From gerrit-no-reply at lists.osmocom.org Tue Aug 1 10:22:35 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 1 Aug 2017 10:22:35 +0000 Subject: osmo-bts[master]: lc-15, sysmo: l1_if: print name on PH-DATA.ind unknwon sapi In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3397 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I007e5f0ce9709026331817e55148749e21d8b015 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Aug 1 10:22:57 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 1 Aug 2017 10:22:57 +0000 Subject: [MERGED] osmo-bts[master]: lc-15, sysmo: l1_if: print name on PH-DATA.ind unknwon sapi In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: lc-15, sysmo: l1_if: print name on PH-DATA.ind unknwon sapi ...................................................................... lc-15, sysmo: l1_if: print name on PH-DATA.ind unknwon sapi Change-Id: I007e5f0ce9709026331817e55148749e21d8b015 --- M src/osmo-bts-litecell15/l1_if.c M src/osmo-bts-sysmo/l1_if.c 2 files changed, 4 insertions(+), 4 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/osmo-bts-litecell15/l1_if.c b/src/osmo-bts-litecell15/l1_if.c index cb3efab..a3b9556 100644 --- a/src/osmo-bts-litecell15/l1_if.c +++ b/src/osmo-bts-litecell15/l1_if.c @@ -934,8 +934,8 @@ chan_nr = chan_nr_by_sapi(&trx->ts[data_ind->u8Tn], data_ind->sapi, data_ind->subCh, data_ind->u8Tn, data_ind->u32Fn); if (!chan_nr) { - LOGP(DL1C, LOGL_ERROR, "PH-DATA-INDICATION for unknown sapi " - "%d\n", data_ind->sapi); + LOGP(DL1C, LOGL_ERROR, "PH-DATA-INDICATION for unknown sapi %s (%d)\n", + get_value_string(lc15bts_l1sapi_names, data_ind->sapi), data_ind->sapi); msgb_free(l1p_msg); return ENOTSUP; } diff --git a/src/osmo-bts-sysmo/l1_if.c b/src/osmo-bts-sysmo/l1_if.c index a4bfffb..781900e 100644 --- a/src/osmo-bts-sysmo/l1_if.c +++ b/src/osmo-bts-sysmo/l1_if.c @@ -929,8 +929,8 @@ chan_nr = chan_nr_by_sapi(&trx->ts[data_ind->u8Tn], data_ind->sapi, data_ind->subCh, data_ind->u8Tn, data_ind->u32Fn); if (!chan_nr) { - LOGP(DL1C, LOGL_ERROR, "PH-DATA-INDICATION for unknown sapi " - "%d\n", data_ind->sapi); + LOGP(DL1C, LOGL_ERROR, "PH-DATA-INDICATION for unknown sapi %s (%d)\n", + get_value_string(femtobts_l1sapi_names, data_ind->sapi), data_ind->sapi); msgb_free(l1p_msg); return ENOTSUP; } -- To view, visit https://gerrit.osmocom.org/3397 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I007e5f0ce9709026331817e55148749e21d8b015 Gerrit-PatchSet: 2 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Tue Aug 1 10:23:08 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 1 Aug 2017 10:23:08 +0000 Subject: [MERGED] libosmo-sccp[master]: sccp: fix possible nullpointer deref In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: sccp: fix possible nullpointer deref ...................................................................... sccp: fix possible nullpointer deref check input parameters local_ip and remote_ip of the function osmo_sccp_simple_client_on_ss7_id() before using them with talloc_strdup() Change-Id: I1a5dd1ea3167513bf9e7ae153f83e1ae3136c905 --- M src/sccp_user.c 1 file changed, 4 insertions(+), 2 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/sccp_user.c b/src/sccp_user.c index c9443a2..89a0320 100644 --- a/src/sccp_user.c +++ b/src/sccp_user.c @@ -331,8 +331,10 @@ goto out_rt; asp_created = true; - asp->cfg.local.host = talloc_strdup(asp, local_ip); - asp->cfg.remote.host = talloc_strdup(asp, remote_ip); + local_ip ? asp->cfg.local.host = + talloc_strdup(asp, local_ip) : NULL; + remote_ip ? asp->cfg.remote.host = + talloc_strdup(asp, remote_ip) : NULL; osmo_ss7_as_add_asp(as, asp->cfg.name); } -- To view, visit https://gerrit.osmocom.org/3354 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I1a5dd1ea3167513bf9e7ae153f83e1ae3136c905 Gerrit-PatchSet: 3 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Tue Aug 1 11:08:04 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 1 Aug 2017 11:08:04 +0000 Subject: libosmo-sccp[master]: sccp: derive local address from given sccp instance In-Reply-To: References: Message-ID: Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3330 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I371dc9132871aad3d8321ea13cf9fd69d76eff8f Gerrit-PatchSet: 3 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Aug 1 11:08:05 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 1 Aug 2017 11:08:05 +0000 Subject: [MERGED] libosmo-sccp[master]: sccp: derive local address from given sccp instance In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: sccp: derive local address from given sccp instance ...................................................................... sccp: derive local address from given sccp instance The most important parts of an SCCP address are the routing indicator and the pointcode. The latter one is always available via the SS7 instance, so a basic local address can be derived from there. Add function osmo_sccp_local_addr_by_instance() to derive a basic local SCCP address from a given SCCP instance Change-Id: I371dc9132871aad3d8321ea13cf9fd69d76eff8f --- M include/osmocom/sigtran/sccp_sap.h M src/sccp_user.c 2 files changed, 26 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/include/osmocom/sigtran/sccp_sap.h b/include/osmocom/sigtran/sccp_sap.h index 24d64d9..732df2a 100644 --- a/include/osmocom/sigtran/sccp_sap.h +++ b/include/osmocom/sigtran/sccp_sap.h @@ -253,3 +253,7 @@ const char *name); const char *osmo_sccp_name_by_addr(const struct osmo_sccp_addr *addr); + +void osmo_sccp_local_addr_by_instance(struct osmo_sccp_addr *dest_addr, + const struct osmo_sccp_instance *inst, + uint32_t ssn); diff --git a/src/sccp_user.c b/src/sccp_user.c index 89a0320..495b6dc 100644 --- a/src/sccp_user.c +++ b/src/sccp_user.c @@ -22,6 +22,7 @@ */ #include +#include #include #include @@ -30,6 +31,7 @@ #include #include #include +#include #include "sccp_internal.h" #include "xua_internal.h" @@ -231,6 +233,26 @@ talloc_free(inst); } +/*! \brief derive a basic local SCCP-Address from a given SCCP instance. + * \param[out] dest_addr pointer to output address memory + * \param[in] inst SCCP instance + * \param[in] ssn Subsystem Number */ +void osmo_sccp_local_addr_by_instance(struct osmo_sccp_addr *dest_addr, + const struct osmo_sccp_instance *inst, + uint32_t ssn) +{ + struct osmo_ss7_instance *ss7; + + OSMO_ASSERT(dest_addr); + OSMO_ASSERT(inst); + ss7 = inst->ss7; + OSMO_ASSERT(ss7); + + *dest_addr = (struct osmo_sccp_addr){}; + + osmo_sccp_make_addr_pc_ssn(dest_addr, ss7->cfg.primary_pc, ssn); +} + /*********************************************************************** * Convenience function for CLIENT ***********************************************************************/ -- To view, visit https://gerrit.osmocom.org/3330 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I371dc9132871aad3d8321ea13cf9fd69d76eff8f Gerrit-PatchSet: 4 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Tue Aug 1 11:09:44 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 1 Aug 2017 11:09:44 +0000 Subject: libosmocore[master]: gsm0480: modify USSD structures to support external handling In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/3374 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I5f8972b86cd4dcb54b643a24b5794a87c8758073 Gerrit-PatchSet: 2 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Alexander Chemeris Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Ivan Kluchnikov Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Aug 1 11:10:35 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 1 Aug 2017 11:10:35 +0000 Subject: libosmocore[master]: gsm0480: modify USSD structures to support external handling In-Reply-To: References: Message-ID: Patch Set 2: -Code-Review in general, what is your strategy for forward/backward compatibility here? you're changing the API and ABI while keeping the symbol name identical, breaking existing applications -- To view, visit https://gerrit.osmocom.org/3374 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I5f8972b86cd4dcb54b643a24b5794a87c8758073 Gerrit-PatchSet: 2 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Alexander Chemeris Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Ivan Kluchnikov Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Aug 1 11:11:59 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 1 Aug 2017 11:11:59 +0000 Subject: libosmocore[master]: gsm0480: refactor the parse_process_uss_req() In-Reply-To: References: Message-ID: Patch Set 3: rather than improving the manually-generated code for USSD/SS parsing, shouldn't we simply move to using asn1c for generaging C code for the SS related ASN.1? -- To view, visit https://gerrit.osmocom.org/3375 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I467f75794c5ac9df75c001245b18bbdfcfaadd88 Gerrit-PatchSet: 3 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Alexander Chemeris Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Ivan Kluchnikov Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Aug 1 13:22:05 2017 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Tue, 1 Aug 2017 13:22:05 +0000 Subject: [PATCH] libosmo-sccp[master]: sccp: add function to check sccp addresses Message-ID: Review at https://gerrit.osmocom.org/3398 sccp: add function to check sccp addresses In order to catch invalid CS7 configurations, It is necessary to check if sccp addresses contain plausible address data. Change-Id: Ic6245288b0171eae10aa708403c1ddb584c92f38 --- M include/osmocom/sigtran/sccp_sap.h M src/sccp_user.c 2 files changed, 44 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-sccp refs/changes/98/3398/1 diff --git a/include/osmocom/sigtran/sccp_sap.h b/include/osmocom/sigtran/sccp_sap.h index 732df2a..90da686 100644 --- a/include/osmocom/sigtran/sccp_sap.h +++ b/include/osmocom/sigtran/sccp_sap.h @@ -257,3 +257,5 @@ void osmo_sccp_local_addr_by_instance(struct osmo_sccp_addr *dest_addr, const struct osmo_sccp_instance *inst, uint32_t ssn); + +bool osmo_sccp_check_addr(struct osmo_sccp_addr *addr, uint32_t presence); diff --git a/src/sccp_user.c b/src/sccp_user.c index 495b6dc..3724eb1 100644 --- a/src/sccp_user.c +++ b/src/sccp_user.c @@ -253,6 +253,48 @@ osmo_sccp_make_addr_pc_ssn(dest_addr, ss7->cfg.primary_pc, ssn); } +/*! \brief check if a given SCCP-Address is consistant. + * \param[in] addr SCCP address to check + * \param[in] presence mask with minimum required address components + * \returns true when address data seems plausible */ +bool osmo_sccp_check_addr(struct osmo_sccp_addr *addr, uint32_t presence) +{ + /* Minimum requirements do not match */ + if ((addr->presence & presence) != presence) + return false; + + /* GT ranges */ + if (addr->presence & OSMO_SCCP_ADDR_T_GT) { + if (addr->gt.gti > 15) + return false; + if (addr->gt.npi > 15) + return false; + if (addr->gt.nai > 127) + return false; + } + + /* Routing by GT, but no GT present */ + if (addr->ri == OSMO_SCCP_RI_GT + && !(addr->presence & OSMO_SCCP_ADDR_T_GT)) + return false; + + /* Routing by PC/SSN, but no PC/SSN present */ + if (addr->ri == OSMO_SCCP_RI_SSN_PC) { + if ((addr->presence & OSMO_SCCP_ADDR_T_PC) == 0) + return false; + if ((addr->presence & OSMO_SCCP_ADDR_T_SSN) == 0) + return false; + } + + if (addr->ri == OSMO_SCCP_RI_SSN_IP) { + if ((addr->presence & OSMO_SCCP_ADDR_T_IPv4) == 0 && + (addr->presence & OSMO_SCCP_ADDR_T_IPv6) == 0) + return false; + } + + return true; +} + /*********************************************************************** * Convenience function for CLIENT ***********************************************************************/ -- To view, visit https://gerrit.osmocom.org/3398 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ic6245288b0171eae10aa708403c1ddb584c92f38 Gerrit-PatchSet: 1 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: dexter From gerrit-no-reply at lists.osmocom.org Tue Aug 1 16:41:59 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 1 Aug 2017 16:41:59 +0000 Subject: [PATCH] openbsc[master]: Fix gsm_pchan2chan_nr() to use RSL_CHAN_OSMO_PDCH Message-ID: Review at https://gerrit.osmocom.org/3399 Fix gsm_pchan2chan_nr() to use RSL_CHAN_OSMO_PDCH When converting from GSM_PCHAN_PDCH, we should generate a RSL channel number IE with the osmocom extension RSL_CHAN_OSMO_PDCH rather than claiming it is a regular TCH/F channel. Change-Id: Ie34219e64a6d89da4a79f2db8ec73d1909fb8280 --- M openbsc/src/libbsc/abis_rsl.c M openbsc/src/libcommon/gsm_data_shared.c 2 files changed, 5 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/99/3399/1 diff --git a/openbsc/src/libbsc/abis_rsl.c b/openbsc/src/libbsc/abis_rsl.c index f4fd6de..18a8072 100644 --- a/openbsc/src/libbsc/abis_rsl.c +++ b/openbsc/src/libbsc/abis_rsl.c @@ -2439,7 +2439,7 @@ dh = (struct abis_rsl_dchan_hdr *) msgb_put(msg, sizeof(*dh)); init_dchan_hdr(dh, msg_type); dh->c.msg_discr = ABIS_RSL_MDISC_DED_CHAN; - dh->chan_nr = gsm_pchan2chan_nr(GSM_PCHAN_PDCH, ts->nr, 0); + dh->chan_nr = gsm_pchan2chan_nr(GSM_PCHAN_TCHF, ts->nr, 0); DEBUGP(DRSL, "%s IPAC PDCH %sACT\n", gsm_ts_name(ts), act ? "" : "DE"); diff --git a/openbsc/src/libcommon/gsm_data_shared.c b/openbsc/src/libcommon/gsm_data_shared.c index 8992636..6302e05 100644 --- a/openbsc/src/libcommon/gsm_data_shared.c +++ b/openbsc/src/libcommon/gsm_data_shared.c @@ -643,11 +643,14 @@ switch (pchan) { case GSM_PCHAN_TCH_F: - case GSM_PCHAN_PDCH: case GSM_PCHAN_TCH_F_PDCH: OSMO_ASSERT(lchan_nr == 0); cbits = 0x01; break; + case GSM_PCHAN_PDCH: + OSMO_ASSERT(lchan_nr == 0); + cbits = RSL_CHAN_OSMO_PDCH >> 3; + break; case GSM_PCHAN_TCH_H: OSMO_ASSERT(lchan_nr < 2); cbits = 0x02; -- To view, visit https://gerrit.osmocom.org/3399 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ie34219e64a6d89da4a79f2db8ec73d1909fb8280 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Tue Aug 1 17:10:22 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 1 Aug 2017 17:10:22 +0000 Subject: [PATCH] openbsc[master]: SGSN: Fix RAN information exposed on GTP during PDP CTX CREATE Message-ID: Review at https://gerrit.osmocom.org/3400 SGSN: Fix RAN information exposed on GTP during PDP CTX CREATE In the PDP Context Create from SGSN to GGSN, we include information about the RAN type (GERAN/UTRAN) and the Cell of the MS. This was all hard-coded to GERAN, and wasn't updated when we added UTRAN support to the SGSN. Change-Id: I6c79e42c5e08b28fe8182555302a5505fbbaa313 --- M openbsc/src/gprs/sgsn_libgtp.c 1 file changed, 14 insertions(+), 4 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/00/3400/1 diff --git a/openbsc/src/gprs/sgsn_libgtp.c b/openbsc/src/gprs/sgsn_libgtp.c index 387b95f..e90b66d 100644 --- a/openbsc/src/gprs/sgsn_libgtp.c +++ b/openbsc/src/gprs/sgsn_libgtp.c @@ -251,9 +251,12 @@ memcpy(pdp->gsnlu.v, &sgsn->cfg.gtp_listenaddr.sin_addr, sizeof(sgsn->cfg.gtp_listenaddr.sin_addr)); - /* Assume we are a GERAN system */ + /* Encode RAT Type according to TS 29.060 7.7.50 */ pdp->rattype.l = 1; - pdp->rattype.v[0] = 2; + if (mmctx->ran_type == MM_CTX_T_UTRAN_Iu) + pdp->rattype.v[0] = 1; + else + pdp->rattype.v[0] = 2; pdp->rattype_given = 1; /* Include RAI and ULI all the time */ @@ -264,10 +267,17 @@ raid.rac = 0xFF; gsm48_construct_ra(pdp->rai.v, &raid); + /* Encode User Location Information accordint to TS 29.060 7.7.51 */ pdp->userloc_given = 1; pdp->userloc.l = 8; - pdp->userloc.v[0] = 0; /* CGI for GERAN */ - bssgp_create_cell_id(&pdp->userloc.v[1], &mmctx->ra, mmctx->gb.cell_id); + if (mmctx->ran_type == MM_CTX_T_UTRAN_Iu) { + pdp->userloc.v[0] = 1; /* SAI for UTRAN */ + /* SAI is like CGI but with SAC instead of CID, so we can abuse this function */ + bssgp_create_cell_id(&pdp->userloc.v[1], &mmctx->ra, mmctx->iu.sac); + } else { + pdp->userloc.v[0] = 0; /* CGI for GERAN */ + bssgp_create_cell_id(&pdp->userloc.v[1], &mmctx->ra, mmctx->gb.cell_id); + } /* include the IMEI(SV) */ pdp->imeisv_given = 1; -- To view, visit https://gerrit.osmocom.org/3400 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I6c79e42c5e08b28fe8182555302a5505fbbaa313 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Tue Aug 1 21:23:18 2017 From: gerrit-no-reply at lists.osmocom.org (Alexander Chemeris) Date: Tue, 1 Aug 2017 21:23:18 +0000 Subject: libosmocore[master]: gsm0480: modify USSD structures to support external handling In-Reply-To: References: Message-ID: Patch Set 2: > in general, what is your strategy for forward/backward > compatibility here? you're changing the API and ABI while keeping > the symbol name identical, breaking existing applications Should we just bump the lib version? Otherwise we'll have to maintain two similar structures and similar, but different set of functions to operate them, which looks like an overkill here given there is only one user of this code - *#100# in osmo-nitb. As a general comment, these patches are supposed to pave the way to more patches to osmo-nitb to allow communicating un-parsed SS/USSD to an external application. Thus splitting structures and functions in a way when we can avoid parsing the whole SS/USSD request every time. -- To view, visit https://gerrit.osmocom.org/3374 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I5f8972b86cd4dcb54b643a24b5794a87c8758073 Gerrit-PatchSet: 2 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Alexander Chemeris Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Ivan Kluchnikov Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Aug 2 11:45:18 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Wed, 2 Aug 2017 11:45:18 +0000 Subject: [PATCH] osmo-gsm-tester[master]: Add minimal USSD support to test extension number Message-ID: Review at https://gerrit.osmocom.org/3401 Add minimal USSD support to test extension number Change-Id: Ib19331f9c6476ac01bf729790dfd63c56de86a89 --- M example/default-suites.conf M src/osmo_gsm_tester/ofono_client.py A suites/aoip_ussd/assert_extension.py A suites/aoip_ussd/suite.conf A suites/ussd/assert_extension.py A suites/ussd/suite.conf 6 files changed, 89 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-tester refs/changes/01/3401/1 diff --git a/example/default-suites.conf b/example/default-suites.conf index eba7dea..b0df113 100644 --- a/example/default-suites.conf +++ b/example/default-suites.conf @@ -4,3 +4,7 @@ - aoip_sms:trx - smpp - aoip_smpp +- ussd:sysmo +- aoip_ussd:sysmo +- ussd:trx +- aoip_ussd:trx diff --git a/src/osmo_gsm_tester/ofono_client.py b/src/osmo_gsm_tester/ofono_client.py index 60f98df..7732486 100644 --- a/src/osmo_gsm_tester/ofono_client.py +++ b/src/osmo_gsm_tester/ofono_client.py @@ -37,6 +37,7 @@ I_MODEM = 'org.ofono.Modem' I_NETREG = 'org.ofono.NetworkRegistration' I_SMS = 'org.ofono.MessageManager' +I_SS = 'org.ofono.SupplementaryServices' # See https://github.com/intgr/ofono/blob/master/doc/network-api.txt#L78 NETREG_ST_REGISTERED = 'registered' @@ -530,6 +531,11 @@ return True return False + def ussd_send(self, command): + ss = self.dbus.interface(I_SS) + service_type, response = ss.Initiate(command) + return response + def info(self, keys=('Manufacturer', 'Model', 'Revision')): props = self.properties() return ', '.join(['%s: %r'%(k,props.get(k)) for k in keys]) diff --git a/suites/aoip_ussd/assert_extension.py b/suites/aoip_ussd/assert_extension.py new file mode 100755 index 0000000..da5dad3 --- /dev/null +++ b/suites/aoip_ussd/assert_extension.py @@ -0,0 +1,36 @@ +#!/usr/bin/env python3 +from osmo_gsm_tester.test import * + +USSD_COMMAND_GET_EXTENSION = '*#100#' + +hlr = suite.hlr() +bts = suite.bts() +mgcpgw = suite.mgcpgw(bts_ip=bts.remote_addr()) +msc = suite.msc(hlr, mgcpgw) +bsc = suite.bsc(msc) +stp = suite.stp() +ms = suite.modem() + +hlr.start() +stp.start() +msc.start() +mgcpgw.start() + +bsc.bts_add(bts) +bsc.start() + +bts.start() + +hlr.subscriber_add(ms) + +ms.connect(msc.mcc_mnc()) + +ms.log_info() + +print('waiting for modems to attach...') +wait(ms.is_connected, msc.mcc_mnc()) +wait(msc.subscriber_attached, ms) + +print('Sending ussd code %s' % USSD_COMMAND_GET_EXTENSION) +response = ms.ussd_send(USSD_COMMAND_GET_EXTENSION) +assert ' ' + ms.msisdn + '\r' in response diff --git a/suites/aoip_ussd/suite.conf b/suites/aoip_ussd/suite.conf new file mode 100644 index 0000000..8e0a684 --- /dev/null +++ b/suites/aoip_ussd/suite.conf @@ -0,0 +1,7 @@ +resources: + ip_address: + - times: 5 # msc, bsc, hlr, stp, mgw + bts: + - times: 1 + modem: + - times: 1 diff --git a/suites/ussd/assert_extension.py b/suites/ussd/assert_extension.py new file mode 100755 index 0000000..4e2e0e1 --- /dev/null +++ b/suites/ussd/assert_extension.py @@ -0,0 +1,26 @@ +#!/usr/bin/env python3 +from osmo_gsm_tester.test import * + +USSD_COMMAND_GET_EXTENSION = '*#100#' + +nitb = suite.nitb() +bts = suite.bts() +ms = suite.modem() + +print('start nitb and bts...') +nitb.bts_add(bts) +nitb.start() +bts.start() + +nitb.subscriber_add(ms) + +ms.connect(nitb.mcc_mnc()) +ms.log_info() + +print('waiting for modems to attach...') +wait(ms.is_connected, nitb.mcc_mnc()) +wait(nitb.subscriber_attached, ms) + +print('Sending ussd code %s' % USSD_COMMAND_GET_EXTENSION) +response = ms.ussd_send(USSD_COMMAND_GET_EXTENSION) +assert ' ' + ms.msisdn + '\r' in response diff --git a/suites/ussd/suite.conf b/suites/ussd/suite.conf new file mode 100644 index 0000000..eb59abb --- /dev/null +++ b/suites/ussd/suite.conf @@ -0,0 +1,10 @@ +resources: + ip_address: + - times: 1 + bts: + - times: 1 + modem: + - times: 1 + +defaults: + timeout: 60s -- To view, visit https://gerrit.osmocom.org/3401 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ib19331f9c6476ac01bf729790dfd63c56de86a89 Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Wed Aug 2 11:45:19 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Wed, 2 Aug 2017 11:45:19 +0000 Subject: [PATCH] osmo-gsm-tester[master]: ussd: Workaround ofono issue to prevent test failure Message-ID: Review at https://gerrit.osmocom.org/3402 ussd: Workaround ofono issue to prevent test failure Change-Id: I72f68bc980e6421a65f7d33712a587da340698e5 --- M suites/aoip_ussd/assert_extension.py M suites/ussd/assert_extension.py 2 files changed, 20 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-tester refs/changes/02/3402/1 diff --git a/suites/aoip_ussd/assert_extension.py b/suites/aoip_ussd/assert_extension.py index da5dad3..9046c14 100755 --- a/suites/aoip_ussd/assert_extension.py +++ b/suites/aoip_ussd/assert_extension.py @@ -31,6 +31,16 @@ wait(ms.is_connected, msc.mcc_mnc()) wait(msc.subscriber_attached, ms) +# ofono (qmi) currently changes state to 'registered' jut after sending +# 'Location Update Request', but before receiving 'Location Updating Accept'. +# Which means we can reach lines below and send USSD code while still not being +# attached, which will then fail. See OsmoGsmTester #2239 for more detailed +# information. +# Until we find an ofono fix or a better way to workaround this, let's just +# sleep for a while in order to reveie the 'Location Updating Accept' message +# before attemting to send the USSD. +sleep(10) + print('Sending ussd code %s' % USSD_COMMAND_GET_EXTENSION) response = ms.ussd_send(USSD_COMMAND_GET_EXTENSION) assert ' ' + ms.msisdn + '\r' in response diff --git a/suites/ussd/assert_extension.py b/suites/ussd/assert_extension.py index 4e2e0e1..f61db2f 100755 --- a/suites/ussd/assert_extension.py +++ b/suites/ussd/assert_extension.py @@ -21,6 +21,16 @@ wait(ms.is_connected, nitb.mcc_mnc()) wait(nitb.subscriber_attached, ms) +# ofono (qmi) currently changes state to 'registered' jut after sending +# 'Location Update Request', but before receiving 'Location Updating Accept'. +# Which means we can reach lines below and send USSD code while still not being +# attached, which will then fail. See OsmoGsmTester #2239 for more detailed +# information. +# Until we find an ofono fix or a better way to workaround this, let's just +# sleep for a while in order to reveie the 'Location Updating Accept' message +# before attemting to send the USSD. +sleep(10) + print('Sending ussd code %s' % USSD_COMMAND_GET_EXTENSION) response = ms.ussd_send(USSD_COMMAND_GET_EXTENSION) assert ' ' + ms.msisdn + '\r' in response -- To view, visit https://gerrit.osmocom.org/3402 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I72f68bc980e6421a65f7d33712a587da340698e5 Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Wed Aug 2 11:48:43 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Wed, 2 Aug 2017 11:48:43 +0000 Subject: osmo-gsm-tester[master]: ussd: Workaround ofono issue to prevent test failure In-Reply-To: References: Message-ID: Patch Set 1: I tested both ussd and aoip_ussd. With this patch it seems to pass all the times I tried. See issue https://osmocom.org/issues/2239 for followup on the issue. -- To view, visit https://gerrit.osmocom.org/3402 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I72f68bc980e6421a65f7d33712a587da340698e5 Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: neels Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Aug 2 13:15:16 2017 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Wed, 2 Aug 2017 13:15:16 +0000 Subject: osmo-bts[master]: L1SAP: Use RSL_CHAN_OSMO_PDCH across L1SAP In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+1 Verified+1 I have tested with the following two timsolt configurations: ---------8<--------- trx 0 rf_locked 0 arfcn 866 nominal power 23 max_power_red 22 rsl e1 tei 0 timeslot 0 phys_chan_config CCCH+SDCCH4 hopping enabled 0 timeslot 1 phys_chan_config SDCCH8 hopping enabled 0 timeslot 2 phys_chan_config TCH/F_PDCH hopping enabled 0 timeslot 3 phys_chan_config TCH/F_PDCH hopping enabled 0 timeslot 4 phys_chan_config SDCCH8 hopping enabled 0 timeslot 5 phys_chan_config SDCCH8 hopping enabled 0 timeslot 6 phys_chan_config SDCCH8 hopping enabled 0 timeslot 7 phys_chan_config SDCCH8 hopping enabled 0 ---------8<--------- ---------8<--------- trx 0 rf_locked 0 arfcn 866 nominal power 23 max_power_red 22 rsl e1 tei 0 timeslot 0 phys_chan_config CCCH+SDCCH4 hopping enabled 0 timeslot 1 phys_chan_config SDCCH8 hopping enabled 0 timeslot 2 phys_chan_config TCH/F_TCH/H_PDCH hopping enabled 0 timeslot 3 phys_chan_config SDCCH8 hopping enabled 0 timeslot 4 phys_chan_config SDCCH8 hopping enabled 0 timeslot 5 phys_chan_config SDCCH8 hopping enabled 0 timeslot 6 phys_chan_config SDCCH8 hopping enabled 0 timeslot 7 phys_chan_config SDCCH8 hopping enabled 0 ---------8<--------- The test included a phone call from one mobile to the other on the same cell, in both cases this will force the BTS to disconnect the PDCH and reconnect the TS as voice channels. While making the call, internet access was blocked (expected) and after finishing the call internet access was available again. >From the perspective of dynamic TS, I do not see any problems here. -- To view, visit https://gerrit.osmocom.org/3393 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Iaaa833febe45b82166d3901f10cc5466a7591c19 Gerrit-PatchSet: 2 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: dexter Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Aug 2 23:37:10 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 2 Aug 2017 23:37:10 +0000 Subject: [PATCH] openggsn[master]: ippool: Add IPv6 support to IP pool implementation Message-ID: Review at https://gerrit.osmocom.org/3403 ippool: Add IPv6 support to IP pool implementation Change-Id: Ib98cc4bf634d6be9a7bf8c03a24e629455fcafc8 --- M ggsn/ggsn.c M ggsn/gtp-kernel.c M ggsn/gtp-kernel.h M lib/Makefile.am A lib/in46_addr.c A lib/in46_addr.h M lib/ippool.c M lib/ippool.h M sgsnemu/sgsnemu.c 9 files changed, 372 insertions(+), 169 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openggsn refs/changes/03/3403/1 diff --git a/ggsn/ggsn.c b/ggsn/ggsn.c index 4d07f11..00c7174 100644 --- a/ggsn/ggsn.c +++ b/ggsn/ggsn.c @@ -56,6 +56,7 @@ #include "../lib/tun.h" #include "../lib/ippool.h" #include "../lib/syserr.h" +#include "../lib/in46_addr.h" #include "../gtp/pdp.h" #include "../gtp/gtp.h" #include "cmdline.h" @@ -65,7 +66,8 @@ int maxfd = 0; /* For select() */ struct in_addr listen_; -struct in_addr netaddr, destaddr, net, mask; /* Network interface */ +struct in_addr netaddr, destaddr, net; /* Network interface */ +size_t prefixlen; struct in_addr dns1, dns2; /* PCO DNS address */ char *ipup, *ipdown; /* Filename of scripts */ int debug; /* Print debug output */ @@ -135,9 +137,12 @@ static bool send_trap(const struct gsn_t *gsn, const struct pdp_t *pdp, const struct ippoolm_t *member, const char *var) { + char addrbuf[256]; char val[NAMESIZE]; - snprintf(val, sizeof(val), "%" PRIu64 ",%s", pdp->imsi, inet_ntoa(member->addr)); + const char *addrstr = in46a_ntop(&member->addr, addrbuf, sizeof(addrbuf)); + + snprintf(val, sizeof(val), "%" PRIu64 ",%s", pdp->imsi, addrstr); if (ctrl_cmd_send_trap(gsn->ctrl, var, val) < 0) { LOGP(DGGSN, LOGL_ERROR, "Failed to create and send TRAP for IMSI %" PRIu64 " [%s].\n", pdp->imsi, var); @@ -168,7 +173,7 @@ int create_context_ind(struct pdp_t *pdp) { - struct in_addr addr; + struct in46_addr addr; struct ippoolm_t *member; DEBUGP(DGGSN, "Received create PDP context request\n"); @@ -181,8 +186,8 @@ memcpy(pdp->qos_neg.v, pdp->qos_req.v, pdp->qos_req.l); /* TODO */ pdp->qos_neg.l = pdp->qos_req.l; - if (pdp_euaton(&pdp->eua, &addr)) { - addr.s_addr = 0; /* Request dynamic */ + if (pdp_euaton(&pdp->eua, &addr.v4)) { + addr.v4.s_addr = 0; /* Request dynamic */ } if (ippool_newip(ippool, &member, &addr, 0)) { @@ -190,7 +195,7 @@ return 0; /* Allready in use, or no more available */ } - pdp_ntoeua(&member->addr, &pdp->eua); + pdp_ntoeua(&member->addr.v4, &pdp->eua); pdp->peer = member; pdp->ipif = tun; /* TODO */ member->peer = pdp; @@ -213,10 +218,18 @@ int cb_tun_ind(struct tun_t *tun, void *pack, unsigned len) { struct ippoolm_t *ipm; - struct in_addr dst; + struct in46_addr dst; struct tun_packet_t *iph = (struct tun_packet_t *)pack; - dst.s_addr = iph->dst; + if (iph->ver == 4) { + if (len < sizeof(*iph) || len < 4*iph->ihl) + return -1; + dst.len = 4; + dst.v4.s_addr = iph->dst; + } else { + LOGP(DGGSN, LOGL_NOTICE, "non-IPv4 packet received from tun\n"); + return -1; + } DEBUGP(DGGSN, "Received packet from tun!\n"); @@ -381,12 +394,14 @@ /* net */ /* Store net as in_addr net and mask */ if (args_info.net_arg) { - if (ippool_aton(&net, &mask, args_info.net_arg, 0)) { + struct in46_addr in46; + if (ippool_aton(&in46, &prefixlen, args_info.net_arg, 0)) { SYS_ERR(DGGSN, LOGL_ERROR, 0, "Invalid network address: %s!", args_info.net_arg); exit(1); } + net.s_addr = in46.v4.s_addr; netaddr.s_addr = htonl(ntohl(net.s_addr) + 1); destaddr.s_addr = htonl(ntohl(net.s_addr) + 1); } else { @@ -545,7 +560,7 @@ maxfd = gsn->fd1u; /* use GTP kernel module for data packet encapsulation */ - if (gtp_kernel_init(gsn, &net, &mask, &args_info) < 0) + if (gtp_kernel_init(gsn, &net, prefixlen, &args_info) < 0) goto err; gtp_set_cb_data_ind(gsn, encaps_tun); @@ -570,7 +585,7 @@ } DEBUGP(DGGSN, "Setting tun IP address\n"); - if (tun_setaddr(tun, &netaddr, &destaddr, &mask)) { + if (tun_setaddr(tun, &netaddr, &destaddr, &prefixlen)) { SYS_ERR(DGGSN, LOGL_ERROR, 0, "Failed to set tun IP address"); exit(1); } diff --git a/ggsn/gtp-kernel.c b/ggsn/gtp-kernel.c index dbe5a9f..458ac27 100644 --- a/ggsn/gtp-kernel.c +++ b/ggsn/gtp-kernel.c @@ -70,17 +70,6 @@ printf("\n"); } -static int mask2prefix(struct in_addr *mask) -{ - uint32_t tmp = ntohl(mask->s_addr); - int k; - - for (k=0; tmp > 0; k++) - tmp = (tmp << 1); - - return k; -} - static struct { int genl_id; struct mnl_socket *nl; @@ -91,7 +80,7 @@ #define GTP_DEVNAME "gtp0" int gtp_kernel_init(struct gsn_t *gsn, struct in_addr *net, - struct in_addr *mask, + size_t prefixlen, struct gengetopt_args_info *args_info) { if (!args_info->gtp_linux_given) @@ -126,7 +115,7 @@ DEBUGP(DGGSN, "Setting route to reach %s via %s\n", args_info->net_arg, GTP_DEVNAME); - if (gtp_dev_config(GTP_DEVNAME, net, mask2prefix(mask)) < 0) { + if (gtp_dev_config(GTP_DEVNAME, net, prefixlen) < 0) { SYS_ERR(DGGSN, LOGL_ERROR, 0, "Cannot add route to reach network %s\n", args_info->net_arg); diff --git a/ggsn/gtp-kernel.h b/ggsn/gtp-kernel.h index 83280a0..b3b29e3 100644 --- a/ggsn/gtp-kernel.h +++ b/ggsn/gtp-kernel.h @@ -8,7 +8,7 @@ #ifdef GTP_KERNEL int gtp_kernel_init(struct gsn_t *gsn, struct in_addr *net, - struct in_addr *mask, + size_t prefixlen, struct gengetopt_args_info *args_info); void gtp_kernel_stop(void); @@ -19,7 +19,7 @@ #else static inline int gtp_kernel_init(struct gsn_t *gsn, struct in_addr *net, - struct in_addr *mask, + size_t prefixlen, struct gengetopt_args_info *args_info) { if (args_info->gtp_linux_given) { diff --git a/lib/Makefile.am b/lib/Makefile.am index 756d566..632990c 100644 --- a/lib/Makefile.am +++ b/lib/Makefile.am @@ -1,7 +1,7 @@ noinst_LIBRARIES = libmisc.a -noinst_HEADERS = gnugetopt.h ippool.h lookup.h syserr.h tun.h +noinst_HEADERS = gnugetopt.h ippool.h lookup.h syserr.h tun.h in46_addr.h AM_CFLAGS = -O2 -fno-builtin -Wall -DSBINDIR='"$(sbindir)"' -ggdb $(LIBOSMOCORE_CFLAGS) -libmisc_a_SOURCES = getopt1.c getopt.c ippool.c lookup.c tun.c debug.c +libmisc_a_SOURCES = getopt1.c getopt.c ippool.c lookup.c tun.c debug.c in46_addr.c diff --git a/lib/in46_addr.c b/lib/in46_addr.c new file mode 100644 index 0000000..f9bb020 --- /dev/null +++ b/lib/in46_addr.c @@ -0,0 +1,148 @@ +/* + * IPv4/v6 address functions. + * Copyright (C) 2017 by Harald Welte + * + * The contents of this file may be used under the terms of the GNU + * General Public License Version 2, provided that the above copyright + * notice and this permission notice is included in all copies or + * substantial portions of the software. + * + */ + +#include "lib/in46_addr.h" + +#include +#include +#include +#include +#include +#include +#include + +/*! Return the address family of given \reff in46_addr argument */ +int in46a_to_af(const struct in46_addr *in) +{ + switch (in->len) { + case 4: + return AF_INET; + case 16: + return AF_INET6; + default: + return -1; + } +} + +/*! Convert \ref in46_addr to sockaddr_storage */ +int in46a_to_sas(struct sockaddr_storage *out, const struct in46_addr *in) +{ + struct sockaddr_in *sin = (struct sockaddr_in *)out; + struct sockaddr_in6 *sin6 = (struct sockaddr_in6 *)out; + + switch (in->len) { + case 4: + sin->sin_family = AF_INET; + sin->sin_addr = in->v4; + break; + case 16: + sin6->sin6_family = AF_INET; + sin6->sin6_addr = in->v6; + break; + default: + return -1; + } + + return 0; +} + +/*! Convenience wrapper around inet_ntop() for \ref in46_addr */ +const char *in46a_ntop(const struct in46_addr *in, char *dst, socklen_t dst_size) +{ + int af = in46a_to_af(in); + if (af < 0) + return NULL; + + return inet_ntop(af, (const void *) &in->v4, dst, dst_size); +} + +/*! Determine if two in46_addr are equal or not + * \returns 1 in case they are equal; 0 otherwise */ +int in46a_equal(const struct in46_addr *a, const struct in46_addr *b) +{ + if (a->len == b->len && !memcmp(&a->v6, &b->v6, a->len)) + return 1; + else + return 0; +} + +/*! Match if IPv6 addr1 + addr2 are within same \a mask */ +static int ipv6_within_mask(const struct in6_addr *addr1, const struct in6_addr *addr2, + const struct in6_addr *mask) +{ + struct in6_addr masked = *addr2; +#if defined(__linux__) + masked.s6_addr32[0] &= mask->s6_addr32[0]; + masked.s6_addr32[1] &= mask->s6_addr32[1]; + masked.s6_addr32[2] &= mask->s6_addr32[2]; + masked.s6_addr32[3] &= mask->s6_addr32[3]; +#else + masked.__u6_addr.__u6_addr32[0] &= mask->__u6_addr.__u6_addr32[0]; + masked.__u6_addr.__u6_addr32[1] &= mask->__u6_addr.__u6_addr32[1]; + masked.__u6_addr.__u6_addr32[2] &= mask->__u6_addr.__u6_addr32[2]; + masked.__u6_addr.__u6_addr32[3] &= mask->__u6_addr.__u6_addr32[3]; +#endif + if (!memcmp(addr1, &masked, sizeof(struct in6_addr))) + return 1; + else + return 0; +} + +/*! Create an IPv6 netmask from the given prefix length */ +static void create_ipv6_netmask(struct in6_addr *netmask, int prefixlen) +{ + uint32_t *p_netmask; + memset(netmask, 0, sizeof(struct in6_addr)); + if (prefixlen < 0) + prefixlen = 0; + else if (128 < prefixlen) + prefixlen = 128; + +#if defined(__linux__) + p_netmask = &netmask->s6_addr32[0]; +#else + p_netmask = &netmask->__u6_addr.__u6_addr32[0]; +#endif + while (32 < prefixlen) { + *p_netmask = 0xffffffff; + p_netmask++; + prefixlen -= 32; + } + if (prefixlen != 0) { + *p_netmask = htonl(0xFFFFFFFF << (32 - prefixlen)); + } +} + +/*! Determine if given \a addr is within given \a net + \a prefixlen + * Builds the netmask from \a net + \a prefixlen and matches it to \a addr + * \returns 1 in case of a match, 0 otherwise */ +int in46a_within_mask(const struct in46_addr *addr, const struct in46_addr *net, size_t prefixlen) +{ + struct in_addr netmask; + struct in6_addr netmask6; + + if (addr->len != net->len) + return 0; + + switch (addr->len) { + case 4: + netmask.s_addr = htonl(0xFFFFFFFF << (32 - prefixlen)); + if ((addr->v4.s_addr & netmask.s_addr) == net->v4.s_addr) + return 1; + else + return 0; + case 16: + create_ipv6_netmask(&netmask6, prefixlen); + return ipv6_within_mask(&addr->v6, &net->v6, &netmask6); + default: + return 0; + } +} diff --git a/lib/in46_addr.h b/lib/in46_addr.h new file mode 100644 index 0000000..f28fd8e --- /dev/null +++ b/lib/in46_addr.h @@ -0,0 +1,19 @@ +#pragma once +#include +#include + +/* a simple wrapper around an in6_addr to also contain the length of the address, + * thereby implicitly indicating the address family of the address */ +struct in46_addr { + uint8_t len; + union { + struct in_addr v4; + struct in6_addr v6; + }; +}; + +extern int in46a_to_af(const struct in46_addr *in); +extern int in46a_to_sas(struct sockaddr_storage *out, const struct in46_addr *in); +extern const char *in46a_ntop(const struct in46_addr *in, char *dst, socklen_t dst_size); +extern int in46a_equal(const struct in46_addr *a, const struct in46_addr *b); +extern int in46a_within_mask(const struct in46_addr *addr, const struct in46_addr *net, size_t prefixlen); diff --git a/lib/ippool.c b/lib/ippool.c index 1f79a77..6c43ad7 100644 --- a/lib/ippool.c +++ b/lib/ippool.c @@ -1,6 +1,7 @@ /* * IP address pool functions. * Copyright (C) 2003, 2004 Mondru AB. + * Copyright (C) 2017 by Harald Welte * * The contents of this file may be used under the terms of the GNU * General Public License Version 2, provided that the above copyright @@ -13,9 +14,11 @@ #include /* in_addr */ #include /* calloc */ #include /* sscanf */ +#include #include #include #include +#include #include "syserr.h" #include "ippool.h" #include "lookup.h" @@ -31,13 +34,14 @@ printf("Listsize %d\n", this->listsize); for (n = 0; n < this->listsize; n++) { - printf("Unit %d inuse %d prev %d next %d addr %s %x\n", + char s[256]; + in46a_ntop(&this->member[n].addr, s, sizeof(s)); + printf("Unit %d inuse %d prev %d next %d addr %s\n", n, this->member[n].inuse, this->member[n].prev - this->member, this->member[n].next - this->member, - inet_ntoa(this->member[n].addr), - this->member[n].addr.s_addr); + s); } return 0; } @@ -49,7 +53,7 @@ struct ippoolm_t *p_prev = NULL; /* Insert into hash table */ - hash = ippool_hash4(&member->addr) & this->hashmask; + hash = ippool_hash(&member->addr) & this->hashmask; for (p = this->hash[hash]; p; p = p->nexthash) p_prev = p; if (!p_prev) @@ -66,7 +70,7 @@ struct ippoolm_t *p_prev = NULL; /* Find in hash table */ - hash = ippool_hash4(&member->addr) & this->hashmask; + hash = ippool_hash(&member->addr) & this->hashmask; for (p = this->hash[hash]; p; p = p->nexthash) { if (p == member) { break; @@ -88,73 +92,98 @@ return 0; } -unsigned long int ippool_hash4(struct in_addr *addr) +static unsigned long int ippool_hash4(struct in_addr *addr) { return lookup((unsigned char *)&addr->s_addr, sizeof(addr->s_addr), 0); } -#ifndef IPPOOL_NOIP6 -unsigned long int ippool_hash6(struct in6_addr *addr) +static unsigned long int ippool_hash6(struct in6_addr *addr) { - return lookup((unsigned char *)addr->u6_addr8, sizeof(addr->u6_addr8), + /* TODO: Review hash spread for IPv6 */ + return lookup((unsigned char *)addr->s6_addr, sizeof(addr->s6_addr), 0); } -#endif + +unsigned long int ippool_hash(struct in46_addr *addr) +{ + if (addr->len == 4) + return ippool_hash4(&addr->v4); + else + return ippool_hash6(&addr->v6); +} /* Get IP address and mask */ -int ippool_aton(struct in_addr *addr, struct in_addr *mask, - char *pool, int number) +int ippool_aton(struct in46_addr *addr, size_t *prefixlen, const char *pool_in, int number) { + struct addrinfo *ai; + struct addrinfo hints = { + .ai_family = AF_UNSPEC, + .ai_socktype = SOCK_DGRAM, + .ai_flags = 0, + .ai_protocol = 0 + }; + char *pool = alloca(strlen(pool_in)+1); - /* Parse only first instance of network for now */ - /* Eventually "number" will indicate the token which we want to parse */ + strcpy(pool, pool_in); - unsigned int a1, a2, a3, a4; - unsigned int m1, m2, m3, m4; - int c; - int m; - int masklog; + int err; - c = sscanf(pool, "%u.%u.%u.%u/%u.%u.%u.%u", - &a1, &a2, &a3, &a4, &m1, &m2, &m3, &m4); - switch (c) { - case 4: - mask->s_addr = 0xffffffff; - break; - case 5: - if (m1 > 32) { - SYS_ERR(DIP, LOGL_ERROR, 0, "Invalid mask"); - return -1; /* Invalid mask */ + /* Find '/' and point to first char after it */ + char *prefixlen_str = strchr(pool, '/'); + if (prefixlen_str) { + *prefixlen_str = '\0'; + prefixlen_str++; + if (*prefixlen_str == '\0') { + SYS_ERR(DIP, LOGL_ERROR, 0, "Empty prefix length specified"); + return -1; } - mask->s_addr = htonl(0xffffffff << (32 - m1)); - break; - case 8: - if (m1 >= 256 || m2 >= 256 || m3 >= 256 || m4 >= 256) { - SYS_ERR(DIP, LOGL_ERROR, 0, "Invalid mask"); - return -1; /* Wrong mask format */ - } - m = m1 * 0x1000000 + m2 * 0x10000 + m3 * 0x100 + m4; - for (masklog = 0; ((1 << masklog) < ((~m) + 1)); masklog++) ; - if (((~m) + 1) != (1 << masklog)) { - SYS_ERR(DIP, LOGL_ERROR, 0, "Invalid mask"); - return -1; /* Wrong mask format (not all ones followed by all zeros) */ - } - mask->s_addr = htonl(m); - break; - default: - SYS_ERR(DIP, LOGL_ERROR, 0, "Invalid mask"); - return -1; /* Invalid mask */ } - if (a1 >= 256 || a2 >= 256 || a3 >= 256 || a4 >= 256) { - SYS_ERR(DIP, LOGL_ERROR, 0, - "Wrong IP address format"); + /* convert address */ + if ((err = getaddrinfo(pool, NULL, &hints, &ai))) { + SYS_ERR(DIP, LOGL_ERROR, 0, "Bad address"); return -1; - } else - addr->s_addr = - htonl(a1 * 0x1000000 + a2 * 0x10000 + a3 * 0x100 + a4); + } + + /* Copy address, set lengths */ + if (ai->ai_family == AF_INET) { + *prefixlen = 32; + addr->len = sizeof(struct in_addr); + addr->v4 = ((struct sockaddr_in*)ai->ai_addr)->sin_addr; + } else { + *prefixlen = 128; + addr->len = sizeof(struct in6_addr); + addr->v6 = ((struct sockaddr_in6*)ai->ai_addr)->sin6_addr; + } + freeaddrinfo(ai); + + /* parse prefixlen */ + if (prefixlen_str) { + char *e; + *prefixlen = strtol(prefixlen_str, &e, 10); + if (*e != '\0') { + SYS_ERR(DIP, LOGL_ERROR, 0, "Prefixlen is not an int"); + return -1; + } + } + + if (*prefixlen > (addr->len * 8)) { + SYS_ERR(DIP, LOGL_ERROR, 0, "Perfixlen too big"); + return -1; + } return 0; +} + +/* Increase IPv4/IPv6 address by 1 */ +void in46a_inc(struct in46_addr *addr) +{ + size_t addrlen; + uint8_t *a = (uint8_t *)&addr->v6; + for (addrlen = addr->len; addrlen > 0; addrlen--) { + if (++a[addrlen-1]) + break; + } } /* Create new address pool */ @@ -165,11 +194,10 @@ /* Parse only first instance of pool for now */ int i; - struct in_addr addr; - struct in_addr mask; - struct in_addr stataddr; - struct in_addr statmask; - unsigned int m; + struct in46_addr addr; + size_t addrprefixlen; + struct in46_addr stataddr; + size_t stataddrprefixlen; int listsize; int dynsize; unsigned int statsize; @@ -177,7 +205,7 @@ if (!allowdyn) { dynsize = 0; } else { - if (ippool_aton(&addr, &mask, dyn, 0)) { + if (ippool_aton(&addr, &addrprefixlen, dyn, 0)) { SYS_ERR(DIP, LOGL_ERROR, 0, "Failed to parse dynamic pool"); return -1; @@ -188,8 +216,7 @@ flags |= IPPOOL_NONETWORK; } - m = ntohl(mask.s_addr); - dynsize = ((~m) + 1); + dynsize = (1 << (addr.len*8 - addrprefixlen)) -1; if (flags & IPPOOL_NONETWORK) /* Exclude network address from pool */ dynsize--; if (flags & IPPOOL_NOGATEWAY) /* Exclude gateway address from pool */ @@ -200,17 +227,16 @@ if (!allowstat) { statsize = 0; - stataddr.s_addr = 0; - statmask.s_addr = 0; + stataddr.len = 0; + stataddrprefixlen = 0; } else { - if (ippool_aton(&stataddr, &statmask, stat, 0)) { + if (ippool_aton(&stataddr, &stataddrprefixlen, stat, 0)) { SYS_ERR(DIP, LOGL_ERROR, 0, "Failed to parse static range"); return -1; } - m = ntohl(statmask.s_addr); - statsize = ((~m) + 1); + statsize = (1 << (addr.len - addrprefixlen + 1)) -1; if (statsize > IPPOOL_STATSIZE) statsize = IPPOOL_STATSIZE; } @@ -225,8 +251,9 @@ (*this)->allowdyn = allowdyn; (*this)->allowstat = allowstat; - (*this)->stataddr = stataddr; - (*this)->statmask = statmask; + if (stataddr.len > 0) + (*this)->stataddr = stataddr; + (*this)->stataddrprefixlen = stataddrprefixlen; (*this)->listsize += listsize; if (!((*this)->member = calloc(sizeof(struct ippoolm_t), listsize))) { @@ -255,17 +282,15 @@ (*this)->firstdyn = NULL; (*this)->lastdyn = NULL; + if (flags & IPPOOL_NOGATEWAY) { + in46a_inc(&addr); + in46a_inc(&addr); + } else if (flags & IPPOOL_NONETWORK) { + in46a_inc(&addr); + } for (i = 0; i < dynsize; i++) { - - if (flags & IPPOOL_NOGATEWAY) - (*this)->member[i].addr.s_addr = - htonl(ntohl(addr.s_addr) + i + 2); - else if (flags & IPPOOL_NONETWORK) - (*this)->member[i].addr.s_addr = - htonl(ntohl(addr.s_addr) + i + 1); - else - (*this)->member[i].addr.s_addr = - htonl(ntohl(addr.s_addr) + i); + (*this)->member[i].addr = addr; + in46a_inc(&addr); (*this)->member[i].inuse = 0; @@ -285,8 +310,8 @@ (*this)->firststat = NULL; (*this)->laststat = NULL; for (i = dynsize; i < listsize; i++) { - - (*this)->member[i].addr.s_addr = 0; + struct in46_addr *i6al = &(*this)->member[i].addr; + memset(i6al, 0, sizeof(*i6al)); (*this)->member[i].inuse = 0; /* Insert into list of unused */ @@ -316,15 +341,15 @@ /* Find an IP address in the pool */ int ippool_getip(struct ippool_t *this, struct ippoolm_t **member, - struct in_addr *addr) + struct in46_addr *addr) { struct ippoolm_t *p; uint32_t hash; /* Find in hash table */ - hash = ippool_hash4(addr) & this->hashmask; + hash = ippool_hash(addr) & this->hashmask; for (p = this->hash[hash]; p; p = p->nexthash) { - if ((p->addr.s_addr == addr->s_addr) && (p->inuse)) { + if (in46a_equal(&p->addr, addr)) { if (member) *member = p; return 0; @@ -344,7 +369,7 @@ * address space. **/ int ippool_newip(struct ippool_t *this, struct ippoolm_t **member, - struct in_addr *addr, int statip) + struct in46_addr *addr, int statip) { struct ippoolm_t *p; struct ippoolm_t *p2 = NULL; @@ -365,17 +390,23 @@ if (0) (void)ippool_printaddr(this); + int specified = 0; + if (addr) { + if (addr->len == 4 && addr->v4.s_addr) + specified = 1; + if (addr->len == 16 && !IN6_IS_ADDR_UNSPECIFIED(&addr->v6)) + specified = 1; + } + /* First check to see if this type of address is allowed */ - if ((addr) && (addr->s_addr) && statip) { /* IP address given */ + if (specified && statip) { /* IP address given */ if (!this->allowstat) { SYS_ERR(DIP, LOGL_ERROR, 0, "Static IP address not allowed"); return -1; } - if ((addr->s_addr & this->statmask.s_addr) != - this->stataddr.s_addr) { - SYS_ERR(DIP, LOGL_ERROR, 0, - "Static out of range"); + if (!in46a_within_mask(addr, &this->stataddr, this->stataddrprefixlen)) { + SYS_ERR(DIP, LOGL_ERROR, 0, "Static out of range"); return -1; } } else { @@ -387,11 +418,11 @@ } /* If IP address given try to find it in dynamic address pool */ - if ((addr) && (addr->s_addr)) { /* IP address given */ + if (specified) { /* IP address given */ /* Find in hash table */ - hash = ippool_hash4(addr) & this->hashmask; + hash = ippool_hash(addr) & this->hashmask; for (p = this->hash[hash]; p; p = p->nexthash) { - if ((p->addr.s_addr == addr->s_addr)) { + if (in46a_equal(&p->addr, addr)) { p2 = p; break; } @@ -420,6 +451,11 @@ return -1; /* Allready in use / Should not happen */ } + if (p2->addr.len != addr->len) { + SYS_ERR(DIP, LOGL_ERROR, 0, "MS requested unsupported PDP context type"); + return -1; + } + /* Remove from linked list of free dynamic addresses */ if (p2->prev) p2->prev->next = p2->next; @@ -442,13 +478,18 @@ /* It was not possible to allocate from dynamic address pool */ /* Try to allocate from static address space */ - if ((addr) && (addr->s_addr) && (statip)) { /* IP address given */ + if (specified && (statip)) { /* IP address given */ if (!this->firststat) { SYS_ERR(DIP, LOGL_ERROR, 0, "No more IP addresses available"); return -1; /* No more available */ } else p2 = this->firststat; + + if (p2->addr.len != addr->len) { + SYS_ERR(DIP, LOGL_ERROR, 0, "MS requested unsupported PDP context type"); + return -1; + } /* Remove from linked list of free static addresses */ if (p2->prev) @@ -518,7 +559,7 @@ this->laststat = member; member->inuse = 0; - member->addr.s_addr = 0; + memset(&member->addr, 0, sizeof(member->addr)); member->peer = NULL; member->nexthash = NULL; if (0) @@ -530,9 +571,3 @@ return -1; } } - -#ifndef IPPOOL_NOIP6 -extern unsigned long int ippool_hash6(struct in6_addr *addr); -extern int ippool_getip6(struct ippool_t *this, struct in6_addr *addr); -extern int ippool_returnip6(struct ippool_t *this, struct in6_addr *addr); -#endif diff --git a/lib/ippool.h b/lib/ippool.h index 534140d..53154f2 100644 --- a/lib/ippool.h +++ b/lib/ippool.h @@ -12,6 +12,8 @@ #ifndef _IPPOOL_H #define _IPPOOL_H +#include "../lib/in46_addr.h" + /* Assuming that the address space is fragmented we need a hash table in order to return the addresses. @@ -26,8 +28,6 @@ in RFC2373. */ -#define IPPOOL_NOIP6 - #define IPPOOL_NONETWORK 0x01 #define IPPOOL_NOBROADCAST 0x02 #define IPPOOL_NOGATEWAY 0x04 @@ -40,8 +40,8 @@ unsigned int listsize; /* Total number of addresses */ int allowdyn; /* Allow dynamic IP address allocation */ int allowstat; /* Allow static IP address allocation */ - struct in_addr stataddr; /* Static address range network address */ - struct in_addr statmask; /* Static address range network mask */ + struct in46_addr stataddr; /* Static address range network address */ + size_t stataddrprefixlen; /* IPv6 prefix length of stataddr */ struct ippoolm_t *member; /* Listsize array of members */ unsigned int hashsize; /* Size of hash table */ int hashlog; /* Log2 size of hash table */ @@ -54,11 +54,7 @@ }; struct ippoolm_t { -#ifndef IPPOOL_NOIP6 - struct in6_addr addr; /* IP address of this member */ -#else - struct in_addr addr; /* IP address of this member */ -#endif + struct in46_addr addr; /* IP address of this member */ int inuse; /* 0=available; 1= dynamic; 2 = static */ struct ippoolm_t *nexthash; /* Linked list part of hash table */ struct ippoolm_t *prev, *next; /* Linked list of free dynamic or static */ @@ -70,7 +66,7 @@ bytes for each address. */ /* Hash an IP address using code based on Bob Jenkins lookupa */ -extern unsigned long int ippool_hash4(struct in_addr *addr); +extern unsigned long int ippool_hash(struct in46_addr *addr); /* Create new address pool */ extern int ippool_new(struct ippool_t **this, char *dyn, char *stat, @@ -81,24 +77,20 @@ /* Find an IP address in the pool */ extern int ippool_getip(struct ippool_t *this, struct ippoolm_t **member, - struct in_addr *addr); + struct in46_addr *addr); /* Get an IP address. If addr = 0.0.0.0 get a dynamic IP address. Otherwise check to see if the given address is available */ extern int ippool_newip(struct ippool_t *this, struct ippoolm_t **member, - struct in_addr *addr, int statip); + struct in46_addr *addr, int statip); /* Return a previously allocated IP address */ extern int ippool_freeip(struct ippool_t *this, struct ippoolm_t *member); /* Get net and mask based on ascii string */ -extern int ippool_aton(struct in_addr *addr, struct in_addr *mask, - char *pool, int number); +int ippool_aton(struct in46_addr *addr, size_t *prefixlen, const char *pool, int number); -#ifndef IPPOOL_NOIP6 -extern unsigned long int ippool_hash6(struct in6_addr *addr); -extern int ippool_getip6(struct ippool_t *this, struct in6_addr *addr); -extern int ippool_returnip6(struct ippool_t *this, struct in6_addr *addr); -#endif +/* Increase IPv4/IPv6 address by 1 */ +extern void in46a_inc(struct in46_addr *addr); #endif /* !_IPPOOL_H */ diff --git a/sgsnemu/sgsnemu.c b/sgsnemu/sgsnemu.c index 1567e7e..90a6200 100644 --- a/sgsnemu/sgsnemu.c +++ b/sgsnemu/sgsnemu.c @@ -58,7 +58,7 @@ uint8_t inuse; /* 0=free. 1=used by somebody */ struct iphash_t *ipnext; struct pdp_t *pdp; - struct in_addr addr; + struct in46_addr addr; }; struct iphash_t iparr[MAXCONTEXTS]; struct iphash_t *iphash[MAXCONTEXTS]; @@ -81,7 +81,8 @@ struct { int debug; /* Print debug messages */ int createif; /* Create local network interface */ - struct in_addr netaddr, destaddr, net, mask; /* Network interface */ + struct in_addr netaddr, destaddr, net; /* Network interface */ + size_t prefixlen; char *ipup, *ipdown; /* Filename of scripts */ int defaultroute; /* Set up default route */ struct in_addr pinghost; /* Remote ping host */ @@ -160,13 +161,13 @@ state = 3; /* Tell main loop to finish. */ } -int ipset(struct iphash_t *ipaddr, struct in_addr *addr) +int ipset(struct iphash_t *ipaddr, struct in46_addr *addr) { - int hash = ippool_hash4(addr) % MAXCONTEXTS; + int hash = ippool_hash(addr) % MAXCONTEXTS; struct iphash_t *h; struct iphash_t *prev = NULL; ipaddr->ipnext = NULL; - ipaddr->addr.s_addr = addr->s_addr; + ipaddr->addr = *addr; for (h = iphash[hash]; h; h = h->ipnext) prev = h; if (!prev) @@ -178,7 +179,7 @@ int ipdel(struct iphash_t *ipaddr) { - int hash = ippool_hash4(&ipaddr->addr) % MAXCONTEXTS; + int hash = ippool_hash(&ipaddr->addr) % MAXCONTEXTS; struct iphash_t *h; struct iphash_t *prev = NULL; for (h = iphash[hash]; h; h = h->ipnext) { @@ -194,12 +195,12 @@ return EOF; /* End of linked list and not found */ } -int ipget(struct iphash_t **ipaddr, struct in_addr *addr) +int ipget(struct iphash_t **ipaddr, struct in46_addr *addr) { - int hash = ippool_hash4(addr) % MAXCONTEXTS; + int hash = ippool_hash(addr) % MAXCONTEXTS; struct iphash_t *h; for (h = iphash[hash]; h; h = h->ipnext) { - if ((h->addr.s_addr == addr->s_addr)) { + if (in46a_equal(&h->addr, addr)) { *ipaddr = h; return 0; } @@ -859,15 +860,17 @@ /* net */ /* Store net as in_addr net and mask */ if (args_info.net_arg) { + struct in46_addr in46; if (ippool_aton - (&options.net, &options.mask, args_info.net_arg, 0)) { + (&in46, &options.prefixlen, args_info.net_arg, 0)) { SYS_ERR(DSGSN, LOGL_ERROR, 0, "Invalid network address: %s!", args_info.net_arg); exit(1); } + options.net.s_addr = in46.v4.s_addr; #if defined (__sun__) - options.netaddr.s_addr = htonl(ntohl(options.net.s_addr) + 1); + options.netaddrs_addr = htonl(ntohl(options.net.s_addr) + 1); options.destaddr.s_addr = htonl(ntohl(options.net.s_addr) + 1); #else options.netaddr.s_addr = options.net.s_addr; @@ -876,7 +879,7 @@ } else { options.net.s_addr = 0; - options.mask.s_addr = 0; + options.prefixlen = 0; options.netaddr.s_addr = 0; options.destaddr.s_addr = 0; } @@ -1277,14 +1280,15 @@ int cb_tun_ind(struct tun_t *tun, void *pack, unsigned len) { struct iphash_t *ipm; - struct in_addr src; + struct in46_addr src; struct tun_packet_t *iph = (struct tun_packet_t *)pack; - src.s_addr = iph->src; + src.len = 4; + src.v4.s_addr = iph->src; if (ipget(&ipm, &src)) { printf("Dropping packet from invalid source address: %s\n", - inet_ntoa(src)); + inet_ntoa(src.v4)); return 0; } @@ -1295,7 +1299,7 @@ int create_pdp_conf(struct pdp_t *pdp, void *cbp, int cause) { - struct in_addr addr; + struct in46_addr addr; struct iphash_t *iph = (struct iphash_t *)cbp; @@ -1324,7 +1328,7 @@ return EOF; /* Not what we expected */ } - if (pdp_euaton(&pdp->eua, &addr)) { + if (pdp_euaton(&pdp->eua, &addr.v4)) { printf ("Received create PDP context response. Cause value: %d\n", cause); @@ -1335,7 +1339,7 @@ } printf("Received create PDP context response. IP address: %s\n", - inet_ntoa(addr)); + inet_ntoa(addr.v4)); if ((options.createif) && (!options.net.s_addr)) { struct in_addr m; @@ -1345,11 +1349,11 @@ m.s_addr = -1; #endif /* printf("Setting up interface and routing\n"); */ - tun_addaddr(tun, &addr, &addr, &m); + tun_addaddr(tun, &addr.v4, &addr.v4, &m); if (options.defaultroute) { struct in_addr rm; rm.s_addr = 0; - tun_addroute(tun, &rm, &addr, &rm); + tun_addroute(tun, &rm, &addr.v4, &rm); } if (options.ipup) tun_runscript(tun, options.ipup); @@ -1472,9 +1476,10 @@ } if ((options.createif) && (options.net.s_addr)) { + struct in_addr mask; + mask.s_addr = options.prefixlen ? (0xFFFFFFFF >> (32 - options.prefixlen)) : 0; /* printf("Setting up interface and routing\n"); */ - tun_addaddr(tun, &options.netaddr, &options.destaddr, - &options.mask); + tun_addaddr(tun, &options.netaddr, &options.destaddr, &mask); if (options.defaultroute) { struct in_addr rm; rm.s_addr = 0; -- To view, visit https://gerrit.osmocom.org/3403 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ib98cc4bf634d6be9a7bf8c03a24e629455fcafc8 Gerrit-PatchSet: 1 Gerrit-Project: openggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Wed Aug 2 23:37:11 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 2 Aug 2017 23:37:11 +0000 Subject: [PATCH] openggsn[master]: lib/tun.h: Remove non-endian-safe redefinition of IP header Message-ID: Review at https://gerrit.osmocom.org/3404 lib/tun.h: Remove non-endian-safe redefinition of IP header We can simply use 'struct iphdr' from netinet/ip.h to achieve the same goal (and be portable). Change-Id: Ieece22e127dc14a7ffdc3b05656628989ad00b32 --- M ggsn/ggsn.c M lib/tun.h M sgsnemu/sgsnemu.c 3 files changed, 8 insertions(+), 21 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openggsn refs/changes/04/3404/1 diff --git a/ggsn/ggsn.c b/ggsn/ggsn.c index 00c7174..11aea78 100644 --- a/ggsn/ggsn.c +++ b/ggsn/ggsn.c @@ -34,6 +34,7 @@ #include #include #include +#include #include #include #include @@ -42,6 +43,7 @@ #include #include #include +#include #include #include @@ -219,13 +221,13 @@ { struct ippoolm_t *ipm; struct in46_addr dst; - struct tun_packet_t *iph = (struct tun_packet_t *)pack; + struct iphdr *iph = (struct iphdr *)pack; - if (iph->ver == 4) { + if (iph->version == 4) { if (len < sizeof(*iph) || len < 4*iph->ihl) return -1; dst.len = 4; - dst.v4.s_addr = iph->dst; + dst.v4.s_addr = iph->daddr; } else { LOGP(DGGSN, LOGL_NOTICE, "non-IPv4 packet received from tun\n"); return -1; diff --git a/lib/tun.h b/lib/tun.h index ce7b91c..5143ccd 100644 --- a/lib/tun.h +++ b/lib/tun.h @@ -17,22 +17,6 @@ #define TUN_ADDRSIZE 128 #define TUN_NLBUFSIZE 1024 -struct tun_packet_t { - unsigned int ver:4; - unsigned int ihl:4; - unsigned int dscp:6; - unsigned int ecn:2; - unsigned int length:16; - unsigned int id:16; - unsigned int flags:3; - unsigned int fragment:13; - unsigned int ttl:8; - unsigned int protocol:8; - unsigned int check:16; - unsigned int src:32; - unsigned int dst:32; -}; - /* *********************************************************** * Information storage for each tun instance *************************************************************/ diff --git a/sgsnemu/sgsnemu.c b/sgsnemu/sgsnemu.c index 90a6200..af8f9fa 100644 --- a/sgsnemu/sgsnemu.c +++ b/sgsnemu/sgsnemu.c @@ -29,6 +29,7 @@ #include #include #include +#include #include #include #include @@ -1281,10 +1282,10 @@ { struct iphash_t *ipm; struct in46_addr src; - struct tun_packet_t *iph = (struct tun_packet_t *)pack; + struct iphdr *iph = (struct iphdr *)pack; src.len = 4; - src.v4.s_addr = iph->src; + src.v4.s_addr = iph->saddr; if (ipget(&ipm, &src)) { printf("Dropping packet from invalid source address: %s\n", -- To view, visit https://gerrit.osmocom.org/3404 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ieece22e127dc14a7ffdc3b05656628989ad00b32 Gerrit-PatchSet: 1 Gerrit-Project: openggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Wed Aug 2 23:37:11 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 2 Aug 2017 23:37:11 +0000 Subject: [PATCH] openggsn[master]: ippool_new(): const-ify input arguments Message-ID: Review at https://gerrit.osmocom.org/3405 ippool_new(): const-ify input arguments Change-Id: If3e53584e8c9c1f06bba4c183c9fd65fae913904 --- M lib/ippool.c M lib/ippool.h 2 files changed, 2 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openggsn refs/changes/05/3405/1 diff --git a/lib/ippool.c b/lib/ippool.c index 6c43ad7..9a3d0b3 100644 --- a/lib/ippool.c +++ b/lib/ippool.c @@ -187,7 +187,7 @@ } /* Create new address pool */ -int ippool_new(struct ippool_t **this, char *dyn, char *stat, +int ippool_new(struct ippool_t **this, const char *dyn, const char *stat, int allowdyn, int allowstat, int flags) { diff --git a/lib/ippool.h b/lib/ippool.h index 53154f2..e3c1c92 100644 --- a/lib/ippool.h +++ b/lib/ippool.h @@ -69,7 +69,7 @@ extern unsigned long int ippool_hash(struct in46_addr *addr); /* Create new address pool */ -extern int ippool_new(struct ippool_t **this, char *dyn, char *stat, +extern int ippool_new(struct ippool_t **this, const char *dyn, const char *stat, int allowdyn, int allowstat, int flags); /* Delete existing address pool */ -- To view, visit https://gerrit.osmocom.org/3405 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: If3e53584e8c9c1f06bba4c183c9fd65fae913904 Gerrit-PatchSet: 1 Gerrit-Project: openggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Wed Aug 2 23:37:12 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 2 Aug 2017 23:37:12 +0000 Subject: [PATCH] openggsn[master]: IPv6 support for user IP Message-ID: Review at https://gerrit.osmocom.org/3406 IPv6 support for user IP This patch enables the use of IPv6 PDP contexts. The phone will have to request an IPv6 End-user-Address, and the GGSN will have to be configured for an IPv6 pool. The outer transport-layer IP between SGSN and GGSN must still be IPv4, it is not modified by this patch Change-Id: I22c3bf32a98e5daf99d6eaeac8c9f95cc7574774 --- M ggsn/ggsn.c M lib/in46_addr.c M lib/in46_addr.h M sgsnemu/sgsnemu.c 4 files changed, 75 insertions(+), 5 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openggsn refs/changes/06/3406/1 diff --git a/ggsn/ggsn.c b/ggsn/ggsn.c index 11aea78..6ef7e54 100644 --- a/ggsn/ggsn.c +++ b/ggsn/ggsn.c @@ -35,6 +35,7 @@ #include #include #include +#include #include #include #include @@ -188,7 +189,7 @@ memcpy(pdp->qos_neg.v, pdp->qos_req.v, pdp->qos_req.l); /* TODO */ pdp->qos_neg.l = pdp->qos_req.l; - if (pdp_euaton(&pdp->eua, &addr.v4)) { + if (in46a_from_eua(&pdp->eua, &addr)) { addr.v4.s_addr = 0; /* Request dynamic */ } @@ -197,7 +198,7 @@ return 0; /* Allready in use, or no more available */ } - pdp_ntoeua(&member->addr.v4, &pdp->eua); + in46a_to_eua(&member->addr, &pdp->eua); pdp->peer = member; pdp->ipif = tun; /* TODO */ member->peer = pdp; @@ -222,14 +223,18 @@ struct ippoolm_t *ipm; struct in46_addr dst; struct iphdr *iph = (struct iphdr *)pack; + struct ip6_hdr *ip6h = (struct ip6_hdr *)pack; if (iph->version == 4) { if (len < sizeof(*iph) || len < 4*iph->ihl) return -1; dst.len = 4; dst.v4.s_addr = iph->daddr; + } else if (iph->version == 6) { + dst.len = 16; + dst.v6 = ip6h->ip6_dst; } else { - LOGP(DGGSN, LOGL_NOTICE, "non-IPv4 packet received from tun\n"); + LOGP(DGGSN, LOGL_NOTICE, "non-IPv packet received from tun\n"); return -1; } diff --git a/lib/in46_addr.c b/lib/in46_addr.c index f9bb020..844e318 100644 --- a/lib/in46_addr.c +++ b/lib/in46_addr.c @@ -9,7 +9,7 @@ * */ -#include "lib/in46_addr.h" +#include "../lib/in46_addr.h" #include #include @@ -146,3 +146,63 @@ return 0; } } + +/*! Convert given PDP End User Address to in46_addr + * \returns 0 on success; negative on error */ +int in46a_to_eua(const struct in46_addr *src, struct ul66_t *eua) +{ + switch (src->len) { + case 4: + eua->l = 6; + eua->v[0] = 0xf1; /* IETF */ + eua->v[1] = 0x21; /* IPv4 */ + memcpy(&eua->v[2], &src->v4, 4); /* Copy a 4 byte address */ + break; + case 16: + eua->l = 18; + eua->v[0] = 0xf1; /* IETF */ + eua->v[1] = 0x57; /* IPv6 */ + memcpy(&eua->v[2], &src->v6, 16); /* Copy a 16 byte address */ + break; + default: + return -1; + } + return 0; +} + +/*! Convert given in46_addr to PDP End User Address + * \returns 0 on success; negative on error */ +int in46a_from_eua(const struct ul66_t *eua, struct in46_addr *dst) +{ + if (eua->l < 2) + goto default_to_dyn_v4; + + if (eua->v[0] != 0xf1) + return -1; + + switch (eua->v[1]) { + case 0x21: + dst->len = 4; + if (eua->l >= 6) + memcpy(&dst->v4, &eua->v[2], 4); /* Copy a 4 byte address */ + else + dst->v4.s_addr = 0; + break; + case 0x57: + dst->len = 16; + if (eua->l >= 18) + memcpy(&dst->v6, &eua->v[2], 16); /* Copy a 16 byte address */ + else + memset(&dst->v6, 0, 16); + break; + default: + return -1; + } + return 0; + +default_to_dyn_v4: + /* assume dynamic IPv4 by default */ + dst->len = 4; + dst->v4.s_addr = 0; + return 0; +} diff --git a/lib/in46_addr.h b/lib/in46_addr.h index f28fd8e..a0ad6e1 100644 --- a/lib/in46_addr.h +++ b/lib/in46_addr.h @@ -2,6 +2,8 @@ #include #include +#include "../gtp/pdp.h" + /* a simple wrapper around an in6_addr to also contain the length of the address, * thereby implicitly indicating the address family of the address */ struct in46_addr { @@ -17,3 +19,6 @@ extern const char *in46a_ntop(const struct in46_addr *in, char *dst, socklen_t dst_size); extern int in46a_equal(const struct in46_addr *a, const struct in46_addr *b); extern int in46a_within_mask(const struct in46_addr *addr, const struct in46_addr *net, size_t prefixlen); + +int in46a_to_eua(const struct in46_addr *src, struct ul66_t *eua); +int in46a_from_eua(const struct ul66_t *eua, struct in46_addr *dst); diff --git a/sgsnemu/sgsnemu.c b/sgsnemu/sgsnemu.c index af8f9fa..8c9cfd3 100644 --- a/sgsnemu/sgsnemu.c +++ b/sgsnemu/sgsnemu.c @@ -1329,7 +1329,7 @@ return EOF; /* Not what we expected */ } - if (pdp_euaton(&pdp->eua, &addr.v4)) { + if (in46a_from_eua(&pdp->eua, &addr)) { printf ("Received create PDP context response. Cause value: %d\n", cause); -- To view, visit https://gerrit.osmocom.org/3406 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I22c3bf32a98e5daf99d6eaeac8c9f95cc7574774 Gerrit-PatchSet: 1 Gerrit-Project: openggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Wed Aug 2 23:37:12 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 2 Aug 2017 23:37:12 +0000 Subject: [PATCH] openggsn[master]: ggsn: Send proper errors in create_context_ind() Message-ID: Review at https://gerrit.osmocom.org/3407 ggsn: Send proper errors in create_context_ind() When we receive PDP context requests for unknown PDP types or if we run out of dynamic addresses, we need to inform the SGSN that PDP context creation failed. Change-Id: Ibf199c1726130d27c8f80230b30ee51101c93b06 --- M ggsn/ggsn.c M lib/ippool.c M lib/ippool.h 3 files changed, 20 insertions(+), 11 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openggsn refs/changes/07/3407/1 diff --git a/ggsn/ggsn.c b/ggsn/ggsn.c index 6ef7e54..c1cea7e 100644 --- a/ggsn/ggsn.c +++ b/ggsn/ggsn.c @@ -178,6 +178,7 @@ { struct in46_addr addr; struct ippoolm_t *member; + int rc; DEBUGP(DGGSN, "Received create PDP context request\n"); @@ -190,11 +191,16 @@ pdp->qos_neg.l = pdp->qos_req.l; if (in46a_from_eua(&pdp->eua, &addr)) { - addr.v4.s_addr = 0; /* Request dynamic */ + SYS_ERR(DGGSN, LOGL_ERROR, 0, "Cannot decode EUA from MS/SGSN: %s", + osmo_hexdump(pdp->eua.v, pdp->eua.l)); + gtp_create_context_resp(gsn, pdp, GTPCAUSE_UNKNOWN_PDP); + return 0; } - if (ippool_newip(ippool, &member, &addr, 0)) { - gtp_create_context_resp(gsn, pdp, GTPCAUSE_NO_RESOURCES); + rc = ippool_newip(ippool, &member, &addr, 0); + if (rc < 0) { + SYS_ERR(DGGSN, LOGL_ERROR, 0, "Cannot allocate IP address in pool\n"); + gtp_create_context_resp(gsn, pdp, -rc); return 0; /* Allready in use, or no more available */ } @@ -206,6 +212,8 @@ if (gtp_kernel_tunnel_add(pdp) < 0) { SYS_ERR(DGGSN, LOGL_ERROR, 0, "Cannot add tunnel to kernel: %s\n", strerror(errno)); + gtp_create_context_resp(gsn, pdp, GTPCAUSE_SYS_FAIL); + return 0; } if (!send_trap(gsn, pdp, member, "imsi-ass-ip")) { /* TRAP with IP assignment */ diff --git a/lib/ippool.c b/lib/ippool.c index 9a3d0b3..305aae2 100644 --- a/lib/ippool.c +++ b/lib/ippool.c @@ -403,7 +403,7 @@ if (!this->allowstat) { SYS_ERR(DIP, LOGL_ERROR, 0, "Static IP address not allowed"); - return -1; + return -GTPCAUSE_NOT_SUPPORTED; } if (!in46a_within_mask(addr, &this->stataddr, this->stataddrprefixlen)) { SYS_ERR(DIP, LOGL_ERROR, 0, "Static out of range"); @@ -413,7 +413,7 @@ if (!this->allowdyn) { SYS_ERR(DIP, LOGL_ERROR, 0, "Dynamic IP address not allowed"); - return -1; + return -GTPCAUSE_NOT_SUPPORTED; } } @@ -439,7 +439,7 @@ if (!this->firstdyn) { SYS_ERR(DIP, LOGL_ERROR, 0, "No more IP addresses available"); - return -1; + return -GTPCAUSE_ADDR_OCCUPIED; } else p2 = this->firstdyn; } @@ -448,12 +448,12 @@ if (p2->inuse) { SYS_ERR(DIP, LOGL_ERROR, 0, "IP address allready in use"); - return -1; /* Allready in use / Should not happen */ + return -GTPCAUSE_SYS_FAIL; /* Allready in use / Should not happen */ } if (p2->addr.len != addr->len) { SYS_ERR(DIP, LOGL_ERROR, 0, "MS requested unsupported PDP context type"); - return -1; + return -GTPCAUSE_UNKNOWN_PDP; } /* Remove from linked list of free dynamic addresses */ @@ -482,13 +482,13 @@ if (!this->firststat) { SYS_ERR(DIP, LOGL_ERROR, 0, "No more IP addresses available"); - return -1; /* No more available */ + return -GTPCAUSE_ADDR_OCCUPIED; /* No more available */ } else p2 = this->firststat; if (p2->addr.len != addr->len) { SYS_ERR(DIP, LOGL_ERROR, 0, "MS requested unsupported PDP context type"); - return -1; + return -GTPCAUSE_UNKNOWN_PDP; } /* Remove from linked list of free static addresses */ @@ -513,7 +513,7 @@ SYS_ERR(DIP, LOGL_ERROR, 0, "Could not allocate IP address"); - return -1; /* Should never get here. TODO: Bad code */ + return -GTPCAUSE_SYS_FAIL; /* Should never get here. TODO: Bad code */ } int ippool_freeip(struct ippool_t *this, struct ippoolm_t *member) diff --git a/lib/ippool.h b/lib/ippool.h index e3c1c92..ba92a56 100644 --- a/lib/ippool.h +++ b/lib/ippool.h @@ -13,6 +13,7 @@ #define _IPPOOL_H #include "../lib/in46_addr.h" +#include "../gtp/gtp.h" /* Assuming that the address space is fragmented we need a hash table in order to return the addresses. -- To view, visit https://gerrit.osmocom.org/3407 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ibf199c1726130d27c8f80230b30ee51101c93b06 Gerrit-PatchSet: 1 Gerrit-Project: openggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Wed Aug 2 23:37:12 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 2 Aug 2017 23:37:12 +0000 Subject: [PATCH] openggsn[master]: Support setting TUN device IPv6 address + prefix Message-ID: Review at https://gerrit.osmocom.org/3408 Support setting TUN device IPv6 address + prefix As we can now have PDP contexts with IPv6 user IP payload, it is useful to extend the TUN related code to be able to configure the tun device IPv6 address + prefix length Change-Id: I899d21e52d02e0b8384af29ddd489ff19c8f2cf6 --- M ggsn/ggsn.c M lib/tun.c M lib/tun.h 3 files changed, 111 insertions(+), 17 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openggsn refs/changes/08/3408/1 diff --git a/ggsn/ggsn.c b/ggsn/ggsn.c index c1cea7e..a591321 100644 --- a/ggsn/ggsn.c +++ b/ggsn/ggsn.c @@ -69,7 +69,7 @@ int maxfd = 0; /* For select() */ struct in_addr listen_; -struct in_addr netaddr, destaddr, net; /* Network interface */ +struct in46_addr netaddr, destaddr, net; /* Network interface */ size_t prefixlen; struct in_addr dns1, dns2; /* PCO DNS address */ char *ipup, *ipdown; /* Filename of scripts */ @@ -409,16 +409,16 @@ /* net */ /* Store net as in_addr net and mask */ if (args_info.net_arg) { - struct in46_addr in46; - if (ippool_aton(&in46, &prefixlen, args_info.net_arg, 0)) { + if (ippool_aton(&net, &prefixlen, args_info.net_arg, 0)) { SYS_ERR(DGGSN, LOGL_ERROR, 0, "Invalid network address: %s!", args_info.net_arg); exit(1); } - net.s_addr = in46.v4.s_addr; - netaddr.s_addr = htonl(ntohl(net.s_addr) + 1); - destaddr.s_addr = htonl(ntohl(net.s_addr) + 1); + /* default for network + destination address = net + 1 */ + netaddr = net; + in46a_inc(&netaddr); + destaddr = netaddr; } else { SYS_ERR(DGGSN, LOGL_ERROR, 0, "Network address must be specified: %s!", @@ -575,7 +575,7 @@ maxfd = gsn->fd1u; /* use GTP kernel module for data packet encapsulation */ - if (gtp_kernel_init(gsn, &net, prefixlen, &args_info) < 0) + if (gtp_kernel_init(gsn, &net.v4, prefixlen, &args_info) < 0) goto err; gtp_set_cb_data_ind(gsn, encaps_tun); @@ -600,7 +600,7 @@ } DEBUGP(DGGSN, "Setting tun IP address\n"); - if (tun_setaddr(tun, &netaddr, &destaddr, &prefixlen)) { + if (tun_setaddr(tun, &netaddr, &destaddr, prefixlen)) { SYS_ERR(DGGSN, LOGL_ERROR, 0, "Failed to set tun IP address"); exit(1); } diff --git a/lib/tun.c b/lib/tun.c index 8325f5d..7e0af12 100644 --- a/lib/tun.c +++ b/lib/tun.c @@ -1,6 +1,7 @@ /* * TUN interface functions. * Copyright (C) 2002, 2003, 2004 Mondru AB. + * Copyright (C) 2017 by Harald Welte * * The contents of this file may be used under the terms of the GNU * General Public License Version 2, provided that the above copyright @@ -65,7 +66,12 @@ #include "tun.h" #include "syserr.h" +static int tun_setaddr4(struct tun_t *this, struct in_addr *addr, + struct in_addr *dstaddr, struct in_addr *netmask); + #if defined(__linux__) + +#include int tun_nlattr(struct nlmsghdr *n, int nsize, int type, void *d, int dlen) { @@ -247,7 +253,7 @@ struct msghdr msg; if (!this->addrs) /* Use ioctl for first addr to make ping work */ - return tun_setaddr(this, addr, dstaddr, netmask); + return tun_setaddr4(this, addr, dstaddr, netmask); memset(&req, 0, sizeof(req)); req.n.nlmsg_len = NLMSG_LENGTH(sizeof(struct ifaddrmsg)); @@ -345,7 +351,7 @@ /* TODO: Is this needed on FreeBSD? */ if (!this->addrs) /* Use ioctl for first addr to make ping work */ - return tun_setaddr(this, addr, dstaddr, netmask); /* TODO dstaddr */ + return tun_setaddr4(this, addr, dstaddr, netmask); /* TODO dstaddr */ memset(&areq, 0, sizeof(areq)); @@ -391,7 +397,7 @@ #elif defined (__sun__) if (!this->addrs) /* Use ioctl for first addr to make ping work */ - return tun_setaddr(this, addr, dstaddr, netmask); + return tun_setaddr4(this, addr, dstaddr, netmask); SYS_ERR(DTUN, LOGL_ERROR, errno, "Setting multiple addresses not possible on Solaris"); @@ -403,9 +409,8 @@ } -int tun_setaddr(struct tun_t *this, - struct in_addr *addr, - struct in_addr *dstaddr, struct in_addr *netmask) +static int tun_setaddr4(struct tun_t *this, struct in_addr *addr, + struct in_addr *dstaddr, struct in_addr *netmask) { struct ifreq ifr; int fd; @@ -498,13 +503,99 @@ tun_sifflags(this, IFF_UP | IFF_RUNNING); #if defined(__FreeBSD__) || defined (__APPLE__) - tun_addroute(this, dstaddr, addr, netmask); + tun_addroute(this, dstaddr, addr, &this->netmask); this->routes = 1; #endif return 0; } +static int tun_setaddr6(struct tun_t *this, struct in6_addr *addr, struct in6_addr *dstaddr, + size_t prefixlen) +{ + struct in6_ifreq ifr; + struct ifreq namereq; + int fd; + + memset(&ifr, 0, sizeof(ifr)); + memset(&namereq, 0, sizeof(namereq)); + + /* Create a channel to the NET kernel */ + if ((fd = socket(AF_INET6, SOCK_DGRAM, 0)) < 0) { + SYS_ERR(DTUN, LOGL_ERROR, 0, "socket() failed"); + return -1; + } + + /* get interface index */ + strncpy(namereq.ifr_name, this->devname, IFNAMSIZ); + namereq.ifr_name[IFNAMSIZ-1] = 0; + if (ioctl(fd, SIOGIFINDEX, &namereq) < 0) { + SYS_ERR(DTUN, LOGL_ERROR, 0, "Could not get ifindex"); + return -1; + } + ifr.ifr6_ifindex = namereq.ifr_ifindex; + ifr.ifr6_prefixlen = prefixlen; + + if (addr) { + memcpy(&this->addr, addr, sizeof(*addr)); + memcpy(&ifr.ifr6_addr, addr, sizeof(*addr)); + if (ioctl(fd, SIOCSIFADDR, (void *) &ifr) < 0) { + if (errno != EEXIST) { + SYS_ERR(DTUN, LOGL_ERROR, 0, "ioctl(SIOCSIFADDR) failed"); + } else { + SYS_ERR(DTUN, LOGL_NOTICE, 0, "ioctl(SIOCSIFADDR): Address alreadsy exists"); + } + close(fd); + return -1; + } + } + +#if 0 + /* FIXME: looks like this is not possible/necessary for IPv6? */ + if (dstaddr) { + memcpy(&this->dstaddr, dstaddr, sizeof(*dstaddr)); + memcpy(&ifr.ifr6_addr, dstaddr, sizeof(*dstaddr)); + if (ioctl(fd, SIOCSIFDSTADDR, (caddr_t *) &ifr) < 0) { + SYS_ERR(DTUN, LOGL_ERROR, "ioctl(SIOCSIFDSTADDR) failed"); + close(fd); + return -1; + } + } +#endif + + close(fd); + this->addrs++; + + /* On linux the route to the interface is set automatically + on FreeBSD we have to do this manually */ + + /* TODO: How does it work on Solaris? */ + + tun_sifflags(this, IFF_UP | IFF_RUNNING); + +#if 0 /* FIXME */ +//#if defined(__FreeBSD__) || defined (__APPLE__) + tun_addroute6(this, dstaddr, addr, prefixlen); + this->routes = 1; +#endif + + return 0; +} + +int tun_setaddr(struct tun_t *this, struct in46_addr *addr, struct in46_addr *dstaddr, size_t prefixlen) +{ + struct in_addr netmask; + switch (addr->len) { + case 4: + netmask.s_addr = htonl(0xffffffff << (32 - prefixlen)); + return tun_setaddr4(this, &addr->v4, dstaddr ? &dstaddr->v4 : NULL, &netmask); + case 16: + return tun_setaddr6(this, &addr->v6, dstaddr ? &dstaddr->v6 : NULL, prefixlen); + default: + return -1; + } +} + int tun_route(struct tun_t *this, struct in_addr *dst, struct in_addr *gateway, struct in_addr *mask, int delete) diff --git a/lib/tun.h b/lib/tun.h index 5143ccd..4716253 100644 --- a/lib/tun.h +++ b/lib/tun.h @@ -1,6 +1,7 @@ /* * TUN interface functions. * Copyright (C) 2002, 2003 Mondru AB. + * Copyright (C) 2017 by Harald Welte * * The contents of this file may be used under the terms of the GNU * General Public License Version 2, provided that the above copyright @@ -11,6 +12,8 @@ #ifndef _TUN_H #define _TUN_H + +#include "../lib/in46_addr.h" #define PACKET_MAX 8196 /* Maximum packet size we receive */ #define TUN_SCRIPTSIZE 256 @@ -40,8 +43,8 @@ extern int tun_addaddr(struct tun_t *this, struct in_addr *addr, struct in_addr *dstaddr, struct in_addr *netmask); -extern int tun_setaddr(struct tun_t *this, struct in_addr *our_adr, - struct in_addr *his_adr, struct in_addr *net_mask); +extern int tun_setaddr(struct tun_t *this, struct in46_addr *our_adr, + struct in46_addr *his_adr, size_t prefixlen); int tun_addroute(struct tun_t *this, struct in_addr *dst, struct in_addr *gateway, struct in_addr *mask); -- To view, visit https://gerrit.osmocom.org/3408 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I899d21e52d02e0b8384af29ddd489ff19c8f2cf6 Gerrit-PatchSet: 1 Gerrit-Project: openggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Wed Aug 2 23:38:47 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 2 Aug 2017 23:38:47 +0000 Subject: openggsn[master]: IPv6 support In-Reply-To: References: Message-ID: Patch Set 1: Code-Review-1 this patch appears to be against a more than 7 year old version of openggsn, it cannot be merged / integrated automatically in any way. -- To view, visit https://gerrit.osmocom.org/2870 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: If8ce8b4b8cd2ba97f7ba122de4703983111046e4 Gerrit-PatchSet: 1 Gerrit-Project: openggsn Gerrit-Branch: master Gerrit-Owner: groos at xiplink.com Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Aug 2 23:40:50 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 2 Aug 2017 23:40:50 +0000 Subject: [PATCH] openggsn[master]: Support setting TUN device IPv6 address + prefix In-Reply-To: References: Message-ID: Support setting TUN device IPv6 address + prefix As we can now have PDP contexts with IPv6 user IP payload, it is useful to extend the TUN related code to be able to configure the tun device IPv6 address + prefix length Change-Id: I899d21e52d02e0b8384af29ddd489ff19c8f2cf6 --- M ggsn/ggsn.c M lib/tun.c M lib/tun.h 3 files changed, 111 insertions(+), 17 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openggsn refs/changes/08/3408/2 diff --git a/ggsn/ggsn.c b/ggsn/ggsn.c index c1cea7e..a591321 100644 --- a/ggsn/ggsn.c +++ b/ggsn/ggsn.c @@ -69,7 +69,7 @@ int maxfd = 0; /* For select() */ struct in_addr listen_; -struct in_addr netaddr, destaddr, net; /* Network interface */ +struct in46_addr netaddr, destaddr, net; /* Network interface */ size_t prefixlen; struct in_addr dns1, dns2; /* PCO DNS address */ char *ipup, *ipdown; /* Filename of scripts */ @@ -409,16 +409,16 @@ /* net */ /* Store net as in_addr net and mask */ if (args_info.net_arg) { - struct in46_addr in46; - if (ippool_aton(&in46, &prefixlen, args_info.net_arg, 0)) { + if (ippool_aton(&net, &prefixlen, args_info.net_arg, 0)) { SYS_ERR(DGGSN, LOGL_ERROR, 0, "Invalid network address: %s!", args_info.net_arg); exit(1); } - net.s_addr = in46.v4.s_addr; - netaddr.s_addr = htonl(ntohl(net.s_addr) + 1); - destaddr.s_addr = htonl(ntohl(net.s_addr) + 1); + /* default for network + destination address = net + 1 */ + netaddr = net; + in46a_inc(&netaddr); + destaddr = netaddr; } else { SYS_ERR(DGGSN, LOGL_ERROR, 0, "Network address must be specified: %s!", @@ -575,7 +575,7 @@ maxfd = gsn->fd1u; /* use GTP kernel module for data packet encapsulation */ - if (gtp_kernel_init(gsn, &net, prefixlen, &args_info) < 0) + if (gtp_kernel_init(gsn, &net.v4, prefixlen, &args_info) < 0) goto err; gtp_set_cb_data_ind(gsn, encaps_tun); @@ -600,7 +600,7 @@ } DEBUGP(DGGSN, "Setting tun IP address\n"); - if (tun_setaddr(tun, &netaddr, &destaddr, &prefixlen)) { + if (tun_setaddr(tun, &netaddr, &destaddr, prefixlen)) { SYS_ERR(DGGSN, LOGL_ERROR, 0, "Failed to set tun IP address"); exit(1); } diff --git a/lib/tun.c b/lib/tun.c index 8325f5d..7e0af12 100644 --- a/lib/tun.c +++ b/lib/tun.c @@ -1,6 +1,7 @@ /* * TUN interface functions. * Copyright (C) 2002, 2003, 2004 Mondru AB. + * Copyright (C) 2017 by Harald Welte * * The contents of this file may be used under the terms of the GNU * General Public License Version 2, provided that the above copyright @@ -65,7 +66,12 @@ #include "tun.h" #include "syserr.h" +static int tun_setaddr4(struct tun_t *this, struct in_addr *addr, + struct in_addr *dstaddr, struct in_addr *netmask); + #if defined(__linux__) + +#include int tun_nlattr(struct nlmsghdr *n, int nsize, int type, void *d, int dlen) { @@ -247,7 +253,7 @@ struct msghdr msg; if (!this->addrs) /* Use ioctl for first addr to make ping work */ - return tun_setaddr(this, addr, dstaddr, netmask); + return tun_setaddr4(this, addr, dstaddr, netmask); memset(&req, 0, sizeof(req)); req.n.nlmsg_len = NLMSG_LENGTH(sizeof(struct ifaddrmsg)); @@ -345,7 +351,7 @@ /* TODO: Is this needed on FreeBSD? */ if (!this->addrs) /* Use ioctl for first addr to make ping work */ - return tun_setaddr(this, addr, dstaddr, netmask); /* TODO dstaddr */ + return tun_setaddr4(this, addr, dstaddr, netmask); /* TODO dstaddr */ memset(&areq, 0, sizeof(areq)); @@ -391,7 +397,7 @@ #elif defined (__sun__) if (!this->addrs) /* Use ioctl for first addr to make ping work */ - return tun_setaddr(this, addr, dstaddr, netmask); + return tun_setaddr4(this, addr, dstaddr, netmask); SYS_ERR(DTUN, LOGL_ERROR, errno, "Setting multiple addresses not possible on Solaris"); @@ -403,9 +409,8 @@ } -int tun_setaddr(struct tun_t *this, - struct in_addr *addr, - struct in_addr *dstaddr, struct in_addr *netmask) +static int tun_setaddr4(struct tun_t *this, struct in_addr *addr, + struct in_addr *dstaddr, struct in_addr *netmask) { struct ifreq ifr; int fd; @@ -498,13 +503,99 @@ tun_sifflags(this, IFF_UP | IFF_RUNNING); #if defined(__FreeBSD__) || defined (__APPLE__) - tun_addroute(this, dstaddr, addr, netmask); + tun_addroute(this, dstaddr, addr, &this->netmask); this->routes = 1; #endif return 0; } +static int tun_setaddr6(struct tun_t *this, struct in6_addr *addr, struct in6_addr *dstaddr, + size_t prefixlen) +{ + struct in6_ifreq ifr; + struct ifreq namereq; + int fd; + + memset(&ifr, 0, sizeof(ifr)); + memset(&namereq, 0, sizeof(namereq)); + + /* Create a channel to the NET kernel */ + if ((fd = socket(AF_INET6, SOCK_DGRAM, 0)) < 0) { + SYS_ERR(DTUN, LOGL_ERROR, 0, "socket() failed"); + return -1; + } + + /* get interface index */ + strncpy(namereq.ifr_name, this->devname, IFNAMSIZ); + namereq.ifr_name[IFNAMSIZ-1] = 0; + if (ioctl(fd, SIOGIFINDEX, &namereq) < 0) { + SYS_ERR(DTUN, LOGL_ERROR, 0, "Could not get ifindex"); + return -1; + } + ifr.ifr6_ifindex = namereq.ifr_ifindex; + ifr.ifr6_prefixlen = prefixlen; + + if (addr) { + memcpy(&this->addr, addr, sizeof(*addr)); + memcpy(&ifr.ifr6_addr, addr, sizeof(*addr)); + if (ioctl(fd, SIOCSIFADDR, (void *) &ifr) < 0) { + if (errno != EEXIST) { + SYS_ERR(DTUN, LOGL_ERROR, 0, "ioctl(SIOCSIFADDR) failed"); + } else { + SYS_ERR(DTUN, LOGL_NOTICE, 0, "ioctl(SIOCSIFADDR): Address alreadsy exists"); + } + close(fd); + return -1; + } + } + +#if 0 + /* FIXME: looks like this is not possible/necessary for IPv6? */ + if (dstaddr) { + memcpy(&this->dstaddr, dstaddr, sizeof(*dstaddr)); + memcpy(&ifr.ifr6_addr, dstaddr, sizeof(*dstaddr)); + if (ioctl(fd, SIOCSIFDSTADDR, (caddr_t *) &ifr) < 0) { + SYS_ERR(DTUN, LOGL_ERROR, "ioctl(SIOCSIFDSTADDR) failed"); + close(fd); + return -1; + } + } +#endif + + close(fd); + this->addrs++; + + /* On linux the route to the interface is set automatically + on FreeBSD we have to do this manually */ + + /* TODO: How does it work on Solaris? */ + + tun_sifflags(this, IFF_UP | IFF_RUNNING); + +#if 0 /* FIXME */ +//#if defined(__FreeBSD__) || defined (__APPLE__) + tun_addroute6(this, dstaddr, addr, prefixlen); + this->routes = 1; +#endif + + return 0; +} + +int tun_setaddr(struct tun_t *this, struct in46_addr *addr, struct in46_addr *dstaddr, size_t prefixlen) +{ + struct in_addr netmask; + switch (addr->len) { + case 4: + netmask.s_addr = htonl(0xffffffff << (32 - prefixlen)); + return tun_setaddr4(this, &addr->v4, dstaddr ? &dstaddr->v4 : NULL, &netmask); + case 16: + return tun_setaddr6(this, &addr->v6, dstaddr ? &dstaddr->v6 : NULL, prefixlen); + default: + return -1; + } +} + int tun_route(struct tun_t *this, struct in_addr *dst, struct in_addr *gateway, struct in_addr *mask, int delete) diff --git a/lib/tun.h b/lib/tun.h index 5143ccd..4716253 100644 --- a/lib/tun.h +++ b/lib/tun.h @@ -1,6 +1,7 @@ /* * TUN interface functions. * Copyright (C) 2002, 2003 Mondru AB. + * Copyright (C) 2017 by Harald Welte * * The contents of this file may be used under the terms of the GNU * General Public License Version 2, provided that the above copyright @@ -11,6 +12,8 @@ #ifndef _TUN_H #define _TUN_H + +#include "../lib/in46_addr.h" #define PACKET_MAX 8196 /* Maximum packet size we receive */ #define TUN_SCRIPTSIZE 256 @@ -40,8 +43,8 @@ extern int tun_addaddr(struct tun_t *this, struct in_addr *addr, struct in_addr *dstaddr, struct in_addr *netmask); -extern int tun_setaddr(struct tun_t *this, struct in_addr *our_adr, - struct in_addr *his_adr, struct in_addr *net_mask); +extern int tun_setaddr(struct tun_t *this, struct in46_addr *our_adr, + struct in46_addr *his_adr, size_t prefixlen); int tun_addroute(struct tun_t *this, struct in_addr *dst, struct in_addr *gateway, struct in_addr *mask); -- To view, visit https://gerrit.osmocom.org/3408 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I899d21e52d02e0b8384af29ddd489ff19c8f2cf6 Gerrit-PatchSet: 2 Gerrit-Project: openggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Aug 2 23:40:50 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 2 Aug 2017 23:40:50 +0000 Subject: [PATCH] openggsn[master]: ippool: Add IPv6 support to IP pool implementation In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3403 to look at the new patch set (#2). ippool: Add IPv6 support to IP pool implementation Change-Id: Ib98cc4bf634d6be9a7bf8c03a24e629455fcafc8 --- M ggsn/ggsn.c M ggsn/gtp-kernel.c M ggsn/gtp-kernel.h M lib/Makefile.am A lib/in46_addr.c A lib/in46_addr.h M lib/ippool.c M lib/ippool.h M sgsnemu/sgsnemu.c 9 files changed, 372 insertions(+), 169 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openggsn refs/changes/03/3403/2 diff --git a/ggsn/ggsn.c b/ggsn/ggsn.c index 4d07f11..00c7174 100644 --- a/ggsn/ggsn.c +++ b/ggsn/ggsn.c @@ -56,6 +56,7 @@ #include "../lib/tun.h" #include "../lib/ippool.h" #include "../lib/syserr.h" +#include "../lib/in46_addr.h" #include "../gtp/pdp.h" #include "../gtp/gtp.h" #include "cmdline.h" @@ -65,7 +66,8 @@ int maxfd = 0; /* For select() */ struct in_addr listen_; -struct in_addr netaddr, destaddr, net, mask; /* Network interface */ +struct in_addr netaddr, destaddr, net; /* Network interface */ +size_t prefixlen; struct in_addr dns1, dns2; /* PCO DNS address */ char *ipup, *ipdown; /* Filename of scripts */ int debug; /* Print debug output */ @@ -135,9 +137,12 @@ static bool send_trap(const struct gsn_t *gsn, const struct pdp_t *pdp, const struct ippoolm_t *member, const char *var) { + char addrbuf[256]; char val[NAMESIZE]; - snprintf(val, sizeof(val), "%" PRIu64 ",%s", pdp->imsi, inet_ntoa(member->addr)); + const char *addrstr = in46a_ntop(&member->addr, addrbuf, sizeof(addrbuf)); + + snprintf(val, sizeof(val), "%" PRIu64 ",%s", pdp->imsi, addrstr); if (ctrl_cmd_send_trap(gsn->ctrl, var, val) < 0) { LOGP(DGGSN, LOGL_ERROR, "Failed to create and send TRAP for IMSI %" PRIu64 " [%s].\n", pdp->imsi, var); @@ -168,7 +173,7 @@ int create_context_ind(struct pdp_t *pdp) { - struct in_addr addr; + struct in46_addr addr; struct ippoolm_t *member; DEBUGP(DGGSN, "Received create PDP context request\n"); @@ -181,8 +186,8 @@ memcpy(pdp->qos_neg.v, pdp->qos_req.v, pdp->qos_req.l); /* TODO */ pdp->qos_neg.l = pdp->qos_req.l; - if (pdp_euaton(&pdp->eua, &addr)) { - addr.s_addr = 0; /* Request dynamic */ + if (pdp_euaton(&pdp->eua, &addr.v4)) { + addr.v4.s_addr = 0; /* Request dynamic */ } if (ippool_newip(ippool, &member, &addr, 0)) { @@ -190,7 +195,7 @@ return 0; /* Allready in use, or no more available */ } - pdp_ntoeua(&member->addr, &pdp->eua); + pdp_ntoeua(&member->addr.v4, &pdp->eua); pdp->peer = member; pdp->ipif = tun; /* TODO */ member->peer = pdp; @@ -213,10 +218,18 @@ int cb_tun_ind(struct tun_t *tun, void *pack, unsigned len) { struct ippoolm_t *ipm; - struct in_addr dst; + struct in46_addr dst; struct tun_packet_t *iph = (struct tun_packet_t *)pack; - dst.s_addr = iph->dst; + if (iph->ver == 4) { + if (len < sizeof(*iph) || len < 4*iph->ihl) + return -1; + dst.len = 4; + dst.v4.s_addr = iph->dst; + } else { + LOGP(DGGSN, LOGL_NOTICE, "non-IPv4 packet received from tun\n"); + return -1; + } DEBUGP(DGGSN, "Received packet from tun!\n"); @@ -381,12 +394,14 @@ /* net */ /* Store net as in_addr net and mask */ if (args_info.net_arg) { - if (ippool_aton(&net, &mask, args_info.net_arg, 0)) { + struct in46_addr in46; + if (ippool_aton(&in46, &prefixlen, args_info.net_arg, 0)) { SYS_ERR(DGGSN, LOGL_ERROR, 0, "Invalid network address: %s!", args_info.net_arg); exit(1); } + net.s_addr = in46.v4.s_addr; netaddr.s_addr = htonl(ntohl(net.s_addr) + 1); destaddr.s_addr = htonl(ntohl(net.s_addr) + 1); } else { @@ -545,7 +560,7 @@ maxfd = gsn->fd1u; /* use GTP kernel module for data packet encapsulation */ - if (gtp_kernel_init(gsn, &net, &mask, &args_info) < 0) + if (gtp_kernel_init(gsn, &net, prefixlen, &args_info) < 0) goto err; gtp_set_cb_data_ind(gsn, encaps_tun); @@ -570,7 +585,7 @@ } DEBUGP(DGGSN, "Setting tun IP address\n"); - if (tun_setaddr(tun, &netaddr, &destaddr, &mask)) { + if (tun_setaddr(tun, &netaddr, &destaddr, &prefixlen)) { SYS_ERR(DGGSN, LOGL_ERROR, 0, "Failed to set tun IP address"); exit(1); } diff --git a/ggsn/gtp-kernel.c b/ggsn/gtp-kernel.c index dbe5a9f..458ac27 100644 --- a/ggsn/gtp-kernel.c +++ b/ggsn/gtp-kernel.c @@ -70,17 +70,6 @@ printf("\n"); } -static int mask2prefix(struct in_addr *mask) -{ - uint32_t tmp = ntohl(mask->s_addr); - int k; - - for (k=0; tmp > 0; k++) - tmp = (tmp << 1); - - return k; -} - static struct { int genl_id; struct mnl_socket *nl; @@ -91,7 +80,7 @@ #define GTP_DEVNAME "gtp0" int gtp_kernel_init(struct gsn_t *gsn, struct in_addr *net, - struct in_addr *mask, + size_t prefixlen, struct gengetopt_args_info *args_info) { if (!args_info->gtp_linux_given) @@ -126,7 +115,7 @@ DEBUGP(DGGSN, "Setting route to reach %s via %s\n", args_info->net_arg, GTP_DEVNAME); - if (gtp_dev_config(GTP_DEVNAME, net, mask2prefix(mask)) < 0) { + if (gtp_dev_config(GTP_DEVNAME, net, prefixlen) < 0) { SYS_ERR(DGGSN, LOGL_ERROR, 0, "Cannot add route to reach network %s\n", args_info->net_arg); diff --git a/ggsn/gtp-kernel.h b/ggsn/gtp-kernel.h index 83280a0..b3b29e3 100644 --- a/ggsn/gtp-kernel.h +++ b/ggsn/gtp-kernel.h @@ -8,7 +8,7 @@ #ifdef GTP_KERNEL int gtp_kernel_init(struct gsn_t *gsn, struct in_addr *net, - struct in_addr *mask, + size_t prefixlen, struct gengetopt_args_info *args_info); void gtp_kernel_stop(void); @@ -19,7 +19,7 @@ #else static inline int gtp_kernel_init(struct gsn_t *gsn, struct in_addr *net, - struct in_addr *mask, + size_t prefixlen, struct gengetopt_args_info *args_info) { if (args_info->gtp_linux_given) { diff --git a/lib/Makefile.am b/lib/Makefile.am index 756d566..632990c 100644 --- a/lib/Makefile.am +++ b/lib/Makefile.am @@ -1,7 +1,7 @@ noinst_LIBRARIES = libmisc.a -noinst_HEADERS = gnugetopt.h ippool.h lookup.h syserr.h tun.h +noinst_HEADERS = gnugetopt.h ippool.h lookup.h syserr.h tun.h in46_addr.h AM_CFLAGS = -O2 -fno-builtin -Wall -DSBINDIR='"$(sbindir)"' -ggdb $(LIBOSMOCORE_CFLAGS) -libmisc_a_SOURCES = getopt1.c getopt.c ippool.c lookup.c tun.c debug.c +libmisc_a_SOURCES = getopt1.c getopt.c ippool.c lookup.c tun.c debug.c in46_addr.c diff --git a/lib/in46_addr.c b/lib/in46_addr.c new file mode 100644 index 0000000..903ceec --- /dev/null +++ b/lib/in46_addr.c @@ -0,0 +1,148 @@ +/* + * IPv4/v6 address functions. + * Copyright (C) 2017 by Harald Welte + * + * The contents of this file may be used under the terms of the GNU + * General Public License Version 2, provided that the above copyright + * notice and this permission notice is included in all copies or + * substantial portions of the software. + * + */ + +#include "../lib/in46_addr.h" + +#include +#include +#include +#include +#include +#include +#include + +/*! Return the address family of given \reff in46_addr argument */ +int in46a_to_af(const struct in46_addr *in) +{ + switch (in->len) { + case 4: + return AF_INET; + case 16: + return AF_INET6; + default: + return -1; + } +} + +/*! Convert \ref in46_addr to sockaddr_storage */ +int in46a_to_sas(struct sockaddr_storage *out, const struct in46_addr *in) +{ + struct sockaddr_in *sin = (struct sockaddr_in *)out; + struct sockaddr_in6 *sin6 = (struct sockaddr_in6 *)out; + + switch (in->len) { + case 4: + sin->sin_family = AF_INET; + sin->sin_addr = in->v4; + break; + case 16: + sin6->sin6_family = AF_INET; + sin6->sin6_addr = in->v6; + break; + default: + return -1; + } + + return 0; +} + +/*! Convenience wrapper around inet_ntop() for \ref in46_addr */ +const char *in46a_ntop(const struct in46_addr *in, char *dst, socklen_t dst_size) +{ + int af = in46a_to_af(in); + if (af < 0) + return NULL; + + return inet_ntop(af, (const void *) &in->v4, dst, dst_size); +} + +/*! Determine if two in46_addr are equal or not + * \returns 1 in case they are equal; 0 otherwise */ +int in46a_equal(const struct in46_addr *a, const struct in46_addr *b) +{ + if (a->len == b->len && !memcmp(&a->v6, &b->v6, a->len)) + return 1; + else + return 0; +} + +/*! Match if IPv6 addr1 + addr2 are within same \a mask */ +static int ipv6_within_mask(const struct in6_addr *addr1, const struct in6_addr *addr2, + const struct in6_addr *mask) +{ + struct in6_addr masked = *addr2; +#if defined(__linux__) + masked.s6_addr32[0] &= mask->s6_addr32[0]; + masked.s6_addr32[1] &= mask->s6_addr32[1]; + masked.s6_addr32[2] &= mask->s6_addr32[2]; + masked.s6_addr32[3] &= mask->s6_addr32[3]; +#else + masked.__u6_addr.__u6_addr32[0] &= mask->__u6_addr.__u6_addr32[0]; + masked.__u6_addr.__u6_addr32[1] &= mask->__u6_addr.__u6_addr32[1]; + masked.__u6_addr.__u6_addr32[2] &= mask->__u6_addr.__u6_addr32[2]; + masked.__u6_addr.__u6_addr32[3] &= mask->__u6_addr.__u6_addr32[3]; +#endif + if (!memcmp(addr1, &masked, sizeof(struct in6_addr))) + return 1; + else + return 0; +} + +/*! Create an IPv6 netmask from the given prefix length */ +static void create_ipv6_netmask(struct in6_addr *netmask, int prefixlen) +{ + uint32_t *p_netmask; + memset(netmask, 0, sizeof(struct in6_addr)); + if (prefixlen < 0) + prefixlen = 0; + else if (128 < prefixlen) + prefixlen = 128; + +#if defined(__linux__) + p_netmask = &netmask->s6_addr32[0]; +#else + p_netmask = &netmask->__u6_addr.__u6_addr32[0]; +#endif + while (32 < prefixlen) { + *p_netmask = 0xffffffff; + p_netmask++; + prefixlen -= 32; + } + if (prefixlen != 0) { + *p_netmask = htonl(0xFFFFFFFF << (32 - prefixlen)); + } +} + +/*! Determine if given \a addr is within given \a net + \a prefixlen + * Builds the netmask from \a net + \a prefixlen and matches it to \a addr + * \returns 1 in case of a match, 0 otherwise */ +int in46a_within_mask(const struct in46_addr *addr, const struct in46_addr *net, size_t prefixlen) +{ + struct in_addr netmask; + struct in6_addr netmask6; + + if (addr->len != net->len) + return 0; + + switch (addr->len) { + case 4: + netmask.s_addr = htonl(0xFFFFFFFF << (32 - prefixlen)); + if ((addr->v4.s_addr & netmask.s_addr) == net->v4.s_addr) + return 1; + else + return 0; + case 16: + create_ipv6_netmask(&netmask6, prefixlen); + return ipv6_within_mask(&addr->v6, &net->v6, &netmask6); + default: + return 0; + } +} diff --git a/lib/in46_addr.h b/lib/in46_addr.h new file mode 100644 index 0000000..f28fd8e --- /dev/null +++ b/lib/in46_addr.h @@ -0,0 +1,19 @@ +#pragma once +#include +#include + +/* a simple wrapper around an in6_addr to also contain the length of the address, + * thereby implicitly indicating the address family of the address */ +struct in46_addr { + uint8_t len; + union { + struct in_addr v4; + struct in6_addr v6; + }; +}; + +extern int in46a_to_af(const struct in46_addr *in); +extern int in46a_to_sas(struct sockaddr_storage *out, const struct in46_addr *in); +extern const char *in46a_ntop(const struct in46_addr *in, char *dst, socklen_t dst_size); +extern int in46a_equal(const struct in46_addr *a, const struct in46_addr *b); +extern int in46a_within_mask(const struct in46_addr *addr, const struct in46_addr *net, size_t prefixlen); diff --git a/lib/ippool.c b/lib/ippool.c index 1f79a77..6c43ad7 100644 --- a/lib/ippool.c +++ b/lib/ippool.c @@ -1,6 +1,7 @@ /* * IP address pool functions. * Copyright (C) 2003, 2004 Mondru AB. + * Copyright (C) 2017 by Harald Welte * * The contents of this file may be used under the terms of the GNU * General Public License Version 2, provided that the above copyright @@ -13,9 +14,11 @@ #include /* in_addr */ #include /* calloc */ #include /* sscanf */ +#include #include #include #include +#include #include "syserr.h" #include "ippool.h" #include "lookup.h" @@ -31,13 +34,14 @@ printf("Listsize %d\n", this->listsize); for (n = 0; n < this->listsize; n++) { - printf("Unit %d inuse %d prev %d next %d addr %s %x\n", + char s[256]; + in46a_ntop(&this->member[n].addr, s, sizeof(s)); + printf("Unit %d inuse %d prev %d next %d addr %s\n", n, this->member[n].inuse, this->member[n].prev - this->member, this->member[n].next - this->member, - inet_ntoa(this->member[n].addr), - this->member[n].addr.s_addr); + s); } return 0; } @@ -49,7 +53,7 @@ struct ippoolm_t *p_prev = NULL; /* Insert into hash table */ - hash = ippool_hash4(&member->addr) & this->hashmask; + hash = ippool_hash(&member->addr) & this->hashmask; for (p = this->hash[hash]; p; p = p->nexthash) p_prev = p; if (!p_prev) @@ -66,7 +70,7 @@ struct ippoolm_t *p_prev = NULL; /* Find in hash table */ - hash = ippool_hash4(&member->addr) & this->hashmask; + hash = ippool_hash(&member->addr) & this->hashmask; for (p = this->hash[hash]; p; p = p->nexthash) { if (p == member) { break; @@ -88,73 +92,98 @@ return 0; } -unsigned long int ippool_hash4(struct in_addr *addr) +static unsigned long int ippool_hash4(struct in_addr *addr) { return lookup((unsigned char *)&addr->s_addr, sizeof(addr->s_addr), 0); } -#ifndef IPPOOL_NOIP6 -unsigned long int ippool_hash6(struct in6_addr *addr) +static unsigned long int ippool_hash6(struct in6_addr *addr) { - return lookup((unsigned char *)addr->u6_addr8, sizeof(addr->u6_addr8), + /* TODO: Review hash spread for IPv6 */ + return lookup((unsigned char *)addr->s6_addr, sizeof(addr->s6_addr), 0); } -#endif + +unsigned long int ippool_hash(struct in46_addr *addr) +{ + if (addr->len == 4) + return ippool_hash4(&addr->v4); + else + return ippool_hash6(&addr->v6); +} /* Get IP address and mask */ -int ippool_aton(struct in_addr *addr, struct in_addr *mask, - char *pool, int number) +int ippool_aton(struct in46_addr *addr, size_t *prefixlen, const char *pool_in, int number) { + struct addrinfo *ai; + struct addrinfo hints = { + .ai_family = AF_UNSPEC, + .ai_socktype = SOCK_DGRAM, + .ai_flags = 0, + .ai_protocol = 0 + }; + char *pool = alloca(strlen(pool_in)+1); - /* Parse only first instance of network for now */ - /* Eventually "number" will indicate the token which we want to parse */ + strcpy(pool, pool_in); - unsigned int a1, a2, a3, a4; - unsigned int m1, m2, m3, m4; - int c; - int m; - int masklog; + int err; - c = sscanf(pool, "%u.%u.%u.%u/%u.%u.%u.%u", - &a1, &a2, &a3, &a4, &m1, &m2, &m3, &m4); - switch (c) { - case 4: - mask->s_addr = 0xffffffff; - break; - case 5: - if (m1 > 32) { - SYS_ERR(DIP, LOGL_ERROR, 0, "Invalid mask"); - return -1; /* Invalid mask */ + /* Find '/' and point to first char after it */ + char *prefixlen_str = strchr(pool, '/'); + if (prefixlen_str) { + *prefixlen_str = '\0'; + prefixlen_str++; + if (*prefixlen_str == '\0') { + SYS_ERR(DIP, LOGL_ERROR, 0, "Empty prefix length specified"); + return -1; } - mask->s_addr = htonl(0xffffffff << (32 - m1)); - break; - case 8: - if (m1 >= 256 || m2 >= 256 || m3 >= 256 || m4 >= 256) { - SYS_ERR(DIP, LOGL_ERROR, 0, "Invalid mask"); - return -1; /* Wrong mask format */ - } - m = m1 * 0x1000000 + m2 * 0x10000 + m3 * 0x100 + m4; - for (masklog = 0; ((1 << masklog) < ((~m) + 1)); masklog++) ; - if (((~m) + 1) != (1 << masklog)) { - SYS_ERR(DIP, LOGL_ERROR, 0, "Invalid mask"); - return -1; /* Wrong mask format (not all ones followed by all zeros) */ - } - mask->s_addr = htonl(m); - break; - default: - SYS_ERR(DIP, LOGL_ERROR, 0, "Invalid mask"); - return -1; /* Invalid mask */ } - if (a1 >= 256 || a2 >= 256 || a3 >= 256 || a4 >= 256) { - SYS_ERR(DIP, LOGL_ERROR, 0, - "Wrong IP address format"); + /* convert address */ + if ((err = getaddrinfo(pool, NULL, &hints, &ai))) { + SYS_ERR(DIP, LOGL_ERROR, 0, "Bad address"); return -1; - } else - addr->s_addr = - htonl(a1 * 0x1000000 + a2 * 0x10000 + a3 * 0x100 + a4); + } + + /* Copy address, set lengths */ + if (ai->ai_family == AF_INET) { + *prefixlen = 32; + addr->len = sizeof(struct in_addr); + addr->v4 = ((struct sockaddr_in*)ai->ai_addr)->sin_addr; + } else { + *prefixlen = 128; + addr->len = sizeof(struct in6_addr); + addr->v6 = ((struct sockaddr_in6*)ai->ai_addr)->sin6_addr; + } + freeaddrinfo(ai); + + /* parse prefixlen */ + if (prefixlen_str) { + char *e; + *prefixlen = strtol(prefixlen_str, &e, 10); + if (*e != '\0') { + SYS_ERR(DIP, LOGL_ERROR, 0, "Prefixlen is not an int"); + return -1; + } + } + + if (*prefixlen > (addr->len * 8)) { + SYS_ERR(DIP, LOGL_ERROR, 0, "Perfixlen too big"); + return -1; + } return 0; +} + +/* Increase IPv4/IPv6 address by 1 */ +void in46a_inc(struct in46_addr *addr) +{ + size_t addrlen; + uint8_t *a = (uint8_t *)&addr->v6; + for (addrlen = addr->len; addrlen > 0; addrlen--) { + if (++a[addrlen-1]) + break; + } } /* Create new address pool */ @@ -165,11 +194,10 @@ /* Parse only first instance of pool for now */ int i; - struct in_addr addr; - struct in_addr mask; - struct in_addr stataddr; - struct in_addr statmask; - unsigned int m; + struct in46_addr addr; + size_t addrprefixlen; + struct in46_addr stataddr; + size_t stataddrprefixlen; int listsize; int dynsize; unsigned int statsize; @@ -177,7 +205,7 @@ if (!allowdyn) { dynsize = 0; } else { - if (ippool_aton(&addr, &mask, dyn, 0)) { + if (ippool_aton(&addr, &addrprefixlen, dyn, 0)) { SYS_ERR(DIP, LOGL_ERROR, 0, "Failed to parse dynamic pool"); return -1; @@ -188,8 +216,7 @@ flags |= IPPOOL_NONETWORK; } - m = ntohl(mask.s_addr); - dynsize = ((~m) + 1); + dynsize = (1 << (addr.len*8 - addrprefixlen)) -1; if (flags & IPPOOL_NONETWORK) /* Exclude network address from pool */ dynsize--; if (flags & IPPOOL_NOGATEWAY) /* Exclude gateway address from pool */ @@ -200,17 +227,16 @@ if (!allowstat) { statsize = 0; - stataddr.s_addr = 0; - statmask.s_addr = 0; + stataddr.len = 0; + stataddrprefixlen = 0; } else { - if (ippool_aton(&stataddr, &statmask, stat, 0)) { + if (ippool_aton(&stataddr, &stataddrprefixlen, stat, 0)) { SYS_ERR(DIP, LOGL_ERROR, 0, "Failed to parse static range"); return -1; } - m = ntohl(statmask.s_addr); - statsize = ((~m) + 1); + statsize = (1 << (addr.len - addrprefixlen + 1)) -1; if (statsize > IPPOOL_STATSIZE) statsize = IPPOOL_STATSIZE; } @@ -225,8 +251,9 @@ (*this)->allowdyn = allowdyn; (*this)->allowstat = allowstat; - (*this)->stataddr = stataddr; - (*this)->statmask = statmask; + if (stataddr.len > 0) + (*this)->stataddr = stataddr; + (*this)->stataddrprefixlen = stataddrprefixlen; (*this)->listsize += listsize; if (!((*this)->member = calloc(sizeof(struct ippoolm_t), listsize))) { @@ -255,17 +282,15 @@ (*this)->firstdyn = NULL; (*this)->lastdyn = NULL; + if (flags & IPPOOL_NOGATEWAY) { + in46a_inc(&addr); + in46a_inc(&addr); + } else if (flags & IPPOOL_NONETWORK) { + in46a_inc(&addr); + } for (i = 0; i < dynsize; i++) { - - if (flags & IPPOOL_NOGATEWAY) - (*this)->member[i].addr.s_addr = - htonl(ntohl(addr.s_addr) + i + 2); - else if (flags & IPPOOL_NONETWORK) - (*this)->member[i].addr.s_addr = - htonl(ntohl(addr.s_addr) + i + 1); - else - (*this)->member[i].addr.s_addr = - htonl(ntohl(addr.s_addr) + i); + (*this)->member[i].addr = addr; + in46a_inc(&addr); (*this)->member[i].inuse = 0; @@ -285,8 +310,8 @@ (*this)->firststat = NULL; (*this)->laststat = NULL; for (i = dynsize; i < listsize; i++) { - - (*this)->member[i].addr.s_addr = 0; + struct in46_addr *i6al = &(*this)->member[i].addr; + memset(i6al, 0, sizeof(*i6al)); (*this)->member[i].inuse = 0; /* Insert into list of unused */ @@ -316,15 +341,15 @@ /* Find an IP address in the pool */ int ippool_getip(struct ippool_t *this, struct ippoolm_t **member, - struct in_addr *addr) + struct in46_addr *addr) { struct ippoolm_t *p; uint32_t hash; /* Find in hash table */ - hash = ippool_hash4(addr) & this->hashmask; + hash = ippool_hash(addr) & this->hashmask; for (p = this->hash[hash]; p; p = p->nexthash) { - if ((p->addr.s_addr == addr->s_addr) && (p->inuse)) { + if (in46a_equal(&p->addr, addr)) { if (member) *member = p; return 0; @@ -344,7 +369,7 @@ * address space. **/ int ippool_newip(struct ippool_t *this, struct ippoolm_t **member, - struct in_addr *addr, int statip) + struct in46_addr *addr, int statip) { struct ippoolm_t *p; struct ippoolm_t *p2 = NULL; @@ -365,17 +390,23 @@ if (0) (void)ippool_printaddr(this); + int specified = 0; + if (addr) { + if (addr->len == 4 && addr->v4.s_addr) + specified = 1; + if (addr->len == 16 && !IN6_IS_ADDR_UNSPECIFIED(&addr->v6)) + specified = 1; + } + /* First check to see if this type of address is allowed */ - if ((addr) && (addr->s_addr) && statip) { /* IP address given */ + if (specified && statip) { /* IP address given */ if (!this->allowstat) { SYS_ERR(DIP, LOGL_ERROR, 0, "Static IP address not allowed"); return -1; } - if ((addr->s_addr & this->statmask.s_addr) != - this->stataddr.s_addr) { - SYS_ERR(DIP, LOGL_ERROR, 0, - "Static out of range"); + if (!in46a_within_mask(addr, &this->stataddr, this->stataddrprefixlen)) { + SYS_ERR(DIP, LOGL_ERROR, 0, "Static out of range"); return -1; } } else { @@ -387,11 +418,11 @@ } /* If IP address given try to find it in dynamic address pool */ - if ((addr) && (addr->s_addr)) { /* IP address given */ + if (specified) { /* IP address given */ /* Find in hash table */ - hash = ippool_hash4(addr) & this->hashmask; + hash = ippool_hash(addr) & this->hashmask; for (p = this->hash[hash]; p; p = p->nexthash) { - if ((p->addr.s_addr == addr->s_addr)) { + if (in46a_equal(&p->addr, addr)) { p2 = p; break; } @@ -420,6 +451,11 @@ return -1; /* Allready in use / Should not happen */ } + if (p2->addr.len != addr->len) { + SYS_ERR(DIP, LOGL_ERROR, 0, "MS requested unsupported PDP context type"); + return -1; + } + /* Remove from linked list of free dynamic addresses */ if (p2->prev) p2->prev->next = p2->next; @@ -442,13 +478,18 @@ /* It was not possible to allocate from dynamic address pool */ /* Try to allocate from static address space */ - if ((addr) && (addr->s_addr) && (statip)) { /* IP address given */ + if (specified && (statip)) { /* IP address given */ if (!this->firststat) { SYS_ERR(DIP, LOGL_ERROR, 0, "No more IP addresses available"); return -1; /* No more available */ } else p2 = this->firststat; + + if (p2->addr.len != addr->len) { + SYS_ERR(DIP, LOGL_ERROR, 0, "MS requested unsupported PDP context type"); + return -1; + } /* Remove from linked list of free static addresses */ if (p2->prev) @@ -518,7 +559,7 @@ this->laststat = member; member->inuse = 0; - member->addr.s_addr = 0; + memset(&member->addr, 0, sizeof(member->addr)); member->peer = NULL; member->nexthash = NULL; if (0) @@ -530,9 +571,3 @@ return -1; } } - -#ifndef IPPOOL_NOIP6 -extern unsigned long int ippool_hash6(struct in6_addr *addr); -extern int ippool_getip6(struct ippool_t *this, struct in6_addr *addr); -extern int ippool_returnip6(struct ippool_t *this, struct in6_addr *addr); -#endif diff --git a/lib/ippool.h b/lib/ippool.h index 534140d..53154f2 100644 --- a/lib/ippool.h +++ b/lib/ippool.h @@ -12,6 +12,8 @@ #ifndef _IPPOOL_H #define _IPPOOL_H +#include "../lib/in46_addr.h" + /* Assuming that the address space is fragmented we need a hash table in order to return the addresses. @@ -26,8 +28,6 @@ in RFC2373. */ -#define IPPOOL_NOIP6 - #define IPPOOL_NONETWORK 0x01 #define IPPOOL_NOBROADCAST 0x02 #define IPPOOL_NOGATEWAY 0x04 @@ -40,8 +40,8 @@ unsigned int listsize; /* Total number of addresses */ int allowdyn; /* Allow dynamic IP address allocation */ int allowstat; /* Allow static IP address allocation */ - struct in_addr stataddr; /* Static address range network address */ - struct in_addr statmask; /* Static address range network mask */ + struct in46_addr stataddr; /* Static address range network address */ + size_t stataddrprefixlen; /* IPv6 prefix length of stataddr */ struct ippoolm_t *member; /* Listsize array of members */ unsigned int hashsize; /* Size of hash table */ int hashlog; /* Log2 size of hash table */ @@ -54,11 +54,7 @@ }; struct ippoolm_t { -#ifndef IPPOOL_NOIP6 - struct in6_addr addr; /* IP address of this member */ -#else - struct in_addr addr; /* IP address of this member */ -#endif + struct in46_addr addr; /* IP address of this member */ int inuse; /* 0=available; 1= dynamic; 2 = static */ struct ippoolm_t *nexthash; /* Linked list part of hash table */ struct ippoolm_t *prev, *next; /* Linked list of free dynamic or static */ @@ -70,7 +66,7 @@ bytes for each address. */ /* Hash an IP address using code based on Bob Jenkins lookupa */ -extern unsigned long int ippool_hash4(struct in_addr *addr); +extern unsigned long int ippool_hash(struct in46_addr *addr); /* Create new address pool */ extern int ippool_new(struct ippool_t **this, char *dyn, char *stat, @@ -81,24 +77,20 @@ /* Find an IP address in the pool */ extern int ippool_getip(struct ippool_t *this, struct ippoolm_t **member, - struct in_addr *addr); + struct in46_addr *addr); /* Get an IP address. If addr = 0.0.0.0 get a dynamic IP address. Otherwise check to see if the given address is available */ extern int ippool_newip(struct ippool_t *this, struct ippoolm_t **member, - struct in_addr *addr, int statip); + struct in46_addr *addr, int statip); /* Return a previously allocated IP address */ extern int ippool_freeip(struct ippool_t *this, struct ippoolm_t *member); /* Get net and mask based on ascii string */ -extern int ippool_aton(struct in_addr *addr, struct in_addr *mask, - char *pool, int number); +int ippool_aton(struct in46_addr *addr, size_t *prefixlen, const char *pool, int number); -#ifndef IPPOOL_NOIP6 -extern unsigned long int ippool_hash6(struct in6_addr *addr); -extern int ippool_getip6(struct ippool_t *this, struct in6_addr *addr); -extern int ippool_returnip6(struct ippool_t *this, struct in6_addr *addr); -#endif +/* Increase IPv4/IPv6 address by 1 */ +extern void in46a_inc(struct in46_addr *addr); #endif /* !_IPPOOL_H */ diff --git a/sgsnemu/sgsnemu.c b/sgsnemu/sgsnemu.c index 1567e7e..90a6200 100644 --- a/sgsnemu/sgsnemu.c +++ b/sgsnemu/sgsnemu.c @@ -58,7 +58,7 @@ uint8_t inuse; /* 0=free. 1=used by somebody */ struct iphash_t *ipnext; struct pdp_t *pdp; - struct in_addr addr; + struct in46_addr addr; }; struct iphash_t iparr[MAXCONTEXTS]; struct iphash_t *iphash[MAXCONTEXTS]; @@ -81,7 +81,8 @@ struct { int debug; /* Print debug messages */ int createif; /* Create local network interface */ - struct in_addr netaddr, destaddr, net, mask; /* Network interface */ + struct in_addr netaddr, destaddr, net; /* Network interface */ + size_t prefixlen; char *ipup, *ipdown; /* Filename of scripts */ int defaultroute; /* Set up default route */ struct in_addr pinghost; /* Remote ping host */ @@ -160,13 +161,13 @@ state = 3; /* Tell main loop to finish. */ } -int ipset(struct iphash_t *ipaddr, struct in_addr *addr) +int ipset(struct iphash_t *ipaddr, struct in46_addr *addr) { - int hash = ippool_hash4(addr) % MAXCONTEXTS; + int hash = ippool_hash(addr) % MAXCONTEXTS; struct iphash_t *h; struct iphash_t *prev = NULL; ipaddr->ipnext = NULL; - ipaddr->addr.s_addr = addr->s_addr; + ipaddr->addr = *addr; for (h = iphash[hash]; h; h = h->ipnext) prev = h; if (!prev) @@ -178,7 +179,7 @@ int ipdel(struct iphash_t *ipaddr) { - int hash = ippool_hash4(&ipaddr->addr) % MAXCONTEXTS; + int hash = ippool_hash(&ipaddr->addr) % MAXCONTEXTS; struct iphash_t *h; struct iphash_t *prev = NULL; for (h = iphash[hash]; h; h = h->ipnext) { @@ -194,12 +195,12 @@ return EOF; /* End of linked list and not found */ } -int ipget(struct iphash_t **ipaddr, struct in_addr *addr) +int ipget(struct iphash_t **ipaddr, struct in46_addr *addr) { - int hash = ippool_hash4(addr) % MAXCONTEXTS; + int hash = ippool_hash(addr) % MAXCONTEXTS; struct iphash_t *h; for (h = iphash[hash]; h; h = h->ipnext) { - if ((h->addr.s_addr == addr->s_addr)) { + if (in46a_equal(&h->addr, addr)) { *ipaddr = h; return 0; } @@ -859,15 +860,17 @@ /* net */ /* Store net as in_addr net and mask */ if (args_info.net_arg) { + struct in46_addr in46; if (ippool_aton - (&options.net, &options.mask, args_info.net_arg, 0)) { + (&in46, &options.prefixlen, args_info.net_arg, 0)) { SYS_ERR(DSGSN, LOGL_ERROR, 0, "Invalid network address: %s!", args_info.net_arg); exit(1); } + options.net.s_addr = in46.v4.s_addr; #if defined (__sun__) - options.netaddr.s_addr = htonl(ntohl(options.net.s_addr) + 1); + options.netaddrs_addr = htonl(ntohl(options.net.s_addr) + 1); options.destaddr.s_addr = htonl(ntohl(options.net.s_addr) + 1); #else options.netaddr.s_addr = options.net.s_addr; @@ -876,7 +879,7 @@ } else { options.net.s_addr = 0; - options.mask.s_addr = 0; + options.prefixlen = 0; options.netaddr.s_addr = 0; options.destaddr.s_addr = 0; } @@ -1277,14 +1280,15 @@ int cb_tun_ind(struct tun_t *tun, void *pack, unsigned len) { struct iphash_t *ipm; - struct in_addr src; + struct in46_addr src; struct tun_packet_t *iph = (struct tun_packet_t *)pack; - src.s_addr = iph->src; + src.len = 4; + src.v4.s_addr = iph->src; if (ipget(&ipm, &src)) { printf("Dropping packet from invalid source address: %s\n", - inet_ntoa(src)); + inet_ntoa(src.v4)); return 0; } @@ -1295,7 +1299,7 @@ int create_pdp_conf(struct pdp_t *pdp, void *cbp, int cause) { - struct in_addr addr; + struct in46_addr addr; struct iphash_t *iph = (struct iphash_t *)cbp; @@ -1324,7 +1328,7 @@ return EOF; /* Not what we expected */ } - if (pdp_euaton(&pdp->eua, &addr)) { + if (pdp_euaton(&pdp->eua, &addr.v4)) { printf ("Received create PDP context response. Cause value: %d\n", cause); @@ -1335,7 +1339,7 @@ } printf("Received create PDP context response. IP address: %s\n", - inet_ntoa(addr)); + inet_ntoa(addr.v4)); if ((options.createif) && (!options.net.s_addr)) { struct in_addr m; @@ -1345,11 +1349,11 @@ m.s_addr = -1; #endif /* printf("Setting up interface and routing\n"); */ - tun_addaddr(tun, &addr, &addr, &m); + tun_addaddr(tun, &addr.v4, &addr.v4, &m); if (options.defaultroute) { struct in_addr rm; rm.s_addr = 0; - tun_addroute(tun, &rm, &addr, &rm); + tun_addroute(tun, &rm, &addr.v4, &rm); } if (options.ipup) tun_runscript(tun, options.ipup); @@ -1472,9 +1476,10 @@ } if ((options.createif) && (options.net.s_addr)) { + struct in_addr mask; + mask.s_addr = options.prefixlen ? (0xFFFFFFFF >> (32 - options.prefixlen)) : 0; /* printf("Setting up interface and routing\n"); */ - tun_addaddr(tun, &options.netaddr, &options.destaddr, - &options.mask); + tun_addaddr(tun, &options.netaddr, &options.destaddr, &mask); if (options.defaultroute) { struct in_addr rm; rm.s_addr = 0; -- To view, visit https://gerrit.osmocom.org/3403 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ib98cc4bf634d6be9a7bf8c03a24e629455fcafc8 Gerrit-PatchSet: 2 Gerrit-Project: openggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Aug 2 23:40:50 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 2 Aug 2017 23:40:50 +0000 Subject: [PATCH] openggsn[master]: IPv6 support for user IP In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3406 to look at the new patch set (#2). IPv6 support for user IP This patch enables the use of IPv6 PDP contexts. The phone will have to request an IPv6 End-user-Address, and the GGSN will have to be configured for an IPv6 pool. The outer transport-layer IP between SGSN and GGSN must still be IPv4, it is not modified by this patch Change-Id: I22c3bf32a98e5daf99d6eaeac8c9f95cc7574774 --- M ggsn/ggsn.c M lib/in46_addr.c M lib/in46_addr.h M sgsnemu/sgsnemu.c 4 files changed, 74 insertions(+), 4 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openggsn refs/changes/06/3406/2 diff --git a/ggsn/ggsn.c b/ggsn/ggsn.c index 11aea78..6ef7e54 100644 --- a/ggsn/ggsn.c +++ b/ggsn/ggsn.c @@ -35,6 +35,7 @@ #include #include #include +#include #include #include #include @@ -188,7 +189,7 @@ memcpy(pdp->qos_neg.v, pdp->qos_req.v, pdp->qos_req.l); /* TODO */ pdp->qos_neg.l = pdp->qos_req.l; - if (pdp_euaton(&pdp->eua, &addr.v4)) { + if (in46a_from_eua(&pdp->eua, &addr)) { addr.v4.s_addr = 0; /* Request dynamic */ } @@ -197,7 +198,7 @@ return 0; /* Allready in use, or no more available */ } - pdp_ntoeua(&member->addr.v4, &pdp->eua); + in46a_to_eua(&member->addr, &pdp->eua); pdp->peer = member; pdp->ipif = tun; /* TODO */ member->peer = pdp; @@ -222,14 +223,18 @@ struct ippoolm_t *ipm; struct in46_addr dst; struct iphdr *iph = (struct iphdr *)pack; + struct ip6_hdr *ip6h = (struct ip6_hdr *)pack; if (iph->version == 4) { if (len < sizeof(*iph) || len < 4*iph->ihl) return -1; dst.len = 4; dst.v4.s_addr = iph->daddr; + } else if (iph->version == 6) { + dst.len = 16; + dst.v6 = ip6h->ip6_dst; } else { - LOGP(DGGSN, LOGL_NOTICE, "non-IPv4 packet received from tun\n"); + LOGP(DGGSN, LOGL_NOTICE, "non-IPv packet received from tun\n"); return -1; } diff --git a/lib/in46_addr.c b/lib/in46_addr.c index 903ceec..844e318 100644 --- a/lib/in46_addr.c +++ b/lib/in46_addr.c @@ -146,3 +146,63 @@ return 0; } } + +/*! Convert given PDP End User Address to in46_addr + * \returns 0 on success; negative on error */ +int in46a_to_eua(const struct in46_addr *src, struct ul66_t *eua) +{ + switch (src->len) { + case 4: + eua->l = 6; + eua->v[0] = 0xf1; /* IETF */ + eua->v[1] = 0x21; /* IPv4 */ + memcpy(&eua->v[2], &src->v4, 4); /* Copy a 4 byte address */ + break; + case 16: + eua->l = 18; + eua->v[0] = 0xf1; /* IETF */ + eua->v[1] = 0x57; /* IPv6 */ + memcpy(&eua->v[2], &src->v6, 16); /* Copy a 16 byte address */ + break; + default: + return -1; + } + return 0; +} + +/*! Convert given in46_addr to PDP End User Address + * \returns 0 on success; negative on error */ +int in46a_from_eua(const struct ul66_t *eua, struct in46_addr *dst) +{ + if (eua->l < 2) + goto default_to_dyn_v4; + + if (eua->v[0] != 0xf1) + return -1; + + switch (eua->v[1]) { + case 0x21: + dst->len = 4; + if (eua->l >= 6) + memcpy(&dst->v4, &eua->v[2], 4); /* Copy a 4 byte address */ + else + dst->v4.s_addr = 0; + break; + case 0x57: + dst->len = 16; + if (eua->l >= 18) + memcpy(&dst->v6, &eua->v[2], 16); /* Copy a 16 byte address */ + else + memset(&dst->v6, 0, 16); + break; + default: + return -1; + } + return 0; + +default_to_dyn_v4: + /* assume dynamic IPv4 by default */ + dst->len = 4; + dst->v4.s_addr = 0; + return 0; +} diff --git a/lib/in46_addr.h b/lib/in46_addr.h index f28fd8e..a0ad6e1 100644 --- a/lib/in46_addr.h +++ b/lib/in46_addr.h @@ -2,6 +2,8 @@ #include #include +#include "../gtp/pdp.h" + /* a simple wrapper around an in6_addr to also contain the length of the address, * thereby implicitly indicating the address family of the address */ struct in46_addr { @@ -17,3 +19,6 @@ extern const char *in46a_ntop(const struct in46_addr *in, char *dst, socklen_t dst_size); extern int in46a_equal(const struct in46_addr *a, const struct in46_addr *b); extern int in46a_within_mask(const struct in46_addr *addr, const struct in46_addr *net, size_t prefixlen); + +int in46a_to_eua(const struct in46_addr *src, struct ul66_t *eua); +int in46a_from_eua(const struct ul66_t *eua, struct in46_addr *dst); diff --git a/sgsnemu/sgsnemu.c b/sgsnemu/sgsnemu.c index af8f9fa..8c9cfd3 100644 --- a/sgsnemu/sgsnemu.c +++ b/sgsnemu/sgsnemu.c @@ -1329,7 +1329,7 @@ return EOF; /* Not what we expected */ } - if (pdp_euaton(&pdp->eua, &addr.v4)) { + if (in46a_from_eua(&pdp->eua, &addr)) { printf ("Received create PDP context response. Cause value: %d\n", cause); -- To view, visit https://gerrit.osmocom.org/3406 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I22c3bf32a98e5daf99d6eaeac8c9f95cc7574774 Gerrit-PatchSet: 2 Gerrit-Project: openggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Aug 2 23:40:50 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 2 Aug 2017 23:40:50 +0000 Subject: [PATCH] openggsn[master]: ggsn: Send proper errors in create_context_ind() In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3407 to look at the new patch set (#2). ggsn: Send proper errors in create_context_ind() When we receive PDP context requests for unknown PDP types or if we run out of dynamic addresses, we need to inform the SGSN that PDP context creation failed. Change-Id: Ibf199c1726130d27c8f80230b30ee51101c93b06 --- M ggsn/ggsn.c M lib/ippool.c M lib/ippool.h 3 files changed, 20 insertions(+), 11 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openggsn refs/changes/07/3407/2 diff --git a/ggsn/ggsn.c b/ggsn/ggsn.c index 6ef7e54..c1cea7e 100644 --- a/ggsn/ggsn.c +++ b/ggsn/ggsn.c @@ -178,6 +178,7 @@ { struct in46_addr addr; struct ippoolm_t *member; + int rc; DEBUGP(DGGSN, "Received create PDP context request\n"); @@ -190,11 +191,16 @@ pdp->qos_neg.l = pdp->qos_req.l; if (in46a_from_eua(&pdp->eua, &addr)) { - addr.v4.s_addr = 0; /* Request dynamic */ + SYS_ERR(DGGSN, LOGL_ERROR, 0, "Cannot decode EUA from MS/SGSN: %s", + osmo_hexdump(pdp->eua.v, pdp->eua.l)); + gtp_create_context_resp(gsn, pdp, GTPCAUSE_UNKNOWN_PDP); + return 0; } - if (ippool_newip(ippool, &member, &addr, 0)) { - gtp_create_context_resp(gsn, pdp, GTPCAUSE_NO_RESOURCES); + rc = ippool_newip(ippool, &member, &addr, 0); + if (rc < 0) { + SYS_ERR(DGGSN, LOGL_ERROR, 0, "Cannot allocate IP address in pool\n"); + gtp_create_context_resp(gsn, pdp, -rc); return 0; /* Allready in use, or no more available */ } @@ -206,6 +212,8 @@ if (gtp_kernel_tunnel_add(pdp) < 0) { SYS_ERR(DGGSN, LOGL_ERROR, 0, "Cannot add tunnel to kernel: %s\n", strerror(errno)); + gtp_create_context_resp(gsn, pdp, GTPCAUSE_SYS_FAIL); + return 0; } if (!send_trap(gsn, pdp, member, "imsi-ass-ip")) { /* TRAP with IP assignment */ diff --git a/lib/ippool.c b/lib/ippool.c index 9a3d0b3..305aae2 100644 --- a/lib/ippool.c +++ b/lib/ippool.c @@ -403,7 +403,7 @@ if (!this->allowstat) { SYS_ERR(DIP, LOGL_ERROR, 0, "Static IP address not allowed"); - return -1; + return -GTPCAUSE_NOT_SUPPORTED; } if (!in46a_within_mask(addr, &this->stataddr, this->stataddrprefixlen)) { SYS_ERR(DIP, LOGL_ERROR, 0, "Static out of range"); @@ -413,7 +413,7 @@ if (!this->allowdyn) { SYS_ERR(DIP, LOGL_ERROR, 0, "Dynamic IP address not allowed"); - return -1; + return -GTPCAUSE_NOT_SUPPORTED; } } @@ -439,7 +439,7 @@ if (!this->firstdyn) { SYS_ERR(DIP, LOGL_ERROR, 0, "No more IP addresses available"); - return -1; + return -GTPCAUSE_ADDR_OCCUPIED; } else p2 = this->firstdyn; } @@ -448,12 +448,12 @@ if (p2->inuse) { SYS_ERR(DIP, LOGL_ERROR, 0, "IP address allready in use"); - return -1; /* Allready in use / Should not happen */ + return -GTPCAUSE_SYS_FAIL; /* Allready in use / Should not happen */ } if (p2->addr.len != addr->len) { SYS_ERR(DIP, LOGL_ERROR, 0, "MS requested unsupported PDP context type"); - return -1; + return -GTPCAUSE_UNKNOWN_PDP; } /* Remove from linked list of free dynamic addresses */ @@ -482,13 +482,13 @@ if (!this->firststat) { SYS_ERR(DIP, LOGL_ERROR, 0, "No more IP addresses available"); - return -1; /* No more available */ + return -GTPCAUSE_ADDR_OCCUPIED; /* No more available */ } else p2 = this->firststat; if (p2->addr.len != addr->len) { SYS_ERR(DIP, LOGL_ERROR, 0, "MS requested unsupported PDP context type"); - return -1; + return -GTPCAUSE_UNKNOWN_PDP; } /* Remove from linked list of free static addresses */ @@ -513,7 +513,7 @@ SYS_ERR(DIP, LOGL_ERROR, 0, "Could not allocate IP address"); - return -1; /* Should never get here. TODO: Bad code */ + return -GTPCAUSE_SYS_FAIL; /* Should never get here. TODO: Bad code */ } int ippool_freeip(struct ippool_t *this, struct ippoolm_t *member) diff --git a/lib/ippool.h b/lib/ippool.h index e3c1c92..ba92a56 100644 --- a/lib/ippool.h +++ b/lib/ippool.h @@ -13,6 +13,7 @@ #define _IPPOOL_H #include "../lib/in46_addr.h" +#include "../gtp/gtp.h" /* Assuming that the address space is fragmented we need a hash table in order to return the addresses. -- To view, visit https://gerrit.osmocom.org/3407 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ibf199c1726130d27c8f80230b30ee51101c93b06 Gerrit-PatchSet: 2 Gerrit-Project: openggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Aug 2 23:48:09 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 2 Aug 2017 23:48:09 +0000 Subject: [PATCH] openggsn[master]: ippool: Add IPv6 support to IP pool implementation In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3403 to look at the new patch set (#3). ippool: Add IPv6 support to IP pool implementation Change-Id: Ib98cc4bf634d6be9a7bf8c03a24e629455fcafc8 --- M ggsn/ggsn.c M ggsn/gtp-kernel.c M ggsn/gtp-kernel.h M lib/Makefile.am A lib/in46_addr.c A lib/in46_addr.h M lib/ippool.c M lib/ippool.h M sgsnemu/sgsnemu.c 9 files changed, 371 insertions(+), 169 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openggsn refs/changes/03/3403/3 diff --git a/ggsn/ggsn.c b/ggsn/ggsn.c index 4d07f11..00c7174 100644 --- a/ggsn/ggsn.c +++ b/ggsn/ggsn.c @@ -56,6 +56,7 @@ #include "../lib/tun.h" #include "../lib/ippool.h" #include "../lib/syserr.h" +#include "../lib/in46_addr.h" #include "../gtp/pdp.h" #include "../gtp/gtp.h" #include "cmdline.h" @@ -65,7 +66,8 @@ int maxfd = 0; /* For select() */ struct in_addr listen_; -struct in_addr netaddr, destaddr, net, mask; /* Network interface */ +struct in_addr netaddr, destaddr, net; /* Network interface */ +size_t prefixlen; struct in_addr dns1, dns2; /* PCO DNS address */ char *ipup, *ipdown; /* Filename of scripts */ int debug; /* Print debug output */ @@ -135,9 +137,12 @@ static bool send_trap(const struct gsn_t *gsn, const struct pdp_t *pdp, const struct ippoolm_t *member, const char *var) { + char addrbuf[256]; char val[NAMESIZE]; - snprintf(val, sizeof(val), "%" PRIu64 ",%s", pdp->imsi, inet_ntoa(member->addr)); + const char *addrstr = in46a_ntop(&member->addr, addrbuf, sizeof(addrbuf)); + + snprintf(val, sizeof(val), "%" PRIu64 ",%s", pdp->imsi, addrstr); if (ctrl_cmd_send_trap(gsn->ctrl, var, val) < 0) { LOGP(DGGSN, LOGL_ERROR, "Failed to create and send TRAP for IMSI %" PRIu64 " [%s].\n", pdp->imsi, var); @@ -168,7 +173,7 @@ int create_context_ind(struct pdp_t *pdp) { - struct in_addr addr; + struct in46_addr addr; struct ippoolm_t *member; DEBUGP(DGGSN, "Received create PDP context request\n"); @@ -181,8 +186,8 @@ memcpy(pdp->qos_neg.v, pdp->qos_req.v, pdp->qos_req.l); /* TODO */ pdp->qos_neg.l = pdp->qos_req.l; - if (pdp_euaton(&pdp->eua, &addr)) { - addr.s_addr = 0; /* Request dynamic */ + if (pdp_euaton(&pdp->eua, &addr.v4)) { + addr.v4.s_addr = 0; /* Request dynamic */ } if (ippool_newip(ippool, &member, &addr, 0)) { @@ -190,7 +195,7 @@ return 0; /* Allready in use, or no more available */ } - pdp_ntoeua(&member->addr, &pdp->eua); + pdp_ntoeua(&member->addr.v4, &pdp->eua); pdp->peer = member; pdp->ipif = tun; /* TODO */ member->peer = pdp; @@ -213,10 +218,18 @@ int cb_tun_ind(struct tun_t *tun, void *pack, unsigned len) { struct ippoolm_t *ipm; - struct in_addr dst; + struct in46_addr dst; struct tun_packet_t *iph = (struct tun_packet_t *)pack; - dst.s_addr = iph->dst; + if (iph->ver == 4) { + if (len < sizeof(*iph) || len < 4*iph->ihl) + return -1; + dst.len = 4; + dst.v4.s_addr = iph->dst; + } else { + LOGP(DGGSN, LOGL_NOTICE, "non-IPv4 packet received from tun\n"); + return -1; + } DEBUGP(DGGSN, "Received packet from tun!\n"); @@ -381,12 +394,14 @@ /* net */ /* Store net as in_addr net and mask */ if (args_info.net_arg) { - if (ippool_aton(&net, &mask, args_info.net_arg, 0)) { + struct in46_addr in46; + if (ippool_aton(&in46, &prefixlen, args_info.net_arg, 0)) { SYS_ERR(DGGSN, LOGL_ERROR, 0, "Invalid network address: %s!", args_info.net_arg); exit(1); } + net.s_addr = in46.v4.s_addr; netaddr.s_addr = htonl(ntohl(net.s_addr) + 1); destaddr.s_addr = htonl(ntohl(net.s_addr) + 1); } else { @@ -545,7 +560,7 @@ maxfd = gsn->fd1u; /* use GTP kernel module for data packet encapsulation */ - if (gtp_kernel_init(gsn, &net, &mask, &args_info) < 0) + if (gtp_kernel_init(gsn, &net, prefixlen, &args_info) < 0) goto err; gtp_set_cb_data_ind(gsn, encaps_tun); @@ -570,7 +585,7 @@ } DEBUGP(DGGSN, "Setting tun IP address\n"); - if (tun_setaddr(tun, &netaddr, &destaddr, &mask)) { + if (tun_setaddr(tun, &netaddr, &destaddr, &prefixlen)) { SYS_ERR(DGGSN, LOGL_ERROR, 0, "Failed to set tun IP address"); exit(1); } diff --git a/ggsn/gtp-kernel.c b/ggsn/gtp-kernel.c index dbe5a9f..458ac27 100644 --- a/ggsn/gtp-kernel.c +++ b/ggsn/gtp-kernel.c @@ -70,17 +70,6 @@ printf("\n"); } -static int mask2prefix(struct in_addr *mask) -{ - uint32_t tmp = ntohl(mask->s_addr); - int k; - - for (k=0; tmp > 0; k++) - tmp = (tmp << 1); - - return k; -} - static struct { int genl_id; struct mnl_socket *nl; @@ -91,7 +80,7 @@ #define GTP_DEVNAME "gtp0" int gtp_kernel_init(struct gsn_t *gsn, struct in_addr *net, - struct in_addr *mask, + size_t prefixlen, struct gengetopt_args_info *args_info) { if (!args_info->gtp_linux_given) @@ -126,7 +115,7 @@ DEBUGP(DGGSN, "Setting route to reach %s via %s\n", args_info->net_arg, GTP_DEVNAME); - if (gtp_dev_config(GTP_DEVNAME, net, mask2prefix(mask)) < 0) { + if (gtp_dev_config(GTP_DEVNAME, net, prefixlen) < 0) { SYS_ERR(DGGSN, LOGL_ERROR, 0, "Cannot add route to reach network %s\n", args_info->net_arg); diff --git a/ggsn/gtp-kernel.h b/ggsn/gtp-kernel.h index 83280a0..b3b29e3 100644 --- a/ggsn/gtp-kernel.h +++ b/ggsn/gtp-kernel.h @@ -8,7 +8,7 @@ #ifdef GTP_KERNEL int gtp_kernel_init(struct gsn_t *gsn, struct in_addr *net, - struct in_addr *mask, + size_t prefixlen, struct gengetopt_args_info *args_info); void gtp_kernel_stop(void); @@ -19,7 +19,7 @@ #else static inline int gtp_kernel_init(struct gsn_t *gsn, struct in_addr *net, - struct in_addr *mask, + size_t prefixlen, struct gengetopt_args_info *args_info) { if (args_info->gtp_linux_given) { diff --git a/lib/Makefile.am b/lib/Makefile.am index 756d566..632990c 100644 --- a/lib/Makefile.am +++ b/lib/Makefile.am @@ -1,7 +1,7 @@ noinst_LIBRARIES = libmisc.a -noinst_HEADERS = gnugetopt.h ippool.h lookup.h syserr.h tun.h +noinst_HEADERS = gnugetopt.h ippool.h lookup.h syserr.h tun.h in46_addr.h AM_CFLAGS = -O2 -fno-builtin -Wall -DSBINDIR='"$(sbindir)"' -ggdb $(LIBOSMOCORE_CFLAGS) -libmisc_a_SOURCES = getopt1.c getopt.c ippool.c lookup.c tun.c debug.c +libmisc_a_SOURCES = getopt1.c getopt.c ippool.c lookup.c tun.c debug.c in46_addr.c diff --git a/lib/in46_addr.c b/lib/in46_addr.c new file mode 100644 index 0000000..903ceec --- /dev/null +++ b/lib/in46_addr.c @@ -0,0 +1,148 @@ +/* + * IPv4/v6 address functions. + * Copyright (C) 2017 by Harald Welte + * + * The contents of this file may be used under the terms of the GNU + * General Public License Version 2, provided that the above copyright + * notice and this permission notice is included in all copies or + * substantial portions of the software. + * + */ + +#include "../lib/in46_addr.h" + +#include +#include +#include +#include +#include +#include +#include + +/*! Return the address family of given \reff in46_addr argument */ +int in46a_to_af(const struct in46_addr *in) +{ + switch (in->len) { + case 4: + return AF_INET; + case 16: + return AF_INET6; + default: + return -1; + } +} + +/*! Convert \ref in46_addr to sockaddr_storage */ +int in46a_to_sas(struct sockaddr_storage *out, const struct in46_addr *in) +{ + struct sockaddr_in *sin = (struct sockaddr_in *)out; + struct sockaddr_in6 *sin6 = (struct sockaddr_in6 *)out; + + switch (in->len) { + case 4: + sin->sin_family = AF_INET; + sin->sin_addr = in->v4; + break; + case 16: + sin6->sin6_family = AF_INET; + sin6->sin6_addr = in->v6; + break; + default: + return -1; + } + + return 0; +} + +/*! Convenience wrapper around inet_ntop() for \ref in46_addr */ +const char *in46a_ntop(const struct in46_addr *in, char *dst, socklen_t dst_size) +{ + int af = in46a_to_af(in); + if (af < 0) + return NULL; + + return inet_ntop(af, (const void *) &in->v4, dst, dst_size); +} + +/*! Determine if two in46_addr are equal or not + * \returns 1 in case they are equal; 0 otherwise */ +int in46a_equal(const struct in46_addr *a, const struct in46_addr *b) +{ + if (a->len == b->len && !memcmp(&a->v6, &b->v6, a->len)) + return 1; + else + return 0; +} + +/*! Match if IPv6 addr1 + addr2 are within same \a mask */ +static int ipv6_within_mask(const struct in6_addr *addr1, const struct in6_addr *addr2, + const struct in6_addr *mask) +{ + struct in6_addr masked = *addr2; +#if defined(__linux__) + masked.s6_addr32[0] &= mask->s6_addr32[0]; + masked.s6_addr32[1] &= mask->s6_addr32[1]; + masked.s6_addr32[2] &= mask->s6_addr32[2]; + masked.s6_addr32[3] &= mask->s6_addr32[3]; +#else + masked.__u6_addr.__u6_addr32[0] &= mask->__u6_addr.__u6_addr32[0]; + masked.__u6_addr.__u6_addr32[1] &= mask->__u6_addr.__u6_addr32[1]; + masked.__u6_addr.__u6_addr32[2] &= mask->__u6_addr.__u6_addr32[2]; + masked.__u6_addr.__u6_addr32[3] &= mask->__u6_addr.__u6_addr32[3]; +#endif + if (!memcmp(addr1, &masked, sizeof(struct in6_addr))) + return 1; + else + return 0; +} + +/*! Create an IPv6 netmask from the given prefix length */ +static void create_ipv6_netmask(struct in6_addr *netmask, int prefixlen) +{ + uint32_t *p_netmask; + memset(netmask, 0, sizeof(struct in6_addr)); + if (prefixlen < 0) + prefixlen = 0; + else if (128 < prefixlen) + prefixlen = 128; + +#if defined(__linux__) + p_netmask = &netmask->s6_addr32[0]; +#else + p_netmask = &netmask->__u6_addr.__u6_addr32[0]; +#endif + while (32 < prefixlen) { + *p_netmask = 0xffffffff; + p_netmask++; + prefixlen -= 32; + } + if (prefixlen != 0) { + *p_netmask = htonl(0xFFFFFFFF << (32 - prefixlen)); + } +} + +/*! Determine if given \a addr is within given \a net + \a prefixlen + * Builds the netmask from \a net + \a prefixlen and matches it to \a addr + * \returns 1 in case of a match, 0 otherwise */ +int in46a_within_mask(const struct in46_addr *addr, const struct in46_addr *net, size_t prefixlen) +{ + struct in_addr netmask; + struct in6_addr netmask6; + + if (addr->len != net->len) + return 0; + + switch (addr->len) { + case 4: + netmask.s_addr = htonl(0xFFFFFFFF << (32 - prefixlen)); + if ((addr->v4.s_addr & netmask.s_addr) == net->v4.s_addr) + return 1; + else + return 0; + case 16: + create_ipv6_netmask(&netmask6, prefixlen); + return ipv6_within_mask(&addr->v6, &net->v6, &netmask6); + default: + return 0; + } +} diff --git a/lib/in46_addr.h b/lib/in46_addr.h new file mode 100644 index 0000000..f28fd8e --- /dev/null +++ b/lib/in46_addr.h @@ -0,0 +1,19 @@ +#pragma once +#include +#include + +/* a simple wrapper around an in6_addr to also contain the length of the address, + * thereby implicitly indicating the address family of the address */ +struct in46_addr { + uint8_t len; + union { + struct in_addr v4; + struct in6_addr v6; + }; +}; + +extern int in46a_to_af(const struct in46_addr *in); +extern int in46a_to_sas(struct sockaddr_storage *out, const struct in46_addr *in); +extern const char *in46a_ntop(const struct in46_addr *in, char *dst, socklen_t dst_size); +extern int in46a_equal(const struct in46_addr *a, const struct in46_addr *b); +extern int in46a_within_mask(const struct in46_addr *addr, const struct in46_addr *net, size_t prefixlen); diff --git a/lib/ippool.c b/lib/ippool.c index 1f79a77..c3eb267 100644 --- a/lib/ippool.c +++ b/lib/ippool.c @@ -1,6 +1,7 @@ /* * IP address pool functions. * Copyright (C) 2003, 2004 Mondru AB. + * Copyright (C) 2017 by Harald Welte * * The contents of this file may be used under the terms of the GNU * General Public License Version 2, provided that the above copyright @@ -16,6 +17,7 @@ #include #include #include +#include #include "syserr.h" #include "ippool.h" #include "lookup.h" @@ -31,13 +33,14 @@ printf("Listsize %d\n", this->listsize); for (n = 0; n < this->listsize; n++) { - printf("Unit %d inuse %d prev %d next %d addr %s %x\n", + char s[256]; + in46a_ntop(&this->member[n].addr, s, sizeof(s)); + printf("Unit %d inuse %d prev %d next %d addr %s\n", n, this->member[n].inuse, this->member[n].prev - this->member, this->member[n].next - this->member, - inet_ntoa(this->member[n].addr), - this->member[n].addr.s_addr); + s); } return 0; } @@ -49,7 +52,7 @@ struct ippoolm_t *p_prev = NULL; /* Insert into hash table */ - hash = ippool_hash4(&member->addr) & this->hashmask; + hash = ippool_hash(&member->addr) & this->hashmask; for (p = this->hash[hash]; p; p = p->nexthash) p_prev = p; if (!p_prev) @@ -66,7 +69,7 @@ struct ippoolm_t *p_prev = NULL; /* Find in hash table */ - hash = ippool_hash4(&member->addr) & this->hashmask; + hash = ippool_hash(&member->addr) & this->hashmask; for (p = this->hash[hash]; p; p = p->nexthash) { if (p == member) { break; @@ -88,73 +91,98 @@ return 0; } -unsigned long int ippool_hash4(struct in_addr *addr) +static unsigned long int ippool_hash4(struct in_addr *addr) { return lookup((unsigned char *)&addr->s_addr, sizeof(addr->s_addr), 0); } -#ifndef IPPOOL_NOIP6 -unsigned long int ippool_hash6(struct in6_addr *addr) +static unsigned long int ippool_hash6(struct in6_addr *addr) { - return lookup((unsigned char *)addr->u6_addr8, sizeof(addr->u6_addr8), + /* TODO: Review hash spread for IPv6 */ + return lookup((unsigned char *)addr->s6_addr, sizeof(addr->s6_addr), 0); } -#endif + +unsigned long int ippool_hash(struct in46_addr *addr) +{ + if (addr->len == 4) + return ippool_hash4(&addr->v4); + else + return ippool_hash6(&addr->v6); +} /* Get IP address and mask */ -int ippool_aton(struct in_addr *addr, struct in_addr *mask, - char *pool, int number) +int ippool_aton(struct in46_addr *addr, size_t *prefixlen, const char *pool_in, int number) { + struct addrinfo *ai; + struct addrinfo hints = { + .ai_family = AF_UNSPEC, + .ai_socktype = SOCK_DGRAM, + .ai_flags = 0, + .ai_protocol = 0 + }; + char pool[strlen(pool_in)+1]; - /* Parse only first instance of network for now */ - /* Eventually "number" will indicate the token which we want to parse */ + strcpy(pool, pool_in); - unsigned int a1, a2, a3, a4; - unsigned int m1, m2, m3, m4; - int c; - int m; - int masklog; + int err; - c = sscanf(pool, "%u.%u.%u.%u/%u.%u.%u.%u", - &a1, &a2, &a3, &a4, &m1, &m2, &m3, &m4); - switch (c) { - case 4: - mask->s_addr = 0xffffffff; - break; - case 5: - if (m1 > 32) { - SYS_ERR(DIP, LOGL_ERROR, 0, "Invalid mask"); - return -1; /* Invalid mask */ + /* Find '/' and point to first char after it */ + char *prefixlen_str = strchr(pool, '/'); + if (prefixlen_str) { + *prefixlen_str = '\0'; + prefixlen_str++; + if (*prefixlen_str == '\0') { + SYS_ERR(DIP, LOGL_ERROR, 0, "Empty prefix length specified"); + return -1; } - mask->s_addr = htonl(0xffffffff << (32 - m1)); - break; - case 8: - if (m1 >= 256 || m2 >= 256 || m3 >= 256 || m4 >= 256) { - SYS_ERR(DIP, LOGL_ERROR, 0, "Invalid mask"); - return -1; /* Wrong mask format */ - } - m = m1 * 0x1000000 + m2 * 0x10000 + m3 * 0x100 + m4; - for (masklog = 0; ((1 << masklog) < ((~m) + 1)); masklog++) ; - if (((~m) + 1) != (1 << masklog)) { - SYS_ERR(DIP, LOGL_ERROR, 0, "Invalid mask"); - return -1; /* Wrong mask format (not all ones followed by all zeros) */ - } - mask->s_addr = htonl(m); - break; - default: - SYS_ERR(DIP, LOGL_ERROR, 0, "Invalid mask"); - return -1; /* Invalid mask */ } - if (a1 >= 256 || a2 >= 256 || a3 >= 256 || a4 >= 256) { - SYS_ERR(DIP, LOGL_ERROR, 0, - "Wrong IP address format"); + /* convert address */ + if ((err = getaddrinfo(pool, NULL, &hints, &ai))) { + SYS_ERR(DIP, LOGL_ERROR, 0, "Bad address"); return -1; - } else - addr->s_addr = - htonl(a1 * 0x1000000 + a2 * 0x10000 + a3 * 0x100 + a4); + } + + /* Copy address, set lengths */ + if (ai->ai_family == AF_INET) { + *prefixlen = 32; + addr->len = sizeof(struct in_addr); + addr->v4 = ((struct sockaddr_in*)ai->ai_addr)->sin_addr; + } else { + *prefixlen = 128; + addr->len = sizeof(struct in6_addr); + addr->v6 = ((struct sockaddr_in6*)ai->ai_addr)->sin6_addr; + } + freeaddrinfo(ai); + + /* parse prefixlen */ + if (prefixlen_str) { + char *e; + *prefixlen = strtol(prefixlen_str, &e, 10); + if (*e != '\0') { + SYS_ERR(DIP, LOGL_ERROR, 0, "Prefixlen is not an int"); + return -1; + } + } + + if (*prefixlen > (addr->len * 8)) { + SYS_ERR(DIP, LOGL_ERROR, 0, "Perfixlen too big"); + return -1; + } return 0; +} + +/* Increase IPv4/IPv6 address by 1 */ +void in46a_inc(struct in46_addr *addr) +{ + size_t addrlen; + uint8_t *a = (uint8_t *)&addr->v6; + for (addrlen = addr->len; addrlen > 0; addrlen--) { + if (++a[addrlen-1]) + break; + } } /* Create new address pool */ @@ -165,11 +193,10 @@ /* Parse only first instance of pool for now */ int i; - struct in_addr addr; - struct in_addr mask; - struct in_addr stataddr; - struct in_addr statmask; - unsigned int m; + struct in46_addr addr; + size_t addrprefixlen; + struct in46_addr stataddr; + size_t stataddrprefixlen; int listsize; int dynsize; unsigned int statsize; @@ -177,7 +204,7 @@ if (!allowdyn) { dynsize = 0; } else { - if (ippool_aton(&addr, &mask, dyn, 0)) { + if (ippool_aton(&addr, &addrprefixlen, dyn, 0)) { SYS_ERR(DIP, LOGL_ERROR, 0, "Failed to parse dynamic pool"); return -1; @@ -188,8 +215,7 @@ flags |= IPPOOL_NONETWORK; } - m = ntohl(mask.s_addr); - dynsize = ((~m) + 1); + dynsize = (1 << (addr.len*8 - addrprefixlen)) -1; if (flags & IPPOOL_NONETWORK) /* Exclude network address from pool */ dynsize--; if (flags & IPPOOL_NOGATEWAY) /* Exclude gateway address from pool */ @@ -200,17 +226,16 @@ if (!allowstat) { statsize = 0; - stataddr.s_addr = 0; - statmask.s_addr = 0; + stataddr.len = 0; + stataddrprefixlen = 0; } else { - if (ippool_aton(&stataddr, &statmask, stat, 0)) { + if (ippool_aton(&stataddr, &stataddrprefixlen, stat, 0)) { SYS_ERR(DIP, LOGL_ERROR, 0, "Failed to parse static range"); return -1; } - m = ntohl(statmask.s_addr); - statsize = ((~m) + 1); + statsize = (1 << (addr.len - addrprefixlen + 1)) -1; if (statsize > IPPOOL_STATSIZE) statsize = IPPOOL_STATSIZE; } @@ -225,8 +250,9 @@ (*this)->allowdyn = allowdyn; (*this)->allowstat = allowstat; - (*this)->stataddr = stataddr; - (*this)->statmask = statmask; + if (stataddr.len > 0) + (*this)->stataddr = stataddr; + (*this)->stataddrprefixlen = stataddrprefixlen; (*this)->listsize += listsize; if (!((*this)->member = calloc(sizeof(struct ippoolm_t), listsize))) { @@ -255,17 +281,15 @@ (*this)->firstdyn = NULL; (*this)->lastdyn = NULL; + if (flags & IPPOOL_NOGATEWAY) { + in46a_inc(&addr); + in46a_inc(&addr); + } else if (flags & IPPOOL_NONETWORK) { + in46a_inc(&addr); + } for (i = 0; i < dynsize; i++) { - - if (flags & IPPOOL_NOGATEWAY) - (*this)->member[i].addr.s_addr = - htonl(ntohl(addr.s_addr) + i + 2); - else if (flags & IPPOOL_NONETWORK) - (*this)->member[i].addr.s_addr = - htonl(ntohl(addr.s_addr) + i + 1); - else - (*this)->member[i].addr.s_addr = - htonl(ntohl(addr.s_addr) + i); + (*this)->member[i].addr = addr; + in46a_inc(&addr); (*this)->member[i].inuse = 0; @@ -285,8 +309,8 @@ (*this)->firststat = NULL; (*this)->laststat = NULL; for (i = dynsize; i < listsize; i++) { - - (*this)->member[i].addr.s_addr = 0; + struct in46_addr *i6al = &(*this)->member[i].addr; + memset(i6al, 0, sizeof(*i6al)); (*this)->member[i].inuse = 0; /* Insert into list of unused */ @@ -316,15 +340,15 @@ /* Find an IP address in the pool */ int ippool_getip(struct ippool_t *this, struct ippoolm_t **member, - struct in_addr *addr) + struct in46_addr *addr) { struct ippoolm_t *p; uint32_t hash; /* Find in hash table */ - hash = ippool_hash4(addr) & this->hashmask; + hash = ippool_hash(addr) & this->hashmask; for (p = this->hash[hash]; p; p = p->nexthash) { - if ((p->addr.s_addr == addr->s_addr) && (p->inuse)) { + if (in46a_equal(&p->addr, addr)) { if (member) *member = p; return 0; @@ -344,7 +368,7 @@ * address space. **/ int ippool_newip(struct ippool_t *this, struct ippoolm_t **member, - struct in_addr *addr, int statip) + struct in46_addr *addr, int statip) { struct ippoolm_t *p; struct ippoolm_t *p2 = NULL; @@ -365,17 +389,23 @@ if (0) (void)ippool_printaddr(this); + int specified = 0; + if (addr) { + if (addr->len == 4 && addr->v4.s_addr) + specified = 1; + if (addr->len == 16 && !IN6_IS_ADDR_UNSPECIFIED(&addr->v6)) + specified = 1; + } + /* First check to see if this type of address is allowed */ - if ((addr) && (addr->s_addr) && statip) { /* IP address given */ + if (specified && statip) { /* IP address given */ if (!this->allowstat) { SYS_ERR(DIP, LOGL_ERROR, 0, "Static IP address not allowed"); return -1; } - if ((addr->s_addr & this->statmask.s_addr) != - this->stataddr.s_addr) { - SYS_ERR(DIP, LOGL_ERROR, 0, - "Static out of range"); + if (!in46a_within_mask(addr, &this->stataddr, this->stataddrprefixlen)) { + SYS_ERR(DIP, LOGL_ERROR, 0, "Static out of range"); return -1; } } else { @@ -387,11 +417,11 @@ } /* If IP address given try to find it in dynamic address pool */ - if ((addr) && (addr->s_addr)) { /* IP address given */ + if (specified) { /* IP address given */ /* Find in hash table */ - hash = ippool_hash4(addr) & this->hashmask; + hash = ippool_hash(addr) & this->hashmask; for (p = this->hash[hash]; p; p = p->nexthash) { - if ((p->addr.s_addr == addr->s_addr)) { + if (in46a_equal(&p->addr, addr)) { p2 = p; break; } @@ -420,6 +450,11 @@ return -1; /* Allready in use / Should not happen */ } + if (p2->addr.len != addr->len) { + SYS_ERR(DIP, LOGL_ERROR, 0, "MS requested unsupported PDP context type"); + return -1; + } + /* Remove from linked list of free dynamic addresses */ if (p2->prev) p2->prev->next = p2->next; @@ -442,13 +477,18 @@ /* It was not possible to allocate from dynamic address pool */ /* Try to allocate from static address space */ - if ((addr) && (addr->s_addr) && (statip)) { /* IP address given */ + if (specified && (statip)) { /* IP address given */ if (!this->firststat) { SYS_ERR(DIP, LOGL_ERROR, 0, "No more IP addresses available"); return -1; /* No more available */ } else p2 = this->firststat; + + if (p2->addr.len != addr->len) { + SYS_ERR(DIP, LOGL_ERROR, 0, "MS requested unsupported PDP context type"); + return -1; + } /* Remove from linked list of free static addresses */ if (p2->prev) @@ -518,7 +558,7 @@ this->laststat = member; member->inuse = 0; - member->addr.s_addr = 0; + memset(&member->addr, 0, sizeof(member->addr)); member->peer = NULL; member->nexthash = NULL; if (0) @@ -530,9 +570,3 @@ return -1; } } - -#ifndef IPPOOL_NOIP6 -extern unsigned long int ippool_hash6(struct in6_addr *addr); -extern int ippool_getip6(struct ippool_t *this, struct in6_addr *addr); -extern int ippool_returnip6(struct ippool_t *this, struct in6_addr *addr); -#endif diff --git a/lib/ippool.h b/lib/ippool.h index 534140d..53154f2 100644 --- a/lib/ippool.h +++ b/lib/ippool.h @@ -12,6 +12,8 @@ #ifndef _IPPOOL_H #define _IPPOOL_H +#include "../lib/in46_addr.h" + /* Assuming that the address space is fragmented we need a hash table in order to return the addresses. @@ -26,8 +28,6 @@ in RFC2373. */ -#define IPPOOL_NOIP6 - #define IPPOOL_NONETWORK 0x01 #define IPPOOL_NOBROADCAST 0x02 #define IPPOOL_NOGATEWAY 0x04 @@ -40,8 +40,8 @@ unsigned int listsize; /* Total number of addresses */ int allowdyn; /* Allow dynamic IP address allocation */ int allowstat; /* Allow static IP address allocation */ - struct in_addr stataddr; /* Static address range network address */ - struct in_addr statmask; /* Static address range network mask */ + struct in46_addr stataddr; /* Static address range network address */ + size_t stataddrprefixlen; /* IPv6 prefix length of stataddr */ struct ippoolm_t *member; /* Listsize array of members */ unsigned int hashsize; /* Size of hash table */ int hashlog; /* Log2 size of hash table */ @@ -54,11 +54,7 @@ }; struct ippoolm_t { -#ifndef IPPOOL_NOIP6 - struct in6_addr addr; /* IP address of this member */ -#else - struct in_addr addr; /* IP address of this member */ -#endif + struct in46_addr addr; /* IP address of this member */ int inuse; /* 0=available; 1= dynamic; 2 = static */ struct ippoolm_t *nexthash; /* Linked list part of hash table */ struct ippoolm_t *prev, *next; /* Linked list of free dynamic or static */ @@ -70,7 +66,7 @@ bytes for each address. */ /* Hash an IP address using code based on Bob Jenkins lookupa */ -extern unsigned long int ippool_hash4(struct in_addr *addr); +extern unsigned long int ippool_hash(struct in46_addr *addr); /* Create new address pool */ extern int ippool_new(struct ippool_t **this, char *dyn, char *stat, @@ -81,24 +77,20 @@ /* Find an IP address in the pool */ extern int ippool_getip(struct ippool_t *this, struct ippoolm_t **member, - struct in_addr *addr); + struct in46_addr *addr); /* Get an IP address. If addr = 0.0.0.0 get a dynamic IP address. Otherwise check to see if the given address is available */ extern int ippool_newip(struct ippool_t *this, struct ippoolm_t **member, - struct in_addr *addr, int statip); + struct in46_addr *addr, int statip); /* Return a previously allocated IP address */ extern int ippool_freeip(struct ippool_t *this, struct ippoolm_t *member); /* Get net and mask based on ascii string */ -extern int ippool_aton(struct in_addr *addr, struct in_addr *mask, - char *pool, int number); +int ippool_aton(struct in46_addr *addr, size_t *prefixlen, const char *pool, int number); -#ifndef IPPOOL_NOIP6 -extern unsigned long int ippool_hash6(struct in6_addr *addr); -extern int ippool_getip6(struct ippool_t *this, struct in6_addr *addr); -extern int ippool_returnip6(struct ippool_t *this, struct in6_addr *addr); -#endif +/* Increase IPv4/IPv6 address by 1 */ +extern void in46a_inc(struct in46_addr *addr); #endif /* !_IPPOOL_H */ diff --git a/sgsnemu/sgsnemu.c b/sgsnemu/sgsnemu.c index 1567e7e..90a6200 100644 --- a/sgsnemu/sgsnemu.c +++ b/sgsnemu/sgsnemu.c @@ -58,7 +58,7 @@ uint8_t inuse; /* 0=free. 1=used by somebody */ struct iphash_t *ipnext; struct pdp_t *pdp; - struct in_addr addr; + struct in46_addr addr; }; struct iphash_t iparr[MAXCONTEXTS]; struct iphash_t *iphash[MAXCONTEXTS]; @@ -81,7 +81,8 @@ struct { int debug; /* Print debug messages */ int createif; /* Create local network interface */ - struct in_addr netaddr, destaddr, net, mask; /* Network interface */ + struct in_addr netaddr, destaddr, net; /* Network interface */ + size_t prefixlen; char *ipup, *ipdown; /* Filename of scripts */ int defaultroute; /* Set up default route */ struct in_addr pinghost; /* Remote ping host */ @@ -160,13 +161,13 @@ state = 3; /* Tell main loop to finish. */ } -int ipset(struct iphash_t *ipaddr, struct in_addr *addr) +int ipset(struct iphash_t *ipaddr, struct in46_addr *addr) { - int hash = ippool_hash4(addr) % MAXCONTEXTS; + int hash = ippool_hash(addr) % MAXCONTEXTS; struct iphash_t *h; struct iphash_t *prev = NULL; ipaddr->ipnext = NULL; - ipaddr->addr.s_addr = addr->s_addr; + ipaddr->addr = *addr; for (h = iphash[hash]; h; h = h->ipnext) prev = h; if (!prev) @@ -178,7 +179,7 @@ int ipdel(struct iphash_t *ipaddr) { - int hash = ippool_hash4(&ipaddr->addr) % MAXCONTEXTS; + int hash = ippool_hash(&ipaddr->addr) % MAXCONTEXTS; struct iphash_t *h; struct iphash_t *prev = NULL; for (h = iphash[hash]; h; h = h->ipnext) { @@ -194,12 +195,12 @@ return EOF; /* End of linked list and not found */ } -int ipget(struct iphash_t **ipaddr, struct in_addr *addr) +int ipget(struct iphash_t **ipaddr, struct in46_addr *addr) { - int hash = ippool_hash4(addr) % MAXCONTEXTS; + int hash = ippool_hash(addr) % MAXCONTEXTS; struct iphash_t *h; for (h = iphash[hash]; h; h = h->ipnext) { - if ((h->addr.s_addr == addr->s_addr)) { + if (in46a_equal(&h->addr, addr)) { *ipaddr = h; return 0; } @@ -859,15 +860,17 @@ /* net */ /* Store net as in_addr net and mask */ if (args_info.net_arg) { + struct in46_addr in46; if (ippool_aton - (&options.net, &options.mask, args_info.net_arg, 0)) { + (&in46, &options.prefixlen, args_info.net_arg, 0)) { SYS_ERR(DSGSN, LOGL_ERROR, 0, "Invalid network address: %s!", args_info.net_arg); exit(1); } + options.net.s_addr = in46.v4.s_addr; #if defined (__sun__) - options.netaddr.s_addr = htonl(ntohl(options.net.s_addr) + 1); + options.netaddrs_addr = htonl(ntohl(options.net.s_addr) + 1); options.destaddr.s_addr = htonl(ntohl(options.net.s_addr) + 1); #else options.netaddr.s_addr = options.net.s_addr; @@ -876,7 +879,7 @@ } else { options.net.s_addr = 0; - options.mask.s_addr = 0; + options.prefixlen = 0; options.netaddr.s_addr = 0; options.destaddr.s_addr = 0; } @@ -1277,14 +1280,15 @@ int cb_tun_ind(struct tun_t *tun, void *pack, unsigned len) { struct iphash_t *ipm; - struct in_addr src; + struct in46_addr src; struct tun_packet_t *iph = (struct tun_packet_t *)pack; - src.s_addr = iph->src; + src.len = 4; + src.v4.s_addr = iph->src; if (ipget(&ipm, &src)) { printf("Dropping packet from invalid source address: %s\n", - inet_ntoa(src)); + inet_ntoa(src.v4)); return 0; } @@ -1295,7 +1299,7 @@ int create_pdp_conf(struct pdp_t *pdp, void *cbp, int cause) { - struct in_addr addr; + struct in46_addr addr; struct iphash_t *iph = (struct iphash_t *)cbp; @@ -1324,7 +1328,7 @@ return EOF; /* Not what we expected */ } - if (pdp_euaton(&pdp->eua, &addr)) { + if (pdp_euaton(&pdp->eua, &addr.v4)) { printf ("Received create PDP context response. Cause value: %d\n", cause); @@ -1335,7 +1339,7 @@ } printf("Received create PDP context response. IP address: %s\n", - inet_ntoa(addr)); + inet_ntoa(addr.v4)); if ((options.createif) && (!options.net.s_addr)) { struct in_addr m; @@ -1345,11 +1349,11 @@ m.s_addr = -1; #endif /* printf("Setting up interface and routing\n"); */ - tun_addaddr(tun, &addr, &addr, &m); + tun_addaddr(tun, &addr.v4, &addr.v4, &m); if (options.defaultroute) { struct in_addr rm; rm.s_addr = 0; - tun_addroute(tun, &rm, &addr, &rm); + tun_addroute(tun, &rm, &addr.v4, &rm); } if (options.ipup) tun_runscript(tun, options.ipup); @@ -1472,9 +1476,10 @@ } if ((options.createif) && (options.net.s_addr)) { + struct in_addr mask; + mask.s_addr = options.prefixlen ? (0xFFFFFFFF >> (32 - options.prefixlen)) : 0; /* printf("Setting up interface and routing\n"); */ - tun_addaddr(tun, &options.netaddr, &options.destaddr, - &options.mask); + tun_addaddr(tun, &options.netaddr, &options.destaddr, &mask); if (options.defaultroute) { struct in_addr rm; rm.s_addr = 0; -- To view, visit https://gerrit.osmocom.org/3403 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ib98cc4bf634d6be9a7bf8c03a24e629455fcafc8 Gerrit-PatchSet: 3 Gerrit-Project: openggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Thu Aug 3 00:13:24 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 3 Aug 2017 00:13:24 +0000 Subject: [PATCH] openggsn[master]: lib/tun.h: Remove non-endian-safe redefinition of IP header In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3404 to look at the new patch set (#4). lib/tun.h: Remove non-endian-safe redefinition of IP header We can simply use 'struct iphdr' from netinet/ip.h to achieve the same goal (and be portable). Change-Id: Ieece22e127dc14a7ffdc3b05656628989ad00b32 --- M configure.ac M ggsn/ggsn.c M lib/tun.h M sgsnemu/sgsnemu.c 4 files changed, 39 insertions(+), 20 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openggsn refs/changes/04/3404/4 diff --git a/configure.ac b/configure.ac index 45ab22b..b7e6793 100644 --- a/configure.ac +++ b/configure.ac @@ -112,6 +112,12 @@ AC_DEFINE([HAVE_RT_MSGHDR])], AC_MSG_RESULT(no)) +AC_MSG_CHECKING(whether struct iphdr exists) +AH_TEMPLATE(HAVE_IPHDR) +AC_EGREP_HEADER(struct iphdr, netinet/ip.h, +[AC_MSG_RESULT(yes) + AC_DEFINE([HAVE_IPHDR])], + AC_MSG_RESULT(no)) # Checks for library functions. AC_PROG_GCC_TRADITIONAL diff --git a/ggsn/ggsn.c b/ggsn/ggsn.c index 00c7174..11aea78 100644 --- a/ggsn/ggsn.c +++ b/ggsn/ggsn.c @@ -34,6 +34,7 @@ #include #include #include +#include #include #include #include @@ -42,6 +43,7 @@ #include #include #include +#include #include #include @@ -219,13 +221,13 @@ { struct ippoolm_t *ipm; struct in46_addr dst; - struct tun_packet_t *iph = (struct tun_packet_t *)pack; + struct iphdr *iph = (struct iphdr *)pack; - if (iph->ver == 4) { + if (iph->version == 4) { if (len < sizeof(*iph) || len < 4*iph->ihl) return -1; dst.len = 4; - dst.v4.s_addr = iph->dst; + dst.v4.s_addr = iph->daddr; } else { LOGP(DGGSN, LOGL_NOTICE, "non-IPv4 packet received from tun\n"); return -1; diff --git a/lib/tun.h b/lib/tun.h index ce7b91c..c50bdf9 100644 --- a/lib/tun.h +++ b/lib/tun.h @@ -17,21 +17,31 @@ #define TUN_ADDRSIZE 128 #define TUN_NLBUFSIZE 1024 -struct tun_packet_t { - unsigned int ver:4; - unsigned int ihl:4; - unsigned int dscp:6; - unsigned int ecn:2; - unsigned int length:16; - unsigned int id:16; - unsigned int flags:3; - unsigned int fragment:13; - unsigned int ttl:8; - unsigned int protocol:8; - unsigned int check:16; - unsigned int src:32; - unsigned int dst:32; -}; +#include "config.h" +#ifndef HAVE_IPHDR +struct iphdr + { +#if __BYTE_ORDER == __LITTLE_ENDIAN + unsigned int ihl:4; + unsigned int version:4; +#elif __BYTE_ORDER == __BIG_ENDIAN + unsigned int version:4; + unsigned int ihl:4; +#else +# error "Please fix " +#endif + u_int8_t tos; + u_int16_t tot_len; + u_int16_t id; + u_int16_t frag_off; + u_int8_t ttl; + u_int8_t protocol; + u_int16_t check; + u_int32_t saddr; + u_int32_t daddr; + /*The options start here. */ + }; +#endif /* !HAVE_IPHDR */ /* *********************************************************** * Information storage for each tun instance diff --git a/sgsnemu/sgsnemu.c b/sgsnemu/sgsnemu.c index 90a6200..af8f9fa 100644 --- a/sgsnemu/sgsnemu.c +++ b/sgsnemu/sgsnemu.c @@ -29,6 +29,7 @@ #include #include #include +#include #include #include #include @@ -1281,10 +1282,10 @@ { struct iphash_t *ipm; struct in46_addr src; - struct tun_packet_t *iph = (struct tun_packet_t *)pack; + struct iphdr *iph = (struct iphdr *)pack; src.len = 4; - src.v4.s_addr = iph->src; + src.v4.s_addr = iph->saddr; if (ipget(&ipm, &src)) { printf("Dropping packet from invalid source address: %s\n", -- To view, visit https://gerrit.osmocom.org/3404 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ieece22e127dc14a7ffdc3b05656628989ad00b32 Gerrit-PatchSet: 4 Gerrit-Project: openggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Thu Aug 3 00:18:59 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 3 Aug 2017 00:18:59 +0000 Subject: openggsn[master]: ippool: Add IPv6 support to IP pool implementation In-Reply-To: References: Message-ID: Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3403 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ib98cc4bf634d6be9a7bf8c03a24e629455fcafc8 Gerrit-PatchSet: 3 Gerrit-Project: openggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Aug 3 00:19:03 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 3 Aug 2017 00:19:03 +0000 Subject: openggsn[master]: lib/tun.h: Remove non-endian-safe redefinition of IP header In-Reply-To: References: Message-ID: Patch Set 4: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3404 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ieece22e127dc14a7ffdc3b05656628989ad00b32 Gerrit-PatchSet: 4 Gerrit-Project: openggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Aug 3 00:19:05 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 3 Aug 2017 00:19:05 +0000 Subject: openggsn[master]: ippool_new(): const-ify input arguments In-Reply-To: References: Message-ID: Patch Set 4: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3405 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: If3e53584e8c9c1f06bba4c183c9fd65fae913904 Gerrit-PatchSet: 4 Gerrit-Project: openggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Aug 3 00:19:13 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 3 Aug 2017 00:19:13 +0000 Subject: openggsn[master]: ggsn: Send proper errors in create_context_ind() In-Reply-To: References: Message-ID: Patch Set 4: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3407 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ibf199c1726130d27c8f80230b30ee51101c93b06 Gerrit-PatchSet: 4 Gerrit-Project: openggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Aug 3 08:44:50 2017 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Thu, 3 Aug 2017 08:44:50 +0000 Subject: libosmo-sccp[master]: vty: command to set local ip of ASP In-Reply-To: References: Message-ID: Patch Set 1: I am a bit confused here. In osmo_sccp_simple_client_on_ss7_id() we assign asp->cfg.local.host and asp->cfg.remote.host. I could not find any possibility to set asp->cfg.local.host, but there is asp->cfg.local.host to set asp->cfg.remote.host. Thats why I thought that there is something missing here, if not we can safely abandon this patch. (Note: Also this patch still lacks writing the parameter) -- To view, visit https://gerrit.osmocom.org/3271 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I115b87b08bdc4b07772b7afb9c25bc713e79945a Gerrit-PatchSet: 1 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: dexter Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Aug 3 09:04:26 2017 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Thu, 3 Aug 2017 09:04:26 +0000 Subject: libosmo-sccp[master]: add osmo_sccp_addr_set_ssn() In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 > Build Successful > > http://jenkins.osmocom.org/jenkins/job/libosmo-sccp-gerrit/663/ : > SUCCESS' --verified 1 --code-review 0 -- To view, visit https://gerrit.osmocom.org/3359 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I85b46269dbe7909e52873ace3f720f6292a4516c Gerrit-PatchSet: 1 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: dexter Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Aug 3 22:24:25 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 3 Aug 2017 22:24:25 +0000 Subject: [PATCH] openggsn[master]: Proper fix for "Force Dynamic IP" in Create PDP CTX Message-ID: Review at https://gerrit.osmocom.org/3409 Proper fix for "Force Dynamic IP" in Create PDP CTX An EUA length of *2* octets indicates dynamic IP address, while an EUA length of 0 is invalid. Let's fix this hack (which needs to finally be removed anyway). Change-Id: Ib1b57eb0654327882044d6862d955f4b32aa6bcd --- M ggsn/ggsn.c 1 file changed, 3 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/openggsn refs/changes/09/3409/1 diff --git a/ggsn/ggsn.c b/ggsn/ggsn.c index 4d07f11..168e907 100644 --- a/ggsn/ggsn.c +++ b/ggsn/ggsn.c @@ -173,7 +173,9 @@ DEBUGP(DGGSN, "Received create PDP context request\n"); - pdp->eua.l = 0; /* TODO: Indicates dynamic IP */ + /* FIXME: we manually force all context requests to dynamic here! */ + if (pdp->eua.l > 2) + pdp->eua.l = 2; memcpy(pdp->qos_neg0, pdp->qos_req0, sizeof(pdp->qos_req0)); memcpy(&pdp->pco_neg, &pco, sizeof(pdp->pco_neg)); -- To view, visit https://gerrit.osmocom.org/3409 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ib1b57eb0654327882044d6862d955f4b32aa6bcd Gerrit-PatchSet: 1 Gerrit-Project: openggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Sat Aug 5 15:06:50 2017 From: gerrit-no-reply at lists.osmocom.org (Holger Freyther) Date: Sat, 5 Aug 2017 15:06:50 +0000 Subject: [PATCH] meta-telephony[refs/meta/config]: Edit Project Config In-Reply-To: References: Message-ID: Edit Project Config Change-Id: I67df0550f41efe9b1bd8c55b6b2445296d623f7e --- M project.config 1 file changed, 0 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/meta-telephony refs/changes/11/3411/2 diff --git a/project.config b/project.config index e080951..15a3af0 100644 --- a/project.config +++ b/project.config @@ -1,4 +1,2 @@ -[access] - inheritFrom = All-Projects [submit] action = rebase if necessary -- To view, visit https://gerrit.osmocom.org/3411 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I67df0550f41efe9b1bd8c55b6b2445296d623f7e Gerrit-PatchSet: 2 Gerrit-Project: meta-telephony Gerrit-Branch: refs/meta/config Gerrit-Owner: Holger Freyther From gerrit-no-reply at lists.osmocom.org Sat Aug 5 15:06:56 2017 From: gerrit-no-reply at lists.osmocom.org (Holger Freyther) Date: Sat, 5 Aug 2017 15:06:56 +0000 Subject: [PATCH] meta-telephony[refs/meta/config]: Edit Project Config Message-ID: Review at https://gerrit.osmocom.org/3411 Edit Project Config Change-Id: I67df0550f41efe9b1bd8c55b6b2445296d623f7e --- M project.config 1 file changed, 0 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/meta-telephony refs/changes/11/3411/2 diff --git a/project.config b/project.config index e080951..15a3af0 100644 --- a/project.config +++ b/project.config @@ -1,4 +1,2 @@ -[access] - inheritFrom = All-Projects [submit] action = rebase if necessary -- To view, visit https://gerrit.osmocom.org/3411 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I67df0550f41efe9b1bd8c55b6b2445296d623f7e Gerrit-PatchSet: 2 Gerrit-Project: meta-telephony Gerrit-Branch: refs/meta/config Gerrit-Owner: Holger Freyther From gerrit-no-reply at lists.osmocom.org Sat Aug 5 15:07:36 2017 From: gerrit-no-reply at lists.osmocom.org (Holger Freyther) Date: Sat, 5 Aug 2017 15:07:36 +0000 Subject: meta-telephony[refs/meta/config]: Edit Project Config In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 Verified+1 -- To view, visit https://gerrit.osmocom.org/3411 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I67df0550f41efe9b1bd8c55b6b2445296d623f7e Gerrit-PatchSet: 2 Gerrit-Project: meta-telephony Gerrit-Branch: refs/meta/config Gerrit-Owner: Holger Freyther Gerrit-Reviewer: Holger Freyther Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sat Aug 5 15:07:39 2017 From: gerrit-no-reply at lists.osmocom.org (Holger Freyther) Date: Sat, 5 Aug 2017 15:07:39 +0000 Subject: [MERGED] meta-telephony[refs/meta/config]: Edit Project Config In-Reply-To: References: Message-ID: Holger Freyther has submitted this change and it was merged. Change subject: Edit Project Config ...................................................................... Edit Project Config Change-Id: I67df0550f41efe9b1bd8c55b6b2445296d623f7e --- M project.config 1 file changed, 0 insertions(+), 2 deletions(-) Approvals: Holger Freyther: Looks good to me, approved; Verified diff --git a/project.config b/project.config index e080951..15a3af0 100644 --- a/project.config +++ b/project.config @@ -1,4 +1,2 @@ -[access] - inheritFrom = All-Projects [submit] action = rebase if necessary -- To view, visit https://gerrit.osmocom.org/3411 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I67df0550f41efe9b1bd8c55b6b2445296d623f7e Gerrit-PatchSet: 2 Gerrit-Project: meta-telephony Gerrit-Branch: refs/meta/config Gerrit-Owner: Holger Freyther Gerrit-Reviewer: Holger Freyther From gerrit-no-reply at lists.osmocom.org Mon Aug 7 09:59:23 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Mon, 7 Aug 2017 09:59:23 +0000 Subject: [PATCH] osmo-bts[master]: lc15bts-mgr.service: Prepare dirs and sysctls for the process Message-ID: Review at https://gerrit.osmocom.org/3412 lc15bts-mgr.service: Prepare dirs and sysctls for the process Change-Id: I0a0a10ca9498318c48c81fa94faceb2ad4ac1de6 --- M contrib/lc15bts-mgr.service 1 file changed, 18 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/12/3412/1 diff --git a/contrib/lc15bts-mgr.service b/contrib/lc15bts-mgr.service index 5790abe..bf788e6 100644 --- a/contrib/lc15bts-mgr.service +++ b/contrib/lc15bts-mgr.service @@ -1,12 +1,29 @@ [Unit] Description=osmo-bts manager for LC15 / sysmoBTS 2100 +After=lc15-sysdev-remap.service +Wants=lc15-sysdev-remap.service [Service] Type=simple -ExecStart=/usr/bin/lc15bts-mgr -s -c /etc/osmocom/lc15bts-mgr.cfg +NotifyAccess=all +WatchdogSec=21780s Restart=always RestartSec=2 +# Make sure directories and symbolic link exist +ExecStartPre=/bin/sh -c 'test -d /mnt/storage/var/run/lc15bts-mgr || mkdir -p /mnt/storage/var/run/lc15bts-mgr ; test -d /var/run/lc15bts-mgr || ln -sf /mnt/storage/var/run/lc15bts-mgr/ /var/run' +# Make sure BTS operation hour exist +ExecStartPre=/bin/sh -c 'test -f /mnt/storage/var/run/lc15bts-mgr/hours-running || echo 0 > /mnt/storage/var/run/lc15bts-mgr/hours-running' +# Shutdown all PA correctly +ExecStartPre=/bin/sh -c 'echo disabled > /var/lc15/pa-state/pa0/state; echo disabled > /var/lc15/pa-state/pa1/state' +ExecStartPre=/bin/sh -c 'echo 0 > /var/lc15/pa-supply/max_microvolts; echo 0 > /var/lc15/pa-supply/min_microvolts' + +ExecStart=/usr/bin/lc15bts-mgr -s -c /etc/osmocom/lc15bts-mgr.cfg + +# Shutdown all PA correctly +ExecStopPost=/bin/sh -c 'echo disabled > /var/lc15/pa-state/pa0/state; echo disabled > /var/lc15/pa-state/pa1/state' +ExecStopPost=/bin/sh -c 'echo 0 > /var/lc15/pa-supply/max_microvolts; echo 0 > /var/lc15/pa-supply/min_microvolts' + [Install] WantedBy=multi-user.target Alias=osmo-bts-mgr.service -- To view, visit https://gerrit.osmocom.org/3412 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I0a0a10ca9498318c48c81fa94faceb2ad4ac1de6 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Mon Aug 7 11:45:31 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 7 Aug 2017 11:45:31 +0000 Subject: [PATCH] osmo-gsm-tester[master]: osmo-bsc.cfg.tmpl: add point code addresses Message-ID: Review at https://gerrit.osmocom.org/3413 osmo-bsc.cfg.tmpl: add point code addresses osmo-bsc requires atm to have point code addresses given for msc + bsc Change-Id: I94f8a6892ad7e10001322cbc5a46687c0d532cb2 --- M src/osmo_gsm_tester/templates/osmo-bsc.cfg.tmpl 1 file changed, 10 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-tester refs/changes/13/3413/1 diff --git a/src/osmo_gsm_tester/templates/osmo-bsc.cfg.tmpl b/src/osmo_gsm_tester/templates/osmo-bsc.cfg.tmpl index 514514f..0e2f759 100644 --- a/src/osmo_gsm_tester/templates/osmo-bsc.cfg.tmpl +++ b/src/osmo_gsm_tester/templates/osmo-bsc.cfg.tmpl @@ -13,6 +13,14 @@ e1_input e1_line 0 driver ipa ipa bind ${bsc.ip_address.addr} +cs7 instance 1 + point-code 0.0.2 + sccp-address bsc_local + point-code 0.0.2 + routing-indicator PC + sccp-address msc_remote + point-code 0.0.1 + routing-indicator PC network network country code ${bsc.net.mcc} mobile network code ${bsc.net.mnc} @@ -79,3 +87,5 @@ amr-config 5_90k allowed amr-config 5_15k forbidden amr-config 4_75k forbidden + msc-addr msc_remote + bsc-addr bsc_local -- To view, visit https://gerrit.osmocom.org/3413 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I94f8a6892ad7e10001322cbc5a46687c0d532cb2 Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: lynxis lazus From gerrit-no-reply at lists.osmocom.org Mon Aug 7 11:46:10 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 7 Aug 2017 11:46:10 +0000 Subject: osmo-gsm-tester[master]: osmo-bsc.cfg.tmpl: add point code addresses In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3413 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I94f8a6892ad7e10001322cbc5a46687c0d532cb2 Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: lynxis lazus Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Aug 7 11:46:12 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 7 Aug 2017 11:46:12 +0000 Subject: [MERGED] osmo-gsm-tester[master]: osmo-bsc.cfg.tmpl: add point code addresses In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: osmo-bsc.cfg.tmpl: add point code addresses ...................................................................... osmo-bsc.cfg.tmpl: add point code addresses osmo-bsc requires atm to have point code addresses given for msc + bsc Change-Id: I94f8a6892ad7e10001322cbc5a46687c0d532cb2 --- M src/osmo_gsm_tester/templates/osmo-bsc.cfg.tmpl 1 file changed, 10 insertions(+), 0 deletions(-) Approvals: Neels Hofmeyr: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/osmo_gsm_tester/templates/osmo-bsc.cfg.tmpl b/src/osmo_gsm_tester/templates/osmo-bsc.cfg.tmpl index 514514f..0e2f759 100644 --- a/src/osmo_gsm_tester/templates/osmo-bsc.cfg.tmpl +++ b/src/osmo_gsm_tester/templates/osmo-bsc.cfg.tmpl @@ -13,6 +13,14 @@ e1_input e1_line 0 driver ipa ipa bind ${bsc.ip_address.addr} +cs7 instance 1 + point-code 0.0.2 + sccp-address bsc_local + point-code 0.0.2 + routing-indicator PC + sccp-address msc_remote + point-code 0.0.1 + routing-indicator PC network network country code ${bsc.net.mcc} mobile network code ${bsc.net.mnc} @@ -79,3 +87,5 @@ amr-config 5_90k allowed amr-config 5_15k forbidden amr-config 4_75k forbidden + msc-addr msc_remote + bsc-addr bsc_local -- To view, visit https://gerrit.osmocom.org/3413 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I94f8a6892ad7e10001322cbc5a46687c0d532cb2 Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: lynxis lazus From gerrit-no-reply at lists.osmocom.org Mon Aug 7 12:18:46 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 7 Aug 2017 12:18:46 +0000 Subject: [PATCH] osmo-gsm-tester[master]: aoip: add newly needed osmo-msc point-code config Message-ID: Review at https://gerrit.osmocom.org/3414 aoip: add newly needed osmo-msc point-code config OsmoMSC no longer has a hard-coded point-code of 0.0.1. Configure it. Change-Id: I54be984415445e695c583f35c419aed559ac5c84 --- M src/osmo_gsm_tester/templates/osmo-msc.cfg.tmpl 1 file changed, 4 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-tester refs/changes/14/3414/1 diff --git a/src/osmo_gsm_tester/templates/osmo-msc.cfg.tmpl b/src/osmo_gsm_tester/templates/osmo-msc.cfg.tmpl index 89982e0..314450b 100644 --- a/src/osmo_gsm_tester/templates/osmo-msc.cfg.tmpl +++ b/src/osmo_gsm_tester/templates/osmo-msc.cfg.tmpl @@ -16,9 +16,13 @@ auth policy ${msc.net.auth_policy} location updating reject cause 13 encryption ${msc.net.encryption} +cs7 instance 0 + point-code 0.0.1 msc mgcpgw remote-ip ${mgcpgw.ip_address.addr} assign-tmsi + cs7-instance-iu 0 + cs7-instance-a 0 ctrl bind ${msc.ip_address.addr} smpp -- To view, visit https://gerrit.osmocom.org/3414 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I54be984415445e695c583f35c419aed559ac5c84 Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Mon Aug 7 12:18:46 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 7 Aug 2017 12:18:46 +0000 Subject: [PATCH] osmo-gsm-tester[master]: cosmetic: osmo-msc.cfg.tmpl: fix indent Message-ID: Review at https://gerrit.osmocom.org/3415 cosmetic: osmo-msc.cfg.tmpl: fix indent Change-Id: Iefc3b06338cff4f5e51b7b03d9a5f92de18ca86a --- M src/osmo_gsm_tester/templates/osmo-msc.cfg.tmpl 1 file changed, 2 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-tester refs/changes/15/3415/1 diff --git a/src/osmo_gsm_tester/templates/osmo-msc.cfg.tmpl b/src/osmo_gsm_tester/templates/osmo-msc.cfg.tmpl index 314450b..1abaf20 100644 --- a/src/osmo_gsm_tester/templates/osmo-msc.cfg.tmpl +++ b/src/osmo_gsm_tester/templates/osmo-msc.cfg.tmpl @@ -19,8 +19,8 @@ cs7 instance 0 point-code 0.0.1 msc - mgcpgw remote-ip ${mgcpgw.ip_address.addr} - assign-tmsi + mgcpgw remote-ip ${mgcpgw.ip_address.addr} + assign-tmsi cs7-instance-iu 0 cs7-instance-a 0 ctrl -- To view, visit https://gerrit.osmocom.org/3415 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Iefc3b06338cff4f5e51b7b03d9a5f92de18ca86a Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Mon Aug 7 12:19:30 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 7 Aug 2017 12:19:30 +0000 Subject: [MERGED] osmo-iuh[master]: ranap_common.h: fix include of asn1c/asn_application.h In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: ranap_common.h: fix include of asn1c/asn_application.h ...................................................................... ranap_common.h: fix include of asn1c/asn_application.h Change-Id: I152377813cdcfef73e2c4309b0f8c97807d7d4f8 --- M include/osmocom/ranap/ranap_common.h 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/include/osmocom/ranap/ranap_common.h b/include/osmocom/ranap/ranap_common.h index 66b8c3e..8899bd5 100644 --- a/include/osmocom/ranap/ranap_common.h +++ b/include/osmocom/ranap/ranap_common.h @@ -1,6 +1,6 @@ #pragma once -#include +#include /* for f in ranap/RANAP_*.h; printf "#include \"$f\"\n" */ #include -- To view, visit https://gerrit.osmocom.org/3352 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I152377813cdcfef73e2c4309b0f8c97807d7d4f8 Gerrit-PatchSet: 2 Gerrit-Project: osmo-iuh Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Mon Aug 7 12:20:07 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 7 Aug 2017 12:20:07 +0000 Subject: [MERGED] osmo-iuh[master]: move openbsc.git's iu.h, iu.c, iu_vty.c here as iu_client In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: move openbsc.git's iu.h, iu.c, iu_vty.c here as iu_client ...................................................................... move openbsc.git's iu.h, iu.c, iu_vty.c here as iu_client To help split openbsc.git to separate MSC and SGSN repositories, place the common Iu interface related code here in libosmo-ranap. Also apply various improvements while moving (from intermittent code review). The code depends on libosmo-ranap tightly. One reason to want this separate from libosmo-ranap could be that it uses libosmo-sigtran, accepting an sccp instance. However, including in libosmo-ranap is the simplest way to go. The osmo-iuh build depends on libosmo-sigtran anyway because of OsmoHNBGW, and all current users of libosmo-ranap also naturally link libosmo-sigtran already. Apply prefix ranap_iu_ and RANAP_IU_ to allow smooth transition from the openbsc.git iu_ to the libranap ranap_iu_ implementations. Prune unneeded #include statements. Instead of sccp_addr, store an rnc pointer in the ue_conn_ctx. To facilitate, also: - Move iu_rnc struct to iu_client.h (as ranap_iu_rnc). - Instead of sccp_addr, pass rnc to ue_conn_ctx_alloc(). - Pass a local struct new_ue_conn_ctx containing the sccp_addr and conn_id up the RANAP handling stack in case of an InitialUE message. - Separate the InitialUE message handling from cn_ranap_handle_co(), by moving to new and separate cn_ranap_handle_co_initial(), so we can still pass a looked-up ue_conn_ctx to all other cn_ranap_handle_co() code paths. - Allocate the ue_conn_ctx only in ranap_handle_co_initial_ue(), not as early as before. Note that we are not actually ever using the rnc pointer now present in ue_conn_ctx. It could be used for more concise paging, to first page only the RNC where we last saw the subscriber. So far we page all matching LAC/RACs. Tweak error logging: use __func__ instead of writing the function names as string constants. In iu_client_vty.c: - Move the asn.1 debug commands from logging over to the iu node. They are not specific to the logging target. They could qualify for an entirely separate 'asn1' root node, but for simplicity place under 'iu'. - Add the 'asn1' commands to ranap_iu_vty_config_write(), so far missing. - remove the legacy "net." from a VTY error message, it is not known which name the parent node of 'iu' has. Depends: libosmo-sccp I85b46269dbe7909e52873ace3f720f6292a4516c, libosmo-sccp Ie1aedd7894acd69ddc887cd65a8a0df4b888838c Change-Id: I6a3f7ad15be03fb94689b4af6ccfa828c25f45c0 --- M include/osmocom/ranap/Makefile.am A include/osmocom/ranap/iu_client.h M src/Makefile.am A src/iu_client.c A src/iu_client_vty.c 5 files changed, 999 insertions(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/include/osmocom/ranap/Makefile.am b/include/osmocom/ranap/Makefile.am index 0f83e03..1606928 100644 --- a/include/osmocom/ranap/Makefile.am +++ b/include/osmocom/ranap/Makefile.am @@ -12,6 +12,7 @@ ranap_common_cn.h \ ranap_msg_factory.h \ iu_helpers.h \ + iu_client.h \ RANAP_AccuracyFulfilmentIndicator.h \ RANAP_AllocationOrRetentionPriority.h \ RANAP_AlternativeRABConfigurationRequest.h \ diff --git a/include/osmocom/ranap/iu_client.h b/include/osmocom/ranap/iu_client.h new file mode 100644 index 0000000..873b2d2 --- /dev/null +++ b/include/osmocom/ranap/iu_client.h @@ -0,0 +1,74 @@ +#pragma once + +#include + +#include +#include +#include + +struct msgb; +struct osmo_auth_vector; + +struct RANAP_RAB_SetupOrModifiedItemIEs_s; +struct RANAP_Cause; + +struct ranap_iu_rnc; + +/* Debugging switches from asn1c and osmo-iuh */ +extern int asn_debug; +extern int asn1_xer_print; + +enum ranap_nsap_addr_enc { + RANAP_NSAP_ADDR_ENC_X213, + RANAP_NSAP_ADDR_ENC_V4RAW, +}; + +struct ranap_ue_conn_ctx { + struct llist_head list; + struct ranap_iu_rnc *rnc; + uint32_t conn_id; + int integrity_active; + struct gprs_ra_id ra_id; + enum ranap_nsap_addr_enc rab_assign_addr_enc; +}; + +enum ranap_iu_event_type { + RANAP_IU_EVENT_RAB_ASSIGN, + RANAP_IU_EVENT_SECURITY_MODE_COMPLETE, + RANAP_IU_EVENT_IU_RELEASE, /* An actual Iu Release message was received */ + RANAP_IU_EVENT_LINK_INVALIDATED, /* A SUA link was lost or closed down */ +}; + +extern const struct value_string ranap_iu_event_type_names[]; +static inline const char *ranap_iu_event_type_str(enum ranap_iu_event_type e) +{ + return get_value_string(ranap_iu_event_type_names, e); +} + +/* Implementations of iu_recv_cb_t shall find the ranap_ue_conn_ctx in msg->dst. */ +typedef int (* ranap_iu_recv_cb_t )(struct msgb *msg, struct gprs_ra_id *ra_id, + uint16_t *sai); + +typedef int (* ranap_iu_event_cb_t )(struct ranap_ue_conn_ctx *ue_ctx, + enum ranap_iu_event_type type, void *data); + +typedef int (* ranap_iu_rab_ass_resp_cb_t )(struct ranap_ue_conn_ctx *ue_ctx, uint8_t rab_id, + struct RANAP_RAB_SetupOrModifiedItemIEs_s *setup_ies); + +int ranap_iu_init(void *ctx, int log_subsystem, const char *sccp_user_name, struct osmo_sccp_instance *sccp, + ranap_iu_recv_cb_t iu_recv_cb, ranap_iu_event_cb_t iu_event_cb); + +int ranap_iu_tx(struct msgb *msg, uint8_t sapi); + +int ranap_iu_page_cs(const char *imsi, const uint32_t *tmsi, uint16_t lac); +int ranap_iu_page_ps(const char *imsi, const uint32_t *ptmsi, uint16_t lac, uint8_t rac); + +int ranap_iu_rab_act(struct ranap_ue_conn_ctx *ue_ctx, struct msgb *msg); +int ranap_iu_rab_deact(struct ranap_ue_conn_ctx *ue_ctx, uint8_t rab_id); +int ranap_iu_tx_sec_mode_cmd(struct ranap_ue_conn_ctx *uectx, struct osmo_auth_vector *vec, + int send_ck, int new_key); +int ranap_iu_tx_common_id(struct ranap_ue_conn_ctx *ue_ctx, const char *imsi); +int ranap_iu_tx_release(struct ranap_ue_conn_ctx *ctx, const struct RANAP_Cause *cause); + +void ranap_iu_vty_init(int iu_parent_node, enum ranap_nsap_addr_enc *rab_assign_addr_enc); +int ranap_iu_vty_config_write(struct vty *vty, const char *indent); diff --git a/src/Makefile.am b/src/Makefile.am index bb1ebbd..48918b0 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -54,7 +54,7 @@ libosmo_ranap_la_LDFLAGS = $(AM_LDFLAGS) -version-info $(RANAP_LIBVERSION) libosmo_ranap_la_LIBADD = $(OSMOCORE_LIBS) $(OSMOGSM_LIBS) $(ASN1C_LIBS) $(COMMON_LDADD) ranap/libosmo-asn1-ranap.la libosmo_ranap_la_SOURCES = ranap_common.c ranap_encoder.c ranap_decoder.c ranap_msg_factory.c iu_helpers.c \ - ranap_common_cn.c + ranap_common_cn.c iu_client.c iu_client_vty.c # build the actual HomeNodeB gateway # diff --git a/src/iu_client.c b/src/iu_client.c new file mode 100644 index 0000000..83ed276 --- /dev/null +++ b/src/iu_client.c @@ -0,0 +1,783 @@ +/* Common parts of IuCS and IuPS interfaces implementation */ + +/* (C) 2016-2017 by sysmocom s.f.m.c. GmbH + * All Rights Reserved + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + * + */ + +#include +#include +#include +#include +#include +#include + +#include + +#include +#include +#include +#include +#include +#include + +/* Parsed global RNC id. See also struct RANAP_GlobalRNC_ID, and note that the + * PLMN identity is a BCD representation of the MCC and MNC. + * See iu_grnc_id_parse(). */ +struct iu_grnc_id { + uint16_t mcc; + uint16_t mnc; + uint16_t rnc_id; +}; + +/* A remote RNC (Radio Network Controller, like BSC but for UMTS) that has + * called us and is currently reachable at the given osmo_sccp_addr. So, when we + * know a LAC for a subscriber, we can page it at the RNC matching that LAC or + * RAC. An HNB-GW typically presents itself as if it were a single RNC, even + * though it may have several RNCs in hNodeBs connected to it. Those will then + * share the same RNC id, which they actually receive and adopt from the HNB-GW + * in the HNBAP HNB REGISTER ACCEPT message. */ +struct ranap_iu_rnc { + struct llist_head entry; + + uint16_t rnc_id; + uint16_t lac; /* Location Area Code (used for CS and PS) */ + uint8_t rac; /* Routing Area Code (used for PS only) */ + struct osmo_sccp_addr sccp_addr; +}; + +void *talloc_iu_ctx; +void *talloc_asn1_ctx; + +/* Implement the extern asn_debug from libasn1c to indicate whether to print + * asn.1 debug messages (see libasn1c). */ +int asn_debug = 0; + +/* Implement the extern asn1_xer_print to indicate whether the ASN.1 binary + * code decoded and encoded during Iu communication should be logged to stderr + * (see asn.1 generated code in osmo-iuh). */ +int asn1_xer_print = 0; + +ranap_iu_recv_cb_t global_iu_recv_cb = NULL; +ranap_iu_event_cb_t global_iu_event_cb = NULL; +int iu_log_subsystem = 0; + +#define LOGPIU(level, fmt, args...) \ + LOGP(iu_log_subsystem, level, fmt, ## args) + +static LLIST_HEAD(ue_conn_ctx_list); +static LLIST_HEAD(rnc_list); + +static struct osmo_sccp_instance *g_sccp; +static struct osmo_sccp_user *g_scu; + +const struct value_string ranap_iu_event_type_names[] = { + OSMO_VALUE_STRING(RANAP_IU_EVENT_RAB_ASSIGN), + OSMO_VALUE_STRING(RANAP_IU_EVENT_SECURITY_MODE_COMPLETE), + OSMO_VALUE_STRING(RANAP_IU_EVENT_IU_RELEASE), + OSMO_VALUE_STRING(RANAP_IU_EVENT_LINK_INVALIDATED), + { 0, NULL } +}; + +static struct ranap_ue_conn_ctx *ue_conn_ctx_alloc(struct ranap_iu_rnc *rnc, uint32_t conn_id) +{ + struct ranap_ue_conn_ctx *ctx = talloc_zero(talloc_iu_ctx, struct ranap_ue_conn_ctx); + + ctx->rnc = rnc; + ctx->conn_id = conn_id; + llist_add(&ctx->list, &ue_conn_ctx_list); + + return ctx; +} + +static struct ranap_ue_conn_ctx *ue_conn_ctx_find(uint32_t conn_id) +{ + struct ranap_ue_conn_ctx *ctx; + + llist_for_each_entry(ctx, &ue_conn_ctx_list, list) { + if (ctx->conn_id == conn_id) + return ctx; + } + return NULL; +} + +static struct ranap_iu_rnc *iu_rnc_alloc(uint16_t rnc_id, uint16_t lac, uint8_t rac, + struct osmo_sccp_addr *addr) +{ + struct ranap_iu_rnc *rnc = talloc_zero(talloc_iu_ctx, struct ranap_iu_rnc); + + rnc->rnc_id = rnc_id; + rnc->lac = lac; + rnc->rac = rac; + rnc->sccp_addr = *addr; + llist_add(&rnc->entry, &rnc_list); + + LOGPIU(LOGL_NOTICE, "New RNC %d (LAC=%d RAC=%d)\n", + rnc->rnc_id, rnc->lac, rnc->rac); + + return rnc; +} + +static struct ranap_iu_rnc *iu_rnc_register(uint16_t rnc_id, uint16_t lac, + uint8_t rac, struct osmo_sccp_addr *addr) +{ + struct ranap_iu_rnc *rnc; + llist_for_each_entry(rnc, &rnc_list, entry) { + if (rnc->rnc_id != rnc_id) + continue; + + /* We have this RNC Id registered already. Make sure that the + * details match. */ + + /* TODO should a mismatch be an error? */ + if (rnc->lac != lac || rnc->rac != rac) + LOGPIU(LOGL_NOTICE, "RNC %d changes its details:" + " LAC=%d RAC=%d --> LAC=%d RAC=%d\n", + rnc->rnc_id, rnc->lac, rnc->rac, + lac, rac); + rnc->lac = lac; + rnc->rac = rac; + + if (addr && memcmp(&rnc->sccp_addr, addr, sizeof(*addr))) + LOGPIU(LOGL_NOTICE, "RNC %d on New SCCP Addr %s" + " (LAC=%d RAC=%d)\n", + rnc->rnc_id, osmo_sccp_addr_dump(addr), rnc->lac, rnc->rac); + rnc->sccp_addr = *addr; + return rnc; + } + + /* Not found, make a new one. */ + return iu_rnc_alloc(rnc_id, lac, rac, addr); +} + +/*********************************************************************** + * RANAP handling + ***********************************************************************/ + +int ranap_iu_rab_act(struct ranap_ue_conn_ctx *ue_ctx, struct msgb *msg) +{ + struct osmo_scu_prim *prim; + + /* wrap RANAP message in SCCP N-DATA.req */ + prim = (struct osmo_scu_prim *) msgb_push(msg, sizeof(*prim)); + prim->u.data.conn_id = ue_ctx->conn_id; + osmo_prim_init(&prim->oph, + SCCP_SAP_USER, + OSMO_SCU_PRIM_N_DATA, + PRIM_OP_REQUEST, + msg); + return osmo_sccp_user_sap_down(g_scu, &prim->oph); +} + +int ranap_iu_rab_deact(struct ranap_ue_conn_ctx *ue_ctx, uint8_t rab_id) +{ + /* FIXME */ + return -1; +} + +int ranap_iu_tx_sec_mode_cmd(struct ranap_ue_conn_ctx *uectx, struct osmo_auth_vector *vec, + int send_ck, int new_key) +{ + struct osmo_scu_prim *prim; + struct msgb *msg; + + /* create RANAP message */ + msg = ranap_new_msg_sec_mod_cmd(vec->ik, send_ck? vec->ck : NULL, + new_key ? RANAP_KeyStatus_new : RANAP_KeyStatus_old); + msg->l2h = msg->data; + /* wrap RANAP message in SCCP N-DATA.req */ + prim = (struct osmo_scu_prim *) msgb_push(msg, sizeof(*prim)); + prim->u.data.conn_id = uectx->conn_id; + osmo_prim_init(&prim->oph, SCCP_SAP_USER, + OSMO_SCU_PRIM_N_DATA, + PRIM_OP_REQUEST, msg); + osmo_sccp_user_sap_down(g_scu, &prim->oph); + + return 0; +} + +int ranap_iu_tx_common_id(struct ranap_ue_conn_ctx *uectx, const char *imsi) +{ + struct msgb *msg; + struct osmo_scu_prim *prim; + + LOGPIU(LOGL_INFO, "Transmitting RANAP CommonID (SCCP conn_id %u)\n", + uectx->conn_id); + + msg = ranap_new_msg_common_id(imsi); + msg->l2h = msg->data; + prim = (struct osmo_scu_prim *) msgb_push(msg, sizeof(*prim)); + prim->u.data.conn_id = uectx->conn_id; + osmo_prim_init(&prim->oph, SCCP_SAP_USER, + OSMO_SCU_PRIM_N_DATA, + PRIM_OP_REQUEST, msg); + osmo_sccp_user_sap_down(g_scu, &prim->oph); + return 0; +} + +static int iu_grnc_id_parse(struct iu_grnc_id *dst, struct RANAP_GlobalRNC_ID *src) +{ + /* The size is coming from arbitrary sender, check it gracefully */ + if (src->pLMNidentity.size != 3) { + LOGPIU(LOGL_ERROR, "Invalid PLMN Identity size:" + " should be 3, is %d\n", src->pLMNidentity.size); + return -1; + } + gsm48_mcc_mnc_from_bcd(&src->pLMNidentity.buf[0], + &dst->mcc, &dst->mnc); + dst->rnc_id = (uint16_t)src->rNC_ID; + return 0; +} + +#if 0 + -- not used at present -- +static int iu_grnc_id_compose(struct iu_grnc_id *src, struct RANAP_GlobalRNC_ID *dst) +{ + /* The caller must ensure proper size */ + OSMO_ASSERT(dst->pLMNidentity.size == 3); + gsm48_mcc_mnc_to_bcd(&dst->pLMNidentity.buf[0], + src->mcc, src->mnc); + dst->rNC_ID = src->rnc_id; + return 0; +} +#endif + +struct new_ue_conn_ctx { + struct osmo_sccp_addr sccp_addr; + uint32_t conn_id; +}; + +static int ranap_handle_co_initial_ue(void *ctx, RANAP_InitialUE_MessageIEs_t *ies) +{ + struct new_ue_conn_ctx *new_ctx = ctx; + struct gprs_ra_id ra_id; + struct iu_grnc_id grnc_id; + uint16_t sai; + struct ranap_ue_conn_ctx *ue; + struct msgb *msg = msgb_alloc(256, "RANAP->NAS"); + struct ranap_iu_rnc *rnc; + + if (ranap_parse_lai(&ra_id, &ies->lai) != 0) { + LOGPIU(LOGL_ERROR, "Failed to parse RANAP LAI IE\n"); + return -1; + } + + if (ies->presenceMask & INITIALUE_MESSAGEIES_RANAP_RAC_PRESENT) { + ra_id.rac = asn1str_to_u8(&ies->rac); + } + + if (iu_grnc_id_parse(&grnc_id, &ies->globalRNC_ID) != 0) { + LOGPIU(LOGL_ERROR, + "Failed to parse RANAP Global-RNC-ID IE\n"); + return -1; + } + + sai = asn1str_to_u16(&ies->sai.sAC); + msgb_gmmh(msg) = msgb_put(msg, ies->nas_pdu.size); + memcpy(msgb_gmmh(msg), ies->nas_pdu.buf, ies->nas_pdu.size); + + /* Make sure we know the RNC Id and LAC+RAC coming in on this connection. */ + rnc = iu_rnc_register(grnc_id.rnc_id, ra_id.lac, ra_id.rac, &new_ctx->sccp_addr); + + ue = ue_conn_ctx_alloc(rnc, new_ctx->conn_id); + OSMO_ASSERT(ue); + ue->ra_id = ra_id; + + /* Feed into the MM layer */ + msg->dst = ue; + global_iu_recv_cb(msg, &ra_id, &sai); + + msgb_free(msg); + + return 0; +} + +static int ranap_handle_co_dt(void *ctx, RANAP_DirectTransferIEs_t *ies) +{ + struct gprs_ra_id _ra_id, *ra_id = NULL; + uint16_t _sai, *sai = NULL; + struct msgb *msg = msgb_alloc(256, "RANAP->NAS"); + + if (ies->presenceMask & DIRECTTRANSFERIES_RANAP_LAI_PRESENT) { + if (ranap_parse_lai(&_ra_id, &ies->lai) != 0) { + LOGPIU(LOGL_ERROR, "Failed to parse RANAP LAI IE\n"); + return -1; + } + ra_id = &_ra_id; + if (ies->presenceMask & DIRECTTRANSFERIES_RANAP_RAC_PRESENT) { + _ra_id.rac = asn1str_to_u8(&ies->rac); + } + if (ies->presenceMask & DIRECTTRANSFERIES_RANAP_SAI_PRESENT) { + _sai = asn1str_to_u16(&ies->sai.sAC); + sai = &_sai; + } + } + + msgb_gmmh(msg) = msgb_put(msg, ies->nas_pdu.size); + memcpy(msgb_gmmh(msg), ies->nas_pdu.buf, ies->nas_pdu.size); + + /* Feed into the MM/CC/SMS-CP layer */ + msg->dst = ctx; + global_iu_recv_cb(msg, ra_id, sai); + + msgb_free(msg); + + return 0; +} + +static int ranap_handle_co_err_ind(void *ctx, RANAP_ErrorIndicationIEs_t *ies) +{ + if (ies->presenceMask & ERRORINDICATIONIES_RANAP_CAUSE_PRESENT) + LOGPIU(LOGL_ERROR, "Rx Error Indication (%s)\n", + ranap_cause_str(&ies->cause)); + else + LOGPIU(LOGL_ERROR, "Rx Error Indication\n"); + + return 0; +} + +int ranap_iu_tx(struct msgb *msg_nas, uint8_t sapi) +{ + struct ranap_ue_conn_ctx *uectx = msg_nas->dst; + struct msgb *msg; + struct osmo_scu_prim *prim; + + LOGPIU(LOGL_INFO, "Transmitting L3 Message as RANAP DT (SCCP conn_id %u)\n", + uectx->conn_id); + + msg = ranap_new_msg_dt(sapi, msg_nas->data, msgb_length(msg_nas)); + msgb_free(msg_nas); + msg->l2h = msg->data; + prim = (struct osmo_scu_prim *) msgb_push(msg, sizeof(*prim)); + prim->u.data.conn_id = uectx->conn_id; + osmo_prim_init(&prim->oph, SCCP_SAP_USER, + OSMO_SCU_PRIM_N_DATA, + PRIM_OP_REQUEST, msg); + osmo_sccp_user_sap_down(g_scu, &prim->oph); + return 0; +} + +/* Send Iu Release for the given UE connection. + * If cause is NULL, the standard "No remaining RAB" cause is sent, otherwise + * the provided cause. */ +int ranap_iu_tx_release(struct ranap_ue_conn_ctx *ctx, const struct RANAP_Cause *cause) +{ + struct msgb *msg; + struct osmo_scu_prim *prim; + static const struct RANAP_Cause default_cause = { + .present = RANAP_Cause_PR_radioNetwork, + .choice.radioNetwork = RANAP_CauseRadioNetwork_no_remaining_rab, + }; + + if (!cause) + cause = &default_cause; + + msg = ranap_new_msg_iu_rel_cmd(cause); + msg->l2h = msg->data; + prim = (struct osmo_scu_prim *) msgb_push(msg, sizeof(*prim)); + prim->u.data.conn_id = ctx->conn_id; + osmo_prim_init(&prim->oph, SCCP_SAP_USER, + OSMO_SCU_PRIM_N_DATA, + PRIM_OP_REQUEST, msg); + return osmo_sccp_user_sap_down(g_scu, &prim->oph); +} + +static int ranap_handle_co_iu_rel_req(struct ranap_ue_conn_ctx *ctx, RANAP_Iu_ReleaseRequestIEs_t *ies) +{ + LOGPIU(LOGL_INFO, "Received Iu Release Request, Sending Release Command\n"); + ranap_iu_tx_release(ctx, &ies->cause); + return 0; +} + +static int ranap_handle_co_rab_ass_resp(struct ranap_ue_conn_ctx *ctx, RANAP_RAB_AssignmentResponseIEs_t *ies) +{ + int rc = -1; + + LOGPIU(LOGL_INFO, + "Rx RAB Assignment Response for UE conn_id %u\n", ctx->conn_id); + if (ies->presenceMask & RAB_ASSIGNMENTRESPONSEIES_RANAP_RAB_SETUPORMODIFIEDLIST_PRESENT) { + /* TODO: Iterate over list of SetupOrModifiedList IEs and handle each one */ + RANAP_IE_t *ranap_ie = ies->raB_SetupOrModifiedList.raB_SetupOrModifiedList_ies.list.array[0]; + RANAP_RAB_SetupOrModifiedItemIEs_t setup_ies; + + rc = ranap_decode_rab_setupormodifieditemies_fromlist(&setup_ies, &ranap_ie->value); + if (rc) { + LOGPIU(LOGL_ERROR, "Error in ranap_decode_rab_setupormodifieditemies()\n"); + return rc; + } + + rc = global_iu_event_cb(ctx, RANAP_IU_EVENT_RAB_ASSIGN, &setup_ies); + + ranap_free_rab_setupormodifieditemies(&setup_ies); + } + /* FIXME: handle RAB Ass failure? */ + + return rc; +} + +static void cn_ranap_handle_co_initial(void *ctx, ranap_message *message) +{ + int rc; + + LOGPIU(LOGL_NOTICE, "handle_co_initial(dir=%u, proc=%u)\n", message->direction, message->procedureCode); + + if (message->direction != RANAP_RANAP_PDU_PR_initiatingMessage + || message->procedureCode != RANAP_ProcedureCode_id_InitialUE_Message) { + LOGPIU(LOGL_ERROR, "Expected direction 'InitiatingMessage'," + " procedureCode 'InitialUE_Message', instead got %u and %u\n", + message->direction, message->procedureCode); + rc = -1; + } + else + rc = ranap_handle_co_initial_ue(ctx, &message->msg.initialUE_MessageIEs); + + if (rc) { + LOGPIU(LOGL_ERROR, "Error in %s (%d)\n", __func__, rc); + /* TODO handling of the error? */ + } +} + +/* Entry point for connection-oriented RANAP message */ +static void cn_ranap_handle_co(void *ctx, ranap_message *message) +{ + int rc; + + LOGPIU(LOGL_NOTICE, "handle_co(dir=%u, proc=%u)\n", message->direction, message->procedureCode); + + switch (message->direction) { + case RANAP_RANAP_PDU_PR_initiatingMessage: + switch (message->procedureCode) { + case RANAP_ProcedureCode_id_InitialUE_Message: + LOGPIU(LOGL_ERROR, "Got InitialUE_Message but this is not a new conn\n"); + rc = -1; + break; + case RANAP_ProcedureCode_id_DirectTransfer: + rc = ranap_handle_co_dt(ctx, &message->msg.directTransferIEs); + break; + case RANAP_ProcedureCode_id_ErrorIndication: + rc = ranap_handle_co_err_ind(ctx, &message->msg.errorIndicationIEs); + break; + case RANAP_ProcedureCode_id_Iu_ReleaseRequest: + /* Iu Release Request */ + rc = ranap_handle_co_iu_rel_req(ctx, &message->msg.iu_ReleaseRequestIEs); + break; + default: + LOGPIU(LOGL_ERROR, "Received Initiating Message: unknown Procedure Code %d\n", + message->procedureCode); + rc = -1; + break; + } + break; + case RANAP_RANAP_PDU_PR_successfulOutcome: + switch (message->procedureCode) { + case RANAP_ProcedureCode_id_SecurityModeControl: + /* Security Mode Complete */ + rc = global_iu_event_cb(ctx, RANAP_IU_EVENT_SECURITY_MODE_COMPLETE, NULL); + break; + case RANAP_ProcedureCode_id_Iu_Release: + /* Iu Release Complete */ + rc = global_iu_event_cb(ctx, RANAP_IU_EVENT_IU_RELEASE, NULL); + if (rc) { + LOGPIU(LOGL_ERROR, "Iu Release event: Iu Event callback returned %d\n", + rc); + } + break; + default: + LOGPIU(LOGL_ERROR, "Received Successful Outcome: unknown Procedure Code %d\n", + message->procedureCode); + rc = -1; + break; + } + break; + case RANAP_RANAP_PDU_PR_outcome: + switch (message->procedureCode) { + case RANAP_ProcedureCode_id_RAB_Assignment: + /* RAB Assignment Response */ + rc = ranap_handle_co_rab_ass_resp(ctx, &message->msg.raB_AssignmentResponseIEs); + break; + default: + LOGPIU(LOGL_ERROR, "Received Outcome: unknown Procedure Code %d\n", + message->procedureCode); + rc = -1; + break; + } + break; + case RANAP_RANAP_PDU_PR_unsuccessfulOutcome: + default: + LOGPIU(LOGL_ERROR, "Received Unsuccessful Outcome: Procedure Code %d\n", + message->procedureCode); + rc = -1; + break; + } + + if (rc) { + LOGPIU(LOGL_ERROR, "Error in %s (%d)\n", __func__, rc); + /* TODO handling of the error? */ + } +} + +static int ranap_handle_cl_reset_req(void *ctx, RANAP_ResetIEs_t *ies) +{ + /* FIXME: send reset response */ + return -1; +} + +static int ranap_handle_cl_err_ind(void *ctx, RANAP_ErrorIndicationIEs_t *ies) +{ + if (ies->presenceMask & ERRORINDICATIONIES_RANAP_CAUSE_PRESENT) + LOGPIU(LOGL_ERROR, "Rx Error Indication (%s)\n", + ranap_cause_str(&ies->cause)); + else + LOGPIU(LOGL_ERROR, "Rx Error Indication\n"); + + return 0; +} + +/* Entry point for connection-less RANAP message */ +static void cn_ranap_handle_cl(void *ctx, ranap_message *message) +{ + int rc; + + switch (message->direction) { + case RANAP_RANAP_PDU_PR_initiatingMessage: + switch (message->procedureCode) { + case RANAP_ProcedureCode_id_Reset: + /* received reset.req, send reset.resp */ + rc = ranap_handle_cl_reset_req(ctx, &message->msg.resetIEs); + break; + case RANAP_ProcedureCode_id_ErrorIndication: + rc = ranap_handle_cl_err_ind(ctx, &message->msg.errorIndicationIEs); + break; + default: + rc = -1; + break; + } + break; + case RANAP_RANAP_PDU_PR_successfulOutcome: + case RANAP_RANAP_PDU_PR_unsuccessfulOutcome: + case RANAP_RANAP_PDU_PR_outcome: + default: + rc = -1; + break; + } + + if (rc) { + LOGPIU(LOGL_ERROR, "Error in %s (%d)\n", __func__, rc); + /* TODO handling of the error? */ + } +} + +/*********************************************************************** + * Paging + ***********************************************************************/ + +struct osmo_sccp_addr local_sccp_addr = { + .presence = OSMO_SCCP_ADDR_T_SSN | OSMO_SCCP_ADDR_T_PC, + .ri = OSMO_SCCP_RI_SSN_PC, + .ssn = OSMO_SCCP_SSN_RANAP, + .pc = 1, +}; + +/* Send a paging command down a given SCCP User. tmsi and paging_cause are + * optional and may be passed NULL and 0, respectively, to disable their use. + * See enum RANAP_PagingCause. + * + * If TMSI is given, the IMSI is not sent over the air interface. Nevertheless, + * the IMSI is still required for resolution in the HNB-GW and/or(?) RNC. */ +static int iu_tx_paging_cmd(struct osmo_sccp_addr *called_addr, + const char *imsi, const uint32_t *tmsi, + bool is_ps, uint32_t paging_cause) +{ + struct msgb *msg; + msg = ranap_new_msg_paging_cmd(imsi, tmsi, is_ps? 1 : 0, paging_cause); + msg->l2h = msg->data; + osmo_sccp_tx_unitdata_msg(g_scu, &local_sccp_addr, called_addr, msg); + return 0; +} + +static int iu_page(const char *imsi, const uint32_t *tmsi_or_ptimsi, + uint16_t lac, uint8_t rac, bool is_ps) +{ + struct ranap_iu_rnc *rnc; + int pagings_sent = 0; + + if (tmsi_or_ptimsi) { + LOGPIU(LOGL_DEBUG, "%s: Looking for RNCs to page for IMSI %s" + " (paging will use %s %x)\n", + is_ps? "IuPS" : "IuCS", + imsi, + is_ps? "PTMSI" : "TMSI", + *tmsi_or_ptimsi); + } else { + LOGPIU(LOGL_DEBUG, "%s: Looking for RNCs to page for IMSI %s" + " (paging will use IMSI)\n", + is_ps? "IuPS" : "IuCS", + imsi + ); + } + + llist_for_each_entry(rnc, &rnc_list, entry) { + if (rnc->lac != lac) + continue; + if (is_ps && rnc->rac != rac) + continue; + + /* Found a match! */ + if (iu_tx_paging_cmd(&rnc->sccp_addr, imsi, tmsi_or_ptimsi, is_ps, 0) + == 0) { + LOGPIU(LOGL_DEBUG, + "%s: Paged for IMSI %s on RNC %d, on SCCP addr %s\n", + is_ps? "IuPS" : "IuCS", + imsi, rnc->rnc_id, osmo_sccp_addr_dump(&rnc->sccp_addr)); + pagings_sent ++; + } + } + + /* Some logging... */ + if (pagings_sent > 0) { + LOGPIU(LOGL_DEBUG, + "%s: %d RNCs were paged for IMSI %s.\n", + is_ps? "IuPS" : "IuCS", + pagings_sent, imsi); + } + else { + if (is_ps) { + LOGPIU(LOGL_ERROR, "IuPS: Found no RNC to page for" + " LAC %d RAC %d (would have paged IMSI %s)\n", + lac, rac, imsi); + } + else { + LOGPIU(LOGL_ERROR, "IuCS: Found no RNC to page for" + " LAC %d (would have paged IMSI %s)\n", + lac, imsi); + } + } + + return pagings_sent; +} + +int ranap_iu_page_cs(const char *imsi, const uint32_t *tmsi, uint16_t lac) +{ + return iu_page(imsi, tmsi, lac, 0, false); +} + +int ranap_iu_page_ps(const char *imsi, const uint32_t *ptmsi, uint16_t lac, uint8_t rac) +{ + return iu_page(imsi, ptmsi, lac, rac, true); +} + + +/*********************************************************************** + * + ***********************************************************************/ + +int tx_unitdata(struct osmo_sccp_user *scu); +int tx_conn_req(struct osmo_sccp_user *scu, uint32_t conn_id); + +struct osmo_prim_hdr *make_conn_req(uint32_t conn_id); +struct osmo_prim_hdr *make_dt1_req(uint32_t conn_id, const uint8_t *data, unsigned int len); + +static struct osmo_prim_hdr *make_conn_resp(struct osmo_scu_connect_param *param) +{ + struct msgb *msg = msgb_alloc(1024, "conn_resp"); + struct osmo_scu_prim *prim; + + prim = (struct osmo_scu_prim *) msgb_put(msg, sizeof(*prim)); + osmo_prim_init(&prim->oph, SCCP_SAP_USER, + OSMO_SCU_PRIM_N_CONNECT, + PRIM_OP_RESPONSE, msg); + memcpy(&prim->u.connect, param, sizeof(prim->u.connect)); + return &prim->oph; +} + +static int sccp_sap_up(struct osmo_prim_hdr *oph, void *_scu) +{ + struct osmo_sccp_user *scu = _scu; + struct osmo_scu_prim *prim = (struct osmo_scu_prim *) oph; + struct osmo_prim_hdr *resp = NULL; + int rc; + struct ranap_ue_conn_ctx *ue; + struct new_ue_conn_ctx new_ctx = {}; + + LOGPIU(LOGL_DEBUG, "sccp_sap_up(%s)\n", osmo_scu_prim_name(oph)); + + switch (OSMO_PRIM_HDR(oph)) { + case OSMO_PRIM(OSMO_SCU_PRIM_N_CONNECT, PRIM_OP_CONFIRM): + /* confirmation of outbound connection */ + rc = -1; + break; + case OSMO_PRIM(OSMO_SCU_PRIM_N_CONNECT, PRIM_OP_INDICATION): + /* indication of new inbound connection request*/ + LOGPIU(LOGL_DEBUG, "N-CONNECT.ind(X->%u)\n", prim->u.connect.conn_id); + if (/* prim->u.connect.called_addr.ssn != OSMO_SCCP_SSN_RANAP || */ + !msgb_l2(oph->msg) || msgb_l2len(oph->msg) == 0) { + LOGPIU(LOGL_NOTICE, + "Received invalid N-CONNECT.ind\n"); + return 0; + } + new_ctx.sccp_addr = prim->u.connect.calling_addr; + new_ctx.conn_id = prim->u.connect.conn_id; + /* first ensure the local SCCP socket is ACTIVE */ + resp = make_conn_resp(&prim->u.connect); + osmo_sccp_user_sap_down(scu, resp); + /* then handle the RANAP payload */ + rc = ranap_cn_rx_co(cn_ranap_handle_co_initial, &new_ctx, msgb_l2(oph->msg), msgb_l2len(oph->msg)); + break; + case OSMO_PRIM(OSMO_SCU_PRIM_N_DISCONNECT, PRIM_OP_INDICATION): + /* indication of disconnect */ + LOGPIU(LOGL_DEBUG, "N-DISCONNECT.ind(%u)\n", + prim->u.disconnect.conn_id); + ue = ue_conn_ctx_find(prim->u.disconnect.conn_id); + rc = ranap_cn_rx_co(cn_ranap_handle_co, ue, msgb_l2(oph->msg), msgb_l2len(oph->msg)); + break; + case OSMO_PRIM(OSMO_SCU_PRIM_N_DATA, PRIM_OP_INDICATION): + /* connection-oriented data received */ + LOGPIU(LOGL_DEBUG, "N-DATA.ind(%u, %s)\n", prim->u.data.conn_id, + osmo_hexdump(msgb_l2(oph->msg), msgb_l2len(oph->msg))); + /* resolve UE context */ + ue = ue_conn_ctx_find(prim->u.data.conn_id); + rc = ranap_cn_rx_co(cn_ranap_handle_co, ue, msgb_l2(oph->msg), msgb_l2len(oph->msg)); + break; + case OSMO_PRIM(OSMO_SCU_PRIM_N_UNITDATA, PRIM_OP_INDICATION): + /* 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)); + break; + default: + rc = -1; + break; + } + + msgb_free(oph->msg); + return rc; +} + +int ranap_iu_init(void *ctx, int log_subsystem, const char *sccp_user_name, struct osmo_sccp_instance *sccp, + ranap_iu_recv_cb_t iu_recv_cb, ranap_iu_event_cb_t iu_event_cb) +{ + iu_log_subsystem = log_subsystem; + talloc_iu_ctx = talloc_named_const(ctx, 1, "iu"); + talloc_asn1_ctx = talloc_named_const(talloc_iu_ctx, 1, "asn1"); + + global_iu_recv_cb = iu_recv_cb; + global_iu_event_cb = iu_event_cb; + g_sccp = sccp; + g_scu = osmo_sccp_user_bind(g_sccp, sccp_user_name, sccp_sap_up, OSMO_SCCP_SSN_RANAP); + + return 0; +} + diff --git a/src/iu_client_vty.c b/src/iu_client_vty.c new file mode 100644 index 0000000..b809b2a --- /dev/null +++ b/src/iu_client_vty.c @@ -0,0 +1,140 @@ +/* OpenBSC Iu related interface to quagga VTY */ +/* (C) 2016 by sysmocom s.m.f.c. GmbH + * All Rights Reserved + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + * + */ + +#include +#include + +#include +#include +#include +#include +#include + +#include + +static enum ranap_nsap_addr_enc *g_rab_assign_addr_enc = NULL; + +DEFUN(cfg_iu_asn1_debug, + cfg_iu_asn1_debug_cmd, + "asn1 debug (1|0)", + "ASN.1 settings\n" + "Enable ASN.1 debug messages\n" + "Log ASN.1 debug messages to stderr\n" + "Do not log ASN.1 debug messages to stderr\n") +{ + asn_debug = atoi(argv[0]); + return CMD_SUCCESS; +} + +DEFUN(cfg_iu_asn1_xer_print, + cfg_iu_asn1_xer_print_cmd, + "asn1 xer-print (1|0)", + "ASN.1 settings\n" + "Log human readable representations of all ASN.1 messages to stderr\n" + "Log XML representation of all ASN.1 messages to stderr\n" + "Do not log decoded ASN.1 messages to stderr\n") +{ + asn1_xer_print = atoi(argv[0]); + return CMD_SUCCESS; +} + +#define IU_STR "Iu interface protocol options\n" +DEFUN(cfg_iu_rab_assign_addr_enc, cfg_iu_rab_assign_addr_enc_cmd, + "iu rab-assign-addr-enc (x213|v4raw)", + IU_STR + "Choose RAB Assignment's Transport Layer Address encoding\n" + "ITU-T X.213 compliant address encoding (default)\n" + "32bit length raw IPv4 address (for ip.access nano3G)\n") +{ + if (!g_rab_assign_addr_enc) { + vty_out(vty, "%%RAB Assignment Transport Layer Address" + " encoding not available%s", VTY_NEWLINE); + return CMD_WARNING; + } + + if (strcmp(argv[0], "v4raw") == 0) + *g_rab_assign_addr_enc = RANAP_NSAP_ADDR_ENC_V4RAW; + else + *g_rab_assign_addr_enc = RANAP_NSAP_ADDR_ENC_X213; + return CMD_SUCCESS; +} + +extern struct osmo_sccp_addr local_sccp_addr; + +DEFUN(cfg_iu_local_addr_pc, cfg_iu_local_addr_pc_cmd, + "iu local-address point-code PC", + IU_STR "Local SCCP Address\n") +{ + local_sccp_addr.presence = OSMO_SCCP_ADDR_T_PC | OSMO_SCCP_ADDR_T_SSN; + local_sccp_addr.ri = OSMO_SCCP_RI_SSN_PC; + local_sccp_addr.pc = osmo_ss7_pointcode_parse(NULL, argv[0]); + + return CMD_SUCCESS; +} + +/* TODO: GT address configuration, in line with 4.5.1.1.1 of TS 25.410 */ + +int ranap_iu_vty_config_write(struct vty *vty, const char *indent) +{ + if (!g_rab_assign_addr_enc) { + vty_out(vty, "%%RAB Assignment Transport Layer Address" + " encoding not available%s", VTY_NEWLINE); + return CMD_WARNING; + } + + switch (*g_rab_assign_addr_enc) { + case RANAP_NSAP_ADDR_ENC_V4RAW: + vty_out(vty, "%siu rab-assign-addr-enc v4raw%s", indent, + VTY_NEWLINE); + break; + case RANAP_NSAP_ADDR_ENC_X213: + /* default value, no need to write anything */ + break; + default: + LOGP(0, LOGL_ERROR, "Invalid value for" + " iu.rab_assign_addr_enc: %d\n", + *g_rab_assign_addr_enc); + return CMD_WARNING; + } + + vty_out(vty, "%siu local-address point-code %s%s", indent, + osmo_ss7_pointcode_print(NULL, local_sccp_addr.pc), VTY_NEWLINE); + + if (asn_debug) + vty_out(vty, "%sasn1 debug 1%s", indent, VTY_NEWLINE); + + if (asn1_xer_print) + vty_out(vty, "%sasn1 xer-print 1%s", indent, VTY_NEWLINE); + + return CMD_SUCCESS; +} + +void ranap_iu_vty_init(int iu_parent_node, enum ranap_nsap_addr_enc *rab_assign_addr_enc) +{ + g_rab_assign_addr_enc = rab_assign_addr_enc; + + install_element(iu_parent_node, &cfg_iu_rab_assign_addr_enc_cmd); + install_element(iu_parent_node, &cfg_iu_local_addr_pc_cmd); + + /* Technically, these are global ASN.1 settings and not necessarily limited to the Iu interface. + * Practically, only Iu users will use ASN.1 in Osmocom programs -- at least so far. So it is + * easiest to have these commands under 'iu'. */ + install_element(iu_parent_node, &cfg_iu_asn1_debug_cmd); + install_element(iu_parent_node, &cfg_iu_asn1_xer_print_cmd); +} -- To view, visit https://gerrit.osmocom.org/3187 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I6a3f7ad15be03fb94689b4af6ccfa828c25f45c0 Gerrit-PatchSet: 4 Gerrit-Project: osmo-iuh Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Mon Aug 7 12:20:26 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 7 Aug 2017 12:20:26 +0000 Subject: osmo-gsm-tester[master]: aoip: add newly needed osmo-msc point-code config In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3414 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I54be984415445e695c583f35c419aed559ac5c84 Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Aug 7 12:20:29 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 7 Aug 2017 12:20:29 +0000 Subject: osmo-gsm-tester[master]: cosmetic: osmo-msc.cfg.tmpl: fix indent In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3415 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Iefc3b06338cff4f5e51b7b03d9a5f92de18ca86a Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Aug 7 12:20:31 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 7 Aug 2017 12:20:31 +0000 Subject: [MERGED] osmo-gsm-tester[master]: cosmetic: osmo-msc.cfg.tmpl: fix indent In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: cosmetic: osmo-msc.cfg.tmpl: fix indent ...................................................................... cosmetic: osmo-msc.cfg.tmpl: fix indent Change-Id: Iefc3b06338cff4f5e51b7b03d9a5f92de18ca86a --- M src/osmo_gsm_tester/templates/osmo-msc.cfg.tmpl 1 file changed, 2 insertions(+), 2 deletions(-) Approvals: Neels Hofmeyr: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/osmo_gsm_tester/templates/osmo-msc.cfg.tmpl b/src/osmo_gsm_tester/templates/osmo-msc.cfg.tmpl index 314450b..1abaf20 100644 --- a/src/osmo_gsm_tester/templates/osmo-msc.cfg.tmpl +++ b/src/osmo_gsm_tester/templates/osmo-msc.cfg.tmpl @@ -19,8 +19,8 @@ cs7 instance 0 point-code 0.0.1 msc - mgcpgw remote-ip ${mgcpgw.ip_address.addr} - assign-tmsi + mgcpgw remote-ip ${mgcpgw.ip_address.addr} + assign-tmsi cs7-instance-iu 0 cs7-instance-a 0 ctrl -- To view, visit https://gerrit.osmocom.org/3415 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Iefc3b06338cff4f5e51b7b03d9a5f92de18ca86a Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Mon Aug 7 12:20:31 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 7 Aug 2017 12:20:31 +0000 Subject: [MERGED] osmo-gsm-tester[master]: aoip: add newly needed osmo-msc point-code config In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: aoip: add newly needed osmo-msc point-code config ...................................................................... aoip: add newly needed osmo-msc point-code config OsmoMSC no longer has a hard-coded point-code of 0.0.1. Configure it. Change-Id: I54be984415445e695c583f35c419aed559ac5c84 --- M src/osmo_gsm_tester/templates/osmo-msc.cfg.tmpl 1 file changed, 4 insertions(+), 0 deletions(-) Approvals: Neels Hofmeyr: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/osmo_gsm_tester/templates/osmo-msc.cfg.tmpl b/src/osmo_gsm_tester/templates/osmo-msc.cfg.tmpl index 89982e0..314450b 100644 --- a/src/osmo_gsm_tester/templates/osmo-msc.cfg.tmpl +++ b/src/osmo_gsm_tester/templates/osmo-msc.cfg.tmpl @@ -16,9 +16,13 @@ auth policy ${msc.net.auth_policy} location updating reject cause 13 encryption ${msc.net.encryption} +cs7 instance 0 + point-code 0.0.1 msc mgcpgw remote-ip ${mgcpgw.ip_address.addr} assign-tmsi + cs7-instance-iu 0 + cs7-instance-a 0 ctrl bind ${msc.ip_address.addr} smpp -- To view, visit https://gerrit.osmocom.org/3414 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I54be984415445e695c583f35c419aed559ac5c84 Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Mon Aug 7 14:07:07 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 7 Aug 2017 14:07:07 +0000 Subject: [PATCH] libosmo-sccp[master]: introduce OSMO_SCCP_RI_NONE to indicate unset RI In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3362 to look at the new patch set (#2). introduce OSMO_SCCP_RI_NONE to indicate unset RI Allows to automatically set an RI in future change I75c67d289693f1c2a049ac61cf2b2097d6e5687d "sccp-addr vty: set RI to SSN_PC when setting a point-code" Change-Id: I6e2f31b023b08cba2f2ee8234e6108efcaca41c0 --- M include/osmocom/sigtran/sccp_sap.h M src/osmo_ss7_vty.c 2 files changed, 6 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-sccp refs/changes/62/3362/2 diff --git a/include/osmocom/sigtran/sccp_sap.h b/include/osmocom/sigtran/sccp_sap.h index 732df2a..ff4c674 100644 --- a/include/osmocom/sigtran/sccp_sap.h +++ b/include/osmocom/sigtran/sccp_sap.h @@ -54,6 +54,7 @@ /* Q.713 3.4.1 + RFC 3868 3.10.2.3 */ enum osmo_sccp_routing_ind { + OSMO_SCCP_RI_NONE, OSMO_SCCP_RI_GT, OSMO_SCCP_RI_SSN_PC, OSMO_SCCP_RI_SSN_IP, diff --git a/src/osmo_ss7_vty.c b/src/osmo_ss7_vty.c index fab27b4..f60eef4 100644 --- a/src/osmo_ss7_vty.c +++ b/src/osmo_ss7_vty.c @@ -1049,6 +1049,11 @@ case OSMO_SCCP_RI_SSN_IP: vty_out(vty, " routing-indicator IP%s", VTY_NEWLINE); break; + case OSMO_SCCP_RI_NONE: + break; + default: + vty_out(vty, " ! invalid routing-indicator value: %u%s", entry->addr.ri, VTY_NEWLINE); + break; } if (entry->addr.presence & OSMO_SCCP_ADDR_T_PC) vty_out(vty, " point-code %s%s", -- To view, visit https://gerrit.osmocom.org/3362 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I6e2f31b023b08cba2f2ee8234e6108efcaca41c0 Gerrit-PatchSet: 2 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Mon Aug 7 14:52:47 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 7 Aug 2017 14:52:47 +0000 Subject: [PATCH] osmo-msc[master]: Implement IuCS (large refactoring and addition) In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3347 to look at the new patch set (#5). Implement IuCS (large refactoring and addition) osmo-nitb becomes osmo-msc add DIUCS debug log constant add iucs.[hc] add msc vty, remove nitb vty add libiudummy, to avoid linking Iu deps in tests Use new msc_tx_dtap() instead of gsm0808_submit_dtap() libmgcp: add mgcpgw client API bridge calls via mgcpgw Enable MSC specific CTRL commands, bsc_base_ctrl_cmds_install() still needs to be split up. Change-Id: I5b5b6a9678b458affa86800afb1ec726e66eed88 --- M .gitignore M configure.ac M doc/examples/osmo-bsc_mgcp/mgcp.cfg A doc/examples/osmo-msc/osmo-msc.cfg D doc/examples/osmo-nitb/bs11/openbsc-1bts-2trx-hopping.cfg D doc/examples/osmo-nitb/bs11/openbsc-1bts-2trx.cfg D doc/examples/osmo-nitb/bs11/openbsc-2bts-2trx.cfg D doc/examples/osmo-nitb/bs11/openbsc.cfg D doc/examples/osmo-nitb/nanobts/openbsc-multitrx.cfg D doc/examples/osmo-nitb/nanobts/openbsc.cfg D doc/examples/osmo-nitb/nokia/openbsc_nokia_3trx.cfg D doc/examples/osmo-nitb/rbs2308/openbsc.cfg D doc/examples/osmo-nitb/sysmobts/openbsc.cfg M include/openbsc/Makefile.am A include/openbsc/common.h M include/openbsc/debug.h M include/openbsc/gprs_gmm.h M include/openbsc/gsm_data.h M include/openbsc/gsm_subscriber.h M include/openbsc/iu.h A include/openbsc/iucs.h A include/openbsc/iucs_ranap.h M include/openbsc/mgcp.h M include/openbsc/mgcp_internal.h A include/openbsc/mgcpgw_client.h M include/openbsc/msc_ifaces.h M include/openbsc/osmo_msc.h M include/openbsc/sgsn.h M include/openbsc/transaction.h M include/openbsc/vlr.h M include/openbsc/vty.h M osmoappdesc.py M src/Makefile.am M src/gprs/gprs_gmm.c M src/gprs/gprs_sgsn.c M src/gprs/sgsn_libgtp.c M src/gprs/sgsn_main.c M src/gprs/sgsn_vty.c M src/libbsc/bsc_init.c M src/libbsc/paging.c M src/libcommon/debug.c M src/libcommon/gsm_data.c M src/libiu/iu.c M src/libiu/iu_vty.c M src/libmgcp/Makefile.am A src/libmgcp/mgcp_common.c M src/libmgcp/mgcp_network.c M src/libmgcp/mgcp_protocol.c A src/libmgcp/mgcpgw_client.c A src/libmgcp/mgcpgw_client_vty.c M src/libmsc/Makefile.am M src/libmsc/a_iface.c M src/libmsc/gsm_04_08.c M src/libmsc/gsm_04_11.c M src/libmsc/gsm_04_80.c M src/libmsc/gsm_subscriber.c A src/libmsc/iu_dummy.c A src/libmsc/iucs.c A src/libmsc/iucs_ranap.c M src/libmsc/msc_ifaces.c A src/libmsc/msc_vty.c M src/libmsc/osmo_msc.c M src/libmsc/silent_call.c M src/libmsc/subscr_conn.c M src/libmsc/transaction.c M src/libmsc/vty_interface_layer3.c M src/libvlr/vlr.c M src/libvlr/vlr_access_req_fsm.c M src/libvlr/vlr_lu_fsm.c M src/osmo-bsc/osmo_bsc_api.c R src/osmo-msc/Makefile.am A src/osmo-msc/msc_main.c D src/osmo-nitb/bsc_hack.c M tests/ctrl_test_runner.py M tests/db/Makefile.am M tests/db/db_test.c M tests/mgcp/Makefile.am A tests/mgcp/mgcpgw_client_test.c A tests/mgcp/mgcpgw_client_test.err A tests/mgcp/mgcpgw_client_test.ok M tests/msc_vlr/Makefile.am M tests/msc_vlr/msc_vlr_test_gsm_authen.err M tests/msc_vlr/msc_vlr_test_gsm_ciph.err M tests/msc_vlr/msc_vlr_test_hlr_reject.err M tests/msc_vlr/msc_vlr_test_hlr_timeout.err M tests/msc_vlr/msc_vlr_test_ms_timeout.err M tests/msc_vlr/msc_vlr_test_no_authen.c M tests/msc_vlr/msc_vlr_test_no_authen.err M tests/msc_vlr/msc_vlr_test_reject_concurrency.err M tests/msc_vlr/msc_vlr_test_rest.err M tests/msc_vlr/msc_vlr_test_umts_authen.c M tests/msc_vlr/msc_vlr_test_umts_authen.err M tests/msc_vlr/msc_vlr_tests.c M tests/msc_vlr/msc_vlr_tests.h M tests/smpp_test_runner.py M tests/sms_queue/Makefile.am M tests/testsuite.at M tests/vty_test_runner.py 98 files changed, 5,032 insertions(+), 3,347 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/47/3347/5 -- To view, visit https://gerrit.osmocom.org/3347 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I5b5b6a9678b458affa86800afb1ec726e66eed88 Gerrit-PatchSet: 5 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Mon Aug 7 14:52:48 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 7 Aug 2017 14:52:48 +0000 Subject: [PATCH] osmo-msc[master]: vlr: place comments on if (0) cases Message-ID: Review at https://gerrit.osmocom.org/3416 vlr: place comments on if (0) cases Change-Id: I56c1e61dedeac01a4e24452feee6616782783d8f --- M src/libvlr/vlr_access_req_fsm.c M src/libvlr/vlr_lu_fsm.c 2 files changed, 8 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/16/3416/1 diff --git a/src/libvlr/vlr_access_req_fsm.c b/src/libvlr/vlr_access_req_fsm.c index 279e3d4..15f84b7 100644 --- a/src/libvlr/vlr_access_req_fsm.c +++ b/src/libvlr/vlr_access_req_fsm.c @@ -172,6 +172,7 @@ LOGPFSM(fi, "%s()\n", __func__); + /* See 3GPP TS 29.002 Proc_Acc_Req_VLR3. */ /* TODO: Identity := IMSI */ if (0 /* TODO: TMSI reallocation at access: vlr->cfg.alloc_tmsi_arq */) { vlr_subscr_alloc_tmsi(vsub); @@ -194,6 +195,7 @@ LOGPFSM(fi, "%s()\n", __func__); /* Node 3 */ + /* See 3GPP TS 29.002 Proc_Acc_Req_VLR3. */ if (0 /* IMEI check required */) { /* Chck_IMEI_VLR */ vlr->ops.tx_id_req(par->msc_conn_ref, GSM_MI_TYPE_IMEI); @@ -207,6 +209,7 @@ static void _proc_arq_vlr_post_pres(struct osmo_fsm_inst *fi) { LOGPFSM(fi, "%s()\n", __func__); + /* See 3GPP TS 29.002 Proc_Acc_Req_VLR3. */ if (0 /* TODO: tracing required */) { /* TODO: Trace_Subscriber_Activity_VLR */ osmo_fsm_inst_state_chg(fi, PR_ARQ_S_WAIT_TRACE_SUB, 0, 0); @@ -227,6 +230,7 @@ proc_arq_fsm_done(fi, VLR_PR_ARQ_RES_UNIDENT_SUBSCR); return; } + /* We don't feature location area specific blocking (yet). */ if (0 /* roaming not allowed in LA */) { /* Set User Error: Roaming not allowed in this LA */ proc_arq_fsm_done(fi, VLR_PR_ARQ_RES_ROAMING_NOTALLOWED); diff --git a/src/libvlr/vlr_lu_fsm.c b/src/libvlr/vlr_lu_fsm.c index d32659f..f9ccbdf 100644 --- a/src/libvlr/vlr_lu_fsm.c +++ b/src/libvlr/vlr_lu_fsm.c @@ -760,7 +760,9 @@ { LOGPFSM(fi, "%s()\n", __func__); - /* FIXME */ + /* OsmoHLR does not support PgA, neither stores the IMEISV, so we have no need to update the HLR + * with either. TODO: depend on actual HLR configuration. See 3GPP TS 23.012 Release 14, process + * Update_Location_Area_VLR (ULA_VLR2). */ if (0) { /* IMEISV or PgA to send */ vlr_loc_upd_node_4(fi); } else { @@ -1149,6 +1151,7 @@ /* unsuccessful case */ enum gsm48_gmm_cause cause = *(enum gsm48_gmm_cause *)data; + /* Ignoring standalone mode for now. */ if (0 /* procedure_error && vlr->cfg.standalone_mode */) { osmo_fsm_inst_state_chg(fi, VLR_ULA_S_WAIT_LU_COMPL_STANDALONE, -- To view, visit https://gerrit.osmocom.org/3416 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I56c1e61dedeac01a4e24452feee6616782783d8f Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Mon Aug 7 14:52:49 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 7 Aug 2017 14:52:49 +0000 Subject: [PATCH] osmo-msc[master]: vlr: LU FSM: enable Retrieve_IMEISV_If_Required Message-ID: Review at https://gerrit.osmocom.org/3417 vlr: LU FSM: enable Retrieve_IMEISV_If_Required Change-Id: I121b95ad6d5ecb7603815eece2b43008de487a8a --- M include/openbsc/vlr.h M src/libvlr/vlr_access_req_fsm.c M src/libvlr/vlr_lu_fsm.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.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_umts_authen.err M tests/msc_vlr/msc_vlr_tests.c 14 files changed, 123 insertions(+), 111 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/17/3417/1 diff --git a/include/openbsc/vlr.h b/include/openbsc/vlr.h index 17cb2ae..09e2ff4 100644 --- a/include/openbsc/vlr.h +++ b/include/openbsc/vlr.h @@ -211,7 +211,8 @@ struct gsup_client *gsup_client; struct vlr_ops ops; struct { - bool retrieve_imeisv; + bool retrieve_imeisv_early; + bool retrieve_imeisv_ciphered; bool assign_tmsi; bool check_imei_rqd; int auth_tuple_max_use_count; diff --git a/src/libvlr/vlr_access_req_fsm.c b/src/libvlr/vlr_access_req_fsm.c index 15f84b7..67fba56 100644 --- a/src/libvlr/vlr_access_req_fsm.c +++ b/src/libvlr/vlr_access_req_fsm.c @@ -286,7 +286,7 @@ if (vlr_set_ciph_mode(vsub->vlr, fi, par->msc_conn_ref, par->ciphering_required, - vsub->vlr->cfg.retrieve_imeisv)) { + vsub->vlr->cfg.retrieve_imeisv_ciphered)) { LOGPFSML(fi, LOGL_ERROR, "Failed to send Ciphering Mode Command\n"); proc_arq_fsm_done(fi, VLR_PR_ARQ_RES_SYSTEM_FAILURE); diff --git a/src/libvlr/vlr_lu_fsm.c b/src/libvlr/vlr_lu_fsm.c index f9ccbdf..ae671c1 100644 --- a/src/libvlr/vlr_lu_fsm.c +++ b/src/libvlr/vlr_lu_fsm.c @@ -814,7 +814,7 @@ if (vlr_set_ciph_mode(vsub->vlr, fi, lfp->msc_conn_ref, lfp->ciphering_required, - vsub->vlr->cfg.retrieve_imeisv)) { + vsub->vlr->cfg.retrieve_imeisv_ciphered)) { LOGPFSML(fi, LOGL_ERROR, "Failed to send Ciphering Mode Command\n"); vlr_lu_compl_fsm_failure(fi, GSM48_REJECT_NETWORK_FAILURE); @@ -896,13 +896,62 @@ return buf; } +static int _lu_fsm_associate_vsub(struct osmo_fsm_inst *fi) +{ + struct lu_fsm_priv *lfp = fi->priv; + struct vlr_instance *vlr = lfp->vlr; + struct vlr_subscr *vsub = NULL; + + if (!lfp->imsi[0]) { + /* TMSI was used */ + lfp->lu_by_tmsi = true; + /* TMSI clash: if a different subscriber already has this TMSI, + * we will find that other subscriber in the VLR. So the IMSIs + * would mismatch, but we don't know about it. Theoretically, + * an authentication process would thwart any attempt to use + * someone else's TMSI. + * TODO: Otherwise we can ask for the IMSI and verify that it + * matches the IMSI on record. */ + vsub = vlr_subscr_find_or_create_by_tmsi(vlr, lfp->tmsi, NULL); + + if (!vsub) { + LOGPFSML(fi, LOGL_ERROR, "VLR subscriber allocation failed\n"); + lu_fsm_failure(fi, GSM48_REJECT_SRV_OPT_TMP_OUT_OF_ORDER); + return -1; + } + + vsub->sub_dataconf_by_hlr_ind = false; + if (assoc_lfp_with_sub(fi, vsub)) { + vlr_subscr_put(vsub); + return -1; /* error, fsm failure invoked in assoc_lfp_with_sub() */ + } + vlr_subscr_put(vsub); + } else { + /* IMSI was used */ + vsub = vlr_subscr_find_or_create_by_imsi(vlr, lfp->imsi, NULL); + + if (!vsub) { + LOGPFSML(fi, LOGL_ERROR, "VLR subscriber allocation failed\n"); + lu_fsm_failure(fi, GSM48_REJECT_SRV_OPT_TMP_OUT_OF_ORDER); + vlr_subscr_put(vsub); + return -1; + } + + vsub->sub_dataconf_by_hlr_ind = false; + if (assoc_lfp_with_sub(fi, vsub)) { + vlr_subscr_put(vsub); + return -1; /* error, fsm failure invoked in assoc_lfp_with_sub() */ + } + vlr_subscr_put(vsub); + } + return 0; +} + /* 4.1.2.1: Subscriber (via MSC/SGSN) requests location update */ static void _start_lu_main(struct osmo_fsm_inst *fi) { struct lu_fsm_priv *lfp = fi->priv; struct vlr_instance *vlr = lfp->vlr; - struct vlr_subscr *vsub = NULL; - bool created; /* TODO: PUESBINE related handling */ @@ -919,61 +968,13 @@ lai_name(&lfp->old_lai)); } - if (!lfp->imsi[0]) { - /* TMSI was used */ - lfp->lu_by_tmsi = true; - /* TMSI clash: if a different subscriber already has this TMSI, - * we will find that other subscriber in the VLR. So the IMSIs - * would mismatch, but we don't know about it. Theoretically, - * an authentication process would thwart any attempt to use - * someone else's TMSI. - * TODO: Otherwise we can ask for the IMSI and verify that it - * matches the IMSI on record. */ - vsub = vlr_subscr_find_or_create_by_tmsi(vlr, lfp->tmsi, - &created); - - if (!vsub) { - LOGPFSML(fi, LOGL_ERROR, - "VLR subscriber allocation failed\n"); - lu_fsm_failure(fi, GSM48_REJECT_SRV_OPT_TMP_OUT_OF_ORDER); - return; - } - - vsub->sub_dataconf_by_hlr_ind = false; - if (assoc_lfp_with_sub(fi, vsub)) { - vlr_subscr_put(vsub); - return; /* error */ - } - - if (created) - vlr_loc_upd_want_imsi(fi); - else - vlr_loc_upd_node1(fi); - /* We cannot have MSC area change, as the VLR - * serves only one MSC */ - vlr_subscr_put(vsub); - } else { - /* IMSI was used */ - vsub = vlr_subscr_find_or_create_by_imsi(vlr, lfp->imsi, NULL); - - if (!vsub) { - LOGPFSML(fi, LOGL_ERROR, - "VLR subscriber allocation failed\n"); - lu_fsm_failure(fi, GSM48_REJECT_SRV_OPT_TMP_OUT_OF_ORDER); - vlr_subscr_put(vsub); - return; - } - - vsub->sub_dataconf_by_hlr_ind = false; - if (assoc_lfp_with_sub(fi, vsub)) { - vlr_subscr_put(vsub); - return; /* error */ - } + /* If this is a TMSI based LU, we may not have the IMSI. Make sure that + * we know the IMSI, either on record, or request it. */ + if (!lfp->vsub->imsi[0]) + vlr_loc_upd_want_imsi(fi); + else vlr_loc_upd_node1(fi); - vlr_subscr_put(vsub); - } } - static void lu_fsm_idle(struct osmo_fsm_inst *fi, uint32_t event, void *data) @@ -983,8 +984,14 @@ OSMO_ASSERT(event == VLR_ULA_E_UPDATE_LA); - if (1) { // FIXME - //if (lfp->type == VLR_LU_TYPE_PERIODIC && lfp->vsub->imeisv[0]) + if (_lu_fsm_associate_vsub(fi)) + return; /* error. FSM already terminated. */ + + OSMO_ASSERT(lfp->vsub); + + /* See 3GPP TS 23.012, procedure Retrieve_IMEISV_If_Required */ + if ((!vlr->cfg.retrieve_imeisv_early) + || (lfp->type == VLR_LU_TYPE_PERIODIC && lfp->vsub->imeisv[0])) { /* R_IMEISV_IR1 passed */ _start_lu_main(fi); } else { @@ -999,7 +1006,8 @@ { switch (event) { case VLR_ULA_E_ID_IMEISV: - /* FIXME: copy IMEISV */ + /* IMEISV was copied in vlr_subscr_rx_id_resp(), and that's + * where we received this event from. */ _start_lu_main(fi); break; default: @@ -1257,6 +1265,8 @@ .in_event_mask = S(VLR_ULA_E_ID_IMEISV), .out_state_mask = S(VLR_ULA_S_WAIT_PVLR) | S(VLR_ULA_S_WAIT_IMSI) | + S(VLR_ULA_S_WAIT_AUTH) | + S(VLR_ULA_S_WAIT_HLR_UPD) | S(VLR_ULA_S_DONE), .name = OSMO_STRINGIFY(VLR_ULA_S_WAIT_IMEISV), .action = lu_fsm_wait_imeisv, diff --git a/tests/msc_vlr/msc_vlr_test_gsm_authen.err b/tests/msc_vlr/msc_vlr_test_gsm_authen.err index 8f93435..09ff4ae 100644 --- a/tests/msc_vlr/msc_vlr_test_gsm_authen.err +++ b/tests/msc_vlr/msc_vlr_test_gsm_authen.err @@ -18,6 +18,7 @@ DVLR set IMSI on subscriber; IMSI=901700000004620 id=901700000004620 DVLR New subscr, IMSI: 901700000004620 DREF VLR subscr IMSI:901700000004620 usage increases to: 2 +DREF VLR subscr IMSI:901700000004620 usage decreases to: 1 DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_IDLE}: vlr_loc_upd_node1() DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_IDLE}: state_chg to VLR_ULA_S_WAIT_AUTH DVLR VLR_Authenticate(901700000004620){VLR_SUB_AS_NEEDS_AUTH}: Allocated @@ -26,7 +27,6 @@ DVLR GSUP tx: 08010809710000004026f0 GSUP --> HLR: OSMO_GSUP_MSGT_SEND_AUTH_INFO_REQUEST: 08010809710000004026f0 DVLR VLR_Authenticate(901700000004620){VLR_SUB_AS_NEEDS_AUTH}: state_chg to VLR_SUB_AS_NEEDS_AUTH_WAIT_AI -DREF VLR subscr IMSI:901700000004620 usage decreases to: 1 DMM compl_l3: Keeping conn DREF IMSI:901700000004620: MSC conn use - 1 == 1 lu_result_sent == 0 @@ -446,6 +446,7 @@ DVLR set IMSI on subscriber; IMSI=901700000004620 id=901700000004620 DVLR New subscr, IMSI: 901700000004620 DREF VLR subscr IMSI:901700000004620 usage increases to: 2 +DREF VLR subscr IMSI:901700000004620 usage decreases to: 1 DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_IDLE}: vlr_loc_upd_node1() DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_IDLE}: state_chg to VLR_ULA_S_WAIT_AUTH DVLR VLR_Authenticate(901700000004620){VLR_SUB_AS_NEEDS_AUTH}: Allocated @@ -454,7 +455,6 @@ DVLR GSUP tx: 08010809710000004026f0 GSUP --> HLR: OSMO_GSUP_MSGT_SEND_AUTH_INFO_REQUEST: 08010809710000004026f0 DVLR VLR_Authenticate(901700000004620){VLR_SUB_AS_NEEDS_AUTH}: state_chg to VLR_SUB_AS_NEEDS_AUTH_WAIT_AI -DREF VLR subscr IMSI:901700000004620 usage decreases to: 1 DMM compl_l3: Keeping conn DREF IMSI:901700000004620: MSC conn use - 1 == 1 lu_result_sent == 0 @@ -887,6 +887,7 @@ DVLR vlr_lu_fsm(50462976){VLR_ULA_S_IDLE}: Received Event VLR_ULA_E_UPDATE_LA DREF VLR subscr MSISDN:46071 usage increases to: 2 DREF VLR subscr MSISDN:46071 usage increases to: 3 +DREF VLR subscr MSISDN:46071 usage decreases to: 2 DVLR vlr_lu_fsm(50462976){VLR_ULA_S_IDLE}: vlr_loc_upd_node1() DVLR vlr_lu_fsm(50462976){VLR_ULA_S_IDLE}: state_chg to VLR_ULA_S_WAIT_AUTH DVLR VLR_Authenticate(50462976){VLR_SUB_AS_NEEDS_AUTH}: Allocated @@ -897,7 +898,6 @@ - sending GSM Auth Request for MSISDN:46071: tuple use_count=1 key_seq=3 auth_types=0x1 and... - ...rand=fa8f20b781b5881329d4fea26b1a3c51 - ...expecting sres=5afc8d72 -DREF VLR subscr MSISDN:46071 usage decreases to: 2 DMM compl_l3: Keeping conn DREF MSISDN:46071: MSC conn use - 1 == 1 auth_request_sent == 1 @@ -1073,6 +1073,7 @@ DVLR set IMSI on subscriber; IMSI=901700000004620 id=901700000004620 DVLR New subscr, IMSI: 901700000004620 DREF VLR subscr IMSI:901700000004620 usage increases to: 2 +DREF VLR subscr IMSI:901700000004620 usage decreases to: 1 DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_IDLE}: vlr_loc_upd_node1() DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_IDLE}: state_chg to VLR_ULA_S_WAIT_AUTH DVLR VLR_Authenticate(901700000004620){VLR_SUB_AS_NEEDS_AUTH}: Allocated @@ -1081,7 +1082,6 @@ DVLR GSUP tx: 08010809710000004026f0 GSUP --> HLR: OSMO_GSUP_MSGT_SEND_AUTH_INFO_REQUEST: 08010809710000004026f0 DVLR VLR_Authenticate(901700000004620){VLR_SUB_AS_NEEDS_AUTH}: state_chg to VLR_SUB_AS_NEEDS_AUTH_WAIT_AI -DREF VLR subscr IMSI:901700000004620 usage decreases to: 1 DMM compl_l3: Keeping conn DREF IMSI:901700000004620: MSC conn use - 1 == 1 lu_result_sent == 0 @@ -1286,6 +1286,7 @@ DVLR set IMSI on subscriber; IMSI=901700000004620 id=901700000004620 DVLR New subscr, IMSI: 901700000004620 DREF VLR subscr IMSI:901700000004620 usage increases to: 2 +DREF VLR subscr IMSI:901700000004620 usage decreases to: 1 DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_IDLE}: vlr_loc_upd_node1() DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_IDLE}: state_chg to VLR_ULA_S_WAIT_AUTH DVLR VLR_Authenticate(901700000004620){VLR_SUB_AS_NEEDS_AUTH}: Allocated @@ -1294,7 +1295,6 @@ DVLR GSUP tx: 08010809710000004026f0 GSUP --> HLR: OSMO_GSUP_MSGT_SEND_AUTH_INFO_REQUEST: 08010809710000004026f0 DVLR VLR_Authenticate(901700000004620){VLR_SUB_AS_NEEDS_AUTH}: state_chg to VLR_SUB_AS_NEEDS_AUTH_WAIT_AI -DREF VLR subscr IMSI:901700000004620 usage decreases to: 1 DMM compl_l3: Keeping conn DREF IMSI:901700000004620: MSC conn use - 1 == 1 lu_result_sent == 0 @@ -1529,6 +1529,7 @@ DVLR set IMSI on subscriber; IMSI=901700000010650 id=901700000010650 DVLR New subscr, IMSI: 901700000010650 DREF VLR subscr IMSI:901700000010650 usage increases to: 2 +DREF VLR subscr IMSI:901700000010650 usage decreases to: 1 DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_IDLE}: vlr_loc_upd_node1() DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_IDLE}: state_chg to VLR_ULA_S_WAIT_AUTH DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_NEEDS_AUTH}: Allocated @@ -1537,7 +1538,6 @@ DVLR GSUP tx: 08010809710000000156f0 GSUP --> HLR: OSMO_GSUP_MSGT_SEND_AUTH_INFO_REQUEST: 08010809710000000156f0 DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_NEEDS_AUTH}: state_chg to VLR_SUB_AS_NEEDS_AUTH_WAIT_AI -DREF VLR subscr IMSI:901700000010650 usage decreases to: 1 DMM compl_l3: Keeping conn DREF IMSI:901700000010650: MSC conn use - 1 == 1 lu_result_sent == 0 diff --git a/tests/msc_vlr/msc_vlr_test_gsm_ciph.c b/tests/msc_vlr/msc_vlr_test_gsm_ciph.c index 1ebf9c6..589f7da 100644 --- a/tests/msc_vlr/msc_vlr_test_gsm_ciph.c +++ b/tests/msc_vlr/msc_vlr_test_gsm_ciph.c @@ -565,7 +565,7 @@ /* implicit: net->authentication_required = true; */ net->a5_encryption = VLR_CIPH_A5_1; - net->vlr->cfg.retrieve_imeisv = true; + net->vlr->cfg.retrieve_imeisv_ciphered = true; btw("Location Update request causes a GSUP Send Auth Info request to HLR"); lu_result_sent = RES_NONE; diff --git a/tests/msc_vlr/msc_vlr_test_gsm_ciph.err b/tests/msc_vlr/msc_vlr_test_gsm_ciph.err index 4543ace..f43d6f1 100644 --- a/tests/msc_vlr/msc_vlr_test_gsm_ciph.err +++ b/tests/msc_vlr/msc_vlr_test_gsm_ciph.err @@ -18,6 +18,7 @@ DVLR set IMSI on subscriber; IMSI=901700000004620 id=901700000004620 DVLR New subscr, IMSI: 901700000004620 DREF VLR subscr IMSI:901700000004620 usage increases to: 2 +DREF VLR subscr IMSI:901700000004620 usage decreases to: 1 DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_IDLE}: vlr_loc_upd_node1() DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_IDLE}: state_chg to VLR_ULA_S_WAIT_AUTH DVLR VLR_Authenticate(901700000004620){VLR_SUB_AS_NEEDS_AUTH}: Allocated @@ -26,7 +27,6 @@ DVLR GSUP tx: 08010809710000004026f0 GSUP --> HLR: OSMO_GSUP_MSGT_SEND_AUTH_INFO_REQUEST: 08010809710000004026f0 DVLR VLR_Authenticate(901700000004620){VLR_SUB_AS_NEEDS_AUTH}: state_chg to VLR_SUB_AS_NEEDS_AUTH_WAIT_AI -DREF VLR subscr IMSI:901700000004620 usage decreases to: 1 DMM compl_l3: Keeping conn DREF IMSI:901700000004620: MSC conn use - 1 == 1 lu_result_sent == 0 @@ -480,6 +480,7 @@ DVLR set IMSI on subscriber; IMSI=901700000004620 id=901700000004620 DVLR New subscr, IMSI: 901700000004620 DREF VLR subscr IMSI:901700000004620 usage increases to: 2 +DREF VLR subscr IMSI:901700000004620 usage decreases to: 1 DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_IDLE}: vlr_loc_upd_node1() DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_IDLE}: state_chg to VLR_ULA_S_WAIT_AUTH DVLR VLR_Authenticate(901700000004620){VLR_SUB_AS_NEEDS_AUTH}: Allocated @@ -488,7 +489,6 @@ DVLR GSUP tx: 08010809710000004026f0 GSUP --> HLR: OSMO_GSUP_MSGT_SEND_AUTH_INFO_REQUEST: 08010809710000004026f0 DVLR VLR_Authenticate(901700000004620){VLR_SUB_AS_NEEDS_AUTH}: state_chg to VLR_SUB_AS_NEEDS_AUTH_WAIT_AI -DREF VLR subscr IMSI:901700000004620 usage decreases to: 1 DMM compl_l3: Keeping conn DREF IMSI:901700000004620: MSC conn use - 1 == 1 lu_result_sent == 0 @@ -979,6 +979,7 @@ DVLR set IMSI on subscriber; IMSI=901700000004620 id=901700000004620 DVLR New subscr, IMSI: 901700000004620 DREF VLR subscr IMSI:901700000004620 usage increases to: 2 +DREF VLR subscr IMSI:901700000004620 usage decreases to: 1 DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_IDLE}: vlr_loc_upd_node1() DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_IDLE}: state_chg to VLR_ULA_S_WAIT_AUTH DVLR VLR_Authenticate(901700000004620){VLR_SUB_AS_NEEDS_AUTH}: Allocated @@ -987,7 +988,6 @@ DVLR GSUP tx: 08010809710000004026f0 GSUP --> HLR: OSMO_GSUP_MSGT_SEND_AUTH_INFO_REQUEST: 08010809710000004026f0 DVLR VLR_Authenticate(901700000004620){VLR_SUB_AS_NEEDS_AUTH}: state_chg to VLR_SUB_AS_NEEDS_AUTH_WAIT_AI -DREF VLR subscr IMSI:901700000004620 usage decreases to: 1 DMM compl_l3: Keeping conn DREF IMSI:901700000004620: MSC conn use - 1 == 1 lu_result_sent == 0 @@ -1192,6 +1192,7 @@ DVLR set IMSI on subscriber; IMSI=901700000004620 id=901700000004620 DVLR New subscr, IMSI: 901700000004620 DREF VLR subscr IMSI:901700000004620 usage increases to: 2 +DREF VLR subscr IMSI:901700000004620 usage decreases to: 1 DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_IDLE}: vlr_loc_upd_node1() DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_IDLE}: state_chg to VLR_ULA_S_WAIT_AUTH DVLR VLR_Authenticate(901700000004620){VLR_SUB_AS_NEEDS_AUTH}: Allocated @@ -1200,7 +1201,6 @@ DVLR GSUP tx: 08010809710000004026f0 GSUP --> HLR: OSMO_GSUP_MSGT_SEND_AUTH_INFO_REQUEST: 08010809710000004026f0 DVLR VLR_Authenticate(901700000004620){VLR_SUB_AS_NEEDS_AUTH}: state_chg to VLR_SUB_AS_NEEDS_AUTH_WAIT_AI -DREF VLR subscr IMSI:901700000004620 usage decreases to: 1 DMM compl_l3: Keeping conn DREF IMSI:901700000004620: MSC conn use - 1 == 1 lu_result_sent == 0 @@ -1404,6 +1404,7 @@ DVLR set IMSI on subscriber; IMSI=901700000004620 id=901700000004620 DVLR New subscr, IMSI: 901700000004620 DREF VLR subscr IMSI:901700000004620 usage increases to: 2 +DREF VLR subscr IMSI:901700000004620 usage decreases to: 1 DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_IDLE}: vlr_loc_upd_node1() DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_IDLE}: state_chg to VLR_ULA_S_WAIT_AUTH DVLR VLR_Authenticate(901700000004620){VLR_SUB_AS_NEEDS_AUTH}: Allocated @@ -1412,7 +1413,6 @@ DVLR GSUP tx: 08010809710000004026f0 GSUP --> HLR: OSMO_GSUP_MSGT_SEND_AUTH_INFO_REQUEST: 08010809710000004026f0 DVLR VLR_Authenticate(901700000004620){VLR_SUB_AS_NEEDS_AUTH}: state_chg to VLR_SUB_AS_NEEDS_AUTH_WAIT_AI -DREF VLR subscr IMSI:901700000004620 usage decreases to: 1 DMM compl_l3: Keeping conn DREF IMSI:901700000004620: MSC conn use - 1 == 1 lu_result_sent == 0 diff --git a/tests/msc_vlr/msc_vlr_test_hlr_reject.err b/tests/msc_vlr/msc_vlr_test_hlr_reject.err index b72ceff..2a06d08 100644 --- a/tests/msc_vlr/msc_vlr_test_hlr_reject.err +++ b/tests/msc_vlr/msc_vlr_test_hlr_reject.err @@ -18,6 +18,7 @@ DVLR set IMSI on subscriber; IMSI=901700000004620 id=901700000004620 DVLR New subscr, IMSI: 901700000004620 DREF VLR subscr IMSI:901700000004620 usage increases to: 2 +DREF VLR subscr IMSI:901700000004620 usage decreases to: 1 DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_IDLE}: vlr_loc_upd_node1() DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_IDLE}: state_chg to VLR_ULA_S_WAIT_AUTH DVLR VLR_Authenticate(901700000004620){VLR_SUB_AS_NEEDS_AUTH}: Allocated @@ -26,7 +27,6 @@ DVLR GSUP tx: 08010809710000004026f0 GSUP --> HLR: OSMO_GSUP_MSGT_SEND_AUTH_INFO_REQUEST: 08010809710000004026f0 DVLR VLR_Authenticate(901700000004620){VLR_SUB_AS_NEEDS_AUTH}: state_chg to VLR_SUB_AS_NEEDS_AUTH_WAIT_AI -DREF VLR subscr IMSI:901700000004620 usage decreases to: 1 DMM compl_l3: Keeping conn DREF IMSI:901700000004620: MSC conn use - 1 == 1 lu_result_sent == 0 @@ -91,6 +91,7 @@ DVLR set IMSI on subscriber; IMSI=901700000004620 id=901700000004620 DVLR New subscr, IMSI: 901700000004620 DREF VLR subscr IMSI:901700000004620 usage increases to: 2 +DREF VLR subscr IMSI:901700000004620 usage decreases to: 1 DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_IDLE}: vlr_loc_upd_node1() DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_IDLE}: state_chg to VLR_ULA_S_WAIT_AUTH DVLR VLR_Authenticate(901700000004620){VLR_SUB_AS_NEEDS_AUTH}: Allocated @@ -99,7 +100,6 @@ DVLR GSUP tx: 08010809710000004026f0 GSUP --> HLR: OSMO_GSUP_MSGT_SEND_AUTH_INFO_REQUEST: 08010809710000004026f0 DVLR VLR_Authenticate(901700000004620){VLR_SUB_AS_NEEDS_AUTH}: state_chg to VLR_SUB_AS_NEEDS_AUTH_WAIT_AI -DREF VLR subscr IMSI:901700000004620 usage decreases to: 1 DMM compl_l3: Keeping conn DREF IMSI:901700000004620: MSC conn use - 1 == 1 lu_result_sent == 0 @@ -166,6 +166,7 @@ DVLR set IMSI on subscriber; IMSI=901700000004620 id=901700000004620 DVLR New subscr, IMSI: 901700000004620 DREF VLR subscr IMSI:901700000004620 usage increases to: 2 +DREF VLR subscr IMSI:901700000004620 usage decreases to: 1 DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_IDLE}: vlr_loc_upd_node1() DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_IDLE}: state_chg to VLR_ULA_S_WAIT_AUTH DVLR VLR_Authenticate(901700000004620){VLR_SUB_AS_NEEDS_AUTH}: Allocated @@ -174,7 +175,6 @@ DVLR GSUP tx: 08010809710000004026f0 GSUP --> HLR: OSMO_GSUP_MSGT_SEND_AUTH_INFO_REQUEST: 08010809710000004026f0 DVLR VLR_Authenticate(901700000004620){VLR_SUB_AS_NEEDS_AUTH}: state_chg to VLR_SUB_AS_NEEDS_AUTH_WAIT_AI -DREF VLR subscr IMSI:901700000004620 usage decreases to: 1 DMM compl_l3: Keeping conn DREF IMSI:901700000004620: MSC conn use - 1 == 1 lu_result_sent == 0 @@ -311,6 +311,7 @@ DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_IDLE}: Received Event VLR_ULA_E_UPDATE_LA DREF VLR subscr MSISDN:46071 usage increases to: 2 DREF VLR subscr MSISDN:46071 usage increases to: 3 +DREF VLR subscr MSISDN:46071 usage decreases to: 2 DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_IDLE}: vlr_loc_upd_node1() DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_IDLE}: state_chg to VLR_ULA_S_WAIT_AUTH DVLR VLR_Authenticate(901700000004620){VLR_SUB_AS_NEEDS_AUTH}: Allocated @@ -319,7 +320,6 @@ DVLR GSUP tx: 08010809710000004026f0 GSUP --> HLR: OSMO_GSUP_MSGT_SEND_AUTH_INFO_REQUEST: 08010809710000004026f0 DVLR VLR_Authenticate(901700000004620){VLR_SUB_AS_NEEDS_AUTH}: state_chg to VLR_SUB_AS_NEEDS_AUTH_WAIT_AI -DREF VLR subscr MSISDN:46071 usage decreases to: 2 DMM compl_l3: Keeping conn DREF MSISDN:46071: MSC conn use - 1 == 1 lu_result_sent == 0 @@ -459,6 +459,7 @@ DVLR set IMSI on subscriber; IMSI=901700000004620 id=901700000004620 DVLR New subscr, IMSI: 901700000004620 DREF VLR subscr IMSI:901700000004620 usage increases to: 2 +DREF VLR subscr IMSI:901700000004620 usage decreases to: 1 DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_IDLE}: vlr_loc_upd_node1() DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_IDLE}: state_chg to VLR_ULA_S_WAIT_AUTH DVLR VLR_Authenticate(901700000004620){VLR_SUB_AS_NEEDS_AUTH}: Allocated @@ -467,7 +468,6 @@ DVLR GSUP tx: 08010809710000004026f0 GSUP --> HLR: OSMO_GSUP_MSGT_SEND_AUTH_INFO_REQUEST: 08010809710000004026f0 DVLR VLR_Authenticate(901700000004620){VLR_SUB_AS_NEEDS_AUTH}: state_chg to VLR_SUB_AS_NEEDS_AUTH_WAIT_AI -DREF VLR subscr IMSI:901700000004620 usage decreases to: 1 DMM compl_l3: Keeping conn DREF IMSI:901700000004620: MSC conn use - 1 == 1 lu_result_sent == 0 @@ -604,6 +604,7 @@ DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_IDLE}: Received Event VLR_ULA_E_UPDATE_LA DREF VLR subscr MSISDN:46071 usage increases to: 2 DREF VLR subscr MSISDN:46071 usage increases to: 3 +DREF VLR subscr MSISDN:46071 usage decreases to: 2 DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_IDLE}: vlr_loc_upd_node1() DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_IDLE}: state_chg to VLR_ULA_S_WAIT_AUTH DVLR VLR_Authenticate(901700000004620){VLR_SUB_AS_NEEDS_AUTH}: Allocated @@ -612,7 +613,6 @@ DVLR GSUP tx: 08010809710000004026f0 GSUP --> HLR: OSMO_GSUP_MSGT_SEND_AUTH_INFO_REQUEST: 08010809710000004026f0 DVLR VLR_Authenticate(901700000004620){VLR_SUB_AS_NEEDS_AUTH}: state_chg to VLR_SUB_AS_NEEDS_AUTH_WAIT_AI -DREF VLR subscr MSISDN:46071 usage decreases to: 2 DMM compl_l3: Keeping conn DREF MSISDN:46071: MSC conn use - 1 == 1 lu_result_sent == 0 @@ -679,6 +679,7 @@ DVLR set IMSI on subscriber; IMSI=901700000004620 id=901700000004620 DVLR New subscr, IMSI: 901700000004620 DREF VLR subscr IMSI:901700000004620 usage increases to: 2 +DREF VLR subscr IMSI:901700000004620 usage decreases to: 1 DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_IDLE}: vlr_loc_upd_node1() DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_IDLE}: state_chg to VLR_ULA_S_WAIT_AUTH DVLR VLR_Authenticate(901700000004620){VLR_SUB_AS_NEEDS_AUTH}: Allocated @@ -687,7 +688,6 @@ DVLR GSUP tx: 08010809710000004026f0 GSUP --> HLR: OSMO_GSUP_MSGT_SEND_AUTH_INFO_REQUEST: 08010809710000004026f0 DVLR VLR_Authenticate(901700000004620){VLR_SUB_AS_NEEDS_AUTH}: state_chg to VLR_SUB_AS_NEEDS_AUTH_WAIT_AI -DREF VLR subscr IMSI:901700000004620 usage decreases to: 1 DMM compl_l3: Keeping conn DREF IMSI:901700000004620: MSC conn use - 1 == 1 lu_result_sent == 0 @@ -825,6 +825,7 @@ DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_IDLE}: Received Event VLR_ULA_E_UPDATE_LA DREF VLR subscr MSISDN:46071 usage increases to: 2 DREF VLR subscr MSISDN:46071 usage increases to: 3 +DREF VLR subscr MSISDN:46071 usage decreases to: 2 DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_IDLE}: vlr_loc_upd_node1() DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_IDLE}: state_chg to VLR_ULA_S_WAIT_AUTH DVLR VLR_Authenticate(901700000004620){VLR_SUB_AS_NEEDS_AUTH}: Allocated @@ -833,7 +834,6 @@ DVLR GSUP tx: 08010809710000004026f0 GSUP --> HLR: OSMO_GSUP_MSGT_SEND_AUTH_INFO_REQUEST: 08010809710000004026f0 DVLR VLR_Authenticate(901700000004620){VLR_SUB_AS_NEEDS_AUTH}: state_chg to VLR_SUB_AS_NEEDS_AUTH_WAIT_AI -DREF VLR subscr MSISDN:46071 usage decreases to: 2 DMM compl_l3: Keeping conn DREF MSISDN:46071: MSC conn use - 1 == 1 lu_result_sent == 0 @@ -898,6 +898,7 @@ DVLR set IMSI on subscriber; IMSI=901700000004620 id=901700000004620 DVLR New subscr, IMSI: 901700000004620 DREF VLR subscr IMSI:901700000004620 usage increases to: 2 +DREF VLR subscr IMSI:901700000004620 usage decreases to: 1 DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_IDLE}: vlr_loc_upd_node1() DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_IDLE}: state_chg to VLR_ULA_S_WAIT_AUTH DVLR VLR_Authenticate(901700000004620){VLR_SUB_AS_NEEDS_AUTH}: Allocated @@ -906,7 +907,6 @@ DVLR GSUP tx: 08010809710000004026f0 GSUP --> HLR: OSMO_GSUP_MSGT_SEND_AUTH_INFO_REQUEST: 08010809710000004026f0 DVLR VLR_Authenticate(901700000004620){VLR_SUB_AS_NEEDS_AUTH}: state_chg to VLR_SUB_AS_NEEDS_AUTH_WAIT_AI -DREF VLR subscr IMSI:901700000004620 usage decreases to: 1 DMM compl_l3: Keeping conn DREF IMSI:901700000004620: MSC conn use - 1 == 1 lu_result_sent == 0 @@ -970,6 +970,7 @@ DVLR set IMSI on subscriber; IMSI=901700000004620 id=901700000004620 DVLR New subscr, IMSI: 901700000004620 DREF VLR subscr IMSI:901700000004620 usage increases to: 2 +DREF VLR subscr IMSI:901700000004620 usage decreases to: 1 DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_IDLE}: vlr_loc_upd_node1() DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_IDLE}: vlr_loc_upd_post_auth() DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_IDLE}: vlr_loc_upd_post_ciph() @@ -981,7 +982,6 @@ DVLR GSUP tx: 04010809710000004026f0 GSUP --> HLR: OSMO_GSUP_MSGT_UPDATE_LOCATION_REQUEST: 04010809710000004026f0 DVLR upd_hlr_vlr_fsm(901700000004620){UPD_HLR_VLR_S_INIT}: state_chg to UPD_HLR_VLR_S_WAIT_FOR_DATA -DREF VLR subscr IMSI:901700000004620 usage decreases to: 1 DMM compl_l3: Keeping conn DREF IMSI:901700000004620: MSC conn use - 1 == 1 lu_result_sent == 0 @@ -1045,6 +1045,7 @@ DVLR set IMSI on subscriber; IMSI=901700000004620 id=901700000004620 DVLR New subscr, IMSI: 901700000004620 DREF VLR subscr IMSI:901700000004620 usage increases to: 2 +DREF VLR subscr IMSI:901700000004620 usage decreases to: 1 DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_IDLE}: vlr_loc_upd_node1() DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_IDLE}: vlr_loc_upd_post_auth() DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_IDLE}: vlr_loc_upd_post_ciph() @@ -1056,7 +1057,6 @@ DVLR GSUP tx: 04010809710000004026f0 GSUP --> HLR: OSMO_GSUP_MSGT_UPDATE_LOCATION_REQUEST: 04010809710000004026f0 DVLR upd_hlr_vlr_fsm(901700000004620){UPD_HLR_VLR_S_INIT}: state_chg to UPD_HLR_VLR_S_WAIT_FOR_DATA -DREF VLR subscr IMSI:901700000004620 usage decreases to: 1 DMM compl_l3: Keeping conn DREF IMSI:901700000004620: MSC conn use - 1 == 1 lu_result_sent == 0 diff --git a/tests/msc_vlr/msc_vlr_test_hlr_timeout.err b/tests/msc_vlr/msc_vlr_test_hlr_timeout.err index 1d2541d..c1bd9ac 100644 --- a/tests/msc_vlr/msc_vlr_test_hlr_timeout.err +++ b/tests/msc_vlr/msc_vlr_test_hlr_timeout.err @@ -19,6 +19,7 @@ DVLR set IMSI on subscriber; IMSI=901700000004620 id=901700000004620 DVLR New subscr, IMSI: 901700000004620 DREF VLR subscr IMSI:901700000004620 usage increases to: 2 +DREF VLR subscr IMSI:901700000004620 usage decreases to: 1 DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_IDLE}: vlr_loc_upd_node1() DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_IDLE}: state_chg to VLR_ULA_S_WAIT_AUTH DVLR VLR_Authenticate(901700000004620){VLR_SUB_AS_NEEDS_AUTH}: Allocated @@ -27,7 +28,6 @@ DVLR GSUP tx: 08010809710000004026f0 GSUP --> HLR: OSMO_GSUP_MSGT_SEND_AUTH_INFO_REQUEST: 08010809710000004026f0 DVLR VLR_Authenticate(901700000004620){VLR_SUB_AS_NEEDS_AUTH}: state_chg to VLR_SUB_AS_NEEDS_AUTH_WAIT_AI -DREF VLR subscr IMSI:901700000004620 usage decreases to: 1 DMM compl_l3: Keeping conn DREF IMSI:901700000004620: MSC conn use - 1 == 1 lu_result_sent == 0 @@ -100,6 +100,7 @@ DVLR set IMSI on subscriber; IMSI=901700000004620 id=901700000004620 DVLR New subscr, IMSI: 901700000004620 DREF VLR subscr IMSI:901700000004620 usage increases to: 2 +DREF VLR subscr IMSI:901700000004620 usage decreases to: 1 DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_IDLE}: vlr_loc_upd_node1() DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_IDLE}: vlr_loc_upd_post_auth() DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_IDLE}: vlr_loc_upd_post_ciph() @@ -111,7 +112,6 @@ DVLR GSUP tx: 04010809710000004026f0 GSUP --> HLR: OSMO_GSUP_MSGT_UPDATE_LOCATION_REQUEST: 04010809710000004026f0 DVLR upd_hlr_vlr_fsm(901700000004620){UPD_HLR_VLR_S_INIT}: state_chg to UPD_HLR_VLR_S_WAIT_FOR_DATA -DREF VLR subscr IMSI:901700000004620 usage decreases to: 1 DMM compl_l3: Keeping conn DREF IMSI:901700000004620: MSC conn use - 1 == 1 lu_result_sent == 0 diff --git a/tests/msc_vlr/msc_vlr_test_ms_timeout.err b/tests/msc_vlr/msc_vlr_test_ms_timeout.err index beee070..841aa9a 100644 --- a/tests/msc_vlr/msc_vlr_test_ms_timeout.err +++ b/tests/msc_vlr/msc_vlr_test_ms_timeout.err @@ -19,6 +19,7 @@ DVLR set IMSI on subscriber; IMSI=901700000004620 id=901700000004620 DVLR New subscr, IMSI: 901700000004620 DREF VLR subscr IMSI:901700000004620 usage increases to: 2 +DREF VLR subscr IMSI:901700000004620 usage decreases to: 1 DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_IDLE}: vlr_loc_upd_node1() DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_IDLE}: state_chg to VLR_ULA_S_WAIT_AUTH DVLR VLR_Authenticate(901700000004620){VLR_SUB_AS_NEEDS_AUTH}: Allocated @@ -27,7 +28,6 @@ DVLR GSUP tx: 08010809710000004026f0 GSUP --> HLR: OSMO_GSUP_MSGT_SEND_AUTH_INFO_REQUEST: 08010809710000004026f0 DVLR VLR_Authenticate(901700000004620){VLR_SUB_AS_NEEDS_AUTH}: state_chg to VLR_SUB_AS_NEEDS_AUTH_WAIT_AI -DREF VLR subscr IMSI:901700000004620 usage decreases to: 1 DMM compl_l3: Keeping conn DREF IMSI:901700000004620: MSC conn use - 1 == 1 lu_result_sent == 0 @@ -120,6 +120,7 @@ DVLR set IMSI on subscriber; IMSI=901700000004620 id=901700000004620 DVLR New subscr, IMSI: 901700000004620 DREF VLR subscr IMSI:901700000004620 usage increases to: 2 +DREF VLR subscr IMSI:901700000004620 usage decreases to: 1 DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_IDLE}: vlr_loc_upd_node1() DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_IDLE}: state_chg to VLR_ULA_S_WAIT_AUTH DVLR VLR_Authenticate(901700000004620){VLR_SUB_AS_NEEDS_AUTH}: Allocated @@ -128,7 +129,6 @@ DVLR GSUP tx: 08010809710000004026f0 GSUP --> HLR: OSMO_GSUP_MSGT_SEND_AUTH_INFO_REQUEST: 08010809710000004026f0 DVLR VLR_Authenticate(901700000004620){VLR_SUB_AS_NEEDS_AUTH}: state_chg to VLR_SUB_AS_NEEDS_AUTH_WAIT_AI -DREF VLR subscr IMSI:901700000004620 usage decreases to: 1 DMM compl_l3: Keeping conn DREF IMSI:901700000004620: MSC conn use - 1 == 1 lu_result_sent == 0 diff --git a/tests/msc_vlr/msc_vlr_test_no_authen.err b/tests/msc_vlr/msc_vlr_test_no_authen.err index 12b6c69..651ac29 100644 --- a/tests/msc_vlr/msc_vlr_test_no_authen.err +++ b/tests/msc_vlr/msc_vlr_test_no_authen.err @@ -18,6 +18,7 @@ DVLR set IMSI on subscriber; IMSI=901700000004620 id=901700000004620 DVLR New subscr, IMSI: 901700000004620 DREF VLR subscr IMSI:901700000004620 usage increases to: 2 +DREF VLR subscr IMSI:901700000004620 usage decreases to: 1 DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_IDLE}: vlr_loc_upd_node1() DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_IDLE}: vlr_loc_upd_post_auth() DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_IDLE}: vlr_loc_upd_post_ciph() @@ -29,7 +30,6 @@ DVLR GSUP tx: 04010809710000004026f0 GSUP --> HLR: OSMO_GSUP_MSGT_UPDATE_LOCATION_REQUEST: 04010809710000004026f0 DVLR upd_hlr_vlr_fsm(901700000004620){UPD_HLR_VLR_S_INIT}: state_chg to UPD_HLR_VLR_S_WAIT_FOR_DATA -DREF VLR subscr IMSI:901700000004620 usage decreases to: 1 DMM compl_l3: Keeping conn DREF IMSI:901700000004620: MSC conn use - 1 == 1 lu_result_sent == 0 @@ -324,6 +324,7 @@ DVLR set IMSI on subscriber; IMSI=901700000004620 id=901700000004620 DVLR New subscr, IMSI: 901700000004620 DREF VLR subscr IMSI:901700000004620 usage increases to: 2 +DREF VLR subscr IMSI:901700000004620 usage decreases to: 1 DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_IDLE}: vlr_loc_upd_node1() DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_IDLE}: vlr_loc_upd_post_auth() DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_IDLE}: vlr_loc_upd_post_ciph() @@ -335,7 +336,6 @@ DVLR GSUP tx: 04010809710000004026f0 GSUP --> HLR: OSMO_GSUP_MSGT_UPDATE_LOCATION_REQUEST: 04010809710000004026f0 DVLR upd_hlr_vlr_fsm(901700000004620){UPD_HLR_VLR_S_INIT}: state_chg to UPD_HLR_VLR_S_WAIT_FOR_DATA -DREF VLR subscr IMSI:901700000004620 usage decreases to: 1 DMM compl_l3: Keeping conn DREF IMSI:901700000004620: MSC conn use - 1 == 1 lu_result_sent == 0 @@ -643,6 +643,7 @@ DVLR vlr_lu_fsm(50462976){VLR_ULA_S_IDLE}: Received Event VLR_ULA_E_UPDATE_LA DREF VLR subscr MSISDN:46071 usage increases to: 2 DREF VLR subscr MSISDN:46071 usage increases to: 3 +DREF VLR subscr MSISDN:46071 usage decreases to: 2 DVLR vlr_lu_fsm(50462976){VLR_ULA_S_IDLE}: vlr_loc_upd_node1() DVLR vlr_lu_fsm(50462976){VLR_ULA_S_IDLE}: vlr_loc_upd_post_auth() DVLR vlr_lu_fsm(50462976){VLR_ULA_S_IDLE}: vlr_loc_upd_post_ciph() @@ -654,7 +655,6 @@ DVLR GSUP tx: 04010809710000004026f0 GSUP --> HLR: OSMO_GSUP_MSGT_UPDATE_LOCATION_REQUEST: 04010809710000004026f0 DVLR upd_hlr_vlr_fsm(50462976){UPD_HLR_VLR_S_INIT}: state_chg to UPD_HLR_VLR_S_WAIT_FOR_DATA -DREF VLR subscr MSISDN:46071 usage decreases to: 2 DMM compl_l3: Keeping conn DREF MSISDN:46071: MSC conn use - 1 == 1 lu_result_sent == 0 @@ -814,6 +814,7 @@ DVLR set IMSI on subscriber; IMSI=901700000004620 id=901700000004620 DVLR New subscr, IMSI: 901700000004620 DREF VLR subscr IMSI:901700000004620 usage increases to: 2 +DREF VLR subscr IMSI:901700000004620 usage decreases to: 1 DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_IDLE}: vlr_loc_upd_node1() DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_IDLE}: vlr_loc_upd_post_auth() DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_IDLE}: vlr_loc_upd_post_ciph() @@ -825,7 +826,6 @@ DVLR GSUP tx: 04010809710000004026f0 GSUP --> HLR: OSMO_GSUP_MSGT_UPDATE_LOCATION_REQUEST: 04010809710000004026f0 DVLR upd_hlr_vlr_fsm(901700000004620){UPD_HLR_VLR_S_INIT}: state_chg to UPD_HLR_VLR_S_WAIT_FOR_DATA -DREF VLR subscr IMSI:901700000004620 usage decreases to: 1 DMM compl_l3: Keeping conn DREF IMSI:901700000004620: MSC conn use - 1 == 1 lu_result_sent == 0 @@ -981,6 +981,7 @@ DVLR set IMSI on subscriber; IMSI=901700000004620 id=901700000004620 DVLR New subscr, IMSI: 901700000004620 DREF VLR subscr IMSI:901700000004620 usage increases to: 2 +DREF VLR subscr IMSI:901700000004620 usage decreases to: 1 DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_IDLE}: vlr_loc_upd_node1() DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_IDLE}: vlr_loc_upd_post_auth() DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_IDLE}: vlr_loc_upd_post_ciph() @@ -992,7 +993,6 @@ DVLR GSUP tx: 04010809710000004026f0 GSUP --> HLR: OSMO_GSUP_MSGT_UPDATE_LOCATION_REQUEST: 04010809710000004026f0 DVLR upd_hlr_vlr_fsm(901700000004620){UPD_HLR_VLR_S_INIT}: state_chg to UPD_HLR_VLR_S_WAIT_FOR_DATA -DREF VLR subscr IMSI:901700000004620 usage decreases to: 1 DMM compl_l3: Keeping conn DREF IMSI:901700000004620: MSC conn use - 1 == 1 lu_result_sent == 0 diff --git a/tests/msc_vlr/msc_vlr_test_reject_concurrency.err b/tests/msc_vlr/msc_vlr_test_reject_concurrency.err index 874cf5f..c51d08a 100644 --- a/tests/msc_vlr/msc_vlr_test_reject_concurrency.err +++ b/tests/msc_vlr/msc_vlr_test_reject_concurrency.err @@ -18,6 +18,7 @@ DVLR set IMSI on subscriber; IMSI=901700000004620 id=901700000004620 DVLR New subscr, IMSI: 901700000004620 DREF VLR subscr IMSI:901700000004620 usage increases to: 2 +DREF VLR subscr IMSI:901700000004620 usage decreases to: 1 DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_IDLE}: vlr_loc_upd_node1() DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_IDLE}: vlr_loc_upd_post_auth() DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_IDLE}: vlr_loc_upd_post_ciph() @@ -29,7 +30,6 @@ DVLR GSUP tx: 04010809710000004026f0 GSUP --> HLR: OSMO_GSUP_MSGT_UPDATE_LOCATION_REQUEST: 04010809710000004026f0 DVLR upd_hlr_vlr_fsm(901700000004620){UPD_HLR_VLR_S_INIT}: state_chg to UPD_HLR_VLR_S_WAIT_FOR_DATA -DREF VLR subscr IMSI:901700000004620 usage decreases to: 1 DMM compl_l3: Keeping conn DREF IMSI:901700000004620: MSC conn use - 1 == 1 lu_result_sent == 0 @@ -168,6 +168,7 @@ DVLR set IMSI on subscriber; IMSI=901700000004620 id=901700000004620 DVLR New subscr, IMSI: 901700000004620 DREF VLR subscr IMSI:901700000004620 usage increases to: 2 +DREF VLR subscr IMSI:901700000004620 usage decreases to: 1 DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_IDLE}: vlr_loc_upd_node1() DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_IDLE}: vlr_loc_upd_post_auth() DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_IDLE}: vlr_loc_upd_post_ciph() @@ -179,7 +180,6 @@ DVLR GSUP tx: 04010809710000004026f0 GSUP --> HLR: OSMO_GSUP_MSGT_UPDATE_LOCATION_REQUEST: 04010809710000004026f0 DVLR upd_hlr_vlr_fsm(901700000004620){UPD_HLR_VLR_S_INIT}: state_chg to UPD_HLR_VLR_S_WAIT_FOR_DATA -DREF VLR subscr IMSI:901700000004620 usage decreases to: 1 DMM compl_l3: Keeping conn DREF IMSI:901700000004620: MSC conn use - 1 == 1 lu_result_sent == 0 @@ -288,6 +288,7 @@ DVLR set IMSI on subscriber; IMSI=901700000004620 id=901700000004620 DVLR New subscr, IMSI: 901700000004620 DREF VLR subscr IMSI:901700000004620 usage increases to: 2 +DREF VLR subscr IMSI:901700000004620 usage decreases to: 1 DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_IDLE}: vlr_loc_upd_node1() DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_IDLE}: vlr_loc_upd_post_auth() DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_IDLE}: vlr_loc_upd_post_ciph() @@ -299,7 +300,6 @@ DVLR GSUP tx: 04010809710000004026f0 GSUP --> HLR: OSMO_GSUP_MSGT_UPDATE_LOCATION_REQUEST: 04010809710000004026f0 DVLR upd_hlr_vlr_fsm(901700000004620){UPD_HLR_VLR_S_INIT}: state_chg to UPD_HLR_VLR_S_WAIT_FOR_DATA -DREF VLR subscr IMSI:901700000004620 usage decreases to: 1 DMM compl_l3: Keeping conn DREF IMSI:901700000004620: MSC conn use - 1 == 1 lu_result_sent == 0 @@ -413,6 +413,7 @@ DVLR set IMSI on subscriber; IMSI=901700000004620 id=901700000004620 DVLR New subscr, IMSI: 901700000004620 DREF VLR subscr IMSI:901700000004620 usage increases to: 2 +DREF VLR subscr IMSI:901700000004620 usage decreases to: 1 DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_IDLE}: vlr_loc_upd_node1() DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_IDLE}: vlr_loc_upd_post_auth() DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_IDLE}: vlr_loc_upd_post_ciph() @@ -424,7 +425,6 @@ DVLR GSUP tx: 04010809710000004026f0 GSUP --> HLR: OSMO_GSUP_MSGT_UPDATE_LOCATION_REQUEST: 04010809710000004026f0 DVLR upd_hlr_vlr_fsm(901700000004620){UPD_HLR_VLR_S_INIT}: state_chg to UPD_HLR_VLR_S_WAIT_FOR_DATA -DREF VLR subscr IMSI:901700000004620 usage decreases to: 1 DMM compl_l3: Keeping conn DREF IMSI:901700000004620: MSC conn use - 1 == 1 lu_result_sent == 0 @@ -536,6 +536,7 @@ DVLR set IMSI on subscriber; IMSI=901700000004620 id=901700000004620 DVLR New subscr, IMSI: 901700000004620 DREF VLR subscr IMSI:901700000004620 usage increases to: 2 +DREF VLR subscr IMSI:901700000004620 usage decreases to: 1 DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_IDLE}: vlr_loc_upd_node1() DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_IDLE}: vlr_loc_upd_post_auth() DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_IDLE}: vlr_loc_upd_post_ciph() @@ -547,7 +548,6 @@ DVLR GSUP tx: 04010809710000004026f0 GSUP --> HLR: OSMO_GSUP_MSGT_UPDATE_LOCATION_REQUEST: 04010809710000004026f0 DVLR upd_hlr_vlr_fsm(901700000004620){UPD_HLR_VLR_S_INIT}: state_chg to UPD_HLR_VLR_S_WAIT_FOR_DATA -DREF VLR subscr IMSI:901700000004620 usage decreases to: 1 DMM compl_l3: Keeping conn DREF IMSI:901700000004620: MSC conn use - 1 == 1 lu_result_sent == 0 @@ -721,6 +721,7 @@ DVLR set IMSI on subscriber; IMSI=901700000004620 id=901700000004620 DVLR New subscr, IMSI: 901700000004620 DREF VLR subscr IMSI:901700000004620 usage increases to: 2 +DREF VLR subscr IMSI:901700000004620 usage decreases to: 1 DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_IDLE}: vlr_loc_upd_node1() DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_IDLE}: vlr_loc_upd_post_auth() DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_IDLE}: vlr_loc_upd_post_ciph() @@ -732,7 +733,6 @@ DVLR GSUP tx: 04010809710000004026f0 GSUP --> HLR: OSMO_GSUP_MSGT_UPDATE_LOCATION_REQUEST: 04010809710000004026f0 DVLR upd_hlr_vlr_fsm(901700000004620){UPD_HLR_VLR_S_INIT}: state_chg to UPD_HLR_VLR_S_WAIT_FOR_DATA -DREF VLR subscr IMSI:901700000004620 usage decreases to: 1 DMM compl_l3: Keeping conn DREF IMSI:901700000004620: MSC conn use - 1 == 1 lu_result_sent == 0 @@ -908,6 +908,7 @@ DVLR set IMSI on subscriber; IMSI=901700000004620 id=901700000004620 DVLR New subscr, IMSI: 901700000004620 DREF VLR subscr IMSI:901700000004620 usage increases to: 2 +DREF VLR subscr IMSI:901700000004620 usage decreases to: 1 DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_IDLE}: vlr_loc_upd_node1() DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_IDLE}: vlr_loc_upd_post_auth() DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_IDLE}: vlr_loc_upd_post_ciph() @@ -919,7 +920,6 @@ DVLR GSUP tx: 04010809710000004026f0 GSUP --> HLR: OSMO_GSUP_MSGT_UPDATE_LOCATION_REQUEST: 04010809710000004026f0 DVLR upd_hlr_vlr_fsm(901700000004620){UPD_HLR_VLR_S_INIT}: state_chg to UPD_HLR_VLR_S_WAIT_FOR_DATA -DREF VLR subscr IMSI:901700000004620 usage decreases to: 1 DMM compl_l3: Keeping conn DREF IMSI:901700000004620: MSC conn use - 1 == 1 lu_result_sent == 0 @@ -1099,6 +1099,7 @@ DVLR set IMSI on subscriber; IMSI=901700000004620 id=901700000004620 DVLR New subscr, IMSI: 901700000004620 DREF VLR subscr IMSI:901700000004620 usage increases to: 2 +DREF VLR subscr IMSI:901700000004620 usage decreases to: 1 DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_IDLE}: vlr_loc_upd_node1() DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_IDLE}: vlr_loc_upd_post_auth() DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_IDLE}: vlr_loc_upd_post_ciph() @@ -1110,7 +1111,6 @@ DVLR GSUP tx: 04010809710000004026f0 GSUP --> HLR: OSMO_GSUP_MSGT_UPDATE_LOCATION_REQUEST: 04010809710000004026f0 DVLR upd_hlr_vlr_fsm(901700000004620){UPD_HLR_VLR_S_INIT}: state_chg to UPD_HLR_VLR_S_WAIT_FOR_DATA -DREF VLR subscr IMSI:901700000004620 usage decreases to: 1 DMM compl_l3: Keeping conn DREF IMSI:901700000004620: MSC conn use - 1 == 1 lu_result_sent == 0 @@ -1314,6 +1314,7 @@ DVLR set IMSI on subscriber; IMSI=901700000004620 id=901700000004620 DVLR New subscr, IMSI: 901700000004620 DREF VLR subscr IMSI:901700000004620 usage increases to: 2 +DREF VLR subscr IMSI:901700000004620 usage decreases to: 1 DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_IDLE}: vlr_loc_upd_node1() DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_IDLE}: vlr_loc_upd_post_auth() DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_IDLE}: vlr_loc_upd_post_ciph() @@ -1325,7 +1326,6 @@ DVLR GSUP tx: 04010809710000004026f0 GSUP --> HLR: OSMO_GSUP_MSGT_UPDATE_LOCATION_REQUEST: 04010809710000004026f0 DVLR upd_hlr_vlr_fsm(901700000004620){UPD_HLR_VLR_S_INIT}: state_chg to UPD_HLR_VLR_S_WAIT_FOR_DATA -DREF VLR subscr IMSI:901700000004620 usage decreases to: 1 DMM compl_l3: Keeping conn DREF IMSI:901700000004620: MSC conn use - 1 == 1 lu_result_sent == 0 @@ -1546,6 +1546,7 @@ DVLR set IMSI on subscriber; IMSI=901700000004620 id=901700000004620 DVLR New subscr, IMSI: 901700000004620 DREF VLR subscr IMSI:901700000004620 usage increases to: 2 +DREF VLR subscr IMSI:901700000004620 usage decreases to: 1 DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_IDLE}: vlr_loc_upd_node1() DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_IDLE}: vlr_loc_upd_post_auth() DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_IDLE}: vlr_loc_upd_post_ciph() @@ -1557,7 +1558,6 @@ DVLR GSUP tx: 04010809710000004026f0 GSUP --> HLR: OSMO_GSUP_MSGT_UPDATE_LOCATION_REQUEST: 04010809710000004026f0 DVLR upd_hlr_vlr_fsm(901700000004620){UPD_HLR_VLR_S_INIT}: state_chg to UPD_HLR_VLR_S_WAIT_FOR_DATA -DREF VLR subscr IMSI:901700000004620 usage decreases to: 1 DMM compl_l3: Keeping conn DREF IMSI:901700000004620: MSC conn use - 1 == 1 lu_result_sent == 0 diff --git a/tests/msc_vlr/msc_vlr_test_rest.err b/tests/msc_vlr/msc_vlr_test_rest.err index 3dd7141..75ff80b 100644 --- a/tests/msc_vlr/msc_vlr_test_rest.err +++ b/tests/msc_vlr/msc_vlr_test_rest.err @@ -102,6 +102,7 @@ DVLR set IMSI on subscriber; IMSI=901700000004620 id=901700000004620 DVLR New subscr, IMSI: 901700000004620 DREF VLR subscr IMSI:901700000004620 usage increases to: 2 +DREF VLR subscr IMSI:901700000004620 usage decreases to: 1 DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_IDLE}: vlr_loc_upd_node1() DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_IDLE}: vlr_loc_upd_post_auth() DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_IDLE}: vlr_loc_upd_post_ciph() @@ -113,7 +114,6 @@ DVLR GSUP tx: 04010809710000004026f0 GSUP --> HLR: OSMO_GSUP_MSGT_UPDATE_LOCATION_REQUEST: 04010809710000004026f0 DVLR upd_hlr_vlr_fsm(901700000004620){UPD_HLR_VLR_S_INIT}: state_chg to UPD_HLR_VLR_S_WAIT_FOR_DATA -DREF VLR subscr IMSI:901700000004620 usage decreases to: 1 DMM compl_l3: Keeping conn DREF IMSI:901700000004620: MSC conn use - 1 == 1 lu_result_sent == 0 @@ -215,6 +215,7 @@ DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_IDLE}: Received Event VLR_ULA_E_UPDATE_LA DREF VLR subscr MSISDN:46071 usage increases to: 2 DREF VLR subscr MSISDN:46071 usage increases to: 3 +DREF VLR subscr MSISDN:46071 usage decreases to: 2 DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_IDLE}: vlr_loc_upd_node1() DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_IDLE}: vlr_loc_upd_post_auth() DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_IDLE}: vlr_loc_upd_post_ciph() @@ -226,7 +227,6 @@ DVLR GSUP tx: 04010809710000004026f0 GSUP --> HLR: OSMO_GSUP_MSGT_UPDATE_LOCATION_REQUEST: 04010809710000004026f0 DVLR upd_hlr_vlr_fsm(901700000004620){UPD_HLR_VLR_S_INIT}: state_chg to UPD_HLR_VLR_S_WAIT_FOR_DATA -DREF VLR subscr MSISDN:46071 usage decreases to: 2 DMM compl_l3: Keeping conn DREF MSISDN:46071: MSC conn use - 1 == 1 lu_result_sent == 0 @@ -349,11 +349,11 @@ DREF VLR subscr unknown usage increases to: 1 DVLR New subscr, TMSI: 0x23422342 DREF VLR subscr TMSI:0x23422342 usage increases to: 2 +DREF VLR subscr TMSI:0x23422342 usage decreases to: 1 DVLR vlr_lu_fsm(591536962){VLR_ULA_S_IDLE}: vlr_loc_upd_want_imsi() DVLR vlr_lu_fsm(591536962){VLR_ULA_S_IDLE}: state_chg to VLR_ULA_S_WAIT_IMSI - DTAP --> MS: 051801 - DTAP matches expected message -DREF VLR subscr TMSI:0x23422342 usage decreases to: 1 DMM compl_l3: Keeping conn DREF TMSI:0x23422342: MSC conn use - 1 == 1 lu_result_sent == 0 diff --git a/tests/msc_vlr/msc_vlr_test_umts_authen.err b/tests/msc_vlr/msc_vlr_test_umts_authen.err index 67c69c0..bfb4a8e 100644 --- a/tests/msc_vlr/msc_vlr_test_umts_authen.err +++ b/tests/msc_vlr/msc_vlr_test_umts_authen.err @@ -18,6 +18,7 @@ DVLR set IMSI on subscriber; IMSI=901700000010650 id=901700000010650 DVLR New subscr, IMSI: 901700000010650 DREF VLR subscr IMSI:901700000010650 usage increases to: 2 +DREF VLR subscr IMSI:901700000010650 usage decreases to: 1 DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_IDLE}: vlr_loc_upd_node1() DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_IDLE}: state_chg to VLR_ULA_S_WAIT_AUTH DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_NEEDS_AUTH}: Allocated @@ -26,7 +27,6 @@ DVLR GSUP tx: 08010809710000000156f0 GSUP --> HLR: OSMO_GSUP_MSGT_SEND_AUTH_INFO_REQUEST: 08010809710000000156f0 DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_NEEDS_AUTH}: state_chg to VLR_SUB_AS_NEEDS_AUTH_WAIT_AI -DREF VLR subscr IMSI:901700000010650 usage decreases to: 1 DMM compl_l3: Keeping conn DREF IMSI:901700000010650: MSC conn use - 1 == 1 lu_result_sent == 0 @@ -430,6 +430,7 @@ DVLR set IMSI on subscriber; IMSI=901700000010650 id=901700000010650 DVLR New subscr, IMSI: 901700000010650 DREF VLR subscr IMSI:901700000010650 usage increases to: 2 +DREF VLR subscr IMSI:901700000010650 usage decreases to: 1 DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_IDLE}: vlr_loc_upd_node1() DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_IDLE}: state_chg to VLR_ULA_S_WAIT_AUTH DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_NEEDS_AUTH}: Allocated @@ -438,7 +439,6 @@ DVLR GSUP tx: 08010809710000000156f0 GSUP --> HLR: OSMO_GSUP_MSGT_SEND_AUTH_INFO_REQUEST: 08010809710000000156f0 DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_NEEDS_AUTH}: state_chg to VLR_SUB_AS_NEEDS_AUTH_WAIT_AI -DREF VLR subscr IMSI:901700000010650 usage decreases to: 1 DMM compl_l3: Keeping conn DREF IMSI:901700000010650: MSC conn use - 1 == 1 lu_result_sent == 0 @@ -842,6 +842,7 @@ DVLR set IMSI on subscriber; IMSI=901700000010650 id=901700000010650 DVLR New subscr, IMSI: 901700000010650 DREF VLR subscr IMSI:901700000010650 usage increases to: 2 +DREF VLR subscr IMSI:901700000010650 usage decreases to: 1 DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_IDLE}: vlr_loc_upd_node1() DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_IDLE}: state_chg to VLR_ULA_S_WAIT_AUTH DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_NEEDS_AUTH}: Allocated @@ -850,7 +851,6 @@ DVLR GSUP tx: 08010809710000000156f0 GSUP --> HLR: OSMO_GSUP_MSGT_SEND_AUTH_INFO_REQUEST: 08010809710000000156f0 DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_NEEDS_AUTH}: state_chg to VLR_SUB_AS_NEEDS_AUTH_WAIT_AI -DREF VLR subscr IMSI:901700000010650 usage decreases to: 1 DMM compl_l3: Keeping conn DREF IMSI:901700000010650: MSC conn use - 1 == 1 lu_result_sent == 0 @@ -1019,6 +1019,7 @@ DVLR set IMSI on subscriber; IMSI=901700000010650 id=901700000010650 DVLR New subscr, IMSI: 901700000010650 DREF VLR subscr IMSI:901700000010650 usage increases to: 2 +DREF VLR subscr IMSI:901700000010650 usage decreases to: 1 DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_IDLE}: vlr_loc_upd_node1() DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_IDLE}: state_chg to VLR_ULA_S_WAIT_AUTH DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_NEEDS_AUTH}: Allocated @@ -1027,7 +1028,6 @@ DVLR GSUP tx: 08010809710000000156f0 GSUP --> HLR: OSMO_GSUP_MSGT_SEND_AUTH_INFO_REQUEST: 08010809710000000156f0 DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_NEEDS_AUTH}: state_chg to VLR_SUB_AS_NEEDS_AUTH_WAIT_AI -DREF VLR subscr IMSI:901700000010650 usage decreases to: 1 DMM compl_l3: Keeping conn DREF IMSI:901700000010650: MSC conn use - 1 == 1 lu_result_sent == 0 diff --git a/tests/msc_vlr/msc_vlr_tests.c b/tests/msc_vlr/msc_vlr_tests.c index 8f04593..a878be7 100644 --- a/tests/msc_vlr/msc_vlr_tests.c +++ b/tests/msc_vlr/msc_vlr_tests.c @@ -294,7 +294,8 @@ net->a5_encryption = VLR_CIPH_NONE; net->vlr->cfg.check_imei_rqd = false; net->vlr->cfg.assign_tmsi = false; - net->vlr->cfg.retrieve_imeisv = false; + net->vlr->cfg.retrieve_imeisv_early = false; + net->vlr->cfg.retrieve_imeisv_ciphered = false; rx_from_ran = RAN_GERAN_A; auth_request_sent = false; -- To view, visit https://gerrit.osmocom.org/3417 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I121b95ad6d5ecb7603815eece2b43008de487a8a Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Mon Aug 7 14:52:49 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 7 Aug 2017 14:52:49 +0000 Subject: [PATCH] osmo-msc[master]: contrib: Add osmo-msc service file Message-ID: Review at https://gerrit.osmocom.org/3418 contrib: Add osmo-msc service file Change-Id: Ifdaf4107167c84af8a616f4ee792d5a34495564b --- A contrib/systemd/osmo-msc.service 1 file changed, 13 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/18/3418/1 diff --git a/contrib/systemd/osmo-msc.service b/contrib/systemd/osmo-msc.service new file mode 100644 index 0000000..2c81eba --- /dev/null +++ b/contrib/systemd/osmo-msc.service @@ -0,0 +1,13 @@ +[Unit] +Description=Osmocom Mobile Switching Center (MSC) +Wants=osmo-hlr +After=osmo-hlr + +[Service] +Type=simple +Restart=always +ExecStart=/usr/bin/osmo-msc -c /etc/osmocom/osmo-msc.cfg +RestartSec=2 + +[Install] +WantedBy=multi-user.target -- To view, visit https://gerrit.osmocom.org/3418 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ifdaf4107167c84af8a616f4ee792d5a34495564b Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: daniel From gerrit-no-reply at lists.osmocom.org Mon Aug 7 14:52:50 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 7 Aug 2017 14:52:50 +0000 Subject: [PATCH] osmo-msc[master]: examples: Change IP address of config files Message-ID: Review at https://gerrit.osmocom.org/3419 examples: Change IP address of config files This helps in providing 3G software packages for the sysmoNITB hardware. Change-Id: Ie3a25f6771ed6e620cb2b315638c622a9a24e530 --- M doc/examples/osmo-bsc_mgcp/mgcp.cfg M doc/examples/osmo-msc/osmo-msc.cfg M doc/examples/osmo-sgsn/osmo-sgsn.cfg 3 files changed, 7 insertions(+), 7 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/19/3419/1 diff --git a/doc/examples/osmo-bsc_mgcp/mgcp.cfg b/doc/examples/osmo-bsc_mgcp/mgcp.cfg index 2622d23..3c43f1f 100644 --- a/doc/examples/osmo-bsc_mgcp/mgcp.cfg +++ b/doc/examples/osmo-bsc_mgcp/mgcp.cfg @@ -7,9 +7,9 @@ no login ! mgcp - !local ip 192.168.0.132 - !bts ip 192.168.0.124 - !bind ip 192.168.0.132 + !local ip 10.23.24.2 + !bts ip 10.24.24.1 + !bind ip 10.23.24.1 bind port 2427 rtp base 4000 rtp force-ptime 20 diff --git a/doc/examples/osmo-msc/osmo-msc.cfg b/doc/examples/osmo-msc/osmo-msc.cfg index 6cb9e4e..1b1d192 100644 --- a/doc/examples/osmo-msc/osmo-msc.cfg +++ b/doc/examples/osmo-msc/osmo-msc.cfg @@ -15,5 +15,5 @@ rrlp mode none mm info 1 msc - mgcpgw remote-ip 192.168.0.132 + mgcpgw remote-ip 10.23.24.1 assign-tmsi diff --git a/doc/examples/osmo-sgsn/osmo-sgsn.cfg b/doc/examples/osmo-sgsn/osmo-sgsn.cfg index 4955983..530fb8c 100644 --- a/doc/examples/osmo-sgsn/osmo-sgsn.cfg +++ b/doc/examples/osmo-sgsn/osmo-sgsn.cfg @@ -6,8 +6,8 @@ no login ! sgsn - gtp local-ip 127.0.0.1 - ggsn 0 remote-ip 127.0.0.1 + gtp local-ip 10.23.24.1 + ggsn 0 remote-ip 10.23.24.2 ggsn 0 gtp-version 1 ! ns @@ -18,7 +18,7 @@ timer tns-test 30 timer tns-alive 3 timer tns-alive-retries 10 - encapsulation udp local-ip 127.0.0.1 + encapsulation udp local-ip 10.23.24.1 encapsulation udp local-port 23000 encapsulation framerelay-gre enabled 0 ! -- To view, visit https://gerrit.osmocom.org/3419 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ie3a25f6771ed6e620cb2b315638c622a9a24e530 Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: daniel From gerrit-no-reply at lists.osmocom.org Mon Aug 7 14:52:50 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 7 Aug 2017 14:52:50 +0000 Subject: [PATCH] osmo-msc[master]: contrib: Change systemd requirements so the services connect... Message-ID: Review at https://gerrit.osmocom.org/3420 contrib: Change systemd requirements so the services connect properly Change-Id: Ib1b3c640ddd81927a60ee307c4b0cb90fd83eebe --- M contrib/systemd/osmo-msc.service M contrib/systemd/osmo-sgsn.service 2 files changed, 6 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/20/3420/1 diff --git a/contrib/systemd/osmo-msc.service b/contrib/systemd/osmo-msc.service index 2c81eba..7cebb14 100644 --- a/contrib/systemd/osmo-msc.service +++ b/contrib/systemd/osmo-msc.service @@ -1,7 +1,8 @@ [Unit] Description=Osmocom Mobile Switching Center (MSC) -Wants=osmo-hlr -After=osmo-hlr +Wants=osmo-hlr.service +After=osmo-hlr.service +After=osmo-hnbgw.service [Service] Type=simple diff --git a/contrib/systemd/osmo-sgsn.service b/contrib/systemd/osmo-sgsn.service index 674d786..bf6a8e0 100644 --- a/contrib/systemd/osmo-sgsn.service +++ b/contrib/systemd/osmo-sgsn.service @@ -1,5 +1,8 @@ [Unit] Description=OpenBSC SGSN +Wants=osmo-hlr.service +After=osmo-hlr.service +After=osmo-hnbgw.service [Service] Type=simple -- To view, visit https://gerrit.osmocom.org/3420 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ib1b3c640ddd81927a60ee307c4b0cb90fd83eebe Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: daniel From gerrit-no-reply at lists.osmocom.org Mon Aug 7 14:52:50 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 7 Aug 2017 14:52:50 +0000 Subject: [PATCH] osmo-msc[master]: examples/sgsn: Use osmo-hlr with auth-policy remote by default Message-ID: Review at https://gerrit.osmocom.org/3421 examples/sgsn: Use osmo-hlr with auth-policy remote by default Change-Id: Ie3b2013198d3e2b780a4e31c36b89b58129dcacd --- M doc/examples/osmo-sgsn/osmo-sgsn.cfg 1 file changed, 3 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/21/3421/1 diff --git a/doc/examples/osmo-sgsn/osmo-sgsn.cfg b/doc/examples/osmo-sgsn/osmo-sgsn.cfg index 530fb8c..01be513 100644 --- a/doc/examples/osmo-sgsn/osmo-sgsn.cfg +++ b/doc/examples/osmo-sgsn/osmo-sgsn.cfg @@ -9,6 +9,9 @@ gtp local-ip 10.23.24.1 ggsn 0 remote-ip 10.23.24.2 ggsn 0 gtp-version 1 + auth-policy remote + gsup remote-ip 127.0.0.1 + gsup remote-port 2222 ! ns timer tns-block 3 -- To view, visit https://gerrit.osmocom.org/3421 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ie3b2013198d3e2b780a4e31c36b89b58129dcacd Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: daniel From gerrit-no-reply at lists.osmocom.org Mon Aug 7 15:16:35 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 7 Aug 2017 15:16:35 +0000 Subject: [PATCH] osmo-iuh[master]: make point codes configurable by SCCP address book 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/3394 to look at the new patch set (#2). make point codes configurable by SCCP address book In the vty config, use the SCCP address book to configure the local and remote SCCP addresses. Add VTY commands to set the remote SCCP addresses by name, derive the ss7 instance from these addresses: cs7 instance 1 point-code 0.23.0 sccp-address msc point-code 0.0.1 sccp-address sgsn point-code 0.0.2 hnbgw iucs remote-addr msc iups remote-addr sgsn Enforce that both IuCS and IuPS use the same ss7 instance. In the future, we may add the feature to use two separate instances. Depends: libosmo-sccp I75c67d289693f1c2a049ac61cf2b2097d6e5687d, Ie1aedd7894acd69ddc887cd65a8a0df4b888838c, I85b46269dbe7909e52873ace3f720f6292a4516c Change-Id: I33a7ba11eb7c2d9a5dc74d10fb0cf04bf664477b --- M include/osmocom/iuh/hnbgw.h M include/osmocom/iuh/hnbgw_cn.h M src/hnbgw.c M src/hnbgw_cn.c M src/hnbgw_rua.c M src/hnbgw_vty.c 6 files changed, 120 insertions(+), 100 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-iuh refs/changes/94/3394/2 diff --git a/include/osmocom/iuh/hnbgw.h b/include/osmocom/iuh/hnbgw.h index db22d97..58bdab4 100644 --- a/include/osmocom/iuh/hnbgw.h +++ b/include/osmocom/iuh/hnbgw.h @@ -116,10 +116,8 @@ /*! The UDP port where we receive multiplexed CS user * plane traffic from HNBs */ uint16_t iuh_cs_mux_port; - const char *iucs_remote_ip; - uint16_t iucs_remote_port; - const char *iups_remote_ip; - uint16_t iups_remote_port; + const char *iucs_remote_addr_name; + const char *iups_remote_addr_name; uint16_t rnc_id; bool hnbap_allow_tmsi; } config; @@ -134,11 +132,11 @@ /* currently active CN links for CS and PS */ struct { - struct osmo_sccp_instance *instance; + struct osmo_sccp_instance *client; struct hnbgw_cnlink *cnlink; struct osmo_sccp_addr local_addr; - struct osmo_sccp_addr remote_addr_cs; - struct osmo_sccp_addr remote_addr_ps; + struct osmo_sccp_addr iucs_remote_addr; + struct osmo_sccp_addr iups_remote_addr; } sccp; }; diff --git a/include/osmocom/iuh/hnbgw_cn.h b/include/osmocom/iuh/hnbgw_cn.h index 93123f2..2e61d82 100644 --- a/include/osmocom/iuh/hnbgw_cn.h +++ b/include/osmocom/iuh/hnbgw_cn.h @@ -2,5 +2,4 @@ #include -int hnbgw_cnlink_init(struct hnb_gw *gw, const char *stp_host, uint16_t stp_port, - const char *local_ip, uint32_t local_pc); +int hnbgw_cnlink_init(struct hnb_gw *gw, const char *stp_host, uint16_t stp_port, const char *local_ip); diff --git a/src/hnbgw.c b/src/hnbgw.c index 5d9f87b..409110f 100644 --- a/src/hnbgw.c +++ b/src/hnbgw.c @@ -79,14 +79,6 @@ gw->config.iuh_local_ip = talloc_strdup(gw, HNBGW_LOCAL_IP_DEFAULT); gw->config.iuh_local_port = IUH_DEFAULT_SCTP_PORT; - gw->config.iucs_remote_ip = talloc_strdup(gw, - HNBGW_IUCS_REMOTE_IP_DEFAULT); - gw->config.iucs_remote_port = M3UA_PORT; - - gw->config.iups_remote_ip = talloc_strdup(gw, - HNBGW_IUPS_REMOTE_IP_DEFAULT); - gw->config.iups_remote_port = M3UA_PORT; - gw->next_ue_ctx_id = 23; INIT_LLIST_HEAD(&gw->hnb_list); INIT_LLIST_HEAD(&gw->ue_list); @@ -465,6 +457,7 @@ vty_info.copyright = osmo_hnbgw_copyright; vty_init(&vty_info); + osmo_ss7_vty_init_asp(); hnbgw_vty_init(g_hnb_gw, tall_hnb_ctx); logging_vty_add_cmds(&hnbgw_log_info); @@ -501,23 +494,12 @@ ranap_set_log_area(DRANAP); - OSMO_ASSERT(g_hnb_gw->config.iucs_remote_ip); rc = hnbgw_cnlink_init(g_hnb_gw, - g_hnb_gw->config.iucs_remote_ip, - g_hnb_gw->config.iucs_remote_port, - "127.0.0.5" /* FIXME: configurable */, - 23 /* FIXME: configurable */); + "127.0.0.1", M3UA_PORT, "127.0.0.5" /* FIXME: configurable */); if (rc < 0) { LOGP(DMAIN, LOGL_ERROR, "Failed to initialize SCCP link to CN\n"); exit(1); } - - osmo_sccp_make_addr_pc_ssn(&g_hnb_gw->sccp.remote_addr_cs, - 1 /* FIXME: configurable */, - OSMO_SCCP_SSN_RANAP); - osmo_sccp_make_addr_pc_ssn(&g_hnb_gw->sccp.remote_addr_ps, - 2 /* FIXME: configurable */, - OSMO_SCCP_SSN_RANAP); OSMO_ASSERT(g_hnb_gw->config.iuh_local_ip); LOGP(DMAIN, LOGL_NOTICE, "Listening for Iuh at %s %d\n", diff --git a/src/hnbgw_cn.c b/src/hnbgw_cn.c index e967260..6fccd7a 100644 --- a/src/hnbgw_cn.c +++ b/src/hnbgw_cn.c @@ -63,8 +63,8 @@ { struct hnb_gw *gw = data; - transmit_rst(gw, RANAP_CN_DomainIndicator_cs_domain, &gw->sccp.remote_addr_cs); - transmit_rst(gw, RANAP_CN_DomainIndicator_ps_domain, &gw->sccp.remote_addr_ps); + transmit_rst(gw, RANAP_CN_DomainIndicator_cs_domain, &gw->sccp.iucs_remote_addr); + transmit_rst(gw, RANAP_CN_DomainIndicator_ps_domain, &gw->sccp.iups_remote_addr); hnbgw_cnlink_change_state(gw->sccp.cnlink, CNLINK_S_EST_RST_TX_WAIT_ACK); /* The spec states that we should abandon after a configurable * number of times. We decide to simply continue trying */ @@ -251,12 +251,12 @@ const struct osmo_sccp_addr *cn_remote_addr, bool *is_ps) { - if (pc_and_ssn_match(cn_remote_addr, &gw->sccp.remote_addr_cs)) { + if (pc_and_ssn_match(cn_remote_addr, &gw->sccp.iucs_remote_addr)) { if (is_ps) *is_ps = false; return 0; } - if (pc_and_ssn_match(cn_remote_addr, &gw->sccp.remote_addr_ps)) { + if (pc_and_ssn_match(cn_remote_addr, &gw->sccp.iups_remote_addr)) { if (is_ps) *is_ps = true; return 0; @@ -401,27 +401,90 @@ return 0; } -int hnbgw_cnlink_init(struct hnb_gw *gw, const char *stp_host, uint16_t stp_port, - const char *local_ip, uint32_t local_pc) +static bool addr_has_pc_and_ssn(const struct osmo_sccp_addr *addr) { - struct hnbgw_cnlink *cnlink; - int rc; + if (!(addr->presence & OSMO_SCCP_ADDR_T_SSN)) + return false; + if (!(addr->presence & OSMO_SCCP_ADDR_T_PC)) + return false; + return true; +} - OSMO_ASSERT(!gw->sccp.instance); - OSMO_ASSERT(!gw->sccp.cnlink); +static int resolve_addr_name(struct osmo_sccp_addr *dest, struct osmo_ss7_instance **ss7, + const char *addr_name, const char *label) +{ + struct osmo_ss7_instance *ss7_tmp; - gw->sccp.instance = osmo_sccp_simple_client(gw, "OsmoHNBGW", local_pc, - OSMO_SS7_ASP_PROT_M3UA, 0, local_ip, - stp_port, stp_host); - if (!gw->sccp.instance) { - LOGP(DMAIN, LOGL_ERROR, "Failed to init SCCP Instance\n"); + if (!addr_name) { + LOGP(DMAIN, LOGL_ERROR, "Missing config: %s remote-addr\n", label); return -1; } - LOGP(DRUA, LOGL_DEBUG, "SCCP uplink to STP: %s %u\n", stp_host, stp_port); + ss7_tmp = osmo_sccp_addr_by_name(dest, addr_name); + if (!ss7_tmp) { + LOGP(DMAIN, LOGL_ERROR, "%s remote addr: no such SCCP address book entry: '%s'\n", + label, addr_name); + return -1; + } - osmo_sccp_make_addr_pc_ssn(&gw->sccp.local_addr, local_pc, - OSMO_SCCP_SSN_RANAP); + if (*ss7 && (*ss7 != ss7_tmp)) { + LOGP(DMAIN, LOGL_ERROR, "IuCS and IuPS cannot be served from separate CS7 instances," + " cs7 instance %d != %d\n", (*ss7)->cfg.id, ss7_tmp->cfg.id); + return -1; + } + + *ss7 = ss7_tmp; + + osmo_sccp_addr_set_ssn(dest, OSMO_SCCP_SSN_RANAP); + + if (!addr_has_pc_and_ssn(dest)) { + LOGP(DMAIN, LOGL_ERROR, "Invalid/incomplete %s remote-addr: %s\n", + label, osmo_sccp_addr_name(dest)); + return -1; + } + + LOGP(DRANAP, LOGL_NOTICE, "Remote %s SCCP addr: %s\n", + label, osmo_sccp_addr_name(*ss7, dest)); + return 0; +} + +int hnbgw_cnlink_init(struct hnb_gw *gw, const char *stp_host, uint16_t stp_port, const char *local_ip) +{ + struct hnbgw_cnlink *cnlink; + struct osmo_ss7_instance *ss7; + uint32_t local_pc; + int rc; + + OSMO_ASSERT(!gw->sccp.client); + OSMO_ASSERT(!gw->sccp.cnlink); + + ss7 = NULL; + if (resolve_addr_name(&gw->sccp.iucs_remote_addr, &ss7, + gw->config.iucs_remote_addr_name, "IuCS")) + return -1; + if (resolve_addr_name(&gw->sccp.iups_remote_addr, &ss7, + gw->config.iups_remote_addr_name, "IuPS")) + return -1; + + if (!ss7->cfg.primary_pc_valid) { + LOGP(DMAIN, LOGL_ERROR, "IuCS/IuPS uplink cannot be setup: CS7 instance %d has no point-code set\n", + ss7->cfg.id); + return -1; + } + local_pc = ss7->cfg.primary_pc; + + osmo_sccp_make_addr_pc_ssn(&gw->sccp.local_addr, local_pc, OSMO_SCCP_SSN_RANAP); + + LOGP(DRANAP, LOGL_NOTICE, "M3UA uplink to STP: %s %u\n", stp_host, stp_port); + LOGP(DRANAP, LOGL_NOTICE, "Local SCCP addr: %s\n", osmo_sccp_addr_name(ss7, &gw->sccp.local_addr)); + + gw->sccp.client = osmo_sccp_simple_client_on_ss7_id(gw, ss7->cfg.id, "OsmoHNBGW", + local_pc, OSMO_SS7_ASP_PROT_M3UA, + 0, local_ip, stp_port, stp_host); + if (!gw->sccp.client) { + LOGP(DMAIN, LOGL_ERROR, "Failed to init SCCP Client\n"); + return -1; + } cnlink = talloc_zero(gw, struct hnbgw_cnlink); cnlink->gw = gw; @@ -430,10 +493,8 @@ cnlink->T_RafC.data = gw; cnlink->next_conn_id = 1000; - cnlink->sccp_user = osmo_sccp_user_bind_pc(gw->sccp.instance, - "OsmoHNBGW", - sccp_sap_up, OSMO_SCCP_SSN_RANAP, - gw->sccp.local_addr.pc); + cnlink->sccp_user = osmo_sccp_user_bind_pc(gw->sccp.client, "OsmoHNBGW", sccp_sap_up, + OSMO_SCCP_SSN_RANAP, gw->sccp.local_addr.pc); if (!cnlink->sccp_user) { LOGP(DMAIN, LOGL_ERROR, "Failed to init SCCP User\n"); return -1; diff --git a/src/hnbgw_rua.c b/src/hnbgw_rua.c index b610437..95979f5 100644 --- a/src/hnbgw_rua.c +++ b/src/hnbgw_rua.c @@ -188,11 +188,11 @@ switch (cN_DomainIndicator) { case RUA_CN_DomainIndicator_cs_domain: - remote_addr = &hnb->gw->sccp.remote_addr_cs; + remote_addr = &hnb->gw->sccp.iucs_remote_addr; is_ps = false; break; case RUA_CN_DomainIndicator_ps_domain: - remote_addr = &hnb->gw->sccp.remote_addr_ps; + remote_addr = &hnb->gw->sccp.iups_remote_addr; is_ps = true; break; default: diff --git a/src/hnbgw_vty.c b/src/hnbgw_vty.c index 59871da..ddea578 100644 --- a/src/hnbgw_vty.c +++ b/src/hnbgw_vty.c @@ -90,7 +90,6 @@ vty->node = HNBGW_NODE; vty->index = NULL; break; - default: case HNBGW_NODE: vty->node = CONFIG_NODE; vty->index = NULL; @@ -98,6 +97,9 @@ case CONFIG_NODE: vty->node = ENABLE_NODE; vty->index = NULL; + break; + default: + osmo_ss7_vty_go_parent(vty); break; } @@ -182,37 +184,23 @@ return CMD_SUCCESS; } -DEFUN(cfg_hnbgw_iucs_remote_ip, cfg_hnbgw_iucs_remote_ip_cmd, "remote-ip A.B.C.D", - "Address to establish IuCS core network link to\n" - "Remote IuCS IP address (default: " HNBGW_IUCS_REMOTE_IP_DEFAULT ")") +DEFUN(cfg_hnbgw_iucs_remote_addr, + cfg_hnbgw_iucs_remote_addr_cmd, + "remote-addr NAME", + "SCCP address to send IuCS to (MSC)\n" + "SCCP address book entry name (see 'cs7-instance')\n") { - talloc_free((void*)g_hnb_gw->config.iucs_remote_ip); - g_hnb_gw->config.iucs_remote_ip = talloc_strdup(tall_hnb_ctx, argv[0]); + g_hnb_gw->config.iucs_remote_addr_name = talloc_strdup(g_hnb_gw, argv[0]); return CMD_SUCCESS; } -DEFUN(cfg_hnbgw_iucs_remote_port, cfg_hnbgw_iucs_remote_port_cmd, "remote-port <1-65535>", - "Remote port to establish IuCS core network link to\n" - "Remote IuCS port (default: 14001)") +DEFUN(cfg_hnbgw_iups_remote_addr, + cfg_hnbgw_iups_remote_addr_cmd, + "remote-addr NAME", + "SCCP address to send IuPS to (SGSN)\n" + "SCCP address book entry name (see 'cs7-instance')\n") { - g_hnb_gw->config.iucs_remote_port = atoi(argv[0]); - return CMD_SUCCESS; -} - -DEFUN(cfg_hnbgw_iups_remote_ip, cfg_hnbgw_iups_remote_ip_cmd, "remote-ip A.B.C.D", - "Address to establish IuPS core network link to\n" - "Remote IuPS IP address (default: " HNBGW_IUPS_REMOTE_IP_DEFAULT ")") -{ - talloc_free((void*)g_hnb_gw->config.iups_remote_ip); - g_hnb_gw->config.iups_remote_ip = talloc_strdup(tall_hnb_ctx, argv[0]); - return CMD_SUCCESS; -} - -DEFUN(cfg_hnbgw_iups_remote_port, cfg_hnbgw_iups_remote_port_cmd, "remote-port <1-65535>", - "Remote port to establish IuPS core network link to\n" - "Remote IuPS port (default: 14001)") -{ - g_hnb_gw->config.iups_remote_port = atoi(argv[0]); + g_hnb_gw->config.iups_remote_addr_name = talloc_strdup(g_hnb_gw, argv[0]); return CMD_SUCCESS; } @@ -248,15 +236,12 @@ const char *addr; uint16_t port; + if (!g_hnb_gw->config.iucs_remote_addr_name) + return CMD_SUCCESS; + vty_out(vty, " iucs%s", VTY_NEWLINE); - - addr = g_hnb_gw->config.iucs_remote_ip; - if (addr && (strcmp(addr, HNBGW_IUCS_REMOTE_IP_DEFAULT) != 0)) - vty_out(vty, " remote-ip %s%s", addr, VTY_NEWLINE); - - port = g_hnb_gw->config.iucs_remote_port; - if (port && port != SUA_PORT) - vty_out(vty, " remote-port %u%s", port, VTY_NEWLINE); + vty_out(vty, " remote-addr %s%s", g_hnb_gw->config.iucs_remote_addr_name, + VTY_NEWLINE); return CMD_SUCCESS; } @@ -266,15 +251,12 @@ const char *addr; uint16_t port; + if (!g_hnb_gw->config.iups_remote_addr_name) + return CMD_SUCCESS; + vty_out(vty, " iups%s", VTY_NEWLINE); - - addr = g_hnb_gw->config.iups_remote_ip; - if (addr && (strcmp(addr, HNBGW_IUPS_REMOTE_IP_DEFAULT) != 0)) - vty_out(vty, " remote-ip %s%s", addr, VTY_NEWLINE); - - port = g_hnb_gw->config.iups_remote_port; - if (port && port != SUA_PORT) - vty_out(vty, " remote-port %u%s", port, VTY_NEWLINE); + vty_out(vty, " remote-addr %s%s", g_hnb_gw->config.iups_remote_addr_name, + VTY_NEWLINE); return CMD_SUCCESS; } @@ -300,15 +282,13 @@ install_node(&iucs_node, config_write_hnbgw_iucs); vty_install_default(IUCS_NODE); - install_element(IUCS_NODE, &cfg_hnbgw_iucs_remote_ip_cmd); - install_element(IUCS_NODE, &cfg_hnbgw_iucs_remote_port_cmd); + install_element(IUCS_NODE, &cfg_hnbgw_iucs_remote_addr_cmd); install_element(HNBGW_NODE, &cfg_hnbgw_iups_cmd); install_node(&iups_node, config_write_hnbgw_iups); vty_install_default(IUPS_NODE); - install_element(IUPS_NODE, &cfg_hnbgw_iups_remote_ip_cmd); - install_element(IUPS_NODE, &cfg_hnbgw_iups_remote_port_cmd); + install_element(IUPS_NODE, &cfg_hnbgw_iups_remote_addr_cmd); install_element_ve(&show_hnb_cmd); install_element_ve(&show_ue_cmd); -- To view, visit https://gerrit.osmocom.org/3394 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I33a7ba11eb7c2d9a5dc74d10fb0cf04bf664477b Gerrit-PatchSet: 2 Gerrit-Project: osmo-iuh Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From admin at opensuse.org Mon Aug 7 19:54:06 2017 From: admin at opensuse.org (OBS Notification) Date: Mon, 07 Aug 2017 19:54:06 +0000 Subject: Build failure of network:osmocom:nightly/libosmocore in Debian_9.0/x86_64 In-Reply-To: References: Message-ID: <5988c57854e01_5624c6af8411843bd@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/libosmocore/Debian_9.0/x86_64 Package network:osmocom:nightly/libosmocore failed to build in Debian_9.0/x86_64 Check out the package for editing: osc checkout network:osmocom:nightly libosmocore Last lines of build log: [ 228s] -[..] Encoding / Decoding cycle : OK [ 228s] -[..] Encoding / Decoding cycle : OK [ 228s] -[..] Encoding / Decoding cycle : OK [ 228s] - [ 228s] -[+] Testing: gsm0503_mcs9 [ 228s] -[.] Input length : ret = 606 exp = 606 -> OK [ 228s] -[.] Output length : ret = 1836 exp = 1836 -> OK [ 228s] -[.] Random vector checks: [ 228s] -[..] Encoding / Decoding cycle : OK [ 228s] -[..] Encoding / Decoding cycle : OK [ 228s] -[..] Encoding / Decoding cycle : OK [ 228s] - [ 228s] ./testsuite.at:57: exit code was 132, expected 0 [ 228s] 9. testsuite.at:54: 9. conv_gsm0503 (testsuite.at:54): FAILED (testsuite.at:57) [ 228s] debian/rules:26: recipe for target 'override_dh_auto_test' failed [ 228s] make[1]: *** [override_dh_auto_test] Error 1 [ 228s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 228s] debian/rules:15: recipe for target 'build' failed [ 228s] make: *** [build] Error 2 [ 228s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 228s] [ 228s] build32 failed "build libosmocore_0.9.6.20170807.dsc" at Mon Aug 7 19:53:49 UTC 2017. [ 228s] [ 228s] ### VM INTERACTION START ### [ 231s] [ 212.937616] reboot: Power down [ 233s] ### VM INTERACTION END ### [ 233s] [ 233s] build32 failed "build libosmocore_0.9.6.20170807.dsc" at Mon Aug 7 19:53:55 UTC 2017. [ 233s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Mon Aug 7 19:54:06 2017 From: admin at opensuse.org (OBS Notification) Date: Mon, 07 Aug 2017 19:54:06 +0000 Subject: Build failure of network:osmocom:nightly/libosmocore in Debian_9.0/x86_64 In-Reply-To: References: Message-ID: <5988c57887d54_5624c6af8411844a6@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/libosmocore/Debian_9.0/x86_64 Package network:osmocom:nightly/libosmocore failed to build in Debian_9.0/x86_64 Check out the package for editing: osc checkout network:osmocom:nightly libosmocore Last lines of build log: [ 228s] -[..] Encoding / Decoding cycle : OK [ 228s] -[..] Encoding / Decoding cycle : OK [ 228s] -[..] Encoding / Decoding cycle : OK [ 228s] - [ 228s] -[+] Testing: gsm0503_mcs9 [ 228s] -[.] Input length : ret = 606 exp = 606 -> OK [ 228s] -[.] Output length : ret = 1836 exp = 1836 -> OK [ 228s] -[.] Random vector checks: [ 228s] -[..] Encoding / Decoding cycle : OK [ 228s] -[..] Encoding / Decoding cycle : OK [ 228s] -[..] Encoding / Decoding cycle : OK [ 228s] - [ 228s] ./testsuite.at:57: exit code was 132, expected 0 [ 228s] 9. testsuite.at:54: 9. conv_gsm0503 (testsuite.at:54): FAILED (testsuite.at:57) [ 228s] debian/rules:26: recipe for target 'override_dh_auto_test' failed [ 228s] make[1]: *** [override_dh_auto_test] Error 1 [ 228s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 228s] debian/rules:15: recipe for target 'build' failed [ 228s] make: *** [build] Error 2 [ 228s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 228s] [ 228s] build32 failed "build libosmocore_0.9.6.20170807.dsc" at Mon Aug 7 19:53:49 UTC 2017. [ 228s] [ 228s] ### VM INTERACTION START ### [ 231s] [ 212.937616] reboot: Power down [ 233s] ### VM INTERACTION END ### [ 233s] [ 233s] build32 failed "build libosmocore_0.9.6.20170807.dsc" at Mon Aug 7 19:53:55 UTC 2017. [ 233s] -- 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 Aug 8 08:59:35 2017 From: gerrit-no-reply at lists.osmocom.org (Pablo Neira Ayuso) Date: Tue, 8 Aug 2017 08:59:35 +0000 Subject: [PATCH] openbsc[master]: gsm_04_11: get rid of unused parameter in sms_route_mt_sms() Message-ID: Review at https://gerrit.osmocom.org/3422 gsm_04_11: get rid of unused parameter in sms_route_mt_sms() This parameter is unused, remove it. Change-Id: I797abce3f91447e8f397c7cf726db7425479fe0e --- M openbsc/src/libmsc/gsm_04_11.c 1 file changed, 6 insertions(+), 5 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/22/3422/1 diff --git a/openbsc/src/libmsc/gsm_04_11.c b/openbsc/src/libmsc/gsm_04_11.c index acf425a..da4460c 100644 --- a/openbsc/src/libmsc/gsm_04_11.c +++ b/openbsc/src/libmsc/gsm_04_11.c @@ -187,7 +187,7 @@ return gsm411_smc_send(&trans->sms.smc_inst, msg_type, msg); } -static int gsm340_rx_sms_submit(struct msgb *msg, struct gsm_sms *gsms) +static int gsm340_rx_sms_submit(struct gsm_sms *gsms) { if (db_sms_store(gsms) != 0) { LOGP(DLSMS, LOGL_ERROR, "Failed to store SMS in Database\n"); @@ -277,8 +277,9 @@ return msg->len - old_msg_len; } -int sms_route_mt_sms(struct gsm_subscriber_connection *conn, struct msgb *msg, - struct gsm_sms *gsms, uint8_t sms_mti, bool *deferred) +static int sms_route_mt_sms(struct gsm_subscriber_connection *conn, + struct gsm_sms *gsms, uint8_t sms_mti, + bool *deferred) { int rc; @@ -342,7 +343,7 @@ switch (sms_mti) { case GSM340_SMS_SUBMIT_MS2SC: /* MS is submitting a SMS */ - rc = gsm340_rx_sms_submit(msg, gsms); + rc = gsm340_rx_sms_submit(gsms); break; case GSM340_SMS_COMMAND_MS2SC: case GSM340_SMS_DELIVER_REP_MS2SC: @@ -487,7 +488,7 @@ /* FIXME: This looks very wrong */ send_signal(0, NULL, gsms, 0); - rc = sms_route_mt_sms(conn, msg, gsms, sms_mti, deferred); + rc = sms_route_mt_sms(conn, gsms, sms_mti, deferred); out: if (!deferred) sms_free(gsms); -- To view, visit https://gerrit.osmocom.org/3422 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I797abce3f91447e8f397c7cf726db7425479fe0e Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Pablo Neira Ayuso From gerrit-no-reply at lists.osmocom.org Tue Aug 8 08:59:36 2017 From: gerrit-no-reply at lists.osmocom.org (Pablo Neira Ayuso) Date: Tue, 8 Aug 2017 08:59:36 +0000 Subject: [PATCH] openbsc[master]: libmsc: do not leak pending SMPP command object on error path Message-ID: Review at https://gerrit.osmocom.org/3423 libmsc: do not leak pending SMPP command object on error path Make sure the SMPP command object is released on errors. Change-Id: I474584425d23fb379a9d71b33e29ac0e24f01e61 --- M openbsc/src/libmsc/smpp_openbsc.c 1 file changed, 6 insertions(+), 5 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/23/3423/1 diff --git a/openbsc/src/libmsc/smpp_openbsc.c b/openbsc/src/libmsc/smpp_openbsc.c index f7d1441..36ad0a2 100644 --- a/openbsc/src/libmsc/smpp_openbsc.c +++ b/openbsc/src/libmsc/smpp_openbsc.c @@ -517,7 +517,7 @@ conn = connection_for_subscr(cmd->subscr); if (!conn) { LOGP(DSMPP, LOGL_ERROR, "No connection to subscriber anymore\n"); - return; + goto out; } trans = trans_find_by_id(conn, GSM48_PDISC_SMS, @@ -525,10 +525,11 @@ if (!trans) { LOGP(DSMPP, LOGL_ERROR, "GSM transaction %u is gone\n", cmd->sms->gsm411.transaction_id); - return; + goto out; } gsm411_send_rp_ack(trans, cmd->sms->gsm411.msg_ref); +out: smpp_cmd_free(cmd); } @@ -541,7 +542,7 @@ conn = connection_for_subscr(cmd->subscr); if (!conn) { LOGP(DSMPP, LOGL_ERROR, "No connection to subscriber anymore\n"); - return; + goto out; } trans = trans_find_by_id(conn, GSM48_PDISC_SMS, @@ -549,14 +550,14 @@ if (!trans) { LOGP(DSMPP, LOGL_ERROR, "GSM transaction %u is gone\n", cmd->sms->gsm411.transaction_id); - return; + goto out; } if (smpp_to_gsm411_err(status, &gsm411_cause) < 0) gsm411_cause = GSM411_RP_CAUSE_MO_NET_OUT_OF_ORDER; gsm411_send_rp_error(trans, cmd->sms->gsm411.msg_ref, gsm411_cause); - +out: smpp_cmd_free(cmd); } -- To view, visit https://gerrit.osmocom.org/3423 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I474584425d23fb379a9d71b33e29ac0e24f01e61 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Pablo Neira Ayuso From gerrit-no-reply at lists.osmocom.org Tue Aug 8 08:59:36 2017 From: gerrit-no-reply at lists.osmocom.org (Pablo Neira Ayuso) Date: Tue, 8 Aug 2017 08:59:36 +0000 Subject: [PATCH] openbsc[master]: libmsc: remove dead code in sms_route_mt_sms() Message-ID: Review at https://gerrit.osmocom.org/3424 libmsc: remove dead code in sms_route_mt_sms() The following branch: if (!rc && !gsms->receiver) rc = GSM411_RP_CAUSE_MO_NUM_UNASSIGNED; at the end of sms_route_mt_sms() always evaluates false. Just a bit before, in such function, we have this: if (!gsms->receiver) { ... #ifdef BUILD_SMPP ... #else ... #endif return rc; } So, if there is no receiver, we just stop running code and return the RP cause via the rc variable. Same applies to the smpp_first check under the BUILD_SMPP ifdef (that I have removed in this snippet to keep this commit message small). Change-Id: Ic3502b5b169bc7a73a67fd6ff53d8b6c0dc045c8 --- M openbsc/src/libmsc/gsm_04_11.c 1 file changed, 0 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/24/3424/1 diff --git a/openbsc/src/libmsc/gsm_04_11.c b/openbsc/src/libmsc/gsm_04_11.c index da4460c..7df5e64 100644 --- a/openbsc/src/libmsc/gsm_04_11.c +++ b/openbsc/src/libmsc/gsm_04_11.c @@ -356,9 +356,6 @@ break; } - if (!rc && !gsms->receiver) - rc = GSM411_RP_CAUSE_MO_NUM_UNASSIGNED; - return rc; } -- To view, visit https://gerrit.osmocom.org/3424 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ic3502b5b169bc7a73a67fd6ff53d8b6c0dc045c8 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Pablo Neira Ayuso From gerrit-no-reply at lists.osmocom.org Tue Aug 8 08:59:37 2017 From: gerrit-no-reply at lists.osmocom.org (Pablo Neira Ayuso) Date: Tue, 8 Aug 2017 08:59:37 +0000 Subject: [PATCH] openbsc[master]: libmsc: remove duplicate lines in deliver_to_esme() Message-ID: Review at https://gerrit.osmocom.org/3425 libmsc: remove duplicate lines in deliver_to_esme() This code is accidentally doing the same thing twice, remove it. Change-Id: I68087a850399e22951d2407e4d8a09c671a775c9 --- M openbsc/src/libmsc/smpp_openbsc.c 1 file changed, 0 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/25/3425/1 diff --git a/openbsc/src/libmsc/smpp_openbsc.c b/openbsc/src/libmsc/smpp_openbsc.c index 36ad0a2..c9379ec 100644 --- a/openbsc/src/libmsc/smpp_openbsc.c +++ b/openbsc/src/libmsc/smpp_openbsc.c @@ -676,8 +676,6 @@ } else { deliver.sm_length = sms->user_data_len; memcpy(deliver.short_message, sms->user_data, deliver.sm_length); - deliver.sm_length = sms->user_data_len; - memcpy(deliver.short_message, sms->user_data, deliver.sm_length); } if (esme->acl && esme->acl->osmocom_ext && conn->lchan) -- To view, visit https://gerrit.osmocom.org/3425 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I68087a850399e22951d2407e4d8a09c671a775c9 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Pablo Neira Ayuso From gerrit-no-reply at lists.osmocom.org Tue Aug 8 08:59:37 2017 From: gerrit-no-reply at lists.osmocom.org (Pablo Neira Ayuso) Date: Tue, 8 Aug 2017 08:59:37 +0000 Subject: [PATCH] openbsc[master]: libmsc: remove 'deferred' parameter in sms_route_mt_sms() Message-ID: Review at https://gerrit.osmocom.org/3426 libmsc: remove 'deferred' parameter in sms_route_mt_sms() No need to cache the sms object, just cache what we need into the smpp_cmd structure. This simplifies what that I introduced in 93ffbd0029d1 ("libmsc: send RP-ACK to MS after ESME sends SMPP DELIVER-SM-RESP"). Change-Id: Iba5f864f9bb963baff95969e306b1b7cff00c1e3 --- M openbsc/src/libmsc/gsm_04_11.c M openbsc/src/libmsc/smpp_openbsc.c M openbsc/src/libmsc/smpp_smsc.h 3 files changed, 24 insertions(+), 30 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/26/3426/1 diff --git a/openbsc/src/libmsc/gsm_04_11.c b/openbsc/src/libmsc/gsm_04_11.c index 7df5e64..d60de08 100644 --- a/openbsc/src/libmsc/gsm_04_11.c +++ b/openbsc/src/libmsc/gsm_04_11.c @@ -278,8 +278,7 @@ } static int sms_route_mt_sms(struct gsm_subscriber_connection *conn, - struct gsm_sms *gsms, uint8_t sms_mti, - bool *deferred) + struct gsm_sms *gsms, uint8_t sms_mti) { int rc; @@ -293,7 +292,7 @@ * delivery of the SMS. */ if (smpp_first) { - rc = smpp_try_deliver(gsms, conn, deferred); + rc = smpp_try_deliver(gsms, conn); if (rc == GSM411_RP_CAUSE_MO_NUM_UNASSIGNED) /* unknown subscriber, try local */ goto try_local; @@ -322,7 +321,7 @@ return GSM411_RP_CAUSE_MO_NUM_UNASSIGNED; } - rc = smpp_try_deliver(gsms, conn, deferred); + rc = smpp_try_deliver(gsms, conn); if (rc == GSM411_RP_CAUSE_MO_NUM_UNASSIGNED) { rate_ctr_inc(&conn->network->msc_ctrs->ctr[MSC_CTR_SMS_NO_RECEIVER]); } else if (rc < 0) { @@ -363,7 +362,7 @@ /* process an incoming TPDU (called from RP-DATA) * return value > 0: RP CAUSE for ERROR; < 0: silent error; 0 = success */ static int gsm340_rx_tpdu(struct gsm_trans *trans, struct msgb *msg, - uint32_t gsm411_msg_ref, bool *deferred) + uint32_t gsm411_msg_ref) { struct gsm_subscriber_connection *conn = trans->conn; uint8_t *smsp = msgb_sms(msg); @@ -485,10 +484,9 @@ /* FIXME: This looks very wrong */ send_signal(0, NULL, gsms, 0); - rc = sms_route_mt_sms(conn, gsms, sms_mti, deferred); + rc = sms_route_mt_sms(conn, gsms, sms_mti); out: - if (!deferred) - sms_free(gsms); + sms_free(gsms); return rc; } @@ -541,7 +539,6 @@ uint8_t dst_len, uint8_t *dst, uint8_t tpdu_len, uint8_t *tpdu) { - bool deferred = false; int rc = 0; if (src_len && src) @@ -558,8 +555,8 @@ DEBUGP(DLSMS, "DST(%u,%s)\n", dst_len, osmo_hexdump(dst, dst_len)); - rc = gsm340_rx_tpdu(trans, msg, rph->msg_ref, &deferred); - if (rc == 0 && !deferred) + rc = gsm340_rx_tpdu(trans, msg, rph->msg_ref); + if (rc == 0) return gsm411_send_rp_ack(trans, rph->msg_ref); else if (rc > 0) return gsm411_send_rp_error(trans, rph->msg_ref, rc); diff --git a/openbsc/src/libmsc/smpp_openbsc.c b/openbsc/src/libmsc/smpp_openbsc.c index c9379ec..6b89df2 100644 --- a/openbsc/src/libmsc/smpp_openbsc.c +++ b/openbsc/src/libmsc/smpp_openbsc.c @@ -497,7 +497,6 @@ osmo_timer_del(&cmd->response_timer); llist_del(&cmd->list); subscr_put(cmd->subscr); - sms_free(cmd->sms); talloc_free(cmd); } @@ -520,15 +519,14 @@ goto out; } - trans = trans_find_by_id(conn, GSM48_PDISC_SMS, - cmd->sms->gsm411.transaction_id); + trans = trans_find_by_id(conn, GSM48_PDISC_SMS, cmd->gsm411_trans_id); if (!trans) { LOGP(DSMPP, LOGL_ERROR, "GSM transaction %u is gone\n", - cmd->sms->gsm411.transaction_id); + cmd->gsm411_trans_id); goto out; } - gsm411_send_rp_ack(trans, cmd->sms->gsm411.msg_ref); + gsm411_send_rp_ack(trans, cmd->gsm411_msg_ref); out: smpp_cmd_free(cmd); } @@ -545,18 +543,17 @@ goto out; } - trans = trans_find_by_id(conn, GSM48_PDISC_SMS, - cmd->sms->gsm411.transaction_id); + trans = trans_find_by_id(conn, GSM48_PDISC_SMS, cmd->gsm411_trans_id); if (!trans) { LOGP(DSMPP, LOGL_ERROR, "GSM transaction %u is gone\n", - cmd->sms->gsm411.transaction_id); + cmd->gsm411_trans_id); goto out; } if (smpp_to_gsm411_err(status, &gsm411_cause) < 0) gsm411_cause = GSM411_RP_CAUSE_MO_NET_OUT_OF_ORDER; - gsm411_send_rp_error(trans, cmd->sms->gsm411.msg_ref, gsm411_cause); + gsm411_send_rp_error(trans, cmd->gsm411_msg_ref, gsm411_cause); out: smpp_cmd_free(cmd); } @@ -568,7 +565,7 @@ static int smpp_cmd_enqueue(struct osmo_esme *esme, struct gsm_subscriber *subscr, struct gsm_sms *sms, - uint32_t sequence_number, bool *deferred) + uint32_t sequence_number) { struct osmo_smpp_cmd *cmd; @@ -577,7 +574,8 @@ return -1; cmd->sequence_nr = sequence_number; - cmd->sms = sms; + cmd->gsm411_msg_ref = sms->gsm411.msg_ref; + cmd->gsm411_trans_id = sms->gsm411.transaction_id; cmd->subscr = subscr_get(subscr); /* FIXME: No predefined value for this response_timer as specified by @@ -588,7 +586,6 @@ osmo_timer_setup(&cmd->response_timer, smpp_deliver_sm_cb, cmd); osmo_timer_schedule(&cmd->response_timer, 5, 0); llist_add_tail(&cmd->list, &esme->smpp_cmd_list); - *deferred = true; return 0; } @@ -606,8 +603,7 @@ } static int deliver_to_esme(struct osmo_esme *esme, struct gsm_sms *sms, - struct gsm_subscriber_connection *conn, - bool *deferred) + struct gsm_subscriber_connection *conn) { struct deliver_sm_t deliver; int mode, ret; @@ -686,7 +682,7 @@ return ret; return smpp_cmd_enqueue(esme, conn->subscr, sms, - deliver.sequence_number, deferred); + deliver.sequence_number); } static struct smsc *g_smsc; @@ -697,7 +693,7 @@ } int smpp_try_deliver(struct gsm_sms *sms, - struct gsm_subscriber_connection *conn, bool *deferred) + struct gsm_subscriber_connection *conn) { struct osmo_esme *esme; struct osmo_smpp_addr dst; @@ -710,7 +706,7 @@ rc = smpp_route(g_smsc, &dst, &esme); if (!rc) - rc = deliver_to_esme(esme, sms, conn, deferred); + rc = deliver_to_esme(esme, sms, conn); return rc; } diff --git a/openbsc/src/libmsc/smpp_smsc.h b/openbsc/src/libmsc/smpp_smsc.h index c9209ef..468d3b4 100644 --- a/openbsc/src/libmsc/smpp_smsc.h +++ b/openbsc/src/libmsc/smpp_smsc.h @@ -89,8 +89,9 @@ struct osmo_smpp_cmd { struct llist_head list; struct gsm_subscriber *subscr; - struct gsm_sms *sms; uint32_t sequence_nr; + uint32_t gsm411_msg_ref; + uint8_t gsm411_trans_id; struct osmo_timer_list response_timer; }; @@ -161,5 +162,5 @@ int smpp_route_smpp_first(struct gsm_sms *sms, struct gsm_subscriber_connection *conn); int smpp_try_deliver(struct gsm_sms *sms, - struct gsm_subscriber_connection *conn, bool *deferred); + struct gsm_subscriber_connection *conn); #endif -- To view, visit https://gerrit.osmocom.org/3426 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Iba5f864f9bb963baff95969e306b1b7cff00c1e3 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Pablo Neira Ayuso From gerrit-no-reply at lists.osmocom.org Tue Aug 8 08:59:37 2017 From: gerrit-no-reply at lists.osmocom.org (Pablo Neira Ayuso) Date: Tue, 8 Aug 2017 08:59:37 +0000 Subject: [PATCH] openbsc[master]: libmsc: move gsm340_rx_sms_submit() to sms_route_mt_sms() Message-ID: Review at https://gerrit.osmocom.org/3427 libmsc: move gsm340_rx_sms_submit() to sms_route_mt_sms() Move the sms message-type-identifier (mti) handling away from the routing logic. This patch allows us to reuse the sms_route_mt_sms() function in a follow up patch for sms reports send through SMPP DELIVER_SM with esm_class = Delivery Receipt. Change-Id: I3f3d30e0762b91e2099243b0be1a4b67cbb5e9c0 --- M openbsc/src/libmsc/gsm_04_11.c 1 file changed, 22 insertions(+), 19 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/27/3427/1 diff --git a/openbsc/src/libmsc/gsm_04_11.c b/openbsc/src/libmsc/gsm_04_11.c index d60de08..7294153 100644 --- a/openbsc/src/libmsc/gsm_04_11.c +++ b/openbsc/src/libmsc/gsm_04_11.c @@ -278,7 +278,7 @@ } static int sms_route_mt_sms(struct gsm_subscriber_connection *conn, - struct gsm_sms *gsms, uint8_t sms_mti) + struct gsm_sms *gsms) { int rc; @@ -336,23 +336,6 @@ rc = GSM411_RP_CAUSE_MO_NUM_UNASSIGNED; rate_ctr_inc(&conn->network->msc_ctrs->ctr[MSC_CTR_SMS_NO_RECEIVER]); #endif - return rc; - } - - switch (sms_mti) { - case GSM340_SMS_SUBMIT_MS2SC: - /* MS is submitting a SMS */ - rc = gsm340_rx_sms_submit(gsms); - break; - case GSM340_SMS_COMMAND_MS2SC: - case GSM340_SMS_DELIVER_REP_MS2SC: - LOGP(DLSMS, 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); - rc = GSM411_RP_CAUSE_IE_NOTEXIST; - break; } return rc; @@ -484,7 +467,27 @@ /* FIXME: This looks very wrong */ send_signal(0, NULL, gsms, 0); - rc = sms_route_mt_sms(conn, gsms, sms_mti); + rc = sms_route_mt_sms(conn, gsms); + + /* This SMS got routed through SMPP or no receiver exists. */ + if (!gsms->receiver) + return rc; + + switch (sms_mti) { + case GSM340_SMS_SUBMIT_MS2SC: + /* MS is submitting a SMS */ + rc = gsm340_rx_sms_submit(gsms); + break; + case GSM340_SMS_COMMAND_MS2SC: + case GSM340_SMS_DELIVER_REP_MS2SC: + LOGP(DLSMS, 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); + rc = GSM411_RP_CAUSE_IE_NOTEXIST; + break; + } out: sms_free(gsms); -- To view, visit https://gerrit.osmocom.org/3427 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I3f3d30e0762b91e2099243b0be1a4b67cbb5e9c0 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Pablo Neira Ayuso From gerrit-no-reply at lists.osmocom.org Tue Aug 8 08:59:38 2017 From: gerrit-no-reply at lists.osmocom.org (Pablo Neira Ayuso) Date: Tue, 8 Aug 2017 08:59:38 +0000 Subject: [PATCH] openbsc[master]: libmsc: set registered_delivery field in SMPP 3.4 DELIVER_SM... Message-ID: Review at https://gerrit.osmocom.org/3428 libmsc: set registered_delivery field in SMPP 3.4 DELIVER_SM messages Propagate the status report request field to the SMPP message through the registered_delivery field, so the ESME knows that the mobile phone is asking for explicit delivery acknowledgment is required. See SMPP 3.4 specs section 5.2.17. Change-Id: I59af60fa89cd10ae973c5e122789e3e03e3728ee --- M openbsc/src/libmsc/smpp_openbsc.c 1 file changed, 8 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/28/3428/1 diff --git a/openbsc/src/libmsc/smpp_openbsc.c b/openbsc/src/libmsc/smpp_openbsc.c index 6b89df2..cf78676 100644 --- a/openbsc/src/libmsc/smpp_openbsc.c +++ b/openbsc/src/libmsc/smpp_openbsc.c @@ -602,6 +602,10 @@ return NULL; } +/* See SMPP 3.4, Section 5.2.17. registered_delivery (1 byte field). */ +#define SMPP34_NO_DELIVERY_RECEIPT 0x0 +#define SMPP34_DELIVERY_RECEIPT_REQ 0x1 + static int deliver_to_esme(struct osmo_esme *esme, struct gsm_sms *sms, struct gsm_subscriber_connection *conn) { @@ -642,7 +646,10 @@ deliver.protocol_id = sms->protocol_id; deliver.priority_flag = 0; - deliver.registered_delivery = 0; + if (sms->status_rep_req) + deliver.registered_delivery = SMPP34_DELIVERY_RECEIPT_REQ; + else + deliver.registered_delivery = SMPP34_NO_DELIVERY_RECEIPT; /* Figure out SMPP DCS from TP-DCS */ dcs = sms->data_coding_scheme; -- To view, visit https://gerrit.osmocom.org/3428 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I59af60fa89cd10ae973c5e122789e3e03e3728ee Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Pablo Neira Ayuso From gerrit-no-reply at lists.osmocom.org Tue Aug 8 08:59:38 2017 From: gerrit-no-reply at lists.osmocom.org (Pablo Neira Ayuso) Date: Tue, 8 Aug 2017 08:59:38 +0000 Subject: [PATCH] openbsc[master]: libmsc: report status report request flag from SMPP SUBMIT_SM Message-ID: Review at https://gerrit.osmocom.org/3429 libmsc: report status report request flag from SMPP SUBMIT_SM Restore the sms status report request flag from SUBMIT_SM. Change-Id: Iac05252253f8933a3875b4904599b7a225191a4b --- M openbsc/src/libmsc/smpp_openbsc.c 1 file changed, 1 insertion(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/29/3429/1 diff --git a/openbsc/src/libmsc/smpp_openbsc.c b/openbsc/src/libmsc/smpp_openbsc.c index cf78676..a803763 100644 --- a/openbsc/src/libmsc/smpp_openbsc.c +++ b/openbsc/src/libmsc/smpp_openbsc.c @@ -129,6 +129,7 @@ sms = sms_alloc(); sms->source = SMS_SOURCE_SMPP; sms->smpp.sequence_nr = submit->sequence_number; + sms->status_rep_req = submit->registered_delivery; /* fill in the destination address */ sms->receiver = dest; -- To view, visit https://gerrit.osmocom.org/3429 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Iac05252253f8933a3875b4904599b7a225191a4b Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Pablo Neira Ayuso From gerrit-no-reply at lists.osmocom.org Tue Aug 8 08:59:38 2017 From: gerrit-no-reply at lists.osmocom.org (Pablo Neira Ayuso) Date: Tue, 8 Aug 2017 08:59:38 +0000 Subject: [PATCH] openbsc[master]: libmsc: missing bit shift in status report flag when stored ... Message-ID: Review at https://gerrit.osmocom.org/3430 libmsc: missing bit shift in status report flag when stored in sms object So we just store 0 or 1 depending on what the mobile phone requests. Change-Id: Idb7d5594219c0e458ccb561383a59604bc1a4201 --- M openbsc/src/libmsc/gsm_04_11.c 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/30/3430/1 diff --git a/openbsc/src/libmsc/gsm_04_11.c b/openbsc/src/libmsc/gsm_04_11.c index 7294153..1aed60e 100644 --- a/openbsc/src/libmsc/gsm_04_11.c +++ b/openbsc/src/libmsc/gsm_04_11.c @@ -366,7 +366,7 @@ /* invert those fields where 0 means active/present */ sms_mti = *smsp & 0x03; sms_vpf = (*smsp & 0x18) >> 3; - gsms->status_rep_req = (*smsp & 0x20); + gsms->status_rep_req = (*smsp & 0x20) >> 5; gsms->ud_hdr_ind = (*smsp & 0x40); /* * Not evaluating MMS (More Messages to Send) because the -- To view, visit https://gerrit.osmocom.org/3430 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Idb7d5594219c0e458ccb561383a59604bc1a4201 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Pablo Neira Ayuso From gerrit-no-reply at lists.osmocom.org Tue Aug 8 08:59:38 2017 From: gerrit-no-reply at lists.osmocom.org (Pablo Neira Ayuso) Date: Tue, 8 Aug 2017 08:59:38 +0000 Subject: [PATCH] openbsc[master]: utils: smpp_mirror: set registered_delivery field in SMPP SU... Message-ID: Review at https://gerrit.osmocom.org/3431 utils: smpp_mirror: set registered_delivery field in SMPP SUBMIT_SM To test delivery reports using this utility. Change-Id: I0e477407531fdd4d906e53c9b5a48a79a239966f --- M openbsc/src/utils/smpp_mirror.c 1 file changed, 1 insertion(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/31/3431/1 diff --git a/openbsc/src/utils/smpp_mirror.c b/openbsc/src/utils/smpp_mirror.c index 95df5f2..ec28f0a 100644 --- a/openbsc/src/utils/smpp_mirror.c +++ b/openbsc/src/utils/smpp_mirror.c @@ -130,6 +130,7 @@ sizeof(deliver.destination_addr))); submit.esm_class = deliver.esm_class; + submit.registered_delivery = deliver.registered_delivery; submit.protocol_id = deliver.protocol_id; submit.priority_flag = deliver.priority_flag; memcpy(submit.schedule_delivery_time, deliver.schedule_delivery_time, -- To view, visit https://gerrit.osmocom.org/3431 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I0e477407531fdd4d906e53c9b5a48a79a239966f Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Pablo Neira Ayuso From gerrit-no-reply at lists.osmocom.org Tue Aug 8 08:59:39 2017 From: gerrit-no-reply at lists.osmocom.org (Pablo Neira Ayuso) Date: Tue, 8 Aug 2017 08:59:39 +0000 Subject: [PATCH] openbsc[master]: utils: smpp_mirror: temporarily munch SMPP delivery receipts Message-ID: Review at https://gerrit.osmocom.org/3432 utils: smpp_mirror: temporarily munch SMPP delivery receipts Just munch and log SMPP delivery receipts by now, don't mirror this, it is going to break things in openbsc. Follow up patch removes this and mirrors this SMPP message as a SUBMIT_SM with esm_class = Delivery Acknowledgement. Change-Id: I78e93bc4034679e238c8642ccf6a0e844b1d6d8b --- M openbsc/src/utils/smpp_mirror.c 1 file changed, 8 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/32/3432/1 diff --git a/openbsc/src/utils/smpp_mirror.c b/openbsc/src/utils/smpp_mirror.c index ec28f0a..edb40b5 100644 --- a/openbsc/src/utils/smpp_mirror.c +++ b/openbsc/src/utils/smpp_mirror.c @@ -112,6 +112,14 @@ PACK_AND_SEND(esme, &deliver_r); + /* This is a delivery receipt, temporarily munch it until we teach + * openbsc what to do with this. + */ + if (deliver.esm_class == 0x04) { + LOGP(DSMPP, LOGL_NOTICE, "%s\n", deliver.short_message); + return 0; + } + memset(&submit, 0, sizeof(submit)); submit.command_id = SUBMIT_SM; submit.command_status = ESME_ROK; -- To view, visit https://gerrit.osmocom.org/3432 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I78e93bc4034679e238c8642ccf6a0e844b1d6d8b Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Pablo Neira Ayuso From gerrit-no-reply at lists.osmocom.org Tue Aug 8 08:59:39 2017 From: gerrit-no-reply at lists.osmocom.org (Pablo Neira Ayuso) Date: Tue, 8 Aug 2017 08:59:39 +0000 Subject: [PATCH] openbsc[master]: utils: smpp_mirror: reflect message reference TLV Message-ID: Review at https://gerrit.osmocom.org/3433 utils: smpp_mirror: reflect message reference TLV Useful to test the delivery receipt support. This TLV contains the GSM03.40 message reference. Change-Id: I1b0abaa7e06ffe1bd2242c70813d8b70e9fa954f --- M openbsc/src/utils/smpp_mirror.c 1 file changed, 23 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/33/3433/1 diff --git a/openbsc/src/utils/smpp_mirror.c b/openbsc/src/utils/smpp_mirror.c index edb40b5..88545de 100644 --- a/openbsc/src/utils/smpp_mirror.c +++ b/openbsc/src/utils/smpp_mirror.c @@ -95,12 +95,23 @@ } /* FIXME: merge with smpp_smsc.c */ +static struct tlv_t *find_tlv(struct tlv_t *head, uint16_t tag) +{ + struct tlv_t *t; + + for (t = head; t != NULL; t = t->next) { + if (t->tag == tag) + return t; + } + return NULL; +} static int smpp_handle_deliver(struct esme *esme, struct msgb *msg) { struct deliver_sm_t deliver; struct deliver_sm_resp_t deliver_r; struct submit_sm_t submit; + tlv_t *t; int rc; memset(&deliver, 0, sizeof(deliver)); @@ -155,7 +166,18 @@ memcpy(submit.short_message, deliver.short_message, OSMO_MIN(sizeof(submit.short_message), sizeof(deliver.short_message))); - /* FIXME: TLV? */ + + /* FIXME: More TLV? */ + t = find_tlv(deliver.tlv, TLVID_user_message_reference); + if (t) { + tlv_t tlv; + + memset(&tlv, 0, sizeof(tlv)); + tlv.tag = TLVID_user_message_reference; + tlv.length = 2; + tlv.value.val16 = t->value.val16; + build_tlv(&submit.tlv, &tlv); + } return PACK_AND_SEND(esme, &submit); } -- To view, visit https://gerrit.osmocom.org/3433 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I1b0abaa7e06ffe1bd2242c70813d8b70e9fa954f Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Pablo Neira Ayuso From gerrit-no-reply at lists.osmocom.org Tue Aug 8 08:59:39 2017 From: gerrit-no-reply at lists.osmocom.org (Pablo Neira Ayuso) Date: Tue, 8 Aug 2017 08:59:39 +0000 Subject: [PATCH] openbsc[master]: libmsc: add support for SMPP delivery receipts Message-ID: Review at https://gerrit.osmocom.org/3434 libmsc: add support for SMPP delivery receipts If the mobile phone requests a status report via SMS, send a DELIVER_SM with esm_class = Delivery Receipt to ESME to indicate that the SMS has been already delivered to its destination. MS GSM 03.40 SMSC SMPP 3.4 ESME | | | | SMS-DELIVER | | |<----------------------------| | | GSM 04.11 RP-ACK | | |---------------------------->| | | | DELIVER-SM | | | esm_class = Delivery Receipt | | |------------------------------->| | | DELIVER-SM-RESP | | |<-------------------------------| | | | This patch implements "Appendix B. Delivery Receipt Format" as specified in the SMPP 3.4 specs. This string is conveyed in the SMS message as data, and it is only meaningful to the ESME, for logging purposes. The "submit date" and "done date" are not yet set, and other fields are just sent with dummy values, so they are left to be finished as future work. Change-Id: Ic1a9023074bfa938099377980b6aff9b262fab2a --- M openbsc/include/openbsc/gsm_data.h M openbsc/src/libmsc/gsm_04_11.c M openbsc/src/libmsc/smpp_openbsc.c M openbsc/src/libmsc/smpp_smsc.h 4 files changed, 83 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/34/3434/1 diff --git a/openbsc/include/openbsc/gsm_data.h b/openbsc/include/openbsc/gsm_data.h index 37a341c..5e9a3a1 100644 --- a/openbsc/include/openbsc/gsm_data.h +++ b/openbsc/include/openbsc/gsm_data.h @@ -456,6 +456,7 @@ } smpp; unsigned long validity_minutes; + bool report; uint8_t reply_path_req; uint8_t status_rep_req; uint8_t ud_hdr_ind; diff --git a/openbsc/src/libmsc/gsm_04_11.c b/openbsc/src/libmsc/gsm_04_11.c index 1aed60e..ea80860 100644 --- a/openbsc/src/libmsc/gsm_04_11.c +++ b/openbsc/src/libmsc/gsm_04_11.c @@ -593,6 +593,60 @@ rpud_len, rp_ud); } +static struct gsm_sms *sms_report_alloc(struct gsm_sms *sms) +{ + struct gsm_sms *sms_report; + int len; + + sms_report = sms_alloc(); + if (!sms_report) + return NULL; + + sms_report->msg_ref = sms->msg_ref; + sms_report->protocol_id = sms->protocol_id; + sms_report->data_coding_scheme = GSM338_DCS_1111_8BIT_DATA; + + /* Invert address to send status report back to origin. */ + sms_report->src = sms->dst; + sms_report->dst = sms->src; + + /* As specified by Appendix B. Delivery Receipt Format. + * TODO: Many fields in this string are just set with dummy values, + * revisit this. + */ + len = snprintf((char *)sms_report->user_data, + sizeof(sms_report->user_data), + "id:%.08llu sub:000 dlvrd:000 submit date:YYMMDDhhmm done date:YYMMDDhhmm stat:DELIVRD err:000 text:%.20s", + sms->id, sms->user_data); + sms_report->user_data_len = len; + LOGP(DLSMS, LOGL_NOTICE, "%s\n", sms_report->user_data); + + /* This represents a sms report. */ + sms_report->report = true; + + return sms_report; +} + +static void sms_status_report(struct gsm_sms *gsms, + struct gsm_subscriber_connection *conn) +{ + struct gsm_sms *sms_report; + int rc; + + sms_report = sms_report_alloc(gsms); + if (!sms_report) + return; + + rc = sms_route_mt_sms(conn, sms_report); + if (rc < 0) { + LOGP(DLSMS, LOGL_ERROR, + "Failed to send status report! err=%d\n", rc); + } + LOGP(DLSMS, LOGL_NOTICE, "Status report has been sent\n"); + + sms_free(sms_report); +} + /* Receive a 04.11 RP-ACK message (response to RP-DATA from us) */ static int gsm411_rx_rp_ack(struct msgb *msg, struct gsm_trans *trans, struct gsm411_rp_hdr *rph) @@ -614,6 +668,9 @@ send_signal(S_SMS_DELIVERED, trans, sms, 0); + if (sms->status_rep_req) + sms_status_report(sms, trans->conn); + sms_free(sms); trans->sms.sms = NULL; diff --git a/openbsc/src/libmsc/smpp_openbsc.c b/openbsc/src/libmsc/smpp_openbsc.c index a803763..42357e2 100644 --- a/openbsc/src/libmsc/smpp_openbsc.c +++ b/openbsc/src/libmsc/smpp_openbsc.c @@ -200,6 +200,10 @@ sms->user_data_len = sms_msg_len; } + t = find_tlv(submit->tlv, TLVID_user_message_reference); + if (t) + sms->msg_ref = ntohs(t->value.val16); + *psms = sms; return ESME_ROK; } @@ -514,6 +518,13 @@ struct gsm_subscriber_connection *conn; struct gsm_trans *trans; + /* We got a DELIVER_SM response for this is status report, this was + * initiated by the SMSC, so no need to send any RP-ACK to the mobile + * station. + */ + if (cmd->report) + goto out; + conn = connection_for_subscr(cmd->subscr); if (!conn) { LOGP(DSMPP, LOGL_ERROR, "No connection to subscriber anymore\n"); @@ -537,6 +548,9 @@ struct gsm_subscriber_connection *conn; struct gsm_trans *trans; int gsm411_cause; + + if (cmd->report) + goto out; conn = connection_for_subscr(cmd->subscr); if (!conn) { @@ -575,6 +589,7 @@ return -1; cmd->sequence_nr = sequence_number; + cmd->report = sms->report; cmd->gsm411_msg_ref = sms->gsm411.msg_ref; cmd->gsm411_trans_id = sms->gsm411.transaction_id; cmd->subscr = subscr_get(subscr); @@ -639,7 +654,12 @@ memcpy(deliver.destination_addr, sms->dst.addr, sizeof(deliver.destination_addr)); - deliver.esm_class = 1; /* datagram mode */ + /* Short message contains a delivery receipt? Sect. 5.2.12. */ + if (sms->report) + deliver.esm_class = 0x04; + else + deliver.esm_class = 1; /* datagram mode */ + if (sms->ud_hdr_ind) deliver.esm_class |= 0x40; if (sms->reply_path_req) @@ -685,6 +705,9 @@ if (esme->acl && esme->acl->osmocom_ext && conn->lchan) append_osmo_tlvs(&deliver.tlv, conn->lchan); + append_tlv_u16(&deliver.tlv, TLVID_user_message_reference, + sms->msg_ref); + ret = smpp_tx_deliver(esme, &deliver); if (ret < 0) return ret; diff --git a/openbsc/src/libmsc/smpp_smsc.h b/openbsc/src/libmsc/smpp_smsc.h index 468d3b4..854d048 100644 --- a/openbsc/src/libmsc/smpp_smsc.h +++ b/openbsc/src/libmsc/smpp_smsc.h @@ -92,6 +92,7 @@ uint32_t sequence_nr; uint32_t gsm411_msg_ref; uint8_t gsm411_trans_id; + bool report; struct osmo_timer_list response_timer; }; -- To view, visit https://gerrit.osmocom.org/3434 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ic1a9023074bfa938099377980b6aff9b262fab2a Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Pablo Neira Ayuso From gerrit-no-reply at lists.osmocom.org Tue Aug 8 08:59:39 2017 From: gerrit-no-reply at lists.osmocom.org (Pablo Neira Ayuso) Date: Tue, 8 Aug 2017 08:59:39 +0000 Subject: [PATCH] openbsc[master]: libmsc: update database to accomodate SMS status-report fields Message-ID: Review at https://gerrit.osmocom.org/3435 libmsc: update database to accomodate SMS status-report fields SMPP DELIVER_SM messages with esm_class = Delivery Receipt need to send this message reference (that the mobile phone allocates) to the ESME. Thus, the ESME propagates it via SUBMIT_SM with esm_class = Delivery Acknoledgment so that the SMSC sends the GSM 03.40 status-report to the origin including this. Given this field is useful for status-reports, we need to store it in the HLR database. Moreover, we need a new field that specifies if the entry represents a SMS status-report, to do the right handling from the gsm411_send_sms() - such new handling comes in a follow up patch entitled "libmsc: handle delivery ack via SMPP SUBMIT SM / send GSM 03.40 status report". This patch includes the migration routines to the new database schema revision 5, it's quite a bit of dbi boilerplate code - copied-pasted and adapted. Change-Id: I7276d356d805a83ebeec72b02c8563b7135ea0b6 --- M openbsc/src/libmsc/db.c 1 file changed, 162 insertions(+), 6 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/35/3435/1 diff --git a/openbsc/src/libmsc/db.c b/openbsc/src/libmsc/db.c index 5fe2a3c..99d4486 100644 --- a/openbsc/src/libmsc/db.c +++ b/openbsc/src/libmsc/db.c @@ -50,7 +50,7 @@ static char *db_dirname = NULL; static dbi_conn conn; -#define SCHEMA_REVISION "4" +#define SCHEMA_REVISION "5" enum { SCHEMA_META, @@ -124,6 +124,8 @@ "valid_until TIMESTAMP, " "reply_path_req INTEGER NOT NULL, " "status_rep_req INTEGER NOT NULL, " + "report INTEGER NOT NULL, " + "msg_ref INTEGER NOT NULL, " "protocol_id INTEGER NOT NULL, " "data_coding_scheme INTEGER NOT NULL, " "ud_hdr_ind INTEGER NOT NULL, " @@ -370,6 +372,152 @@ return -EINVAL; } +/* Just like v4, but there is a new message reference field for status reports, + * that is set to zero for existing entries since there is no way we can infer + * this. + */ +static struct gsm_sms *sms_from_result_v4(dbi_result result) +{ + struct gsm_sms *sms = sms_alloc(); + const unsigned char *user_data; + const char *text, *addr; + + if (!sms) + return NULL; + + sms->id = dbi_result_get_ulonglong(result, "id"); + + sms->reply_path_req = dbi_result_get_ulonglong(result, "reply_path_req"); + sms->status_rep_req = dbi_result_get_ulonglong(result, "status_rep_req"); + sms->ud_hdr_ind = dbi_result_get_ulonglong(result, "ud_hdr_ind"); + sms->protocol_id = dbi_result_get_ulonglong(result, "protocol_id"); + sms->data_coding_scheme = dbi_result_get_ulonglong(result, + "data_coding_scheme"); + + addr = dbi_result_get_string(result, "src_addr"); + osmo_strlcpy(sms->src.addr, addr, sizeof(sms->src.addr)); + sms->src.ton = dbi_result_get_ulonglong(result, "src_ton"); + sms->src.npi = dbi_result_get_ulonglong(result, "src_npi"); + + addr = dbi_result_get_string(result, "dest_addr"); + osmo_strlcpy(sms->dst.addr, addr, sizeof(sms->dst.addr)); + sms->dst.ton = dbi_result_get_ulonglong(result, "dest_ton"); + sms->dst.npi = dbi_result_get_ulonglong(result, "dest_npi"); + + sms->user_data_len = dbi_result_get_field_length(result, "user_data"); + user_data = dbi_result_get_binary(result, "user_data"); + if (sms->user_data_len > sizeof(sms->user_data)) + sms->user_data_len = (uint8_t) sizeof(sms->user_data); + memcpy(sms->user_data, user_data, sms->user_data_len); + + text = dbi_result_get_string(result, "text"); + if (text) + osmo_strlcpy(sms->text, text, sizeof(sms->text)); + return sms; +} + +static int update_db_revision_4(void) +{ + dbi_result result; + struct gsm_sms *sms; + + LOGP(DDB, LOGL_NOTICE, "Going to migrate from revision 4\n"); + + result = dbi_conn_query(conn, "BEGIN EXCLUSIVE TRANSACTION"); + if (!result) { + LOGP(DDB, LOGL_ERROR, + "Failed to begin transaction (upgrade from rev 4)\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_4"); + if (!result) { + LOGP(DDB, LOGL_ERROR, + "Failed to rename the old SMS table (upgrade from rev 4).\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 4).\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_4"); + if (!result) { + LOGP(DDB, LOGL_ERROR, + "Failed fetch messages from the old SMS table (upgrade from rev 4).\n"); + goto rollback; + } + while (dbi_result_next_row(result)) { + sms = sms_from_result_v4(result); + if (db_sms_store(sms) != 0) { + LOGP(DDB, LOGL_ERROR, "Failed to store message to the new SMS table(upgrade from rev 4).\n"); + sms_free(sms); + dbi_result_free(result); + goto rollback; + } + sms_free(sms); + } + dbi_result_free(result); + + /* Remove the temporary table */ + result = dbi_conn_query(conn, "DROP TABLE SMS_4"); + if (!result) { + LOGP(DDB, LOGL_ERROR, + "Failed to drop the old SMS table (upgrade from rev 4).\n"); + goto rollback; + } + dbi_result_free(result); + + /* We're done. Bump DB Meta revision to 4 */ + result = dbi_conn_query(conn, + "UPDATE Meta " + "SET value = '5' " + "WHERE key = 'revision'"); + if (!result) { + LOGP(DDB, LOGL_ERROR, + "Failed to update DB schema revision (upgrade from rev 4).\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 4)\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 4).\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 4).\n"); + else + dbi_result_free(result); + return -EINVAL; +} + static int check_db_revision(void) { dbi_result result; @@ -412,6 +560,9 @@ goto error; case 3: if (update_db_revision_3()) + goto error; + case 4: + if (update_db_revision_4()) goto error; /* The end of waterfall */ @@ -1445,20 +1596,23 @@ result = dbi_conn_queryf(conn, "INSERT INTO SMS " "(created, valid_until, " - "reply_path_req, status_rep_req, protocol_id, " - "data_coding_scheme, ud_hdr_ind, " + "reply_path_req, status_rep_req, report, " + "msg_ref, protocol_id, data_coding_scheme, " + "ud_hdr_ind, " "user_data, text, " "dest_addr, dest_ton, dest_npi, " "src_addr, src_ton, src_npi) VALUES " "(datetime('now'), %u, " "%u, %u, %u, " - "%u, %u, " + "%u, %u, %u, " + "%u, " "%s, %s, " "%s, %u, %u, " "%s, %u, %u)", validity_timestamp, - sms->reply_path_req, sms->status_rep_req, sms->protocol_id, - sms->data_coding_scheme, sms->ud_hdr_ind, + sms->reply_path_req, sms->status_rep_req, sms->report, + sms->msg_ref, sms->protocol_id, sms->data_coding_scheme, + sms->ud_hdr_ind, q_udata, q_text, q_daddr, sms->dst.ton, sms->dst.npi, q_saddr, sms->src.ton, sms->src.npi); @@ -1489,6 +1643,8 @@ /* FIXME: those should all be get_uchar, but sqlite3 is braindead */ sms->reply_path_req = dbi_result_get_ulonglong(result, "reply_path_req"); sms->status_rep_req = dbi_result_get_ulonglong(result, "status_rep_req"); + sms->report = dbi_result_get_ulonglong(result, "report"); + sms->msg_ref = dbi_result_get_ulonglong(result, "msg_ref"); sms->ud_hdr_ind = dbi_result_get_ulonglong(result, "ud_hdr_ind"); sms->protocol_id = dbi_result_get_ulonglong(result, "protocol_id"); sms->data_coding_scheme = dbi_result_get_ulonglong(result, -- To view, visit https://gerrit.osmocom.org/3435 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I7276d356d805a83ebeec72b02c8563b7135ea0b6 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Pablo Neira Ayuso From gerrit-no-reply at lists.osmocom.org Tue Aug 8 08:59:40 2017 From: gerrit-no-reply at lists.osmocom.org (Pablo Neira Ayuso) Date: Tue, 8 Aug 2017 08:59:40 +0000 Subject: [PATCH] openbsc[master]: utils: smpp_mirror: bounce Delivery Receipts as Delivery Ack... Message-ID: Review at https://gerrit.osmocom.org/3436 utils: smpp_mirror: bounce Delivery Receipts as Delivery Acknowledgments Simple patch to test the new status-report support. Change-Id: I877e228d8e174430f700631edbf9955972da7892 --- M openbsc/src/utils/smpp_mirror.c 1 file changed, 8 insertions(+), 9 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/36/3436/1 diff --git a/openbsc/src/utils/smpp_mirror.c b/openbsc/src/utils/smpp_mirror.c index 88545de..0b04b24 100644 --- a/openbsc/src/utils/smpp_mirror.c +++ b/openbsc/src/utils/smpp_mirror.c @@ -123,14 +123,6 @@ PACK_AND_SEND(esme, &deliver_r); - /* This is a delivery receipt, temporarily munch it until we teach - * openbsc what to do with this. - */ - if (deliver.esm_class == 0x04) { - LOGP(DSMPP, LOGL_NOTICE, "%s\n", deliver.short_message); - return 0; - } - memset(&submit, 0, sizeof(submit)); submit.command_id = SUBMIT_SM; submit.command_status = ESME_ROK; @@ -148,7 +140,14 @@ OSMO_MIN(sizeof(submit.source_addr), sizeof(deliver.destination_addr))); - submit.esm_class = deliver.esm_class; + /* Mirror delivery receipts as a delivery acknowledgements. */ + if (deliver.esm_class == 0x04) { + LOGP(DSMPP, LOGL_NOTICE, "%s\n", deliver.short_message); + submit.esm_class = 0x08; + } else { + submit.esm_class = deliver.esm_class; + } + submit.registered_delivery = deliver.registered_delivery; submit.protocol_id = deliver.protocol_id; submit.priority_flag = deliver.priority_flag; -- To view, visit https://gerrit.osmocom.org/3436 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I877e228d8e174430f700631edbf9955972da7892 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Pablo Neira Ayuso From gerrit-no-reply at lists.osmocom.org Tue Aug 8 08:59:40 2017 From: gerrit-no-reply at lists.osmocom.org (Pablo Neira Ayuso) Date: Tue, 8 Aug 2017 08:59:40 +0000 Subject: [PATCH] openbsc[master]: libmsc: handle delivery ack via SMPP SUBMIT SM / send GSM 03... Message-ID: Review at https://gerrit.osmocom.org/3437 libmsc: handle delivery ack via SMPP SUBMIT SM / send GSM 03.40 status report This patch adds gsm340_sms_send_status_report_tpdu() to build a status-report. Moreover, set sms->report field if we see a SMPP SUBMIT_SM with Delivery Acknowledgment esm_class, so this identifies that this is a delivery report. MS GSM 03.40 SMSC SMPP 3.4 ESME | | | | | SUBMIT-SM | | | esm_class = Delivery Ack | | |<-------------------------------| | | SUBMIT-SM-RESP | | |------------------------------->| | | | | SMS-STATUS-REPORT | | |<----------------------------| | | GSM 04.11 RP-ACK | | |---------------------------->| | | | | There is a FIXME message in this patch, that I just copied from gsm340_gen_sms_deliver_tpdu() since TP-MMS is not supported by OpenBSC. Change-Id: Ib70e534840308ed315f7add440351e649de3f907 --- M openbsc/src/libmsc/gsm_04_11.c M openbsc/src/libmsc/smpp_openbsc.c 2 files changed, 54 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/37/3437/1 diff --git a/openbsc/src/libmsc/gsm_04_11.c b/openbsc/src/libmsc/gsm_04_11.c index ea80860..a2e002e 100644 --- a/openbsc/src/libmsc/gsm_04_11.c +++ b/openbsc/src/libmsc/gsm_04_11.c @@ -277,6 +277,49 @@ return msg->len - old_msg_len; } +/* As defined by GSM 03.40, Section 9.2.2.3. */ +static int gsm340_gen_sms_status_report_tpdu(struct msgb *msg, + struct gsm_sms *sms) +{ + unsigned int old_msg_len = msg->len; + uint8_t oa_len = 0; + uint8_t oa[12]; /* max len per 03.40 */ + uint8_t *smsp; + + /* generate first octet with masked bits */ + smsp = msgb_put(msg, 1); + /* TP-MTI (message type indicator) */ + *smsp = GSM340_SMS_STATUS_REP_SC2MS; + /* TP-MMS (more messages to send) */ + if (0 /* FIXME */) + *smsp |= 0x04; + /* TP-MR (message reference) */ + smsp = msgb_put(msg, 1); + *smsp = sms->msg_ref; + /* generate recipient address */ + oa_len = gsm340_gen_oa_sub(oa, sizeof(oa), &sms->dst); + smsp = msgb_put(msg, oa_len); + memcpy(smsp, oa, oa_len); + + /* generate TP-SCTS (Service centre timestamp) */ + smsp = msgb_put(msg, 7); + gsm340_gen_scts(smsp, time(NULL)); + + /* generate TP-DT (Discharge time, in TP-SCTS format). */ + smsp = msgb_put(msg, 7); + gsm340_gen_scts(smsp, time(NULL)); + + /* TP-ST (status) */ + smsp = msgb_put(msg, 1); + /* 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); + + return msg->len - old_msg_len; +} + static int sms_route_mt_sms(struct gsm_subscriber_connection *conn, struct gsm_sms *gsms) { @@ -992,8 +1035,13 @@ /* obtain a pointer for the rp_ud_len, so we can fill it later */ rp_ud_len = (uint8_t *)msgb_put(msg, 1); - /* generate the 03.40 SMS-DELIVER TPDU */ - rc = gsm340_gen_sms_deliver_tpdu(msg, sms); + if (sms->report) { + /* generate the 03.40 SMS-STATUS-REPORT TPDU */ + rc = gsm340_gen_sms_status_report_tpdu(msg, sms); + } else { + /* generate the 03.40 SMS-DELIVER TPDU */ + rc = gsm340_gen_sms_deliver_tpdu(msg, sms); + } if (rc < 0) { send_signal(S_SMS_UNKNOWN_ERROR, trans, sms, 0); sms_free(sms); diff --git a/openbsc/src/libmsc/smpp_openbsc.c b/openbsc/src/libmsc/smpp_openbsc.c index 42357e2..32ad30e 100644 --- a/openbsc/src/libmsc/smpp_openbsc.c +++ b/openbsc/src/libmsc/smpp_openbsc.c @@ -143,6 +143,10 @@ osmo_strlcpy(sms->src.addr, (char *)submit->source_addr, sizeof(sms->src.addr)); + /* This is a Delivery Acknowledgment. */ + if (submit->esm_class == 0x08) + sms->report = true; + if (submit->esm_class & 0x40) sms->ud_hdr_ind = 1; -- To view, visit https://gerrit.osmocom.org/3437 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ib70e534840308ed315f7add440351e649de3f907 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Pablo Neira Ayuso From gerrit-no-reply at lists.osmocom.org Tue Aug 8 08:59:41 2017 From: gerrit-no-reply at lists.osmocom.org (Pablo Neira Ayuso) Date: Tue, 8 Aug 2017 08:59:41 +0000 Subject: [PATCH] openbsc[master]: libmsc: support GSM 03.40 status report for nitb Message-ID: Review at https://gerrit.osmocom.org/3438 libmsc: support GSM 03.40 status report for nitb This patch adds support for GSM 03.40 in nitb mode. MS GSM 03.40 SMSC | | | SMS-SUBMIT | |--------------------------->| | GSM 04.11 RP-ACK | |<---------------------------| | SMS-DELIVER | |<---------------------------| | GSM 04.11 RP-ACK | |--------------------------->| | SMS-STATUS-REPORT | |<---------------------------| | GSM 04.11 RP-ACK | |--------------------------->| | | Change-Id: I5cc7bb4ebadde0940f44d10c3df34707b0615160 --- M openbsc/src/libmsc/gsm_04_11.c 1 file changed, 4 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/38/3438/1 diff --git a/openbsc/src/libmsc/gsm_04_11.c b/openbsc/src/libmsc/gsm_04_11.c index a2e002e..13d7d1c 100644 --- a/openbsc/src/libmsc/gsm_04_11.c +++ b/openbsc/src/libmsc/gsm_04_11.c @@ -687,6 +687,10 @@ } LOGP(DLSMS, LOGL_NOTICE, "Status report has been sent\n"); + /* No route via SMPP, send the GSM 03.40 status-report now. */ + if (gsms->receiver) + gsm340_rx_sms_submit(sms_report); + sms_free(sms_report); } -- To view, visit https://gerrit.osmocom.org/3438 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I5cc7bb4ebadde0940f44d10c3df34707b0615160 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Pablo Neira Ayuso From gerrit-no-reply at lists.osmocom.org Tue Aug 8 09:24:27 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 8 Aug 2017 09:24:27 +0000 Subject: osmo-msc[master]: contrib: Change systemd requirements so the services connect... In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3420 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ib1b3c640ddd81927a60ee307c4b0cb90fd83eebe Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: daniel Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Aug 8 09:29:51 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 8 Aug 2017 09:29:51 +0000 Subject: osmo-msc[master]: examples: Change IP address of config files In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3419 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ie3a25f6771ed6e620cb2b315638c622a9a24e530 Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: daniel Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Aug 8 09:29:58 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 8 Aug 2017 09:29:58 +0000 Subject: osmo-msc[master]: contrib: Add osmo-msc service file In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3418 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ifdaf4107167c84af8a616f4ee792d5a34495564b Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: daniel Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Aug 8 09:31:12 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 8 Aug 2017 09:31:12 +0000 Subject: osmo-msc[master]: log protocol discriminators and message types by name In-Reply-To: References: Message-ID: Patch Set 5: Code-Review+2 (1 comment) https://gerrit.osmocom.org/#/c/3350/5/tests/msc_vlr/msc_vlr_tests.c File tests/msc_vlr/msc_vlr_tests.c: Line 168: log("MSC <--%s-- MS: %s", unrelated to the current patch: In general, we have shown the MS always on the left (like in almost all 3GPP diagrams, ladder diagrams, ...) and the core network on the right. Maybe for a follow-up patch? -- To view, visit https://gerrit.osmocom.org/3350 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ida205d217e304337d816b14fd15e2ee435e7397d Gerrit-PatchSet: 5 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Tue Aug 8 09:31:33 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 8 Aug 2017 09:31:33 +0000 Subject: osmo-msc[master]: sgsn init: pass sgsn_config pointer to sgsn_vty_init(), not ... In-Reply-To: References: Message-ID: Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3346 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ie6b6e5422987586531a898e0c5b867623dbecb0f Gerrit-PatchSet: 3 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Aug 8 09:31:48 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 8 Aug 2017 09:31:48 +0000 Subject: osmo-msc[master]: vlr: place comments on if (0) cases In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3416 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I56c1e61dedeac01a4e24452feee6616782783d8f Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Aug 8 09:32:13 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 8 Aug 2017 09:32:13 +0000 Subject: osmo-msc[master]: vlr: LU FSM: enable Retrieve_IMEISV_If_Required In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3417 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I121b95ad6d5ecb7603815eece2b43008de487a8a Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Aug 8 09:43:47 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 8 Aug 2017 09:43:47 +0000 Subject: [MERGED] osmo-msc[master]: vlr: place comments on if (0) cases In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: vlr: place comments on if (0) cases ...................................................................... vlr: place comments on if (0) cases Change-Id: I56c1e61dedeac01a4e24452feee6616782783d8f --- M src/libvlr/vlr_access_req_fsm.c M src/libvlr/vlr_lu_fsm.c 2 files changed, 8 insertions(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/libvlr/vlr_access_req_fsm.c b/src/libvlr/vlr_access_req_fsm.c index 279e3d4..15f84b7 100644 --- a/src/libvlr/vlr_access_req_fsm.c +++ b/src/libvlr/vlr_access_req_fsm.c @@ -172,6 +172,7 @@ LOGPFSM(fi, "%s()\n", __func__); + /* See 3GPP TS 29.002 Proc_Acc_Req_VLR3. */ /* TODO: Identity := IMSI */ if (0 /* TODO: TMSI reallocation at access: vlr->cfg.alloc_tmsi_arq */) { vlr_subscr_alloc_tmsi(vsub); @@ -194,6 +195,7 @@ LOGPFSM(fi, "%s()\n", __func__); /* Node 3 */ + /* See 3GPP TS 29.002 Proc_Acc_Req_VLR3. */ if (0 /* IMEI check required */) { /* Chck_IMEI_VLR */ vlr->ops.tx_id_req(par->msc_conn_ref, GSM_MI_TYPE_IMEI); @@ -207,6 +209,7 @@ static void _proc_arq_vlr_post_pres(struct osmo_fsm_inst *fi) { LOGPFSM(fi, "%s()\n", __func__); + /* See 3GPP TS 29.002 Proc_Acc_Req_VLR3. */ if (0 /* TODO: tracing required */) { /* TODO: Trace_Subscriber_Activity_VLR */ osmo_fsm_inst_state_chg(fi, PR_ARQ_S_WAIT_TRACE_SUB, 0, 0); @@ -227,6 +230,7 @@ proc_arq_fsm_done(fi, VLR_PR_ARQ_RES_UNIDENT_SUBSCR); return; } + /* We don't feature location area specific blocking (yet). */ if (0 /* roaming not allowed in LA */) { /* Set User Error: Roaming not allowed in this LA */ proc_arq_fsm_done(fi, VLR_PR_ARQ_RES_ROAMING_NOTALLOWED); diff --git a/src/libvlr/vlr_lu_fsm.c b/src/libvlr/vlr_lu_fsm.c index d32659f..f9ccbdf 100644 --- a/src/libvlr/vlr_lu_fsm.c +++ b/src/libvlr/vlr_lu_fsm.c @@ -760,7 +760,9 @@ { LOGPFSM(fi, "%s()\n", __func__); - /* FIXME */ + /* OsmoHLR does not support PgA, neither stores the IMEISV, so we have no need to update the HLR + * with either. TODO: depend on actual HLR configuration. See 3GPP TS 23.012 Release 14, process + * Update_Location_Area_VLR (ULA_VLR2). */ if (0) { /* IMEISV or PgA to send */ vlr_loc_upd_node_4(fi); } else { @@ -1149,6 +1151,7 @@ /* unsuccessful case */ enum gsm48_gmm_cause cause = *(enum gsm48_gmm_cause *)data; + /* Ignoring standalone mode for now. */ if (0 /* procedure_error && vlr->cfg.standalone_mode */) { osmo_fsm_inst_state_chg(fi, VLR_ULA_S_WAIT_LU_COMPL_STANDALONE, -- To view, visit https://gerrit.osmocom.org/3416 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I56c1e61dedeac01a4e24452feee6616782783d8f Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Tue Aug 8 09:44:01 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 8 Aug 2017 09:44:01 +0000 Subject: [MERGED] osmo-msc[master]: vlr: LU FSM: enable Retrieve_IMEISV_If_Required In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: vlr: LU FSM: enable Retrieve_IMEISV_If_Required ...................................................................... vlr: LU FSM: enable Retrieve_IMEISV_If_Required Change-Id: I121b95ad6d5ecb7603815eece2b43008de487a8a --- M include/openbsc/vlr.h M src/libvlr/vlr_access_req_fsm.c M src/libvlr/vlr_lu_fsm.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.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_umts_authen.err M tests/msc_vlr/msc_vlr_tests.c 14 files changed, 123 insertions(+), 111 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/include/openbsc/vlr.h b/include/openbsc/vlr.h index 17cb2ae..09e2ff4 100644 --- a/include/openbsc/vlr.h +++ b/include/openbsc/vlr.h @@ -211,7 +211,8 @@ struct gsup_client *gsup_client; struct vlr_ops ops; struct { - bool retrieve_imeisv; + bool retrieve_imeisv_early; + bool retrieve_imeisv_ciphered; bool assign_tmsi; bool check_imei_rqd; int auth_tuple_max_use_count; diff --git a/src/libvlr/vlr_access_req_fsm.c b/src/libvlr/vlr_access_req_fsm.c index 15f84b7..67fba56 100644 --- a/src/libvlr/vlr_access_req_fsm.c +++ b/src/libvlr/vlr_access_req_fsm.c @@ -286,7 +286,7 @@ if (vlr_set_ciph_mode(vsub->vlr, fi, par->msc_conn_ref, par->ciphering_required, - vsub->vlr->cfg.retrieve_imeisv)) { + vsub->vlr->cfg.retrieve_imeisv_ciphered)) { LOGPFSML(fi, LOGL_ERROR, "Failed to send Ciphering Mode Command\n"); proc_arq_fsm_done(fi, VLR_PR_ARQ_RES_SYSTEM_FAILURE); diff --git a/src/libvlr/vlr_lu_fsm.c b/src/libvlr/vlr_lu_fsm.c index f9ccbdf..ae671c1 100644 --- a/src/libvlr/vlr_lu_fsm.c +++ b/src/libvlr/vlr_lu_fsm.c @@ -814,7 +814,7 @@ if (vlr_set_ciph_mode(vsub->vlr, fi, lfp->msc_conn_ref, lfp->ciphering_required, - vsub->vlr->cfg.retrieve_imeisv)) { + vsub->vlr->cfg.retrieve_imeisv_ciphered)) { LOGPFSML(fi, LOGL_ERROR, "Failed to send Ciphering Mode Command\n"); vlr_lu_compl_fsm_failure(fi, GSM48_REJECT_NETWORK_FAILURE); @@ -896,13 +896,62 @@ return buf; } +static int _lu_fsm_associate_vsub(struct osmo_fsm_inst *fi) +{ + struct lu_fsm_priv *lfp = fi->priv; + struct vlr_instance *vlr = lfp->vlr; + struct vlr_subscr *vsub = NULL; + + if (!lfp->imsi[0]) { + /* TMSI was used */ + lfp->lu_by_tmsi = true; + /* TMSI clash: if a different subscriber already has this TMSI, + * we will find that other subscriber in the VLR. So the IMSIs + * would mismatch, but we don't know about it. Theoretically, + * an authentication process would thwart any attempt to use + * someone else's TMSI. + * TODO: Otherwise we can ask for the IMSI and verify that it + * matches the IMSI on record. */ + vsub = vlr_subscr_find_or_create_by_tmsi(vlr, lfp->tmsi, NULL); + + if (!vsub) { + LOGPFSML(fi, LOGL_ERROR, "VLR subscriber allocation failed\n"); + lu_fsm_failure(fi, GSM48_REJECT_SRV_OPT_TMP_OUT_OF_ORDER); + return -1; + } + + vsub->sub_dataconf_by_hlr_ind = false; + if (assoc_lfp_with_sub(fi, vsub)) { + vlr_subscr_put(vsub); + return -1; /* error, fsm failure invoked in assoc_lfp_with_sub() */ + } + vlr_subscr_put(vsub); + } else { + /* IMSI was used */ + vsub = vlr_subscr_find_or_create_by_imsi(vlr, lfp->imsi, NULL); + + if (!vsub) { + LOGPFSML(fi, LOGL_ERROR, "VLR subscriber allocation failed\n"); + lu_fsm_failure(fi, GSM48_REJECT_SRV_OPT_TMP_OUT_OF_ORDER); + vlr_subscr_put(vsub); + return -1; + } + + vsub->sub_dataconf_by_hlr_ind = false; + if (assoc_lfp_with_sub(fi, vsub)) { + vlr_subscr_put(vsub); + return -1; /* error, fsm failure invoked in assoc_lfp_with_sub() */ + } + vlr_subscr_put(vsub); + } + return 0; +} + /* 4.1.2.1: Subscriber (via MSC/SGSN) requests location update */ static void _start_lu_main(struct osmo_fsm_inst *fi) { struct lu_fsm_priv *lfp = fi->priv; struct vlr_instance *vlr = lfp->vlr; - struct vlr_subscr *vsub = NULL; - bool created; /* TODO: PUESBINE related handling */ @@ -919,61 +968,13 @@ lai_name(&lfp->old_lai)); } - if (!lfp->imsi[0]) { - /* TMSI was used */ - lfp->lu_by_tmsi = true; - /* TMSI clash: if a different subscriber already has this TMSI, - * we will find that other subscriber in the VLR. So the IMSIs - * would mismatch, but we don't know about it. Theoretically, - * an authentication process would thwart any attempt to use - * someone else's TMSI. - * TODO: Otherwise we can ask for the IMSI and verify that it - * matches the IMSI on record. */ - vsub = vlr_subscr_find_or_create_by_tmsi(vlr, lfp->tmsi, - &created); - - if (!vsub) { - LOGPFSML(fi, LOGL_ERROR, - "VLR subscriber allocation failed\n"); - lu_fsm_failure(fi, GSM48_REJECT_SRV_OPT_TMP_OUT_OF_ORDER); - return; - } - - vsub->sub_dataconf_by_hlr_ind = false; - if (assoc_lfp_with_sub(fi, vsub)) { - vlr_subscr_put(vsub); - return; /* error */ - } - - if (created) - vlr_loc_upd_want_imsi(fi); - else - vlr_loc_upd_node1(fi); - /* We cannot have MSC area change, as the VLR - * serves only one MSC */ - vlr_subscr_put(vsub); - } else { - /* IMSI was used */ - vsub = vlr_subscr_find_or_create_by_imsi(vlr, lfp->imsi, NULL); - - if (!vsub) { - LOGPFSML(fi, LOGL_ERROR, - "VLR subscriber allocation failed\n"); - lu_fsm_failure(fi, GSM48_REJECT_SRV_OPT_TMP_OUT_OF_ORDER); - vlr_subscr_put(vsub); - return; - } - - vsub->sub_dataconf_by_hlr_ind = false; - if (assoc_lfp_with_sub(fi, vsub)) { - vlr_subscr_put(vsub); - return; /* error */ - } + /* If this is a TMSI based LU, we may not have the IMSI. Make sure that + * we know the IMSI, either on record, or request it. */ + if (!lfp->vsub->imsi[0]) + vlr_loc_upd_want_imsi(fi); + else vlr_loc_upd_node1(fi); - vlr_subscr_put(vsub); - } } - static void lu_fsm_idle(struct osmo_fsm_inst *fi, uint32_t event, void *data) @@ -983,8 +984,14 @@ OSMO_ASSERT(event == VLR_ULA_E_UPDATE_LA); - if (1) { // FIXME - //if (lfp->type == VLR_LU_TYPE_PERIODIC && lfp->vsub->imeisv[0]) + if (_lu_fsm_associate_vsub(fi)) + return; /* error. FSM already terminated. */ + + OSMO_ASSERT(lfp->vsub); + + /* See 3GPP TS 23.012, procedure Retrieve_IMEISV_If_Required */ + if ((!vlr->cfg.retrieve_imeisv_early) + || (lfp->type == VLR_LU_TYPE_PERIODIC && lfp->vsub->imeisv[0])) { /* R_IMEISV_IR1 passed */ _start_lu_main(fi); } else { @@ -999,7 +1006,8 @@ { switch (event) { case VLR_ULA_E_ID_IMEISV: - /* FIXME: copy IMEISV */ + /* IMEISV was copied in vlr_subscr_rx_id_resp(), and that's + * where we received this event from. */ _start_lu_main(fi); break; default: @@ -1257,6 +1265,8 @@ .in_event_mask = S(VLR_ULA_E_ID_IMEISV), .out_state_mask = S(VLR_ULA_S_WAIT_PVLR) | S(VLR_ULA_S_WAIT_IMSI) | + S(VLR_ULA_S_WAIT_AUTH) | + S(VLR_ULA_S_WAIT_HLR_UPD) | S(VLR_ULA_S_DONE), .name = OSMO_STRINGIFY(VLR_ULA_S_WAIT_IMEISV), .action = lu_fsm_wait_imeisv, diff --git a/tests/msc_vlr/msc_vlr_test_gsm_authen.err b/tests/msc_vlr/msc_vlr_test_gsm_authen.err index 8f93435..09ff4ae 100644 --- a/tests/msc_vlr/msc_vlr_test_gsm_authen.err +++ b/tests/msc_vlr/msc_vlr_test_gsm_authen.err @@ -18,6 +18,7 @@ DVLR set IMSI on subscriber; IMSI=901700000004620 id=901700000004620 DVLR New subscr, IMSI: 901700000004620 DREF VLR subscr IMSI:901700000004620 usage increases to: 2 +DREF VLR subscr IMSI:901700000004620 usage decreases to: 1 DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_IDLE}: vlr_loc_upd_node1() DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_IDLE}: state_chg to VLR_ULA_S_WAIT_AUTH DVLR VLR_Authenticate(901700000004620){VLR_SUB_AS_NEEDS_AUTH}: Allocated @@ -26,7 +27,6 @@ DVLR GSUP tx: 08010809710000004026f0 GSUP --> HLR: OSMO_GSUP_MSGT_SEND_AUTH_INFO_REQUEST: 08010809710000004026f0 DVLR VLR_Authenticate(901700000004620){VLR_SUB_AS_NEEDS_AUTH}: state_chg to VLR_SUB_AS_NEEDS_AUTH_WAIT_AI -DREF VLR subscr IMSI:901700000004620 usage decreases to: 1 DMM compl_l3: Keeping conn DREF IMSI:901700000004620: MSC conn use - 1 == 1 lu_result_sent == 0 @@ -446,6 +446,7 @@ DVLR set IMSI on subscriber; IMSI=901700000004620 id=901700000004620 DVLR New subscr, IMSI: 901700000004620 DREF VLR subscr IMSI:901700000004620 usage increases to: 2 +DREF VLR subscr IMSI:901700000004620 usage decreases to: 1 DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_IDLE}: vlr_loc_upd_node1() DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_IDLE}: state_chg to VLR_ULA_S_WAIT_AUTH DVLR VLR_Authenticate(901700000004620){VLR_SUB_AS_NEEDS_AUTH}: Allocated @@ -454,7 +455,6 @@ DVLR GSUP tx: 08010809710000004026f0 GSUP --> HLR: OSMO_GSUP_MSGT_SEND_AUTH_INFO_REQUEST: 08010809710000004026f0 DVLR VLR_Authenticate(901700000004620){VLR_SUB_AS_NEEDS_AUTH}: state_chg to VLR_SUB_AS_NEEDS_AUTH_WAIT_AI -DREF VLR subscr IMSI:901700000004620 usage decreases to: 1 DMM compl_l3: Keeping conn DREF IMSI:901700000004620: MSC conn use - 1 == 1 lu_result_sent == 0 @@ -887,6 +887,7 @@ DVLR vlr_lu_fsm(50462976){VLR_ULA_S_IDLE}: Received Event VLR_ULA_E_UPDATE_LA DREF VLR subscr MSISDN:46071 usage increases to: 2 DREF VLR subscr MSISDN:46071 usage increases to: 3 +DREF VLR subscr MSISDN:46071 usage decreases to: 2 DVLR vlr_lu_fsm(50462976){VLR_ULA_S_IDLE}: vlr_loc_upd_node1() DVLR vlr_lu_fsm(50462976){VLR_ULA_S_IDLE}: state_chg to VLR_ULA_S_WAIT_AUTH DVLR VLR_Authenticate(50462976){VLR_SUB_AS_NEEDS_AUTH}: Allocated @@ -897,7 +898,6 @@ - sending GSM Auth Request for MSISDN:46071: tuple use_count=1 key_seq=3 auth_types=0x1 and... - ...rand=fa8f20b781b5881329d4fea26b1a3c51 - ...expecting sres=5afc8d72 -DREF VLR subscr MSISDN:46071 usage decreases to: 2 DMM compl_l3: Keeping conn DREF MSISDN:46071: MSC conn use - 1 == 1 auth_request_sent == 1 @@ -1073,6 +1073,7 @@ DVLR set IMSI on subscriber; IMSI=901700000004620 id=901700000004620 DVLR New subscr, IMSI: 901700000004620 DREF VLR subscr IMSI:901700000004620 usage increases to: 2 +DREF VLR subscr IMSI:901700000004620 usage decreases to: 1 DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_IDLE}: vlr_loc_upd_node1() DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_IDLE}: state_chg to VLR_ULA_S_WAIT_AUTH DVLR VLR_Authenticate(901700000004620){VLR_SUB_AS_NEEDS_AUTH}: Allocated @@ -1081,7 +1082,6 @@ DVLR GSUP tx: 08010809710000004026f0 GSUP --> HLR: OSMO_GSUP_MSGT_SEND_AUTH_INFO_REQUEST: 08010809710000004026f0 DVLR VLR_Authenticate(901700000004620){VLR_SUB_AS_NEEDS_AUTH}: state_chg to VLR_SUB_AS_NEEDS_AUTH_WAIT_AI -DREF VLR subscr IMSI:901700000004620 usage decreases to: 1 DMM compl_l3: Keeping conn DREF IMSI:901700000004620: MSC conn use - 1 == 1 lu_result_sent == 0 @@ -1286,6 +1286,7 @@ DVLR set IMSI on subscriber; IMSI=901700000004620 id=901700000004620 DVLR New subscr, IMSI: 901700000004620 DREF VLR subscr IMSI:901700000004620 usage increases to: 2 +DREF VLR subscr IMSI:901700000004620 usage decreases to: 1 DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_IDLE}: vlr_loc_upd_node1() DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_IDLE}: state_chg to VLR_ULA_S_WAIT_AUTH DVLR VLR_Authenticate(901700000004620){VLR_SUB_AS_NEEDS_AUTH}: Allocated @@ -1294,7 +1295,6 @@ DVLR GSUP tx: 08010809710000004026f0 GSUP --> HLR: OSMO_GSUP_MSGT_SEND_AUTH_INFO_REQUEST: 08010809710000004026f0 DVLR VLR_Authenticate(901700000004620){VLR_SUB_AS_NEEDS_AUTH}: state_chg to VLR_SUB_AS_NEEDS_AUTH_WAIT_AI -DREF VLR subscr IMSI:901700000004620 usage decreases to: 1 DMM compl_l3: Keeping conn DREF IMSI:901700000004620: MSC conn use - 1 == 1 lu_result_sent == 0 @@ -1529,6 +1529,7 @@ DVLR set IMSI on subscriber; IMSI=901700000010650 id=901700000010650 DVLR New subscr, IMSI: 901700000010650 DREF VLR subscr IMSI:901700000010650 usage increases to: 2 +DREF VLR subscr IMSI:901700000010650 usage decreases to: 1 DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_IDLE}: vlr_loc_upd_node1() DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_IDLE}: state_chg to VLR_ULA_S_WAIT_AUTH DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_NEEDS_AUTH}: Allocated @@ -1537,7 +1538,6 @@ DVLR GSUP tx: 08010809710000000156f0 GSUP --> HLR: OSMO_GSUP_MSGT_SEND_AUTH_INFO_REQUEST: 08010809710000000156f0 DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_NEEDS_AUTH}: state_chg to VLR_SUB_AS_NEEDS_AUTH_WAIT_AI -DREF VLR subscr IMSI:901700000010650 usage decreases to: 1 DMM compl_l3: Keeping conn DREF IMSI:901700000010650: MSC conn use - 1 == 1 lu_result_sent == 0 diff --git a/tests/msc_vlr/msc_vlr_test_gsm_ciph.c b/tests/msc_vlr/msc_vlr_test_gsm_ciph.c index 1ebf9c6..589f7da 100644 --- a/tests/msc_vlr/msc_vlr_test_gsm_ciph.c +++ b/tests/msc_vlr/msc_vlr_test_gsm_ciph.c @@ -565,7 +565,7 @@ /* implicit: net->authentication_required = true; */ net->a5_encryption = VLR_CIPH_A5_1; - net->vlr->cfg.retrieve_imeisv = true; + net->vlr->cfg.retrieve_imeisv_ciphered = true; btw("Location Update request causes a GSUP Send Auth Info request to HLR"); lu_result_sent = RES_NONE; diff --git a/tests/msc_vlr/msc_vlr_test_gsm_ciph.err b/tests/msc_vlr/msc_vlr_test_gsm_ciph.err index 4543ace..f43d6f1 100644 --- a/tests/msc_vlr/msc_vlr_test_gsm_ciph.err +++ b/tests/msc_vlr/msc_vlr_test_gsm_ciph.err @@ -18,6 +18,7 @@ DVLR set IMSI on subscriber; IMSI=901700000004620 id=901700000004620 DVLR New subscr, IMSI: 901700000004620 DREF VLR subscr IMSI:901700000004620 usage increases to: 2 +DREF VLR subscr IMSI:901700000004620 usage decreases to: 1 DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_IDLE}: vlr_loc_upd_node1() DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_IDLE}: state_chg to VLR_ULA_S_WAIT_AUTH DVLR VLR_Authenticate(901700000004620){VLR_SUB_AS_NEEDS_AUTH}: Allocated @@ -26,7 +27,6 @@ DVLR GSUP tx: 08010809710000004026f0 GSUP --> HLR: OSMO_GSUP_MSGT_SEND_AUTH_INFO_REQUEST: 08010809710000004026f0 DVLR VLR_Authenticate(901700000004620){VLR_SUB_AS_NEEDS_AUTH}: state_chg to VLR_SUB_AS_NEEDS_AUTH_WAIT_AI -DREF VLR subscr IMSI:901700000004620 usage decreases to: 1 DMM compl_l3: Keeping conn DREF IMSI:901700000004620: MSC conn use - 1 == 1 lu_result_sent == 0 @@ -480,6 +480,7 @@ DVLR set IMSI on subscriber; IMSI=901700000004620 id=901700000004620 DVLR New subscr, IMSI: 901700000004620 DREF VLR subscr IMSI:901700000004620 usage increases to: 2 +DREF VLR subscr IMSI:901700000004620 usage decreases to: 1 DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_IDLE}: vlr_loc_upd_node1() DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_IDLE}: state_chg to VLR_ULA_S_WAIT_AUTH DVLR VLR_Authenticate(901700000004620){VLR_SUB_AS_NEEDS_AUTH}: Allocated @@ -488,7 +489,6 @@ DVLR GSUP tx: 08010809710000004026f0 GSUP --> HLR: OSMO_GSUP_MSGT_SEND_AUTH_INFO_REQUEST: 08010809710000004026f0 DVLR VLR_Authenticate(901700000004620){VLR_SUB_AS_NEEDS_AUTH}: state_chg to VLR_SUB_AS_NEEDS_AUTH_WAIT_AI -DREF VLR subscr IMSI:901700000004620 usage decreases to: 1 DMM compl_l3: Keeping conn DREF IMSI:901700000004620: MSC conn use - 1 == 1 lu_result_sent == 0 @@ -979,6 +979,7 @@ DVLR set IMSI on subscriber; IMSI=901700000004620 id=901700000004620 DVLR New subscr, IMSI: 901700000004620 DREF VLR subscr IMSI:901700000004620 usage increases to: 2 +DREF VLR subscr IMSI:901700000004620 usage decreases to: 1 DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_IDLE}: vlr_loc_upd_node1() DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_IDLE}: state_chg to VLR_ULA_S_WAIT_AUTH DVLR VLR_Authenticate(901700000004620){VLR_SUB_AS_NEEDS_AUTH}: Allocated @@ -987,7 +988,6 @@ DVLR GSUP tx: 08010809710000004026f0 GSUP --> HLR: OSMO_GSUP_MSGT_SEND_AUTH_INFO_REQUEST: 08010809710000004026f0 DVLR VLR_Authenticate(901700000004620){VLR_SUB_AS_NEEDS_AUTH}: state_chg to VLR_SUB_AS_NEEDS_AUTH_WAIT_AI -DREF VLR subscr IMSI:901700000004620 usage decreases to: 1 DMM compl_l3: Keeping conn DREF IMSI:901700000004620: MSC conn use - 1 == 1 lu_result_sent == 0 @@ -1192,6 +1192,7 @@ DVLR set IMSI on subscriber; IMSI=901700000004620 id=901700000004620 DVLR New subscr, IMSI: 901700000004620 DREF VLR subscr IMSI:901700000004620 usage increases to: 2 +DREF VLR subscr IMSI:901700000004620 usage decreases to: 1 DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_IDLE}: vlr_loc_upd_node1() DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_IDLE}: state_chg to VLR_ULA_S_WAIT_AUTH DVLR VLR_Authenticate(901700000004620){VLR_SUB_AS_NEEDS_AUTH}: Allocated @@ -1200,7 +1201,6 @@ DVLR GSUP tx: 08010809710000004026f0 GSUP --> HLR: OSMO_GSUP_MSGT_SEND_AUTH_INFO_REQUEST: 08010809710000004026f0 DVLR VLR_Authenticate(901700000004620){VLR_SUB_AS_NEEDS_AUTH}: state_chg to VLR_SUB_AS_NEEDS_AUTH_WAIT_AI -DREF VLR subscr IMSI:901700000004620 usage decreases to: 1 DMM compl_l3: Keeping conn DREF IMSI:901700000004620: MSC conn use - 1 == 1 lu_result_sent == 0 @@ -1404,6 +1404,7 @@ DVLR set IMSI on subscriber; IMSI=901700000004620 id=901700000004620 DVLR New subscr, IMSI: 901700000004620 DREF VLR subscr IMSI:901700000004620 usage increases to: 2 +DREF VLR subscr IMSI:901700000004620 usage decreases to: 1 DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_IDLE}: vlr_loc_upd_node1() DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_IDLE}: state_chg to VLR_ULA_S_WAIT_AUTH DVLR VLR_Authenticate(901700000004620){VLR_SUB_AS_NEEDS_AUTH}: Allocated @@ -1412,7 +1413,6 @@ DVLR GSUP tx: 08010809710000004026f0 GSUP --> HLR: OSMO_GSUP_MSGT_SEND_AUTH_INFO_REQUEST: 08010809710000004026f0 DVLR VLR_Authenticate(901700000004620){VLR_SUB_AS_NEEDS_AUTH}: state_chg to VLR_SUB_AS_NEEDS_AUTH_WAIT_AI -DREF VLR subscr IMSI:901700000004620 usage decreases to: 1 DMM compl_l3: Keeping conn DREF IMSI:901700000004620: MSC conn use - 1 == 1 lu_result_sent == 0 diff --git a/tests/msc_vlr/msc_vlr_test_hlr_reject.err b/tests/msc_vlr/msc_vlr_test_hlr_reject.err index b72ceff..2a06d08 100644 --- a/tests/msc_vlr/msc_vlr_test_hlr_reject.err +++ b/tests/msc_vlr/msc_vlr_test_hlr_reject.err @@ -18,6 +18,7 @@ DVLR set IMSI on subscriber; IMSI=901700000004620 id=901700000004620 DVLR New subscr, IMSI: 901700000004620 DREF VLR subscr IMSI:901700000004620 usage increases to: 2 +DREF VLR subscr IMSI:901700000004620 usage decreases to: 1 DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_IDLE}: vlr_loc_upd_node1() DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_IDLE}: state_chg to VLR_ULA_S_WAIT_AUTH DVLR VLR_Authenticate(901700000004620){VLR_SUB_AS_NEEDS_AUTH}: Allocated @@ -26,7 +27,6 @@ DVLR GSUP tx: 08010809710000004026f0 GSUP --> HLR: OSMO_GSUP_MSGT_SEND_AUTH_INFO_REQUEST: 08010809710000004026f0 DVLR VLR_Authenticate(901700000004620){VLR_SUB_AS_NEEDS_AUTH}: state_chg to VLR_SUB_AS_NEEDS_AUTH_WAIT_AI -DREF VLR subscr IMSI:901700000004620 usage decreases to: 1 DMM compl_l3: Keeping conn DREF IMSI:901700000004620: MSC conn use - 1 == 1 lu_result_sent == 0 @@ -91,6 +91,7 @@ DVLR set IMSI on subscriber; IMSI=901700000004620 id=901700000004620 DVLR New subscr, IMSI: 901700000004620 DREF VLR subscr IMSI:901700000004620 usage increases to: 2 +DREF VLR subscr IMSI:901700000004620 usage decreases to: 1 DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_IDLE}: vlr_loc_upd_node1() DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_IDLE}: state_chg to VLR_ULA_S_WAIT_AUTH DVLR VLR_Authenticate(901700000004620){VLR_SUB_AS_NEEDS_AUTH}: Allocated @@ -99,7 +100,6 @@ DVLR GSUP tx: 08010809710000004026f0 GSUP --> HLR: OSMO_GSUP_MSGT_SEND_AUTH_INFO_REQUEST: 08010809710000004026f0 DVLR VLR_Authenticate(901700000004620){VLR_SUB_AS_NEEDS_AUTH}: state_chg to VLR_SUB_AS_NEEDS_AUTH_WAIT_AI -DREF VLR subscr IMSI:901700000004620 usage decreases to: 1 DMM compl_l3: Keeping conn DREF IMSI:901700000004620: MSC conn use - 1 == 1 lu_result_sent == 0 @@ -166,6 +166,7 @@ DVLR set IMSI on subscriber; IMSI=901700000004620 id=901700000004620 DVLR New subscr, IMSI: 901700000004620 DREF VLR subscr IMSI:901700000004620 usage increases to: 2 +DREF VLR subscr IMSI:901700000004620 usage decreases to: 1 DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_IDLE}: vlr_loc_upd_node1() DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_IDLE}: state_chg to VLR_ULA_S_WAIT_AUTH DVLR VLR_Authenticate(901700000004620){VLR_SUB_AS_NEEDS_AUTH}: Allocated @@ -174,7 +175,6 @@ DVLR GSUP tx: 08010809710000004026f0 GSUP --> HLR: OSMO_GSUP_MSGT_SEND_AUTH_INFO_REQUEST: 08010809710000004026f0 DVLR VLR_Authenticate(901700000004620){VLR_SUB_AS_NEEDS_AUTH}: state_chg to VLR_SUB_AS_NEEDS_AUTH_WAIT_AI -DREF VLR subscr IMSI:901700000004620 usage decreases to: 1 DMM compl_l3: Keeping conn DREF IMSI:901700000004620: MSC conn use - 1 == 1 lu_result_sent == 0 @@ -311,6 +311,7 @@ DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_IDLE}: Received Event VLR_ULA_E_UPDATE_LA DREF VLR subscr MSISDN:46071 usage increases to: 2 DREF VLR subscr MSISDN:46071 usage increases to: 3 +DREF VLR subscr MSISDN:46071 usage decreases to: 2 DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_IDLE}: vlr_loc_upd_node1() DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_IDLE}: state_chg to VLR_ULA_S_WAIT_AUTH DVLR VLR_Authenticate(901700000004620){VLR_SUB_AS_NEEDS_AUTH}: Allocated @@ -319,7 +320,6 @@ DVLR GSUP tx: 08010809710000004026f0 GSUP --> HLR: OSMO_GSUP_MSGT_SEND_AUTH_INFO_REQUEST: 08010809710000004026f0 DVLR VLR_Authenticate(901700000004620){VLR_SUB_AS_NEEDS_AUTH}: state_chg to VLR_SUB_AS_NEEDS_AUTH_WAIT_AI -DREF VLR subscr MSISDN:46071 usage decreases to: 2 DMM compl_l3: Keeping conn DREF MSISDN:46071: MSC conn use - 1 == 1 lu_result_sent == 0 @@ -459,6 +459,7 @@ DVLR set IMSI on subscriber; IMSI=901700000004620 id=901700000004620 DVLR New subscr, IMSI: 901700000004620 DREF VLR subscr IMSI:901700000004620 usage increases to: 2 +DREF VLR subscr IMSI:901700000004620 usage decreases to: 1 DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_IDLE}: vlr_loc_upd_node1() DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_IDLE}: state_chg to VLR_ULA_S_WAIT_AUTH DVLR VLR_Authenticate(901700000004620){VLR_SUB_AS_NEEDS_AUTH}: Allocated @@ -467,7 +468,6 @@ DVLR GSUP tx: 08010809710000004026f0 GSUP --> HLR: OSMO_GSUP_MSGT_SEND_AUTH_INFO_REQUEST: 08010809710000004026f0 DVLR VLR_Authenticate(901700000004620){VLR_SUB_AS_NEEDS_AUTH}: state_chg to VLR_SUB_AS_NEEDS_AUTH_WAIT_AI -DREF VLR subscr IMSI:901700000004620 usage decreases to: 1 DMM compl_l3: Keeping conn DREF IMSI:901700000004620: MSC conn use - 1 == 1 lu_result_sent == 0 @@ -604,6 +604,7 @@ DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_IDLE}: Received Event VLR_ULA_E_UPDATE_LA DREF VLR subscr MSISDN:46071 usage increases to: 2 DREF VLR subscr MSISDN:46071 usage increases to: 3 +DREF VLR subscr MSISDN:46071 usage decreases to: 2 DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_IDLE}: vlr_loc_upd_node1() DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_IDLE}: state_chg to VLR_ULA_S_WAIT_AUTH DVLR VLR_Authenticate(901700000004620){VLR_SUB_AS_NEEDS_AUTH}: Allocated @@ -612,7 +613,6 @@ DVLR GSUP tx: 08010809710000004026f0 GSUP --> HLR: OSMO_GSUP_MSGT_SEND_AUTH_INFO_REQUEST: 08010809710000004026f0 DVLR VLR_Authenticate(901700000004620){VLR_SUB_AS_NEEDS_AUTH}: state_chg to VLR_SUB_AS_NEEDS_AUTH_WAIT_AI -DREF VLR subscr MSISDN:46071 usage decreases to: 2 DMM compl_l3: Keeping conn DREF MSISDN:46071: MSC conn use - 1 == 1 lu_result_sent == 0 @@ -679,6 +679,7 @@ DVLR set IMSI on subscriber; IMSI=901700000004620 id=901700000004620 DVLR New subscr, IMSI: 901700000004620 DREF VLR subscr IMSI:901700000004620 usage increases to: 2 +DREF VLR subscr IMSI:901700000004620 usage decreases to: 1 DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_IDLE}: vlr_loc_upd_node1() DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_IDLE}: state_chg to VLR_ULA_S_WAIT_AUTH DVLR VLR_Authenticate(901700000004620){VLR_SUB_AS_NEEDS_AUTH}: Allocated @@ -687,7 +688,6 @@ DVLR GSUP tx: 08010809710000004026f0 GSUP --> HLR: OSMO_GSUP_MSGT_SEND_AUTH_INFO_REQUEST: 08010809710000004026f0 DVLR VLR_Authenticate(901700000004620){VLR_SUB_AS_NEEDS_AUTH}: state_chg to VLR_SUB_AS_NEEDS_AUTH_WAIT_AI -DREF VLR subscr IMSI:901700000004620 usage decreases to: 1 DMM compl_l3: Keeping conn DREF IMSI:901700000004620: MSC conn use - 1 == 1 lu_result_sent == 0 @@ -825,6 +825,7 @@ DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_IDLE}: Received Event VLR_ULA_E_UPDATE_LA DREF VLR subscr MSISDN:46071 usage increases to: 2 DREF VLR subscr MSISDN:46071 usage increases to: 3 +DREF VLR subscr MSISDN:46071 usage decreases to: 2 DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_IDLE}: vlr_loc_upd_node1() DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_IDLE}: state_chg to VLR_ULA_S_WAIT_AUTH DVLR VLR_Authenticate(901700000004620){VLR_SUB_AS_NEEDS_AUTH}: Allocated @@ -833,7 +834,6 @@ DVLR GSUP tx: 08010809710000004026f0 GSUP --> HLR: OSMO_GSUP_MSGT_SEND_AUTH_INFO_REQUEST: 08010809710000004026f0 DVLR VLR_Authenticate(901700000004620){VLR_SUB_AS_NEEDS_AUTH}: state_chg to VLR_SUB_AS_NEEDS_AUTH_WAIT_AI -DREF VLR subscr MSISDN:46071 usage decreases to: 2 DMM compl_l3: Keeping conn DREF MSISDN:46071: MSC conn use - 1 == 1 lu_result_sent == 0 @@ -898,6 +898,7 @@ DVLR set IMSI on subscriber; IMSI=901700000004620 id=901700000004620 DVLR New subscr, IMSI: 901700000004620 DREF VLR subscr IMSI:901700000004620 usage increases to: 2 +DREF VLR subscr IMSI:901700000004620 usage decreases to: 1 DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_IDLE}: vlr_loc_upd_node1() DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_IDLE}: state_chg to VLR_ULA_S_WAIT_AUTH DVLR VLR_Authenticate(901700000004620){VLR_SUB_AS_NEEDS_AUTH}: Allocated @@ -906,7 +907,6 @@ DVLR GSUP tx: 08010809710000004026f0 GSUP --> HLR: OSMO_GSUP_MSGT_SEND_AUTH_INFO_REQUEST: 08010809710000004026f0 DVLR VLR_Authenticate(901700000004620){VLR_SUB_AS_NEEDS_AUTH}: state_chg to VLR_SUB_AS_NEEDS_AUTH_WAIT_AI -DREF VLR subscr IMSI:901700000004620 usage decreases to: 1 DMM compl_l3: Keeping conn DREF IMSI:901700000004620: MSC conn use - 1 == 1 lu_result_sent == 0 @@ -970,6 +970,7 @@ DVLR set IMSI on subscriber; IMSI=901700000004620 id=901700000004620 DVLR New subscr, IMSI: 901700000004620 DREF VLR subscr IMSI:901700000004620 usage increases to: 2 +DREF VLR subscr IMSI:901700000004620 usage decreases to: 1 DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_IDLE}: vlr_loc_upd_node1() DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_IDLE}: vlr_loc_upd_post_auth() DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_IDLE}: vlr_loc_upd_post_ciph() @@ -981,7 +982,6 @@ DVLR GSUP tx: 04010809710000004026f0 GSUP --> HLR: OSMO_GSUP_MSGT_UPDATE_LOCATION_REQUEST: 04010809710000004026f0 DVLR upd_hlr_vlr_fsm(901700000004620){UPD_HLR_VLR_S_INIT}: state_chg to UPD_HLR_VLR_S_WAIT_FOR_DATA -DREF VLR subscr IMSI:901700000004620 usage decreases to: 1 DMM compl_l3: Keeping conn DREF IMSI:901700000004620: MSC conn use - 1 == 1 lu_result_sent == 0 @@ -1045,6 +1045,7 @@ DVLR set IMSI on subscriber; IMSI=901700000004620 id=901700000004620 DVLR New subscr, IMSI: 901700000004620 DREF VLR subscr IMSI:901700000004620 usage increases to: 2 +DREF VLR subscr IMSI:901700000004620 usage decreases to: 1 DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_IDLE}: vlr_loc_upd_node1() DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_IDLE}: vlr_loc_upd_post_auth() DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_IDLE}: vlr_loc_upd_post_ciph() @@ -1056,7 +1057,6 @@ DVLR GSUP tx: 04010809710000004026f0 GSUP --> HLR: OSMO_GSUP_MSGT_UPDATE_LOCATION_REQUEST: 04010809710000004026f0 DVLR upd_hlr_vlr_fsm(901700000004620){UPD_HLR_VLR_S_INIT}: state_chg to UPD_HLR_VLR_S_WAIT_FOR_DATA -DREF VLR subscr IMSI:901700000004620 usage decreases to: 1 DMM compl_l3: Keeping conn DREF IMSI:901700000004620: MSC conn use - 1 == 1 lu_result_sent == 0 diff --git a/tests/msc_vlr/msc_vlr_test_hlr_timeout.err b/tests/msc_vlr/msc_vlr_test_hlr_timeout.err index 1d2541d..c1bd9ac 100644 --- a/tests/msc_vlr/msc_vlr_test_hlr_timeout.err +++ b/tests/msc_vlr/msc_vlr_test_hlr_timeout.err @@ -19,6 +19,7 @@ DVLR set IMSI on subscriber; IMSI=901700000004620 id=901700000004620 DVLR New subscr, IMSI: 901700000004620 DREF VLR subscr IMSI:901700000004620 usage increases to: 2 +DREF VLR subscr IMSI:901700000004620 usage decreases to: 1 DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_IDLE}: vlr_loc_upd_node1() DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_IDLE}: state_chg to VLR_ULA_S_WAIT_AUTH DVLR VLR_Authenticate(901700000004620){VLR_SUB_AS_NEEDS_AUTH}: Allocated @@ -27,7 +28,6 @@ DVLR GSUP tx: 08010809710000004026f0 GSUP --> HLR: OSMO_GSUP_MSGT_SEND_AUTH_INFO_REQUEST: 08010809710000004026f0 DVLR VLR_Authenticate(901700000004620){VLR_SUB_AS_NEEDS_AUTH}: state_chg to VLR_SUB_AS_NEEDS_AUTH_WAIT_AI -DREF VLR subscr IMSI:901700000004620 usage decreases to: 1 DMM compl_l3: Keeping conn DREF IMSI:901700000004620: MSC conn use - 1 == 1 lu_result_sent == 0 @@ -100,6 +100,7 @@ DVLR set IMSI on subscriber; IMSI=901700000004620 id=901700000004620 DVLR New subscr, IMSI: 901700000004620 DREF VLR subscr IMSI:901700000004620 usage increases to: 2 +DREF VLR subscr IMSI:901700000004620 usage decreases to: 1 DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_IDLE}: vlr_loc_upd_node1() DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_IDLE}: vlr_loc_upd_post_auth() DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_IDLE}: vlr_loc_upd_post_ciph() @@ -111,7 +112,6 @@ DVLR GSUP tx: 04010809710000004026f0 GSUP --> HLR: OSMO_GSUP_MSGT_UPDATE_LOCATION_REQUEST: 04010809710000004026f0 DVLR upd_hlr_vlr_fsm(901700000004620){UPD_HLR_VLR_S_INIT}: state_chg to UPD_HLR_VLR_S_WAIT_FOR_DATA -DREF VLR subscr IMSI:901700000004620 usage decreases to: 1 DMM compl_l3: Keeping conn DREF IMSI:901700000004620: MSC conn use - 1 == 1 lu_result_sent == 0 diff --git a/tests/msc_vlr/msc_vlr_test_ms_timeout.err b/tests/msc_vlr/msc_vlr_test_ms_timeout.err index beee070..841aa9a 100644 --- a/tests/msc_vlr/msc_vlr_test_ms_timeout.err +++ b/tests/msc_vlr/msc_vlr_test_ms_timeout.err @@ -19,6 +19,7 @@ DVLR set IMSI on subscriber; IMSI=901700000004620 id=901700000004620 DVLR New subscr, IMSI: 901700000004620 DREF VLR subscr IMSI:901700000004620 usage increases to: 2 +DREF VLR subscr IMSI:901700000004620 usage decreases to: 1 DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_IDLE}: vlr_loc_upd_node1() DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_IDLE}: state_chg to VLR_ULA_S_WAIT_AUTH DVLR VLR_Authenticate(901700000004620){VLR_SUB_AS_NEEDS_AUTH}: Allocated @@ -27,7 +28,6 @@ DVLR GSUP tx: 08010809710000004026f0 GSUP --> HLR: OSMO_GSUP_MSGT_SEND_AUTH_INFO_REQUEST: 08010809710000004026f0 DVLR VLR_Authenticate(901700000004620){VLR_SUB_AS_NEEDS_AUTH}: state_chg to VLR_SUB_AS_NEEDS_AUTH_WAIT_AI -DREF VLR subscr IMSI:901700000004620 usage decreases to: 1 DMM compl_l3: Keeping conn DREF IMSI:901700000004620: MSC conn use - 1 == 1 lu_result_sent == 0 @@ -120,6 +120,7 @@ DVLR set IMSI on subscriber; IMSI=901700000004620 id=901700000004620 DVLR New subscr, IMSI: 901700000004620 DREF VLR subscr IMSI:901700000004620 usage increases to: 2 +DREF VLR subscr IMSI:901700000004620 usage decreases to: 1 DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_IDLE}: vlr_loc_upd_node1() DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_IDLE}: state_chg to VLR_ULA_S_WAIT_AUTH DVLR VLR_Authenticate(901700000004620){VLR_SUB_AS_NEEDS_AUTH}: Allocated @@ -128,7 +129,6 @@ DVLR GSUP tx: 08010809710000004026f0 GSUP --> HLR: OSMO_GSUP_MSGT_SEND_AUTH_INFO_REQUEST: 08010809710000004026f0 DVLR VLR_Authenticate(901700000004620){VLR_SUB_AS_NEEDS_AUTH}: state_chg to VLR_SUB_AS_NEEDS_AUTH_WAIT_AI -DREF VLR subscr IMSI:901700000004620 usage decreases to: 1 DMM compl_l3: Keeping conn DREF IMSI:901700000004620: MSC conn use - 1 == 1 lu_result_sent == 0 diff --git a/tests/msc_vlr/msc_vlr_test_no_authen.err b/tests/msc_vlr/msc_vlr_test_no_authen.err index 12b6c69..651ac29 100644 --- a/tests/msc_vlr/msc_vlr_test_no_authen.err +++ b/tests/msc_vlr/msc_vlr_test_no_authen.err @@ -18,6 +18,7 @@ DVLR set IMSI on subscriber; IMSI=901700000004620 id=901700000004620 DVLR New subscr, IMSI: 901700000004620 DREF VLR subscr IMSI:901700000004620 usage increases to: 2 +DREF VLR subscr IMSI:901700000004620 usage decreases to: 1 DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_IDLE}: vlr_loc_upd_node1() DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_IDLE}: vlr_loc_upd_post_auth() DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_IDLE}: vlr_loc_upd_post_ciph() @@ -29,7 +30,6 @@ DVLR GSUP tx: 04010809710000004026f0 GSUP --> HLR: OSMO_GSUP_MSGT_UPDATE_LOCATION_REQUEST: 04010809710000004026f0 DVLR upd_hlr_vlr_fsm(901700000004620){UPD_HLR_VLR_S_INIT}: state_chg to UPD_HLR_VLR_S_WAIT_FOR_DATA -DREF VLR subscr IMSI:901700000004620 usage decreases to: 1 DMM compl_l3: Keeping conn DREF IMSI:901700000004620: MSC conn use - 1 == 1 lu_result_sent == 0 @@ -324,6 +324,7 @@ DVLR set IMSI on subscriber; IMSI=901700000004620 id=901700000004620 DVLR New subscr, IMSI: 901700000004620 DREF VLR subscr IMSI:901700000004620 usage increases to: 2 +DREF VLR subscr IMSI:901700000004620 usage decreases to: 1 DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_IDLE}: vlr_loc_upd_node1() DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_IDLE}: vlr_loc_upd_post_auth() DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_IDLE}: vlr_loc_upd_post_ciph() @@ -335,7 +336,6 @@ DVLR GSUP tx: 04010809710000004026f0 GSUP --> HLR: OSMO_GSUP_MSGT_UPDATE_LOCATION_REQUEST: 04010809710000004026f0 DVLR upd_hlr_vlr_fsm(901700000004620){UPD_HLR_VLR_S_INIT}: state_chg to UPD_HLR_VLR_S_WAIT_FOR_DATA -DREF VLR subscr IMSI:901700000004620 usage decreases to: 1 DMM compl_l3: Keeping conn DREF IMSI:901700000004620: MSC conn use - 1 == 1 lu_result_sent == 0 @@ -643,6 +643,7 @@ DVLR vlr_lu_fsm(50462976){VLR_ULA_S_IDLE}: Received Event VLR_ULA_E_UPDATE_LA DREF VLR subscr MSISDN:46071 usage increases to: 2 DREF VLR subscr MSISDN:46071 usage increases to: 3 +DREF VLR subscr MSISDN:46071 usage decreases to: 2 DVLR vlr_lu_fsm(50462976){VLR_ULA_S_IDLE}: vlr_loc_upd_node1() DVLR vlr_lu_fsm(50462976){VLR_ULA_S_IDLE}: vlr_loc_upd_post_auth() DVLR vlr_lu_fsm(50462976){VLR_ULA_S_IDLE}: vlr_loc_upd_post_ciph() @@ -654,7 +655,6 @@ DVLR GSUP tx: 04010809710000004026f0 GSUP --> HLR: OSMO_GSUP_MSGT_UPDATE_LOCATION_REQUEST: 04010809710000004026f0 DVLR upd_hlr_vlr_fsm(50462976){UPD_HLR_VLR_S_INIT}: state_chg to UPD_HLR_VLR_S_WAIT_FOR_DATA -DREF VLR subscr MSISDN:46071 usage decreases to: 2 DMM compl_l3: Keeping conn DREF MSISDN:46071: MSC conn use - 1 == 1 lu_result_sent == 0 @@ -814,6 +814,7 @@ DVLR set IMSI on subscriber; IMSI=901700000004620 id=901700000004620 DVLR New subscr, IMSI: 901700000004620 DREF VLR subscr IMSI:901700000004620 usage increases to: 2 +DREF VLR subscr IMSI:901700000004620 usage decreases to: 1 DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_IDLE}: vlr_loc_upd_node1() DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_IDLE}: vlr_loc_upd_post_auth() DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_IDLE}: vlr_loc_upd_post_ciph() @@ -825,7 +826,6 @@ DVLR GSUP tx: 04010809710000004026f0 GSUP --> HLR: OSMO_GSUP_MSGT_UPDATE_LOCATION_REQUEST: 04010809710000004026f0 DVLR upd_hlr_vlr_fsm(901700000004620){UPD_HLR_VLR_S_INIT}: state_chg to UPD_HLR_VLR_S_WAIT_FOR_DATA -DREF VLR subscr IMSI:901700000004620 usage decreases to: 1 DMM compl_l3: Keeping conn DREF IMSI:901700000004620: MSC conn use - 1 == 1 lu_result_sent == 0 @@ -981,6 +981,7 @@ DVLR set IMSI on subscriber; IMSI=901700000004620 id=901700000004620 DVLR New subscr, IMSI: 901700000004620 DREF VLR subscr IMSI:901700000004620 usage increases to: 2 +DREF VLR subscr IMSI:901700000004620 usage decreases to: 1 DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_IDLE}: vlr_loc_upd_node1() DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_IDLE}: vlr_loc_upd_post_auth() DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_IDLE}: vlr_loc_upd_post_ciph() @@ -992,7 +993,6 @@ DVLR GSUP tx: 04010809710000004026f0 GSUP --> HLR: OSMO_GSUP_MSGT_UPDATE_LOCATION_REQUEST: 04010809710000004026f0 DVLR upd_hlr_vlr_fsm(901700000004620){UPD_HLR_VLR_S_INIT}: state_chg to UPD_HLR_VLR_S_WAIT_FOR_DATA -DREF VLR subscr IMSI:901700000004620 usage decreases to: 1 DMM compl_l3: Keeping conn DREF IMSI:901700000004620: MSC conn use - 1 == 1 lu_result_sent == 0 diff --git a/tests/msc_vlr/msc_vlr_test_reject_concurrency.err b/tests/msc_vlr/msc_vlr_test_reject_concurrency.err index 874cf5f..c51d08a 100644 --- a/tests/msc_vlr/msc_vlr_test_reject_concurrency.err +++ b/tests/msc_vlr/msc_vlr_test_reject_concurrency.err @@ -18,6 +18,7 @@ DVLR set IMSI on subscriber; IMSI=901700000004620 id=901700000004620 DVLR New subscr, IMSI: 901700000004620 DREF VLR subscr IMSI:901700000004620 usage increases to: 2 +DREF VLR subscr IMSI:901700000004620 usage decreases to: 1 DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_IDLE}: vlr_loc_upd_node1() DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_IDLE}: vlr_loc_upd_post_auth() DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_IDLE}: vlr_loc_upd_post_ciph() @@ -29,7 +30,6 @@ DVLR GSUP tx: 04010809710000004026f0 GSUP --> HLR: OSMO_GSUP_MSGT_UPDATE_LOCATION_REQUEST: 04010809710000004026f0 DVLR upd_hlr_vlr_fsm(901700000004620){UPD_HLR_VLR_S_INIT}: state_chg to UPD_HLR_VLR_S_WAIT_FOR_DATA -DREF VLR subscr IMSI:901700000004620 usage decreases to: 1 DMM compl_l3: Keeping conn DREF IMSI:901700000004620: MSC conn use - 1 == 1 lu_result_sent == 0 @@ -168,6 +168,7 @@ DVLR set IMSI on subscriber; IMSI=901700000004620 id=901700000004620 DVLR New subscr, IMSI: 901700000004620 DREF VLR subscr IMSI:901700000004620 usage increases to: 2 +DREF VLR subscr IMSI:901700000004620 usage decreases to: 1 DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_IDLE}: vlr_loc_upd_node1() DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_IDLE}: vlr_loc_upd_post_auth() DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_IDLE}: vlr_loc_upd_post_ciph() @@ -179,7 +180,6 @@ DVLR GSUP tx: 04010809710000004026f0 GSUP --> HLR: OSMO_GSUP_MSGT_UPDATE_LOCATION_REQUEST: 04010809710000004026f0 DVLR upd_hlr_vlr_fsm(901700000004620){UPD_HLR_VLR_S_INIT}: state_chg to UPD_HLR_VLR_S_WAIT_FOR_DATA -DREF VLR subscr IMSI:901700000004620 usage decreases to: 1 DMM compl_l3: Keeping conn DREF IMSI:901700000004620: MSC conn use - 1 == 1 lu_result_sent == 0 @@ -288,6 +288,7 @@ DVLR set IMSI on subscriber; IMSI=901700000004620 id=901700000004620 DVLR New subscr, IMSI: 901700000004620 DREF VLR subscr IMSI:901700000004620 usage increases to: 2 +DREF VLR subscr IMSI:901700000004620 usage decreases to: 1 DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_IDLE}: vlr_loc_upd_node1() DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_IDLE}: vlr_loc_upd_post_auth() DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_IDLE}: vlr_loc_upd_post_ciph() @@ -299,7 +300,6 @@ DVLR GSUP tx: 04010809710000004026f0 GSUP --> HLR: OSMO_GSUP_MSGT_UPDATE_LOCATION_REQUEST: 04010809710000004026f0 DVLR upd_hlr_vlr_fsm(901700000004620){UPD_HLR_VLR_S_INIT}: state_chg to UPD_HLR_VLR_S_WAIT_FOR_DATA -DREF VLR subscr IMSI:901700000004620 usage decreases to: 1 DMM compl_l3: Keeping conn DREF IMSI:901700000004620: MSC conn use - 1 == 1 lu_result_sent == 0 @@ -413,6 +413,7 @@ DVLR set IMSI on subscriber; IMSI=901700000004620 id=901700000004620 DVLR New subscr, IMSI: 901700000004620 DREF VLR subscr IMSI:901700000004620 usage increases to: 2 +DREF VLR subscr IMSI:901700000004620 usage decreases to: 1 DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_IDLE}: vlr_loc_upd_node1() DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_IDLE}: vlr_loc_upd_post_auth() DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_IDLE}: vlr_loc_upd_post_ciph() @@ -424,7 +425,6 @@ DVLR GSUP tx: 04010809710000004026f0 GSUP --> HLR: OSMO_GSUP_MSGT_UPDATE_LOCATION_REQUEST: 04010809710000004026f0 DVLR upd_hlr_vlr_fsm(901700000004620){UPD_HLR_VLR_S_INIT}: state_chg to UPD_HLR_VLR_S_WAIT_FOR_DATA -DREF VLR subscr IMSI:901700000004620 usage decreases to: 1 DMM compl_l3: Keeping conn DREF IMSI:901700000004620: MSC conn use - 1 == 1 lu_result_sent == 0 @@ -536,6 +536,7 @@ DVLR set IMSI on subscriber; IMSI=901700000004620 id=901700000004620 DVLR New subscr, IMSI: 901700000004620 DREF VLR subscr IMSI:901700000004620 usage increases to: 2 +DREF VLR subscr IMSI:901700000004620 usage decreases to: 1 DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_IDLE}: vlr_loc_upd_node1() DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_IDLE}: vlr_loc_upd_post_auth() DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_IDLE}: vlr_loc_upd_post_ciph() @@ -547,7 +548,6 @@ DVLR GSUP tx: 04010809710000004026f0 GSUP --> HLR: OSMO_GSUP_MSGT_UPDATE_LOCATION_REQUEST: 04010809710000004026f0 DVLR upd_hlr_vlr_fsm(901700000004620){UPD_HLR_VLR_S_INIT}: state_chg to UPD_HLR_VLR_S_WAIT_FOR_DATA -DREF VLR subscr IMSI:901700000004620 usage decreases to: 1 DMM compl_l3: Keeping conn DREF IMSI:901700000004620: MSC conn use - 1 == 1 lu_result_sent == 0 @@ -721,6 +721,7 @@ DVLR set IMSI on subscriber; IMSI=901700000004620 id=901700000004620 DVLR New subscr, IMSI: 901700000004620 DREF VLR subscr IMSI:901700000004620 usage increases to: 2 +DREF VLR subscr IMSI:901700000004620 usage decreases to: 1 DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_IDLE}: vlr_loc_upd_node1() DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_IDLE}: vlr_loc_upd_post_auth() DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_IDLE}: vlr_loc_upd_post_ciph() @@ -732,7 +733,6 @@ DVLR GSUP tx: 04010809710000004026f0 GSUP --> HLR: OSMO_GSUP_MSGT_UPDATE_LOCATION_REQUEST: 04010809710000004026f0 DVLR upd_hlr_vlr_fsm(901700000004620){UPD_HLR_VLR_S_INIT}: state_chg to UPD_HLR_VLR_S_WAIT_FOR_DATA -DREF VLR subscr IMSI:901700000004620 usage decreases to: 1 DMM compl_l3: Keeping conn DREF IMSI:901700000004620: MSC conn use - 1 == 1 lu_result_sent == 0 @@ -908,6 +908,7 @@ DVLR set IMSI on subscriber; IMSI=901700000004620 id=901700000004620 DVLR New subscr, IMSI: 901700000004620 DREF VLR subscr IMSI:901700000004620 usage increases to: 2 +DREF VLR subscr IMSI:901700000004620 usage decreases to: 1 DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_IDLE}: vlr_loc_upd_node1() DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_IDLE}: vlr_loc_upd_post_auth() DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_IDLE}: vlr_loc_upd_post_ciph() @@ -919,7 +920,6 @@ DVLR GSUP tx: 04010809710000004026f0 GSUP --> HLR: OSMO_GSUP_MSGT_UPDATE_LOCATION_REQUEST: 04010809710000004026f0 DVLR upd_hlr_vlr_fsm(901700000004620){UPD_HLR_VLR_S_INIT}: state_chg to UPD_HLR_VLR_S_WAIT_FOR_DATA -DREF VLR subscr IMSI:901700000004620 usage decreases to: 1 DMM compl_l3: Keeping conn DREF IMSI:901700000004620: MSC conn use - 1 == 1 lu_result_sent == 0 @@ -1099,6 +1099,7 @@ DVLR set IMSI on subscriber; IMSI=901700000004620 id=901700000004620 DVLR New subscr, IMSI: 901700000004620 DREF VLR subscr IMSI:901700000004620 usage increases to: 2 +DREF VLR subscr IMSI:901700000004620 usage decreases to: 1 DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_IDLE}: vlr_loc_upd_node1() DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_IDLE}: vlr_loc_upd_post_auth() DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_IDLE}: vlr_loc_upd_post_ciph() @@ -1110,7 +1111,6 @@ DVLR GSUP tx: 04010809710000004026f0 GSUP --> HLR: OSMO_GSUP_MSGT_UPDATE_LOCATION_REQUEST: 04010809710000004026f0 DVLR upd_hlr_vlr_fsm(901700000004620){UPD_HLR_VLR_S_INIT}: state_chg to UPD_HLR_VLR_S_WAIT_FOR_DATA -DREF VLR subscr IMSI:901700000004620 usage decreases to: 1 DMM compl_l3: Keeping conn DREF IMSI:901700000004620: MSC conn use - 1 == 1 lu_result_sent == 0 @@ -1314,6 +1314,7 @@ DVLR set IMSI on subscriber; IMSI=901700000004620 id=901700000004620 DVLR New subscr, IMSI: 901700000004620 DREF VLR subscr IMSI:901700000004620 usage increases to: 2 +DREF VLR subscr IMSI:901700000004620 usage decreases to: 1 DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_IDLE}: vlr_loc_upd_node1() DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_IDLE}: vlr_loc_upd_post_auth() DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_IDLE}: vlr_loc_upd_post_ciph() @@ -1325,7 +1326,6 @@ DVLR GSUP tx: 04010809710000004026f0 GSUP --> HLR: OSMO_GSUP_MSGT_UPDATE_LOCATION_REQUEST: 04010809710000004026f0 DVLR upd_hlr_vlr_fsm(901700000004620){UPD_HLR_VLR_S_INIT}: state_chg to UPD_HLR_VLR_S_WAIT_FOR_DATA -DREF VLR subscr IMSI:901700000004620 usage decreases to: 1 DMM compl_l3: Keeping conn DREF IMSI:901700000004620: MSC conn use - 1 == 1 lu_result_sent == 0 @@ -1546,6 +1546,7 @@ DVLR set IMSI on subscriber; IMSI=901700000004620 id=901700000004620 DVLR New subscr, IMSI: 901700000004620 DREF VLR subscr IMSI:901700000004620 usage increases to: 2 +DREF VLR subscr IMSI:901700000004620 usage decreases to: 1 DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_IDLE}: vlr_loc_upd_node1() DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_IDLE}: vlr_loc_upd_post_auth() DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_IDLE}: vlr_loc_upd_post_ciph() @@ -1557,7 +1558,6 @@ DVLR GSUP tx: 04010809710000004026f0 GSUP --> HLR: OSMO_GSUP_MSGT_UPDATE_LOCATION_REQUEST: 04010809710000004026f0 DVLR upd_hlr_vlr_fsm(901700000004620){UPD_HLR_VLR_S_INIT}: state_chg to UPD_HLR_VLR_S_WAIT_FOR_DATA -DREF VLR subscr IMSI:901700000004620 usage decreases to: 1 DMM compl_l3: Keeping conn DREF IMSI:901700000004620: MSC conn use - 1 == 1 lu_result_sent == 0 diff --git a/tests/msc_vlr/msc_vlr_test_rest.err b/tests/msc_vlr/msc_vlr_test_rest.err index 3dd7141..75ff80b 100644 --- a/tests/msc_vlr/msc_vlr_test_rest.err +++ b/tests/msc_vlr/msc_vlr_test_rest.err @@ -102,6 +102,7 @@ DVLR set IMSI on subscriber; IMSI=901700000004620 id=901700000004620 DVLR New subscr, IMSI: 901700000004620 DREF VLR subscr IMSI:901700000004620 usage increases to: 2 +DREF VLR subscr IMSI:901700000004620 usage decreases to: 1 DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_IDLE}: vlr_loc_upd_node1() DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_IDLE}: vlr_loc_upd_post_auth() DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_IDLE}: vlr_loc_upd_post_ciph() @@ -113,7 +114,6 @@ DVLR GSUP tx: 04010809710000004026f0 GSUP --> HLR: OSMO_GSUP_MSGT_UPDATE_LOCATION_REQUEST: 04010809710000004026f0 DVLR upd_hlr_vlr_fsm(901700000004620){UPD_HLR_VLR_S_INIT}: state_chg to UPD_HLR_VLR_S_WAIT_FOR_DATA -DREF VLR subscr IMSI:901700000004620 usage decreases to: 1 DMM compl_l3: Keeping conn DREF IMSI:901700000004620: MSC conn use - 1 == 1 lu_result_sent == 0 @@ -215,6 +215,7 @@ DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_IDLE}: Received Event VLR_ULA_E_UPDATE_LA DREF VLR subscr MSISDN:46071 usage increases to: 2 DREF VLR subscr MSISDN:46071 usage increases to: 3 +DREF VLR subscr MSISDN:46071 usage decreases to: 2 DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_IDLE}: vlr_loc_upd_node1() DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_IDLE}: vlr_loc_upd_post_auth() DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_IDLE}: vlr_loc_upd_post_ciph() @@ -226,7 +227,6 @@ DVLR GSUP tx: 04010809710000004026f0 GSUP --> HLR: OSMO_GSUP_MSGT_UPDATE_LOCATION_REQUEST: 04010809710000004026f0 DVLR upd_hlr_vlr_fsm(901700000004620){UPD_HLR_VLR_S_INIT}: state_chg to UPD_HLR_VLR_S_WAIT_FOR_DATA -DREF VLR subscr MSISDN:46071 usage decreases to: 2 DMM compl_l3: Keeping conn DREF MSISDN:46071: MSC conn use - 1 == 1 lu_result_sent == 0 @@ -349,11 +349,11 @@ DREF VLR subscr unknown usage increases to: 1 DVLR New subscr, TMSI: 0x23422342 DREF VLR subscr TMSI:0x23422342 usage increases to: 2 +DREF VLR subscr TMSI:0x23422342 usage decreases to: 1 DVLR vlr_lu_fsm(591536962){VLR_ULA_S_IDLE}: vlr_loc_upd_want_imsi() DVLR vlr_lu_fsm(591536962){VLR_ULA_S_IDLE}: state_chg to VLR_ULA_S_WAIT_IMSI - DTAP --> MS: 051801 - DTAP matches expected message -DREF VLR subscr TMSI:0x23422342 usage decreases to: 1 DMM compl_l3: Keeping conn DREF TMSI:0x23422342: MSC conn use - 1 == 1 lu_result_sent == 0 diff --git a/tests/msc_vlr/msc_vlr_test_umts_authen.err b/tests/msc_vlr/msc_vlr_test_umts_authen.err index 67c69c0..bfb4a8e 100644 --- a/tests/msc_vlr/msc_vlr_test_umts_authen.err +++ b/tests/msc_vlr/msc_vlr_test_umts_authen.err @@ -18,6 +18,7 @@ DVLR set IMSI on subscriber; IMSI=901700000010650 id=901700000010650 DVLR New subscr, IMSI: 901700000010650 DREF VLR subscr IMSI:901700000010650 usage increases to: 2 +DREF VLR subscr IMSI:901700000010650 usage decreases to: 1 DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_IDLE}: vlr_loc_upd_node1() DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_IDLE}: state_chg to VLR_ULA_S_WAIT_AUTH DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_NEEDS_AUTH}: Allocated @@ -26,7 +27,6 @@ DVLR GSUP tx: 08010809710000000156f0 GSUP --> HLR: OSMO_GSUP_MSGT_SEND_AUTH_INFO_REQUEST: 08010809710000000156f0 DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_NEEDS_AUTH}: state_chg to VLR_SUB_AS_NEEDS_AUTH_WAIT_AI -DREF VLR subscr IMSI:901700000010650 usage decreases to: 1 DMM compl_l3: Keeping conn DREF IMSI:901700000010650: MSC conn use - 1 == 1 lu_result_sent == 0 @@ -430,6 +430,7 @@ DVLR set IMSI on subscriber; IMSI=901700000010650 id=901700000010650 DVLR New subscr, IMSI: 901700000010650 DREF VLR subscr IMSI:901700000010650 usage increases to: 2 +DREF VLR subscr IMSI:901700000010650 usage decreases to: 1 DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_IDLE}: vlr_loc_upd_node1() DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_IDLE}: state_chg to VLR_ULA_S_WAIT_AUTH DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_NEEDS_AUTH}: Allocated @@ -438,7 +439,6 @@ DVLR GSUP tx: 08010809710000000156f0 GSUP --> HLR: OSMO_GSUP_MSGT_SEND_AUTH_INFO_REQUEST: 08010809710000000156f0 DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_NEEDS_AUTH}: state_chg to VLR_SUB_AS_NEEDS_AUTH_WAIT_AI -DREF VLR subscr IMSI:901700000010650 usage decreases to: 1 DMM compl_l3: Keeping conn DREF IMSI:901700000010650: MSC conn use - 1 == 1 lu_result_sent == 0 @@ -842,6 +842,7 @@ DVLR set IMSI on subscriber; IMSI=901700000010650 id=901700000010650 DVLR New subscr, IMSI: 901700000010650 DREF VLR subscr IMSI:901700000010650 usage increases to: 2 +DREF VLR subscr IMSI:901700000010650 usage decreases to: 1 DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_IDLE}: vlr_loc_upd_node1() DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_IDLE}: state_chg to VLR_ULA_S_WAIT_AUTH DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_NEEDS_AUTH}: Allocated @@ -850,7 +851,6 @@ DVLR GSUP tx: 08010809710000000156f0 GSUP --> HLR: OSMO_GSUP_MSGT_SEND_AUTH_INFO_REQUEST: 08010809710000000156f0 DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_NEEDS_AUTH}: state_chg to VLR_SUB_AS_NEEDS_AUTH_WAIT_AI -DREF VLR subscr IMSI:901700000010650 usage decreases to: 1 DMM compl_l3: Keeping conn DREF IMSI:901700000010650: MSC conn use - 1 == 1 lu_result_sent == 0 @@ -1019,6 +1019,7 @@ DVLR set IMSI on subscriber; IMSI=901700000010650 id=901700000010650 DVLR New subscr, IMSI: 901700000010650 DREF VLR subscr IMSI:901700000010650 usage increases to: 2 +DREF VLR subscr IMSI:901700000010650 usage decreases to: 1 DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_IDLE}: vlr_loc_upd_node1() DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_IDLE}: state_chg to VLR_ULA_S_WAIT_AUTH DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_NEEDS_AUTH}: Allocated @@ -1027,7 +1028,6 @@ DVLR GSUP tx: 08010809710000000156f0 GSUP --> HLR: OSMO_GSUP_MSGT_SEND_AUTH_INFO_REQUEST: 08010809710000000156f0 DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_NEEDS_AUTH}: state_chg to VLR_SUB_AS_NEEDS_AUTH_WAIT_AI -DREF VLR subscr IMSI:901700000010650 usage decreases to: 1 DMM compl_l3: Keeping conn DREF IMSI:901700000010650: MSC conn use - 1 == 1 lu_result_sent == 0 diff --git a/tests/msc_vlr/msc_vlr_tests.c b/tests/msc_vlr/msc_vlr_tests.c index 8f04593..a878be7 100644 --- a/tests/msc_vlr/msc_vlr_tests.c +++ b/tests/msc_vlr/msc_vlr_tests.c @@ -294,7 +294,8 @@ net->a5_encryption = VLR_CIPH_NONE; net->vlr->cfg.check_imei_rqd = false; net->vlr->cfg.assign_tmsi = false; - net->vlr->cfg.retrieve_imeisv = false; + net->vlr->cfg.retrieve_imeisv_early = false; + net->vlr->cfg.retrieve_imeisv_ciphered = false; rx_from_ran = RAN_GERAN_A; auth_request_sent = false; -- To view, visit https://gerrit.osmocom.org/3417 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I121b95ad6d5ecb7603815eece2b43008de487a8a Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Tue Aug 8 10:11:10 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 8 Aug 2017 10:11:10 +0000 Subject: openbsc[master]: libmsc: set registered_delivery field in SMPP 3.4 DELIVER_SM... In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 (1 comment) https://gerrit.osmocom.org/#/c/3428/1/openbsc/src/libmsc/smpp_openbsc.c File openbsc/src/libmsc/smpp_openbsc.c: Line 607: #define SMPP34_DELIVERY_RECEIPT_REQ 0x1 (we tend to use enums instead) -- To view, visit https://gerrit.osmocom.org/3428 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I59af60fa89cd10ae973c5e122789e3e03e3728ee Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Pablo Neira Ayuso Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Keith Whyte Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Tue Aug 8 10:12:41 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 8 Aug 2017 10:12:41 +0000 Subject: openbsc[master]: libmsc: report status report request flag from SMPP SUBMIT_SM In-Reply-To: References: Message-ID: Patch Set 1: (1 comment) https://gerrit.osmocom.org/#/c/3429/1//COMMIT_MSG Commit Message: Line 9: Restore the sms status report request flag from SUBMIT_SM. what's the difference in behavior before and after this patch? -- To view, visit https://gerrit.osmocom.org/3429 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Iac05252253f8933a3875b4904599b7a225191a4b Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Pablo Neira Ayuso Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Keith Whyte Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Tue Aug 8 10:16:00 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 8 Aug 2017 10:16:00 +0000 Subject: openbsc[master]: libmsc: remove dead code in sms_route_mt_sms() In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3424 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ic3502b5b169bc7a73a67fd6ff53d8b6c0dc045c8 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Pablo Neira Ayuso Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Keith Whyte Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Aug 8 10:16:19 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 8 Aug 2017 10:16:19 +0000 Subject: openbsc[master]: libmsc: remove duplicate lines in deliver_to_esme() In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3425 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I68087a850399e22951d2407e4d8a09c671a775c9 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Pablo Neira Ayuso Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Keith Whyte Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Aug 8 10:22:11 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 8 Aug 2017 10:22:11 +0000 Subject: openbsc[master]: libmsc: remove 'deferred' parameter in sms_route_mt_sms() In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/3426 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Iba5f864f9bb963baff95969e306b1b7cff00c1e3 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Pablo Neira Ayuso Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Keith Whyte Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Aug 8 10:26:05 2017 From: gerrit-no-reply at lists.osmocom.org (Pablo Neira Ayuso) Date: Tue, 8 Aug 2017 10:26:05 +0000 Subject: openbsc[master]: libmsc: report status report request flag from SMPP SUBMIT_SM In-Reply-To: References: Message-ID: Patch Set 1: (1 comment) https://gerrit.osmocom.org/#/c/3429/1//COMMIT_MSG Commit Message: Line 9: Restore the sms status report request flag from SUBMIT_SM. > what's the difference in behavior before and after this patch? Without this patch, the status report request flag is not accordingly propagated from the ESME. Given all sms are routed via SMPP/ESME, if we don't set this flag when submitting it back to the SMSC, the SMSC generates not Delivery Receipt. -- To view, visit https://gerrit.osmocom.org/3429 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Iac05252253f8933a3875b4904599b7a225191a4b Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Pablo Neira Ayuso Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Keith Whyte Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pablo Neira Ayuso Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Tue Aug 8 10:28:42 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 8 Aug 2017 10:28:42 +0000 Subject: openbsc[master]: libmsc: move gsm340_rx_sms_submit() to sms_route_mt_sms() In-Reply-To: References: Message-ID: Patch Set 1: (1 comment) https://gerrit.osmocom.org/#/c/3427/1//COMMIT_MSG Commit Message: Line 12: DELIVER_SM with esm_class = Delivery Receipt. state the change-id of the follow-up patch? -- To view, visit https://gerrit.osmocom.org/3427 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I3f3d30e0762b91e2099243b0be1a4b67cbb5e9c0 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Pablo Neira Ayuso Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Keith Whyte Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Tue Aug 8 10:31:22 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 8 Aug 2017 10:31:22 +0000 Subject: openbsc[master]: libmsc: report status report request flag from SMPP SUBMIT_SM In-Reply-To: References: Message-ID: Patch Set 1: (would be nice to have that in the commit message, possibly via edit on gerrit ui) -- To view, visit https://gerrit.osmocom.org/3429 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Iac05252253f8933a3875b4904599b7a225191a4b Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Pablo Neira Ayuso Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Keith Whyte Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pablo Neira Ayuso Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Aug 8 10:31:52 2017 From: gerrit-no-reply at lists.osmocom.org (Pablo Neira Ayuso) Date: Tue, 8 Aug 2017 10:31:52 +0000 Subject: openbsc[master]: libmsc: set registered_delivery field in SMPP 3.4 DELIVER_SM... In-Reply-To: References: Message-ID: Patch Set 1: (1 comment) https://gerrit.osmocom.org/#/c/3428/1/openbsc/src/libmsc/smpp_openbsc.c File openbsc/src/libmsc/smpp_openbsc.c: Line 607: #define SMPP34_DELIVERY_RECEIPT_REQ 0x1 > (we tend to use enums instead) OK, I didn't know about this policy. I have a few more cleanup patches here after this, I can include such change in the next batch if this is not a major showstopper? This would block the entire series... Let me know, thanks for reviewing! -- To view, visit https://gerrit.osmocom.org/3428 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I59af60fa89cd10ae973c5e122789e3e03e3728ee Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Pablo Neira Ayuso Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Keith Whyte Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pablo Neira Ayuso Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Tue Aug 8 10:32:20 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 8 Aug 2017 10:32:20 +0000 Subject: openbsc[master]: libmsc: do not leak pending SMPP command object on error path In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3423 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I474584425d23fb379a9d71b33e29ac0e24f01e61 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Pablo Neira Ayuso Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Keith Whyte Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Aug 8 10:35:17 2017 From: gerrit-no-reply at lists.osmocom.org (Pablo Neira Ayuso) Date: Tue, 8 Aug 2017 10:35:17 +0000 Subject: [PATCH] openbsc[master]: libmsc: move gsm340_rx_sms_submit() to sms_route_mt_sms() In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3427 to look at the new patch set (#2). libmsc: move gsm340_rx_sms_submit() to sms_route_mt_sms() Move the sms message-type-identifier (mti) handling away from the routing logic. This patch allows us to reuse the sms_route_mt_sms() function in a follow up patch for sms reports send through SMPP DELIVER_SM with esm_class = Delivery Receipt whose Change-Id is Ic1a9023074bfa938099377980b6aff9b262fab2a. Change-Id: I3f3d30e0762b91e2099243b0be1a4b67cbb5e9c0 --- M openbsc/src/libmsc/gsm_04_11.c 1 file changed, 22 insertions(+), 19 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/27/3427/2 diff --git a/openbsc/src/libmsc/gsm_04_11.c b/openbsc/src/libmsc/gsm_04_11.c index d60de08..7294153 100644 --- a/openbsc/src/libmsc/gsm_04_11.c +++ b/openbsc/src/libmsc/gsm_04_11.c @@ -278,7 +278,7 @@ } static int sms_route_mt_sms(struct gsm_subscriber_connection *conn, - struct gsm_sms *gsms, uint8_t sms_mti) + struct gsm_sms *gsms) { int rc; @@ -336,23 +336,6 @@ rc = GSM411_RP_CAUSE_MO_NUM_UNASSIGNED; rate_ctr_inc(&conn->network->msc_ctrs->ctr[MSC_CTR_SMS_NO_RECEIVER]); #endif - return rc; - } - - switch (sms_mti) { - case GSM340_SMS_SUBMIT_MS2SC: - /* MS is submitting a SMS */ - rc = gsm340_rx_sms_submit(gsms); - break; - case GSM340_SMS_COMMAND_MS2SC: - case GSM340_SMS_DELIVER_REP_MS2SC: - LOGP(DLSMS, 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); - rc = GSM411_RP_CAUSE_IE_NOTEXIST; - break; } return rc; @@ -484,7 +467,27 @@ /* FIXME: This looks very wrong */ send_signal(0, NULL, gsms, 0); - rc = sms_route_mt_sms(conn, gsms, sms_mti); + rc = sms_route_mt_sms(conn, gsms); + + /* This SMS got routed through SMPP or no receiver exists. */ + if (!gsms->receiver) + return rc; + + switch (sms_mti) { + case GSM340_SMS_SUBMIT_MS2SC: + /* MS is submitting a SMS */ + rc = gsm340_rx_sms_submit(gsms); + break; + case GSM340_SMS_COMMAND_MS2SC: + case GSM340_SMS_DELIVER_REP_MS2SC: + LOGP(DLSMS, 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); + rc = GSM411_RP_CAUSE_IE_NOTEXIST; + break; + } out: sms_free(gsms); -- To view, visit https://gerrit.osmocom.org/3427 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I3f3d30e0762b91e2099243b0be1a4b67cbb5e9c0 Gerrit-PatchSet: 2 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Pablo Neira Ayuso Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Keith Whyte Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Tue Aug 8 10:37:44 2017 From: gerrit-no-reply at lists.osmocom.org (Pablo Neira Ayuso) Date: Tue, 8 Aug 2017 10:37:44 +0000 Subject: [PATCH] openbsc[master]: libmsc: report status report request flag from SMPP SUBMIT_SM In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3429 to look at the new patch set (#2). libmsc: report status report request flag from SMPP SUBMIT_SM Restore the sms status report request flag from SUBMIT_SM. Without this patch, the status report request flag is not accordingly propagated from the ESME. Given all sms are routed via SMPP/ESME, if we don't set this flag when submitting it back to the SMSC, the SMSC generates not Delivery Receipt. Change-Id: Iac05252253f8933a3875b4904599b7a225191a4b --- M openbsc/src/libmsc/smpp_openbsc.c 1 file changed, 1 insertion(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/29/3429/2 diff --git a/openbsc/src/libmsc/smpp_openbsc.c b/openbsc/src/libmsc/smpp_openbsc.c index cf78676..a803763 100644 --- a/openbsc/src/libmsc/smpp_openbsc.c +++ b/openbsc/src/libmsc/smpp_openbsc.c @@ -129,6 +129,7 @@ sms = sms_alloc(); sms->source = SMS_SOURCE_SMPP; sms->smpp.sequence_nr = submit->sequence_number; + sms->status_rep_req = submit->registered_delivery; /* fill in the destination address */ sms->receiver = dest; -- To view, visit https://gerrit.osmocom.org/3429 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Iac05252253f8933a3875b4904599b7a225191a4b Gerrit-PatchSet: 2 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Pablo Neira Ayuso Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Keith Whyte Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pablo Neira Ayuso From gerrit-no-reply at lists.osmocom.org Tue Aug 8 10:41:08 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 8 Aug 2017 10:41:08 +0000 Subject: openbsc[master]: libmsc: support GSM 03.40 status report for nitb In-Reply-To: References: Message-ID: Patch Set 1: (1 comment) https://gerrit.osmocom.org/#/c/3438/1/openbsc/src/libmsc/gsm_04_11.c File openbsc/src/libmsc/gsm_04_11.c: Line 692: gsm340_rx_sms_submit(sms_report); code cosmetics: I see from the old sms_route_mt_sms() that it looks correct (besides no switch(sms_mti) here which I hope you're sure is correct), but the code flow seems a bit weird now. The name "sms_route_mt_sms()" suggests that it has already been sent, which above log message also states. Yet we send it only later. I'm thinking the log should be moved below after sending concluded. Also the indicator whether it was routed or still needs to be sent seems a bit odd, could be made more obvious and/or clearly documented at sms_route_mt_sms() API doc? -- To view, visit https://gerrit.osmocom.org/3438 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I5cc7bb4ebadde0940f44d10c3df34707b0615160 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Pablo Neira Ayuso Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Keith Whyte Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Tue Aug 8 10:43:12 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 8 Aug 2017 10:43:12 +0000 Subject: openbsc[master]: gsm_04_11: get rid of unused parameter in sms_route_mt_sms() In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 seems like our habit of passing the rx'd msgb around if anyone would like to query its context, but fair enough -- To view, visit https://gerrit.osmocom.org/3422 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I797abce3f91447e8f397c7cf726db7425479fe0e Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Pablo Neira Ayuso Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Keith Whyte Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Aug 8 10:49:31 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 8 Aug 2017 10:49:31 +0000 Subject: openbsc[master]: libmsc: handle delivery ack via SMPP SUBMIT SM / send GSM 03... In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 (1 comment) https://gerrit.osmocom.org/#/c/3437/1/openbsc/src/libmsc/gsm_04_11.c File openbsc/src/libmsc/gsm_04_11.c: Line 280: /* As defined by GSM 03.40, Section 9.2.2.3. */ (in comments we usually say "3GPP TS 03.40") -- To view, visit https://gerrit.osmocom.org/3437 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ib70e534840308ed315f7add440351e649de3f907 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Pablo Neira Ayuso Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Keith Whyte Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Tue Aug 8 10:51:51 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 8 Aug 2017 10:51:51 +0000 Subject: openbsc[master]: utils: smpp_mirror: bounce Delivery Receipts as Delivery Ack... In-Reply-To: References: Message-ID: Patch Set 1: (1 comment) https://gerrit.osmocom.org/#/c/3436/1/openbsc/src/utils/smpp_mirror.c File openbsc/src/utils/smpp_mirror.c: Line 145: LOGP(DSMPP, LOGL_NOTICE, "%s\n", deliver.short_message); I guess this log statement existed to remind us that delivery receipts were not being handled, so I'd drop it or move to LOGL_DEBUG. -- To view, visit https://gerrit.osmocom.org/3436 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I877e228d8e174430f700631edbf9955972da7892 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Pablo Neira Ayuso Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Keith Whyte Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Tue Aug 8 10:57:52 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 8 Aug 2017 10:57:52 +0000 Subject: openbsc[master]: libmsc: update database to accomodate SMS status-report fields In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 (1 comment) https://gerrit.osmocom.org/#/c/3435/1/openbsc/src/libmsc/db.c File openbsc/src/libmsc/db.c: Line 375: /* Just like v4, but there is a new message reference field for status reports, "just like v5"? -- To view, visit https://gerrit.osmocom.org/3435 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I7276d356d805a83ebeec72b02c8563b7135ea0b6 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Pablo Neira Ayuso Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Keith Whyte Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Tue Aug 8 11:01:32 2017 From: gerrit-no-reply at lists.osmocom.org (Pablo Neira Ayuso) Date: Tue, 8 Aug 2017 11:01:32 +0000 Subject: openbsc[master]: libmsc: support GSM 03.40 status report for nitb In-Reply-To: References: Message-ID: Patch Set 1: (1 comment) https://gerrit.osmocom.org/#/c/3438/1/openbsc/src/libmsc/gsm_04_11.c File openbsc/src/libmsc/gsm_04_11.c: Line 692: gsm340_rx_sms_submit(sms_report); > code cosmetics: I see from the old sms_route_mt_sms() that it looks correct I'm going to try to address all your concerns in one go. With SMPP support, we're getting this from the SMPP SUBMIT_SM, so there is no mti here. In nitb mode, the sms_report object is created from the original sms that we get from the mobile station. I don't think the old switch(mti) belong sms_route_mt_sms(). I don't see where the name "sms_route_mt_sms()" suggests it has been already sent :-), we can probably rename this to simply sms_route() given that no mti handling happens anymore. I agree the log could be moved after the gsms->receiver branch, it would be more intuitive, yes. Anyway, this code runs inconditionally, so from the logging perspective, this would be printed in the right. Regarding the gsm->receiver indicator, the SMSC handles both SMPP and nitb modes. With SMPP there is no receiver, we really don't know since it's the ESME the one routing all SMS. We can probably wrap this in some simple: static inline bool sms_has_route(struct gsm_sms *sms) { return gsm->receiver; } Thanks for your fast review! -- To view, visit https://gerrit.osmocom.org/3438 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I5cc7bb4ebadde0940f44d10c3df34707b0615160 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Pablo Neira Ayuso Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Keith Whyte Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pablo Neira Ayuso Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Tue Aug 8 11:03:00 2017 From: gerrit-no-reply at lists.osmocom.org (Pablo Neira Ayuso) Date: Tue, 8 Aug 2017 11:03:00 +0000 Subject: openbsc[master]: gsm_04_11: get rid of unused parameter in sms_route_mt_sms() In-Reply-To: References: Message-ID: Patch Set 1: This is DEAD code, just consuming more CPU cycles on something we don't need. We can restore this once you need it ;-) Thanks! -- To view, visit https://gerrit.osmocom.org/3422 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I797abce3f91447e8f397c7cf726db7425479fe0e Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Pablo Neira Ayuso Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Keith Whyte Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pablo Neira Ayuso Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Aug 8 11:06:51 2017 From: gerrit-no-reply at lists.osmocom.org (Pablo Neira Ayuso) Date: Tue, 8 Aug 2017 11:06:51 +0000 Subject: [PATCH] openbsc[master]: utils: smpp_mirror: bounce Delivery Receipts as Delivery Ack... In-Reply-To: References: Message-ID: utils: smpp_mirror: bounce Delivery Receipts as Delivery Acknowledgments Simple patch to test the new status-report support. Change-Id: I877e228d8e174430f700631edbf9955972da7892 --- M openbsc/src/utils/smpp_mirror.c 1 file changed, 8 insertions(+), 9 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/36/3436/2 diff --git a/openbsc/src/utils/smpp_mirror.c b/openbsc/src/utils/smpp_mirror.c index 88545de..c570505 100644 --- a/openbsc/src/utils/smpp_mirror.c +++ b/openbsc/src/utils/smpp_mirror.c @@ -123,14 +123,6 @@ PACK_AND_SEND(esme, &deliver_r); - /* This is a delivery receipt, temporarily munch it until we teach - * openbsc what to do with this. - */ - if (deliver.esm_class == 0x04) { - LOGP(DSMPP, LOGL_NOTICE, "%s\n", deliver.short_message); - return 0; - } - memset(&submit, 0, sizeof(submit)); submit.command_id = SUBMIT_SM; submit.command_status = ESME_ROK; @@ -148,7 +140,14 @@ OSMO_MIN(sizeof(submit.source_addr), sizeof(deliver.destination_addr))); - submit.esm_class = deliver.esm_class; + /* Mirror delivery receipts as a delivery acknowledgements. */ + if (deliver.esm_class == 0x04) { + LOGP(DSMPP, LOGL_DEBUG, "%s\n", deliver.short_message); + submit.esm_class = 0x08; + } else { + submit.esm_class = deliver.esm_class; + } + submit.registered_delivery = deliver.registered_delivery; submit.protocol_id = deliver.protocol_id; submit.priority_flag = deliver.priority_flag; -- To view, visit https://gerrit.osmocom.org/3436 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I877e228d8e174430f700631edbf9955972da7892 Gerrit-PatchSet: 2 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Pablo Neira Ayuso Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Keith Whyte Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Tue Aug 8 11:10:32 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 8 Aug 2017 11:10:32 +0000 Subject: openbsc[master]: libmsc: add support for SMPP delivery receipts In-Reply-To: References: Message-ID: Patch Set 1: (6 comments) https://gerrit.osmocom.org/#/c/3434/1/openbsc/src/libmsc/gsm_04_11.c File openbsc/src/libmsc/gsm_04_11.c: Line 637: if (!sms_report) log error, or maybe OSMO_ASSERT(sms_report)? https://gerrit.osmocom.org/#/c/3434/1/openbsc/src/libmsc/smpp_openbsc.c File openbsc/src/libmsc/smpp_openbsc.c: Line 521: /* We got a DELIVER_SM response for this is status report, this was (hard to understand, fix typo/punctuation?) Line 552: if (cmd->report) add comment to explain why? (ah, same as above, right) Line 659: deliver.esm_class = 0x04; (would be nice to have constants instead of magic numbers ... but not related to this patch) Line 709: sms->msg_ref); user message reference was always missing? maybe the fact that it is added unconditionally deserves a mention in the log msg, or even a separate patch? https://gerrit.osmocom.org/#/c/3434/1/openbsc/src/libmsc/smpp_smsc.h File openbsc/src/libmsc/smpp_smsc.h: Line 95: bool report; (can be understood as "you should report" or "this is a report" ... would be nice to clarify the name) -- To view, visit https://gerrit.osmocom.org/3434 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ic1a9023074bfa938099377980b6aff9b262fab2a Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Pablo Neira Ayuso Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Keith Whyte Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Tue Aug 8 11:17:28 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 8 Aug 2017 11:17:28 +0000 Subject: openbsc[master]: utils: smpp_mirror: reflect message reference TLV In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 (1 comment) https://gerrit.osmocom.org/#/c/3433/1/openbsc/src/utils/smpp_mirror.c File openbsc/src/utils/smpp_mirror.c: Line 98: static struct tlv_t *find_tlv(struct tlv_t *head, uint16_t tag) this is kind of on its own... could it use libosmocore gsm/tlv.h instead? But I see that the sms code uses its own TLV code ... does it make sense to put this where the other TLV functions are? -- To view, visit https://gerrit.osmocom.org/3433 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I1b0abaa7e06ffe1bd2242c70813d8b70e9fa954f Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Pablo Neira Ayuso Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Keith Whyte Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Tue Aug 8 11:25:01 2017 From: gerrit-no-reply at lists.osmocom.org (Pablo Neira Ayuso) Date: Tue, 8 Aug 2017 11:25:01 +0000 Subject: openbsc[master]: libmsc: add support for SMPP delivery receipts In-Reply-To: References: Message-ID: Patch Set 1: (5 comments) https://gerrit.osmocom.org/#/c/3434/1/openbsc/src/libmsc/gsm_04_11.c File openbsc/src/libmsc/gsm_04_11.c: Line 637: if (!sms_report) > log error, or maybe OSMO_ASSERT(sms_report)? Is there anything the user can do after this error? Why bother? I mean, you only hit this is there is not memory left... So likely there is a leak. OSMO_ASSERT() would stop openBSC from running, is that getting this any better? This sounds like calling BUG() in the kernel. So what do we get from spamming the user with an error that *only* happens if we have no memory left? https://gerrit.osmocom.org/#/c/3434/1/openbsc/src/libmsc/smpp_openbsc.c File openbsc/src/libmsc/smpp_openbsc.c: Line 521: /* We got a DELIVER_SM response for this is status report, this was > (hard to understand, fix typo/punctuation?) This is a reply to a DELIVER_SM with esm_class = Delivery Receipt, we're just having a conversation that was initiated by the SMSC. So we don't need to send any RP-ACK to the mobile, as we do with DELIVER_SM for a plan SMS. Line 659: deliver.esm_class = 0x04; > (would be nice to have constants instead of magic numbers ... but not relat I agree, this applies all over the place, but that would require a bit of work. Line 709: sms->msg_ref); > user message reference was always missing? maybe the fact that it is added Yes, message reference was always missing because there was no status-reports ;-). We can just add a branch here to skip this if saving bytes on the network are really a concern at the cost of slowing down the CPU path. https://gerrit.osmocom.org/#/c/3434/1/openbsc/src/libmsc/smpp_smsc.h File openbsc/src/libmsc/smpp_smsc.h: Line 95: bool report; > (can be understood as "you should report" or "this is a report" ... would b This just annotates that the SMPP command that we send represents a deliver-report. -- To view, visit https://gerrit.osmocom.org/3434 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ic1a9023074bfa938099377980b6aff9b262fab2a Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Pablo Neira Ayuso Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Keith Whyte Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pablo Neira Ayuso Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Tue Aug 8 11:32:53 2017 From: gerrit-no-reply at lists.osmocom.org (Pablo Neira Ayuso) Date: Tue, 8 Aug 2017 11:32:53 +0000 Subject: openbsc[master]: utils: smpp_mirror: reflect message reference TLV In-Reply-To: References: Message-ID: Patch Set 1: (1 comment) https://gerrit.osmocom.org/#/c/3433/1/openbsc/src/utils/smpp_mirror.c File openbsc/src/utils/smpp_mirror.c: Line 98: static struct tlv_t *find_tlv(struct tlv_t *head, uint16_t tag) > this is kind of on its own... could it use libosmocore gsm/tlv.h instead? B I think this belongs to the libsmpp library, since these are SMPP TLVs. There is more code in the openBSC tree that is related to SMPP that could be placed there too. -- To view, visit https://gerrit.osmocom.org/3433 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I1b0abaa7e06ffe1bd2242c70813d8b70e9fa954f Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Pablo Neira Ayuso Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Keith Whyte Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pablo Neira Ayuso Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Tue Aug 8 11:37:00 2017 From: gerrit-no-reply at lists.osmocom.org (Pablo Neira Ayuso) Date: Tue, 8 Aug 2017 11:37:00 +0000 Subject: [PATCH] openbsc[master]: libmsc: update database to accomodate SMS status-report fields 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/3435 to look at the new patch set (#2). libmsc: update database to accomodate SMS status-report fields SMPP DELIVER_SM messages with esm_class = Delivery Receipt need to send this message reference (that the mobile phone allocates) to the ESME. Thus, the ESME propagates it via SUBMIT_SM with esm_class = Delivery Acknoledgment so that the SMSC sends the GSM 03.40 status-report to the origin including this. Given this field is useful for status-reports, we need to store it in the HLR database. Moreover, we need a new field that specifies if the entry represents a SMS status-report, to do the right handling from the gsm411_send_sms() - such new handling comes in a follow up patch entitled "libmsc: handle delivery ack via SMPP SUBMIT SM / send GSM 03.40 status report". This patch includes the migration routines to the new database schema revision 5, it's quite a bit of dbi boilerplate code - copied-pasted and adapted. Change-Id: I7276d356d805a83ebeec72b02c8563b7135ea0b6 --- M openbsc/src/libmsc/db.c 1 file changed, 162 insertions(+), 6 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/35/3435/2 diff --git a/openbsc/src/libmsc/db.c b/openbsc/src/libmsc/db.c index 5fe2a3c..424beda 100644 --- a/openbsc/src/libmsc/db.c +++ b/openbsc/src/libmsc/db.c @@ -50,7 +50,7 @@ static char *db_dirname = NULL; static dbi_conn conn; -#define SCHEMA_REVISION "4" +#define SCHEMA_REVISION "5" enum { SCHEMA_META, @@ -124,6 +124,8 @@ "valid_until TIMESTAMP, " "reply_path_req INTEGER NOT NULL, " "status_rep_req INTEGER NOT NULL, " + "report INTEGER NOT NULL, " + "msg_ref INTEGER NOT NULL, " "protocol_id INTEGER NOT NULL, " "data_coding_scheme INTEGER NOT NULL, " "ud_hdr_ind INTEGER NOT NULL, " @@ -370,6 +372,152 @@ return -EINVAL; } +/* Just like v3, but there is a new message reference field for status reports, + * that is set to zero for existing entries since there is no way we can infer + * this. + */ +static struct gsm_sms *sms_from_result_v4(dbi_result result) +{ + struct gsm_sms *sms = sms_alloc(); + const unsigned char *user_data; + const char *text, *addr; + + if (!sms) + return NULL; + + sms->id = dbi_result_get_ulonglong(result, "id"); + + sms->reply_path_req = dbi_result_get_ulonglong(result, "reply_path_req"); + sms->status_rep_req = dbi_result_get_ulonglong(result, "status_rep_req"); + sms->ud_hdr_ind = dbi_result_get_ulonglong(result, "ud_hdr_ind"); + sms->protocol_id = dbi_result_get_ulonglong(result, "protocol_id"); + sms->data_coding_scheme = dbi_result_get_ulonglong(result, + "data_coding_scheme"); + + addr = dbi_result_get_string(result, "src_addr"); + osmo_strlcpy(sms->src.addr, addr, sizeof(sms->src.addr)); + sms->src.ton = dbi_result_get_ulonglong(result, "src_ton"); + sms->src.npi = dbi_result_get_ulonglong(result, "src_npi"); + + addr = dbi_result_get_string(result, "dest_addr"); + osmo_strlcpy(sms->dst.addr, addr, sizeof(sms->dst.addr)); + sms->dst.ton = dbi_result_get_ulonglong(result, "dest_ton"); + sms->dst.npi = dbi_result_get_ulonglong(result, "dest_npi"); + + sms->user_data_len = dbi_result_get_field_length(result, "user_data"); + user_data = dbi_result_get_binary(result, "user_data"); + if (sms->user_data_len > sizeof(sms->user_data)) + sms->user_data_len = (uint8_t) sizeof(sms->user_data); + memcpy(sms->user_data, user_data, sms->user_data_len); + + text = dbi_result_get_string(result, "text"); + if (text) + osmo_strlcpy(sms->text, text, sizeof(sms->text)); + return sms; +} + +static int update_db_revision_4(void) +{ + dbi_result result; + struct gsm_sms *sms; + + LOGP(DDB, LOGL_NOTICE, "Going to migrate from revision 4\n"); + + result = dbi_conn_query(conn, "BEGIN EXCLUSIVE TRANSACTION"); + if (!result) { + LOGP(DDB, LOGL_ERROR, + "Failed to begin transaction (upgrade from rev 4)\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_4"); + if (!result) { + LOGP(DDB, LOGL_ERROR, + "Failed to rename the old SMS table (upgrade from rev 4).\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 4).\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_4"); + if (!result) { + LOGP(DDB, LOGL_ERROR, + "Failed fetch messages from the old SMS table (upgrade from rev 4).\n"); + goto rollback; + } + while (dbi_result_next_row(result)) { + sms = sms_from_result_v4(result); + if (db_sms_store(sms) != 0) { + LOGP(DDB, LOGL_ERROR, "Failed to store message to the new SMS table(upgrade from rev 4).\n"); + sms_free(sms); + dbi_result_free(result); + goto rollback; + } + sms_free(sms); + } + dbi_result_free(result); + + /* Remove the temporary table */ + result = dbi_conn_query(conn, "DROP TABLE SMS_4"); + if (!result) { + LOGP(DDB, LOGL_ERROR, + "Failed to drop the old SMS table (upgrade from rev 4).\n"); + goto rollback; + } + dbi_result_free(result); + + /* We're done. Bump DB Meta revision to 4 */ + result = dbi_conn_query(conn, + "UPDATE Meta " + "SET value = '5' " + "WHERE key = 'revision'"); + if (!result) { + LOGP(DDB, LOGL_ERROR, + "Failed to update DB schema revision (upgrade from rev 4).\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 4)\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 4).\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 4).\n"); + else + dbi_result_free(result); + return -EINVAL; +} + static int check_db_revision(void) { dbi_result result; @@ -412,6 +560,9 @@ goto error; case 3: if (update_db_revision_3()) + goto error; + case 4: + if (update_db_revision_4()) goto error; /* The end of waterfall */ @@ -1445,20 +1596,23 @@ result = dbi_conn_queryf(conn, "INSERT INTO SMS " "(created, valid_until, " - "reply_path_req, status_rep_req, protocol_id, " - "data_coding_scheme, ud_hdr_ind, " + "reply_path_req, status_rep_req, report, " + "msg_ref, protocol_id, data_coding_scheme, " + "ud_hdr_ind, " "user_data, text, " "dest_addr, dest_ton, dest_npi, " "src_addr, src_ton, src_npi) VALUES " "(datetime('now'), %u, " "%u, %u, %u, " - "%u, %u, " + "%u, %u, %u, " + "%u, " "%s, %s, " "%s, %u, %u, " "%s, %u, %u)", validity_timestamp, - sms->reply_path_req, sms->status_rep_req, sms->protocol_id, - sms->data_coding_scheme, sms->ud_hdr_ind, + sms->reply_path_req, sms->status_rep_req, sms->report, + sms->msg_ref, sms->protocol_id, sms->data_coding_scheme, + sms->ud_hdr_ind, q_udata, q_text, q_daddr, sms->dst.ton, sms->dst.npi, q_saddr, sms->src.ton, sms->src.npi); @@ -1489,6 +1643,8 @@ /* FIXME: those should all be get_uchar, but sqlite3 is braindead */ sms->reply_path_req = dbi_result_get_ulonglong(result, "reply_path_req"); sms->status_rep_req = dbi_result_get_ulonglong(result, "status_rep_req"); + sms->report = dbi_result_get_ulonglong(result, "report"); + sms->msg_ref = dbi_result_get_ulonglong(result, "msg_ref"); sms->ud_hdr_ind = dbi_result_get_ulonglong(result, "ud_hdr_ind"); sms->protocol_id = dbi_result_get_ulonglong(result, "protocol_id"); sms->data_coding_scheme = dbi_result_get_ulonglong(result, -- To view, visit https://gerrit.osmocom.org/3435 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I7276d356d805a83ebeec72b02c8563b7135ea0b6 Gerrit-PatchSet: 2 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Pablo Neira Ayuso Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Keith Whyte Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Tue Aug 8 11:42:06 2017 From: gerrit-no-reply at lists.osmocom.org (Pablo Neira Ayuso) Date: Tue, 8 Aug 2017 11:42:06 +0000 Subject: [PATCH] openbsc[master]: libmsc: handle delivery ack via SMPP SUBMIT SM / send GSM 03... 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/3437 to look at the new patch set (#2). libmsc: handle delivery ack via SMPP SUBMIT SM / send GSM 03.40 status report This patch adds gsm340_sms_send_status_report_tpdu() to build a status-report. Moreover, set sms->report field if we see a SMPP SUBMIT_SM with Delivery Acknowledgment esm_class, so this identifies that this is a delivery report. MS GSM 03.40 SMSC SMPP 3.4 ESME | | | | | SUBMIT-SM | | | esm_class = Delivery Ack | | |<-------------------------------| | | SUBMIT-SM-RESP | | |------------------------------->| | | | | SMS-STATUS-REPORT | | |<----------------------------| | | GSM 04.11 RP-ACK | | |---------------------------->| | | | | There is a FIXME message in this patch, that I just copied from gsm340_gen_sms_deliver_tpdu() since TP-MMS is not supported by OpenBSC. Change-Id: Ib70e534840308ed315f7add440351e649de3f907 --- M openbsc/src/libmsc/gsm_04_11.c M openbsc/src/libmsc/smpp_openbsc.c 2 files changed, 54 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/37/3437/2 diff --git a/openbsc/src/libmsc/gsm_04_11.c b/openbsc/src/libmsc/gsm_04_11.c index ea80860..9ba4c5f 100644 --- a/openbsc/src/libmsc/gsm_04_11.c +++ b/openbsc/src/libmsc/gsm_04_11.c @@ -277,6 +277,49 @@ return msg->len - old_msg_len; } +/* As defined by 3GPP TS 03.40, Section 9.2.2.3. */ +static int gsm340_gen_sms_status_report_tpdu(struct msgb *msg, + struct gsm_sms *sms) +{ + unsigned int old_msg_len = msg->len; + uint8_t oa_len = 0; + uint8_t oa[12]; /* max len per 03.40 */ + uint8_t *smsp; + + /* generate first octet with masked bits */ + smsp = msgb_put(msg, 1); + /* TP-MTI (message type indicator) */ + *smsp = GSM340_SMS_STATUS_REP_SC2MS; + /* TP-MMS (more messages to send) */ + if (0 /* FIXME */) + *smsp |= 0x04; + /* TP-MR (message reference) */ + smsp = msgb_put(msg, 1); + *smsp = sms->msg_ref; + /* generate recipient address */ + oa_len = gsm340_gen_oa_sub(oa, sizeof(oa), &sms->dst); + smsp = msgb_put(msg, oa_len); + memcpy(smsp, oa, oa_len); + + /* generate TP-SCTS (Service centre timestamp) */ + smsp = msgb_put(msg, 7); + gsm340_gen_scts(smsp, time(NULL)); + + /* generate TP-DT (Discharge time, in TP-SCTS format). */ + smsp = msgb_put(msg, 7); + gsm340_gen_scts(smsp, time(NULL)); + + /* TP-ST (status) */ + smsp = msgb_put(msg, 1); + /* 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); + + return msg->len - old_msg_len; +} + static int sms_route_mt_sms(struct gsm_subscriber_connection *conn, struct gsm_sms *gsms) { @@ -992,8 +1035,13 @@ /* obtain a pointer for the rp_ud_len, so we can fill it later */ rp_ud_len = (uint8_t *)msgb_put(msg, 1); - /* generate the 03.40 SMS-DELIVER TPDU */ - rc = gsm340_gen_sms_deliver_tpdu(msg, sms); + if (sms->report) { + /* generate the 03.40 SMS-STATUS-REPORT TPDU */ + rc = gsm340_gen_sms_status_report_tpdu(msg, sms); + } else { + /* generate the 03.40 SMS-DELIVER TPDU */ + rc = gsm340_gen_sms_deliver_tpdu(msg, sms); + } if (rc < 0) { send_signal(S_SMS_UNKNOWN_ERROR, trans, sms, 0); sms_free(sms); diff --git a/openbsc/src/libmsc/smpp_openbsc.c b/openbsc/src/libmsc/smpp_openbsc.c index 42357e2..32ad30e 100644 --- a/openbsc/src/libmsc/smpp_openbsc.c +++ b/openbsc/src/libmsc/smpp_openbsc.c @@ -143,6 +143,10 @@ osmo_strlcpy(sms->src.addr, (char *)submit->source_addr, sizeof(sms->src.addr)); + /* This is a Delivery Acknowledgment. */ + if (submit->esm_class == 0x08) + sms->report = true; + if (submit->esm_class & 0x40) sms->ud_hdr_ind = 1; -- To view, visit https://gerrit.osmocom.org/3437 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ib70e534840308ed315f7add440351e649de3f907 Gerrit-PatchSet: 2 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Pablo Neira Ayuso Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Keith Whyte Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Tue Aug 8 11:52:28 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 8 Aug 2017 11:52:28 +0000 Subject: osmo-iuh[master]: make point codes configurable by SCCP address book In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3394 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I33a7ba11eb7c2d9a5dc74d10fb0cf04bf664477b Gerrit-PatchSet: 2 Gerrit-Project: osmo-iuh Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Aug 8 11:54:43 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 8 Aug 2017 11:54:43 +0000 Subject: libosmocore[master]: Add release target to Makefile In-Reply-To: References: Message-ID: Patch Set 12: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3130 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I790ceb958195b9f6cbabfe8c977dc30e2bd7414b Gerrit-PatchSet: 12 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: blobb Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Aug 8 11:55:04 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 8 Aug 2017 11:55:04 +0000 Subject: [MERGED] libosmocore[master]: Add release target to Makefile In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Add release target to Makefile ...................................................................... Add release target to Makefile Add simple helper target to automate basic release steps: * version bump * prepare release commit * git commit, tag and sign For library projects: * update debian/changelog from TODO-RELEASE * cleanup TODO-RELEASE For non-library projects: * update debian/changelog from git log Note: it requires bumpversion package to be installed, debian/control is adjusted accordingly. The helper itself is installed to facilitate reuse by other libraries. N. B: you still have to manually adjust LIBVERSION in previous commit - see TODO-RELEASE header for details. Use it as follows: make REL=minor release The REL parameter defines which component of the version [1] to bump and can be any of { major, minor, patch }. [1] http://semver.org/ Change-Id: I790ceb958195b9f6cbabfe8c977dc30e2bd7414b Related: OS#1861 --- M Makefile.am M configure.ac M debian/control A osmo-release.mk 4 files changed, 41 insertions(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/Makefile.am b/Makefile.am index b8de3ca..8b35856 100644 --- a/Makefile.am +++ b/Makefile.am @@ -7,13 +7,20 @@ pkgconfig_DATA = libosmocore.pc libosmocodec.pc libosmovty.pc libosmogsm.pc \ libosmogb.pc libosmoctrl.pc libosmocoding.pc + at RELMAKE@ + +relengdir = $(includedir) +releng_DATA = osmo-release.mk + +osmo-release.mk: git-version-gen + BUILT_SOURCES = $(top_srcdir)/.version $(top_srcdir)/.version: echo $(VERSION) > $@-t && mv $@-t $@ dist-hook: echo $(VERSION) > $(distdir)/.tarball-version -EXTRA_DIST = git-version-gen .version README.md +EXTRA_DIST = git-version-gen .version README.md osmo-release.mk if HAVE_DOXYGEN diff --git a/configure.ac b/configure.ac index 96757df..5821ad3 100644 --- a/configure.ac +++ b/configure.ac @@ -11,6 +11,10 @@ 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]) + dnl checks for programs AC_PROG_MAKE_SET AC_PROG_MKDIR_P diff --git a/debian/control b/debian/control index b19448e..e266173 100644 --- a/debian/control +++ b/debian/control @@ -281,6 +281,7 @@ Multi-Arch: same Section: libdevel Depends: libosmocore, + bumpversion, libtalloc-dev, ${misc:Depends} Description: Development headers for Open Source MObile COMmunications CORE library diff --git a/osmo-release.mk b/osmo-release.mk new file mode 100644 index 0000000..4407c86 --- /dev/null +++ b/osmo-release.mk @@ -0,0 +1,28 @@ +ifdef REL +NEW_VERSION := $(shell bumpversion --list --current-version $(VERSION) $(REL) --allow-dirty | awk -F '=' '{ print $$2 }') +LIBVERS := $(shell git grep -n LIBVERSION | grep '=' | grep am | grep -v LDFLAGS) +ISODATE := $(shell date -I) +endif + +release: +ifeq ($(NEW_VERSION),) + @$(error Failed to determine NEW_VERSION - please fix versioning (current is $(VERSION)) before proceeding with the release) +endif + @echo "Releasing" $(VERSION) "->" $(NEW_VERSION)"..." +ifeq ($(LIBVERS),) + @gbp dch --debian-tag='%(version)s' --auto --meta --git-author --multimaint-merge +else + @echo "You should NOT be doing this unless you've read and understood following article:" + @echo "https://www.gnu.org/software/libtool/manual/html_node/Updating-version-info.html#Updating-version-info" + @grep -v '#' TODO-RELEASE | sed 's/\t\+/:/g' | xargs -d'\n' -I entry dch -m -v $(NEW_VERSION) "entry" + @dch -r -m --distribution "unstable" "" + @grep '#' TODO-RELEASE > TODO-RELEASE.clean + @mv TODO-RELEASE.clean TODO-RELEASE + @echo "Do NOT push the release commit if you have not adjusted LIBVERSION in preceeding commit!!!" + @echo "Are you sure the following versions are correct?" + @echo $(LIBVERS) +endif + @git add -u + @bumpversion --current-version $(VERSION) $(REL) --tag --commit --tag-name $(NEW_VERSION) --allow-dirty + @git tag -s $(NEW_VERSION) -f -m "Release v$(NEW_VERSION) on $(ISODATE)." + @echo "Release" $(NEW_VERSION) "prepared, tagged and signed." -- To view, visit https://gerrit.osmocom.org/3130 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I790ceb958195b9f6cbabfe8c977dc30e2bd7414b Gerrit-PatchSet: 13 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: blobb From gerrit-no-reply at lists.osmocom.org Tue Aug 8 11:55:32 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 8 Aug 2017 11:55:32 +0000 Subject: [MERGED] libosmo-abis[master]: Use release helper from libosmocore In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Use release helper from libosmocore ...................................................................... Use release helper from libosmocore Change-Id: Ifc88e5c942a8b430b2436d429c86560d82984a95 Related: OS#1861 --- M Makefile.am M configure.ac 2 files changed, 6 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/Makefile.am b/Makefile.am index 9e24bef..a8774c4 100644 --- a/Makefile.am +++ b/Makefile.am @@ -13,3 +13,5 @@ echo $(VERSION) > $(distdir)/.tarball-version EXTRA_DIST = .version README.md + + at RELMAKE@ diff --git a/configure.ac b/configure.ac index 0686f64..eb7733e 100644 --- a/configure.ac +++ b/configure.ac @@ -11,6 +11,10 @@ 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]) + dnl checks for programs AC_PROG_MAKE_SET AC_PROG_CC -- To view, visit https://gerrit.osmocom.org/3131 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ifc88e5c942a8b430b2436d429c86560d82984a95 Gerrit-PatchSet: 3 Gerrit-Project: libosmo-abis Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: neels From gerrit-no-reply at lists.osmocom.org Tue Aug 8 11:56:08 2017 From: gerrit-no-reply at lists.osmocom.org (Pablo Neira Ayuso) Date: Tue, 8 Aug 2017 11:56:08 +0000 Subject: [PATCH] openbsc[master]: libmsc: support GSM 03.40 status report for nitb In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3438 to look at the new patch set (#2). libmsc: support GSM 03.40 status report for nitb This patch adds support for GSM 03.40 in nitb mode. MS GSM 03.40 SMSC | | | SMS-SUBMIT | |--------------------------->| | GSM 04.11 RP-ACK | |<---------------------------| | SMS-DELIVER | |<---------------------------| | GSM 04.11 RP-ACK | |--------------------------->| | SMS-STATUS-REPORT | |<---------------------------| | GSM 04.11 RP-ACK | |--------------------------->| | | Change-Id: I5cc7bb4ebadde0940f44d10c3df34707b0615160 --- M openbsc/src/libmsc/gsm_04_11.c 1 file changed, 5 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/38/3438/2 diff --git a/openbsc/src/libmsc/gsm_04_11.c b/openbsc/src/libmsc/gsm_04_11.c index a2e002e..fa00907 100644 --- a/openbsc/src/libmsc/gsm_04_11.c +++ b/openbsc/src/libmsc/gsm_04_11.c @@ -685,6 +685,11 @@ LOGP(DLSMS, LOGL_ERROR, "Failed to send status report! err=%d\n", rc); } + + /* No route via SMPP, send the GSM 03.40 status-report now. */ + if (gsms->receiver) + gsm340_rx_sms_submit(sms_report); + LOGP(DLSMS, LOGL_NOTICE, "Status report has been sent\n"); sms_free(sms_report); -- To view, visit https://gerrit.osmocom.org/3438 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I5cc7bb4ebadde0940f44d10c3df34707b0615160 Gerrit-PatchSet: 2 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Pablo Neira Ayuso Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Keith Whyte Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pablo Neira Ayuso From gerrit-no-reply at lists.osmocom.org Tue Aug 8 11:56:31 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 8 Aug 2017 11:56:31 +0000 Subject: openggsn[master]: ippool: Add IPv6 support to IP pool implementation In-Reply-To: References: Message-ID: Patch Set 4: Code-Review-1 we actually need to allocate /64 prefixes and not individual v6 addresess, this needs to be re-worked -- To view, visit https://gerrit.osmocom.org/3403 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ib98cc4bf634d6be9a7bf8c03a24e629455fcafc8 Gerrit-PatchSet: 4 Gerrit-Project: openggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Aug 8 11:56:43 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 8 Aug 2017 11:56:43 +0000 Subject: openggsn[master]: Proper fix for "Force Dynamic IP" in Create PDP CTX In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3409 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ib1b57eb0654327882044d6862d955f4b32aa6bcd Gerrit-PatchSet: 1 Gerrit-Project: openggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Aug 8 11:56:56 2017 From: gerrit-no-reply at lists.osmocom.org (lynxis lazus) Date: Tue, 8 Aug 2017 11:56:56 +0000 Subject: [PATCH] libasn1c[master]: add .gitreview to support git review plugin Message-ID: Review at https://gerrit.osmocom.org/3439 add .gitreview to support git review plugin Change-Id: Ia197da1614a8cbec5f177368ca9e25946059c68a --- A .gitreview 1 file changed, 3 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libasn1c refs/changes/39/3439/1 diff --git a/.gitreview b/.gitreview new file mode 100644 index 0000000..972358d --- /dev/null +++ b/.gitreview @@ -0,0 +1,3 @@ +[gerrit] +host=gerrit.osmocom.org +project=libasn1c -- To view, visit https://gerrit.osmocom.org/3439 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ia197da1614a8cbec5f177368ca9e25946059c68a Gerrit-PatchSet: 1 Gerrit-Project: libasn1c Gerrit-Branch: master Gerrit-Owner: lynxis lazus From gerrit-no-reply at lists.osmocom.org Tue Aug 8 11:56:56 2017 From: gerrit-no-reply at lists.osmocom.org (lynxis lazus) Date: Tue, 8 Aug 2017 11:56:56 +0000 Subject: [PATCH] libasn1c[master]: add /debian to build a package Message-ID: Review at https://gerrit.osmocom.org/3440 add /debian to build a package debian files need a release so start with release 0.1.0 Change-Id: I135d975b84027d51cb1dc534e04dd314bbd20289 --- A debian/changelog A debian/compat A debian/control A debian/copyright A debian/libasn1c-dev.install A debian/libasn1c0.install A debian/rules A debian/source/format 8 files changed, 147 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libasn1c refs/changes/40/3440/1 diff --git a/debian/changelog b/debian/changelog new file mode 100644 index 0000000..f56c11a --- /dev/null +++ b/debian/changelog @@ -0,0 +1,5 @@ +libasn1c (0.1.0) UNRELEASED; urgency=low + + * Initial release. + + -- Alexander Couzens Sun, 06 Aug 2017 22:25:03 +0000 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..4313249 --- /dev/null +++ b/debian/control @@ -0,0 +1,33 @@ +Source: libasn1c +Section: libs +Priority: extra +Maintainer: Alexander Couzens +Build-Depends: debhelper (>=9), + dh-autoreconf, + libtalloc-dev +Standards-Version: 3.9.8 +Vcs-Git: git://git.osmocom.org/libasn1c.git +Vcs-Browser: http://git.osmocom.org/gitweb?p=libasn1c.git;a=summary +Homepage: https://projects.osmocom.org/projects/libasn1c + +Package: libasn1c0 +Section: libs +Architecture: any +Multi-Arch: same +Pre-Depends: ${misc:Pre-Depends} +Depends: ${misc:Depends}, ${shlibs:Depends} +Description: asn1c runtime code as shared library + +Package: libasn1c-dbg +Section: debug +Architecture: any +Multi-Arch: same +Depends: libasn1c0 (= ${binary:Version}), ${misc:Depends} +Description: asn1c runtime code as shared library + +Package: libasn1c-dev +Section: libdevel +Architecture: any +Multi-Arch: same +Depends: libasn1c0 (= ${binary:Version}), ${misc:Depends} +Description: asn1c runtime code as shared library diff --git a/debian/copyright b/debian/copyright new file mode 100644 index 0000000..cce213b --- /dev/null +++ b/debian/copyright @@ -0,0 +1,43 @@ +Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ +Upstream-Name: libasn1c +Source: git://git.osmocom.org/libasn1c + +Files: * +Copyright: 2005-2014 Lev Walkin +License: BSD-3-Clause + +Files: src/xer_support.c +Copyright: 2003,2004 X/IO Labs, xiolabs.com. + 2003,2004,2005 Lev Walkin . +License: BSD-3-Clause + +Files: debian/* +Copyright: 2017 Alexander Couzens +License: BSD-3-Clause + +License: BSD-3-Clause + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + . + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + 3. Neither the name of the University nor the names of its contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + . + THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + SUCH DAMAGE. + diff --git a/debian/libasn1c-dev.install b/debian/libasn1c-dev.install new file mode 100644 index 0000000..d8a8a49 --- /dev/null +++ b/debian/libasn1c-dev.install @@ -0,0 +1,4 @@ +usr/include +usr/lib/*/pkgconfig/*.pc +usr/lib/*/*.a +usr/lib/*/lib*.so diff --git a/debian/libasn1c0.install b/debian/libasn1c0.install new file mode 100644 index 0000000..3de3b10 --- /dev/null +++ b/debian/libasn1c0.install @@ -0,0 +1 @@ +usr/lib/*/*.so.* diff --git a/debian/rules b/debian/rules new file mode 100755 index 0000000..c806072 --- /dev/null +++ b/debian/rules @@ -0,0 +1,59 @@ +#!/usr/bin/make -f +# You must remove unused comment lines for the released package. +# See debhelper(7) (uncomment to enable) +# This is an autogenerated template for debian/rules. +# +# Output every command that modifies files on the build system. +#export DH_VERBOSE = 1 +# +# Copy some variable definitions from pkg-info.mk and vendor.mk +# under /usr/share/dpkg/ to here if they are useful. +# +# See FEATURE AREAS/ENVIRONMENT in dpkg-buildflags(1) +# Apply all hardening options +#export DEB_BUILD_MAINT_OPTIONS = hardening=+all +# Package maintainers to append CFLAGS +#export DEB_CFLAGS_MAINT_APPEND = -Wall -pedantic +# Package maintainers to append LDFLAGS +#export DEB_LDFLAGS_MAINT_APPEND = -Wl,--as-needed +# +# With debhelper version 9 or newer, the dh command exports +# all buildflags. So there is no need to include the +# /usr/share/dpkg/buildflags.mk file here if compat is 9 or newer. +# +# These are rarely used code. (START) +# +# The following include for *.mk magically sets miscellaneous +# variables while honoring existing values of pertinent +# environment variables: +# +# Architecture-related variables such as DEB_TARGET_MULTIARCH: +#include /usr/share/dpkg/architecture.mk +# Vendor-related variables such as DEB_VENDOR: +#include /usr/share/dpkg/vendor.mk +# Package-related variables such as DEB_DISTRIBUTION +#include /usr/share/dpkg/pkg-info.mk +# +# You may alternatively set them susing a simple script such as: +# DEB_VENDOR ?= $(shell dpkg-vendor --query Vendor) +# +# These are rarely used code. (END) +# + +# main packaging script based on dh7 syntax +%: + dh $@ --with autoreconf + +# debmake generated override targets +# Set options for ./configure +#CONFIGURE_FLAGS = +#overrride_dh_configure: +# dh_configure -- $(CONFIGURE_FLAGS) +# +# Do not install libtool archive, python .pyc .pyo +#override_dh_install: +# dh_install --list-missing -X.la -X.pyc -X.pyo + +# See https://www.debian.org/doc/manuals/developers-reference/best-pkging-practices.html#bpp-dbg +override_dh_strip: + dh_strip --dbg-package=libasn1c-dbg 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/3440 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I135d975b84027d51cb1dc534e04dd314bbd20289 Gerrit-PatchSet: 1 Gerrit-Project: libasn1c Gerrit-Branch: master Gerrit-Owner: lynxis lazus From gerrit-no-reply at lists.osmocom.org Tue Aug 8 11:58:13 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Tue, 8 Aug 2017 11:58:13 +0000 Subject: [PATCH] osmo-gsm-tester[master]: Set osmo-bts pcu-socket config to point to run dir Message-ID: Review at https://gerrit.osmocom.org/3441 Set osmo-bts pcu-socket config to point to run dir Otherwise osmo-bts stores the socket file in /tmp. If an earlier instance doesn't finish cleanly, the file is left there and a new instance will fail to start because it cannot create a new socket file in the same place. Change-Id: I5a1da23c45a4ac496fe765e0d78c52dae3e7808b --- M src/osmo_gsm_tester/bts_osmotrx.py M src/osmo_gsm_tester/bts_sysmo.py M src/osmo_gsm_tester/templates/osmo-bts-sysmo.cfg.tmpl M src/osmo_gsm_tester/templates/osmo-bts-trx.cfg.tmpl 4 files changed, 15 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-tester refs/changes/41/3441/1 diff --git a/src/osmo_gsm_tester/bts_osmotrx.py b/src/osmo_gsm_tester/bts_osmotrx.py index 585647a..d8675cb 100644 --- a/src/osmo_gsm_tester/bts_osmotrx.py +++ b/src/osmo_gsm_tester/bts_osmotrx.py @@ -95,8 +95,13 @@ values = dict(osmo_bts_trx=config.get_defaults('osmo_bts_trx')) config.overlay(values, self.suite_run.config()) - config.overlay(values, dict(osmo_bts_trx=dict(oml_remote_ip=self.bsc.addr()))) - config.overlay(values, dict(osmo_bts_trx=self.conf)) + config.overlay(values, { + 'osmo_bts_trx': { + 'oml_remote_ip': self.bsc.addr(), + 'pcu_socket_path': os.path.join(str(self.run_dir), 'pcu_bts') + } + }) + config.overlay(values, { 'osmo_bts_trx': self.conf }) self.dbg('OSMO-BTS-TRX CONFIG:\n' + pprint.pformat(values)) diff --git a/src/osmo_gsm_tester/bts_sysmo.py b/src/osmo_gsm_tester/bts_sysmo.py index eab0bdb..f37f88b 100644 --- a/src/osmo_gsm_tester/bts_sysmo.py +++ b/src/osmo_gsm_tester/bts_sysmo.py @@ -119,7 +119,12 @@ values = { 'osmo_bts_sysmo': config.get_defaults('osmo_bts_sysmo') } config.overlay(values, self.suite_run.config()) - config.overlay(values, { 'osmo_bts_sysmo': { 'oml_remote_ip': self.bsc.addr() } }) + config.overlay(values, { + 'osmo_bts_sysmo': { + 'oml_remote_ip': self.bsc.addr(), + 'pcu_socket_path': os.path.join(SysmoBts.REMOTE_DIR, 'pcu_bts') + } + }) config.overlay(values, { 'osmo_bts_sysmo': self.conf }) self.dbg('SYSMOBTS CONFIG:\n' + pprint.pformat(values)) diff --git a/src/osmo_gsm_tester/templates/osmo-bts-sysmo.cfg.tmpl b/src/osmo_gsm_tester/templates/osmo-bts-sysmo.cfg.tmpl index cf9666b..69f7ac1 100644 --- a/src/osmo_gsm_tester/templates/osmo-bts-sysmo.cfg.tmpl +++ b/src/osmo_gsm_tester/templates/osmo-bts-sysmo.cfg.tmpl @@ -16,6 +16,7 @@ band ${osmo_bts_sysmo.band} ipa unit-id ${osmo_bts_sysmo.ipa_unit_id} 0 oml remote-ip ${osmo_bts_sysmo.oml_remote_ip} + pcu-socket ${osmo_bts_sysmo.pcu_socket_path} gsmtap-sapi bcch gsmtap-sapi ccch gsmtap-sapi rach diff --git a/src/osmo_gsm_tester/templates/osmo-bts-trx.cfg.tmpl b/src/osmo_gsm_tester/templates/osmo-bts-trx.cfg.tmpl index 452b920..1737947 100644 --- a/src/osmo_gsm_tester/templates/osmo-bts-trx.cfg.tmpl +++ b/src/osmo_gsm_tester/templates/osmo-bts-trx.cfg.tmpl @@ -20,6 +20,7 @@ band ${osmo_bts_trx.band} ipa unit-id ${osmo_bts_trx.ipa_unit_id} 0 oml remote-ip ${osmo_bts_trx.oml_remote_ip} + pcu-socket ${osmo_bts_trx.pcu_socket_path} settsc gsmtap-sapi bcch gsmtap-sapi ccch -- To view, visit https://gerrit.osmocom.org/3441 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I5a1da23c45a4ac496fe765e0d78c52dae3e7808b Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Tue Aug 8 11:58:52 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 8 Aug 2017 11:58:52 +0000 Subject: openggsn[master]: Support setting TUN device IPv6 address + prefix In-Reply-To: References: Message-ID: Patch Set 5: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3408 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I899d21e52d02e0b8384af29ddd489ff19c8f2cf6 Gerrit-PatchSet: 5 Gerrit-Project: openggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Aug 8 11:59:19 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 8 Aug 2017 11:59:19 +0000 Subject: libosmo-sccp[master]: sccp: add function to check sccp addresses In-Reply-To: References: Message-ID: Patch Set 1: (1 comment) https://gerrit.osmocom.org/#/c/3398/1/src/sccp_user.c File src/sccp_user.c: Line 256: /*! \brief check if a given SCCP-Address is consistant. (at least in libosmocore, we have autobrief, so we'd drop the "\brief". In libosmo-sccp we don't even have a doxygen make target, not sure whether that will change.) typo: "consistent" -- To view, visit https://gerrit.osmocom.org/3398 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ic6245288b0171eae10aa708403c1ddb584c92f38 Gerrit-PatchSet: 1 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Tue Aug 8 11:59:32 2017 From: gerrit-no-reply at lists.osmocom.org (lynxis lazus) Date: Tue, 8 Aug 2017 11:59:32 +0000 Subject: [PATCH] osmo-iuh[master]: add .gitreview to support git review plugin Message-ID: Review at https://gerrit.osmocom.org/3442 add .gitreview to support git review plugin Change-Id: If8ebdb687f41911f55679472a0c87f9734264e80 --- A .gitreview 1 file changed, 3 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-iuh refs/changes/42/3442/1 diff --git a/.gitreview b/.gitreview new file mode 100644 index 0000000..b8af595 --- /dev/null +++ b/.gitreview @@ -0,0 +1,3 @@ +[gerrit] +host=gerrit.osmocom.org +project=osmo-iuh -- To view, visit https://gerrit.osmocom.org/3442 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: If8ebdb687f41911f55679472a0c87f9734264e80 Gerrit-PatchSet: 1 Gerrit-Project: osmo-iuh Gerrit-Branch: master Gerrit-Owner: lynxis lazus From gerrit-no-reply at lists.osmocom.org Tue Aug 8 12:00:27 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 8 Aug 2017 12:00:27 +0000 Subject: [PATCH] libosmo-sccp[master]: sccp: add function to check sccp addresses In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3398 to look at the new patch set (#2). sccp: add function to check sccp addresses In order to catch invalid CS7 configurations, It is necessary to check if sccp addresses contain plausible address data. Change-Id: Ic6245288b0171eae10aa708403c1ddb584c92f38 --- M include/osmocom/sigtran/sccp_sap.h M src/sccp_user.c 2 files changed, 44 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-sccp refs/changes/98/3398/2 diff --git a/include/osmocom/sigtran/sccp_sap.h b/include/osmocom/sigtran/sccp_sap.h index 732df2a..90da686 100644 --- a/include/osmocom/sigtran/sccp_sap.h +++ b/include/osmocom/sigtran/sccp_sap.h @@ -257,3 +257,5 @@ void osmo_sccp_local_addr_by_instance(struct osmo_sccp_addr *dest_addr, const struct osmo_sccp_instance *inst, uint32_t ssn); + +bool osmo_sccp_check_addr(struct osmo_sccp_addr *addr, uint32_t presence); diff --git a/src/sccp_user.c b/src/sccp_user.c index 495b6dc..71b3262 100644 --- a/src/sccp_user.c +++ b/src/sccp_user.c @@ -253,6 +253,48 @@ osmo_sccp_make_addr_pc_ssn(dest_addr, ss7->cfg.primary_pc, ssn); } +/*! \brief check whether a given SCCP-Address is consistent. + * \param[in] addr SCCP address to check + * \param[in] presence mask with minimum required address components + * \returns true when address data seems plausible */ +bool osmo_sccp_check_addr(struct osmo_sccp_addr *addr, uint32_t presence) +{ + /* Minimum requirements do not match */ + if ((addr->presence & presence) != presence) + return false; + + /* GT ranges */ + if (addr->presence & OSMO_SCCP_ADDR_T_GT) { + if (addr->gt.gti > 15) + return false; + if (addr->gt.npi > 15) + return false; + if (addr->gt.nai > 127) + return false; + } + + /* Routing by GT, but no GT present */ + if (addr->ri == OSMO_SCCP_RI_GT + && !(addr->presence & OSMO_SCCP_ADDR_T_GT)) + return false; + + /* Routing by PC/SSN, but no PC/SSN present */ + if (addr->ri == OSMO_SCCP_RI_SSN_PC) { + if ((addr->presence & OSMO_SCCP_ADDR_T_PC) == 0) + return false; + if ((addr->presence & OSMO_SCCP_ADDR_T_SSN) == 0) + return false; + } + + if (addr->ri == OSMO_SCCP_RI_SSN_IP) { + if ((addr->presence & OSMO_SCCP_ADDR_T_IPv4) == 0 && + (addr->presence & OSMO_SCCP_ADDR_T_IPv6) == 0) + return false; + } + + return true; +} + /*********************************************************************** * Convenience function for CLIENT ***********************************************************************/ -- To view, visit https://gerrit.osmocom.org/3398 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ic6245288b0171eae10aa708403c1ddb584c92f38 Gerrit-PatchSet: 2 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Tue Aug 8 12:00:49 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 8 Aug 2017 12:00:49 +0000 Subject: libosmo-sccp[master]: sccp: add function to check sccp addresses In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3398 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ic6245288b0171eae10aa708403c1ddb584c92f38 Gerrit-PatchSet: 2 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Aug 8 12:02:26 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 8 Aug 2017 12:02:26 +0000 Subject: libasn1c[master]: add .gitreview to support git review plugin In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3439 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ia197da1614a8cbec5f177368ca9e25946059c68a Gerrit-PatchSet: 1 Gerrit-Project: libasn1c Gerrit-Branch: master Gerrit-Owner: lynxis lazus Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Aug 8 12:05:14 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 8 Aug 2017 12:05:14 +0000 Subject: libasn1c[master]: add /debian to build a package In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 (1 comment) @hwelte, is there also material copyrighted by you in libasn1c? https://gerrit.osmocom.org/#/c/3440/1/debian/rules File debian/rules: Line 45: dh $@ --with autoreconf ws -- To view, visit https://gerrit.osmocom.org/3440 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I135d975b84027d51cb1dc534e04dd314bbd20289 Gerrit-PatchSet: 1 Gerrit-Project: libasn1c Gerrit-Branch: master Gerrit-Owner: lynxis lazus Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Tue Aug 8 12:05:35 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 8 Aug 2017 12:05:35 +0000 Subject: osmo-iuh[master]: add .gitreview to support git review plugin In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3442 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: If8ebdb687f41911f55679472a0c87f9734264e80 Gerrit-PatchSet: 1 Gerrit-Project: osmo-iuh Gerrit-Branch: master Gerrit-Owner: lynxis lazus Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Aug 8 12:50:26 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 8 Aug 2017 12:50:26 +0000 Subject: openbsc[master]: libmsc: add support for SMPP delivery receipts In-Reply-To: References: Message-ID: Patch Set 1: (5 comments) https://gerrit.osmocom.org/#/c/3434/1/openbsc/src/libmsc/gsm_04_11.c File openbsc/src/libmsc/gsm_04_11.c: Line 637: if (!sms_report) > Is there anything the user can do after this error? if mem is up, the program will likely not do *anything* useful anymore. Instead of going on to try, probably producing lots of weird output after this, we might as well say what's up and bail. An OSMO_ASSERT() would sufficiently convey such meaning (and avoids possible mem problems for log composition). The current patch says nothing, drops the status report on the floor and goes on silently with other things, I believe that's not a good paradigm. If you're bothering to check the pointer, then let's bother properly :) https://gerrit.osmocom.org/#/c/3434/1/openbsc/src/libmsc/smpp_openbsc.c File openbsc/src/libmsc/smpp_openbsc.c: Line 521: /* We got a DELIVER_SM response for this is status report, this was > This is a reply to a DELIVER_SM with esm_class = Delivery Receipt, we're ju I was referring to "we got a X response for this is status report, this" which is gramatically wrong, thus I find it hard to figure out... If this needs more comment, I'd appreciate it as in-code comment instead of gerrit review comment, for the benefit of future code readers. Line 659: deliver.esm_class = 0x04; > I agree, this applies all over the place, but that would require a bit of w agreed Line 709: sms->msg_ref); > Yes, message reference was always missing because there was no status-repor cpu cycles or bytes aren't really a concern, only semantics. We're adding a TLV but not mentioning it, that's all. https://gerrit.osmocom.org/#/c/3434/1/openbsc/src/libmsc/smpp_smsc.h File openbsc/src/libmsc/smpp_smsc.h: Line 95: bool report; > This just annotates that the SMPP command that we send represents a deliver maybe 'bool is_report;' then? (nitpick) -- To view, visit https://gerrit.osmocom.org/3434 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ic1a9023074bfa938099377980b6aff9b262fab2a Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Pablo Neira Ayuso Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Keith Whyte Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pablo Neira Ayuso Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Tue Aug 8 13:23:23 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Tue, 8 Aug 2017 13:23:23 +0000 Subject: [PATCH] osmo-pcu[master]: Add pcu-socket vty config Message-ID: Review at https://gerrit.osmocom.org/3443 Add pcu-socket vty config osmo-bts already supports configuring a different path for the bts<->pcu socket by using the 'pcu-socket' config field. Change-Id: I9b3e1171da467519750b201849ec892a1e318129 --- M src/bts.h M src/osmobts_sock.cpp M src/pcu_main.cpp M src/pcu_vty.c M src/pcu_vty.h 5 files changed, 27 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/43/3443/1 diff --git a/src/bts.h b/src/bts.h index 25193f9..cff0020 100644 --- a/src/bts.h +++ b/src/bts.h @@ -233,6 +233,9 @@ * period. */ struct BTS *bts; + + /* Path to be used for the pcu-bts socket */ + char *pcu_sock_path; }; #ifdef __cplusplus diff --git a/src/osmobts_sock.cpp b/src/osmobts_sock.cpp index d7e55e7..e9b85ab 100644 --- a/src/osmobts_sock.cpp +++ b/src/osmobts_sock.cpp @@ -223,6 +223,7 @@ struct sockaddr_un local; unsigned int namelen; int rc; + struct gprs_rlcmac_bts *bts = bts_main_data(); LOGP(DL1IF, LOGL_INFO, "Opening OsmoPCU L1 interface to OsmoBTS\n"); @@ -244,7 +245,7 @@ } local.sun_family = AF_UNIX; - strncpy(local.sun_path, "/tmp/pcu_bts", sizeof(local.sun_path)); + strncpy(local.sun_path, bts->pcu_sock_path, sizeof(local.sun_path)); local.sun_path[sizeof(local.sun_path) - 1] = '\0'; /* we use the same magic that X11 uses in Xtranssock.c for diff --git a/src/pcu_main.cpp b/src/pcu_main.cpp index b69e446..8e7cde8 100644 --- a/src/pcu_main.cpp +++ b/src/pcu_main.cpp @@ -216,6 +216,8 @@ */ bts->dl_arq_type = EGPRS_ARQ1; + bts->pcu_sock_path = talloc_strdup(tall_pcu_ctx, PCU_SOCK_DEFAULT); + msgb_talloc_ctx_init(tall_pcu_ctx, 0); osmo_init_logging(&gprs_log_info); diff --git a/src/pcu_vty.c b/src/pcu_vty.c index cd22e38..0fc9db3 100644 --- a/src/pcu_vty.c +++ b/src/pcu_vty.c @@ -233,6 +233,8 @@ if (bts->dl_tbf_idle_msec) vty_out(vty, " dl-tbf-idle-time %d%s", bts->dl_tbf_idle_msec, VTY_NEWLINE); + if (strcmp(bts->pcu_sock_path, PCU_SOCK_DEFAULT)) + vty_out(vty, " pcu-socket %s%s", bts->pcu_sock_path, VTY_NEWLINE); for (i = 0; i < 32; i++) { unsigned int cs = (1 << i); @@ -966,6 +968,21 @@ return CMD_SUCCESS; } +DEFUN(cfg_pcu_sock, cfg_pcu_sock_cmd, + "pcu-socket PATH", + "Configure the osmo-bts PCU socket file/path name\n") +{ + struct gprs_rlcmac_bts *bts = bts_main_data(); + + if (bts->pcu_sock_path) { + /* FIXME: close the interface? */ + talloc_free(bts->pcu_sock_path); + } + bts->pcu_sock_path = talloc_strdup(tall_pcu_ctx, argv[0]); + /* FIXME: re-open the interface? */ + + return CMD_SUCCESS; +} DEFUN(show_tbf, show_tbf_cmd, @@ -1096,6 +1113,7 @@ install_element(PCU_NODE, &cfg_pcu_no_ms_idle_time_cmd); install_element(PCU_NODE, &cfg_pcu_gsmtap_categ_cmd); install_element(PCU_NODE, &cfg_pcu_no_gsmtap_categ_cmd); + install_element(PCU_NODE, &cfg_pcu_sock_cmd); install_element_ve(&show_bts_stats_cmd); install_element_ve(&show_tbf_cmd); diff --git a/src/pcu_vty.h b/src/pcu_vty.h index c00b882..09cd8cf 100644 --- a/src/pcu_vty.h +++ b/src/pcu_vty.h @@ -4,6 +4,8 @@ #include #include +#define PCU_SOCK_DEFAULT "/tmp/pcu_bts" + enum pcu_vty_node { PCU_NODE = _LAST_OSMOVTY_NODE + 1, }; -- To view, visit https://gerrit.osmocom.org/3443 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I9b3e1171da467519750b201849ec892a1e318129 Gerrit-PatchSet: 1 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Tue Aug 8 13:51:53 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Tue, 8 Aug 2017 13:51:53 +0000 Subject: [PATCH] osmo-pcu[master]: Add pcu-socket vty config In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3443 to look at the new patch set (#2). Add pcu-socket vty config osmo-bts already supports configuring a different path for the bts<->pcu socket by using the 'pcu-socket' config field. Change-Id: I9b3e1171da467519750b201849ec892a1e318129 --- M src/bts.h M src/osmobts_sock.cpp M src/pcu_main.cpp M src/pcu_vty.c M src/pcu_vty.h 5 files changed, 29 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/43/3443/2 diff --git a/src/bts.h b/src/bts.h index 25193f9..cff0020 100644 --- a/src/bts.h +++ b/src/bts.h @@ -233,6 +233,9 @@ * period. */ struct BTS *bts; + + /* Path to be used for the pcu-bts socket */ + char *pcu_sock_path; }; #ifdef __cplusplus diff --git a/src/osmobts_sock.cpp b/src/osmobts_sock.cpp index d7e55e7..e9b85ab 100644 --- a/src/osmobts_sock.cpp +++ b/src/osmobts_sock.cpp @@ -223,6 +223,7 @@ struct sockaddr_un local; unsigned int namelen; int rc; + struct gprs_rlcmac_bts *bts = bts_main_data(); LOGP(DL1IF, LOGL_INFO, "Opening OsmoPCU L1 interface to OsmoBTS\n"); @@ -244,7 +245,7 @@ } local.sun_family = AF_UNIX; - strncpy(local.sun_path, "/tmp/pcu_bts", sizeof(local.sun_path)); + strncpy(local.sun_path, bts->pcu_sock_path, sizeof(local.sun_path)); local.sun_path[sizeof(local.sun_path) - 1] = '\0'; /* we use the same magic that X11 uses in Xtranssock.c for diff --git a/src/pcu_main.cpp b/src/pcu_main.cpp index b69e446..8e7cde8 100644 --- a/src/pcu_main.cpp +++ b/src/pcu_main.cpp @@ -216,6 +216,8 @@ */ bts->dl_arq_type = EGPRS_ARQ1; + bts->pcu_sock_path = talloc_strdup(tall_pcu_ctx, PCU_SOCK_DEFAULT); + msgb_talloc_ctx_init(tall_pcu_ctx, 0); osmo_init_logging(&gprs_log_info); diff --git a/src/pcu_vty.c b/src/pcu_vty.c index cd22e38..a1da11e 100644 --- a/src/pcu_vty.c +++ b/src/pcu_vty.c @@ -233,6 +233,8 @@ if (bts->dl_tbf_idle_msec) vty_out(vty, " dl-tbf-idle-time %d%s", bts->dl_tbf_idle_msec, VTY_NEWLINE); + if (strcmp(bts->pcu_sock_path, PCU_SOCK_DEFAULT)) + vty_out(vty, " pcu-socket %s%s", bts->pcu_sock_path, VTY_NEWLINE); for (i = 0; i < 32; i++) { unsigned int cs = (1 << i); @@ -966,6 +968,23 @@ return CMD_SUCCESS; } +DEFUN(cfg_pcu_sock, + cfg_pcu_sock_cmd, + "pcu-socket PATH", + "Configure the osmo-bts PCU socket file/path name\n" + "Path of the socket to connect to\n") +{ + struct gprs_rlcmac_bts *bts = bts_main_data(); + + if (bts->pcu_sock_path) { + /* FIXME: close the interface? */ + talloc_free(bts->pcu_sock_path); + } + bts->pcu_sock_path = talloc_strdup(tall_pcu_ctx, argv[0]); + /* FIXME: re-open the interface? */ + + return CMD_SUCCESS; +} DEFUN(show_tbf, show_tbf_cmd, @@ -1096,6 +1115,7 @@ install_element(PCU_NODE, &cfg_pcu_no_ms_idle_time_cmd); install_element(PCU_NODE, &cfg_pcu_gsmtap_categ_cmd); install_element(PCU_NODE, &cfg_pcu_no_gsmtap_categ_cmd); + install_element(PCU_NODE, &cfg_pcu_sock_cmd); install_element_ve(&show_bts_stats_cmd); install_element_ve(&show_tbf_cmd); diff --git a/src/pcu_vty.h b/src/pcu_vty.h index c00b882..09cd8cf 100644 --- a/src/pcu_vty.h +++ b/src/pcu_vty.h @@ -4,6 +4,8 @@ #include #include +#define PCU_SOCK_DEFAULT "/tmp/pcu_bts" + enum pcu_vty_node { PCU_NODE = _LAST_OSMOVTY_NODE + 1, }; -- To view, visit https://gerrit.osmocom.org/3443 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I9b3e1171da467519750b201849ec892a1e318129 Gerrit-PatchSet: 2 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Tue Aug 8 15:15:32 2017 From: gerrit-no-reply at lists.osmocom.org (lynxis lazus) Date: Tue, 8 Aug 2017 15:15:32 +0000 Subject: [PATCH] osmo-mgw[master]: .gitreview: update repo url to new location Message-ID: Review at https://gerrit.osmocom.org/3444 .gitreview: update repo url to new location Change-Id: Ic08e308e3b6f9dda35c95da4628268ccd2b6cfaa --- M .gitreview 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-mgw refs/changes/44/3444/1 diff --git a/.gitreview b/.gitreview index ee67509..1f71dcf 100644 --- a/.gitreview +++ b/.gitreview @@ -1,3 +1,3 @@ [gerrit] host=gerrit.osmocom.org -project=openbsc +project=osmo-mgw -- To view, visit https://gerrit.osmocom.org/3444 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ic08e308e3b6f9dda35c95da4628268ccd2b6cfaa Gerrit-PatchSet: 1 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: lynxis lazus From gerrit-no-reply at lists.osmocom.org Tue Aug 8 15:24:05 2017 From: gerrit-no-reply at lists.osmocom.org (lynxis lazus) Date: Tue, 8 Aug 2017 15:24:05 +0000 Subject: [PATCH] osmo-bsc[master]: .gitreview: update repo url to new location Message-ID: Review at https://gerrit.osmocom.org/3445 .gitreview: update repo url to new location Old files came from openbsc. Change-Id: If8b5b0b3c9472e2d25f90f659dcc90aac44d7566 --- M .gitreview 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/45/3445/1 diff --git a/.gitreview b/.gitreview index ee67509..bd724b7 100644 --- a/.gitreview +++ b/.gitreview @@ -1,3 +1,3 @@ [gerrit] host=gerrit.osmocom.org -project=openbsc +project=osmo-bsc -- To view, visit https://gerrit.osmocom.org/3445 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: If8b5b0b3c9472e2d25f90f659dcc90aac44d7566 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: lynxis lazus From gerrit-no-reply at lists.osmocom.org Tue Aug 8 15:26:29 2017 From: gerrit-no-reply at lists.osmocom.org (lynxis lazus) Date: Tue, 8 Aug 2017 15:26:29 +0000 Subject: [PATCH] osmo-msc[master]: update .gitreview to new repo url Message-ID: Review at https://gerrit.osmocom.org/3446 update .gitreview to new repo url Leftover from split out of openbsc Change-Id: I684eedfdeb52a9b018d3798961b29b9e31526cd1 --- M .gitreview 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/46/3446/1 diff --git a/.gitreview b/.gitreview index ee67509..6f1bb85 100644 --- a/.gitreview +++ b/.gitreview @@ -1,3 +1,3 @@ [gerrit] host=gerrit.osmocom.org -project=openbsc +project=osmo-msc -- To view, visit https://gerrit.osmocom.org/3446 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I684eedfdeb52a9b018d3798961b29b9e31526cd1 Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: lynxis lazus From gerrit-no-reply at lists.osmocom.org Tue Aug 8 15:28:25 2017 From: gerrit-no-reply at lists.osmocom.org (lynxis lazus) Date: Tue, 8 Aug 2017 15:28:25 +0000 Subject: [PATCH] osmo-sgsn[master]: .gitreview: update repo url to new location Message-ID: Review at https://gerrit.osmocom.org/3447 .gitreview: update repo url to new location Old files was a leftover from split out of openbsc. Change-Id: Ifefb345df6c00aadee0ccc3c59796dba590a9f32 --- M .gitreview 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-sgsn refs/changes/47/3447/1 diff --git a/.gitreview b/.gitreview index ee67509..560ddef 100644 --- a/.gitreview +++ b/.gitreview @@ -1,3 +1,3 @@ [gerrit] host=gerrit.osmocom.org -project=openbsc +project=osmo-sgsn -- To view, visit https://gerrit.osmocom.org/3447 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ifefb345df6c00aadee0ccc3c59796dba590a9f32 Gerrit-PatchSet: 1 Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-Owner: lynxis lazus From gerrit-no-reply at lists.osmocom.org Tue Aug 8 17:00:32 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 8 Aug 2017 17:00:32 +0000 Subject: osmo-mgw[master]: .gitreview: update repo url to new location In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 Verified+1 -- To view, visit https://gerrit.osmocom.org/3444 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ic08e308e3b6f9dda35c95da4628268ccd2b6cfaa Gerrit-PatchSet: 1 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: lynxis lazus Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Aug 8 17:00:35 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 8 Aug 2017 17:00:35 +0000 Subject: [MERGED] osmo-mgw[master]: .gitreview: update repo url to new location In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: .gitreview: update repo url to new location ...................................................................... .gitreview: update repo url to new location Change-Id: Ic08e308e3b6f9dda35c95da4628268ccd2b6cfaa --- M .gitreview 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Neels Hofmeyr: Looks good to me, approved; Verified diff --git a/.gitreview b/.gitreview index ee67509..1f71dcf 100644 --- a/.gitreview +++ b/.gitreview @@ -1,3 +1,3 @@ [gerrit] host=gerrit.osmocom.org -project=openbsc +project=osmo-mgw -- To view, visit https://gerrit.osmocom.org/3444 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ic08e308e3b6f9dda35c95da4628268ccd2b6cfaa Gerrit-PatchSet: 1 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: lynxis lazus Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Tue Aug 8 17:00:50 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 8 Aug 2017 17:00:50 +0000 Subject: osmo-msc[master]: update .gitreview to new repo url In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3446 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I684eedfdeb52a9b018d3798961b29b9e31526cd1 Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: lynxis lazus Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Aug 8 17:00:52 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 8 Aug 2017 17:00:52 +0000 Subject: [MERGED] osmo-msc[master]: update .gitreview to new repo url In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: update .gitreview to new repo url ...................................................................... update .gitreview to new repo url Leftover from split out of openbsc Change-Id: I684eedfdeb52a9b018d3798961b29b9e31526cd1 --- M .gitreview 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Neels Hofmeyr: Looks good to me, approved Jenkins Builder: Verified diff --git a/.gitreview b/.gitreview index ee67509..6f1bb85 100644 --- a/.gitreview +++ b/.gitreview @@ -1,3 +1,3 @@ [gerrit] host=gerrit.osmocom.org -project=openbsc +project=osmo-msc -- To view, visit https://gerrit.osmocom.org/3446 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I684eedfdeb52a9b018d3798961b29b9e31526cd1 Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: lynxis lazus Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Tue Aug 8 17:01:03 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 8 Aug 2017 17:01:03 +0000 Subject: osmo-sgsn[master]: .gitreview: update repo url to new location In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 Verified+1 -- To view, visit https://gerrit.osmocom.org/3447 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ifefb345df6c00aadee0ccc3c59796dba590a9f32 Gerrit-PatchSet: 1 Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-Owner: lynxis lazus Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Aug 8 17:01:07 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 8 Aug 2017 17:01:07 +0000 Subject: [MERGED] osmo-sgsn[master]: .gitreview: update repo url to new location In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: .gitreview: update repo url to new location ...................................................................... .gitreview: update repo url to new location Old files was a leftover from split out of openbsc. Change-Id: Ifefb345df6c00aadee0ccc3c59796dba590a9f32 --- M .gitreview 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Neels Hofmeyr: Looks good to me, approved; Verified diff --git a/.gitreview b/.gitreview index ee67509..560ddef 100644 --- a/.gitreview +++ b/.gitreview @@ -1,3 +1,3 @@ [gerrit] host=gerrit.osmocom.org -project=openbsc +project=osmo-sgsn -- To view, visit https://gerrit.osmocom.org/3447 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ifefb345df6c00aadee0ccc3c59796dba590a9f32 Gerrit-PatchSet: 1 Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-Owner: lynxis lazus Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Tue Aug 8 17:02:01 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 8 Aug 2017 17:02:01 +0000 Subject: osmo-bsc[master]: .gitreview: update repo url to new location In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 Verified+1 -- To view, visit https://gerrit.osmocom.org/3445 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: If8b5b0b3c9472e2d25f90f659dcc90aac44d7566 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: lynxis lazus Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Aug 8 17:02:04 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 8 Aug 2017 17:02:04 +0000 Subject: [MERGED] osmo-bsc[master]: .gitreview: update repo url to new location In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: .gitreview: update repo url to new location ...................................................................... .gitreview: update repo url to new location Old files came from openbsc. Change-Id: If8b5b0b3c9472e2d25f90f659dcc90aac44d7566 --- M .gitreview 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Neels Hofmeyr: Looks good to me, approved; Verified diff --git a/.gitreview b/.gitreview index ee67509..bd724b7 100644 --- a/.gitreview +++ b/.gitreview @@ -1,3 +1,3 @@ [gerrit] host=gerrit.osmocom.org -project=openbsc +project=osmo-bsc -- To view, visit https://gerrit.osmocom.org/3445 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: If8b5b0b3c9472e2d25f90f659dcc90aac44d7566 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: lynxis lazus Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Tue Aug 8 17:02:19 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 8 Aug 2017 17:02:19 +0000 Subject: [MERGED] osmo-iuh[master]: add .gitreview to support git review plugin In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: add .gitreview to support git review plugin ...................................................................... add .gitreview to support git review plugin Change-Id: If8ebdb687f41911f55679472a0c87f9734264e80 --- A .gitreview 1 file changed, 3 insertions(+), 0 deletions(-) Approvals: Neels Hofmeyr: Looks good to me, approved Jenkins Builder: Verified diff --git a/.gitreview b/.gitreview new file mode 100644 index 0000000..b8af595 --- /dev/null +++ b/.gitreview @@ -0,0 +1,3 @@ +[gerrit] +host=gerrit.osmocom.org +project=osmo-iuh -- To view, visit https://gerrit.osmocom.org/3442 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: If8ebdb687f41911f55679472a0c87f9734264e80 Gerrit-PatchSet: 2 Gerrit-Project: osmo-iuh Gerrit-Branch: master Gerrit-Owner: lynxis lazus Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Tue Aug 8 18:08:06 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 8 Aug 2017 18:08:06 +0000 Subject: [PATCH] osmo-gsm-manuals[master]: rf.adoc: Fix table rendering for path loss models Message-ID: Review at https://gerrit.osmocom.org/3448 rf.adoc: Fix table rendering for path loss models Change-Id: Ia36c5ecf943b978d846884a1c4b638dccd89da3b --- M common/chapters/rf.adoc 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-manuals refs/changes/48/3448/1 diff --git a/common/chapters/rf.adoc b/common/chapters/rf.adoc index 95472b2..f3f6dd9 100644 --- a/common/chapters/rf.adoc +++ b/common/chapters/rf.adoc @@ -576,7 +576,7 @@ [[path-loss-models]] .List of common path loss models -[options="header",cols="20%,20%,60%"] +[options="header",cols="10%,10%,20%,60%"] |=== |Type|Sub-Type|Bands|Name |Terrain|-|850, 900, 1800, 1900|ITU terrain model -- To view, visit https://gerrit.osmocom.org/3448 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ia36c5ecf943b978d846884a1c4b638dccd89da3b Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Tue Aug 8 18:19:36 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 8 Aug 2017 18:19:36 +0000 Subject: osmo-gsm-manuals[master]: rf.adoc: Fix table rendering for path loss models In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3448 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ia36c5ecf943b978d846884a1c4b638dccd89da3b Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Aug 8 18:19:40 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 8 Aug 2017 18:19:40 +0000 Subject: [MERGED] osmo-gsm-manuals[master]: rf.adoc: Fix table rendering for path loss models In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: rf.adoc: Fix table rendering for path loss models ...................................................................... rf.adoc: Fix table rendering for path loss models Change-Id: Ia36c5ecf943b978d846884a1c4b638dccd89da3b --- M common/chapters/rf.adoc 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/common/chapters/rf.adoc b/common/chapters/rf.adoc index 95472b2..f3f6dd9 100644 --- a/common/chapters/rf.adoc +++ b/common/chapters/rf.adoc @@ -576,7 +576,7 @@ [[path-loss-models]] .List of common path loss models -[options="header",cols="20%,20%,60%"] +[options="header",cols="10%,10%,20%,60%"] |=== |Type|Sub-Type|Bands|Name |Terrain|-|850, 900, 1800, 1900|ITU terrain model -- To view, visit https://gerrit.osmocom.org/3448 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ia36c5ecf943b978d846884a1c4b638dccd89da3b Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Tue Aug 8 18:20:04 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 8 Aug 2017 18:20:04 +0000 Subject: libosmo-sccp[master]: add osmo_sccp_addr_set_ssn() In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3359 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I85b46269dbe7909e52873ace3f720f6292a4516c Gerrit-PatchSet: 2 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: dexter Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Aug 8 18:20:33 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 8 Aug 2017 18:20:33 +0000 Subject: libosmo-sccp[master]: osmo_ss7_vty_init: ensure a talloc ctx is set by user In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3360 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Id4e7f47979001f7856b0b3665c9e94982e75e490 Gerrit-PatchSet: 2 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Aug 8 18:22:51 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 8 Aug 2017 18:22:51 +0000 Subject: libosmo-sccp[master]: ensure valid primary_pc in osmo_ss7_instance In-Reply-To: References: Message-ID: Patch Set 3: It is likely we will at some point have secondary point codes. Hence, I would prefer to either have a sub-structure that encapsulates the uint32_t and the valid flag, so that type and related code/functions can be re-used (e.g. something like is_pc_valid() inline function that then can operate on that type). An alternative would be to use the MSB as valid flag, as all known point code formats have a maximum of 24 bits in length. -- To view, visit https://gerrit.osmocom.org/3355 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I7f0f0c89b7335d9da24161bfac8234be214ca00c Gerrit-PatchSet: 3 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Aug 8 18:23:02 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 8 Aug 2017 18:23:02 +0000 Subject: libosmo-sccp[master]: constify ss7_instance arg of osmo_ss7_pointcode_print() In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3361 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I8c6b7188d004033e75e9c41f4a65c418d13a79c5 Gerrit-PatchSet: 2 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Aug 8 18:23:15 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 8 Aug 2017 18:23:15 +0000 Subject: libosmo-sccp[master]: introduce OSMO_SCCP_RI_NONE to indicate unset RI In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3362 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I6e2f31b023b08cba2f2ee8234e6108efcaca41c0 Gerrit-PatchSet: 2 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Aug 8 18:24:21 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 8 Aug 2017 18:24:21 +0000 Subject: libosmo-sccp[master]: add osmo_sccp_addr_name() and three value_string[]s In-Reply-To: References: Message-ID: Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3363 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ie1aedd7894acd69ddc887cd65a8a0df4b888838c Gerrit-PatchSet: 3 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Aug 8 18:24:33 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 8 Aug 2017 18:24:33 +0000 Subject: libosmo-sccp[master]: fix osmo_sccp_addr_dump(): actually print RI In-Reply-To: References: Message-ID: Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3364 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I93e0aa706867e7b1de7f7a6071e3c8af89772af0 Gerrit-PatchSet: 3 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Aug 8 18:24:57 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 8 Aug 2017 18:24:57 +0000 Subject: libosmo-sccp[master]: sccp-addr vty: set RI to SSN_PC when setting a point-code In-Reply-To: References: Message-ID: Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3365 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I75c67d289693f1c2a049ac61cf2b2097d6e5687d Gerrit-PatchSet: 3 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Aug 8 18:25:35 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 8 Aug 2017 18:25:35 +0000 Subject: libosmo-sccp[master]: sccp_helpers: check buf len in append_to_buf() In-Reply-To: References: Message-ID: Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3366 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I2e6d656871f952be8e719573fedf2154832841d7 Gerrit-PatchSet: 3 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Aug 8 18:25:45 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 8 Aug 2017 18:25:45 +0000 Subject: libosmo-sccp[master]: cosmetic: ws in log In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3367 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: If5a56ec170d4e91ce070f6fa9c9cfe5bbc121186 Gerrit-PatchSet: 2 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Aug 8 18:25:51 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 8 Aug 2017 18:25:51 +0000 Subject: [MERGED] libosmo-sccp[master]: osmo_ss7_vty_init: ensure a talloc ctx is set by user In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: osmo_ss7_vty_init: ensure a talloc ctx is set by user ...................................................................... osmo_ss7_vty_init: ensure a talloc ctx is set by user Drop the separate osmo_ss7_set_vty_alloc_ctx() because we are likely to forget calling it. Instead, incorporate into osmo_ss7_vty_init_*() with a new ctx arg, and set the static context var in vty_init_shared(). Change-Id: Id4e7f47979001f7856b0b3665c9e94982e75e490 --- M examples/m3ua_example.c M include/osmocom/sigtran/osmo_ss7.h M src/osmo_ss7_vty.c M stp/stp_main.c 4 files changed, 11 insertions(+), 15 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/examples/m3ua_example.c b/examples/m3ua_example.c index d3c6a7c..6c2b146 100644 --- a/examples/m3ua_example.c +++ b/examples/m3ua_example.c @@ -92,7 +92,7 @@ osmo_ss7_init(); osmo_fsm_log_addr(false); vty_init(&vty_info); - osmo_ss7_vty_init_asp(); + osmo_ss7_vty_init_asp(NULL); osmo_sccp_vty_init(); if (argc <= 1) diff --git a/include/osmocom/sigtran/osmo_ss7.h b/include/osmocom/sigtran/osmo_ss7.h index 87ace4a..bbe425c 100644 --- a/include/osmocom/sigtran/osmo_ss7.h +++ b/include/osmocom/sigtran/osmo_ss7.h @@ -471,8 +471,7 @@ /* VTY related */ struct vty; -void osmo_ss7_set_vty_alloc_ctx(void *ctx); -void osmo_ss7_vty_init_asp(void); -void osmo_ss7_vty_init_sg(void); +void osmo_ss7_vty_init_asp(void *ctx); +void osmo_ss7_vty_init_sg(void *ctx); int osmo_ss7_vty_go_parent(struct vty *vty); int osmo_ss7_is_config_node(struct vty *vty, int node); diff --git a/src/osmo_ss7_vty.c b/src/osmo_ss7_vty.c index c859eb9..476aedf 100644 --- a/src/osmo_ss7_vty.c +++ b/src/osmo_ss7_vty.c @@ -1661,8 +1661,10 @@ install_element(L_CS7_SCCPADDR_GT_NODE, &cs7_sccpaddr_gt_digits_cmd); } -static void vty_init_shared(void) +static void vty_init_shared(void *ctx) { + g_ctx = ctx; + install_element_ve(&show_cs7_user_cmd); /* the mother of all VTY config nodes */ @@ -1706,14 +1708,14 @@ vty_init_addr(); } -void osmo_ss7_vty_init_asp(void) +void osmo_ss7_vty_init_asp(void *ctx) { - vty_init_shared(); + vty_init_shared(ctx); } -void osmo_ss7_vty_init_sg(void) +void osmo_ss7_vty_init_sg(void *ctx) { - vty_init_shared(); + vty_init_shared(ctx); install_node(&rtable_node, NULL); vty_install_default(L_CS7_RTABLE_NODE); @@ -1730,8 +1732,3 @@ install_element(L_CS7_XUA_NODE, &xua_local_ip_cmd); install_element(L_CS7_XUA_NODE, &xua_accept_dyn_asp_cmd); } - -void osmo_ss7_set_vty_alloc_ctx(void *ctx) -{ - g_ctx = ctx; -}; diff --git a/stp/stp_main.c b/stp/stp_main.c index 074272b..ac8e6dd 100644 --- a/stp/stp_main.c +++ b/stp/stp_main.c @@ -137,7 +137,7 @@ osmo_ss7_init(); osmo_fsm_log_addr(false); logging_vty_add_cmds(&log_info); - osmo_ss7_vty_init_sg(); + osmo_ss7_vty_init_sg(NULL); osmo_fsm_vty_add_cmds(); rc = vty_read_config_file(cmdline_config.config_file, NULL); -- To view, visit https://gerrit.osmocom.org/3360 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Id4e7f47979001f7856b0b3665c9e94982e75e490 Gerrit-PatchSet: 2 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Tue Aug 8 18:25:52 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 8 Aug 2017 18:25:52 +0000 Subject: [MERGED] libosmo-sccp[master]: add osmo_sccp_addr_set_ssn() In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: add osmo_sccp_addr_set_ssn() ...................................................................... add osmo_sccp_addr_set_ssn() Will be used by e.g. osmo-hnbgw to add an SSN to addresses obtained from the sccp address book. Change-Id: I85b46269dbe7909e52873ace3f720f6292a4516c --- M include/osmocom/sigtran/sccp_helpers.h M src/sccp_helpers.c 2 files changed, 8 insertions(+), 0 deletions(-) Approvals: dexter: Looks good to me, but someone else must approve Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/include/osmocom/sigtran/sccp_helpers.h b/include/osmocom/sigtran/sccp_helpers.h index ecf583e..2f318f4 100644 --- a/include/osmocom/sigtran/sccp_helpers.h +++ b/include/osmocom/sigtran/sccp_helpers.h @@ -17,6 +17,8 @@ void osmo_sccp_make_addr_pc_ssn(struct osmo_sccp_addr *addr, uint32_t pc, uint32_t ssn); +void osmo_sccp_addr_set_ssn(struct osmo_sccp_addr *addr, uint32_t ssn); + int osmo_sccp_tx_unitdata_ranap(struct osmo_sccp_user *scu, uint32_t src_point_code, uint32_t dst_point_code, diff --git a/src/sccp_helpers.c b/src/sccp_helpers.c index 76a7c1c..2320fe5 100644 --- a/src/sccp_helpers.c +++ b/src/sccp_helpers.c @@ -44,6 +44,12 @@ addr->pc = pc; } +void osmo_sccp_addr_set_ssn(struct osmo_sccp_addr *addr, uint32_t ssn) +{ + addr->presence |= OSMO_SCCP_ADDR_T_SSN; + addr->ssn = ssn; +} + int osmo_sccp_tx_unitdata(struct osmo_sccp_user *scu, const struct osmo_sccp_addr *calling_addr, const struct osmo_sccp_addr *called_addr, -- To view, visit https://gerrit.osmocom.org/3359 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I85b46269dbe7909e52873ace3f720f6292a4516c Gerrit-PatchSet: 2 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: dexter From gerrit-no-reply at lists.osmocom.org Tue Aug 8 18:26:13 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Tue, 8 Aug 2017 18:26:13 +0000 Subject: libosmo-netif[master]: tests: osmo-pcap: Fix per packet timer In-Reply-To: References: Message-ID: Patch Set 1: Gentle ping for this one. It's been in review process for more than a month now. Is there something preventing to merge it? -- To view, visit https://gerrit.osmocom.org/3063 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I715865c1edd1fc2ec9b024671d91eb72559cbdea Gerrit-PatchSet: 1 Gerrit-Project: libosmo-netif Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Aug 8 18:28:18 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 8 Aug 2017 18:28:18 +0000 Subject: libosmo-netif[master]: tests: osmo-pcap: Fix per packet timer In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 (1 comment) https://gerrit.osmocom.org/#/c/3063/1/tests/osmo-pcap-test/pcap.c File tests/osmo-pcap-test/pcap.c: Line 112: if(p->deliver_msg) { if 'if' was a function... -- To view, visit https://gerrit.osmocom.org/3063 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I715865c1edd1fc2ec9b024671d91eb72559cbdea Gerrit-PatchSet: 1 Gerrit-Project: libosmo-netif Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Tue Aug 8 18:28:45 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 8 Aug 2017 18:28:45 +0000 Subject: libosmo-netif[master]: tests: osmo-pcap: Allow different l2 pkts In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3064 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ie62fa0a8e45e1e141edb64b116dad185ad9c7a5f Gerrit-PatchSet: 1 Gerrit-Project: libosmo-netif Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Aug 8 18:42:08 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Tue, 8 Aug 2017 18:42:08 +0000 Subject: [PATCH] libosmo-netif[master]: tests: osmo-pcap: Fix per packet timer 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/3063 to look at the new patch set (#2). tests: osmo-pcap: Fix per packet timer Before this commit, the gap time between 2 packets {n-1, n} was being applied to {n, n+1}. Change-Id: I715865c1edd1fc2ec9b024671d91eb72559cbdea --- M tests/osmo-pcap-test/osmo_pcap.h M tests/osmo-pcap-test/pcap.c 2 files changed, 13 insertions(+), 7 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-netif refs/changes/63/3063/2 diff --git a/tests/osmo-pcap-test/osmo_pcap.h b/tests/osmo-pcap-test/osmo_pcap.h index cff638b..171360d 100644 --- a/tests/osmo-pcap-test/osmo_pcap.h +++ b/tests/osmo-pcap-test/osmo_pcap.h @@ -12,6 +12,7 @@ pcap_t *h; struct osmo_timer_list timer; struct timeval last; + struct msgb *deliver_msg; }; pcap_t *osmo_pcap_test_open(const char *pcapfile); diff --git a/tests/osmo-pcap-test/pcap.c b/tests/osmo-pcap-test/pcap.c index 8fa8e0f..61408f8 100644 --- a/tests/osmo-pcap-test/pcap.c +++ b/tests/osmo-pcap-test/pcap.c @@ -39,7 +39,8 @@ } osmo_pcap_test_stats; static int -osmo_pcap_process_packet(const uint8_t *pkt, uint32_t pktlen, +osmo_pcap_process_packet(struct msgb **msgptr, + const uint8_t *pkt, uint32_t pktlen, struct osmo_pcap_proto_l2l3 *l3h, struct osmo_pcap_proto_l4 *l4h, int (*cb)(struct msgb *msgb)) @@ -56,7 +57,7 @@ /* This packet contains no data, skip it. */ if (l4h->l4pkt_no_data(pkt + l3hdr_len + ETH_HLEN)) { osmo_pcap_test_stats.skip++; - return 0; + return -1; } /* get application layer data. */ @@ -72,11 +73,9 @@ memcpy(msgb->data, pkt, pktlen); msgb_put(msgb, pktlen); - ret = cb(msgb); + *msgptr = msgb; - osmo_pcap_test_stats.processed++; - - return ret; + return 0; } pcap_t *osmo_pcap_test_open(const char *pcapfile) @@ -109,6 +108,12 @@ struct timeval res; uint8_t l4protonum; + if (p->deliver_msg) { + if (cb(p->deliver_msg) == 0) + osmo_pcap_test_stats.processed++; + p->deliver_msg = 0; + } + retry: pkt = pcap_next(p->h, &pcaph); if (pkt == NULL) @@ -140,7 +145,7 @@ memcpy(&p->last, &pcaph.ts, sizeof(struct timeval)); /* retry with next packet if this has been skipped. */ - if (osmo_pcap_process_packet(pkt, pcaph.caplen, l3h, l4h, cb) < 0) + if (osmo_pcap_process_packet(&p->deliver_msg, pkt, pcaph.caplen, l3h, l4h, cb) < 0) goto retry; /* calculate waiting time */ -- To view, visit https://gerrit.osmocom.org/3063 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I715865c1edd1fc2ec9b024671d91eb72559cbdea Gerrit-PatchSet: 2 Gerrit-Project: libosmo-netif Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Tue Aug 8 18:42:08 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Tue, 8 Aug 2017 18:42:08 +0000 Subject: [PATCH] libosmo-netif[master]: tests: osmo-pcap: Allow different l2 pkts 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/3064 to look at the new patch set (#2). tests: osmo-pcap: Allow different l2 pkts Before this patch, ETH was assumed and other types were not supported. This patch also adds Linux cooked packet support for L2. Change-Id: Ie62fa0a8e45e1e141edb64b116dad185ad9c7a5f --- M tests/osmo-pcap-test/Makefile.am A tests/osmo-pcap-test/l2_eth.c A tests/osmo-pcap-test/l2_sll.c M tests/osmo-pcap-test/l3_ipv4.c M tests/osmo-pcap-test/l4_tcp.c M tests/osmo-pcap-test/l4_udp.c M tests/osmo-pcap-test/pcap.c M tests/osmo-pcap-test/proto.c M tests/osmo-pcap-test/proto.h 9 files changed, 189 insertions(+), 50 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-netif refs/changes/64/3064/2 diff --git a/tests/osmo-pcap-test/Makefile.am b/tests/osmo-pcap-test/Makefile.am index a256005..3e5bdf1 100644 --- a/tests/osmo-pcap-test/Makefile.am +++ b/tests/osmo-pcap-test/Makefile.am @@ -3,6 +3,8 @@ check_PROGRAMS = osmo-pcap-test osmo_pcap_test_SOURCES = proto.c \ + l2_eth.c \ + l2_sll.c \ l3_ipv4.c \ l4_tcp.c \ l4_udp.c \ diff --git a/tests/osmo-pcap-test/l2_eth.c b/tests/osmo-pcap-test/l2_eth.c new file mode 100644 index 0000000..3171fd7 --- /dev/null +++ b/tests/osmo-pcap-test/l2_eth.c @@ -0,0 +1,48 @@ +/* + * (C) 2012 by Pablo Neira Ayuso + * (C) 2012 by On Waves ehf + * + * 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 vers + */ + +#include +#include +#include +#include +#include + +#include "proto.h" + +#define PRINT_CMP(...) + +static int unsigned l2_eth_pkt_l3proto_num(const uint8_t *pkt) +{ + const struct ethhdr *eh = (const struct ethhdr *)pkt; + switch(ntohs(eh->h_proto)) { + case ETH_P_IP: + return htons(AF_INET); + default: + return eh->h_proto; + } +} + +static unsigned int l2_eth_pkt_l2hdr_len(const uint8_t *pkt) +{ + + return ETH_HLEN; +} + +static struct osmo_pcap_proto_l2 eth = { + //.l2protonum = ETH_P_IP, + .l2protonum = DLT_EN10MB, + .l2pkt_hdr_len = l2_eth_pkt_l2hdr_len, + .l3pkt_proto = l2_eth_pkt_l3proto_num, +}; + +void l2_eth_init(void) +{ + osmo_pcap_proto_l2_register(ð); +} diff --git a/tests/osmo-pcap-test/l2_sll.c b/tests/osmo-pcap-test/l2_sll.c new file mode 100644 index 0000000..5a600ff --- /dev/null +++ b/tests/osmo-pcap-test/l2_sll.c @@ -0,0 +1,47 @@ +/* + * (C) 2012 by Pablo Neira Ayuso + * (C) 2012 by On Waves ehf + * + * 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 vers + */ + +#include +#include +#include +#include +#include + +#include "proto.h" + +#define PRINT_CMP(...) + +static unsigned int l2_sll_pkt_l3proto_num(const uint8_t *pkt) +{ + const struct sll_header *lh = (const struct sll_header *)pkt; + switch(ntohs(lh->sll_protocol)) { + case ETH_P_IP: + return htons(AF_INET); + default: + return lh->sll_protocol; + } +} + +static unsigned int l2_sll_pkt_l2hdr_len(const uint8_t *pkt) +{ + + return SLL_HDR_LEN; +} + +static struct osmo_pcap_proto_l2 sll = { + .l2protonum = DLT_LINUX_SLL, + .l2pkt_hdr_len = l2_sll_pkt_l2hdr_len, + .l3pkt_proto = l2_sll_pkt_l3proto_num, +}; + +void l2_sll_init(void) +{ + osmo_pcap_proto_l2_register(&sll); +} diff --git a/tests/osmo-pcap-test/l3_ipv4.c b/tests/osmo-pcap-test/l3_ipv4.c index 83e3479..521a803 100644 --- a/tests/osmo-pcap-test/l3_ipv4.c +++ b/tests/osmo-pcap-test/l3_ipv4.c @@ -16,29 +16,27 @@ #define PRINT_CMP(...) -static int l3_ipv4_pkt_l4proto_num(const uint8_t *pkt) +static unsigned int l3_ipv4_pkt_l4proto_num(const uint8_t *pkt) { const struct iphdr *iph = (const struct iphdr *)pkt; return iph->protocol; } -static int l3_ipv4_pkt_l3hdr_len(const uint8_t *pkt) +static unsigned int l3_ipv4_pkt_l3hdr_len(const uint8_t *pkt) { const struct iphdr *iph = (const struct iphdr *)pkt; return iph->ihl << 2; } -static struct osmo_pcap_proto_l2l3 ipv4 = { - .l2protonum = ETH_P_IP, +static struct osmo_pcap_proto_l3 ipv4 = { .l3protonum = AF_INET, - .l2hdr_len = ETH_HLEN, .l3pkt_hdr_len = l3_ipv4_pkt_l3hdr_len, .l4pkt_proto = l3_ipv4_pkt_l4proto_num, }; -void l2l3_ipv4_init(void) +void l3_ipv4_init(void) { - osmo_pcap_proto_l2l3_register(&ipv4); + osmo_pcap_proto_l3_register(&ipv4); } diff --git a/tests/osmo-pcap-test/l4_tcp.c b/tests/osmo-pcap-test/l4_tcp.c index 1e024b5..f7aedbd 100644 --- a/tests/osmo-pcap-test/l4_tcp.c +++ b/tests/osmo-pcap-test/l4_tcp.c @@ -13,14 +13,14 @@ #include "proto.h" -static int l4_tcp_pkt_hdr_len(const uint8_t *pkt) +static unsigned int l4_tcp_pkt_hdr_len(const uint8_t *pkt) { const struct tcphdr *tcph = (const struct tcphdr *)pkt; return tcph->doff << 2; } -static int l4_tcp_pkt_no_data(const uint8_t *pkt) +static unsigned int l4_tcp_pkt_no_data(const uint8_t *pkt) { const struct tcphdr *tcph = (const struct tcphdr *)pkt; return tcph->syn || tcph->fin || tcph->rst || !tcph->psh; diff --git a/tests/osmo-pcap-test/l4_udp.c b/tests/osmo-pcap-test/l4_udp.c index 9ffa77b..1733908 100644 --- a/tests/osmo-pcap-test/l4_udp.c +++ b/tests/osmo-pcap-test/l4_udp.c @@ -13,12 +13,12 @@ #include "proto.h" -static int l4_udp_pkt_hdr_len(const uint8_t *pkt) +static unsigned int l4_udp_pkt_hdr_len(const uint8_t *pkt) { return sizeof(struct udphdr); } -static int l4_udp_pkt_no_data(const uint8_t *pkt) +static unsigned int l4_udp_pkt_no_data(const uint8_t *pkt) { /* UDP has no control packets. */ return 0; diff --git a/tests/osmo-pcap-test/pcap.c b/tests/osmo-pcap-test/pcap.c index 61408f8..f9304b9 100644 --- a/tests/osmo-pcap-test/pcap.c +++ b/tests/osmo-pcap-test/pcap.c @@ -34,6 +34,7 @@ uint32_t pkts; uint32_t skip; uint32_t processed; + uint32_t unsupported_l2; uint32_t unsupported_l3; uint32_t unsupported_l4; } osmo_pcap_test_stats; @@ -41,21 +42,22 @@ static int osmo_pcap_process_packet(struct msgb **msgptr, const uint8_t *pkt, uint32_t pktlen, - struct osmo_pcap_proto_l2l3 *l3h, + struct osmo_pcap_proto_l2 *l2h, + struct osmo_pcap_proto_l3 *l3h, struct osmo_pcap_proto_l4 *l4h, int (*cb)(struct msgb *msgb)) { - unsigned int l3hdr_len, skip_hdr_len; + unsigned int l2hdr_len, l3hdr_len, skip_hdr_len; struct msgb *msgb; - int ret; /* skip layer 2, 3 and 4 headers */ - l3hdr_len = l3h->l3pkt_hdr_len(pkt + ETH_HLEN); - skip_hdr_len = l3h->l2hdr_len + l3hdr_len + - l4h->l4pkt_hdr_len(pkt + ETH_HLEN + l3hdr_len); + l2hdr_len = l2h->l2pkt_hdr_len(pkt); + l3hdr_len = l3h->l3pkt_hdr_len(pkt + l2hdr_len); + skip_hdr_len = l2hdr_len + l3hdr_len + + l4h->l4pkt_hdr_len(pkt + l2hdr_len + l3hdr_len); /* This packet contains no data, skip it. */ - if (l4h->l4pkt_no_data(pkt + l3hdr_len + ETH_HLEN)) { + if (l4h->l4pkt_no_data(pkt + l2hdr_len + l3hdr_len)) { osmo_pcap_test_stats.skip++; return -1; } @@ -101,10 +103,11 @@ int osmo_pcap_test_run(struct osmo_pcap *p, uint8_t pnum, int (*cb)(struct msgb *msgb)) { - struct osmo_pcap_proto_l2l3 *l3h; + struct osmo_pcap_proto_l2 *l2h; + struct osmo_pcap_proto_l3 *l3h; struct osmo_pcap_proto_l4 *l4h; struct pcap_pkthdr pcaph; - const u_char *pkt; + const u_char *l2pkt, *l3pkt; struct timeval res; uint8_t l4protonum; @@ -115,26 +118,34 @@ } retry: - pkt = pcap_next(p->h, &pcaph); - if (pkt == NULL) + l2pkt = pcap_next(p->h, &pcaph); + if (l2pkt == NULL) return -1; osmo_pcap_test_stats.pkts++; - l3h = osmo_pcap_proto_l2l3_find(pkt); + int linktype = pcap_datalink(p->h); + l2h = osmo_pcap_proto_l2_find(linktype); + if (l2h == NULL) { + osmo_pcap_test_stats.unsupported_l2++; + goto retry; + } + + l3h = osmo_pcap_proto_l3_find(l2h->l3pkt_proto(l2pkt)); if (l3h == NULL) { osmo_pcap_test_stats.unsupported_l3++; goto retry; } - l4protonum = l3h->l4pkt_proto(pkt + ETH_HLEN); + l3pkt = l2pkt + l2h->l2pkt_hdr_len(l2pkt); + l4protonum = l3h->l4pkt_proto(l3pkt); /* filter l4 protocols we are not interested in */ if (l4protonum != pnum) { osmo_pcap_test_stats.skip++; goto retry; } - l4h = osmo_pcap_proto_l4_find(pkt, l4protonum); + l4h = osmo_pcap_proto_l4_find(l4protonum); if (l4h == NULL) { osmo_pcap_test_stats.unsupported_l4++; goto retry; @@ -145,7 +156,7 @@ memcpy(&p->last, &pcaph.ts, sizeof(struct timeval)); /* retry with next packet if this has been skipped. */ - if (osmo_pcap_process_packet(&p->deliver_msg, pkt, pcaph.caplen, l3h, l4h, cb) < 0) + if (osmo_pcap_process_packet(&p->deliver_msg, l2pkt, pcaph.caplen, l2h, l3h, l4h, cb) < 0) goto retry; /* calculate waiting time */ @@ -161,19 +172,22 @@ void osmo_pcap_stats_printf(void) { - printf("pkts=%d processed=%d skip=%d " + printf("pkts=%d processed=%d skip=%d unsupported_l2=%d " "unsupported_l3=%d unsupported_l4=%d\n", osmo_pcap_test_stats.pkts, osmo_pcap_test_stats.processed, osmo_pcap_test_stats.skip, + osmo_pcap_test_stats.unsupported_l2, osmo_pcap_test_stats.unsupported_l3, osmo_pcap_test_stats.unsupported_l4); } void osmo_pcap_init(void) { - /* Initialization of supported layer 3 and 4 protocols here. */ - l2l3_ipv4_init(); + /* Initialization of supported layer 2, 3 and 4 protocols here. */ + l2_eth_init(); + l2_sll_init(); + l3_ipv4_init(); l4_tcp_init(); l4_udp_init(); } diff --git a/tests/osmo-pcap-test/proto.c b/tests/osmo-pcap-test/proto.c index f90f07c..085ca25 100644 --- a/tests/osmo-pcap-test/proto.c +++ b/tests/osmo-pcap-test/proto.c @@ -15,28 +15,46 @@ #include #include "proto.h" -static LLIST_HEAD(l2l3_proto_list); +static LLIST_HEAD(l2_proto_list); +static LLIST_HEAD(l3_proto_list); static LLIST_HEAD(l4_proto_list); +#include -struct osmo_pcap_proto_l2l3 *osmo_pcap_proto_l2l3_find(const uint8_t *pkt) +struct osmo_pcap_proto_l2 *osmo_pcap_proto_l2_find(unsigned int pcap_linktype) { - const struct ethhdr *eh = (const struct ethhdr *)pkt; - struct osmo_pcap_proto_l2l3 *cur; + struct osmo_pcap_proto_l2 *cur; - llist_for_each_entry(cur, &l2l3_proto_list, head) { - if (ntohs(cur->l2protonum) == eh->h_proto) + llist_for_each_entry(cur, &l2_proto_list, head) { + if (cur->l2protonum == pcap_linktype) return cur; } return NULL; } -void osmo_pcap_proto_l2l3_register(struct osmo_pcap_proto_l2l3 *h) +void osmo_pcap_proto_l2_register(struct osmo_pcap_proto_l2 *h) { - llist_add(&h->head, &l2l3_proto_list); + llist_add(&h->head, &l2_proto_list); +} + + +struct osmo_pcap_proto_l3 *osmo_pcap_proto_l3_find(unsigned int l3protocol) +{ + struct osmo_pcap_proto_l3 *cur; + + llist_for_each_entry(cur, &l3_proto_list, head) { + if (ntohs(cur->l3protonum) == l3protocol) + return cur; + } + return NULL; +} + +void osmo_pcap_proto_l3_register(struct osmo_pcap_proto_l3 *h) +{ + llist_add(&h->head, &l3_proto_list); } struct osmo_pcap_proto_l4 * -osmo_pcap_proto_l4_find(const uint8_t *pkt, unsigned int l4protocol) +osmo_pcap_proto_l4_find(unsigned int l4protocol) { struct osmo_pcap_proto_l4 *cur; diff --git a/tests/osmo-pcap-test/proto.h b/tests/osmo-pcap-test/proto.h index 8cb41ed..2580058 100644 --- a/tests/osmo-pcap-test/proto.h +++ b/tests/osmo-pcap-test/proto.h @@ -10,30 +10,42 @@ unsigned int l4protonum; - int (*l4pkt_hdr_len)(const uint8_t *pkt); - int (*l4pkt_no_data)(const uint8_t *pkt); + unsigned int (*l4pkt_hdr_len)(const uint8_t *pkt); + unsigned int (*l4pkt_no_data)(const uint8_t *pkt); }; -struct osmo_pcap_proto_l2l3 { +struct osmo_pcap_proto_l3 { struct llist_head head; - - unsigned int l2protonum; - unsigned int l2hdr_len; unsigned int l3protonum; - int (*l3pkt_hdr_len)(const uint8_t *pkt); - int (*l4pkt_proto)(const uint8_t *pkt); + unsigned int (*l3pkt_hdr_len)(const uint8_t *pkt); + unsigned int (*l4pkt_proto)(const uint8_t *pkt); }; -struct osmo_pcap_proto_l2l3 *osmo_pcap_proto_l2l3_find(const uint8_t *pkt); -void osmo_pcap_proto_l2l3_register(struct osmo_pcap_proto_l2l3 *h); +struct osmo_pcap_proto_l2 { + struct llist_head head; -struct osmo_pcap_proto_l4 *osmo_pcap_proto_l4_find(const uint8_t *pkt, unsigned int l4protonum); + unsigned int l2protonum; + + unsigned int (*l2pkt_hdr_len)(const uint8_t *pkt); + unsigned int (*l3pkt_proto)(const uint8_t *pkt); +}; + + +struct osmo_pcap_proto_l2 *osmo_pcap_proto_l2_find(unsigned int pcap_linktype); +void osmo_pcap_proto_l2_register(struct osmo_pcap_proto_l2 *h); + +struct osmo_pcap_proto_l3 *osmo_pcap_proto_l3_find(unsigned int l3protonum); +void osmo_pcap_proto_l3_register(struct osmo_pcap_proto_l3 *h); + +struct osmo_pcap_proto_l4 *osmo_pcap_proto_l4_find(unsigned int l4protonum); void osmo_pcap_proto_l4_register(struct osmo_pcap_proto_l4 *h); /* Initialization of supported protocols here. */ -void l2l3_ipv4_init(void); +void l2_sll_init(void); +void l2_eth_init(void); +void l3_ipv4_init(void); void l4_tcp_init(void); void l4_udp_init(void); -- To view, visit https://gerrit.osmocom.org/3064 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ie62fa0a8e45e1e141edb64b116dad185ad9c7a5f Gerrit-PatchSet: 2 Gerrit-Project: libosmo-netif Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Tue Aug 8 18:43:40 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Tue, 8 Aug 2017 18:43:40 +0000 Subject: libosmo-netif[master]: tests: osmo-pcap: Fix per packet timer In-Reply-To: References: Message-ID: Patch Set 2: Rebased on top of current master + fixed whitespace with if (one in each commit actually). -- To view, visit https://gerrit.osmocom.org/3063 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I715865c1edd1fc2ec9b024671d91eb72559cbdea Gerrit-PatchSet: 2 Gerrit-Project: libosmo-netif Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Aug 9 08:46:29 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 9 Aug 2017 08:46:29 +0000 Subject: openbsc[master]: libmsc: set registered_delivery field in SMPP 3.4 DELIVER_SM... In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 (1 comment) https://gerrit.osmocom.org/#/c/3428/1/openbsc/src/libmsc/smpp_openbsc.c File openbsc/src/libmsc/smpp_openbsc.c: Line 607: #define SMPP34_DELIVERY_RECEIPT_REQ 0x1 > OK, I didn't know about this policy. it's not a strict policy, just a "FYI". Feel free to keep it or chagne it. -- To view, visit https://gerrit.osmocom.org/3428 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I59af60fa89cd10ae973c5e122789e3e03e3728ee Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Pablo Neira Ayuso Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Keith Whyte Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pablo Neira Ayuso Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Wed Aug 9 08:47:09 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 9 Aug 2017 08:47:09 +0000 Subject: openbsc[master]: libmsc: missing bit shift in status report flag when stored ... In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3430 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Idb7d5594219c0e458ccb561383a59604bc1a4201 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Pablo Neira Ayuso Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Keith Whyte Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Aug 9 08:52:12 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 9 Aug 2017 08:52:12 +0000 Subject: openbsc[master]: libmsc: handle delivery ack via SMPP SUBMIT SM / send GSM 03... In-Reply-To: References: Message-ID: Patch Set 1: (1 comment) https://gerrit.osmocom.org/#/c/3437/1/openbsc/src/libmsc/gsm_04_11.c File openbsc/src/libmsc/gsm_04_11.c: Line 280: /* As defined by GSM 03.40, Section 9.2.2.3. */ > (in comments we usually say "3GPP TS 03.40") actually, we normally say "GSM TS xx.yy" or "3GPP TS xx.yyy", if you really want to make a comment here. But we really shouldn't spend time on such details. The reader will know what is meant. -- To view, visit https://gerrit.osmocom.org/3437 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ib70e534840308ed315f7add440351e649de3f907 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Pablo Neira Ayuso Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Keith Whyte Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Wed Aug 9 08:52:28 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 9 Aug 2017 08:52:28 +0000 Subject: openbsc[master]: libmsc: handle delivery ack via SMPP SUBMIT SM / send GSM 03... In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3437 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ib70e534840308ed315f7add440351e649de3f907 Gerrit-PatchSet: 2 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Pablo Neira Ayuso Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Keith Whyte Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Aug 9 08:54:40 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 9 Aug 2017 08:54:40 +0000 Subject: openbsc[master]: libmsc: update database to accomodate SMS status-report fields In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3435 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I7276d356d805a83ebeec72b02c8563b7135ea0b6 Gerrit-PatchSet: 2 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Pablo Neira Ayuso Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Keith Whyte Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Aug 9 09:22:20 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 9 Aug 2017 09:22:20 +0000 Subject: openbsc[master]: utils: smpp_mirror: reflect message reference TLV In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3433 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I1b0abaa7e06ffe1bd2242c70813d8b70e9fa954f Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Pablo Neira Ayuso Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Keith Whyte Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pablo Neira Ayuso Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Aug 9 09:23:02 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 9 Aug 2017 09:23:02 +0000 Subject: openbsc[master]: libmsc: report status report request flag from SMPP SUBMIT_SM In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3429 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Iac05252253f8933a3875b4904599b7a225191a4b Gerrit-PatchSet: 2 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Pablo Neira Ayuso Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Keith Whyte Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pablo Neira Ayuso Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Aug 9 09:23:30 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 9 Aug 2017 09:23:30 +0000 Subject: openbsc[master]: utils: smpp_mirror: temporarily munch SMPP delivery receipts In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3432 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I78e93bc4034679e238c8642ccf6a0e844b1d6d8b Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Pablo Neira Ayuso Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Keith Whyte Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Aug 9 09:27:32 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 9 Aug 2017 09:27:32 +0000 Subject: openbsc[master]: gsm_04_11: get rid of unused parameter in sms_route_mt_sms() In-Reply-To: References: Message-ID: Patch Set 1: I think particularly if all functions are 'static' and within one file, any reasonably optimizing compiler should remove unused function arguments, so this is a bit of a pseudo-discussion here. We do have several places in the code where we pass along some objects either to make function signatures similar with other functions, or if we're not sure if we will need it at a not-too-distant point (if we take a short-cut by not checking some things we should check, e.g.). Summary: I would simply mark the function as static (as in this patch) but not remove unused arguments. But then, honestly, I don't care. We can also simply leave it like it is. -- To view, visit https://gerrit.osmocom.org/3422 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I797abce3f91447e8f397c7cf726db7425479fe0e Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Pablo Neira Ayuso Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Keith Whyte Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pablo Neira Ayuso Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Aug 9 09:27:48 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 9 Aug 2017 09:27:48 +0000 Subject: openbsc[master]: utils: smpp_mirror: set registered_delivery field in SMPP SU... In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3431 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I0e477407531fdd4d906e53c9b5a48a79a239966f Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Pablo Neira Ayuso Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Keith Whyte Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Aug 9 09:28:17 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 9 Aug 2017 09:28:17 +0000 Subject: openbsc[master]: libmsc: do not leak pending SMPP command object on error path In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3423 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I474584425d23fb379a9d71b33e29ac0e24f01e61 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Pablo Neira Ayuso Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Keith Whyte Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Aug 9 09:46:14 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 9 Aug 2017 09:46:14 +0000 Subject: openbsc[master]: libmsc: remove 'deferred' parameter in sms_route_mt_sms() In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3426 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Iba5f864f9bb963baff95969e306b1b7cff00c1e3 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Pablo Neira Ayuso Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Keith Whyte Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Aug 9 09:46:36 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 9 Aug 2017 09:46:36 +0000 Subject: openbsc[master]: libmsc: remove duplicate lines in deliver_to_esme() In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3425 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I68087a850399e22951d2407e4d8a09c671a775c9 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Pablo Neira Ayuso Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Keith Whyte Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Aug 9 09:47:09 2017 From: gerrit-no-reply at lists.osmocom.org (Pablo Neira Ayuso) Date: Wed, 9 Aug 2017 09:47:09 +0000 Subject: openbsc[master]: gsm_04_11: get rid of unused parameter in sms_route_mt_sms() In-Reply-To: References: Message-ID: Patch Set 1: I need to call gsm340_rx_sms_submit() in the last patch of this series, to add support for status-report in nitb mode. In such scenario, I have no real msgb object, since the struct gsm_sms object is allocated from the SMPP SUBMIT_SM esm_class = Delivery Acknoledgement. If this patch is kept back, I will have to pass a NULL pointer as parameter here when calling gsm340_rx_sms_submit() from the new sms_status_report() path. -- To view, visit https://gerrit.osmocom.org/3422 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I797abce3f91447e8f397c7cf726db7425479fe0e Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Pablo Neira Ayuso Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Keith Whyte Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pablo Neira Ayuso Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Aug 9 09:47:17 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 9 Aug 2017 09:47:17 +0000 Subject: openbsc[master]: libmsc: remove dead code in sms_route_mt_sms() In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3424 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ic3502b5b169bc7a73a67fd6ff53d8b6c0dc045c8 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Pablo Neira Ayuso Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Keith Whyte Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Aug 9 09:52:19 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 9 Aug 2017 09:52:19 +0000 Subject: libasn1c[master]: add /debian to build a package In-Reply-To: References: Message-ID: Patch Set 1: > (1 comment) > > @hwelte, is there also material copyrighted by you in libasn1c? yes, specifically asn1helpers.[ch] -- To view, visit https://gerrit.osmocom.org/3440 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I135d975b84027d51cb1dc534e04dd314bbd20289 Gerrit-PatchSet: 1 Gerrit-Project: libasn1c Gerrit-Branch: master Gerrit-Owner: lynxis lazus Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Aug 9 09:53:00 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 9 Aug 2017 09:53:00 +0000 Subject: libasn1c[master]: add .gitreview to support git review plugin In-Reply-To: References: Message-ID: Patch Set 1: Verified+1 -- To view, visit https://gerrit.osmocom.org/3439 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ia197da1614a8cbec5f177368ca9e25946059c68a Gerrit-PatchSet: 1 Gerrit-Project: libasn1c Gerrit-Branch: master Gerrit-Owner: lynxis lazus Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Aug 9 09:53:02 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 9 Aug 2017 09:53:02 +0000 Subject: [MERGED] libasn1c[master]: add .gitreview to support git review plugin In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: add .gitreview to support git review plugin ...................................................................... add .gitreview to support git review plugin Change-Id: Ia197da1614a8cbec5f177368ca9e25946059c68a --- A .gitreview 1 file changed, 3 insertions(+), 0 deletions(-) Approvals: Neels Hofmeyr: Looks good to me, approved Harald Welte: Verified diff --git a/.gitreview b/.gitreview new file mode 100644 index 0000000..972358d --- /dev/null +++ b/.gitreview @@ -0,0 +1,3 @@ +[gerrit] +host=gerrit.osmocom.org +project=libasn1c -- To view, visit https://gerrit.osmocom.org/3439 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ia197da1614a8cbec5f177368ca9e25946059c68a Gerrit-PatchSet: 1 Gerrit-Project: libasn1c Gerrit-Branch: master Gerrit-Owner: lynxis lazus Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Wed Aug 9 09:53:35 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 9 Aug 2017 09:53:35 +0000 Subject: [MERGED] libosmo-sccp[master]: sccp: add function to check sccp addresses In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: sccp: add function to check sccp addresses ...................................................................... sccp: add function to check sccp addresses In order to catch invalid CS7 configurations, It is necessary to check if sccp addresses contain plausible address data. Change-Id: Ic6245288b0171eae10aa708403c1ddb584c92f38 --- M include/osmocom/sigtran/sccp_sap.h M src/sccp_user.c 2 files changed, 44 insertions(+), 0 deletions(-) Approvals: Neels Hofmeyr: Looks good to me, approved Jenkins Builder: Verified diff --git a/include/osmocom/sigtran/sccp_sap.h b/include/osmocom/sigtran/sccp_sap.h index 732df2a..90da686 100644 --- a/include/osmocom/sigtran/sccp_sap.h +++ b/include/osmocom/sigtran/sccp_sap.h @@ -257,3 +257,5 @@ void osmo_sccp_local_addr_by_instance(struct osmo_sccp_addr *dest_addr, const struct osmo_sccp_instance *inst, uint32_t ssn); + +bool osmo_sccp_check_addr(struct osmo_sccp_addr *addr, uint32_t presence); diff --git a/src/sccp_user.c b/src/sccp_user.c index 495b6dc..71b3262 100644 --- a/src/sccp_user.c +++ b/src/sccp_user.c @@ -253,6 +253,48 @@ osmo_sccp_make_addr_pc_ssn(dest_addr, ss7->cfg.primary_pc, ssn); } +/*! \brief check whether a given SCCP-Address is consistent. + * \param[in] addr SCCP address to check + * \param[in] presence mask with minimum required address components + * \returns true when address data seems plausible */ +bool osmo_sccp_check_addr(struct osmo_sccp_addr *addr, uint32_t presence) +{ + /* Minimum requirements do not match */ + if ((addr->presence & presence) != presence) + return false; + + /* GT ranges */ + if (addr->presence & OSMO_SCCP_ADDR_T_GT) { + if (addr->gt.gti > 15) + return false; + if (addr->gt.npi > 15) + return false; + if (addr->gt.nai > 127) + return false; + } + + /* Routing by GT, but no GT present */ + if (addr->ri == OSMO_SCCP_RI_GT + && !(addr->presence & OSMO_SCCP_ADDR_T_GT)) + return false; + + /* Routing by PC/SSN, but no PC/SSN present */ + if (addr->ri == OSMO_SCCP_RI_SSN_PC) { + if ((addr->presence & OSMO_SCCP_ADDR_T_PC) == 0) + return false; + if ((addr->presence & OSMO_SCCP_ADDR_T_SSN) == 0) + return false; + } + + if (addr->ri == OSMO_SCCP_RI_SSN_IP) { + if ((addr->presence & OSMO_SCCP_ADDR_T_IPv4) == 0 && + (addr->presence & OSMO_SCCP_ADDR_T_IPv6) == 0) + return false; + } + + return true; +} + /*********************************************************************** * Convenience function for CLIENT ***********************************************************************/ -- To view, visit https://gerrit.osmocom.org/3398 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ic6245288b0171eae10aa708403c1ddb584c92f38 Gerrit-PatchSet: 3 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Wed Aug 9 09:54:45 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 9 Aug 2017 09:54:45 +0000 Subject: osmo-pcu[master]: Add pcu-socket vty config In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+1 (1 comment) https://gerrit.osmocom.org/#/c/3443/2/src/pcu_vty.h File src/pcu_vty.h: Line 7: #define PCU_SOCK_DEFAULT "/tmp/pcu_bts" this should probably be part of pcuif_proto.h -- To view, visit https://gerrit.osmocom.org/3443 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I9b3e1171da467519750b201849ec892a1e318129 Gerrit-PatchSet: 2 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Wed Aug 9 09:55:06 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 9 Aug 2017 09:55:06 +0000 Subject: libosmo-netif[master]: tests: osmo-pcap: Fix per packet timer In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3063 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I715865c1edd1fc2ec9b024671d91eb72559cbdea Gerrit-PatchSet: 2 Gerrit-Project: libosmo-netif Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Aug 9 09:55:08 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 9 Aug 2017 09:55:08 +0000 Subject: [MERGED] libosmo-netif[master]: tests: osmo-pcap: Fix per packet timer In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: tests: osmo-pcap: Fix per packet timer ...................................................................... tests: osmo-pcap: Fix per packet timer Before this commit, the gap time between 2 packets {n-1, n} was being applied to {n, n+1}. Change-Id: I715865c1edd1fc2ec9b024671d91eb72559cbdea --- M tests/osmo-pcap-test/osmo_pcap.h M tests/osmo-pcap-test/pcap.c 2 files changed, 13 insertions(+), 7 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/tests/osmo-pcap-test/osmo_pcap.h b/tests/osmo-pcap-test/osmo_pcap.h index cff638b..171360d 100644 --- a/tests/osmo-pcap-test/osmo_pcap.h +++ b/tests/osmo-pcap-test/osmo_pcap.h @@ -12,6 +12,7 @@ pcap_t *h; struct osmo_timer_list timer; struct timeval last; + struct msgb *deliver_msg; }; pcap_t *osmo_pcap_test_open(const char *pcapfile); diff --git a/tests/osmo-pcap-test/pcap.c b/tests/osmo-pcap-test/pcap.c index 8fa8e0f..61408f8 100644 --- a/tests/osmo-pcap-test/pcap.c +++ b/tests/osmo-pcap-test/pcap.c @@ -39,7 +39,8 @@ } osmo_pcap_test_stats; static int -osmo_pcap_process_packet(const uint8_t *pkt, uint32_t pktlen, +osmo_pcap_process_packet(struct msgb **msgptr, + const uint8_t *pkt, uint32_t pktlen, struct osmo_pcap_proto_l2l3 *l3h, struct osmo_pcap_proto_l4 *l4h, int (*cb)(struct msgb *msgb)) @@ -56,7 +57,7 @@ /* This packet contains no data, skip it. */ if (l4h->l4pkt_no_data(pkt + l3hdr_len + ETH_HLEN)) { osmo_pcap_test_stats.skip++; - return 0; + return -1; } /* get application layer data. */ @@ -72,11 +73,9 @@ memcpy(msgb->data, pkt, pktlen); msgb_put(msgb, pktlen); - ret = cb(msgb); + *msgptr = msgb; - osmo_pcap_test_stats.processed++; - - return ret; + return 0; } pcap_t *osmo_pcap_test_open(const char *pcapfile) @@ -109,6 +108,12 @@ struct timeval res; uint8_t l4protonum; + if (p->deliver_msg) { + if (cb(p->deliver_msg) == 0) + osmo_pcap_test_stats.processed++; + p->deliver_msg = 0; + } + retry: pkt = pcap_next(p->h, &pcaph); if (pkt == NULL) @@ -140,7 +145,7 @@ memcpy(&p->last, &pcaph.ts, sizeof(struct timeval)); /* retry with next packet if this has been skipped. */ - if (osmo_pcap_process_packet(pkt, pcaph.caplen, l3h, l4h, cb) < 0) + if (osmo_pcap_process_packet(&p->deliver_msg, pkt, pcaph.caplen, l3h, l4h, cb) < 0) goto retry; /* calculate waiting time */ -- To view, visit https://gerrit.osmocom.org/3063 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I715865c1edd1fc2ec9b024671d91eb72559cbdea Gerrit-PatchSet: 2 Gerrit-Project: libosmo-netif Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Wed Aug 9 09:55:30 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 9 Aug 2017 09:55:30 +0000 Subject: libosmo-netif[master]: tests: osmo-pcap: Allow different l2 pkts In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3064 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ie62fa0a8e45e1e141edb64b116dad185ad9c7a5f Gerrit-PatchSet: 2 Gerrit-Project: libosmo-netif Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Aug 9 09:55:32 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 9 Aug 2017 09:55:32 +0000 Subject: [MERGED] libosmo-netif[master]: tests: osmo-pcap: Allow different l2 pkts In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: tests: osmo-pcap: Allow different l2 pkts ...................................................................... tests: osmo-pcap: Allow different l2 pkts Before this patch, ETH was assumed and other types were not supported. This patch also adds Linux cooked packet support for L2. Change-Id: Ie62fa0a8e45e1e141edb64b116dad185ad9c7a5f --- M tests/osmo-pcap-test/Makefile.am A tests/osmo-pcap-test/l2_eth.c A tests/osmo-pcap-test/l2_sll.c M tests/osmo-pcap-test/l3_ipv4.c M tests/osmo-pcap-test/l4_tcp.c M tests/osmo-pcap-test/l4_udp.c M tests/osmo-pcap-test/pcap.c M tests/osmo-pcap-test/proto.c M tests/osmo-pcap-test/proto.h 9 files changed, 189 insertions(+), 50 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/tests/osmo-pcap-test/Makefile.am b/tests/osmo-pcap-test/Makefile.am index a256005..3e5bdf1 100644 --- a/tests/osmo-pcap-test/Makefile.am +++ b/tests/osmo-pcap-test/Makefile.am @@ -3,6 +3,8 @@ check_PROGRAMS = osmo-pcap-test osmo_pcap_test_SOURCES = proto.c \ + l2_eth.c \ + l2_sll.c \ l3_ipv4.c \ l4_tcp.c \ l4_udp.c \ diff --git a/tests/osmo-pcap-test/l2_eth.c b/tests/osmo-pcap-test/l2_eth.c new file mode 100644 index 0000000..3171fd7 --- /dev/null +++ b/tests/osmo-pcap-test/l2_eth.c @@ -0,0 +1,48 @@ +/* + * (C) 2012 by Pablo Neira Ayuso + * (C) 2012 by On Waves ehf + * + * 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 vers + */ + +#include +#include +#include +#include +#include + +#include "proto.h" + +#define PRINT_CMP(...) + +static int unsigned l2_eth_pkt_l3proto_num(const uint8_t *pkt) +{ + const struct ethhdr *eh = (const struct ethhdr *)pkt; + switch(ntohs(eh->h_proto)) { + case ETH_P_IP: + return htons(AF_INET); + default: + return eh->h_proto; + } +} + +static unsigned int l2_eth_pkt_l2hdr_len(const uint8_t *pkt) +{ + + return ETH_HLEN; +} + +static struct osmo_pcap_proto_l2 eth = { + //.l2protonum = ETH_P_IP, + .l2protonum = DLT_EN10MB, + .l2pkt_hdr_len = l2_eth_pkt_l2hdr_len, + .l3pkt_proto = l2_eth_pkt_l3proto_num, +}; + +void l2_eth_init(void) +{ + osmo_pcap_proto_l2_register(ð); +} diff --git a/tests/osmo-pcap-test/l2_sll.c b/tests/osmo-pcap-test/l2_sll.c new file mode 100644 index 0000000..5a600ff --- /dev/null +++ b/tests/osmo-pcap-test/l2_sll.c @@ -0,0 +1,47 @@ +/* + * (C) 2012 by Pablo Neira Ayuso + * (C) 2012 by On Waves ehf + * + * 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 vers + */ + +#include +#include +#include +#include +#include + +#include "proto.h" + +#define PRINT_CMP(...) + +static unsigned int l2_sll_pkt_l3proto_num(const uint8_t *pkt) +{ + const struct sll_header *lh = (const struct sll_header *)pkt; + switch(ntohs(lh->sll_protocol)) { + case ETH_P_IP: + return htons(AF_INET); + default: + return lh->sll_protocol; + } +} + +static unsigned int l2_sll_pkt_l2hdr_len(const uint8_t *pkt) +{ + + return SLL_HDR_LEN; +} + +static struct osmo_pcap_proto_l2 sll = { + .l2protonum = DLT_LINUX_SLL, + .l2pkt_hdr_len = l2_sll_pkt_l2hdr_len, + .l3pkt_proto = l2_sll_pkt_l3proto_num, +}; + +void l2_sll_init(void) +{ + osmo_pcap_proto_l2_register(&sll); +} diff --git a/tests/osmo-pcap-test/l3_ipv4.c b/tests/osmo-pcap-test/l3_ipv4.c index 83e3479..521a803 100644 --- a/tests/osmo-pcap-test/l3_ipv4.c +++ b/tests/osmo-pcap-test/l3_ipv4.c @@ -16,29 +16,27 @@ #define PRINT_CMP(...) -static int l3_ipv4_pkt_l4proto_num(const uint8_t *pkt) +static unsigned int l3_ipv4_pkt_l4proto_num(const uint8_t *pkt) { const struct iphdr *iph = (const struct iphdr *)pkt; return iph->protocol; } -static int l3_ipv4_pkt_l3hdr_len(const uint8_t *pkt) +static unsigned int l3_ipv4_pkt_l3hdr_len(const uint8_t *pkt) { const struct iphdr *iph = (const struct iphdr *)pkt; return iph->ihl << 2; } -static struct osmo_pcap_proto_l2l3 ipv4 = { - .l2protonum = ETH_P_IP, +static struct osmo_pcap_proto_l3 ipv4 = { .l3protonum = AF_INET, - .l2hdr_len = ETH_HLEN, .l3pkt_hdr_len = l3_ipv4_pkt_l3hdr_len, .l4pkt_proto = l3_ipv4_pkt_l4proto_num, }; -void l2l3_ipv4_init(void) +void l3_ipv4_init(void) { - osmo_pcap_proto_l2l3_register(&ipv4); + osmo_pcap_proto_l3_register(&ipv4); } diff --git a/tests/osmo-pcap-test/l4_tcp.c b/tests/osmo-pcap-test/l4_tcp.c index 1e024b5..f7aedbd 100644 --- a/tests/osmo-pcap-test/l4_tcp.c +++ b/tests/osmo-pcap-test/l4_tcp.c @@ -13,14 +13,14 @@ #include "proto.h" -static int l4_tcp_pkt_hdr_len(const uint8_t *pkt) +static unsigned int l4_tcp_pkt_hdr_len(const uint8_t *pkt) { const struct tcphdr *tcph = (const struct tcphdr *)pkt; return tcph->doff << 2; } -static int l4_tcp_pkt_no_data(const uint8_t *pkt) +static unsigned int l4_tcp_pkt_no_data(const uint8_t *pkt) { const struct tcphdr *tcph = (const struct tcphdr *)pkt; return tcph->syn || tcph->fin || tcph->rst || !tcph->psh; diff --git a/tests/osmo-pcap-test/l4_udp.c b/tests/osmo-pcap-test/l4_udp.c index 9ffa77b..1733908 100644 --- a/tests/osmo-pcap-test/l4_udp.c +++ b/tests/osmo-pcap-test/l4_udp.c @@ -13,12 +13,12 @@ #include "proto.h" -static int l4_udp_pkt_hdr_len(const uint8_t *pkt) +static unsigned int l4_udp_pkt_hdr_len(const uint8_t *pkt) { return sizeof(struct udphdr); } -static int l4_udp_pkt_no_data(const uint8_t *pkt) +static unsigned int l4_udp_pkt_no_data(const uint8_t *pkt) { /* UDP has no control packets. */ return 0; diff --git a/tests/osmo-pcap-test/pcap.c b/tests/osmo-pcap-test/pcap.c index 61408f8..f9304b9 100644 --- a/tests/osmo-pcap-test/pcap.c +++ b/tests/osmo-pcap-test/pcap.c @@ -34,6 +34,7 @@ uint32_t pkts; uint32_t skip; uint32_t processed; + uint32_t unsupported_l2; uint32_t unsupported_l3; uint32_t unsupported_l4; } osmo_pcap_test_stats; @@ -41,21 +42,22 @@ static int osmo_pcap_process_packet(struct msgb **msgptr, const uint8_t *pkt, uint32_t pktlen, - struct osmo_pcap_proto_l2l3 *l3h, + struct osmo_pcap_proto_l2 *l2h, + struct osmo_pcap_proto_l3 *l3h, struct osmo_pcap_proto_l4 *l4h, int (*cb)(struct msgb *msgb)) { - unsigned int l3hdr_len, skip_hdr_len; + unsigned int l2hdr_len, l3hdr_len, skip_hdr_len; struct msgb *msgb; - int ret; /* skip layer 2, 3 and 4 headers */ - l3hdr_len = l3h->l3pkt_hdr_len(pkt + ETH_HLEN); - skip_hdr_len = l3h->l2hdr_len + l3hdr_len + - l4h->l4pkt_hdr_len(pkt + ETH_HLEN + l3hdr_len); + l2hdr_len = l2h->l2pkt_hdr_len(pkt); + l3hdr_len = l3h->l3pkt_hdr_len(pkt + l2hdr_len); + skip_hdr_len = l2hdr_len + l3hdr_len + + l4h->l4pkt_hdr_len(pkt + l2hdr_len + l3hdr_len); /* This packet contains no data, skip it. */ - if (l4h->l4pkt_no_data(pkt + l3hdr_len + ETH_HLEN)) { + if (l4h->l4pkt_no_data(pkt + l2hdr_len + l3hdr_len)) { osmo_pcap_test_stats.skip++; return -1; } @@ -101,10 +103,11 @@ int osmo_pcap_test_run(struct osmo_pcap *p, uint8_t pnum, int (*cb)(struct msgb *msgb)) { - struct osmo_pcap_proto_l2l3 *l3h; + struct osmo_pcap_proto_l2 *l2h; + struct osmo_pcap_proto_l3 *l3h; struct osmo_pcap_proto_l4 *l4h; struct pcap_pkthdr pcaph; - const u_char *pkt; + const u_char *l2pkt, *l3pkt; struct timeval res; uint8_t l4protonum; @@ -115,26 +118,34 @@ } retry: - pkt = pcap_next(p->h, &pcaph); - if (pkt == NULL) + l2pkt = pcap_next(p->h, &pcaph); + if (l2pkt == NULL) return -1; osmo_pcap_test_stats.pkts++; - l3h = osmo_pcap_proto_l2l3_find(pkt); + int linktype = pcap_datalink(p->h); + l2h = osmo_pcap_proto_l2_find(linktype); + if (l2h == NULL) { + osmo_pcap_test_stats.unsupported_l2++; + goto retry; + } + + l3h = osmo_pcap_proto_l3_find(l2h->l3pkt_proto(l2pkt)); if (l3h == NULL) { osmo_pcap_test_stats.unsupported_l3++; goto retry; } - l4protonum = l3h->l4pkt_proto(pkt + ETH_HLEN); + l3pkt = l2pkt + l2h->l2pkt_hdr_len(l2pkt); + l4protonum = l3h->l4pkt_proto(l3pkt); /* filter l4 protocols we are not interested in */ if (l4protonum != pnum) { osmo_pcap_test_stats.skip++; goto retry; } - l4h = osmo_pcap_proto_l4_find(pkt, l4protonum); + l4h = osmo_pcap_proto_l4_find(l4protonum); if (l4h == NULL) { osmo_pcap_test_stats.unsupported_l4++; goto retry; @@ -145,7 +156,7 @@ memcpy(&p->last, &pcaph.ts, sizeof(struct timeval)); /* retry with next packet if this has been skipped. */ - if (osmo_pcap_process_packet(&p->deliver_msg, pkt, pcaph.caplen, l3h, l4h, cb) < 0) + if (osmo_pcap_process_packet(&p->deliver_msg, l2pkt, pcaph.caplen, l2h, l3h, l4h, cb) < 0) goto retry; /* calculate waiting time */ @@ -161,19 +172,22 @@ void osmo_pcap_stats_printf(void) { - printf("pkts=%d processed=%d skip=%d " + printf("pkts=%d processed=%d skip=%d unsupported_l2=%d " "unsupported_l3=%d unsupported_l4=%d\n", osmo_pcap_test_stats.pkts, osmo_pcap_test_stats.processed, osmo_pcap_test_stats.skip, + osmo_pcap_test_stats.unsupported_l2, osmo_pcap_test_stats.unsupported_l3, osmo_pcap_test_stats.unsupported_l4); } void osmo_pcap_init(void) { - /* Initialization of supported layer 3 and 4 protocols here. */ - l2l3_ipv4_init(); + /* Initialization of supported layer 2, 3 and 4 protocols here. */ + l2_eth_init(); + l2_sll_init(); + l3_ipv4_init(); l4_tcp_init(); l4_udp_init(); } diff --git a/tests/osmo-pcap-test/proto.c b/tests/osmo-pcap-test/proto.c index f90f07c..085ca25 100644 --- a/tests/osmo-pcap-test/proto.c +++ b/tests/osmo-pcap-test/proto.c @@ -15,28 +15,46 @@ #include #include "proto.h" -static LLIST_HEAD(l2l3_proto_list); +static LLIST_HEAD(l2_proto_list); +static LLIST_HEAD(l3_proto_list); static LLIST_HEAD(l4_proto_list); +#include -struct osmo_pcap_proto_l2l3 *osmo_pcap_proto_l2l3_find(const uint8_t *pkt) +struct osmo_pcap_proto_l2 *osmo_pcap_proto_l2_find(unsigned int pcap_linktype) { - const struct ethhdr *eh = (const struct ethhdr *)pkt; - struct osmo_pcap_proto_l2l3 *cur; + struct osmo_pcap_proto_l2 *cur; - llist_for_each_entry(cur, &l2l3_proto_list, head) { - if (ntohs(cur->l2protonum) == eh->h_proto) + llist_for_each_entry(cur, &l2_proto_list, head) { + if (cur->l2protonum == pcap_linktype) return cur; } return NULL; } -void osmo_pcap_proto_l2l3_register(struct osmo_pcap_proto_l2l3 *h) +void osmo_pcap_proto_l2_register(struct osmo_pcap_proto_l2 *h) { - llist_add(&h->head, &l2l3_proto_list); + llist_add(&h->head, &l2_proto_list); +} + + +struct osmo_pcap_proto_l3 *osmo_pcap_proto_l3_find(unsigned int l3protocol) +{ + struct osmo_pcap_proto_l3 *cur; + + llist_for_each_entry(cur, &l3_proto_list, head) { + if (ntohs(cur->l3protonum) == l3protocol) + return cur; + } + return NULL; +} + +void osmo_pcap_proto_l3_register(struct osmo_pcap_proto_l3 *h) +{ + llist_add(&h->head, &l3_proto_list); } struct osmo_pcap_proto_l4 * -osmo_pcap_proto_l4_find(const uint8_t *pkt, unsigned int l4protocol) +osmo_pcap_proto_l4_find(unsigned int l4protocol) { struct osmo_pcap_proto_l4 *cur; diff --git a/tests/osmo-pcap-test/proto.h b/tests/osmo-pcap-test/proto.h index 8cb41ed..2580058 100644 --- a/tests/osmo-pcap-test/proto.h +++ b/tests/osmo-pcap-test/proto.h @@ -10,30 +10,42 @@ unsigned int l4protonum; - int (*l4pkt_hdr_len)(const uint8_t *pkt); - int (*l4pkt_no_data)(const uint8_t *pkt); + unsigned int (*l4pkt_hdr_len)(const uint8_t *pkt); + unsigned int (*l4pkt_no_data)(const uint8_t *pkt); }; -struct osmo_pcap_proto_l2l3 { +struct osmo_pcap_proto_l3 { struct llist_head head; - - unsigned int l2protonum; - unsigned int l2hdr_len; unsigned int l3protonum; - int (*l3pkt_hdr_len)(const uint8_t *pkt); - int (*l4pkt_proto)(const uint8_t *pkt); + unsigned int (*l3pkt_hdr_len)(const uint8_t *pkt); + unsigned int (*l4pkt_proto)(const uint8_t *pkt); }; -struct osmo_pcap_proto_l2l3 *osmo_pcap_proto_l2l3_find(const uint8_t *pkt); -void osmo_pcap_proto_l2l3_register(struct osmo_pcap_proto_l2l3 *h); +struct osmo_pcap_proto_l2 { + struct llist_head head; -struct osmo_pcap_proto_l4 *osmo_pcap_proto_l4_find(const uint8_t *pkt, unsigned int l4protonum); + unsigned int l2protonum; + + unsigned int (*l2pkt_hdr_len)(const uint8_t *pkt); + unsigned int (*l3pkt_proto)(const uint8_t *pkt); +}; + + +struct osmo_pcap_proto_l2 *osmo_pcap_proto_l2_find(unsigned int pcap_linktype); +void osmo_pcap_proto_l2_register(struct osmo_pcap_proto_l2 *h); + +struct osmo_pcap_proto_l3 *osmo_pcap_proto_l3_find(unsigned int l3protonum); +void osmo_pcap_proto_l3_register(struct osmo_pcap_proto_l3 *h); + +struct osmo_pcap_proto_l4 *osmo_pcap_proto_l4_find(unsigned int l4protonum); void osmo_pcap_proto_l4_register(struct osmo_pcap_proto_l4 *h); /* Initialization of supported protocols here. */ -void l2l3_ipv4_init(void); +void l2_sll_init(void); +void l2_eth_init(void); +void l3_ipv4_init(void); void l4_tcp_init(void); void l4_udp_init(void); -- To view, visit https://gerrit.osmocom.org/3064 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ie62fa0a8e45e1e141edb64b116dad185ad9c7a5f Gerrit-PatchSet: 2 Gerrit-Project: libosmo-netif Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Aug 9 09:57:15 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 9 Aug 2017 09:57:15 +0000 Subject: osmo-bts[master]: lc15bts-mgr.service: Prepare dirs and sysctls for the process In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3412 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I0a0a10ca9498318c48c81fa94faceb2ad4ac1de6 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Aug 9 09:57:31 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 9 Aug 2017 09:57:31 +0000 Subject: [MERGED] osmo-bts[master]: lc15bts-mgr.service: Prepare dirs and sysctls for the process In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: lc15bts-mgr.service: Prepare dirs and sysctls for the process ...................................................................... lc15bts-mgr.service: Prepare dirs and sysctls for the process Change-Id: I0a0a10ca9498318c48c81fa94faceb2ad4ac1de6 --- M contrib/lc15bts-mgr.service 1 file changed, 18 insertions(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/contrib/lc15bts-mgr.service b/contrib/lc15bts-mgr.service index 5790abe..bf788e6 100644 --- a/contrib/lc15bts-mgr.service +++ b/contrib/lc15bts-mgr.service @@ -1,12 +1,29 @@ [Unit] Description=osmo-bts manager for LC15 / sysmoBTS 2100 +After=lc15-sysdev-remap.service +Wants=lc15-sysdev-remap.service [Service] Type=simple -ExecStart=/usr/bin/lc15bts-mgr -s -c /etc/osmocom/lc15bts-mgr.cfg +NotifyAccess=all +WatchdogSec=21780s Restart=always RestartSec=2 +# Make sure directories and symbolic link exist +ExecStartPre=/bin/sh -c 'test -d /mnt/storage/var/run/lc15bts-mgr || mkdir -p /mnt/storage/var/run/lc15bts-mgr ; test -d /var/run/lc15bts-mgr || ln -sf /mnt/storage/var/run/lc15bts-mgr/ /var/run' +# Make sure BTS operation hour exist +ExecStartPre=/bin/sh -c 'test -f /mnt/storage/var/run/lc15bts-mgr/hours-running || echo 0 > /mnt/storage/var/run/lc15bts-mgr/hours-running' +# Shutdown all PA correctly +ExecStartPre=/bin/sh -c 'echo disabled > /var/lc15/pa-state/pa0/state; echo disabled > /var/lc15/pa-state/pa1/state' +ExecStartPre=/bin/sh -c 'echo 0 > /var/lc15/pa-supply/max_microvolts; echo 0 > /var/lc15/pa-supply/min_microvolts' + +ExecStart=/usr/bin/lc15bts-mgr -s -c /etc/osmocom/lc15bts-mgr.cfg + +# Shutdown all PA correctly +ExecStopPost=/bin/sh -c 'echo disabled > /var/lc15/pa-state/pa0/state; echo disabled > /var/lc15/pa-state/pa1/state' +ExecStopPost=/bin/sh -c 'echo 0 > /var/lc15/pa-supply/max_microvolts; echo 0 > /var/lc15/pa-supply/min_microvolts' + [Install] WantedBy=multi-user.target Alias=osmo-bts-mgr.service -- To view, visit https://gerrit.osmocom.org/3412 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I0a0a10ca9498318c48c81fa94faceb2ad4ac1de6 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Aug 9 09:58:31 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 9 Aug 2017 09:58:31 +0000 Subject: osmo-gsm-tester[master]: Set osmo-bts pcu-socket config to point to run dir In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3441 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I5a1da23c45a4ac496fe765e0d78c52dae3e7808b Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Aug 9 09:59:14 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 9 Aug 2017 09:59:14 +0000 Subject: openbsc[master]: libmsc: move gsm340_rx_sms_submit() to sms_route_mt_sms() In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3427 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I3f3d30e0762b91e2099243b0be1a4b67cbb5e9c0 Gerrit-PatchSet: 2 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Pablo Neira Ayuso Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Keith Whyte Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Aug 9 10:01:11 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 9 Aug 2017 10:01:11 +0000 Subject: [ABANDON] openggsn[master]: IPv6 support In-Reply-To: References: Message-ID: Harald Welte has abandoned this change. Change subject: IPv6 support ...................................................................... Abandoned code is for > 7 year old version and of little use today. Author is not able to provide current version of patch. Meanwhile, we're working on IPv6 PDP context support in master -- To view, visit https://gerrit.osmocom.org/2870 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: abandon Gerrit-Change-Id: If8ce8b4b8cd2ba97f7ba122de4703983111046e4 Gerrit-PatchSet: 1 Gerrit-Project: openggsn Gerrit-Branch: master Gerrit-Owner: groos at xiplink.com Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Aug 9 10:01:51 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 9 Aug 2017 10:01:51 +0000 Subject: osmo-gsm-tester[master]: ussd: Workaround ofono issue to prevent test failure In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3402 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I72f68bc980e6421a65f7d33712a587da340698e5 Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: lynxis lazus Gerrit-Reviewer: neels Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Aug 9 10:02:09 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 9 Aug 2017 10:02:09 +0000 Subject: osmo-gsm-tester[master]: Add minimal USSD support to test extension number In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/3401 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ib19331f9c6476ac01bf729790dfd63c56de86a89 Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: lynxis lazus Gerrit-Reviewer: neels Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Aug 9 10:02:34 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 9 Aug 2017 10:02:34 +0000 Subject: [MERGED] osmo-bts[master]: VIRT-BTS: Support for GPRS In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: VIRT-BTS: Support for GPRS ...................................................................... VIRT-BTS: Support for GPRS Change-Id: Id851578c53255866537a16a0be6c3e9268e6ccbc --- M src/osmo-bts-virtual/bts_model.c M src/osmo-bts-virtual/l1_if.c M src/osmo-bts-virtual/main.c 3 files changed, 7 insertions(+), 9 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/osmo-bts-virtual/bts_model.c b/src/osmo-bts-virtual/bts_model.c index c82f1aa..b971af5 100644 --- a/src/osmo-bts-virtual/bts_model.c +++ b/src/osmo-bts-virtual/bts_model.c @@ -137,13 +137,12 @@ case NM_OC_SITE_MANAGER: case NM_OC_BASEB_TRANSC: case NM_OC_BTS: - oml_mo_state_chg(mo, NM_OPSTATE_ENABLED, NM_AVSTATE_OK); - rc = oml_mo_opstart_ack(mo); - break; - /* TODO: gprs support */ case NM_OC_GPRS_NSE: case NM_OC_GPRS_CELL: case NM_OC_GPRS_NSVC: + oml_mo_state_chg(mo, NM_OPSTATE_ENABLED, NM_AVSTATE_OK); + rc = oml_mo_opstart_ack(mo); + break; default: rc = oml_mo_opstart_nack(mo, NM_NACK_OBJCLASS_NOTSUPP); } diff --git a/src/osmo-bts-virtual/l1_if.c b/src/osmo-bts-virtual/l1_if.c index bdbf2a7..cb6d483 100644 --- a/src/osmo-bts-virtual/l1_if.c +++ b/src/osmo-bts-virtual/l1_if.c @@ -133,6 +133,9 @@ #endif case GSMTAP_CHANNEL_SDCCH4: case GSMTAP_CHANNEL_SDCCH8: + case GSMTAP_CHANNEL_PACCH: + case GSMTAP_CHANNEL_PDCH: + case GSMTAP_CHANNEL_PTCCH: osmo_prim_init(&l1sap.oph, SAP_GSM_PH, PRIM_PH_DATA, PRIM_OP_INDICATION, msg); l1sap.u.data.chan_nr = chan_nr; @@ -142,7 +145,7 @@ l1sap.u.data.ber10k = 0; /* Bit Error Rate in 0.01%. Best -> 0 */ l1sap.u.data.ta_offs_qbits = 0; /* Burst time of arrival in quarter bits. Probably used for Timing Advance calc. Best -> 0 */ l1sap.u.data.lqual_cb = 10 * signal_dbm; /* Link quality in centiBel = 10 * dB. */ - l1sap.u.data.pdch_presence_info = PRES_INFO_UNKNOWN; + l1sap.u.data.pdch_presence_info = PRES_INFO_BOTH; break; case GSMTAP_CHANNEL_AGCH: case GSMTAP_CHANNEL_PCH: @@ -151,9 +154,6 @@ goto nomessage; case GSMTAP_CHANNEL_SDCCH: case GSMTAP_CHANNEL_CCCH: - case GSMTAP_CHANNEL_PACCH: - case GSMTAP_CHANNEL_PDCH: - case GSMTAP_CHANNEL_PTCCH: case GSMTAP_CHANNEL_CBCH51: case GSMTAP_CHANNEL_CBCH52: LOGP(DL1P, LOGL_NOTICE, "Ignore incoming msg - channel type not supported!\n"); diff --git a/src/osmo-bts-virtual/main.c b/src/osmo-bts-virtual/main.c index 937046b..8459107 100644 --- a/src/osmo-bts-virtual/main.c +++ b/src/osmo-bts-virtual/main.c @@ -51,7 +51,6 @@ /* dummy, since no direct dsp support */ uint32_t trx_get_hlayer1(struct gsm_bts_trx *trx) { - LOGP(DSUM, LOGL_NOTICE, "Unimplemneted %s\n", __func__); return 0; } -- To view, visit https://gerrit.osmocom.org/3371 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Id851578c53255866537a16a0be6c3e9268e6ccbc Gerrit-PatchSet: 5 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Aug 9 10:02:48 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 9 Aug 2017 10:02:48 +0000 Subject: osmo-bts[master]: GSMTAP: Don't log fill frames via GSMTAP In-Reply-To: References: Message-ID: Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3372 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Icd18dafb235933c9e6aa9d98ddd8fac1522cc9ac Gerrit-PatchSet: 3 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Aug 9 10:03:12 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 9 Aug 2017 10:03:12 +0000 Subject: osmo-bts[master]: L1SAP: Use RSL_CHAN_OSMO_PDCH across L1SAP In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3393 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Iaaa833febe45b82166d3901f10cc5466a7591c19 Gerrit-PatchSet: 2 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: dexter Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Aug 9 10:03:14 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 9 Aug 2017 10:03:14 +0000 Subject: [MERGED] osmo-bts[master]: L1SAP: Use RSL_CHAN_OSMO_PDCH across L1SAP In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: L1SAP: Use RSL_CHAN_OSMO_PDCH across L1SAP ...................................................................... L1SAP: Use RSL_CHAN_OSMO_PDCH across L1SAP So far, L1SAP code is hiding RSL_CHAN_OSMO_PDCH from the bts specific code below L1SAP. This is some kind of a hack/workaround, making code and debug output / logs more difficult to understand. So let's teach the lower layer how to treat RSL_CHAN_OSMO_PDCH and remove the "hiding" code from the common l1sap.c code. Change-Id: Iaaa833febe45b82166d3901f10cc5466a7591c19 --- M include/osmo-bts/l1sap.h M src/common/l1sap.c M src/common/scheduler.c M src/osmo-bts-litecell15/l1_if.c M src/osmo-bts-octphy/l1_if.c M src/osmo-bts-sysmo/l1_if.c 6 files changed, 12 insertions(+), 14 deletions(-) Approvals: dexter: Looks good to me, but someone else must approve; Verified Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/include/osmo-bts/l1sap.h b/include/osmo-bts/l1sap.h index 4e9c9e2..ad13145 100644 --- a/include/osmo-bts/l1sap.h +++ b/include/osmo-bts/l1sap.h @@ -22,6 +22,7 @@ #define L1SAP_IS_CHAN_BCCH(chan_nr) ((chan_nr & 0xf8) == 0x80) #define L1SAP_IS_CHAN_RACH(chan_nr) ((chan_nr & 0xf8) == 0x88) #define L1SAP_IS_CHAN_AGCH_PCH(chan_nr) ((chan_nr & 0xf8) == 0x90) +#define L1SAP_IS_CHAN_PDCH(chan_nr) ((chan_nr & 0xf8) == 0xc0) /* rach type from ra */ #define L1SAP_IS_PACKET_RACH(ra) ((ra & 0xf0) == 0x70 && (ra & 0x0f) != 0x0f) diff --git a/src/common/l1sap.c b/src/common/l1sap.c index 7c69561..4bf24a5 100644 --- a/src/common/l1sap.c +++ b/src/common/l1sap.c @@ -263,6 +263,8 @@ *chan_type = GSMTAP_CHANNEL_PCH; else *chan_type = GSMTAP_CHANNEL_AGCH; + } else if (L1SAP_IS_CHAN_PDCH(chan_nr)) { + *chan_type = GSMTAP_CHANNEL_PDTCH; } if (L1SAP_IS_LINK_SACCH(link_id)) *chan_type |= GSMTAP_CHANNEL_ACCH; @@ -1218,7 +1220,7 @@ l1sap = msgb_l1sap_prim(msg); osmo_prim_init(&l1sap->oph, SAP_GSM_PH, PRIM_PH_DATA, PRIM_OP_REQUEST, msg); - l1sap->u.data.chan_nr = 0x08 | ts->nr; + l1sap->u.data.chan_nr = RSL_CHAN_OSMO_PDCH | ts->nr; l1sap->u.data.link_id = 0x00; l1sap->u.data.fn = fn; msg->l2h = msgb_put(msg, len); @@ -1264,11 +1266,6 @@ enum osmo_mph_info_type type, uint8_t sacch_only) { struct osmo_phsap_prim l1sap; - - /* The caller may pass a non-standard RSL_CHAN_OSMO_PDCH, which the L1 - * doesn't understand. Use the normal TCH/F cbits instead. */ - if ((chan_nr & RSL_CHAN_NR_MASK) == RSL_CHAN_OSMO_PDCH) - chan_nr = RSL_CHAN_Bm_ACCHs | (chan_nr & ~RSL_CHAN_NR_MASK); memset(&l1sap, 0, sizeof(l1sap)); osmo_prim_init(&l1sap.oph, SAP_GSM_PH, PRIM_MPH_INFO, PRIM_OP_REQUEST, diff --git a/src/common/scheduler.c b/src/common/scheduler.c index 08603d2..f6cb07e 100644 --- a/src/common/scheduler.c +++ b/src/common/scheduler.c @@ -152,8 +152,8 @@ { 0, TRXC_SACCH8_5, 0x68, LID_SACCH, "SACCH/8(5)", rts_data_fn, tx_data_fn, rx_data_fn, 0 }, { 0, TRXC_SACCH8_6, 0x70, LID_SACCH, "SACCH/8(6)", rts_data_fn, tx_data_fn, rx_data_fn, 0 }, { 0, TRXC_SACCH8_7, 0x78, LID_SACCH, "SACCH/8(7)", rts_data_fn, tx_data_fn, rx_data_fn, 0 }, - { 1, TRXC_PDTCH, 0x08, LID_DEDIC, "PDTCH", rts_data_fn, tx_pdtch_fn, rx_pdtch_fn, 0 }, - { 1, TRXC_PTCCH, 0x08, LID_DEDIC, "PTCCH", rts_data_fn, tx_data_fn, rx_data_fn, 0 }, + { 1, TRXC_PDTCH, 0xc0, LID_DEDIC, "PDTCH", rts_data_fn, tx_pdtch_fn, rx_pdtch_fn, 0 }, + { 1, TRXC_PTCCH, 0xc0, LID_DEDIC, "PTCCH", rts_data_fn, tx_data_fn, rx_data_fn, 0 }, }; const struct value_string trx_chan_type_names[] = { diff --git a/src/osmo-bts-litecell15/l1_if.c b/src/osmo-bts-litecell15/l1_if.c index a3b9556..12c2470 100644 --- a/src/osmo-bts-litecell15/l1_if.c +++ b/src/osmo-bts-litecell15/l1_if.c @@ -358,9 +358,9 @@ lchan = get_lchan_by_chan_nr(trx, chan_nr); if (L1SAP_IS_LINK_SACCH(link_id)) { sapi = GsmL1_Sapi_Sacch; - if (!L1SAP_IS_CHAN_TCHF(chan_nr)) + if (!L1SAP_IS_CHAN_TCHF(chan_nr) && !L1SAP_IS_CHAN_PDCH(chan_nr)) subCh = l1sap_chan2ss(chan_nr); - } else if (L1SAP_IS_CHAN_TCHF(chan_nr)) { + } else if (L1SAP_IS_CHAN_TCHF(chan_nr) || L1SAP_IS_CHAN_PDCH(chan_nr)) { if (ts_is_pdch(&trx->ts[u8Tn])) { if (L1SAP_IS_PTCCH(u32Fn)) { sapi = GsmL1_Sapi_Ptcch; diff --git a/src/osmo-bts-octphy/l1_if.c b/src/osmo-bts-octphy/l1_if.c index 20a84f8..cb792d7 100644 --- a/src/osmo-bts-octphy/l1_if.c +++ b/src/osmo-bts-octphy/l1_if.c @@ -473,9 +473,9 @@ subCh = 0xf1; if (L1SAP_IS_LINK_SACCH(link_id)) { sapi = cOCTVC1_GSM_SAPI_ENUM_SACCH; - if (!L1SAP_IS_CHAN_TCHF(chan_nr)) + if (!L1SAP_IS_CHAN_TCHF(chan_nr) && !L1SAP_IS_CHAN_PDCH(chan_nr)) subCh = l1sap_chan2ss(chan_nr); - } else if (L1SAP_IS_CHAN_TCHF(chan_nr)) { + } else if (L1SAP_IS_CHAN_TCHF(chan_nr) || L1SAP_IS_CHAN_PDCH(chan_nr)) { if (trx->ts[u8Tn].pchan == GSM_PCHAN_PDCH) { if (L1SAP_IS_PTCCH(u32Fn)) { sapi = cOCTVC1_GSM_SAPI_ENUM_PTCCH; diff --git a/src/osmo-bts-sysmo/l1_if.c b/src/osmo-bts-sysmo/l1_if.c index 781900e..8f68210 100644 --- a/src/osmo-bts-sysmo/l1_if.c +++ b/src/osmo-bts-sysmo/l1_if.c @@ -354,9 +354,9 @@ lchan = get_lchan_by_chan_nr(trx, chan_nr); if (L1SAP_IS_LINK_SACCH(link_id)) { sapi = GsmL1_Sapi_Sacch; - if (!L1SAP_IS_CHAN_TCHF(chan_nr)) + if (!L1SAP_IS_CHAN_TCHF(chan_nr) && !L1SAP_IS_CHAN_PDCH(chan_nr)) subCh = l1sap_chan2ss(chan_nr); - } else if (L1SAP_IS_CHAN_TCHF(chan_nr)) { + } else if (L1SAP_IS_CHAN_TCHF(chan_nr) || L1SAP_IS_CHAN_PDCH(chan_nr)) { if (ts_is_pdch(&trx->ts[u8Tn])) { if (L1SAP_IS_PTCCH(u32Fn)) { sapi = GsmL1_Sapi_Ptcch; -- To view, visit https://gerrit.osmocom.org/3393 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Iaaa833febe45b82166d3901f10cc5466a7591c19 Gerrit-PatchSet: 3 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: dexter From gerrit-no-reply at lists.osmocom.org Wed Aug 9 10:05:52 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 9 Aug 2017 10:05:52 +0000 Subject: libosmocore[master]: gsm0480: refactor the parse_process_uss_req() In-Reply-To: References: Message-ID: Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3375 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I467f75794c5ac9df75c001245b18bbdfcfaadd88 Gerrit-PatchSet: 3 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Alexander Chemeris Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Ivan Kluchnikov Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Aug 9 10:06:07 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 9 Aug 2017 10:06:07 +0000 Subject: libosmocore[master]: gsm0480: handle UnstructuredSS request with DSC != 0x0F In-Reply-To: References: Message-ID: Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3376 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I73d602f6f20b0afe7600d16bbd432069ae7be788 Gerrit-PatchSet: 3 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Alexander Chemeris Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Ivan Kluchnikov Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Aug 9 10:06:24 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 9 Aug 2017 10:06:24 +0000 Subject: libosmocore[master]: gsm0480: parse GSM0480_MTYPE_FACILITY separately In-Reply-To: References: Message-ID: Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3377 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I6e029c436a50fa8c2823ea39c5d123ee701becfa Gerrit-PatchSet: 3 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Alexander Chemeris Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Ivan Kluchnikov Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Aug 9 10:07:03 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 9 Aug 2017 10:07:03 +0000 Subject: libosmocore[master]: gsm0480: handle GSM0480_CTYPE_RETURN_RESULT In-Reply-To: References: Message-ID: Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3378 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I8fb2856acbbf4c53e7d53200a37bc8f79e763bcf Gerrit-PatchSet: 3 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Alexander Chemeris Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Ivan Kluchnikov Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Aug 9 10:07:11 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 9 Aug 2017 10:07:11 +0000 Subject: libosmocore[master]: gsm0480: handle USS_NOTIFY and USS_REQUEST with PROCESS_USS_REQ In-Reply-To: References: Message-ID: Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3379 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: If7cc6a966dfc17d37e22338ecc1f239f908a9f2e Gerrit-PatchSet: 3 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Alexander Chemeris Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Ivan Kluchnikov Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Aug 9 10:07:18 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 9 Aug 2017 10:07:18 +0000 Subject: libosmocore[master]: gsm0480: handle GSM0480_OP_CODE_PROCESS_USS_DATA In-Reply-To: References: Message-ID: Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3380 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I470290c2b544555e53cedd849b1d6a961db7b5a4 Gerrit-PatchSet: 3 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Alexander Chemeris Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Ivan Kluchnikov Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Aug 9 10:07:43 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 9 Aug 2017 10:07:43 +0000 Subject: libosmocore[master]: gsm0480: expose the gsm0480_parse_ss_facility_ie() In-Reply-To: References: Message-ID: Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3381 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I35d3360f36c48eb1295610ab96ff264c45af77eb Gerrit-PatchSet: 3 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Alexander Chemeris Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Ivan Kluchnikov Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Aug 9 10:08:08 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 9 Aug 2017 10:08:08 +0000 Subject: libosmocore[master]: gsm0480: drop length check in gsm0480_decode_ss_request() In-Reply-To: References: Message-ID: Patch Set 3: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/3373 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I63b7f8ce403169a9dbdbdb031db16693de2196d6 Gerrit-PatchSet: 3 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Alexander Chemeris Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Aug 9 10:08:11 2017 From: gerrit-no-reply at lists.osmocom.org (Holger Freyther) Date: Wed, 9 Aug 2017 10:08:11 +0000 Subject: [PATCH] meta-telephony[laforge/nightly]: libosmo-sccp: Attempt to fix link issue on 201705-nightly bu... Message-ID: Review at https://gerrit.osmocom.org/3449 libosmo-sccp: Attempt to fix link issue on 201705-nightly builds This project will build some static libraries needed for testing and also for downstream users. Do not disable the static build on newer Poky versions. arm-poky-linux-gnueabi-libtool: link: arm-poky-linux-gnueabi-gcc -march=armv5te -marm --sysroot=/home/jenkinsdebian8amd64/jenkins/workspace/201705-nightly/label/Debian8-AMD64/build/tmp/work/armv5te-poky-linux-gnueabi/libosmo-sccp/git-r1.18.1/recipe-sysroot -Wall -I/home/jenkinsdebian8amd64/jenkins/workspace/201705-nightly/label/Debian8-AMD64/build/tmp/work/armv5te-poky-linux-gnueabi/libosmo-sccp/git-r1.18.1/recipe-sysroot/usr/include/ -I/home/jenkinsdebian8amd64/jenkins/workspace/201705-nightly/label/Debian8-AMD64/build/tmp/work/armv5te-poky-linux-gnueabi/libosmo-sccp/git-r1.18.1/recipe-sysroot/usr/include/ -O2 -pipe -g -feliminate-unused-debug-types -fdebug-prefix-map=/home/jenkinsdebian8amd64/jenkins/workspace/201705-nightly/label/Debian8-AMD64/build/tmp/work/armv5te-poky-linux-gnueabi/libosmo-sccp/git-r1.18.1=/usr/src/debug/libosmo-sccp/git-r1.18.1 -fdebug-prefix-map=/home/jenkinsdebian8amd64/jenkins/workspace/201705-nightly/label/Debian8-AMD64/build/tmp/work/armv5te-poky-linux-gnueabi/libosmo-sccp/git-r1.18.1/recipe-sysroot-native= -fdebug-prefix-map=/home/jenkinsdebian8amd64/jenkins/workspace/201705-nightly/label/Debian8-AMD64/build/tmp/work/armv5te-poky-linux-gnueabi/libosmo-sccp/git-r1.18.1/recipe-sysroot= -Wl,-O1 -Wl,--hash-style=gnu -Wl,--as-needed -o xua_test xua_test.o sccp_test_data.o ../../src/.libs/libosmo-sigtran.so -losmogsm -ltalloc -losmovty -losmocore -losmonetif -lsctp | xua_test.o: In function `test_helpers': | /usr/src/debug/libosmo-sccp/git-r1.18.1/git/tests/xua/xua_test.c:160: undefined reference to `xua_part_add_gt' | /usr/src/debug/libosmo-sccp/git-r1.18.1/git/tests/xua/xua_test.c:168: undefined reference to `sua_parse_gt' | xua_test.o: In function `test_sccp2sua_case': Change-Id: I80eea9ac888ab4b13614ff475bebacb94b72b0f2 --- M recipes-osmocom/libosmo-sccp/libosmo-sccp_git.bb 1 file changed, 4 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/meta-telephony refs/changes/49/3449/1 diff --git a/recipes-osmocom/libosmo-sccp/libosmo-sccp_git.bb b/recipes-osmocom/libosmo-sccp/libosmo-sccp_git.bb index 3e3ac5f..87ea2c0 100644 --- a/recipes-osmocom/libosmo-sccp/libosmo-sccp_git.bb +++ b/recipes-osmocom/libosmo-sccp/libosmo-sccp_git.bb @@ -5,6 +5,10 @@ SRC_URI = "git://git.osmocom.org/libosmo-sccp.git;protocol=git" PR = "${INC_PR}.1" +# we require the tests to link to the static libosmo-sigtran library to +# access symbols not starting with osmo_* +EXTRA_OECONF_remove = "--disable-static" + # because "${WORKDIR}/git" is not a git repo, it can't figure out the version do_configure_prepend() { echo "${PV}" > ${S}/.tarball-version -- To view, visit https://gerrit.osmocom.org/3449 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I80eea9ac888ab4b13614ff475bebacb94b72b0f2 Gerrit-PatchSet: 1 Gerrit-Project: meta-telephony Gerrit-Branch: laforge/nightly Gerrit-Owner: Holger Freyther From gerrit-no-reply at lists.osmocom.org Wed Aug 9 10:11:41 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Wed, 9 Aug 2017 10:11:41 +0000 Subject: meta-telephony[laforge/nightly]: libosmo-sccp: Attempt to fix link issue on 201705-nightly bu... In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/3449 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I80eea9ac888ab4b13614ff475bebacb94b72b0f2 Gerrit-PatchSet: 1 Gerrit-Project: meta-telephony Gerrit-Branch: laforge/nightly Gerrit-Owner: Holger Freyther Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Aug 9 10:12:29 2017 From: gerrit-no-reply at lists.osmocom.org (Holger Freyther) Date: Wed, 9 Aug 2017 10:12:29 +0000 Subject: meta-telephony[laforge/nightly]: libosmo-sccp: Attempt to fix link issue on 201705-nightly bu... In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 Verified+1 -- To view, visit https://gerrit.osmocom.org/3449 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I80eea9ac888ab4b13614ff475bebacb94b72b0f2 Gerrit-PatchSet: 1 Gerrit-Project: meta-telephony Gerrit-Branch: laforge/nightly Gerrit-Owner: Holger Freyther Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Aug 9 10:12:33 2017 From: gerrit-no-reply at lists.osmocom.org (Holger Freyther) Date: Wed, 9 Aug 2017 10:12:33 +0000 Subject: [MERGED] meta-telephony[laforge/nightly]: libosmo-sccp: Attempt to fix link issue on 201705-nightly bu... In-Reply-To: References: Message-ID: Holger Freyther has submitted this change and it was merged. Change subject: libosmo-sccp: Attempt to fix link issue on 201705-nightly builds ...................................................................... libosmo-sccp: Attempt to fix link issue on 201705-nightly builds This project will build some static libraries needed for testing and also for downstream users. Do not disable the static build on newer Poky versions. arm-poky-linux-gnueabi-libtool: link: arm-poky-linux-gnueabi-gcc -march=armv5te -marm --sysroot=/home/jenkinsdebian8amd64/jenkins/workspace/201705-nightly/label/Debian8-AMD64/build/tmp/work/armv5te-poky-linux-gnueabi/libosmo-sccp/git-r1.18.1/recipe-sysroot -Wall -I/home/jenkinsdebian8amd64/jenkins/workspace/201705-nightly/label/Debian8-AMD64/build/tmp/work/armv5te-poky-linux-gnueabi/libosmo-sccp/git-r1.18.1/recipe-sysroot/usr/include/ -I/home/jenkinsdebian8amd64/jenkins/workspace/201705-nightly/label/Debian8-AMD64/build/tmp/work/armv5te-poky-linux-gnueabi/libosmo-sccp/git-r1.18.1/recipe-sysroot/usr/include/ -O2 -pipe -g -feliminate-unused-debug-types -fdebug-prefix-map=/home/jenkinsdebian8amd64/jenkins/workspace/201705-nightly/label/Debian8-AMD64/build/tmp/work/armv5te-poky-linux-gnueabi/libosmo-sccp/git-r1.18.1=/usr/src/debug/libosmo-sccp/git-r1.18.1 -fdebug-prefix-map=/home/jenkinsdebian8amd64/jenkins/workspace/201705-nightly/label/Debian8-AMD64/build/tmp/work/armv5te-poky-linux-gnueabi/libosmo-sccp/git-r1.18.1/recipe-sysroot-native= -fdebug-prefix-map=/home/jenkinsdebian8amd64/jenkins/workspace/201705-nightly/label/Debian8-AMD64/build/tmp/work/armv5te-poky-linux-gnueabi/libosmo-sccp/git-r1.18.1/recipe-sysroot= -Wl,-O1 -Wl,--hash-style=gnu -Wl,--as-needed -o xua_test xua_test.o sccp_test_data.o ../../src/.libs/libosmo-sigtran.so -losmogsm -ltalloc -losmovty -losmocore -losmonetif -lsctp | xua_test.o: In function `test_helpers': | /usr/src/debug/libosmo-sccp/git-r1.18.1/git/tests/xua/xua_test.c:160: undefined reference to `xua_part_add_gt' | /usr/src/debug/libosmo-sccp/git-r1.18.1/git/tests/xua/xua_test.c:168: undefined reference to `sua_parse_gt' | xua_test.o: In function `test_sccp2sua_case': Change-Id: I80eea9ac888ab4b13614ff475bebacb94b72b0f2 --- M recipes-osmocom/libosmo-sccp/libosmo-sccp_git.bb 1 file changed, 4 insertions(+), 0 deletions(-) Approvals: Pau Espin Pedrol: Looks good to me, but someone else must approve Holger Freyther: Looks good to me, approved; Verified diff --git a/recipes-osmocom/libosmo-sccp/libosmo-sccp_git.bb b/recipes-osmocom/libosmo-sccp/libosmo-sccp_git.bb index 3e3ac5f..87ea2c0 100644 --- a/recipes-osmocom/libosmo-sccp/libosmo-sccp_git.bb +++ b/recipes-osmocom/libosmo-sccp/libosmo-sccp_git.bb @@ -5,6 +5,10 @@ SRC_URI = "git://git.osmocom.org/libosmo-sccp.git;protocol=git" PR = "${INC_PR}.1" +# we require the tests to link to the static libosmo-sigtran library to +# access symbols not starting with osmo_* +EXTRA_OECONF_remove = "--disable-static" + # because "${WORKDIR}/git" is not a git repo, it can't figure out the version do_configure_prepend() { echo "${PV}" > ${S}/.tarball-version -- To view, visit https://gerrit.osmocom.org/3449 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I80eea9ac888ab4b13614ff475bebacb94b72b0f2 Gerrit-PatchSet: 1 Gerrit-Project: meta-telephony Gerrit-Branch: laforge/nightly Gerrit-Owner: Holger Freyther Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Wed Aug 9 10:13:07 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 9 Aug 2017 10:13:07 +0000 Subject: openbsc[master]: gsm_04_11: get rid of unused parameter in sms_route_mt_sms() In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 > I need to call gsm340_rx_sms_submit() in the last patch of this > series, to add support for status-report in nitb mode. Ok, then please state this briefly in the commit log, i.e. tha the code will be called in a context without msgb. This gives important context. -- To view, visit https://gerrit.osmocom.org/3422 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I797abce3f91447e8f397c7cf726db7425479fe0e Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Pablo Neira Ayuso Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Keith Whyte Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pablo Neira Ayuso Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Aug 9 10:14:01 2017 From: gerrit-no-reply at lists.osmocom.org (Pablo Neira Ayuso) Date: Wed, 9 Aug 2017 10:14:01 +0000 Subject: [MERGED] openbsc[master]: gsm_04_11: get rid of unused parameter in sms_route_mt_sms() In-Reply-To: References: Message-ID: Pablo Neira Ayuso has submitted this change and it was merged. Change subject: gsm_04_11: get rid of unused parameter in sms_route_mt_sms() ...................................................................... gsm_04_11: get rid of unused parameter in sms_route_mt_sms() This parameter is unused, remove it. Change-Id: I797abce3f91447e8f397c7cf726db7425479fe0e --- M openbsc/src/libmsc/gsm_04_11.c 1 file changed, 6 insertions(+), 5 deletions(-) Approvals: Neels Hofmeyr: Looks good to me, but someone else must approve Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/openbsc/src/libmsc/gsm_04_11.c b/openbsc/src/libmsc/gsm_04_11.c index acf425a..da4460c 100644 --- a/openbsc/src/libmsc/gsm_04_11.c +++ b/openbsc/src/libmsc/gsm_04_11.c @@ -187,7 +187,7 @@ return gsm411_smc_send(&trans->sms.smc_inst, msg_type, msg); } -static int gsm340_rx_sms_submit(struct msgb *msg, struct gsm_sms *gsms) +static int gsm340_rx_sms_submit(struct gsm_sms *gsms) { if (db_sms_store(gsms) != 0) { LOGP(DLSMS, LOGL_ERROR, "Failed to store SMS in Database\n"); @@ -277,8 +277,9 @@ return msg->len - old_msg_len; } -int sms_route_mt_sms(struct gsm_subscriber_connection *conn, struct msgb *msg, - struct gsm_sms *gsms, uint8_t sms_mti, bool *deferred) +static int sms_route_mt_sms(struct gsm_subscriber_connection *conn, + struct gsm_sms *gsms, uint8_t sms_mti, + bool *deferred) { int rc; @@ -342,7 +343,7 @@ switch (sms_mti) { case GSM340_SMS_SUBMIT_MS2SC: /* MS is submitting a SMS */ - rc = gsm340_rx_sms_submit(msg, gsms); + rc = gsm340_rx_sms_submit(gsms); break; case GSM340_SMS_COMMAND_MS2SC: case GSM340_SMS_DELIVER_REP_MS2SC: @@ -487,7 +488,7 @@ /* FIXME: This looks very wrong */ send_signal(0, NULL, gsms, 0); - rc = sms_route_mt_sms(conn, msg, gsms, sms_mti, deferred); + rc = sms_route_mt_sms(conn, gsms, sms_mti, deferred); out: if (!deferred) sms_free(gsms); -- To view, visit https://gerrit.osmocom.org/3422 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I797abce3f91447e8f397c7cf726db7425479fe0e Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Pablo Neira Ayuso Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Keith Whyte Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pablo Neira Ayuso From gerrit-no-reply at lists.osmocom.org Wed Aug 9 10:14:09 2017 From: gerrit-no-reply at lists.osmocom.org (Pablo Neira Ayuso) Date: Wed, 9 Aug 2017 10:14:09 +0000 Subject: [MERGED] openbsc[master]: libmsc: do not leak pending SMPP command object on error path In-Reply-To: References: Message-ID: Pablo Neira Ayuso has submitted this change and it was merged. Change subject: libmsc: do not leak pending SMPP command object on error path ...................................................................... libmsc: do not leak pending SMPP command object on error path Make sure the SMPP command object is released on errors. Change-Id: I474584425d23fb379a9d71b33e29ac0e24f01e61 --- M openbsc/src/libmsc/smpp_openbsc.c 1 file changed, 6 insertions(+), 5 deletions(-) Approvals: Neels Hofmeyr: Looks good to me, approved Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/openbsc/src/libmsc/smpp_openbsc.c b/openbsc/src/libmsc/smpp_openbsc.c index f7d1441..36ad0a2 100644 --- a/openbsc/src/libmsc/smpp_openbsc.c +++ b/openbsc/src/libmsc/smpp_openbsc.c @@ -517,7 +517,7 @@ conn = connection_for_subscr(cmd->subscr); if (!conn) { LOGP(DSMPP, LOGL_ERROR, "No connection to subscriber anymore\n"); - return; + goto out; } trans = trans_find_by_id(conn, GSM48_PDISC_SMS, @@ -525,10 +525,11 @@ if (!trans) { LOGP(DSMPP, LOGL_ERROR, "GSM transaction %u is gone\n", cmd->sms->gsm411.transaction_id); - return; + goto out; } gsm411_send_rp_ack(trans, cmd->sms->gsm411.msg_ref); +out: smpp_cmd_free(cmd); } @@ -541,7 +542,7 @@ conn = connection_for_subscr(cmd->subscr); if (!conn) { LOGP(DSMPP, LOGL_ERROR, "No connection to subscriber anymore\n"); - return; + goto out; } trans = trans_find_by_id(conn, GSM48_PDISC_SMS, @@ -549,14 +550,14 @@ if (!trans) { LOGP(DSMPP, LOGL_ERROR, "GSM transaction %u is gone\n", cmd->sms->gsm411.transaction_id); - return; + goto out; } if (smpp_to_gsm411_err(status, &gsm411_cause) < 0) gsm411_cause = GSM411_RP_CAUSE_MO_NET_OUT_OF_ORDER; gsm411_send_rp_error(trans, cmd->sms->gsm411.msg_ref, gsm411_cause); - +out: smpp_cmd_free(cmd); } -- To view, visit https://gerrit.osmocom.org/3423 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I474584425d23fb379a9d71b33e29ac0e24f01e61 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Pablo Neira Ayuso Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Keith Whyte Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pablo Neira Ayuso From gerrit-no-reply at lists.osmocom.org Wed Aug 9 10:14:17 2017 From: gerrit-no-reply at lists.osmocom.org (Pablo Neira Ayuso) Date: Wed, 9 Aug 2017 10:14:17 +0000 Subject: [MERGED] openbsc[master]: libmsc: remove dead code in sms_route_mt_sms() In-Reply-To: References: Message-ID: Pablo Neira Ayuso has submitted this change and it was merged. Change subject: libmsc: remove dead code in sms_route_mt_sms() ...................................................................... libmsc: remove dead code in sms_route_mt_sms() The following branch: if (!rc && !gsms->receiver) rc = GSM411_RP_CAUSE_MO_NUM_UNASSIGNED; at the end of sms_route_mt_sms() always evaluates false. Just a bit before, in such function, we have this: if (!gsms->receiver) { ... #ifdef BUILD_SMPP ... #else ... #endif return rc; } So, if there is no receiver, we just stop running code and return the RP cause via the rc variable. Same applies to the smpp_first check under the BUILD_SMPP ifdef (that I have removed in this snippet to keep this commit message small). Change-Id: Ic3502b5b169bc7a73a67fd6ff53d8b6c0dc045c8 --- M openbsc/src/libmsc/gsm_04_11.c 1 file changed, 0 insertions(+), 3 deletions(-) Approvals: Neels Hofmeyr: Looks good to me, approved Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/openbsc/src/libmsc/gsm_04_11.c b/openbsc/src/libmsc/gsm_04_11.c index da4460c..7df5e64 100644 --- a/openbsc/src/libmsc/gsm_04_11.c +++ b/openbsc/src/libmsc/gsm_04_11.c @@ -356,9 +356,6 @@ break; } - if (!rc && !gsms->receiver) - rc = GSM411_RP_CAUSE_MO_NUM_UNASSIGNED; - return rc; } -- To view, visit https://gerrit.osmocom.org/3424 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ic3502b5b169bc7a73a67fd6ff53d8b6c0dc045c8 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Pablo Neira Ayuso Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Keith Whyte Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pablo Neira Ayuso From gerrit-no-reply at lists.osmocom.org Wed Aug 9 10:14:23 2017 From: gerrit-no-reply at lists.osmocom.org (Pablo Neira Ayuso) Date: Wed, 9 Aug 2017 10:14:23 +0000 Subject: [MERGED] openbsc[master]: libmsc: remove duplicate lines in deliver_to_esme() In-Reply-To: References: Message-ID: Pablo Neira Ayuso has submitted this change and it was merged. Change subject: libmsc: remove duplicate lines in deliver_to_esme() ...................................................................... libmsc: remove duplicate lines in deliver_to_esme() This code is accidentally doing the same thing twice, remove it. Change-Id: I68087a850399e22951d2407e4d8a09c671a775c9 --- M openbsc/src/libmsc/smpp_openbsc.c 1 file changed, 0 insertions(+), 2 deletions(-) Approvals: Neels Hofmeyr: Looks good to me, approved Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/openbsc/src/libmsc/smpp_openbsc.c b/openbsc/src/libmsc/smpp_openbsc.c index 36ad0a2..c9379ec 100644 --- a/openbsc/src/libmsc/smpp_openbsc.c +++ b/openbsc/src/libmsc/smpp_openbsc.c @@ -676,8 +676,6 @@ } else { deliver.sm_length = sms->user_data_len; memcpy(deliver.short_message, sms->user_data, deliver.sm_length); - deliver.sm_length = sms->user_data_len; - memcpy(deliver.short_message, sms->user_data, deliver.sm_length); } if (esme->acl && esme->acl->osmocom_ext && conn->lchan) -- To view, visit https://gerrit.osmocom.org/3425 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I68087a850399e22951d2407e4d8a09c671a775c9 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Pablo Neira Ayuso Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Keith Whyte Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pablo Neira Ayuso From gerrit-no-reply at lists.osmocom.org Wed Aug 9 10:14:28 2017 From: gerrit-no-reply at lists.osmocom.org (Pablo Neira Ayuso) Date: Wed, 9 Aug 2017 10:14:28 +0000 Subject: [MERGED] openbsc[master]: libmsc: remove 'deferred' parameter in sms_route_mt_sms() In-Reply-To: References: Message-ID: Pablo Neira Ayuso has submitted this change and it was merged. Change subject: libmsc: remove 'deferred' parameter in sms_route_mt_sms() ...................................................................... libmsc: remove 'deferred' parameter in sms_route_mt_sms() No need to cache the sms object, just cache what we need into the smpp_cmd structure. This simplifies what that I introduced in 93ffbd0029d1 ("libmsc: send RP-ACK to MS after ESME sends SMPP DELIVER-SM-RESP"). Change-Id: Iba5f864f9bb963baff95969e306b1b7cff00c1e3 --- M openbsc/src/libmsc/gsm_04_11.c M openbsc/src/libmsc/smpp_openbsc.c M openbsc/src/libmsc/smpp_smsc.h 3 files changed, 24 insertions(+), 30 deletions(-) Approvals: Neels Hofmeyr: Looks good to me, but someone else must approve Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/openbsc/src/libmsc/gsm_04_11.c b/openbsc/src/libmsc/gsm_04_11.c index 7df5e64..d60de08 100644 --- a/openbsc/src/libmsc/gsm_04_11.c +++ b/openbsc/src/libmsc/gsm_04_11.c @@ -278,8 +278,7 @@ } static int sms_route_mt_sms(struct gsm_subscriber_connection *conn, - struct gsm_sms *gsms, uint8_t sms_mti, - bool *deferred) + struct gsm_sms *gsms, uint8_t sms_mti) { int rc; @@ -293,7 +292,7 @@ * delivery of the SMS. */ if (smpp_first) { - rc = smpp_try_deliver(gsms, conn, deferred); + rc = smpp_try_deliver(gsms, conn); if (rc == GSM411_RP_CAUSE_MO_NUM_UNASSIGNED) /* unknown subscriber, try local */ goto try_local; @@ -322,7 +321,7 @@ return GSM411_RP_CAUSE_MO_NUM_UNASSIGNED; } - rc = smpp_try_deliver(gsms, conn, deferred); + rc = smpp_try_deliver(gsms, conn); if (rc == GSM411_RP_CAUSE_MO_NUM_UNASSIGNED) { rate_ctr_inc(&conn->network->msc_ctrs->ctr[MSC_CTR_SMS_NO_RECEIVER]); } else if (rc < 0) { @@ -363,7 +362,7 @@ /* process an incoming TPDU (called from RP-DATA) * return value > 0: RP CAUSE for ERROR; < 0: silent error; 0 = success */ static int gsm340_rx_tpdu(struct gsm_trans *trans, struct msgb *msg, - uint32_t gsm411_msg_ref, bool *deferred) + uint32_t gsm411_msg_ref) { struct gsm_subscriber_connection *conn = trans->conn; uint8_t *smsp = msgb_sms(msg); @@ -485,10 +484,9 @@ /* FIXME: This looks very wrong */ send_signal(0, NULL, gsms, 0); - rc = sms_route_mt_sms(conn, gsms, sms_mti, deferred); + rc = sms_route_mt_sms(conn, gsms, sms_mti); out: - if (!deferred) - sms_free(gsms); + sms_free(gsms); return rc; } @@ -541,7 +539,6 @@ uint8_t dst_len, uint8_t *dst, uint8_t tpdu_len, uint8_t *tpdu) { - bool deferred = false; int rc = 0; if (src_len && src) @@ -558,8 +555,8 @@ DEBUGP(DLSMS, "DST(%u,%s)\n", dst_len, osmo_hexdump(dst, dst_len)); - rc = gsm340_rx_tpdu(trans, msg, rph->msg_ref, &deferred); - if (rc == 0 && !deferred) + rc = gsm340_rx_tpdu(trans, msg, rph->msg_ref); + if (rc == 0) return gsm411_send_rp_ack(trans, rph->msg_ref); else if (rc > 0) return gsm411_send_rp_error(trans, rph->msg_ref, rc); diff --git a/openbsc/src/libmsc/smpp_openbsc.c b/openbsc/src/libmsc/smpp_openbsc.c index c9379ec..6b89df2 100644 --- a/openbsc/src/libmsc/smpp_openbsc.c +++ b/openbsc/src/libmsc/smpp_openbsc.c @@ -497,7 +497,6 @@ osmo_timer_del(&cmd->response_timer); llist_del(&cmd->list); subscr_put(cmd->subscr); - sms_free(cmd->sms); talloc_free(cmd); } @@ -520,15 +519,14 @@ goto out; } - trans = trans_find_by_id(conn, GSM48_PDISC_SMS, - cmd->sms->gsm411.transaction_id); + trans = trans_find_by_id(conn, GSM48_PDISC_SMS, cmd->gsm411_trans_id); if (!trans) { LOGP(DSMPP, LOGL_ERROR, "GSM transaction %u is gone\n", - cmd->sms->gsm411.transaction_id); + cmd->gsm411_trans_id); goto out; } - gsm411_send_rp_ack(trans, cmd->sms->gsm411.msg_ref); + gsm411_send_rp_ack(trans, cmd->gsm411_msg_ref); out: smpp_cmd_free(cmd); } @@ -545,18 +543,17 @@ goto out; } - trans = trans_find_by_id(conn, GSM48_PDISC_SMS, - cmd->sms->gsm411.transaction_id); + trans = trans_find_by_id(conn, GSM48_PDISC_SMS, cmd->gsm411_trans_id); if (!trans) { LOGP(DSMPP, LOGL_ERROR, "GSM transaction %u is gone\n", - cmd->sms->gsm411.transaction_id); + cmd->gsm411_trans_id); goto out; } if (smpp_to_gsm411_err(status, &gsm411_cause) < 0) gsm411_cause = GSM411_RP_CAUSE_MO_NET_OUT_OF_ORDER; - gsm411_send_rp_error(trans, cmd->sms->gsm411.msg_ref, gsm411_cause); + gsm411_send_rp_error(trans, cmd->gsm411_msg_ref, gsm411_cause); out: smpp_cmd_free(cmd); } @@ -568,7 +565,7 @@ static int smpp_cmd_enqueue(struct osmo_esme *esme, struct gsm_subscriber *subscr, struct gsm_sms *sms, - uint32_t sequence_number, bool *deferred) + uint32_t sequence_number) { struct osmo_smpp_cmd *cmd; @@ -577,7 +574,8 @@ return -1; cmd->sequence_nr = sequence_number; - cmd->sms = sms; + cmd->gsm411_msg_ref = sms->gsm411.msg_ref; + cmd->gsm411_trans_id = sms->gsm411.transaction_id; cmd->subscr = subscr_get(subscr); /* FIXME: No predefined value for this response_timer as specified by @@ -588,7 +586,6 @@ osmo_timer_setup(&cmd->response_timer, smpp_deliver_sm_cb, cmd); osmo_timer_schedule(&cmd->response_timer, 5, 0); llist_add_tail(&cmd->list, &esme->smpp_cmd_list); - *deferred = true; return 0; } @@ -606,8 +603,7 @@ } static int deliver_to_esme(struct osmo_esme *esme, struct gsm_sms *sms, - struct gsm_subscriber_connection *conn, - bool *deferred) + struct gsm_subscriber_connection *conn) { struct deliver_sm_t deliver; int mode, ret; @@ -686,7 +682,7 @@ return ret; return smpp_cmd_enqueue(esme, conn->subscr, sms, - deliver.sequence_number, deferred); + deliver.sequence_number); } static struct smsc *g_smsc; @@ -697,7 +693,7 @@ } int smpp_try_deliver(struct gsm_sms *sms, - struct gsm_subscriber_connection *conn, bool *deferred) + struct gsm_subscriber_connection *conn) { struct osmo_esme *esme; struct osmo_smpp_addr dst; @@ -710,7 +706,7 @@ rc = smpp_route(g_smsc, &dst, &esme); if (!rc) - rc = deliver_to_esme(esme, sms, conn, deferred); + rc = deliver_to_esme(esme, sms, conn); return rc; } diff --git a/openbsc/src/libmsc/smpp_smsc.h b/openbsc/src/libmsc/smpp_smsc.h index c9209ef..468d3b4 100644 --- a/openbsc/src/libmsc/smpp_smsc.h +++ b/openbsc/src/libmsc/smpp_smsc.h @@ -89,8 +89,9 @@ struct osmo_smpp_cmd { struct llist_head list; struct gsm_subscriber *subscr; - struct gsm_sms *sms; uint32_t sequence_nr; + uint32_t gsm411_msg_ref; + uint8_t gsm411_trans_id; struct osmo_timer_list response_timer; }; @@ -161,5 +162,5 @@ int smpp_route_smpp_first(struct gsm_sms *sms, struct gsm_subscriber_connection *conn); int smpp_try_deliver(struct gsm_sms *sms, - struct gsm_subscriber_connection *conn, bool *deferred); + struct gsm_subscriber_connection *conn); #endif -- To view, visit https://gerrit.osmocom.org/3426 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Iba5f864f9bb963baff95969e306b1b7cff00c1e3 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Pablo Neira Ayuso Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Keith Whyte Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pablo Neira Ayuso From gerrit-no-reply at lists.osmocom.org Wed Aug 9 10:14:58 2017 From: gerrit-no-reply at lists.osmocom.org (Pablo Neira Ayuso) Date: Wed, 9 Aug 2017 10:14:58 +0000 Subject: [MERGED] openbsc[master]: libmsc: move gsm340_rx_sms_submit() to sms_route_mt_sms() In-Reply-To: References: Message-ID: Pablo Neira Ayuso has submitted this change and it was merged. Change subject: libmsc: move gsm340_rx_sms_submit() to sms_route_mt_sms() ...................................................................... libmsc: move gsm340_rx_sms_submit() to sms_route_mt_sms() Move the sms message-type-identifier (mti) handling away from the routing logic. This patch allows us to reuse the sms_route_mt_sms() function in a follow up patch for sms reports send through SMPP DELIVER_SM with esm_class = Delivery Receipt whose Change-Id is Ic1a9023074bfa938099377980b6aff9b262fab2a. Change-Id: I3f3d30e0762b91e2099243b0be1a4b67cbb5e9c0 --- M openbsc/src/libmsc/gsm_04_11.c 1 file changed, 22 insertions(+), 19 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/openbsc/src/libmsc/gsm_04_11.c b/openbsc/src/libmsc/gsm_04_11.c index d60de08..7294153 100644 --- a/openbsc/src/libmsc/gsm_04_11.c +++ b/openbsc/src/libmsc/gsm_04_11.c @@ -278,7 +278,7 @@ } static int sms_route_mt_sms(struct gsm_subscriber_connection *conn, - struct gsm_sms *gsms, uint8_t sms_mti) + struct gsm_sms *gsms) { int rc; @@ -336,23 +336,6 @@ rc = GSM411_RP_CAUSE_MO_NUM_UNASSIGNED; rate_ctr_inc(&conn->network->msc_ctrs->ctr[MSC_CTR_SMS_NO_RECEIVER]); #endif - return rc; - } - - switch (sms_mti) { - case GSM340_SMS_SUBMIT_MS2SC: - /* MS is submitting a SMS */ - rc = gsm340_rx_sms_submit(gsms); - break; - case GSM340_SMS_COMMAND_MS2SC: - case GSM340_SMS_DELIVER_REP_MS2SC: - LOGP(DLSMS, 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); - rc = GSM411_RP_CAUSE_IE_NOTEXIST; - break; } return rc; @@ -484,7 +467,27 @@ /* FIXME: This looks very wrong */ send_signal(0, NULL, gsms, 0); - rc = sms_route_mt_sms(conn, gsms, sms_mti); + rc = sms_route_mt_sms(conn, gsms); + + /* This SMS got routed through SMPP or no receiver exists. */ + if (!gsms->receiver) + return rc; + + switch (sms_mti) { + case GSM340_SMS_SUBMIT_MS2SC: + /* MS is submitting a SMS */ + rc = gsm340_rx_sms_submit(gsms); + break; + case GSM340_SMS_COMMAND_MS2SC: + case GSM340_SMS_DELIVER_REP_MS2SC: + LOGP(DLSMS, 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); + rc = GSM411_RP_CAUSE_IE_NOTEXIST; + break; + } out: sms_free(gsms); -- To view, visit https://gerrit.osmocom.org/3427 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I3f3d30e0762b91e2099243b0be1a4b67cbb5e9c0 Gerrit-PatchSet: 2 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Pablo Neira Ayuso Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Keith Whyte Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pablo Neira Ayuso From gerrit-no-reply at lists.osmocom.org Wed Aug 9 10:16:10 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 9 Aug 2017 10:16:10 +0000 Subject: libosmocore[master]: gsm0480: modify USSD structures to support external handling In-Reply-To: References: Message-ID: Patch Set 2: The problem is that you're breaking API + ABI. The symbol stll exists, and code compiled against the old version of the symbol will crash in a non-obvious way. So I would prefer any solution that avoids this. Simply renaming the function would solve it, as then an old program would simply no longer start against the new library due to the missing symbol. bumping the libversion is something we only do as part of the tag/release process, and thus doesn't help immedaitely. We either need to change that policy, or we need a different solution that involes having the new function under a new name (whether or not the old function continues). -- To view, visit https://gerrit.osmocom.org/3374 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I5f8972b86cd4dcb54b643a24b5794a87c8758073 Gerrit-PatchSet: 2 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Alexander Chemeris Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Ivan Kluchnikov Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Aug 9 10:22:37 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Wed, 9 Aug 2017 10:22:37 +0000 Subject: [PATCH] osmo-pcu[master]: Add pcu-socket vty config 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/3443 to look at the new patch set (#3). Add pcu-socket vty config osmo-bts already supports configuring a different path for the bts<->pcu socket by using the 'pcu-socket' config field. Change-Id: I9b3e1171da467519750b201849ec892a1e318129 --- M include/osmocom/pcu/pcuif_proto.h M src/bts.h M src/osmobts_sock.cpp M src/pcu_main.cpp M src/pcu_vty.c 5 files changed, 30 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/43/3443/3 diff --git a/include/osmocom/pcu/pcuif_proto.h b/include/osmocom/pcu/pcuif_proto.h index 88dc09e..39103ee 100644 --- a/include/osmocom/pcu/pcuif_proto.h +++ b/include/osmocom/pcu/pcuif_proto.h @@ -3,6 +3,8 @@ #include +#define PCU_SOCK_DEFAULT "/tmp/pcu_bts" + #define PCU_IF_VERSION 0x07 #define TXT_MAX_LEN 128 diff --git a/src/bts.h b/src/bts.h index 25193f9..cff0020 100644 --- a/src/bts.h +++ b/src/bts.h @@ -233,6 +233,9 @@ * period. */ struct BTS *bts; + + /* Path to be used for the pcu-bts socket */ + char *pcu_sock_path; }; #ifdef __cplusplus diff --git a/src/osmobts_sock.cpp b/src/osmobts_sock.cpp index d7e55e7..e9b85ab 100644 --- a/src/osmobts_sock.cpp +++ b/src/osmobts_sock.cpp @@ -223,6 +223,7 @@ struct sockaddr_un local; unsigned int namelen; int rc; + struct gprs_rlcmac_bts *bts = bts_main_data(); LOGP(DL1IF, LOGL_INFO, "Opening OsmoPCU L1 interface to OsmoBTS\n"); @@ -244,7 +245,7 @@ } local.sun_family = AF_UNIX; - strncpy(local.sun_path, "/tmp/pcu_bts", sizeof(local.sun_path)); + strncpy(local.sun_path, bts->pcu_sock_path, sizeof(local.sun_path)); local.sun_path[sizeof(local.sun_path) - 1] = '\0'; /* we use the same magic that X11 uses in Xtranssock.c for diff --git a/src/pcu_main.cpp b/src/pcu_main.cpp index b69e446..8e7cde8 100644 --- a/src/pcu_main.cpp +++ b/src/pcu_main.cpp @@ -216,6 +216,8 @@ */ bts->dl_arq_type = EGPRS_ARQ1; + bts->pcu_sock_path = talloc_strdup(tall_pcu_ctx, PCU_SOCK_DEFAULT); + msgb_talloc_ctx_init(tall_pcu_ctx, 0); osmo_init_logging(&gprs_log_info); diff --git a/src/pcu_vty.c b/src/pcu_vty.c index cd22e38..68d2f55 100644 --- a/src/pcu_vty.c +++ b/src/pcu_vty.c @@ -9,6 +9,7 @@ #include #include #include +#include #include "pcu_vty.h" #include "gprs_rlcmac.h" #include "bts.h" @@ -233,6 +234,8 @@ if (bts->dl_tbf_idle_msec) vty_out(vty, " dl-tbf-idle-time %d%s", bts->dl_tbf_idle_msec, VTY_NEWLINE); + if (strcmp(bts->pcu_sock_path, PCU_SOCK_DEFAULT)) + vty_out(vty, " pcu-socket %s%s", bts->pcu_sock_path, VTY_NEWLINE); for (i = 0; i < 32; i++) { unsigned int cs = (1 << i); @@ -966,6 +969,23 @@ return CMD_SUCCESS; } +DEFUN(cfg_pcu_sock, + cfg_pcu_sock_cmd, + "pcu-socket PATH", + "Configure the osmo-bts PCU socket file/path name\n" + "Path of the socket to connect to\n") +{ + struct gprs_rlcmac_bts *bts = bts_main_data(); + + if (bts->pcu_sock_path) { + /* FIXME: close the interface? */ + talloc_free(bts->pcu_sock_path); + } + bts->pcu_sock_path = talloc_strdup(tall_pcu_ctx, argv[0]); + /* FIXME: re-open the interface? */ + + return CMD_SUCCESS; +} DEFUN(show_tbf, show_tbf_cmd, @@ -1096,6 +1116,7 @@ install_element(PCU_NODE, &cfg_pcu_no_ms_idle_time_cmd); install_element(PCU_NODE, &cfg_pcu_gsmtap_categ_cmd); install_element(PCU_NODE, &cfg_pcu_no_gsmtap_categ_cmd); + install_element(PCU_NODE, &cfg_pcu_sock_cmd); install_element_ve(&show_bts_stats_cmd); install_element_ve(&show_tbf_cmd); -- To view, visit https://gerrit.osmocom.org/3443 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I9b3e1171da467519750b201849ec892a1e318129 Gerrit-PatchSet: 3 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Wed Aug 9 10:29:34 2017 From: gerrit-no-reply at lists.osmocom.org (Pablo Neira Ayuso) Date: Wed, 9 Aug 2017 10:29:34 +0000 Subject: openbsc[master]: libmsc: set registered_delivery field in SMPP 3.4 DELIVER_SM... In-Reply-To: References: Message-ID: Patch Set 1: If I push the "submit" button here, gerrit (on a black screen) fails with: Code Review - Error Cannot merge 6f615241665a8c47500855e2d608cab4467e6443 Missing dependency -- To view, visit https://gerrit.osmocom.org/3428 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I59af60fa89cd10ae973c5e122789e3e03e3728ee Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Pablo Neira Ayuso Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Keith Whyte Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pablo Neira Ayuso Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Aug 9 10:36:44 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Wed, 9 Aug 2017 10:36:44 +0000 Subject: openbsc[master]: libmsc: set registered_delivery field in SMPP 3.4 DELIVER_SM... In-Reply-To: References: Message-ID: Patch Set 1: > If I push the "submit" button here, gerrit (on a black screen) > fails with: > > Code Review - Error > Cannot merge 6f615241665a8c47500855e2d608cab4467e6443 > Missing dependency I think that happens when you try to merge a commit in a branch with parent commits already merged. Not sure what's the best solution to fix this, I remember running into this a while ago and afair since then I just wait to have all the commits approved, then press "submit including parents" on the last commit in the branch. You may need to rebase it using the web UI or manually rebase + push on your PC, but let's see if somebody else knows better. -- To view, visit https://gerrit.osmocom.org/3428 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I59af60fa89cd10ae973c5e122789e3e03e3728ee Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Pablo Neira Ayuso Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Keith Whyte Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pablo Neira Ayuso Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Aug 9 10:38:21 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 9 Aug 2017 10:38:21 +0000 Subject: [MERGED] osmo-bts[master]: GSMTAP: Don't log fill frames via GSMTAP In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: GSMTAP: Don't log fill frames via GSMTAP ...................................................................... GSMTAP: Don't log fill frames via GSMTAP There's very little point in sending fill frames (such as empty PAGING) or dummy UI frames via GSMTAP all the time. They serve no purpose other than to bloat the log files and make it more difficult for users to find the interesting bits among all this noise. Change-Id: Icd18dafb235933c9e6aa9d98ddd8fac1522cc9ac --- M src/common/l1sap.c 1 file changed, 27 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/common/l1sap.c b/src/common/l1sap.c index 4bf24a5..97cbac1 100644 --- a/src/common/l1sap.c +++ b/src/common/l1sap.c @@ -317,6 +317,28 @@ return 0; } +/* Paging Request 1 with "no identity" content, i.e. empty/dummy paging */ +static const uint8_t paging_fill[GSM_MACBLOCK_LEN] = { + 0x15, 0x06, 0x21, 0x00, 0x01, 0xf0, 0x2b, 0x2b, 0x2b, 0x2b, + 0x2b, 0x2b, 0x2b, 0x2b, 0x2b, 0x2b, 0x2b, 0x2b, 0x2b, 0x2b, + 0x2b, 0x2b, 0x2b }; + +static bool is_fill_frame(uint8_t chan_type, const uint8_t *data, unsigned int len) +{ + switch (chan_type) { + case GSMTAP_CHANNEL_AGCH: + if (!memcmp(data, fill_frame, GSM_MACBLOCK_LEN)) + return true; + break; + case GSMTAP_CHANNEL_PCH: + if (!memcmp(data, paging_fill, GSM_MACBLOCK_LEN)) + return true; + break; + default: + return false; + } +} + static int to_gsmtap(struct gsm_bts_trx *trx, struct osmo_phsap_prim *l1sap) { uint8_t *data; @@ -364,6 +386,11 @@ return 0; } + /* don't log fill frames via GSMTAP; they serve no purpose other than + * to clog up your logs */ + if (is_fill_frame(chan_type, data, len)) + return 0; + gsmtap_send(gsmtap, trx->arfcn | uplink, tn, chan_type, ss, fn, 0, 0, data, len); -- To view, visit https://gerrit.osmocom.org/3372 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Icd18dafb235933c9e6aa9d98ddd8fac1522cc9ac Gerrit-PatchSet: 4 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Aug 9 10:45:21 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 9 Aug 2017 10:45:21 +0000 Subject: osmocom-bb[master]: vty_interface.c: use RPLMN from settings if preset In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3357 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ic70889cdb6be95f06d0c2df710524b4128b5f72b Gerrit-PatchSet: 1 Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Aug 9 10:45:24 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 9 Aug 2017 10:45:24 +0000 Subject: [MERGED] osmocom-bb[master]: vty_interface.c: use RPLMN from settings if preset In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: vty_interface.c: use RPLMN from settings if preset ...................................................................... vty_interface.c: use RPLMN from settings if preset Previously, when testcard was attached via VTY interface, the initial values were used for MCC / MNC, LAC and TMSI, even if correct RPLMN settings were set. Change-Id: Ic70889cdb6be95f06d0c2df710524b4128b5f72b --- M src/host/layer23/src/mobile/vty_interface.c 1 file changed, 15 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/host/layer23/src/mobile/vty_interface.c b/src/host/layer23/src/mobile/vty_interface.c index d909153..b26d471 100644 --- a/src/host/layer23/src/mobile/vty_interface.c +++ b/src/host/layer23/src/mobile/vty_interface.c @@ -472,6 +472,9 @@ int attached) { struct osmocom_ms *ms; + struct gsm_settings *set; + + /* Initial testcard settings */ uint16_t mcc = 0x001, mnc = 0x01f, lac = 0x0000; uint32_t tmsi = 0xffffffff; @@ -485,6 +488,18 @@ return CMD_WARNING; } + set = &ms->settings; + if (set->test_rplmn_valid) { + mcc = set->test_rplmn_mcc; + mnc = set->test_rplmn_mnc; + + if (set->test_lac > 0x0000 && set->test_lac < 0xfffe) + lac = set->test_lac; + + if (set->test_tmsi != 0xffffffff) + tmsi = set->test_tmsi; + } + if (argc == 2) { vty_out(vty, "Give MNC together with MCC%s", VTY_NEWLINE); return CMD_WARNING; -- To view, visit https://gerrit.osmocom.org/3357 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ic70889cdb6be95f06d0c2df710524b4128b5f72b Gerrit-PatchSet: 1 Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max From gerrit-no-reply at lists.osmocom.org Wed Aug 9 10:45:46 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 9 Aug 2017 10:45:46 +0000 Subject: osmo-ci[master]: Use stow for dependency management In-Reply-To: References: Message-ID: Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/2691 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I8f5012419495a656912b7b71e4f76ce102c6b63a Gerrit-PatchSet: 3 Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Owner: Alexander Huemer Gerrit-Reviewer: Alexander Huemer Gerrit-Reviewer: Andr? Boddenberg Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: blobb Gerrit-Reviewer: neels Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Aug 9 10:46:48 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 9 Aug 2017 10:46:48 +0000 Subject: openbsc[master]: timer vty: also print the default value in cmd doc In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3340 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I8259234e5c62e058dde56d531071440bbab11462 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Aug 9 10:47:02 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 9 Aug 2017 10:47:02 +0000 Subject: openbsc[master]: vty: add 'default' keyword to timer config In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3339 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I4e837e8bedfad7ac4fd50048ecb016ddb37c2397 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Aug 9 10:47:12 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 9 Aug 2017 10:47:12 +0000 Subject: openbsc[master]: cosmetic: vty for timers: remove obsolete range check In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3338 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I1cffa5b01cd5c589f1e42998e32135f1da8c960b Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Aug 9 10:47:18 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 9 Aug 2017 10:47:18 +0000 Subject: [MERGED] openbsc[master]: cosmetic: vty for timers: remove obsolete range check In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: cosmetic: vty for timers: remove obsolete range check ...................................................................... cosmetic: vty for timers: remove obsolete range check The VTY parsing already ensures the parameter range being 1..65535, no need to check the range again. Change-Id: I1cffa5b01cd5c589f1e42998e32135f1da8c960b --- M openbsc/src/libbsc/bsc_vty.c 1 file changed, 0 insertions(+), 6 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/openbsc/src/libbsc/bsc_vty.c b/openbsc/src/libbsc/bsc_vty.c index bcd78e3..49ff535 100644 --- a/openbsc/src/libbsc/bsc_vty.c +++ b/openbsc/src/libbsc/bsc_vty.c @@ -1551,12 +1551,6 @@ struct gsm_network *gsmnet = gsmnet_from_vty(vty); \ int value = atoi(argv[0]); \ \ - if (value < 1 || value > 65535) { \ - vty_out(vty, "Timer value %s out of range.%s", \ - argv[0], VTY_NEWLINE); \ - return CMD_WARNING; \ - } \ - \ gsmnet->T##number = value; \ return CMD_SUCCESS; \ } -- To view, visit https://gerrit.osmocom.org/3338 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I1cffa5b01cd5c589f1e42998e32135f1da8c960b Gerrit-PatchSet: 2 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Aug 9 10:47:18 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 9 Aug 2017 10:47:18 +0000 Subject: [MERGED] openbsc[master]: vty: add 'default' keyword to timer config In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: vty: add 'default' keyword to timer config ...................................................................... vty: add 'default' keyword to timer config Change-Id: I4e837e8bedfad7ac4fd50048ecb016ddb37c2397 --- M openbsc/src/libbsc/bsc_vty.c 1 file changed, 14 insertions(+), 3 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/openbsc/src/libbsc/bsc_vty.c b/openbsc/src/libbsc/bsc_vty.c index 49ff535..31eb143 100644 --- a/openbsc/src/libbsc/bsc_vty.c +++ b/openbsc/src/libbsc/bsc_vty.c @@ -1541,15 +1541,26 @@ return CMD_SUCCESS; } +#define DEFAULT_TIMER(number) GSM_T##number##_DEFAULT +/* Add another expansion so that DEFAULT_TIMER() becomes its value */ +#define EXPAND_AND_STRINGIFY(x) OSMO_STRINGIFY(x) + #define DECLARE_TIMER(number, doc) \ DEFUN(cfg_net_T##number, \ cfg_net_T##number##_cmd, \ - "timer t" #number " <1-65535>", \ + "timer t" #number " (default|<1-65535>)", \ "Configure GSM Timers\n" \ - doc "Timer Value in seconds\n") \ + doc \ + "Set to default timer value" \ + " (" EXPAND_AND_STRINGIFY(DEFAULT_TIMER(number)) " seconds)\n" \ + "Timer Value in seconds\n") \ { \ struct gsm_network *gsmnet = gsmnet_from_vty(vty); \ - int value = atoi(argv[0]); \ + int value; \ + if (strcmp(argv[0], "default") == 0) \ + value = DEFAULT_TIMER(number); \ + else \ + value = atoi(argv[0]); \ \ gsmnet->T##number = value; \ return CMD_SUCCESS; \ -- To view, visit https://gerrit.osmocom.org/3339 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I4e837e8bedfad7ac4fd50048ecb016ddb37c2397 Gerrit-PatchSet: 2 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Aug 9 10:47:18 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 9 Aug 2017 10:47:18 +0000 Subject: [MERGED] openbsc[master]: timer vty: also print the default value in cmd doc In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: timer vty: also print the default value in cmd doc ...................................................................... timer vty: also print the default value in cmd doc Rationale: allows seeing all timer defaults at once by doing OsmoBSC(config-net)# timer ? Before, defaults are visible only by doing on each timer: OsmoBSC(config-net)# timer t1234 Change-Id: I8259234e5c62e058dde56d531071440bbab11462 --- M openbsc/src/libbsc/bsc_vty.c 1 file changed, 13 insertions(+), 13 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/openbsc/src/libbsc/bsc_vty.c b/openbsc/src/libbsc/bsc_vty.c index 31eb143..c6ff6d5 100644 --- a/openbsc/src/libbsc/bsc_vty.c +++ b/openbsc/src/libbsc/bsc_vty.c @@ -1550,7 +1550,7 @@ cfg_net_T##number##_cmd, \ "timer t" #number " (default|<1-65535>)", \ "Configure GSM Timers\n" \ - doc \ + doc " (default: " EXPAND_AND_STRINGIFY(DEFAULT_TIMER(number)) " seconds)\n" \ "Set to default timer value" \ " (" EXPAND_AND_STRINGIFY(DEFAULT_TIMER(number)) " seconds)\n" \ "Timer Value in seconds\n") \ @@ -1566,18 +1566,18 @@ return CMD_SUCCESS; \ } -DECLARE_TIMER(3101, "Set the timeout value for IMMEDIATE ASSIGNMENT.\n") -DECLARE_TIMER(3103, "Set the timeout value for HANDOVER.\n") -DECLARE_TIMER(3105, "Set the timer for repetition of PHYSICAL INFORMATION.\n") -DECLARE_TIMER(3107, "Currently not used.\n") -DECLARE_TIMER(3109, "Set the RSL SACCH deactivation timeout.\n") -DECLARE_TIMER(3111, "Set the RSL timeout to wait before releasing the RF Channel.\n") -DECLARE_TIMER(3113, "Set the time to try paging a subscriber.\n") -DECLARE_TIMER(3115, "Currently not used.\n") -DECLARE_TIMER(3117, "Currently not used.\n") -DECLARE_TIMER(3119, "Currently not used.\n") -DECLARE_TIMER(3122, "Waiting time (seconds) after IMM ASS REJECT\n") -DECLARE_TIMER(3141, "Currently not used.\n") +DECLARE_TIMER(3101, "Set the timeout value for IMMEDIATE ASSIGNMENT") +DECLARE_TIMER(3103, "Set the timeout value for HANDOVER") +DECLARE_TIMER(3105, "Set the timer for repetition of PHYSICAL INFORMATION") +DECLARE_TIMER(3107, "Currently not used") +DECLARE_TIMER(3109, "Set the RSL SACCH deactivation timeout") +DECLARE_TIMER(3111, "Set the RSL timeout to wait before releasing the RF Channel") +DECLARE_TIMER(3113, "Set the time to try paging a subscriber") +DECLARE_TIMER(3115, "Currently not used") +DECLARE_TIMER(3117, "Currently not used") +DECLARE_TIMER(3119, "Currently not used") +DECLARE_TIMER(3122, "Waiting time (seconds) after IMM ASS REJECT") +DECLARE_TIMER(3141, "Currently not used") DEFUN_DEPRECATED(cfg_net_dtx, cfg_net_dtx_cmd, -- To view, visit https://gerrit.osmocom.org/3340 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I8259234e5c62e058dde56d531071440bbab11462 Gerrit-PatchSet: 2 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Aug 9 10:49:34 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 9 Aug 2017 10:49:34 +0000 Subject: openbsc[master]: libcommon: Fix log output for bts>0. In-Reply-To: References: Message-ID: Patch Set 2: ping? Alexander, can I motivat you to extend the test case to cover multiple BTSs and their numbers, as requested a month ago? Should be super trivial, AFAICT. -- To view, visit https://gerrit.osmocom.org/3185 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I61c18a7f021fcb1ec00d34a745f4e3ab03416c2d Gerrit-PatchSet: 2 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Alexander Chemeris Gerrit-Reviewer: Alexander Chemeris Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Aug 9 10:50:41 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 9 Aug 2017 10:50:41 +0000 Subject: osmo-pcu[master]: Move DL scheduling and RTS handler to trx level In-Reply-To: References: Message-ID: Patch Set 4: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3150 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ia176245647c19fa1551fb6f5c8225b2529f73cbf Gerrit-PatchSet: 4 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Aug 9 10:51:17 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 9 Aug 2017 10:51:17 +0000 Subject: osmo-pcu[master]: Encapsulate handling of UL ACK timeout In-Reply-To: References: Message-ID: Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3155 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ia3f009c52118db95b38a077e08eecda844e7f8d1 Gerrit-PatchSet: 3 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Aug 9 10:52:18 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 9 Aug 2017 10:52:18 +0000 Subject: osmo-pcu[master]: Move common code into functions In-Reply-To: References: Message-ID: Patch Set 4: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3156 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I9ec3ab8de100f0bc75044f55ac769d1083d52806 Gerrit-PatchSet: 4 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Aug 9 10:53:18 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 9 Aug 2017 10:53:18 +0000 Subject: osmo-pcu[master]: Move DL assignment to TBF-DL In-Reply-To: References: Message-ID: Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3157 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I04584103018675a2f35cfb565473bfd81a208d7c Gerrit-PatchSet: 3 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Aug 9 10:55:41 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 9 Aug 2017 10:55:41 +0000 Subject: osmo-pcu[master]: Simplify polling troubleshooting In-Reply-To: References: Message-ID: Patch Set 7: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/2859 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I14074207f8bbc18b3ebd60875bb99a0a3a4b399d Gerrit-PatchSet: 7 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Aug 9 11:01:53 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Wed, 9 Aug 2017 11:01:53 +0000 Subject: [MERGED] osmo-gsm-tester[master]: Set osmo-bts pcu-socket config to point to run dir In-Reply-To: References: Message-ID: Pau Espin Pedrol has submitted this change and it was merged. Change subject: Set osmo-bts pcu-socket config to point to run dir ...................................................................... Set osmo-bts pcu-socket config to point to run dir Otherwise osmo-bts stores the socket file in /tmp. If an earlier instance doesn't finish cleanly, the file is left there and a new instance will fail to start because it cannot create a new socket file in the same place. Change-Id: I5a1da23c45a4ac496fe765e0d78c52dae3e7808b --- M src/osmo_gsm_tester/bts_osmotrx.py M src/osmo_gsm_tester/bts_sysmo.py M src/osmo_gsm_tester/templates/osmo-bts-sysmo.cfg.tmpl M src/osmo_gsm_tester/templates/osmo-bts-trx.cfg.tmpl 4 files changed, 15 insertions(+), 3 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/osmo_gsm_tester/bts_osmotrx.py b/src/osmo_gsm_tester/bts_osmotrx.py index 585647a..d8675cb 100644 --- a/src/osmo_gsm_tester/bts_osmotrx.py +++ b/src/osmo_gsm_tester/bts_osmotrx.py @@ -95,8 +95,13 @@ values = dict(osmo_bts_trx=config.get_defaults('osmo_bts_trx')) config.overlay(values, self.suite_run.config()) - config.overlay(values, dict(osmo_bts_trx=dict(oml_remote_ip=self.bsc.addr()))) - config.overlay(values, dict(osmo_bts_trx=self.conf)) + config.overlay(values, { + 'osmo_bts_trx': { + 'oml_remote_ip': self.bsc.addr(), + 'pcu_socket_path': os.path.join(str(self.run_dir), 'pcu_bts') + } + }) + config.overlay(values, { 'osmo_bts_trx': self.conf }) self.dbg('OSMO-BTS-TRX CONFIG:\n' + pprint.pformat(values)) diff --git a/src/osmo_gsm_tester/bts_sysmo.py b/src/osmo_gsm_tester/bts_sysmo.py index eab0bdb..f37f88b 100644 --- a/src/osmo_gsm_tester/bts_sysmo.py +++ b/src/osmo_gsm_tester/bts_sysmo.py @@ -119,7 +119,12 @@ values = { 'osmo_bts_sysmo': config.get_defaults('osmo_bts_sysmo') } config.overlay(values, self.suite_run.config()) - config.overlay(values, { 'osmo_bts_sysmo': { 'oml_remote_ip': self.bsc.addr() } }) + config.overlay(values, { + 'osmo_bts_sysmo': { + 'oml_remote_ip': self.bsc.addr(), + 'pcu_socket_path': os.path.join(SysmoBts.REMOTE_DIR, 'pcu_bts') + } + }) config.overlay(values, { 'osmo_bts_sysmo': self.conf }) self.dbg('SYSMOBTS CONFIG:\n' + pprint.pformat(values)) diff --git a/src/osmo_gsm_tester/templates/osmo-bts-sysmo.cfg.tmpl b/src/osmo_gsm_tester/templates/osmo-bts-sysmo.cfg.tmpl index cf9666b..69f7ac1 100644 --- a/src/osmo_gsm_tester/templates/osmo-bts-sysmo.cfg.tmpl +++ b/src/osmo_gsm_tester/templates/osmo-bts-sysmo.cfg.tmpl @@ -16,6 +16,7 @@ band ${osmo_bts_sysmo.band} ipa unit-id ${osmo_bts_sysmo.ipa_unit_id} 0 oml remote-ip ${osmo_bts_sysmo.oml_remote_ip} + pcu-socket ${osmo_bts_sysmo.pcu_socket_path} gsmtap-sapi bcch gsmtap-sapi ccch gsmtap-sapi rach diff --git a/src/osmo_gsm_tester/templates/osmo-bts-trx.cfg.tmpl b/src/osmo_gsm_tester/templates/osmo-bts-trx.cfg.tmpl index 452b920..1737947 100644 --- a/src/osmo_gsm_tester/templates/osmo-bts-trx.cfg.tmpl +++ b/src/osmo_gsm_tester/templates/osmo-bts-trx.cfg.tmpl @@ -20,6 +20,7 @@ band ${osmo_bts_trx.band} ipa unit-id ${osmo_bts_trx.ipa_unit_id} 0 oml remote-ip ${osmo_bts_trx.oml_remote_ip} + pcu-socket ${osmo_bts_trx.pcu_socket_path} settsc gsmtap-sapi bcch gsmtap-sapi ccch -- To view, visit https://gerrit.osmocom.org/3441 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I5a1da23c45a4ac496fe765e0d78c52dae3e7808b Gerrit-PatchSet: 2 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Wed Aug 9 11:06:06 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 9 Aug 2017 11:06:06 +0000 Subject: [PATCH] osmo-bts[master]: TRX: Remove global variables, move SETBSIC/SETTSC handling i... 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/3044 to look at the new patch set (#4). TRX: Remove global variables, move SETBSIC/SETTSC handling into phy_link Whether or not we are talking to an OpenBTS (SETBSIC) or OsmoTRX (SETTSC) transceiver is a property of the phy_link, and not a property of the BTS. Also, we *really, really* should never use global variables. I'm very happy this is being cleaned up, finally. Change-Id: I51aeb17661dfd63ff347f7b2c0d7ffa383ec814c --- M include/osmo-bts/phy_link.h M src/osmo-bts-trx/trx_if.c M src/osmo-bts-trx/trx_if.h M src/osmo-bts-trx/trx_vty.c 4 files changed, 38 insertions(+), 66 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/44/3044/4 diff --git a/include/osmo-bts/phy_link.h b/include/osmo-bts/phy_link.h index 3d4bf91..7011622 100644 --- a/include/osmo-bts/phy_link.h +++ b/include/osmo-bts/phy_link.h @@ -47,6 +47,7 @@ uint32_t clock_advance; uint32_t rts_advance; + bool use_legacy_setbsic; } osmotrx; struct { char *mcast_dev; /* Network device for multicast */ diff --git a/src/osmo-bts-trx/trx_if.c b/src/osmo-bts-trx/trx_if.c index 8ce2893..86a3b9b 100644 --- a/src/osmo-bts-trx/trx_if.c +++ b/src/osmo-bts-trx/trx_if.c @@ -51,8 +51,6 @@ //#define TOA_RSSI_DEBUG int transceiver_available = 0; -int settsc_enabled = 0; -int setbsic_enabled = 0; #define TRX_MAX_BURST_LEN 512 @@ -248,21 +246,21 @@ /*! Send "SETTSC" command to TRX */ int trx_if_cmd_settsc(struct trx_l1h *l1h, uint8_t tsc) { - if (!settsc_enabled) + struct phy_instance *pinst = l1h->phy_inst; + if (pinst->phy_link->u.osmotrx.use_legacy_setbsic) return 0; - /* if TSC is enabled only, the positive response is mandatory */ - return trx_ctrl_cmd(l1h, (setbsic_enabled) ? 0 : 1, "SETTSC", "%d", - tsc); + + return trx_ctrl_cmd(l1h, 1, "SETTSC", "%d", tsc); } /*! Send "SETBSIC" command to TRX */ int trx_if_cmd_setbsic(struct trx_l1h *l1h, uint8_t bsic) { - if (!setbsic_enabled) + struct phy_instance *pinst = l1h->phy_inst; + if (!pinst->phy_link->u.osmotrx.use_legacy_setbsic) return 0; - /* if BSIC is enabled only, the positive response is mandatory */ - return trx_ctrl_cmd(l1h, (settsc_enabled) ? 0 : 1, "SETBSIC", "%d", - bsic); + + return trx_ctrl_cmd(l1h, 1, "SETBSIC", "%d", bsic); } /*! Send "SETRXGAIN" command to TRX */ diff --git a/src/osmo-bts-trx/trx_if.h b/src/osmo-bts-trx/trx_if.h index 86fb18f..076e35e 100644 --- a/src/osmo-bts-trx/trx_if.h +++ b/src/osmo-bts-trx/trx_if.h @@ -2,8 +2,6 @@ #define TRX_IF_H extern int transceiver_available; -extern int settsc_enabled; -extern int setbsic_enabled; struct trx_l1h; diff --git a/src/osmo-bts-trx/trx_vty.c b/src/osmo-bts-trx/trx_vty.c index 6d6cded..482248c 100644 --- a/src/osmo-bts-trx/trx_vty.c +++ b/src/osmo-bts-trx/trx_vty.c @@ -197,51 +197,6 @@ return CMD_SUCCESS; } -DEFUN(cfg_bts_settsc, cfg_bts_settsc_cmd, - "settsc", - "Use SETTSC to configure transceiver\n") -{ - settsc_enabled = 1; - - return CMD_SUCCESS; -} - -DEFUN(cfg_bts_setbsic, cfg_bts_setbsic_cmd, - "setbsic", - "Use SETBSIC to configure transceiver\n") -{ - setbsic_enabled = 1; - - return CMD_SUCCESS; -} - -DEFUN(cfg_bts_no_settsc, cfg_bts_no_settsc_cmd, - "no settsc", - NO_STR "Disable SETTSC to configure transceiver\n") -{ - settsc_enabled = 0; - if (!setbsic_enabled) { - vty_out(vty, "%% Auto enabling SETBSIC.%s", VTY_NEWLINE); - setbsic_enabled = 1; - } - - return CMD_SUCCESS; -} - -DEFUN(cfg_bts_no_setbsic, cfg_bts_no_setbsic_cmd, - "no setbsic", - NO_STR "Disable SETBSIC to configure transceiver\n") -{ - setbsic_enabled = 0; - if (!settsc_enabled) { - vty_out(vty, "%% Auto enabling SETTSC.%s", VTY_NEWLINE); - settsc_enabled = 1; - } - - return CMD_SUCCESS; -} - - DEFUN(cfg_phyinst_maxdly, cfg_phyinst_maxdly_cmd, "osmotrx maxdly <0-31>", "Set the maximum acceptable delay of an Access Burst (in GSM symbols)." @@ -322,7 +277,6 @@ vty_out(vty, "OFF: %d%s", trx_if_cmd_poweroff(l1h), VTY_NEWLINE); else { vty_out(vty, "ON: %d%s", trx_if_cmd_poweron(l1h), VTY_NEWLINE); - settsc_enabled = 1; } return CMD_SUCCESS; @@ -503,6 +457,30 @@ return CMD_SUCCESS; } +DEFUN(cfg_phy_setbsic, cfg_phy_setbsic_cmd, + "osmotrx legacy-setbsic", + "Use SETBSIC to configure transceiver (use ONLY with OpenBTS Transceiver!)\n") +{ + struct phy_link *plink = vty->index; + plink->u.osmotrx.use_legacy_setbsic = true; + + vty_out(vty, "%% You have enabled SETBSIC, which is not supported by OsmoTRX " + "but only useful if you want to interface with legacy OpenBTS Transceivers%s", + VTY_NEWLINE); + + return CMD_SUCCESS; +} + +DEFUN(cfg_phy_no_setbsic, cfg_phy_no_setbsic_cmd, + "no osmotrx legacy-setbsic", + NO_STR "Disable Legacy SETBSIC to configure transceiver\n") +{ + struct phy_link *plink = vty->index; + plink->u.osmotrx.use_legacy_setbsic = false; + + return CMD_SUCCESS; +} + void bts_model_config_write_phy(struct vty *vty, struct phy_link *plink) { if (plink->u.osmotrx.local_ip) @@ -523,6 +501,9 @@ plink->u.osmotrx.clock_advance, VTY_NEWLINE); vty_out(vty, " osmotrx rts-advance %d%s", plink->u.osmotrx.rts_advance, VTY_NEWLINE); + + if (plink->u.osmotrx.use_legacy_setbsic) + vty_out(vty, " osmotrx leyacy-setbsic%s", VTY_NEWLINE); } void bts_model_config_write_phy_inst(struct vty *vty, struct phy_instance *pinst) @@ -565,10 +546,6 @@ vty_out(vty, " no ms-power-loop%s", VTY_NEWLINE); vty_out(vty, " %stiming-advance-loop%s", (trx_ta_loop) ? "":"no ", VTY_NEWLINE); - if (settsc_enabled) - vty_out(vty, " settsc%s", VTY_NEWLINE); - if (setbsic_enabled) - vty_out(vty, " setbsic%s", VTY_NEWLINE); } void bts_model_config_write_trx(struct vty *vty, struct gsm_bts_trx *trx) @@ -586,16 +563,14 @@ install_element(BTS_NODE, &cfg_bts_no_ms_power_loop_cmd); install_element(BTS_NODE, &cfg_bts_timing_advance_loop_cmd); install_element(BTS_NODE, &cfg_bts_no_timing_advance_loop_cmd); - install_element(BTS_NODE, &cfg_bts_settsc_cmd); - install_element(BTS_NODE, &cfg_bts_setbsic_cmd); - install_element(BTS_NODE, &cfg_bts_no_settsc_cmd); - install_element(BTS_NODE, &cfg_bts_no_setbsic_cmd); install_element(PHY_NODE, &cfg_phy_base_port_cmd); install_element(PHY_NODE, &cfg_phy_fn_advance_cmd); install_element(PHY_NODE, &cfg_phy_rts_advance_cmd); install_element(PHY_NODE, &cfg_phy_transc_ip_cmd); install_element(PHY_NODE, &cfg_phy_osmotrx_ip_cmd); + install_element(PHY_NODE, &cfg_phy_setbsic_cmd); + install_element(PHY_NODE, &cfg_phy_no_setbsic_cmd); install_element(PHY_INST_NODE, &cfg_phyinst_rxgain_cmd); install_element(PHY_INST_NODE, &cfg_phyinst_tx_atten_cmd); -- To view, visit https://gerrit.osmocom.org/3044 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I51aeb17661dfd63ff347f7b2c0d7ffa383ec814c Gerrit-PatchSet: 4 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Vadim Yanitskiy From gerrit-no-reply at lists.osmocom.org Wed Aug 9 11:06:06 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 9 Aug 2017 11:06:06 +0000 Subject: [PATCH] osmo-bts[master]: TRX: Remove bogus extern global variable declarations In-Reply-To: References: Message-ID: Hello Vadim Yanitskiy, Max, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3045 to look at the new patch set (#4). TRX: Remove bogus extern global variable declarations Those global variable declarations for non-existing variables were introduced in 8a8d73a691c709403be4adbe8f2a7150b4d5998a, let's remove them again. The source / destination IP address is a parameter of the phy_link, and not a global variable. Change-Id: I94b5f934fc3bd00b0467d90029d3053b16594186 --- M src/osmo-bts-trx/trx_if.h 1 file changed, 0 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/45/3045/4 diff --git a/src/osmo-bts-trx/trx_if.h b/src/osmo-bts-trx/trx_if.h index 1fc454d..86fb18f 100644 --- a/src/osmo-bts-trx/trx_if.h +++ b/src/osmo-bts-trx/trx_if.h @@ -2,8 +2,6 @@ #define TRX_IF_H extern int transceiver_available; -extern const char *local_ip; -extern const char *remote_ip; extern int settsc_enabled; extern int setbsic_enabled; -- To view, visit https://gerrit.osmocom.org/3045 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I94b5f934fc3bd00b0467d90029d3053b16594186 Gerrit-PatchSet: 4 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Vadim Yanitskiy From gerrit-no-reply at lists.osmocom.org Wed Aug 9 11:06:06 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 9 Aug 2017 11:06:06 +0000 Subject: [PATCH] osmo-bts[master]: l1sap/osmo-bts-sysmo: Improve logging In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3038 to look at the new patch set (#2). l1sap/osmo-bts-sysmo: Improve logging Change-Id: I339db0e5f3fd5e44bac974f2447afc80388802af --- M src/common/l1sap.c 1 file changed, 23 insertions(+), 12 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/38/3038/2 diff --git a/src/common/l1sap.c b/src/common/l1sap.c index 97cbac1..21d9dc6 100644 --- a/src/common/l1sap.c +++ b/src/common/l1sap.c @@ -500,12 +500,16 @@ struct bts_ul_meas ulm; struct gsm_lchan *lchan; - DEBUGP(DL1P, "MPH_INFO meas ind chan_nr=0x%02x\n", - info_meas_ind->chan_nr); - lchan = get_active_lchan_by_chan_nr(trx, info_meas_ind->chan_nr); - if (!lchan) + if (!lchan) { + LOGP(DL1P, LOGL_ERROR, "No lchan for MPH INFO MEAS IND (chan_nr=%u)\n", + info_meas_ind->chan_nr); return 0; + } + + DEBUGP(DL1P, "%s MPH_INFO meas ind, ta_offs_qbits=%d, ber10k=%d, inv_rssi=%u\n", + gsm_lchan_name(lchan), info_meas_ind->ta_offs_qbits, + info_meas_ind->ber10k, info_meas_ind->inv_rssi); /* in the GPRS case we are not interested in measurement * processing. The PCU will take care of it */ @@ -727,8 +731,10 @@ memcpy(p, fill_frame, GSM_MACBLOCK_LEN); } else if (!(chan_nr & 0x80)) { /* only TCH/F, TCH/H, SDCCH/4 and SDCCH/8 have C5 bit cleared */ lchan = get_active_lchan_by_chan_nr(trx, chan_nr); - if (!lchan) + if (!lchan) { + LOGP(DL1P, LOGL_ERROR, "No lchan for PH-RTS.ind (chan_nr=%u)\n", chan_nr); return 0; + } if (L1SAP_IS_LINK_SACCH(link_id)) { p = msgb_put(msg, GSM_MACBLOCK_LEN); /* L1-header, if not set/modified by layer 1 */ @@ -779,8 +785,8 @@ memcpy(p, fill_frame, GSM_MACBLOCK_LEN); } - DEBUGP(DL1P, "Tx PH-DATA.req %02u/%02u/%02u chan_nr=%02x link_id=0x%02x\n", - g_time.t1, g_time.t2, g_time.t3, chan_nr, link_id); + DEBUGP(DL1P, "Tx PH-DATA.req %s chan_nr=0x%02x link_id=0x%02x\n", + osmo_dump_gsmtime(&g_time), chan_nr, link_id); l1sap_down(trx, l1sap); @@ -830,8 +836,10 @@ DEBUGP(DL1P, "Rx TCH-RTS.ind %s chan_nr=0x%02x\n", osmo_dump_gsmtime(&g_time), chan_nr); lchan = get_active_lchan_by_chan_nr(trx, chan_nr); - if (!lchan) + if (!lchan) { + LOGP(DL1P, LOGL_ERROR, "No lchan for PH-RTS.ind (chan_nr=%u)\n", chan_nr); return 0; + } if (!lchan->loopback && lchan->abis_ip.rtp_socket) { osmo_rtp_socket_poll(lchan->abis_ip.rtp_socket); @@ -880,8 +888,7 @@ resp_l1sap->u.tch.fn = fn; resp_l1sap->u.tch.marker = marker; - DEBUGP(DL1P, "Tx TCH.req %02u/%02u/%02u chan_nr=0x%02x\n", - g_time.t1, g_time.t2, g_time.t3, chan_nr); + DEBUGP(DL1P, "Tx TCH.req %s chan_nr=0x%02x\n", osmo_dump_gsmtime(&g_time), chan_nr); l1sap_down(trx, resp_l1sap); @@ -1024,8 +1031,10 @@ } lchan = get_active_lchan_by_chan_nr(trx, chan_nr); - if (!lchan) + if (!lchan) { + LOGP(DL1P, LOGL_ERROR, "No lchan for chan_nr=%d\n", chan_nr); return 0; + } /* bad frame */ if (len == 0) { @@ -1091,8 +1100,10 @@ DEBUGP(DL1P, "Rx TCH.ind %s chan_nr=0x%02x\n", osmo_dump_gsmtime(&g_time), chan_nr); lchan = get_active_lchan_by_chan_nr(trx, chan_nr); - if (!lchan) + if (!lchan) { + LOGP(DL1P, LOGL_ERROR, "No lchan for TCH.ind (chan_nr=%u)\n", chan_nr); return 0; + } msgb_pull(msg, sizeof(*l1sap)); -- To view, visit https://gerrit.osmocom.org/3038 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I339db0e5f3fd5e44bac974f2447afc80388802af Gerrit-PatchSet: 2 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Aug 9 11:09:42 2017 From: gerrit-no-reply at lists.osmocom.org (Pablo Neira Ayuso) Date: Wed, 9 Aug 2017 11:09:42 +0000 Subject: [PATCH] openbsc[master]: libmsc: report status report request flag from SMPP SUBMIT_SM 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/3429 to look at the new patch set (#3). libmsc: report status report request flag from SMPP SUBMIT_SM Restore the sms status report request flag from SUBMIT_SM. Change-Id: Iac05252253f8933a3875b4904599b7a225191a4b --- M openbsc/src/libmsc/smpp_openbsc.c 1 file changed, 1 insertion(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/29/3429/3 diff --git a/openbsc/src/libmsc/smpp_openbsc.c b/openbsc/src/libmsc/smpp_openbsc.c index cf78676..a803763 100644 --- a/openbsc/src/libmsc/smpp_openbsc.c +++ b/openbsc/src/libmsc/smpp_openbsc.c @@ -129,6 +129,7 @@ sms = sms_alloc(); sms->source = SMS_SOURCE_SMPP; sms->smpp.sequence_nr = submit->sequence_number; + sms->status_rep_req = submit->registered_delivery; /* fill in the destination address */ sms->receiver = dest; -- To view, visit https://gerrit.osmocom.org/3429 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Iac05252253f8933a3875b4904599b7a225191a4b Gerrit-PatchSet: 3 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Pablo Neira Ayuso Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Keith Whyte Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pablo Neira Ayuso From gerrit-no-reply at lists.osmocom.org Wed Aug 9 11:09:42 2017 From: gerrit-no-reply at lists.osmocom.org (Pablo Neira Ayuso) Date: Wed, 9 Aug 2017 11:09:42 +0000 Subject: [PATCH] openbsc[master]: libmsc: add support for SMPP delivery receipts In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3434 to look at the new patch set (#2). libmsc: add support for SMPP delivery receipts If the mobile phone requests a status report via SMS, send a DELIVER_SM with esm_class = Delivery Receipt to ESME to indicate that the SMS has been already delivered to its destination. MS GSM 03.40 SMSC SMPP 3.4 ESME | | | | SMS-DELIVER | | |<----------------------------| | | GSM 04.11 RP-ACK | | |---------------------------->| | | | DELIVER-SM | | | esm_class = Delivery Receipt | | |------------------------------->| | | DELIVER-SM-RESP | | |<-------------------------------| | | | This patch implements "Appendix B. Delivery Receipt Format" as specified in the SMPP 3.4 specs. This string is conveyed in the SMS message as data, and it is only meaningful to the ESME, for logging purposes. The "submit date" and "done date" are not yet set, and other fields are just sent with dummy values, so they are left to be finished as future work. The new SMPP TLV tag TLVID_user_message_reference is added to the SMPP messages inconditionally now since this information is required by delivery-reports to associate the status-report with the original SMS. Change-Id: Ic1a9023074bfa938099377980b6aff9b262fab2a --- M openbsc/include/openbsc/gsm_data.h M openbsc/src/libmsc/gsm_04_11.c M openbsc/src/libmsc/smpp_openbsc.c M openbsc/src/libmsc/smpp_smsc.h 4 files changed, 76 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/34/3434/2 diff --git a/openbsc/include/openbsc/gsm_data.h b/openbsc/include/openbsc/gsm_data.h index 37a341c..6829d22 100644 --- a/openbsc/include/openbsc/gsm_data.h +++ b/openbsc/include/openbsc/gsm_data.h @@ -456,6 +456,7 @@ } smpp; unsigned long validity_minutes; + bool is_report; uint8_t reply_path_req; uint8_t status_rep_req; uint8_t ud_hdr_ind; diff --git a/openbsc/src/libmsc/gsm_04_11.c b/openbsc/src/libmsc/gsm_04_11.c index 1aed60e..0edbe0b 100644 --- a/openbsc/src/libmsc/gsm_04_11.c +++ b/openbsc/src/libmsc/gsm_04_11.c @@ -593,6 +593,57 @@ rpud_len, rp_ud); } +static struct gsm_sms *sms_report_alloc(struct gsm_sms *sms) +{ + struct gsm_sms *sms_report; + int len; + + sms_report = sms_alloc(); + OSMO_ASSERT(sms_report); + + sms_report->msg_ref = sms->msg_ref; + sms_report->protocol_id = sms->protocol_id; + sms_report->data_coding_scheme = GSM338_DCS_1111_8BIT_DATA; + + /* Invert address to send status report back to origin. */ + sms_report->src = sms->dst; + sms_report->dst = sms->src; + + /* As specified by Appendix B. Delivery Receipt Format. + * TODO: Many fields in this string are just set with dummy values, + * revisit this. + */ + len = snprintf((char *)sms_report->user_data, + sizeof(sms_report->user_data), + "id:%.08llu sub:000 dlvrd:000 submit date:YYMMDDhhmm done date:YYMMDDhhmm stat:DELIVRD err:000 text:%.20s", + sms->id, sms->user_data); + sms_report->user_data_len = len; + LOGP(DLSMS, LOGL_NOTICE, "%s\n", sms_report->user_data); + + /* This represents a sms report. */ + sms_report->is_report = true; + + return sms_report; +} + +static void sms_status_report(struct gsm_sms *gsms, + struct gsm_subscriber_connection *conn) +{ + struct gsm_sms *sms_report; + int rc; + + sms_report = sms_report_alloc(gsms); + + rc = sms_route_mt_sms(conn, sms_report); + if (rc < 0) { + LOGP(DLSMS, LOGL_ERROR, + "Failed to send status report! err=%d\n", rc); + } + LOGP(DLSMS, LOGL_NOTICE, "Status report has been sent\n"); + + sms_free(sms_report); +} + /* Receive a 04.11 RP-ACK message (response to RP-DATA from us) */ static int gsm411_rx_rp_ack(struct msgb *msg, struct gsm_trans *trans, struct gsm411_rp_hdr *rph) @@ -614,6 +665,9 @@ send_signal(S_SMS_DELIVERED, trans, sms, 0); + if (sms->status_rep_req) + sms_status_report(sms, trans->conn); + sms_free(sms); trans->sms.sms = NULL; diff --git a/openbsc/src/libmsc/smpp_openbsc.c b/openbsc/src/libmsc/smpp_openbsc.c index a803763..c0aa89b 100644 --- a/openbsc/src/libmsc/smpp_openbsc.c +++ b/openbsc/src/libmsc/smpp_openbsc.c @@ -200,6 +200,10 @@ sms->user_data_len = sms_msg_len; } + t = find_tlv(submit->tlv, TLVID_user_message_reference); + if (t) + sms->msg_ref = ntohs(t->value.val16); + *psms = sms; return ESME_ROK; } @@ -514,6 +518,9 @@ struct gsm_subscriber_connection *conn; struct gsm_trans *trans; + if (cmd->is_report) + goto out; + conn = connection_for_subscr(cmd->subscr); if (!conn) { LOGP(DSMPP, LOGL_ERROR, "No connection to subscriber anymore\n"); @@ -537,6 +544,9 @@ struct gsm_subscriber_connection *conn; struct gsm_trans *trans; int gsm411_cause; + + if (cmd->is_report) + goto out; conn = connection_for_subscr(cmd->subscr); if (!conn) { @@ -575,6 +585,7 @@ return -1; cmd->sequence_nr = sequence_number; + cmd->is_report = sms->is_report; cmd->gsm411_msg_ref = sms->gsm411.msg_ref; cmd->gsm411_trans_id = sms->gsm411.transaction_id; cmd->subscr = subscr_get(subscr); @@ -639,7 +650,12 @@ memcpy(deliver.destination_addr, sms->dst.addr, sizeof(deliver.destination_addr)); - deliver.esm_class = 1; /* datagram mode */ + /* Short message contains a delivery receipt? Sect. 5.2.12. */ + if (sms->is_report) + deliver.esm_class = 0x04; + else + deliver.esm_class = 1; /* datagram mode */ + if (sms->ud_hdr_ind) deliver.esm_class |= 0x40; if (sms->reply_path_req) @@ -685,6 +701,9 @@ if (esme->acl && esme->acl->osmocom_ext && conn->lchan) append_osmo_tlvs(&deliver.tlv, conn->lchan); + append_tlv_u16(&deliver.tlv, TLVID_user_message_reference, + sms->msg_ref); + ret = smpp_tx_deliver(esme, &deliver); if (ret < 0) return ret; diff --git a/openbsc/src/libmsc/smpp_smsc.h b/openbsc/src/libmsc/smpp_smsc.h index 468d3b4..257383f 100644 --- a/openbsc/src/libmsc/smpp_smsc.h +++ b/openbsc/src/libmsc/smpp_smsc.h @@ -92,6 +92,7 @@ uint32_t sequence_nr; uint32_t gsm411_msg_ref; uint8_t gsm411_trans_id; + bool is_report; struct osmo_timer_list response_timer; }; -- To view, visit https://gerrit.osmocom.org/3434 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ic1a9023074bfa938099377980b6aff9b262fab2a Gerrit-PatchSet: 2 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Pablo Neira Ayuso Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Keith Whyte Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pablo Neira Ayuso From gerrit-no-reply at lists.osmocom.org Wed Aug 9 11:09:42 2017 From: gerrit-no-reply at lists.osmocom.org (Pablo Neira Ayuso) Date: Wed, 9 Aug 2017 11:09:42 +0000 Subject: [PATCH] openbsc[master]: libmsc: update database to accomodate SMS status-report fields In-Reply-To: References: Message-ID: Hello Neels Hofmeyr, Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3435 to look at the new patch set (#3). libmsc: update database to accomodate SMS status-report fields SMPP DELIVER_SM messages with esm_class = Delivery Receipt need to send this message reference (that the mobile phone allocates) to the ESME. Thus, the ESME propagates it via SUBMIT_SM with esm_class = Delivery Acknoledgment so that the SMSC sends the GSM 03.40 status-report to the origin including this. Given this field is useful for status-reports, we need to store it in the HLR database. Moreover, we need a new field that specifies if the entry represents a SMS status-report, to do the right handling from the gsm411_send_sms() - such new handling comes in a follow up patch entitled "libmsc: handle delivery ack via SMPP SUBMIT SM / send GSM 03.40 status report". This patch includes the migration routines to the new database schema revision 5, it's quite a bit of dbi boilerplate code - copied-pasted and adapted. Change-Id: I7276d356d805a83ebeec72b02c8563b7135ea0b6 --- M openbsc/src/libmsc/db.c 1 file changed, 162 insertions(+), 6 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/35/3435/3 diff --git a/openbsc/src/libmsc/db.c b/openbsc/src/libmsc/db.c index 5fe2a3c..9945dca 100644 --- a/openbsc/src/libmsc/db.c +++ b/openbsc/src/libmsc/db.c @@ -50,7 +50,7 @@ static char *db_dirname = NULL; static dbi_conn conn; -#define SCHEMA_REVISION "4" +#define SCHEMA_REVISION "5" enum { SCHEMA_META, @@ -124,6 +124,8 @@ "valid_until TIMESTAMP, " "reply_path_req INTEGER NOT NULL, " "status_rep_req INTEGER NOT NULL, " + "is_report INTEGER NOT NULL, " + "msg_ref INTEGER NOT NULL, " "protocol_id INTEGER NOT NULL, " "data_coding_scheme INTEGER NOT NULL, " "ud_hdr_ind INTEGER NOT NULL, " @@ -370,6 +372,152 @@ return -EINVAL; } +/* Just like v3, but there is a new message reference field for status reports, + * that is set to zero for existing entries since there is no way we can infer + * this. + */ +static struct gsm_sms *sms_from_result_v4(dbi_result result) +{ + struct gsm_sms *sms = sms_alloc(); + const unsigned char *user_data; + const char *text, *addr; + + if (!sms) + return NULL; + + sms->id = dbi_result_get_ulonglong(result, "id"); + + sms->reply_path_req = dbi_result_get_ulonglong(result, "reply_path_req"); + sms->status_rep_req = dbi_result_get_ulonglong(result, "status_rep_req"); + sms->ud_hdr_ind = dbi_result_get_ulonglong(result, "ud_hdr_ind"); + sms->protocol_id = dbi_result_get_ulonglong(result, "protocol_id"); + sms->data_coding_scheme = dbi_result_get_ulonglong(result, + "data_coding_scheme"); + + addr = dbi_result_get_string(result, "src_addr"); + osmo_strlcpy(sms->src.addr, addr, sizeof(sms->src.addr)); + sms->src.ton = dbi_result_get_ulonglong(result, "src_ton"); + sms->src.npi = dbi_result_get_ulonglong(result, "src_npi"); + + addr = dbi_result_get_string(result, "dest_addr"); + osmo_strlcpy(sms->dst.addr, addr, sizeof(sms->dst.addr)); + sms->dst.ton = dbi_result_get_ulonglong(result, "dest_ton"); + sms->dst.npi = dbi_result_get_ulonglong(result, "dest_npi"); + + sms->user_data_len = dbi_result_get_field_length(result, "user_data"); + user_data = dbi_result_get_binary(result, "user_data"); + if (sms->user_data_len > sizeof(sms->user_data)) + sms->user_data_len = (uint8_t) sizeof(sms->user_data); + memcpy(sms->user_data, user_data, sms->user_data_len); + + text = dbi_result_get_string(result, "text"); + if (text) + osmo_strlcpy(sms->text, text, sizeof(sms->text)); + return sms; +} + +static int update_db_revision_4(void) +{ + dbi_result result; + struct gsm_sms *sms; + + LOGP(DDB, LOGL_NOTICE, "Going to migrate from revision 4\n"); + + result = dbi_conn_query(conn, "BEGIN EXCLUSIVE TRANSACTION"); + if (!result) { + LOGP(DDB, LOGL_ERROR, + "Failed to begin transaction (upgrade from rev 4)\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_4"); + if (!result) { + LOGP(DDB, LOGL_ERROR, + "Failed to rename the old SMS table (upgrade from rev 4).\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 4).\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_4"); + if (!result) { + LOGP(DDB, LOGL_ERROR, + "Failed fetch messages from the old SMS table (upgrade from rev 4).\n"); + goto rollback; + } + while (dbi_result_next_row(result)) { + sms = sms_from_result_v4(result); + if (db_sms_store(sms) != 0) { + LOGP(DDB, LOGL_ERROR, "Failed to store message to the new SMS table(upgrade from rev 4).\n"); + sms_free(sms); + dbi_result_free(result); + goto rollback; + } + sms_free(sms); + } + dbi_result_free(result); + + /* Remove the temporary table */ + result = dbi_conn_query(conn, "DROP TABLE SMS_4"); + if (!result) { + LOGP(DDB, LOGL_ERROR, + "Failed to drop the old SMS table (upgrade from rev 4).\n"); + goto rollback; + } + dbi_result_free(result); + + /* We're done. Bump DB Meta revision to 4 */ + result = dbi_conn_query(conn, + "UPDATE Meta " + "SET value = '5' " + "WHERE key = 'revision'"); + if (!result) { + LOGP(DDB, LOGL_ERROR, + "Failed to update DB schema revision (upgrade from rev 4).\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 4)\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 4).\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 4).\n"); + else + dbi_result_free(result); + return -EINVAL; +} + static int check_db_revision(void) { dbi_result result; @@ -412,6 +560,9 @@ goto error; case 3: if (update_db_revision_3()) + goto error; + case 4: + if (update_db_revision_4()) goto error; /* The end of waterfall */ @@ -1445,20 +1596,23 @@ result = dbi_conn_queryf(conn, "INSERT INTO SMS " "(created, valid_until, " - "reply_path_req, status_rep_req, protocol_id, " - "data_coding_scheme, ud_hdr_ind, " + "reply_path_req, status_rep_req, is_report, " + "msg_ref, protocol_id, data_coding_scheme, " + "ud_hdr_ind, " "user_data, text, " "dest_addr, dest_ton, dest_npi, " "src_addr, src_ton, src_npi) VALUES " "(datetime('now'), %u, " "%u, %u, %u, " - "%u, %u, " + "%u, %u, %u, " + "%u, " "%s, %s, " "%s, %u, %u, " "%s, %u, %u)", validity_timestamp, - sms->reply_path_req, sms->status_rep_req, sms->protocol_id, - sms->data_coding_scheme, sms->ud_hdr_ind, + sms->reply_path_req, sms->status_rep_req, sms->is_report, + sms->msg_ref, sms->protocol_id, sms->data_coding_scheme, + sms->ud_hdr_ind, q_udata, q_text, q_daddr, sms->dst.ton, sms->dst.npi, q_saddr, sms->src.ton, sms->src.npi); @@ -1489,6 +1643,8 @@ /* FIXME: those should all be get_uchar, but sqlite3 is braindead */ sms->reply_path_req = dbi_result_get_ulonglong(result, "reply_path_req"); sms->status_rep_req = dbi_result_get_ulonglong(result, "status_rep_req"); + sms->is_report = dbi_result_get_ulonglong(result, "is_report"); + sms->msg_ref = dbi_result_get_ulonglong(result, "msg_ref"); sms->ud_hdr_ind = dbi_result_get_ulonglong(result, "ud_hdr_ind"); sms->protocol_id = dbi_result_get_ulonglong(result, "protocol_id"); sms->data_coding_scheme = dbi_result_get_ulonglong(result, -- To view, visit https://gerrit.osmocom.org/3435 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I7276d356d805a83ebeec72b02c8563b7135ea0b6 Gerrit-PatchSet: 3 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Pablo Neira Ayuso Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Keith Whyte Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Wed Aug 9 11:09:42 2017 From: gerrit-no-reply at lists.osmocom.org (Pablo Neira Ayuso) Date: Wed, 9 Aug 2017 11:09:42 +0000 Subject: [PATCH] openbsc[master]: utils: smpp_mirror: bounce Delivery Receipts as Delivery Ack... In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3436 to look at the new patch set (#3). utils: smpp_mirror: bounce Delivery Receipts as Delivery Acknowledgments Simple patch to test the new status-report support code, remove previous code before Delivery Acknowledgement support was in place. Use LOGL_DEBUG for logging messages here as suggested by Neels and Harald. Change-Id: I877e228d8e174430f700631edbf9955972da7892 --- M openbsc/src/utils/smpp_mirror.c 1 file changed, 8 insertions(+), 9 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/36/3436/3 diff --git a/openbsc/src/utils/smpp_mirror.c b/openbsc/src/utils/smpp_mirror.c index 88545de..c570505 100644 --- a/openbsc/src/utils/smpp_mirror.c +++ b/openbsc/src/utils/smpp_mirror.c @@ -123,14 +123,6 @@ PACK_AND_SEND(esme, &deliver_r); - /* This is a delivery receipt, temporarily munch it until we teach - * openbsc what to do with this. - */ - if (deliver.esm_class == 0x04) { - LOGP(DSMPP, LOGL_NOTICE, "%s\n", deliver.short_message); - return 0; - } - memset(&submit, 0, sizeof(submit)); submit.command_id = SUBMIT_SM; submit.command_status = ESME_ROK; @@ -148,7 +140,14 @@ OSMO_MIN(sizeof(submit.source_addr), sizeof(deliver.destination_addr))); - submit.esm_class = deliver.esm_class; + /* Mirror delivery receipts as a delivery acknowledgements. */ + if (deliver.esm_class == 0x04) { + LOGP(DSMPP, LOGL_DEBUG, "%s\n", deliver.short_message); + submit.esm_class = 0x08; + } else { + submit.esm_class = deliver.esm_class; + } + submit.registered_delivery = deliver.registered_delivery; submit.protocol_id = deliver.protocol_id; submit.priority_flag = deliver.priority_flag; -- To view, visit https://gerrit.osmocom.org/3436 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I877e228d8e174430f700631edbf9955972da7892 Gerrit-PatchSet: 3 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Pablo Neira Ayuso Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Keith Whyte Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Wed Aug 9 11:09:42 2017 From: gerrit-no-reply at lists.osmocom.org (Pablo Neira Ayuso) Date: Wed, 9 Aug 2017 11:09:42 +0000 Subject: [PATCH] openbsc[master]: libmsc: handle delivery ack via SMPP SUBMIT SM / send GSM 03... In-Reply-To: References: Message-ID: Hello Neels Hofmeyr, Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3437 to look at the new patch set (#3). libmsc: handle delivery ack via SMPP SUBMIT SM / send GSM 03.40 status report This patch adds gsm340_sms_send_status_report_tpdu() to build a status-report. Moreover, set sms->report field if we see a SMPP SUBMIT_SM with Delivery Acknowledgment esm_class, so this identifies that this is a delivery report. MS GSM 03.40 SMSC SMPP 3.4 ESME | | | | | SUBMIT-SM | | | esm_class = Delivery Ack | | |<-------------------------------| | | SUBMIT-SM-RESP | | |------------------------------->| | | | | SMS-STATUS-REPORT | | |<----------------------------| | | GSM 04.11 RP-ACK | | |---------------------------->| | | | | There is a FIXME message in this patch, that I just copied from gsm340_gen_sms_deliver_tpdu() since TP-MMS is not supported by OpenBSC. Change-Id: Ib70e534840308ed315f7add440351e649de3f907 --- M openbsc/src/libmsc/gsm_04_11.c M openbsc/src/libmsc/smpp_openbsc.c 2 files changed, 54 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/37/3437/3 diff --git a/openbsc/src/libmsc/gsm_04_11.c b/openbsc/src/libmsc/gsm_04_11.c index 0edbe0b..80c3d77 100644 --- a/openbsc/src/libmsc/gsm_04_11.c +++ b/openbsc/src/libmsc/gsm_04_11.c @@ -277,6 +277,49 @@ return msg->len - old_msg_len; } +/* As defined by GSM 03.40, Section 9.2.2.3. */ +static int gsm340_gen_sms_status_report_tpdu(struct msgb *msg, + struct gsm_sms *sms) +{ + unsigned int old_msg_len = msg->len; + uint8_t oa_len = 0; + uint8_t oa[12]; /* max len per 03.40 */ + uint8_t *smsp; + + /* generate first octet with masked bits */ + smsp = msgb_put(msg, 1); + /* TP-MTI (message type indicator) */ + *smsp = GSM340_SMS_STATUS_REP_SC2MS; + /* TP-MMS (more messages to send) */ + if (0 /* FIXME */) + *smsp |= 0x04; + /* TP-MR (message reference) */ + smsp = msgb_put(msg, 1); + *smsp = sms->msg_ref; + /* generate recipient address */ + oa_len = gsm340_gen_oa_sub(oa, sizeof(oa), &sms->dst); + smsp = msgb_put(msg, oa_len); + memcpy(smsp, oa, oa_len); + + /* generate TP-SCTS (Service centre timestamp) */ + smsp = msgb_put(msg, 7); + gsm340_gen_scts(smsp, time(NULL)); + + /* generate TP-DT (Discharge time, in TP-SCTS format). */ + smsp = msgb_put(msg, 7); + gsm340_gen_scts(smsp, time(NULL)); + + /* TP-ST (status) */ + smsp = msgb_put(msg, 1); + /* 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); + + return msg->len - old_msg_len; +} + static int sms_route_mt_sms(struct gsm_subscriber_connection *conn, struct gsm_sms *gsms) { @@ -989,8 +1032,13 @@ /* obtain a pointer for the rp_ud_len, so we can fill it later */ rp_ud_len = (uint8_t *)msgb_put(msg, 1); - /* generate the 03.40 SMS-DELIVER TPDU */ - rc = gsm340_gen_sms_deliver_tpdu(msg, sms); + if (sms->is_report) { + /* generate the 03.40 SMS-STATUS-REPORT TPDU */ + rc = gsm340_gen_sms_status_report_tpdu(msg, sms); + } else { + /* generate the 03.40 SMS-DELIVER TPDU */ + rc = gsm340_gen_sms_deliver_tpdu(msg, sms); + } if (rc < 0) { send_signal(S_SMS_UNKNOWN_ERROR, trans, sms, 0); sms_free(sms); diff --git a/openbsc/src/libmsc/smpp_openbsc.c b/openbsc/src/libmsc/smpp_openbsc.c index c0aa89b..85de040 100644 --- a/openbsc/src/libmsc/smpp_openbsc.c +++ b/openbsc/src/libmsc/smpp_openbsc.c @@ -143,6 +143,10 @@ osmo_strlcpy(sms->src.addr, (char *)submit->source_addr, sizeof(sms->src.addr)); + /* This is a Delivery Acknowledgment. */ + if (submit->esm_class == 0x08) + sms->is_report = true; + if (submit->esm_class & 0x40) sms->ud_hdr_ind = 1; -- To view, visit https://gerrit.osmocom.org/3437 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ib70e534840308ed315f7add440351e649de3f907 Gerrit-PatchSet: 3 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Pablo Neira Ayuso Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Keith Whyte Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Wed Aug 9 11:09:42 2017 From: gerrit-no-reply at lists.osmocom.org (Pablo Neira Ayuso) Date: Wed, 9 Aug 2017 11:09:42 +0000 Subject: [PATCH] openbsc[master]: libmsc: support GSM 03.40 status report for nitb In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3438 to look at the new patch set (#3). libmsc: support GSM 03.40 status report for nitb This patch adds support for GSM 03.40 in nitb mode. MS GSM 03.40 SMSC | | | SMS-SUBMIT | |--------------------------->| | GSM 04.11 RP-ACK | |<---------------------------| | SMS-DELIVER | |<---------------------------| | GSM 04.11 RP-ACK | |--------------------------->| | SMS-STATUS-REPORT | |<---------------------------| | GSM 04.11 RP-ACK | |--------------------------->| | | Change-Id: I5cc7bb4ebadde0940f44d10c3df34707b0615160 --- M openbsc/src/libmsc/gsm_04_11.c 1 file changed, 5 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/38/3438/3 diff --git a/openbsc/src/libmsc/gsm_04_11.c b/openbsc/src/libmsc/gsm_04_11.c index 80c3d77..73e0f55 100644 --- a/openbsc/src/libmsc/gsm_04_11.c +++ b/openbsc/src/libmsc/gsm_04_11.c @@ -682,6 +682,11 @@ LOGP(DLSMS, LOGL_ERROR, "Failed to send status report! err=%d\n", rc); } + + /* No route via SMPP, send the GSM 03.40 status-report now. */ + if (gsms->receiver) + gsm340_rx_sms_submit(sms_report); + LOGP(DLSMS, LOGL_NOTICE, "Status report has been sent\n"); sms_free(sms_report); -- To view, visit https://gerrit.osmocom.org/3438 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I5cc7bb4ebadde0940f44d10c3df34707b0615160 Gerrit-PatchSet: 3 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Pablo Neira Ayuso Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Keith Whyte Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pablo Neira Ayuso From gerrit-no-reply at lists.osmocom.org Wed Aug 9 11:12:43 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 9 Aug 2017 11:12:43 +0000 Subject: [PATCH] openbsc[master]: Fix gsm_pchan2chan_nr() to use RSL_CHAN_OSMO_PDCH In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3399 to look at the new patch set (#2). Fix gsm_pchan2chan_nr() to use RSL_CHAN_OSMO_PDCH When converting from GSM_PCHAN_PDCH, we should generate a RSL channel number IE with the osmocom extension RSL_CHAN_OSMO_PDCH rather than claiming it is a regular TCH/F channel. This is important as this function is used by osmo-bts, too - and it decides which channel number IE is put in the GSMTAP header for both GSMTAP tracing as well as the GSMTAP based osmo-bts-virtual. In order to avoid any unintended effect on libbsc, we make sure to modify rsl_ipacc_pdch_activate() to always use GSM_PCHAN_TCH_F in related RSL message. Change-Id: Ie34219e64a6d89da4a79f2db8ec73d1909fb8280 --- M openbsc/src/libbsc/abis_rsl.c M openbsc/src/libcommon/gsm_data_shared.c 2 files changed, 5 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/99/3399/2 diff --git a/openbsc/src/libbsc/abis_rsl.c b/openbsc/src/libbsc/abis_rsl.c index f4fd6de..0ce2748 100644 --- a/openbsc/src/libbsc/abis_rsl.c +++ b/openbsc/src/libbsc/abis_rsl.c @@ -2439,7 +2439,7 @@ dh = (struct abis_rsl_dchan_hdr *) msgb_put(msg, sizeof(*dh)); init_dchan_hdr(dh, msg_type); dh->c.msg_discr = ABIS_RSL_MDISC_DED_CHAN; - dh->chan_nr = gsm_pchan2chan_nr(GSM_PCHAN_PDCH, ts->nr, 0); + dh->chan_nr = gsm_pchan2chan_nr(GSM_PCHAN_TCH_F, ts->nr, 0); DEBUGP(DRSL, "%s IPAC PDCH %sACT\n", gsm_ts_name(ts), act ? "" : "DE"); diff --git a/openbsc/src/libcommon/gsm_data_shared.c b/openbsc/src/libcommon/gsm_data_shared.c index 8992636..6302e05 100644 --- a/openbsc/src/libcommon/gsm_data_shared.c +++ b/openbsc/src/libcommon/gsm_data_shared.c @@ -643,11 +643,14 @@ switch (pchan) { case GSM_PCHAN_TCH_F: - case GSM_PCHAN_PDCH: case GSM_PCHAN_TCH_F_PDCH: OSMO_ASSERT(lchan_nr == 0); cbits = 0x01; break; + case GSM_PCHAN_PDCH: + OSMO_ASSERT(lchan_nr == 0); + cbits = RSL_CHAN_OSMO_PDCH >> 3; + break; case GSM_PCHAN_TCH_H: OSMO_ASSERT(lchan_nr < 2); cbits = 0x02; -- To view, visit https://gerrit.osmocom.org/3399 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ie34219e64a6d89da4a79f2db8ec73d1909fb8280 Gerrit-PatchSet: 2 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Aug 9 11:13:48 2017 From: gerrit-no-reply at lists.osmocom.org (Holger Freyther) Date: Wed, 9 Aug 2017 11:13:48 +0000 Subject: openbsc[master]: libmsc: update database to accomodate SMS status-report fields In-Reply-To: References: Message-ID: Patch Set 3: Have you considered using ALTER TABLE? Can it work here? -- To view, visit https://gerrit.osmocom.org/3435 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I7276d356d805a83ebeec72b02c8563b7135ea0b6 Gerrit-PatchSet: 3 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Pablo Neira Ayuso Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Keith Whyte Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Aug 9 11:13:59 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 9 Aug 2017 11:13:59 +0000 Subject: openbsc[master]: libmsc: report status report request flag from SMPP SUBMIT_SM In-Reply-To: References: Message-ID: Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3429 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Iac05252253f8933a3875b4904599b7a225191a4b Gerrit-PatchSet: 3 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Pablo Neira Ayuso Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Keith Whyte Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pablo Neira Ayuso Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Aug 9 11:15:08 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 9 Aug 2017 11:15:08 +0000 Subject: openbsc[master]: libmsc: add support for SMPP delivery receipts In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 (1 comment) https://gerrit.osmocom.org/#/c/3434/1/openbsc/src/libmsc/gsm_04_11.c File openbsc/src/libmsc/gsm_04_11.c: Line 637: rc = sms_route_mt_sms(conn, sms_report); > if mem is up, the program will likely not do *anything* useful anymore. Ins It is our general practise/consensus that we should not try to resolve memory allocation failures. There is some old code that does try to cope with it, and most probably in a bad way. So indeed, I think the best approach to deal with allocation failures is to terminate the program. WE don't allocate large amounts of memory anyway, and if our small allocations fail, the system is beyond hope. The difference to the kernel is that the NITB/MSC/... process will simply be restarted very quickly, without having an impact on other processes on the system. And if we have a leak, we should fix it, and users should complain with a meaningful error message (e.g. the assert). We could consider moving the ASSERT()s into the allocator, or have something like talloc macros that assert if they fail. But that's outside of the scope of this patch. -- To view, visit https://gerrit.osmocom.org/3434 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ic1a9023074bfa938099377980b6aff9b262fab2a Gerrit-PatchSet: 2 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Pablo Neira Ayuso Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Keith Whyte Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pablo Neira Ayuso Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Wed Aug 9 11:15:40 2017 From: gerrit-no-reply at lists.osmocom.org (Pablo Neira Ayuso) Date: Wed, 9 Aug 2017 11:15:40 +0000 Subject: openbsc[master]: libmsc: report status report request flag from SMPP SUBMIT_SM In-Reply-To: References: Message-ID: Patch Set 3: Verified+1 -- To view, visit https://gerrit.osmocom.org/3429 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Iac05252253f8933a3875b4904599b7a225191a4b Gerrit-PatchSet: 3 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Pablo Neira Ayuso Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Keith Whyte Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pablo Neira Ayuso Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Aug 9 11:15:55 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 9 Aug 2017 11:15:55 +0000 Subject: openbsc[master]: utils: smpp_mirror: bounce Delivery Receipts as Delivery Ack... In-Reply-To: References: Message-ID: Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3436 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I877e228d8e174430f700631edbf9955972da7892 Gerrit-PatchSet: 3 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Pablo Neira Ayuso Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Keith Whyte Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Aug 9 11:16:21 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 9 Aug 2017 11:16:21 +0000 Subject: openbsc[master]: libmsc: handle delivery ack via SMPP SUBMIT SM / send GSM 03... In-Reply-To: References: Message-ID: Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3437 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ib70e534840308ed315f7add440351e649de3f907 Gerrit-PatchSet: 3 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Pablo Neira Ayuso Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Keith Whyte Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Aug 9 11:17:09 2017 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Wed, 9 Aug 2017 11:17:09 +0000 Subject: osmo-bts[master]: TRX: Remove bogus extern global variable declarations In-Reply-To: References: Message-ID: Patch Set 4: Code-Review+1 Maxim has added the 'Related: OS#1848' label in the previous patch set. I think it makes sense to keep it. -- To view, visit https://gerrit.osmocom.org/3045 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I94b5f934fc3bd00b0467d90029d3053b16594186 Gerrit-PatchSet: 4 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Vadim Yanitskiy Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Aug 9 11:18:11 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 9 Aug 2017 11:18:11 +0000 Subject: openbsc[master]: SGSN: Fix RAN information exposed on GTP during PDP CTX CREATE In-Reply-To: References: Message-ID: Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3400 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I6c79e42c5e08b28fe8182555302a5505fbbaa313 Gerrit-PatchSet: 3 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Aug 9 11:18:49 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 9 Aug 2017 11:18:49 +0000 Subject: [PATCH] osmo-bts[master]: TRX: Remove bogus extern global variable declarations In-Reply-To: References: Message-ID: Hello Vadim Yanitskiy, Max, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3045 to look at the new patch set (#5). TRX: Remove bogus extern global variable declarations Those global variable declarations for non-existing variables were introduced in 8a8d73a691c709403be4adbe8f2a7150b4d5998a, let's remove them again. The source / destination IP address is a parameter of the phy_link, and not a global variable. Related: OS#1848 Change-Id: I94b5f934fc3bd00b0467d90029d3053b16594186 --- M src/osmo-bts-trx/trx_if.h 1 file changed, 0 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/45/3045/5 diff --git a/src/osmo-bts-trx/trx_if.h b/src/osmo-bts-trx/trx_if.h index 1fc454d..86fb18f 100644 --- a/src/osmo-bts-trx/trx_if.h +++ b/src/osmo-bts-trx/trx_if.h @@ -2,8 +2,6 @@ #define TRX_IF_H extern int transceiver_available; -extern const char *local_ip; -extern const char *remote_ip; extern int settsc_enabled; extern int setbsic_enabled; -- To view, visit https://gerrit.osmocom.org/3045 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I94b5f934fc3bd00b0467d90029d3053b16594186 Gerrit-PatchSet: 5 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Vadim Yanitskiy From gerrit-no-reply at lists.osmocom.org Wed Aug 9 11:19:01 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 9 Aug 2017 11:19:01 +0000 Subject: osmo-bts[master]: TRX: Remove bogus extern global variable declarations In-Reply-To: References: Message-ID: Patch Set 5: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3045 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I94b5f934fc3bd00b0467d90029d3053b16594186 Gerrit-PatchSet: 5 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Vadim Yanitskiy Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Aug 9 11:19:52 2017 From: gerrit-no-reply at lists.osmocom.org (Alexander Chemeris) Date: Wed, 9 Aug 2017 11:19:52 +0000 Subject: openbsc[master]: libcommon: Fix log output for bts>0. In-Reply-To: References: Message-ID: Patch Set 2: Hi Harald, thank you for a reminder. I'll try to find some time to extend the patch. -- To view, visit https://gerrit.osmocom.org/3185 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I61c18a7f021fcb1ec00d34a745f4e3ab03416c2d Gerrit-PatchSet: 2 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Alexander Chemeris Gerrit-Reviewer: Alexander Chemeris Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Aug 9 11:23:39 2017 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Wed, 9 Aug 2017 11:23:39 +0000 Subject: osmo-bts[master]: TRX: Remove bogus extern global variable declarations In-Reply-To: References: Message-ID: Patch Set 5: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/3045 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I94b5f934fc3bd00b0467d90029d3053b16594186 Gerrit-PatchSet: 5 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Vadim Yanitskiy Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Aug 9 11:24:44 2017 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Wed, 9 Aug 2017 11:24:44 +0000 Subject: osmo-bts[master]: TRX: Remove global variables, move SETBSIC/SETTSC handling i... In-Reply-To: References: Message-ID: Patch Set 4: Code-Review+1 (1 comment) https://gerrit.osmocom.org/#/c/3044/4//COMMIT_MSG Commit Message: PS4, Line 10: transceiver is a property What is a property? Do you mean "... transceiver, this is a property ..."? -- To view, visit https://gerrit.osmocom.org/3044 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I51aeb17661dfd63ff347f7b2c0d7ffa383ec814c Gerrit-PatchSet: 4 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Vadim Yanitskiy Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Wed Aug 9 11:32:58 2017 From: gerrit-no-reply at lists.osmocom.org (Keith Whyte) Date: Wed, 9 Aug 2017 11:32:58 +0000 Subject: openbsc[master]: libmsc: update database to accomodate SMS status-report fields In-Reply-To: References: Message-ID: Patch Set 3: > Can it work here? I don't believe so, SQLITE3 ALTER TABLE is limited to adding new columns to the end of the table. Probably why it's done like this in previous db version upgrades. https://www.sqlite.org/lang_altertable.html -- To view, visit https://gerrit.osmocom.org/3435 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I7276d356d805a83ebeec72b02c8563b7135ea0b6 Gerrit-PatchSet: 3 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Pablo Neira Ayuso Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Keith Whyte Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Aug 9 11:55:03 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 9 Aug 2017 11:55:03 +0000 Subject: [PATCH] libosmo-sccp[master]: ensure valid primary_pc in osmo_ss7_instance In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3355 to look at the new patch set (#4). ensure valid primary_pc in osmo_ss7_instance Initialize osmo_ss7_instance.cfg.primary_pc = OSMO_SS7_PC_INVALID. Adjust all code paths using primary_pc to ensure it is indeed valid. Rationale: It looks like we are going to use the primary point-code of an SS7 instance to derive a local SCCP address, e.g. for osmo-bsc and osmo-hnbgw. cs7-instance 1 point-code 1.2.3 ! sets osmo_ss7_instance.primary_pc = 1.2.3 sccp-address msc point-code 0.0.1 routing-indicator PC hnb iucs remote-addr msc ! derives cs7 instance 1 and local pc 1.2.3 If 'point-code 1.2.3' is omitted, this becomes '0.0.0' without the user noticing, and this happens for each client that omits it. I would like to barf when no local PC is set. Change-Id: I7f0f0c89b7335d9da24161bfac8234be214ca00c --- M src/osmo_ss7.c M src/osmo_ss7_vty.c M src/sccp_scoc.c M src/sccp_scrc.c M src/sccp_user.c 5 files changed, 19 insertions(+), 6 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-sccp refs/changes/55/3355/4 diff --git a/src/osmo_ss7.c b/src/osmo_ss7.c index 6db3f14..f82f952 100644 --- a/src/osmo_ss7.c +++ b/src/osmo_ss7.c @@ -354,6 +354,8 @@ if (!inst) return NULL; + inst->cfg.primary_pc = OSMO_SS7_PC_INVALID; + inst->cfg.id = id; LOGSS7(inst, LOGL_INFO, "Creating SS7 Instance\n"); @@ -1825,7 +1827,7 @@ bool osmo_ss7_pc_is_local(struct osmo_ss7_instance *inst, uint32_t pc) { OSMO_ASSERT(ss7_initialized); - if (pc == inst->cfg.primary_pc) + if (osmo_ss7_pc_is_valid(inst->cfg.primary_pc) && pc == inst->cfg.primary_pc) return true; /* FIXME: Secondary and Capability Point Codes */ return false; diff --git a/src/osmo_ss7_vty.c b/src/osmo_ss7_vty.c index 476aedf..164b7f2 100644 --- a/src/osmo_ss7_vty.c +++ b/src/osmo_ss7_vty.c @@ -166,7 +166,7 @@ { struct osmo_ss7_instance *inst = vty->index; int pc = osmo_ss7_pointcode_parse(inst, argv[0]); - if (pc < 0) { + if (pc < 0 || !osmo_ss7_pc_is_valid((uint32_t)pc)) { vty_out(vty, "Invalid point code (%s)%s", argv[0], VTY_NEWLINE); return CMD_WARNING; } @@ -1536,7 +1536,7 @@ if (inst->cfg.pc_fmt.delimiter != '.') vty_out(vty, " point-code delimiter dash%s", VTY_NEWLINE); - if (inst->cfg.primary_pc) + if (osmo_ss7_pc_is_valid(inst->cfg.primary_pc)) vty_out(vty, " point-code %s%s", osmo_ss7_pointcode_print(inst, inst->cfg.primary_pc), VTY_NEWLINE); diff --git a/src/sccp_scoc.c b/src/sccp_scoc.c index 3d43448..9820c40 100644 --- a/src/sccp_scoc.c +++ b/src/sccp_scoc.c @@ -1670,11 +1670,11 @@ { struct osmo_ss7_instance *s7i = conn->inst->ss7; struct osmo_sccp_addr *remote_addr; - uint32_t local_pc; + uint32_t local_pc = OSMO_SS7_PC_INVALID; if (conn->user->pc_valid) local_pc = conn->user->pc; - else + else if (osmo_ss7_pc_is_valid(s7i->cfg.primary_pc)) local_pc = s7i->cfg.primary_pc; if (conn->incoming) diff --git a/src/sccp_scrc.c b/src/sccp_scrc.c index e44201a..2afd696 100644 --- a/src/sccp_scrc.c +++ b/src/sccp_scrc.c @@ -91,8 +91,14 @@ param = &omp->u.transfer; if (sua->mtp.opc) param->opc = sua->mtp.opc; - else + else { + if (!osmo_ss7_pc_is_valid(s7i->cfg.primary_pc)) { + LOGP(DLSCCP, LOGL_ERROR, "SS7 instance %u: no primary point-code set\n", + s7i->cfg.id); + return -1; + } param->opc = s7i->cfg.primary_pc; + } param->dpc = remote_pc; param->sls = sua->mtp.sls; param->sio = MTP_SIO(MTP_SI_SCCP, s7i->cfg.network_indicator); diff --git a/src/sccp_user.c b/src/sccp_user.c index 71b3262..d49da29 100644 --- a/src/sccp_user.c +++ b/src/sccp_user.c @@ -366,6 +366,11 @@ goto out_ss7; as_created = true; + if (!osmo_ss7_pc_is_valid(ss7->cfg.primary_pc)) { + LOGP(DLSCCP, LOGL_ERROR, "SS7 instance %u: no primary point-code set\n", + ss7->cfg.id); + goto out_ss7; + } as->cfg.routing_key.pc = ss7->cfg.primary_pc; /* install default route */ -- To view, visit https://gerrit.osmocom.org/3355 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I7f0f0c89b7335d9da24161bfac8234be214ca00c Gerrit-PatchSet: 4 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Aug 9 11:55:04 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 9 Aug 2017 11:55:04 +0000 Subject: [PATCH] libosmo-sccp[master]: add OSMO_SS7_PC_INVALID, add osmo_ss7_pc_is_valid() Message-ID: Review at https://gerrit.osmocom.org/3450 add OSMO_SS7_PC_INVALID, add osmo_ss7_pc_is_valid() Introduce OSMO_SS7_PC_INVALID to mark an unset point code. Add static osmo_ss7_pc_is_valid() (name matches schema of osmo_ss7_pc_is_local()). In osmo_ss7_pointcode_print(), return "(no PC)" if !osmo_ss7_pc_is_valid(), for convenient printing of any PC state. Subsequent patches will use this for osmo_ss7_instance (I7f0f0c89b7335d9da24161bfac8234be214ca00c) as well as osmo_sccp_user (I8684c9b559712072c772012890bbf7efa7c8eb35). Rationale: Currently, in osmo_ss7_vty.c we had "if (inst->cfg.primary_pc)" suggesting 0 is invalid, but in struct osmo_sccp_user we have flag pc_valid suggesting 0 is indeed valid. All known point code formats are <= 24bit, so we can easily use 0xffffffff as indicator for an unset PC, which removes the need to remember to set a second field for validity and keeps the structs nice and lean. Change-Id: Ib5715bf03a4de7713a7a809dfd821c700255ba8c --- M include/osmocom/sigtran/osmo_ss7.h M src/osmo_ss7.c 2 files changed, 17 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-sccp refs/changes/50/3450/1 diff --git a/include/osmocom/sigtran/osmo_ss7.h b/include/osmocom/sigtran/osmo_ss7.h index bbe425c..967912a 100644 --- a/include/osmocom/sigtran/osmo_ss7.h +++ b/include/osmocom/sigtran/osmo_ss7.h @@ -26,6 +26,14 @@ const char *osmo_ss7_pointcode_print(struct osmo_ss7_instance *inst, uint32_t pc); const char *osmo_ss7_pointcode_print2(struct osmo_ss7_instance *inst, uint32_t pc); +/* All known point-code formats have a length of or below 24 bit. + * A point-code value exceeding that is used to indicate an unset PC. */ +#define OSMO_SS7_PC_INVALID 0xffffffff +static inline bool osmo_ss7_pc_is_valid(uint32_t pc) +{ + return pc <= 0x00ffffff; +} + /*********************************************************************** * SS7 Routing Tables ***********************************************************************/ diff --git a/src/osmo_ss7.c b/src/osmo_ss7.c index eb5a4ef..6db3f14 100644 --- a/src/osmo_ss7.c +++ b/src/osmo_ss7.c @@ -247,10 +247,16 @@ const char *_osmo_ss7_pointcode_print(char *buf, size_t len, struct osmo_ss7_instance *inst, uint32_t pc) { - const struct osmo_ss7_pc_fmt *pc_fmt = inst ? &inst->cfg.pc_fmt : &default_pc_fmt; - unsigned int num_comp_exp = num_pc_comp_exp(pc_fmt); - const char *fmtstr = gen_pc_fmtstr(pc_fmt, &num_comp_exp); + const struct osmo_ss7_pc_fmt *pc_fmt; + unsigned int num_comp_exp; + const char *fmtstr; + if (!osmo_ss7_pc_is_valid(pc)) + return "(no PC)"; + + pc_fmt = inst ? &inst->cfg.pc_fmt : &default_pc_fmt; + num_comp_exp = num_pc_comp_exp(pc_fmt); + fmtstr = gen_pc_fmtstr(pc_fmt, &num_comp_exp); OSMO_ASSERT(fmtstr); snprintf(buf, len, fmtstr, pc_comp_shift_and_mask(pc_fmt, 0, pc), -- To view, visit https://gerrit.osmocom.org/3450 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ib5715bf03a4de7713a7a809dfd821c700255ba8c Gerrit-PatchSet: 1 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Wed Aug 9 11:55:04 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 9 Aug 2017 11:55:04 +0000 Subject: [PATCH] libosmo-sccp[master]: consistency: use OSMO_SS7_PC_INVALID for osmo_sccp_user Message-ID: Review at https://gerrit.osmocom.org/3451 consistency: use OSMO_SS7_PC_INVALID for osmo_sccp_user A previous patch added ss7_instance primary_pc validity checks by means of OSMO_SS7_PC_INVALID. To be consistent, also adjust sccp_user accordingly. (see I7f0f0c89b7335d9da24161bfac8234be214ca00c) Remove the osmo_sccp_user's pc_valid field, replaced by pc=OSMO_SS7_PC_INVALID. Adjust all code paths. Simplify some log printing, using the fact that osmo_ss7_pointcode_print() now outputs "(no PC)" for unset point codes. Change-Id: I8684c9b559712072c772012890bbf7efa7c8eb35 --- M src/sccp_internal.h M src/sccp_scoc.c M src/sccp_user.c M src/sccp_vty.c 4 files changed, 16 insertions(+), 21 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-sccp refs/changes/51/3451/1 diff --git a/src/sccp_internal.h b/src/sccp_internal.h index 17dda13..66d768d 100644 --- a/src/sccp_internal.h +++ b/src/sccp_internal.h @@ -34,7 +34,6 @@ /*! \brief SSN and/or point code to which we are bound */ uint16_t ssn; uint32_t pc; - bool pc_valid; /* set if we are a server */ struct llist_head links; diff --git a/src/sccp_scoc.c b/src/sccp_scoc.c index 9820c40..74fb0e7 100644 --- a/src/sccp_scoc.c +++ b/src/sccp_scoc.c @@ -1672,7 +1672,7 @@ struct osmo_sccp_addr *remote_addr; uint32_t local_pc = OSMO_SS7_PC_INVALID; - if (conn->user->pc_valid) + if (osmo_ss7_pc_is_valid(conn->user->pc)) local_pc = conn->user->pc; else if (osmo_ss7_pc_is_valid(s7i->cfg.primary_pc)) local_pc = s7i->cfg.primary_pc; diff --git a/src/sccp_user.c b/src/sccp_user.c index d49da29..1414572 100644 --- a/src/sccp_user.c +++ b/src/sccp_user.c @@ -48,13 +48,13 @@ /* First try to find match for PC + SSN */ llist_for_each_entry(scu, &inst->users, list) { - if (scu->pc_valid && scu->pc == pc && scu->ssn == ssn) + if (osmo_ss7_pc_is_valid(scu->pc) && scu->pc == pc && scu->ssn == ssn) return scu; } /* Then try to match on SSN only */ llist_for_each_entry(scu, &inst->users, list) { - if (!scu->pc_valid && scu->ssn == ssn) + if (!osmo_ss7_pc_is_valid(scu->pc) && scu->ssn == ssn) return scu; } @@ -65,28 +65,25 @@ * \param[in] inst SCCP Instance * \param[in] name human-readable name * \param[in] ssn Sub-System Number to bind to - * \param[in] pc Point Code to bind to (if any) - * \param[in] pc_valid Whether or not \ref pc is valid/used + * \param[in] pc Point Code to bind to, or OSMO_SS7_PC_INVALID if none. * \returns Callee-allocated SCCP User on success; negative otherwise */ static struct osmo_sccp_user * sccp_user_bind_pc(struct osmo_sccp_instance *inst, const char *name, - osmo_prim_cb prim_cb, uint16_t ssn, uint32_t pc, bool pc_valid) + osmo_prim_cb prim_cb, uint16_t ssn, uint32_t pc) { struct osmo_sccp_user *scu; - if (!pc_valid) - pc = 0; scu = sccp_user_find(inst, ssn, pc); if (scu) { LOGP(DLSCCP, LOGL_ERROR, - "Cannot bind user '%s' to SSN=%u PC=%u=%s (pc_valid=%u), this SSN and PC" + "Cannot bind user '%s' to SSN=%u PC=%s, this SSN and PC" " is already bound by '%s'\n", - name, ssn, pc, osmo_ss7_pointcode_print(inst->ss7, pc), pc_valid, scu->name); + name, ssn, osmo_ss7_pointcode_print(inst->ss7, pc), scu->name); return NULL; } - LOGP(DLSCCP, LOGL_INFO, "Binding user '%s' to SSN=%u PC=%u=%s (pc_valid=%u)\n", - name, ssn, pc, osmo_ss7_pointcode_print(inst->ss7, pc), pc_valid); + LOGP(DLSCCP, LOGL_INFO, "Binding user '%s' to SSN=%u PC=%s\n", + name, ssn, osmo_ss7_pointcode_print(inst->ss7, pc)); scu = talloc_zero(inst, struct osmo_sccp_user); scu->name = talloc_strdup(scu, name); @@ -94,7 +91,6 @@ scu->prim_cb = prim_cb; scu->ssn = ssn; scu->pc = pc; - scu->pc_valid = pc_valid; llist_add_tail(&scu->list, &inst->users); return scu; @@ -104,13 +100,13 @@ * \param[in] inst SCCP Instance * \param[in] name human-readable name * \param[in] ssn Sub-System Number to bind to - * \param[in] pc Point Code to bind to (if any) + * \param[in] pc Point Code to bind to * \returns Callee-allocated SCCP User on success; negative otherwise */ struct osmo_sccp_user * osmo_sccp_user_bind_pc(struct osmo_sccp_instance *inst, const char *name, osmo_prim_cb prim_cb, uint16_t ssn, uint32_t pc) { - return sccp_user_bind_pc(inst, name, prim_cb, ssn, pc, true); + return sccp_user_bind_pc(inst, name, prim_cb, ssn, pc); } /*! \brief Bind a given SCCP User to a given SSN (at any PC) @@ -122,7 +118,7 @@ osmo_sccp_user_bind(struct osmo_sccp_instance *inst, const char *name, osmo_prim_cb prim_cb, uint16_t ssn) { - return sccp_user_bind_pc(inst, name, prim_cb, ssn, 0, false); + return sccp_user_bind_pc(inst, name, prim_cb, ssn, OSMO_SS7_PC_INVALID); } /*! \brief Unbind a given SCCP user @@ -130,9 +126,9 @@ * at the time this function returns. */ void osmo_sccp_user_unbind(struct osmo_sccp_user *scu) { - LOGP(DLSCCP, LOGL_INFO, "Unbinding user '%s' from SSN=%u PC=%u " - "(pc_valid=%u)\n", scu->name, scu->ssn, scu->pc, - scu->pc_valid); + LOGP(DLSCCP, LOGL_INFO, "Unbinding user '%s' from SSN=%u PC=%s\n", + scu->name, scu->ssn, + osmo_ss7_pointcode_print(scu->inst->ss7, scu->pc)); /* FIXME: free/release all connections held by this user? */ llist_del(&scu->list); talloc_free(scu); diff --git a/src/sccp_vty.c b/src/sccp_vty.c index 626fefb..7f0a0de 100644 --- a/src/sccp_vty.c +++ b/src/sccp_vty.c @@ -42,7 +42,7 @@ { struct osmo_sccp_instance *sccp = user->inst; - if (user->pc_valid) + if (osmo_ss7_pc_is_valid(user->pc)) vty_out(vty, "SSN %3u %7s : %s%s", user->ssn, osmo_ss7_pointcode_print(sccp->ss7, user->pc), user->name, VTY_NEWLINE); -- To view, visit https://gerrit.osmocom.org/3451 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I8684c9b559712072c772012890bbf7efa7c8eb35 Gerrit-PatchSet: 1 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Wed Aug 9 11:56:45 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 9 Aug 2017 11:56:45 +0000 Subject: libosmo-sccp[master]: ensure valid primary_pc in osmo_ss7_instance In-Reply-To: References: Message-ID: Patch Set 4: Now using 0xffffffff to mark invalid PC, this commit spread out into three: adding the invalid value, ensuring set primary_pc, and then adjusting osmo_sccp_user to use the same invalidity marking. -- To view, visit https://gerrit.osmocom.org/3355 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I7f0f0c89b7335d9da24161bfac8234be214ca00c Gerrit-PatchSet: 4 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Aug 9 12:04:24 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 9 Aug 2017 12:04:24 +0000 Subject: libasn1c[master]: add /debian to build a package In-Reply-To: References: Message-ID: Patch Set 1: Code-Review-1 lynxis, let's enhance the copyright notice as in above comments -- To view, visit https://gerrit.osmocom.org/3440 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I135d975b84027d51cb1dc534e04dd314bbd20289 Gerrit-PatchSet: 1 Gerrit-Project: libasn1c Gerrit-Branch: master Gerrit-Owner: lynxis lazus Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Aug 9 12:22:46 2017 From: gerrit-no-reply at lists.osmocom.org (Pablo Neira Ayuso) Date: Wed, 9 Aug 2017 12:22:46 +0000 Subject: [PATCH] openbsc[master]: libmsc: update database to accomodate SMS status-report fields In-Reply-To: References: Message-ID: Hello Neels Hofmeyr, Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3435 to look at the new patch set (#4). libmsc: update database to accomodate SMS status-report fields SMPP DELIVER_SM messages with esm_class = Delivery Receipt need to send this message reference (that the mobile phone allocates) to the ESME. Thus, the ESME propagates it via SUBMIT_SM with esm_class = Delivery Acknoledgment so that the SMSC sends the GSM 03.40 status-report to the origin including this. Given this field is useful for status-reports, we need to store it in the HLR database. Moreover, we need a new field that specifies if the entry represents a SMS status-report, to do the right handling from the gsm411_send_sms() - such new handling comes in a follow up patch entitled "libmsc: handle delivery ack via SMPP SUBMIT SM / send GSM 03.40 status report". This patch includes the migration routines to the new database schema revision 5, it's quite a bit of dbi boilerplate code - copied-pasted and adapted. Change-Id: I7276d356d805a83ebeec72b02c8563b7135ea0b6 --- M openbsc/src/libmsc/db.c M openbsc/tests/db/db_test.err 2 files changed, 163 insertions(+), 6 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/35/3435/4 diff --git a/openbsc/src/libmsc/db.c b/openbsc/src/libmsc/db.c index 5fe2a3c..9945dca 100644 --- a/openbsc/src/libmsc/db.c +++ b/openbsc/src/libmsc/db.c @@ -50,7 +50,7 @@ static char *db_dirname = NULL; static dbi_conn conn; -#define SCHEMA_REVISION "4" +#define SCHEMA_REVISION "5" enum { SCHEMA_META, @@ -124,6 +124,8 @@ "valid_until TIMESTAMP, " "reply_path_req INTEGER NOT NULL, " "status_rep_req INTEGER NOT NULL, " + "is_report INTEGER NOT NULL, " + "msg_ref INTEGER NOT NULL, " "protocol_id INTEGER NOT NULL, " "data_coding_scheme INTEGER NOT NULL, " "ud_hdr_ind INTEGER NOT NULL, " @@ -370,6 +372,152 @@ return -EINVAL; } +/* Just like v3, but there is a new message reference field for status reports, + * that is set to zero for existing entries since there is no way we can infer + * this. + */ +static struct gsm_sms *sms_from_result_v4(dbi_result result) +{ + struct gsm_sms *sms = sms_alloc(); + const unsigned char *user_data; + const char *text, *addr; + + if (!sms) + return NULL; + + sms->id = dbi_result_get_ulonglong(result, "id"); + + sms->reply_path_req = dbi_result_get_ulonglong(result, "reply_path_req"); + sms->status_rep_req = dbi_result_get_ulonglong(result, "status_rep_req"); + sms->ud_hdr_ind = dbi_result_get_ulonglong(result, "ud_hdr_ind"); + sms->protocol_id = dbi_result_get_ulonglong(result, "protocol_id"); + sms->data_coding_scheme = dbi_result_get_ulonglong(result, + "data_coding_scheme"); + + addr = dbi_result_get_string(result, "src_addr"); + osmo_strlcpy(sms->src.addr, addr, sizeof(sms->src.addr)); + sms->src.ton = dbi_result_get_ulonglong(result, "src_ton"); + sms->src.npi = dbi_result_get_ulonglong(result, "src_npi"); + + addr = dbi_result_get_string(result, "dest_addr"); + osmo_strlcpy(sms->dst.addr, addr, sizeof(sms->dst.addr)); + sms->dst.ton = dbi_result_get_ulonglong(result, "dest_ton"); + sms->dst.npi = dbi_result_get_ulonglong(result, "dest_npi"); + + sms->user_data_len = dbi_result_get_field_length(result, "user_data"); + user_data = dbi_result_get_binary(result, "user_data"); + if (sms->user_data_len > sizeof(sms->user_data)) + sms->user_data_len = (uint8_t) sizeof(sms->user_data); + memcpy(sms->user_data, user_data, sms->user_data_len); + + text = dbi_result_get_string(result, "text"); + if (text) + osmo_strlcpy(sms->text, text, sizeof(sms->text)); + return sms; +} + +static int update_db_revision_4(void) +{ + dbi_result result; + struct gsm_sms *sms; + + LOGP(DDB, LOGL_NOTICE, "Going to migrate from revision 4\n"); + + result = dbi_conn_query(conn, "BEGIN EXCLUSIVE TRANSACTION"); + if (!result) { + LOGP(DDB, LOGL_ERROR, + "Failed to begin transaction (upgrade from rev 4)\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_4"); + if (!result) { + LOGP(DDB, LOGL_ERROR, + "Failed to rename the old SMS table (upgrade from rev 4).\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 4).\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_4"); + if (!result) { + LOGP(DDB, LOGL_ERROR, + "Failed fetch messages from the old SMS table (upgrade from rev 4).\n"); + goto rollback; + } + while (dbi_result_next_row(result)) { + sms = sms_from_result_v4(result); + if (db_sms_store(sms) != 0) { + LOGP(DDB, LOGL_ERROR, "Failed to store message to the new SMS table(upgrade from rev 4).\n"); + sms_free(sms); + dbi_result_free(result); + goto rollback; + } + sms_free(sms); + } + dbi_result_free(result); + + /* Remove the temporary table */ + result = dbi_conn_query(conn, "DROP TABLE SMS_4"); + if (!result) { + LOGP(DDB, LOGL_ERROR, + "Failed to drop the old SMS table (upgrade from rev 4).\n"); + goto rollback; + } + dbi_result_free(result); + + /* We're done. Bump DB Meta revision to 4 */ + result = dbi_conn_query(conn, + "UPDATE Meta " + "SET value = '5' " + "WHERE key = 'revision'"); + if (!result) { + LOGP(DDB, LOGL_ERROR, + "Failed to update DB schema revision (upgrade from rev 4).\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 4)\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 4).\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 4).\n"); + else + dbi_result_free(result); + return -EINVAL; +} + static int check_db_revision(void) { dbi_result result; @@ -412,6 +560,9 @@ goto error; case 3: if (update_db_revision_3()) + goto error; + case 4: + if (update_db_revision_4()) goto error; /* The end of waterfall */ @@ -1445,20 +1596,23 @@ result = dbi_conn_queryf(conn, "INSERT INTO SMS " "(created, valid_until, " - "reply_path_req, status_rep_req, protocol_id, " - "data_coding_scheme, ud_hdr_ind, " + "reply_path_req, status_rep_req, is_report, " + "msg_ref, protocol_id, data_coding_scheme, " + "ud_hdr_ind, " "user_data, text, " "dest_addr, dest_ton, dest_npi, " "src_addr, src_ton, src_npi) VALUES " "(datetime('now'), %u, " "%u, %u, %u, " - "%u, %u, " + "%u, %u, %u, " + "%u, " "%s, %s, " "%s, %u, %u, " "%s, %u, %u)", validity_timestamp, - sms->reply_path_req, sms->status_rep_req, sms->protocol_id, - sms->data_coding_scheme, sms->ud_hdr_ind, + sms->reply_path_req, sms->status_rep_req, sms->is_report, + sms->msg_ref, sms->protocol_id, sms->data_coding_scheme, + sms->ud_hdr_ind, q_udata, q_text, q_daddr, sms->dst.ton, sms->dst.npi, q_saddr, sms->src.ton, sms->src.npi); @@ -1489,6 +1643,8 @@ /* FIXME: those should all be get_uchar, but sqlite3 is braindead */ sms->reply_path_req = dbi_result_get_ulonglong(result, "reply_path_req"); sms->status_rep_req = dbi_result_get_ulonglong(result, "status_rep_req"); + sms->is_report = dbi_result_get_ulonglong(result, "is_report"); + sms->msg_ref = dbi_result_get_ulonglong(result, "msg_ref"); sms->ud_hdr_ind = dbi_result_get_ulonglong(result, "ud_hdr_ind"); sms->protocol_id = dbi_result_get_ulonglong(result, "protocol_id"); sms->data_coding_scheme = dbi_result_get_ulonglong(result, diff --git a/openbsc/tests/db/db_test.err b/openbsc/tests/db/db_test.err index fa9a54c..27e5703 100644 --- a/openbsc/tests/db/db_test.err +++ b/openbsc/tests/db/db_test.err @@ -1,2 +1,3 @@ Going to migrate from revision 3 +Going to migrate from revision 4  \ No newline at end of file -- To view, visit https://gerrit.osmocom.org/3435 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I7276d356d805a83ebeec72b02c8563b7135ea0b6 Gerrit-PatchSet: 4 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Pablo Neira Ayuso Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Keith Whyte Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Wed Aug 9 12:55:15 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 9 Aug 2017 12:55:15 +0000 Subject: openbsc[master]: libmsc: set registered_delivery field in SMPP 3.4 DELIVER_SM... In-Reply-To: References: Message-ID: Patch Set 2: Verified+1 -- To view, visit https://gerrit.osmocom.org/3428 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I59af60fa89cd10ae973c5e122789e3e03e3728ee Gerrit-PatchSet: 2 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Pablo Neira Ayuso Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Keith Whyte Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pablo Neira Ayuso Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Aug 9 12:55:44 2017 From: gerrit-no-reply at lists.osmocom.org (Pablo Neira Ayuso) Date: Wed, 9 Aug 2017 12:55:44 +0000 Subject: [MERGED] openbsc[master]: libmsc: set registered_delivery field in SMPP 3.4 DELIVER_SM... In-Reply-To: References: Message-ID: Pablo Neira Ayuso has submitted this change and it was merged. Change subject: libmsc: set registered_delivery field in SMPP 3.4 DELIVER_SM messages ...................................................................... libmsc: set registered_delivery field in SMPP 3.4 DELIVER_SM messages Propagate the status report request field to the SMPP message through the registered_delivery field, so the ESME knows that the mobile phone is asking for explicit delivery acknowledgment is required. See SMPP 3.4 specs section 5.2.17. Change-Id: I59af60fa89cd10ae973c5e122789e3e03e3728ee --- M openbsc/src/libmsc/smpp_openbsc.c 1 file changed, 8 insertions(+), 1 deletion(-) Approvals: Neels Hofmeyr: Looks good to me, but someone else must approve Harald Welte: Looks good to me, approved; Verified diff --git a/openbsc/src/libmsc/smpp_openbsc.c b/openbsc/src/libmsc/smpp_openbsc.c index 6b89df2..cf78676 100644 --- a/openbsc/src/libmsc/smpp_openbsc.c +++ b/openbsc/src/libmsc/smpp_openbsc.c @@ -602,6 +602,10 @@ return NULL; } +/* See SMPP 3.4, Section 5.2.17. registered_delivery (1 byte field). */ +#define SMPP34_NO_DELIVERY_RECEIPT 0x0 +#define SMPP34_DELIVERY_RECEIPT_REQ 0x1 + static int deliver_to_esme(struct osmo_esme *esme, struct gsm_sms *sms, struct gsm_subscriber_connection *conn) { @@ -642,7 +646,10 @@ deliver.protocol_id = sms->protocol_id; deliver.priority_flag = 0; - deliver.registered_delivery = 0; + if (sms->status_rep_req) + deliver.registered_delivery = SMPP34_DELIVERY_RECEIPT_REQ; + else + deliver.registered_delivery = SMPP34_NO_DELIVERY_RECEIPT; /* Figure out SMPP DCS from TP-DCS */ dcs = sms->data_coding_scheme; -- To view, visit https://gerrit.osmocom.org/3428 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I59af60fa89cd10ae973c5e122789e3e03e3728ee Gerrit-PatchSet: 2 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Pablo Neira Ayuso Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Keith Whyte Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pablo Neira Ayuso Gerrit-Reviewer: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Wed Aug 9 12:55:50 2017 From: gerrit-no-reply at lists.osmocom.org (Pablo Neira Ayuso) Date: Wed, 9 Aug 2017 12:55:50 +0000 Subject: [MERGED] openbsc[master]: libmsc: report status report request flag from SMPP SUBMIT_SM In-Reply-To: References: Message-ID: Pablo Neira Ayuso has submitted this change and it was merged. Change subject: libmsc: report status report request flag from SMPP SUBMIT_SM ...................................................................... libmsc: report status report request flag from SMPP SUBMIT_SM Restore the sms status report request flag from SUBMIT_SM. Change-Id: Iac05252253f8933a3875b4904599b7a225191a4b --- M openbsc/src/libmsc/smpp_openbsc.c 1 file changed, 1 insertion(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified Pablo Neira Ayuso: Verified diff --git a/openbsc/src/libmsc/smpp_openbsc.c b/openbsc/src/libmsc/smpp_openbsc.c index cf78676..a803763 100644 --- a/openbsc/src/libmsc/smpp_openbsc.c +++ b/openbsc/src/libmsc/smpp_openbsc.c @@ -129,6 +129,7 @@ sms = sms_alloc(); sms->source = SMS_SOURCE_SMPP; sms->smpp.sequence_nr = submit->sequence_number; + sms->status_rep_req = submit->registered_delivery; /* fill in the destination address */ sms->receiver = dest; -- To view, visit https://gerrit.osmocom.org/3429 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Iac05252253f8933a3875b4904599b7a225191a4b Gerrit-PatchSet: 3 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Pablo Neira Ayuso Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Keith Whyte Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pablo Neira Ayuso From gerrit-no-reply at lists.osmocom.org Wed Aug 9 12:55:54 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 9 Aug 2017 12:55:54 +0000 Subject: openbsc[master]: libmsc: update database to accomodate SMS status-report fields In-Reply-To: References: Message-ID: Patch Set 4: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3435 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I7276d356d805a83ebeec72b02c8563b7135ea0b6 Gerrit-PatchSet: 4 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Pablo Neira Ayuso Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Keith Whyte Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Aug 9 12:56:13 2017 From: gerrit-no-reply at lists.osmocom.org (Pablo Neira Ayuso) Date: Wed, 9 Aug 2017 12:56:13 +0000 Subject: [MERGED] openbsc[master]: libmsc: missing bit shift in status report flag when stored ... In-Reply-To: References: Message-ID: Pablo Neira Ayuso has submitted this change and it was merged. Change subject: libmsc: missing bit shift in status report flag when stored in sms object ...................................................................... libmsc: missing bit shift in status report flag when stored in sms object So we just store 0 or 1 depending on what the mobile phone requests. Change-Id: Idb7d5594219c0e458ccb561383a59604bc1a4201 --- M openbsc/src/libmsc/gsm_04_11.c 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/openbsc/src/libmsc/gsm_04_11.c b/openbsc/src/libmsc/gsm_04_11.c index 7294153..1aed60e 100644 --- a/openbsc/src/libmsc/gsm_04_11.c +++ b/openbsc/src/libmsc/gsm_04_11.c @@ -366,7 +366,7 @@ /* invert those fields where 0 means active/present */ sms_mti = *smsp & 0x03; sms_vpf = (*smsp & 0x18) >> 3; - gsms->status_rep_req = (*smsp & 0x20); + gsms->status_rep_req = (*smsp & 0x20) >> 5; gsms->ud_hdr_ind = (*smsp & 0x40); /* * Not evaluating MMS (More Messages to Send) because the -- To view, visit https://gerrit.osmocom.org/3430 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Idb7d5594219c0e458ccb561383a59604bc1a4201 Gerrit-PatchSet: 2 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Pablo Neira Ayuso Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Keith Whyte Gerrit-Reviewer: Pablo Neira Ayuso From gerrit-no-reply at lists.osmocom.org Wed Aug 9 12:56:24 2017 From: gerrit-no-reply at lists.osmocom.org (Pablo Neira Ayuso) Date: Wed, 9 Aug 2017 12:56:24 +0000 Subject: [MERGED] openbsc[master]: utils: smpp_mirror: set registered_delivery field in SMPP SU... In-Reply-To: References: Message-ID: Pablo Neira Ayuso has submitted this change and it was merged. Change subject: utils: smpp_mirror: set registered_delivery field in SMPP SUBMIT_SM ...................................................................... utils: smpp_mirror: set registered_delivery field in SMPP SUBMIT_SM To test delivery reports using this utility. Change-Id: I0e477407531fdd4d906e53c9b5a48a79a239966f --- M openbsc/src/utils/smpp_mirror.c 1 file changed, 1 insertion(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/openbsc/src/utils/smpp_mirror.c b/openbsc/src/utils/smpp_mirror.c index 95df5f2..ec28f0a 100644 --- a/openbsc/src/utils/smpp_mirror.c +++ b/openbsc/src/utils/smpp_mirror.c @@ -130,6 +130,7 @@ sizeof(deliver.destination_addr))); submit.esm_class = deliver.esm_class; + submit.registered_delivery = deliver.registered_delivery; submit.protocol_id = deliver.protocol_id; submit.priority_flag = deliver.priority_flag; memcpy(submit.schedule_delivery_time, deliver.schedule_delivery_time, -- To view, visit https://gerrit.osmocom.org/3431 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I0e477407531fdd4d906e53c9b5a48a79a239966f Gerrit-PatchSet: 2 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Pablo Neira Ayuso Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Keith Whyte Gerrit-Reviewer: Pablo Neira Ayuso From gerrit-no-reply at lists.osmocom.org Wed Aug 9 12:56:26 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 9 Aug 2017 12:56:26 +0000 Subject: openbsc[master]: libmsc: support GSM 03.40 status report for nitb In-Reply-To: References: Message-ID: Patch Set 4: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3438 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I5cc7bb4ebadde0940f44d10c3df34707b0615160 Gerrit-PatchSet: 4 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Pablo Neira Ayuso Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Keith Whyte Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pablo Neira Ayuso Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Aug 9 12:56:30 2017 From: gerrit-no-reply at lists.osmocom.org (Pablo Neira Ayuso) Date: Wed, 9 Aug 2017 12:56:30 +0000 Subject: [MERGED] openbsc[master]: utils: smpp_mirror: temporarily munch SMPP delivery receipts In-Reply-To: References: Message-ID: Pablo Neira Ayuso has submitted this change and it was merged. Change subject: utils: smpp_mirror: temporarily munch SMPP delivery receipts ...................................................................... utils: smpp_mirror: temporarily munch SMPP delivery receipts Just munch and log SMPP delivery receipts by now, don't mirror this, it is going to break things in openbsc. Follow up patch removes this and mirrors this SMPP message as a SUBMIT_SM with esm_class = Delivery Acknowledgement. Change-Id: I78e93bc4034679e238c8642ccf6a0e844b1d6d8b --- M openbsc/src/utils/smpp_mirror.c 1 file changed, 8 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/openbsc/src/utils/smpp_mirror.c b/openbsc/src/utils/smpp_mirror.c index ec28f0a..edb40b5 100644 --- a/openbsc/src/utils/smpp_mirror.c +++ b/openbsc/src/utils/smpp_mirror.c @@ -112,6 +112,14 @@ PACK_AND_SEND(esme, &deliver_r); + /* This is a delivery receipt, temporarily munch it until we teach + * openbsc what to do with this. + */ + if (deliver.esm_class == 0x04) { + LOGP(DSMPP, LOGL_NOTICE, "%s\n", deliver.short_message); + return 0; + } + memset(&submit, 0, sizeof(submit)); submit.command_id = SUBMIT_SM; submit.command_status = ESME_ROK; -- To view, visit https://gerrit.osmocom.org/3432 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I78e93bc4034679e238c8642ccf6a0e844b1d6d8b Gerrit-PatchSet: 2 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Pablo Neira Ayuso Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Keith Whyte Gerrit-Reviewer: Pablo Neira Ayuso From gerrit-no-reply at lists.osmocom.org Wed Aug 9 12:56:35 2017 From: gerrit-no-reply at lists.osmocom.org (Pablo Neira Ayuso) Date: Wed, 9 Aug 2017 12:56:35 +0000 Subject: [MERGED] openbsc[master]: utils: smpp_mirror: reflect message reference TLV In-Reply-To: References: Message-ID: Pablo Neira Ayuso has submitted this change and it was merged. Change subject: utils: smpp_mirror: reflect message reference TLV ...................................................................... utils: smpp_mirror: reflect message reference TLV Useful to test the delivery receipt support. This TLV contains the GSM03.40 message reference. Change-Id: I1b0abaa7e06ffe1bd2242c70813d8b70e9fa954f --- M openbsc/src/utils/smpp_mirror.c 1 file changed, 23 insertions(+), 1 deletion(-) Approvals: Neels Hofmeyr: Looks good to me, but someone else must approve Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/openbsc/src/utils/smpp_mirror.c b/openbsc/src/utils/smpp_mirror.c index edb40b5..88545de 100644 --- a/openbsc/src/utils/smpp_mirror.c +++ b/openbsc/src/utils/smpp_mirror.c @@ -95,12 +95,23 @@ } /* FIXME: merge with smpp_smsc.c */ +static struct tlv_t *find_tlv(struct tlv_t *head, uint16_t tag) +{ + struct tlv_t *t; + + for (t = head; t != NULL; t = t->next) { + if (t->tag == tag) + return t; + } + return NULL; +} static int smpp_handle_deliver(struct esme *esme, struct msgb *msg) { struct deliver_sm_t deliver; struct deliver_sm_resp_t deliver_r; struct submit_sm_t submit; + tlv_t *t; int rc; memset(&deliver, 0, sizeof(deliver)); @@ -155,7 +166,18 @@ memcpy(submit.short_message, deliver.short_message, OSMO_MIN(sizeof(submit.short_message), sizeof(deliver.short_message))); - /* FIXME: TLV? */ + + /* FIXME: More TLV? */ + t = find_tlv(deliver.tlv, TLVID_user_message_reference); + if (t) { + tlv_t tlv; + + memset(&tlv, 0, sizeof(tlv)); + tlv.tag = TLVID_user_message_reference; + tlv.length = 2; + tlv.value.val16 = t->value.val16; + build_tlv(&submit.tlv, &tlv); + } return PACK_AND_SEND(esme, &submit); } -- To view, visit https://gerrit.osmocom.org/3433 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I1b0abaa7e06ffe1bd2242c70813d8b70e9fa954f Gerrit-PatchSet: 2 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Pablo Neira Ayuso Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Keith Whyte Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pablo Neira Ayuso From gerrit-no-reply at lists.osmocom.org Wed Aug 9 12:56:42 2017 From: gerrit-no-reply at lists.osmocom.org (Pablo Neira Ayuso) Date: Wed, 9 Aug 2017 12:56:42 +0000 Subject: [MERGED] openbsc[master]: libmsc: add support for SMPP delivery receipts In-Reply-To: References: Message-ID: Pablo Neira Ayuso has submitted this change and it was merged. Change subject: libmsc: add support for SMPP delivery receipts ...................................................................... libmsc: add support for SMPP delivery receipts If the mobile phone requests a status report via SMS, send a DELIVER_SM with esm_class = Delivery Receipt to ESME to indicate that the SMS has been already delivered to its destination. MS GSM 03.40 SMSC SMPP 3.4 ESME | | | | SMS-DELIVER | | |<----------------------------| | | GSM 04.11 RP-ACK | | |---------------------------->| | | | DELIVER-SM | | | esm_class = Delivery Receipt | | |------------------------------->| | | DELIVER-SM-RESP | | |<-------------------------------| | | | This patch implements "Appendix B. Delivery Receipt Format" as specified in the SMPP 3.4 specs. This string is conveyed in the SMS message as data, and it is only meaningful to the ESME, for logging purposes. The "submit date" and "done date" are not yet set, and other fields are just sent with dummy values, so they are left to be finished as future work. The new SMPP TLV tag TLVID_user_message_reference is added to the SMPP messages inconditionally now since this information is required by delivery-reports to associate the status-report with the original SMS. Change-Id: Ic1a9023074bfa938099377980b6aff9b262fab2a --- M openbsc/include/openbsc/gsm_data.h M openbsc/src/libmsc/gsm_04_11.c M openbsc/src/libmsc/smpp_openbsc.c M openbsc/src/libmsc/smpp_smsc.h 4 files changed, 76 insertions(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/openbsc/include/openbsc/gsm_data.h b/openbsc/include/openbsc/gsm_data.h index 37a341c..6829d22 100644 --- a/openbsc/include/openbsc/gsm_data.h +++ b/openbsc/include/openbsc/gsm_data.h @@ -456,6 +456,7 @@ } smpp; unsigned long validity_minutes; + bool is_report; uint8_t reply_path_req; uint8_t status_rep_req; uint8_t ud_hdr_ind; diff --git a/openbsc/src/libmsc/gsm_04_11.c b/openbsc/src/libmsc/gsm_04_11.c index 1aed60e..0edbe0b 100644 --- a/openbsc/src/libmsc/gsm_04_11.c +++ b/openbsc/src/libmsc/gsm_04_11.c @@ -593,6 +593,57 @@ rpud_len, rp_ud); } +static struct gsm_sms *sms_report_alloc(struct gsm_sms *sms) +{ + struct gsm_sms *sms_report; + int len; + + sms_report = sms_alloc(); + OSMO_ASSERT(sms_report); + + sms_report->msg_ref = sms->msg_ref; + sms_report->protocol_id = sms->protocol_id; + sms_report->data_coding_scheme = GSM338_DCS_1111_8BIT_DATA; + + /* Invert address to send status report back to origin. */ + sms_report->src = sms->dst; + sms_report->dst = sms->src; + + /* As specified by Appendix B. Delivery Receipt Format. + * TODO: Many fields in this string are just set with dummy values, + * revisit this. + */ + len = snprintf((char *)sms_report->user_data, + sizeof(sms_report->user_data), + "id:%.08llu sub:000 dlvrd:000 submit date:YYMMDDhhmm done date:YYMMDDhhmm stat:DELIVRD err:000 text:%.20s", + sms->id, sms->user_data); + sms_report->user_data_len = len; + LOGP(DLSMS, LOGL_NOTICE, "%s\n", sms_report->user_data); + + /* This represents a sms report. */ + sms_report->is_report = true; + + return sms_report; +} + +static void sms_status_report(struct gsm_sms *gsms, + struct gsm_subscriber_connection *conn) +{ + struct gsm_sms *sms_report; + int rc; + + sms_report = sms_report_alloc(gsms); + + rc = sms_route_mt_sms(conn, sms_report); + if (rc < 0) { + LOGP(DLSMS, LOGL_ERROR, + "Failed to send status report! err=%d\n", rc); + } + LOGP(DLSMS, LOGL_NOTICE, "Status report has been sent\n"); + + sms_free(sms_report); +} + /* Receive a 04.11 RP-ACK message (response to RP-DATA from us) */ static int gsm411_rx_rp_ack(struct msgb *msg, struct gsm_trans *trans, struct gsm411_rp_hdr *rph) @@ -614,6 +665,9 @@ send_signal(S_SMS_DELIVERED, trans, sms, 0); + if (sms->status_rep_req) + sms_status_report(sms, trans->conn); + sms_free(sms); trans->sms.sms = NULL; diff --git a/openbsc/src/libmsc/smpp_openbsc.c b/openbsc/src/libmsc/smpp_openbsc.c index a803763..c0aa89b 100644 --- a/openbsc/src/libmsc/smpp_openbsc.c +++ b/openbsc/src/libmsc/smpp_openbsc.c @@ -200,6 +200,10 @@ sms->user_data_len = sms_msg_len; } + t = find_tlv(submit->tlv, TLVID_user_message_reference); + if (t) + sms->msg_ref = ntohs(t->value.val16); + *psms = sms; return ESME_ROK; } @@ -514,6 +518,9 @@ struct gsm_subscriber_connection *conn; struct gsm_trans *trans; + if (cmd->is_report) + goto out; + conn = connection_for_subscr(cmd->subscr); if (!conn) { LOGP(DSMPP, LOGL_ERROR, "No connection to subscriber anymore\n"); @@ -537,6 +544,9 @@ struct gsm_subscriber_connection *conn; struct gsm_trans *trans; int gsm411_cause; + + if (cmd->is_report) + goto out; conn = connection_for_subscr(cmd->subscr); if (!conn) { @@ -575,6 +585,7 @@ return -1; cmd->sequence_nr = sequence_number; + cmd->is_report = sms->is_report; cmd->gsm411_msg_ref = sms->gsm411.msg_ref; cmd->gsm411_trans_id = sms->gsm411.transaction_id; cmd->subscr = subscr_get(subscr); @@ -639,7 +650,12 @@ memcpy(deliver.destination_addr, sms->dst.addr, sizeof(deliver.destination_addr)); - deliver.esm_class = 1; /* datagram mode */ + /* Short message contains a delivery receipt? Sect. 5.2.12. */ + if (sms->is_report) + deliver.esm_class = 0x04; + else + deliver.esm_class = 1; /* datagram mode */ + if (sms->ud_hdr_ind) deliver.esm_class |= 0x40; if (sms->reply_path_req) @@ -685,6 +701,9 @@ if (esme->acl && esme->acl->osmocom_ext && conn->lchan) append_osmo_tlvs(&deliver.tlv, conn->lchan); + append_tlv_u16(&deliver.tlv, TLVID_user_message_reference, + sms->msg_ref); + ret = smpp_tx_deliver(esme, &deliver); if (ret < 0) return ret; diff --git a/openbsc/src/libmsc/smpp_smsc.h b/openbsc/src/libmsc/smpp_smsc.h index 468d3b4..257383f 100644 --- a/openbsc/src/libmsc/smpp_smsc.h +++ b/openbsc/src/libmsc/smpp_smsc.h @@ -92,6 +92,7 @@ uint32_t sequence_nr; uint32_t gsm411_msg_ref; uint8_t gsm411_trans_id; + bool is_report; struct osmo_timer_list response_timer; }; -- To view, visit https://gerrit.osmocom.org/3434 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ic1a9023074bfa938099377980b6aff9b262fab2a Gerrit-PatchSet: 2 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Pablo Neira Ayuso Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Keith Whyte Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pablo Neira Ayuso From gerrit-no-reply at lists.osmocom.org Wed Aug 9 12:56:58 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 9 Aug 2017 12:56:58 +0000 Subject: [MERGED] osmo-bts[master]: TRX: Remove bogus extern global variable declarations In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: TRX: Remove bogus extern global variable declarations ...................................................................... TRX: Remove bogus extern global variable declarations Those global variable declarations for non-existing variables were introduced in 8a8d73a691c709403be4adbe8f2a7150b4d5998a, let's remove them again. The source / destination IP address is a parameter of the phy_link, and not a global variable. Related: OS#1848 Change-Id: I94b5f934fc3bd00b0467d90029d3053b16594186 --- M src/osmo-bts-trx/trx_if.h 1 file changed, 0 insertions(+), 2 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/osmo-bts-trx/trx_if.h b/src/osmo-bts-trx/trx_if.h index 1fc454d..86fb18f 100644 --- a/src/osmo-bts-trx/trx_if.h +++ b/src/osmo-bts-trx/trx_if.h @@ -2,8 +2,6 @@ #define TRX_IF_H extern int transceiver_available; -extern const char *local_ip; -extern const char *remote_ip; extern int settsc_enabled; extern int setbsic_enabled; -- To view, visit https://gerrit.osmocom.org/3045 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I94b5f934fc3bd00b0467d90029d3053b16594186 Gerrit-PatchSet: 5 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Vadim Yanitskiy From gerrit-no-reply at lists.osmocom.org Wed Aug 9 12:57:28 2017 From: gerrit-no-reply at lists.osmocom.org (Keith Whyte) Date: Wed, 9 Aug 2017 12:57:28 +0000 Subject: openbsc[master]: libmsc: support GSM 03.40 status report for nitb In-Reply-To: References: Message-ID: Patch Set 4: Verified+1 -- To view, visit https://gerrit.osmocom.org/3438 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I5cc7bb4ebadde0940f44d10c3df34707b0615160 Gerrit-PatchSet: 4 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Pablo Neira Ayuso Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Keith Whyte Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pablo Neira Ayuso Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Aug 9 12:58:13 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 9 Aug 2017 12:58:13 +0000 Subject: libosmo-sccp[master]: add OSMO_SS7_PC_INVALID, add osmo_ss7_pc_is_valid() In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3450 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ib5715bf03a4de7713a7a809dfd821c700255ba8c Gerrit-PatchSet: 1 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Aug 9 12:58:24 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 9 Aug 2017 12:58:24 +0000 Subject: libosmo-sccp[master]: ensure valid primary_pc in osmo_ss7_instance In-Reply-To: References: Message-ID: Patch Set 4: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3355 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I7f0f0c89b7335d9da24161bfac8234be214ca00c Gerrit-PatchSet: 4 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Aug 9 12:58:37 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 9 Aug 2017 12:58:37 +0000 Subject: libosmo-sccp[master]: consistency: use OSMO_SS7_PC_INVALID for osmo_sccp_user In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3451 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I8684c9b559712072c772012890bbf7efa7c8eb35 Gerrit-PatchSet: 1 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Aug 9 12:58:58 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 9 Aug 2017 12:58:58 +0000 Subject: [MERGED] libosmo-sccp[master]: consistency: use OSMO_SS7_PC_INVALID for osmo_sccp_user In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: consistency: use OSMO_SS7_PC_INVALID for osmo_sccp_user ...................................................................... consistency: use OSMO_SS7_PC_INVALID for osmo_sccp_user A previous patch added ss7_instance primary_pc validity checks by means of OSMO_SS7_PC_INVALID. To be consistent, also adjust sccp_user accordingly. (see I7f0f0c89b7335d9da24161bfac8234be214ca00c) Remove the osmo_sccp_user's pc_valid field, replaced by pc=OSMO_SS7_PC_INVALID. Adjust all code paths. Simplify some log printing, using the fact that osmo_ss7_pointcode_print() now outputs "(no PC)" for unset point codes. Change-Id: I8684c9b559712072c772012890bbf7efa7c8eb35 --- M src/sccp_internal.h M src/sccp_scoc.c M src/sccp_user.c M src/sccp_vty.c 4 files changed, 16 insertions(+), 21 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/sccp_internal.h b/src/sccp_internal.h index 17dda13..66d768d 100644 --- a/src/sccp_internal.h +++ b/src/sccp_internal.h @@ -34,7 +34,6 @@ /*! \brief SSN and/or point code to which we are bound */ uint16_t ssn; uint32_t pc; - bool pc_valid; /* set if we are a server */ struct llist_head links; diff --git a/src/sccp_scoc.c b/src/sccp_scoc.c index 9820c40..74fb0e7 100644 --- a/src/sccp_scoc.c +++ b/src/sccp_scoc.c @@ -1672,7 +1672,7 @@ struct osmo_sccp_addr *remote_addr; uint32_t local_pc = OSMO_SS7_PC_INVALID; - if (conn->user->pc_valid) + if (osmo_ss7_pc_is_valid(conn->user->pc)) local_pc = conn->user->pc; else if (osmo_ss7_pc_is_valid(s7i->cfg.primary_pc)) local_pc = s7i->cfg.primary_pc; diff --git a/src/sccp_user.c b/src/sccp_user.c index d49da29..1414572 100644 --- a/src/sccp_user.c +++ b/src/sccp_user.c @@ -48,13 +48,13 @@ /* First try to find match for PC + SSN */ llist_for_each_entry(scu, &inst->users, list) { - if (scu->pc_valid && scu->pc == pc && scu->ssn == ssn) + if (osmo_ss7_pc_is_valid(scu->pc) && scu->pc == pc && scu->ssn == ssn) return scu; } /* Then try to match on SSN only */ llist_for_each_entry(scu, &inst->users, list) { - if (!scu->pc_valid && scu->ssn == ssn) + if (!osmo_ss7_pc_is_valid(scu->pc) && scu->ssn == ssn) return scu; } @@ -65,28 +65,25 @@ * \param[in] inst SCCP Instance * \param[in] name human-readable name * \param[in] ssn Sub-System Number to bind to - * \param[in] pc Point Code to bind to (if any) - * \param[in] pc_valid Whether or not \ref pc is valid/used + * \param[in] pc Point Code to bind to, or OSMO_SS7_PC_INVALID if none. * \returns Callee-allocated SCCP User on success; negative otherwise */ static struct osmo_sccp_user * sccp_user_bind_pc(struct osmo_sccp_instance *inst, const char *name, - osmo_prim_cb prim_cb, uint16_t ssn, uint32_t pc, bool pc_valid) + osmo_prim_cb prim_cb, uint16_t ssn, uint32_t pc) { struct osmo_sccp_user *scu; - if (!pc_valid) - pc = 0; scu = sccp_user_find(inst, ssn, pc); if (scu) { LOGP(DLSCCP, LOGL_ERROR, - "Cannot bind user '%s' to SSN=%u PC=%u=%s (pc_valid=%u), this SSN and PC" + "Cannot bind user '%s' to SSN=%u PC=%s, this SSN and PC" " is already bound by '%s'\n", - name, ssn, pc, osmo_ss7_pointcode_print(inst->ss7, pc), pc_valid, scu->name); + name, ssn, osmo_ss7_pointcode_print(inst->ss7, pc), scu->name); return NULL; } - LOGP(DLSCCP, LOGL_INFO, "Binding user '%s' to SSN=%u PC=%u=%s (pc_valid=%u)\n", - name, ssn, pc, osmo_ss7_pointcode_print(inst->ss7, pc), pc_valid); + LOGP(DLSCCP, LOGL_INFO, "Binding user '%s' to SSN=%u PC=%s\n", + name, ssn, osmo_ss7_pointcode_print(inst->ss7, pc)); scu = talloc_zero(inst, struct osmo_sccp_user); scu->name = talloc_strdup(scu, name); @@ -94,7 +91,6 @@ scu->prim_cb = prim_cb; scu->ssn = ssn; scu->pc = pc; - scu->pc_valid = pc_valid; llist_add_tail(&scu->list, &inst->users); return scu; @@ -104,13 +100,13 @@ * \param[in] inst SCCP Instance * \param[in] name human-readable name * \param[in] ssn Sub-System Number to bind to - * \param[in] pc Point Code to bind to (if any) + * \param[in] pc Point Code to bind to * \returns Callee-allocated SCCP User on success; negative otherwise */ struct osmo_sccp_user * osmo_sccp_user_bind_pc(struct osmo_sccp_instance *inst, const char *name, osmo_prim_cb prim_cb, uint16_t ssn, uint32_t pc) { - return sccp_user_bind_pc(inst, name, prim_cb, ssn, pc, true); + return sccp_user_bind_pc(inst, name, prim_cb, ssn, pc); } /*! \brief Bind a given SCCP User to a given SSN (at any PC) @@ -122,7 +118,7 @@ osmo_sccp_user_bind(struct osmo_sccp_instance *inst, const char *name, osmo_prim_cb prim_cb, uint16_t ssn) { - return sccp_user_bind_pc(inst, name, prim_cb, ssn, 0, false); + return sccp_user_bind_pc(inst, name, prim_cb, ssn, OSMO_SS7_PC_INVALID); } /*! \brief Unbind a given SCCP user @@ -130,9 +126,9 @@ * at the time this function returns. */ void osmo_sccp_user_unbind(struct osmo_sccp_user *scu) { - LOGP(DLSCCP, LOGL_INFO, "Unbinding user '%s' from SSN=%u PC=%u " - "(pc_valid=%u)\n", scu->name, scu->ssn, scu->pc, - scu->pc_valid); + LOGP(DLSCCP, LOGL_INFO, "Unbinding user '%s' from SSN=%u PC=%s\n", + scu->name, scu->ssn, + osmo_ss7_pointcode_print(scu->inst->ss7, scu->pc)); /* FIXME: free/release all connections held by this user? */ llist_del(&scu->list); talloc_free(scu); diff --git a/src/sccp_vty.c b/src/sccp_vty.c index 626fefb..7f0a0de 100644 --- a/src/sccp_vty.c +++ b/src/sccp_vty.c @@ -42,7 +42,7 @@ { struct osmo_sccp_instance *sccp = user->inst; - if (user->pc_valid) + if (osmo_ss7_pc_is_valid(user->pc)) vty_out(vty, "SSN %3u %7s : %s%s", user->ssn, osmo_ss7_pointcode_print(sccp->ss7, user->pc), user->name, VTY_NEWLINE); -- To view, visit https://gerrit.osmocom.org/3451 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I8684c9b559712072c772012890bbf7efa7c8eb35 Gerrit-PatchSet: 1 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Aug 9 12:58:58 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 9 Aug 2017 12:58:58 +0000 Subject: [MERGED] libosmo-sccp[master]: ensure valid primary_pc in osmo_ss7_instance In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: ensure valid primary_pc in osmo_ss7_instance ...................................................................... ensure valid primary_pc in osmo_ss7_instance Initialize osmo_ss7_instance.cfg.primary_pc = OSMO_SS7_PC_INVALID. Adjust all code paths using primary_pc to ensure it is indeed valid. Rationale: It looks like we are going to use the primary point-code of an SS7 instance to derive a local SCCP address, e.g. for osmo-bsc and osmo-hnbgw. cs7-instance 1 point-code 1.2.3 ! sets osmo_ss7_instance.primary_pc = 1.2.3 sccp-address msc point-code 0.0.1 routing-indicator PC hnb iucs remote-addr msc ! derives cs7 instance 1 and local pc 1.2.3 If 'point-code 1.2.3' is omitted, this becomes '0.0.0' without the user noticing, and this happens for each client that omits it. I would like to barf when no local PC is set. Change-Id: I7f0f0c89b7335d9da24161bfac8234be214ca00c --- M src/osmo_ss7.c M src/osmo_ss7_vty.c M src/sccp_scoc.c M src/sccp_scrc.c M src/sccp_user.c 5 files changed, 19 insertions(+), 6 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/osmo_ss7.c b/src/osmo_ss7.c index 6db3f14..f82f952 100644 --- a/src/osmo_ss7.c +++ b/src/osmo_ss7.c @@ -354,6 +354,8 @@ if (!inst) return NULL; + inst->cfg.primary_pc = OSMO_SS7_PC_INVALID; + inst->cfg.id = id; LOGSS7(inst, LOGL_INFO, "Creating SS7 Instance\n"); @@ -1825,7 +1827,7 @@ bool osmo_ss7_pc_is_local(struct osmo_ss7_instance *inst, uint32_t pc) { OSMO_ASSERT(ss7_initialized); - if (pc == inst->cfg.primary_pc) + if (osmo_ss7_pc_is_valid(inst->cfg.primary_pc) && pc == inst->cfg.primary_pc) return true; /* FIXME: Secondary and Capability Point Codes */ return false; diff --git a/src/osmo_ss7_vty.c b/src/osmo_ss7_vty.c index 476aedf..164b7f2 100644 --- a/src/osmo_ss7_vty.c +++ b/src/osmo_ss7_vty.c @@ -166,7 +166,7 @@ { struct osmo_ss7_instance *inst = vty->index; int pc = osmo_ss7_pointcode_parse(inst, argv[0]); - if (pc < 0) { + if (pc < 0 || !osmo_ss7_pc_is_valid((uint32_t)pc)) { vty_out(vty, "Invalid point code (%s)%s", argv[0], VTY_NEWLINE); return CMD_WARNING; } @@ -1536,7 +1536,7 @@ if (inst->cfg.pc_fmt.delimiter != '.') vty_out(vty, " point-code delimiter dash%s", VTY_NEWLINE); - if (inst->cfg.primary_pc) + if (osmo_ss7_pc_is_valid(inst->cfg.primary_pc)) vty_out(vty, " point-code %s%s", osmo_ss7_pointcode_print(inst, inst->cfg.primary_pc), VTY_NEWLINE); diff --git a/src/sccp_scoc.c b/src/sccp_scoc.c index 3d43448..9820c40 100644 --- a/src/sccp_scoc.c +++ b/src/sccp_scoc.c @@ -1670,11 +1670,11 @@ { struct osmo_ss7_instance *s7i = conn->inst->ss7; struct osmo_sccp_addr *remote_addr; - uint32_t local_pc; + uint32_t local_pc = OSMO_SS7_PC_INVALID; if (conn->user->pc_valid) local_pc = conn->user->pc; - else + else if (osmo_ss7_pc_is_valid(s7i->cfg.primary_pc)) local_pc = s7i->cfg.primary_pc; if (conn->incoming) diff --git a/src/sccp_scrc.c b/src/sccp_scrc.c index e44201a..2afd696 100644 --- a/src/sccp_scrc.c +++ b/src/sccp_scrc.c @@ -91,8 +91,14 @@ param = &omp->u.transfer; if (sua->mtp.opc) param->opc = sua->mtp.opc; - else + else { + if (!osmo_ss7_pc_is_valid(s7i->cfg.primary_pc)) { + LOGP(DLSCCP, LOGL_ERROR, "SS7 instance %u: no primary point-code set\n", + s7i->cfg.id); + return -1; + } param->opc = s7i->cfg.primary_pc; + } param->dpc = remote_pc; param->sls = sua->mtp.sls; param->sio = MTP_SIO(MTP_SI_SCCP, s7i->cfg.network_indicator); diff --git a/src/sccp_user.c b/src/sccp_user.c index 71b3262..d49da29 100644 --- a/src/sccp_user.c +++ b/src/sccp_user.c @@ -366,6 +366,11 @@ goto out_ss7; as_created = true; + if (!osmo_ss7_pc_is_valid(ss7->cfg.primary_pc)) { + LOGP(DLSCCP, LOGL_ERROR, "SS7 instance %u: no primary point-code set\n", + ss7->cfg.id); + goto out_ss7; + } as->cfg.routing_key.pc = ss7->cfg.primary_pc; /* install default route */ -- To view, visit https://gerrit.osmocom.org/3355 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I7f0f0c89b7335d9da24161bfac8234be214ca00c Gerrit-PatchSet: 4 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Wed Aug 9 12:58:58 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 9 Aug 2017 12:58:58 +0000 Subject: [MERGED] libosmo-sccp[master]: add OSMO_SS7_PC_INVALID, add osmo_ss7_pc_is_valid() In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: add OSMO_SS7_PC_INVALID, add osmo_ss7_pc_is_valid() ...................................................................... add OSMO_SS7_PC_INVALID, add osmo_ss7_pc_is_valid() Introduce OSMO_SS7_PC_INVALID to mark an unset point code. Add static osmo_ss7_pc_is_valid() (name matches schema of osmo_ss7_pc_is_local()). In osmo_ss7_pointcode_print(), return "(no PC)" if !osmo_ss7_pc_is_valid(), for convenient printing of any PC state. Subsequent patches will use this for osmo_ss7_instance (I7f0f0c89b7335d9da24161bfac8234be214ca00c) as well as osmo_sccp_user (I8684c9b559712072c772012890bbf7efa7c8eb35). Rationale: Currently, in osmo_ss7_vty.c we had "if (inst->cfg.primary_pc)" suggesting 0 is invalid, but in struct osmo_sccp_user we have flag pc_valid suggesting 0 is indeed valid. All known point code formats are <= 24bit, so we can easily use 0xffffffff as indicator for an unset PC, which removes the need to remember to set a second field for validity and keeps the structs nice and lean. Change-Id: Ib5715bf03a4de7713a7a809dfd821c700255ba8c --- M include/osmocom/sigtran/osmo_ss7.h M src/osmo_ss7.c 2 files changed, 17 insertions(+), 3 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/include/osmocom/sigtran/osmo_ss7.h b/include/osmocom/sigtran/osmo_ss7.h index bbe425c..967912a 100644 --- a/include/osmocom/sigtran/osmo_ss7.h +++ b/include/osmocom/sigtran/osmo_ss7.h @@ -26,6 +26,14 @@ const char *osmo_ss7_pointcode_print(struct osmo_ss7_instance *inst, uint32_t pc); const char *osmo_ss7_pointcode_print2(struct osmo_ss7_instance *inst, uint32_t pc); +/* All known point-code formats have a length of or below 24 bit. + * A point-code value exceeding that is used to indicate an unset PC. */ +#define OSMO_SS7_PC_INVALID 0xffffffff +static inline bool osmo_ss7_pc_is_valid(uint32_t pc) +{ + return pc <= 0x00ffffff; +} + /*********************************************************************** * SS7 Routing Tables ***********************************************************************/ diff --git a/src/osmo_ss7.c b/src/osmo_ss7.c index eb5a4ef..6db3f14 100644 --- a/src/osmo_ss7.c +++ b/src/osmo_ss7.c @@ -247,10 +247,16 @@ const char *_osmo_ss7_pointcode_print(char *buf, size_t len, struct osmo_ss7_instance *inst, uint32_t pc) { - const struct osmo_ss7_pc_fmt *pc_fmt = inst ? &inst->cfg.pc_fmt : &default_pc_fmt; - unsigned int num_comp_exp = num_pc_comp_exp(pc_fmt); - const char *fmtstr = gen_pc_fmtstr(pc_fmt, &num_comp_exp); + const struct osmo_ss7_pc_fmt *pc_fmt; + unsigned int num_comp_exp; + const char *fmtstr; + if (!osmo_ss7_pc_is_valid(pc)) + return "(no PC)"; + + pc_fmt = inst ? &inst->cfg.pc_fmt : &default_pc_fmt; + num_comp_exp = num_pc_comp_exp(pc_fmt); + fmtstr = gen_pc_fmtstr(pc_fmt, &num_comp_exp); OSMO_ASSERT(fmtstr); snprintf(buf, len, fmtstr, pc_comp_shift_and_mask(pc_fmt, 0, pc), -- To view, visit https://gerrit.osmocom.org/3450 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ib5715bf03a4de7713a7a809dfd821c700255ba8c Gerrit-PatchSet: 1 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Aug 9 12:58:58 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 9 Aug 2017 12:58:58 +0000 Subject: [MERGED] libosmo-sccp[master]: sccp_helpers: check buf len in append_to_buf() In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: sccp_helpers: check buf len in append_to_buf() ...................................................................... sccp_helpers: check buf len in append_to_buf() Change-Id: I2e6d656871f952be8e719573fedf2154832841d7 --- M src/sccp_helpers.c 1 file changed, 21 insertions(+), 18 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/sccp_helpers.c b/src/sccp_helpers.c index db562db..1e83c8c 100644 --- a/src/sccp_helpers.c +++ b/src/sccp_helpers.c @@ -230,16 +230,19 @@ return osmo_sccp_tx_conn_resp_msg(scu, conn_id, resp_addr, msg); } -static void append_to_buf(char *buf, bool *comma, const char *fmt, ...) +static void append_to_buf(char *buf, size_t size, bool *comma, const char *fmt, ...) { va_list ap; + size_t printed; va_start(ap, fmt); if (*comma == true) { strcat(buf, ","); } else *comma = true; - vsprintf(buf+strlen(buf), fmt, ap); + printed = strlen(buf); + OSMO_ASSERT(printed <= size); + vsnprintf(buf + printed, size - printed, fmt, ap); va_end(ap); } @@ -260,16 +263,16 @@ if (gt->gti == OSMO_SCCP_GTI_TT_ONLY || gt->gti == OSMO_SCCP_GTI_TT_NPL_ENC || gt->gti == OSMO_SCCP_GTI_TT_NPL_ENC_NAI) - append_to_buf(buf, &comma, "TT=%u", gt->tt); + append_to_buf(buf, sizeof(buf), &comma, "TT=%u", gt->tt); if (gt->gti == OSMO_SCCP_GTI_TT_NPL_ENC || gt->gti == OSMO_SCCP_GTI_TT_NPL_ENC_NAI) - append_to_buf(buf, &comma, "NPL=%u", gt->npi); + append_to_buf(buf, sizeof(buf), &comma, "NPL=%u", gt->npi); if (gt->gti == OSMO_SCCP_GTI_TT_NPL_ENC_NAI) - append_to_buf(buf, &comma, "NAI=%u", gt->nai); + append_to_buf(buf, sizeof(buf), &comma, "NAI=%u", gt->nai); - append_to_buf(buf, &comma, "DIG=%s", gt->digits); + append_to_buf(buf, sizeof(buf), &comma, "DIG=%s", gt->digits); return buf; } @@ -282,17 +285,17 @@ buf[0] = '\0'; - append_to_buf(buf, &comma, "RI=%d", addr->ri); + append_to_buf(buf, sizeof(buf), &comma, "RI=%d", addr->ri); if (addr->presence & OSMO_SCCP_ADDR_T_PC) - append_to_buf(buf, &comma, "PC=%u", addr->pc); + append_to_buf(buf, sizeof(buf), &comma, "PC=%u", addr->pc); if (addr->presence & OSMO_SCCP_ADDR_T_SSN) - append_to_buf(buf, &comma, "SSN=%u", addr->ssn); + append_to_buf(buf, sizeof(buf), &comma, "SSN=%u", addr->ssn); if (addr->presence & OSMO_SCCP_ADDR_T_IPv4) - append_to_buf(buf, &comma, "IP=%s", inet_ntoa(addr->ip.v4)); - append_to_buf(buf, &comma, "GTI=%u", addr->gt.gti); + append_to_buf(buf, sizeof(buf), &comma, "IP=%s", inet_ntoa(addr->ip.v4)); + append_to_buf(buf, sizeof(buf), &comma, "GTI=%u", addr->gt.gti); if (addr->presence & OSMO_SCCP_ADDR_T_GT) - append_to_buf(buf, &comma, "GT=(%s)", osmo_sccp_gt_dump(&addr->gt)); + append_to_buf(buf, sizeof(buf), &comma, "GT=(%s)", osmo_sccp_gt_dump(&addr->gt)); return buf; } @@ -305,17 +308,17 @@ buf[0] = '\0'; - append_to_buf(buf, &comma, "RI=%s", osmo_sccp_routing_ind_name(addr->ri)); + append_to_buf(buf, sizeof(buf), &comma, "RI=%s", osmo_sccp_routing_ind_name(addr->ri)); if (addr->presence & OSMO_SCCP_ADDR_T_PC) - append_to_buf(buf, &comma, "PC=%s", osmo_ss7_pointcode_print(ss7, addr->pc)); + append_to_buf(buf, sizeof(buf), &comma, "PC=%s", osmo_ss7_pointcode_print(ss7, addr->pc)); if (addr->presence & OSMO_SCCP_ADDR_T_SSN) - append_to_buf(buf, &comma, "SSN=%s", osmo_sccp_ssn_name(addr->ssn)); + append_to_buf(buf, sizeof(buf), &comma, "SSN=%s", osmo_sccp_ssn_name(addr->ssn)); if (addr->presence & OSMO_SCCP_ADDR_T_IPv4) - append_to_buf(buf, &comma, "IP=%s", inet_ntoa(addr->ip.v4)); - append_to_buf(buf, &comma, "GTI=%s", osmo_sccp_gti_name(addr->gt.gti)); + append_to_buf(buf, sizeof(buf), &comma, "IP=%s", inet_ntoa(addr->ip.v4)); + append_to_buf(buf, sizeof(buf), &comma, "GTI=%s", osmo_sccp_gti_name(addr->gt.gti)); if (addr->presence & OSMO_SCCP_ADDR_T_GT) - append_to_buf(buf, &comma, "GT=(%s)", osmo_sccp_gt_dump(&addr->gt)); + append_to_buf(buf, sizeof(buf), &comma, "GT=(%s)", osmo_sccp_gt_dump(&addr->gt)); return buf; } -- To view, visit https://gerrit.osmocom.org/3366 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I2e6d656871f952be8e719573fedf2154832841d7 Gerrit-PatchSet: 4 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Aug 9 12:58:59 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 9 Aug 2017 12:58:59 +0000 Subject: [MERGED] libosmo-sccp[master]: sccp-addr vty: set RI to SSN_PC when setting a point-code In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: sccp-addr vty: set RI to SSN_PC when setting a point-code ...................................................................... sccp-addr vty: set RI to SSN_PC when setting a point-code Change-Id: I75c67d289693f1c2a049ac61cf2b2097d6e5687d --- M src/osmo_ss7_vty.c 1 file changed, 2 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/osmo_ss7_vty.c b/src/osmo_ss7_vty.c index b70f892..21efcae 100644 --- a/src/osmo_ss7_vty.c +++ b/src/osmo_ss7_vty.c @@ -1300,6 +1300,8 @@ entry->addr.presence |= OSMO_SCCP_ADDR_T_PC; entry->addr.pc = pc; + if (entry->addr.ri == OSMO_SCCP_RI_NONE) + entry->addr.ri = OSMO_SCCP_RI_SSN_PC; return CMD_SUCCESS; } -- To view, visit https://gerrit.osmocom.org/3365 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I75c67d289693f1c2a049ac61cf2b2097d6e5687d Gerrit-PatchSet: 4 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Aug 9 12:58:59 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 9 Aug 2017 12:58:59 +0000 Subject: [MERGED] libosmo-sccp[master]: cosmetic: ws in log In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: cosmetic: ws in log ...................................................................... cosmetic: ws in log Change-Id: If5a56ec170d4e91ce070f6fa9c9cfe5bbc121186 --- M src/sccp2sua.c 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/sccp2sua.c b/src/sccp2sua.c index 499b55b..ad948c9 100644 --- a/src/sccp2sua.c +++ b/src/sccp2sua.c @@ -231,7 +231,7 @@ break; default: LOGP(DLSUA, LOGL_ERROR, "Unknown CCP Routing Indicator %u" - "requested\n", in->ri); + " requested\n", in->ri); return -EINVAL; } -- To view, visit https://gerrit.osmocom.org/3367 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: If5a56ec170d4e91ce070f6fa9c9cfe5bbc121186 Gerrit-PatchSet: 3 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Aug 9 12:58:59 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 9 Aug 2017 12:58:59 +0000 Subject: [MERGED] libosmo-sccp[master]: add osmo_sccp_addr_name() and three value_string[]s In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: add osmo_sccp_addr_name() and three value_string[]s ...................................................................... add osmo_sccp_addr_name() and three value_string[]s osmo_sccp_addr_dump() just prints the raw values. In osmo_sccp_addr_name(), use osmo_ss7_pointcode_print() and newly added RI, SSN and GT value_string[] to print more human readable log output. Change-Id: Ie1aedd7894acd69ddc887cd65a8a0df4b888838c --- M include/osmocom/sigtran/sccp_sap.h M src/sccp_helpers.c M src/sccp_sap.c 3 files changed, 84 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/include/osmocom/sigtran/sccp_sap.h b/include/osmocom/sigtran/sccp_sap.h index 13b1022..796597f 100644 --- a/include/osmocom/sigtran/sccp_sap.h +++ b/include/osmocom/sigtran/sccp_sap.h @@ -60,6 +60,11 @@ OSMO_SCCP_RI_SSN_IP, }; +extern const struct value_string osmo_sccp_routing_ind_names[]; +static inline const char *osmo_sccp_routing_ind_name(enum osmo_sccp_routing_ind val) +{ return get_value_string(osmo_sccp_routing_ind_names, val); } + + /* Q.713 3.4.1 + RFC 3868 3.10.2.3 */ enum osmo_sccp_gti { OSMO_SCCP_GTI_NO_GT, @@ -68,6 +73,10 @@ OSMO_SCCP_GTI_TT_NPL_ENC, OSMO_SCCP_GTI_TT_NPL_ENC_NAI, }; + +extern const struct value_string osmo_sccp_gti_names[]; +static inline const char *osmo_sccp_gti_name(enum osmo_sccp_gti val) +{ return get_value_string(osmo_sccp_gti_names, val); } /* RFC 3868 3.10.2.3 */ enum osmo_sccp_npi { @@ -126,6 +135,10 @@ OSMO_SCCP_SSN_BSS_OAM = 253, }; +extern const struct value_string osmo_sccp_ssn_names[]; +static inline const char *osmo_sccp_ssn_name(enum osmo_sccp_ssn val) +{ return get_value_string(osmo_sccp_ssn_names, val); } + struct osmo_sccp_gt { uint8_t gti; uint8_t tt; diff --git a/src/sccp_helpers.c b/src/sccp_helpers.c index 2320fe5..471c9cb 100644 --- a/src/sccp_helpers.c +++ b/src/sccp_helpers.c @@ -274,6 +274,7 @@ return buf; } +/* Return string representation of SCCP address raw bytes in a static string. */ char *osmo_sccp_addr_dump(const struct osmo_sccp_addr *addr) { static char buf[256]; @@ -295,3 +296,26 @@ return buf; } + +/* Like osmo_sccp_addr_dump() but print human readable representations instead of raw values. */ +char *osmo_sccp_addr_name(const struct osmo_ss7_instance *ss7, const struct osmo_sccp_addr *addr) +{ + static char buf[256]; + bool comma = false; + + buf[0] = '\0'; + + append_to_buf(buf, &comma, "RI=%s", osmo_sccp_routing_ind_name(addr->ri)); + + if (addr->presence & OSMO_SCCP_ADDR_T_PC) + append_to_buf(buf, &comma, "PC=%s", osmo_ss7_pointcode_print(ss7, addr->pc)); + if (addr->presence & OSMO_SCCP_ADDR_T_SSN) + append_to_buf(buf, &comma, "SSN=%s", osmo_sccp_ssn_name(addr->ssn)); + if (addr->presence & OSMO_SCCP_ADDR_T_IPv4) + append_to_buf(buf, &comma, "IP=%s", inet_ntoa(addr->ip.v4)); + append_to_buf(buf, &comma, "GTI=%s", osmo_sccp_gti_name(addr->gt.gti)); + if (addr->presence & OSMO_SCCP_ADDR_T_GT) + append_to_buf(buf, &comma, "GT=(%s)", osmo_sccp_gt_dump(&addr->gt)); + + return buf; +} diff --git a/src/sccp_sap.c b/src/sccp_sap.c index d4580ae..e5addb1 100644 --- a/src/sccp_sap.c +++ b/src/sccp_sap.c @@ -85,3 +85,50 @@ return prim_name_buf; } + +const struct value_string osmo_sccp_routing_ind_names[] = { + { OSMO_SCCP_RI_NONE, "NONE" }, + { OSMO_SCCP_RI_GT, "GT" }, + { OSMO_SCCP_RI_SSN_PC, "SSN_PC" }, + { OSMO_SCCP_RI_SSN_IP, "SSN_IP" }, + { 0, NULL } +}; + +const struct value_string osmo_sccp_gti_names[] = { + { OSMO_SCCP_GTI_NO_GT, "NO_GT" }, + { OSMO_SCCP_GTI_NAI_ONLY, "NAI_ONLY" }, + { OSMO_SCCP_GTI_TT_ONLY, "TT_ONLY" }, + { OSMO_SCCP_GTI_TT_NPL_ENC, "TT_NPL_ENC" }, + { OSMO_SCCP_GTI_TT_NPL_ENC_NAI, "TT_NPL_ENC_NAI" }, + { 0, NULL } +}; + +const struct value_string osmo_sccp_ssn_names[] = { + { OSMO_SCCP_SSN_MGMT, "MGMT" }, + { OSMO_SCCP_SSN_ISUP, "ISUP" }, + { OSMO_SCCP_SSN_OMAP, "OMAP" }, + { OSMO_SCCP_SSN_MAP, "MAP" }, + { OSMO_SCCP_SSN_HLR, "HLR" }, + { OSMO_SCCP_SSN_VLR, "VLR" }, + { OSMO_SCCP_SSN_MSC, "MSC" }, + { OSMO_SCCP_SSN_EIR, "EIR" }, + { OSMO_SCCP_SSN_AUC, "AUC" }, + { OSMO_SCCP_SSN_ISDN_SS, "ISDN_SS" }, + { OSMO_SCCP_SSN_RES_INTL, "RES_INTL" }, + { OSMO_SCCP_SSN_BISDN, "BISDN" }, + { OSMO_SCCP_SSN_TC_TEST, "TC_TEST" }, + { OSMO_SCCP_SSN_RANAP, "RANAP" }, + { OSMO_SCCP_SSN_RNSAP, "RNSAP" }, + { OSMO_SCCP_SSN_GMLC_MAP, "GMLC_MAP" }, + { OSMO_SCCP_SSN_CAP, "CAP" }, + { OSMO_SCCP_SSN_gsmSCF_MAP, "gsmSCF_MAP" }, + { OSMO_SCCP_SSN_SIWF_MAP, "SIWF_MAP" }, + { OSMO_SCCP_SSN_SGSN_MAP, "SGSN_MAP" }, + { OSMO_SCCP_SSN_GGSN_MAP, "GGSN_MAP" }, + { OSMO_SCCP_SSN_PCAP, "PCAP" }, + { OSMO_SCCP_SSN_BSC_BSSAP, "BSC_BSSAP" }, + { OSMO_SCCP_SSN_MSC_BSSAP, "MSC_BSSAP" }, + { OSMO_SCCP_SSN_SMLC_BSSAP, "SMLC_BSSAP" }, + { OSMO_SCCP_SSN_BSS_OAM, "BSS_OAM" }, + { 0, NULL } +}; -- To view, visit https://gerrit.osmocom.org/3363 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ie1aedd7894acd69ddc887cd65a8a0df4b888838c Gerrit-PatchSet: 4 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Aug 9 12:59:00 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 9 Aug 2017 12:59:00 +0000 Subject: [MERGED] libosmo-sccp[master]: fix osmo_sccp_addr_dump(): actually print RI In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: fix osmo_sccp_addr_dump(): actually print RI ...................................................................... fix osmo_sccp_addr_dump(): actually print RI Adjust xua_test accordingly. Change-Id: I93e0aa706867e7b1de7f7a6071e3c8af89772af0 --- M src/sccp_helpers.c M tests/xua/xua_test.ok 2 files changed, 7 insertions(+), 7 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/sccp_helpers.c b/src/sccp_helpers.c index 471c9cb..db562db 100644 --- a/src/sccp_helpers.c +++ b/src/sccp_helpers.c @@ -282,7 +282,7 @@ buf[0] = '\0'; - append_to_buf(buf, &comma, "RI=7"); + append_to_buf(buf, &comma, "RI=%d", addr->ri); if (addr->presence & OSMO_SCCP_ADDR_T_PC) append_to_buf(buf, &comma, "PC=%u", addr->pc); diff --git a/tests/xua/xua_test.ok b/tests/xua/xua_test.ok index ca8572a..12d817d 100644 --- a/tests/xua/xua_test.ok +++ b/tests/xua/xua_test.ok @@ -1,14 +1,14 @@ digits='01234567' (8) digits='0123456' (7) sccp_addr_parse test case 0 -expected: RI=7,SSN=6,GTI=4,GT=(TT=0,NPL=1,NAI=4,DIG=919969679389) -parsed: RI=7,SSN=6,GTI=4,GT=(TT=0,NPL=1,NAI=4,DIG=919969679389) +expected: RI=1,SSN=6,GTI=4,GT=(TT=0,NPL=1,NAI=4,DIG=919969679389) +parsed: RI=1,SSN=6,GTI=4,GT=(TT=0,NPL=1,NAI=4,DIG=919969679389) sccp_addr_parse test case 1 -expected: RI=7,SSN=8,GTI=4,GT=(TT=0,NPL=1,NAI=4,DIG=919869299992) -parsed: RI=7,SSN=8,GTI=4,GT=(TT=0,NPL=1,NAI=4,DIG=919869299992) +expected: RI=1,SSN=8,GTI=4,GT=(TT=0,NPL=1,NAI=4,DIG=919869299992) +parsed: RI=1,SSN=8,GTI=4,GT=(TT=0,NPL=1,NAI=4,DIG=919869299992) sccp_addr_parse test case 2 -expected: RI=7,SSN=254,GTI=0 -parsed: RI=7,SSN=254,GTI=0 +expected: RI=2,SSN=254,GTI=0 +parsed: RI=2,SSN=254,GTI=0 Testing Decoded GT -> SUA encoding IN: TT=0,NPL=1,NAI=4,DIG=919969679389 0400000001000000040000003931393936393637393338390000000000000000000000000000000000000000 -- To view, visit https://gerrit.osmocom.org/3364 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I93e0aa706867e7b1de7f7a6071e3c8af89772af0 Gerrit-PatchSet: 4 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Aug 9 12:59:00 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 9 Aug 2017 12:59:00 +0000 Subject: [MERGED] libosmo-sccp[master]: introduce OSMO_SCCP_RI_NONE to indicate unset RI In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: introduce OSMO_SCCP_RI_NONE to indicate unset RI ...................................................................... introduce OSMO_SCCP_RI_NONE to indicate unset RI Allows to automatically set an RI in future change I75c67d289693f1c2a049ac61cf2b2097d6e5687d "sccp-addr vty: set RI to SSN_PC when setting a point-code" Change-Id: I6e2f31b023b08cba2f2ee8234e6108efcaca41c0 --- M include/osmocom/sigtran/sccp_sap.h M src/osmo_ss7_vty.c 2 files changed, 6 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/include/osmocom/sigtran/sccp_sap.h b/include/osmocom/sigtran/sccp_sap.h index 90da686..13b1022 100644 --- a/include/osmocom/sigtran/sccp_sap.h +++ b/include/osmocom/sigtran/sccp_sap.h @@ -54,6 +54,7 @@ /* Q.713 3.4.1 + RFC 3868 3.10.2.3 */ enum osmo_sccp_routing_ind { + OSMO_SCCP_RI_NONE, OSMO_SCCP_RI_GT, OSMO_SCCP_RI_SSN_PC, OSMO_SCCP_RI_SSN_IP, diff --git a/src/osmo_ss7_vty.c b/src/osmo_ss7_vty.c index 164b7f2..b70f892 100644 --- a/src/osmo_ss7_vty.c +++ b/src/osmo_ss7_vty.c @@ -1048,6 +1048,11 @@ case OSMO_SCCP_RI_SSN_IP: vty_out(vty, " routing-indicator IP%s", VTY_NEWLINE); break; + case OSMO_SCCP_RI_NONE: + break; + default: + vty_out(vty, " ! invalid routing-indicator value: %u%s", entry->addr.ri, VTY_NEWLINE); + break; } if (entry->addr.presence & OSMO_SCCP_ADDR_T_PC) vty_out(vty, " point-code %s%s", -- To view, visit https://gerrit.osmocom.org/3362 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I6e2f31b023b08cba2f2ee8234e6108efcaca41c0 Gerrit-PatchSet: 3 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Aug 9 12:59:01 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 9 Aug 2017 12:59:01 +0000 Subject: [MERGED] libosmo-sccp[master]: constify ss7_instance arg of osmo_ss7_pointcode_print() In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: constify ss7_instance arg of osmo_ss7_pointcode_print() ...................................................................... constify ss7_instance arg of osmo_ss7_pointcode_print() Change-Id: I8c6b7188d004033e75e9c41f4a65c418d13a79c5 --- M include/osmocom/sigtran/osmo_ss7.h M src/osmo_ss7.c 2 files changed, 5 insertions(+), 5 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/include/osmocom/sigtran/osmo_ss7.h b/include/osmocom/sigtran/osmo_ss7.h index 967912a..a457709 100644 --- a/include/osmocom/sigtran/osmo_ss7.h +++ b/include/osmocom/sigtran/osmo_ss7.h @@ -23,8 +23,8 @@ bool osmo_ss7_pc_is_local(struct osmo_ss7_instance *inst, uint32_t pc); int osmo_ss7_pointcode_parse(struct osmo_ss7_instance *inst, const char *str); int osmo_ss7_pointcode_parse_mask_or_len(struct osmo_ss7_instance *inst, const char *in); -const char *osmo_ss7_pointcode_print(struct osmo_ss7_instance *inst, uint32_t pc); -const char *osmo_ss7_pointcode_print2(struct osmo_ss7_instance *inst, uint32_t pc); +const char *osmo_ss7_pointcode_print(const struct osmo_ss7_instance *inst, uint32_t pc); +const char *osmo_ss7_pointcode_print2(const struct osmo_ss7_instance *inst, uint32_t pc); /* All known point-code formats have a length of or below 24 bit. * A point-code value exceeding that is used to indicate an unset PC. */ diff --git a/src/osmo_ss7.c b/src/osmo_ss7.c index f82f952..7b0b0e4 100644 --- a/src/osmo_ss7.c +++ b/src/osmo_ss7.c @@ -245,7 +245,7 @@ return -EINVAL; } -const char *_osmo_ss7_pointcode_print(char *buf, size_t len, struct osmo_ss7_instance *inst, uint32_t pc) +const char *_osmo_ss7_pointcode_print(char *buf, size_t len, const struct osmo_ss7_instance *inst, uint32_t pc) { const struct osmo_ss7_pc_fmt *pc_fmt; unsigned int num_comp_exp; @@ -269,7 +269,7 @@ /* print a pointcode according to the structure configured for this * ss7_instance */ -const char *osmo_ss7_pointcode_print(struct osmo_ss7_instance *inst, uint32_t pc) +const char *osmo_ss7_pointcode_print(const struct osmo_ss7_instance *inst, uint32_t pc) { static char buf[MAX_PC_STR_LEN]; return _osmo_ss7_pointcode_print(buf, sizeof(buf), inst, pc); @@ -277,7 +277,7 @@ /* same as osmo_ss7_pointcode_print() but using a separate buffer, useful for multiple point codes in the * same LOGP/printf. */ -const char *osmo_ss7_pointcode_print2(struct osmo_ss7_instance *inst, uint32_t pc) +const char *osmo_ss7_pointcode_print2(const struct osmo_ss7_instance *inst, uint32_t pc) { static char buf[MAX_PC_STR_LEN]; return _osmo_ss7_pointcode_print(buf, sizeof(buf), inst, pc); -- To view, visit https://gerrit.osmocom.org/3361 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I8c6b7188d004033e75e9c41f4a65c418d13a79c5 Gerrit-PatchSet: 3 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Aug 9 12:59:09 2017 From: gerrit-no-reply at lists.osmocom.org (Keith Whyte) Date: Wed, 9 Aug 2017 12:59:09 +0000 Subject: openbsc[master]: libmsc: support GSM 03.40 status report for nitb In-Reply-To: References: Message-ID: Patch Set 4: > Patch Set 4: Verified+1 Not sure why I am permitted to Verify this... :-/ -- To view, visit https://gerrit.osmocom.org/3438 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I5cc7bb4ebadde0940f44d10c3df34707b0615160 Gerrit-PatchSet: 4 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Pablo Neira Ayuso Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Keith Whyte Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pablo Neira Ayuso Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Aug 9 12:59:56 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 9 Aug 2017 12:59:56 +0000 Subject: osmo-bts[master]: l1sap/osmo-bts-sysmo: Improve logging In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3038 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I339db0e5f3fd5e44bac974f2447afc80388802af Gerrit-PatchSet: 2 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Aug 9 13:02:43 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 9 Aug 2017 13:02:43 +0000 Subject: osmo-bts[master]: TRX: Remove global variables, move SETBSIC/SETTSC handling i... In-Reply-To: References: Message-ID: Patch Set 4: Code-Review+2 (1 comment) https://gerrit.osmocom.org/#/c/3044/4//COMMIT_MSG Commit Message: PS4, Line 10: transceiver is a property > What is a property? property: https://en.wikipedia.org/wiki/Property_(programming) and no, my original sentence is what I want. "[The question of] whether we are talking to an OpenBTS or OsmoTRX transceiver is a property [...]" -- To view, visit https://gerrit.osmocom.org/3044 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I51aeb17661dfd63ff347f7b2c0d7ffa383ec814c Gerrit-PatchSet: 4 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Vadim Yanitskiy Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Wed Aug 9 13:03:22 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 9 Aug 2017 13:03:22 +0000 Subject: [MERGED] osmo-bts[master]: l1sap/osmo-bts-sysmo: Improve logging In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: l1sap/osmo-bts-sysmo: Improve logging ...................................................................... l1sap/osmo-bts-sysmo: Improve logging Change-Id: I339db0e5f3fd5e44bac974f2447afc80388802af --- M src/common/l1sap.c 1 file changed, 23 insertions(+), 12 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/common/l1sap.c b/src/common/l1sap.c index 97cbac1..21d9dc6 100644 --- a/src/common/l1sap.c +++ b/src/common/l1sap.c @@ -500,12 +500,16 @@ struct bts_ul_meas ulm; struct gsm_lchan *lchan; - DEBUGP(DL1P, "MPH_INFO meas ind chan_nr=0x%02x\n", - info_meas_ind->chan_nr); - lchan = get_active_lchan_by_chan_nr(trx, info_meas_ind->chan_nr); - if (!lchan) + if (!lchan) { + LOGP(DL1P, LOGL_ERROR, "No lchan for MPH INFO MEAS IND (chan_nr=%u)\n", + info_meas_ind->chan_nr); return 0; + } + + DEBUGP(DL1P, "%s MPH_INFO meas ind, ta_offs_qbits=%d, ber10k=%d, inv_rssi=%u\n", + gsm_lchan_name(lchan), info_meas_ind->ta_offs_qbits, + info_meas_ind->ber10k, info_meas_ind->inv_rssi); /* in the GPRS case we are not interested in measurement * processing. The PCU will take care of it */ @@ -727,8 +731,10 @@ memcpy(p, fill_frame, GSM_MACBLOCK_LEN); } else if (!(chan_nr & 0x80)) { /* only TCH/F, TCH/H, SDCCH/4 and SDCCH/8 have C5 bit cleared */ lchan = get_active_lchan_by_chan_nr(trx, chan_nr); - if (!lchan) + if (!lchan) { + LOGP(DL1P, LOGL_ERROR, "No lchan for PH-RTS.ind (chan_nr=%u)\n", chan_nr); return 0; + } if (L1SAP_IS_LINK_SACCH(link_id)) { p = msgb_put(msg, GSM_MACBLOCK_LEN); /* L1-header, if not set/modified by layer 1 */ @@ -779,8 +785,8 @@ memcpy(p, fill_frame, GSM_MACBLOCK_LEN); } - DEBUGP(DL1P, "Tx PH-DATA.req %02u/%02u/%02u chan_nr=%02x link_id=0x%02x\n", - g_time.t1, g_time.t2, g_time.t3, chan_nr, link_id); + DEBUGP(DL1P, "Tx PH-DATA.req %s chan_nr=0x%02x link_id=0x%02x\n", + osmo_dump_gsmtime(&g_time), chan_nr, link_id); l1sap_down(trx, l1sap); @@ -830,8 +836,10 @@ DEBUGP(DL1P, "Rx TCH-RTS.ind %s chan_nr=0x%02x\n", osmo_dump_gsmtime(&g_time), chan_nr); lchan = get_active_lchan_by_chan_nr(trx, chan_nr); - if (!lchan) + if (!lchan) { + LOGP(DL1P, LOGL_ERROR, "No lchan for PH-RTS.ind (chan_nr=%u)\n", chan_nr); return 0; + } if (!lchan->loopback && lchan->abis_ip.rtp_socket) { osmo_rtp_socket_poll(lchan->abis_ip.rtp_socket); @@ -880,8 +888,7 @@ resp_l1sap->u.tch.fn = fn; resp_l1sap->u.tch.marker = marker; - DEBUGP(DL1P, "Tx TCH.req %02u/%02u/%02u chan_nr=0x%02x\n", - g_time.t1, g_time.t2, g_time.t3, chan_nr); + DEBUGP(DL1P, "Tx TCH.req %s chan_nr=0x%02x\n", osmo_dump_gsmtime(&g_time), chan_nr); l1sap_down(trx, resp_l1sap); @@ -1024,8 +1031,10 @@ } lchan = get_active_lchan_by_chan_nr(trx, chan_nr); - if (!lchan) + if (!lchan) { + LOGP(DL1P, LOGL_ERROR, "No lchan for chan_nr=%d\n", chan_nr); return 0; + } /* bad frame */ if (len == 0) { @@ -1091,8 +1100,10 @@ DEBUGP(DL1P, "Rx TCH.ind %s chan_nr=0x%02x\n", osmo_dump_gsmtime(&g_time), chan_nr); lchan = get_active_lchan_by_chan_nr(trx, chan_nr); - if (!lchan) + if (!lchan) { + LOGP(DL1P, LOGL_ERROR, "No lchan for TCH.ind (chan_nr=%u)\n", chan_nr); return 0; + } msgb_pull(msg, sizeof(*l1sap)); -- To view, visit https://gerrit.osmocom.org/3038 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I339db0e5f3fd5e44bac974f2447afc80388802af Gerrit-PatchSet: 3 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Aug 9 13:03:35 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 9 Aug 2017 13:03:35 +0000 Subject: [MERGED] osmo-bts[master]: TRX: Remove global variables, move SETBSIC/SETTSC handling i... In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: TRX: Remove global variables, move SETBSIC/SETTSC handling into phy_link ...................................................................... TRX: Remove global variables, move SETBSIC/SETTSC handling into phy_link Whether or not we are talking to an OpenBTS (SETBSIC) or OsmoTRX (SETTSC) transceiver is a property of the phy_link, and not a property of the BTS. Also, we *really, really* should never use global variables. I'm very happy this is being cleaned up, finally. Change-Id: I51aeb17661dfd63ff347f7b2c0d7ffa383ec814c --- M include/osmo-bts/phy_link.h M src/osmo-bts-trx/trx_if.c M src/osmo-bts-trx/trx_if.h M src/osmo-bts-trx/trx_vty.c 4 files changed, 38 insertions(+), 66 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/include/osmo-bts/phy_link.h b/include/osmo-bts/phy_link.h index 3d4bf91..7011622 100644 --- a/include/osmo-bts/phy_link.h +++ b/include/osmo-bts/phy_link.h @@ -47,6 +47,7 @@ uint32_t clock_advance; uint32_t rts_advance; + bool use_legacy_setbsic; } osmotrx; struct { char *mcast_dev; /* Network device for multicast */ diff --git a/src/osmo-bts-trx/trx_if.c b/src/osmo-bts-trx/trx_if.c index 8ce2893..86a3b9b 100644 --- a/src/osmo-bts-trx/trx_if.c +++ b/src/osmo-bts-trx/trx_if.c @@ -51,8 +51,6 @@ //#define TOA_RSSI_DEBUG int transceiver_available = 0; -int settsc_enabled = 0; -int setbsic_enabled = 0; #define TRX_MAX_BURST_LEN 512 @@ -248,21 +246,21 @@ /*! Send "SETTSC" command to TRX */ int trx_if_cmd_settsc(struct trx_l1h *l1h, uint8_t tsc) { - if (!settsc_enabled) + struct phy_instance *pinst = l1h->phy_inst; + if (pinst->phy_link->u.osmotrx.use_legacy_setbsic) return 0; - /* if TSC is enabled only, the positive response is mandatory */ - return trx_ctrl_cmd(l1h, (setbsic_enabled) ? 0 : 1, "SETTSC", "%d", - tsc); + + return trx_ctrl_cmd(l1h, 1, "SETTSC", "%d", tsc); } /*! Send "SETBSIC" command to TRX */ int trx_if_cmd_setbsic(struct trx_l1h *l1h, uint8_t bsic) { - if (!setbsic_enabled) + struct phy_instance *pinst = l1h->phy_inst; + if (!pinst->phy_link->u.osmotrx.use_legacy_setbsic) return 0; - /* if BSIC is enabled only, the positive response is mandatory */ - return trx_ctrl_cmd(l1h, (settsc_enabled) ? 0 : 1, "SETBSIC", "%d", - bsic); + + return trx_ctrl_cmd(l1h, 1, "SETBSIC", "%d", bsic); } /*! Send "SETRXGAIN" command to TRX */ diff --git a/src/osmo-bts-trx/trx_if.h b/src/osmo-bts-trx/trx_if.h index 86fb18f..076e35e 100644 --- a/src/osmo-bts-trx/trx_if.h +++ b/src/osmo-bts-trx/trx_if.h @@ -2,8 +2,6 @@ #define TRX_IF_H extern int transceiver_available; -extern int settsc_enabled; -extern int setbsic_enabled; struct trx_l1h; diff --git a/src/osmo-bts-trx/trx_vty.c b/src/osmo-bts-trx/trx_vty.c index 6d6cded..482248c 100644 --- a/src/osmo-bts-trx/trx_vty.c +++ b/src/osmo-bts-trx/trx_vty.c @@ -197,51 +197,6 @@ return CMD_SUCCESS; } -DEFUN(cfg_bts_settsc, cfg_bts_settsc_cmd, - "settsc", - "Use SETTSC to configure transceiver\n") -{ - settsc_enabled = 1; - - return CMD_SUCCESS; -} - -DEFUN(cfg_bts_setbsic, cfg_bts_setbsic_cmd, - "setbsic", - "Use SETBSIC to configure transceiver\n") -{ - setbsic_enabled = 1; - - return CMD_SUCCESS; -} - -DEFUN(cfg_bts_no_settsc, cfg_bts_no_settsc_cmd, - "no settsc", - NO_STR "Disable SETTSC to configure transceiver\n") -{ - settsc_enabled = 0; - if (!setbsic_enabled) { - vty_out(vty, "%% Auto enabling SETBSIC.%s", VTY_NEWLINE); - setbsic_enabled = 1; - } - - return CMD_SUCCESS; -} - -DEFUN(cfg_bts_no_setbsic, cfg_bts_no_setbsic_cmd, - "no setbsic", - NO_STR "Disable SETBSIC to configure transceiver\n") -{ - setbsic_enabled = 0; - if (!settsc_enabled) { - vty_out(vty, "%% Auto enabling SETTSC.%s", VTY_NEWLINE); - settsc_enabled = 1; - } - - return CMD_SUCCESS; -} - - DEFUN(cfg_phyinst_maxdly, cfg_phyinst_maxdly_cmd, "osmotrx maxdly <0-31>", "Set the maximum acceptable delay of an Access Burst (in GSM symbols)." @@ -322,7 +277,6 @@ vty_out(vty, "OFF: %d%s", trx_if_cmd_poweroff(l1h), VTY_NEWLINE); else { vty_out(vty, "ON: %d%s", trx_if_cmd_poweron(l1h), VTY_NEWLINE); - settsc_enabled = 1; } return CMD_SUCCESS; @@ -503,6 +457,30 @@ return CMD_SUCCESS; } +DEFUN(cfg_phy_setbsic, cfg_phy_setbsic_cmd, + "osmotrx legacy-setbsic", + "Use SETBSIC to configure transceiver (use ONLY with OpenBTS Transceiver!)\n") +{ + struct phy_link *plink = vty->index; + plink->u.osmotrx.use_legacy_setbsic = true; + + vty_out(vty, "%% You have enabled SETBSIC, which is not supported by OsmoTRX " + "but only useful if you want to interface with legacy OpenBTS Transceivers%s", + VTY_NEWLINE); + + return CMD_SUCCESS; +} + +DEFUN(cfg_phy_no_setbsic, cfg_phy_no_setbsic_cmd, + "no osmotrx legacy-setbsic", + NO_STR "Disable Legacy SETBSIC to configure transceiver\n") +{ + struct phy_link *plink = vty->index; + plink->u.osmotrx.use_legacy_setbsic = false; + + return CMD_SUCCESS; +} + void bts_model_config_write_phy(struct vty *vty, struct phy_link *plink) { if (plink->u.osmotrx.local_ip) @@ -523,6 +501,9 @@ plink->u.osmotrx.clock_advance, VTY_NEWLINE); vty_out(vty, " osmotrx rts-advance %d%s", plink->u.osmotrx.rts_advance, VTY_NEWLINE); + + if (plink->u.osmotrx.use_legacy_setbsic) + vty_out(vty, " osmotrx leyacy-setbsic%s", VTY_NEWLINE); } void bts_model_config_write_phy_inst(struct vty *vty, struct phy_instance *pinst) @@ -565,10 +546,6 @@ vty_out(vty, " no ms-power-loop%s", VTY_NEWLINE); vty_out(vty, " %stiming-advance-loop%s", (trx_ta_loop) ? "":"no ", VTY_NEWLINE); - if (settsc_enabled) - vty_out(vty, " settsc%s", VTY_NEWLINE); - if (setbsic_enabled) - vty_out(vty, " setbsic%s", VTY_NEWLINE); } void bts_model_config_write_trx(struct vty *vty, struct gsm_bts_trx *trx) @@ -586,16 +563,14 @@ install_element(BTS_NODE, &cfg_bts_no_ms_power_loop_cmd); install_element(BTS_NODE, &cfg_bts_timing_advance_loop_cmd); install_element(BTS_NODE, &cfg_bts_no_timing_advance_loop_cmd); - install_element(BTS_NODE, &cfg_bts_settsc_cmd); - install_element(BTS_NODE, &cfg_bts_setbsic_cmd); - install_element(BTS_NODE, &cfg_bts_no_settsc_cmd); - install_element(BTS_NODE, &cfg_bts_no_setbsic_cmd); install_element(PHY_NODE, &cfg_phy_base_port_cmd); install_element(PHY_NODE, &cfg_phy_fn_advance_cmd); install_element(PHY_NODE, &cfg_phy_rts_advance_cmd); install_element(PHY_NODE, &cfg_phy_transc_ip_cmd); install_element(PHY_NODE, &cfg_phy_osmotrx_ip_cmd); + install_element(PHY_NODE, &cfg_phy_setbsic_cmd); + install_element(PHY_NODE, &cfg_phy_no_setbsic_cmd); install_element(PHY_INST_NODE, &cfg_phyinst_rxgain_cmd); install_element(PHY_INST_NODE, &cfg_phyinst_tx_atten_cmd); -- To view, visit https://gerrit.osmocom.org/3044 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I51aeb17661dfd63ff347f7b2c0d7ffa383ec814c Gerrit-PatchSet: 5 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Vadim Yanitskiy From gerrit-no-reply at lists.osmocom.org Wed Aug 9 13:04:01 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 9 Aug 2017 13:04:01 +0000 Subject: osmo-pcu[master]: Add pcu-socket vty config In-Reply-To: References: Message-ID: Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3443 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I9b3e1171da467519750b201849ec892a1e318129 Gerrit-PatchSet: 3 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Aug 9 13:04:04 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 9 Aug 2017 13:04:04 +0000 Subject: [MERGED] osmo-pcu[master]: Add pcu-socket vty config In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Add pcu-socket vty config ...................................................................... Add pcu-socket vty config osmo-bts already supports configuring a different path for the bts<->pcu socket by using the 'pcu-socket' config field. Change-Id: I9b3e1171da467519750b201849ec892a1e318129 --- M include/osmocom/pcu/pcuif_proto.h M src/bts.h M src/osmobts_sock.cpp M src/pcu_main.cpp M src/pcu_vty.c 5 files changed, 30 insertions(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/include/osmocom/pcu/pcuif_proto.h b/include/osmocom/pcu/pcuif_proto.h index 88dc09e..39103ee 100644 --- a/include/osmocom/pcu/pcuif_proto.h +++ b/include/osmocom/pcu/pcuif_proto.h @@ -3,6 +3,8 @@ #include +#define PCU_SOCK_DEFAULT "/tmp/pcu_bts" + #define PCU_IF_VERSION 0x07 #define TXT_MAX_LEN 128 diff --git a/src/bts.h b/src/bts.h index 25193f9..cff0020 100644 --- a/src/bts.h +++ b/src/bts.h @@ -233,6 +233,9 @@ * period. */ struct BTS *bts; + + /* Path to be used for the pcu-bts socket */ + char *pcu_sock_path; }; #ifdef __cplusplus diff --git a/src/osmobts_sock.cpp b/src/osmobts_sock.cpp index d7e55e7..e9b85ab 100644 --- a/src/osmobts_sock.cpp +++ b/src/osmobts_sock.cpp @@ -223,6 +223,7 @@ struct sockaddr_un local; unsigned int namelen; int rc; + struct gprs_rlcmac_bts *bts = bts_main_data(); LOGP(DL1IF, LOGL_INFO, "Opening OsmoPCU L1 interface to OsmoBTS\n"); @@ -244,7 +245,7 @@ } local.sun_family = AF_UNIX; - strncpy(local.sun_path, "/tmp/pcu_bts", sizeof(local.sun_path)); + strncpy(local.sun_path, bts->pcu_sock_path, sizeof(local.sun_path)); local.sun_path[sizeof(local.sun_path) - 1] = '\0'; /* we use the same magic that X11 uses in Xtranssock.c for diff --git a/src/pcu_main.cpp b/src/pcu_main.cpp index b69e446..8e7cde8 100644 --- a/src/pcu_main.cpp +++ b/src/pcu_main.cpp @@ -216,6 +216,8 @@ */ bts->dl_arq_type = EGPRS_ARQ1; + bts->pcu_sock_path = talloc_strdup(tall_pcu_ctx, PCU_SOCK_DEFAULT); + msgb_talloc_ctx_init(tall_pcu_ctx, 0); osmo_init_logging(&gprs_log_info); diff --git a/src/pcu_vty.c b/src/pcu_vty.c index cd22e38..68d2f55 100644 --- a/src/pcu_vty.c +++ b/src/pcu_vty.c @@ -9,6 +9,7 @@ #include #include #include +#include #include "pcu_vty.h" #include "gprs_rlcmac.h" #include "bts.h" @@ -233,6 +234,8 @@ if (bts->dl_tbf_idle_msec) vty_out(vty, " dl-tbf-idle-time %d%s", bts->dl_tbf_idle_msec, VTY_NEWLINE); + if (strcmp(bts->pcu_sock_path, PCU_SOCK_DEFAULT)) + vty_out(vty, " pcu-socket %s%s", bts->pcu_sock_path, VTY_NEWLINE); for (i = 0; i < 32; i++) { unsigned int cs = (1 << i); @@ -966,6 +969,23 @@ return CMD_SUCCESS; } +DEFUN(cfg_pcu_sock, + cfg_pcu_sock_cmd, + "pcu-socket PATH", + "Configure the osmo-bts PCU socket file/path name\n" + "Path of the socket to connect to\n") +{ + struct gprs_rlcmac_bts *bts = bts_main_data(); + + if (bts->pcu_sock_path) { + /* FIXME: close the interface? */ + talloc_free(bts->pcu_sock_path); + } + bts->pcu_sock_path = talloc_strdup(tall_pcu_ctx, argv[0]); + /* FIXME: re-open the interface? */ + + return CMD_SUCCESS; +} DEFUN(show_tbf, show_tbf_cmd, @@ -1096,6 +1116,7 @@ install_element(PCU_NODE, &cfg_pcu_no_ms_idle_time_cmd); install_element(PCU_NODE, &cfg_pcu_gsmtap_categ_cmd); install_element(PCU_NODE, &cfg_pcu_no_gsmtap_categ_cmd); + install_element(PCU_NODE, &cfg_pcu_sock_cmd); install_element_ve(&show_bts_stats_cmd); install_element_ve(&show_tbf_cmd); -- To view, visit https://gerrit.osmocom.org/3443 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I9b3e1171da467519750b201849ec892a1e318129 Gerrit-PatchSet: 3 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Wed Aug 9 13:25:00 2017 From: gerrit-no-reply at lists.osmocom.org (Pablo Neira Ayuso) Date: Wed, 9 Aug 2017 13:25:00 +0000 Subject: openbsc[master]: libmsc: update database to accomodate SMS status-report fields In-Reply-To: References: Message-ID: Patch Set 4: Verified+1 (1 comment) https://gerrit.osmocom.org/#/c/3435/1/openbsc/src/libmsc/db.c File openbsc/src/libmsc/db.c: Line 375: /* Just like v3, but there is a new message reference field for status reports, > "just like v5"? Right, just like v3 actually. -- To view, visit https://gerrit.osmocom.org/3435 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I7276d356d805a83ebeec72b02c8563b7135ea0b6 Gerrit-PatchSet: 4 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Pablo Neira Ayuso Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Keith Whyte Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pablo Neira Ayuso Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Wed Aug 9 13:25:08 2017 From: gerrit-no-reply at lists.osmocom.org (Pablo Neira Ayuso) Date: Wed, 9 Aug 2017 13:25:08 +0000 Subject: [MERGED] openbsc[master]: libmsc: update database to accomodate SMS status-report fields In-Reply-To: References: Message-ID: Pablo Neira Ayuso has submitted this change and it was merged. Change subject: libmsc: update database to accomodate SMS status-report fields ...................................................................... libmsc: update database to accomodate SMS status-report fields SMPP DELIVER_SM messages with esm_class = Delivery Receipt need to send this message reference (that the mobile phone allocates) to the ESME. Thus, the ESME propagates it via SUBMIT_SM with esm_class = Delivery Acknoledgment so that the SMSC sends the GSM 03.40 status-report to the origin including this. Given this field is useful for status-reports, we need to store it in the HLR database. Moreover, we need a new field that specifies if the entry represents a SMS status-report, to do the right handling from the gsm411_send_sms() - such new handling comes in a follow up patch entitled "libmsc: handle delivery ack via SMPP SUBMIT SM / send GSM 03.40 status report". This patch includes the migration routines to the new database schema revision 5, it's quite a bit of dbi boilerplate code - copied-pasted and adapted. Change-Id: I7276d356d805a83ebeec72b02c8563b7135ea0b6 --- M openbsc/src/libmsc/db.c M openbsc/tests/db/db_test.err 2 files changed, 163 insertions(+), 6 deletions(-) Approvals: Harald Welte: Looks good to me, approved Pablo Neira Ayuso: Verified diff --git a/openbsc/src/libmsc/db.c b/openbsc/src/libmsc/db.c index 5fe2a3c..9945dca 100644 --- a/openbsc/src/libmsc/db.c +++ b/openbsc/src/libmsc/db.c @@ -50,7 +50,7 @@ static char *db_dirname = NULL; static dbi_conn conn; -#define SCHEMA_REVISION "4" +#define SCHEMA_REVISION "5" enum { SCHEMA_META, @@ -124,6 +124,8 @@ "valid_until TIMESTAMP, " "reply_path_req INTEGER NOT NULL, " "status_rep_req INTEGER NOT NULL, " + "is_report INTEGER NOT NULL, " + "msg_ref INTEGER NOT NULL, " "protocol_id INTEGER NOT NULL, " "data_coding_scheme INTEGER NOT NULL, " "ud_hdr_ind INTEGER NOT NULL, " @@ -370,6 +372,152 @@ return -EINVAL; } +/* Just like v3, but there is a new message reference field for status reports, + * that is set to zero for existing entries since there is no way we can infer + * this. + */ +static struct gsm_sms *sms_from_result_v4(dbi_result result) +{ + struct gsm_sms *sms = sms_alloc(); + const unsigned char *user_data; + const char *text, *addr; + + if (!sms) + return NULL; + + sms->id = dbi_result_get_ulonglong(result, "id"); + + sms->reply_path_req = dbi_result_get_ulonglong(result, "reply_path_req"); + sms->status_rep_req = dbi_result_get_ulonglong(result, "status_rep_req"); + sms->ud_hdr_ind = dbi_result_get_ulonglong(result, "ud_hdr_ind"); + sms->protocol_id = dbi_result_get_ulonglong(result, "protocol_id"); + sms->data_coding_scheme = dbi_result_get_ulonglong(result, + "data_coding_scheme"); + + addr = dbi_result_get_string(result, "src_addr"); + osmo_strlcpy(sms->src.addr, addr, sizeof(sms->src.addr)); + sms->src.ton = dbi_result_get_ulonglong(result, "src_ton"); + sms->src.npi = dbi_result_get_ulonglong(result, "src_npi"); + + addr = dbi_result_get_string(result, "dest_addr"); + osmo_strlcpy(sms->dst.addr, addr, sizeof(sms->dst.addr)); + sms->dst.ton = dbi_result_get_ulonglong(result, "dest_ton"); + sms->dst.npi = dbi_result_get_ulonglong(result, "dest_npi"); + + sms->user_data_len = dbi_result_get_field_length(result, "user_data"); + user_data = dbi_result_get_binary(result, "user_data"); + if (sms->user_data_len > sizeof(sms->user_data)) + sms->user_data_len = (uint8_t) sizeof(sms->user_data); + memcpy(sms->user_data, user_data, sms->user_data_len); + + text = dbi_result_get_string(result, "text"); + if (text) + osmo_strlcpy(sms->text, text, sizeof(sms->text)); + return sms; +} + +static int update_db_revision_4(void) +{ + dbi_result result; + struct gsm_sms *sms; + + LOGP(DDB, LOGL_NOTICE, "Going to migrate from revision 4\n"); + + result = dbi_conn_query(conn, "BEGIN EXCLUSIVE TRANSACTION"); + if (!result) { + LOGP(DDB, LOGL_ERROR, + "Failed to begin transaction (upgrade from rev 4)\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_4"); + if (!result) { + LOGP(DDB, LOGL_ERROR, + "Failed to rename the old SMS table (upgrade from rev 4).\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 4).\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_4"); + if (!result) { + LOGP(DDB, LOGL_ERROR, + "Failed fetch messages from the old SMS table (upgrade from rev 4).\n"); + goto rollback; + } + while (dbi_result_next_row(result)) { + sms = sms_from_result_v4(result); + if (db_sms_store(sms) != 0) { + LOGP(DDB, LOGL_ERROR, "Failed to store message to the new SMS table(upgrade from rev 4).\n"); + sms_free(sms); + dbi_result_free(result); + goto rollback; + } + sms_free(sms); + } + dbi_result_free(result); + + /* Remove the temporary table */ + result = dbi_conn_query(conn, "DROP TABLE SMS_4"); + if (!result) { + LOGP(DDB, LOGL_ERROR, + "Failed to drop the old SMS table (upgrade from rev 4).\n"); + goto rollback; + } + dbi_result_free(result); + + /* We're done. Bump DB Meta revision to 4 */ + result = dbi_conn_query(conn, + "UPDATE Meta " + "SET value = '5' " + "WHERE key = 'revision'"); + if (!result) { + LOGP(DDB, LOGL_ERROR, + "Failed to update DB schema revision (upgrade from rev 4).\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 4)\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 4).\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 4).\n"); + else + dbi_result_free(result); + return -EINVAL; +} + static int check_db_revision(void) { dbi_result result; @@ -412,6 +560,9 @@ goto error; case 3: if (update_db_revision_3()) + goto error; + case 4: + if (update_db_revision_4()) goto error; /* The end of waterfall */ @@ -1445,20 +1596,23 @@ result = dbi_conn_queryf(conn, "INSERT INTO SMS " "(created, valid_until, " - "reply_path_req, status_rep_req, protocol_id, " - "data_coding_scheme, ud_hdr_ind, " + "reply_path_req, status_rep_req, is_report, " + "msg_ref, protocol_id, data_coding_scheme, " + "ud_hdr_ind, " "user_data, text, " "dest_addr, dest_ton, dest_npi, " "src_addr, src_ton, src_npi) VALUES " "(datetime('now'), %u, " "%u, %u, %u, " - "%u, %u, " + "%u, %u, %u, " + "%u, " "%s, %s, " "%s, %u, %u, " "%s, %u, %u)", validity_timestamp, - sms->reply_path_req, sms->status_rep_req, sms->protocol_id, - sms->data_coding_scheme, sms->ud_hdr_ind, + sms->reply_path_req, sms->status_rep_req, sms->is_report, + sms->msg_ref, sms->protocol_id, sms->data_coding_scheme, + sms->ud_hdr_ind, q_udata, q_text, q_daddr, sms->dst.ton, sms->dst.npi, q_saddr, sms->src.ton, sms->src.npi); @@ -1489,6 +1643,8 @@ /* FIXME: those should all be get_uchar, but sqlite3 is braindead */ sms->reply_path_req = dbi_result_get_ulonglong(result, "reply_path_req"); sms->status_rep_req = dbi_result_get_ulonglong(result, "status_rep_req"); + sms->is_report = dbi_result_get_ulonglong(result, "is_report"); + sms->msg_ref = dbi_result_get_ulonglong(result, "msg_ref"); sms->ud_hdr_ind = dbi_result_get_ulonglong(result, "ud_hdr_ind"); sms->protocol_id = dbi_result_get_ulonglong(result, "protocol_id"); sms->data_coding_scheme = dbi_result_get_ulonglong(result, diff --git a/openbsc/tests/db/db_test.err b/openbsc/tests/db/db_test.err index fa9a54c..27e5703 100644 --- a/openbsc/tests/db/db_test.err +++ b/openbsc/tests/db/db_test.err @@ -1,2 +1,3 @@ Going to migrate from revision 3 +Going to migrate from revision 4  \ No newline at end of file -- To view, visit https://gerrit.osmocom.org/3435 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I7276d356d805a83ebeec72b02c8563b7135ea0b6 Gerrit-PatchSet: 4 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Pablo Neira Ayuso Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Keith Whyte Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pablo Neira Ayuso From gerrit-no-reply at lists.osmocom.org Wed Aug 9 13:25:37 2017 From: gerrit-no-reply at lists.osmocom.org (Pablo Neira Ayuso) Date: Wed, 9 Aug 2017 13:25:37 +0000 Subject: openbsc[master]: utils: smpp_mirror: bounce Delivery Receipts as Delivery Ack... In-Reply-To: References: Message-ID: Patch Set 4: Verified+1 -- To view, visit https://gerrit.osmocom.org/3436 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I877e228d8e174430f700631edbf9955972da7892 Gerrit-PatchSet: 4 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Pablo Neira Ayuso Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Keith Whyte Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pablo Neira Ayuso Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Aug 9 13:25:38 2017 From: gerrit-no-reply at lists.osmocom.org (Pablo Neira Ayuso) Date: Wed, 9 Aug 2017 13:25:38 +0000 Subject: [MERGED] openbsc[master]: utils: smpp_mirror: bounce Delivery Receipts as Delivery Ack... In-Reply-To: References: Message-ID: Pablo Neira Ayuso has submitted this change and it was merged. Change subject: utils: smpp_mirror: bounce Delivery Receipts as Delivery Acknowledgments ...................................................................... utils: smpp_mirror: bounce Delivery Receipts as Delivery Acknowledgments Simple patch to test the new status-report support code, remove previous code before Delivery Acknowledgement support was in place. Use LOGL_DEBUG for logging messages here as suggested by Neels and Harald. Change-Id: I877e228d8e174430f700631edbf9955972da7892 --- M openbsc/src/utils/smpp_mirror.c 1 file changed, 8 insertions(+), 9 deletions(-) Approvals: Harald Welte: Looks good to me, approved Pablo Neira Ayuso: Verified diff --git a/openbsc/src/utils/smpp_mirror.c b/openbsc/src/utils/smpp_mirror.c index 88545de..c570505 100644 --- a/openbsc/src/utils/smpp_mirror.c +++ b/openbsc/src/utils/smpp_mirror.c @@ -123,14 +123,6 @@ PACK_AND_SEND(esme, &deliver_r); - /* This is a delivery receipt, temporarily munch it until we teach - * openbsc what to do with this. - */ - if (deliver.esm_class == 0x04) { - LOGP(DSMPP, LOGL_NOTICE, "%s\n", deliver.short_message); - return 0; - } - memset(&submit, 0, sizeof(submit)); submit.command_id = SUBMIT_SM; submit.command_status = ESME_ROK; @@ -148,7 +140,14 @@ OSMO_MIN(sizeof(submit.source_addr), sizeof(deliver.destination_addr))); - submit.esm_class = deliver.esm_class; + /* Mirror delivery receipts as a delivery acknowledgements. */ + if (deliver.esm_class == 0x04) { + LOGP(DSMPP, LOGL_DEBUG, "%s\n", deliver.short_message); + submit.esm_class = 0x08; + } else { + submit.esm_class = deliver.esm_class; + } + submit.registered_delivery = deliver.registered_delivery; submit.protocol_id = deliver.protocol_id; submit.priority_flag = deliver.priority_flag; -- To view, visit https://gerrit.osmocom.org/3436 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I877e228d8e174430f700631edbf9955972da7892 Gerrit-PatchSet: 4 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Pablo Neira Ayuso Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Keith Whyte Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pablo Neira Ayuso From gerrit-no-reply at lists.osmocom.org Wed Aug 9 13:26:38 2017 From: gerrit-no-reply at lists.osmocom.org (Pablo Neira Ayuso) Date: Wed, 9 Aug 2017 13:26:38 +0000 Subject: openbsc[master]: libmsc: handle delivery ack via SMPP SUBMIT SM / send GSM 03... In-Reply-To: References: Message-ID: Patch Set 4: Verified+1 -- To view, visit https://gerrit.osmocom.org/3437 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ib70e534840308ed315f7add440351e649de3f907 Gerrit-PatchSet: 4 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Pablo Neira Ayuso Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Keith Whyte Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pablo Neira Ayuso Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Aug 9 13:26:41 2017 From: gerrit-no-reply at lists.osmocom.org (Pablo Neira Ayuso) Date: Wed, 9 Aug 2017 13:26:41 +0000 Subject: [MERGED] openbsc[master]: libmsc: handle delivery ack via SMPP SUBMIT SM / send GSM 03... In-Reply-To: References: Message-ID: Pablo Neira Ayuso has submitted this change and it was merged. Change subject: libmsc: handle delivery ack via SMPP SUBMIT SM / send GSM 03.40 status report ...................................................................... libmsc: handle delivery ack via SMPP SUBMIT SM / send GSM 03.40 status report This patch adds gsm340_sms_send_status_report_tpdu() to build a status-report. Moreover, set sms->report field if we see a SMPP SUBMIT_SM with Delivery Acknowledgment esm_class, so this identifies that this is a delivery report. MS GSM 03.40 SMSC SMPP 3.4 ESME | | | | | SUBMIT-SM | | | esm_class = Delivery Ack | | |<-------------------------------| | | SUBMIT-SM-RESP | | |------------------------------->| | | | | SMS-STATUS-REPORT | | |<----------------------------| | | GSM 04.11 RP-ACK | | |---------------------------->| | | | | There is a FIXME message in this patch, that I just copied from gsm340_gen_sms_deliver_tpdu() since TP-MMS is not supported by OpenBSC. Change-Id: Ib70e534840308ed315f7add440351e649de3f907 --- M openbsc/src/libmsc/gsm_04_11.c M openbsc/src/libmsc/smpp_openbsc.c 2 files changed, 54 insertions(+), 2 deletions(-) Approvals: Harald Welte: Looks good to me, approved Pablo Neira Ayuso: Verified diff --git a/openbsc/src/libmsc/gsm_04_11.c b/openbsc/src/libmsc/gsm_04_11.c index 0edbe0b..80c3d77 100644 --- a/openbsc/src/libmsc/gsm_04_11.c +++ b/openbsc/src/libmsc/gsm_04_11.c @@ -277,6 +277,49 @@ return msg->len - old_msg_len; } +/* As defined by GSM 03.40, Section 9.2.2.3. */ +static int gsm340_gen_sms_status_report_tpdu(struct msgb *msg, + struct gsm_sms *sms) +{ + unsigned int old_msg_len = msg->len; + uint8_t oa_len = 0; + uint8_t oa[12]; /* max len per 03.40 */ + uint8_t *smsp; + + /* generate first octet with masked bits */ + smsp = msgb_put(msg, 1); + /* TP-MTI (message type indicator) */ + *smsp = GSM340_SMS_STATUS_REP_SC2MS; + /* TP-MMS (more messages to send) */ + if (0 /* FIXME */) + *smsp |= 0x04; + /* TP-MR (message reference) */ + smsp = msgb_put(msg, 1); + *smsp = sms->msg_ref; + /* generate recipient address */ + oa_len = gsm340_gen_oa_sub(oa, sizeof(oa), &sms->dst); + smsp = msgb_put(msg, oa_len); + memcpy(smsp, oa, oa_len); + + /* generate TP-SCTS (Service centre timestamp) */ + smsp = msgb_put(msg, 7); + gsm340_gen_scts(smsp, time(NULL)); + + /* generate TP-DT (Discharge time, in TP-SCTS format). */ + smsp = msgb_put(msg, 7); + gsm340_gen_scts(smsp, time(NULL)); + + /* TP-ST (status) */ + smsp = msgb_put(msg, 1); + /* 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); + + return msg->len - old_msg_len; +} + static int sms_route_mt_sms(struct gsm_subscriber_connection *conn, struct gsm_sms *gsms) { @@ -989,8 +1032,13 @@ /* obtain a pointer for the rp_ud_len, so we can fill it later */ rp_ud_len = (uint8_t *)msgb_put(msg, 1); - /* generate the 03.40 SMS-DELIVER TPDU */ - rc = gsm340_gen_sms_deliver_tpdu(msg, sms); + if (sms->is_report) { + /* generate the 03.40 SMS-STATUS-REPORT TPDU */ + rc = gsm340_gen_sms_status_report_tpdu(msg, sms); + } else { + /* generate the 03.40 SMS-DELIVER TPDU */ + rc = gsm340_gen_sms_deliver_tpdu(msg, sms); + } if (rc < 0) { send_signal(S_SMS_UNKNOWN_ERROR, trans, sms, 0); sms_free(sms); diff --git a/openbsc/src/libmsc/smpp_openbsc.c b/openbsc/src/libmsc/smpp_openbsc.c index c0aa89b..85de040 100644 --- a/openbsc/src/libmsc/smpp_openbsc.c +++ b/openbsc/src/libmsc/smpp_openbsc.c @@ -143,6 +143,10 @@ osmo_strlcpy(sms->src.addr, (char *)submit->source_addr, sizeof(sms->src.addr)); + /* This is a Delivery Acknowledgment. */ + if (submit->esm_class == 0x08) + sms->is_report = true; + if (submit->esm_class & 0x40) sms->ud_hdr_ind = 1; -- To view, visit https://gerrit.osmocom.org/3437 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ib70e534840308ed315f7add440351e649de3f907 Gerrit-PatchSet: 4 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Pablo Neira Ayuso Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Keith Whyte Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pablo Neira Ayuso From gerrit-no-reply at lists.osmocom.org Wed Aug 9 13:26:45 2017 From: gerrit-no-reply at lists.osmocom.org (Pablo Neira Ayuso) Date: Wed, 9 Aug 2017 13:26:45 +0000 Subject: [MERGED] openbsc[master]: libmsc: support GSM 03.40 status report for nitb In-Reply-To: References: Message-ID: Pablo Neira Ayuso has submitted this change and it was merged. Change subject: libmsc: support GSM 03.40 status report for nitb ...................................................................... libmsc: support GSM 03.40 status report for nitb This patch adds support for GSM 03.40 in nitb mode. MS GSM 03.40 SMSC | | | SMS-SUBMIT | |--------------------------->| | GSM 04.11 RP-ACK | |<---------------------------| | SMS-DELIVER | |<---------------------------| | GSM 04.11 RP-ACK | |--------------------------->| | SMS-STATUS-REPORT | |<---------------------------| | GSM 04.11 RP-ACK | |--------------------------->| | | Change-Id: I5cc7bb4ebadde0940f44d10c3df34707b0615160 --- M openbsc/src/libmsc/gsm_04_11.c 1 file changed, 5 insertions(+), 0 deletions(-) Approvals: Keith Whyte: Verified Harald Welte: Looks good to me, approved diff --git a/openbsc/src/libmsc/gsm_04_11.c b/openbsc/src/libmsc/gsm_04_11.c index 80c3d77..73e0f55 100644 --- a/openbsc/src/libmsc/gsm_04_11.c +++ b/openbsc/src/libmsc/gsm_04_11.c @@ -682,6 +682,11 @@ LOGP(DLSMS, LOGL_ERROR, "Failed to send status report! err=%d\n", rc); } + + /* No route via SMPP, send the GSM 03.40 status-report now. */ + if (gsms->receiver) + gsm340_rx_sms_submit(sms_report); + LOGP(DLSMS, LOGL_NOTICE, "Status report has been sent\n"); sms_free(sms_report); -- To view, visit https://gerrit.osmocom.org/3438 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I5cc7bb4ebadde0940f44d10c3df34707b0615160 Gerrit-PatchSet: 4 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Pablo Neira Ayuso Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Keith Whyte Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pablo Neira Ayuso From gerrit-no-reply at lists.osmocom.org Wed Aug 9 13:31:33 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 9 Aug 2017 13:31:33 +0000 Subject: [PATCH] osmo-iuh[master]: make point codes configurable by SCCP address book 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/3394 to look at the new patch set (#3). make point codes configurable by SCCP address book In the vty config, use the SCCP address book to configure the local and remote SCCP addresses. Add VTY commands to set the remote SCCP addresses by name, derive the ss7 instance from these addresses: cs7 instance 1 point-code 0.23.0 sccp-address msc point-code 0.0.1 sccp-address sgsn point-code 0.0.2 hnbgw iucs remote-addr msc iups remote-addr sgsn Enforce that both IuCS and IuPS use the same ss7 instance. In the future, we may add the feature to use two separate instances. Depends: libosmo-sccp I75c67d289693f1c2a049ac61cf2b2097d6e5687d, Ie1aedd7894acd69ddc887cd65a8a0df4b888838c, I85b46269dbe7909e52873ace3f720f6292a4516c Change-Id: I33a7ba11eb7c2d9a5dc74d10fb0cf04bf664477b --- M include/osmocom/iuh/hnbgw.h M include/osmocom/iuh/hnbgw_cn.h M src/hnbgw.c M src/hnbgw_cn.c M src/hnbgw_rua.c M src/hnbgw_vty.c 6 files changed, 120 insertions(+), 100 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-iuh refs/changes/94/3394/3 diff --git a/include/osmocom/iuh/hnbgw.h b/include/osmocom/iuh/hnbgw.h index db22d97..58bdab4 100644 --- a/include/osmocom/iuh/hnbgw.h +++ b/include/osmocom/iuh/hnbgw.h @@ -116,10 +116,8 @@ /*! The UDP port where we receive multiplexed CS user * plane traffic from HNBs */ uint16_t iuh_cs_mux_port; - const char *iucs_remote_ip; - uint16_t iucs_remote_port; - const char *iups_remote_ip; - uint16_t iups_remote_port; + const char *iucs_remote_addr_name; + const char *iups_remote_addr_name; uint16_t rnc_id; bool hnbap_allow_tmsi; } config; @@ -134,11 +132,11 @@ /* currently active CN links for CS and PS */ struct { - struct osmo_sccp_instance *instance; + struct osmo_sccp_instance *client; struct hnbgw_cnlink *cnlink; struct osmo_sccp_addr local_addr; - struct osmo_sccp_addr remote_addr_cs; - struct osmo_sccp_addr remote_addr_ps; + struct osmo_sccp_addr iucs_remote_addr; + struct osmo_sccp_addr iups_remote_addr; } sccp; }; diff --git a/include/osmocom/iuh/hnbgw_cn.h b/include/osmocom/iuh/hnbgw_cn.h index 93123f2..2e61d82 100644 --- a/include/osmocom/iuh/hnbgw_cn.h +++ b/include/osmocom/iuh/hnbgw_cn.h @@ -2,5 +2,4 @@ #include -int hnbgw_cnlink_init(struct hnb_gw *gw, const char *stp_host, uint16_t stp_port, - const char *local_ip, uint32_t local_pc); +int hnbgw_cnlink_init(struct hnb_gw *gw, const char *stp_host, uint16_t stp_port, const char *local_ip); diff --git a/src/hnbgw.c b/src/hnbgw.c index 5d9f87b..c9fdd53 100644 --- a/src/hnbgw.c +++ b/src/hnbgw.c @@ -79,14 +79,6 @@ gw->config.iuh_local_ip = talloc_strdup(gw, HNBGW_LOCAL_IP_DEFAULT); gw->config.iuh_local_port = IUH_DEFAULT_SCTP_PORT; - gw->config.iucs_remote_ip = talloc_strdup(gw, - HNBGW_IUCS_REMOTE_IP_DEFAULT); - gw->config.iucs_remote_port = M3UA_PORT; - - gw->config.iups_remote_ip = talloc_strdup(gw, - HNBGW_IUPS_REMOTE_IP_DEFAULT); - gw->config.iups_remote_port = M3UA_PORT; - gw->next_ue_ctx_id = 23; INIT_LLIST_HEAD(&gw->hnb_list); INIT_LLIST_HEAD(&gw->ue_list); @@ -465,6 +457,7 @@ vty_info.copyright = osmo_hnbgw_copyright; vty_init(&vty_info); + osmo_ss7_vty_init_asp(tall_hnb_ctx); hnbgw_vty_init(g_hnb_gw, tall_hnb_ctx); logging_vty_add_cmds(&hnbgw_log_info); @@ -501,23 +494,12 @@ ranap_set_log_area(DRANAP); - OSMO_ASSERT(g_hnb_gw->config.iucs_remote_ip); rc = hnbgw_cnlink_init(g_hnb_gw, - g_hnb_gw->config.iucs_remote_ip, - g_hnb_gw->config.iucs_remote_port, - "127.0.0.5" /* FIXME: configurable */, - 23 /* FIXME: configurable */); + "127.0.0.1", M3UA_PORT, "127.0.0.5" /* FIXME: configurable */); if (rc < 0) { LOGP(DMAIN, LOGL_ERROR, "Failed to initialize SCCP link to CN\n"); exit(1); } - - osmo_sccp_make_addr_pc_ssn(&g_hnb_gw->sccp.remote_addr_cs, - 1 /* FIXME: configurable */, - OSMO_SCCP_SSN_RANAP); - osmo_sccp_make_addr_pc_ssn(&g_hnb_gw->sccp.remote_addr_ps, - 2 /* FIXME: configurable */, - OSMO_SCCP_SSN_RANAP); OSMO_ASSERT(g_hnb_gw->config.iuh_local_ip); LOGP(DMAIN, LOGL_NOTICE, "Listening for Iuh at %s %d\n", diff --git a/src/hnbgw_cn.c b/src/hnbgw_cn.c index e967260..4aa3422 100644 --- a/src/hnbgw_cn.c +++ b/src/hnbgw_cn.c @@ -63,8 +63,8 @@ { struct hnb_gw *gw = data; - transmit_rst(gw, RANAP_CN_DomainIndicator_cs_domain, &gw->sccp.remote_addr_cs); - transmit_rst(gw, RANAP_CN_DomainIndicator_ps_domain, &gw->sccp.remote_addr_ps); + transmit_rst(gw, RANAP_CN_DomainIndicator_cs_domain, &gw->sccp.iucs_remote_addr); + transmit_rst(gw, RANAP_CN_DomainIndicator_ps_domain, &gw->sccp.iups_remote_addr); hnbgw_cnlink_change_state(gw->sccp.cnlink, CNLINK_S_EST_RST_TX_WAIT_ACK); /* The spec states that we should abandon after a configurable * number of times. We decide to simply continue trying */ @@ -251,12 +251,12 @@ const struct osmo_sccp_addr *cn_remote_addr, bool *is_ps) { - if (pc_and_ssn_match(cn_remote_addr, &gw->sccp.remote_addr_cs)) { + if (pc_and_ssn_match(cn_remote_addr, &gw->sccp.iucs_remote_addr)) { if (is_ps) *is_ps = false; return 0; } - if (pc_and_ssn_match(cn_remote_addr, &gw->sccp.remote_addr_ps)) { + if (pc_and_ssn_match(cn_remote_addr, &gw->sccp.iups_remote_addr)) { if (is_ps) *is_ps = true; return 0; @@ -401,27 +401,90 @@ return 0; } -int hnbgw_cnlink_init(struct hnb_gw *gw, const char *stp_host, uint16_t stp_port, - const char *local_ip, uint32_t local_pc) +static bool addr_has_pc_and_ssn(const struct osmo_sccp_addr *addr) { - struct hnbgw_cnlink *cnlink; - int rc; + if (!(addr->presence & OSMO_SCCP_ADDR_T_SSN)) + return false; + if (!(addr->presence & OSMO_SCCP_ADDR_T_PC)) + return false; + return true; +} - OSMO_ASSERT(!gw->sccp.instance); - OSMO_ASSERT(!gw->sccp.cnlink); +static int resolve_addr_name(struct osmo_sccp_addr *dest, struct osmo_ss7_instance **ss7, + const char *addr_name, const char *label) +{ + struct osmo_ss7_instance *ss7_tmp; - gw->sccp.instance = osmo_sccp_simple_client(gw, "OsmoHNBGW", local_pc, - OSMO_SS7_ASP_PROT_M3UA, 0, local_ip, - stp_port, stp_host); - if (!gw->sccp.instance) { - LOGP(DMAIN, LOGL_ERROR, "Failed to init SCCP Instance\n"); + if (!addr_name) { + LOGP(DMAIN, LOGL_ERROR, "Missing config: %s remote-addr\n", label); return -1; } - LOGP(DRUA, LOGL_DEBUG, "SCCP uplink to STP: %s %u\n", stp_host, stp_port); + ss7_tmp = osmo_sccp_addr_by_name(dest, addr_name); + if (!ss7_tmp) { + LOGP(DMAIN, LOGL_ERROR, "%s remote addr: no such SCCP address book entry: '%s'\n", + label, addr_name); + return -1; + } - osmo_sccp_make_addr_pc_ssn(&gw->sccp.local_addr, local_pc, - OSMO_SCCP_SSN_RANAP); + if (*ss7 && (*ss7 != ss7_tmp)) { + LOGP(DMAIN, LOGL_ERROR, "IuCS and IuPS cannot be served from separate CS7 instances," + " cs7 instance %d != %d\n", (*ss7)->cfg.id, ss7_tmp->cfg.id); + return -1; + } + + *ss7 = ss7_tmp; + + osmo_sccp_addr_set_ssn(dest, OSMO_SCCP_SSN_RANAP); + + if (!addr_has_pc_and_ssn(dest)) { + LOGP(DMAIN, LOGL_ERROR, "Invalid/incomplete %s remote-addr: %s\n", + label, osmo_sccp_addr_name(dest)); + return -1; + } + + LOGP(DRANAP, LOGL_NOTICE, "Remote %s SCCP addr: %s\n", + label, osmo_sccp_addr_name(*ss7, dest)); + return 0; +} + +int hnbgw_cnlink_init(struct hnb_gw *gw, const char *stp_host, uint16_t stp_port, const char *local_ip) +{ + struct hnbgw_cnlink *cnlink; + struct osmo_ss7_instance *ss7; + uint32_t local_pc; + int rc; + + OSMO_ASSERT(!gw->sccp.client); + OSMO_ASSERT(!gw->sccp.cnlink); + + ss7 = NULL; + if (resolve_addr_name(&gw->sccp.iucs_remote_addr, &ss7, + gw->config.iucs_remote_addr_name, "IuCS")) + return -1; + if (resolve_addr_name(&gw->sccp.iups_remote_addr, &ss7, + gw->config.iups_remote_addr_name, "IuPS")) + return -1; + + if (!osmo_ss7_pc_is_valid(ss7->cfg.primary_pc)) { + LOGP(DMAIN, LOGL_ERROR, "IuCS/IuPS uplink cannot be setup: CS7 instance %d has no point-code set\n", + ss7->cfg.id); + return -1; + } + local_pc = ss7->cfg.primary_pc; + + osmo_sccp_make_addr_pc_ssn(&gw->sccp.local_addr, local_pc, OSMO_SCCP_SSN_RANAP); + + LOGP(DRANAP, LOGL_NOTICE, "M3UA uplink to STP: %s %u\n", stp_host, stp_port); + LOGP(DRANAP, LOGL_NOTICE, "Local SCCP addr: %s\n", osmo_sccp_addr_name(ss7, &gw->sccp.local_addr)); + + gw->sccp.client = osmo_sccp_simple_client_on_ss7_id(gw, ss7->cfg.id, "OsmoHNBGW", + local_pc, OSMO_SS7_ASP_PROT_M3UA, + 0, local_ip, stp_port, stp_host); + if (!gw->sccp.client) { + LOGP(DMAIN, LOGL_ERROR, "Failed to init SCCP Client\n"); + return -1; + } cnlink = talloc_zero(gw, struct hnbgw_cnlink); cnlink->gw = gw; @@ -430,10 +493,8 @@ cnlink->T_RafC.data = gw; cnlink->next_conn_id = 1000; - cnlink->sccp_user = osmo_sccp_user_bind_pc(gw->sccp.instance, - "OsmoHNBGW", - sccp_sap_up, OSMO_SCCP_SSN_RANAP, - gw->sccp.local_addr.pc); + cnlink->sccp_user = osmo_sccp_user_bind_pc(gw->sccp.client, "OsmoHNBGW", sccp_sap_up, + OSMO_SCCP_SSN_RANAP, gw->sccp.local_addr.pc); if (!cnlink->sccp_user) { LOGP(DMAIN, LOGL_ERROR, "Failed to init SCCP User\n"); return -1; diff --git a/src/hnbgw_rua.c b/src/hnbgw_rua.c index b610437..95979f5 100644 --- a/src/hnbgw_rua.c +++ b/src/hnbgw_rua.c @@ -188,11 +188,11 @@ switch (cN_DomainIndicator) { case RUA_CN_DomainIndicator_cs_domain: - remote_addr = &hnb->gw->sccp.remote_addr_cs; + remote_addr = &hnb->gw->sccp.iucs_remote_addr; is_ps = false; break; case RUA_CN_DomainIndicator_ps_domain: - remote_addr = &hnb->gw->sccp.remote_addr_ps; + remote_addr = &hnb->gw->sccp.iups_remote_addr; is_ps = true; break; default: diff --git a/src/hnbgw_vty.c b/src/hnbgw_vty.c index 59871da..ddea578 100644 --- a/src/hnbgw_vty.c +++ b/src/hnbgw_vty.c @@ -90,7 +90,6 @@ vty->node = HNBGW_NODE; vty->index = NULL; break; - default: case HNBGW_NODE: vty->node = CONFIG_NODE; vty->index = NULL; @@ -98,6 +97,9 @@ case CONFIG_NODE: vty->node = ENABLE_NODE; vty->index = NULL; + break; + default: + osmo_ss7_vty_go_parent(vty); break; } @@ -182,37 +184,23 @@ return CMD_SUCCESS; } -DEFUN(cfg_hnbgw_iucs_remote_ip, cfg_hnbgw_iucs_remote_ip_cmd, "remote-ip A.B.C.D", - "Address to establish IuCS core network link to\n" - "Remote IuCS IP address (default: " HNBGW_IUCS_REMOTE_IP_DEFAULT ")") +DEFUN(cfg_hnbgw_iucs_remote_addr, + cfg_hnbgw_iucs_remote_addr_cmd, + "remote-addr NAME", + "SCCP address to send IuCS to (MSC)\n" + "SCCP address book entry name (see 'cs7-instance')\n") { - talloc_free((void*)g_hnb_gw->config.iucs_remote_ip); - g_hnb_gw->config.iucs_remote_ip = talloc_strdup(tall_hnb_ctx, argv[0]); + g_hnb_gw->config.iucs_remote_addr_name = talloc_strdup(g_hnb_gw, argv[0]); return CMD_SUCCESS; } -DEFUN(cfg_hnbgw_iucs_remote_port, cfg_hnbgw_iucs_remote_port_cmd, "remote-port <1-65535>", - "Remote port to establish IuCS core network link to\n" - "Remote IuCS port (default: 14001)") +DEFUN(cfg_hnbgw_iups_remote_addr, + cfg_hnbgw_iups_remote_addr_cmd, + "remote-addr NAME", + "SCCP address to send IuPS to (SGSN)\n" + "SCCP address book entry name (see 'cs7-instance')\n") { - g_hnb_gw->config.iucs_remote_port = atoi(argv[0]); - return CMD_SUCCESS; -} - -DEFUN(cfg_hnbgw_iups_remote_ip, cfg_hnbgw_iups_remote_ip_cmd, "remote-ip A.B.C.D", - "Address to establish IuPS core network link to\n" - "Remote IuPS IP address (default: " HNBGW_IUPS_REMOTE_IP_DEFAULT ")") -{ - talloc_free((void*)g_hnb_gw->config.iups_remote_ip); - g_hnb_gw->config.iups_remote_ip = talloc_strdup(tall_hnb_ctx, argv[0]); - return CMD_SUCCESS; -} - -DEFUN(cfg_hnbgw_iups_remote_port, cfg_hnbgw_iups_remote_port_cmd, "remote-port <1-65535>", - "Remote port to establish IuPS core network link to\n" - "Remote IuPS port (default: 14001)") -{ - g_hnb_gw->config.iups_remote_port = atoi(argv[0]); + g_hnb_gw->config.iups_remote_addr_name = talloc_strdup(g_hnb_gw, argv[0]); return CMD_SUCCESS; } @@ -248,15 +236,12 @@ const char *addr; uint16_t port; + if (!g_hnb_gw->config.iucs_remote_addr_name) + return CMD_SUCCESS; + vty_out(vty, " iucs%s", VTY_NEWLINE); - - addr = g_hnb_gw->config.iucs_remote_ip; - if (addr && (strcmp(addr, HNBGW_IUCS_REMOTE_IP_DEFAULT) != 0)) - vty_out(vty, " remote-ip %s%s", addr, VTY_NEWLINE); - - port = g_hnb_gw->config.iucs_remote_port; - if (port && port != SUA_PORT) - vty_out(vty, " remote-port %u%s", port, VTY_NEWLINE); + vty_out(vty, " remote-addr %s%s", g_hnb_gw->config.iucs_remote_addr_name, + VTY_NEWLINE); return CMD_SUCCESS; } @@ -266,15 +251,12 @@ const char *addr; uint16_t port; + if (!g_hnb_gw->config.iups_remote_addr_name) + return CMD_SUCCESS; + vty_out(vty, " iups%s", VTY_NEWLINE); - - addr = g_hnb_gw->config.iups_remote_ip; - if (addr && (strcmp(addr, HNBGW_IUPS_REMOTE_IP_DEFAULT) != 0)) - vty_out(vty, " remote-ip %s%s", addr, VTY_NEWLINE); - - port = g_hnb_gw->config.iups_remote_port; - if (port && port != SUA_PORT) - vty_out(vty, " remote-port %u%s", port, VTY_NEWLINE); + vty_out(vty, " remote-addr %s%s", g_hnb_gw->config.iups_remote_addr_name, + VTY_NEWLINE); return CMD_SUCCESS; } @@ -300,15 +282,13 @@ install_node(&iucs_node, config_write_hnbgw_iucs); vty_install_default(IUCS_NODE); - install_element(IUCS_NODE, &cfg_hnbgw_iucs_remote_ip_cmd); - install_element(IUCS_NODE, &cfg_hnbgw_iucs_remote_port_cmd); + install_element(IUCS_NODE, &cfg_hnbgw_iucs_remote_addr_cmd); install_element(HNBGW_NODE, &cfg_hnbgw_iups_cmd); install_node(&iups_node, config_write_hnbgw_iups); vty_install_default(IUPS_NODE); - install_element(IUPS_NODE, &cfg_hnbgw_iups_remote_ip_cmd); - install_element(IUPS_NODE, &cfg_hnbgw_iups_remote_port_cmd); + install_element(IUPS_NODE, &cfg_hnbgw_iups_remote_addr_cmd); install_element_ve(&show_hnb_cmd); install_element_ve(&show_ue_cmd); -- To view, visit https://gerrit.osmocom.org/3394 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I33a7ba11eb7c2d9a5dc74d10fb0cf04bf664477b Gerrit-PatchSet: 3 Gerrit-Project: osmo-iuh Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Aug 9 13:32:34 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 9 Aug 2017 13:32:34 +0000 Subject: [ABANDON] osmo-iuh[master]: apply ctx arg to osmo_ss7_vty_init_asp() In-Reply-To: References: Message-ID: Neels Hofmeyr has abandoned this change. Change subject: apply ctx arg to osmo_ss7_vty_init_asp() ...................................................................... Abandoned now part of 'make point codes configurable by SCCP address book' https://gerrit.osmocom.org/3394 -- To view, visit https://gerrit.osmocom.org/3369 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: abandon Gerrit-Change-Id: Idccbdc669d740179153d0a73096745785bd2f5af Gerrit-PatchSet: 3 Gerrit-Project: osmo-iuh Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Aug 9 17:01:32 2017 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Wed, 9 Aug 2017 17:01:32 +0000 Subject: [PATCH] libosmo-sccp[master]: sccp: fix creating of the default route in simple client Message-ID: Review at https://gerrit.osmocom.org/3452 sccp: fix creating of the default route in simple client The simple client (osmo_sccp_simple_client_on_ss7_id() and osmo_sccp_simple_client) does not create a default route if the user has already created an AS via VTY. Check the presence of a default route independently of the AS. If no default route exists, create one. Change-Id: I7516fa5509bade4ba10e9d8eaa3e46cfe3696b3a --- M src/sccp_user.c 1 file changed, 7 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-sccp refs/changes/52/3452/1 diff --git a/src/sccp_user.c b/src/sccp_user.c index 1414572..1d59d3c 100644 --- a/src/sccp_user.c +++ b/src/sccp_user.c @@ -368,16 +368,20 @@ goto out_ss7; } as->cfg.routing_key.pc = ss7->cfg.primary_pc; + } + LOGP(DLSCCP, LOGL_NOTICE, "%s: Using AS instance %s\n", name, + as->cfg.name); - /* install default route */ + /* Create a default route if necessary */ + rt = osmo_ss7_route_find_dpc_mask(ss7->rtable_system, 0, 0); + if (!rt) { + LOGP(DLSCCP, LOGL_NOTICE, "%s: Creating default route\n", name); rt = osmo_ss7_route_create(ss7->rtable_system, 0, 0, as->cfg.name); if (!rt) goto out_as; rt_created = true; } - LOGP(DLSCCP, LOGL_NOTICE, "%s: Using AS instance %s\n", name, - as->cfg.name); /* Check if we do already have an application server process * that is associated with the application server we have choosen -- To view, visit https://gerrit.osmocom.org/3452 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I7516fa5509bade4ba10e9d8eaa3e46cfe3696b3a Gerrit-PatchSet: 1 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: dexter From gerrit-no-reply at lists.osmocom.org Wed Aug 9 17:01:33 2017 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Wed, 9 Aug 2017 17:01:33 +0000 Subject: [PATCH] libosmo-sccp[master]: vty: hide SG commands when running as ASP Message-ID: Review at https://gerrit.osmocom.org/3453 vty: hide SG commands when running as ASP The SG (signal gateway) requires an extra set of VTY commands in order to be fully configurable. These VTY commands do not make sense in a situation where libosmo-sccp is used to implement an ASP (application server process). Detect in which role libosmo-sccp is used by which of the VTY initalization functions are called: osmo_ss7_vty_init_asp() ==> ASP osmo_ss7_vty_init_sg() ==> SG Prevent writing back of SG specific configuration when in running as ASP. Only write back the full parameter set when running as SG. Change-Id: I707bcd790f4c6d0f618e41163b51d2179ea3aeaf --- M src/osmo_ss7_vty.c 1 file changed, 13 insertions(+), 5 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-sccp refs/changes/53/3453/1 diff --git a/src/osmo_ss7_vty.c b/src/osmo_ss7_vty.c index 21efcae..9343edd 100644 --- a/src/osmo_ss7_vty.c +++ b/src/osmo_ss7_vty.c @@ -50,6 +50,8 @@ * Core CS7 Configuration ***********************************************************************/ +enum cs7_role_t {CS7_ROLE_SG, CS7_ROLE_ASP}; +static enum cs7_role_t cs7_role; static void *g_ctx; static struct cmd_node cs7_node = { @@ -1559,12 +1561,16 @@ llist_for_each_entry(as, &inst->as_list, list) write_one_as(vty, as); - /* now dump routes, as their target ASs exist */ - llist_for_each_entry(rtable, &inst->rtable_list, list) - write_one_rtable(vty, rtable); + /* now dump everything that is relevent for the SG role */ + if (cs7_role == CS7_ROLE_SG) { - llist_for_each_entry(oxs, &inst->xua_servers, list) - write_one_xua(vty, oxs); + /* dump routes, as their target ASs exist */ + llist_for_each_entry(rtable, &inst->rtable_list, list) + write_one_rtable(vty, rtable); + + llist_for_each_entry(oxs, &inst->xua_servers, list) + write_one_xua(vty, oxs); + } /* Append SCCP Addressbook */ write_sccp_addressbook(vty, inst); @@ -1717,11 +1723,13 @@ void osmo_ss7_vty_init_asp(void *ctx) { + cs7_role = CS7_ROLE_ASP; vty_init_shared(ctx); } void osmo_ss7_vty_init_sg(void *ctx) { + cs7_role = CS7_ROLE_SG; vty_init_shared(ctx); install_node(&rtable_node, NULL); -- To view, visit https://gerrit.osmocom.org/3453 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I707bcd790f4c6d0f618e41163b51d2179ea3aeaf Gerrit-PatchSet: 1 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: dexter From gerrit-no-reply at lists.osmocom.org Wed Aug 9 17:02:30 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 9 Aug 2017 17:02:30 +0000 Subject: [PATCH] libosmocore[master]: Add osmo_gprs_{ul, dl}_block_size_{bits, bytes} functions Message-ID: Review at https://gerrit.osmocom.org/3454 Add osmo_gprs_{ul,dl}_block_size_{bits,bytes} functions Those functions can be used to look up the size of (E)GPRS blocks. Change-Id: I05ff75ef7dfae639886bbd09fe35f03a8af9d988 --- M include/osmocom/gprs/gprs_rlc.h M src/gsm/gprs_rlc.c M src/gsm/libosmogsm.map 3 files changed, 121 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/54/3454/1 diff --git a/include/osmocom/gprs/gprs_rlc.h b/include/osmocom/gprs/gprs_rlc.h index 05d3de6..b74f9e4 100644 --- a/include/osmocom/gprs/gprs_rlc.h +++ b/include/osmocom/gprs/gprs_rlc.h @@ -26,4 +26,29 @@ EGPRS_HDR_TYPE3, }; +enum osmo_gprs_cs { + OSMO_GPRS_CS_NONE, + OSMO_GPRS_CS1, + OSMO_GPRS_CS2, + OSMO_GPRS_CS3, + OSMO_GPRS_CS4, + OSMO_GPRS_MCS1, + OSMO_GPRS_MCS2, + OSMO_GPRS_MCS3, + OSMO_GPRS_MCS4, + OSMO_GPRS_MCS5, + OSMO_GPRS_MCS6, + OSMO_GPRS_MCS7, + OSMO_GPRS_MCS8, + OSMO_GPRS_MCS9, + _NUM_OSMO_GPRS_CS +}; + int egprs_get_cps(struct egprs_cps *cps, uint8_t type, uint8_t bits); + +int osmo_gprs_ul_block_size_bits(enum osmo_gprs_cs cs); +int osmo_gprs_dl_block_size_bits(enum osmo_gprs_cs cs); +int osmo_gprs_ul_block_size_bytes(enum osmo_gprs_cs cs); +int osmo_gprs_dl_block_size_bytes(enum osmo_gprs_cs cs); +enum osmo_gprs_cs osmo_gprs_ul_cs_by_block_bytes(uint8_t block_size); +enum osmo_gprs_cs osmo_gprs_dl_cs_by_block_bytes(uint8_t block_size); diff --git a/src/gsm/gprs_rlc.c b/src/gsm/gprs_rlc.c index b213b26..d2c05b7 100644 --- a/src/gsm/gprs_rlc.c +++ b/src/gsm/gprs_rlc.c @@ -5,6 +5,7 @@ #include #include +#include #include #include #include @@ -109,3 +110,92 @@ return 0; } + +struct gprs_cs_desc { + struct { + uint8_t bytes; + uint8_t bits; + } uplink, downlink; +}; + +const struct gprs_cs_desc gprs_cs_desc[_NUM_OSMO_GPRS_CS] = { + [OSMO_GPRS_CS1] = { {23, 0}, {23, 0} }, + [OSMO_GPRS_CS2] = { {33, 7}, {33, 7} }, + [OSMO_GPRS_CS3] = { {39, 3}, {39, 3} }, + [OSMO_GPRS_CS4] = { {53, 7}, {53, 7} }, + + [OSMO_GPRS_MCS1] = { {26, 1}, {26, 1} }, + [OSMO_GPRS_MCS2] = { {32, 1}, {32, 1} }, + [OSMO_GPRS_MCS3] = { {41, 1}, {41, 1} }, + [OSMO_GPRS_MCS4] = { {48, 1}, {48, 1} }, + + [OSMO_GPRS_MCS5] = { {60, 7}, {59, 6} }, + [OSMO_GPRS_MCS6] = { {78, 7}, {77, 6} }, + [OSMO_GPRS_MCS7] = { {118, 2}, {117, 4} }, + [OSMO_GPRS_MCS8] = { {142, 2}, {141, 4} }, + [OSMO_GPRS_MCS9] = { {154, 2}, {153, 4} }, +}; + +/*! Return size of (E)GPRS uplink block for given coding scheme in bits */ +int osmo_gprs_ul_block_size_bits(enum osmo_gprs_cs cs) +{ + if (cs >= ARRAY_SIZE(gprs_cs_desc)) + return -EINVAL; + return gprs_cs_desc[cs].uplink.bytes * 8 + gprs_cs_desc[cs].uplink.bits; +} + +/*! Return size of (E)GPRS downlink block for given coding scheme in bits */ +int osmo_gprs_dl_block_size_bits(enum osmo_gprs_cs cs) +{ + if (cs >= ARRAY_SIZE(gprs_cs_desc)) + return -EINVAL; + return gprs_cs_desc[cs].downlink.bytes * 8 + gprs_cs_desc[cs].downlink.bits; +} + +/*! Return size of (E)GPRS uplink block for given coding scheme in bytes */ +int osmo_gprs_ul_block_size_bytes(enum osmo_gprs_cs cs) +{ + int rc; + if (cs >= ARRAY_SIZE(gprs_cs_desc)) + return -EINVAL; + rc = gprs_cs_desc[cs].uplink.bytes; + if (gprs_cs_desc[cs].uplink.bits) + rc++; + return rc; +} + +/*! Return size of (E)GPRS downlink block for given coding scheme in bytes */ +int osmo_gprs_dl_block_size_bytes(enum osmo_gprs_cs cs) +{ + int rc; + if (cs >= ARRAY_SIZE(gprs_cs_desc)) + return -EINVAL; + rc = gprs_cs_desc[cs].downlink.bytes; + if (gprs_cs_desc[cs].downlink.bits) + rc++; + return rc; +} + +/*! Return coding scheme for given (E)GPRS uplink block size */ +enum osmo_gprs_cs osmo_gprs_ul_cs_by_block_bytes(uint8_t block_size) +{ + unsigned int i; + + for (i = 0; i < ARRAY_SIZE(gprs_cs_desc); i++) { + if (block_size == osmo_gprs_ul_block_size_bytes(i)) + return i; + } + return OSMO_GPRS_CS_NONE; +} + +/*! Return coding scheme for given (E)GPRS downlink block size */ +enum osmo_gprs_cs osmo_gprs_dl_cs_by_block_bytes(uint8_t block_size) +{ + unsigned int i; + + for (i = 0; i < ARRAY_SIZE(gprs_cs_desc); i++) { + if (block_size == osmo_gprs_dl_block_size_bytes(i)) + return i; + } + return OSMO_GPRS_CS_NONE; +} diff --git a/src/gsm/libosmogsm.map b/src/gsm/libosmogsm.map index 714cb25..066f410 100644 --- a/src/gsm/libosmogsm.map +++ b/src/gsm/libosmogsm.map @@ -65,6 +65,12 @@ gprs_msgt_gmm_names; egprs_get_cps; +osmo_gprs_ul_block_size_bits; +osmo_gprs_dl_block_size_bits; +osmo_gprs_ul_block_size_bytes; +osmo_gprs_dl_block_size_bytes; +osmo_gprs_ul_cs_by_block_bytes; +osmo_gprs_dl_cs_by_block_bytes; gsm48_gmm_cause_names; gsm48_gsm_cause_names; -- To view, visit https://gerrit.osmocom.org/3454 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I05ff75ef7dfae639886bbd09fe35f03a8af9d988 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Wed Aug 9 17:02:32 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 9 Aug 2017 17:02:32 +0000 Subject: [PATCH] libosmocore[master]: tlv: add [msgb_]t16lv_put() for 16bit tag + 8 bit len TLVs Message-ID: Review at https://gerrit.osmocom.org/3455 tlv: add [msgb_]t16lv_put() for 16bit tag + 8 bit len TLVs In the Protocol Configuration Options IE (see 3GPP TS 24.008 10.5.6.3) there is yet another new TLV format (derived from PPP IPCP/LCP/...) which uses 16bit tag and 8bit length. Let's add functions so we can generate related TLVs. Parsing is unfortunately not possible in our existing structure as our tlv_parsed array only has 256 entries and thus cannot cope with 16bit tags. Change-Id: I9799130e2eba8fae8c4480fbb8a900c30232b694 --- M include/osmocom/gsm/tlv.h 1 file changed, 20 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/55/3455/1 diff --git a/include/osmocom/gsm/tlv.h b/include/osmocom/gsm/tlv.h index c356840..f903223 100644 --- a/include/osmocom/gsm/tlv.h +++ b/include/osmocom/gsm/tlv.h @@ -21,7 +21,7 @@ TLV16 8 8 N * 16 TvLV 8 8/16 N * 8 vTvLV 8/16 8/16 N * 8 - + T16LV 16 8 N * 8 */ /*! gross length of a LV type field */ @@ -34,6 +34,8 @@ #define TL16V_GROSS_LEN(x) (x+3) /*! gross length of a L16TV type field */ #define L16TV_GROSS_LEN(x) (x+3) +/*! gross length of a T16LV type field */ +#define T16LV_GROSS_LEN(x) (x+3) /*! maximum length of TLV of one byte length */ #define TVLV_MAX_ONEBYTE 0x7f @@ -119,6 +121,17 @@ return buf + len*2; } +/*! put (append) a TL16V field */ +static inline uint8_t *t16lv_put(uint8_t *buf, uint16_t tag, uint8_t len, + const uint8_t *val) +{ + *buf++ = tag >> 8; + *buf++ = tag & 0xff; + *buf++ = len; + memcpy(buf, val, len); + return buf + len + 2; +} + /*! put (append) a TvLV field */ static inline uint8_t *tvlv_put(uint8_t *buf, uint8_t tag, uint16_t len, const uint8_t *val) @@ -185,6 +198,12 @@ return tl16v_put(buf, tag, len, val); } +static inline uint8_t *msgb_t16lv_put(struct msgb *msg, uint16_t tag, uint8_t len, const uint8_t *val) +{ + uint8_t *buf = msgb_put(msg, T16LV_GROSS_LEN(len)); + return t16lv_put(buf, tag, len, val); +} + /*! put (append) a TvLV field to \ref msgb */ static inline uint8_t *msgb_tvlv_put(struct msgb *msg, uint8_t tag, uint16_t len, const uint8_t *val) -- To view, visit https://gerrit.osmocom.org/3455 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I9799130e2eba8fae8c4480fbb8a900c30232b694 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Wed Aug 9 20:15:43 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 9 Aug 2017 20:15:43 +0000 Subject: [PATCH] openggsn[master]: ippool: Add IPv6 support to IP pool implementation In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3403 to look at the new patch set (#5). ippool: Add IPv6 support to IP pool implementation Extend the IP pool implementation to be able to manage both pools of 32bit addresses (IPv4) as well as pools of 128bit addresses (IPv6) Change-Id: Ib98cc4bf634d6be9a7bf8c03a24e629455fcafc8 --- M ggsn/ggsn.c M ggsn/gtp-kernel.c M ggsn/gtp-kernel.h M lib/Makefile.am A lib/in46_addr.c A lib/in46_addr.h M lib/ippool.c M lib/ippool.h M sgsnemu/sgsnemu.c 9 files changed, 371 insertions(+), 169 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openggsn refs/changes/03/3403/5 diff --git a/ggsn/ggsn.c b/ggsn/ggsn.c index 168e907..0d0e569 100644 --- a/ggsn/ggsn.c +++ b/ggsn/ggsn.c @@ -56,6 +56,7 @@ #include "../lib/tun.h" #include "../lib/ippool.h" #include "../lib/syserr.h" +#include "../lib/in46_addr.h" #include "../gtp/pdp.h" #include "../gtp/gtp.h" #include "cmdline.h" @@ -65,7 +66,8 @@ int maxfd = 0; /* For select() */ struct in_addr listen_; -struct in_addr netaddr, destaddr, net, mask; /* Network interface */ +struct in_addr netaddr, destaddr, net; /* Network interface */ +size_t prefixlen; struct in_addr dns1, dns2; /* PCO DNS address */ char *ipup, *ipdown; /* Filename of scripts */ int debug; /* Print debug output */ @@ -135,9 +137,12 @@ static bool send_trap(const struct gsn_t *gsn, const struct pdp_t *pdp, const struct ippoolm_t *member, const char *var) { + char addrbuf[256]; char val[NAMESIZE]; - snprintf(val, sizeof(val), "%" PRIu64 ",%s", pdp->imsi, inet_ntoa(member->addr)); + const char *addrstr = in46a_ntop(&member->addr, addrbuf, sizeof(addrbuf)); + + snprintf(val, sizeof(val), "%" PRIu64 ",%s", pdp->imsi, addrstr); if (ctrl_cmd_send_trap(gsn->ctrl, var, val) < 0) { LOGP(DGGSN, LOGL_ERROR, "Failed to create and send TRAP for IMSI %" PRIu64 " [%s].\n", pdp->imsi, var); @@ -168,7 +173,7 @@ int create_context_ind(struct pdp_t *pdp) { - struct in_addr addr; + struct in46_addr addr; struct ippoolm_t *member; DEBUGP(DGGSN, "Received create PDP context request\n"); @@ -183,8 +188,8 @@ memcpy(pdp->qos_neg.v, pdp->qos_req.v, pdp->qos_req.l); /* TODO */ pdp->qos_neg.l = pdp->qos_req.l; - if (pdp_euaton(&pdp->eua, &addr)) { - addr.s_addr = 0; /* Request dynamic */ + if (pdp_euaton(&pdp->eua, &addr.v4)) { + addr.v4.s_addr = 0; /* Request dynamic */ } if (ippool_newip(ippool, &member, &addr, 0)) { @@ -192,7 +197,7 @@ return 0; /* Allready in use, or no more available */ } - pdp_ntoeua(&member->addr, &pdp->eua); + pdp_ntoeua(&member->addr.v4, &pdp->eua); pdp->peer = member; pdp->ipif = tun; /* TODO */ member->peer = pdp; @@ -215,10 +220,18 @@ int cb_tun_ind(struct tun_t *tun, void *pack, unsigned len) { struct ippoolm_t *ipm; - struct in_addr dst; + struct in46_addr dst; struct tun_packet_t *iph = (struct tun_packet_t *)pack; - dst.s_addr = iph->dst; + if (iph->ver == 4) { + if (len < sizeof(*iph) || len < 4*iph->ihl) + return -1; + dst.len = 4; + dst.v4.s_addr = iph->dst; + } else { + LOGP(DGGSN, LOGL_NOTICE, "non-IPv4 packet received from tun\n"); + return -1; + } DEBUGP(DGGSN, "Received packet from tun!\n"); @@ -383,12 +396,14 @@ /* net */ /* Store net as in_addr net and mask */ if (args_info.net_arg) { - if (ippool_aton(&net, &mask, args_info.net_arg, 0)) { + struct in46_addr in46; + if (ippool_aton(&in46, &prefixlen, args_info.net_arg, 0)) { SYS_ERR(DGGSN, LOGL_ERROR, 0, "Invalid network address: %s!", args_info.net_arg); exit(1); } + net.s_addr = in46.v4.s_addr; netaddr.s_addr = htonl(ntohl(net.s_addr) + 1); destaddr.s_addr = htonl(ntohl(net.s_addr) + 1); } else { @@ -547,7 +562,7 @@ maxfd = gsn->fd1u; /* use GTP kernel module for data packet encapsulation */ - if (gtp_kernel_init(gsn, &net, &mask, &args_info) < 0) + if (gtp_kernel_init(gsn, &net, prefixlen, &args_info) < 0) goto err; gtp_set_cb_data_ind(gsn, encaps_tun); @@ -572,7 +587,7 @@ } DEBUGP(DGGSN, "Setting tun IP address\n"); - if (tun_setaddr(tun, &netaddr, &destaddr, &mask)) { + if (tun_setaddr(tun, &netaddr, &destaddr, &prefixlen)) { SYS_ERR(DGGSN, LOGL_ERROR, 0, "Failed to set tun IP address"); exit(1); } diff --git a/ggsn/gtp-kernel.c b/ggsn/gtp-kernel.c index dbe5a9f..458ac27 100644 --- a/ggsn/gtp-kernel.c +++ b/ggsn/gtp-kernel.c @@ -70,17 +70,6 @@ printf("\n"); } -static int mask2prefix(struct in_addr *mask) -{ - uint32_t tmp = ntohl(mask->s_addr); - int k; - - for (k=0; tmp > 0; k++) - tmp = (tmp << 1); - - return k; -} - static struct { int genl_id; struct mnl_socket *nl; @@ -91,7 +80,7 @@ #define GTP_DEVNAME "gtp0" int gtp_kernel_init(struct gsn_t *gsn, struct in_addr *net, - struct in_addr *mask, + size_t prefixlen, struct gengetopt_args_info *args_info) { if (!args_info->gtp_linux_given) @@ -126,7 +115,7 @@ DEBUGP(DGGSN, "Setting route to reach %s via %s\n", args_info->net_arg, GTP_DEVNAME); - if (gtp_dev_config(GTP_DEVNAME, net, mask2prefix(mask)) < 0) { + if (gtp_dev_config(GTP_DEVNAME, net, prefixlen) < 0) { SYS_ERR(DGGSN, LOGL_ERROR, 0, "Cannot add route to reach network %s\n", args_info->net_arg); diff --git a/ggsn/gtp-kernel.h b/ggsn/gtp-kernel.h index 83280a0..b3b29e3 100644 --- a/ggsn/gtp-kernel.h +++ b/ggsn/gtp-kernel.h @@ -8,7 +8,7 @@ #ifdef GTP_KERNEL int gtp_kernel_init(struct gsn_t *gsn, struct in_addr *net, - struct in_addr *mask, + size_t prefixlen, struct gengetopt_args_info *args_info); void gtp_kernel_stop(void); @@ -19,7 +19,7 @@ #else static inline int gtp_kernel_init(struct gsn_t *gsn, struct in_addr *net, - struct in_addr *mask, + size_t prefixlen, struct gengetopt_args_info *args_info) { if (args_info->gtp_linux_given) { diff --git a/lib/Makefile.am b/lib/Makefile.am index 756d566..632990c 100644 --- a/lib/Makefile.am +++ b/lib/Makefile.am @@ -1,7 +1,7 @@ noinst_LIBRARIES = libmisc.a -noinst_HEADERS = gnugetopt.h ippool.h lookup.h syserr.h tun.h +noinst_HEADERS = gnugetopt.h ippool.h lookup.h syserr.h tun.h in46_addr.h AM_CFLAGS = -O2 -fno-builtin -Wall -DSBINDIR='"$(sbindir)"' -ggdb $(LIBOSMOCORE_CFLAGS) -libmisc_a_SOURCES = getopt1.c getopt.c ippool.c lookup.c tun.c debug.c +libmisc_a_SOURCES = getopt1.c getopt.c ippool.c lookup.c tun.c debug.c in46_addr.c diff --git a/lib/in46_addr.c b/lib/in46_addr.c new file mode 100644 index 0000000..903ceec --- /dev/null +++ b/lib/in46_addr.c @@ -0,0 +1,148 @@ +/* + * IPv4/v6 address functions. + * Copyright (C) 2017 by Harald Welte + * + * The contents of this file may be used under the terms of the GNU + * General Public License Version 2, provided that the above copyright + * notice and this permission notice is included in all copies or + * substantial portions of the software. + * + */ + +#include "../lib/in46_addr.h" + +#include +#include +#include +#include +#include +#include +#include + +/*! Return the address family of given \reff in46_addr argument */ +int in46a_to_af(const struct in46_addr *in) +{ + switch (in->len) { + case 4: + return AF_INET; + case 16: + return AF_INET6; + default: + return -1; + } +} + +/*! Convert \ref in46_addr to sockaddr_storage */ +int in46a_to_sas(struct sockaddr_storage *out, const struct in46_addr *in) +{ + struct sockaddr_in *sin = (struct sockaddr_in *)out; + struct sockaddr_in6 *sin6 = (struct sockaddr_in6 *)out; + + switch (in->len) { + case 4: + sin->sin_family = AF_INET; + sin->sin_addr = in->v4; + break; + case 16: + sin6->sin6_family = AF_INET; + sin6->sin6_addr = in->v6; + break; + default: + return -1; + } + + return 0; +} + +/*! Convenience wrapper around inet_ntop() for \ref in46_addr */ +const char *in46a_ntop(const struct in46_addr *in, char *dst, socklen_t dst_size) +{ + int af = in46a_to_af(in); + if (af < 0) + return NULL; + + return inet_ntop(af, (const void *) &in->v4, dst, dst_size); +} + +/*! Determine if two in46_addr are equal or not + * \returns 1 in case they are equal; 0 otherwise */ +int in46a_equal(const struct in46_addr *a, const struct in46_addr *b) +{ + if (a->len == b->len && !memcmp(&a->v6, &b->v6, a->len)) + return 1; + else + return 0; +} + +/*! Match if IPv6 addr1 + addr2 are within same \a mask */ +static int ipv6_within_mask(const struct in6_addr *addr1, const struct in6_addr *addr2, + const struct in6_addr *mask) +{ + struct in6_addr masked = *addr2; +#if defined(__linux__) + masked.s6_addr32[0] &= mask->s6_addr32[0]; + masked.s6_addr32[1] &= mask->s6_addr32[1]; + masked.s6_addr32[2] &= mask->s6_addr32[2]; + masked.s6_addr32[3] &= mask->s6_addr32[3]; +#else + masked.__u6_addr.__u6_addr32[0] &= mask->__u6_addr.__u6_addr32[0]; + masked.__u6_addr.__u6_addr32[1] &= mask->__u6_addr.__u6_addr32[1]; + masked.__u6_addr.__u6_addr32[2] &= mask->__u6_addr.__u6_addr32[2]; + masked.__u6_addr.__u6_addr32[3] &= mask->__u6_addr.__u6_addr32[3]; +#endif + if (!memcmp(addr1, &masked, sizeof(struct in6_addr))) + return 1; + else + return 0; +} + +/*! Create an IPv6 netmask from the given prefix length */ +static void create_ipv6_netmask(struct in6_addr *netmask, int prefixlen) +{ + uint32_t *p_netmask; + memset(netmask, 0, sizeof(struct in6_addr)); + if (prefixlen < 0) + prefixlen = 0; + else if (128 < prefixlen) + prefixlen = 128; + +#if defined(__linux__) + p_netmask = &netmask->s6_addr32[0]; +#else + p_netmask = &netmask->__u6_addr.__u6_addr32[0]; +#endif + while (32 < prefixlen) { + *p_netmask = 0xffffffff; + p_netmask++; + prefixlen -= 32; + } + if (prefixlen != 0) { + *p_netmask = htonl(0xFFFFFFFF << (32 - prefixlen)); + } +} + +/*! Determine if given \a addr is within given \a net + \a prefixlen + * Builds the netmask from \a net + \a prefixlen and matches it to \a addr + * \returns 1 in case of a match, 0 otherwise */ +int in46a_within_mask(const struct in46_addr *addr, const struct in46_addr *net, size_t prefixlen) +{ + struct in_addr netmask; + struct in6_addr netmask6; + + if (addr->len != net->len) + return 0; + + switch (addr->len) { + case 4: + netmask.s_addr = htonl(0xFFFFFFFF << (32 - prefixlen)); + if ((addr->v4.s_addr & netmask.s_addr) == net->v4.s_addr) + return 1; + else + return 0; + case 16: + create_ipv6_netmask(&netmask6, prefixlen); + return ipv6_within_mask(&addr->v6, &net->v6, &netmask6); + default: + return 0; + } +} diff --git a/lib/in46_addr.h b/lib/in46_addr.h new file mode 100644 index 0000000..f28fd8e --- /dev/null +++ b/lib/in46_addr.h @@ -0,0 +1,19 @@ +#pragma once +#include +#include + +/* a simple wrapper around an in6_addr to also contain the length of the address, + * thereby implicitly indicating the address family of the address */ +struct in46_addr { + uint8_t len; + union { + struct in_addr v4; + struct in6_addr v6; + }; +}; + +extern int in46a_to_af(const struct in46_addr *in); +extern int in46a_to_sas(struct sockaddr_storage *out, const struct in46_addr *in); +extern const char *in46a_ntop(const struct in46_addr *in, char *dst, socklen_t dst_size); +extern int in46a_equal(const struct in46_addr *a, const struct in46_addr *b); +extern int in46a_within_mask(const struct in46_addr *addr, const struct in46_addr *net, size_t prefixlen); diff --git a/lib/ippool.c b/lib/ippool.c index 1f79a77..c3eb267 100644 --- a/lib/ippool.c +++ b/lib/ippool.c @@ -1,6 +1,7 @@ /* * IP address pool functions. * Copyright (C) 2003, 2004 Mondru AB. + * Copyright (C) 2017 by Harald Welte * * The contents of this file may be used under the terms of the GNU * General Public License Version 2, provided that the above copyright @@ -16,6 +17,7 @@ #include #include #include +#include #include "syserr.h" #include "ippool.h" #include "lookup.h" @@ -31,13 +33,14 @@ printf("Listsize %d\n", this->listsize); for (n = 0; n < this->listsize; n++) { - printf("Unit %d inuse %d prev %d next %d addr %s %x\n", + char s[256]; + in46a_ntop(&this->member[n].addr, s, sizeof(s)); + printf("Unit %d inuse %d prev %d next %d addr %s\n", n, this->member[n].inuse, this->member[n].prev - this->member, this->member[n].next - this->member, - inet_ntoa(this->member[n].addr), - this->member[n].addr.s_addr); + s); } return 0; } @@ -49,7 +52,7 @@ struct ippoolm_t *p_prev = NULL; /* Insert into hash table */ - hash = ippool_hash4(&member->addr) & this->hashmask; + hash = ippool_hash(&member->addr) & this->hashmask; for (p = this->hash[hash]; p; p = p->nexthash) p_prev = p; if (!p_prev) @@ -66,7 +69,7 @@ struct ippoolm_t *p_prev = NULL; /* Find in hash table */ - hash = ippool_hash4(&member->addr) & this->hashmask; + hash = ippool_hash(&member->addr) & this->hashmask; for (p = this->hash[hash]; p; p = p->nexthash) { if (p == member) { break; @@ -88,73 +91,98 @@ return 0; } -unsigned long int ippool_hash4(struct in_addr *addr) +static unsigned long int ippool_hash4(struct in_addr *addr) { return lookup((unsigned char *)&addr->s_addr, sizeof(addr->s_addr), 0); } -#ifndef IPPOOL_NOIP6 -unsigned long int ippool_hash6(struct in6_addr *addr) +static unsigned long int ippool_hash6(struct in6_addr *addr) { - return lookup((unsigned char *)addr->u6_addr8, sizeof(addr->u6_addr8), + /* TODO: Review hash spread for IPv6 */ + return lookup((unsigned char *)addr->s6_addr, sizeof(addr->s6_addr), 0); } -#endif + +unsigned long int ippool_hash(struct in46_addr *addr) +{ + if (addr->len == 4) + return ippool_hash4(&addr->v4); + else + return ippool_hash6(&addr->v6); +} /* Get IP address and mask */ -int ippool_aton(struct in_addr *addr, struct in_addr *mask, - char *pool, int number) +int ippool_aton(struct in46_addr *addr, size_t *prefixlen, const char *pool_in, int number) { + struct addrinfo *ai; + struct addrinfo hints = { + .ai_family = AF_UNSPEC, + .ai_socktype = SOCK_DGRAM, + .ai_flags = 0, + .ai_protocol = 0 + }; + char pool[strlen(pool_in)+1]; - /* Parse only first instance of network for now */ - /* Eventually "number" will indicate the token which we want to parse */ + strcpy(pool, pool_in); - unsigned int a1, a2, a3, a4; - unsigned int m1, m2, m3, m4; - int c; - int m; - int masklog; + int err; - c = sscanf(pool, "%u.%u.%u.%u/%u.%u.%u.%u", - &a1, &a2, &a3, &a4, &m1, &m2, &m3, &m4); - switch (c) { - case 4: - mask->s_addr = 0xffffffff; - break; - case 5: - if (m1 > 32) { - SYS_ERR(DIP, LOGL_ERROR, 0, "Invalid mask"); - return -1; /* Invalid mask */ + /* Find '/' and point to first char after it */ + char *prefixlen_str = strchr(pool, '/'); + if (prefixlen_str) { + *prefixlen_str = '\0'; + prefixlen_str++; + if (*prefixlen_str == '\0') { + SYS_ERR(DIP, LOGL_ERROR, 0, "Empty prefix length specified"); + return -1; } - mask->s_addr = htonl(0xffffffff << (32 - m1)); - break; - case 8: - if (m1 >= 256 || m2 >= 256 || m3 >= 256 || m4 >= 256) { - SYS_ERR(DIP, LOGL_ERROR, 0, "Invalid mask"); - return -1; /* Wrong mask format */ - } - m = m1 * 0x1000000 + m2 * 0x10000 + m3 * 0x100 + m4; - for (masklog = 0; ((1 << masklog) < ((~m) + 1)); masklog++) ; - if (((~m) + 1) != (1 << masklog)) { - SYS_ERR(DIP, LOGL_ERROR, 0, "Invalid mask"); - return -1; /* Wrong mask format (not all ones followed by all zeros) */ - } - mask->s_addr = htonl(m); - break; - default: - SYS_ERR(DIP, LOGL_ERROR, 0, "Invalid mask"); - return -1; /* Invalid mask */ } - if (a1 >= 256 || a2 >= 256 || a3 >= 256 || a4 >= 256) { - SYS_ERR(DIP, LOGL_ERROR, 0, - "Wrong IP address format"); + /* convert address */ + if ((err = getaddrinfo(pool, NULL, &hints, &ai))) { + SYS_ERR(DIP, LOGL_ERROR, 0, "Bad address"); return -1; - } else - addr->s_addr = - htonl(a1 * 0x1000000 + a2 * 0x10000 + a3 * 0x100 + a4); + } + + /* Copy address, set lengths */ + if (ai->ai_family == AF_INET) { + *prefixlen = 32; + addr->len = sizeof(struct in_addr); + addr->v4 = ((struct sockaddr_in*)ai->ai_addr)->sin_addr; + } else { + *prefixlen = 128; + addr->len = sizeof(struct in6_addr); + addr->v6 = ((struct sockaddr_in6*)ai->ai_addr)->sin6_addr; + } + freeaddrinfo(ai); + + /* parse prefixlen */ + if (prefixlen_str) { + char *e; + *prefixlen = strtol(prefixlen_str, &e, 10); + if (*e != '\0') { + SYS_ERR(DIP, LOGL_ERROR, 0, "Prefixlen is not an int"); + return -1; + } + } + + if (*prefixlen > (addr->len * 8)) { + SYS_ERR(DIP, LOGL_ERROR, 0, "Perfixlen too big"); + return -1; + } return 0; +} + +/* Increase IPv4/IPv6 address by 1 */ +void in46a_inc(struct in46_addr *addr) +{ + size_t addrlen; + uint8_t *a = (uint8_t *)&addr->v6; + for (addrlen = addr->len; addrlen > 0; addrlen--) { + if (++a[addrlen-1]) + break; + } } /* Create new address pool */ @@ -165,11 +193,10 @@ /* Parse only first instance of pool for now */ int i; - struct in_addr addr; - struct in_addr mask; - struct in_addr stataddr; - struct in_addr statmask; - unsigned int m; + struct in46_addr addr; + size_t addrprefixlen; + struct in46_addr stataddr; + size_t stataddrprefixlen; int listsize; int dynsize; unsigned int statsize; @@ -177,7 +204,7 @@ if (!allowdyn) { dynsize = 0; } else { - if (ippool_aton(&addr, &mask, dyn, 0)) { + if (ippool_aton(&addr, &addrprefixlen, dyn, 0)) { SYS_ERR(DIP, LOGL_ERROR, 0, "Failed to parse dynamic pool"); return -1; @@ -188,8 +215,7 @@ flags |= IPPOOL_NONETWORK; } - m = ntohl(mask.s_addr); - dynsize = ((~m) + 1); + dynsize = (1 << (addr.len*8 - addrprefixlen)) -1; if (flags & IPPOOL_NONETWORK) /* Exclude network address from pool */ dynsize--; if (flags & IPPOOL_NOGATEWAY) /* Exclude gateway address from pool */ @@ -200,17 +226,16 @@ if (!allowstat) { statsize = 0; - stataddr.s_addr = 0; - statmask.s_addr = 0; + stataddr.len = 0; + stataddrprefixlen = 0; } else { - if (ippool_aton(&stataddr, &statmask, stat, 0)) { + if (ippool_aton(&stataddr, &stataddrprefixlen, stat, 0)) { SYS_ERR(DIP, LOGL_ERROR, 0, "Failed to parse static range"); return -1; } - m = ntohl(statmask.s_addr); - statsize = ((~m) + 1); + statsize = (1 << (addr.len - addrprefixlen + 1)) -1; if (statsize > IPPOOL_STATSIZE) statsize = IPPOOL_STATSIZE; } @@ -225,8 +250,9 @@ (*this)->allowdyn = allowdyn; (*this)->allowstat = allowstat; - (*this)->stataddr = stataddr; - (*this)->statmask = statmask; + if (stataddr.len > 0) + (*this)->stataddr = stataddr; + (*this)->stataddrprefixlen = stataddrprefixlen; (*this)->listsize += listsize; if (!((*this)->member = calloc(sizeof(struct ippoolm_t), listsize))) { @@ -255,17 +281,15 @@ (*this)->firstdyn = NULL; (*this)->lastdyn = NULL; + if (flags & IPPOOL_NOGATEWAY) { + in46a_inc(&addr); + in46a_inc(&addr); + } else if (flags & IPPOOL_NONETWORK) { + in46a_inc(&addr); + } for (i = 0; i < dynsize; i++) { - - if (flags & IPPOOL_NOGATEWAY) - (*this)->member[i].addr.s_addr = - htonl(ntohl(addr.s_addr) + i + 2); - else if (flags & IPPOOL_NONETWORK) - (*this)->member[i].addr.s_addr = - htonl(ntohl(addr.s_addr) + i + 1); - else - (*this)->member[i].addr.s_addr = - htonl(ntohl(addr.s_addr) + i); + (*this)->member[i].addr = addr; + in46a_inc(&addr); (*this)->member[i].inuse = 0; @@ -285,8 +309,8 @@ (*this)->firststat = NULL; (*this)->laststat = NULL; for (i = dynsize; i < listsize; i++) { - - (*this)->member[i].addr.s_addr = 0; + struct in46_addr *i6al = &(*this)->member[i].addr; + memset(i6al, 0, sizeof(*i6al)); (*this)->member[i].inuse = 0; /* Insert into list of unused */ @@ -316,15 +340,15 @@ /* Find an IP address in the pool */ int ippool_getip(struct ippool_t *this, struct ippoolm_t **member, - struct in_addr *addr) + struct in46_addr *addr) { struct ippoolm_t *p; uint32_t hash; /* Find in hash table */ - hash = ippool_hash4(addr) & this->hashmask; + hash = ippool_hash(addr) & this->hashmask; for (p = this->hash[hash]; p; p = p->nexthash) { - if ((p->addr.s_addr == addr->s_addr) && (p->inuse)) { + if (in46a_equal(&p->addr, addr)) { if (member) *member = p; return 0; @@ -344,7 +368,7 @@ * address space. **/ int ippool_newip(struct ippool_t *this, struct ippoolm_t **member, - struct in_addr *addr, int statip) + struct in46_addr *addr, int statip) { struct ippoolm_t *p; struct ippoolm_t *p2 = NULL; @@ -365,17 +389,23 @@ if (0) (void)ippool_printaddr(this); + int specified = 0; + if (addr) { + if (addr->len == 4 && addr->v4.s_addr) + specified = 1; + if (addr->len == 16 && !IN6_IS_ADDR_UNSPECIFIED(&addr->v6)) + specified = 1; + } + /* First check to see if this type of address is allowed */ - if ((addr) && (addr->s_addr) && statip) { /* IP address given */ + if (specified && statip) { /* IP address given */ if (!this->allowstat) { SYS_ERR(DIP, LOGL_ERROR, 0, "Static IP address not allowed"); return -1; } - if ((addr->s_addr & this->statmask.s_addr) != - this->stataddr.s_addr) { - SYS_ERR(DIP, LOGL_ERROR, 0, - "Static out of range"); + if (!in46a_within_mask(addr, &this->stataddr, this->stataddrprefixlen)) { + SYS_ERR(DIP, LOGL_ERROR, 0, "Static out of range"); return -1; } } else { @@ -387,11 +417,11 @@ } /* If IP address given try to find it in dynamic address pool */ - if ((addr) && (addr->s_addr)) { /* IP address given */ + if (specified) { /* IP address given */ /* Find in hash table */ - hash = ippool_hash4(addr) & this->hashmask; + hash = ippool_hash(addr) & this->hashmask; for (p = this->hash[hash]; p; p = p->nexthash) { - if ((p->addr.s_addr == addr->s_addr)) { + if (in46a_equal(&p->addr, addr)) { p2 = p; break; } @@ -420,6 +450,11 @@ return -1; /* Allready in use / Should not happen */ } + if (p2->addr.len != addr->len) { + SYS_ERR(DIP, LOGL_ERROR, 0, "MS requested unsupported PDP context type"); + return -1; + } + /* Remove from linked list of free dynamic addresses */ if (p2->prev) p2->prev->next = p2->next; @@ -442,13 +477,18 @@ /* It was not possible to allocate from dynamic address pool */ /* Try to allocate from static address space */ - if ((addr) && (addr->s_addr) && (statip)) { /* IP address given */ + if (specified && (statip)) { /* IP address given */ if (!this->firststat) { SYS_ERR(DIP, LOGL_ERROR, 0, "No more IP addresses available"); return -1; /* No more available */ } else p2 = this->firststat; + + if (p2->addr.len != addr->len) { + SYS_ERR(DIP, LOGL_ERROR, 0, "MS requested unsupported PDP context type"); + return -1; + } /* Remove from linked list of free static addresses */ if (p2->prev) @@ -518,7 +558,7 @@ this->laststat = member; member->inuse = 0; - member->addr.s_addr = 0; + memset(&member->addr, 0, sizeof(member->addr)); member->peer = NULL; member->nexthash = NULL; if (0) @@ -530,9 +570,3 @@ return -1; } } - -#ifndef IPPOOL_NOIP6 -extern unsigned long int ippool_hash6(struct in6_addr *addr); -extern int ippool_getip6(struct ippool_t *this, struct in6_addr *addr); -extern int ippool_returnip6(struct ippool_t *this, struct in6_addr *addr); -#endif diff --git a/lib/ippool.h b/lib/ippool.h index 534140d..53154f2 100644 --- a/lib/ippool.h +++ b/lib/ippool.h @@ -12,6 +12,8 @@ #ifndef _IPPOOL_H #define _IPPOOL_H +#include "../lib/in46_addr.h" + /* Assuming that the address space is fragmented we need a hash table in order to return the addresses. @@ -26,8 +28,6 @@ in RFC2373. */ -#define IPPOOL_NOIP6 - #define IPPOOL_NONETWORK 0x01 #define IPPOOL_NOBROADCAST 0x02 #define IPPOOL_NOGATEWAY 0x04 @@ -40,8 +40,8 @@ unsigned int listsize; /* Total number of addresses */ int allowdyn; /* Allow dynamic IP address allocation */ int allowstat; /* Allow static IP address allocation */ - struct in_addr stataddr; /* Static address range network address */ - struct in_addr statmask; /* Static address range network mask */ + struct in46_addr stataddr; /* Static address range network address */ + size_t stataddrprefixlen; /* IPv6 prefix length of stataddr */ struct ippoolm_t *member; /* Listsize array of members */ unsigned int hashsize; /* Size of hash table */ int hashlog; /* Log2 size of hash table */ @@ -54,11 +54,7 @@ }; struct ippoolm_t { -#ifndef IPPOOL_NOIP6 - struct in6_addr addr; /* IP address of this member */ -#else - struct in_addr addr; /* IP address of this member */ -#endif + struct in46_addr addr; /* IP address of this member */ int inuse; /* 0=available; 1= dynamic; 2 = static */ struct ippoolm_t *nexthash; /* Linked list part of hash table */ struct ippoolm_t *prev, *next; /* Linked list of free dynamic or static */ @@ -70,7 +66,7 @@ bytes for each address. */ /* Hash an IP address using code based on Bob Jenkins lookupa */ -extern unsigned long int ippool_hash4(struct in_addr *addr); +extern unsigned long int ippool_hash(struct in46_addr *addr); /* Create new address pool */ extern int ippool_new(struct ippool_t **this, char *dyn, char *stat, @@ -81,24 +77,20 @@ /* Find an IP address in the pool */ extern int ippool_getip(struct ippool_t *this, struct ippoolm_t **member, - struct in_addr *addr); + struct in46_addr *addr); /* Get an IP address. If addr = 0.0.0.0 get a dynamic IP address. Otherwise check to see if the given address is available */ extern int ippool_newip(struct ippool_t *this, struct ippoolm_t **member, - struct in_addr *addr, int statip); + struct in46_addr *addr, int statip); /* Return a previously allocated IP address */ extern int ippool_freeip(struct ippool_t *this, struct ippoolm_t *member); /* Get net and mask based on ascii string */ -extern int ippool_aton(struct in_addr *addr, struct in_addr *mask, - char *pool, int number); +int ippool_aton(struct in46_addr *addr, size_t *prefixlen, const char *pool, int number); -#ifndef IPPOOL_NOIP6 -extern unsigned long int ippool_hash6(struct in6_addr *addr); -extern int ippool_getip6(struct ippool_t *this, struct in6_addr *addr); -extern int ippool_returnip6(struct ippool_t *this, struct in6_addr *addr); -#endif +/* Increase IPv4/IPv6 address by 1 */ +extern void in46a_inc(struct in46_addr *addr); #endif /* !_IPPOOL_H */ diff --git a/sgsnemu/sgsnemu.c b/sgsnemu/sgsnemu.c index 1567e7e..90a6200 100644 --- a/sgsnemu/sgsnemu.c +++ b/sgsnemu/sgsnemu.c @@ -58,7 +58,7 @@ uint8_t inuse; /* 0=free. 1=used by somebody */ struct iphash_t *ipnext; struct pdp_t *pdp; - struct in_addr addr; + struct in46_addr addr; }; struct iphash_t iparr[MAXCONTEXTS]; struct iphash_t *iphash[MAXCONTEXTS]; @@ -81,7 +81,8 @@ struct { int debug; /* Print debug messages */ int createif; /* Create local network interface */ - struct in_addr netaddr, destaddr, net, mask; /* Network interface */ + struct in_addr netaddr, destaddr, net; /* Network interface */ + size_t prefixlen; char *ipup, *ipdown; /* Filename of scripts */ int defaultroute; /* Set up default route */ struct in_addr pinghost; /* Remote ping host */ @@ -160,13 +161,13 @@ state = 3; /* Tell main loop to finish. */ } -int ipset(struct iphash_t *ipaddr, struct in_addr *addr) +int ipset(struct iphash_t *ipaddr, struct in46_addr *addr) { - int hash = ippool_hash4(addr) % MAXCONTEXTS; + int hash = ippool_hash(addr) % MAXCONTEXTS; struct iphash_t *h; struct iphash_t *prev = NULL; ipaddr->ipnext = NULL; - ipaddr->addr.s_addr = addr->s_addr; + ipaddr->addr = *addr; for (h = iphash[hash]; h; h = h->ipnext) prev = h; if (!prev) @@ -178,7 +179,7 @@ int ipdel(struct iphash_t *ipaddr) { - int hash = ippool_hash4(&ipaddr->addr) % MAXCONTEXTS; + int hash = ippool_hash(&ipaddr->addr) % MAXCONTEXTS; struct iphash_t *h; struct iphash_t *prev = NULL; for (h = iphash[hash]; h; h = h->ipnext) { @@ -194,12 +195,12 @@ return EOF; /* End of linked list and not found */ } -int ipget(struct iphash_t **ipaddr, struct in_addr *addr) +int ipget(struct iphash_t **ipaddr, struct in46_addr *addr) { - int hash = ippool_hash4(addr) % MAXCONTEXTS; + int hash = ippool_hash(addr) % MAXCONTEXTS; struct iphash_t *h; for (h = iphash[hash]; h; h = h->ipnext) { - if ((h->addr.s_addr == addr->s_addr)) { + if (in46a_equal(&h->addr, addr)) { *ipaddr = h; return 0; } @@ -859,15 +860,17 @@ /* net */ /* Store net as in_addr net and mask */ if (args_info.net_arg) { + struct in46_addr in46; if (ippool_aton - (&options.net, &options.mask, args_info.net_arg, 0)) { + (&in46, &options.prefixlen, args_info.net_arg, 0)) { SYS_ERR(DSGSN, LOGL_ERROR, 0, "Invalid network address: %s!", args_info.net_arg); exit(1); } + options.net.s_addr = in46.v4.s_addr; #if defined (__sun__) - options.netaddr.s_addr = htonl(ntohl(options.net.s_addr) + 1); + options.netaddrs_addr = htonl(ntohl(options.net.s_addr) + 1); options.destaddr.s_addr = htonl(ntohl(options.net.s_addr) + 1); #else options.netaddr.s_addr = options.net.s_addr; @@ -876,7 +879,7 @@ } else { options.net.s_addr = 0; - options.mask.s_addr = 0; + options.prefixlen = 0; options.netaddr.s_addr = 0; options.destaddr.s_addr = 0; } @@ -1277,14 +1280,15 @@ int cb_tun_ind(struct tun_t *tun, void *pack, unsigned len) { struct iphash_t *ipm; - struct in_addr src; + struct in46_addr src; struct tun_packet_t *iph = (struct tun_packet_t *)pack; - src.s_addr = iph->src; + src.len = 4; + src.v4.s_addr = iph->src; if (ipget(&ipm, &src)) { printf("Dropping packet from invalid source address: %s\n", - inet_ntoa(src)); + inet_ntoa(src.v4)); return 0; } @@ -1295,7 +1299,7 @@ int create_pdp_conf(struct pdp_t *pdp, void *cbp, int cause) { - struct in_addr addr; + struct in46_addr addr; struct iphash_t *iph = (struct iphash_t *)cbp; @@ -1324,7 +1328,7 @@ return EOF; /* Not what we expected */ } - if (pdp_euaton(&pdp->eua, &addr)) { + if (pdp_euaton(&pdp->eua, &addr.v4)) { printf ("Received create PDP context response. Cause value: %d\n", cause); @@ -1335,7 +1339,7 @@ } printf("Received create PDP context response. IP address: %s\n", - inet_ntoa(addr)); + inet_ntoa(addr.v4)); if ((options.createif) && (!options.net.s_addr)) { struct in_addr m; @@ -1345,11 +1349,11 @@ m.s_addr = -1; #endif /* printf("Setting up interface and routing\n"); */ - tun_addaddr(tun, &addr, &addr, &m); + tun_addaddr(tun, &addr.v4, &addr.v4, &m); if (options.defaultroute) { struct in_addr rm; rm.s_addr = 0; - tun_addroute(tun, &rm, &addr, &rm); + tun_addroute(tun, &rm, &addr.v4, &rm); } if (options.ipup) tun_runscript(tun, options.ipup); @@ -1472,9 +1476,10 @@ } if ((options.createif) && (options.net.s_addr)) { + struct in_addr mask; + mask.s_addr = options.prefixlen ? (0xFFFFFFFF >> (32 - options.prefixlen)) : 0; /* printf("Setting up interface and routing\n"); */ - tun_addaddr(tun, &options.netaddr, &options.destaddr, - &options.mask); + tun_addaddr(tun, &options.netaddr, &options.destaddr, &mask); if (options.defaultroute) { struct in_addr rm; rm.s_addr = 0; -- To view, visit https://gerrit.osmocom.org/3403 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ib98cc4bf634d6be9a7bf8c03a24e629455fcafc8 Gerrit-PatchSet: 5 Gerrit-Project: openggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Aug 9 20:15:43 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 9 Aug 2017 20:15:43 +0000 Subject: [PATCH] openggsn[master]: lib/tun.h: Remove non-endian-safe redefinition of IP header In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3404 to look at the new patch set (#6). lib/tun.h: Remove non-endian-safe redefinition of IP header We can simply use 'struct iphdr' from netinet/ip.h to achieve the same goal (and be portable). Change-Id: Ieece22e127dc14a7ffdc3b05656628989ad00b32 --- M configure.ac M ggsn/ggsn.c M lib/tun.h M sgsnemu/sgsnemu.c 4 files changed, 39 insertions(+), 20 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openggsn refs/changes/04/3404/6 diff --git a/configure.ac b/configure.ac index 45ab22b..b7e6793 100644 --- a/configure.ac +++ b/configure.ac @@ -112,6 +112,12 @@ AC_DEFINE([HAVE_RT_MSGHDR])], AC_MSG_RESULT(no)) +AC_MSG_CHECKING(whether struct iphdr exists) +AH_TEMPLATE(HAVE_IPHDR) +AC_EGREP_HEADER(struct iphdr, netinet/ip.h, +[AC_MSG_RESULT(yes) + AC_DEFINE([HAVE_IPHDR])], + AC_MSG_RESULT(no)) # Checks for library functions. AC_PROG_GCC_TRADITIONAL diff --git a/ggsn/ggsn.c b/ggsn/ggsn.c index 0d0e569..4fb2066 100644 --- a/ggsn/ggsn.c +++ b/ggsn/ggsn.c @@ -34,6 +34,7 @@ #include #include #include +#include #include #include #include @@ -42,6 +43,7 @@ #include #include #include +#include #include #include @@ -221,13 +223,13 @@ { struct ippoolm_t *ipm; struct in46_addr dst; - struct tun_packet_t *iph = (struct tun_packet_t *)pack; + struct iphdr *iph = (struct iphdr *)pack; - if (iph->ver == 4) { + if (iph->version == 4) { if (len < sizeof(*iph) || len < 4*iph->ihl) return -1; dst.len = 4; - dst.v4.s_addr = iph->dst; + dst.v4.s_addr = iph->daddr; } else { LOGP(DGGSN, LOGL_NOTICE, "non-IPv4 packet received from tun\n"); return -1; diff --git a/lib/tun.h b/lib/tun.h index ce7b91c..c50bdf9 100644 --- a/lib/tun.h +++ b/lib/tun.h @@ -17,21 +17,31 @@ #define TUN_ADDRSIZE 128 #define TUN_NLBUFSIZE 1024 -struct tun_packet_t { - unsigned int ver:4; - unsigned int ihl:4; - unsigned int dscp:6; - unsigned int ecn:2; - unsigned int length:16; - unsigned int id:16; - unsigned int flags:3; - unsigned int fragment:13; - unsigned int ttl:8; - unsigned int protocol:8; - unsigned int check:16; - unsigned int src:32; - unsigned int dst:32; -}; +#include "config.h" +#ifndef HAVE_IPHDR +struct iphdr + { +#if __BYTE_ORDER == __LITTLE_ENDIAN + unsigned int ihl:4; + unsigned int version:4; +#elif __BYTE_ORDER == __BIG_ENDIAN + unsigned int version:4; + unsigned int ihl:4; +#else +# error "Please fix " +#endif + u_int8_t tos; + u_int16_t tot_len; + u_int16_t id; + u_int16_t frag_off; + u_int8_t ttl; + u_int8_t protocol; + u_int16_t check; + u_int32_t saddr; + u_int32_t daddr; + /*The options start here. */ + }; +#endif /* !HAVE_IPHDR */ /* *********************************************************** * Information storage for each tun instance diff --git a/sgsnemu/sgsnemu.c b/sgsnemu/sgsnemu.c index 90a6200..af8f9fa 100644 --- a/sgsnemu/sgsnemu.c +++ b/sgsnemu/sgsnemu.c @@ -29,6 +29,7 @@ #include #include #include +#include #include #include #include @@ -1281,10 +1282,10 @@ { struct iphash_t *ipm; struct in46_addr src; - struct tun_packet_t *iph = (struct tun_packet_t *)pack; + struct iphdr *iph = (struct iphdr *)pack; src.len = 4; - src.v4.s_addr = iph->src; + src.v4.s_addr = iph->saddr; if (ipget(&ipm, &src)) { printf("Dropping packet from invalid source address: %s\n", -- To view, visit https://gerrit.osmocom.org/3404 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ieece22e127dc14a7ffdc3b05656628989ad00b32 Gerrit-PatchSet: 6 Gerrit-Project: openggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Aug 9 20:15:43 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 9 Aug 2017 20:15:43 +0000 Subject: [PATCH] openggsn[master]: ippool_new(): const-ify input arguments In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3405 to look at the new patch set (#6). ippool_new(): const-ify input arguments Change-Id: If3e53584e8c9c1f06bba4c183c9fd65fae913904 --- M lib/ippool.c M lib/ippool.h 2 files changed, 2 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openggsn refs/changes/05/3405/6 diff --git a/lib/ippool.c b/lib/ippool.c index c3eb267..3ca1b86 100644 --- a/lib/ippool.c +++ b/lib/ippool.c @@ -186,7 +186,7 @@ } /* Create new address pool */ -int ippool_new(struct ippool_t **this, char *dyn, char *stat, +int ippool_new(struct ippool_t **this, const char *dyn, const char *stat, int allowdyn, int allowstat, int flags) { diff --git a/lib/ippool.h b/lib/ippool.h index 53154f2..e3c1c92 100644 --- a/lib/ippool.h +++ b/lib/ippool.h @@ -69,7 +69,7 @@ extern unsigned long int ippool_hash(struct in46_addr *addr); /* Create new address pool */ -extern int ippool_new(struct ippool_t **this, char *dyn, char *stat, +extern int ippool_new(struct ippool_t **this, const char *dyn, const char *stat, int allowdyn, int allowstat, int flags); /* Delete existing address pool */ -- To view, visit https://gerrit.osmocom.org/3405 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: If3e53584e8c9c1f06bba4c183c9fd65fae913904 Gerrit-PatchSet: 6 Gerrit-Project: openggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Aug 9 20:15:43 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 9 Aug 2017 20:15:43 +0000 Subject: [PATCH] openggsn[master]: IPv6 support for user IP In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3406 to look at the new patch set (#6). IPv6 support for user IP This patch enables the use of IPv6 PDP contexts. The phone will have to request an IPv6 End-user-Address, and the GGSN will have to be configured for an IPv6 pool. The outer transport-layer IP between SGSN and GGSN must still be IPv4, it is not modified by this patch Change-Id: I22c3bf32a98e5daf99d6eaeac8c9f95cc7574774 --- M ggsn/ggsn.c M lib/in46_addr.c M lib/in46_addr.h M sgsnemu/sgsnemu.c 4 files changed, 74 insertions(+), 4 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openggsn refs/changes/06/3406/6 diff --git a/ggsn/ggsn.c b/ggsn/ggsn.c index 4fb2066..8e7d1e3 100644 --- a/ggsn/ggsn.c +++ b/ggsn/ggsn.c @@ -35,6 +35,7 @@ #include #include #include +#include #include #include #include @@ -190,7 +191,7 @@ memcpy(pdp->qos_neg.v, pdp->qos_req.v, pdp->qos_req.l); /* TODO */ pdp->qos_neg.l = pdp->qos_req.l; - if (pdp_euaton(&pdp->eua, &addr.v4)) { + if (in46a_from_eua(&pdp->eua, &addr)) { addr.v4.s_addr = 0; /* Request dynamic */ } @@ -199,7 +200,7 @@ return 0; /* Allready in use, or no more available */ } - pdp_ntoeua(&member->addr.v4, &pdp->eua); + in46a_to_eua(&member->addr, &pdp->eua); pdp->peer = member; pdp->ipif = tun; /* TODO */ member->peer = pdp; @@ -224,14 +225,18 @@ struct ippoolm_t *ipm; struct in46_addr dst; struct iphdr *iph = (struct iphdr *)pack; + struct ip6_hdr *ip6h = (struct ip6_hdr *)pack; if (iph->version == 4) { if (len < sizeof(*iph) || len < 4*iph->ihl) return -1; dst.len = 4; dst.v4.s_addr = iph->daddr; + } else if (iph->version == 6) { + dst.len = 16; + dst.v6 = ip6h->ip6_dst; } else { - LOGP(DGGSN, LOGL_NOTICE, "non-IPv4 packet received from tun\n"); + LOGP(DGGSN, LOGL_NOTICE, "non-IPv packet received from tun\n"); return -1; } diff --git a/lib/in46_addr.c b/lib/in46_addr.c index 903ceec..844e318 100644 --- a/lib/in46_addr.c +++ b/lib/in46_addr.c @@ -146,3 +146,63 @@ return 0; } } + +/*! Convert given PDP End User Address to in46_addr + * \returns 0 on success; negative on error */ +int in46a_to_eua(const struct in46_addr *src, struct ul66_t *eua) +{ + switch (src->len) { + case 4: + eua->l = 6; + eua->v[0] = 0xf1; /* IETF */ + eua->v[1] = 0x21; /* IPv4 */ + memcpy(&eua->v[2], &src->v4, 4); /* Copy a 4 byte address */ + break; + case 16: + eua->l = 18; + eua->v[0] = 0xf1; /* IETF */ + eua->v[1] = 0x57; /* IPv6 */ + memcpy(&eua->v[2], &src->v6, 16); /* Copy a 16 byte address */ + break; + default: + return -1; + } + return 0; +} + +/*! Convert given in46_addr to PDP End User Address + * \returns 0 on success; negative on error */ +int in46a_from_eua(const struct ul66_t *eua, struct in46_addr *dst) +{ + if (eua->l < 2) + goto default_to_dyn_v4; + + if (eua->v[0] != 0xf1) + return -1; + + switch (eua->v[1]) { + case 0x21: + dst->len = 4; + if (eua->l >= 6) + memcpy(&dst->v4, &eua->v[2], 4); /* Copy a 4 byte address */ + else + dst->v4.s_addr = 0; + break; + case 0x57: + dst->len = 16; + if (eua->l >= 18) + memcpy(&dst->v6, &eua->v[2], 16); /* Copy a 16 byte address */ + else + memset(&dst->v6, 0, 16); + break; + default: + return -1; + } + return 0; + +default_to_dyn_v4: + /* assume dynamic IPv4 by default */ + dst->len = 4; + dst->v4.s_addr = 0; + return 0; +} diff --git a/lib/in46_addr.h b/lib/in46_addr.h index f28fd8e..a0ad6e1 100644 --- a/lib/in46_addr.h +++ b/lib/in46_addr.h @@ -2,6 +2,8 @@ #include #include +#include "../gtp/pdp.h" + /* a simple wrapper around an in6_addr to also contain the length of the address, * thereby implicitly indicating the address family of the address */ struct in46_addr { @@ -17,3 +19,6 @@ extern const char *in46a_ntop(const struct in46_addr *in, char *dst, socklen_t dst_size); extern int in46a_equal(const struct in46_addr *a, const struct in46_addr *b); extern int in46a_within_mask(const struct in46_addr *addr, const struct in46_addr *net, size_t prefixlen); + +int in46a_to_eua(const struct in46_addr *src, struct ul66_t *eua); +int in46a_from_eua(const struct ul66_t *eua, struct in46_addr *dst); diff --git a/sgsnemu/sgsnemu.c b/sgsnemu/sgsnemu.c index af8f9fa..8c9cfd3 100644 --- a/sgsnemu/sgsnemu.c +++ b/sgsnemu/sgsnemu.c @@ -1329,7 +1329,7 @@ return EOF; /* Not what we expected */ } - if (pdp_euaton(&pdp->eua, &addr.v4)) { + if (in46a_from_eua(&pdp->eua, &addr)) { printf ("Received create PDP context response. Cause value: %d\n", cause); -- To view, visit https://gerrit.osmocom.org/3406 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I22c3bf32a98e5daf99d6eaeac8c9f95cc7574774 Gerrit-PatchSet: 6 Gerrit-Project: openggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Aug 9 20:15:43 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 9 Aug 2017 20:15:43 +0000 Subject: [PATCH] openggsn[master]: ggsn: Send proper errors in create_context_ind() In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3407 to look at the new patch set (#6). ggsn: Send proper errors in create_context_ind() When we receive PDP context requests for unknown PDP types or if we run out of dynamic addresses, we need to inform the SGSN that PDP context creation failed. Change-Id: Ibf199c1726130d27c8f80230b30ee51101c93b06 --- M ggsn/ggsn.c M lib/ippool.c M lib/ippool.h 3 files changed, 20 insertions(+), 11 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openggsn refs/changes/07/3407/6 diff --git a/ggsn/ggsn.c b/ggsn/ggsn.c index 8e7d1e3..0629f9e 100644 --- a/ggsn/ggsn.c +++ b/ggsn/ggsn.c @@ -178,6 +178,7 @@ { struct in46_addr addr; struct ippoolm_t *member; + int rc; DEBUGP(DGGSN, "Received create PDP context request\n"); @@ -192,11 +193,16 @@ pdp->qos_neg.l = pdp->qos_req.l; if (in46a_from_eua(&pdp->eua, &addr)) { - addr.v4.s_addr = 0; /* Request dynamic */ + SYS_ERR(DGGSN, LOGL_ERROR, 0, "Cannot decode EUA from MS/SGSN: %s", + osmo_hexdump(pdp->eua.v, pdp->eua.l)); + gtp_create_context_resp(gsn, pdp, GTPCAUSE_UNKNOWN_PDP); + return 0; } - if (ippool_newip(ippool, &member, &addr, 0)) { - gtp_create_context_resp(gsn, pdp, GTPCAUSE_NO_RESOURCES); + rc = ippool_newip(ippool, &member, &addr, 0); + if (rc < 0) { + SYS_ERR(DGGSN, LOGL_ERROR, 0, "Cannot allocate IP address in pool\n"); + gtp_create_context_resp(gsn, pdp, -rc); return 0; /* Allready in use, or no more available */ } @@ -208,6 +214,8 @@ if (gtp_kernel_tunnel_add(pdp) < 0) { SYS_ERR(DGGSN, LOGL_ERROR, 0, "Cannot add tunnel to kernel: %s\n", strerror(errno)); + gtp_create_context_resp(gsn, pdp, GTPCAUSE_SYS_FAIL); + return 0; } if (!send_trap(gsn, pdp, member, "imsi-ass-ip")) { /* TRAP with IP assignment */ diff --git a/lib/ippool.c b/lib/ippool.c index 3ca1b86..007dc50 100644 --- a/lib/ippool.c +++ b/lib/ippool.c @@ -402,7 +402,7 @@ if (!this->allowstat) { SYS_ERR(DIP, LOGL_ERROR, 0, "Static IP address not allowed"); - return -1; + return -GTPCAUSE_NOT_SUPPORTED; } if (!in46a_within_mask(addr, &this->stataddr, this->stataddrprefixlen)) { SYS_ERR(DIP, LOGL_ERROR, 0, "Static out of range"); @@ -412,7 +412,7 @@ if (!this->allowdyn) { SYS_ERR(DIP, LOGL_ERROR, 0, "Dynamic IP address not allowed"); - return -1; + return -GTPCAUSE_NOT_SUPPORTED; } } @@ -438,7 +438,7 @@ if (!this->firstdyn) { SYS_ERR(DIP, LOGL_ERROR, 0, "No more IP addresses available"); - return -1; + return -GTPCAUSE_ADDR_OCCUPIED; } else p2 = this->firstdyn; } @@ -447,12 +447,12 @@ if (p2->inuse) { SYS_ERR(DIP, LOGL_ERROR, 0, "IP address allready in use"); - return -1; /* Allready in use / Should not happen */ + return -GTPCAUSE_SYS_FAIL; /* Allready in use / Should not happen */ } if (p2->addr.len != addr->len) { SYS_ERR(DIP, LOGL_ERROR, 0, "MS requested unsupported PDP context type"); - return -1; + return -GTPCAUSE_UNKNOWN_PDP; } /* Remove from linked list of free dynamic addresses */ @@ -481,13 +481,13 @@ if (!this->firststat) { SYS_ERR(DIP, LOGL_ERROR, 0, "No more IP addresses available"); - return -1; /* No more available */ + return -GTPCAUSE_ADDR_OCCUPIED; /* No more available */ } else p2 = this->firststat; if (p2->addr.len != addr->len) { SYS_ERR(DIP, LOGL_ERROR, 0, "MS requested unsupported PDP context type"); - return -1; + return -GTPCAUSE_UNKNOWN_PDP; } /* Remove from linked list of free static addresses */ @@ -512,7 +512,7 @@ SYS_ERR(DIP, LOGL_ERROR, 0, "Could not allocate IP address"); - return -1; /* Should never get here. TODO: Bad code */ + return -GTPCAUSE_SYS_FAIL; /* Should never get here. TODO: Bad code */ } int ippool_freeip(struct ippool_t *this, struct ippoolm_t *member) diff --git a/lib/ippool.h b/lib/ippool.h index e3c1c92..ba92a56 100644 --- a/lib/ippool.h +++ b/lib/ippool.h @@ -13,6 +13,7 @@ #define _IPPOOL_H #include "../lib/in46_addr.h" +#include "../gtp/gtp.h" /* Assuming that the address space is fragmented we need a hash table in order to return the addresses. -- To view, visit https://gerrit.osmocom.org/3407 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ibf199c1726130d27c8f80230b30ee51101c93b06 Gerrit-PatchSet: 6 Gerrit-Project: openggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Aug 9 20:15:45 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 9 Aug 2017 20:15:45 +0000 Subject: [PATCH] openggsn[master]: in46_addr: Add new function in46a_prefix_equal() Message-ID: Review at https://gerrit.osmocom.org/3456 in46_addr: Add new function in46a_prefix_equal() This function is used to compare an IPv6 address against another, using the smaller of the two prefix lengths. Change-Id: Ic993d8abdc90897cb55276f01ae3b8a5eadf5a0d --- M lib/in46_addr.c M lib/in46_addr.h 2 files changed, 18 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openggsn refs/changes/56/3456/1 diff --git a/lib/in46_addr.c b/lib/in46_addr.c index 844e318..a220583 100644 --- a/lib/in46_addr.c +++ b/lib/in46_addr.c @@ -74,6 +74,23 @@ return 0; } +/*! Determine if two in46_addr prefix are equal or not + * The prefix length is determined by the shortest of the prefixes of a and b + * \returns 1 in case the common prefix are equal; 0 otherwise */ +int in46a_prefix_equal(const struct in46_addr *a, const struct in46_addr *b) +{ + unsigned int len; + if (a->len > b->len) + len = b->len; + else + len = a->len; + + if (!memcmp(&a->v6, &b->v6, len)) + return 1; + else + return 0; +} + /*! Match if IPv6 addr1 + addr2 are within same \a mask */ static int ipv6_within_mask(const struct in6_addr *addr1, const struct in6_addr *addr2, const struct in6_addr *mask) diff --git a/lib/in46_addr.h b/lib/in46_addr.h index a0ad6e1..0afd2b4 100644 --- a/lib/in46_addr.h +++ b/lib/in46_addr.h @@ -18,6 +18,7 @@ extern int in46a_to_sas(struct sockaddr_storage *out, const struct in46_addr *in); extern const char *in46a_ntop(const struct in46_addr *in, char *dst, socklen_t dst_size); extern int in46a_equal(const struct in46_addr *a, const struct in46_addr *b); +extern int in46a_prefix_equal(const struct in46_addr *a, const struct in46_addr *b); extern int in46a_within_mask(const struct in46_addr *addr, const struct in46_addr *net, size_t prefixlen); int in46a_to_eua(const struct in46_addr *src, struct ul66_t *eua); -- To view, visit https://gerrit.osmocom.org/3456 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ic993d8abdc90897cb55276f01ae3b8a5eadf5a0d Gerrit-PatchSet: 1 Gerrit-Project: openggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Wed Aug 9 20:15:45 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 9 Aug 2017 20:15:45 +0000 Subject: [PATCH] openggsn[master]: ippool: Extend pool to work with /64 prefixes Message-ID: Review at https://gerrit.osmocom.org/3457 ippool: Extend pool to work with /64 prefixes In IPv6 GPRS, we actually don't want to allocate an individual v6 address (like in IPv4), but we want to allocate a prefix. The standard prefix lengh is 8 bytes, i.e. a /64 prefix. This patch extends the pool to be able to work with such v6 prefixes. Change-Id: I0cf700b6baf195a2e5fbea000531f801acaaa443 --- M ggsn/ggsn.c M lib/ippool.c 2 files changed, 14 insertions(+), 7 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openggsn refs/changes/57/3457/1 diff --git a/ggsn/ggsn.c b/ggsn/ggsn.c index 0629f9e..9b11884 100644 --- a/ggsn/ggsn.c +++ b/ggsn/ggsn.c @@ -241,7 +241,11 @@ dst.len = 4; dst.v4.s_addr = iph->daddr; } else if (iph->version == 6) { - dst.len = 16; + /* Due to the fact that 3GPP requires an allocation of a + * /64 prefix to each MS, we must instruct + * ippool_getip() below to match only the leading /64 + * prefix, i.e. the first 8 bytes of the address */ + dst.len = 8; dst.v6 = ip6h->ip6_dst; } else { LOGP(DGGSN, LOGL_NOTICE, "non-IPv packet received from tun\n"); diff --git a/lib/ippool.c b/lib/ippool.c index 007dc50..683d2d8 100644 --- a/lib/ippool.c +++ b/lib/ippool.c @@ -96,11 +96,10 @@ return lookup((unsigned char *)&addr->s_addr, sizeof(addr->s_addr), 0); } -static unsigned long int ippool_hash6(struct in6_addr *addr) +static unsigned long int ippool_hash6(struct in6_addr *addr, unsigned int len) { /* TODO: Review hash spread for IPv6 */ - return lookup((unsigned char *)addr->s6_addr, sizeof(addr->s6_addr), - 0); + return lookup((unsigned char *)addr->s6_addr, len, 0); } unsigned long int ippool_hash(struct in46_addr *addr) @@ -108,7 +107,7 @@ if (addr->len == 4) return ippool_hash4(&addr->v4); else - return ippool_hash6(&addr->v6); + return ippool_hash6(&addr->v6, addr->len); } /* Get IP address and mask */ @@ -209,6 +208,10 @@ "Failed to parse dynamic pool"); return -1; } + /* we want to work with /64 prefixes, i.e. allocate /64 prefixes rather + * than /128 (single IPv6 addresses) */ + if (addr->len == sizeof(in6_addr)) + addr->len = 64/8; /* Set IPPOOL_NONETWORK if IPPOOL_NOGATEWAY is set */ if (flags & IPPOOL_NOGATEWAY) { @@ -348,7 +351,7 @@ /* Find in hash table */ hash = ippool_hash(addr) & this->hashmask; for (p = this->hash[hash]; p; p = p->nexthash) { - if (in46a_equal(&p->addr, addr)) { + if (in46a_prefix_equal(&p->addr, addr)) { if (member) *member = p; return 0; @@ -421,7 +424,7 @@ /* Find in hash table */ hash = ippool_hash(addr) & this->hashmask; for (p = this->hash[hash]; p; p = p->nexthash) { - if (in46a_equal(&p->addr, addr)) { + if (in46a_prefix_equal(&p->addr, addr)) { p2 = p; break; } -- To view, visit https://gerrit.osmocom.org/3457 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I0cf700b6baf195a2e5fbea000531f801acaaa443 Gerrit-PatchSet: 1 Gerrit-Project: openggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Wed Aug 9 20:15:46 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 9 Aug 2017 20:15:46 +0000 Subject: [PATCH] openggsn[master]: IPv6: Implement IPv6 prefix assignment via ICMPv6 router adv... Message-ID: Review at https://gerrit.osmocom.org/3458 IPv6: Implement IPv6 prefix assignment via ICMPv6 router advertisement The 3GPP specs are quite strange when it comes to how an IPv6 address or rather prefix is assigned to an IPv6 PDP context. The designated method for allocating the IPv6 address via the PDP EUA (End User Address) Information Element in the GTP signalling plane is *not* used to allocate the address/prefix. Instead, the EUA is used to allocate an "interface identifier" to the MS, which it the uses to derive its link-local source address to send a router solicitation. The GGSN subsequently answers witha router advertisement, advertising a single/64 prefix, whihcthe MS then uses to generate it's real IPv6 source address for subsequent communication. Change-Id: Icddf7d30e01d76a4784bcef5787b36f52f703a9f --- M ggsn/Makefile.am A ggsn/checksum.c A ggsn/checksum.h M ggsn/ggsn.c A ggsn/icmpv6.c A ggsn/icmpv6.h M lib/debug.c M lib/in46_addr.c M lib/ippool.c M lib/syserr.h 10 files changed, 505 insertions(+), 5 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openggsn refs/changes/58/3458/1 diff --git a/ggsn/Makefile.am b/ggsn/Makefile.am index 3ad3a6e..c945f0b 100644 --- a/ggsn/Makefile.am +++ b/ggsn/Makefile.am @@ -12,7 +12,7 @@ endif ggsn_DEPENDENCIES = ../gtp/libgtp.la ../lib/libmisc.a -ggsn_SOURCES = ggsn.c cmdline.c cmdline.h gtp-kernel.h +ggsn_SOURCES = ggsn.c cmdline.c cmdline.h gtp-kernel.h icmpv6.c icmpv6.h checksum.c checksum.h if ENABLE_GTP_KERNEL ggsn_SOURCES += gtp-kernel.c diff --git a/ggsn/checksum.c b/ggsn/checksum.c new file mode 100644 index 0000000..1e9e58e --- /dev/null +++ b/ggsn/checksum.c @@ -0,0 +1,205 @@ +/* + * + * INET An implementation of the TCP/IP protocol suite for the LINUX + * operating system. INET is implemented using the BSD Socket + * interface as the means of communication with the user level. + * + * IP/TCP/UDP checksumming routines + * + * Authors: Jorge Cwik, + * Arnt Gulbrandsen, + * Tom May, + * Andreas Schwab, + * Lots of code moved from tcp.c and ip.c; see those files + * for more names. + * + * 03/02/96 Jes Sorensen, Andreas Schwab, Roman Hodek: + * Fixed some nasty bugs, causing some horrible crashes. + * A: At some points, the sum (%0) was used as + * length-counter instead of the length counter + * (%1). Thanks to Roman Hodek for pointing this out. + * B: GCC seems to mess up if one uses too many + * data-registers to hold input values and one tries to + * specify d0 and d1 as scratch registers. Letting gcc + * choose these registers itself solves the problem. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version + * 2 of the License, or (at your option) any later version. + */ + +/* Revised by Kenneth Albanowski for m68knommu. Basic problem: unaligned access + kills, so most of the assembly has to go. */ + +#include "checksum.h" +#include +#include + +static inline unsigned short from32to16(unsigned int x) +{ + /* add up 16-bit and 16-bit for 16+c bit */ + x = (x & 0xffff) + (x >> 16); + /* add up carry.. */ + x = (x & 0xffff) + (x >> 16); + return x; +} + +static unsigned int do_csum(const unsigned char *buff, int len) +{ + int odd; + unsigned int result = 0; + + if (len <= 0) + goto out; + odd = 1 & (unsigned long) buff; + if (odd) { +#ifdef __LITTLE_ENDIAN + result += (*buff << 8); +#else + result = *buff; +#endif + len--; + buff++; + } + if (len >= 2) { + if (2 & (unsigned long) buff) { + result += *(unsigned short *) buff; + len -= 2; + buff += 2; + } + if (len >= 4) { + const unsigned char *end = buff + ((unsigned)len & ~3); + unsigned int carry = 0; + do { + unsigned int w = *(unsigned int *) buff; + buff += 4; + result += carry; + result += w; + carry = (w > result); + } while (buff < end); + result += carry; + result = (result & 0xffff) + (result >> 16); + } + if (len & 2) { + result += *(unsigned short *) buff; + buff += 2; + } + } + if (len & 1) +#ifdef __LITTLE_ENDIAN + result += *buff; +#else + result += (*buff << 8); +#endif + result = from32to16(result); + if (odd) + result = ((result >> 8) & 0xff) | ((result & 0xff) << 8); +out: + return result; +} + +/* + * This is a version of ip_compute_csum() optimized for IP headers, + * which always checksum on 4 octet boundaries. + */ +uint16_t ip_fast_csum(const void *iph, unsigned int ihl) +{ + return (uint16_t)~do_csum(iph, ihl*4); +} + +/* + * computes the checksum of a memory block at buff, length len, + * and adds in "sum" (32-bit) + * + * returns a 32-bit number suitable for feeding into itself + * or csum_tcpudp_magic + * + * this function must be called with even lengths, except + * for the last fragment, which may be odd + * + * it's best to have buff aligned on a 32-bit boundary + */ +uint32_t csum_partial(const void *buff, int len, uint32_t wsum) +{ + unsigned int sum = (unsigned int)wsum; + unsigned int result = do_csum(buff, len); + + /* add in old sum, and carry.. */ + result += sum; + if (sum > result) + result += 1; + return (uint32_t)result; +} + +/* + * this routine is used for miscellaneous IP-like checksums, mainly + * in icmp.c + */ +uint16_t ip_compute_csum(const void *buff, int len) +{ + return (uint16_t)~do_csum(buff, len); +} + +uint16_t csum_ipv6_magic(const struct in6_addr *saddr, + const struct in6_addr *daddr, + uint32_t len, uint8_t proto, uint32_t csum) +{ + int carry; + uint32_t ulen; + uint32_t uproto; + uint32_t sum = (uint32_t)csum; + + sum += (uint32_t)saddr->s6_addr32[0]; + carry = (sum < (uint32_t)saddr->s6_addr32[0]); + sum += carry; + + sum += (uint32_t)saddr->s6_addr32[1]; + carry = (sum < (uint32_t)saddr->s6_addr32[1]); + sum += carry; + + sum += (uint32_t)saddr->s6_addr32[2]; + carry = (sum < (uint32_t)saddr->s6_addr32[2]); + sum += carry; + + sum += (uint32_t)saddr->s6_addr32[3]; + carry = (sum < (uint32_t)saddr->s6_addr32[3]); + sum += carry; + + sum += (uint32_t)daddr->s6_addr32[0]; + carry = (sum < (uint32_t)daddr->s6_addr32[0]); + sum += carry; + + sum += (uint32_t)daddr->s6_addr32[1]; + carry = (sum < (uint32_t)daddr->s6_addr32[1]); + sum += carry; + + sum += (uint32_t)daddr->s6_addr32[2]; + carry = (sum < (uint32_t)daddr->s6_addr32[2]); + sum += carry; + + sum += (uint32_t)daddr->s6_addr32[3]; + carry = (sum < (uint32_t)daddr->s6_addr32[3]); + sum += carry; + + ulen = (uint32_t)htonl((uint32_t) len); + sum += ulen; + carry = (sum < ulen); + sum += carry; + + uproto = (uint32_t)htonl(proto); + sum += uproto; + carry = (sum < uproto); + sum += carry; + + return csum_fold((uint32_t)sum); +} + +/* fold a partial checksum */ +uint16_t csum_fold(uint32_t csum) +{ + uint32_t sum = (uint32_t)csum; + sum = (sum & 0xffff) + (sum >> 16); + sum = (sum & 0xffff) + (sum >> 16); + return (uint16_t)~sum; +} diff --git a/ggsn/checksum.h b/ggsn/checksum.h new file mode 100644 index 0000000..4b22431 --- /dev/null +++ b/ggsn/checksum.h @@ -0,0 +1,13 @@ +#pragma once +#include +#include + +uint16_t ip_fast_csum(const void *iph, unsigned int ihl); +uint32_t csum_partial(const void *buff, int len, uint32_t wsum); +uint16_t ip_compute_csum(const void *buff, int len); + +uint16_t csum_ipv6_magic(const struct in6_addr *saddr, + const struct in6_addr *daddr, + uint32_t len, uint8_t proto, uint32_t csum); + +uint16_t csum_fold(uint32_t csum); diff --git a/ggsn/ggsn.c b/ggsn/ggsn.c index 9b11884..c307177 100644 --- a/ggsn/ggsn.c +++ b/ggsn/ggsn.c @@ -64,6 +64,7 @@ #include "../gtp/gtp.h" #include "cmdline.h" #include "gtp-kernel.h" +#include "icmpv6.h" int end = 0; int maxfd = 0; /* For select() */ @@ -206,11 +207,23 @@ return 0; /* Allready in use, or no more available */ } - in46a_to_eua(&member->addr, &pdp->eua); + if (addr.len == sizeof(struct in6_addr)) { + struct in46_addr tmp; + /* IPv6 doesn't really send the real/allocated address at this point, but just + * the link-identifier which the MS shall use for router solicitation */ + tmp.len = addr.len; + /* initialize upper 64 bits to prefix, they are discarded by MS anyway */ + memcpy(tmp.v6.s6_addr, &member->addr.v6, 8); + /* use allocated 64bit prefix as lower 64bit, used as link id by MS */ + memcpy(tmp.v6.s6_addr+8, &member->addr.v6, 8); + in46a_to_eua(&tmp, &pdp->eua); + } else + in46a_to_eua(&member->addr, &pdp->eua); pdp->peer = member; pdp->ipif = tun; /* TODO */ member->peer = pdp; + /* TODO: In IPv6, EUA doesn't contain the actual IP addr/prefix! */ if (gtp_kernel_tunnel_add(pdp) < 0) { SYS_ERR(DGGSN, LOGL_ERROR, 0, "Cannot add tunnel to kernel: %s\n", strerror(errno)); @@ -264,9 +277,30 @@ return 0; } +/* RFC3307 link-local scope multicast address */ +static const struct in6_addr all_router_mcast_addr = { + .s6_addr = { 0xff,0x02,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,2 } +}; + int encaps_tun(struct pdp_t *pdp, void *pack, unsigned len) { + struct iphdr *iph = (struct iphdr *)pack; + struct ip6_hdr *ip6h = (struct ip6_hdr *)pack; + DEBUGP(DGGSN, "encaps_tun. Packet received: forwarding to tun\n"); + + switch (iph->version) { + case 6: + /* daddr: all-routers multicast addr */ + if (IN6_ARE_ADDR_EQUAL(&ip6h->ip6_dst, &all_router_mcast_addr)) + return handle_router_mcast(gsn, pdp, pack, len); + break; + case 4: + break; + default: + LOGP(DGGSN, LOGL_ERROR, "Packet from MS is neither IPv4 nor IPv6\n"); + return -1; + } return tun_encaps((struct tun_t *)pdp->ipif, pack, len); } diff --git a/ggsn/icmpv6.c b/ggsn/icmpv6.c new file mode 100644 index 0000000..94c980b --- /dev/null +++ b/ggsn/icmpv6.c @@ -0,0 +1,234 @@ +/* Minimal ICMPv6 code for generating router advertisements as required by + * relevant 3GPP specs for a GGSN with IPv6 PDP contexts */ + +/* (C) 2017 by Harald Welte + * + * The contents of this file may be used under the terms of the GNU + * General Public License Version 2, provided that the above copyright + * notice and this permission notice is included in all copies or + * substantial portions of the software. + */ + +#include +#include +#include +#include +#include + +#include +#include +#include "checksum.h" + +#include "../gtp/gtp.h" +#include "../gtp/pdp.h" +#include "../lib/ippool.h" +#include "../lib/syserr.h" +#include "config.h" + +/* 29.061 11.2.1.3.4 IPv6 Router Configuration Variables in GGSN */ +#define GGSN_MaxRtrAdvInterval 21600 /* 6 hours */ +#define GGSN_MinRtrAdvInterval 16200 /* 4.5 hours */ +#define GGSN_AdvValidLifetime 0xffffffff /* infinite */ +#define GGSN_AdvPreferredLifetime 0xffffffff /* infinite */ + +struct icmpv6_hdr { + uint8_t type; + uint8_t code; + uint16_t csum; +} __attribute__ ((packed)); + +/* RFC4861 Section 4.2 */ +struct icmpv6_radv_hdr { + struct icmpv6_hdr hdr; + uint8_t cur_ho_limit; +#if __BYTE_ORDER == __LITTLE_ENDIAN + uint8_t res:6, + m:1, + o:1; +#elif __BYTE_ORDER == __BIG_ENDIAN + uint8_t m:1, + o:1, + res:6; +#else +# error "Please fix " +#endif + uint16_t router_lifetime; + uint32_t reachable_time; + uint32_t retrans_timer; + uint8_t options[0]; +} __attribute__ ((packed)); + +/* RFC4861 Section 4.6 */ +struct icmpv6_opt_hdr { + uint8_t type; + /* length in units of 8 octets, including type+len! */ + uint8_t len; + uint8_t data[0]; +} __attribute__ ((packed)); + +/* RFC4861 Section 4.6.2 */ +struct icmpv6_opt_prefix { + struct icmpv6_opt_hdr hdr; + uint8_t prefix_len; +#if __BYTE_ORDER == __LITTLE_ENDIAN + uint8_t res:6, + a:1, + l:1; +#elif __BYTE_ORDER == __BIG_ENDIAN + uint8_t l:1, + a:1, + res:6; +#else +# error "Please fix " +#endif + uint32_t valid_lifetime; + uint32_t preferred_lifetime; + uint32_t res2; + uint8_t prefix[16]; +} __attribute__ ((packed)); + + +/*! construct a 3GPP 29.061 compliant router advertisement for a given prefix + * \param[in] saddr Source IPv6 address for router advertisement + * \param[in] daddr Destination IPv6 address for router advertisement IPv6 header + * \param[in] prefix The single prefix to be advertised (/64 implied!)i + * \returns callee-allocated message buffer containing router advertisement */ +struct msgb *icmpv6_construct_ra(const struct in6_addr *saddr, + const struct in6_addr *daddr, + const struct in6_addr *prefix) +{ + struct msgb *msg = msgb_alloc_headroom(512,128, "IPv6 RA"); + struct icmpv6_radv_hdr *ra; + struct icmpv6_opt_prefix *ra_opt_pref; + struct ip6_hdr *i6h; + uint32_t len; + uint16_t skb_csum; + + OSMO_ASSERT(msg); + + ra = (struct icmpv6_radv_hdr *) msgb_put(msg, sizeof(*ra)); + ra->hdr.type = 134; /* see RFC4861 4.2 */ + ra->hdr.code = 0; /* see RFC4861 4.2 */ + ra->hdr.csum = 0; /* updated below */ + ra->cur_ho_limit = 64; /* seems reasonable? */ + /* the GGSN shall leave the M-flag cleared in the Router + * Advertisement messages */ + ra->m = 0; + /* The GGSN may set the O-flag if there are additional + * configuration parameters that need to be fetched by the MS */ + ra->o = 0; /* no DHCPv6 */ + ra->res = 0; + /* RFC4861 Default: 3 * MaxRtrAdvInterval */ + ra->router_lifetime = htons(3*GGSN_MaxRtrAdvInterval); + ra->reachable_time = 0; /* Unspecified */ + + /* RFC4861 Section 4.6.2 */ + ra_opt_pref = (struct icmpv6_opt_prefix *) msgb_put(msg, sizeof(*ra_opt_pref)); + ra_opt_pref->hdr.type = 3; /* RFC4861 4.6.2 */ + ra_opt_pref->hdr.len = 4; /* RFC4861 4.6.2 */ + ra_opt_pref->prefix_len = 64; /* only prefix length as per 3GPP */ + /* The Prefix is contained in the Prefix Information Option of + * the Router Advertisements and shall have the A-flag set + * and the L-flag cleared */ + ra_opt_pref->a = 1; + ra_opt_pref->l = 0; + ra_opt_pref->res = 0; + /* The lifetime of the prefix shall be set to infinity */ + ra_opt_pref->valid_lifetime = htonl(GGSN_AdvValidLifetime); + ra_opt_pref->preferred_lifetime = htonl(GGSN_AdvPreferredLifetime); + ra_opt_pref->res2 = 0; + memcpy(ra_opt_pref->prefix, prefix, sizeof(ra_opt_pref->prefix)); + + /* checksum */ + skb_csum = csum_partial(msgb_data(msg), msgb_length(msg), 0); + len = msgb_length(msg); + ra->hdr.csum = csum_ipv6_magic(saddr, daddr, len, IPPROTO_ICMPV6, skb_csum); + + /* Push IPv6 header in front of ICMPv6 packet */ + i6h = (struct ip6_hdr *) msgb_push(msg, sizeof(*i6h)); + /* 4 bits version, 8 bits TC, 20 bits flow-ID */ + i6h->ip6_ctlun.ip6_un1.ip6_un1_flow = htonl(0x60000000); + i6h->ip6_ctlun.ip6_un1.ip6_un1_plen = htons(len); + i6h->ip6_ctlun.ip6_un1.ip6_un1_nxt = IPPROTO_ICMPV6; + i6h->ip6_ctlun.ip6_un1.ip6_un1_hlim = 255; + i6h->ip6_src = *saddr; + i6h->ip6_dst = *daddr; + + return msg; +} + +/* Walidate an ICMPv6 router solicitation according to RFC4861 6.1.1 */ +static bool icmpv6_validate_router_solicit(const uint8_t *pack, unsigned len) +{ + const struct ip6_hdr *ip6h = (struct ip6_hdr *)pack; + //const struct icmpv6_hdr *ic6h = (struct icmpv6_hdr *) (pack + sizeof(*ip6h)); + + /* Hop limit field must have 255 */ + if (ip6h->ip6_ctlun.ip6_un1.ip6_un1_hlim != 255) + return false; + /* FIXME: ICMP checksum is valid */ + /* ICMP length (derived from IP length) is 8 or more octets */ + if (ip6h->ip6_ctlun.ip6_un1.ip6_un1_plen < 8) + return false; + /* FIXME: All included options have a length > 0 */ + /* FIXME: If IP source is unspecified, no source link-layer addr option */ + return true; +} + +/* RFC3307 link-local scope multicast address */ +static const struct in6_addr my_local_addr = { + .s6_addr = { 0x01,0x02,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0xff } +}; + +/* handle incoming packets to the all-routers multicast address */ +int handle_router_mcast(struct gsn_t *gsn, struct pdp_t *pdp, const uint8_t *pack, unsigned len) +{ + struct ippoolm_t *member = pdp->peer; + const struct ip6_hdr *ip6h = (struct ip6_hdr *)pack; + const struct icmpv6_hdr *ic6h = (struct icmpv6_hdr *) (pack + sizeof(*ip6h)); + struct msgb *msg; + + OSMO_ASSERT(pdp); + OSMO_ASSERT(member); + + if (len < sizeof(*ip6h)) { + LOGP(DICMP6, LOGL_NOTICE, "Packet too short: %u bytes\n", len); + return -1; + } + + /* we only treat ICMPv6 here */ + if (ip6h->ip6_ctlun.ip6_un1.ip6_un1_nxt != IPPROTO_ICMPV6) { + LOGP(DICMP6, LOGL_DEBUG, "Ignoring non-ICMP to all-routers mcast\n"); + return 0; + } + + if (len < sizeof(*ip6h) + sizeof(*ic6h)) { + LOGP(DICMP6, LOGL_NOTICE, "Short ICMPv6 packet: %s\n", osmo_hexdump(pack, len)); + return -1; + } + + switch (ic6h->type) { + case 133: /* router solicitation */ + if (ic6h->code != 0) { + LOGP(DICMP6, LOGL_NOTICE, "ICMPv6 type 133 but code %d\n", ic6h->code); + return -1; + } + if (!icmpv6_validate_router_solicit(pack, len)) { + LOGP(DICMP6, LOGL_NOTICE, "Invalid Router Solicitation: %s\n", + osmo_hexdump(pack, len)); + return -1; + } + /* FIXME: Send router advertisement from GGSN link-local + * address to MS link-local address, including prefix + * allocated to this PDP context */ + msg = icmpv6_construct_ra(&my_local_addr, &ip6h->ip6_src, &member->addr.v6); + /* Send the constructed RA to the MS */ + gtp_data_req(gsn, pdp, msgb_data(msg), msgb_length(msg)); + msgb_free(msg); + break; + default: + LOGP(DICMP6, LOGL_DEBUG, "Unknown ICMPv6 type %u\n", ic6h->type); + break; + } + return 0; +} diff --git a/ggsn/icmpv6.h b/ggsn/icmpv6.h new file mode 100644 index 0000000..ebff04e --- /dev/null +++ b/ggsn/icmpv6.h @@ -0,0 +1,6 @@ +#pragma once + +#include "../gtp/gtp.h" +#include "../gtp/pdp.h" + +int handle_router_mcast(struct gsn_t *gsn, struct pdp_t *pdp, const uint8_t *pack, unsigned len); diff --git a/lib/debug.c b/lib/debug.c index b3850f9..83423dc 100644 --- a/lib/debug.c +++ b/lib/debug.c @@ -26,6 +26,11 @@ .description = "SGSN Emulator", .enabled = 1, .loglevel = LOGL_NOTICE, }, + [DICMP6] = { + .name = "DICMP6", + .description = "ICMPv6", + .enabled = 1, .loglevel = LOGL_DEBUG, + }, }; const struct log_info log_info = { diff --git a/lib/in46_addr.c b/lib/in46_addr.c index a220583..1785377 100644 --- a/lib/in46_addr.c +++ b/lib/in46_addr.c @@ -25,6 +25,7 @@ switch (in->len) { case 4: return AF_INET; + case 8: case 16: return AF_INET6; default: @@ -175,6 +176,7 @@ eua->v[1] = 0x21; /* IPv4 */ memcpy(&eua->v[2], &src->v4, 4); /* Copy a 4 byte address */ break; + case 8: case 16: eua->l = 18; eua->v[0] = 0xf1; /* IETF */ diff --git a/lib/ippool.c b/lib/ippool.c index 683d2d8..1729ec7 100644 --- a/lib/ippool.c +++ b/lib/ippool.c @@ -210,8 +210,8 @@ } /* we want to work with /64 prefixes, i.e. allocate /64 prefixes rather * than /128 (single IPv6 addresses) */ - if (addr->len == sizeof(in6_addr)) - addr->len = 64/8; + if (addr.len == sizeof(struct in6_addr)) + addr.len = 64/8; /* Set IPPOOL_NONETWORK if IPPOOL_NOGATEWAY is set */ if (flags & IPPOOL_NOGATEWAY) { @@ -453,7 +453,7 @@ return -GTPCAUSE_SYS_FAIL; /* Allready in use / Should not happen */ } - if (p2->addr.len != addr->len) { + if (p2->addr.len != addr->len && !(addr->len == 16 && p2->addr.len == 8)) { SYS_ERR(DIP, LOGL_ERROR, 0, "MS requested unsupported PDP context type"); return -GTPCAUSE_UNKNOWN_PDP; } diff --git a/lib/syserr.h b/lib/syserr.h index 0c50a5f..adc5840 100644 --- a/lib/syserr.h +++ b/lib/syserr.h @@ -19,6 +19,7 @@ DTUN, DGGSN, DSGSN, + DICMP6, }; #define SYS_ERR(sub, pri, en, fmt, args...) \ -- To view, visit https://gerrit.osmocom.org/3458 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Icddf7d30e01d76a4784bcef5787b36f52f703a9f Gerrit-PatchSet: 1 Gerrit-Project: openggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Wed Aug 9 20:15:46 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 9 Aug 2017 20:15:46 +0000 Subject: [PATCH] openggsn[master]: IPv6: Support PCO for IPv6 DNS addresses Message-ID: Review at https://gerrit.osmocom.org/3459 IPv6: Support PCO for IPv6 DNS addresses In IPv6, DNS server information is not passed along as IPCP6 like in IPv5 with IPCP. The reason is that IPCP6 (for PPP) doesn't support passing DNS server information. Rather, the relevant RFCs indicate DHCPv6 should be used even over point-to-point links. 3GPP decided to avoid DHCPv6 dependency for stateless autoconfiguration (the only mandatory IPv6 configuration mechanism) and added some new non-PPP-style PCO information elements ("containers") which can among other things inform a MS about IPV6 DNS servers. That same mechanism can also be used to inform the MS about IPv4 DNS servers, so for IPv4 there are now two competing mechanisms: IPCP and the new "native" PCO container. With this patch, we support both for IPv4. Change-Id: I21499afd61def8c925f7838bde76f34d28214b56 --- M ggsn/ggsn.c 1 file changed, 137 insertions(+), 42 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openggsn refs/changes/59/3459/1 diff --git a/ggsn/ggsn.c b/ggsn/ggsn.c index c307177..991b54c 100644 --- a/ggsn/ggsn.c +++ b/ggsn/ggsn.c @@ -72,7 +72,7 @@ struct in_addr listen_; struct in_addr netaddr, destaddr, net; /* Network interface */ size_t prefixlen; -struct in_addr dns1, dns2; /* PCO DNS address */ +struct in46_addr dns1, dns2; /* PCO DNS address */ char *ipup, *ipdown; /* Filename of scripts */ int debug; /* Print debug output */ struct ul255_t pco; @@ -175,6 +175,103 @@ return 0; } +#include + +/* 3GPP TS 24.008 10.6.5.3 */ +enum pco_protocols { + PCO_P_LCP = 0xC021, + PCO_P_PAP = 0xC023, + PCO_P_CHAP = 0xC223, + PCO_P_IPCP = 0x8021, + PCO_P_PCSCF_ADDR = 0x0001, + PCO_P_IM_CN_SS_F = 0x0002, + PCO_P_DNS_IPv6_ADDR = 0x0003, + PCO_P_POLICY_CTRL_REJ = 0x0004, /* only in Network->MS */ + PCO_P_MS_SUP_NETREQ_BCI = 0x0005, + /* reserved */ + PCO_P_DSMIPv6_HA_ADDR = 0x0007, + PCO_P_DSMIPv6_HN_PREF = 0x0008, + PCO_P_DSMIPv6_v4_HA_ADDR= 0x0009, + PCO_P_IP_ADDR_VIA_NAS = 0x000a, /* only MS->Network */ + PCO_P_IPv4_ADDR_VIA_DHCP= 0x000b, /* only MS->Netowrk */ + PCO_P_PCSCF_IPv4_ADDR = 0x000c, + PCO_P_DNS_IPv4_ADDR = 0x000d, + PCO_P_MSISDN = 0x000e, + PCO_P_IFOM_SUPPORT = 0x000f, + PCO_P_IPv4_LINK_MTU = 0x0010, + PCO_P_MS_SUPP_LOC_A_TFT = 0x0011, + PCO_P_PCSCF_RESEL_SUP = 0x0012, /* only MS->Network */ + PCO_P_NBIFOM_REQ = 0x0013, + PCO_P_NBIFOM_MODE = 0x0014, + PCO_P_NONIP_LINK_MTU = 0x0015, + PCO_P_APN_RATE_CTRL_SUP = 0x0016, + PCO_P_PS_DATA_OFF_UE = 0x0017, + PCO_P_REL_DATA_SVC = 0x0018, +}; + +/* determine if PCO contains given protocol */ +static bool pco_contains_proto(struct ul255_t *pco, uint16_t prot) +{ + uint8_t *cur = pco->v + 1; + + /* iterate over PCO and check if protocol contained */ + while (cur + 2 < pco->v + pco->l) { + uint16_t cur_prot = osmo_load16be(cur); + uint8_t cur_len = cur[2]; + if (cur_prot == prot) + return true; + if (cur_len == 0) + break; + cur += cur_len; + } + return false; +} + +/* determine if PDP context has IPv6 support */ +static bool pdp_has_v4(struct pdp_t *pdp) +{ + if (pdp->eua.l == 4+2) + return true; + else + return false; +} + +/* process one PCO request from a MS/UE, putting together the proper responses */ +static void process_pco(struct pdp_t *pdp) +{ + struct msgb *msg = msgb_alloc(256, "PCO"); + msgb_put_u8(msg, 0x80); /* ext-bit + configuration protocol byte */ + + /* FIXME: also check if primary / secondary DNS was requested */ + if (pdp_has_v4(pdp) && pco_contains_proto(&pdp->pco_req, PCO_P_IPCP)) { + /* FIXME: properly implement this for IPCP */ + uint8_t *cur = msgb_put(msg, pco.l-1); + memcpy(cur, pco.v+1, pco.l-1); + } + + if (pco_contains_proto(&pdp->pco_req, PCO_P_DNS_IPv6_ADDR)) { + if (dns1.len == 16) + msgb_t16lv_put(msg, PCO_P_DNS_IPv6_ADDR, dns1.len, dns1.v6.s6_addr); + if (dns2.len == 16) + msgb_t16lv_put(msg, PCO_P_DNS_IPv6_ADDR, dns2.len, dns2.v6.s6_addr); + } + + if (pco_contains_proto(&pdp->pco_req, PCO_P_DNS_IPv4_ADDR)) { + if (dns1.len == 4) + msgb_t16lv_put(msg, PCO_P_DNS_IPv4_ADDR, dns1.len, (uint8_t *)&dns1.v4); + if (dns2.len == 4) + msgb_t16lv_put(msg, PCO_P_DNS_IPv4_ADDR, dns2.len, (uint8_t *)&dns2.v4); + } + + if (msgb_length(msg) > 1) { + memcpy(pdp->pco_neg.v, msgb_data(msg), msgb_length(msg)); + pdp->pco_neg.l = msgb_length(msg); + } else + pdp->pco_neg.l = 0; + + msgb_free(msg); +} + int create_context_ind(struct pdp_t *pdp) { struct in46_addr addr; @@ -188,7 +285,6 @@ pdp->eua.l = 2; memcpy(pdp->qos_neg0, pdp->qos_req0, sizeof(pdp->qos_req0)); - memcpy(&pdp->pco_neg, &pco, sizeof(pdp->pco_neg)); memcpy(pdp->qos_neg.v, pdp->qos_req.v, pdp->qos_req.l); /* TODO */ pdp->qos_neg.l = pdp->qos_req.l; @@ -235,6 +331,8 @@ gtp_create_context_resp(gsn, pdp, GTPCAUSE_NO_RESOURCES); return 0; } + + process_pco(pdp); gtp_create_context_resp(gsn, pdp, GTPCAUSE_ACC_REQ); return 0; /* Success */ @@ -486,59 +584,56 @@ } /* DNS1 and DNS2 */ -#ifdef HAVE_INET_ATON - dns1.s_addr = 0; + memset(&dns1, 0, sizeof(dns1)); if (args_info.pcodns1_arg) { - if (0 == inet_aton(args_info.pcodns1_arg, &dns1)) { + size_t tmp; + if (ippool_aton(&dns1, &tmp, args_info.pcodns1_arg, 0) != 0) { SYS_ERR(DGGSN, LOGL_ERROR, 0, "Failed to convert pcodns1!"); exit(1); } } - dns2.s_addr = 0; + memset(&dns2, 0, sizeof(dns2)); if (args_info.pcodns2_arg) { - if (0 == inet_aton(args_info.pcodns2_arg, &dns2)) { + size_t tmp; + if (ippool_aton(&dns2, &tmp, args_info.pcodns2_arg, 0) != 0) { SYS_ERR(DGGSN, LOGL_ERROR, 0, "Failed to convert pcodns2!"); exit(1); } } -#else - dns1.s_addr = 0; - if (args_info.pcodns1_arg) { - dns1.s_addr = inet_addr(args_info.pcodns1_arg); - if (dns1.s_addr == -1) { - SYS_ERR(DGGSN, LOGL_ERROR, 0, - "Failed to convert pcodns1!"); - exit(1); - } - } - dns2.s_addr = 0; - if (args_info.pcodns2_arg) { - dns2.s_addr = inet_addr(args_info.pcodns2_arg); - if (dns2.s_addr == -1) { - SYS_ERR(DGGSN, LOGL_ERROR, 0, - "Failed to convert pcodns2!"); - exit(1); - } - } -#endif - pco.l = 20; - pco.v[0] = 0x80; /* x0000yyy x=1, yyy=000: PPP */ - pco.v[1] = 0x80; /* IPCP */ - pco.v[2] = 0x21; - pco.v[3] = 0x10; /* Length of contents */ - pco.v[4] = 0x02; /* ACK */ - pco.v[5] = 0x00; /* ID: Need to match request */ - pco.v[6] = 0x00; /* Length */ - pco.v[7] = 0x10; - pco.v[8] = 0x81; /* DNS 1 */ - pco.v[9] = 0x06; - memcpy(&pco.v[10], &dns1, sizeof(dns1)); - pco.v[14] = 0x83; - pco.v[15] = 0x06; /* DNS 2 */ - memcpy(&pco.v[16], &dns2, sizeof(dns2)); + unsigned int cur = 0; + pco.v[cur++] = 0x80; /* x0000yyy x=1, yyy=000: PPP */ + pco.v[cur++] = 0x80; /* IPCP */ + pco.v[cur++] = 0x21; + pco.v[cur++] = 0xFF; /* Length of contents */ + pco.v[cur++] = 0x02; /* ACK */ + pco.v[cur++] = 0x00; /* ID: Need to match request */ + pco.v[cur++] = 0x00; /* Length */ + pco.v[cur++] = 0xFF; /* overwritten */ + if (dns1.len == 4) { + pco.v[cur++] = 0x81; /* DNS 1 */ + pco.v[cur++] = 2 + dns1.len; + if (dns1.len == 4) + memcpy(&pco.v[cur], &dns1.v4, dns1.len); + else + memcpy(&pco.v[cur], &dns1.v6, dns1.len); + cur += dns1.len; + } + if (dns2.len == 4) { + pco.v[cur++] = 0x83; + pco.v[cur++] = 2 + dns2.len; /* DNS 2 */ + if (dns2.len == 4) + memcpy(&pco.v[cur], &dns2.v4, dns2.len); + else + memcpy(&pco.v[cur], &dns2.v6, dns2.len); + cur += dns2.len; + } + pco.l = cur; + /* patch in length values */ + pco.v[3] = pco.l - 4; + pco.v[7] = pco.l - 4; /* ipup */ ipup = args_info.ipup_arg; -- To view, visit https://gerrit.osmocom.org/3459 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I21499afd61def8c925f7838bde76f34d28214b56 Gerrit-PatchSet: 1 Gerrit-Project: openggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Wed Aug 9 20:15:47 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 9 Aug 2017 20:15:47 +0000 Subject: [PATCH] openggsn[master]: IPv6: in46_addr: OSMO_ASSERT() in case of unsupported calls Message-ID: Review at https://gerrit.osmocom.org/3460 IPv6: in46_addr: OSMO_ASSERT() in case of unsupported calls There's a bit of trickery with the ip_pool and it's "lengty=8" IPv6 prefix handling, let's make sure we don't accidentially call any support functions with addresses of wrong length. Change-Id: I444c190bdcd18780344e1f0dad4faf3bcf9da5a5 --- M lib/in46_addr.c 1 file changed, 6 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openggsn refs/changes/60/3460/1 diff --git a/lib/in46_addr.c b/lib/in46_addr.c index 1785377..8f5cc09 100644 --- a/lib/in46_addr.c +++ b/lib/in46_addr.c @@ -11,6 +11,8 @@ #include "../lib/in46_addr.h" +#include + #include #include #include @@ -29,6 +31,7 @@ case 16: return AF_INET6; default: + OSMO_ASSERT(0); return -1; } } @@ -49,6 +52,7 @@ sin6->sin6_addr = in->v6; break; default: + OSMO_ASSERT(0); return -1; } @@ -161,6 +165,7 @@ create_ipv6_netmask(&netmask6, prefixlen); return ipv6_within_mask(&addr->v6, &net->v6, &netmask6); default: + OSMO_ASSERT(0); return 0; } } @@ -184,6 +189,7 @@ memcpy(&eua->v[2], &src->v6, 16); /* Copy a 16 byte address */ break; default: + OSMO_ASSERT(0); return -1; } return 0; -- To view, visit https://gerrit.osmocom.org/3460 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I444c190bdcd18780344e1f0dad4faf3bcf9da5a5 Gerrit-PatchSet: 1 Gerrit-Project: openggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte From admin at opensuse.org Wed Aug 9 19:54:33 2017 From: admin at opensuse.org (OBS Notification) Date: Wed, 09 Aug 2017 19:54:33 +0000 Subject: Build failure of network:osmocom:nightly/libosmocore in xUbuntu_16.04/i586 In-Reply-To: References: Message-ID: <598b687d77dbb_5f97c0cf882775dd@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/libosmocore/xUbuntu_16.04/i586 Package network:osmocom:nightly/libosmocore failed to build in xUbuntu_16.04/i586 Check out the package for editing: osc checkout network:osmocom:nightly libosmocore Last lines of build log: [ 251s] | [ 251s] | This file was extended by libosmocore config.status 0.9.6.20170809, which was [ 251s] | generated by GNU Autoconf 2.69. Invocation command line was [ 251s] | [ 251s] | CONFIG_FILES = [ 251s] | CONFIG_HEADERS = [ 251s] | CONFIG_LINKS = [ 251s] | CONFIG_COMMANDS = [ 251s] | $ ./config.status Doxyfile.core [ 251s] | [ 251s] | on build31 [ 251s] | [ 251s] | config.status:1172: creating Doxyfile.core [ 251s] [ 251s] debian/rules:26: recipe for target 'override_dh_auto_test' failed [ 251s] make[1]: *** [override_dh_auto_test] Error 1 [ 251s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 251s] debian/rules:15: recipe for target 'build' failed [ 251s] make: *** [build] Error 2 [ 251s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 251s] [ 251s] build31 failed "build libosmocore_0.9.6.20170809.dsc" at Wed Aug 9 19:54:26 UTC 2017. [ 251s] [ 251s] ### VM INTERACTION START ### [ 253s] [ 239.590395] reboot: Power down [ 254s] ### VM INTERACTION END ### [ 254s] [ 254s] build31 failed "build libosmocore_0.9.6.20170809.dsc" at Wed Aug 9 19:54:30 UTC 2017. [ 254s] -- 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 Aug 9 20:32:56 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 9 Aug 2017 20:32:56 +0000 Subject: osmo-iuh[master]: make point codes configurable by SCCP address book In-Reply-To: References: Message-ID: Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3394 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I33a7ba11eb7c2d9a5dc74d10fb0cf04bf664477b Gerrit-PatchSet: 3 Gerrit-Project: osmo-iuh Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Aug 9 20:32:58 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 9 Aug 2017 20:32:58 +0000 Subject: [MERGED] osmo-iuh[master]: make point codes configurable by SCCP address book In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: make point codes configurable by SCCP address book ...................................................................... make point codes configurable by SCCP address book In the vty config, use the SCCP address book to configure the local and remote SCCP addresses. Add VTY commands to set the remote SCCP addresses by name, derive the ss7 instance from these addresses: cs7 instance 1 point-code 0.23.0 sccp-address msc point-code 0.0.1 sccp-address sgsn point-code 0.0.2 hnbgw iucs remote-addr msc iups remote-addr sgsn Enforce that both IuCS and IuPS use the same ss7 instance. In the future, we may add the feature to use two separate instances. Depends: libosmo-sccp I75c67d289693f1c2a049ac61cf2b2097d6e5687d, Ie1aedd7894acd69ddc887cd65a8a0df4b888838c, I85b46269dbe7909e52873ace3f720f6292a4516c Change-Id: I33a7ba11eb7c2d9a5dc74d10fb0cf04bf664477b --- M include/osmocom/iuh/hnbgw.h M include/osmocom/iuh/hnbgw_cn.h M src/hnbgw.c M src/hnbgw_cn.c M src/hnbgw_rua.c M src/hnbgw_vty.c 6 files changed, 120 insertions(+), 100 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/include/osmocom/iuh/hnbgw.h b/include/osmocom/iuh/hnbgw.h index db22d97..58bdab4 100644 --- a/include/osmocom/iuh/hnbgw.h +++ b/include/osmocom/iuh/hnbgw.h @@ -116,10 +116,8 @@ /*! The UDP port where we receive multiplexed CS user * plane traffic from HNBs */ uint16_t iuh_cs_mux_port; - const char *iucs_remote_ip; - uint16_t iucs_remote_port; - const char *iups_remote_ip; - uint16_t iups_remote_port; + const char *iucs_remote_addr_name; + const char *iups_remote_addr_name; uint16_t rnc_id; bool hnbap_allow_tmsi; } config; @@ -134,11 +132,11 @@ /* currently active CN links for CS and PS */ struct { - struct osmo_sccp_instance *instance; + struct osmo_sccp_instance *client; struct hnbgw_cnlink *cnlink; struct osmo_sccp_addr local_addr; - struct osmo_sccp_addr remote_addr_cs; - struct osmo_sccp_addr remote_addr_ps; + struct osmo_sccp_addr iucs_remote_addr; + struct osmo_sccp_addr iups_remote_addr; } sccp; }; diff --git a/include/osmocom/iuh/hnbgw_cn.h b/include/osmocom/iuh/hnbgw_cn.h index 93123f2..2e61d82 100644 --- a/include/osmocom/iuh/hnbgw_cn.h +++ b/include/osmocom/iuh/hnbgw_cn.h @@ -2,5 +2,4 @@ #include -int hnbgw_cnlink_init(struct hnb_gw *gw, const char *stp_host, uint16_t stp_port, - const char *local_ip, uint32_t local_pc); +int hnbgw_cnlink_init(struct hnb_gw *gw, const char *stp_host, uint16_t stp_port, const char *local_ip); diff --git a/src/hnbgw.c b/src/hnbgw.c index 5d9f87b..c9fdd53 100644 --- a/src/hnbgw.c +++ b/src/hnbgw.c @@ -79,14 +79,6 @@ gw->config.iuh_local_ip = talloc_strdup(gw, HNBGW_LOCAL_IP_DEFAULT); gw->config.iuh_local_port = IUH_DEFAULT_SCTP_PORT; - gw->config.iucs_remote_ip = talloc_strdup(gw, - HNBGW_IUCS_REMOTE_IP_DEFAULT); - gw->config.iucs_remote_port = M3UA_PORT; - - gw->config.iups_remote_ip = talloc_strdup(gw, - HNBGW_IUPS_REMOTE_IP_DEFAULT); - gw->config.iups_remote_port = M3UA_PORT; - gw->next_ue_ctx_id = 23; INIT_LLIST_HEAD(&gw->hnb_list); INIT_LLIST_HEAD(&gw->ue_list); @@ -465,6 +457,7 @@ vty_info.copyright = osmo_hnbgw_copyright; vty_init(&vty_info); + osmo_ss7_vty_init_asp(tall_hnb_ctx); hnbgw_vty_init(g_hnb_gw, tall_hnb_ctx); logging_vty_add_cmds(&hnbgw_log_info); @@ -501,23 +494,12 @@ ranap_set_log_area(DRANAP); - OSMO_ASSERT(g_hnb_gw->config.iucs_remote_ip); rc = hnbgw_cnlink_init(g_hnb_gw, - g_hnb_gw->config.iucs_remote_ip, - g_hnb_gw->config.iucs_remote_port, - "127.0.0.5" /* FIXME: configurable */, - 23 /* FIXME: configurable */); + "127.0.0.1", M3UA_PORT, "127.0.0.5" /* FIXME: configurable */); if (rc < 0) { LOGP(DMAIN, LOGL_ERROR, "Failed to initialize SCCP link to CN\n"); exit(1); } - - osmo_sccp_make_addr_pc_ssn(&g_hnb_gw->sccp.remote_addr_cs, - 1 /* FIXME: configurable */, - OSMO_SCCP_SSN_RANAP); - osmo_sccp_make_addr_pc_ssn(&g_hnb_gw->sccp.remote_addr_ps, - 2 /* FIXME: configurable */, - OSMO_SCCP_SSN_RANAP); OSMO_ASSERT(g_hnb_gw->config.iuh_local_ip); LOGP(DMAIN, LOGL_NOTICE, "Listening for Iuh at %s %d\n", diff --git a/src/hnbgw_cn.c b/src/hnbgw_cn.c index e967260..4aa3422 100644 --- a/src/hnbgw_cn.c +++ b/src/hnbgw_cn.c @@ -63,8 +63,8 @@ { struct hnb_gw *gw = data; - transmit_rst(gw, RANAP_CN_DomainIndicator_cs_domain, &gw->sccp.remote_addr_cs); - transmit_rst(gw, RANAP_CN_DomainIndicator_ps_domain, &gw->sccp.remote_addr_ps); + transmit_rst(gw, RANAP_CN_DomainIndicator_cs_domain, &gw->sccp.iucs_remote_addr); + transmit_rst(gw, RANAP_CN_DomainIndicator_ps_domain, &gw->sccp.iups_remote_addr); hnbgw_cnlink_change_state(gw->sccp.cnlink, CNLINK_S_EST_RST_TX_WAIT_ACK); /* The spec states that we should abandon after a configurable * number of times. We decide to simply continue trying */ @@ -251,12 +251,12 @@ const struct osmo_sccp_addr *cn_remote_addr, bool *is_ps) { - if (pc_and_ssn_match(cn_remote_addr, &gw->sccp.remote_addr_cs)) { + if (pc_and_ssn_match(cn_remote_addr, &gw->sccp.iucs_remote_addr)) { if (is_ps) *is_ps = false; return 0; } - if (pc_and_ssn_match(cn_remote_addr, &gw->sccp.remote_addr_ps)) { + if (pc_and_ssn_match(cn_remote_addr, &gw->sccp.iups_remote_addr)) { if (is_ps) *is_ps = true; return 0; @@ -401,27 +401,90 @@ return 0; } -int hnbgw_cnlink_init(struct hnb_gw *gw, const char *stp_host, uint16_t stp_port, - const char *local_ip, uint32_t local_pc) +static bool addr_has_pc_and_ssn(const struct osmo_sccp_addr *addr) { - struct hnbgw_cnlink *cnlink; - int rc; + if (!(addr->presence & OSMO_SCCP_ADDR_T_SSN)) + return false; + if (!(addr->presence & OSMO_SCCP_ADDR_T_PC)) + return false; + return true; +} - OSMO_ASSERT(!gw->sccp.instance); - OSMO_ASSERT(!gw->sccp.cnlink); +static int resolve_addr_name(struct osmo_sccp_addr *dest, struct osmo_ss7_instance **ss7, + const char *addr_name, const char *label) +{ + struct osmo_ss7_instance *ss7_tmp; - gw->sccp.instance = osmo_sccp_simple_client(gw, "OsmoHNBGW", local_pc, - OSMO_SS7_ASP_PROT_M3UA, 0, local_ip, - stp_port, stp_host); - if (!gw->sccp.instance) { - LOGP(DMAIN, LOGL_ERROR, "Failed to init SCCP Instance\n"); + if (!addr_name) { + LOGP(DMAIN, LOGL_ERROR, "Missing config: %s remote-addr\n", label); return -1; } - LOGP(DRUA, LOGL_DEBUG, "SCCP uplink to STP: %s %u\n", stp_host, stp_port); + ss7_tmp = osmo_sccp_addr_by_name(dest, addr_name); + if (!ss7_tmp) { + LOGP(DMAIN, LOGL_ERROR, "%s remote addr: no such SCCP address book entry: '%s'\n", + label, addr_name); + return -1; + } - osmo_sccp_make_addr_pc_ssn(&gw->sccp.local_addr, local_pc, - OSMO_SCCP_SSN_RANAP); + if (*ss7 && (*ss7 != ss7_tmp)) { + LOGP(DMAIN, LOGL_ERROR, "IuCS and IuPS cannot be served from separate CS7 instances," + " cs7 instance %d != %d\n", (*ss7)->cfg.id, ss7_tmp->cfg.id); + return -1; + } + + *ss7 = ss7_tmp; + + osmo_sccp_addr_set_ssn(dest, OSMO_SCCP_SSN_RANAP); + + if (!addr_has_pc_and_ssn(dest)) { + LOGP(DMAIN, LOGL_ERROR, "Invalid/incomplete %s remote-addr: %s\n", + label, osmo_sccp_addr_name(dest)); + return -1; + } + + LOGP(DRANAP, LOGL_NOTICE, "Remote %s SCCP addr: %s\n", + label, osmo_sccp_addr_name(*ss7, dest)); + return 0; +} + +int hnbgw_cnlink_init(struct hnb_gw *gw, const char *stp_host, uint16_t stp_port, const char *local_ip) +{ + struct hnbgw_cnlink *cnlink; + struct osmo_ss7_instance *ss7; + uint32_t local_pc; + int rc; + + OSMO_ASSERT(!gw->sccp.client); + OSMO_ASSERT(!gw->sccp.cnlink); + + ss7 = NULL; + if (resolve_addr_name(&gw->sccp.iucs_remote_addr, &ss7, + gw->config.iucs_remote_addr_name, "IuCS")) + return -1; + if (resolve_addr_name(&gw->sccp.iups_remote_addr, &ss7, + gw->config.iups_remote_addr_name, "IuPS")) + return -1; + + if (!osmo_ss7_pc_is_valid(ss7->cfg.primary_pc)) { + LOGP(DMAIN, LOGL_ERROR, "IuCS/IuPS uplink cannot be setup: CS7 instance %d has no point-code set\n", + ss7->cfg.id); + return -1; + } + local_pc = ss7->cfg.primary_pc; + + osmo_sccp_make_addr_pc_ssn(&gw->sccp.local_addr, local_pc, OSMO_SCCP_SSN_RANAP); + + LOGP(DRANAP, LOGL_NOTICE, "M3UA uplink to STP: %s %u\n", stp_host, stp_port); + LOGP(DRANAP, LOGL_NOTICE, "Local SCCP addr: %s\n", osmo_sccp_addr_name(ss7, &gw->sccp.local_addr)); + + gw->sccp.client = osmo_sccp_simple_client_on_ss7_id(gw, ss7->cfg.id, "OsmoHNBGW", + local_pc, OSMO_SS7_ASP_PROT_M3UA, + 0, local_ip, stp_port, stp_host); + if (!gw->sccp.client) { + LOGP(DMAIN, LOGL_ERROR, "Failed to init SCCP Client\n"); + return -1; + } cnlink = talloc_zero(gw, struct hnbgw_cnlink); cnlink->gw = gw; @@ -430,10 +493,8 @@ cnlink->T_RafC.data = gw; cnlink->next_conn_id = 1000; - cnlink->sccp_user = osmo_sccp_user_bind_pc(gw->sccp.instance, - "OsmoHNBGW", - sccp_sap_up, OSMO_SCCP_SSN_RANAP, - gw->sccp.local_addr.pc); + cnlink->sccp_user = osmo_sccp_user_bind_pc(gw->sccp.client, "OsmoHNBGW", sccp_sap_up, + OSMO_SCCP_SSN_RANAP, gw->sccp.local_addr.pc); if (!cnlink->sccp_user) { LOGP(DMAIN, LOGL_ERROR, "Failed to init SCCP User\n"); return -1; diff --git a/src/hnbgw_rua.c b/src/hnbgw_rua.c index b610437..95979f5 100644 --- a/src/hnbgw_rua.c +++ b/src/hnbgw_rua.c @@ -188,11 +188,11 @@ switch (cN_DomainIndicator) { case RUA_CN_DomainIndicator_cs_domain: - remote_addr = &hnb->gw->sccp.remote_addr_cs; + remote_addr = &hnb->gw->sccp.iucs_remote_addr; is_ps = false; break; case RUA_CN_DomainIndicator_ps_domain: - remote_addr = &hnb->gw->sccp.remote_addr_ps; + remote_addr = &hnb->gw->sccp.iups_remote_addr; is_ps = true; break; default: diff --git a/src/hnbgw_vty.c b/src/hnbgw_vty.c index 59871da..ddea578 100644 --- a/src/hnbgw_vty.c +++ b/src/hnbgw_vty.c @@ -90,7 +90,6 @@ vty->node = HNBGW_NODE; vty->index = NULL; break; - default: case HNBGW_NODE: vty->node = CONFIG_NODE; vty->index = NULL; @@ -98,6 +97,9 @@ case CONFIG_NODE: vty->node = ENABLE_NODE; vty->index = NULL; + break; + default: + osmo_ss7_vty_go_parent(vty); break; } @@ -182,37 +184,23 @@ return CMD_SUCCESS; } -DEFUN(cfg_hnbgw_iucs_remote_ip, cfg_hnbgw_iucs_remote_ip_cmd, "remote-ip A.B.C.D", - "Address to establish IuCS core network link to\n" - "Remote IuCS IP address (default: " HNBGW_IUCS_REMOTE_IP_DEFAULT ")") +DEFUN(cfg_hnbgw_iucs_remote_addr, + cfg_hnbgw_iucs_remote_addr_cmd, + "remote-addr NAME", + "SCCP address to send IuCS to (MSC)\n" + "SCCP address book entry name (see 'cs7-instance')\n") { - talloc_free((void*)g_hnb_gw->config.iucs_remote_ip); - g_hnb_gw->config.iucs_remote_ip = talloc_strdup(tall_hnb_ctx, argv[0]); + g_hnb_gw->config.iucs_remote_addr_name = talloc_strdup(g_hnb_gw, argv[0]); return CMD_SUCCESS; } -DEFUN(cfg_hnbgw_iucs_remote_port, cfg_hnbgw_iucs_remote_port_cmd, "remote-port <1-65535>", - "Remote port to establish IuCS core network link to\n" - "Remote IuCS port (default: 14001)") +DEFUN(cfg_hnbgw_iups_remote_addr, + cfg_hnbgw_iups_remote_addr_cmd, + "remote-addr NAME", + "SCCP address to send IuPS to (SGSN)\n" + "SCCP address book entry name (see 'cs7-instance')\n") { - g_hnb_gw->config.iucs_remote_port = atoi(argv[0]); - return CMD_SUCCESS; -} - -DEFUN(cfg_hnbgw_iups_remote_ip, cfg_hnbgw_iups_remote_ip_cmd, "remote-ip A.B.C.D", - "Address to establish IuPS core network link to\n" - "Remote IuPS IP address (default: " HNBGW_IUPS_REMOTE_IP_DEFAULT ")") -{ - talloc_free((void*)g_hnb_gw->config.iups_remote_ip); - g_hnb_gw->config.iups_remote_ip = talloc_strdup(tall_hnb_ctx, argv[0]); - return CMD_SUCCESS; -} - -DEFUN(cfg_hnbgw_iups_remote_port, cfg_hnbgw_iups_remote_port_cmd, "remote-port <1-65535>", - "Remote port to establish IuPS core network link to\n" - "Remote IuPS port (default: 14001)") -{ - g_hnb_gw->config.iups_remote_port = atoi(argv[0]); + g_hnb_gw->config.iups_remote_addr_name = talloc_strdup(g_hnb_gw, argv[0]); return CMD_SUCCESS; } @@ -248,15 +236,12 @@ const char *addr; uint16_t port; + if (!g_hnb_gw->config.iucs_remote_addr_name) + return CMD_SUCCESS; + vty_out(vty, " iucs%s", VTY_NEWLINE); - - addr = g_hnb_gw->config.iucs_remote_ip; - if (addr && (strcmp(addr, HNBGW_IUCS_REMOTE_IP_DEFAULT) != 0)) - vty_out(vty, " remote-ip %s%s", addr, VTY_NEWLINE); - - port = g_hnb_gw->config.iucs_remote_port; - if (port && port != SUA_PORT) - vty_out(vty, " remote-port %u%s", port, VTY_NEWLINE); + vty_out(vty, " remote-addr %s%s", g_hnb_gw->config.iucs_remote_addr_name, + VTY_NEWLINE); return CMD_SUCCESS; } @@ -266,15 +251,12 @@ const char *addr; uint16_t port; + if (!g_hnb_gw->config.iups_remote_addr_name) + return CMD_SUCCESS; + vty_out(vty, " iups%s", VTY_NEWLINE); - - addr = g_hnb_gw->config.iups_remote_ip; - if (addr && (strcmp(addr, HNBGW_IUPS_REMOTE_IP_DEFAULT) != 0)) - vty_out(vty, " remote-ip %s%s", addr, VTY_NEWLINE); - - port = g_hnb_gw->config.iups_remote_port; - if (port && port != SUA_PORT) - vty_out(vty, " remote-port %u%s", port, VTY_NEWLINE); + vty_out(vty, " remote-addr %s%s", g_hnb_gw->config.iups_remote_addr_name, + VTY_NEWLINE); return CMD_SUCCESS; } @@ -300,15 +282,13 @@ install_node(&iucs_node, config_write_hnbgw_iucs); vty_install_default(IUCS_NODE); - install_element(IUCS_NODE, &cfg_hnbgw_iucs_remote_ip_cmd); - install_element(IUCS_NODE, &cfg_hnbgw_iucs_remote_port_cmd); + install_element(IUCS_NODE, &cfg_hnbgw_iucs_remote_addr_cmd); install_element(HNBGW_NODE, &cfg_hnbgw_iups_cmd); install_node(&iups_node, config_write_hnbgw_iups); vty_install_default(IUPS_NODE); - install_element(IUPS_NODE, &cfg_hnbgw_iups_remote_ip_cmd); - install_element(IUPS_NODE, &cfg_hnbgw_iups_remote_port_cmd); + install_element(IUPS_NODE, &cfg_hnbgw_iups_remote_addr_cmd); install_element_ve(&show_hnb_cmd); install_element_ve(&show_ue_cmd); -- To view, visit https://gerrit.osmocom.org/3394 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I33a7ba11eb7c2d9a5dc74d10fb0cf04bf664477b Gerrit-PatchSet: 3 Gerrit-Project: osmo-iuh Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Aug 9 20:33:12 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 9 Aug 2017 20:33:12 +0000 Subject: openggsn[master]: ippool: Add IPv6 support to IP pool implementation In-Reply-To: References: Message-ID: Patch Set 5: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3403 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ib98cc4bf634d6be9a7bf8c03a24e629455fcafc8 Gerrit-PatchSet: 5 Gerrit-Project: openggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Aug 9 20:33:19 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 9 Aug 2017 20:33:19 +0000 Subject: openggsn[master]: IPv6 support for user IP In-Reply-To: References: Message-ID: Patch Set 6: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3406 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I22c3bf32a98e5daf99d6eaeac8c9f95cc7574774 Gerrit-PatchSet: 6 Gerrit-Project: openggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Aug 9 20:33:24 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 9 Aug 2017 20:33:24 +0000 Subject: openggsn[master]: in46_addr: Add new function in46a_prefix_equal() In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3456 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ic993d8abdc90897cb55276f01ae3b8a5eadf5a0d Gerrit-PatchSet: 1 Gerrit-Project: openggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Aug 9 20:33:29 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 9 Aug 2017 20:33:29 +0000 Subject: [MERGED] openggsn[master]: in46_addr: Add new function in46a_prefix_equal() In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: in46_addr: Add new function in46a_prefix_equal() ...................................................................... in46_addr: Add new function in46a_prefix_equal() This function is used to compare an IPv6 address against another, using the smaller of the two prefix lengths. Change-Id: Ic993d8abdc90897cb55276f01ae3b8a5eadf5a0d --- M lib/in46_addr.c M lib/in46_addr.h 2 files changed, 18 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/lib/in46_addr.c b/lib/in46_addr.c index 844e318..a220583 100644 --- a/lib/in46_addr.c +++ b/lib/in46_addr.c @@ -74,6 +74,23 @@ return 0; } +/*! Determine if two in46_addr prefix are equal or not + * The prefix length is determined by the shortest of the prefixes of a and b + * \returns 1 in case the common prefix are equal; 0 otherwise */ +int in46a_prefix_equal(const struct in46_addr *a, const struct in46_addr *b) +{ + unsigned int len; + if (a->len > b->len) + len = b->len; + else + len = a->len; + + if (!memcmp(&a->v6, &b->v6, len)) + return 1; + else + return 0; +} + /*! Match if IPv6 addr1 + addr2 are within same \a mask */ static int ipv6_within_mask(const struct in6_addr *addr1, const struct in6_addr *addr2, const struct in6_addr *mask) diff --git a/lib/in46_addr.h b/lib/in46_addr.h index a0ad6e1..0afd2b4 100644 --- a/lib/in46_addr.h +++ b/lib/in46_addr.h @@ -18,6 +18,7 @@ extern int in46a_to_sas(struct sockaddr_storage *out, const struct in46_addr *in); extern const char *in46a_ntop(const struct in46_addr *in, char *dst, socklen_t dst_size); extern int in46a_equal(const struct in46_addr *a, const struct in46_addr *b); +extern int in46a_prefix_equal(const struct in46_addr *a, const struct in46_addr *b); extern int in46a_within_mask(const struct in46_addr *addr, const struct in46_addr *net, size_t prefixlen); int in46a_to_eua(const struct in46_addr *src, struct ul66_t *eua); -- To view, visit https://gerrit.osmocom.org/3456 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ic993d8abdc90897cb55276f01ae3b8a5eadf5a0d Gerrit-PatchSet: 1 Gerrit-Project: openggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Aug 9 20:33:29 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 9 Aug 2017 20:33:29 +0000 Subject: [MERGED] openggsn[master]: IPv6 support for user IP In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: IPv6 support for user IP ...................................................................... IPv6 support for user IP This patch enables the use of IPv6 PDP contexts. The phone will have to request an IPv6 End-user-Address, and the GGSN will have to be configured for an IPv6 pool. The outer transport-layer IP between SGSN and GGSN must still be IPv4, it is not modified by this patch Change-Id: I22c3bf32a98e5daf99d6eaeac8c9f95cc7574774 --- M ggsn/ggsn.c M lib/in46_addr.c M lib/in46_addr.h M sgsnemu/sgsnemu.c 4 files changed, 74 insertions(+), 4 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/ggsn/ggsn.c b/ggsn/ggsn.c index 4fb2066..8e7d1e3 100644 --- a/ggsn/ggsn.c +++ b/ggsn/ggsn.c @@ -35,6 +35,7 @@ #include #include #include +#include #include #include #include @@ -190,7 +191,7 @@ memcpy(pdp->qos_neg.v, pdp->qos_req.v, pdp->qos_req.l); /* TODO */ pdp->qos_neg.l = pdp->qos_req.l; - if (pdp_euaton(&pdp->eua, &addr.v4)) { + if (in46a_from_eua(&pdp->eua, &addr)) { addr.v4.s_addr = 0; /* Request dynamic */ } @@ -199,7 +200,7 @@ return 0; /* Allready in use, or no more available */ } - pdp_ntoeua(&member->addr.v4, &pdp->eua); + in46a_to_eua(&member->addr, &pdp->eua); pdp->peer = member; pdp->ipif = tun; /* TODO */ member->peer = pdp; @@ -224,14 +225,18 @@ struct ippoolm_t *ipm; struct in46_addr dst; struct iphdr *iph = (struct iphdr *)pack; + struct ip6_hdr *ip6h = (struct ip6_hdr *)pack; if (iph->version == 4) { if (len < sizeof(*iph) || len < 4*iph->ihl) return -1; dst.len = 4; dst.v4.s_addr = iph->daddr; + } else if (iph->version == 6) { + dst.len = 16; + dst.v6 = ip6h->ip6_dst; } else { - LOGP(DGGSN, LOGL_NOTICE, "non-IPv4 packet received from tun\n"); + LOGP(DGGSN, LOGL_NOTICE, "non-IPv packet received from tun\n"); return -1; } diff --git a/lib/in46_addr.c b/lib/in46_addr.c index 903ceec..844e318 100644 --- a/lib/in46_addr.c +++ b/lib/in46_addr.c @@ -146,3 +146,63 @@ return 0; } } + +/*! Convert given PDP End User Address to in46_addr + * \returns 0 on success; negative on error */ +int in46a_to_eua(const struct in46_addr *src, struct ul66_t *eua) +{ + switch (src->len) { + case 4: + eua->l = 6; + eua->v[0] = 0xf1; /* IETF */ + eua->v[1] = 0x21; /* IPv4 */ + memcpy(&eua->v[2], &src->v4, 4); /* Copy a 4 byte address */ + break; + case 16: + eua->l = 18; + eua->v[0] = 0xf1; /* IETF */ + eua->v[1] = 0x57; /* IPv6 */ + memcpy(&eua->v[2], &src->v6, 16); /* Copy a 16 byte address */ + break; + default: + return -1; + } + return 0; +} + +/*! Convert given in46_addr to PDP End User Address + * \returns 0 on success; negative on error */ +int in46a_from_eua(const struct ul66_t *eua, struct in46_addr *dst) +{ + if (eua->l < 2) + goto default_to_dyn_v4; + + if (eua->v[0] != 0xf1) + return -1; + + switch (eua->v[1]) { + case 0x21: + dst->len = 4; + if (eua->l >= 6) + memcpy(&dst->v4, &eua->v[2], 4); /* Copy a 4 byte address */ + else + dst->v4.s_addr = 0; + break; + case 0x57: + dst->len = 16; + if (eua->l >= 18) + memcpy(&dst->v6, &eua->v[2], 16); /* Copy a 16 byte address */ + else + memset(&dst->v6, 0, 16); + break; + default: + return -1; + } + return 0; + +default_to_dyn_v4: + /* assume dynamic IPv4 by default */ + dst->len = 4; + dst->v4.s_addr = 0; + return 0; +} diff --git a/lib/in46_addr.h b/lib/in46_addr.h index f28fd8e..a0ad6e1 100644 --- a/lib/in46_addr.h +++ b/lib/in46_addr.h @@ -2,6 +2,8 @@ #include #include +#include "../gtp/pdp.h" + /* a simple wrapper around an in6_addr to also contain the length of the address, * thereby implicitly indicating the address family of the address */ struct in46_addr { @@ -17,3 +19,6 @@ extern const char *in46a_ntop(const struct in46_addr *in, char *dst, socklen_t dst_size); extern int in46a_equal(const struct in46_addr *a, const struct in46_addr *b); extern int in46a_within_mask(const struct in46_addr *addr, const struct in46_addr *net, size_t prefixlen); + +int in46a_to_eua(const struct in46_addr *src, struct ul66_t *eua); +int in46a_from_eua(const struct ul66_t *eua, struct in46_addr *dst); diff --git a/sgsnemu/sgsnemu.c b/sgsnemu/sgsnemu.c index af8f9fa..8c9cfd3 100644 --- a/sgsnemu/sgsnemu.c +++ b/sgsnemu/sgsnemu.c @@ -1329,7 +1329,7 @@ return EOF; /* Not what we expected */ } - if (pdp_euaton(&pdp->eua, &addr.v4)) { + if (in46a_from_eua(&pdp->eua, &addr)) { printf ("Received create PDP context response. Cause value: %d\n", cause); -- To view, visit https://gerrit.osmocom.org/3406 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I22c3bf32a98e5daf99d6eaeac8c9f95cc7574774 Gerrit-PatchSet: 6 Gerrit-Project: openggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Aug 9 20:33:29 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 9 Aug 2017 20:33:29 +0000 Subject: [MERGED] openggsn[master]: ippool: Add IPv6 support to IP pool implementation In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: ippool: Add IPv6 support to IP pool implementation ...................................................................... ippool: Add IPv6 support to IP pool implementation Extend the IP pool implementation to be able to manage both pools of 32bit addresses (IPv4) as well as pools of 128bit addresses (IPv6) Change-Id: Ib98cc4bf634d6be9a7bf8c03a24e629455fcafc8 --- M ggsn/ggsn.c M ggsn/gtp-kernel.c M ggsn/gtp-kernel.h M lib/Makefile.am A lib/in46_addr.c A lib/in46_addr.h M lib/ippool.c M lib/ippool.h M sgsnemu/sgsnemu.c 9 files changed, 371 insertions(+), 169 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/ggsn/ggsn.c b/ggsn/ggsn.c index 168e907..0d0e569 100644 --- a/ggsn/ggsn.c +++ b/ggsn/ggsn.c @@ -56,6 +56,7 @@ #include "../lib/tun.h" #include "../lib/ippool.h" #include "../lib/syserr.h" +#include "../lib/in46_addr.h" #include "../gtp/pdp.h" #include "../gtp/gtp.h" #include "cmdline.h" @@ -65,7 +66,8 @@ int maxfd = 0; /* For select() */ struct in_addr listen_; -struct in_addr netaddr, destaddr, net, mask; /* Network interface */ +struct in_addr netaddr, destaddr, net; /* Network interface */ +size_t prefixlen; struct in_addr dns1, dns2; /* PCO DNS address */ char *ipup, *ipdown; /* Filename of scripts */ int debug; /* Print debug output */ @@ -135,9 +137,12 @@ static bool send_trap(const struct gsn_t *gsn, const struct pdp_t *pdp, const struct ippoolm_t *member, const char *var) { + char addrbuf[256]; char val[NAMESIZE]; - snprintf(val, sizeof(val), "%" PRIu64 ",%s", pdp->imsi, inet_ntoa(member->addr)); + const char *addrstr = in46a_ntop(&member->addr, addrbuf, sizeof(addrbuf)); + + snprintf(val, sizeof(val), "%" PRIu64 ",%s", pdp->imsi, addrstr); if (ctrl_cmd_send_trap(gsn->ctrl, var, val) < 0) { LOGP(DGGSN, LOGL_ERROR, "Failed to create and send TRAP for IMSI %" PRIu64 " [%s].\n", pdp->imsi, var); @@ -168,7 +173,7 @@ int create_context_ind(struct pdp_t *pdp) { - struct in_addr addr; + struct in46_addr addr; struct ippoolm_t *member; DEBUGP(DGGSN, "Received create PDP context request\n"); @@ -183,8 +188,8 @@ memcpy(pdp->qos_neg.v, pdp->qos_req.v, pdp->qos_req.l); /* TODO */ pdp->qos_neg.l = pdp->qos_req.l; - if (pdp_euaton(&pdp->eua, &addr)) { - addr.s_addr = 0; /* Request dynamic */ + if (pdp_euaton(&pdp->eua, &addr.v4)) { + addr.v4.s_addr = 0; /* Request dynamic */ } if (ippool_newip(ippool, &member, &addr, 0)) { @@ -192,7 +197,7 @@ return 0; /* Allready in use, or no more available */ } - pdp_ntoeua(&member->addr, &pdp->eua); + pdp_ntoeua(&member->addr.v4, &pdp->eua); pdp->peer = member; pdp->ipif = tun; /* TODO */ member->peer = pdp; @@ -215,10 +220,18 @@ int cb_tun_ind(struct tun_t *tun, void *pack, unsigned len) { struct ippoolm_t *ipm; - struct in_addr dst; + struct in46_addr dst; struct tun_packet_t *iph = (struct tun_packet_t *)pack; - dst.s_addr = iph->dst; + if (iph->ver == 4) { + if (len < sizeof(*iph) || len < 4*iph->ihl) + return -1; + dst.len = 4; + dst.v4.s_addr = iph->dst; + } else { + LOGP(DGGSN, LOGL_NOTICE, "non-IPv4 packet received from tun\n"); + return -1; + } DEBUGP(DGGSN, "Received packet from tun!\n"); @@ -383,12 +396,14 @@ /* net */ /* Store net as in_addr net and mask */ if (args_info.net_arg) { - if (ippool_aton(&net, &mask, args_info.net_arg, 0)) { + struct in46_addr in46; + if (ippool_aton(&in46, &prefixlen, args_info.net_arg, 0)) { SYS_ERR(DGGSN, LOGL_ERROR, 0, "Invalid network address: %s!", args_info.net_arg); exit(1); } + net.s_addr = in46.v4.s_addr; netaddr.s_addr = htonl(ntohl(net.s_addr) + 1); destaddr.s_addr = htonl(ntohl(net.s_addr) + 1); } else { @@ -547,7 +562,7 @@ maxfd = gsn->fd1u; /* use GTP kernel module for data packet encapsulation */ - if (gtp_kernel_init(gsn, &net, &mask, &args_info) < 0) + if (gtp_kernel_init(gsn, &net, prefixlen, &args_info) < 0) goto err; gtp_set_cb_data_ind(gsn, encaps_tun); @@ -572,7 +587,7 @@ } DEBUGP(DGGSN, "Setting tun IP address\n"); - if (tun_setaddr(tun, &netaddr, &destaddr, &mask)) { + if (tun_setaddr(tun, &netaddr, &destaddr, &prefixlen)) { SYS_ERR(DGGSN, LOGL_ERROR, 0, "Failed to set tun IP address"); exit(1); } diff --git a/ggsn/gtp-kernel.c b/ggsn/gtp-kernel.c index dbe5a9f..458ac27 100644 --- a/ggsn/gtp-kernel.c +++ b/ggsn/gtp-kernel.c @@ -70,17 +70,6 @@ printf("\n"); } -static int mask2prefix(struct in_addr *mask) -{ - uint32_t tmp = ntohl(mask->s_addr); - int k; - - for (k=0; tmp > 0; k++) - tmp = (tmp << 1); - - return k; -} - static struct { int genl_id; struct mnl_socket *nl; @@ -91,7 +80,7 @@ #define GTP_DEVNAME "gtp0" int gtp_kernel_init(struct gsn_t *gsn, struct in_addr *net, - struct in_addr *mask, + size_t prefixlen, struct gengetopt_args_info *args_info) { if (!args_info->gtp_linux_given) @@ -126,7 +115,7 @@ DEBUGP(DGGSN, "Setting route to reach %s via %s\n", args_info->net_arg, GTP_DEVNAME); - if (gtp_dev_config(GTP_DEVNAME, net, mask2prefix(mask)) < 0) { + if (gtp_dev_config(GTP_DEVNAME, net, prefixlen) < 0) { SYS_ERR(DGGSN, LOGL_ERROR, 0, "Cannot add route to reach network %s\n", args_info->net_arg); diff --git a/ggsn/gtp-kernel.h b/ggsn/gtp-kernel.h index 83280a0..b3b29e3 100644 --- a/ggsn/gtp-kernel.h +++ b/ggsn/gtp-kernel.h @@ -8,7 +8,7 @@ #ifdef GTP_KERNEL int gtp_kernel_init(struct gsn_t *gsn, struct in_addr *net, - struct in_addr *mask, + size_t prefixlen, struct gengetopt_args_info *args_info); void gtp_kernel_stop(void); @@ -19,7 +19,7 @@ #else static inline int gtp_kernel_init(struct gsn_t *gsn, struct in_addr *net, - struct in_addr *mask, + size_t prefixlen, struct gengetopt_args_info *args_info) { if (args_info->gtp_linux_given) { diff --git a/lib/Makefile.am b/lib/Makefile.am index 756d566..632990c 100644 --- a/lib/Makefile.am +++ b/lib/Makefile.am @@ -1,7 +1,7 @@ noinst_LIBRARIES = libmisc.a -noinst_HEADERS = gnugetopt.h ippool.h lookup.h syserr.h tun.h +noinst_HEADERS = gnugetopt.h ippool.h lookup.h syserr.h tun.h in46_addr.h AM_CFLAGS = -O2 -fno-builtin -Wall -DSBINDIR='"$(sbindir)"' -ggdb $(LIBOSMOCORE_CFLAGS) -libmisc_a_SOURCES = getopt1.c getopt.c ippool.c lookup.c tun.c debug.c +libmisc_a_SOURCES = getopt1.c getopt.c ippool.c lookup.c tun.c debug.c in46_addr.c diff --git a/lib/in46_addr.c b/lib/in46_addr.c new file mode 100644 index 0000000..903ceec --- /dev/null +++ b/lib/in46_addr.c @@ -0,0 +1,148 @@ +/* + * IPv4/v6 address functions. + * Copyright (C) 2017 by Harald Welte + * + * The contents of this file may be used under the terms of the GNU + * General Public License Version 2, provided that the above copyright + * notice and this permission notice is included in all copies or + * substantial portions of the software. + * + */ + +#include "../lib/in46_addr.h" + +#include +#include +#include +#include +#include +#include +#include + +/*! Return the address family of given \reff in46_addr argument */ +int in46a_to_af(const struct in46_addr *in) +{ + switch (in->len) { + case 4: + return AF_INET; + case 16: + return AF_INET6; + default: + return -1; + } +} + +/*! Convert \ref in46_addr to sockaddr_storage */ +int in46a_to_sas(struct sockaddr_storage *out, const struct in46_addr *in) +{ + struct sockaddr_in *sin = (struct sockaddr_in *)out; + struct sockaddr_in6 *sin6 = (struct sockaddr_in6 *)out; + + switch (in->len) { + case 4: + sin->sin_family = AF_INET; + sin->sin_addr = in->v4; + break; + case 16: + sin6->sin6_family = AF_INET; + sin6->sin6_addr = in->v6; + break; + default: + return -1; + } + + return 0; +} + +/*! Convenience wrapper around inet_ntop() for \ref in46_addr */ +const char *in46a_ntop(const struct in46_addr *in, char *dst, socklen_t dst_size) +{ + int af = in46a_to_af(in); + if (af < 0) + return NULL; + + return inet_ntop(af, (const void *) &in->v4, dst, dst_size); +} + +/*! Determine if two in46_addr are equal or not + * \returns 1 in case they are equal; 0 otherwise */ +int in46a_equal(const struct in46_addr *a, const struct in46_addr *b) +{ + if (a->len == b->len && !memcmp(&a->v6, &b->v6, a->len)) + return 1; + else + return 0; +} + +/*! Match if IPv6 addr1 + addr2 are within same \a mask */ +static int ipv6_within_mask(const struct in6_addr *addr1, const struct in6_addr *addr2, + const struct in6_addr *mask) +{ + struct in6_addr masked = *addr2; +#if defined(__linux__) + masked.s6_addr32[0] &= mask->s6_addr32[0]; + masked.s6_addr32[1] &= mask->s6_addr32[1]; + masked.s6_addr32[2] &= mask->s6_addr32[2]; + masked.s6_addr32[3] &= mask->s6_addr32[3]; +#else + masked.__u6_addr.__u6_addr32[0] &= mask->__u6_addr.__u6_addr32[0]; + masked.__u6_addr.__u6_addr32[1] &= mask->__u6_addr.__u6_addr32[1]; + masked.__u6_addr.__u6_addr32[2] &= mask->__u6_addr.__u6_addr32[2]; + masked.__u6_addr.__u6_addr32[3] &= mask->__u6_addr.__u6_addr32[3]; +#endif + if (!memcmp(addr1, &masked, sizeof(struct in6_addr))) + return 1; + else + return 0; +} + +/*! Create an IPv6 netmask from the given prefix length */ +static void create_ipv6_netmask(struct in6_addr *netmask, int prefixlen) +{ + uint32_t *p_netmask; + memset(netmask, 0, sizeof(struct in6_addr)); + if (prefixlen < 0) + prefixlen = 0; + else if (128 < prefixlen) + prefixlen = 128; + +#if defined(__linux__) + p_netmask = &netmask->s6_addr32[0]; +#else + p_netmask = &netmask->__u6_addr.__u6_addr32[0]; +#endif + while (32 < prefixlen) { + *p_netmask = 0xffffffff; + p_netmask++; + prefixlen -= 32; + } + if (prefixlen != 0) { + *p_netmask = htonl(0xFFFFFFFF << (32 - prefixlen)); + } +} + +/*! Determine if given \a addr is within given \a net + \a prefixlen + * Builds the netmask from \a net + \a prefixlen and matches it to \a addr + * \returns 1 in case of a match, 0 otherwise */ +int in46a_within_mask(const struct in46_addr *addr, const struct in46_addr *net, size_t prefixlen) +{ + struct in_addr netmask; + struct in6_addr netmask6; + + if (addr->len != net->len) + return 0; + + switch (addr->len) { + case 4: + netmask.s_addr = htonl(0xFFFFFFFF << (32 - prefixlen)); + if ((addr->v4.s_addr & netmask.s_addr) == net->v4.s_addr) + return 1; + else + return 0; + case 16: + create_ipv6_netmask(&netmask6, prefixlen); + return ipv6_within_mask(&addr->v6, &net->v6, &netmask6); + default: + return 0; + } +} diff --git a/lib/in46_addr.h b/lib/in46_addr.h new file mode 100644 index 0000000..f28fd8e --- /dev/null +++ b/lib/in46_addr.h @@ -0,0 +1,19 @@ +#pragma once +#include +#include + +/* a simple wrapper around an in6_addr to also contain the length of the address, + * thereby implicitly indicating the address family of the address */ +struct in46_addr { + uint8_t len; + union { + struct in_addr v4; + struct in6_addr v6; + }; +}; + +extern int in46a_to_af(const struct in46_addr *in); +extern int in46a_to_sas(struct sockaddr_storage *out, const struct in46_addr *in); +extern const char *in46a_ntop(const struct in46_addr *in, char *dst, socklen_t dst_size); +extern int in46a_equal(const struct in46_addr *a, const struct in46_addr *b); +extern int in46a_within_mask(const struct in46_addr *addr, const struct in46_addr *net, size_t prefixlen); diff --git a/lib/ippool.c b/lib/ippool.c index 1f79a77..c3eb267 100644 --- a/lib/ippool.c +++ b/lib/ippool.c @@ -1,6 +1,7 @@ /* * IP address pool functions. * Copyright (C) 2003, 2004 Mondru AB. + * Copyright (C) 2017 by Harald Welte * * The contents of this file may be used under the terms of the GNU * General Public License Version 2, provided that the above copyright @@ -16,6 +17,7 @@ #include #include #include +#include #include "syserr.h" #include "ippool.h" #include "lookup.h" @@ -31,13 +33,14 @@ printf("Listsize %d\n", this->listsize); for (n = 0; n < this->listsize; n++) { - printf("Unit %d inuse %d prev %d next %d addr %s %x\n", + char s[256]; + in46a_ntop(&this->member[n].addr, s, sizeof(s)); + printf("Unit %d inuse %d prev %d next %d addr %s\n", n, this->member[n].inuse, this->member[n].prev - this->member, this->member[n].next - this->member, - inet_ntoa(this->member[n].addr), - this->member[n].addr.s_addr); + s); } return 0; } @@ -49,7 +52,7 @@ struct ippoolm_t *p_prev = NULL; /* Insert into hash table */ - hash = ippool_hash4(&member->addr) & this->hashmask; + hash = ippool_hash(&member->addr) & this->hashmask; for (p = this->hash[hash]; p; p = p->nexthash) p_prev = p; if (!p_prev) @@ -66,7 +69,7 @@ struct ippoolm_t *p_prev = NULL; /* Find in hash table */ - hash = ippool_hash4(&member->addr) & this->hashmask; + hash = ippool_hash(&member->addr) & this->hashmask; for (p = this->hash[hash]; p; p = p->nexthash) { if (p == member) { break; @@ -88,73 +91,98 @@ return 0; } -unsigned long int ippool_hash4(struct in_addr *addr) +static unsigned long int ippool_hash4(struct in_addr *addr) { return lookup((unsigned char *)&addr->s_addr, sizeof(addr->s_addr), 0); } -#ifndef IPPOOL_NOIP6 -unsigned long int ippool_hash6(struct in6_addr *addr) +static unsigned long int ippool_hash6(struct in6_addr *addr) { - return lookup((unsigned char *)addr->u6_addr8, sizeof(addr->u6_addr8), + /* TODO: Review hash spread for IPv6 */ + return lookup((unsigned char *)addr->s6_addr, sizeof(addr->s6_addr), 0); } -#endif + +unsigned long int ippool_hash(struct in46_addr *addr) +{ + if (addr->len == 4) + return ippool_hash4(&addr->v4); + else + return ippool_hash6(&addr->v6); +} /* Get IP address and mask */ -int ippool_aton(struct in_addr *addr, struct in_addr *mask, - char *pool, int number) +int ippool_aton(struct in46_addr *addr, size_t *prefixlen, const char *pool_in, int number) { + struct addrinfo *ai; + struct addrinfo hints = { + .ai_family = AF_UNSPEC, + .ai_socktype = SOCK_DGRAM, + .ai_flags = 0, + .ai_protocol = 0 + }; + char pool[strlen(pool_in)+1]; - /* Parse only first instance of network for now */ - /* Eventually "number" will indicate the token which we want to parse */ + strcpy(pool, pool_in); - unsigned int a1, a2, a3, a4; - unsigned int m1, m2, m3, m4; - int c; - int m; - int masklog; + int err; - c = sscanf(pool, "%u.%u.%u.%u/%u.%u.%u.%u", - &a1, &a2, &a3, &a4, &m1, &m2, &m3, &m4); - switch (c) { - case 4: - mask->s_addr = 0xffffffff; - break; - case 5: - if (m1 > 32) { - SYS_ERR(DIP, LOGL_ERROR, 0, "Invalid mask"); - return -1; /* Invalid mask */ + /* Find '/' and point to first char after it */ + char *prefixlen_str = strchr(pool, '/'); + if (prefixlen_str) { + *prefixlen_str = '\0'; + prefixlen_str++; + if (*prefixlen_str == '\0') { + SYS_ERR(DIP, LOGL_ERROR, 0, "Empty prefix length specified"); + return -1; } - mask->s_addr = htonl(0xffffffff << (32 - m1)); - break; - case 8: - if (m1 >= 256 || m2 >= 256 || m3 >= 256 || m4 >= 256) { - SYS_ERR(DIP, LOGL_ERROR, 0, "Invalid mask"); - return -1; /* Wrong mask format */ - } - m = m1 * 0x1000000 + m2 * 0x10000 + m3 * 0x100 + m4; - for (masklog = 0; ((1 << masklog) < ((~m) + 1)); masklog++) ; - if (((~m) + 1) != (1 << masklog)) { - SYS_ERR(DIP, LOGL_ERROR, 0, "Invalid mask"); - return -1; /* Wrong mask format (not all ones followed by all zeros) */ - } - mask->s_addr = htonl(m); - break; - default: - SYS_ERR(DIP, LOGL_ERROR, 0, "Invalid mask"); - return -1; /* Invalid mask */ } - if (a1 >= 256 || a2 >= 256 || a3 >= 256 || a4 >= 256) { - SYS_ERR(DIP, LOGL_ERROR, 0, - "Wrong IP address format"); + /* convert address */ + if ((err = getaddrinfo(pool, NULL, &hints, &ai))) { + SYS_ERR(DIP, LOGL_ERROR, 0, "Bad address"); return -1; - } else - addr->s_addr = - htonl(a1 * 0x1000000 + a2 * 0x10000 + a3 * 0x100 + a4); + } + + /* Copy address, set lengths */ + if (ai->ai_family == AF_INET) { + *prefixlen = 32; + addr->len = sizeof(struct in_addr); + addr->v4 = ((struct sockaddr_in*)ai->ai_addr)->sin_addr; + } else { + *prefixlen = 128; + addr->len = sizeof(struct in6_addr); + addr->v6 = ((struct sockaddr_in6*)ai->ai_addr)->sin6_addr; + } + freeaddrinfo(ai); + + /* parse prefixlen */ + if (prefixlen_str) { + char *e; + *prefixlen = strtol(prefixlen_str, &e, 10); + if (*e != '\0') { + SYS_ERR(DIP, LOGL_ERROR, 0, "Prefixlen is not an int"); + return -1; + } + } + + if (*prefixlen > (addr->len * 8)) { + SYS_ERR(DIP, LOGL_ERROR, 0, "Perfixlen too big"); + return -1; + } return 0; +} + +/* Increase IPv4/IPv6 address by 1 */ +void in46a_inc(struct in46_addr *addr) +{ + size_t addrlen; + uint8_t *a = (uint8_t *)&addr->v6; + for (addrlen = addr->len; addrlen > 0; addrlen--) { + if (++a[addrlen-1]) + break; + } } /* Create new address pool */ @@ -165,11 +193,10 @@ /* Parse only first instance of pool for now */ int i; - struct in_addr addr; - struct in_addr mask; - struct in_addr stataddr; - struct in_addr statmask; - unsigned int m; + struct in46_addr addr; + size_t addrprefixlen; + struct in46_addr stataddr; + size_t stataddrprefixlen; int listsize; int dynsize; unsigned int statsize; @@ -177,7 +204,7 @@ if (!allowdyn) { dynsize = 0; } else { - if (ippool_aton(&addr, &mask, dyn, 0)) { + if (ippool_aton(&addr, &addrprefixlen, dyn, 0)) { SYS_ERR(DIP, LOGL_ERROR, 0, "Failed to parse dynamic pool"); return -1; @@ -188,8 +215,7 @@ flags |= IPPOOL_NONETWORK; } - m = ntohl(mask.s_addr); - dynsize = ((~m) + 1); + dynsize = (1 << (addr.len*8 - addrprefixlen)) -1; if (flags & IPPOOL_NONETWORK) /* Exclude network address from pool */ dynsize--; if (flags & IPPOOL_NOGATEWAY) /* Exclude gateway address from pool */ @@ -200,17 +226,16 @@ if (!allowstat) { statsize = 0; - stataddr.s_addr = 0; - statmask.s_addr = 0; + stataddr.len = 0; + stataddrprefixlen = 0; } else { - if (ippool_aton(&stataddr, &statmask, stat, 0)) { + if (ippool_aton(&stataddr, &stataddrprefixlen, stat, 0)) { SYS_ERR(DIP, LOGL_ERROR, 0, "Failed to parse static range"); return -1; } - m = ntohl(statmask.s_addr); - statsize = ((~m) + 1); + statsize = (1 << (addr.len - addrprefixlen + 1)) -1; if (statsize > IPPOOL_STATSIZE) statsize = IPPOOL_STATSIZE; } @@ -225,8 +250,9 @@ (*this)->allowdyn = allowdyn; (*this)->allowstat = allowstat; - (*this)->stataddr = stataddr; - (*this)->statmask = statmask; + if (stataddr.len > 0) + (*this)->stataddr = stataddr; + (*this)->stataddrprefixlen = stataddrprefixlen; (*this)->listsize += listsize; if (!((*this)->member = calloc(sizeof(struct ippoolm_t), listsize))) { @@ -255,17 +281,15 @@ (*this)->firstdyn = NULL; (*this)->lastdyn = NULL; + if (flags & IPPOOL_NOGATEWAY) { + in46a_inc(&addr); + in46a_inc(&addr); + } else if (flags & IPPOOL_NONETWORK) { + in46a_inc(&addr); + } for (i = 0; i < dynsize; i++) { - - if (flags & IPPOOL_NOGATEWAY) - (*this)->member[i].addr.s_addr = - htonl(ntohl(addr.s_addr) + i + 2); - else if (flags & IPPOOL_NONETWORK) - (*this)->member[i].addr.s_addr = - htonl(ntohl(addr.s_addr) + i + 1); - else - (*this)->member[i].addr.s_addr = - htonl(ntohl(addr.s_addr) + i); + (*this)->member[i].addr = addr; + in46a_inc(&addr); (*this)->member[i].inuse = 0; @@ -285,8 +309,8 @@ (*this)->firststat = NULL; (*this)->laststat = NULL; for (i = dynsize; i < listsize; i++) { - - (*this)->member[i].addr.s_addr = 0; + struct in46_addr *i6al = &(*this)->member[i].addr; + memset(i6al, 0, sizeof(*i6al)); (*this)->member[i].inuse = 0; /* Insert into list of unused */ @@ -316,15 +340,15 @@ /* Find an IP address in the pool */ int ippool_getip(struct ippool_t *this, struct ippoolm_t **member, - struct in_addr *addr) + struct in46_addr *addr) { struct ippoolm_t *p; uint32_t hash; /* Find in hash table */ - hash = ippool_hash4(addr) & this->hashmask; + hash = ippool_hash(addr) & this->hashmask; for (p = this->hash[hash]; p; p = p->nexthash) { - if ((p->addr.s_addr == addr->s_addr) && (p->inuse)) { + if (in46a_equal(&p->addr, addr)) { if (member) *member = p; return 0; @@ -344,7 +368,7 @@ * address space. **/ int ippool_newip(struct ippool_t *this, struct ippoolm_t **member, - struct in_addr *addr, int statip) + struct in46_addr *addr, int statip) { struct ippoolm_t *p; struct ippoolm_t *p2 = NULL; @@ -365,17 +389,23 @@ if (0) (void)ippool_printaddr(this); + int specified = 0; + if (addr) { + if (addr->len == 4 && addr->v4.s_addr) + specified = 1; + if (addr->len == 16 && !IN6_IS_ADDR_UNSPECIFIED(&addr->v6)) + specified = 1; + } + /* First check to see if this type of address is allowed */ - if ((addr) && (addr->s_addr) && statip) { /* IP address given */ + if (specified && statip) { /* IP address given */ if (!this->allowstat) { SYS_ERR(DIP, LOGL_ERROR, 0, "Static IP address not allowed"); return -1; } - if ((addr->s_addr & this->statmask.s_addr) != - this->stataddr.s_addr) { - SYS_ERR(DIP, LOGL_ERROR, 0, - "Static out of range"); + if (!in46a_within_mask(addr, &this->stataddr, this->stataddrprefixlen)) { + SYS_ERR(DIP, LOGL_ERROR, 0, "Static out of range"); return -1; } } else { @@ -387,11 +417,11 @@ } /* If IP address given try to find it in dynamic address pool */ - if ((addr) && (addr->s_addr)) { /* IP address given */ + if (specified) { /* IP address given */ /* Find in hash table */ - hash = ippool_hash4(addr) & this->hashmask; + hash = ippool_hash(addr) & this->hashmask; for (p = this->hash[hash]; p; p = p->nexthash) { - if ((p->addr.s_addr == addr->s_addr)) { + if (in46a_equal(&p->addr, addr)) { p2 = p; break; } @@ -420,6 +450,11 @@ return -1; /* Allready in use / Should not happen */ } + if (p2->addr.len != addr->len) { + SYS_ERR(DIP, LOGL_ERROR, 0, "MS requested unsupported PDP context type"); + return -1; + } + /* Remove from linked list of free dynamic addresses */ if (p2->prev) p2->prev->next = p2->next; @@ -442,13 +477,18 @@ /* It was not possible to allocate from dynamic address pool */ /* Try to allocate from static address space */ - if ((addr) && (addr->s_addr) && (statip)) { /* IP address given */ + if (specified && (statip)) { /* IP address given */ if (!this->firststat) { SYS_ERR(DIP, LOGL_ERROR, 0, "No more IP addresses available"); return -1; /* No more available */ } else p2 = this->firststat; + + if (p2->addr.len != addr->len) { + SYS_ERR(DIP, LOGL_ERROR, 0, "MS requested unsupported PDP context type"); + return -1; + } /* Remove from linked list of free static addresses */ if (p2->prev) @@ -518,7 +558,7 @@ this->laststat = member; member->inuse = 0; - member->addr.s_addr = 0; + memset(&member->addr, 0, sizeof(member->addr)); member->peer = NULL; member->nexthash = NULL; if (0) @@ -530,9 +570,3 @@ return -1; } } - -#ifndef IPPOOL_NOIP6 -extern unsigned long int ippool_hash6(struct in6_addr *addr); -extern int ippool_getip6(struct ippool_t *this, struct in6_addr *addr); -extern int ippool_returnip6(struct ippool_t *this, struct in6_addr *addr); -#endif diff --git a/lib/ippool.h b/lib/ippool.h index 534140d..53154f2 100644 --- a/lib/ippool.h +++ b/lib/ippool.h @@ -12,6 +12,8 @@ #ifndef _IPPOOL_H #define _IPPOOL_H +#include "../lib/in46_addr.h" + /* Assuming that the address space is fragmented we need a hash table in order to return the addresses. @@ -26,8 +28,6 @@ in RFC2373. */ -#define IPPOOL_NOIP6 - #define IPPOOL_NONETWORK 0x01 #define IPPOOL_NOBROADCAST 0x02 #define IPPOOL_NOGATEWAY 0x04 @@ -40,8 +40,8 @@ unsigned int listsize; /* Total number of addresses */ int allowdyn; /* Allow dynamic IP address allocation */ int allowstat; /* Allow static IP address allocation */ - struct in_addr stataddr; /* Static address range network address */ - struct in_addr statmask; /* Static address range network mask */ + struct in46_addr stataddr; /* Static address range network address */ + size_t stataddrprefixlen; /* IPv6 prefix length of stataddr */ struct ippoolm_t *member; /* Listsize array of members */ unsigned int hashsize; /* Size of hash table */ int hashlog; /* Log2 size of hash table */ @@ -54,11 +54,7 @@ }; struct ippoolm_t { -#ifndef IPPOOL_NOIP6 - struct in6_addr addr; /* IP address of this member */ -#else - struct in_addr addr; /* IP address of this member */ -#endif + struct in46_addr addr; /* IP address of this member */ int inuse; /* 0=available; 1= dynamic; 2 = static */ struct ippoolm_t *nexthash; /* Linked list part of hash table */ struct ippoolm_t *prev, *next; /* Linked list of free dynamic or static */ @@ -70,7 +66,7 @@ bytes for each address. */ /* Hash an IP address using code based on Bob Jenkins lookupa */ -extern unsigned long int ippool_hash4(struct in_addr *addr); +extern unsigned long int ippool_hash(struct in46_addr *addr); /* Create new address pool */ extern int ippool_new(struct ippool_t **this, char *dyn, char *stat, @@ -81,24 +77,20 @@ /* Find an IP address in the pool */ extern int ippool_getip(struct ippool_t *this, struct ippoolm_t **member, - struct in_addr *addr); + struct in46_addr *addr); /* Get an IP address. If addr = 0.0.0.0 get a dynamic IP address. Otherwise check to see if the given address is available */ extern int ippool_newip(struct ippool_t *this, struct ippoolm_t **member, - struct in_addr *addr, int statip); + struct in46_addr *addr, int statip); /* Return a previously allocated IP address */ extern int ippool_freeip(struct ippool_t *this, struct ippoolm_t *member); /* Get net and mask based on ascii string */ -extern int ippool_aton(struct in_addr *addr, struct in_addr *mask, - char *pool, int number); +int ippool_aton(struct in46_addr *addr, size_t *prefixlen, const char *pool, int number); -#ifndef IPPOOL_NOIP6 -extern unsigned long int ippool_hash6(struct in6_addr *addr); -extern int ippool_getip6(struct ippool_t *this, struct in6_addr *addr); -extern int ippool_returnip6(struct ippool_t *this, struct in6_addr *addr); -#endif +/* Increase IPv4/IPv6 address by 1 */ +extern void in46a_inc(struct in46_addr *addr); #endif /* !_IPPOOL_H */ diff --git a/sgsnemu/sgsnemu.c b/sgsnemu/sgsnemu.c index 1567e7e..90a6200 100644 --- a/sgsnemu/sgsnemu.c +++ b/sgsnemu/sgsnemu.c @@ -58,7 +58,7 @@ uint8_t inuse; /* 0=free. 1=used by somebody */ struct iphash_t *ipnext; struct pdp_t *pdp; - struct in_addr addr; + struct in46_addr addr; }; struct iphash_t iparr[MAXCONTEXTS]; struct iphash_t *iphash[MAXCONTEXTS]; @@ -81,7 +81,8 @@ struct { int debug; /* Print debug messages */ int createif; /* Create local network interface */ - struct in_addr netaddr, destaddr, net, mask; /* Network interface */ + struct in_addr netaddr, destaddr, net; /* Network interface */ + size_t prefixlen; char *ipup, *ipdown; /* Filename of scripts */ int defaultroute; /* Set up default route */ struct in_addr pinghost; /* Remote ping host */ @@ -160,13 +161,13 @@ state = 3; /* Tell main loop to finish. */ } -int ipset(struct iphash_t *ipaddr, struct in_addr *addr) +int ipset(struct iphash_t *ipaddr, struct in46_addr *addr) { - int hash = ippool_hash4(addr) % MAXCONTEXTS; + int hash = ippool_hash(addr) % MAXCONTEXTS; struct iphash_t *h; struct iphash_t *prev = NULL; ipaddr->ipnext = NULL; - ipaddr->addr.s_addr = addr->s_addr; + ipaddr->addr = *addr; for (h = iphash[hash]; h; h = h->ipnext) prev = h; if (!prev) @@ -178,7 +179,7 @@ int ipdel(struct iphash_t *ipaddr) { - int hash = ippool_hash4(&ipaddr->addr) % MAXCONTEXTS; + int hash = ippool_hash(&ipaddr->addr) % MAXCONTEXTS; struct iphash_t *h; struct iphash_t *prev = NULL; for (h = iphash[hash]; h; h = h->ipnext) { @@ -194,12 +195,12 @@ return EOF; /* End of linked list and not found */ } -int ipget(struct iphash_t **ipaddr, struct in_addr *addr) +int ipget(struct iphash_t **ipaddr, struct in46_addr *addr) { - int hash = ippool_hash4(addr) % MAXCONTEXTS; + int hash = ippool_hash(addr) % MAXCONTEXTS; struct iphash_t *h; for (h = iphash[hash]; h; h = h->ipnext) { - if ((h->addr.s_addr == addr->s_addr)) { + if (in46a_equal(&h->addr, addr)) { *ipaddr = h; return 0; } @@ -859,15 +860,17 @@ /* net */ /* Store net as in_addr net and mask */ if (args_info.net_arg) { + struct in46_addr in46; if (ippool_aton - (&options.net, &options.mask, args_info.net_arg, 0)) { + (&in46, &options.prefixlen, args_info.net_arg, 0)) { SYS_ERR(DSGSN, LOGL_ERROR, 0, "Invalid network address: %s!", args_info.net_arg); exit(1); } + options.net.s_addr = in46.v4.s_addr; #if defined (__sun__) - options.netaddr.s_addr = htonl(ntohl(options.net.s_addr) + 1); + options.netaddrs_addr = htonl(ntohl(options.net.s_addr) + 1); options.destaddr.s_addr = htonl(ntohl(options.net.s_addr) + 1); #else options.netaddr.s_addr = options.net.s_addr; @@ -876,7 +879,7 @@ } else { options.net.s_addr = 0; - options.mask.s_addr = 0; + options.prefixlen = 0; options.netaddr.s_addr = 0; options.destaddr.s_addr = 0; } @@ -1277,14 +1280,15 @@ int cb_tun_ind(struct tun_t *tun, void *pack, unsigned len) { struct iphash_t *ipm; - struct in_addr src; + struct in46_addr src; struct tun_packet_t *iph = (struct tun_packet_t *)pack; - src.s_addr = iph->src; + src.len = 4; + src.v4.s_addr = iph->src; if (ipget(&ipm, &src)) { printf("Dropping packet from invalid source address: %s\n", - inet_ntoa(src)); + inet_ntoa(src.v4)); return 0; } @@ -1295,7 +1299,7 @@ int create_pdp_conf(struct pdp_t *pdp, void *cbp, int cause) { - struct in_addr addr; + struct in46_addr addr; struct iphash_t *iph = (struct iphash_t *)cbp; @@ -1324,7 +1328,7 @@ return EOF; /* Not what we expected */ } - if (pdp_euaton(&pdp->eua, &addr)) { + if (pdp_euaton(&pdp->eua, &addr.v4)) { printf ("Received create PDP context response. Cause value: %d\n", cause); @@ -1335,7 +1339,7 @@ } printf("Received create PDP context response. IP address: %s\n", - inet_ntoa(addr)); + inet_ntoa(addr.v4)); if ((options.createif) && (!options.net.s_addr)) { struct in_addr m; @@ -1345,11 +1349,11 @@ m.s_addr = -1; #endif /* printf("Setting up interface and routing\n"); */ - tun_addaddr(tun, &addr, &addr, &m); + tun_addaddr(tun, &addr.v4, &addr.v4, &m); if (options.defaultroute) { struct in_addr rm; rm.s_addr = 0; - tun_addroute(tun, &rm, &addr, &rm); + tun_addroute(tun, &rm, &addr.v4, &rm); } if (options.ipup) tun_runscript(tun, options.ipup); @@ -1472,9 +1476,10 @@ } if ((options.createif) && (options.net.s_addr)) { + struct in_addr mask; + mask.s_addr = options.prefixlen ? (0xFFFFFFFF >> (32 - options.prefixlen)) : 0; /* printf("Setting up interface and routing\n"); */ - tun_addaddr(tun, &options.netaddr, &options.destaddr, - &options.mask); + tun_addaddr(tun, &options.netaddr, &options.destaddr, &mask); if (options.defaultroute) { struct in_addr rm; rm.s_addr = 0; -- To view, visit https://gerrit.osmocom.org/3403 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ib98cc4bf634d6be9a7bf8c03a24e629455fcafc8 Gerrit-PatchSet: 5 Gerrit-Project: openggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Aug 9 20:33:29 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 9 Aug 2017 20:33:29 +0000 Subject: [MERGED] openggsn[master]: ggsn: Send proper errors in create_context_ind() In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: ggsn: Send proper errors in create_context_ind() ...................................................................... ggsn: Send proper errors in create_context_ind() When we receive PDP context requests for unknown PDP types or if we run out of dynamic addresses, we need to inform the SGSN that PDP context creation failed. Change-Id: Ibf199c1726130d27c8f80230b30ee51101c93b06 --- M ggsn/ggsn.c M lib/ippool.c M lib/ippool.h 3 files changed, 20 insertions(+), 11 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/ggsn/ggsn.c b/ggsn/ggsn.c index 8e7d1e3..0629f9e 100644 --- a/ggsn/ggsn.c +++ b/ggsn/ggsn.c @@ -178,6 +178,7 @@ { struct in46_addr addr; struct ippoolm_t *member; + int rc; DEBUGP(DGGSN, "Received create PDP context request\n"); @@ -192,11 +193,16 @@ pdp->qos_neg.l = pdp->qos_req.l; if (in46a_from_eua(&pdp->eua, &addr)) { - addr.v4.s_addr = 0; /* Request dynamic */ + SYS_ERR(DGGSN, LOGL_ERROR, 0, "Cannot decode EUA from MS/SGSN: %s", + osmo_hexdump(pdp->eua.v, pdp->eua.l)); + gtp_create_context_resp(gsn, pdp, GTPCAUSE_UNKNOWN_PDP); + return 0; } - if (ippool_newip(ippool, &member, &addr, 0)) { - gtp_create_context_resp(gsn, pdp, GTPCAUSE_NO_RESOURCES); + rc = ippool_newip(ippool, &member, &addr, 0); + if (rc < 0) { + SYS_ERR(DGGSN, LOGL_ERROR, 0, "Cannot allocate IP address in pool\n"); + gtp_create_context_resp(gsn, pdp, -rc); return 0; /* Allready in use, or no more available */ } @@ -208,6 +214,8 @@ if (gtp_kernel_tunnel_add(pdp) < 0) { SYS_ERR(DGGSN, LOGL_ERROR, 0, "Cannot add tunnel to kernel: %s\n", strerror(errno)); + gtp_create_context_resp(gsn, pdp, GTPCAUSE_SYS_FAIL); + return 0; } if (!send_trap(gsn, pdp, member, "imsi-ass-ip")) { /* TRAP with IP assignment */ diff --git a/lib/ippool.c b/lib/ippool.c index 3ca1b86..007dc50 100644 --- a/lib/ippool.c +++ b/lib/ippool.c @@ -402,7 +402,7 @@ if (!this->allowstat) { SYS_ERR(DIP, LOGL_ERROR, 0, "Static IP address not allowed"); - return -1; + return -GTPCAUSE_NOT_SUPPORTED; } if (!in46a_within_mask(addr, &this->stataddr, this->stataddrprefixlen)) { SYS_ERR(DIP, LOGL_ERROR, 0, "Static out of range"); @@ -412,7 +412,7 @@ if (!this->allowdyn) { SYS_ERR(DIP, LOGL_ERROR, 0, "Dynamic IP address not allowed"); - return -1; + return -GTPCAUSE_NOT_SUPPORTED; } } @@ -438,7 +438,7 @@ if (!this->firstdyn) { SYS_ERR(DIP, LOGL_ERROR, 0, "No more IP addresses available"); - return -1; + return -GTPCAUSE_ADDR_OCCUPIED; } else p2 = this->firstdyn; } @@ -447,12 +447,12 @@ if (p2->inuse) { SYS_ERR(DIP, LOGL_ERROR, 0, "IP address allready in use"); - return -1; /* Allready in use / Should not happen */ + return -GTPCAUSE_SYS_FAIL; /* Allready in use / Should not happen */ } if (p2->addr.len != addr->len) { SYS_ERR(DIP, LOGL_ERROR, 0, "MS requested unsupported PDP context type"); - return -1; + return -GTPCAUSE_UNKNOWN_PDP; } /* Remove from linked list of free dynamic addresses */ @@ -481,13 +481,13 @@ if (!this->firststat) { SYS_ERR(DIP, LOGL_ERROR, 0, "No more IP addresses available"); - return -1; /* No more available */ + return -GTPCAUSE_ADDR_OCCUPIED; /* No more available */ } else p2 = this->firststat; if (p2->addr.len != addr->len) { SYS_ERR(DIP, LOGL_ERROR, 0, "MS requested unsupported PDP context type"); - return -1; + return -GTPCAUSE_UNKNOWN_PDP; } /* Remove from linked list of free static addresses */ @@ -512,7 +512,7 @@ SYS_ERR(DIP, LOGL_ERROR, 0, "Could not allocate IP address"); - return -1; /* Should never get here. TODO: Bad code */ + return -GTPCAUSE_SYS_FAIL; /* Should never get here. TODO: Bad code */ } int ippool_freeip(struct ippool_t *this, struct ippoolm_t *member) diff --git a/lib/ippool.h b/lib/ippool.h index e3c1c92..ba92a56 100644 --- a/lib/ippool.h +++ b/lib/ippool.h @@ -13,6 +13,7 @@ #define _IPPOOL_H #include "../lib/in46_addr.h" +#include "../gtp/gtp.h" /* Assuming that the address space is fragmented we need a hash table in order to return the addresses. -- To view, visit https://gerrit.osmocom.org/3407 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ibf199c1726130d27c8f80230b30ee51101c93b06 Gerrit-PatchSet: 6 Gerrit-Project: openggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Aug 9 20:33:30 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 9 Aug 2017 20:33:30 +0000 Subject: [MERGED] openggsn[master]: ippool_new(): const-ify input arguments In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: ippool_new(): const-ify input arguments ...................................................................... ippool_new(): const-ify input arguments Change-Id: If3e53584e8c9c1f06bba4c183c9fd65fae913904 --- M lib/ippool.c M lib/ippool.h 2 files changed, 2 insertions(+), 2 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/lib/ippool.c b/lib/ippool.c index c3eb267..3ca1b86 100644 --- a/lib/ippool.c +++ b/lib/ippool.c @@ -186,7 +186,7 @@ } /* Create new address pool */ -int ippool_new(struct ippool_t **this, char *dyn, char *stat, +int ippool_new(struct ippool_t **this, const char *dyn, const char *stat, int allowdyn, int allowstat, int flags) { diff --git a/lib/ippool.h b/lib/ippool.h index 53154f2..e3c1c92 100644 --- a/lib/ippool.h +++ b/lib/ippool.h @@ -69,7 +69,7 @@ extern unsigned long int ippool_hash(struct in46_addr *addr); /* Create new address pool */ -extern int ippool_new(struct ippool_t **this, char *dyn, char *stat, +extern int ippool_new(struct ippool_t **this, const char *dyn, const char *stat, int allowdyn, int allowstat, int flags); /* Delete existing address pool */ -- To view, visit https://gerrit.osmocom.org/3405 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: If3e53584e8c9c1f06bba4c183c9fd65fae913904 Gerrit-PatchSet: 6 Gerrit-Project: openggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Aug 9 20:33:30 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 9 Aug 2017 20:33:30 +0000 Subject: [MERGED] openggsn[master]: lib/tun.h: Remove non-endian-safe redefinition of IP header In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: lib/tun.h: Remove non-endian-safe redefinition of IP header ...................................................................... lib/tun.h: Remove non-endian-safe redefinition of IP header We can simply use 'struct iphdr' from netinet/ip.h to achieve the same goal (and be portable). Change-Id: Ieece22e127dc14a7ffdc3b05656628989ad00b32 --- M configure.ac M ggsn/ggsn.c M lib/tun.h M sgsnemu/sgsnemu.c 4 files changed, 39 insertions(+), 20 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/configure.ac b/configure.ac index 45ab22b..b7e6793 100644 --- a/configure.ac +++ b/configure.ac @@ -112,6 +112,12 @@ AC_DEFINE([HAVE_RT_MSGHDR])], AC_MSG_RESULT(no)) +AC_MSG_CHECKING(whether struct iphdr exists) +AH_TEMPLATE(HAVE_IPHDR) +AC_EGREP_HEADER(struct iphdr, netinet/ip.h, +[AC_MSG_RESULT(yes) + AC_DEFINE([HAVE_IPHDR])], + AC_MSG_RESULT(no)) # Checks for library functions. AC_PROG_GCC_TRADITIONAL diff --git a/ggsn/ggsn.c b/ggsn/ggsn.c index 0d0e569..4fb2066 100644 --- a/ggsn/ggsn.c +++ b/ggsn/ggsn.c @@ -34,6 +34,7 @@ #include #include #include +#include #include #include #include @@ -42,6 +43,7 @@ #include #include #include +#include #include #include @@ -221,13 +223,13 @@ { struct ippoolm_t *ipm; struct in46_addr dst; - struct tun_packet_t *iph = (struct tun_packet_t *)pack; + struct iphdr *iph = (struct iphdr *)pack; - if (iph->ver == 4) { + if (iph->version == 4) { if (len < sizeof(*iph) || len < 4*iph->ihl) return -1; dst.len = 4; - dst.v4.s_addr = iph->dst; + dst.v4.s_addr = iph->daddr; } else { LOGP(DGGSN, LOGL_NOTICE, "non-IPv4 packet received from tun\n"); return -1; diff --git a/lib/tun.h b/lib/tun.h index ce7b91c..c50bdf9 100644 --- a/lib/tun.h +++ b/lib/tun.h @@ -17,21 +17,31 @@ #define TUN_ADDRSIZE 128 #define TUN_NLBUFSIZE 1024 -struct tun_packet_t { - unsigned int ver:4; - unsigned int ihl:4; - unsigned int dscp:6; - unsigned int ecn:2; - unsigned int length:16; - unsigned int id:16; - unsigned int flags:3; - unsigned int fragment:13; - unsigned int ttl:8; - unsigned int protocol:8; - unsigned int check:16; - unsigned int src:32; - unsigned int dst:32; -}; +#include "config.h" +#ifndef HAVE_IPHDR +struct iphdr + { +#if __BYTE_ORDER == __LITTLE_ENDIAN + unsigned int ihl:4; + unsigned int version:4; +#elif __BYTE_ORDER == __BIG_ENDIAN + unsigned int version:4; + unsigned int ihl:4; +#else +# error "Please fix " +#endif + u_int8_t tos; + u_int16_t tot_len; + u_int16_t id; + u_int16_t frag_off; + u_int8_t ttl; + u_int8_t protocol; + u_int16_t check; + u_int32_t saddr; + u_int32_t daddr; + /*The options start here. */ + }; +#endif /* !HAVE_IPHDR */ /* *********************************************************** * Information storage for each tun instance diff --git a/sgsnemu/sgsnemu.c b/sgsnemu/sgsnemu.c index 90a6200..af8f9fa 100644 --- a/sgsnemu/sgsnemu.c +++ b/sgsnemu/sgsnemu.c @@ -29,6 +29,7 @@ #include #include #include +#include #include #include #include @@ -1281,10 +1282,10 @@ { struct iphash_t *ipm; struct in46_addr src; - struct tun_packet_t *iph = (struct tun_packet_t *)pack; + struct iphdr *iph = (struct iphdr *)pack; src.len = 4; - src.v4.s_addr = iph->src; + src.v4.s_addr = iph->saddr; if (ipget(&ipm, &src)) { printf("Dropping packet from invalid source address: %s\n", -- To view, visit https://gerrit.osmocom.org/3404 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ieece22e127dc14a7ffdc3b05656628989ad00b32 Gerrit-PatchSet: 6 Gerrit-Project: openggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Aug 9 20:33:30 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 9 Aug 2017 20:33:30 +0000 Subject: [MERGED] openggsn[master]: Proper fix for "Force Dynamic IP" in Create PDP CTX In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Proper fix for "Force Dynamic IP" in Create PDP CTX ...................................................................... Proper fix for "Force Dynamic IP" in Create PDP CTX An EUA length of *2* octets indicates dynamic IP address, while an EUA length of 0 is invalid. Let's fix this hack (which needs to finally be removed anyway). Change-Id: Ib1b57eb0654327882044d6862d955f4b32aa6bcd --- M ggsn/ggsn.c 1 file changed, 3 insertions(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/ggsn/ggsn.c b/ggsn/ggsn.c index 4d07f11..168e907 100644 --- a/ggsn/ggsn.c +++ b/ggsn/ggsn.c @@ -173,7 +173,9 @@ DEBUGP(DGGSN, "Received create PDP context request\n"); - pdp->eua.l = 0; /* TODO: Indicates dynamic IP */ + /* FIXME: we manually force all context requests to dynamic here! */ + if (pdp->eua.l > 2) + pdp->eua.l = 2; memcpy(pdp->qos_neg0, pdp->qos_req0, sizeof(pdp->qos_req0)); memcpy(&pdp->pco_neg, &pco, sizeof(pdp->pco_neg)); -- To view, visit https://gerrit.osmocom.org/3409 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ib1b57eb0654327882044d6862d955f4b32aa6bcd Gerrit-PatchSet: 1 Gerrit-Project: openggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Aug 9 20:38:30 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 9 Aug 2017 20:38:30 +0000 Subject: [PATCH] openggsn[master]: Support setting TUN device IPv6 address + prefix In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3408 to look at the new patch set (#7). Support setting TUN device IPv6 address + prefix As we can now have PDP contexts with IPv6 user IP payload, it is useful to extend the TUN related code to be able to configure the tun device IPv6 address + prefix length Change-Id: I899d21e52d02e0b8384af29ddd489ff19c8f2cf6 --- M ggsn/ggsn.c M lib/tun.c M lib/tun.h 3 files changed, 111 insertions(+), 17 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openggsn refs/changes/08/3408/7 diff --git a/ggsn/ggsn.c b/ggsn/ggsn.c index 991b54c..05a56ae 100644 --- a/ggsn/ggsn.c +++ b/ggsn/ggsn.c @@ -70,7 +70,7 @@ int maxfd = 0; /* For select() */ struct in_addr listen_; -struct in_addr netaddr, destaddr, net; /* Network interface */ +struct in46_addr netaddr, destaddr, net; /* Network interface */ size_t prefixlen; struct in46_addr dns1, dns2; /* PCO DNS address */ char *ipup, *ipdown; /* Filename of scripts */ @@ -547,16 +547,16 @@ /* net */ /* Store net as in_addr net and mask */ if (args_info.net_arg) { - struct in46_addr in46; - if (ippool_aton(&in46, &prefixlen, args_info.net_arg, 0)) { + if (ippool_aton(&net, &prefixlen, args_info.net_arg, 0)) { SYS_ERR(DGGSN, LOGL_ERROR, 0, "Invalid network address: %s!", args_info.net_arg); exit(1); } - net.s_addr = in46.v4.s_addr; - netaddr.s_addr = htonl(ntohl(net.s_addr) + 1); - destaddr.s_addr = htonl(ntohl(net.s_addr) + 1); + /* default for network + destination address = net + 1 */ + netaddr = net; + in46a_inc(&netaddr); + destaddr = netaddr; } else { SYS_ERR(DGGSN, LOGL_ERROR, 0, "Network address must be specified: %s!", @@ -710,7 +710,7 @@ maxfd = gsn->fd1u; /* use GTP kernel module for data packet encapsulation */ - if (gtp_kernel_init(gsn, &net, prefixlen, &args_info) < 0) + if (gtp_kernel_init(gsn, &net.v4, prefixlen, &args_info) < 0) goto err; gtp_set_cb_data_ind(gsn, encaps_tun); @@ -735,7 +735,7 @@ } DEBUGP(DGGSN, "Setting tun IP address\n"); - if (tun_setaddr(tun, &netaddr, &destaddr, &prefixlen)) { + if (tun_setaddr(tun, &netaddr, &destaddr, prefixlen)) { SYS_ERR(DGGSN, LOGL_ERROR, 0, "Failed to set tun IP address"); exit(1); } diff --git a/lib/tun.c b/lib/tun.c index 8325f5d..7e0af12 100644 --- a/lib/tun.c +++ b/lib/tun.c @@ -1,6 +1,7 @@ /* * TUN interface functions. * Copyright (C) 2002, 2003, 2004 Mondru AB. + * Copyright (C) 2017 by Harald Welte * * The contents of this file may be used under the terms of the GNU * General Public License Version 2, provided that the above copyright @@ -65,7 +66,12 @@ #include "tun.h" #include "syserr.h" +static int tun_setaddr4(struct tun_t *this, struct in_addr *addr, + struct in_addr *dstaddr, struct in_addr *netmask); + #if defined(__linux__) + +#include int tun_nlattr(struct nlmsghdr *n, int nsize, int type, void *d, int dlen) { @@ -247,7 +253,7 @@ struct msghdr msg; if (!this->addrs) /* Use ioctl for first addr to make ping work */ - return tun_setaddr(this, addr, dstaddr, netmask); + return tun_setaddr4(this, addr, dstaddr, netmask); memset(&req, 0, sizeof(req)); req.n.nlmsg_len = NLMSG_LENGTH(sizeof(struct ifaddrmsg)); @@ -345,7 +351,7 @@ /* TODO: Is this needed on FreeBSD? */ if (!this->addrs) /* Use ioctl for first addr to make ping work */ - return tun_setaddr(this, addr, dstaddr, netmask); /* TODO dstaddr */ + return tun_setaddr4(this, addr, dstaddr, netmask); /* TODO dstaddr */ memset(&areq, 0, sizeof(areq)); @@ -391,7 +397,7 @@ #elif defined (__sun__) if (!this->addrs) /* Use ioctl for first addr to make ping work */ - return tun_setaddr(this, addr, dstaddr, netmask); + return tun_setaddr4(this, addr, dstaddr, netmask); SYS_ERR(DTUN, LOGL_ERROR, errno, "Setting multiple addresses not possible on Solaris"); @@ -403,9 +409,8 @@ } -int tun_setaddr(struct tun_t *this, - struct in_addr *addr, - struct in_addr *dstaddr, struct in_addr *netmask) +static int tun_setaddr4(struct tun_t *this, struct in_addr *addr, + struct in_addr *dstaddr, struct in_addr *netmask) { struct ifreq ifr; int fd; @@ -498,13 +503,99 @@ tun_sifflags(this, IFF_UP | IFF_RUNNING); #if defined(__FreeBSD__) || defined (__APPLE__) - tun_addroute(this, dstaddr, addr, netmask); + tun_addroute(this, dstaddr, addr, &this->netmask); this->routes = 1; #endif return 0; } +static int tun_setaddr6(struct tun_t *this, struct in6_addr *addr, struct in6_addr *dstaddr, + size_t prefixlen) +{ + struct in6_ifreq ifr; + struct ifreq namereq; + int fd; + + memset(&ifr, 0, sizeof(ifr)); + memset(&namereq, 0, sizeof(namereq)); + + /* Create a channel to the NET kernel */ + if ((fd = socket(AF_INET6, SOCK_DGRAM, 0)) < 0) { + SYS_ERR(DTUN, LOGL_ERROR, 0, "socket() failed"); + return -1; + } + + /* get interface index */ + strncpy(namereq.ifr_name, this->devname, IFNAMSIZ); + namereq.ifr_name[IFNAMSIZ-1] = 0; + if (ioctl(fd, SIOGIFINDEX, &namereq) < 0) { + SYS_ERR(DTUN, LOGL_ERROR, 0, "Could not get ifindex"); + return -1; + } + ifr.ifr6_ifindex = namereq.ifr_ifindex; + ifr.ifr6_prefixlen = prefixlen; + + if (addr) { + memcpy(&this->addr, addr, sizeof(*addr)); + memcpy(&ifr.ifr6_addr, addr, sizeof(*addr)); + if (ioctl(fd, SIOCSIFADDR, (void *) &ifr) < 0) { + if (errno != EEXIST) { + SYS_ERR(DTUN, LOGL_ERROR, 0, "ioctl(SIOCSIFADDR) failed"); + } else { + SYS_ERR(DTUN, LOGL_NOTICE, 0, "ioctl(SIOCSIFADDR): Address alreadsy exists"); + } + close(fd); + return -1; + } + } + +#if 0 + /* FIXME: looks like this is not possible/necessary for IPv6? */ + if (dstaddr) { + memcpy(&this->dstaddr, dstaddr, sizeof(*dstaddr)); + memcpy(&ifr.ifr6_addr, dstaddr, sizeof(*dstaddr)); + if (ioctl(fd, SIOCSIFDSTADDR, (caddr_t *) &ifr) < 0) { + SYS_ERR(DTUN, LOGL_ERROR, "ioctl(SIOCSIFDSTADDR) failed"); + close(fd); + return -1; + } + } +#endif + + close(fd); + this->addrs++; + + /* On linux the route to the interface is set automatically + on FreeBSD we have to do this manually */ + + /* TODO: How does it work on Solaris? */ + + tun_sifflags(this, IFF_UP | IFF_RUNNING); + +#if 0 /* FIXME */ +//#if defined(__FreeBSD__) || defined (__APPLE__) + tun_addroute6(this, dstaddr, addr, prefixlen); + this->routes = 1; +#endif + + return 0; +} + +int tun_setaddr(struct tun_t *this, struct in46_addr *addr, struct in46_addr *dstaddr, size_t prefixlen) +{ + struct in_addr netmask; + switch (addr->len) { + case 4: + netmask.s_addr = htonl(0xffffffff << (32 - prefixlen)); + return tun_setaddr4(this, &addr->v4, dstaddr ? &dstaddr->v4 : NULL, &netmask); + case 16: + return tun_setaddr6(this, &addr->v6, dstaddr ? &dstaddr->v6 : NULL, prefixlen); + default: + return -1; + } +} + int tun_route(struct tun_t *this, struct in_addr *dst, struct in_addr *gateway, struct in_addr *mask, int delete) diff --git a/lib/tun.h b/lib/tun.h index c50bdf9..1cd0767 100644 --- a/lib/tun.h +++ b/lib/tun.h @@ -1,6 +1,7 @@ /* * TUN interface functions. * Copyright (C) 2002, 2003 Mondru AB. + * Copyright (C) 2017 by Harald Welte * * The contents of this file may be used under the terms of the GNU * General Public License Version 2, provided that the above copyright @@ -11,6 +12,8 @@ #ifndef _TUN_H #define _TUN_H + +#include "../lib/in46_addr.h" #define PACKET_MAX 8196 /* Maximum packet size we receive */ #define TUN_SCRIPTSIZE 256 @@ -66,8 +69,8 @@ extern int tun_addaddr(struct tun_t *this, struct in_addr *addr, struct in_addr *dstaddr, struct in_addr *netmask); -extern int tun_setaddr(struct tun_t *this, struct in_addr *our_adr, - struct in_addr *his_adr, struct in_addr *net_mask); +extern int tun_setaddr(struct tun_t *this, struct in46_addr *our_adr, + struct in46_addr *his_adr, size_t prefixlen); int tun_addroute(struct tun_t *this, struct in_addr *dst, struct in_addr *gateway, struct in_addr *mask); -- To view, visit https://gerrit.osmocom.org/3408 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I899d21e52d02e0b8384af29ddd489ff19c8f2cf6 Gerrit-PatchSet: 7 Gerrit-Project: openggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Aug 9 20:38:30 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 9 Aug 2017 20:38:30 +0000 Subject: [PATCH] openggsn[master]: ippool: Extend pool to work with /64 prefixes In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3457 to look at the new patch set (#2). ippool: Extend pool to work with /64 prefixes In IPv6 GPRS, we actually don't want to allocate an individual v6 address (like in IPv4), but we want to allocate a prefix. The standard prefix lengh is 8 bytes, i.e. a /64 prefix. This patch extends the pool to be able to work with such v6 prefixes. Change-Id: I0cf700b6baf195a2e5fbea000531f801acaaa443 --- M ggsn/ggsn.c M lib/in46_addr.c M lib/ippool.c 3 files changed, 17 insertions(+), 8 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openggsn refs/changes/57/3457/2 diff --git a/ggsn/ggsn.c b/ggsn/ggsn.c index 0629f9e..9b11884 100644 --- a/ggsn/ggsn.c +++ b/ggsn/ggsn.c @@ -241,7 +241,11 @@ dst.len = 4; dst.v4.s_addr = iph->daddr; } else if (iph->version == 6) { - dst.len = 16; + /* Due to the fact that 3GPP requires an allocation of a + * /64 prefix to each MS, we must instruct + * ippool_getip() below to match only the leading /64 + * prefix, i.e. the first 8 bytes of the address */ + dst.len = 8; dst.v6 = ip6h->ip6_dst; } else { LOGP(DGGSN, LOGL_NOTICE, "non-IPv packet received from tun\n"); diff --git a/lib/in46_addr.c b/lib/in46_addr.c index a220583..1785377 100644 --- a/lib/in46_addr.c +++ b/lib/in46_addr.c @@ -25,6 +25,7 @@ switch (in->len) { case 4: return AF_INET; + case 8: case 16: return AF_INET6; default: @@ -175,6 +176,7 @@ eua->v[1] = 0x21; /* IPv4 */ memcpy(&eua->v[2], &src->v4, 4); /* Copy a 4 byte address */ break; + case 8: case 16: eua->l = 18; eua->v[0] = 0xf1; /* IETF */ diff --git a/lib/ippool.c b/lib/ippool.c index 007dc50..1729ec7 100644 --- a/lib/ippool.c +++ b/lib/ippool.c @@ -96,11 +96,10 @@ return lookup((unsigned char *)&addr->s_addr, sizeof(addr->s_addr), 0); } -static unsigned long int ippool_hash6(struct in6_addr *addr) +static unsigned long int ippool_hash6(struct in6_addr *addr, unsigned int len) { /* TODO: Review hash spread for IPv6 */ - return lookup((unsigned char *)addr->s6_addr, sizeof(addr->s6_addr), - 0); + return lookup((unsigned char *)addr->s6_addr, len, 0); } unsigned long int ippool_hash(struct in46_addr *addr) @@ -108,7 +107,7 @@ if (addr->len == 4) return ippool_hash4(&addr->v4); else - return ippool_hash6(&addr->v6); + return ippool_hash6(&addr->v6, addr->len); } /* Get IP address and mask */ @@ -209,6 +208,10 @@ "Failed to parse dynamic pool"); return -1; } + /* we want to work with /64 prefixes, i.e. allocate /64 prefixes rather + * than /128 (single IPv6 addresses) */ + if (addr.len == sizeof(struct in6_addr)) + addr.len = 64/8; /* Set IPPOOL_NONETWORK if IPPOOL_NOGATEWAY is set */ if (flags & IPPOOL_NOGATEWAY) { @@ -348,7 +351,7 @@ /* Find in hash table */ hash = ippool_hash(addr) & this->hashmask; for (p = this->hash[hash]; p; p = p->nexthash) { - if (in46a_equal(&p->addr, addr)) { + if (in46a_prefix_equal(&p->addr, addr)) { if (member) *member = p; return 0; @@ -421,7 +424,7 @@ /* Find in hash table */ hash = ippool_hash(addr) & this->hashmask; for (p = this->hash[hash]; p; p = p->nexthash) { - if (in46a_equal(&p->addr, addr)) { + if (in46a_prefix_equal(&p->addr, addr)) { p2 = p; break; } @@ -450,7 +453,7 @@ return -GTPCAUSE_SYS_FAIL; /* Allready in use / Should not happen */ } - if (p2->addr.len != addr->len) { + if (p2->addr.len != addr->len && !(addr->len == 16 && p2->addr.len == 8)) { SYS_ERR(DIP, LOGL_ERROR, 0, "MS requested unsupported PDP context type"); return -GTPCAUSE_UNKNOWN_PDP; } -- To view, visit https://gerrit.osmocom.org/3457 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I0cf700b6baf195a2e5fbea000531f801acaaa443 Gerrit-PatchSet: 2 Gerrit-Project: openggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Aug 9 20:38:30 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 9 Aug 2017 20:38:30 +0000 Subject: [PATCH] openggsn[master]: IPv6: Implement IPv6 prefix assignment via ICMPv6 router adv... In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3458 to look at the new patch set (#2). IPv6: Implement IPv6 prefix assignment via ICMPv6 router advertisement The 3GPP specs are quite strange when it comes to how an IPv6 address or rather prefix is assigned to an IPv6 PDP context. The designated method for allocating the IPv6 address via the PDP EUA (End User Address) Information Element in the GTP signalling plane is *not* used to allocate the address/prefix. Instead, the EUA is used to allocate an "interface identifier" to the MS, which it the uses to derive its link-local source address to send a router solicitation. The GGSN subsequently answers witha router advertisement, advertising a single/64 prefix, whihcthe MS then uses to generate it's real IPv6 source address for subsequent communication. Change-Id: Icddf7d30e01d76a4784bcef5787b36f52f703a9f --- M ggsn/Makefile.am A ggsn/checksum.c A ggsn/checksum.h M ggsn/ggsn.c A ggsn/icmpv6.c A ggsn/icmpv6.h M lib/debug.c M lib/syserr.h 8 files changed, 500 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openggsn refs/changes/58/3458/2 diff --git a/ggsn/Makefile.am b/ggsn/Makefile.am index 3ad3a6e..c945f0b 100644 --- a/ggsn/Makefile.am +++ b/ggsn/Makefile.am @@ -12,7 +12,7 @@ endif ggsn_DEPENDENCIES = ../gtp/libgtp.la ../lib/libmisc.a -ggsn_SOURCES = ggsn.c cmdline.c cmdline.h gtp-kernel.h +ggsn_SOURCES = ggsn.c cmdline.c cmdline.h gtp-kernel.h icmpv6.c icmpv6.h checksum.c checksum.h if ENABLE_GTP_KERNEL ggsn_SOURCES += gtp-kernel.c diff --git a/ggsn/checksum.c b/ggsn/checksum.c new file mode 100644 index 0000000..1e9e58e --- /dev/null +++ b/ggsn/checksum.c @@ -0,0 +1,205 @@ +/* + * + * INET An implementation of the TCP/IP protocol suite for the LINUX + * operating system. INET is implemented using the BSD Socket + * interface as the means of communication with the user level. + * + * IP/TCP/UDP checksumming routines + * + * Authors: Jorge Cwik, + * Arnt Gulbrandsen, + * Tom May, + * Andreas Schwab, + * Lots of code moved from tcp.c and ip.c; see those files + * for more names. + * + * 03/02/96 Jes Sorensen, Andreas Schwab, Roman Hodek: + * Fixed some nasty bugs, causing some horrible crashes. + * A: At some points, the sum (%0) was used as + * length-counter instead of the length counter + * (%1). Thanks to Roman Hodek for pointing this out. + * B: GCC seems to mess up if one uses too many + * data-registers to hold input values and one tries to + * specify d0 and d1 as scratch registers. Letting gcc + * choose these registers itself solves the problem. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version + * 2 of the License, or (at your option) any later version. + */ + +/* Revised by Kenneth Albanowski for m68knommu. Basic problem: unaligned access + kills, so most of the assembly has to go. */ + +#include "checksum.h" +#include +#include + +static inline unsigned short from32to16(unsigned int x) +{ + /* add up 16-bit and 16-bit for 16+c bit */ + x = (x & 0xffff) + (x >> 16); + /* add up carry.. */ + x = (x & 0xffff) + (x >> 16); + return x; +} + +static unsigned int do_csum(const unsigned char *buff, int len) +{ + int odd; + unsigned int result = 0; + + if (len <= 0) + goto out; + odd = 1 & (unsigned long) buff; + if (odd) { +#ifdef __LITTLE_ENDIAN + result += (*buff << 8); +#else + result = *buff; +#endif + len--; + buff++; + } + if (len >= 2) { + if (2 & (unsigned long) buff) { + result += *(unsigned short *) buff; + len -= 2; + buff += 2; + } + if (len >= 4) { + const unsigned char *end = buff + ((unsigned)len & ~3); + unsigned int carry = 0; + do { + unsigned int w = *(unsigned int *) buff; + buff += 4; + result += carry; + result += w; + carry = (w > result); + } while (buff < end); + result += carry; + result = (result & 0xffff) + (result >> 16); + } + if (len & 2) { + result += *(unsigned short *) buff; + buff += 2; + } + } + if (len & 1) +#ifdef __LITTLE_ENDIAN + result += *buff; +#else + result += (*buff << 8); +#endif + result = from32to16(result); + if (odd) + result = ((result >> 8) & 0xff) | ((result & 0xff) << 8); +out: + return result; +} + +/* + * This is a version of ip_compute_csum() optimized for IP headers, + * which always checksum on 4 octet boundaries. + */ +uint16_t ip_fast_csum(const void *iph, unsigned int ihl) +{ + return (uint16_t)~do_csum(iph, ihl*4); +} + +/* + * computes the checksum of a memory block at buff, length len, + * and adds in "sum" (32-bit) + * + * returns a 32-bit number suitable for feeding into itself + * or csum_tcpudp_magic + * + * this function must be called with even lengths, except + * for the last fragment, which may be odd + * + * it's best to have buff aligned on a 32-bit boundary + */ +uint32_t csum_partial(const void *buff, int len, uint32_t wsum) +{ + unsigned int sum = (unsigned int)wsum; + unsigned int result = do_csum(buff, len); + + /* add in old sum, and carry.. */ + result += sum; + if (sum > result) + result += 1; + return (uint32_t)result; +} + +/* + * this routine is used for miscellaneous IP-like checksums, mainly + * in icmp.c + */ +uint16_t ip_compute_csum(const void *buff, int len) +{ + return (uint16_t)~do_csum(buff, len); +} + +uint16_t csum_ipv6_magic(const struct in6_addr *saddr, + const struct in6_addr *daddr, + uint32_t len, uint8_t proto, uint32_t csum) +{ + int carry; + uint32_t ulen; + uint32_t uproto; + uint32_t sum = (uint32_t)csum; + + sum += (uint32_t)saddr->s6_addr32[0]; + carry = (sum < (uint32_t)saddr->s6_addr32[0]); + sum += carry; + + sum += (uint32_t)saddr->s6_addr32[1]; + carry = (sum < (uint32_t)saddr->s6_addr32[1]); + sum += carry; + + sum += (uint32_t)saddr->s6_addr32[2]; + carry = (sum < (uint32_t)saddr->s6_addr32[2]); + sum += carry; + + sum += (uint32_t)saddr->s6_addr32[3]; + carry = (sum < (uint32_t)saddr->s6_addr32[3]); + sum += carry; + + sum += (uint32_t)daddr->s6_addr32[0]; + carry = (sum < (uint32_t)daddr->s6_addr32[0]); + sum += carry; + + sum += (uint32_t)daddr->s6_addr32[1]; + carry = (sum < (uint32_t)daddr->s6_addr32[1]); + sum += carry; + + sum += (uint32_t)daddr->s6_addr32[2]; + carry = (sum < (uint32_t)daddr->s6_addr32[2]); + sum += carry; + + sum += (uint32_t)daddr->s6_addr32[3]; + carry = (sum < (uint32_t)daddr->s6_addr32[3]); + sum += carry; + + ulen = (uint32_t)htonl((uint32_t) len); + sum += ulen; + carry = (sum < ulen); + sum += carry; + + uproto = (uint32_t)htonl(proto); + sum += uproto; + carry = (sum < uproto); + sum += carry; + + return csum_fold((uint32_t)sum); +} + +/* fold a partial checksum */ +uint16_t csum_fold(uint32_t csum) +{ + uint32_t sum = (uint32_t)csum; + sum = (sum & 0xffff) + (sum >> 16); + sum = (sum & 0xffff) + (sum >> 16); + return (uint16_t)~sum; +} diff --git a/ggsn/checksum.h b/ggsn/checksum.h new file mode 100644 index 0000000..4b22431 --- /dev/null +++ b/ggsn/checksum.h @@ -0,0 +1,13 @@ +#pragma once +#include +#include + +uint16_t ip_fast_csum(const void *iph, unsigned int ihl); +uint32_t csum_partial(const void *buff, int len, uint32_t wsum); +uint16_t ip_compute_csum(const void *buff, int len); + +uint16_t csum_ipv6_magic(const struct in6_addr *saddr, + const struct in6_addr *daddr, + uint32_t len, uint8_t proto, uint32_t csum); + +uint16_t csum_fold(uint32_t csum); diff --git a/ggsn/ggsn.c b/ggsn/ggsn.c index 9b11884..c307177 100644 --- a/ggsn/ggsn.c +++ b/ggsn/ggsn.c @@ -64,6 +64,7 @@ #include "../gtp/gtp.h" #include "cmdline.h" #include "gtp-kernel.h" +#include "icmpv6.h" int end = 0; int maxfd = 0; /* For select() */ @@ -206,11 +207,23 @@ return 0; /* Allready in use, or no more available */ } - in46a_to_eua(&member->addr, &pdp->eua); + if (addr.len == sizeof(struct in6_addr)) { + struct in46_addr tmp; + /* IPv6 doesn't really send the real/allocated address at this point, but just + * the link-identifier which the MS shall use for router solicitation */ + tmp.len = addr.len; + /* initialize upper 64 bits to prefix, they are discarded by MS anyway */ + memcpy(tmp.v6.s6_addr, &member->addr.v6, 8); + /* use allocated 64bit prefix as lower 64bit, used as link id by MS */ + memcpy(tmp.v6.s6_addr+8, &member->addr.v6, 8); + in46a_to_eua(&tmp, &pdp->eua); + } else + in46a_to_eua(&member->addr, &pdp->eua); pdp->peer = member; pdp->ipif = tun; /* TODO */ member->peer = pdp; + /* TODO: In IPv6, EUA doesn't contain the actual IP addr/prefix! */ if (gtp_kernel_tunnel_add(pdp) < 0) { SYS_ERR(DGGSN, LOGL_ERROR, 0, "Cannot add tunnel to kernel: %s\n", strerror(errno)); @@ -264,9 +277,30 @@ return 0; } +/* RFC3307 link-local scope multicast address */ +static const struct in6_addr all_router_mcast_addr = { + .s6_addr = { 0xff,0x02,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,2 } +}; + int encaps_tun(struct pdp_t *pdp, void *pack, unsigned len) { + struct iphdr *iph = (struct iphdr *)pack; + struct ip6_hdr *ip6h = (struct ip6_hdr *)pack; + DEBUGP(DGGSN, "encaps_tun. Packet received: forwarding to tun\n"); + + switch (iph->version) { + case 6: + /* daddr: all-routers multicast addr */ + if (IN6_ARE_ADDR_EQUAL(&ip6h->ip6_dst, &all_router_mcast_addr)) + return handle_router_mcast(gsn, pdp, pack, len); + break; + case 4: + break; + default: + LOGP(DGGSN, LOGL_ERROR, "Packet from MS is neither IPv4 nor IPv6\n"); + return -1; + } return tun_encaps((struct tun_t *)pdp->ipif, pack, len); } diff --git a/ggsn/icmpv6.c b/ggsn/icmpv6.c new file mode 100644 index 0000000..94c980b --- /dev/null +++ b/ggsn/icmpv6.c @@ -0,0 +1,234 @@ +/* Minimal ICMPv6 code for generating router advertisements as required by + * relevant 3GPP specs for a GGSN with IPv6 PDP contexts */ + +/* (C) 2017 by Harald Welte + * + * The contents of this file may be used under the terms of the GNU + * General Public License Version 2, provided that the above copyright + * notice and this permission notice is included in all copies or + * substantial portions of the software. + */ + +#include +#include +#include +#include +#include + +#include +#include +#include "checksum.h" + +#include "../gtp/gtp.h" +#include "../gtp/pdp.h" +#include "../lib/ippool.h" +#include "../lib/syserr.h" +#include "config.h" + +/* 29.061 11.2.1.3.4 IPv6 Router Configuration Variables in GGSN */ +#define GGSN_MaxRtrAdvInterval 21600 /* 6 hours */ +#define GGSN_MinRtrAdvInterval 16200 /* 4.5 hours */ +#define GGSN_AdvValidLifetime 0xffffffff /* infinite */ +#define GGSN_AdvPreferredLifetime 0xffffffff /* infinite */ + +struct icmpv6_hdr { + uint8_t type; + uint8_t code; + uint16_t csum; +} __attribute__ ((packed)); + +/* RFC4861 Section 4.2 */ +struct icmpv6_radv_hdr { + struct icmpv6_hdr hdr; + uint8_t cur_ho_limit; +#if __BYTE_ORDER == __LITTLE_ENDIAN + uint8_t res:6, + m:1, + o:1; +#elif __BYTE_ORDER == __BIG_ENDIAN + uint8_t m:1, + o:1, + res:6; +#else +# error "Please fix " +#endif + uint16_t router_lifetime; + uint32_t reachable_time; + uint32_t retrans_timer; + uint8_t options[0]; +} __attribute__ ((packed)); + +/* RFC4861 Section 4.6 */ +struct icmpv6_opt_hdr { + uint8_t type; + /* length in units of 8 octets, including type+len! */ + uint8_t len; + uint8_t data[0]; +} __attribute__ ((packed)); + +/* RFC4861 Section 4.6.2 */ +struct icmpv6_opt_prefix { + struct icmpv6_opt_hdr hdr; + uint8_t prefix_len; +#if __BYTE_ORDER == __LITTLE_ENDIAN + uint8_t res:6, + a:1, + l:1; +#elif __BYTE_ORDER == __BIG_ENDIAN + uint8_t l:1, + a:1, + res:6; +#else +# error "Please fix " +#endif + uint32_t valid_lifetime; + uint32_t preferred_lifetime; + uint32_t res2; + uint8_t prefix[16]; +} __attribute__ ((packed)); + + +/*! construct a 3GPP 29.061 compliant router advertisement for a given prefix + * \param[in] saddr Source IPv6 address for router advertisement + * \param[in] daddr Destination IPv6 address for router advertisement IPv6 header + * \param[in] prefix The single prefix to be advertised (/64 implied!)i + * \returns callee-allocated message buffer containing router advertisement */ +struct msgb *icmpv6_construct_ra(const struct in6_addr *saddr, + const struct in6_addr *daddr, + const struct in6_addr *prefix) +{ + struct msgb *msg = msgb_alloc_headroom(512,128, "IPv6 RA"); + struct icmpv6_radv_hdr *ra; + struct icmpv6_opt_prefix *ra_opt_pref; + struct ip6_hdr *i6h; + uint32_t len; + uint16_t skb_csum; + + OSMO_ASSERT(msg); + + ra = (struct icmpv6_radv_hdr *) msgb_put(msg, sizeof(*ra)); + ra->hdr.type = 134; /* see RFC4861 4.2 */ + ra->hdr.code = 0; /* see RFC4861 4.2 */ + ra->hdr.csum = 0; /* updated below */ + ra->cur_ho_limit = 64; /* seems reasonable? */ + /* the GGSN shall leave the M-flag cleared in the Router + * Advertisement messages */ + ra->m = 0; + /* The GGSN may set the O-flag if there are additional + * configuration parameters that need to be fetched by the MS */ + ra->o = 0; /* no DHCPv6 */ + ra->res = 0; + /* RFC4861 Default: 3 * MaxRtrAdvInterval */ + ra->router_lifetime = htons(3*GGSN_MaxRtrAdvInterval); + ra->reachable_time = 0; /* Unspecified */ + + /* RFC4861 Section 4.6.2 */ + ra_opt_pref = (struct icmpv6_opt_prefix *) msgb_put(msg, sizeof(*ra_opt_pref)); + ra_opt_pref->hdr.type = 3; /* RFC4861 4.6.2 */ + ra_opt_pref->hdr.len = 4; /* RFC4861 4.6.2 */ + ra_opt_pref->prefix_len = 64; /* only prefix length as per 3GPP */ + /* The Prefix is contained in the Prefix Information Option of + * the Router Advertisements and shall have the A-flag set + * and the L-flag cleared */ + ra_opt_pref->a = 1; + ra_opt_pref->l = 0; + ra_opt_pref->res = 0; + /* The lifetime of the prefix shall be set to infinity */ + ra_opt_pref->valid_lifetime = htonl(GGSN_AdvValidLifetime); + ra_opt_pref->preferred_lifetime = htonl(GGSN_AdvPreferredLifetime); + ra_opt_pref->res2 = 0; + memcpy(ra_opt_pref->prefix, prefix, sizeof(ra_opt_pref->prefix)); + + /* checksum */ + skb_csum = csum_partial(msgb_data(msg), msgb_length(msg), 0); + len = msgb_length(msg); + ra->hdr.csum = csum_ipv6_magic(saddr, daddr, len, IPPROTO_ICMPV6, skb_csum); + + /* Push IPv6 header in front of ICMPv6 packet */ + i6h = (struct ip6_hdr *) msgb_push(msg, sizeof(*i6h)); + /* 4 bits version, 8 bits TC, 20 bits flow-ID */ + i6h->ip6_ctlun.ip6_un1.ip6_un1_flow = htonl(0x60000000); + i6h->ip6_ctlun.ip6_un1.ip6_un1_plen = htons(len); + i6h->ip6_ctlun.ip6_un1.ip6_un1_nxt = IPPROTO_ICMPV6; + i6h->ip6_ctlun.ip6_un1.ip6_un1_hlim = 255; + i6h->ip6_src = *saddr; + i6h->ip6_dst = *daddr; + + return msg; +} + +/* Walidate an ICMPv6 router solicitation according to RFC4861 6.1.1 */ +static bool icmpv6_validate_router_solicit(const uint8_t *pack, unsigned len) +{ + const struct ip6_hdr *ip6h = (struct ip6_hdr *)pack; + //const struct icmpv6_hdr *ic6h = (struct icmpv6_hdr *) (pack + sizeof(*ip6h)); + + /* Hop limit field must have 255 */ + if (ip6h->ip6_ctlun.ip6_un1.ip6_un1_hlim != 255) + return false; + /* FIXME: ICMP checksum is valid */ + /* ICMP length (derived from IP length) is 8 or more octets */ + if (ip6h->ip6_ctlun.ip6_un1.ip6_un1_plen < 8) + return false; + /* FIXME: All included options have a length > 0 */ + /* FIXME: If IP source is unspecified, no source link-layer addr option */ + return true; +} + +/* RFC3307 link-local scope multicast address */ +static const struct in6_addr my_local_addr = { + .s6_addr = { 0x01,0x02,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0xff } +}; + +/* handle incoming packets to the all-routers multicast address */ +int handle_router_mcast(struct gsn_t *gsn, struct pdp_t *pdp, const uint8_t *pack, unsigned len) +{ + struct ippoolm_t *member = pdp->peer; + const struct ip6_hdr *ip6h = (struct ip6_hdr *)pack; + const struct icmpv6_hdr *ic6h = (struct icmpv6_hdr *) (pack + sizeof(*ip6h)); + struct msgb *msg; + + OSMO_ASSERT(pdp); + OSMO_ASSERT(member); + + if (len < sizeof(*ip6h)) { + LOGP(DICMP6, LOGL_NOTICE, "Packet too short: %u bytes\n", len); + return -1; + } + + /* we only treat ICMPv6 here */ + if (ip6h->ip6_ctlun.ip6_un1.ip6_un1_nxt != IPPROTO_ICMPV6) { + LOGP(DICMP6, LOGL_DEBUG, "Ignoring non-ICMP to all-routers mcast\n"); + return 0; + } + + if (len < sizeof(*ip6h) + sizeof(*ic6h)) { + LOGP(DICMP6, LOGL_NOTICE, "Short ICMPv6 packet: %s\n", osmo_hexdump(pack, len)); + return -1; + } + + switch (ic6h->type) { + case 133: /* router solicitation */ + if (ic6h->code != 0) { + LOGP(DICMP6, LOGL_NOTICE, "ICMPv6 type 133 but code %d\n", ic6h->code); + return -1; + } + if (!icmpv6_validate_router_solicit(pack, len)) { + LOGP(DICMP6, LOGL_NOTICE, "Invalid Router Solicitation: %s\n", + osmo_hexdump(pack, len)); + return -1; + } + /* FIXME: Send router advertisement from GGSN link-local + * address to MS link-local address, including prefix + * allocated to this PDP context */ + msg = icmpv6_construct_ra(&my_local_addr, &ip6h->ip6_src, &member->addr.v6); + /* Send the constructed RA to the MS */ + gtp_data_req(gsn, pdp, msgb_data(msg), msgb_length(msg)); + msgb_free(msg); + break; + default: + LOGP(DICMP6, LOGL_DEBUG, "Unknown ICMPv6 type %u\n", ic6h->type); + break; + } + return 0; +} diff --git a/ggsn/icmpv6.h b/ggsn/icmpv6.h new file mode 100644 index 0000000..ebff04e --- /dev/null +++ b/ggsn/icmpv6.h @@ -0,0 +1,6 @@ +#pragma once + +#include "../gtp/gtp.h" +#include "../gtp/pdp.h" + +int handle_router_mcast(struct gsn_t *gsn, struct pdp_t *pdp, const uint8_t *pack, unsigned len); diff --git a/lib/debug.c b/lib/debug.c index b3850f9..83423dc 100644 --- a/lib/debug.c +++ b/lib/debug.c @@ -26,6 +26,11 @@ .description = "SGSN Emulator", .enabled = 1, .loglevel = LOGL_NOTICE, }, + [DICMP6] = { + .name = "DICMP6", + .description = "ICMPv6", + .enabled = 1, .loglevel = LOGL_DEBUG, + }, }; const struct log_info log_info = { diff --git a/lib/syserr.h b/lib/syserr.h index 0c50a5f..adc5840 100644 --- a/lib/syserr.h +++ b/lib/syserr.h @@ -19,6 +19,7 @@ DTUN, DGGSN, DSGSN, + DICMP6, }; #define SYS_ERR(sub, pri, en, fmt, args...) \ -- To view, visit https://gerrit.osmocom.org/3458 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Icddf7d30e01d76a4784bcef5787b36f52f703a9f Gerrit-PatchSet: 2 Gerrit-Project: openggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Aug 9 20:38:30 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 9 Aug 2017 20:38:30 +0000 Subject: [PATCH] openggsn[master]: IPv6: Support PCO for IPv6 DNS addresses In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3459 to look at the new patch set (#2). IPv6: Support PCO for IPv6 DNS addresses In IPv6, DNS server information is not passed along as IPCP6 like in IPv5 with IPCP. The reason is that IPCP6 (for PPP) doesn't support passing DNS server information. Rather, the relevant RFCs indicate DHCPv6 should be used even over point-to-point links. 3GPP decided to avoid DHCPv6 dependency for stateless autoconfiguration (the only mandatory IPv6 configuration mechanism) and added some new non-PPP-style PCO information elements ("containers") which can among other things inform a MS about IPV6 DNS servers. That same mechanism can also be used to inform the MS about IPv4 DNS servers, so for IPv4 there are now two competing mechanisms: IPCP and the new "native" PCO container. With this patch, we support both for IPv4. Change-Id: I21499afd61def8c925f7838bde76f34d28214b56 --- M ggsn/ggsn.c 1 file changed, 137 insertions(+), 42 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openggsn refs/changes/59/3459/2 diff --git a/ggsn/ggsn.c b/ggsn/ggsn.c index c307177..991b54c 100644 --- a/ggsn/ggsn.c +++ b/ggsn/ggsn.c @@ -72,7 +72,7 @@ struct in_addr listen_; struct in_addr netaddr, destaddr, net; /* Network interface */ size_t prefixlen; -struct in_addr dns1, dns2; /* PCO DNS address */ +struct in46_addr dns1, dns2; /* PCO DNS address */ char *ipup, *ipdown; /* Filename of scripts */ int debug; /* Print debug output */ struct ul255_t pco; @@ -175,6 +175,103 @@ return 0; } +#include + +/* 3GPP TS 24.008 10.6.5.3 */ +enum pco_protocols { + PCO_P_LCP = 0xC021, + PCO_P_PAP = 0xC023, + PCO_P_CHAP = 0xC223, + PCO_P_IPCP = 0x8021, + PCO_P_PCSCF_ADDR = 0x0001, + PCO_P_IM_CN_SS_F = 0x0002, + PCO_P_DNS_IPv6_ADDR = 0x0003, + PCO_P_POLICY_CTRL_REJ = 0x0004, /* only in Network->MS */ + PCO_P_MS_SUP_NETREQ_BCI = 0x0005, + /* reserved */ + PCO_P_DSMIPv6_HA_ADDR = 0x0007, + PCO_P_DSMIPv6_HN_PREF = 0x0008, + PCO_P_DSMIPv6_v4_HA_ADDR= 0x0009, + PCO_P_IP_ADDR_VIA_NAS = 0x000a, /* only MS->Network */ + PCO_P_IPv4_ADDR_VIA_DHCP= 0x000b, /* only MS->Netowrk */ + PCO_P_PCSCF_IPv4_ADDR = 0x000c, + PCO_P_DNS_IPv4_ADDR = 0x000d, + PCO_P_MSISDN = 0x000e, + PCO_P_IFOM_SUPPORT = 0x000f, + PCO_P_IPv4_LINK_MTU = 0x0010, + PCO_P_MS_SUPP_LOC_A_TFT = 0x0011, + PCO_P_PCSCF_RESEL_SUP = 0x0012, /* only MS->Network */ + PCO_P_NBIFOM_REQ = 0x0013, + PCO_P_NBIFOM_MODE = 0x0014, + PCO_P_NONIP_LINK_MTU = 0x0015, + PCO_P_APN_RATE_CTRL_SUP = 0x0016, + PCO_P_PS_DATA_OFF_UE = 0x0017, + PCO_P_REL_DATA_SVC = 0x0018, +}; + +/* determine if PCO contains given protocol */ +static bool pco_contains_proto(struct ul255_t *pco, uint16_t prot) +{ + uint8_t *cur = pco->v + 1; + + /* iterate over PCO and check if protocol contained */ + while (cur + 2 < pco->v + pco->l) { + uint16_t cur_prot = osmo_load16be(cur); + uint8_t cur_len = cur[2]; + if (cur_prot == prot) + return true; + if (cur_len == 0) + break; + cur += cur_len; + } + return false; +} + +/* determine if PDP context has IPv6 support */ +static bool pdp_has_v4(struct pdp_t *pdp) +{ + if (pdp->eua.l == 4+2) + return true; + else + return false; +} + +/* process one PCO request from a MS/UE, putting together the proper responses */ +static void process_pco(struct pdp_t *pdp) +{ + struct msgb *msg = msgb_alloc(256, "PCO"); + msgb_put_u8(msg, 0x80); /* ext-bit + configuration protocol byte */ + + /* FIXME: also check if primary / secondary DNS was requested */ + if (pdp_has_v4(pdp) && pco_contains_proto(&pdp->pco_req, PCO_P_IPCP)) { + /* FIXME: properly implement this for IPCP */ + uint8_t *cur = msgb_put(msg, pco.l-1); + memcpy(cur, pco.v+1, pco.l-1); + } + + if (pco_contains_proto(&pdp->pco_req, PCO_P_DNS_IPv6_ADDR)) { + if (dns1.len == 16) + msgb_t16lv_put(msg, PCO_P_DNS_IPv6_ADDR, dns1.len, dns1.v6.s6_addr); + if (dns2.len == 16) + msgb_t16lv_put(msg, PCO_P_DNS_IPv6_ADDR, dns2.len, dns2.v6.s6_addr); + } + + if (pco_contains_proto(&pdp->pco_req, PCO_P_DNS_IPv4_ADDR)) { + if (dns1.len == 4) + msgb_t16lv_put(msg, PCO_P_DNS_IPv4_ADDR, dns1.len, (uint8_t *)&dns1.v4); + if (dns2.len == 4) + msgb_t16lv_put(msg, PCO_P_DNS_IPv4_ADDR, dns2.len, (uint8_t *)&dns2.v4); + } + + if (msgb_length(msg) > 1) { + memcpy(pdp->pco_neg.v, msgb_data(msg), msgb_length(msg)); + pdp->pco_neg.l = msgb_length(msg); + } else + pdp->pco_neg.l = 0; + + msgb_free(msg); +} + int create_context_ind(struct pdp_t *pdp) { struct in46_addr addr; @@ -188,7 +285,6 @@ pdp->eua.l = 2; memcpy(pdp->qos_neg0, pdp->qos_req0, sizeof(pdp->qos_req0)); - memcpy(&pdp->pco_neg, &pco, sizeof(pdp->pco_neg)); memcpy(pdp->qos_neg.v, pdp->qos_req.v, pdp->qos_req.l); /* TODO */ pdp->qos_neg.l = pdp->qos_req.l; @@ -235,6 +331,8 @@ gtp_create_context_resp(gsn, pdp, GTPCAUSE_NO_RESOURCES); return 0; } + + process_pco(pdp); gtp_create_context_resp(gsn, pdp, GTPCAUSE_ACC_REQ); return 0; /* Success */ @@ -486,59 +584,56 @@ } /* DNS1 and DNS2 */ -#ifdef HAVE_INET_ATON - dns1.s_addr = 0; + memset(&dns1, 0, sizeof(dns1)); if (args_info.pcodns1_arg) { - if (0 == inet_aton(args_info.pcodns1_arg, &dns1)) { + size_t tmp; + if (ippool_aton(&dns1, &tmp, args_info.pcodns1_arg, 0) != 0) { SYS_ERR(DGGSN, LOGL_ERROR, 0, "Failed to convert pcodns1!"); exit(1); } } - dns2.s_addr = 0; + memset(&dns2, 0, sizeof(dns2)); if (args_info.pcodns2_arg) { - if (0 == inet_aton(args_info.pcodns2_arg, &dns2)) { + size_t tmp; + if (ippool_aton(&dns2, &tmp, args_info.pcodns2_arg, 0) != 0) { SYS_ERR(DGGSN, LOGL_ERROR, 0, "Failed to convert pcodns2!"); exit(1); } } -#else - dns1.s_addr = 0; - if (args_info.pcodns1_arg) { - dns1.s_addr = inet_addr(args_info.pcodns1_arg); - if (dns1.s_addr == -1) { - SYS_ERR(DGGSN, LOGL_ERROR, 0, - "Failed to convert pcodns1!"); - exit(1); - } - } - dns2.s_addr = 0; - if (args_info.pcodns2_arg) { - dns2.s_addr = inet_addr(args_info.pcodns2_arg); - if (dns2.s_addr == -1) { - SYS_ERR(DGGSN, LOGL_ERROR, 0, - "Failed to convert pcodns2!"); - exit(1); - } - } -#endif - pco.l = 20; - pco.v[0] = 0x80; /* x0000yyy x=1, yyy=000: PPP */ - pco.v[1] = 0x80; /* IPCP */ - pco.v[2] = 0x21; - pco.v[3] = 0x10; /* Length of contents */ - pco.v[4] = 0x02; /* ACK */ - pco.v[5] = 0x00; /* ID: Need to match request */ - pco.v[6] = 0x00; /* Length */ - pco.v[7] = 0x10; - pco.v[8] = 0x81; /* DNS 1 */ - pco.v[9] = 0x06; - memcpy(&pco.v[10], &dns1, sizeof(dns1)); - pco.v[14] = 0x83; - pco.v[15] = 0x06; /* DNS 2 */ - memcpy(&pco.v[16], &dns2, sizeof(dns2)); + unsigned int cur = 0; + pco.v[cur++] = 0x80; /* x0000yyy x=1, yyy=000: PPP */ + pco.v[cur++] = 0x80; /* IPCP */ + pco.v[cur++] = 0x21; + pco.v[cur++] = 0xFF; /* Length of contents */ + pco.v[cur++] = 0x02; /* ACK */ + pco.v[cur++] = 0x00; /* ID: Need to match request */ + pco.v[cur++] = 0x00; /* Length */ + pco.v[cur++] = 0xFF; /* overwritten */ + if (dns1.len == 4) { + pco.v[cur++] = 0x81; /* DNS 1 */ + pco.v[cur++] = 2 + dns1.len; + if (dns1.len == 4) + memcpy(&pco.v[cur], &dns1.v4, dns1.len); + else + memcpy(&pco.v[cur], &dns1.v6, dns1.len); + cur += dns1.len; + } + if (dns2.len == 4) { + pco.v[cur++] = 0x83; + pco.v[cur++] = 2 + dns2.len; /* DNS 2 */ + if (dns2.len == 4) + memcpy(&pco.v[cur], &dns2.v4, dns2.len); + else + memcpy(&pco.v[cur], &dns2.v6, dns2.len); + cur += dns2.len; + } + pco.l = cur; + /* patch in length values */ + pco.v[3] = pco.l - 4; + pco.v[7] = pco.l - 4; /* ipup */ ipup = args_info.ipup_arg; -- To view, visit https://gerrit.osmocom.org/3459 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I21499afd61def8c925f7838bde76f34d28214b56 Gerrit-PatchSet: 2 Gerrit-Project: openggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Aug 9 20:38:30 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 9 Aug 2017 20:38:30 +0000 Subject: [PATCH] openggsn[master]: IPv6: in46_addr: OSMO_ASSERT() in case of unsupported calls In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3460 to look at the new patch set (#2). IPv6: in46_addr: OSMO_ASSERT() in case of unsupported calls There's a bit of trickery with the ip_pool and it's "lengty=8" IPv6 prefix handling, let's make sure we don't accidentially call any support functions with addresses of wrong length. Change-Id: I444c190bdcd18780344e1f0dad4faf3bcf9da5a5 --- M lib/in46_addr.c 1 file changed, 6 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openggsn refs/changes/60/3460/2 diff --git a/lib/in46_addr.c b/lib/in46_addr.c index 1785377..8f5cc09 100644 --- a/lib/in46_addr.c +++ b/lib/in46_addr.c @@ -11,6 +11,8 @@ #include "../lib/in46_addr.h" +#include + #include #include #include @@ -29,6 +31,7 @@ case 16: return AF_INET6; default: + OSMO_ASSERT(0); return -1; } } @@ -49,6 +52,7 @@ sin6->sin6_addr = in->v6; break; default: + OSMO_ASSERT(0); return -1; } @@ -161,6 +165,7 @@ create_ipv6_netmask(&netmask6, prefixlen); return ipv6_within_mask(&addr->v6, &net->v6, &netmask6); default: + OSMO_ASSERT(0); return 0; } } @@ -184,6 +189,7 @@ memcpy(&eua->v[2], &src->v6, 16); /* Copy a 16 byte address */ break; default: + OSMO_ASSERT(0); return -1; } return 0; -- To view, visit https://gerrit.osmocom.org/3460 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I444c190bdcd18780344e1f0dad4faf3bcf9da5a5 Gerrit-PatchSet: 2 Gerrit-Project: openggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Aug 9 20:38:54 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 9 Aug 2017 20:38:54 +0000 Subject: libosmocore[master]: tlv: add [msgb_]t16lv_put() for 16bit tag + 8 bit len TLVs In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3455 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I9799130e2eba8fae8c4480fbb8a900c30232b694 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Aug 9 20:39:06 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 9 Aug 2017 20:39:06 +0000 Subject: libosmocore[master]: Add osmo_gprs_{ul, dl}_block_size_{bits, bytes} functions In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3454 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I05ff75ef7dfae639886bbd09fe35f03a8af9d988 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Aug 9 20:39:12 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 9 Aug 2017 20:39:12 +0000 Subject: [MERGED] libosmocore[master]: Add osmo_gprs_{ul, dl}_block_size_{bits, bytes} functions In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Add osmo_gprs_{ul,dl}_block_size_{bits,bytes} functions ...................................................................... Add osmo_gprs_{ul,dl}_block_size_{bits,bytes} functions Those functions can be used to look up the size of (E)GPRS blocks. Change-Id: I05ff75ef7dfae639886bbd09fe35f03a8af9d988 --- M include/osmocom/gprs/gprs_rlc.h M src/gsm/gprs_rlc.c M src/gsm/libosmogsm.map 3 files changed, 121 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/include/osmocom/gprs/gprs_rlc.h b/include/osmocom/gprs/gprs_rlc.h index 05d3de6..b74f9e4 100644 --- a/include/osmocom/gprs/gprs_rlc.h +++ b/include/osmocom/gprs/gprs_rlc.h @@ -26,4 +26,29 @@ EGPRS_HDR_TYPE3, }; +enum osmo_gprs_cs { + OSMO_GPRS_CS_NONE, + OSMO_GPRS_CS1, + OSMO_GPRS_CS2, + OSMO_GPRS_CS3, + OSMO_GPRS_CS4, + OSMO_GPRS_MCS1, + OSMO_GPRS_MCS2, + OSMO_GPRS_MCS3, + OSMO_GPRS_MCS4, + OSMO_GPRS_MCS5, + OSMO_GPRS_MCS6, + OSMO_GPRS_MCS7, + OSMO_GPRS_MCS8, + OSMO_GPRS_MCS9, + _NUM_OSMO_GPRS_CS +}; + int egprs_get_cps(struct egprs_cps *cps, uint8_t type, uint8_t bits); + +int osmo_gprs_ul_block_size_bits(enum osmo_gprs_cs cs); +int osmo_gprs_dl_block_size_bits(enum osmo_gprs_cs cs); +int osmo_gprs_ul_block_size_bytes(enum osmo_gprs_cs cs); +int osmo_gprs_dl_block_size_bytes(enum osmo_gprs_cs cs); +enum osmo_gprs_cs osmo_gprs_ul_cs_by_block_bytes(uint8_t block_size); +enum osmo_gprs_cs osmo_gprs_dl_cs_by_block_bytes(uint8_t block_size); diff --git a/src/gsm/gprs_rlc.c b/src/gsm/gprs_rlc.c index b213b26..d2c05b7 100644 --- a/src/gsm/gprs_rlc.c +++ b/src/gsm/gprs_rlc.c @@ -5,6 +5,7 @@ #include #include +#include #include #include #include @@ -109,3 +110,92 @@ return 0; } + +struct gprs_cs_desc { + struct { + uint8_t bytes; + uint8_t bits; + } uplink, downlink; +}; + +const struct gprs_cs_desc gprs_cs_desc[_NUM_OSMO_GPRS_CS] = { + [OSMO_GPRS_CS1] = { {23, 0}, {23, 0} }, + [OSMO_GPRS_CS2] = { {33, 7}, {33, 7} }, + [OSMO_GPRS_CS3] = { {39, 3}, {39, 3} }, + [OSMO_GPRS_CS4] = { {53, 7}, {53, 7} }, + + [OSMO_GPRS_MCS1] = { {26, 1}, {26, 1} }, + [OSMO_GPRS_MCS2] = { {32, 1}, {32, 1} }, + [OSMO_GPRS_MCS3] = { {41, 1}, {41, 1} }, + [OSMO_GPRS_MCS4] = { {48, 1}, {48, 1} }, + + [OSMO_GPRS_MCS5] = { {60, 7}, {59, 6} }, + [OSMO_GPRS_MCS6] = { {78, 7}, {77, 6} }, + [OSMO_GPRS_MCS7] = { {118, 2}, {117, 4} }, + [OSMO_GPRS_MCS8] = { {142, 2}, {141, 4} }, + [OSMO_GPRS_MCS9] = { {154, 2}, {153, 4} }, +}; + +/*! Return size of (E)GPRS uplink block for given coding scheme in bits */ +int osmo_gprs_ul_block_size_bits(enum osmo_gprs_cs cs) +{ + if (cs >= ARRAY_SIZE(gprs_cs_desc)) + return -EINVAL; + return gprs_cs_desc[cs].uplink.bytes * 8 + gprs_cs_desc[cs].uplink.bits; +} + +/*! Return size of (E)GPRS downlink block for given coding scheme in bits */ +int osmo_gprs_dl_block_size_bits(enum osmo_gprs_cs cs) +{ + if (cs >= ARRAY_SIZE(gprs_cs_desc)) + return -EINVAL; + return gprs_cs_desc[cs].downlink.bytes * 8 + gprs_cs_desc[cs].downlink.bits; +} + +/*! Return size of (E)GPRS uplink block for given coding scheme in bytes */ +int osmo_gprs_ul_block_size_bytes(enum osmo_gprs_cs cs) +{ + int rc; + if (cs >= ARRAY_SIZE(gprs_cs_desc)) + return -EINVAL; + rc = gprs_cs_desc[cs].uplink.bytes; + if (gprs_cs_desc[cs].uplink.bits) + rc++; + return rc; +} + +/*! Return size of (E)GPRS downlink block for given coding scheme in bytes */ +int osmo_gprs_dl_block_size_bytes(enum osmo_gprs_cs cs) +{ + int rc; + if (cs >= ARRAY_SIZE(gprs_cs_desc)) + return -EINVAL; + rc = gprs_cs_desc[cs].downlink.bytes; + if (gprs_cs_desc[cs].downlink.bits) + rc++; + return rc; +} + +/*! Return coding scheme for given (E)GPRS uplink block size */ +enum osmo_gprs_cs osmo_gprs_ul_cs_by_block_bytes(uint8_t block_size) +{ + unsigned int i; + + for (i = 0; i < ARRAY_SIZE(gprs_cs_desc); i++) { + if (block_size == osmo_gprs_ul_block_size_bytes(i)) + return i; + } + return OSMO_GPRS_CS_NONE; +} + +/*! Return coding scheme for given (E)GPRS downlink block size */ +enum osmo_gprs_cs osmo_gprs_dl_cs_by_block_bytes(uint8_t block_size) +{ + unsigned int i; + + for (i = 0; i < ARRAY_SIZE(gprs_cs_desc); i++) { + if (block_size == osmo_gprs_dl_block_size_bytes(i)) + return i; + } + return OSMO_GPRS_CS_NONE; +} diff --git a/src/gsm/libosmogsm.map b/src/gsm/libosmogsm.map index 714cb25..066f410 100644 --- a/src/gsm/libosmogsm.map +++ b/src/gsm/libosmogsm.map @@ -65,6 +65,12 @@ gprs_msgt_gmm_names; egprs_get_cps; +osmo_gprs_ul_block_size_bits; +osmo_gprs_dl_block_size_bits; +osmo_gprs_ul_block_size_bytes; +osmo_gprs_dl_block_size_bytes; +osmo_gprs_ul_cs_by_block_bytes; +osmo_gprs_dl_cs_by_block_bytes; gsm48_gmm_cause_names; gsm48_gsm_cause_names; -- To view, visit https://gerrit.osmocom.org/3454 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I05ff75ef7dfae639886bbd09fe35f03a8af9d988 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Aug 9 20:39:12 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 9 Aug 2017 20:39:12 +0000 Subject: [MERGED] libosmocore[master]: tlv: add [msgb_]t16lv_put() for 16bit tag + 8 bit len TLVs In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: tlv: add [msgb_]t16lv_put() for 16bit tag + 8 bit len TLVs ...................................................................... tlv: add [msgb_]t16lv_put() for 16bit tag + 8 bit len TLVs In the Protocol Configuration Options IE (see 3GPP TS 24.008 10.5.6.3) there is yet another new TLV format (derived from PPP IPCP/LCP/...) which uses 16bit tag and 8bit length. Let's add functions so we can generate related TLVs. Parsing is unfortunately not possible in our existing structure as our tlv_parsed array only has 256 entries and thus cannot cope with 16bit tags. Change-Id: I9799130e2eba8fae8c4480fbb8a900c30232b694 --- M include/osmocom/gsm/tlv.h 1 file changed, 20 insertions(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/include/osmocom/gsm/tlv.h b/include/osmocom/gsm/tlv.h index c356840..f903223 100644 --- a/include/osmocom/gsm/tlv.h +++ b/include/osmocom/gsm/tlv.h @@ -21,7 +21,7 @@ TLV16 8 8 N * 16 TvLV 8 8/16 N * 8 vTvLV 8/16 8/16 N * 8 - + T16LV 16 8 N * 8 */ /*! gross length of a LV type field */ @@ -34,6 +34,8 @@ #define TL16V_GROSS_LEN(x) (x+3) /*! gross length of a L16TV type field */ #define L16TV_GROSS_LEN(x) (x+3) +/*! gross length of a T16LV type field */ +#define T16LV_GROSS_LEN(x) (x+3) /*! maximum length of TLV of one byte length */ #define TVLV_MAX_ONEBYTE 0x7f @@ -119,6 +121,17 @@ return buf + len*2; } +/*! put (append) a TL16V field */ +static inline uint8_t *t16lv_put(uint8_t *buf, uint16_t tag, uint8_t len, + const uint8_t *val) +{ + *buf++ = tag >> 8; + *buf++ = tag & 0xff; + *buf++ = len; + memcpy(buf, val, len); + return buf + len + 2; +} + /*! put (append) a TvLV field */ static inline uint8_t *tvlv_put(uint8_t *buf, uint8_t tag, uint16_t len, const uint8_t *val) @@ -185,6 +198,12 @@ return tl16v_put(buf, tag, len, val); } +static inline uint8_t *msgb_t16lv_put(struct msgb *msg, uint16_t tag, uint8_t len, const uint8_t *val) +{ + uint8_t *buf = msgb_put(msg, T16LV_GROSS_LEN(len)); + return t16lv_put(buf, tag, len, val); +} + /*! put (append) a TvLV field to \ref msgb */ static inline uint8_t *msgb_tvlv_put(struct msgb *msg, uint8_t tag, uint16_t len, const uint8_t *val) -- To view, visit https://gerrit.osmocom.org/3455 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I9799130e2eba8fae8c4480fbb8a900c30232b694 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Aug 9 20:40:13 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 9 Aug 2017 20:40:13 +0000 Subject: libosmo-sccp[master]: vty: hide SG commands when running as ASP In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3453 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I707bcd790f4c6d0f618e41163b51d2179ea3aeaf Gerrit-PatchSet: 1 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Aug 9 20:40:33 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 9 Aug 2017 20:40:33 +0000 Subject: libosmo-sccp[master]: sccp: fix creating of the default route in simple client In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3452 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I7516fa5509bade4ba10e9d8eaa3e46cfe3696b3a Gerrit-PatchSet: 1 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Aug 9 20:40:36 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 9 Aug 2017 20:40:36 +0000 Subject: [MERGED] libosmo-sccp[master]: sccp: fix creating of the default route in simple client In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: sccp: fix creating of the default route in simple client ...................................................................... sccp: fix creating of the default route in simple client The simple client (osmo_sccp_simple_client_on_ss7_id() and osmo_sccp_simple_client) does not create a default route if the user has already created an AS via VTY. Check the presence of a default route independently of the AS. If no default route exists, create one. Change-Id: I7516fa5509bade4ba10e9d8eaa3e46cfe3696b3a --- M src/sccp_user.c 1 file changed, 7 insertions(+), 3 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/sccp_user.c b/src/sccp_user.c index 1414572..1d59d3c 100644 --- a/src/sccp_user.c +++ b/src/sccp_user.c @@ -368,16 +368,20 @@ goto out_ss7; } as->cfg.routing_key.pc = ss7->cfg.primary_pc; + } + LOGP(DLSCCP, LOGL_NOTICE, "%s: Using AS instance %s\n", name, + as->cfg.name); - /* install default route */ + /* Create a default route if necessary */ + rt = osmo_ss7_route_find_dpc_mask(ss7->rtable_system, 0, 0); + if (!rt) { + LOGP(DLSCCP, LOGL_NOTICE, "%s: Creating default route\n", name); rt = osmo_ss7_route_create(ss7->rtable_system, 0, 0, as->cfg.name); if (!rt) goto out_as; rt_created = true; } - LOGP(DLSCCP, LOGL_NOTICE, "%s: Using AS instance %s\n", name, - as->cfg.name); /* Check if we do already have an application server process * that is associated with the application server we have choosen -- To view, visit https://gerrit.osmocom.org/3452 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I7516fa5509bade4ba10e9d8eaa3e46cfe3696b3a Gerrit-PatchSet: 1 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Aug 9 20:40:36 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 9 Aug 2017 20:40:36 +0000 Subject: [MERGED] libosmo-sccp[master]: vty: hide SG commands when running as ASP In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: vty: hide SG commands when running as ASP ...................................................................... vty: hide SG commands when running as ASP The SG (signal gateway) requires an extra set of VTY commands in order to be fully configurable. These VTY commands do not make sense in a situation where libosmo-sccp is used to implement an ASP (application server process). Detect in which role libosmo-sccp is used by which of the VTY initalization functions are called: osmo_ss7_vty_init_asp() ==> ASP osmo_ss7_vty_init_sg() ==> SG Prevent writing back of SG specific configuration when in running as ASP. Only write back the full parameter set when running as SG. Change-Id: I707bcd790f4c6d0f618e41163b51d2179ea3aeaf --- M src/osmo_ss7_vty.c 1 file changed, 13 insertions(+), 5 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/osmo_ss7_vty.c b/src/osmo_ss7_vty.c index 21efcae..9343edd 100644 --- a/src/osmo_ss7_vty.c +++ b/src/osmo_ss7_vty.c @@ -50,6 +50,8 @@ * Core CS7 Configuration ***********************************************************************/ +enum cs7_role_t {CS7_ROLE_SG, CS7_ROLE_ASP}; +static enum cs7_role_t cs7_role; static void *g_ctx; static struct cmd_node cs7_node = { @@ -1559,12 +1561,16 @@ llist_for_each_entry(as, &inst->as_list, list) write_one_as(vty, as); - /* now dump routes, as their target ASs exist */ - llist_for_each_entry(rtable, &inst->rtable_list, list) - write_one_rtable(vty, rtable); + /* now dump everything that is relevent for the SG role */ + if (cs7_role == CS7_ROLE_SG) { - llist_for_each_entry(oxs, &inst->xua_servers, list) - write_one_xua(vty, oxs); + /* dump routes, as their target ASs exist */ + llist_for_each_entry(rtable, &inst->rtable_list, list) + write_one_rtable(vty, rtable); + + llist_for_each_entry(oxs, &inst->xua_servers, list) + write_one_xua(vty, oxs); + } /* Append SCCP Addressbook */ write_sccp_addressbook(vty, inst); @@ -1717,11 +1723,13 @@ void osmo_ss7_vty_init_asp(void *ctx) { + cs7_role = CS7_ROLE_ASP; vty_init_shared(ctx); } void osmo_ss7_vty_init_sg(void *ctx) { + cs7_role = CS7_ROLE_SG; vty_init_shared(ctx); install_node(&rtable_node, NULL); -- To view, visit https://gerrit.osmocom.org/3453 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I707bcd790f4c6d0f618e41163b51d2179ea3aeaf Gerrit-PatchSet: 1 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Aug 9 20:41:56 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 9 Aug 2017 20:41:56 +0000 Subject: libosmo-sccp[master]: safer osmo_sccp_make_addr_pc_ssn(): clear all values In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3341 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I37395169d364050e45e99793c495a9848a4f8601 Gerrit-PatchSet: 1 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Aug 9 20:41:57 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 9 Aug 2017 20:41:57 +0000 Subject: [MERGED] libosmo-sccp[master]: safer osmo_sccp_make_addr_pc_ssn(): clear all values In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: safer osmo_sccp_make_addr_pc_ssn(): clear all values ...................................................................... safer osmo_sccp_make_addr_pc_ssn(): clear all values Make sure that all values of the resulting sccp_addr are cleared to obtain a clean PC+SSN address. Before this, gt and ip remained unset/random, e.g. in osmo_sccp_tx_unitdata_ranap() Change-Id: I37395169d364050e45e99793c495a9848a4f8601 --- M src/sccp_helpers.c 1 file changed, 6 insertions(+), 4 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/sccp_helpers.c b/src/sccp_helpers.c index 1e83c8c..4b24392 100644 --- a/src/sccp_helpers.c +++ b/src/sccp_helpers.c @@ -38,10 +38,12 @@ void osmo_sccp_make_addr_pc_ssn(struct osmo_sccp_addr *addr, uint32_t pc, uint32_t ssn) { - addr->presence = OSMO_SCCP_ADDR_T_SSN | OSMO_SCCP_ADDR_T_PC; - addr->ri = OSMO_SCCP_RI_SSN_PC; - addr->ssn = ssn; - addr->pc = pc; + *addr = (struct osmo_sccp_addr){ + .presence = OSMO_SCCP_ADDR_T_SSN | OSMO_SCCP_ADDR_T_PC, + .ri = OSMO_SCCP_RI_SSN_PC, + .ssn = ssn, + .pc = pc, + }; } void osmo_sccp_addr_set_ssn(struct osmo_sccp_addr *addr, uint32_t ssn) -- To view, visit https://gerrit.osmocom.org/3341 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I37395169d364050e45e99793c495a9848a4f8601 Gerrit-PatchSet: 2 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Aug 9 20:42:34 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 9 Aug 2017 20:42:34 +0000 Subject: openggsn[master]: ippool: Extend pool to work with /64 prefixes In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3457 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I0cf700b6baf195a2e5fbea000531f801acaaa443 Gerrit-PatchSet: 2 Gerrit-Project: openggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Aug 9 20:46:00 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 9 Aug 2017 20:46:00 +0000 Subject: [MERGED] openggsn[master]: ippool: Extend pool to work with /64 prefixes In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: ippool: Extend pool to work with /64 prefixes ...................................................................... ippool: Extend pool to work with /64 prefixes In IPv6 GPRS, we actually don't want to allocate an individual v6 address (like in IPv4), but we want to allocate a prefix. The standard prefix lengh is 8 bytes, i.e. a /64 prefix. This patch extends the pool to be able to work with such v6 prefixes. Change-Id: I0cf700b6baf195a2e5fbea000531f801acaaa443 --- M ggsn/ggsn.c M lib/in46_addr.c M lib/ippool.c 3 files changed, 17 insertions(+), 8 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/ggsn/ggsn.c b/ggsn/ggsn.c index 0629f9e..9b11884 100644 --- a/ggsn/ggsn.c +++ b/ggsn/ggsn.c @@ -241,7 +241,11 @@ dst.len = 4; dst.v4.s_addr = iph->daddr; } else if (iph->version == 6) { - dst.len = 16; + /* Due to the fact that 3GPP requires an allocation of a + * /64 prefix to each MS, we must instruct + * ippool_getip() below to match only the leading /64 + * prefix, i.e. the first 8 bytes of the address */ + dst.len = 8; dst.v6 = ip6h->ip6_dst; } else { LOGP(DGGSN, LOGL_NOTICE, "non-IPv packet received from tun\n"); diff --git a/lib/in46_addr.c b/lib/in46_addr.c index a220583..1785377 100644 --- a/lib/in46_addr.c +++ b/lib/in46_addr.c @@ -25,6 +25,7 @@ switch (in->len) { case 4: return AF_INET; + case 8: case 16: return AF_INET6; default: @@ -175,6 +176,7 @@ eua->v[1] = 0x21; /* IPv4 */ memcpy(&eua->v[2], &src->v4, 4); /* Copy a 4 byte address */ break; + case 8: case 16: eua->l = 18; eua->v[0] = 0xf1; /* IETF */ diff --git a/lib/ippool.c b/lib/ippool.c index 007dc50..1729ec7 100644 --- a/lib/ippool.c +++ b/lib/ippool.c @@ -96,11 +96,10 @@ return lookup((unsigned char *)&addr->s_addr, sizeof(addr->s_addr), 0); } -static unsigned long int ippool_hash6(struct in6_addr *addr) +static unsigned long int ippool_hash6(struct in6_addr *addr, unsigned int len) { /* TODO: Review hash spread for IPv6 */ - return lookup((unsigned char *)addr->s6_addr, sizeof(addr->s6_addr), - 0); + return lookup((unsigned char *)addr->s6_addr, len, 0); } unsigned long int ippool_hash(struct in46_addr *addr) @@ -108,7 +107,7 @@ if (addr->len == 4) return ippool_hash4(&addr->v4); else - return ippool_hash6(&addr->v6); + return ippool_hash6(&addr->v6, addr->len); } /* Get IP address and mask */ @@ -209,6 +208,10 @@ "Failed to parse dynamic pool"); return -1; } + /* we want to work with /64 prefixes, i.e. allocate /64 prefixes rather + * than /128 (single IPv6 addresses) */ + if (addr.len == sizeof(struct in6_addr)) + addr.len = 64/8; /* Set IPPOOL_NONETWORK if IPPOOL_NOGATEWAY is set */ if (flags & IPPOOL_NOGATEWAY) { @@ -348,7 +351,7 @@ /* Find in hash table */ hash = ippool_hash(addr) & this->hashmask; for (p = this->hash[hash]; p; p = p->nexthash) { - if (in46a_equal(&p->addr, addr)) { + if (in46a_prefix_equal(&p->addr, addr)) { if (member) *member = p; return 0; @@ -421,7 +424,7 @@ /* Find in hash table */ hash = ippool_hash(addr) & this->hashmask; for (p = this->hash[hash]; p; p = p->nexthash) { - if (in46a_equal(&p->addr, addr)) { + if (in46a_prefix_equal(&p->addr, addr)) { p2 = p; break; } @@ -450,7 +453,7 @@ return -GTPCAUSE_SYS_FAIL; /* Allready in use / Should not happen */ } - if (p2->addr.len != addr->len) { + if (p2->addr.len != addr->len && !(addr->len == 16 && p2->addr.len == 8)) { SYS_ERR(DIP, LOGL_ERROR, 0, "MS requested unsupported PDP context type"); return -GTPCAUSE_UNKNOWN_PDP; } -- To view, visit https://gerrit.osmocom.org/3457 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I0cf700b6baf195a2e5fbea000531f801acaaa443 Gerrit-PatchSet: 2 Gerrit-Project: openggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Thu Aug 10 08:01:36 2017 From: gerrit-no-reply at lists.osmocom.org (Pablo Neira Ayuso) Date: Thu, 10 Aug 2017 08:01:36 +0000 Subject: [PATCH] openbsc[master]: libmsc: gsm340_gen_oa_sub() may return negative value Message-ID: Review at https://gerrit.osmocom.org/3461 libmsc: gsm340_gen_oa_sub() may return negative value gsm340_gen_oa() returns a negative value if the output buffer that the caller passes is too small, so we have to check the return value of this function. Fixes: CID 174178 Fixes: CID 174179 Change-Id: I47215d7d89771730a7f84efa8aeeb187a0911fdb --- M openbsc/src/libmsc/gsm_04_11.c 1 file changed, 9 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/61/3461/1 diff --git a/openbsc/src/libmsc/gsm_04_11.c b/openbsc/src/libmsc/gsm_04_11.c index 73e0f55..8b4ffce 100644 --- a/openbsc/src/libmsc/gsm_04_11.c +++ b/openbsc/src/libmsc/gsm_04_11.c @@ -213,9 +213,9 @@ { uint8_t *smsp; uint8_t oa[12]; /* max len per 03.40 */ - uint8_t oa_len = 0; uint8_t octet_len; unsigned int old_msg_len = msg->len; + int oa_len; /* generate first octet with masked bits */ smsp = msgb_put(msg, 1); @@ -233,6 +233,9 @@ /* generate originator address */ oa_len = gsm340_gen_oa_sub(oa, sizeof(oa), &sms->src); + if (oa_len < 0) + return -ENOSPC; + smsp = msgb_put(msg, oa_len); memcpy(smsp, oa, oa_len); @@ -282,9 +285,9 @@ struct gsm_sms *sms) { unsigned int old_msg_len = msg->len; - uint8_t oa_len = 0; uint8_t oa[12]; /* max len per 03.40 */ uint8_t *smsp; + int oa_len; /* generate first octet with masked bits */ smsp = msgb_put(msg, 1); @@ -296,8 +299,12 @@ /* TP-MR (message reference) */ smsp = msgb_put(msg, 1); *smsp = sms->msg_ref; + /* generate recipient address */ oa_len = gsm340_gen_oa_sub(oa, sizeof(oa), &sms->dst); + if (oa_len < 0) + return -ENOSPC; + smsp = msgb_put(msg, oa_len); memcpy(smsp, oa, oa_len); -- To view, visit https://gerrit.osmocom.org/3461 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I47215d7d89771730a7f84efa8aeeb187a0911fdb Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Pablo Neira Ayuso From gerrit-no-reply at lists.osmocom.org Thu Aug 10 08:25:57 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 10 Aug 2017 08:25:57 +0000 Subject: [PATCH] osmo-gsm-tester[master]: osmo-bts-trx config: remove settsc Message-ID: Review at https://gerrit.osmocom.org/3462 osmo-bts-trx config: remove settsc In osmo-bts change I51aeb17661dfd63ff347f7b2c0d7ffa383ec814c the settsc config item is being removed. To be able to test it, drop the settsc option from the config. Change-Id: I58002a84b6b0104de4fb5c7cade27b263e375c1f --- M src/osmo_gsm_tester/templates/osmo-bts-trx.cfg.tmpl 1 file changed, 0 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-tester refs/changes/62/3462/1 diff --git a/src/osmo_gsm_tester/templates/osmo-bts-trx.cfg.tmpl b/src/osmo_gsm_tester/templates/osmo-bts-trx.cfg.tmpl index 1737947..9ef2547 100644 --- a/src/osmo_gsm_tester/templates/osmo-bts-trx.cfg.tmpl +++ b/src/osmo_gsm_tester/templates/osmo-bts-trx.cfg.tmpl @@ -21,7 +21,6 @@ ipa unit-id ${osmo_bts_trx.ipa_unit_id} 0 oml remote-ip ${osmo_bts_trx.oml_remote_ip} pcu-socket ${osmo_bts_trx.pcu_socket_path} - settsc gsmtap-sapi bcch gsmtap-sapi ccch gsmtap-sapi rach -- To view, visit https://gerrit.osmocom.org/3462 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I58002a84b6b0104de4fb5c7cade27b263e375c1f Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Thu Aug 10 08:29:02 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 10 Aug 2017 08:29:02 +0000 Subject: osmo-gsm-tester[master]: osmo-bts-trx config: remove settsc In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 This commit was reverted a while ago because merge of the osmo-bts was delayed for a while, and meanwhile removing the config option broke the tests. Now that the osmo-bts commit is merged, tests are failing because the option doesn't exist anymore. I rebased it on top of current osmo-gsm-tester master and run it -> it fixes the breakage, merging. -- To view, visit https://gerrit.osmocom.org/3462 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I58002a84b6b0104de4fb5c7cade27b263e375c1f Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Aug 10 08:29:05 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 10 Aug 2017 08:29:05 +0000 Subject: [MERGED] osmo-gsm-tester[master]: osmo-bts-trx config: remove settsc In-Reply-To: References: Message-ID: Pau Espin Pedrol has submitted this change and it was merged. Change subject: osmo-bts-trx config: remove settsc ...................................................................... osmo-bts-trx config: remove settsc In osmo-bts change I51aeb17661dfd63ff347f7b2c0d7ffa383ec814c the settsc config item is being removed. To be able to test it, drop the settsc option from the config. Change-Id: I58002a84b6b0104de4fb5c7cade27b263e375c1f --- M src/osmo_gsm_tester/templates/osmo-bts-trx.cfg.tmpl 1 file changed, 0 insertions(+), 1 deletion(-) Approvals: Pau Espin Pedrol: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/osmo_gsm_tester/templates/osmo-bts-trx.cfg.tmpl b/src/osmo_gsm_tester/templates/osmo-bts-trx.cfg.tmpl index 1737947..9ef2547 100644 --- a/src/osmo_gsm_tester/templates/osmo-bts-trx.cfg.tmpl +++ b/src/osmo_gsm_tester/templates/osmo-bts-trx.cfg.tmpl @@ -21,7 +21,6 @@ ipa unit-id ${osmo_bts_trx.ipa_unit_id} 0 oml remote-ip ${osmo_bts_trx.oml_remote_ip} pcu-socket ${osmo_bts_trx.pcu_socket_path} - settsc gsmtap-sapi bcch gsmtap-sapi ccch gsmtap-sapi rach -- To view, visit https://gerrit.osmocom.org/3462 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I58002a84b6b0104de4fb5c7cade27b263e375c1f Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Thu Aug 10 09:04:46 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 10 Aug 2017 09:04:46 +0000 Subject: [PATCH] osmo-gsm-tester[master]: esme: Add cleanup function to avoid cascade failure of tests Message-ID: Review at https://gerrit.osmocom.org/3463 esme: Add cleanup function to avoid cascade failure of tests In commit 6100b629e55ed4aa319f46ad797741131b9da8e7 I assumed esme already had a cleanup function, which doesn't seem to be the case. This means if a test calls esme.connect() and fails afterwards without calling esme.disconnect(), the connection will be kept but as the test will finish and the NITB is closed, then the connection will be kept forever in an erroneous state. With the cleanup function we ensure we will close the connection after the test. Change-Id: Ia3a23bb8bbccfe7ac5c544521b5566164609f0a5 --- M src/osmo_gsm_tester/esme.py M src/osmo_gsm_tester/suite.py 2 files changed, 4 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-tester refs/changes/63/3463/1 diff --git a/src/osmo_gsm_tester/esme.py b/src/osmo_gsm_tester/esme.py index 7063c33..376152a 100644 --- a/src/osmo_gsm_tester/esme.py +++ b/src/osmo_gsm_tester/esme.py @@ -52,6 +52,9 @@ self.next_user_message_reference = 1 def __del__(self): + self.cleanup() + + def cleanup(self): try: self.disconnect() except smpplib.exceptions.ConnectionError: diff --git a/src/osmo_gsm_tester/suite.py b/src/osmo_gsm_tester/suite.py index d510b93..2ac2062 100644 --- a/src/osmo_gsm_tester/suite.py +++ b/src/osmo_gsm_tester/suite.py @@ -368,6 +368,7 @@ def esme(self): esme_obj = esme.Esme(self.msisdn()) + self.register_for_cleanup(esme_obj) return esme_obj def msisdn(self): -- To view, visit https://gerrit.osmocom.org/3463 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ia3a23bb8bbccfe7ac5c544521b5566164609f0a5 Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Thu Aug 10 09:13:58 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 10 Aug 2017 09:13:58 +0000 Subject: osmo-gsm-tester[master]: esme: Add cleanup function to avoid cascade failure of tests In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 Tested locally in an env where an esme test fails and then the next one used to fail too due to the hanging old conn. -- To view, visit https://gerrit.osmocom.org/3463 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ia3a23bb8bbccfe7ac5c544521b5566164609f0a5 Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Aug 10 09:14:05 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 10 Aug 2017 09:14:05 +0000 Subject: [MERGED] osmo-gsm-tester[master]: esme: Add cleanup function to avoid cascade failure of tests In-Reply-To: References: Message-ID: Pau Espin Pedrol has submitted this change and it was merged. Change subject: esme: Add cleanup function to avoid cascade failure of tests ...................................................................... esme: Add cleanup function to avoid cascade failure of tests In commit 6100b629e55ed4aa319f46ad797741131b9da8e7 I assumed esme already had a cleanup function, which doesn't seem to be the case. This means if a test calls esme.connect() and fails afterwards without calling esme.disconnect(), the connection will be kept but as the test will finish and the NITB is closed, then the connection will be kept forever in an erroneous state. With the cleanup function we ensure we will close the connection after the test. Change-Id: Ia3a23bb8bbccfe7ac5c544521b5566164609f0a5 --- M src/osmo_gsm_tester/esme.py M src/osmo_gsm_tester/suite.py 2 files changed, 4 insertions(+), 0 deletions(-) Approvals: Pau Espin Pedrol: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/osmo_gsm_tester/esme.py b/src/osmo_gsm_tester/esme.py index 7063c33..376152a 100644 --- a/src/osmo_gsm_tester/esme.py +++ b/src/osmo_gsm_tester/esme.py @@ -52,6 +52,9 @@ self.next_user_message_reference = 1 def __del__(self): + self.cleanup() + + def cleanup(self): try: self.disconnect() except smpplib.exceptions.ConnectionError: diff --git a/src/osmo_gsm_tester/suite.py b/src/osmo_gsm_tester/suite.py index d510b93..2ac2062 100644 --- a/src/osmo_gsm_tester/suite.py +++ b/src/osmo_gsm_tester/suite.py @@ -368,6 +368,7 @@ def esme(self): esme_obj = esme.Esme(self.msisdn()) + self.register_for_cleanup(esme_obj) return esme_obj def msisdn(self): -- To view, visit https://gerrit.osmocom.org/3463 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ia3a23bb8bbccfe7ac5c544521b5566164609f0a5 Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Thu Aug 10 10:12:22 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 10 Aug 2017 10:12:22 +0000 Subject: [PATCH] osmo-gsm-tester[master]: util: ip_to_iface: Return secondary iface if present Message-ID: Review at https://gerrit.osmocom.org/3464 util: ip_to_iface: Return secondary iface if present In the following example setup, if osmo-nitb is listening on 10.42.42.2, we want to return eth1:0 instead of eth1. ip addr show eth1 3: eth1: mtu 1500 qdisc pfifo_fast state UP group default qlen 1000 link/ether 00:0d:b9:35:3a:41 brd ff:ff:ff:ff:ff:ff inet 10.42.42.1/24 brd 10.42.42.255 scope global eth1 valid_lft forever preferred_lft forever inet 10.42.42.2/24 brd 10.42.42.255 scope global secondary eth1:0 valid_lft forever preferred_lft forever inet 10.42.42.3/24 brd 10.42.42.255 scope global secondary eth1:1 valid_lft forever preferred_lft forever Change-Id: Ia66e6fd8138fc11a70437a573128aacf6a01b8ff --- M src/osmo_gsm_tester/util.py 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-tester refs/changes/64/3464/1 diff --git a/src/osmo_gsm_tester/util.py b/src/osmo_gsm_tester/util.py index 266243c..602ae45 100644 --- a/src/osmo_gsm_tester/util.py +++ b/src/osmo_gsm_tester/util.py @@ -44,7 +44,7 @@ proc = subprocess.Popen(['ip', 'addr', 'show', 'dev', iface], stdout=subprocess.PIPE, universal_newlines=True) for line in proc.stdout.readlines(): if 'inet' in line and ' ' + ip + '/' in line: - return iface + return line.split()[-1] except Exception as e: pass return None -- To view, visit https://gerrit.osmocom.org/3464 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ia66e6fd8138fc11a70437a573128aacf6a01b8ff Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Thu Aug 10 10:17:37 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 10 Aug 2017 10:17:37 +0000 Subject: osmo-gsm-tester[master]: util: ip_to_iface: Return secondary iface if present In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 Tested on the main unit. Pcap files still contain the whole information and this way we don't record unrelated stuff. -- To view, visit https://gerrit.osmocom.org/3464 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ia66e6fd8138fc11a70437a573128aacf6a01b8ff Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Aug 10 10:17:50 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 10 Aug 2017 10:17:50 +0000 Subject: [MERGED] osmo-gsm-tester[master]: util: ip_to_iface: Return secondary iface if present In-Reply-To: References: Message-ID: Pau Espin Pedrol has submitted this change and it was merged. Change subject: util: ip_to_iface: Return secondary iface if present ...................................................................... util: ip_to_iface: Return secondary iface if present In the following example setup, if osmo-nitb is listening on 10.42.42.2, we want to return eth1:0 instead of eth1. ip addr show eth1 3: eth1: mtu 1500 qdisc pfifo_fast state UP group default qlen 1000 link/ether 00:0d:b9:35:3a:41 brd ff:ff:ff:ff:ff:ff inet 10.42.42.1/24 brd 10.42.42.255 scope global eth1 valid_lft forever preferred_lft forever inet 10.42.42.2/24 brd 10.42.42.255 scope global secondary eth1:0 valid_lft forever preferred_lft forever inet 10.42.42.3/24 brd 10.42.42.255 scope global secondary eth1:1 valid_lft forever preferred_lft forever Change-Id: Ia66e6fd8138fc11a70437a573128aacf6a01b8ff --- M src/osmo_gsm_tester/util.py 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Pau Espin Pedrol: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/osmo_gsm_tester/util.py b/src/osmo_gsm_tester/util.py index 266243c..602ae45 100644 --- a/src/osmo_gsm_tester/util.py +++ b/src/osmo_gsm_tester/util.py @@ -44,7 +44,7 @@ proc = subprocess.Popen(['ip', 'addr', 'show', 'dev', iface], stdout=subprocess.PIPE, universal_newlines=True) for line in proc.stdout.readlines(): if 'inet' in line and ' ' + ip + '/' in line: - return iface + return line.split()[-1] except Exception as e: pass return None -- To view, visit https://gerrit.osmocom.org/3464 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ia66e6fd8138fc11a70437a573128aacf6a01b8ff Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Thu Aug 10 11:08:45 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 10 Aug 2017 11:08:45 +0000 Subject: [PATCH] openbsc[master]: libmsc: Remove comment not applying anymore Message-ID: Review at https://gerrit.osmocom.org/3465 libmsc: Remove comment not applying anymore The change-id I7276d356d805a83ebeec72b02c8563b7135ea0b6 added msg_ref to the databse but forgot to remove the comment stating it's not being stored. Change-Id: I204f098c8f2a480405446113e2181b2c53700cf3 --- M openbsc/src/libmsc/db.c 1 file changed, 0 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/65/3465/1 diff --git a/openbsc/src/libmsc/db.c b/openbsc/src/libmsc/db.c index 9945dca..631e05f 100644 --- a/openbsc/src/libmsc/db.c +++ b/openbsc/src/libmsc/db.c @@ -1649,7 +1649,6 @@ sms->protocol_id = dbi_result_get_ulonglong(result, "protocol_id"); sms->data_coding_scheme = dbi_result_get_ulonglong(result, "data_coding_scheme"); - /* sms->msg_ref is temporary and not stored in DB */ sms->dst.npi = dbi_result_get_ulonglong(result, "dest_npi"); sms->dst.ton = dbi_result_get_ulonglong(result, "dest_ton"); -- To view, visit https://gerrit.osmocom.org/3465 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I204f098c8f2a480405446113e2181b2c53700cf3 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Thu Aug 10 13:17:16 2017 From: gerrit-no-reply at lists.osmocom.org (Holger Freyther) Date: Thu, 10 Aug 2017 13:17:16 +0000 Subject: openbsc[master]: libmsc: update database to accomodate SMS status-report fields In-Reply-To: References: Message-ID: Patch Set 4: > > Can it work here? > I don't believe so, SQLITE3 ALTER TABLE is limited to adding new > columns to the end of the table. Probably why it's done like this > in previous db version upgrades. > https://www.sqlite.org/lang_altertable.html IIRC in the past we wanted to change the type of a column. Here we would not have cared where the new column gets added. -- To view, visit https://gerrit.osmocom.org/3435 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I7276d356d805a83ebeec72b02c8563b7135ea0b6 Gerrit-PatchSet: 4 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Pablo Neira Ayuso Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Keith Whyte Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pablo Neira Ayuso Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Aug 10 14:50:53 2017 From: gerrit-no-reply at lists.osmocom.org (Ivan Kluchnikov) Date: Thu, 10 Aug 2017 14:50:53 +0000 Subject: [PATCH] openbsc[master]: handover_logic: set correct link to bts for subscriber_conne... Message-ID: Review at https://gerrit.osmocom.org/3466 handover_logic: set correct link to bts for subscriber_connection in case of moving this connection to another bts In case of successful completion of handover gsm_subscriber_connection could be moved from one bts to another, so connection link to bts should be replaced by link to bts, which owns new_lchan. This bug was detected, because conn->bts->nr is used in call control log messages and wrong number of bts was observed in these messages after handover. Change-Id: Idc7dd412b7580c451e716b73ef7549826c60b0d9 --- M openbsc/src/libbsc/handover_logic.c 1 file changed, 1 insertion(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/66/3466/1 diff --git a/openbsc/src/libbsc/handover_logic.c b/openbsc/src/libbsc/handover_logic.c index 4dd913b..795a2ee 100644 --- a/openbsc/src/libbsc/handover_logic.c +++ b/openbsc/src/libbsc/handover_logic.c @@ -281,6 +281,7 @@ new_lchan->conn->ho_lchan = NULL; new_lchan->conn->lchan = new_lchan; + new_lchan->conn->bts = new_lchan->ts->trx->bts; ho->old_lchan->conn = NULL; lchan_release(ho->old_lchan, 0, RSL_REL_LOCAL_END); -- To view, visit https://gerrit.osmocom.org/3466 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Idc7dd412b7580c451e716b73ef7549826c60b0d9 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Ivan Kluchnikov From gerrit-no-reply at lists.osmocom.org Thu Aug 10 15:13:46 2017 From: gerrit-no-reply at lists.osmocom.org (Ivan Kluchnikov) Date: Thu, 10 Aug 2017 15:13:46 +0000 Subject: [PATCH] libosmocore[master]: lapd_core: Fix crash in lapd_est_req() function Message-ID: Review at https://gerrit.osmocom.org/3467 lapd_core: Fix crash in lapd_est_req() function lapd_est_req() function could be called on uninitialized lapd link (before lapd_dl_init() and after lapd_dl_exit() functions) due to invalid usage on higher levels. In order to prevent using uninitialized lapd link, we should set LAPD_STATE_NULL state for lapd_datalink in lapd_dl_exit() function. So all messages for lapd_datalink in null state will be unhandled by lapd_recv_dlsap() function and lapd_est_req() function will not be called before lapd_dl_init() function where lapd link state is changed to idle. Change-Id: I306dad9b78e3becaef14c5305ec25c312feefe3c Related: OS#1982 --- M src/gsm/lapd_core.c 1 file changed, 4 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/67/3467/1 diff --git a/src/gsm/lapd_core.c b/src/gsm/lapd_core.c index 166bf9a..6b58006 100644 --- a/src/gsm/lapd_core.c +++ b/src/gsm/lapd_core.c @@ -326,6 +326,10 @@ { /* free all ressources except history buffer */ lapd_dl_reset(dl); + + /* enter null state */ + lapd_dl_newstate(dl, LAPD_STATE_NULL); + /* free history buffer list */ talloc_free(dl->tx_hist); dl->tx_hist = NULL; -- To view, visit https://gerrit.osmocom.org/3467 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I306dad9b78e3becaef14c5305ec25c312feefe3c Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Ivan Kluchnikov From gerrit-no-reply at lists.osmocom.org Thu Aug 10 16:00:48 2017 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Thu, 10 Aug 2017 16:00:48 +0000 Subject: [PATCH] libosmo-sccp[master]: sccp: prefix default parameters of osmo_sccp_simple_client() Message-ID: Review at https://gerrit.osmocom.org/3468 sccp: prefix default parameters of osmo_sccp_simple_client() The simple client takes certain parameters (pc, ip and port numbers) which serve as a fallback default in case the user did not configure any suitable parameters via the VTY. Prefix all default variables with default_ to make the purpose clear to the API user Change-Id: Id9e697e8b198e4f58a79e59aaf2e649e84a3eb63 --- M include/osmocom/sigtran/osmo_ss7.h M src/sccp_user.c 2 files changed, 42 insertions(+), 34 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-sccp refs/changes/68/3468/1 diff --git a/include/osmocom/sigtran/osmo_ss7.h b/include/osmocom/sigtran/osmo_ss7.h index a457709..71c2022 100644 --- a/include/osmocom/sigtran/osmo_ss7.h +++ b/include/osmocom/sigtran/osmo_ss7.h @@ -445,17 +445,20 @@ void osmo_ss7_xua_server_destroy(struct osmo_xua_server *xs); - struct osmo_sccp_instance * -osmo_sccp_simple_client(void *ctx, const char *name, uint32_t pc, - enum osmo_ss7_asp_protocol prot, int local_port, - const char *local_ip, int remote_port, const char *remote_ip); +osmo_sccp_simple_client(void *ctx, const char *name, uint32_t default_pc, + enum osmo_ss7_asp_protocol prot, int default_local_port, + const char *default_local_ip, int default_remote_port, + const char *default_remote_ip); struct osmo_sccp_instance * osmo_sccp_simple_client_on_ss7_id(void *ctx, uint32_t ss7_id, const char *name, - uint32_t pc, enum osmo_ss7_asp_protocol prot, - int local_port, const char *local_ip, - int remote_port, const char *remote_ip); + uint32_t default_pc, + enum osmo_ss7_asp_protocol prot, + int default_local_port, + const char *default_local_ip, + int default_remote_port, + const char *default_remote_ip); struct osmo_sccp_instance * osmo_sccp_simple_server(void *ctx, uint32_t pc, diff --git a/src/sccp_user.c b/src/sccp_user.c index 1d59d3c..41f9587 100644 --- a/src/sccp_user.c +++ b/src/sccp_user.c @@ -297,9 +297,12 @@ struct osmo_sccp_instance * osmo_sccp_simple_client_on_ss7_id(void *ctx, uint32_t ss7_id, const char *name, - uint32_t pc, enum osmo_ss7_asp_protocol prot, - int local_port, const char *local_ip, - int remote_port, const char *remote_ip) + uint32_t default_pc, + enum osmo_ss7_asp_protocol prot, + int default_local_port, + const char *default_local_ip, + int default_remote_port, + const char *default_remote_ip) { struct osmo_ss7_instance *ss7; bool ss7_created = false; @@ -313,17 +316,16 @@ /* Choose default ports when the caller does not supply valid port * numbers. */ - if (!remote_port || remote_port < 0) - remote_port = osmo_ss7_asp_protocol_port(prot); - if (local_port < 0) - local_port = osmo_ss7_asp_protocol_port(prot); + if (!default_remote_port || default_remote_port < 0) + default_remote_port = osmo_ss7_asp_protocol_port(prot); + if (default_local_port < 0) + default_local_port = osmo_ss7_asp_protocol_port(prot); /* Check if there is already an ss7 instance present under * the given id. If not, we will create a new one. */ ss7 = osmo_ss7_instance_find(ss7_id); if (!ss7) { - LOGP(DLSCCP, LOGL_NOTICE, "%s: Creating SS7 instance\n", - name); + LOGP(DLSCCP, LOGL_NOTICE, "%s: Creating SS7 instance\n", name); /* Create a new ss7 instance */ ss7 = osmo_ss7_instance_find_or_create(ctx, ss7_id); @@ -336,7 +338,7 @@ /* Setup primary pointcode * NOTE: This means that the user must set the pointcode to a * proper value when a cs7 instance is defined via the VTY. */ - ss7->cfg.primary_pc = pc; + ss7->cfg.primary_pc = default_pc; ss7_created = true; } LOGP(DLSCCP, LOGL_NOTICE, "%s: Using SS7 instance %u, pc:%s\n", name, @@ -353,8 +355,7 @@ * the protocol we intend to use. If not, we will create one. */ as = osmo_ss7_as_find_by_proto(ss7, prot); if (!as) { - LOGP(DLSCCP, LOGL_NOTICE, "%s: Creating AS instance\n", - name); + LOGP(DLSCCP, LOGL_NOTICE, "%s: Creating AS instance\n", name); as_name = talloc_asprintf(ctx, "as-clnt-%s", name); as = osmo_ss7_as_find_or_create(ss7, as_name, prot); talloc_free(as_name); @@ -363,7 +364,8 @@ as_created = true; if (!osmo_ss7_pc_is_valid(ss7->cfg.primary_pc)) { - LOGP(DLSCCP, LOGL_ERROR, "SS7 instance %u: no primary point-code set\n", + LOGP(DLSCCP, LOGL_ERROR, + "SS7 instance %u: no primary point-code set\n", ss7->cfg.id); goto out_ss7; } @@ -389,21 +391,21 @@ * we intend to use. */ asp = osmo_ss7_asp_find_by_proto(as, prot); if (!asp) { - LOGP(DLSCCP, LOGL_NOTICE, "%s: Creating ASP instance\n", - name); + LOGP(DLSCCP, LOGL_NOTICE, "%s: Creating ASP instance\n", name); asp_name = talloc_asprintf(ctx, "asp-clnt-%s", name); asp = - osmo_ss7_asp_find_or_create(ss7, asp_name, remote_port, - local_port, prot); + osmo_ss7_asp_find_or_create(ss7, asp_name, + default_remote_port, + default_local_port, prot); talloc_free(asp_name); if (!asp) goto out_rt; asp_created = true; - local_ip ? asp->cfg.local.host = - talloc_strdup(asp, local_ip) : NULL; - remote_ip ? asp->cfg.remote.host = - talloc_strdup(asp, remote_ip) : NULL; + default_local_ip ? asp->cfg.local.host = + talloc_strdup(asp, default_local_ip) : NULL; + default_remote_ip ? asp->cfg.remote.host = + talloc_strdup(asp, default_remote_ip) : NULL; osmo_ss7_as_add_asp(as, asp->cfg.name); } @@ -443,13 +445,16 @@ } struct osmo_sccp_instance * -osmo_sccp_simple_client(void *ctx, const char *name, uint32_t pc, - enum osmo_ss7_asp_protocol prot, int local_port, - const char *local_ip, int remote_port, const char *remote_ip) +osmo_sccp_simple_client(void *ctx, const char *name, uint32_t default_pc, + enum osmo_ss7_asp_protocol prot, int default_local_port, + const char *default_local_ip, int default_remote_port, + const char *default_remote_ip) { - return osmo_sccp_simple_client_on_ss7_id(ctx, 1, name, pc, prot, - local_port, local_ip, - remote_port, remote_ip); + return osmo_sccp_simple_client_on_ss7_id(ctx, 1, name, default_pc, prot, + default_local_port, + default_local_ip, + default_remote_port, + default_remote_ip); } /*********************************************************************** -- To view, visit https://gerrit.osmocom.org/3468 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Id9e697e8b198e4f58a79e59aaf2e649e84a3eb63 Gerrit-PatchSet: 1 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: dexter From gerrit-no-reply at lists.osmocom.org Thu Aug 10 16:15:31 2017 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Thu, 10 Aug 2017 16:15:31 +0000 Subject: [PATCH] libosmo-sccp[master]: sccp: prefix default parameters of osmo_sccp_simple_client() In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3468 to look at the new patch set (#2). sccp: prefix default parameters of osmo_sccp_simple_client() The simple client takes certain parameters (pc, ip and port numbers) which serve as a fallback default in case the user did not configure any suitable parameters via the VTY. Prefix all default variables with default_ to make the purpose clear to the API user Change-Id: Id9e697e8b198e4f58a79e59aaf2e649e84a3eb63 --- M include/osmocom/sigtran/osmo_ss7.h M src/sccp_user.c 2 files changed, 37 insertions(+), 27 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-sccp refs/changes/68/3468/2 diff --git a/include/osmocom/sigtran/osmo_ss7.h b/include/osmocom/sigtran/osmo_ss7.h index a457709..71c2022 100644 --- a/include/osmocom/sigtran/osmo_ss7.h +++ b/include/osmocom/sigtran/osmo_ss7.h @@ -445,17 +445,20 @@ void osmo_ss7_xua_server_destroy(struct osmo_xua_server *xs); - struct osmo_sccp_instance * -osmo_sccp_simple_client(void *ctx, const char *name, uint32_t pc, - enum osmo_ss7_asp_protocol prot, int local_port, - const char *local_ip, int remote_port, const char *remote_ip); +osmo_sccp_simple_client(void *ctx, const char *name, uint32_t default_pc, + enum osmo_ss7_asp_protocol prot, int default_local_port, + const char *default_local_ip, int default_remote_port, + const char *default_remote_ip); struct osmo_sccp_instance * osmo_sccp_simple_client_on_ss7_id(void *ctx, uint32_t ss7_id, const char *name, - uint32_t pc, enum osmo_ss7_asp_protocol prot, - int local_port, const char *local_ip, - int remote_port, const char *remote_ip); + uint32_t default_pc, + enum osmo_ss7_asp_protocol prot, + int default_local_port, + const char *default_local_ip, + int default_remote_port, + const char *default_remote_ip); struct osmo_sccp_instance * osmo_sccp_simple_server(void *ctx, uint32_t pc, diff --git a/src/sccp_user.c b/src/sccp_user.c index 1d59d3c..9116b60 100644 --- a/src/sccp_user.c +++ b/src/sccp_user.c @@ -297,9 +297,12 @@ struct osmo_sccp_instance * osmo_sccp_simple_client_on_ss7_id(void *ctx, uint32_t ss7_id, const char *name, - uint32_t pc, enum osmo_ss7_asp_protocol prot, - int local_port, const char *local_ip, - int remote_port, const char *remote_ip) + uint32_t default_pc, + enum osmo_ss7_asp_protocol prot, + int default_local_port, + const char *default_local_ip, + int default_remote_port, + const char *default_remote_ip) { struct osmo_ss7_instance *ss7; bool ss7_created = false; @@ -313,10 +316,10 @@ /* Choose default ports when the caller does not supply valid port * numbers. */ - if (!remote_port || remote_port < 0) - remote_port = osmo_ss7_asp_protocol_port(prot); - if (local_port < 0) - local_port = osmo_ss7_asp_protocol_port(prot); + if (!default_remote_port || default_remote_port < 0) + default_remote_port = osmo_ss7_asp_protocol_port(prot); + if (default_local_port < 0) + default_local_port = osmo_ss7_asp_protocol_port(prot); /* Check if there is already an ss7 instance present under * the given id. If not, we will create a new one. */ @@ -336,7 +339,7 @@ /* Setup primary pointcode * NOTE: This means that the user must set the pointcode to a * proper value when a cs7 instance is defined via the VTY. */ - ss7->cfg.primary_pc = pc; + ss7->cfg.primary_pc = default_pc; ss7_created = true; } LOGP(DLSCCP, LOGL_NOTICE, "%s: Using SS7 instance %u, pc:%s\n", name, @@ -393,17 +396,18 @@ name); asp_name = talloc_asprintf(ctx, "asp-clnt-%s", name); asp = - osmo_ss7_asp_find_or_create(ss7, asp_name, remote_port, - local_port, prot); + osmo_ss7_asp_find_or_create(ss7, asp_name, + default_remote_port, + default_local_port, prot); talloc_free(asp_name); if (!asp) goto out_rt; asp_created = true; - local_ip ? asp->cfg.local.host = - talloc_strdup(asp, local_ip) : NULL; - remote_ip ? asp->cfg.remote.host = - talloc_strdup(asp, remote_ip) : NULL; + default_local_ip ? asp->cfg.local.host = + talloc_strdup(asp, default_local_ip) : NULL; + default_remote_ip ? asp->cfg.remote.host = + talloc_strdup(asp, default_remote_ip) : NULL; osmo_ss7_as_add_asp(as, asp->cfg.name); } @@ -443,13 +447,16 @@ } struct osmo_sccp_instance * -osmo_sccp_simple_client(void *ctx, const char *name, uint32_t pc, - enum osmo_ss7_asp_protocol prot, int local_port, - const char *local_ip, int remote_port, const char *remote_ip) +osmo_sccp_simple_client(void *ctx, const char *name, uint32_t default_pc, + enum osmo_ss7_asp_protocol prot, int default_local_port, + const char *default_local_ip, int default_remote_port, + const char *default_remote_ip) { - return osmo_sccp_simple_client_on_ss7_id(ctx, 1, name, pc, prot, - local_port, local_ip, - remote_port, remote_ip); + return osmo_sccp_simple_client_on_ss7_id(ctx, 1, name, default_pc, prot, + default_local_port, + default_local_ip, + default_remote_port, + default_remote_ip); } /*********************************************************************** -- To view, visit https://gerrit.osmocom.org/3468 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Id9e697e8b198e4f58a79e59aaf2e649e84a3eb63 Gerrit-PatchSet: 2 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: neels From gerrit-no-reply at lists.osmocom.org Thu Aug 10 16:33:57 2017 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Thu, 10 Aug 2017 16:33:57 +0000 Subject: [PATCH] libosmo-sccp[master]: vty: command to set local ip of ASP In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3271 to look at the new patch set (#3). vty: command to set local ip of ASP The local ip of an ASP can not be set, while the same is possible for the remote ip. Add VTY command to set the local ip of an ASP Change-Id: I115b87b08bdc4b07772b7afb9c25bc713e79945a --- M src/osmo_ss7_vty.c 1 file changed, 16 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-sccp refs/changes/71/3271/3 diff --git a/src/osmo_ss7_vty.c b/src/osmo_ss7_vty.c index 9343edd..ca77bf6 100644 --- a/src/osmo_ss7_vty.c +++ b/src/osmo_ss7_vty.c @@ -565,6 +565,16 @@ return CMD_SUCCESS; } +DEFUN(asp_local_ip, asp_local_ip_cmd, + "local-ip A.B.C.D", + "Specify Local IP Address of ASP\n" + "Local IP Address of ASP\n") +{ + struct osmo_ss7_asp *asp = vty->index; + osmo_talloc_replace_string(asp, &asp->cfg.local.host, argv[0]); + return CMD_SUCCESS; +} + DEFUN(asp_qos_clas, asp_qos_class_cmd, "qos-class <0-255>", "Specify QoS Class of ASP\n" @@ -633,6 +643,10 @@ if (asp->cfg.description) vty_out(vty, " description %s%s", asp->cfg.description, VTY_NEWLINE); vty_out(vty, " remote-ip %s%s", asp->cfg.remote.host, VTY_NEWLINE); + + if (cs7_role == CS7_ROLE_ASP) + vty_out(vty, " local-ipy %s%s", asp->cfg.local.host, VTY_NEWLINE); + if (asp->cfg.qos_class) vty_out(vty, " qos-class %u%s", asp->cfg.qos_class, VTY_NEWLINE); } @@ -1725,6 +1739,8 @@ { cs7_role = CS7_ROLE_ASP; vty_init_shared(ctx); + + install_element(L_CS7_ASP_NODE, &asp_local_ip_cmd); } void osmo_ss7_vty_init_sg(void *ctx) -- To view, visit https://gerrit.osmocom.org/3271 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I115b87b08bdc4b07772b7afb9c25bc713e79945a Gerrit-PatchSet: 3 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: dexter From gerrit-no-reply at lists.osmocom.org Thu Aug 10 16:51:31 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 10 Aug 2017 16:51:31 +0000 Subject: libosmo-sccp[master]: sccp: prefix default parameters of osmo_sccp_simple_client() In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3468 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Id9e697e8b198e4f58a79e59aaf2e649e84a3eb63 Gerrit-PatchSet: 2 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: neels Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Aug 10 16:51:43 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 10 Aug 2017 16:51:43 +0000 Subject: [MERGED] libosmo-sccp[master]: sccp: prefix default parameters of osmo_sccp_simple_client() In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: sccp: prefix default parameters of osmo_sccp_simple_client() ...................................................................... sccp: prefix default parameters of osmo_sccp_simple_client() The simple client takes certain parameters (pc, ip and port numbers) which serve as a fallback default in case the user did not configure any suitable parameters via the VTY. Prefix all default variables with default_ to make the purpose clear to the API user Change-Id: Id9e697e8b198e4f58a79e59aaf2e649e84a3eb63 --- M include/osmocom/sigtran/osmo_ss7.h M src/sccp_user.c 2 files changed, 37 insertions(+), 27 deletions(-) Approvals: Neels Hofmeyr: Looks good to me, approved Jenkins Builder: Verified diff --git a/include/osmocom/sigtran/osmo_ss7.h b/include/osmocom/sigtran/osmo_ss7.h index a457709..71c2022 100644 --- a/include/osmocom/sigtran/osmo_ss7.h +++ b/include/osmocom/sigtran/osmo_ss7.h @@ -445,17 +445,20 @@ void osmo_ss7_xua_server_destroy(struct osmo_xua_server *xs); - struct osmo_sccp_instance * -osmo_sccp_simple_client(void *ctx, const char *name, uint32_t pc, - enum osmo_ss7_asp_protocol prot, int local_port, - const char *local_ip, int remote_port, const char *remote_ip); +osmo_sccp_simple_client(void *ctx, const char *name, uint32_t default_pc, + enum osmo_ss7_asp_protocol prot, int default_local_port, + const char *default_local_ip, int default_remote_port, + const char *default_remote_ip); struct osmo_sccp_instance * osmo_sccp_simple_client_on_ss7_id(void *ctx, uint32_t ss7_id, const char *name, - uint32_t pc, enum osmo_ss7_asp_protocol prot, - int local_port, const char *local_ip, - int remote_port, const char *remote_ip); + uint32_t default_pc, + enum osmo_ss7_asp_protocol prot, + int default_local_port, + const char *default_local_ip, + int default_remote_port, + const char *default_remote_ip); struct osmo_sccp_instance * osmo_sccp_simple_server(void *ctx, uint32_t pc, diff --git a/src/sccp_user.c b/src/sccp_user.c index 1d59d3c..9116b60 100644 --- a/src/sccp_user.c +++ b/src/sccp_user.c @@ -297,9 +297,12 @@ struct osmo_sccp_instance * osmo_sccp_simple_client_on_ss7_id(void *ctx, uint32_t ss7_id, const char *name, - uint32_t pc, enum osmo_ss7_asp_protocol prot, - int local_port, const char *local_ip, - int remote_port, const char *remote_ip) + uint32_t default_pc, + enum osmo_ss7_asp_protocol prot, + int default_local_port, + const char *default_local_ip, + int default_remote_port, + const char *default_remote_ip) { struct osmo_ss7_instance *ss7; bool ss7_created = false; @@ -313,10 +316,10 @@ /* Choose default ports when the caller does not supply valid port * numbers. */ - if (!remote_port || remote_port < 0) - remote_port = osmo_ss7_asp_protocol_port(prot); - if (local_port < 0) - local_port = osmo_ss7_asp_protocol_port(prot); + if (!default_remote_port || default_remote_port < 0) + default_remote_port = osmo_ss7_asp_protocol_port(prot); + if (default_local_port < 0) + default_local_port = osmo_ss7_asp_protocol_port(prot); /* Check if there is already an ss7 instance present under * the given id. If not, we will create a new one. */ @@ -336,7 +339,7 @@ /* Setup primary pointcode * NOTE: This means that the user must set the pointcode to a * proper value when a cs7 instance is defined via the VTY. */ - ss7->cfg.primary_pc = pc; + ss7->cfg.primary_pc = default_pc; ss7_created = true; } LOGP(DLSCCP, LOGL_NOTICE, "%s: Using SS7 instance %u, pc:%s\n", name, @@ -393,17 +396,18 @@ name); asp_name = talloc_asprintf(ctx, "asp-clnt-%s", name); asp = - osmo_ss7_asp_find_or_create(ss7, asp_name, remote_port, - local_port, prot); + osmo_ss7_asp_find_or_create(ss7, asp_name, + default_remote_port, + default_local_port, prot); talloc_free(asp_name); if (!asp) goto out_rt; asp_created = true; - local_ip ? asp->cfg.local.host = - talloc_strdup(asp, local_ip) : NULL; - remote_ip ? asp->cfg.remote.host = - talloc_strdup(asp, remote_ip) : NULL; + default_local_ip ? asp->cfg.local.host = + talloc_strdup(asp, default_local_ip) : NULL; + default_remote_ip ? asp->cfg.remote.host = + talloc_strdup(asp, default_remote_ip) : NULL; osmo_ss7_as_add_asp(as, asp->cfg.name); } @@ -443,13 +447,16 @@ } struct osmo_sccp_instance * -osmo_sccp_simple_client(void *ctx, const char *name, uint32_t pc, - enum osmo_ss7_asp_protocol prot, int local_port, - const char *local_ip, int remote_port, const char *remote_ip) +osmo_sccp_simple_client(void *ctx, const char *name, uint32_t default_pc, + enum osmo_ss7_asp_protocol prot, int default_local_port, + const char *default_local_ip, int default_remote_port, + const char *default_remote_ip) { - return osmo_sccp_simple_client_on_ss7_id(ctx, 1, name, pc, prot, - local_port, local_ip, - remote_port, remote_ip); + return osmo_sccp_simple_client_on_ss7_id(ctx, 1, name, default_pc, prot, + default_local_port, + default_local_ip, + default_remote_port, + default_remote_ip); } /*********************************************************************** -- To view, visit https://gerrit.osmocom.org/3468 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Id9e697e8b198e4f58a79e59aaf2e649e84a3eb63 Gerrit-PatchSet: 2 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: neels From gerrit-no-reply at lists.osmocom.org Thu Aug 10 17:05:29 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 10 Aug 2017 17:05:29 +0000 Subject: osmo-msc[master]: log protocol discriminators and message types by name In-Reply-To: References: Message-ID: Patch Set 5: (1 comment) https://gerrit.osmocom.org/#/c/3350/5/tests/msc_vlr/msc_vlr_tests.c File tests/msc_vlr/msc_vlr_tests.c: Line 168: log("MSC <--%s-- MS: %s", > unrelated to the current patch: In general, we have shown the MS always on agreed, no idea why I got the direction wrong this time -- To view, visit https://gerrit.osmocom.org/3350 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ida205d217e304337d816b14fd15e2ee435e7397d Gerrit-PatchSet: 5 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Thu Aug 10 17:12:47 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 10 Aug 2017 17:12:47 +0000 Subject: [PATCH] osmo-msc[master]: 04.08: log protocol discriminators and message types by name In-Reply-To: References: Message-ID: Hello Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3350 to look at the new patch set (#6). 04.08: log protocol discriminators and message types by name On incoming 04.08 messages, we log only the protocol discriminator in decimal. Enhance: log pdisc and message type in hex, and also log the protocol and message type as human readable string. Also adjust the msc_vlr tests' log statements for wrapped rx/tx functions of dtap from/to the MS. Adjust the expected output of msc_vlr_tests. Change-Id: Ida205d217e304337d816b14fd15e2ee435e7397d Depends: libosmocore change-id I0fca8e95ed5c2148b1a7440eff3fc9c7583898df --- M src/libmsc/gsm_04_08.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_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_umts_authen.err M tests/msc_vlr/msc_vlr_tests.c 11 files changed, 923 insertions(+), 907 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/50/3350/6 diff --git a/src/libmsc/gsm_04_08.c b/src/libmsc/gsm_04_08.c index 3f3f905..d97bde2 100644 --- a/src/libmsc/gsm_04_08.c +++ b/src/libmsc/gsm_04_08.c @@ -3003,10 +3003,10 @@ uint8_t pdisc = gsm48_hdr_pdisc(gh); uint8_t msg_type = gsm48_hdr_msg_type(gh); - DEBUGP(DMM, "%s pdisc=%d msg_type=0x%02x:" + DEBUGP(DMM, "%s: rx msg %s:" " received_cm_service_request changes to false\n", vlr_subscr_name(conn->vsub), - pdisc, msg_type); + gsm48_pdisc_msgtype_name(pdisc, msg_type)); } conn->received_cm_service_request = false; } @@ -3022,14 +3022,16 @@ OSMO_ASSERT(conn); OSMO_ASSERT(msg); - LOGP(DRLL, LOGL_DEBUG, "Dispatching 04.08 message, pdisc=%d\n", pdisc); + LOGP(DRLL, LOGL_DEBUG, "Dispatching 04.08 message %s (0x%x:0x%x)\n", + gsm48_pdisc_msgtype_name(pdisc, gsm48_hdr_msg_type(gh)), + pdisc, gsm48_hdr_msg_type(gh)); if (!msc_subscr_conn_is_accepted(conn) && !msg_is_initially_permitted(gh)) { LOGP(DRLL, LOGL_ERROR, - "subscr %s: Message not permitted for initial conn:" - " pdisc=0x%02x msg_type=0x%02x\n", - vlr_subscr_name(conn->vsub), gh->proto_discr, gh->msg_type); + "subscr %s: Message not permitted for initial conn: %s\n", + vlr_subscr_name(conn->vsub), + gsm48_pdisc_msgtype_name(pdisc, gsm48_hdr_msg_type(gh))); return -EACCES; } diff --git a/tests/msc_vlr/msc_vlr_test_gsm_authen.err b/tests/msc_vlr/msc_vlr_test_gsm_authen.err index 65370be..b6b84ed 100644 --- a/tests/msc_vlr/msc_vlr_test_gsm_authen.err +++ b/tests/msc_vlr/msc_vlr_test_gsm_authen.err @@ -1,9 +1,9 @@ ===== test_gsm_authen - Location Update request causes a GSUP Send Auth Info request to HLR - rx from MS: pdisc=0x05 msg_type=0x08 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_LOC_UPD_REQUEST new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_LOC_UPD_REQUEST (0x5:0x8) DREF unknown: MSC conn use + 1 == 2 DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Allocated DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Received Event SUBSCR_CONN_E_START @@ -55,19 +55,19 @@ <-- GSUP rx OSMO_GSUP_MSGT_UPDATE_LOCATION_RESULT: vlr_gsupc_read_cb() returns 0 msc_subscr_conn_is_accepted() == false requests shall be thwarted -DRLL Dispatching 04.08 message, pdisc=3 -DRLL subscr IMSI:901700000004620: Message not permitted for initial conn: pdisc=0x03 msg_type=0x05 -DRLL Dispatching 04.08 message, pdisc=5 -DRLL subscr IMSI:901700000004620: Message not permitted for initial conn: pdisc=0x05 msg_type=0x33 -DRLL Dispatching 04.08 message, pdisc=6 -DRLL subscr IMSI:901700000004620: Message not permitted for initial conn: pdisc=0x06 msg_type=0x19 -DRLL Dispatching 04.08 message, pdisc=9 -DRLL subscr IMSI:901700000004620: Message not permitted for initial conn: pdisc=0x09 msg_type=0x01 +DRLL Dispatching 04.08 message GSM48_MT_CC_SETUP (0x3:0x5) +DRLL subscr IMSI:901700000004620: Message not permitted for initial conn: GSM48_MT_CC_SETUP +DRLL Dispatching 04.08 message unknown 0x33 (0x5:0x33) +DRLL subscr IMSI:901700000004620: Message not permitted for initial conn: unknown 0x33 +DRLL Dispatching 04.08 message GSM48_MT_RR_SYSINFO_1 (0x6:0x19) +DRLL subscr IMSI:901700000004620: Message not permitted for initial conn: GSM48_MT_RR_SYSINFO_1 +DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) +DRLL subscr IMSI:901700000004620: Message not permitted for initial conn: GSM48_PDISC_SMS:0x01 lu_result_sent == 0 - MS sends Authen Response, VLR accepts and sends GSUP LU Req to HLR - rx from MS: pdisc=0x05 msg_type=0x54 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_AUTH_RESP DREF IMSI:901700000004620: MSC conn use + 1 == 2 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_AUTH_RESP (0x5:0x14) DMM IMSI:901700000004620: MM GSM AUTHENTICATION RESPONSE (sres = 2d8b2c3e) DVLR VLR_Authenticate(901700000004620){VLR_SUB_AS_WAIT_RESP}: Received Event VLR_AUTH_E_MS_AUTH_RESP DVLR SUBSCR(IMSI:901700000004620) received res: 2d 8b 2c 3e @@ -162,10 +162,10 @@ llist_count(&net->subscr_conns) == 0 --- - after a while, a new conn sends a CM Service Request. VLR responds with Auth Req, 2nd auth vector - rx from MS: pdisc=0x05 msg_type=0x24 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_CM_SERV_REQ new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_CM_SERV_REQ (0x5:0x24) DMM <- CM SERVICE REQUEST serv_type=0x08 MI(IMSI)=901700000004620 DREF unknown: MSC conn use + 1 == 2 DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Allocated @@ -195,18 +195,18 @@ - needs auth, not yet accepted msc_subscr_conn_is_accepted() == false requests shall be thwarted -DRLL Dispatching 04.08 message, pdisc=3 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x03 msg_type=0x05 -DRLL Dispatching 04.08 message, pdisc=5 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x05 msg_type=0x33 -DRLL Dispatching 04.08 message, pdisc=6 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x06 msg_type=0x19 -DRLL Dispatching 04.08 message, pdisc=9 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x09 msg_type=0x01 +DRLL Dispatching 04.08 message GSM48_MT_CC_SETUP (0x3:0x5) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_MT_CC_SETUP +DRLL Dispatching 04.08 message unknown 0x33 (0x5:0x33) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: unknown 0x33 +DRLL Dispatching 04.08 message GSM48_MT_RR_SYSINFO_1 (0x6:0x19) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_MT_RR_SYSINFO_1 +DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_PDISC_SMS:0x01 - MS sends Authen Response, VLR accepts with a CM Service Accept - rx from MS: pdisc=0x05 msg_type=0x54 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_AUTH_RESP DREF MSISDN:46071: MSC conn use + 1 == 2 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_AUTH_RESP (0x5:0x14) DMM MSISDN:46071: MM GSM AUTHENTICATION RESPONSE (sres = 20bde240) DVLR VLR_Authenticate(901700000004620){VLR_SUB_AS_WAIT_RESP}: Received Event VLR_AUTH_E_MS_AUTH_RESP DVLR SUBSCR(MSISDN:46071) received res: 20 bd e2 40 @@ -242,16 +242,16 @@ - a USSD request is serviced expecting USSD: Your extension is 46071 - rx from MS: pdisc=0x0b msg_type=0x3b + MSC <--RAN_GERAN_A-- MS: GSM48_PDISC_NC_SS:0x3b DREF MSISDN:46071: MSC conn use + 1 == 2 -DRLL Dispatching 04.08 message, pdisc=11 -DMM MSISDN:46071 pdisc=11 msg_type=0x3b: received_cm_service_request changes to false +DRLL Dispatching 04.08 message GSM48_PDISC_NC_SS:0x3b (0xb:0x3b) +DMM MSISDN:46071: rx msg GSM48_PDISC_NC_SS:0x3b: received_cm_service_request changes to false DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_COMMUNICATING DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_ACCEPTED}: state_chg to SUBSCR_CONN_S_COMMUNICATING DMM USSD: Own number requested DMM MSISDN:46071: MSISDN = 46071 DMSC msc_tx 43 bytes to MSISDN:46071 via RAN_GERAN_A -- DTAP --RAN_GERAN_A--> MS: 8b2a1c27a225020100302002013b301b04010f0416d9775d0e2ae3e965f73cfd7683d27310cd06bbc51a0d +- DTAP --RAN_GERAN_A--> MS: GSM48_PDISC_NC_SS:0x2a: 8b2a1c27a225020100302002013b301b04010f0416d9775d0e2ae3e965f73cfd7683d27310cd06bbc51a0d - DTAP matches expected message DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_COMMUNICATING}: Received Event SUBSCR_CONN_E_BUMP DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_COMMUNICATING}: bump: releasing conn @@ -288,10 +288,10 @@ llist_count(&vsub->cs.requests) == 1 DREF VLR subscr MSISDN:46071 usage decreases to: 3 - MS replies with Paging Response, and VLR sends Auth Request with third key - rx from MS: pdisc=0x06 msg_type=0x27 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_RR_PAG_RESP new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=6 +DRLL Dispatching 04.08 message GSM48_MT_RR_PAG_RESP (0x6:0x27) DRR PAGING RESPONSE: MI(IMSI)=901700000004620 DREF unknown: MSC conn use + 1 == 2 DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Allocated @@ -320,18 +320,18 @@ - needs auth, not yet accepted msc_subscr_conn_is_accepted() == false requests shall be thwarted -DRLL Dispatching 04.08 message, pdisc=3 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x03 msg_type=0x05 -DRLL Dispatching 04.08 message, pdisc=5 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x05 msg_type=0x33 -DRLL Dispatching 04.08 message, pdisc=6 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x06 msg_type=0x19 -DRLL Dispatching 04.08 message, pdisc=9 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x09 msg_type=0x01 +DRLL Dispatching 04.08 message GSM48_MT_CC_SETUP (0x3:0x5) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_MT_CC_SETUP +DRLL Dispatching 04.08 message unknown 0x33 (0x5:0x33) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: unknown 0x33 +DRLL Dispatching 04.08 message GSM48_MT_RR_SYSINFO_1 (0x6:0x19) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_MT_RR_SYSINFO_1 +DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_PDISC_SMS:0x01 - MS sends Authen Response, VLR accepts and sends pending SMS - rx from MS: pdisc=0x05 msg_type=0x54 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_AUTH_RESP DREF MSISDN:46071: MSC conn use + 1 == 2 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_AUTH_RESP (0x5:0x14) DMM MSISDN:46071: MM GSM AUTHENTICATION RESPONSE (sres = a29514ae) DVLR VLR_Authenticate(901700000004620){VLR_SUB_AS_WAIT_RESP}: Received Event VLR_AUTH_E_MS_AUTH_RESP DVLR SUBSCR(MSISDN:46071) received res: a2 95 14 ae @@ -361,7 +361,7 @@ DREF VLR subscr MSISDN:46071 usage increases to: 5 DREF MSISDN:46071: MSC conn use + 1 == 3 DMSC msc_tx 91 bytes to MSISDN:46071 via RAN_GERAN_A -- DTAP --RAN_GERAN_A--> MS: 09015801000791447758100650004c0005806470f1000007101000000000445079da1e1ee7416937485e9ea7c965373d1d6683c270383b3d0ed3d36ff71c949e83c22072799e9687c5ec32a81d96afcbf4b4fb0c7ac3e9e9b7db05 +- DTAP --RAN_GERAN_A--> MS: GSM48_PDISC_SMS:0x01: 09015801000791447758100650004c0005806470f1000007101000000000445079da1e1ee7416937485e9ea7c965373d1d6683c270383b3d0ed3d36ff71c949e83c22072799e9687c5ec32a81d96afcbf4b4fb0c7ac3e9e9b7db05 - DTAP matches expected message DREF VLR subscr MSISDN:46071 usage decreases to: 4 DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_BUMP @@ -378,9 +378,9 @@ - conn is still open to wait for SMS ack dance llist_count(&net->subscr_conns) == 1 - MS replies with CP-ACK for received SMS - rx from MS: pdisc=0x89 msg_type=0x04 + MSC <--RAN_GERAN_A-- MS: GSM48_PDISC_SMS:0x04 DREF MSISDN:46071: MSC conn use + 1 == 3 -DRLL Dispatching 04.08 message, pdisc=9 +DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x04 (0x9:0x4) DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_COMMUNICATING DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_ACCEPTED}: state_chg to SUBSCR_CONN_S_COMMUNICATING DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_COMMUNICATING}: Received Event SUBSCR_CONN_E_BUMP @@ -388,12 +388,12 @@ DREF MSISDN:46071: MSC conn use - 1 == 2 llist_count(&net->subscr_conns) == 1 - MS also sends RP-ACK, MSC in turn sends CP-ACK for that - rx from MS: pdisc=0x89 msg_type=0x01 + MSC <--RAN_GERAN_A-- MS: GSM48_PDISC_SMS:0x01 DREF MSISDN:46071: MSC conn use + 1 == 3 -DRLL Dispatching 04.08 message, pdisc=9 +DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_COMMUNICATING}: Received Event SUBSCR_CONN_E_COMMUNICATING DMSC msc_tx 2 bytes to MSISDN:46071 via RAN_GERAN_A -- DTAP --RAN_GERAN_A--> MS: 0904 +- DTAP --RAN_GERAN_A--> MS: GSM48_PDISC_SMS:0x04: 0904 - DTAP matches expected message DREF VLR subscr MSISDN:46071 usage decreases to: 3 DREF VLR subscr MSISDN:46071 usage decreases to: 2 @@ -418,10 +418,10 @@ llist_count(&net->subscr_conns) == 0 --- - subscriber detaches - rx from MS: pdisc=0x05 msg_type=0x01 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_IMSI_DETACH_IND new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_IMSI_DETACH_IND (0x5:0x1) DMM IMSI DETACH INDICATION: MI(IMSI)=901700000004620 DREF VLR subscr MSISDN:46071 usage increases to: 2 DMM IMSI DETACH for MSISDN:46071 @@ -439,10 +439,10 @@ ===== test_gsm_authen_tmsi - Location Update request causes a GSUP Send Auth Info request to HLR - rx from MS: pdisc=0x05 msg_type=0x08 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_LOC_UPD_REQUEST new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_LOC_UPD_REQUEST (0x5:0x8) DREF unknown: MSC conn use + 1 == 2 DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Allocated DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Received Event SUBSCR_CONN_E_START @@ -494,19 +494,19 @@ <-- GSUP rx OSMO_GSUP_MSGT_UPDATE_LOCATION_RESULT: vlr_gsupc_read_cb() returns 0 msc_subscr_conn_is_accepted() == false requests shall be thwarted -DRLL Dispatching 04.08 message, pdisc=3 -DRLL subscr IMSI:901700000004620: Message not permitted for initial conn: pdisc=0x03 msg_type=0x05 -DRLL Dispatching 04.08 message, pdisc=5 -DRLL subscr IMSI:901700000004620: Message not permitted for initial conn: pdisc=0x05 msg_type=0x33 -DRLL Dispatching 04.08 message, pdisc=6 -DRLL subscr IMSI:901700000004620: Message not permitted for initial conn: pdisc=0x06 msg_type=0x19 -DRLL Dispatching 04.08 message, pdisc=9 -DRLL subscr IMSI:901700000004620: Message not permitted for initial conn: pdisc=0x09 msg_type=0x01 +DRLL Dispatching 04.08 message GSM48_MT_CC_SETUP (0x3:0x5) +DRLL subscr IMSI:901700000004620: Message not permitted for initial conn: GSM48_MT_CC_SETUP +DRLL Dispatching 04.08 message unknown 0x33 (0x5:0x33) +DRLL subscr IMSI:901700000004620: Message not permitted for initial conn: unknown 0x33 +DRLL Dispatching 04.08 message GSM48_MT_RR_SYSINFO_1 (0x6:0x19) +DRLL subscr IMSI:901700000004620: Message not permitted for initial conn: GSM48_MT_RR_SYSINFO_1 +DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) +DRLL subscr IMSI:901700000004620: Message not permitted for initial conn: GSM48_PDISC_SMS:0x01 lu_result_sent == 0 - MS sends Authen Response, VLR accepts and sends GSUP LU Req to HLR - rx from MS: pdisc=0x05 msg_type=0x54 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_AUTH_RESP DREF IMSI:901700000004620: MSC conn use + 1 == 2 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_AUTH_RESP (0x5:0x14) DMM IMSI:901700000004620: MM GSM AUTHENTICATION RESPONSE (sres = 2d8b2c3e) DVLR VLR_Authenticate(901700000004620){VLR_SUB_AS_WAIT_RESP}: Received Event VLR_AUTH_E_MS_AUTH_RESP DVLR SUBSCR(IMSI:901700000004620) received res: 2d 8b 2c 3e @@ -577,14 +577,14 @@ lu_result_sent == 1 msc_subscr_conn_is_accepted() == false requests shall be thwarted -DRLL Dispatching 04.08 message, pdisc=3 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x03 msg_type=0x05 -DRLL Dispatching 04.08 message, pdisc=5 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x05 msg_type=0x33 -DRLL Dispatching 04.08 message, pdisc=6 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x06 msg_type=0x19 -DRLL Dispatching 04.08 message, pdisc=9 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x09 msg_type=0x01 +DRLL Dispatching 04.08 message GSM48_MT_CC_SETUP (0x3:0x5) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_MT_CC_SETUP +DRLL Dispatching 04.08 message unknown 0x33 (0x5:0x33) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: unknown 0x33 +DRLL Dispatching 04.08 message GSM48_MT_RR_SYSINFO_1 (0x6:0x19) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_MT_RR_SYSINFO_1 +DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_PDISC_SMS:0x01 - even though the TMSI is not acked, we can already find the subscr with it DREF VLR subscr MSISDN:46071 usage increases to: 2 vsub != NULL == 1 @@ -593,9 +593,9 @@ vsub->tmsi == 0xffffffff DREF VLR subscr MSISDN:46071 usage decreases to: 1 - MS sends TMSI Realloc Complete - rx from MS: pdisc=0x05 msg_type=0x5b + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_TMSI_REALL_COMPL DREF MSISDN:46071: MSC conn use + 1 == 2 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_TMSI_REALL_COMPL (0x5:0x1b) DMM TMSI Reallocation Completed. Subscriber: MSISDN:46071 DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_WAIT_LU_COMPL}: Received Event VLR_ULA_E_NEW_TMSI_ACK DVLR lu_compl_vlr_fsm(901700000004620){LU_COMPL_VLR_S_WAIT_TMSI_CNF}: Received Event LU_COMPL_VLR_E_NEW_TMSI_ACK @@ -637,10 +637,10 @@ DREF VLR subscr MSISDN:46071 usage decreases to: 1 --- - after a while, a new conn sends a CM Service Request using above TMSI. VLR responds with Auth Req, 2nd auth vector - rx from MS: pdisc=0x05 msg_type=0x24 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_CM_SERV_REQ new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_CM_SERV_REQ (0x5:0x24) DMM <- CM SERVICE REQUEST serv_type=0x08 MI(TMSI)=50462976 DREF unknown: MSC conn use + 1 == 2 DMM Subscr_Conn(50462976){SUBSCR_CONN_S_INIT}: Allocated @@ -670,18 +670,18 @@ - needs auth, not yet accepted msc_subscr_conn_is_accepted() == false requests shall be thwarted -DRLL Dispatching 04.08 message, pdisc=3 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x03 msg_type=0x05 -DRLL Dispatching 04.08 message, pdisc=5 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x05 msg_type=0x33 -DRLL Dispatching 04.08 message, pdisc=6 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x06 msg_type=0x19 -DRLL Dispatching 04.08 message, pdisc=9 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x09 msg_type=0x01 +DRLL Dispatching 04.08 message GSM48_MT_CC_SETUP (0x3:0x5) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_MT_CC_SETUP +DRLL Dispatching 04.08 message unknown 0x33 (0x5:0x33) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: unknown 0x33 +DRLL Dispatching 04.08 message GSM48_MT_RR_SYSINFO_1 (0x6:0x19) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_MT_RR_SYSINFO_1 +DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_PDISC_SMS:0x01 - MS sends Authen Response, VLR accepts with a CM Service Accept - rx from MS: pdisc=0x05 msg_type=0x54 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_AUTH_RESP DREF MSISDN:46071: MSC conn use + 1 == 2 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_AUTH_RESP (0x5:0x14) DMM MSISDN:46071: MM GSM AUTHENTICATION RESPONSE (sres = 20bde240) DVLR VLR_Authenticate(50462976){VLR_SUB_AS_WAIT_RESP}: Received Event VLR_AUTH_E_MS_AUTH_RESP DVLR SUBSCR(MSISDN:46071) received res: 20 bd e2 40 @@ -717,16 +717,16 @@ - a USSD request is serviced expecting USSD: Your extension is 46071 - rx from MS: pdisc=0x0b msg_type=0x3b + MSC <--RAN_GERAN_A-- MS: GSM48_PDISC_NC_SS:0x3b DREF MSISDN:46071: MSC conn use + 1 == 2 -DRLL Dispatching 04.08 message, pdisc=11 -DMM MSISDN:46071 pdisc=11 msg_type=0x3b: received_cm_service_request changes to false +DRLL Dispatching 04.08 message GSM48_PDISC_NC_SS:0x3b (0xb:0x3b) +DMM MSISDN:46071: rx msg GSM48_PDISC_NC_SS:0x3b: received_cm_service_request changes to false DMM Subscr_Conn(50462976){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_COMMUNICATING DMM Subscr_Conn(50462976){SUBSCR_CONN_S_ACCEPTED}: state_chg to SUBSCR_CONN_S_COMMUNICATING DMM USSD: Own number requested DMM MSISDN:46071: MSISDN = 46071 DMSC msc_tx 43 bytes to MSISDN:46071 via RAN_GERAN_A -- DTAP --RAN_GERAN_A--> MS: 8b2a1c27a225020100302002013b301b04010f0416d9775d0e2ae3e965f73cfd7683d27310cd06bbc51a0d +- DTAP --RAN_GERAN_A--> MS: GSM48_PDISC_NC_SS:0x2a: 8b2a1c27a225020100302002013b301b04010f0416d9775d0e2ae3e965f73cfd7683d27310cd06bbc51a0d - DTAP matches expected message DMM Subscr_Conn(50462976){SUBSCR_CONN_S_COMMUNICATING}: Received Event SUBSCR_CONN_E_BUMP DMM Subscr_Conn(50462976){SUBSCR_CONN_S_COMMUNICATING}: bump: releasing conn @@ -763,10 +763,10 @@ llist_count(&vsub->cs.requests) == 1 DREF VLR subscr MSISDN:46071 usage decreases to: 3 - MS replies with Paging Response using TMSI, and VLR sends Auth Request with third key - rx from MS: pdisc=0x06 msg_type=0x27 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_RR_PAG_RESP new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=6 +DRLL Dispatching 04.08 message GSM48_MT_RR_PAG_RESP (0x6:0x27) DRR PAGING RESPONSE: MI(TMSI)=50462976 DREF unknown: MSC conn use + 1 == 2 DMM Subscr_Conn(50462976){SUBSCR_CONN_S_INIT}: Allocated @@ -795,18 +795,18 @@ - needs auth, not yet accepted msc_subscr_conn_is_accepted() == false requests shall be thwarted -DRLL Dispatching 04.08 message, pdisc=3 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x03 msg_type=0x05 -DRLL Dispatching 04.08 message, pdisc=5 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x05 msg_type=0x33 -DRLL Dispatching 04.08 message, pdisc=6 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x06 msg_type=0x19 -DRLL Dispatching 04.08 message, pdisc=9 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x09 msg_type=0x01 +DRLL Dispatching 04.08 message GSM48_MT_CC_SETUP (0x3:0x5) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_MT_CC_SETUP +DRLL Dispatching 04.08 message unknown 0x33 (0x5:0x33) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: unknown 0x33 +DRLL Dispatching 04.08 message GSM48_MT_RR_SYSINFO_1 (0x6:0x19) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_MT_RR_SYSINFO_1 +DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_PDISC_SMS:0x01 - MS sends Authen Response, VLR accepts and sends pending SMS - rx from MS: pdisc=0x05 msg_type=0x54 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_AUTH_RESP DREF MSISDN:46071: MSC conn use + 1 == 2 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_AUTH_RESP (0x5:0x14) DMM MSISDN:46071: MM GSM AUTHENTICATION RESPONSE (sres = a29514ae) DVLR VLR_Authenticate(50462976){VLR_SUB_AS_WAIT_RESP}: Received Event VLR_AUTH_E_MS_AUTH_RESP DVLR SUBSCR(MSISDN:46071) received res: a2 95 14 ae @@ -836,7 +836,7 @@ DREF VLR subscr MSISDN:46071 usage increases to: 5 DREF MSISDN:46071: MSC conn use + 1 == 3 DMSC msc_tx 91 bytes to MSISDN:46071 via RAN_GERAN_A -- DTAP --RAN_GERAN_A--> MS: 09015801000791447758100650004c0005806470f1000007101000000000445079da1e1ee7416937485e9ea7c965373d1d6683c270383b3d0ed3d36ff71c949e83c22072799e9687c5ec32a81d96afcbf4b4fb0c7ac3e9e9b7db05 +- DTAP --RAN_GERAN_A--> MS: GSM48_PDISC_SMS:0x01: 09015801000791447758100650004c0005806470f1000007101000000000445079da1e1ee7416937485e9ea7c965373d1d6683c270383b3d0ed3d36ff71c949e83c22072799e9687c5ec32a81d96afcbf4b4fb0c7ac3e9e9b7db05 - DTAP matches expected message DREF VLR subscr MSISDN:46071 usage decreases to: 4 DMM Subscr_Conn(50462976){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_BUMP @@ -853,9 +853,9 @@ - conn is still open to wait for SMS ack dance llist_count(&net->subscr_conns) == 1 - MS replies with CP-ACK for received SMS - rx from MS: pdisc=0x89 msg_type=0x04 + MSC <--RAN_GERAN_A-- MS: GSM48_PDISC_SMS:0x04 DREF MSISDN:46071: MSC conn use + 1 == 3 -DRLL Dispatching 04.08 message, pdisc=9 +DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x04 (0x9:0x4) DMM Subscr_Conn(50462976){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_COMMUNICATING DMM Subscr_Conn(50462976){SUBSCR_CONN_S_ACCEPTED}: state_chg to SUBSCR_CONN_S_COMMUNICATING DMM Subscr_Conn(50462976){SUBSCR_CONN_S_COMMUNICATING}: Received Event SUBSCR_CONN_E_BUMP @@ -863,12 +863,12 @@ DREF MSISDN:46071: MSC conn use - 1 == 2 llist_count(&net->subscr_conns) == 1 - MS also sends RP-ACK, MSC in turn sends CP-ACK for that - rx from MS: pdisc=0x89 msg_type=0x01 + MSC <--RAN_GERAN_A-- MS: GSM48_PDISC_SMS:0x01 DREF MSISDN:46071: MSC conn use + 1 == 3 -DRLL Dispatching 04.08 message, pdisc=9 +DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) DMM Subscr_Conn(50462976){SUBSCR_CONN_S_COMMUNICATING}: Received Event SUBSCR_CONN_E_COMMUNICATING DMSC msc_tx 2 bytes to MSISDN:46071 via RAN_GERAN_A -- DTAP --RAN_GERAN_A--> MS: 0904 +- DTAP --RAN_GERAN_A--> MS: GSM48_PDISC_SMS:0x04: 0904 - DTAP matches expected message DREF VLR subscr MSISDN:46071 usage decreases to: 3 DREF VLR subscr MSISDN:46071 usage decreases to: 2 @@ -894,10 +894,10 @@ --- - subscriber sends LU Request, this time with the TMSI - Location Update request causes an Auth Req to MS - rx from MS: pdisc=0x05 msg_type=0x08 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_LOC_UPD_REQUEST new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_LOC_UPD_REQUEST (0x5:0x8) DREF unknown: MSC conn use + 1 == 2 DMM Subscr_Conn(50462976){SUBSCR_CONN_S_INIT}: Allocated DMM Subscr_Conn(50462976){SUBSCR_CONN_S_INIT}: Received Event SUBSCR_CONN_E_START @@ -926,9 +926,9 @@ auth_request_sent == 1 lu_result_sent == 0 - MS sends Authen Response, VLR accepts and sends GSUP LU Req to HLR - rx from MS: pdisc=0x05 msg_type=0x54 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_AUTH_RESP DREF MSISDN:46071: MSC conn use + 1 == 2 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_AUTH_RESP (0x5:0x14) DMM MSISDN:46071: MM GSM AUTHENTICATION RESPONSE (sres = 5afc8d72) DVLR VLR_Authenticate(50462976){VLR_SUB_AS_WAIT_RESP}: Received Event VLR_AUTH_E_MS_AUTH_RESP DVLR SUBSCR(MSISDN:46071) received res: 5a fc 8d 72 @@ -999,14 +999,14 @@ lu_result_sent == 1 msc_subscr_conn_is_accepted() == false requests shall be thwarted -DRLL Dispatching 04.08 message, pdisc=3 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x03 msg_type=0x05 -DRLL Dispatching 04.08 message, pdisc=5 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x05 msg_type=0x33 -DRLL Dispatching 04.08 message, pdisc=6 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x06 msg_type=0x19 -DRLL Dispatching 04.08 message, pdisc=9 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x09 msg_type=0x01 +DRLL Dispatching 04.08 message GSM48_MT_CC_SETUP (0x3:0x5) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_MT_CC_SETUP +DRLL Dispatching 04.08 message unknown 0x33 (0x5:0x33) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: unknown 0x33 +DRLL Dispatching 04.08 message GSM48_MT_RR_SYSINFO_1 (0x6:0x19) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_MT_RR_SYSINFO_1 +DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_PDISC_SMS:0x01 - even though the TMSI is not acked, we can already find the subscr with it DREF VLR subscr MSISDN:46071 usage increases to: 3 vsub != NULL == 1 @@ -1015,9 +1015,9 @@ vsub->tmsi == 0x03020100 DREF VLR subscr MSISDN:46071 usage decreases to: 2 - MS sends TMSI Realloc Complete - rx from MS: pdisc=0x05 msg_type=0x5b + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_TMSI_REALL_COMPL DREF MSISDN:46071: MSC conn use + 1 == 2 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_TMSI_REALL_COMPL (0x5:0x1b) DMM TMSI Reallocation Completed. Subscriber: MSISDN:46071 DVLR vlr_lu_fsm(50462976){VLR_ULA_S_WAIT_LU_COMPL}: Received Event VLR_ULA_E_NEW_TMSI_ACK DVLR lu_compl_vlr_fsm(50462976){LU_COMPL_VLR_S_WAIT_TMSI_CNF}: Received Event LU_COMPL_VLR_E_NEW_TMSI_ACK @@ -1058,10 +1058,10 @@ DREF VLR subscr MSISDN:46071 usage decreases to: 1 --- - subscriber detaches, using new TMSI - rx from MS: pdisc=0x05 msg_type=0x01 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_IMSI_DETACH_IND new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_IMSI_DETACH_IND (0x5:0x1) DMM IMSI DETACH INDICATION: MI(TMSI)=117835012 DREF VLR subscr MSISDN:46071 usage increases to: 2 DMM IMSI DETACH for MSISDN:46071 @@ -1079,10 +1079,10 @@ ===== test_gsm_authen_imei - Location Update request causes a GSUP Send Auth Info request to HLR - rx from MS: pdisc=0x05 msg_type=0x08 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_LOC_UPD_REQUEST new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_LOC_UPD_REQUEST (0x5:0x8) DREF unknown: MSC conn use + 1 == 2 DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Allocated DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Received Event SUBSCR_CONN_E_START @@ -1134,19 +1134,19 @@ <-- GSUP rx OSMO_GSUP_MSGT_UPDATE_LOCATION_RESULT: vlr_gsupc_read_cb() returns 0 msc_subscr_conn_is_accepted() == false requests shall be thwarted -DRLL Dispatching 04.08 message, pdisc=3 -DRLL subscr IMSI:901700000004620: Message not permitted for initial conn: pdisc=0x03 msg_type=0x05 -DRLL Dispatching 04.08 message, pdisc=5 -DRLL subscr IMSI:901700000004620: Message not permitted for initial conn: pdisc=0x05 msg_type=0x33 -DRLL Dispatching 04.08 message, pdisc=6 -DRLL subscr IMSI:901700000004620: Message not permitted for initial conn: pdisc=0x06 msg_type=0x19 -DRLL Dispatching 04.08 message, pdisc=9 -DRLL subscr IMSI:901700000004620: Message not permitted for initial conn: pdisc=0x09 msg_type=0x01 +DRLL Dispatching 04.08 message GSM48_MT_CC_SETUP (0x3:0x5) +DRLL subscr IMSI:901700000004620: Message not permitted for initial conn: GSM48_MT_CC_SETUP +DRLL Dispatching 04.08 message unknown 0x33 (0x5:0x33) +DRLL subscr IMSI:901700000004620: Message not permitted for initial conn: unknown 0x33 +DRLL Dispatching 04.08 message GSM48_MT_RR_SYSINFO_1 (0x6:0x19) +DRLL subscr IMSI:901700000004620: Message not permitted for initial conn: GSM48_MT_RR_SYSINFO_1 +DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) +DRLL subscr IMSI:901700000004620: Message not permitted for initial conn: GSM48_PDISC_SMS:0x01 lu_result_sent == 0 - MS sends Authen Response, VLR accepts and sends GSUP LU Req to HLR - rx from MS: pdisc=0x05 msg_type=0x54 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_AUTH_RESP DREF IMSI:901700000004620: MSC conn use + 1 == 2 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_AUTH_RESP (0x5:0x14) DMM IMSI:901700000004620: MM GSM AUTHENTICATION RESPONSE (sres = 2d8b2c3e) DVLR VLR_Authenticate(901700000004620){VLR_SUB_AS_WAIT_RESP}: Received Event VLR_AUTH_E_MS_AUTH_RESP DVLR SUBSCR(IMSI:901700000004620) received res: 2d 8b 2c 3e @@ -1209,7 +1209,7 @@ DVLR lu_compl_vlr_fsm(901700000004620){LU_COMPL_VLR_S_WAIT_SUB_PRES}: Received Event LU_COMPL_VLR_E_SUB_PRES_COMPL DVLR lu_compl_vlr_fsm(901700000004620){LU_COMPL_VLR_S_WAIT_SUB_PRES}: state_chg to LU_COMPL_VLR_S_WAIT_IMEI DMSC msc_tx 3 bytes to MSISDN:46071 via RAN_GERAN_A -- DTAP --RAN_GERAN_A--> MS: 051802 +- DTAP --RAN_GERAN_A--> MS: GSM48_MT_MM_ID_REQ: 051802 - DTAP matches expected message DREF VLR subscr MSISDN:46071 usage decreases to: 1 <-- GSUP rx OSMO_GSUP_MSGT_UPDATE_LOCATION_RESULT: vlr_gsupc_read_cb() returns 0 @@ -1220,18 +1220,18 @@ DREF VLR subscr MSISDN:46071 usage decreases to: 1 msc_subscr_conn_is_accepted() == false requests shall be thwarted -DRLL Dispatching 04.08 message, pdisc=3 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x03 msg_type=0x05 -DRLL Dispatching 04.08 message, pdisc=5 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x05 msg_type=0x33 -DRLL Dispatching 04.08 message, pdisc=6 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x06 msg_type=0x19 -DRLL Dispatching 04.08 message, pdisc=9 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x09 msg_type=0x01 +DRLL Dispatching 04.08 message GSM48_MT_CC_SETUP (0x3:0x5) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_MT_CC_SETUP +DRLL Dispatching 04.08 message unknown 0x33 (0x5:0x33) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: unknown 0x33 +DRLL Dispatching 04.08 message GSM48_MT_RR_SYSINFO_1 (0x6:0x19) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_MT_RR_SYSINFO_1 +DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_PDISC_SMS:0x01 - MS replies with an Identity Response - rx from MS: pdisc=0x05 msg_type=0x59 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_ID_RESP DREF MSISDN:46071: MSC conn use + 1 == 2 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_ID_RESP (0x5:0x19) DMM IDENTITY RESPONSE: MI(IMEI)=423423423423423 DVLR set IMEI on subscriber; IMSI=901700000004620 IMEI=423423423423423 DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_WAIT_LU_COMPL}: Received Event VLR_ULA_E_ID_IMEI @@ -1273,10 +1273,10 @@ DREF VLR subscr MSISDN:46071 usage decreases to: 1 --- - subscriber detaches - rx from MS: pdisc=0x05 msg_type=0x01 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_IMSI_DETACH_IND new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_IMSI_DETACH_IND (0x5:0x1) DMM IMSI DETACH INDICATION: MI(IMSI)=901700000004620 DREF VLR subscr MSISDN:46071 usage increases to: 2 DMM IMSI DETACH for MSISDN:46071 @@ -1294,10 +1294,10 @@ ===== test_gsm_authen_tmsi_imei - Location Update request causes a GSUP Send Auth Info request to HLR - rx from MS: pdisc=0x05 msg_type=0x08 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_LOC_UPD_REQUEST new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_LOC_UPD_REQUEST (0x5:0x8) DREF unknown: MSC conn use + 1 == 2 DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Allocated DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Received Event SUBSCR_CONN_E_START @@ -1349,19 +1349,19 @@ <-- GSUP rx OSMO_GSUP_MSGT_UPDATE_LOCATION_RESULT: vlr_gsupc_read_cb() returns 0 msc_subscr_conn_is_accepted() == false requests shall be thwarted -DRLL Dispatching 04.08 message, pdisc=3 -DRLL subscr IMSI:901700000004620: Message not permitted for initial conn: pdisc=0x03 msg_type=0x05 -DRLL Dispatching 04.08 message, pdisc=5 -DRLL subscr IMSI:901700000004620: Message not permitted for initial conn: pdisc=0x05 msg_type=0x33 -DRLL Dispatching 04.08 message, pdisc=6 -DRLL subscr IMSI:901700000004620: Message not permitted for initial conn: pdisc=0x06 msg_type=0x19 -DRLL Dispatching 04.08 message, pdisc=9 -DRLL subscr IMSI:901700000004620: Message not permitted for initial conn: pdisc=0x09 msg_type=0x01 +DRLL Dispatching 04.08 message GSM48_MT_CC_SETUP (0x3:0x5) +DRLL subscr IMSI:901700000004620: Message not permitted for initial conn: GSM48_MT_CC_SETUP +DRLL Dispatching 04.08 message unknown 0x33 (0x5:0x33) +DRLL subscr IMSI:901700000004620: Message not permitted for initial conn: unknown 0x33 +DRLL Dispatching 04.08 message GSM48_MT_RR_SYSINFO_1 (0x6:0x19) +DRLL subscr IMSI:901700000004620: Message not permitted for initial conn: GSM48_MT_RR_SYSINFO_1 +DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) +DRLL subscr IMSI:901700000004620: Message not permitted for initial conn: GSM48_PDISC_SMS:0x01 lu_result_sent == 0 - MS sends Authen Response, VLR accepts and sends GSUP LU Req to HLR - rx from MS: pdisc=0x05 msg_type=0x54 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_AUTH_RESP DREF IMSI:901700000004620: MSC conn use + 1 == 2 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_AUTH_RESP (0x5:0x14) DMM IMSI:901700000004620: MM GSM AUTHENTICATION RESPONSE (sres = 2d8b2c3e) DVLR VLR_Authenticate(901700000004620){VLR_SUB_AS_WAIT_RESP}: Received Event VLR_AUTH_E_MS_AUTH_RESP DVLR SUBSCR(IMSI:901700000004620) received res: 2d 8b 2c 3e @@ -1424,7 +1424,7 @@ DVLR lu_compl_vlr_fsm(901700000004620){LU_COMPL_VLR_S_WAIT_SUB_PRES}: Received Event LU_COMPL_VLR_E_SUB_PRES_COMPL DVLR lu_compl_vlr_fsm(901700000004620){LU_COMPL_VLR_S_WAIT_SUB_PRES}: state_chg to LU_COMPL_VLR_S_WAIT_IMEI_TMSI DMSC msc_tx 3 bytes to MSISDN:46071 via RAN_GERAN_A -- DTAP --RAN_GERAN_A--> MS: 051802 +- DTAP --RAN_GERAN_A--> MS: GSM48_MT_MM_ID_REQ: 051802 - DTAP matches expected message DREF VLR subscr MSISDN:46071 usage decreases to: 1 <-- GSUP rx OSMO_GSUP_MSGT_UPDATE_LOCATION_RESULT: vlr_gsupc_read_cb() returns 0 @@ -1435,18 +1435,18 @@ DREF VLR subscr MSISDN:46071 usage decreases to: 1 msc_subscr_conn_is_accepted() == false requests shall be thwarted -DRLL Dispatching 04.08 message, pdisc=3 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x03 msg_type=0x05 -DRLL Dispatching 04.08 message, pdisc=5 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x05 msg_type=0x33 -DRLL Dispatching 04.08 message, pdisc=6 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x06 msg_type=0x19 -DRLL Dispatching 04.08 message, pdisc=9 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x09 msg_type=0x01 +DRLL Dispatching 04.08 message GSM48_MT_CC_SETUP (0x3:0x5) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_MT_CC_SETUP +DRLL Dispatching 04.08 message unknown 0x33 (0x5:0x33) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: unknown 0x33 +DRLL Dispatching 04.08 message GSM48_MT_RR_SYSINFO_1 (0x6:0x19) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_MT_RR_SYSINFO_1 +DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_PDISC_SMS:0x01 - MS replies with an Identity Response - rx from MS: pdisc=0x05 msg_type=0x59 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_ID_RESP DREF MSISDN:46071: MSC conn use + 1 == 2 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_ID_RESP (0x5:0x19) DMM IDENTITY RESPONSE: MI(IMEI)=423423423423423 DVLR set IMEI on subscriber; IMSI=901700000004620 IMEI=423423423423423 DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_WAIT_LU_COMPL}: Received Event VLR_ULA_E_ID_IMEI @@ -1461,14 +1461,14 @@ lu_result_sent == 1 msc_subscr_conn_is_accepted() == false requests shall be thwarted -DRLL Dispatching 04.08 message, pdisc=3 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x03 msg_type=0x05 -DRLL Dispatching 04.08 message, pdisc=5 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x05 msg_type=0x33 -DRLL Dispatching 04.08 message, pdisc=6 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x06 msg_type=0x19 -DRLL Dispatching 04.08 message, pdisc=9 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x09 msg_type=0x01 +DRLL Dispatching 04.08 message GSM48_MT_CC_SETUP (0x3:0x5) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_MT_CC_SETUP +DRLL Dispatching 04.08 message unknown 0x33 (0x5:0x33) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: unknown 0x33 +DRLL Dispatching 04.08 message GSM48_MT_RR_SYSINFO_1 (0x6:0x19) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_MT_RR_SYSINFO_1 +DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_PDISC_SMS:0x01 - even though the TMSI is not acked, we can already find the subscr with it DREF VLR subscr MSISDN:46071 usage increases to: 2 vsub != NULL == 1 @@ -1477,9 +1477,9 @@ vsub->tmsi == 0xffffffff DREF VLR subscr MSISDN:46071 usage decreases to: 1 - MS sends TMSI Realloc Complete - rx from MS: pdisc=0x05 msg_type=0x5b + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_TMSI_REALL_COMPL DREF MSISDN:46071: MSC conn use + 1 == 2 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_TMSI_REALL_COMPL (0x5:0x1b) DMM TMSI Reallocation Completed. Subscriber: MSISDN:46071 DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_WAIT_LU_COMPL}: Received Event VLR_ULA_E_NEW_TMSI_ACK DVLR lu_compl_vlr_fsm(901700000004620){LU_COMPL_VLR_S_WAIT_TMSI_CNF}: Received Event LU_COMPL_VLR_E_NEW_TMSI_ACK @@ -1519,10 +1519,10 @@ DREF VLR subscr MSISDN:46071 usage decreases to: 1 --- - subscriber detaches, using TMSI - rx from MS: pdisc=0x05 msg_type=0x01 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_IMSI_DETACH_IND new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_IMSI_DETACH_IND (0x5:0x1) DMM IMSI DETACH INDICATION: MI(TMSI)=50462976 DREF VLR subscr MSISDN:46071 usage increases to: 2 DMM IMSI DETACH for MSISDN:46071 @@ -1540,10 +1540,10 @@ ===== test_gsm_milenage_authen - Location Update request causes a GSUP Send Auth Info request to HLR - rx from MS: pdisc=0x05 msg_type=0x08 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_LOC_UPD_REQUEST new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_LOC_UPD_REQUEST (0x5:0x8) DREF unknown: MSC conn use + 1 == 2 DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_INIT}: Allocated DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_INIT}: Received Event SUBSCR_CONN_E_START @@ -1586,9 +1586,9 @@ auth_request_sent == 1 lu_result_sent == 0 - MS sends Authen Response, VLR accepts and sends GSUP LU Req to HLR - rx from MS: pdisc=0x05 msg_type=0x54 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_AUTH_RESP DREF IMSI:901700000010650: MSC conn use + 1 == 2 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_AUTH_RESP (0x5:0x14) DMM IMSI:901700000010650: MM GSM AUTHENTICATION RESPONSE (sres = 9b36efdf) DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_WAIT_RESP}: Received Event VLR_AUTH_E_MS_AUTH_RESP DVLR SUBSCR(IMSI:901700000010650) received res: 9b 36 ef df @@ -1683,10 +1683,10 @@ llist_count(&net->subscr_conns) == 0 --- - after a while, a new conn sends a CM Service Request. VLR responds with Auth Req, 2nd auth vector - rx from MS: pdisc=0x05 msg_type=0x24 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_CM_SERV_REQ new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_CM_SERV_REQ (0x5:0x24) DMM <- CM SERVICE REQUEST serv_type=0x08 MI(IMSI)=901700000010650 DREF unknown: MSC conn use + 1 == 2 DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_INIT}: Allocated @@ -1716,18 +1716,18 @@ - needs auth, not yet accepted msc_subscr_conn_is_accepted() == false requests shall be thwarted -DRLL Dispatching 04.08 message, pdisc=3 -DRLL subscr MSISDN:42342: Message not permitted for initial conn: pdisc=0x03 msg_type=0x05 -DRLL Dispatching 04.08 message, pdisc=5 -DRLL subscr MSISDN:42342: Message not permitted for initial conn: pdisc=0x05 msg_type=0x33 -DRLL Dispatching 04.08 message, pdisc=6 -DRLL subscr MSISDN:42342: Message not permitted for initial conn: pdisc=0x06 msg_type=0x19 -DRLL Dispatching 04.08 message, pdisc=9 -DRLL subscr MSISDN:42342: Message not permitted for initial conn: pdisc=0x09 msg_type=0x01 +DRLL Dispatching 04.08 message GSM48_MT_CC_SETUP (0x3:0x5) +DRLL subscr MSISDN:42342: Message not permitted for initial conn: GSM48_MT_CC_SETUP +DRLL Dispatching 04.08 message unknown 0x33 (0x5:0x33) +DRLL subscr MSISDN:42342: Message not permitted for initial conn: unknown 0x33 +DRLL Dispatching 04.08 message GSM48_MT_RR_SYSINFO_1 (0x6:0x19) +DRLL subscr MSISDN:42342: Message not permitted for initial conn: GSM48_MT_RR_SYSINFO_1 +DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) +DRLL subscr MSISDN:42342: Message not permitted for initial conn: GSM48_PDISC_SMS:0x01 - MS sends Authen Response, VLR accepts with a CM Service Accept - rx from MS: pdisc=0x05 msg_type=0x54 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_AUTH_RESP DREF MSISDN:42342: MSC conn use + 1 == 2 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_AUTH_RESP (0x5:0x14) DMM MSISDN:42342: MM GSM AUTHENTICATION RESPONSE (sres = 85aa3130) DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_WAIT_RESP}: Received Event VLR_AUTH_E_MS_AUTH_RESP DVLR SUBSCR(MSISDN:42342) received res: 85 aa 31 30 @@ -1763,16 +1763,16 @@ - a USSD request is serviced expecting USSD: Your extension is 42342 - rx from MS: pdisc=0x0b msg_type=0x3b + MSC <--RAN_GERAN_A-- MS: GSM48_PDISC_NC_SS:0x3b DREF MSISDN:42342: MSC conn use + 1 == 2 -DRLL Dispatching 04.08 message, pdisc=11 -DMM MSISDN:42342 pdisc=11 msg_type=0x3b: received_cm_service_request changes to false +DRLL Dispatching 04.08 message GSM48_PDISC_NC_SS:0x3b (0xb:0x3b) +DMM MSISDN:42342: rx msg GSM48_PDISC_NC_SS:0x3b: received_cm_service_request changes to false DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_COMMUNICATING DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_ACCEPTED}: state_chg to SUBSCR_CONN_S_COMMUNICATING DMM USSD: Own number requested DMM MSISDN:42342: MSISDN = 42342 DMSC msc_tx 43 bytes to MSISDN:42342 via RAN_GERAN_A -- DTAP --RAN_GERAN_A--> MS: 8b2a1c27a225020100302002013b301b04010f0416d9775d0e2ae3e965f73cfd7683d273104d36a3c91a0d +- DTAP --RAN_GERAN_A--> MS: GSM48_PDISC_NC_SS:0x2a: 8b2a1c27a225020100302002013b301b04010f0416d9775d0e2ae3e965f73cfd7683d273104d36a3c91a0d - DTAP matches expected message DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_COMMUNICATING}: Received Event SUBSCR_CONN_E_BUMP DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_COMMUNICATING}: bump: releasing conn @@ -1809,10 +1809,10 @@ llist_count(&vsub->cs.requests) == 1 DREF VLR subscr MSISDN:42342 usage decreases to: 3 - MS replies with Paging Response, and VLR sends Auth Request with third key - rx from MS: pdisc=0x06 msg_type=0x27 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_RR_PAG_RESP new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=6 +DRLL Dispatching 04.08 message GSM48_MT_RR_PAG_RESP (0x6:0x27) DRR PAGING RESPONSE: MI(IMSI)=901700000010650 DREF unknown: MSC conn use + 1 == 2 DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_INIT}: Allocated @@ -1841,18 +1841,18 @@ - needs auth, not yet accepted msc_subscr_conn_is_accepted() == false requests shall be thwarted -DRLL Dispatching 04.08 message, pdisc=3 -DRLL subscr MSISDN:42342: Message not permitted for initial conn: pdisc=0x03 msg_type=0x05 -DRLL Dispatching 04.08 message, pdisc=5 -DRLL subscr MSISDN:42342: Message not permitted for initial conn: pdisc=0x05 msg_type=0x33 -DRLL Dispatching 04.08 message, pdisc=6 -DRLL subscr MSISDN:42342: Message not permitted for initial conn: pdisc=0x06 msg_type=0x19 -DRLL Dispatching 04.08 message, pdisc=9 -DRLL subscr MSISDN:42342: Message not permitted for initial conn: pdisc=0x09 msg_type=0x01 +DRLL Dispatching 04.08 message GSM48_MT_CC_SETUP (0x3:0x5) +DRLL subscr MSISDN:42342: Message not permitted for initial conn: GSM48_MT_CC_SETUP +DRLL Dispatching 04.08 message unknown 0x33 (0x5:0x33) +DRLL subscr MSISDN:42342: Message not permitted for initial conn: unknown 0x33 +DRLL Dispatching 04.08 message GSM48_MT_RR_SYSINFO_1 (0x6:0x19) +DRLL subscr MSISDN:42342: Message not permitted for initial conn: GSM48_MT_RR_SYSINFO_1 +DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) +DRLL subscr MSISDN:42342: Message not permitted for initial conn: GSM48_PDISC_SMS:0x01 - MS sends Authen Response, VLR accepts and sends pending SMS - rx from MS: pdisc=0x05 msg_type=0x54 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_AUTH_RESP DREF MSISDN:42342: MSC conn use + 1 == 2 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_AUTH_RESP (0x5:0x14) DMM MSISDN:42342: MM GSM AUTHENTICATION RESPONSE (sres = 69d5f9fb) DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_WAIT_RESP}: Received Event VLR_AUTH_E_MS_AUTH_RESP DVLR SUBSCR(MSISDN:42342) received res: 69 d5 f9 fb @@ -1882,7 +1882,7 @@ DREF VLR subscr MSISDN:42342 usage increases to: 5 DREF MSISDN:42342: MSC conn use + 1 == 3 DMSC msc_tx 91 bytes to MSISDN:42342 via RAN_GERAN_A -- DTAP --RAN_GERAN_A--> MS: 09015801000791447758100650004c0005802443f2000007101000000000445079da1e1ee7416937485e9ea7c965373d1d6683c270383b3d0ed3d36ff71c949e83c22072799e9687c5ec32a81d96afcbf4b4fb0c7ac3e9e9b7db05 +- DTAP --RAN_GERAN_A--> MS: GSM48_PDISC_SMS:0x01: 09015801000791447758100650004c0005802443f2000007101000000000445079da1e1ee7416937485e9ea7c965373d1d6683c270383b3d0ed3d36ff71c949e83c22072799e9687c5ec32a81d96afcbf4b4fb0c7ac3e9e9b7db05 - DTAP matches expected message DREF VLR subscr MSISDN:42342 usage decreases to: 4 DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_BUMP @@ -1899,9 +1899,9 @@ - conn is still open to wait for SMS ack dance llist_count(&net->subscr_conns) == 1 - MS replies with CP-ACK for received SMS - rx from MS: pdisc=0x89 msg_type=0x04 + MSC <--RAN_GERAN_A-- MS: GSM48_PDISC_SMS:0x04 DREF MSISDN:42342: MSC conn use + 1 == 3 -DRLL Dispatching 04.08 message, pdisc=9 +DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x04 (0x9:0x4) DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_COMMUNICATING DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_ACCEPTED}: state_chg to SUBSCR_CONN_S_COMMUNICATING DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_COMMUNICATING}: Received Event SUBSCR_CONN_E_BUMP @@ -1909,12 +1909,12 @@ DREF MSISDN:42342: MSC conn use - 1 == 2 llist_count(&net->subscr_conns) == 1 - MS also sends RP-ACK, MSC in turn sends CP-ACK for that - rx from MS: pdisc=0x89 msg_type=0x01 + MSC <--RAN_GERAN_A-- MS: GSM48_PDISC_SMS:0x01 DREF MSISDN:42342: MSC conn use + 1 == 3 -DRLL Dispatching 04.08 message, pdisc=9 +DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_COMMUNICATING}: Received Event SUBSCR_CONN_E_COMMUNICATING DMSC msc_tx 2 bytes to MSISDN:42342 via RAN_GERAN_A -- DTAP --RAN_GERAN_A--> MS: 0904 +- DTAP --RAN_GERAN_A--> MS: GSM48_PDISC_SMS:0x04: 0904 - DTAP matches expected message DREF VLR subscr MSISDN:42342 usage decreases to: 3 DREF VLR subscr MSISDN:42342 usage decreases to: 2 @@ -1939,10 +1939,10 @@ llist_count(&net->subscr_conns) == 0 --- - subscriber detaches - rx from MS: pdisc=0x05 msg_type=0x01 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_IMSI_DETACH_IND new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_IMSI_DETACH_IND (0x5:0x1) DMM IMSI DETACH INDICATION: MI(IMSI)=901700000010650 DREF VLR subscr MSISDN:42342 usage increases to: 2 DMM IMSI DETACH for MSISDN:42342 diff --git a/tests/msc_vlr/msc_vlr_test_gsm_ciph.err b/tests/msc_vlr/msc_vlr_test_gsm_ciph.err index daa2c65..bd8d1b9 100644 --- a/tests/msc_vlr/msc_vlr_test_gsm_ciph.err +++ b/tests/msc_vlr/msc_vlr_test_gsm_ciph.err @@ -1,9 +1,9 @@ ===== test_ciph - Location Update request causes a GSUP Send Auth Info request to HLR - rx from MS: pdisc=0x05 msg_type=0x08 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_LOC_UPD_REQUEST new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_LOC_UPD_REQUEST (0x5:0x8) DREF unknown: MSC conn use + 1 == 2 DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Allocated DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Received Event SUBSCR_CONN_E_START @@ -46,9 +46,9 @@ lu_result_sent == 0 auth_request_sent == 1 - MS sends Authen Response, VLR accepts and sends Ciphering Mode Command to MS - rx from MS: pdisc=0x05 msg_type=0x54 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_AUTH_RESP DREF IMSI:901700000004620: MSC conn use + 1 == 2 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_AUTH_RESP (0x5:0x14) DMM IMSI:901700000004620: MM GSM AUTHENTICATION RESPONSE (sres = 2d8b2c3e) DVLR VLR_Authenticate(901700000004620){VLR_SUB_AS_WAIT_RESP}: Received Event VLR_AUTH_E_MS_AUTH_RESP DVLR SUBSCR(IMSI:901700000004620) received res: 2d 8b 2c 3e @@ -69,17 +69,17 @@ - needs ciph, not yet accepted msc_subscr_conn_is_accepted() == false requests shall be thwarted -DRLL Dispatching 04.08 message, pdisc=3 -DRLL subscr IMSI:901700000004620: Message not permitted for initial conn: pdisc=0x03 msg_type=0x05 -DRLL Dispatching 04.08 message, pdisc=5 -DRLL subscr IMSI:901700000004620: Message not permitted for initial conn: pdisc=0x05 msg_type=0x33 -DRLL Dispatching 04.08 message, pdisc=6 -DRLL subscr IMSI:901700000004620: Message not permitted for initial conn: pdisc=0x06 msg_type=0x19 -DRLL Dispatching 04.08 message, pdisc=9 -DRLL subscr IMSI:901700000004620: Message not permitted for initial conn: pdisc=0x09 msg_type=0x01 +DRLL Dispatching 04.08 message GSM48_MT_CC_SETUP (0x3:0x5) +DRLL subscr IMSI:901700000004620: Message not permitted for initial conn: GSM48_MT_CC_SETUP +DRLL Dispatching 04.08 message unknown 0x33 (0x5:0x33) +DRLL subscr IMSI:901700000004620: Message not permitted for initial conn: unknown 0x33 +DRLL Dispatching 04.08 message GSM48_MT_RR_SYSINFO_1 (0x6:0x19) +DRLL subscr IMSI:901700000004620: Message not permitted for initial conn: GSM48_MT_RR_SYSINFO_1 +DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) +DRLL subscr IMSI:901700000004620: Message not permitted for initial conn: GSM48_PDISC_SMS:0x01 lu_result_sent == 0 - MS sends Ciphering Mode Complete, VLR accepts and sends GSUP LU Req to HLR - rx from MS: pdisc=0x06 msg_type=0x32 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_RR_CIPH_M_COMPL DRR IMSI:901700000004620: CIPHERING MODE COMPLETE DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_WAIT_CIPH}: Received Event VLR_ULA_E_CIPH_RES DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_WAIT_CIPH}: vlr_loc_upd_post_ciph() @@ -162,10 +162,10 @@ llist_count(&net->subscr_conns) == 0 --- - after a while, a new conn sends a CM Service Request. VLR responds with Auth Req, 2nd auth vector - rx from MS: pdisc=0x05 msg_type=0x24 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_CM_SERV_REQ new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_CM_SERV_REQ (0x5:0x24) DMM <- CM SERVICE REQUEST serv_type=0x08 MI(IMSI)=901700000004620 DREF unknown: MSC conn use + 1 == 2 DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Allocated @@ -195,18 +195,18 @@ - needs auth, not yet accepted msc_subscr_conn_is_accepted() == false requests shall be thwarted -DRLL Dispatching 04.08 message, pdisc=3 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x03 msg_type=0x05 -DRLL Dispatching 04.08 message, pdisc=5 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x05 msg_type=0x33 -DRLL Dispatching 04.08 message, pdisc=6 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x06 msg_type=0x19 -DRLL Dispatching 04.08 message, pdisc=9 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x09 msg_type=0x01 +DRLL Dispatching 04.08 message GSM48_MT_CC_SETUP (0x3:0x5) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_MT_CC_SETUP +DRLL Dispatching 04.08 message unknown 0x33 (0x5:0x33) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: unknown 0x33 +DRLL Dispatching 04.08 message GSM48_MT_RR_SYSINFO_1 (0x6:0x19) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_MT_RR_SYSINFO_1 +DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_PDISC_SMS:0x01 - MS sends Authen Response, VLR accepts and requests Ciphering - rx from MS: pdisc=0x05 msg_type=0x54 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_AUTH_RESP DREF MSISDN:46071: MSC conn use + 1 == 2 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_AUTH_RESP (0x5:0x14) DMM MSISDN:46071: MM GSM AUTHENTICATION RESPONSE (sres = 20bde240) DVLR VLR_Authenticate(901700000004620){VLR_SUB_AS_WAIT_RESP}: Received Event VLR_AUTH_E_MS_AUTH_RESP DVLR SUBSCR(MSISDN:46071) received res: 20 bd e2 40 @@ -229,16 +229,16 @@ - needs ciph, not yet accepted msc_subscr_conn_is_accepted() == false requests shall be thwarted -DRLL Dispatching 04.08 message, pdisc=3 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x03 msg_type=0x05 -DRLL Dispatching 04.08 message, pdisc=5 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x05 msg_type=0x33 -DRLL Dispatching 04.08 message, pdisc=6 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x06 msg_type=0x19 -DRLL Dispatching 04.08 message, pdisc=9 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x09 msg_type=0x01 +DRLL Dispatching 04.08 message GSM48_MT_CC_SETUP (0x3:0x5) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_MT_CC_SETUP +DRLL Dispatching 04.08 message unknown 0x33 (0x5:0x33) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: unknown 0x33 +DRLL Dispatching 04.08 message GSM48_MT_RR_SYSINFO_1 (0x6:0x19) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_MT_RR_SYSINFO_1 +DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_PDISC_SMS:0x01 - MS sends Ciphering Mode Complete, VLR accepts; above Ciphering is an implicit CM Service Accept - rx from MS: pdisc=0x06 msg_type=0x32 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_RR_CIPH_M_COMPL DRR MSISDN:46071: CIPHERING MODE COMPLETE DVLR Process_Access_Request_VLR(901700000004620){PR_ARQ_S_WAIT_CIPH}: Received Event PR_ARQ_E_CIPH_RES DVLR Process_Access_Request_VLR(901700000004620){PR_ARQ_S_WAIT_CIPH}: _proc_arq_vlr_node2_post_ciph() @@ -259,16 +259,16 @@ - a USSD request is serviced expecting USSD: Your extension is 46071 - rx from MS: pdisc=0x0b msg_type=0x3b + MSC <--RAN_GERAN_A-- MS: GSM48_PDISC_NC_SS:0x3b DREF MSISDN:46071: MSC conn use + 1 == 2 -DRLL Dispatching 04.08 message, pdisc=11 -DMM MSISDN:46071 pdisc=11 msg_type=0x3b: received_cm_service_request changes to false +DRLL Dispatching 04.08 message GSM48_PDISC_NC_SS:0x3b (0xb:0x3b) +DMM MSISDN:46071: rx msg GSM48_PDISC_NC_SS:0x3b: received_cm_service_request changes to false DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_COMMUNICATING DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_ACCEPTED}: state_chg to SUBSCR_CONN_S_COMMUNICATING DMM USSD: Own number requested DMM MSISDN:46071: MSISDN = 46071 DMSC msc_tx 43 bytes to MSISDN:46071 via RAN_GERAN_A -- DTAP --RAN_GERAN_A--> MS: 8b2a1c27a225020100302002013b301b04010f0416d9775d0e2ae3e965f73cfd7683d27310cd06bbc51a0d +- DTAP --RAN_GERAN_A--> MS: GSM48_PDISC_NC_SS:0x2a: 8b2a1c27a225020100302002013b301b04010f0416d9775d0e2ae3e965f73cfd7683d27310cd06bbc51a0d - DTAP matches expected message DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_COMMUNICATING}: Received Event SUBSCR_CONN_E_BUMP DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_COMMUNICATING}: bump: releasing conn @@ -305,10 +305,10 @@ llist_count(&vsub->cs.requests) == 1 DREF VLR subscr MSISDN:46071 usage decreases to: 3 - MS replies with Paging Response, and VLR sends Auth Request with third key - rx from MS: pdisc=0x06 msg_type=0x27 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_RR_PAG_RESP new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=6 +DRLL Dispatching 04.08 message GSM48_MT_RR_PAG_RESP (0x6:0x27) DRR PAGING RESPONSE: MI(IMSI)=901700000004620 DREF unknown: MSC conn use + 1 == 2 DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Allocated @@ -337,18 +337,18 @@ - needs auth, not yet accepted msc_subscr_conn_is_accepted() == false requests shall be thwarted -DRLL Dispatching 04.08 message, pdisc=3 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x03 msg_type=0x05 -DRLL Dispatching 04.08 message, pdisc=5 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x05 msg_type=0x33 -DRLL Dispatching 04.08 message, pdisc=6 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x06 msg_type=0x19 -DRLL Dispatching 04.08 message, pdisc=9 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x09 msg_type=0x01 +DRLL Dispatching 04.08 message GSM48_MT_CC_SETUP (0x3:0x5) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_MT_CC_SETUP +DRLL Dispatching 04.08 message unknown 0x33 (0x5:0x33) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: unknown 0x33 +DRLL Dispatching 04.08 message GSM48_MT_RR_SYSINFO_1 (0x6:0x19) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_MT_RR_SYSINFO_1 +DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_PDISC_SMS:0x01 - MS sends Authen Response, VLR accepts and requests Ciphering - rx from MS: pdisc=0x05 msg_type=0x54 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_AUTH_RESP DREF MSISDN:46071: MSC conn use + 1 == 2 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_AUTH_RESP (0x5:0x14) DMM MSISDN:46071: MM GSM AUTHENTICATION RESPONSE (sres = a29514ae) DVLR VLR_Authenticate(901700000004620){VLR_SUB_AS_WAIT_RESP}: Received Event VLR_AUTH_E_MS_AUTH_RESP DVLR SUBSCR(MSISDN:46071) received res: a2 95 14 ae @@ -370,16 +370,16 @@ - needs ciph, not yet accepted msc_subscr_conn_is_accepted() == false requests shall be thwarted -DRLL Dispatching 04.08 message, pdisc=3 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x03 msg_type=0x05 -DRLL Dispatching 04.08 message, pdisc=5 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x05 msg_type=0x33 -DRLL Dispatching 04.08 message, pdisc=6 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x06 msg_type=0x19 -DRLL Dispatching 04.08 message, pdisc=9 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x09 msg_type=0x01 +DRLL Dispatching 04.08 message GSM48_MT_CC_SETUP (0x3:0x5) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_MT_CC_SETUP +DRLL Dispatching 04.08 message unknown 0x33 (0x5:0x33) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: unknown 0x33 +DRLL Dispatching 04.08 message GSM48_MT_RR_SYSINFO_1 (0x6:0x19) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_MT_RR_SYSINFO_1 +DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_PDISC_SMS:0x01 - MS sends Ciphering Mode Complete, VLR accepts and sends pending SMS - rx from MS: pdisc=0x06 msg_type=0x32 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_RR_CIPH_M_COMPL DRR MSISDN:46071: CIPHERING MODE COMPLETE DVLR Process_Access_Request_VLR(901700000004620){PR_ARQ_S_WAIT_CIPH}: Received Event PR_ARQ_E_CIPH_RES DVLR Process_Access_Request_VLR(901700000004620){PR_ARQ_S_WAIT_CIPH}: _proc_arq_vlr_node2_post_ciph() @@ -398,7 +398,7 @@ DREF VLR subscr MSISDN:46071 usage increases to: 5 DREF MSISDN:46071: MSC conn use + 1 == 2 DMSC msc_tx 91 bytes to MSISDN:46071 via RAN_GERAN_A -- DTAP --RAN_GERAN_A--> MS: 09015801000791447758100650004c0005806470f1000007101000000000445079da1e1ee7416937485e9ea7c965373d1d6683c270383b3d0ed3d36ff71c949e83c22072799e9687c5ec32a81d96afcbf4b4fb0c7ac3e9e9b7db05 +- DTAP --RAN_GERAN_A--> MS: GSM48_PDISC_SMS:0x01: 09015801000791447758100650004c0005806470f1000007101000000000445079da1e1ee7416937485e9ea7c965373d1d6683c270383b3d0ed3d36ff71c949e83c22072799e9687c5ec32a81d96afcbf4b4fb0c7ac3e9e9b7db05 - DTAP matches expected message DREF VLR subscr MSISDN:46071 usage decreases to: 4 DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_BUMP @@ -412,9 +412,9 @@ - conn is still open to wait for SMS ack dance llist_count(&net->subscr_conns) == 1 - MS replies with CP-ACK for received SMS - rx from MS: pdisc=0x89 msg_type=0x04 + MSC <--RAN_GERAN_A-- MS: GSM48_PDISC_SMS:0x04 DREF MSISDN:46071: MSC conn use + 1 == 3 -DRLL Dispatching 04.08 message, pdisc=9 +DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x04 (0x9:0x4) DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_COMMUNICATING DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_ACCEPTED}: state_chg to SUBSCR_CONN_S_COMMUNICATING DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_COMMUNICATING}: Received Event SUBSCR_CONN_E_BUMP @@ -422,12 +422,12 @@ DREF MSISDN:46071: MSC conn use - 1 == 2 llist_count(&net->subscr_conns) == 1 - MS also sends RP-ACK, MSC in turn sends CP-ACK for that - rx from MS: pdisc=0x89 msg_type=0x01 + MSC <--RAN_GERAN_A-- MS: GSM48_PDISC_SMS:0x01 DREF MSISDN:46071: MSC conn use + 1 == 3 -DRLL Dispatching 04.08 message, pdisc=9 +DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_COMMUNICATING}: Received Event SUBSCR_CONN_E_COMMUNICATING DMSC msc_tx 2 bytes to MSISDN:46071 via RAN_GERAN_A -- DTAP --RAN_GERAN_A--> MS: 0904 +- DTAP --RAN_GERAN_A--> MS: GSM48_PDISC_SMS:0x04: 0904 - DTAP matches expected message DREF VLR subscr MSISDN:46071 usage decreases to: 3 DREF VLR subscr MSISDN:46071 usage decreases to: 2 @@ -452,10 +452,10 @@ llist_count(&net->subscr_conns) == 0 --- - subscriber detaches - rx from MS: pdisc=0x05 msg_type=0x01 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_IMSI_DETACH_IND new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_IMSI_DETACH_IND (0x5:0x1) DMM IMSI DETACH INDICATION: MI(IMSI)=901700000004620 DREF VLR subscr MSISDN:46071 usage increases to: 2 DMM IMSI DETACH for MSISDN:46071 @@ -473,10 +473,10 @@ ===== test_ciph_tmsi - Location Update request causes a GSUP Send Auth Info request to HLR - rx from MS: pdisc=0x05 msg_type=0x08 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_LOC_UPD_REQUEST new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_LOC_UPD_REQUEST (0x5:0x8) DREF unknown: MSC conn use + 1 == 2 DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Allocated DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Received Event SUBSCR_CONN_E_START @@ -519,9 +519,9 @@ auth_request_sent == 1 lu_result_sent == 0 - MS sends Authen Response, VLR accepts and sends Ciphering Mode Command to MS - rx from MS: pdisc=0x05 msg_type=0x54 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_AUTH_RESP DREF IMSI:901700000004620: MSC conn use + 1 == 2 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_AUTH_RESP (0x5:0x14) DMM IMSI:901700000004620: MM GSM AUTHENTICATION RESPONSE (sres = 2d8b2c3e) DVLR VLR_Authenticate(901700000004620){VLR_SUB_AS_WAIT_RESP}: Received Event VLR_AUTH_E_MS_AUTH_RESP DVLR SUBSCR(IMSI:901700000004620) received res: 2d 8b 2c 3e @@ -543,17 +543,17 @@ - needs ciph, not yet accepted msc_subscr_conn_is_accepted() == false requests shall be thwarted -DRLL Dispatching 04.08 message, pdisc=3 -DRLL subscr IMSI:901700000004620: Message not permitted for initial conn: pdisc=0x03 msg_type=0x05 -DRLL Dispatching 04.08 message, pdisc=5 -DRLL subscr IMSI:901700000004620: Message not permitted for initial conn: pdisc=0x05 msg_type=0x33 -DRLL Dispatching 04.08 message, pdisc=6 -DRLL subscr IMSI:901700000004620: Message not permitted for initial conn: pdisc=0x06 msg_type=0x19 -DRLL Dispatching 04.08 message, pdisc=9 -DRLL subscr IMSI:901700000004620: Message not permitted for initial conn: pdisc=0x09 msg_type=0x01 +DRLL Dispatching 04.08 message GSM48_MT_CC_SETUP (0x3:0x5) +DRLL subscr IMSI:901700000004620: Message not permitted for initial conn: GSM48_MT_CC_SETUP +DRLL Dispatching 04.08 message unknown 0x33 (0x5:0x33) +DRLL subscr IMSI:901700000004620: Message not permitted for initial conn: unknown 0x33 +DRLL Dispatching 04.08 message GSM48_MT_RR_SYSINFO_1 (0x6:0x19) +DRLL subscr IMSI:901700000004620: Message not permitted for initial conn: GSM48_MT_RR_SYSINFO_1 +DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) +DRLL subscr IMSI:901700000004620: Message not permitted for initial conn: GSM48_PDISC_SMS:0x01 lu_result_sent == 0 - MS sends Ciphering Mode Complete, VLR accepts and sends GSUP LU Req to HLR - rx from MS: pdisc=0x06 msg_type=0x32 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_RR_CIPH_M_COMPL DRR IMSI:901700000004620: CIPHERING MODE COMPLETE DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_WAIT_CIPH}: Received Event VLR_ULA_E_CIPH_RES DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_WAIT_CIPH}: vlr_loc_upd_post_ciph() @@ -612,14 +612,14 @@ lu_result_sent == 1 msc_subscr_conn_is_accepted() == false requests shall be thwarted -DRLL Dispatching 04.08 message, pdisc=3 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x03 msg_type=0x05 -DRLL Dispatching 04.08 message, pdisc=5 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x05 msg_type=0x33 -DRLL Dispatching 04.08 message, pdisc=6 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x06 msg_type=0x19 -DRLL Dispatching 04.08 message, pdisc=9 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x09 msg_type=0x01 +DRLL Dispatching 04.08 message GSM48_MT_CC_SETUP (0x3:0x5) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_MT_CC_SETUP +DRLL Dispatching 04.08 message unknown 0x33 (0x5:0x33) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: unknown 0x33 +DRLL Dispatching 04.08 message GSM48_MT_RR_SYSINFO_1 (0x6:0x19) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_MT_RR_SYSINFO_1 +DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_PDISC_SMS:0x01 - even though the TMSI is not acked, we can already find the subscr with it DREF VLR subscr MSISDN:46071 usage increases to: 2 vsub != NULL == 1 @@ -628,9 +628,9 @@ vsub->tmsi == 0xffffffff DREF VLR subscr MSISDN:46071 usage decreases to: 1 - MS sends TMSI Realloc Complete - rx from MS: pdisc=0x05 msg_type=0x5b + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_TMSI_REALL_COMPL DREF MSISDN:46071: MSC conn use + 1 == 2 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_TMSI_REALL_COMPL (0x5:0x1b) DMM TMSI Reallocation Completed. Subscriber: MSISDN:46071 DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_WAIT_LU_COMPL}: Received Event VLR_ULA_E_NEW_TMSI_ACK DVLR lu_compl_vlr_fsm(901700000004620){LU_COMPL_VLR_S_WAIT_TMSI_CNF}: Received Event LU_COMPL_VLR_E_NEW_TMSI_ACK @@ -672,10 +672,10 @@ DREF VLR subscr MSISDN:46071 usage decreases to: 1 --- - after a while, a new conn sends a CM Service Request using above TMSI. VLR responds with Auth Req, 2nd auth vector - rx from MS: pdisc=0x05 msg_type=0x24 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_CM_SERV_REQ new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_CM_SERV_REQ (0x5:0x24) DMM <- CM SERVICE REQUEST serv_type=0x08 MI(TMSI)=50462976 DREF unknown: MSC conn use + 1 == 2 DMM Subscr_Conn(50462976){SUBSCR_CONN_S_INIT}: Allocated @@ -705,18 +705,18 @@ - needs auth, not yet accepted msc_subscr_conn_is_accepted() == false requests shall be thwarted -DRLL Dispatching 04.08 message, pdisc=3 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x03 msg_type=0x05 -DRLL Dispatching 04.08 message, pdisc=5 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x05 msg_type=0x33 -DRLL Dispatching 04.08 message, pdisc=6 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x06 msg_type=0x19 -DRLL Dispatching 04.08 message, pdisc=9 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x09 msg_type=0x01 +DRLL Dispatching 04.08 message GSM48_MT_CC_SETUP (0x3:0x5) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_MT_CC_SETUP +DRLL Dispatching 04.08 message unknown 0x33 (0x5:0x33) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: unknown 0x33 +DRLL Dispatching 04.08 message GSM48_MT_RR_SYSINFO_1 (0x6:0x19) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_MT_RR_SYSINFO_1 +DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_PDISC_SMS:0x01 - MS sends Authen Response, VLR accepts and requests Ciphering - rx from MS: pdisc=0x05 msg_type=0x54 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_AUTH_RESP DREF MSISDN:46071: MSC conn use + 1 == 2 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_AUTH_RESP (0x5:0x14) DMM MSISDN:46071: MM GSM AUTHENTICATION RESPONSE (sres = 20bde240) DVLR VLR_Authenticate(50462976){VLR_SUB_AS_WAIT_RESP}: Received Event VLR_AUTH_E_MS_AUTH_RESP DVLR SUBSCR(MSISDN:46071) received res: 20 bd e2 40 @@ -739,16 +739,16 @@ - needs ciph, not yet accepted msc_subscr_conn_is_accepted() == false requests shall be thwarted -DRLL Dispatching 04.08 message, pdisc=3 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x03 msg_type=0x05 -DRLL Dispatching 04.08 message, pdisc=5 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x05 msg_type=0x33 -DRLL Dispatching 04.08 message, pdisc=6 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x06 msg_type=0x19 -DRLL Dispatching 04.08 message, pdisc=9 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x09 msg_type=0x01 +DRLL Dispatching 04.08 message GSM48_MT_CC_SETUP (0x3:0x5) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_MT_CC_SETUP +DRLL Dispatching 04.08 message unknown 0x33 (0x5:0x33) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: unknown 0x33 +DRLL Dispatching 04.08 message GSM48_MT_RR_SYSINFO_1 (0x6:0x19) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_MT_RR_SYSINFO_1 +DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_PDISC_SMS:0x01 - MS sends Ciphering Mode Complete, VLR accepts; above Ciphering is an implicit CM Service Accept - rx from MS: pdisc=0x06 msg_type=0x32 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_RR_CIPH_M_COMPL DRR MSISDN:46071: CIPHERING MODE COMPLETE DVLR Process_Access_Request_VLR(50462976){PR_ARQ_S_WAIT_CIPH}: Received Event PR_ARQ_E_CIPH_RES DVLR Process_Access_Request_VLR(50462976){PR_ARQ_S_WAIT_CIPH}: _proc_arq_vlr_node2_post_ciph() @@ -769,16 +769,16 @@ - a USSD request is serviced expecting USSD: Your extension is 46071 - rx from MS: pdisc=0x0b msg_type=0x3b + MSC <--RAN_GERAN_A-- MS: GSM48_PDISC_NC_SS:0x3b DREF MSISDN:46071: MSC conn use + 1 == 2 -DRLL Dispatching 04.08 message, pdisc=11 -DMM MSISDN:46071 pdisc=11 msg_type=0x3b: received_cm_service_request changes to false +DRLL Dispatching 04.08 message GSM48_PDISC_NC_SS:0x3b (0xb:0x3b) +DMM MSISDN:46071: rx msg GSM48_PDISC_NC_SS:0x3b: received_cm_service_request changes to false DMM Subscr_Conn(50462976){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_COMMUNICATING DMM Subscr_Conn(50462976){SUBSCR_CONN_S_ACCEPTED}: state_chg to SUBSCR_CONN_S_COMMUNICATING DMM USSD: Own number requested DMM MSISDN:46071: MSISDN = 46071 DMSC msc_tx 43 bytes to MSISDN:46071 via RAN_GERAN_A -- DTAP --RAN_GERAN_A--> MS: 8b2a1c27a225020100302002013b301b04010f0416d9775d0e2ae3e965f73cfd7683d27310cd06bbc51a0d +- DTAP --RAN_GERAN_A--> MS: GSM48_PDISC_NC_SS:0x2a: 8b2a1c27a225020100302002013b301b04010f0416d9775d0e2ae3e965f73cfd7683d27310cd06bbc51a0d - DTAP matches expected message DMM Subscr_Conn(50462976){SUBSCR_CONN_S_COMMUNICATING}: Received Event SUBSCR_CONN_E_BUMP DMM Subscr_Conn(50462976){SUBSCR_CONN_S_COMMUNICATING}: bump: releasing conn @@ -815,10 +815,10 @@ llist_count(&vsub->cs.requests) == 1 DREF VLR subscr MSISDN:46071 usage decreases to: 3 - MS replies with Paging Response using TMSI, and VLR sends Auth Request with third key - rx from MS: pdisc=0x06 msg_type=0x27 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_RR_PAG_RESP new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=6 +DRLL Dispatching 04.08 message GSM48_MT_RR_PAG_RESP (0x6:0x27) DRR PAGING RESPONSE: MI(TMSI)=50462976 DREF unknown: MSC conn use + 1 == 2 DMM Subscr_Conn(50462976){SUBSCR_CONN_S_INIT}: Allocated @@ -847,18 +847,18 @@ - needs auth, not yet accepted msc_subscr_conn_is_accepted() == false requests shall be thwarted -DRLL Dispatching 04.08 message, pdisc=3 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x03 msg_type=0x05 -DRLL Dispatching 04.08 message, pdisc=5 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x05 msg_type=0x33 -DRLL Dispatching 04.08 message, pdisc=6 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x06 msg_type=0x19 -DRLL Dispatching 04.08 message, pdisc=9 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x09 msg_type=0x01 +DRLL Dispatching 04.08 message GSM48_MT_CC_SETUP (0x3:0x5) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_MT_CC_SETUP +DRLL Dispatching 04.08 message unknown 0x33 (0x5:0x33) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: unknown 0x33 +DRLL Dispatching 04.08 message GSM48_MT_RR_SYSINFO_1 (0x6:0x19) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_MT_RR_SYSINFO_1 +DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_PDISC_SMS:0x01 - MS sends Authen Response, VLR accepts and requests Ciphering - rx from MS: pdisc=0x05 msg_type=0x54 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_AUTH_RESP DREF MSISDN:46071: MSC conn use + 1 == 2 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_AUTH_RESP (0x5:0x14) DMM MSISDN:46071: MM GSM AUTHENTICATION RESPONSE (sres = a29514ae) DVLR VLR_Authenticate(50462976){VLR_SUB_AS_WAIT_RESP}: Received Event VLR_AUTH_E_MS_AUTH_RESP DVLR SUBSCR(MSISDN:46071) received res: a2 95 14 ae @@ -880,16 +880,16 @@ - needs ciph, not yet accepted msc_subscr_conn_is_accepted() == false requests shall be thwarted -DRLL Dispatching 04.08 message, pdisc=3 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x03 msg_type=0x05 -DRLL Dispatching 04.08 message, pdisc=5 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x05 msg_type=0x33 -DRLL Dispatching 04.08 message, pdisc=6 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x06 msg_type=0x19 -DRLL Dispatching 04.08 message, pdisc=9 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x09 msg_type=0x01 +DRLL Dispatching 04.08 message GSM48_MT_CC_SETUP (0x3:0x5) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_MT_CC_SETUP +DRLL Dispatching 04.08 message unknown 0x33 (0x5:0x33) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: unknown 0x33 +DRLL Dispatching 04.08 message GSM48_MT_RR_SYSINFO_1 (0x6:0x19) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_MT_RR_SYSINFO_1 +DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_PDISC_SMS:0x01 - MS sends Ciphering Mode Complete, VLR accepts and sends pending SMS - rx from MS: pdisc=0x06 msg_type=0x32 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_RR_CIPH_M_COMPL DRR MSISDN:46071: CIPHERING MODE COMPLETE DVLR Process_Access_Request_VLR(50462976){PR_ARQ_S_WAIT_CIPH}: Received Event PR_ARQ_E_CIPH_RES DVLR Process_Access_Request_VLR(50462976){PR_ARQ_S_WAIT_CIPH}: _proc_arq_vlr_node2_post_ciph() @@ -908,7 +908,7 @@ DREF VLR subscr MSISDN:46071 usage increases to: 5 DREF MSISDN:46071: MSC conn use + 1 == 2 DMSC msc_tx 91 bytes to MSISDN:46071 via RAN_GERAN_A -- DTAP --RAN_GERAN_A--> MS: 09015801000791447758100650004c0005806470f1000007101000000000445079da1e1ee7416937485e9ea7c965373d1d6683c270383b3d0ed3d36ff71c949e83c22072799e9687c5ec32a81d96afcbf4b4fb0c7ac3e9e9b7db05 +- DTAP --RAN_GERAN_A--> MS: GSM48_PDISC_SMS:0x01: 09015801000791447758100650004c0005806470f1000007101000000000445079da1e1ee7416937485e9ea7c965373d1d6683c270383b3d0ed3d36ff71c949e83c22072799e9687c5ec32a81d96afcbf4b4fb0c7ac3e9e9b7db05 - DTAP matches expected message DREF VLR subscr MSISDN:46071 usage decreases to: 4 DMM Subscr_Conn(50462976){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_BUMP @@ -922,9 +922,9 @@ - conn is still open to wait for SMS ack dance llist_count(&net->subscr_conns) == 1 - MS replies with CP-ACK for received SMS - rx from MS: pdisc=0x89 msg_type=0x04 + MSC <--RAN_GERAN_A-- MS: GSM48_PDISC_SMS:0x04 DREF MSISDN:46071: MSC conn use + 1 == 3 -DRLL Dispatching 04.08 message, pdisc=9 +DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x04 (0x9:0x4) DMM Subscr_Conn(50462976){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_COMMUNICATING DMM Subscr_Conn(50462976){SUBSCR_CONN_S_ACCEPTED}: state_chg to SUBSCR_CONN_S_COMMUNICATING DMM Subscr_Conn(50462976){SUBSCR_CONN_S_COMMUNICATING}: Received Event SUBSCR_CONN_E_BUMP @@ -932,12 +932,12 @@ DREF MSISDN:46071: MSC conn use - 1 == 2 llist_count(&net->subscr_conns) == 1 - MS also sends RP-ACK, MSC in turn sends CP-ACK for that - rx from MS: pdisc=0x89 msg_type=0x01 + MSC <--RAN_GERAN_A-- MS: GSM48_PDISC_SMS:0x01 DREF MSISDN:46071: MSC conn use + 1 == 3 -DRLL Dispatching 04.08 message, pdisc=9 +DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) DMM Subscr_Conn(50462976){SUBSCR_CONN_S_COMMUNICATING}: Received Event SUBSCR_CONN_E_COMMUNICATING DMSC msc_tx 2 bytes to MSISDN:46071 via RAN_GERAN_A -- DTAP --RAN_GERAN_A--> MS: 0904 +- DTAP --RAN_GERAN_A--> MS: GSM48_PDISC_SMS:0x04: 0904 - DTAP matches expected message DREF VLR subscr MSISDN:46071 usage decreases to: 3 DREF VLR subscr MSISDN:46071 usage decreases to: 2 @@ -962,10 +962,10 @@ llist_count(&net->subscr_conns) == 0 --- - subscriber detaches, using TMSI - rx from MS: pdisc=0x05 msg_type=0x01 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_IMSI_DETACH_IND new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_IMSI_DETACH_IND (0x5:0x1) DMM IMSI DETACH INDICATION: MI(TMSI)=50462976 DREF VLR subscr MSISDN:46071 usage increases to: 2 DMM IMSI DETACH for MSISDN:46071 @@ -983,10 +983,10 @@ ===== test_ciph_imei - Location Update request causes a GSUP Send Auth Info request to HLR - rx from MS: pdisc=0x05 msg_type=0x08 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_LOC_UPD_REQUEST new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_LOC_UPD_REQUEST (0x5:0x8) DREF unknown: MSC conn use + 1 == 2 DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Allocated DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Received Event SUBSCR_CONN_E_START @@ -1029,9 +1029,9 @@ auth_request_sent == 1 lu_result_sent == 0 - MS sends Authen Response, VLR accepts and sends Ciphering Mode Command to MS - rx from MS: pdisc=0x05 msg_type=0x54 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_AUTH_RESP DREF IMSI:901700000004620: MSC conn use + 1 == 2 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_AUTH_RESP (0x5:0x14) DMM IMSI:901700000004620: MM GSM AUTHENTICATION RESPONSE (sres = 2d8b2c3e) DVLR VLR_Authenticate(901700000004620){VLR_SUB_AS_WAIT_RESP}: Received Event VLR_AUTH_E_MS_AUTH_RESP DVLR SUBSCR(IMSI:901700000004620) received res: 2d 8b 2c 3e @@ -1052,17 +1052,17 @@ - needs ciph, not yet accepted msc_subscr_conn_is_accepted() == false requests shall be thwarted -DRLL Dispatching 04.08 message, pdisc=3 -DRLL subscr IMSI:901700000004620: Message not permitted for initial conn: pdisc=0x03 msg_type=0x05 -DRLL Dispatching 04.08 message, pdisc=5 -DRLL subscr IMSI:901700000004620: Message not permitted for initial conn: pdisc=0x05 msg_type=0x33 -DRLL Dispatching 04.08 message, pdisc=6 -DRLL subscr IMSI:901700000004620: Message not permitted for initial conn: pdisc=0x06 msg_type=0x19 -DRLL Dispatching 04.08 message, pdisc=9 -DRLL subscr IMSI:901700000004620: Message not permitted for initial conn: pdisc=0x09 msg_type=0x01 +DRLL Dispatching 04.08 message GSM48_MT_CC_SETUP (0x3:0x5) +DRLL subscr IMSI:901700000004620: Message not permitted for initial conn: GSM48_MT_CC_SETUP +DRLL Dispatching 04.08 message unknown 0x33 (0x5:0x33) +DRLL subscr IMSI:901700000004620: Message not permitted for initial conn: unknown 0x33 +DRLL Dispatching 04.08 message GSM48_MT_RR_SYSINFO_1 (0x6:0x19) +DRLL subscr IMSI:901700000004620: Message not permitted for initial conn: GSM48_MT_RR_SYSINFO_1 +DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) +DRLL subscr IMSI:901700000004620: Message not permitted for initial conn: GSM48_PDISC_SMS:0x01 lu_result_sent == 0 - MS sends Ciphering Mode Complete, VLR accepts and sends GSUP LU Req to HLR - rx from MS: pdisc=0x06 msg_type=0x32 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_RR_CIPH_M_COMPL DRR IMSI:901700000004620: CIPHERING MODE COMPLETE DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_WAIT_CIPH}: Received Event VLR_ULA_E_CIPH_RES DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_WAIT_CIPH}: vlr_loc_upd_post_ciph() @@ -1113,7 +1113,7 @@ DVLR lu_compl_vlr_fsm(901700000004620){LU_COMPL_VLR_S_WAIT_SUB_PRES}: Received Event LU_COMPL_VLR_E_SUB_PRES_COMPL DVLR lu_compl_vlr_fsm(901700000004620){LU_COMPL_VLR_S_WAIT_SUB_PRES}: state_chg to LU_COMPL_VLR_S_WAIT_IMEI DMSC msc_tx 3 bytes to MSISDN:46071 via RAN_GERAN_A -- DTAP --RAN_GERAN_A--> MS: 051802 +- DTAP --RAN_GERAN_A--> MS: GSM48_MT_MM_ID_REQ: 051802 - DTAP matches expected message DREF VLR subscr MSISDN:46071 usage decreases to: 1 <-- GSUP rx OSMO_GSUP_MSGT_UPDATE_LOCATION_RESULT: vlr_gsupc_read_cb() returns 0 @@ -1124,18 +1124,18 @@ DREF VLR subscr MSISDN:46071 usage decreases to: 1 msc_subscr_conn_is_accepted() == false requests shall be thwarted -DRLL Dispatching 04.08 message, pdisc=3 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x03 msg_type=0x05 -DRLL Dispatching 04.08 message, pdisc=5 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x05 msg_type=0x33 -DRLL Dispatching 04.08 message, pdisc=6 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x06 msg_type=0x19 -DRLL Dispatching 04.08 message, pdisc=9 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x09 msg_type=0x01 +DRLL Dispatching 04.08 message GSM48_MT_CC_SETUP (0x3:0x5) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_MT_CC_SETUP +DRLL Dispatching 04.08 message unknown 0x33 (0x5:0x33) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: unknown 0x33 +DRLL Dispatching 04.08 message GSM48_MT_RR_SYSINFO_1 (0x6:0x19) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_MT_RR_SYSINFO_1 +DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_PDISC_SMS:0x01 - MS replies with an Identity Response - rx from MS: pdisc=0x05 msg_type=0x59 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_ID_RESP DREF MSISDN:46071: MSC conn use + 1 == 2 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_ID_RESP (0x5:0x19) DMM IDENTITY RESPONSE: MI(IMEI)=423423423423423 DVLR set IMEI on subscriber; IMSI=901700000004620 IMEI=423423423423423 DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_WAIT_LU_COMPL}: Received Event VLR_ULA_E_ID_IMEI @@ -1177,10 +1177,10 @@ DREF VLR subscr MSISDN:46071 usage decreases to: 1 --- - subscriber detaches - rx from MS: pdisc=0x05 msg_type=0x01 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_IMSI_DETACH_IND new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_IMSI_DETACH_IND (0x5:0x1) DMM IMSI DETACH INDICATION: MI(IMSI)=901700000004620 DREF VLR subscr MSISDN:46071 usage increases to: 2 DMM IMSI DETACH for MSISDN:46071 @@ -1198,10 +1198,10 @@ ===== test_ciph_imeisv - Location Update request causes a GSUP Send Auth Info request to HLR - rx from MS: pdisc=0x05 msg_type=0x08 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_LOC_UPD_REQUEST new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_LOC_UPD_REQUEST (0x5:0x8) DREF unknown: MSC conn use + 1 == 2 DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Allocated DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Received Event SUBSCR_CONN_E_START @@ -1244,9 +1244,9 @@ auth_request_sent == 1 lu_result_sent == 0 - MS sends Authen Response, VLR accepts and sends Ciphering Mode Command to MS - rx from MS: pdisc=0x05 msg_type=0x54 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_AUTH_RESP DREF IMSI:901700000004620: MSC conn use + 1 == 2 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_AUTH_RESP (0x5:0x14) DMM IMSI:901700000004620: MM GSM AUTHENTICATION RESPONSE (sres = 2d8b2c3e) DVLR VLR_Authenticate(901700000004620){VLR_SUB_AS_WAIT_RESP}: Received Event VLR_AUTH_E_MS_AUTH_RESP DVLR SUBSCR(IMSI:901700000004620) received res: 2d 8b 2c 3e @@ -1269,20 +1269,20 @@ - needs ciph, not yet accepted msc_subscr_conn_is_accepted() == false requests shall be thwarted -DRLL Dispatching 04.08 message, pdisc=3 -DRLL subscr IMSI:901700000004620: Message not permitted for initial conn: pdisc=0x03 msg_type=0x05 -DRLL Dispatching 04.08 message, pdisc=5 -DRLL subscr IMSI:901700000004620: Message not permitted for initial conn: pdisc=0x05 msg_type=0x33 -DRLL Dispatching 04.08 message, pdisc=6 -DRLL subscr IMSI:901700000004620: Message not permitted for initial conn: pdisc=0x06 msg_type=0x19 -DRLL Dispatching 04.08 message, pdisc=9 -DRLL subscr IMSI:901700000004620: Message not permitted for initial conn: pdisc=0x09 msg_type=0x01 +DRLL Dispatching 04.08 message GSM48_MT_CC_SETUP (0x3:0x5) +DRLL subscr IMSI:901700000004620: Message not permitted for initial conn: GSM48_MT_CC_SETUP +DRLL Dispatching 04.08 message unknown 0x33 (0x5:0x33) +DRLL subscr IMSI:901700000004620: Message not permitted for initial conn: unknown 0x33 +DRLL Dispatching 04.08 message GSM48_MT_RR_SYSINFO_1 (0x6:0x19) +DRLL subscr IMSI:901700000004620: Message not permitted for initial conn: GSM48_MT_RR_SYSINFO_1 +DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) +DRLL subscr IMSI:901700000004620: Message not permitted for initial conn: GSM48_PDISC_SMS:0x01 lu_result_sent == 0 DREF VLR subscr IMSI:901700000004620 usage increases to: 2 vsub->imeisv[0] == 0 DREF VLR subscr IMSI:901700000004620 usage decreases to: 1 - MS sends Ciphering Mode Complete with IMEISV, VLR accepts and sends GSUP LU Req to HLR - rx from MS: pdisc=0x06 msg_type=0x32 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_RR_CIPH_M_COMPL DRR IMSI:901700000004620: CIPHERING MODE COMPLETE DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_WAIT_CIPH}: Received Event VLR_ULA_E_CIPH_RES DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_WAIT_CIPH}: got IMEISV: 4234234234234235F @@ -1303,18 +1303,18 @@ DREF VLR subscr IMSI:901700000004620 usage decreases to: 1 msc_subscr_conn_is_accepted() == false requests shall be thwarted -DRLL Dispatching 04.08 message, pdisc=3 -DRLL subscr IMSI:901700000004620: Message not permitted for initial conn: pdisc=0x03 msg_type=0x05 -DRLL Dispatching 04.08 message, pdisc=5 -DRLL subscr IMSI:901700000004620: Message not permitted for initial conn: pdisc=0x05 msg_type=0x33 -DRLL Dispatching 04.08 message, pdisc=6 -DRLL subscr IMSI:901700000004620: Message not permitted for initial conn: pdisc=0x06 msg_type=0x19 -DRLL Dispatching 04.08 message, pdisc=9 -DRLL subscr IMSI:901700000004620: Message not permitted for initial conn: pdisc=0x09 msg_type=0x01 +DRLL Dispatching 04.08 message GSM48_MT_CC_SETUP (0x3:0x5) +DRLL subscr IMSI:901700000004620: Message not permitted for initial conn: GSM48_MT_CC_SETUP +DRLL Dispatching 04.08 message unknown 0x33 (0x5:0x33) +DRLL subscr IMSI:901700000004620: Message not permitted for initial conn: unknown 0x33 +DRLL Dispatching 04.08 message GSM48_MT_RR_SYSINFO_1 (0x6:0x19) +DRLL subscr IMSI:901700000004620: Message not permitted for initial conn: GSM48_MT_RR_SYSINFO_1 +DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) +DRLL subscr IMSI:901700000004620: Message not permitted for initial conn: GSM48_PDISC_SMS:0x01 - MS replies with an Identity Response - rx from MS: pdisc=0x05 msg_type=0x59 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_ID_RESP DREF IMSI:901700000004620: MSC conn use + 1 == 2 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_ID_RESP (0x5:0x19) DMM IDENTITY RESPONSE: MI(IMEI)=423423423423423 DVLR set IMEI on subscriber; IMSI=901700000004620 IMEI=423423423423423 DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_WAIT_HLR_UPD}: Received Event VLR_ULA_E_ID_IMEI @@ -1391,10 +1391,10 @@ llist_count(&net->subscr_conns) == 0 --- - subscriber detaches - rx from MS: pdisc=0x05 msg_type=0x01 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_IMSI_DETACH_IND new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_IMSI_DETACH_IND (0x5:0x1) DMM IMSI DETACH INDICATION: MI(IMSI)=901700000004620 DREF VLR subscr MSISDN:46071 usage increases to: 2 DMM IMSI DETACH for MSISDN:46071 @@ -1412,10 +1412,10 @@ ===== test_ciph_tmsi_imei - Location Update request causes a GSUP Send Auth Info request to HLR - rx from MS: pdisc=0x05 msg_type=0x08 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_LOC_UPD_REQUEST new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_LOC_UPD_REQUEST (0x5:0x8) DREF unknown: MSC conn use + 1 == 2 DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Allocated DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Received Event SUBSCR_CONN_E_START @@ -1458,9 +1458,9 @@ auth_request_sent == 1 lu_result_sent == 0 - MS sends Authen Response, VLR accepts and sends Ciphering Mode Command to MS - rx from MS: pdisc=0x05 msg_type=0x54 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_AUTH_RESP DREF IMSI:901700000004620: MSC conn use + 1 == 2 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_AUTH_RESP (0x5:0x14) DMM IMSI:901700000004620: MM GSM AUTHENTICATION RESPONSE (sres = 2d8b2c3e) DVLR VLR_Authenticate(901700000004620){VLR_SUB_AS_WAIT_RESP}: Received Event VLR_AUTH_E_MS_AUTH_RESP DVLR SUBSCR(IMSI:901700000004620) received res: 2d 8b 2c 3e @@ -1481,17 +1481,17 @@ - needs ciph, not yet accepted msc_subscr_conn_is_accepted() == false requests shall be thwarted -DRLL Dispatching 04.08 message, pdisc=3 -DRLL subscr IMSI:901700000004620: Message not permitted for initial conn: pdisc=0x03 msg_type=0x05 -DRLL Dispatching 04.08 message, pdisc=5 -DRLL subscr IMSI:901700000004620: Message not permitted for initial conn: pdisc=0x05 msg_type=0x33 -DRLL Dispatching 04.08 message, pdisc=6 -DRLL subscr IMSI:901700000004620: Message not permitted for initial conn: pdisc=0x06 msg_type=0x19 -DRLL Dispatching 04.08 message, pdisc=9 -DRLL subscr IMSI:901700000004620: Message not permitted for initial conn: pdisc=0x09 msg_type=0x01 +DRLL Dispatching 04.08 message GSM48_MT_CC_SETUP (0x3:0x5) +DRLL subscr IMSI:901700000004620: Message not permitted for initial conn: GSM48_MT_CC_SETUP +DRLL Dispatching 04.08 message unknown 0x33 (0x5:0x33) +DRLL subscr IMSI:901700000004620: Message not permitted for initial conn: unknown 0x33 +DRLL Dispatching 04.08 message GSM48_MT_RR_SYSINFO_1 (0x6:0x19) +DRLL subscr IMSI:901700000004620: Message not permitted for initial conn: GSM48_MT_RR_SYSINFO_1 +DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) +DRLL subscr IMSI:901700000004620: Message not permitted for initial conn: GSM48_PDISC_SMS:0x01 lu_result_sent == 0 - MS sends Ciphering Mode Complete, VLR accepts and sends GSUP LU Req to HLR - rx from MS: pdisc=0x06 msg_type=0x32 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_RR_CIPH_M_COMPL DRR IMSI:901700000004620: CIPHERING MODE COMPLETE DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_WAIT_CIPH}: Received Event VLR_ULA_E_CIPH_RES DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_WAIT_CIPH}: vlr_loc_upd_post_ciph() @@ -1542,7 +1542,7 @@ DVLR lu_compl_vlr_fsm(901700000004620){LU_COMPL_VLR_S_WAIT_SUB_PRES}: Received Event LU_COMPL_VLR_E_SUB_PRES_COMPL DVLR lu_compl_vlr_fsm(901700000004620){LU_COMPL_VLR_S_WAIT_SUB_PRES}: state_chg to LU_COMPL_VLR_S_WAIT_IMEI_TMSI DMSC msc_tx 3 bytes to MSISDN:46071 via RAN_GERAN_A -- DTAP --RAN_GERAN_A--> MS: 051802 +- DTAP --RAN_GERAN_A--> MS: GSM48_MT_MM_ID_REQ: 051802 - DTAP matches expected message DREF VLR subscr MSISDN:46071 usage decreases to: 1 <-- GSUP rx OSMO_GSUP_MSGT_UPDATE_LOCATION_RESULT: vlr_gsupc_read_cb() returns 0 @@ -1553,18 +1553,18 @@ DREF VLR subscr MSISDN:46071 usage decreases to: 1 msc_subscr_conn_is_accepted() == false requests shall be thwarted -DRLL Dispatching 04.08 message, pdisc=3 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x03 msg_type=0x05 -DRLL Dispatching 04.08 message, pdisc=5 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x05 msg_type=0x33 -DRLL Dispatching 04.08 message, pdisc=6 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x06 msg_type=0x19 -DRLL Dispatching 04.08 message, pdisc=9 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x09 msg_type=0x01 +DRLL Dispatching 04.08 message GSM48_MT_CC_SETUP (0x3:0x5) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_MT_CC_SETUP +DRLL Dispatching 04.08 message unknown 0x33 (0x5:0x33) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: unknown 0x33 +DRLL Dispatching 04.08 message GSM48_MT_RR_SYSINFO_1 (0x6:0x19) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_MT_RR_SYSINFO_1 +DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_PDISC_SMS:0x01 - MS replies with an Identity Response - rx from MS: pdisc=0x05 msg_type=0x59 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_ID_RESP DREF MSISDN:46071: MSC conn use + 1 == 2 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_ID_RESP (0x5:0x19) DMM IDENTITY RESPONSE: MI(IMEI)=423423423423423 DVLR set IMEI on subscriber; IMSI=901700000004620 IMEI=423423423423423 DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_WAIT_LU_COMPL}: Received Event VLR_ULA_E_ID_IMEI @@ -1579,14 +1579,14 @@ lu_result_sent == 1 msc_subscr_conn_is_accepted() == false requests shall be thwarted -DRLL Dispatching 04.08 message, pdisc=3 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x03 msg_type=0x05 -DRLL Dispatching 04.08 message, pdisc=5 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x05 msg_type=0x33 -DRLL Dispatching 04.08 message, pdisc=6 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x06 msg_type=0x19 -DRLL Dispatching 04.08 message, pdisc=9 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x09 msg_type=0x01 +DRLL Dispatching 04.08 message GSM48_MT_CC_SETUP (0x3:0x5) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_MT_CC_SETUP +DRLL Dispatching 04.08 message unknown 0x33 (0x5:0x33) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: unknown 0x33 +DRLL Dispatching 04.08 message GSM48_MT_RR_SYSINFO_1 (0x6:0x19) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_MT_RR_SYSINFO_1 +DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_PDISC_SMS:0x01 - even though the TMSI is not acked, we can already find the subscr with it DREF VLR subscr MSISDN:46071 usage increases to: 2 vsub != NULL == 1 @@ -1595,9 +1595,9 @@ vsub->tmsi == 0xffffffff DREF VLR subscr MSISDN:46071 usage decreases to: 1 - MS sends TMSI Realloc Complete - rx from MS: pdisc=0x05 msg_type=0x5b + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_TMSI_REALL_COMPL DREF MSISDN:46071: MSC conn use + 1 == 2 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_TMSI_REALL_COMPL (0x5:0x1b) DMM TMSI Reallocation Completed. Subscriber: MSISDN:46071 DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_WAIT_LU_COMPL}: Received Event VLR_ULA_E_NEW_TMSI_ACK DVLR lu_compl_vlr_fsm(901700000004620){LU_COMPL_VLR_S_WAIT_TMSI_CNF}: Received Event LU_COMPL_VLR_E_NEW_TMSI_ACK @@ -1637,10 +1637,10 @@ DREF VLR subscr MSISDN:46071 usage decreases to: 1 --- - subscriber detaches, using TMSI - rx from MS: pdisc=0x05 msg_type=0x01 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_IMSI_DETACH_IND new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_IMSI_DETACH_IND (0x5:0x1) DMM IMSI DETACH INDICATION: MI(TMSI)=50462976 DREF VLR subscr MSISDN:46071 usage increases to: 2 DMM IMSI DETACH for MSISDN:46071 diff --git a/tests/msc_vlr/msc_vlr_test_hlr_reject.err b/tests/msc_vlr/msc_vlr_test_hlr_reject.err index 4c566d1..9650df9 100644 --- a/tests/msc_vlr/msc_vlr_test_hlr_reject.err +++ b/tests/msc_vlr/msc_vlr_test_hlr_reject.err @@ -1,9 +1,9 @@ ===== test_hlr_rej_auth_info_unknown_imsi - Location Update request causes a GSUP Send Auth Info request to HLR - rx from MS: pdisc=0x05 msg_type=0x08 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_LOC_UPD_REQUEST new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_LOC_UPD_REQUEST (0x5:0x8) DREF unknown: MSC conn use + 1 == 2 DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Allocated DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Received Event SUBSCR_CONN_E_START @@ -74,10 +74,10 @@ ===== test_hlr_rej_auth_info_net_fail - Location Update request causes a GSUP Send Auth Info request to HLR - rx from MS: pdisc=0x05 msg_type=0x08 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_LOC_UPD_REQUEST new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_LOC_UPD_REQUEST (0x5:0x8) DREF unknown: MSC conn use + 1 == 2 DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Allocated DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Received Event SUBSCR_CONN_E_START @@ -150,10 +150,10 @@ --- - Submit a used auth tuple in the VLR - Location Update request causes a GSUP Send Auth Info request to HLR - rx from MS: pdisc=0x05 msg_type=0x08 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_LOC_UPD_REQUEST new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_LOC_UPD_REQUEST (0x5:0x8) DREF unknown: MSC conn use + 1 == 2 DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Allocated DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Received Event SUBSCR_CONN_E_START @@ -196,9 +196,9 @@ auth_request_sent == 1 lu_result_sent == 0 - MS sends Authen Response, VLR accepts and sends GSUP LU Req to HLR - rx from MS: pdisc=0x05 msg_type=0x54 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_AUTH_RESP DREF IMSI:901700000004620: MSC conn use + 1 == 2 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_AUTH_RESP (0x5:0x14) DMM IMSI:901700000004620: MM GSM AUTHENTICATION RESPONSE (sres = 2d8b2c3e) DVLR VLR_Authenticate(901700000004620){VLR_SUB_AS_WAIT_RESP}: Received Event VLR_AUTH_E_MS_AUTH_RESP DVLR SUBSCR(IMSI:901700000004620) received res: 2d 8b 2c 3e @@ -299,10 +299,10 @@ --- - Another LU wants to get new tuples; even though HLR sends Network Failure, we are reusing the old tuples. - Location Update request causes a GSUP Send Auth Info request to HLR - rx from MS: pdisc=0x05 msg_type=0x08 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_LOC_UPD_REQUEST new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_LOC_UPD_REQUEST (0x5:0x8) DREF unknown: MSC conn use + 1 == 2 DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Allocated DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Received Event SUBSCR_CONN_E_START @@ -343,9 +343,9 @@ auth_request_sent == 1 lu_result_sent == 0 - MS sends Authen Response, VLR accepts and sends GSUP LU Req to HLR - rx from MS: pdisc=0x05 msg_type=0x54 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_AUTH_RESP DREF MSISDN:46071: MSC conn use + 1 == 2 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_AUTH_RESP (0x5:0x14) DMM MSISDN:46071: MM GSM AUTHENTICATION RESPONSE (sres = 2d8b2c3e) DVLR VLR_Authenticate(901700000004620){VLR_SUB_AS_WAIT_RESP}: Received Event VLR_AUTH_E_MS_AUTH_RESP DVLR SUBSCR(MSISDN:46071) received res: 2d 8b 2c 3e @@ -447,10 +447,10 @@ --- - Submit a used auth tuple in the VLR - Location Update request causes a GSUP Send Auth Info request to HLR - rx from MS: pdisc=0x05 msg_type=0x08 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_LOC_UPD_REQUEST new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_LOC_UPD_REQUEST (0x5:0x8) DREF unknown: MSC conn use + 1 == 2 DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Allocated DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Received Event SUBSCR_CONN_E_START @@ -493,9 +493,9 @@ auth_request_sent == 1 lu_result_sent == 0 - MS sends Authen Response, VLR accepts and sends GSUP LU Req to HLR - rx from MS: pdisc=0x05 msg_type=0x54 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_AUTH_RESP DREF IMSI:901700000004620: MSC conn use + 1 == 2 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_AUTH_RESP (0x5:0x14) DMM IMSI:901700000004620: MM GSM AUTHENTICATION RESPONSE (sres = 2d8b2c3e) DVLR VLR_Authenticate(901700000004620){VLR_SUB_AS_WAIT_RESP}: Received Event VLR_AUTH_E_MS_AUTH_RESP DVLR SUBSCR(IMSI:901700000004620) received res: 2d 8b 2c 3e @@ -596,10 +596,10 @@ --- - Another LU wants to get new tuples; HLR sends Network Failure, we reject. - Location Update request causes a GSUP Send Auth Info request to HLR - rx from MS: pdisc=0x05 msg_type=0x08 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_LOC_UPD_REQUEST new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_LOC_UPD_REQUEST (0x5:0x8) DREF unknown: MSC conn use + 1 == 2 DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Allocated DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Received Event SUBSCR_CONN_E_START @@ -670,10 +670,10 @@ --- - Submit a used auth tuple in the VLR - Location Update request causes a GSUP Send Auth Info request to HLR - rx from MS: pdisc=0x05 msg_type=0x08 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_LOC_UPD_REQUEST new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_LOC_UPD_REQUEST (0x5:0x8) DREF unknown: MSC conn use + 1 == 2 DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Allocated DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Received Event SUBSCR_CONN_E_START @@ -716,9 +716,9 @@ auth_request_sent == 1 lu_result_sent == 0 - MS sends Authen Response, VLR accepts and sends GSUP LU Req to HLR - rx from MS: pdisc=0x05 msg_type=0x54 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_AUTH_RESP DREF IMSI:901700000004620: MSC conn use + 1 == 2 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_AUTH_RESP (0x5:0x14) DMM IMSI:901700000004620: MM GSM AUTHENTICATION RESPONSE (sres = 2d8b2c3e) DVLR VLR_Authenticate(901700000004620){VLR_SUB_AS_WAIT_RESP}: Received Event VLR_AUTH_E_MS_AUTH_RESP DVLR SUBSCR(IMSI:901700000004620) received res: 2d 8b 2c 3e @@ -820,10 +820,10 @@ - Another LU wants to get new tuples; HLR sends IMSI Unknown. Even though we would re-use an old tuple, reject the unknown IMSI. net->vlr->cfg.auth_reuse_old_sets_on_error == 1 - Location Update request causes a GSUP Send Auth Info request to HLR - rx from MS: pdisc=0x05 msg_type=0x08 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_LOC_UPD_REQUEST new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_LOC_UPD_REQUEST (0x5:0x8) DREF unknown: MSC conn use + 1 == 2 DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Allocated DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Received Event SUBSCR_CONN_E_START @@ -892,10 +892,10 @@ ===== test_hlr_acc_but_no_auth_tuples - Location Update request causes a GSUP Send Auth Info request to HLR - rx from MS: pdisc=0x05 msg_type=0x08 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_LOC_UPD_REQUEST new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_LOC_UPD_REQUEST (0x5:0x8) DREF unknown: MSC conn use + 1 == 2 DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Allocated DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Received Event SUBSCR_CONN_E_START @@ -965,10 +965,10 @@ ===== test_hlr_rej_lu - Location Update request causes a GSUP LU request to HLR - rx from MS: pdisc=0x05 msg_type=0x08 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_LOC_UPD_REQUEST new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_LOC_UPD_REQUEST (0x5:0x8) DREF unknown: MSC conn use + 1 == 2 DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Allocated DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Received Event SUBSCR_CONN_E_START @@ -1041,10 +1041,10 @@ ===== test_hlr_no_insert_data - Location Update request causes a GSUP LU request to HLR - rx from MS: pdisc=0x05 msg_type=0x08 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_LOC_UPD_REQUEST new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_LOC_UPD_REQUEST (0x5:0x8) DREF unknown: MSC conn use + 1 == 2 DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Allocated DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Received Event SUBSCR_CONN_E_START diff --git a/tests/msc_vlr/msc_vlr_test_hlr_timeout.err b/tests/msc_vlr/msc_vlr_test_hlr_timeout.err index 7c04f46..f83cc29 100644 --- a/tests/msc_vlr/msc_vlr_test_hlr_timeout.err +++ b/tests/msc_vlr/msc_vlr_test_hlr_timeout.err @@ -1,10 +1,10 @@ ===== test_hlr_timeout_lu_auth_info - Total time passed: 0.000000 s - Location Update request causes a GSUP Send Auth Info request to HLR - rx from MS: pdisc=0x05 msg_type=0x08 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_LOC_UPD_REQUEST new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_LOC_UPD_REQUEST (0x5:0x8) DREF unknown: MSC conn use + 1 == 2 DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Allocated DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Received Event SUBSCR_CONN_E_START @@ -83,10 +83,10 @@ ===== test_hlr_timeout_lu_upd_loc_result - Total time passed: 0.000000 s - Location Update request causes a GSUP LU request to HLR - rx from MS: pdisc=0x05 msg_type=0x08 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_LOC_UPD_REQUEST new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_LOC_UPD_REQUEST (0x5:0x8) DREF unknown: MSC conn use + 1 == 2 DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Allocated DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Received Event SUBSCR_CONN_E_START diff --git a/tests/msc_vlr/msc_vlr_test_ms_timeout.err b/tests/msc_vlr/msc_vlr_test_ms_timeout.err index 046548c..1574ef9 100644 --- a/tests/msc_vlr/msc_vlr_test_ms_timeout.err +++ b/tests/msc_vlr/msc_vlr_test_ms_timeout.err @@ -1,10 +1,10 @@ ===== test_ms_timeout_lu_auth_resp - Total time passed: 0.000000 s - Location Update request causes a GSUP Send Auth Info request to HLR - rx from MS: pdisc=0x05 msg_type=0x08 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_LOC_UPD_REQUEST new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_LOC_UPD_REQUEST (0x5:0x8) DREF unknown: MSC conn use + 1 == 2 DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Allocated DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Received Event SUBSCR_CONN_E_START @@ -103,10 +103,10 @@ ===== test_ms_timeout_cm_auth_resp - Total time passed: 0.000000 s - Location Update request causes a GSUP Send Auth Info request to HLR - rx from MS: pdisc=0x05 msg_type=0x08 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_LOC_UPD_REQUEST new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_LOC_UPD_REQUEST (0x5:0x8) DREF unknown: MSC conn use + 1 == 2 DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Allocated DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Received Event SUBSCR_CONN_E_START @@ -149,9 +149,9 @@ auth_request_sent == 1 lu_result_sent == 0 - MS sends Authen Response, VLR accepts and sends GSUP LU Req to HLR - rx from MS: pdisc=0x05 msg_type=0x54 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_AUTH_RESP DREF IMSI:901700000004620: MSC conn use + 1 == 2 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_AUTH_RESP (0x5:0x14) DMM IMSI:901700000004620: MM GSM AUTHENTICATION RESPONSE (sres = 2d8b2c3e) DVLR VLR_Authenticate(901700000004620){VLR_SUB_AS_WAIT_RESP}: Received Event VLR_AUTH_E_MS_AUTH_RESP DVLR SUBSCR(IMSI:901700000004620) received res: 2d 8b 2c 3e @@ -246,10 +246,10 @@ llist_count(&net->subscr_conns) == 0 --- - after a while, a new conn sends a CM Service Request. VLR responds with Auth Req, 2nd auth vector - rx from MS: pdisc=0x05 msg_type=0x24 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_CM_SERV_REQ new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_CM_SERV_REQ (0x5:0x24) DMM <- CM SERVICE REQUEST serv_type=0x08 MI(IMSI)=901700000004620 DREF unknown: MSC conn use + 1 == 2 DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Allocated diff --git a/tests/msc_vlr/msc_vlr_test_no_authen.err b/tests/msc_vlr/msc_vlr_test_no_authen.err index 99454fc..015e55b 100644 --- a/tests/msc_vlr/msc_vlr_test_no_authen.err +++ b/tests/msc_vlr/msc_vlr_test_no_authen.err @@ -1,9 +1,9 @@ ===== test_no_authen - Location Update request causes a GSUP LU request to HLR - rx from MS: pdisc=0x05 msg_type=0x08 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_LOC_UPD_REQUEST new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_LOC_UPD_REQUEST (0x5:0x8) DREF unknown: MSC conn use + 1 == 2 DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Allocated DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Received Event SUBSCR_CONN_E_START @@ -46,14 +46,14 @@ - having received subscriber data does not mean acceptance msc_subscr_conn_is_accepted() == false requests shall be thwarted -DRLL Dispatching 04.08 message, pdisc=3 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x03 msg_type=0x05 -DRLL Dispatching 04.08 message, pdisc=5 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x05 msg_type=0x33 -DRLL Dispatching 04.08 message, pdisc=6 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x06 msg_type=0x19 -DRLL Dispatching 04.08 message, pdisc=9 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x09 msg_type=0x01 +DRLL Dispatching 04.08 message GSM48_MT_CC_SETUP (0x3:0x5) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_MT_CC_SETUP +DRLL Dispatching 04.08 message unknown 0x33 (0x5:0x33) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: unknown 0x33 +DRLL Dispatching 04.08 message GSM48_MT_RR_SYSINFO_1 (0x6:0x19) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_MT_RR_SYSINFO_1 +DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_PDISC_SMS:0x01 lu_result_sent == 0 - HLR also sends GSUP _UPDATE_LOCATION_RESULT <-- GSUP rx OSMO_GSUP_MSGT_UPDATE_LOCATION_RESULT: 06010809710000004026f0 @@ -115,10 +115,10 @@ llist_count(&net->subscr_conns) == 0 --- - after a while, a new conn sends a CM Service Request - rx from MS: pdisc=0x05 msg_type=0x24 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_CM_SERV_REQ new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_CM_SERV_REQ (0x5:0x24) DMM <- CM SERVICE REQUEST serv_type=0x08 MI(IMSI)=901700000004620 DREF unknown: MSC conn use + 1 == 2 DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Allocated @@ -156,16 +156,16 @@ - a USSD request is serviced expecting USSD: Your extension is 46071 - rx from MS: pdisc=0x0b msg_type=0x3b + MSC <--RAN_GERAN_A-- MS: GSM48_PDISC_NC_SS:0x3b DREF MSISDN:46071: MSC conn use + 1 == 2 -DRLL Dispatching 04.08 message, pdisc=11 -DMM MSISDN:46071 pdisc=11 msg_type=0x3b: received_cm_service_request changes to false +DRLL Dispatching 04.08 message GSM48_PDISC_NC_SS:0x3b (0xb:0x3b) +DMM MSISDN:46071: rx msg GSM48_PDISC_NC_SS:0x3b: received_cm_service_request changes to false DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_COMMUNICATING DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_ACCEPTED}: state_chg to SUBSCR_CONN_S_COMMUNICATING DMM USSD: Own number requested DMM MSISDN:46071: MSISDN = 46071 DMSC msc_tx 43 bytes to MSISDN:46071 via RAN_GERAN_A -- DTAP --RAN_GERAN_A--> MS: 8b2a1c27a225020100302002013b301b04010f0416d9775d0e2ae3e965f73cfd7683d27310cd06bbc51a0d +- DTAP --RAN_GERAN_A--> MS: GSM48_PDISC_NC_SS:0x2a: 8b2a1c27a225020100302002013b301b04010f0416d9775d0e2ae3e965f73cfd7683d27310cd06bbc51a0d - DTAP matches expected message DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_COMMUNICATING}: Received Event SUBSCR_CONN_E_BUMP DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_COMMUNICATING}: bump: releasing conn @@ -203,10 +203,10 @@ llist_count(&vsub->cs.requests) == 1 DREF VLR subscr MSISDN:46071 usage decreases to: 3 - MS replies with Paging Response, we deliver the SMS - rx from MS: pdisc=0x06 msg_type=0x27 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_RR_PAG_RESP new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=6 +DRLL Dispatching 04.08 message GSM48_MT_RR_PAG_RESP (0x6:0x27) DRR PAGING RESPONSE: MI(IMSI)=901700000004620 DREF unknown: MSC conn use + 1 == 2 DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Allocated @@ -236,7 +236,7 @@ DREF VLR subscr MSISDN:46071 usage increases to: 6 DREF MSISDN:46071: MSC conn use + 1 == 3 DMSC msc_tx 91 bytes to MSISDN:46071 via RAN_GERAN_A -- DTAP --RAN_GERAN_A--> MS: 09015801000791447758100650004c0005806470f1000007101000000000445079da1e1ee7416937485e9ea7c965373d1d6683c270383b3d0ed3d36ff71c949e83c22072799e9687c5ec32a81d96afcbf4b4fb0c7ac3e9e9b7db05 +- DTAP --RAN_GERAN_A--> MS: GSM48_PDISC_SMS:0x01: 09015801000791447758100650004c0005806470f1000007101000000000445079da1e1ee7416937485e9ea7c965373d1d6683c270383b3d0ed3d36ff71c949e83c22072799e9687c5ec32a81d96afcbf4b4fb0c7ac3e9e9b7db05 - DTAP matches expected message DREF VLR subscr MSISDN:46071 usage decreases to: 5 DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_BUMP @@ -254,9 +254,9 @@ - conn is still open to wait for SMS ack dance llist_count(&net->subscr_conns) == 1 - MS replies with CP-ACK for received SMS - rx from MS: pdisc=0x89 msg_type=0x04 + MSC <--RAN_GERAN_A-- MS: GSM48_PDISC_SMS:0x04 DREF MSISDN:46071: MSC conn use + 1 == 3 -DRLL Dispatching 04.08 message, pdisc=9 +DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x04 (0x9:0x4) DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_COMMUNICATING DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_ACCEPTED}: state_chg to SUBSCR_CONN_S_COMMUNICATING DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_COMMUNICATING}: Received Event SUBSCR_CONN_E_BUMP @@ -264,12 +264,12 @@ DREF MSISDN:46071: MSC conn use - 1 == 2 llist_count(&net->subscr_conns) == 1 - MS also sends RP-ACK, MSC in turn sends CP-ACK for that - rx from MS: pdisc=0x89 msg_type=0x01 + MSC <--RAN_GERAN_A-- MS: GSM48_PDISC_SMS:0x01 DREF MSISDN:46071: MSC conn use + 1 == 3 -DRLL Dispatching 04.08 message, pdisc=9 +DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_COMMUNICATING}: Received Event SUBSCR_CONN_E_COMMUNICATING DMSC msc_tx 2 bytes to MSISDN:46071 via RAN_GERAN_A -- DTAP --RAN_GERAN_A--> MS: 0904 +- DTAP --RAN_GERAN_A--> MS: GSM48_PDISC_SMS:0x04: 0904 - DTAP matches expected message DREF VLR subscr MSISDN:46071 usage decreases to: 3 DREF VLR subscr MSISDN:46071 usage decreases to: 2 @@ -294,10 +294,10 @@ llist_count(&net->subscr_conns) == 0 --- - subscriber detaches - rx from MS: pdisc=0x05 msg_type=0x01 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_IMSI_DETACH_IND new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_IMSI_DETACH_IND (0x5:0x1) DMM IMSI DETACH INDICATION: MI(IMSI)=901700000004620 DREF VLR subscr MSISDN:46071 usage increases to: 2 DMM IMSI DETACH for MSISDN:46071 @@ -315,10 +315,10 @@ ===== test_no_authen_tmsi - Location Update request causes a GSUP LU request to HLR - rx from MS: pdisc=0x05 msg_type=0x08 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_LOC_UPD_REQUEST new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_LOC_UPD_REQUEST (0x5:0x8) DREF unknown: MSC conn use + 1 == 2 DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Allocated DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Received Event SUBSCR_CONN_E_START @@ -361,14 +361,14 @@ - having received subscriber data does not mean acceptance msc_subscr_conn_is_accepted() == false requests shall be thwarted -DRLL Dispatching 04.08 message, pdisc=3 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x03 msg_type=0x05 -DRLL Dispatching 04.08 message, pdisc=5 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x05 msg_type=0x33 -DRLL Dispatching 04.08 message, pdisc=6 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x06 msg_type=0x19 -DRLL Dispatching 04.08 message, pdisc=9 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x09 msg_type=0x01 +DRLL Dispatching 04.08 message GSM48_MT_CC_SETUP (0x3:0x5) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_MT_CC_SETUP +DRLL Dispatching 04.08 message unknown 0x33 (0x5:0x33) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: unknown 0x33 +DRLL Dispatching 04.08 message GSM48_MT_RR_SYSINFO_1 (0x6:0x19) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_MT_RR_SYSINFO_1 +DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_PDISC_SMS:0x01 lu_result_sent == 0 - HLR also sends GSUP _UPDATE_LOCATION_RESULT <-- GSUP rx OSMO_GSUP_MSGT_UPDATE_LOCATION_RESULT: 06010809710000004026f0 @@ -406,14 +406,14 @@ lu_result_sent == 1 msc_subscr_conn_is_accepted() == false requests shall be thwarted -DRLL Dispatching 04.08 message, pdisc=3 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x03 msg_type=0x05 -DRLL Dispatching 04.08 message, pdisc=5 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x05 msg_type=0x33 -DRLL Dispatching 04.08 message, pdisc=6 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x06 msg_type=0x19 -DRLL Dispatching 04.08 message, pdisc=9 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x09 msg_type=0x01 +DRLL Dispatching 04.08 message GSM48_MT_CC_SETUP (0x3:0x5) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_MT_CC_SETUP +DRLL Dispatching 04.08 message unknown 0x33 (0x5:0x33) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: unknown 0x33 +DRLL Dispatching 04.08 message GSM48_MT_RR_SYSINFO_1 (0x6:0x19) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_MT_RR_SYSINFO_1 +DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_PDISC_SMS:0x01 - even though the TMSI is not acked, we can already find the subscr with it DREF VLR subscr MSISDN:46071 usage increases to: 2 vsub != NULL == 1 @@ -422,9 +422,9 @@ vsub->tmsi == 0xffffffff DREF VLR subscr MSISDN:46071 usage decreases to: 1 - MS sends TMSI Realloc Complete - rx from MS: pdisc=0x05 msg_type=0x5b + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_TMSI_REALL_COMPL DREF MSISDN:46071: MSC conn use + 1 == 2 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_TMSI_REALL_COMPL (0x5:0x1b) DMM TMSI Reallocation Completed. Subscriber: MSISDN:46071 DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_WAIT_LU_COMPL}: Received Event VLR_ULA_E_NEW_TMSI_ACK DVLR lu_compl_vlr_fsm(901700000004620){LU_COMPL_VLR_S_WAIT_TMSI_CNF}: Received Event LU_COMPL_VLR_E_NEW_TMSI_ACK @@ -466,10 +466,10 @@ DREF VLR subscr MSISDN:46071 usage decreases to: 1 --- - after a while, a new conn sends a CM Service Request using above TMSI - rx from MS: pdisc=0x05 msg_type=0x24 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_CM_SERV_REQ new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_CM_SERV_REQ (0x5:0x24) DMM <- CM SERVICE REQUEST serv_type=0x08 MI(TMSI)=50462976 DREF unknown: MSC conn use + 1 == 2 DMM Subscr_Conn(50462976){SUBSCR_CONN_S_INIT}: Allocated @@ -507,16 +507,16 @@ - a USSD request is serviced expecting USSD: Your extension is 46071 - rx from MS: pdisc=0x0b msg_type=0x3b + MSC <--RAN_GERAN_A-- MS: GSM48_PDISC_NC_SS:0x3b DREF MSISDN:46071: MSC conn use + 1 == 2 -DRLL Dispatching 04.08 message, pdisc=11 -DMM MSISDN:46071 pdisc=11 msg_type=0x3b: received_cm_service_request changes to false +DRLL Dispatching 04.08 message GSM48_PDISC_NC_SS:0x3b (0xb:0x3b) +DMM MSISDN:46071: rx msg GSM48_PDISC_NC_SS:0x3b: received_cm_service_request changes to false DMM Subscr_Conn(50462976){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_COMMUNICATING DMM Subscr_Conn(50462976){SUBSCR_CONN_S_ACCEPTED}: state_chg to SUBSCR_CONN_S_COMMUNICATING DMM USSD: Own number requested DMM MSISDN:46071: MSISDN = 46071 DMSC msc_tx 43 bytes to MSISDN:46071 via RAN_GERAN_A -- DTAP --RAN_GERAN_A--> MS: 8b2a1c27a225020100302002013b301b04010f0416d9775d0e2ae3e965f73cfd7683d27310cd06bbc51a0d +- DTAP --RAN_GERAN_A--> MS: GSM48_PDISC_NC_SS:0x2a: 8b2a1c27a225020100302002013b301b04010f0416d9775d0e2ae3e965f73cfd7683d27310cd06bbc51a0d - DTAP matches expected message DMM Subscr_Conn(50462976){SUBSCR_CONN_S_COMMUNICATING}: Received Event SUBSCR_CONN_E_BUMP DMM Subscr_Conn(50462976){SUBSCR_CONN_S_COMMUNICATING}: bump: releasing conn @@ -553,10 +553,10 @@ llist_count(&vsub->cs.requests) == 1 DREF VLR subscr MSISDN:46071 usage decreases to: 3 - MS replies with Paging Response using TMSI, we deliver the SMS - rx from MS: pdisc=0x06 msg_type=0x27 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_RR_PAG_RESP new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=6 +DRLL Dispatching 04.08 message GSM48_MT_RR_PAG_RESP (0x6:0x27) DRR PAGING RESPONSE: MI(TMSI)=50462976 DREF unknown: MSC conn use + 1 == 2 DMM Subscr_Conn(50462976){SUBSCR_CONN_S_INIT}: Allocated @@ -586,7 +586,7 @@ DREF VLR subscr MSISDN:46071 usage increases to: 6 DREF MSISDN:46071: MSC conn use + 1 == 3 DMSC msc_tx 91 bytes to MSISDN:46071 via RAN_GERAN_A -- DTAP --RAN_GERAN_A--> MS: 09015801000791447758100650004c0005806470f1000007101000000000445079da1e1ee7416937485e9ea7c965373d1d6683c270383b3d0ed3d36ff71c949e83c22072799e9687c5ec32a81d96afcbf4b4fb0c7ac3e9e9b7db05 +- DTAP --RAN_GERAN_A--> MS: GSM48_PDISC_SMS:0x01: 09015801000791447758100650004c0005806470f1000007101000000000445079da1e1ee7416937485e9ea7c965373d1d6683c270383b3d0ed3d36ff71c949e83c22072799e9687c5ec32a81d96afcbf4b4fb0c7ac3e9e9b7db05 - DTAP matches expected message DREF VLR subscr MSISDN:46071 usage decreases to: 5 DMM Subscr_Conn(50462976){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_BUMP @@ -604,9 +604,9 @@ - conn is still open to wait for SMS ack dance llist_count(&net->subscr_conns) == 1 - MS replies with CP-ACK for received SMS - rx from MS: pdisc=0x89 msg_type=0x04 + MSC <--RAN_GERAN_A-- MS: GSM48_PDISC_SMS:0x04 DREF MSISDN:46071: MSC conn use + 1 == 3 -DRLL Dispatching 04.08 message, pdisc=9 +DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x04 (0x9:0x4) DMM Subscr_Conn(50462976){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_COMMUNICATING DMM Subscr_Conn(50462976){SUBSCR_CONN_S_ACCEPTED}: state_chg to SUBSCR_CONN_S_COMMUNICATING DMM Subscr_Conn(50462976){SUBSCR_CONN_S_COMMUNICATING}: Received Event SUBSCR_CONN_E_BUMP @@ -614,12 +614,12 @@ DREF MSISDN:46071: MSC conn use - 1 == 2 llist_count(&net->subscr_conns) == 1 - MS also sends RP-ACK, MSC in turn sends CP-ACK for that - rx from MS: pdisc=0x89 msg_type=0x01 + MSC <--RAN_GERAN_A-- MS: GSM48_PDISC_SMS:0x01 DREF MSISDN:46071: MSC conn use + 1 == 3 -DRLL Dispatching 04.08 message, pdisc=9 +DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) DMM Subscr_Conn(50462976){SUBSCR_CONN_S_COMMUNICATING}: Received Event SUBSCR_CONN_E_COMMUNICATING DMSC msc_tx 2 bytes to MSISDN:46071 via RAN_GERAN_A -- DTAP --RAN_GERAN_A--> MS: 0904 +- DTAP --RAN_GERAN_A--> MS: GSM48_PDISC_SMS:0x04: 0904 - DTAP matches expected message DREF VLR subscr MSISDN:46071 usage decreases to: 3 DREF VLR subscr MSISDN:46071 usage decreases to: 2 @@ -645,10 +645,10 @@ --- - subscriber sends LU Request, this time with the TMSI - Location Update request causes a GSUP LU request to HLR - rx from MS: pdisc=0x05 msg_type=0x08 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_LOC_UPD_REQUEST new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_LOC_UPD_REQUEST (0x5:0x8) DREF unknown: MSC conn use + 1 == 2 DMM Subscr_Conn(50462976){SUBSCR_CONN_S_INIT}: Allocated DMM Subscr_Conn(50462976){SUBSCR_CONN_S_INIT}: Received Event SUBSCR_CONN_E_START @@ -689,14 +689,14 @@ - having received subscriber data does not mean acceptance msc_subscr_conn_is_accepted() == false requests shall be thwarted -DRLL Dispatching 04.08 message, pdisc=3 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x03 msg_type=0x05 -DRLL Dispatching 04.08 message, pdisc=5 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x05 msg_type=0x33 -DRLL Dispatching 04.08 message, pdisc=6 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x06 msg_type=0x19 -DRLL Dispatching 04.08 message, pdisc=9 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x09 msg_type=0x01 +DRLL Dispatching 04.08 message GSM48_MT_CC_SETUP (0x3:0x5) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_MT_CC_SETUP +DRLL Dispatching 04.08 message unknown 0x33 (0x5:0x33) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: unknown 0x33 +DRLL Dispatching 04.08 message GSM48_MT_RR_SYSINFO_1 (0x6:0x19) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_MT_RR_SYSINFO_1 +DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_PDISC_SMS:0x01 lu_result_sent == 0 - HLR also sends GSUP _UPDATE_LOCATION_RESULT <-- GSUP rx OSMO_GSUP_MSGT_UPDATE_LOCATION_RESULT: 06010809710000004026f0 @@ -734,14 +734,14 @@ lu_result_sent == 1 msc_subscr_conn_is_accepted() == false requests shall be thwarted -DRLL Dispatching 04.08 message, pdisc=3 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x03 msg_type=0x05 -DRLL Dispatching 04.08 message, pdisc=5 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x05 msg_type=0x33 -DRLL Dispatching 04.08 message, pdisc=6 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x06 msg_type=0x19 -DRLL Dispatching 04.08 message, pdisc=9 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x09 msg_type=0x01 +DRLL Dispatching 04.08 message GSM48_MT_CC_SETUP (0x3:0x5) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_MT_CC_SETUP +DRLL Dispatching 04.08 message unknown 0x33 (0x5:0x33) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: unknown 0x33 +DRLL Dispatching 04.08 message GSM48_MT_RR_SYSINFO_1 (0x6:0x19) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_MT_RR_SYSINFO_1 +DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_PDISC_SMS:0x01 - even though the TMSI is not acked, we can already find the subscr with it DREF VLR subscr MSISDN:46071 usage increases to: 3 vsub != NULL == 1 @@ -750,9 +750,9 @@ vsub->tmsi == 0x03020100 DREF VLR subscr MSISDN:46071 usage decreases to: 2 - MS sends TMSI Realloc Complete - rx from MS: pdisc=0x05 msg_type=0x5b + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_TMSI_REALL_COMPL DREF MSISDN:46071: MSC conn use + 1 == 2 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_TMSI_REALL_COMPL (0x5:0x1b) DMM TMSI Reallocation Completed. Subscriber: MSISDN:46071 DVLR vlr_lu_fsm(50462976){VLR_ULA_S_WAIT_LU_COMPL}: Received Event VLR_ULA_E_NEW_TMSI_ACK DVLR lu_compl_vlr_fsm(50462976){LU_COMPL_VLR_S_WAIT_TMSI_CNF}: Received Event LU_COMPL_VLR_E_NEW_TMSI_ACK @@ -793,10 +793,10 @@ DREF VLR subscr MSISDN:46071 usage decreases to: 1 --- - subscriber detaches, using new TMSI - rx from MS: pdisc=0x05 msg_type=0x01 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_IMSI_DETACH_IND new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_IMSI_DETACH_IND (0x5:0x1) DMM IMSI DETACH INDICATION: MI(TMSI)=117835012 DREF VLR subscr MSISDN:46071 usage increases to: 2 DMM IMSI DETACH for MSISDN:46071 @@ -814,10 +814,10 @@ ===== test_no_authen_imei - Location Update request causes a GSUP LU request to HLR - rx from MS: pdisc=0x05 msg_type=0x08 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_LOC_UPD_REQUEST new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_LOC_UPD_REQUEST (0x5:0x8) DREF unknown: MSC conn use + 1 == 2 DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Allocated DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Received Event SUBSCR_CONN_E_START @@ -860,14 +860,14 @@ - having received subscriber data does not mean acceptance msc_subscr_conn_is_accepted() == false requests shall be thwarted -DRLL Dispatching 04.08 message, pdisc=3 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x03 msg_type=0x05 -DRLL Dispatching 04.08 message, pdisc=5 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x05 msg_type=0x33 -DRLL Dispatching 04.08 message, pdisc=6 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x06 msg_type=0x19 -DRLL Dispatching 04.08 message, pdisc=9 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x09 msg_type=0x01 +DRLL Dispatching 04.08 message GSM48_MT_CC_SETUP (0x3:0x5) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_MT_CC_SETUP +DRLL Dispatching 04.08 message unknown 0x33 (0x5:0x33) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: unknown 0x33 +DRLL Dispatching 04.08 message GSM48_MT_RR_SYSINFO_1 (0x6:0x19) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_MT_RR_SYSINFO_1 +DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_PDISC_SMS:0x01 lu_result_sent == 0 - HLR also sends GSUP _UPDATE_LOCATION_RESULT, and we send an ID Request for the IMEI to the MS <-- GSUP rx OSMO_GSUP_MSGT_UPDATE_LOCATION_RESULT: 06010809710000004026f0 @@ -897,7 +897,7 @@ DVLR lu_compl_vlr_fsm(901700000004620){LU_COMPL_VLR_S_WAIT_SUB_PRES}: Received Event LU_COMPL_VLR_E_SUB_PRES_COMPL DVLR lu_compl_vlr_fsm(901700000004620){LU_COMPL_VLR_S_WAIT_SUB_PRES}: state_chg to LU_COMPL_VLR_S_WAIT_IMEI DMSC msc_tx 3 bytes to MSISDN:46071 via RAN_GERAN_A -- DTAP --RAN_GERAN_A--> MS: 051802 +- DTAP --RAN_GERAN_A--> MS: GSM48_MT_MM_ID_REQ: 051802 - DTAP matches expected message DREF VLR subscr MSISDN:46071 usage decreases to: 1 <-- GSUP rx OSMO_GSUP_MSGT_UPDATE_LOCATION_RESULT: vlr_gsupc_read_cb() returns 0 @@ -908,18 +908,18 @@ DREF VLR subscr MSISDN:46071 usage decreases to: 1 msc_subscr_conn_is_accepted() == false requests shall be thwarted -DRLL Dispatching 04.08 message, pdisc=3 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x03 msg_type=0x05 -DRLL Dispatching 04.08 message, pdisc=5 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x05 msg_type=0x33 -DRLL Dispatching 04.08 message, pdisc=6 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x06 msg_type=0x19 -DRLL Dispatching 04.08 message, pdisc=9 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x09 msg_type=0x01 +DRLL Dispatching 04.08 message GSM48_MT_CC_SETUP (0x3:0x5) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_MT_CC_SETUP +DRLL Dispatching 04.08 message unknown 0x33 (0x5:0x33) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: unknown 0x33 +DRLL Dispatching 04.08 message GSM48_MT_RR_SYSINFO_1 (0x6:0x19) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_MT_RR_SYSINFO_1 +DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_PDISC_SMS:0x01 - MS replies with an Identity Response - rx from MS: pdisc=0x05 msg_type=0x59 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_ID_RESP DREF MSISDN:46071: MSC conn use + 1 == 2 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_ID_RESP (0x5:0x19) DMM IDENTITY RESPONSE: MI(IMEI)=423423423423423 DVLR set IMEI on subscriber; IMSI=901700000004620 IMEI=423423423423423 DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_WAIT_LU_COMPL}: Received Event VLR_ULA_E_ID_IMEI @@ -961,10 +961,10 @@ DREF VLR subscr MSISDN:46071 usage decreases to: 1 --- - subscriber detaches - rx from MS: pdisc=0x05 msg_type=0x01 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_IMSI_DETACH_IND new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_IMSI_DETACH_IND (0x5:0x1) DMM IMSI DETACH INDICATION: MI(IMSI)=901700000004620 DREF VLR subscr MSISDN:46071 usage increases to: 2 DMM IMSI DETACH for MSISDN:46071 @@ -982,10 +982,10 @@ ===== test_no_authen_tmsi_imei - Location Update request causes a GSUP LU request to HLR - rx from MS: pdisc=0x05 msg_type=0x08 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_LOC_UPD_REQUEST new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_LOC_UPD_REQUEST (0x5:0x8) DREF unknown: MSC conn use + 1 == 2 DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Allocated DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Received Event SUBSCR_CONN_E_START @@ -1028,14 +1028,14 @@ - having received subscriber data does not mean acceptance msc_subscr_conn_is_accepted() == false requests shall be thwarted -DRLL Dispatching 04.08 message, pdisc=3 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x03 msg_type=0x05 -DRLL Dispatching 04.08 message, pdisc=5 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x05 msg_type=0x33 -DRLL Dispatching 04.08 message, pdisc=6 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x06 msg_type=0x19 -DRLL Dispatching 04.08 message, pdisc=9 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x09 msg_type=0x01 +DRLL Dispatching 04.08 message GSM48_MT_CC_SETUP (0x3:0x5) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_MT_CC_SETUP +DRLL Dispatching 04.08 message unknown 0x33 (0x5:0x33) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: unknown 0x33 +DRLL Dispatching 04.08 message GSM48_MT_RR_SYSINFO_1 (0x6:0x19) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_MT_RR_SYSINFO_1 +DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_PDISC_SMS:0x01 lu_result_sent == 0 - HLR also sends GSUP _UPDATE_LOCATION_RESULT, and we send an ID Request for the IMEI to the MS <-- GSUP rx OSMO_GSUP_MSGT_UPDATE_LOCATION_RESULT: 06010809710000004026f0 @@ -1065,7 +1065,7 @@ DVLR lu_compl_vlr_fsm(901700000004620){LU_COMPL_VLR_S_WAIT_SUB_PRES}: Received Event LU_COMPL_VLR_E_SUB_PRES_COMPL DVLR lu_compl_vlr_fsm(901700000004620){LU_COMPL_VLR_S_WAIT_SUB_PRES}: state_chg to LU_COMPL_VLR_S_WAIT_IMEI_TMSI DMSC msc_tx 3 bytes to MSISDN:46071 via RAN_GERAN_A -- DTAP --RAN_GERAN_A--> MS: 051802 +- DTAP --RAN_GERAN_A--> MS: GSM48_MT_MM_ID_REQ: 051802 - DTAP matches expected message DREF VLR subscr MSISDN:46071 usage decreases to: 1 <-- GSUP rx OSMO_GSUP_MSGT_UPDATE_LOCATION_RESULT: vlr_gsupc_read_cb() returns 0 @@ -1076,18 +1076,18 @@ DREF VLR subscr MSISDN:46071 usage decreases to: 1 msc_subscr_conn_is_accepted() == false requests shall be thwarted -DRLL Dispatching 04.08 message, pdisc=3 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x03 msg_type=0x05 -DRLL Dispatching 04.08 message, pdisc=5 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x05 msg_type=0x33 -DRLL Dispatching 04.08 message, pdisc=6 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x06 msg_type=0x19 -DRLL Dispatching 04.08 message, pdisc=9 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x09 msg_type=0x01 +DRLL Dispatching 04.08 message GSM48_MT_CC_SETUP (0x3:0x5) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_MT_CC_SETUP +DRLL Dispatching 04.08 message unknown 0x33 (0x5:0x33) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: unknown 0x33 +DRLL Dispatching 04.08 message GSM48_MT_RR_SYSINFO_1 (0x6:0x19) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_MT_RR_SYSINFO_1 +DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_PDISC_SMS:0x01 - MS replies with an Identity Response - rx from MS: pdisc=0x05 msg_type=0x59 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_ID_RESP DREF MSISDN:46071: MSC conn use + 1 == 2 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_ID_RESP (0x5:0x19) DMM IDENTITY RESPONSE: MI(IMEI)=423423423423423 DVLR set IMEI on subscriber; IMSI=901700000004620 IMEI=423423423423423 DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_WAIT_LU_COMPL}: Received Event VLR_ULA_E_ID_IMEI @@ -1102,18 +1102,18 @@ lu_result_sent == 1 msc_subscr_conn_is_accepted() == false requests shall be thwarted -DRLL Dispatching 04.08 message, pdisc=3 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x03 msg_type=0x05 -DRLL Dispatching 04.08 message, pdisc=5 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x05 msg_type=0x33 -DRLL Dispatching 04.08 message, pdisc=6 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x06 msg_type=0x19 -DRLL Dispatching 04.08 message, pdisc=9 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x09 msg_type=0x01 +DRLL Dispatching 04.08 message GSM48_MT_CC_SETUP (0x3:0x5) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_MT_CC_SETUP +DRLL Dispatching 04.08 message unknown 0x33 (0x5:0x33) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: unknown 0x33 +DRLL Dispatching 04.08 message GSM48_MT_RR_SYSINFO_1 (0x6:0x19) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_MT_RR_SYSINFO_1 +DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_PDISC_SMS:0x01 - MS sends TMSI Realloc Complete - rx from MS: pdisc=0x05 msg_type=0x5b + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_TMSI_REALL_COMPL DREF MSISDN:46071: MSC conn use + 1 == 2 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_TMSI_REALL_COMPL (0x5:0x1b) DMM TMSI Reallocation Completed. Subscriber: MSISDN:46071 DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_WAIT_LU_COMPL}: Received Event VLR_ULA_E_NEW_TMSI_ACK DVLR lu_compl_vlr_fsm(901700000004620){LU_COMPL_VLR_S_WAIT_TMSI_CNF}: Received Event LU_COMPL_VLR_E_NEW_TMSI_ACK @@ -1154,10 +1154,10 @@ DREF VLR subscr MSISDN:46071 usage decreases to: 1 --- - subscriber detaches - rx from MS: pdisc=0x05 msg_type=0x01 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_IMSI_DETACH_IND new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_IMSI_DETACH_IND (0x5:0x1) DMM IMSI DETACH INDICATION: MI(IMSI)=901700000004620 DREF VLR subscr MSISDN:46071 usage increases to: 2 DMM IMSI DETACH for MSISDN:46071 diff --git a/tests/msc_vlr/msc_vlr_test_reject_concurrency.err b/tests/msc_vlr/msc_vlr_test_reject_concurrency.err index 267b131..7b0954f 100644 --- a/tests/msc_vlr/msc_vlr_test_reject_concurrency.err +++ b/tests/msc_vlr/msc_vlr_test_reject_concurrency.err @@ -1,9 +1,9 @@ ===== test_reject_2nd_conn - Location Update Request on one connection - rx from MS: pdisc=0x05 msg_type=0x08 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_LOC_UPD_REQUEST new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_LOC_UPD_REQUEST (0x5:0x8) DREF unknown: MSC conn use + 1 == 2 DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Allocated DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Received Event SUBSCR_CONN_E_START @@ -35,10 +35,10 @@ lu_result_sent == 0 llist_count(&net->subscr_conns) == 1 - Another Location Update Request from the same subscriber on another connection is rejected - rx from MS: pdisc=0x05 msg_type=0x08 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_LOC_UPD_REQUEST new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_LOC_UPD_REQUEST (0x5:0x8) DREF unknown: MSC conn use + 1 == 2 DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Allocated DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Received Event SUBSCR_CONN_E_START @@ -151,10 +151,10 @@ ===== test_reject_lu_during_lu - Location Update Request - rx from MS: pdisc=0x05 msg_type=0x08 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_LOC_UPD_REQUEST new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_LOC_UPD_REQUEST (0x5:0x8) DREF unknown: MSC conn use + 1 == 2 DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Allocated DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Received Event SUBSCR_CONN_E_START @@ -187,9 +187,9 @@ llist_count(&net->subscr_conns) == 1 --- - Another Location Update Request from the same subscriber on the same conn is dropped silently - rx from MS: pdisc=0x05 msg_type=0x08 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_LOC_UPD_REQUEST DREF IMSI:901700000004620: MSC conn use + 1 == 2 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_LOC_UPD_REQUEST (0x5:0x8) DMM 901700000004620: Error: connection already in use DMM IMSI:901700000004620: bump: conn still being established (SUBSCR_CONN_S_NEW) DREF IMSI:901700000004620: MSC conn use - 1 == 1 @@ -273,10 +273,10 @@ ===== test_reject_cm_during_lu - Location Update Request - rx from MS: pdisc=0x05 msg_type=0x08 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_LOC_UPD_REQUEST new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_LOC_UPD_REQUEST (0x5:0x8) DREF unknown: MSC conn use + 1 == 2 DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Allocated DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Received Event SUBSCR_CONN_E_START @@ -309,14 +309,14 @@ llist_count(&net->subscr_conns) == 1 --- - A CM Service Request in the middle of a LU is rejected - rx from MS: pdisc=0x05 msg_type=0x24 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_CM_SERV_REQ DREF IMSI:901700000004620: MSC conn use + 1 == 2 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_CM_SERV_REQ (0x5:0x24) DMM <- CM SERVICE REQUEST serv_type=0x08 MI(IMSI)=901700000004620 DMM IMSI:901700000004620: connection already in use DMM -> CM SERVICE Reject cause: 17 DMSC msc_tx 3 bytes to IMSI:901700000004620 via RAN_GERAN_A -- DTAP --RAN_GERAN_A--> MS: 052211 +- DTAP --RAN_GERAN_A--> MS: GSM48_MT_MM_CM_SERV_REJ: 052211 - DTAP matches expected message DMM IMSI:901700000004620: bump: conn still being established (SUBSCR_CONN_S_NEW) DREF IMSI:901700000004620: MSC conn use - 1 == 1 @@ -401,10 +401,10 @@ ===== test_reject_paging_resp_during_lu - Location Update Request - rx from MS: pdisc=0x05 msg_type=0x08 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_LOC_UPD_REQUEST new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_LOC_UPD_REQUEST (0x5:0x8) DREF unknown: MSC conn use + 1 == 2 DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Allocated DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Received Event SUBSCR_CONN_E_START @@ -437,9 +437,9 @@ llist_count(&net->subscr_conns) == 1 --- - An erratic Paging Response is dropped silently - rx from MS: pdisc=0x06 msg_type=0x27 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_RR_PAG_RESP DREF IMSI:901700000004620: MSC conn use + 1 == 2 -DRLL Dispatching 04.08 message, pdisc=6 +DRLL Dispatching 04.08 message GSM48_MT_RR_PAG_RESP (0x6:0x27) DRR PAGING RESPONSE: MI(IMSI)=901700000004620 DMM 901700000004620: Error: connection already in use DMM IMSI:901700000004620: bump: conn still being established (SUBSCR_CONN_S_NEW) @@ -526,10 +526,10 @@ --- - Subscriber does a normal LU - Location Update Request - rx from MS: pdisc=0x05 msg_type=0x08 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_LOC_UPD_REQUEST new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_LOC_UPD_REQUEST (0x5:0x8) DREF unknown: MSC conn use + 1 == 2 DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Allocated DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Received Event SUBSCR_CONN_E_START @@ -630,10 +630,10 @@ llist_count(&net->subscr_conns) == 0 --- - Subscriber does a normal CM Service Request - rx from MS: pdisc=0x05 msg_type=0x24 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_CM_SERV_REQ new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_CM_SERV_REQ (0x5:0x24) DMM <- CM SERVICE REQUEST serv_type=0x08 MI(IMSI)=901700000004620 DREF unknown: MSC conn use + 1 == 2 DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Allocated @@ -669,9 +669,9 @@ cm_service_result_sent == 1 msc_subscr_conn_is_accepted() == true - A LU request on an open conn is dropped silently - rx from MS: pdisc=0x05 msg_type=0x08 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_LOC_UPD_REQUEST DREF MSISDN:46071: MSC conn use + 1 == 2 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_LOC_UPD_REQUEST (0x5:0x8) DMM 901700000004620: Error: connection already in use DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_BUMP DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_ACCEPTED}: bump: still awaiting first request after a CM Service Request @@ -680,9 +680,9 @@ llist_count(&net->subscr_conns) == 1 --- - subscriber detaches - rx from MS: pdisc=0x05 msg_type=0x01 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_IMSI_DETACH_IND DREF MSISDN:46071: MSC conn use + 1 == 2 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_IMSI_DETACH_IND (0x5:0x1) DMM IMSI DETACH INDICATION: MI(IMSI)=901700000004620 DREF VLR subscr MSISDN:46071 usage increases to: 3 DMM IMSI DETACH for MSISDN:46071 @@ -714,10 +714,10 @@ --- - Subscriber does a normal LU - Location Update Request - rx from MS: pdisc=0x05 msg_type=0x08 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_LOC_UPD_REQUEST new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_LOC_UPD_REQUEST (0x5:0x8) DREF unknown: MSC conn use + 1 == 2 DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Allocated DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Received Event SUBSCR_CONN_E_START @@ -818,10 +818,10 @@ llist_count(&net->subscr_conns) == 0 --- - Subscriber does a normal CM Service Request - rx from MS: pdisc=0x05 msg_type=0x24 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_CM_SERV_REQ new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_CM_SERV_REQ (0x5:0x24) DMM <- CM SERVICE REQUEST serv_type=0x08 MI(IMSI)=901700000004620 DREF unknown: MSC conn use + 1 == 2 DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Allocated @@ -857,9 +857,9 @@ cm_service_result_sent == 1 msc_subscr_conn_is_accepted() == true - A second CM Service Request on the same conn is accepted without another auth dance - rx from MS: pdisc=0x05 msg_type=0x24 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_CM_SERV_REQ DREF MSISDN:46071: MSC conn use + 1 == 2 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_CM_SERV_REQ (0x5:0x24) DMM <- CM SERVICE REQUEST serv_type=0x08 MI(IMSI)=901700000004620 DMM MSISDN:46071: re-using already accepted connection - sending CM Service Accept for MSISDN:46071 @@ -870,9 +870,9 @@ llist_count(&net->subscr_conns) == 1 --- - subscriber detaches - rx from MS: pdisc=0x05 msg_type=0x01 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_IMSI_DETACH_IND DREF MSISDN:46071: MSC conn use + 1 == 2 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_IMSI_DETACH_IND (0x5:0x1) DMM IMSI DETACH INDICATION: MI(IMSI)=901700000004620 DREF VLR subscr MSISDN:46071 usage increases to: 3 DMM IMSI DETACH for MSISDN:46071 @@ -904,10 +904,10 @@ --- - Subscriber does a normal LU - Location Update Request - rx from MS: pdisc=0x05 msg_type=0x08 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_LOC_UPD_REQUEST new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_LOC_UPD_REQUEST (0x5:0x8) DREF unknown: MSC conn use + 1 == 2 DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Allocated DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Received Event SUBSCR_CONN_E_START @@ -1008,10 +1008,10 @@ llist_count(&net->subscr_conns) == 0 --- - Subscriber does a normal CM Service Request - rx from MS: pdisc=0x05 msg_type=0x24 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_CM_SERV_REQ new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_CM_SERV_REQ (0x5:0x24) DMM <- CM SERVICE REQUEST serv_type=0x08 MI(IMSI)=901700000004620 DREF unknown: MSC conn use + 1 == 2 DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Allocated @@ -1048,9 +1048,9 @@ msc_subscr_conn_is_accepted() == true --- - An erratic Paging Response on the same conn is dropped silently - rx from MS: pdisc=0x06 msg_type=0x27 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_RR_PAG_RESP DREF MSISDN:46071: MSC conn use + 1 == 2 -DRLL Dispatching 04.08 message, pdisc=6 +DRLL Dispatching 04.08 message GSM48_MT_RR_PAG_RESP (0x6:0x27) DRR PAGING RESPONSE: MI(IMSI)=901700000004620 DMM 901700000004620: Error: connection already in use DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_BUMP @@ -1062,16 +1062,16 @@ - a USSD request is serviced expecting USSD: Your extension is 46071 - rx from MS: pdisc=0x0b msg_type=0x3b + MSC <--RAN_GERAN_A-- MS: GSM48_PDISC_NC_SS:0x3b DREF MSISDN:46071: MSC conn use + 1 == 2 -DRLL Dispatching 04.08 message, pdisc=11 -DMM MSISDN:46071 pdisc=11 msg_type=0x3b: received_cm_service_request changes to false +DRLL Dispatching 04.08 message GSM48_PDISC_NC_SS:0x3b (0xb:0x3b) +DMM MSISDN:46071: rx msg GSM48_PDISC_NC_SS:0x3b: received_cm_service_request changes to false DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_COMMUNICATING DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_ACCEPTED}: state_chg to SUBSCR_CONN_S_COMMUNICATING DMM USSD: Own number requested DMM MSISDN:46071: MSISDN = 46071 DMSC msc_tx 43 bytes to MSISDN:46071 via RAN_GERAN_A -- DTAP --RAN_GERAN_A--> MS: 8b2a1c27a225020100302002013b301b04010f0416d9775d0e2ae3e965f73cfd7683d27310cd06bbc51a0d +- DTAP --RAN_GERAN_A--> MS: GSM48_PDISC_NC_SS:0x2a: 8b2a1c27a225020100302002013b301b04010f0416d9775d0e2ae3e965f73cfd7683d27310cd06bbc51a0d - DTAP matches expected message DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_COMMUNICATING}: Received Event SUBSCR_CONN_E_BUMP DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_COMMUNICATING}: bump: releasing conn @@ -1100,10 +1100,10 @@ --- - Subscriber does a normal LU - Location Update Request - rx from MS: pdisc=0x05 msg_type=0x08 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_LOC_UPD_REQUEST new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_LOC_UPD_REQUEST (0x5:0x8) DREF unknown: MSC conn use + 1 == 2 DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Allocated DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Received Event SUBSCR_CONN_E_START @@ -1216,10 +1216,10 @@ paging_sent == 1 paging_stopped == 0 - MS replies with Paging Response, we deliver the SMS - rx from MS: pdisc=0x06 msg_type=0x27 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_RR_PAG_RESP new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=6 +DRLL Dispatching 04.08 message GSM48_MT_RR_PAG_RESP (0x6:0x27) DRR PAGING RESPONSE: MI(IMSI)=901700000004620 DREF unknown: MSC conn use + 1 == 2 DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Allocated @@ -1249,7 +1249,7 @@ DREF VLR subscr MSISDN:46071 usage increases to: 6 DREF MSISDN:46071: MSC conn use + 1 == 3 DMSC msc_tx 91 bytes to MSISDN:46071 via RAN_GERAN_A -- DTAP --RAN_GERAN_A--> MS: 09015801000791447758100650004c0005806470f1000007101000000000445079da1e1ee7416937485e9ea7c965373d1d6683c270383b3d0ed3d36ff71c949e83c22072799e9687c5ec32a81d96afcbf4b4fb0c7ac3e9e9b7db05 +- DTAP --RAN_GERAN_A--> MS: GSM48_PDISC_SMS:0x01: 09015801000791447758100650004c0005806470f1000007101000000000445079da1e1ee7416937485e9ea7c965373d1d6683c270383b3d0ed3d36ff71c949e83c22072799e9687c5ec32a81d96afcbf4b4fb0c7ac3e9e9b7db05 - DTAP matches expected message DREF VLR subscr MSISDN:46071 usage decreases to: 5 DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_BUMP @@ -1264,9 +1264,9 @@ llist_count(&net->subscr_conns) == 1 --- - MS sends erratic LU Request, which is dropped silently - rx from MS: pdisc=0x05 msg_type=0x08 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_LOC_UPD_REQUEST DREF MSISDN:46071: MSC conn use + 1 == 3 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_LOC_UPD_REQUEST (0x5:0x8) DMM 901700000004620: Error: connection already in use DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_BUMP DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_ACCEPTED}: bump: connection still has active transaction: GSM48_PDISC_SMS @@ -1274,9 +1274,9 @@ lu_result_sent == 0 llist_count(&net->subscr_conns) == 1 - MS replies with CP-ACK for received SMS - rx from MS: pdisc=0x89 msg_type=0x04 + MSC <--RAN_GERAN_A-- MS: GSM48_PDISC_SMS:0x04 DREF MSISDN:46071: MSC conn use + 1 == 3 -DRLL Dispatching 04.08 message, pdisc=9 +DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x04 (0x9:0x4) DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_COMMUNICATING DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_ACCEPTED}: state_chg to SUBSCR_CONN_S_COMMUNICATING DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_COMMUNICATING}: Received Event SUBSCR_CONN_E_BUMP @@ -1284,12 +1284,12 @@ DREF MSISDN:46071: MSC conn use - 1 == 2 llist_count(&net->subscr_conns) == 1 - MS also sends RP-ACK, MSC in turn sends CP-ACK for that - rx from MS: pdisc=0x89 msg_type=0x01 + MSC <--RAN_GERAN_A-- MS: GSM48_PDISC_SMS:0x01 DREF MSISDN:46071: MSC conn use + 1 == 3 -DRLL Dispatching 04.08 message, pdisc=9 +DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_COMMUNICATING}: Received Event SUBSCR_CONN_E_COMMUNICATING DMSC msc_tx 2 bytes to MSISDN:46071 via RAN_GERAN_A -- DTAP --RAN_GERAN_A--> MS: 0904 +- DTAP --RAN_GERAN_A--> MS: GSM48_PDISC_SMS:0x04: 0904 - DTAP matches expected message DREF VLR subscr MSISDN:46071 usage decreases to: 3 DREF VLR subscr MSISDN:46071 usage decreases to: 2 @@ -1322,10 +1322,10 @@ --- - Subscriber does a normal LU - Location Update Request - rx from MS: pdisc=0x05 msg_type=0x08 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_LOC_UPD_REQUEST new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_LOC_UPD_REQUEST (0x5:0x8) DREF unknown: MSC conn use + 1 == 2 DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Allocated DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Received Event SUBSCR_CONN_E_START @@ -1438,10 +1438,10 @@ paging_sent == 1 paging_stopped == 0 - MS replies with Paging Response, we deliver the SMS - rx from MS: pdisc=0x06 msg_type=0x27 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_RR_PAG_RESP new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=6 +DRLL Dispatching 04.08 message GSM48_MT_RR_PAG_RESP (0x6:0x27) DRR PAGING RESPONSE: MI(IMSI)=901700000004620 DREF unknown: MSC conn use + 1 == 2 DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Allocated @@ -1471,7 +1471,7 @@ DREF VLR subscr MSISDN:46071 usage increases to: 6 DREF MSISDN:46071: MSC conn use + 1 == 3 DMSC msc_tx 91 bytes to MSISDN:46071 via RAN_GERAN_A -- DTAP --RAN_GERAN_A--> MS: 09015801000791447758100650004c0005806470f1000007101000000000445079da1e1ee7416937485e9ea7c965373d1d6683c270383b3d0ed3d36ff71c949e83c22072799e9687c5ec32a81d96afcbf4b4fb0c7ac3e9e9b7db05 +- DTAP --RAN_GERAN_A--> MS: GSM48_PDISC_SMS:0x01: 09015801000791447758100650004c0005806470f1000007101000000000445079da1e1ee7416937485e9ea7c965373d1d6683c270383b3d0ed3d36ff71c949e83c22072799e9687c5ec32a81d96afcbf4b4fb0c7ac3e9e9b7db05 - DTAP matches expected message DREF VLR subscr MSISDN:46071 usage decreases to: 5 DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_BUMP @@ -1486,9 +1486,9 @@ llist_count(&net->subscr_conns) == 1 --- - CM Service Request during open connection is accepted - rx from MS: pdisc=0x05 msg_type=0x24 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_CM_SERV_REQ DREF MSISDN:46071: MSC conn use + 1 == 3 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_CM_SERV_REQ (0x5:0x24) DMM <- CM SERVICE REQUEST serv_type=0x08 MI(IMSI)=901700000004620 DMM MSISDN:46071: re-using already accepted connection - sending CM Service Accept for MSISDN:46071 @@ -1499,9 +1499,9 @@ llist_count(&net->subscr_conns) == 1 g_conn->received_cm_service_request == 1 - MS replies with CP-ACK for received SMS - rx from MS: pdisc=0x89 msg_type=0x04 + MSC <--RAN_GERAN_A-- MS: GSM48_PDISC_SMS:0x04 DREF MSISDN:46071: MSC conn use + 1 == 3 -DRLL Dispatching 04.08 message, pdisc=9 +DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x04 (0x9:0x4) DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_COMMUNICATING DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_ACCEPTED}: state_chg to SUBSCR_CONN_S_COMMUNICATING DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_COMMUNICATING}: Received Event SUBSCR_CONN_E_BUMP @@ -1509,12 +1509,12 @@ DREF MSISDN:46071: MSC conn use - 1 == 2 llist_count(&net->subscr_conns) == 1 - MS also sends RP-ACK, MSC in turn sends CP-ACK for that - rx from MS: pdisc=0x89 msg_type=0x01 + MSC <--RAN_GERAN_A-- MS: GSM48_PDISC_SMS:0x01 DREF MSISDN:46071: MSC conn use + 1 == 3 -DRLL Dispatching 04.08 message, pdisc=9 +DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_COMMUNICATING}: Received Event SUBSCR_CONN_E_COMMUNICATING DMSC msc_tx 2 bytes to MSISDN:46071 via RAN_GERAN_A -- DTAP --RAN_GERAN_A--> MS: 0904 +- DTAP --RAN_GERAN_A--> MS: GSM48_PDISC_SMS:0x04: 0904 - DTAP matches expected message DREF VLR subscr MSISDN:46071 usage decreases to: 3 DREF VLR subscr MSISDN:46071 usage decreases to: 2 @@ -1527,9 +1527,9 @@ llist_count(&net->subscr_conns) == 1 --- - subscriber detaches - rx from MS: pdisc=0x05 msg_type=0x01 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_IMSI_DETACH_IND DREF MSISDN:46071: MSC conn use + 1 == 2 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_IMSI_DETACH_IND (0x5:0x1) DMM IMSI DETACH INDICATION: MI(IMSI)=901700000004620 DREF VLR subscr MSISDN:46071 usage increases to: 3 DMM IMSI DETACH for MSISDN:46071 @@ -1561,10 +1561,10 @@ --- - Subscriber does a normal LU - Location Update Request - rx from MS: pdisc=0x05 msg_type=0x08 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_LOC_UPD_REQUEST new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_LOC_UPD_REQUEST (0x5:0x8) DREF unknown: MSC conn use + 1 == 2 DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Allocated DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Received Event SUBSCR_CONN_E_START @@ -1677,10 +1677,10 @@ paging_sent == 1 paging_stopped == 0 - MS replies with Paging Response, we deliver the SMS - rx from MS: pdisc=0x06 msg_type=0x27 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_RR_PAG_RESP new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=6 +DRLL Dispatching 04.08 message GSM48_MT_RR_PAG_RESP (0x6:0x27) DRR PAGING RESPONSE: MI(IMSI)=901700000004620 DREF unknown: MSC conn use + 1 == 2 DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Allocated @@ -1710,7 +1710,7 @@ DREF VLR subscr MSISDN:46071 usage increases to: 6 DREF MSISDN:46071: MSC conn use + 1 == 3 DMSC msc_tx 91 bytes to MSISDN:46071 via RAN_GERAN_A -- DTAP --RAN_GERAN_A--> MS: 09015801000791447758100650004c0005806470f1000007101000000000445079da1e1ee7416937485e9ea7c965373d1d6683c270383b3d0ed3d36ff71c949e83c22072799e9687c5ec32a81d96afcbf4b4fb0c7ac3e9e9b7db05 +- DTAP --RAN_GERAN_A--> MS: GSM48_PDISC_SMS:0x01: 09015801000791447758100650004c0005806470f1000007101000000000445079da1e1ee7416937485e9ea7c965373d1d6683c270383b3d0ed3d36ff71c949e83c22072799e9687c5ec32a81d96afcbf4b4fb0c7ac3e9e9b7db05 - DTAP matches expected message DREF VLR subscr MSISDN:46071 usage decreases to: 5 DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_BUMP @@ -1725,18 +1725,18 @@ llist_count(&net->subscr_conns) == 1 --- - MS sends another erratic Paging Response which is dropped silently - rx from MS: pdisc=0x06 msg_type=0x27 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_RR_PAG_RESP DREF MSISDN:46071: MSC conn use + 1 == 3 -DRLL Dispatching 04.08 message, pdisc=6 +DRLL Dispatching 04.08 message GSM48_MT_RR_PAG_RESP (0x6:0x27) DRR PAGING RESPONSE: MI(IMSI)=901700000004620 DMM 901700000004620: Error: connection already in use DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_BUMP DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_ACCEPTED}: bump: connection still has active transaction: GSM48_PDISC_SMS DREF MSISDN:46071: MSC conn use - 1 == 2 - MS replies with CP-ACK for received SMS - rx from MS: pdisc=0x89 msg_type=0x04 + MSC <--RAN_GERAN_A-- MS: GSM48_PDISC_SMS:0x04 DREF MSISDN:46071: MSC conn use + 1 == 3 -DRLL Dispatching 04.08 message, pdisc=9 +DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x04 (0x9:0x4) DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_COMMUNICATING DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_ACCEPTED}: state_chg to SUBSCR_CONN_S_COMMUNICATING DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_COMMUNICATING}: Received Event SUBSCR_CONN_E_BUMP @@ -1744,12 +1744,12 @@ DREF MSISDN:46071: MSC conn use - 1 == 2 llist_count(&net->subscr_conns) == 1 - MS also sends RP-ACK, MSC in turn sends CP-ACK for that - rx from MS: pdisc=0x89 msg_type=0x01 + MSC <--RAN_GERAN_A-- MS: GSM48_PDISC_SMS:0x01 DREF MSISDN:46071: MSC conn use + 1 == 3 -DRLL Dispatching 04.08 message, pdisc=9 +DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_COMMUNICATING}: Received Event SUBSCR_CONN_E_COMMUNICATING DMSC msc_tx 2 bytes to MSISDN:46071 via RAN_GERAN_A -- DTAP --RAN_GERAN_A--> MS: 0904 +- DTAP --RAN_GERAN_A--> MS: GSM48_PDISC_SMS:0x04: 0904 - DTAP matches expected message DREF VLR subscr MSISDN:46071 usage decreases to: 3 DREF VLR subscr MSISDN:46071 usage decreases to: 2 diff --git a/tests/msc_vlr/msc_vlr_test_rest.err b/tests/msc_vlr/msc_vlr_test_rest.err index 6066eac..6122040 100644 --- a/tests/msc_vlr/msc_vlr_test_rest.err +++ b/tests/msc_vlr/msc_vlr_test_rest.err @@ -10,14 +10,14 @@ DMM Subscr_Conn(test){SUBSCR_CONN_S_INIT}: state_chg to SUBSCR_CONN_S_NEW msc_subscr_conn_is_accepted() == false requests shall be thwarted -DRLL Dispatching 04.08 message, pdisc=3 -DRLL subscr unknown: Message not permitted for initial conn: pdisc=0x03 msg_type=0x05 -DRLL Dispatching 04.08 message, pdisc=5 -DRLL subscr unknown: Message not permitted for initial conn: pdisc=0x05 msg_type=0x33 -DRLL Dispatching 04.08 message, pdisc=6 -DRLL subscr unknown: Message not permitted for initial conn: pdisc=0x06 msg_type=0x19 -DRLL Dispatching 04.08 message, pdisc=9 -DRLL subscr unknown: Message not permitted for initial conn: pdisc=0x09 msg_type=0x01 +DRLL Dispatching 04.08 message GSM48_MT_CC_SETUP (0x3:0x5) +DRLL subscr unknown: Message not permitted for initial conn: GSM48_MT_CC_SETUP +DRLL Dispatching 04.08 message unknown 0x33 (0x5:0x33) +DRLL subscr unknown: Message not permitted for initial conn: unknown 0x33 +DRLL Dispatching 04.08 message GSM48_MT_RR_SYSINFO_1 (0x6:0x19) +DRLL subscr unknown: Message not permitted for initial conn: GSM48_MT_RR_SYSINFO_1 +DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) +DRLL subscr unknown: Message not permitted for initial conn: GSM48_PDISC_SMS:0x01 - fake: acceptance DREF VLR subscr unknown usage increases to: 1 DMM Subscr_Conn(test){SUBSCR_CONN_S_NEW}: state_chg to SUBSCR_CONN_S_ACCEPTED @@ -43,10 +43,10 @@ ===== test_cm_service_without_lu - CM Service Request without a prior Location Updating - rx from MS: pdisc=0x05 msg_type=0x24 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_CM_SERV_REQ new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_CM_SERV_REQ (0x5:0x24) DMM <- CM SERVICE REQUEST serv_type=0x08 MI(IMSI)=901700000004620 DREF unknown: MSC conn use + 1 == 2 DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Allocated @@ -84,10 +84,10 @@ ===== test_two_lu - Location Update request causes a GSUP LU request to HLR - rx from MS: pdisc=0x05 msg_type=0x08 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_LOC_UPD_REQUEST new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_LOC_UPD_REQUEST (0x5:0x8) DREF unknown: MSC conn use + 1 == 2 DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Allocated DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Received Event SUBSCR_CONN_E_START @@ -130,14 +130,14 @@ - having received subscriber data does not mean acceptance msc_subscr_conn_is_accepted() == false requests shall be thwarted -DRLL Dispatching 04.08 message, pdisc=3 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x03 msg_type=0x05 -DRLL Dispatching 04.08 message, pdisc=5 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x05 msg_type=0x33 -DRLL Dispatching 04.08 message, pdisc=6 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x06 msg_type=0x19 -DRLL Dispatching 04.08 message, pdisc=9 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x09 msg_type=0x01 +DRLL Dispatching 04.08 message GSM48_MT_CC_SETUP (0x3:0x5) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_MT_CC_SETUP +DRLL Dispatching 04.08 message unknown 0x33 (0x5:0x33) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: unknown 0x33 +DRLL Dispatching 04.08 message GSM48_MT_RR_SYSINFO_1 (0x6:0x19) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_MT_RR_SYSINFO_1 +DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_PDISC_SMS:0x01 lu_result_sent == 0 - HLR also sends GSUP _UPDATE_LOCATION_RESULT <-- GSUP rx OSMO_GSUP_MSGT_UPDATE_LOCATION_RESULT: 06010809710000004026f0 @@ -200,10 +200,10 @@ --- - verify that the MS can send another LU request - Location Update request causes a GSUP LU request to HLR - rx from MS: pdisc=0x05 msg_type=0x08 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_LOC_UPD_REQUEST new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_LOC_UPD_REQUEST (0x5:0x8) DREF unknown: MSC conn use + 1 == 2 DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Allocated DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Received Event SUBSCR_CONN_E_START @@ -244,14 +244,14 @@ - having received subscriber data does not mean acceptance msc_subscr_conn_is_accepted() == false requests shall be thwarted -DRLL Dispatching 04.08 message, pdisc=3 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x03 msg_type=0x05 -DRLL Dispatching 04.08 message, pdisc=5 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x05 msg_type=0x33 -DRLL Dispatching 04.08 message, pdisc=6 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x06 msg_type=0x19 -DRLL Dispatching 04.08 message, pdisc=9 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x09 msg_type=0x01 +DRLL Dispatching 04.08 message GSM48_MT_CC_SETUP (0x3:0x5) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_MT_CC_SETUP +DRLL Dispatching 04.08 message unknown 0x33 (0x5:0x33) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: unknown 0x33 +DRLL Dispatching 04.08 message GSM48_MT_RR_SYSINFO_1 (0x6:0x19) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_MT_RR_SYSINFO_1 +DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_PDISC_SMS:0x01 lu_result_sent == 0 - HLR also sends GSUP _UPDATE_LOCATION_RESULT <-- GSUP rx OSMO_GSUP_MSGT_UPDATE_LOCATION_RESULT: 06010809710000004026f0 @@ -312,10 +312,10 @@ llist_count(&net->subscr_conns) == 0 --- - subscriber detaches - rx from MS: pdisc=0x05 msg_type=0x01 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_IMSI_DETACH_IND new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_IMSI_DETACH_IND (0x5:0x1) DMM IMSI DETACH INDICATION: MI(IMSI)=901700000004620 DREF VLR subscr MSISDN:46071 usage increases to: 2 DMM IMSI DETACH for MSISDN:46071 @@ -333,10 +333,10 @@ ===== test_lu_unknown_tmsi - Location Update request with unknown TMSI sends ID Request for IMSI - rx from MS: pdisc=0x05 msg_type=0x08 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_LOC_UPD_REQUEST new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_LOC_UPD_REQUEST (0x5:0x8) DREF unknown: MSC conn use + 1 == 2 DMM Subscr_Conn(591536962){SUBSCR_CONN_S_INIT}: Allocated DMM Subscr_Conn(591536962){SUBSCR_CONN_S_INIT}: Received Event SUBSCR_CONN_E_START @@ -354,25 +354,25 @@ DVLR vlr_lu_fsm(591536962){VLR_ULA_S_IDLE}: vlr_loc_upd_want_imsi() DVLR vlr_lu_fsm(591536962){VLR_ULA_S_IDLE}: state_chg to VLR_ULA_S_WAIT_IMSI DMSC msc_tx 3 bytes to TMSI:0x23422342 via RAN_GERAN_A -- DTAP --RAN_GERAN_A--> MS: 051801 +- DTAP --RAN_GERAN_A--> MS: GSM48_MT_MM_ID_REQ: 051801 - DTAP matches expected message DMM TMSI:0x23422342: bump: conn still being established (SUBSCR_CONN_S_NEW) DREF TMSI:0x23422342: MSC conn use - 1 == 1 lu_result_sent == 0 msc_subscr_conn_is_accepted() == false requests shall be thwarted -DRLL Dispatching 04.08 message, pdisc=3 -DRLL subscr TMSI:0x23422342: Message not permitted for initial conn: pdisc=0x03 msg_type=0x05 -DRLL Dispatching 04.08 message, pdisc=5 -DRLL subscr TMSI:0x23422342: Message not permitted for initial conn: pdisc=0x05 msg_type=0x33 -DRLL Dispatching 04.08 message, pdisc=6 -DRLL subscr TMSI:0x23422342: Message not permitted for initial conn: pdisc=0x06 msg_type=0x19 -DRLL Dispatching 04.08 message, pdisc=9 -DRLL subscr TMSI:0x23422342: Message not permitted for initial conn: pdisc=0x09 msg_type=0x01 +DRLL Dispatching 04.08 message GSM48_MT_CC_SETUP (0x3:0x5) +DRLL subscr TMSI:0x23422342: Message not permitted for initial conn: GSM48_MT_CC_SETUP +DRLL Dispatching 04.08 message unknown 0x33 (0x5:0x33) +DRLL subscr TMSI:0x23422342: Message not permitted for initial conn: unknown 0x33 +DRLL Dispatching 04.08 message GSM48_MT_RR_SYSINFO_1 (0x6:0x19) +DRLL subscr TMSI:0x23422342: Message not permitted for initial conn: GSM48_MT_RR_SYSINFO_1 +DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) +DRLL subscr TMSI:0x23422342: Message not permitted for initial conn: GSM48_PDISC_SMS:0x01 - MS tells us the IMSI, causes a GSUP LU request to HLR - rx from MS: pdisc=0x05 msg_type=0x59 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_ID_RESP DREF TMSI:0x23422342: MSC conn use + 1 == 2 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_ID_RESP (0x5:0x19) DMM IDENTITY RESPONSE: MI(IMSI)=901700000004620 DVLR set IMSI on subscriber; IMSI=901700000004620 id=901700000004620 DVLR vlr_lu_fsm(591536962){VLR_ULA_S_WAIT_IMSI}: Received Event VLR_ULA_E_ID_IMSI @@ -404,14 +404,14 @@ - having received subscriber data does not mean acceptance msc_subscr_conn_is_accepted() == false requests shall be thwarted -DRLL Dispatching 04.08 message, pdisc=3 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x03 msg_type=0x05 -DRLL Dispatching 04.08 message, pdisc=5 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x05 msg_type=0x33 -DRLL Dispatching 04.08 message, pdisc=6 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x06 msg_type=0x19 -DRLL Dispatching 04.08 message, pdisc=9 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x09 msg_type=0x01 +DRLL Dispatching 04.08 message GSM48_MT_CC_SETUP (0x3:0x5) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_MT_CC_SETUP +DRLL Dispatching 04.08 message unknown 0x33 (0x5:0x33) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: unknown 0x33 +DRLL Dispatching 04.08 message GSM48_MT_RR_SYSINFO_1 (0x6:0x19) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_MT_RR_SYSINFO_1 +DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_PDISC_SMS:0x01 lu_result_sent == 0 - HLR also sends GSUP _UPDATE_LOCATION_RESULT <-- GSUP rx OSMO_GSUP_MSGT_UPDATE_LOCATION_RESULT: 06010809710000004026f0 diff --git a/tests/msc_vlr/msc_vlr_test_umts_authen.err b/tests/msc_vlr/msc_vlr_test_umts_authen.err index bcb6e31..f59612c 100644 --- a/tests/msc_vlr/msc_vlr_test_umts_authen.err +++ b/tests/msc_vlr/msc_vlr_test_umts_authen.err @@ -1,9 +1,9 @@ ===== test_umts_authen_geran - Location Update request causes a GSUP Send Auth Info request to HLR - rx from MS: pdisc=0x05 msg_type=0x08 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_LOC_UPD_REQUEST new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_LOC_UPD_REQUEST (0x5:0x8) DREF unknown: MSC conn use + 1 == 2 DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_INIT}: Allocated DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_INIT}: Received Event SUBSCR_CONN_E_START @@ -47,9 +47,9 @@ auth_request_sent == 1 lu_result_sent == 0 - MS sends Authen Response, VLR accepts and sends GSUP LU Req to HLR - rx from MS: pdisc=0x05 msg_type=0x54 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_AUTH_RESP DREF IMSI:901700000010650: MSC conn use + 1 == 2 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_AUTH_RESP (0x5:0x14) DMM IMSI:901700000010650: MM R99 AUTHENTICATION RESPONSE (res = e229c19e791f2e41) DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_WAIT_RESP}: Received Event VLR_AUTH_E_MS_AUTH_RESP DVLR SUBSCR(IMSI:901700000010650) received res: e2 29 c1 9e 79 1f 2e 41 @@ -121,14 +121,14 @@ llist_count(&net->subscr_conns) == 1 msc_subscr_conn_is_accepted() == false requests shall be thwarted -DRLL Dispatching 04.08 message, pdisc=3 -DRLL subscr MSISDN:42342: Message not permitted for initial conn: pdisc=0x03 msg_type=0x05 -DRLL Dispatching 04.08 message, pdisc=5 -DRLL subscr MSISDN:42342: Message not permitted for initial conn: pdisc=0x05 msg_type=0x33 -DRLL Dispatching 04.08 message, pdisc=6 -DRLL subscr MSISDN:42342: Message not permitted for initial conn: pdisc=0x06 msg_type=0x19 -DRLL Dispatching 04.08 message, pdisc=9 -DRLL subscr MSISDN:42342: Message not permitted for initial conn: pdisc=0x09 msg_type=0x01 +DRLL Dispatching 04.08 message GSM48_MT_CC_SETUP (0x3:0x5) +DRLL subscr MSISDN:42342: Message not permitted for initial conn: GSM48_MT_CC_SETUP +DRLL Dispatching 04.08 message unknown 0x33 (0x5:0x33) +DRLL subscr MSISDN:42342: Message not permitted for initial conn: unknown 0x33 +DRLL Dispatching 04.08 message GSM48_MT_RR_SYSINFO_1 (0x6:0x19) +DRLL subscr MSISDN:42342: Message not permitted for initial conn: GSM48_MT_RR_SYSINFO_1 +DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) +DRLL subscr MSISDN:42342: Message not permitted for initial conn: GSM48_PDISC_SMS:0x01 - even though the TMSI is not acked, we can already find the subscr with it DREF VLR subscr MSISDN:42342 usage increases to: 2 vsub != NULL == 1 @@ -137,9 +137,9 @@ vsub->tmsi == 0xffffffff DREF VLR subscr MSISDN:42342 usage decreases to: 1 - MS sends TMSI Realloc Complete - rx from MS: pdisc=0x05 msg_type=0x5b + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_TMSI_REALL_COMPL DREF MSISDN:42342: MSC conn use + 1 == 2 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_TMSI_REALL_COMPL (0x5:0x1b) DMM TMSI Reallocation Completed. Subscriber: MSISDN:42342 DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_WAIT_LU_COMPL}: Received Event VLR_ULA_E_NEW_TMSI_ACK DVLR lu_compl_vlr_fsm(901700000010650){LU_COMPL_VLR_S_WAIT_TMSI_CNF}: Received Event LU_COMPL_VLR_E_NEW_TMSI_ACK @@ -174,10 +174,10 @@ llist_count(&net->subscr_conns) == 0 --- - after a while, a new conn sends a CM Service Request. VLR responds with Auth Req, 2nd auth vector - rx from MS: pdisc=0x05 msg_type=0x24 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_CM_SERV_REQ new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_CM_SERV_REQ (0x5:0x24) DMM <- CM SERVICE REQUEST serv_type=0x08 MI(IMSI)=901700000010650 DREF unknown: MSC conn use + 1 == 2 DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_INIT}: Allocated @@ -208,18 +208,18 @@ - needs auth, not yet accepted msc_subscr_conn_is_accepted() == false requests shall be thwarted -DRLL Dispatching 04.08 message, pdisc=3 -DRLL subscr MSISDN:42342: Message not permitted for initial conn: pdisc=0x03 msg_type=0x05 -DRLL Dispatching 04.08 message, pdisc=5 -DRLL subscr MSISDN:42342: Message not permitted for initial conn: pdisc=0x05 msg_type=0x33 -DRLL Dispatching 04.08 message, pdisc=6 -DRLL subscr MSISDN:42342: Message not permitted for initial conn: pdisc=0x06 msg_type=0x19 -DRLL Dispatching 04.08 message, pdisc=9 -DRLL subscr MSISDN:42342: Message not permitted for initial conn: pdisc=0x09 msg_type=0x01 +DRLL Dispatching 04.08 message GSM48_MT_CC_SETUP (0x3:0x5) +DRLL subscr MSISDN:42342: Message not permitted for initial conn: GSM48_MT_CC_SETUP +DRLL Dispatching 04.08 message unknown 0x33 (0x5:0x33) +DRLL subscr MSISDN:42342: Message not permitted for initial conn: unknown 0x33 +DRLL Dispatching 04.08 message GSM48_MT_RR_SYSINFO_1 (0x6:0x19) +DRLL subscr MSISDN:42342: Message not permitted for initial conn: GSM48_MT_RR_SYSINFO_1 +DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) +DRLL subscr MSISDN:42342: Message not permitted for initial conn: GSM48_PDISC_SMS:0x01 - MS sends Authen Response, VLR accepts with a CM Service Accept - rx from MS: pdisc=0x05 msg_type=0x54 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_AUTH_RESP DREF MSISDN:42342: MSC conn use + 1 == 2 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_AUTH_RESP (0x5:0x14) DMM MSISDN:42342: MM R99 AUTHENTICATION RESPONSE (res = 7db47cf7f81e4dc7) DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_WAIT_RESP}: Received Event VLR_AUTH_E_MS_AUTH_RESP DVLR SUBSCR(MSISDN:42342) received res: 7d b4 7c f7 f8 1e 4d c7 @@ -255,16 +255,16 @@ - a USSD request is serviced expecting USSD: Your extension is 42342 - rx from MS: pdisc=0x0b msg_type=0x3b + MSC <--RAN_GERAN_A-- MS: GSM48_PDISC_NC_SS:0x3b DREF MSISDN:42342: MSC conn use + 1 == 2 -DRLL Dispatching 04.08 message, pdisc=11 -DMM MSISDN:42342 pdisc=11 msg_type=0x3b: received_cm_service_request changes to false +DRLL Dispatching 04.08 message GSM48_PDISC_NC_SS:0x3b (0xb:0x3b) +DMM MSISDN:42342: rx msg GSM48_PDISC_NC_SS:0x3b: received_cm_service_request changes to false DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_COMMUNICATING DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_ACCEPTED}: state_chg to SUBSCR_CONN_S_COMMUNICATING DMM USSD: Own number requested DMM MSISDN:42342: MSISDN = 42342 DMSC msc_tx 43 bytes to MSISDN:42342 via RAN_GERAN_A -- DTAP --RAN_GERAN_A--> MS: 8b2a1c27a225020100302002013b301b04010f0416d9775d0e2ae3e965f73cfd7683d273104d36a3c91a0d +- DTAP --RAN_GERAN_A--> MS: GSM48_PDISC_NC_SS:0x2a: 8b2a1c27a225020100302002013b301b04010f0416d9775d0e2ae3e965f73cfd7683d273104d36a3c91a0d - DTAP matches expected message DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_COMMUNICATING}: Received Event SUBSCR_CONN_E_BUMP DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_COMMUNICATING}: bump: releasing conn @@ -301,10 +301,10 @@ llist_count(&vsub->cs.requests) == 1 DREF VLR subscr MSISDN:42342 usage decreases to: 3 - MS replies with Paging Response, and VLR sends Auth Request with third key - rx from MS: pdisc=0x06 msg_type=0x27 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_RR_PAG_RESP new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=6 +DRLL Dispatching 04.08 message GSM48_MT_RR_PAG_RESP (0x6:0x27) DRR PAGING RESPONSE: MI(IMSI)=901700000010650 DREF unknown: MSC conn use + 1 == 2 DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_INIT}: Allocated @@ -334,18 +334,18 @@ - needs auth, not yet accepted msc_subscr_conn_is_accepted() == false requests shall be thwarted -DRLL Dispatching 04.08 message, pdisc=3 -DRLL subscr MSISDN:42342: Message not permitted for initial conn: pdisc=0x03 msg_type=0x05 -DRLL Dispatching 04.08 message, pdisc=5 -DRLL subscr MSISDN:42342: Message not permitted for initial conn: pdisc=0x05 msg_type=0x33 -DRLL Dispatching 04.08 message, pdisc=6 -DRLL subscr MSISDN:42342: Message not permitted for initial conn: pdisc=0x06 msg_type=0x19 -DRLL Dispatching 04.08 message, pdisc=9 -DRLL subscr MSISDN:42342: Message not permitted for initial conn: pdisc=0x09 msg_type=0x01 +DRLL Dispatching 04.08 message GSM48_MT_CC_SETUP (0x3:0x5) +DRLL subscr MSISDN:42342: Message not permitted for initial conn: GSM48_MT_CC_SETUP +DRLL Dispatching 04.08 message unknown 0x33 (0x5:0x33) +DRLL subscr MSISDN:42342: Message not permitted for initial conn: unknown 0x33 +DRLL Dispatching 04.08 message GSM48_MT_RR_SYSINFO_1 (0x6:0x19) +DRLL subscr MSISDN:42342: Message not permitted for initial conn: GSM48_MT_RR_SYSINFO_1 +DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) +DRLL subscr MSISDN:42342: Message not permitted for initial conn: GSM48_PDISC_SMS:0x01 - MS sends Authen Response, VLR accepts and sends pending SMS - rx from MS: pdisc=0x05 msg_type=0x54 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_AUTH_RESP DREF MSISDN:42342: MSC conn use + 1 == 2 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_AUTH_RESP (0x5:0x14) DMM MSISDN:42342: MM R99 AUTHENTICATION RESPONSE (res = 706f996719ba609c) DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_WAIT_RESP}: Received Event VLR_AUTH_E_MS_AUTH_RESP DVLR SUBSCR(MSISDN:42342) received res: 70 6f 99 67 19 ba 60 9c @@ -375,7 +375,7 @@ DREF VLR subscr MSISDN:42342 usage increases to: 5 DREF MSISDN:42342: MSC conn use + 1 == 3 DMSC msc_tx 91 bytes to MSISDN:42342 via RAN_GERAN_A -- DTAP --RAN_GERAN_A--> MS: 09015801000791447758100650004c0005802443f2000007101000000000445079da1e1ee7416937485e9ea7c965373d1d6683c270383b3d0ed3d36ff71c949e83c22072799e9687c5ec32a81d96afcbf4b4fb0c7ac3e9e9b7db05 +- DTAP --RAN_GERAN_A--> MS: GSM48_PDISC_SMS:0x01: 09015801000791447758100650004c0005802443f2000007101000000000445079da1e1ee7416937485e9ea7c965373d1d6683c270383b3d0ed3d36ff71c949e83c22072799e9687c5ec32a81d96afcbf4b4fb0c7ac3e9e9b7db05 - DTAP matches expected message DREF VLR subscr MSISDN:42342 usage decreases to: 4 DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_BUMP @@ -392,9 +392,9 @@ - conn is still open to wait for SMS ack dance llist_count(&net->subscr_conns) == 1 - MS replies with CP-ACK for received SMS - rx from MS: pdisc=0x89 msg_type=0x04 + MSC <--RAN_GERAN_A-- MS: GSM48_PDISC_SMS:0x04 DREF MSISDN:42342: MSC conn use + 1 == 3 -DRLL Dispatching 04.08 message, pdisc=9 +DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x04 (0x9:0x4) DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_COMMUNICATING DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_ACCEPTED}: state_chg to SUBSCR_CONN_S_COMMUNICATING DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_COMMUNICATING}: Received Event SUBSCR_CONN_E_BUMP @@ -402,12 +402,12 @@ DREF MSISDN:42342: MSC conn use - 1 == 2 llist_count(&net->subscr_conns) == 1 - MS also sends RP-ACK, MSC in turn sends CP-ACK for that - rx from MS: pdisc=0x89 msg_type=0x01 + MSC <--RAN_GERAN_A-- MS: GSM48_PDISC_SMS:0x01 DREF MSISDN:42342: MSC conn use + 1 == 3 -DRLL Dispatching 04.08 message, pdisc=9 +DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_COMMUNICATING}: Received Event SUBSCR_CONN_E_COMMUNICATING DMSC msc_tx 2 bytes to MSISDN:42342 via RAN_GERAN_A -- DTAP --RAN_GERAN_A--> MS: 0904 +- DTAP --RAN_GERAN_A--> MS: GSM48_PDISC_SMS:0x04: 0904 - DTAP matches expected message DREF VLR subscr MSISDN:42342 usage decreases to: 3 DREF VLR subscr MSISDN:42342 usage decreases to: 2 @@ -432,10 +432,10 @@ llist_count(&net->subscr_conns) == 0 --- - subscriber detaches - rx from MS: pdisc=0x05 msg_type=0x01 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_IMSI_DETACH_IND new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_IMSI_DETACH_IND (0x5:0x1) DMM IMSI DETACH INDICATION: MI(IMSI)=901700000010650 DREF VLR subscr MSISDN:42342 usage increases to: 2 DMM IMSI DETACH for MSISDN:42342 @@ -453,10 +453,10 @@ ===== test_umts_authen_utran - Location Update request causes a GSUP Send Auth Info request to HLR - rx from MS: pdisc=0x05 msg_type=0x08 + MSC <--RAN_UTRAN_IU-- MS: GSM48_MT_MM_LOC_UPD_REQUEST new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_LOC_UPD_REQUEST (0x5:0x8) DREF unknown: MSC conn use + 1 == 2 DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_INIT}: Allocated DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_INIT}: Received Event SUBSCR_CONN_E_START @@ -500,9 +500,9 @@ auth_request_sent == 1 lu_result_sent == 0 - MS sends Authen Response, VLR accepts and sends SecurityModeControl - rx from MS: pdisc=0x05 msg_type=0x54 + MSC <--RAN_UTRAN_IU-- MS: GSM48_MT_MM_AUTH_RESP DREF IMSI:901700000010650: MSC conn use + 1 == 2 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_AUTH_RESP (0x5:0x14) DMM IMSI:901700000010650: MM R99 AUTHENTICATION RESPONSE (res = e229c19e791f2e41) DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_WAIT_RESP}: Received Event VLR_AUTH_E_MS_AUTH_RESP DVLR SUBSCR(IMSI:901700000010650) received res: e2 29 c1 9e 79 1f 2e 41 @@ -583,14 +583,14 @@ llist_count(&net->subscr_conns) == 1 msc_subscr_conn_is_accepted() == false requests shall be thwarted -DRLL Dispatching 04.08 message, pdisc=3 -DRLL subscr MSISDN:42342: Message not permitted for initial conn: pdisc=0x03 msg_type=0x05 -DRLL Dispatching 04.08 message, pdisc=5 -DRLL subscr MSISDN:42342: Message not permitted for initial conn: pdisc=0x05 msg_type=0x33 -DRLL Dispatching 04.08 message, pdisc=6 -DRLL subscr MSISDN:42342: Message not permitted for initial conn: pdisc=0x06 msg_type=0x19 -DRLL Dispatching 04.08 message, pdisc=9 -DRLL subscr MSISDN:42342: Message not permitted for initial conn: pdisc=0x09 msg_type=0x01 +DRLL Dispatching 04.08 message GSM48_MT_CC_SETUP (0x3:0x5) +DRLL subscr MSISDN:42342: Message not permitted for initial conn: GSM48_MT_CC_SETUP +DRLL Dispatching 04.08 message unknown 0x33 (0x5:0x33) +DRLL subscr MSISDN:42342: Message not permitted for initial conn: unknown 0x33 +DRLL Dispatching 04.08 message GSM48_MT_RR_SYSINFO_1 (0x6:0x19) +DRLL subscr MSISDN:42342: Message not permitted for initial conn: GSM48_MT_RR_SYSINFO_1 +DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) +DRLL subscr MSISDN:42342: Message not permitted for initial conn: GSM48_PDISC_SMS:0x01 - even though the TMSI is not acked, we can already find the subscr with it DREF VLR subscr MSISDN:42342 usage increases to: 2 vsub != NULL == 1 @@ -599,9 +599,9 @@ vsub->tmsi == 0xffffffff DREF VLR subscr MSISDN:42342 usage decreases to: 1 - MS sends TMSI Realloc Complete - rx from MS: pdisc=0x05 msg_type=0x5b + MSC <--RAN_UTRAN_IU-- MS: GSM48_MT_MM_TMSI_REALL_COMPL DREF MSISDN:42342: MSC conn use + 1 == 2 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_TMSI_REALL_COMPL (0x5:0x1b) DMM TMSI Reallocation Completed. Subscriber: MSISDN:42342 DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_WAIT_LU_COMPL}: Received Event VLR_ULA_E_NEW_TMSI_ACK DVLR lu_compl_vlr_fsm(901700000010650){LU_COMPL_VLR_S_WAIT_TMSI_CNF}: Received Event LU_COMPL_VLR_E_NEW_TMSI_ACK @@ -637,10 +637,10 @@ llist_count(&net->subscr_conns) == 0 --- - after a while, a new conn sends a CM Service Request. VLR responds with Auth Req, 2nd auth vector - rx from MS: pdisc=0x05 msg_type=0x24 + MSC <--RAN_UTRAN_IU-- MS: GSM48_MT_MM_CM_SERV_REQ new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_CM_SERV_REQ (0x5:0x24) DMM <- CM SERVICE REQUEST serv_type=0x08 MI(IMSI)=901700000010650 DREF unknown: MSC conn use + 1 == 2 DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_INIT}: Allocated @@ -671,18 +671,18 @@ - needs auth, not yet accepted msc_subscr_conn_is_accepted() == false requests shall be thwarted -DRLL Dispatching 04.08 message, pdisc=3 -DRLL subscr MSISDN:42342: Message not permitted for initial conn: pdisc=0x03 msg_type=0x05 -DRLL Dispatching 04.08 message, pdisc=5 -DRLL subscr MSISDN:42342: Message not permitted for initial conn: pdisc=0x05 msg_type=0x33 -DRLL Dispatching 04.08 message, pdisc=6 -DRLL subscr MSISDN:42342: Message not permitted for initial conn: pdisc=0x06 msg_type=0x19 -DRLL Dispatching 04.08 message, pdisc=9 -DRLL subscr MSISDN:42342: Message not permitted for initial conn: pdisc=0x09 msg_type=0x01 +DRLL Dispatching 04.08 message GSM48_MT_CC_SETUP (0x3:0x5) +DRLL subscr MSISDN:42342: Message not permitted for initial conn: GSM48_MT_CC_SETUP +DRLL Dispatching 04.08 message unknown 0x33 (0x5:0x33) +DRLL subscr MSISDN:42342: Message not permitted for initial conn: unknown 0x33 +DRLL Dispatching 04.08 message GSM48_MT_RR_SYSINFO_1 (0x6:0x19) +DRLL subscr MSISDN:42342: Message not permitted for initial conn: GSM48_MT_RR_SYSINFO_1 +DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) +DRLL subscr MSISDN:42342: Message not permitted for initial conn: GSM48_PDISC_SMS:0x01 - MS sends Authen Response, VLR accepts and sends SecurityModeControl - rx from MS: pdisc=0x05 msg_type=0x54 + MSC <--RAN_UTRAN_IU-- MS: GSM48_MT_MM_AUTH_RESP DREF MSISDN:42342: MSC conn use + 1 == 2 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_AUTH_RESP (0x5:0x14) DMM MSISDN:42342: MM R99 AUTHENTICATION RESPONSE (res = 7db47cf7f81e4dc7) DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_WAIT_RESP}: Received Event VLR_AUTH_E_MS_AUTH_RESP DVLR SUBSCR(MSISDN:42342) received res: 7d b4 7c f7 f8 1e 4d c7 @@ -725,16 +725,16 @@ - a USSD request is serviced expecting USSD: Your extension is 42342 - rx from MS: pdisc=0x0b msg_type=0x3b + MSC <--RAN_UTRAN_IU-- MS: GSM48_PDISC_NC_SS:0x3b DREF MSISDN:42342: MSC conn use + 1 == 2 -DRLL Dispatching 04.08 message, pdisc=11 -DMM MSISDN:42342 pdisc=11 msg_type=0x3b: received_cm_service_request changes to false +DRLL Dispatching 04.08 message GSM48_PDISC_NC_SS:0x3b (0xb:0x3b) +DMM MSISDN:42342: rx msg GSM48_PDISC_NC_SS:0x3b: received_cm_service_request changes to false DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_COMMUNICATING DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_ACCEPTED}: state_chg to SUBSCR_CONN_S_COMMUNICATING DMM USSD: Own number requested DMM MSISDN:42342: MSISDN = 42342 DMSC msc_tx 43 bytes to MSISDN:42342 via RAN_UTRAN_IU -- DTAP --RAN_UTRAN_IU--> MS: 8b2a1c27a225020100302002013b301b04010f0416d9775d0e2ae3e965f73cfd7683d273104d36a3c91a0d +- DTAP --RAN_UTRAN_IU--> MS: GSM48_PDISC_NC_SS:0x2a: 8b2a1c27a225020100302002013b301b04010f0416d9775d0e2ae3e965f73cfd7683d273104d36a3c91a0d - DTAP matches expected message DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_COMMUNICATING}: Received Event SUBSCR_CONN_E_BUMP DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_COMMUNICATING}: bump: releasing conn @@ -772,10 +772,10 @@ llist_count(&vsub->cs.requests) == 1 DREF VLR subscr MSISDN:42342 usage decreases to: 3 - MS replies with Paging Response, and VLR sends Auth Request with third key - rx from MS: pdisc=0x06 msg_type=0x27 + MSC <--RAN_UTRAN_IU-- MS: GSM48_MT_RR_PAG_RESP new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=6 +DRLL Dispatching 04.08 message GSM48_MT_RR_PAG_RESP (0x6:0x27) DRR PAGING RESPONSE: MI(IMSI)=901700000010650 DREF unknown: MSC conn use + 1 == 2 DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_INIT}: Allocated @@ -805,18 +805,18 @@ - needs auth, not yet accepted msc_subscr_conn_is_accepted() == false requests shall be thwarted -DRLL Dispatching 04.08 message, pdisc=3 -DRLL subscr MSISDN:42342: Message not permitted for initial conn: pdisc=0x03 msg_type=0x05 -DRLL Dispatching 04.08 message, pdisc=5 -DRLL subscr MSISDN:42342: Message not permitted for initial conn: pdisc=0x05 msg_type=0x33 -DRLL Dispatching 04.08 message, pdisc=6 -DRLL subscr MSISDN:42342: Message not permitted for initial conn: pdisc=0x06 msg_type=0x19 -DRLL Dispatching 04.08 message, pdisc=9 -DRLL subscr MSISDN:42342: Message not permitted for initial conn: pdisc=0x09 msg_type=0x01 +DRLL Dispatching 04.08 message GSM48_MT_CC_SETUP (0x3:0x5) +DRLL subscr MSISDN:42342: Message not permitted for initial conn: GSM48_MT_CC_SETUP +DRLL Dispatching 04.08 message unknown 0x33 (0x5:0x33) +DRLL subscr MSISDN:42342: Message not permitted for initial conn: unknown 0x33 +DRLL Dispatching 04.08 message GSM48_MT_RR_SYSINFO_1 (0x6:0x19) +DRLL subscr MSISDN:42342: Message not permitted for initial conn: GSM48_MT_RR_SYSINFO_1 +DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) +DRLL subscr MSISDN:42342: Message not permitted for initial conn: GSM48_PDISC_SMS:0x01 - MS sends Authen Response, VLR accepts and sends SecurityModeControl - rx from MS: pdisc=0x05 msg_type=0x54 + MSC <--RAN_UTRAN_IU-- MS: GSM48_MT_MM_AUTH_RESP DREF MSISDN:42342: MSC conn use + 1 == 2 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_AUTH_RESP (0x5:0x14) DMM MSISDN:42342: MM R99 AUTHENTICATION RESPONSE (res = 706f996719ba609c) DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_WAIT_RESP}: Received Event VLR_AUTH_E_MS_AUTH_RESP DVLR SUBSCR(MSISDN:42342) received res: 70 6f 99 67 19 ba 60 9c @@ -857,7 +857,7 @@ DREF VLR subscr MSISDN:42342 usage increases to: 5 DREF MSISDN:42342: MSC conn use + 1 == 2 DMSC msc_tx 91 bytes to MSISDN:42342 via RAN_UTRAN_IU -- DTAP --RAN_UTRAN_IU--> MS: 09015801000791447758100650004c0005802443f2000007101000000000445079da1e1ee7416937485e9ea7c965373d1d6683c270383b3d0ed3d36ff71c949e83c22072799e9687c5ec32a81d96afcbf4b4fb0c7ac3e9e9b7db05 +- DTAP --RAN_UTRAN_IU--> MS: GSM48_PDISC_SMS:0x01: 09015801000791447758100650004c0005802443f2000007101000000000445079da1e1ee7416937485e9ea7c965373d1d6683c270383b3d0ed3d36ff71c949e83c22072799e9687c5ec32a81d96afcbf4b4fb0c7ac3e9e9b7db05 - DTAP matches expected message DREF VLR subscr MSISDN:42342 usage decreases to: 4 DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_BUMP @@ -870,9 +870,9 @@ - conn is still open to wait for SMS ack dance llist_count(&net->subscr_conns) == 1 - MS replies with CP-ACK for received SMS - rx from MS: pdisc=0x89 msg_type=0x04 + MSC <--RAN_UTRAN_IU-- MS: GSM48_PDISC_SMS:0x04 DREF MSISDN:42342: MSC conn use + 1 == 3 -DRLL Dispatching 04.08 message, pdisc=9 +DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x04 (0x9:0x4) DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_COMMUNICATING DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_ACCEPTED}: state_chg to SUBSCR_CONN_S_COMMUNICATING DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_COMMUNICATING}: Received Event SUBSCR_CONN_E_BUMP @@ -880,12 +880,12 @@ DREF MSISDN:42342: MSC conn use - 1 == 2 llist_count(&net->subscr_conns) == 1 - MS also sends RP-ACK, MSC in turn sends CP-ACK for that - rx from MS: pdisc=0x89 msg_type=0x01 + MSC <--RAN_UTRAN_IU-- MS: GSM48_PDISC_SMS:0x01 DREF MSISDN:42342: MSC conn use + 1 == 3 -DRLL Dispatching 04.08 message, pdisc=9 +DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_COMMUNICATING}: Received Event SUBSCR_CONN_E_COMMUNICATING DMSC msc_tx 2 bytes to MSISDN:42342 via RAN_UTRAN_IU -- DTAP --RAN_UTRAN_IU--> MS: 0904 +- DTAP --RAN_UTRAN_IU--> MS: GSM48_PDISC_SMS:0x04: 0904 - DTAP matches expected message DREF VLR subscr MSISDN:42342 usage decreases to: 3 DREF VLR subscr MSISDN:42342 usage decreases to: 2 @@ -911,10 +911,10 @@ llist_count(&net->subscr_conns) == 0 --- - subscriber detaches - rx from MS: pdisc=0x05 msg_type=0x01 + MSC <--RAN_UTRAN_IU-- MS: GSM48_MT_MM_IMSI_DETACH_IND new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_IMSI_DETACH_IND (0x5:0x1) DMM IMSI DETACH INDICATION: MI(IMSI)=901700000010650 DREF VLR subscr MSISDN:42342 usage increases to: 2 DMM IMSI DETACH for MSISDN:42342 @@ -933,10 +933,10 @@ ===== test_umts_authen_resync_geran - Location Update request causes a GSUP Send Auth Info request to HLR - rx from MS: pdisc=0x05 msg_type=0x08 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_LOC_UPD_REQUEST new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_LOC_UPD_REQUEST (0x5:0x8) DREF unknown: MSC conn use + 1 == 2 DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_INIT}: Allocated DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_INIT}: Received Event SUBSCR_CONN_E_START @@ -980,9 +980,9 @@ auth_request_sent == 1 lu_result_sent == 0 - MS sends Authen Failure with Resync cause, VLR sends GSUP to HLR to resync - rx from MS: pdisc=0x05 msg_type=0x1c + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_AUTH_FAIL DREF IMSI:901700000010650: MSC conn use + 1 == 2 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_AUTH_FAIL (0x5:0x1c) DMM IMSI:901700000010650: MM R99 AUTHENTICATION SYNCH (AUTS = 979498b1f72d3e28c59fa2e72f9c) DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_WAIT_RESP}: Received Event VLR_AUTH_E_MS_AUTH_FAIL DVLR GSUP tx: 08010809710000000156f0260e979498b1f72d3e28c59fa2e72f9c201039fa2f4e3d523d8619a73b4f65c3e14d @@ -1010,9 +1010,9 @@ auth_request_sent == 1 lu_result_sent == 0 - MS sends Authen Response, VLR accepts and sends GSUP LU Req to HLR - rx from MS: pdisc=0x05 msg_type=0x54 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_AUTH_RESP DREF IMSI:901700000010650: MSC conn use + 1 == 2 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_AUTH_RESP (0x5:0x14) DMM IMSI:901700000010650: MM R99 AUTHENTICATION RESPONSE (res = 1df5f0b4f22b696e) DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_WAIT_RESP_RESYNC}: Received Event VLR_AUTH_E_MS_AUTH_RESP DVLR SUBSCR(IMSI:901700000010650) received res: 1d f5 f0 b4 f2 2b 69 6e @@ -1084,14 +1084,14 @@ llist_count(&net->subscr_conns) == 1 msc_subscr_conn_is_accepted() == false requests shall be thwarted -DRLL Dispatching 04.08 message, pdisc=3 -DRLL subscr MSISDN:42342: Message not permitted for initial conn: pdisc=0x03 msg_type=0x05 -DRLL Dispatching 04.08 message, pdisc=5 -DRLL subscr MSISDN:42342: Message not permitted for initial conn: pdisc=0x05 msg_type=0x33 -DRLL Dispatching 04.08 message, pdisc=6 -DRLL subscr MSISDN:42342: Message not permitted for initial conn: pdisc=0x06 msg_type=0x19 -DRLL Dispatching 04.08 message, pdisc=9 -DRLL subscr MSISDN:42342: Message not permitted for initial conn: pdisc=0x09 msg_type=0x01 +DRLL Dispatching 04.08 message GSM48_MT_CC_SETUP (0x3:0x5) +DRLL subscr MSISDN:42342: Message not permitted for initial conn: GSM48_MT_CC_SETUP +DRLL Dispatching 04.08 message unknown 0x33 (0x5:0x33) +DRLL subscr MSISDN:42342: Message not permitted for initial conn: unknown 0x33 +DRLL Dispatching 04.08 message GSM48_MT_RR_SYSINFO_1 (0x6:0x19) +DRLL subscr MSISDN:42342: Message not permitted for initial conn: GSM48_MT_RR_SYSINFO_1 +DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) +DRLL subscr MSISDN:42342: Message not permitted for initial conn: GSM48_PDISC_SMS:0x01 - even though the TMSI is not acked, we can already find the subscr with it DREF VLR subscr MSISDN:42342 usage increases to: 2 vsub != NULL == 1 @@ -1100,9 +1100,9 @@ vsub->tmsi == 0xffffffff DREF VLR subscr MSISDN:42342 usage decreases to: 1 - MS sends TMSI Realloc Complete - rx from MS: pdisc=0x05 msg_type=0x5b + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_TMSI_REALL_COMPL DREF MSISDN:42342: MSC conn use + 1 == 2 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_TMSI_REALL_COMPL (0x5:0x1b) DMM TMSI Reallocation Completed. Subscriber: MSISDN:42342 DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_WAIT_LU_COMPL}: Received Event VLR_ULA_E_NEW_TMSI_ACK DVLR lu_compl_vlr_fsm(901700000010650){LU_COMPL_VLR_S_WAIT_TMSI_CNF}: Received Event LU_COMPL_VLR_E_NEW_TMSI_ACK @@ -1143,10 +1143,10 @@ ===== test_umts_authen_resync_utran - Location Update request causes a GSUP Send Auth Info request to HLR - rx from MS: pdisc=0x05 msg_type=0x08 + MSC <--RAN_UTRAN_IU-- MS: GSM48_MT_MM_LOC_UPD_REQUEST new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_LOC_UPD_REQUEST (0x5:0x8) DREF unknown: MSC conn use + 1 == 2 DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_INIT}: Allocated DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_INIT}: Received Event SUBSCR_CONN_E_START @@ -1190,9 +1190,9 @@ auth_request_sent == 1 lu_result_sent == 0 - MS sends Authen Failure with Resync cause, VLR sends GSUP to HLR to resync - rx from MS: pdisc=0x05 msg_type=0x1c + MSC <--RAN_UTRAN_IU-- MS: GSM48_MT_MM_AUTH_FAIL DREF IMSI:901700000010650: MSC conn use + 1 == 2 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_AUTH_FAIL (0x5:0x1c) DMM IMSI:901700000010650: MM R99 AUTHENTICATION SYNCH (AUTS = 979498b1f72d3e28c59fa2e72f9c) DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_WAIT_RESP}: Received Event VLR_AUTH_E_MS_AUTH_FAIL DVLR GSUP tx: 08010809710000000156f0260e979498b1f72d3e28c59fa2e72f9c201039fa2f4e3d523d8619a73b4f65c3e14d @@ -1220,9 +1220,9 @@ auth_request_sent == 1 lu_result_sent == 0 - MS sends Authen Response, VLR accepts and sends SecurityModeControl - rx from MS: pdisc=0x05 msg_type=0x54 + MSC <--RAN_UTRAN_IU-- MS: GSM48_MT_MM_AUTH_RESP DREF IMSI:901700000010650: MSC conn use + 1 == 2 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_AUTH_RESP (0x5:0x14) DMM IMSI:901700000010650: MM R99 AUTHENTICATION RESPONSE (res = 1df5f0b4f22b696e) DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_WAIT_RESP_RESYNC}: Received Event VLR_AUTH_E_MS_AUTH_RESP DVLR SUBSCR(IMSI:901700000010650) received res: 1d f5 f0 b4 f2 2b 69 6e @@ -1303,14 +1303,14 @@ llist_count(&net->subscr_conns) == 1 msc_subscr_conn_is_accepted() == false requests shall be thwarted -DRLL Dispatching 04.08 message, pdisc=3 -DRLL subscr MSISDN:42342: Message not permitted for initial conn: pdisc=0x03 msg_type=0x05 -DRLL Dispatching 04.08 message, pdisc=5 -DRLL subscr MSISDN:42342: Message not permitted for initial conn: pdisc=0x05 msg_type=0x33 -DRLL Dispatching 04.08 message, pdisc=6 -DRLL subscr MSISDN:42342: Message not permitted for initial conn: pdisc=0x06 msg_type=0x19 -DRLL Dispatching 04.08 message, pdisc=9 -DRLL subscr MSISDN:42342: Message not permitted for initial conn: pdisc=0x09 msg_type=0x01 +DRLL Dispatching 04.08 message GSM48_MT_CC_SETUP (0x3:0x5) +DRLL subscr MSISDN:42342: Message not permitted for initial conn: GSM48_MT_CC_SETUP +DRLL Dispatching 04.08 message unknown 0x33 (0x5:0x33) +DRLL subscr MSISDN:42342: Message not permitted for initial conn: unknown 0x33 +DRLL Dispatching 04.08 message GSM48_MT_RR_SYSINFO_1 (0x6:0x19) +DRLL subscr MSISDN:42342: Message not permitted for initial conn: GSM48_MT_RR_SYSINFO_1 +DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) +DRLL subscr MSISDN:42342: Message not permitted for initial conn: GSM48_PDISC_SMS:0x01 - even though the TMSI is not acked, we can already find the subscr with it DREF VLR subscr MSISDN:42342 usage increases to: 2 vsub != NULL == 1 @@ -1319,9 +1319,9 @@ vsub->tmsi == 0xffffffff DREF VLR subscr MSISDN:42342 usage decreases to: 1 - MS sends TMSI Realloc Complete - rx from MS: pdisc=0x05 msg_type=0x5b + MSC <--RAN_UTRAN_IU-- MS: GSM48_MT_MM_TMSI_REALL_COMPL DREF MSISDN:42342: MSC conn use + 1 == 2 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_TMSI_REALL_COMPL (0x5:0x1b) DMM TMSI Reallocation Completed. Subscriber: MSISDN:42342 DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_WAIT_LU_COMPL}: Received Event VLR_ULA_E_NEW_TMSI_ACK DVLR lu_compl_vlr_fsm(901700000010650){LU_COMPL_VLR_S_WAIT_TMSI_CNF}: Received Event LU_COMPL_VLR_E_NEW_TMSI_ACK diff --git a/tests/msc_vlr/msc_vlr_tests.c b/tests/msc_vlr/msc_vlr_tests.c index 28201d0..a90366b 100644 --- a/tests/msc_vlr/msc_vlr_tests.c +++ b/tests/msc_vlr/msc_vlr_tests.c @@ -69,6 +69,17 @@ return msg; } +const char *gh_type_name(struct gsm48_hdr *gh) +{ + return gsm48_pdisc_msgtype_name(gsm48_hdr_pdisc(gh), + gsm48_hdr_msg_type(gh)); +} + +const char *msg_type_name(struct msgb *msg) +{ + return gh_type_name((void*)msg->data); +} + void dtap_expect_tx(const char *hex) { /* Has the previously expected dtap been received? */ @@ -153,8 +164,10 @@ int rc; struct gsm48_hdr *gh = msgb_l3(msg); - log("rx from MS: pdisc=0x%02x msg_type=0x%02x", - gh->proto_discr, gh->msg_type); + + log("MSC <--%s-- MS: %s", + ran_type_name(rx_from_ran), + gh_type_name(gh)); if (g_conn && !conn_exists(g_conn)) g_conn = NULL; @@ -427,8 +440,9 @@ int _validate_dtap(struct msgb *msg, enum ran_type to_ran) { - btw("DTAP --%s--> MS: %s", - ran_type_name(to_ran), + struct gsm48_hdr *gh = (void*)msg->data; + btw("DTAP --%s--> MS: %s: %s", + ran_type_name(to_ran), msg_type_name(msg), osmo_hexdump_nospc(msg->data, msg->len)); OSMO_ASSERT(dtap_tx_expected); -- To view, visit https://gerrit.osmocom.org/3350 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ida205d217e304337d816b14fd15e2ee435e7397d Gerrit-PatchSet: 6 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Thu Aug 10 20:13:56 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 10 Aug 2017 20:13:56 +0000 Subject: libosmocore[master]: lapd_core: Fix crash in lapd_est_req() function In-Reply-To: References: Message-ID: Patch Set 1: could we have a unit test case to avoid regressions here? Also, is this an overlap with gerrit 266 or 3257? -- To view, visit https://gerrit.osmocom.org/3467 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I306dad9b78e3becaef14c5305ec25c312feefe3c Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Ivan Kluchnikov Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Aug 10 20:15:45 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 10 Aug 2017 20:15:45 +0000 Subject: openbsc[master]: handover_logic: set correct link to bts for subscriber_conne... In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3466 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Idc7dd412b7580c451e716b73ef7549826c60b0d9 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Ivan Kluchnikov Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Aug 10 20:16:11 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 10 Aug 2017 20:16:11 +0000 Subject: openbsc[master]: libmsc: gsm340_gen_oa_sub() may return negative value In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3461 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I47215d7d89771730a7f84efa8aeeb187a0911fdb Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Pablo Neira Ayuso Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Aug 10 20:16:12 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 10 Aug 2017 20:16:12 +0000 Subject: [MERGED] openbsc[master]: libmsc: gsm340_gen_oa_sub() may return negative value In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: libmsc: gsm340_gen_oa_sub() may return negative value ...................................................................... libmsc: gsm340_gen_oa_sub() may return negative value gsm340_gen_oa() returns a negative value if the output buffer that the caller passes is too small, so we have to check the return value of this function. Fixes: CID 174178 Fixes: CID 174179 Change-Id: I47215d7d89771730a7f84efa8aeeb187a0911fdb --- M openbsc/src/libmsc/gsm_04_11.c 1 file changed, 9 insertions(+), 2 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/openbsc/src/libmsc/gsm_04_11.c b/openbsc/src/libmsc/gsm_04_11.c index 73e0f55..8b4ffce 100644 --- a/openbsc/src/libmsc/gsm_04_11.c +++ b/openbsc/src/libmsc/gsm_04_11.c @@ -213,9 +213,9 @@ { uint8_t *smsp; uint8_t oa[12]; /* max len per 03.40 */ - uint8_t oa_len = 0; uint8_t octet_len; unsigned int old_msg_len = msg->len; + int oa_len; /* generate first octet with masked bits */ smsp = msgb_put(msg, 1); @@ -233,6 +233,9 @@ /* generate originator address */ oa_len = gsm340_gen_oa_sub(oa, sizeof(oa), &sms->src); + if (oa_len < 0) + return -ENOSPC; + smsp = msgb_put(msg, oa_len); memcpy(smsp, oa, oa_len); @@ -282,9 +285,9 @@ struct gsm_sms *sms) { unsigned int old_msg_len = msg->len; - uint8_t oa_len = 0; uint8_t oa[12]; /* max len per 03.40 */ uint8_t *smsp; + int oa_len; /* generate first octet with masked bits */ smsp = msgb_put(msg, 1); @@ -296,8 +299,12 @@ /* TP-MR (message reference) */ smsp = msgb_put(msg, 1); *smsp = sms->msg_ref; + /* generate recipient address */ oa_len = gsm340_gen_oa_sub(oa, sizeof(oa), &sms->dst); + if (oa_len < 0) + return -ENOSPC; + smsp = msgb_put(msg, oa_len); memcpy(smsp, oa, oa_len); -- To view, visit https://gerrit.osmocom.org/3461 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I47215d7d89771730a7f84efa8aeeb187a0911fdb Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Pablo Neira Ayuso Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Thu Aug 10 20:16:52 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 10 Aug 2017 20:16:52 +0000 Subject: openbsc[master]: libmsc: Remove comment not applying anymore In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3465 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I204f098c8f2a480405446113e2181b2c53700cf3 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pablo Neira Ayuso Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Aug 10 20:16:55 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 10 Aug 2017 20:16:55 +0000 Subject: [MERGED] openbsc[master]: libmsc: Remove comment not applying anymore In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: libmsc: Remove comment not applying anymore ...................................................................... libmsc: Remove comment not applying anymore The change-id I7276d356d805a83ebeec72b02c8563b7135ea0b6 added msg_ref to the databse but forgot to remove the comment stating it's not being stored. Change-Id: I204f098c8f2a480405446113e2181b2c53700cf3 --- M openbsc/src/libmsc/db.c 1 file changed, 0 insertions(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/openbsc/src/libmsc/db.c b/openbsc/src/libmsc/db.c index 9945dca..631e05f 100644 --- a/openbsc/src/libmsc/db.c +++ b/openbsc/src/libmsc/db.c @@ -1649,7 +1649,6 @@ sms->protocol_id = dbi_result_get_ulonglong(result, "protocol_id"); sms->data_coding_scheme = dbi_result_get_ulonglong(result, "data_coding_scheme"); - /* sms->msg_ref is temporary and not stored in DB */ sms->dst.npi = dbi_result_get_ulonglong(result, "dest_npi"); sms->dst.ton = dbi_result_get_ulonglong(result, "dest_ton"); -- To view, visit https://gerrit.osmocom.org/3465 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I204f098c8f2a480405446113e2181b2c53700cf3 Gerrit-PatchSet: 2 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pablo Neira Ayuso From gerrit-no-reply at lists.osmocom.org Fri Aug 11 02:21:07 2017 From: gerrit-no-reply at lists.osmocom.org (Holger Freyther) Date: Fri, 11 Aug 2017 02:21:07 +0000 Subject: libosmocore[master]: lapd_core: Fix crash in lapd_est_req() function In-Reply-To: References: Message-ID: Patch Set 1: Could you put a backtrace into the commit message? -- To view, visit https://gerrit.osmocom.org/3467 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I306dad9b78e3becaef14c5305ec25c312feefe3c Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Ivan Kluchnikov Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Aug 11 10:14:13 2017 From: gerrit-no-reply at lists.osmocom.org (Pablo Neira Ayuso) Date: Fri, 11 Aug 2017 10:14:13 +0000 Subject: [PATCH] libsmpp34[master]: add smpp34_tlv_for_each() helper Message-ID: Review at https://gerrit.osmocom.org/3469 add smpp34_tlv_for_each() helper So we don't need to remember this is an opencoded list of TLVs. Change-Id: I446929feed049d0411e1629ca263e2bc41f714cc --- M src/smpp34_structs.h 1 file changed, 3 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libsmpp34 refs/changes/69/3469/1 diff --git a/src/smpp34_structs.h b/src/smpp34_structs.h index b9effb2..025109d 100644 --- a/src/smpp34_structs.h +++ b/src/smpp34_structs.h @@ -86,6 +86,9 @@ OCTET16( inst, octet, size ); \ } par; +#define smpp34_tlv_for_each(pos, head) \ + for (pos = (head); pos != NULL; pos = pos->next) + #define DAD( inst, par, do_dest_address ) dad_t *par; #define UU2( inst, par, size ) union { \ struct { \ -- To view, visit https://gerrit.osmocom.org/3469 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I446929feed049d0411e1629ca263e2bc41f714cc Gerrit-PatchSet: 1 Gerrit-Project: libsmpp34 Gerrit-Branch: master Gerrit-Owner: Pablo Neira Ayuso From gerrit-no-reply at lists.osmocom.org Fri Aug 11 10:38:18 2017 From: gerrit-no-reply at lists.osmocom.org (Pablo Neira Ayuso) Date: Fri, 11 Aug 2017 10:38:18 +0000 Subject: openbsc[master]: libmsc: update database to accomodate SMS status-report fields In-Reply-To: References: Message-ID: Patch Set 4: When would it be good time to remove code for backward compatibility? Holger added v3 by 2014-03-07, it's a bit more than 3 years now. -- To view, visit https://gerrit.osmocom.org/3435 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I7276d356d805a83ebeec72b02c8563b7135ea0b6 Gerrit-PatchSet: 4 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Pablo Neira Ayuso Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Keith Whyte Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pablo Neira Ayuso Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Aug 11 10:50:05 2017 From: gerrit-no-reply at lists.osmocom.org (Pablo Neira Ayuso) Date: Fri, 11 Aug 2017 10:50:05 +0000 Subject: [PATCH] openbsc[master]: libmsc: use smpp34_tlv_for_each() to avoid suboptimal TLV ha... Message-ID: Review at https://gerrit.osmocom.org/3470 libmsc: use smpp34_tlv_for_each() to avoid suboptimal TLV handling submit_to_sms() now handles two TLVs, so find_tlv() is suboptiomal and it can be removed, since it would result in two passes on the TLV list. Use new smpp34_tlv_for_each() helper to iterate over the list of TLVs. Change-Id: I53a65164a6cc4abc6bf57d9a8dc275cf21c90222 --- M openbsc/src/libmsc/smpp_openbsc.c 1 file changed, 41 insertions(+), 31 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/70/3470/1 diff --git a/openbsc/src/libmsc/smpp_openbsc.c b/openbsc/src/libmsc/smpp_openbsc.c index 85de040..b2944a9 100644 --- a/openbsc/src/libmsc/smpp_openbsc.c +++ b/openbsc/src/libmsc/smpp_openbsc.c @@ -72,26 +72,31 @@ return subscr; } -/*! \brief find a TLV with given tag in list of libsmpp34 TLVs */ -static struct tlv_t *find_tlv(struct tlv_t *head, uint16_t tag) +static int smpp34_submit_tlv_msg_payload(const struct tlv_t *t, + const struct submit_sm_t *submit, + const uint8_t **sms_msg, + unsigned int *sms_msg_len) { - struct tlv_t *t; - - for (t = head; t != NULL; t = t->next) { - if (t->tag == tag) - return t; + if (submit->sm_length) { + LOGP(DLSMS, LOGL_ERROR, + "SMPP cannot have payload in TLV _and_ in the header\n"); + return -1; } - return NULL; + *sms_msg = t->value.octet; + *sms_msg_len = t->length; + + return 0; } /*! \brief convert from submit_sm_t to gsm_sms */ static int submit_to_sms(struct gsm_sms **psms, struct gsm_network *net, const struct submit_sm_t *submit) { + const uint8_t *sms_msg = NULL; struct gsm_subscriber *dest; + uint8_t msg_ref = 0; struct gsm_sms *sms; struct tlv_t *t; - const uint8_t *sms_msg; unsigned int sms_msg_len; int mode; @@ -105,31 +110,40 @@ return ESME_RINVDSTADR; } - t = find_tlv(submit->tlv, TLVID_message_payload); - if (t) { - if (submit->sm_length) { - /* ERROR: we cannot have both! */ - LOGP(DLSMS, LOGL_ERROR, "SMPP Cannot have payload in " - "TLV _and_ in the header\n"); - subscr_put(dest); - return ESME_ROPTPARNOTALLWD; + smpp34_tlv_for_each(t, submit->tlv) { + switch (t->tag) { + case TLVID_message_payload: + if (smpp34_submit_tlv_msg_payload(t, submit, &sms_msg, + &sms_msg_len) < 0) { + subscr_put(dest); + return ESME_ROPTPARNOTALLWD; + } + break; + case TLVID_user_message_reference: + msg_ref = ntohs(t->value.val16); + break; + default: + break; } - sms_msg = t->value.octet; - sms_msg_len = t->length; - } else if (submit->sm_length > 0 && submit->sm_length < 255) { - sms_msg = submit->short_message; - sms_msg_len = submit->sm_length; - } else { - LOGP(DLSMS, LOGL_ERROR, - "SMPP neither message payload nor valid sm_length.\n"); - subscr_put(dest); - return ESME_RINVPARLEN; + } + + if (!sms_msg) { + if (submit->sm_length > 0 && submit->sm_length < 255) { + sms_msg = submit->short_message; + sms_msg_len = submit->sm_length; + } else { + LOGP(DLSMS, LOGL_ERROR, + "SMPP neither message payload nor valid sm_length.\n"); + subscr_put(dest); + return ESME_RINVPARLEN; + } } sms = sms_alloc(); sms->source = SMS_SOURCE_SMPP; sms->smpp.sequence_nr = submit->sequence_number; sms->status_rep_req = submit->registered_delivery; + sms->msg_ref = msg_ref; /* fill in the destination address */ sms->receiver = dest; @@ -203,10 +217,6 @@ memcpy(sms->user_data, sms_msg, sms_msg_len); sms->user_data_len = sms_msg_len; } - - t = find_tlv(submit->tlv, TLVID_user_message_reference); - if (t) - sms->msg_ref = ntohs(t->value.val16); *psms = sms; return ESME_ROK; -- To view, visit https://gerrit.osmocom.org/3470 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I53a65164a6cc4abc6bf57d9a8dc275cf21c90222 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Pablo Neira Ayuso From gerrit-no-reply at lists.osmocom.org Fri Aug 11 10:54:32 2017 From: gerrit-no-reply at lists.osmocom.org (Pablo Neira Ayuso) Date: Fri, 11 Aug 2017 10:54:32 +0000 Subject: [PATCH] openbsc[master]: libmsc: use smpp34_tlv_for_each() to avoid suboptimal TLV ha... In-Reply-To: References: Message-ID: libmsc: use smpp34_tlv_for_each() to avoid suboptimal TLV handling submit_to_sms() now handles two TLVs, so find_tlv() is suboptiomal and it can be removed, since it would result in two passes on the TLV list. Use new smpp34_tlv_for_each() helper to iterate over the list of TLVs. Change-Id: I53a65164a6cc4abc6bf57d9a8dc275cf21c90222 --- M openbsc/src/libmsc/smpp_openbsc.c 1 file changed, 41 insertions(+), 31 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/70/3470/2 diff --git a/openbsc/src/libmsc/smpp_openbsc.c b/openbsc/src/libmsc/smpp_openbsc.c index 85de040..7e23abd 100644 --- a/openbsc/src/libmsc/smpp_openbsc.c +++ b/openbsc/src/libmsc/smpp_openbsc.c @@ -72,26 +72,31 @@ return subscr; } -/*! \brief find a TLV with given tag in list of libsmpp34 TLVs */ -static struct tlv_t *find_tlv(struct tlv_t *head, uint16_t tag) +static int smpp34_submit_tlv_msg_payload(const struct tlv_t *t, + const struct submit_sm_t *submit, + const uint8_t **sms_msg, + unsigned int *sms_msg_len) { - struct tlv_t *t; - - for (t = head; t != NULL; t = t->next) { - if (t->tag == tag) - return t; + if (submit->sm_length) { + LOGP(DLSMS, LOGL_ERROR, + "SMPP cannot have payload in TLV _and_ in the header\n"); + return -1; } - return NULL; + *sms_msg = t->value.octet; + *sms_msg_len = t->length; + + return 0; } /*! \brief convert from submit_sm_t to gsm_sms */ static int submit_to_sms(struct gsm_sms **psms, struct gsm_network *net, const struct submit_sm_t *submit) { + const uint8_t *sms_msg = NULL; struct gsm_subscriber *dest; + uint16_t msg_ref = 0; struct gsm_sms *sms; struct tlv_t *t; - const uint8_t *sms_msg; unsigned int sms_msg_len; int mode; @@ -105,31 +110,40 @@ return ESME_RINVDSTADR; } - t = find_tlv(submit->tlv, TLVID_message_payload); - if (t) { - if (submit->sm_length) { - /* ERROR: we cannot have both! */ - LOGP(DLSMS, LOGL_ERROR, "SMPP Cannot have payload in " - "TLV _and_ in the header\n"); - subscr_put(dest); - return ESME_ROPTPARNOTALLWD; + smpp34_tlv_for_each(t, submit->tlv) { + switch (t->tag) { + case TLVID_message_payload: + if (smpp34_submit_tlv_msg_payload(t, submit, &sms_msg, + &sms_msg_len) < 0) { + subscr_put(dest); + return ESME_ROPTPARNOTALLWD; + } + break; + case TLVID_user_message_reference: + msg_ref = ntohs(t->value.val16); + break; + default: + break; } - sms_msg = t->value.octet; - sms_msg_len = t->length; - } else if (submit->sm_length > 0 && submit->sm_length < 255) { - sms_msg = submit->short_message; - sms_msg_len = submit->sm_length; - } else { - LOGP(DLSMS, LOGL_ERROR, - "SMPP neither message payload nor valid sm_length.\n"); - subscr_put(dest); - return ESME_RINVPARLEN; + } + + if (!sms_msg) { + if (submit->sm_length > 0 && submit->sm_length < 255) { + sms_msg = submit->short_message; + sms_msg_len = submit->sm_length; + } else { + LOGP(DLSMS, LOGL_ERROR, + "SMPP neither message payload nor valid sm_length.\n"); + subscr_put(dest); + return ESME_RINVPARLEN; + } } sms = sms_alloc(); sms->source = SMS_SOURCE_SMPP; sms->smpp.sequence_nr = submit->sequence_number; sms->status_rep_req = submit->registered_delivery; + sms->msg_ref = msg_ref; /* fill in the destination address */ sms->receiver = dest; @@ -203,10 +217,6 @@ memcpy(sms->user_data, sms_msg, sms_msg_len); sms->user_data_len = sms_msg_len; } - - t = find_tlv(submit->tlv, TLVID_user_message_reference); - if (t) - sms->msg_ref = ntohs(t->value.val16); *psms = sms; return ESME_ROK; -- To view, visit https://gerrit.osmocom.org/3470 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I53a65164a6cc4abc6bf57d9a8dc275cf21c90222 Gerrit-PatchSet: 2 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Pablo Neira Ayuso Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Fri Aug 11 10:56:28 2017 From: gerrit-no-reply at lists.osmocom.org (Holger Freyther) Date: Fri, 11 Aug 2017 10:56:28 +0000 Subject: openbsc[master]: libmsc: update database to accomodate SMS status-report fields In-Reply-To: References: Message-ID: Patch Set 4: > When would it be good time to remove code for backward > compatibility? > > Holger added v3 by 2014-03-07, it's a bit more than 3 years now. I don't know... let me try to build an opinion :) * The nitb in the current form is deprecated anyway. So spending time to remove compat seems wasted? * We have integration test support to migrate from version 3 up (e.g. tests/db/hlr.sqlite3) * We don't seem to change schema frequently? >From my point of view the code is not subject to bitrot, has little maintenance requirement (have not touched it in quite some time) and will die soon anyway. I wouldn't touch it now. -- To view, visit https://gerrit.osmocom.org/3435 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I7276d356d805a83ebeec72b02c8563b7135ea0b6 Gerrit-PatchSet: 4 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Pablo Neira Ayuso Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Keith Whyte Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pablo Neira Ayuso Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Aug 11 10:57:23 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 11 Aug 2017 10:57:23 +0000 Subject: [PATCH] openggsn[master]: Support setting TUN device IPv6 address + prefix In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3408 to look at the new patch set (#8). Support setting TUN device IPv6 address + prefix As we can now have PDP contexts with IPv6 user IP payload, it is useful to extend the TUN related code to be able to configure the tun device IPv6 address + prefix length Change-Id: I899d21e52d02e0b8384af29ddd489ff19c8f2cf6 --- M ggsn/ggsn.c M lib/tun.c M lib/tun.h 3 files changed, 127 insertions(+), 17 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openggsn refs/changes/08/3408/8 diff --git a/ggsn/ggsn.c b/ggsn/ggsn.c index 991b54c..05a56ae 100644 --- a/ggsn/ggsn.c +++ b/ggsn/ggsn.c @@ -70,7 +70,7 @@ int maxfd = 0; /* For select() */ struct in_addr listen_; -struct in_addr netaddr, destaddr, net; /* Network interface */ +struct in46_addr netaddr, destaddr, net; /* Network interface */ size_t prefixlen; struct in46_addr dns1, dns2; /* PCO DNS address */ char *ipup, *ipdown; /* Filename of scripts */ @@ -547,16 +547,16 @@ /* net */ /* Store net as in_addr net and mask */ if (args_info.net_arg) { - struct in46_addr in46; - if (ippool_aton(&in46, &prefixlen, args_info.net_arg, 0)) { + if (ippool_aton(&net, &prefixlen, args_info.net_arg, 0)) { SYS_ERR(DGGSN, LOGL_ERROR, 0, "Invalid network address: %s!", args_info.net_arg); exit(1); } - net.s_addr = in46.v4.s_addr; - netaddr.s_addr = htonl(ntohl(net.s_addr) + 1); - destaddr.s_addr = htonl(ntohl(net.s_addr) + 1); + /* default for network + destination address = net + 1 */ + netaddr = net; + in46a_inc(&netaddr); + destaddr = netaddr; } else { SYS_ERR(DGGSN, LOGL_ERROR, 0, "Network address must be specified: %s!", @@ -710,7 +710,7 @@ maxfd = gsn->fd1u; /* use GTP kernel module for data packet encapsulation */ - if (gtp_kernel_init(gsn, &net, prefixlen, &args_info) < 0) + if (gtp_kernel_init(gsn, &net.v4, prefixlen, &args_info) < 0) goto err; gtp_set_cb_data_ind(gsn, encaps_tun); @@ -735,7 +735,7 @@ } DEBUGP(DGGSN, "Setting tun IP address\n"); - if (tun_setaddr(tun, &netaddr, &destaddr, &prefixlen)) { + if (tun_setaddr(tun, &netaddr, &destaddr, prefixlen)) { SYS_ERR(DGGSN, LOGL_ERROR, 0, "Failed to set tun IP address"); exit(1); } diff --git a/lib/tun.c b/lib/tun.c index 8325f5d..205d39a 100644 --- a/lib/tun.c +++ b/lib/tun.c @@ -1,6 +1,7 @@ /* * TUN interface functions. * Copyright (C) 2002, 2003, 2004 Mondru AB. + * Copyright (C) 2017 by Harald Welte * * The contents of this file may be used under the terms of the GNU * General Public License Version 2, provided that the above copyright @@ -37,6 +38,7 @@ #include #include #include +#include #if defined(__linux__) #include @@ -47,6 +49,8 @@ #elif defined (__FreeBSD__) #include #include +#include +#include #elif defined (__APPLE__) #include @@ -65,7 +69,12 @@ #include "tun.h" #include "syserr.h" +static int tun_setaddr4(struct tun_t *this, struct in_addr *addr, + struct in_addr *dstaddr, struct in_addr *netmask); + #if defined(__linux__) + +#include int tun_nlattr(struct nlmsghdr *n, int nsize, int type, void *d, int dlen) { @@ -247,7 +256,7 @@ struct msghdr msg; if (!this->addrs) /* Use ioctl for first addr to make ping work */ - return tun_setaddr(this, addr, dstaddr, netmask); + return tun_setaddr4(this, addr, dstaddr, netmask); memset(&req, 0, sizeof(req)); req.n.nlmsg_len = NLMSG_LENGTH(sizeof(struct ifaddrmsg)); @@ -345,7 +354,7 @@ /* TODO: Is this needed on FreeBSD? */ if (!this->addrs) /* Use ioctl for first addr to make ping work */ - return tun_setaddr(this, addr, dstaddr, netmask); /* TODO dstaddr */ + return tun_setaddr4(this, addr, dstaddr, netmask); /* TODO dstaddr */ memset(&areq, 0, sizeof(areq)); @@ -391,7 +400,7 @@ #elif defined (__sun__) if (!this->addrs) /* Use ioctl for first addr to make ping work */ - return tun_setaddr(this, addr, dstaddr, netmask); + return tun_setaddr4(this, addr, dstaddr, netmask); SYS_ERR(DTUN, LOGL_ERROR, errno, "Setting multiple addresses not possible on Solaris"); @@ -403,9 +412,8 @@ } -int tun_setaddr(struct tun_t *this, - struct in_addr *addr, - struct in_addr *dstaddr, struct in_addr *netmask) +static int tun_setaddr4(struct tun_t *this, struct in_addr *addr, + struct in_addr *dstaddr, struct in_addr *netmask) { struct ifreq ifr; int fd; @@ -498,13 +506,112 @@ tun_sifflags(this, IFF_UP | IFF_RUNNING); #if defined(__FreeBSD__) || defined (__APPLE__) - tun_addroute(this, dstaddr, addr, netmask); + tun_addroute(this, dstaddr, addr, &this->netmask); this->routes = 1; #endif return 0; } +static int tun_setaddr6(struct tun_t *this, struct in6_addr *addr, struct in6_addr *dstaddr, + size_t prefixlen) +{ + struct in6_ifreq ifr; + int fd; + + memset(&ifr, 0, sizeof(ifr)); + +#if defined(__linux__) + ifr.ifr6_prefixlen = prefixlen; + ifr.ifr6_ifindex = if_nametoindex(this->devname); + if (ifr.ifr6_ifindex == 0) { + SYS_ERR(DTUN, LOGL_ERROR, 0, "Error getting ifindex for %s\n", this->devname); + return -1; + } +#elif defined(__FreeBSD__) || defined (__APPLE__) + strncpy(ifr.ifr_name, this->devname, IFNAMSIZ); +#endif + + /* Create a channel to the NET kernel */ + if ((fd = socket(AF_INET6, SOCK_DGRAM, 0)) < 0) { + SYS_ERR(DTUN, LOGL_ERROR, 0, "socket() failed"); + return -1; + } + +#if defined(__linux__) + if (addr) { + memcpy(&this->addr, addr, sizeof(*addr)); + memcpy(&ifr.ifr6_addr, addr, sizeof(*addr)); + if (ioctl(fd, SIOCSIFADDR, (void *) &ifr) < 0) { + if (errno != EEXIST) { + SYS_ERR(DTUN, LOGL_ERROR, 0, "ioctl(SIOCSIFADDR) failed"); + } else { + SYS_ERR(DTUN, LOGL_NOTICE, 0, "ioctl(SIOCSIFADDR): Address alreadsy exists"); + } + close(fd); + return -1; + } + } + +#if 0 + /* FIXME: looks like this is not possible/necessary for IPv6? */ + if (dstaddr) { + memcpy(&this->dstaddr, dstaddr, sizeof(*dstaddr)); + memcpy(&ifr.ifr6_addr, dstaddr, sizeof(*dstaddr)); + if (ioctl(fd, SIOCSIFDSTADDR, (caddr_t *) &ifr) < 0) { + SYS_ERR(DTUN, LOGL_ERROR, "ioctl(SIOCSIFDSTADDR) failed"); + close(fd); + return -1; + } + } +#endif + +#elif defined(__FreeBSD__) || defined (__APPLE__) + if (addr) + memcpy(&ifr.ifr_ifru.ifru_addr, addr, sizeof(ifr.ifr_ifru.ifru_addr)); + if (dstaddr) + memcpy(&ifr.ifr_ifru.ifru_dstaddr, dstaddr, sizeof(ifr.ifr_ifru.ifru_dstaddr)); + + if (ioctl(fd, SIOCSIFADDR_IN6, (struct ifreq *)&ifr) < 0) { + SYS_ERR(DTUN, LOGL_ERROR, 0, "ioctl(SIOCSIFADDR_IN6) failed"); + close(fd); + return -1; + } +#endif + + close(fd); + this->addrs++; + + /* On linux the route to the interface is set automatically + on FreeBSD we have to do this manually */ + + /* TODO: How does it work on Solaris? */ + + tun_sifflags(this, IFF_UP | IFF_RUNNING); + +#if 0 /* FIXME */ +//#if defined(__FreeBSD__) || defined (__APPLE__) + tun_addroute6(this, dstaddr, addr, prefixlen); + this->routes = 1; +#endif + + return 0; +} + +int tun_setaddr(struct tun_t *this, struct in46_addr *addr, struct in46_addr *dstaddr, size_t prefixlen) +{ + struct in_addr netmask; + switch (addr->len) { + case 4: + netmask.s_addr = htonl(0xffffffff << (32 - prefixlen)); + return tun_setaddr4(this, &addr->v4, dstaddr ? &dstaddr->v4 : NULL, &netmask); + case 16: + return tun_setaddr6(this, &addr->v6, dstaddr ? &dstaddr->v6 : NULL, prefixlen); + default: + return -1; + } +} + int tun_route(struct tun_t *this, struct in_addr *dst, struct in_addr *gateway, struct in_addr *mask, int delete) diff --git a/lib/tun.h b/lib/tun.h index c50bdf9..1cd0767 100644 --- a/lib/tun.h +++ b/lib/tun.h @@ -1,6 +1,7 @@ /* * TUN interface functions. * Copyright (C) 2002, 2003 Mondru AB. + * Copyright (C) 2017 by Harald Welte * * The contents of this file may be used under the terms of the GNU * General Public License Version 2, provided that the above copyright @@ -11,6 +12,8 @@ #ifndef _TUN_H #define _TUN_H + +#include "../lib/in46_addr.h" #define PACKET_MAX 8196 /* Maximum packet size we receive */ #define TUN_SCRIPTSIZE 256 @@ -66,8 +69,8 @@ extern int tun_addaddr(struct tun_t *this, struct in_addr *addr, struct in_addr *dstaddr, struct in_addr *netmask); -extern int tun_setaddr(struct tun_t *this, struct in_addr *our_adr, - struct in_addr *his_adr, struct in_addr *net_mask); +extern int tun_setaddr(struct tun_t *this, struct in46_addr *our_adr, + struct in46_addr *his_adr, size_t prefixlen); int tun_addroute(struct tun_t *this, struct in_addr *dst, struct in_addr *gateway, struct in_addr *mask); -- To view, visit https://gerrit.osmocom.org/3408 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I899d21e52d02e0b8384af29ddd489ff19c8f2cf6 Gerrit-PatchSet: 8 Gerrit-Project: openggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Fri Aug 11 10:57:23 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 11 Aug 2017 10:57:23 +0000 Subject: [PATCH] openggsn[master]: IPv6: Implement IPv6 prefix assignment via ICMPv6 router adv... In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3458 to look at the new patch set (#3). IPv6: Implement IPv6 prefix assignment via ICMPv6 router advertisement The 3GPP specs are quite strange when it comes to how an IPv6 address or rather prefix is assigned to an IPv6 PDP context. The designated method for allocating the IPv6 address via the PDP EUA (End User Address) Information Element in the GTP signalling plane is *not* used to allocate the address/prefix. Instead, the EUA is used to allocate an "interface identifier" to the MS, which it the uses to derive its link-local source address to send a router solicitation. The GGSN subsequently answers witha router advertisement, advertising a single/64 prefix, whihcthe MS then uses to generate it's real IPv6 source address for subsequent communication. Change-Id: Icddf7d30e01d76a4784bcef5787b36f52f703a9f --- M ggsn/Makefile.am A ggsn/checksum.c A ggsn/checksum.h M ggsn/ggsn.c A ggsn/icmpv6.c A ggsn/icmpv6.h M lib/debug.c M lib/syserr.h 8 files changed, 510 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openggsn refs/changes/58/3458/3 diff --git a/ggsn/Makefile.am b/ggsn/Makefile.am index 3ad3a6e..c945f0b 100644 --- a/ggsn/Makefile.am +++ b/ggsn/Makefile.am @@ -12,7 +12,7 @@ endif ggsn_DEPENDENCIES = ../gtp/libgtp.la ../lib/libmisc.a -ggsn_SOURCES = ggsn.c cmdline.c cmdline.h gtp-kernel.h +ggsn_SOURCES = ggsn.c cmdline.c cmdline.h gtp-kernel.h icmpv6.c icmpv6.h checksum.c checksum.h if ENABLE_GTP_KERNEL ggsn_SOURCES += gtp-kernel.c diff --git a/ggsn/checksum.c b/ggsn/checksum.c new file mode 100644 index 0000000..4b23897 --- /dev/null +++ b/ggsn/checksum.c @@ -0,0 +1,211 @@ +/* + * + * INET An implementation of the TCP/IP protocol suite for the LINUX + * operating system. INET is implemented using the BSD Socket + * interface as the means of communication with the user level. + * + * IP/TCP/UDP checksumming routines + * + * Authors: Jorge Cwik, + * Arnt Gulbrandsen, + * Tom May, + * Andreas Schwab, + * Lots of code moved from tcp.c and ip.c; see those files + * for more names. + * + * 03/02/96 Jes Sorensen, Andreas Schwab, Roman Hodek: + * Fixed some nasty bugs, causing some horrible crashes. + * A: At some points, the sum (%0) was used as + * length-counter instead of the length counter + * (%1). Thanks to Roman Hodek for pointing this out. + * B: GCC seems to mess up if one uses too many + * data-registers to hold input values and one tries to + * specify d0 and d1 as scratch registers. Letting gcc + * choose these registers itself solves the problem. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version + * 2 of the License, or (at your option) any later version. + */ + +/* Revised by Kenneth Albanowski for m68knommu. Basic problem: unaligned access + kills, so most of the assembly has to go. */ + +#if defined(__FreeBSD__) +#define _KERNEL /* needed on FreeBSD 10.x for s6_addr32 */ +#include +#include +#include +#endif + +#include "checksum.h" +#include + +static inline unsigned short from32to16(unsigned int x) +{ + /* add up 16-bit and 16-bit for 16+c bit */ + x = (x & 0xffff) + (x >> 16); + /* add up carry.. */ + x = (x & 0xffff) + (x >> 16); + return x; +} + +static unsigned int do_csum(const unsigned char *buff, int len) +{ + int odd; + unsigned int result = 0; + + if (len <= 0) + goto out; + odd = 1 & (unsigned long) buff; + if (odd) { +#if BYTE_ORDER == LITTLE_ENDIAN + result += (*buff << 8); +#else + result = *buff; +#endif + len--; + buff++; + } + if (len >= 2) { + if (2 & (unsigned long) buff) { + result += *(unsigned short *) buff; + len -= 2; + buff += 2; + } + if (len >= 4) { + const unsigned char *end = buff + ((unsigned)len & ~3); + unsigned int carry = 0; + do { + unsigned int w = *(unsigned int *) buff; + buff += 4; + result += carry; + result += w; + carry = (w > result); + } while (buff < end); + result += carry; + result = (result & 0xffff) + (result >> 16); + } + if (len & 2) { + result += *(unsigned short *) buff; + buff += 2; + } + } + if (len & 1) +#if BYTE_ORDER == LITTLE_ENDIAN + result += *buff; +#else + result += (*buff << 8); +#endif + result = from32to16(result); + if (odd) + result = ((result >> 8) & 0xff) | ((result & 0xff) << 8); +out: + return result; +} + +/* + * This is a version of ip_compute_csum() optimized for IP headers, + * which always checksum on 4 octet boundaries. + */ +uint16_t ip_fast_csum(const void *iph, unsigned int ihl) +{ + return (uint16_t)~do_csum(iph, ihl*4); +} + +/* + * computes the checksum of a memory block at buff, length len, + * and adds in "sum" (32-bit) + * + * returns a 32-bit number suitable for feeding into itself + * or csum_tcpudp_magic + * + * this function must be called with even lengths, except + * for the last fragment, which may be odd + * + * it's best to have buff aligned on a 32-bit boundary + */ +uint32_t csum_partial(const void *buff, int len, uint32_t wsum) +{ + unsigned int sum = (unsigned int)wsum; + unsigned int result = do_csum(buff, len); + + /* add in old sum, and carry.. */ + result += sum; + if (sum > result) + result += 1; + return (uint32_t)result; +} + +/* + * this routine is used for miscellaneous IP-like checksums, mainly + * in icmp.c + */ +uint16_t ip_compute_csum(const void *buff, int len) +{ + return (uint16_t)~do_csum(buff, len); +} + +uint16_t csum_ipv6_magic(const struct in6_addr *saddr, + const struct in6_addr *daddr, + uint32_t len, uint8_t proto, uint32_t csum) +{ + int carry; + uint32_t ulen; + uint32_t uproto; + uint32_t sum = (uint32_t)csum; + + sum += (uint32_t)saddr->s6_addr32[0]; + carry = (sum < (uint32_t)saddr->s6_addr32[0]); + sum += carry; + + sum += (uint32_t)saddr->s6_addr32[1]; + carry = (sum < (uint32_t)saddr->s6_addr32[1]); + sum += carry; + + sum += (uint32_t)saddr->s6_addr32[2]; + carry = (sum < (uint32_t)saddr->s6_addr32[2]); + sum += carry; + + sum += (uint32_t)saddr->s6_addr32[3]; + carry = (sum < (uint32_t)saddr->s6_addr32[3]); + sum += carry; + + sum += (uint32_t)daddr->s6_addr32[0]; + carry = (sum < (uint32_t)daddr->s6_addr32[0]); + sum += carry; + + sum += (uint32_t)daddr->s6_addr32[1]; + carry = (sum < (uint32_t)daddr->s6_addr32[1]); + sum += carry; + + sum += (uint32_t)daddr->s6_addr32[2]; + carry = (sum < (uint32_t)daddr->s6_addr32[2]); + sum += carry; + + sum += (uint32_t)daddr->s6_addr32[3]; + carry = (sum < (uint32_t)daddr->s6_addr32[3]); + sum += carry; + + ulen = (uint32_t)htonl((uint32_t) len); + sum += ulen; + carry = (sum < ulen); + sum += carry; + + uproto = (uint32_t)htonl(proto); + sum += uproto; + carry = (sum < uproto); + sum += carry; + + return csum_fold((uint32_t)sum); +} + +/* fold a partial checksum */ +uint16_t csum_fold(uint32_t csum) +{ + uint32_t sum = (uint32_t)csum; + sum = (sum & 0xffff) + (sum >> 16); + sum = (sum & 0xffff) + (sum >> 16); + return (uint16_t)~sum; +} diff --git a/ggsn/checksum.h b/ggsn/checksum.h new file mode 100644 index 0000000..4b22431 --- /dev/null +++ b/ggsn/checksum.h @@ -0,0 +1,13 @@ +#pragma once +#include +#include + +uint16_t ip_fast_csum(const void *iph, unsigned int ihl); +uint32_t csum_partial(const void *buff, int len, uint32_t wsum); +uint16_t ip_compute_csum(const void *buff, int len); + +uint16_t csum_ipv6_magic(const struct in6_addr *saddr, + const struct in6_addr *daddr, + uint32_t len, uint8_t proto, uint32_t csum); + +uint16_t csum_fold(uint32_t csum); diff --git a/ggsn/ggsn.c b/ggsn/ggsn.c index 9b11884..c307177 100644 --- a/ggsn/ggsn.c +++ b/ggsn/ggsn.c @@ -64,6 +64,7 @@ #include "../gtp/gtp.h" #include "cmdline.h" #include "gtp-kernel.h" +#include "icmpv6.h" int end = 0; int maxfd = 0; /* For select() */ @@ -206,11 +207,23 @@ return 0; /* Allready in use, or no more available */ } - in46a_to_eua(&member->addr, &pdp->eua); + if (addr.len == sizeof(struct in6_addr)) { + struct in46_addr tmp; + /* IPv6 doesn't really send the real/allocated address at this point, but just + * the link-identifier which the MS shall use for router solicitation */ + tmp.len = addr.len; + /* initialize upper 64 bits to prefix, they are discarded by MS anyway */ + memcpy(tmp.v6.s6_addr, &member->addr.v6, 8); + /* use allocated 64bit prefix as lower 64bit, used as link id by MS */ + memcpy(tmp.v6.s6_addr+8, &member->addr.v6, 8); + in46a_to_eua(&tmp, &pdp->eua); + } else + in46a_to_eua(&member->addr, &pdp->eua); pdp->peer = member; pdp->ipif = tun; /* TODO */ member->peer = pdp; + /* TODO: In IPv6, EUA doesn't contain the actual IP addr/prefix! */ if (gtp_kernel_tunnel_add(pdp) < 0) { SYS_ERR(DGGSN, LOGL_ERROR, 0, "Cannot add tunnel to kernel: %s\n", strerror(errno)); @@ -264,9 +277,30 @@ return 0; } +/* RFC3307 link-local scope multicast address */ +static const struct in6_addr all_router_mcast_addr = { + .s6_addr = { 0xff,0x02,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,2 } +}; + int encaps_tun(struct pdp_t *pdp, void *pack, unsigned len) { + struct iphdr *iph = (struct iphdr *)pack; + struct ip6_hdr *ip6h = (struct ip6_hdr *)pack; + DEBUGP(DGGSN, "encaps_tun. Packet received: forwarding to tun\n"); + + switch (iph->version) { + case 6: + /* daddr: all-routers multicast addr */ + if (IN6_ARE_ADDR_EQUAL(&ip6h->ip6_dst, &all_router_mcast_addr)) + return handle_router_mcast(gsn, pdp, pack, len); + break; + case 4: + break; + default: + LOGP(DGGSN, LOGL_ERROR, "Packet from MS is neither IPv4 nor IPv6\n"); + return -1; + } return tun_encaps((struct tun_t *)pdp->ipif, pack, len); } diff --git a/ggsn/icmpv6.c b/ggsn/icmpv6.c new file mode 100644 index 0000000..ac51bb1 --- /dev/null +++ b/ggsn/icmpv6.c @@ -0,0 +1,238 @@ +/* Minimal ICMPv6 code for generating router advertisements as required by + * relevant 3GPP specs for a GGSN with IPv6 PDP contexts */ + +/* (C) 2017 by Harald Welte + * + * The contents of this file may be used under the terms of the GNU + * General Public License Version 2, provided that the above copyright + * notice and this permission notice is included in all copies or + * substantial portions of the software. + */ + +#include +#include +#include +#include +#if defined(__FreeBSD__) +#include /* FreeBSD 10.x needs this before ip6.h */ +#include +#endif +#include + +#include +#include +#include "checksum.h" + +#include "../gtp/gtp.h" +#include "../gtp/pdp.h" +#include "../lib/ippool.h" +#include "../lib/syserr.h" +#include "config.h" + +/* 29.061 11.2.1.3.4 IPv6 Router Configuration Variables in GGSN */ +#define GGSN_MaxRtrAdvInterval 21600 /* 6 hours */ +#define GGSN_MinRtrAdvInterval 16200 /* 4.5 hours */ +#define GGSN_AdvValidLifetime 0xffffffff /* infinite */ +#define GGSN_AdvPreferredLifetime 0xffffffff /* infinite */ + +struct icmpv6_hdr { + uint8_t type; + uint8_t code; + uint16_t csum; +} __attribute__ ((packed)); + +/* RFC4861 Section 4.2 */ +struct icmpv6_radv_hdr { + struct icmpv6_hdr hdr; + uint8_t cur_ho_limit; +#if BYTE_ORDER == LITTLE_ENDIAN + uint8_t res:6, + m:1, + o:1; +#elif BYTE_ORDER == BIG_ENDIAN + uint8_t m:1, + o:1, + res:6; +#else +# error "Please fix " +#endif + uint16_t router_lifetime; + uint32_t reachable_time; + uint32_t retrans_timer; + uint8_t options[0]; +} __attribute__ ((packed)); + +/* RFC4861 Section 4.6 */ +struct icmpv6_opt_hdr { + uint8_t type; + /* length in units of 8 octets, including type+len! */ + uint8_t len; + uint8_t data[0]; +} __attribute__ ((packed)); + +/* RFC4861 Section 4.6.2 */ +struct icmpv6_opt_prefix { + struct icmpv6_opt_hdr hdr; + uint8_t prefix_len; +#if BYTE_ORDER == LITTLE_ENDIAN + uint8_t res:6, + a:1, + l:1; +#elif BYTE_ORDER == BIG_ENDIAN + uint8_t l:1, + a:1, + res:6; +#else +# error "Please fix " +#endif + uint32_t valid_lifetime; + uint32_t preferred_lifetime; + uint32_t res2; + uint8_t prefix[16]; +} __attribute__ ((packed)); + + +/*! construct a 3GPP 29.061 compliant router advertisement for a given prefix + * \param[in] saddr Source IPv6 address for router advertisement + * \param[in] daddr Destination IPv6 address for router advertisement IPv6 header + * \param[in] prefix The single prefix to be advertised (/64 implied!)i + * \returns callee-allocated message buffer containing router advertisement */ +struct msgb *icmpv6_construct_ra(const struct in6_addr *saddr, + const struct in6_addr *daddr, + const struct in6_addr *prefix) +{ + struct msgb *msg = msgb_alloc_headroom(512,128, "IPv6 RA"); + struct icmpv6_radv_hdr *ra; + struct icmpv6_opt_prefix *ra_opt_pref; + struct ip6_hdr *i6h; + uint32_t len; + uint16_t skb_csum; + + OSMO_ASSERT(msg); + + ra = (struct icmpv6_radv_hdr *) msgb_put(msg, sizeof(*ra)); + ra->hdr.type = 134; /* see RFC4861 4.2 */ + ra->hdr.code = 0; /* see RFC4861 4.2 */ + ra->hdr.csum = 0; /* updated below */ + ra->cur_ho_limit = 64; /* seems reasonable? */ + /* the GGSN shall leave the M-flag cleared in the Router + * Advertisement messages */ + ra->m = 0; + /* The GGSN may set the O-flag if there are additional + * configuration parameters that need to be fetched by the MS */ + ra->o = 0; /* no DHCPv6 */ + ra->res = 0; + /* RFC4861 Default: 3 * MaxRtrAdvInterval */ + ra->router_lifetime = htons(3*GGSN_MaxRtrAdvInterval); + ra->reachable_time = 0; /* Unspecified */ + + /* RFC4861 Section 4.6.2 */ + ra_opt_pref = (struct icmpv6_opt_prefix *) msgb_put(msg, sizeof(*ra_opt_pref)); + ra_opt_pref->hdr.type = 3; /* RFC4861 4.6.2 */ + ra_opt_pref->hdr.len = 4; /* RFC4861 4.6.2 */ + ra_opt_pref->prefix_len = 64; /* only prefix length as per 3GPP */ + /* The Prefix is contained in the Prefix Information Option of + * the Router Advertisements and shall have the A-flag set + * and the L-flag cleared */ + ra_opt_pref->a = 1; + ra_opt_pref->l = 0; + ra_opt_pref->res = 0; + /* The lifetime of the prefix shall be set to infinity */ + ra_opt_pref->valid_lifetime = htonl(GGSN_AdvValidLifetime); + ra_opt_pref->preferred_lifetime = htonl(GGSN_AdvPreferredLifetime); + ra_opt_pref->res2 = 0; + memcpy(ra_opt_pref->prefix, prefix, sizeof(ra_opt_pref->prefix)); + + /* checksum */ + skb_csum = csum_partial(msgb_data(msg), msgb_length(msg), 0); + len = msgb_length(msg); + ra->hdr.csum = csum_ipv6_magic(saddr, daddr, len, IPPROTO_ICMPV6, skb_csum); + + /* Push IPv6 header in front of ICMPv6 packet */ + i6h = (struct ip6_hdr *) msgb_push(msg, sizeof(*i6h)); + /* 4 bits version, 8 bits TC, 20 bits flow-ID */ + i6h->ip6_ctlun.ip6_un1.ip6_un1_flow = htonl(0x60000000); + i6h->ip6_ctlun.ip6_un1.ip6_un1_plen = htons(len); + i6h->ip6_ctlun.ip6_un1.ip6_un1_nxt = IPPROTO_ICMPV6; + i6h->ip6_ctlun.ip6_un1.ip6_un1_hlim = 255; + i6h->ip6_src = *saddr; + i6h->ip6_dst = *daddr; + + return msg; +} + +/* Walidate an ICMPv6 router solicitation according to RFC4861 6.1.1 */ +static bool icmpv6_validate_router_solicit(const uint8_t *pack, unsigned len) +{ + const struct ip6_hdr *ip6h = (struct ip6_hdr *)pack; + //const struct icmpv6_hdr *ic6h = (struct icmpv6_hdr *) (pack + sizeof(*ip6h)); + + /* Hop limit field must have 255 */ + if (ip6h->ip6_ctlun.ip6_un1.ip6_un1_hlim != 255) + return false; + /* FIXME: ICMP checksum is valid */ + /* ICMP length (derived from IP length) is 8 or more octets */ + if (ip6h->ip6_ctlun.ip6_un1.ip6_un1_plen < 8) + return false; + /* FIXME: All included options have a length > 0 */ + /* FIXME: If IP source is unspecified, no source link-layer addr option */ + return true; +} + +/* RFC3307 link-local scope multicast address */ +static const struct in6_addr my_local_addr = { + .s6_addr = { 0x01,0x02,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0xff } +}; + +/* handle incoming packets to the all-routers multicast address */ +int handle_router_mcast(struct gsn_t *gsn, struct pdp_t *pdp, const uint8_t *pack, unsigned len) +{ + struct ippoolm_t *member = pdp->peer; + const struct ip6_hdr *ip6h = (struct ip6_hdr *)pack; + const struct icmpv6_hdr *ic6h = (struct icmpv6_hdr *) (pack + sizeof(*ip6h)); + struct msgb *msg; + + OSMO_ASSERT(pdp); + OSMO_ASSERT(member); + + if (len < sizeof(*ip6h)) { + LOGP(DICMP6, LOGL_NOTICE, "Packet too short: %u bytes\n", len); + return -1; + } + + /* we only treat ICMPv6 here */ + if (ip6h->ip6_ctlun.ip6_un1.ip6_un1_nxt != IPPROTO_ICMPV6) { + LOGP(DICMP6, LOGL_DEBUG, "Ignoring non-ICMP to all-routers mcast\n"); + return 0; + } + + if (len < sizeof(*ip6h) + sizeof(*ic6h)) { + LOGP(DICMP6, LOGL_NOTICE, "Short ICMPv6 packet: %s\n", osmo_hexdump(pack, len)); + return -1; + } + + switch (ic6h->type) { + case 133: /* router solicitation */ + if (ic6h->code != 0) { + LOGP(DICMP6, LOGL_NOTICE, "ICMPv6 type 133 but code %d\n", ic6h->code); + return -1; + } + if (!icmpv6_validate_router_solicit(pack, len)) { + LOGP(DICMP6, LOGL_NOTICE, "Invalid Router Solicitation: %s\n", + osmo_hexdump(pack, len)); + return -1; + } + /* FIXME: Send router advertisement from GGSN link-local + * address to MS link-local address, including prefix + * allocated to this PDP context */ + msg = icmpv6_construct_ra(&my_local_addr, &ip6h->ip6_src, &member->addr.v6); + /* Send the constructed RA to the MS */ + gtp_data_req(gsn, pdp, msgb_data(msg), msgb_length(msg)); + msgb_free(msg); + break; + default: + LOGP(DICMP6, LOGL_DEBUG, "Unknown ICMPv6 type %u\n", ic6h->type); + break; + } + return 0; +} diff --git a/ggsn/icmpv6.h b/ggsn/icmpv6.h new file mode 100644 index 0000000..ebff04e --- /dev/null +++ b/ggsn/icmpv6.h @@ -0,0 +1,6 @@ +#pragma once + +#include "../gtp/gtp.h" +#include "../gtp/pdp.h" + +int handle_router_mcast(struct gsn_t *gsn, struct pdp_t *pdp, const uint8_t *pack, unsigned len); diff --git a/lib/debug.c b/lib/debug.c index b3850f9..83423dc 100644 --- a/lib/debug.c +++ b/lib/debug.c @@ -26,6 +26,11 @@ .description = "SGSN Emulator", .enabled = 1, .loglevel = LOGL_NOTICE, }, + [DICMP6] = { + .name = "DICMP6", + .description = "ICMPv6", + .enabled = 1, .loglevel = LOGL_DEBUG, + }, }; const struct log_info log_info = { diff --git a/lib/syserr.h b/lib/syserr.h index 0c50a5f..adc5840 100644 --- a/lib/syserr.h +++ b/lib/syserr.h @@ -19,6 +19,7 @@ DTUN, DGGSN, DSGSN, + DICMP6, }; #define SYS_ERR(sub, pri, en, fmt, args...) \ -- To view, visit https://gerrit.osmocom.org/3458 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Icddf7d30e01d76a4784bcef5787b36f52f703a9f Gerrit-PatchSet: 3 Gerrit-Project: openggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Fri Aug 11 10:57:24 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 11 Aug 2017 10:57:24 +0000 Subject: [PATCH] openggsn[master]: replace hand-coded tun_gifindex() with standard POSIX if_nam... Message-ID: Review at https://gerrit.osmocom.org/3471 replace hand-coded tun_gifindex() with standard POSIX if_nametoindex() Change-Id: I738472765ab09f530dcf071455e1bb4e6fb3f6e5 --- M lib/tun.c 1 file changed, 3 insertions(+), 25 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openggsn refs/changes/71/3471/1 diff --git a/lib/tun.c b/lib/tun.c index 205d39a..717da88 100644 --- a/lib/tun.c +++ b/lib/tun.c @@ -89,30 +89,6 @@ n->nlmsg_len = alen + len; return 0; } - -int tun_gifindex(struct tun_t *this, __u32 * index) -{ - struct ifreq ifr; - int fd; - - memset(&ifr, '\0', sizeof(ifr)); - ifr.ifr_addr.sa_family = AF_INET; - ifr.ifr_dstaddr.sa_family = AF_INET; - ifr.ifr_netmask.sa_family = AF_INET; - strncpy(ifr.ifr_name, this->devname, IFNAMSIZ); - ifr.ifr_name[IFNAMSIZ - 1] = 0; /* Make sure to terminate */ - if ((fd = socket(AF_INET, SOCK_DGRAM, 0)) < 0) { - SYS_ERR(DTUN, LOGL_ERROR, errno, "socket() failed"); - } - if (ioctl(fd, SIOCGIFINDEX, &ifr)) { - SYS_ERR(DTUN, LOGL_ERROR, errno, "ioctl() failed"); - close(fd); - return -1; - } - close(fd); - *index = ifr.ifr_ifindex; - return 0; -} #endif int tun_sifflags(struct tun_t *this, int flags) @@ -266,7 +242,9 @@ req.i.ifa_prefixlen = 32; /* 32 FOR IPv4 */ req.i.ifa_flags = 0; req.i.ifa_scope = RT_SCOPE_HOST; /* TODO or 0 */ - if (tun_gifindex(this, &req.i.ifa_index)) { + req.i.ifa_index = if_nametoindex(this->devname); + if (!req.i.ifa_index) { + SYS_ERR(DTUN, LOGL_ERROR, errno, "Unable to get ifindex for %s", this->devname); return -1; } -- To view, visit https://gerrit.osmocom.org/3471 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I738472765ab09f530dcf071455e1bb4e6fb3f6e5 Gerrit-PatchSet: 1 Gerrit-Project: openggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Fri Aug 11 10:57:24 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 11 Aug 2017 10:57:24 +0000 Subject: [PATCH] openggsn[master]: tun_new(): Fix array overflow in FreeBSD related code Message-ID: Review at https://gerrit.osmocom.org/3472 tun_new(): Fix array overflow in FreeBSD related code Change-Id: I096e3b614e82e402886163274cfcf9355bd57580 --- M lib/tun.c 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/openggsn refs/changes/72/3472/1 diff --git a/lib/tun.c b/lib/tun.c index 717da88..767052f 100644 --- a/lib/tun.c +++ b/lib/tun.c @@ -786,7 +786,7 @@ } snprintf((*tun)->devname, sizeof((*tun)->devname), "tun%d", devnum); - (*tun)->devname[sizeof((*tun)->devname)] = 0; + (*tun)->devname[sizeof((*tun)->devname)-1] = 0; /* The tun device we found might have "old" IP addresses allocated */ /* We need to delete those. This problem is not present on Linux */ -- To view, visit https://gerrit.osmocom.org/3472 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I096e3b614e82e402886163274cfcf9355bd57580 Gerrit-PatchSet: 1 Gerrit-Project: openggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Fri Aug 11 10:59:13 2017 From: gerrit-no-reply at lists.osmocom.org (Pablo Neira Ayuso) Date: Fri, 11 Aug 2017 10:59:13 +0000 Subject: openbsc[master]: libmsc: update database to accomodate SMS status-report fields In-Reply-To: References: Message-ID: Patch Set 4: Agreed. So let it sink by when the NITB code becomes officially dead. Thanks! -- To view, visit https://gerrit.osmocom.org/3435 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I7276d356d805a83ebeec72b02c8563b7135ea0b6 Gerrit-PatchSet: 4 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Pablo Neira Ayuso Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Keith Whyte Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pablo Neira Ayuso Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Aug 11 11:09:46 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 11 Aug 2017 11:09:46 +0000 Subject: openggsn[master]: IPv6: Implement IPv6 prefix assignment via ICMPv6 router adv... In-Reply-To: References: Message-ID: Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3458 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Icddf7d30e01d76a4784bcef5787b36f52f703a9f Gerrit-PatchSet: 3 Gerrit-Project: openggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Aug 11 11:09:49 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 11 Aug 2017 11:09:49 +0000 Subject: openggsn[master]: IPv6: Support PCO for IPv6 DNS addresses In-Reply-To: References: Message-ID: Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3459 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I21499afd61def8c925f7838bde76f34d28214b56 Gerrit-PatchSet: 3 Gerrit-Project: openggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Aug 11 11:09:52 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 11 Aug 2017 11:09:52 +0000 Subject: openggsn[master]: IPv6: in46_addr: OSMO_ASSERT() in case of unsupported calls In-Reply-To: References: Message-ID: Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3460 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I444c190bdcd18780344e1f0dad4faf3bcf9da5a5 Gerrit-PatchSet: 3 Gerrit-Project: openggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Aug 11 11:12:19 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 11 Aug 2017 11:12:19 +0000 Subject: [PATCH] openggsn[master]: Support setting TUN device IPv6 address + prefix In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3408 to look at the new patch set (#9). Support setting TUN device IPv6 address + prefix As we can now have PDP contexts with IPv6 user IP payload, it is useful to extend the TUN related code to be able to configure the tun device IPv6 address + prefix length Change-Id: I899d21e52d02e0b8384af29ddd489ff19c8f2cf6 --- M ggsn/ggsn.c M lib/tun.c M lib/tun.h 3 files changed, 127 insertions(+), 19 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openggsn refs/changes/08/3408/9 diff --git a/ggsn/ggsn.c b/ggsn/ggsn.c index 991b54c..05a56ae 100644 --- a/ggsn/ggsn.c +++ b/ggsn/ggsn.c @@ -70,7 +70,7 @@ int maxfd = 0; /* For select() */ struct in_addr listen_; -struct in_addr netaddr, destaddr, net; /* Network interface */ +struct in46_addr netaddr, destaddr, net; /* Network interface */ size_t prefixlen; struct in46_addr dns1, dns2; /* PCO DNS address */ char *ipup, *ipdown; /* Filename of scripts */ @@ -547,16 +547,16 @@ /* net */ /* Store net as in_addr net and mask */ if (args_info.net_arg) { - struct in46_addr in46; - if (ippool_aton(&in46, &prefixlen, args_info.net_arg, 0)) { + if (ippool_aton(&net, &prefixlen, args_info.net_arg, 0)) { SYS_ERR(DGGSN, LOGL_ERROR, 0, "Invalid network address: %s!", args_info.net_arg); exit(1); } - net.s_addr = in46.v4.s_addr; - netaddr.s_addr = htonl(ntohl(net.s_addr) + 1); - destaddr.s_addr = htonl(ntohl(net.s_addr) + 1); + /* default for network + destination address = net + 1 */ + netaddr = net; + in46a_inc(&netaddr); + destaddr = netaddr; } else { SYS_ERR(DGGSN, LOGL_ERROR, 0, "Network address must be specified: %s!", @@ -710,7 +710,7 @@ maxfd = gsn->fd1u; /* use GTP kernel module for data packet encapsulation */ - if (gtp_kernel_init(gsn, &net, prefixlen, &args_info) < 0) + if (gtp_kernel_init(gsn, &net.v4, prefixlen, &args_info) < 0) goto err; gtp_set_cb_data_ind(gsn, encaps_tun); @@ -735,7 +735,7 @@ } DEBUGP(DGGSN, "Setting tun IP address\n"); - if (tun_setaddr(tun, &netaddr, &destaddr, &prefixlen)) { + if (tun_setaddr(tun, &netaddr, &destaddr, prefixlen)) { SYS_ERR(DGGSN, LOGL_ERROR, 0, "Failed to set tun IP address"); exit(1); } diff --git a/lib/tun.c b/lib/tun.c index 8325f5d..11ea7bc 100644 --- a/lib/tun.c +++ b/lib/tun.c @@ -1,6 +1,7 @@ /* * TUN interface functions. * Copyright (C) 2002, 2003, 2004 Mondru AB. + * Copyright (C) 2017 by Harald Welte * * The contents of this file may be used under the terms of the GNU * General Public License Version 2, provided that the above copyright @@ -37,16 +38,17 @@ #include #include #include +#include #if defined(__linux__) -#include #include #include #include #elif defined (__FreeBSD__) -#include #include +#include +#include #elif defined (__APPLE__) #include @@ -65,7 +67,12 @@ #include "tun.h" #include "syserr.h" +static int tun_setaddr4(struct tun_t *this, struct in_addr *addr, + struct in_addr *dstaddr, struct in_addr *netmask); + #if defined(__linux__) + +#include int tun_nlattr(struct nlmsghdr *n, int nsize, int type, void *d, int dlen) { @@ -247,7 +254,7 @@ struct msghdr msg; if (!this->addrs) /* Use ioctl for first addr to make ping work */ - return tun_setaddr(this, addr, dstaddr, netmask); + return tun_setaddr4(this, addr, dstaddr, netmask); memset(&req, 0, sizeof(req)); req.n.nlmsg_len = NLMSG_LENGTH(sizeof(struct ifaddrmsg)); @@ -345,7 +352,7 @@ /* TODO: Is this needed on FreeBSD? */ if (!this->addrs) /* Use ioctl for first addr to make ping work */ - return tun_setaddr(this, addr, dstaddr, netmask); /* TODO dstaddr */ + return tun_setaddr4(this, addr, dstaddr, netmask); /* TODO dstaddr */ memset(&areq, 0, sizeof(areq)); @@ -391,7 +398,7 @@ #elif defined (__sun__) if (!this->addrs) /* Use ioctl for first addr to make ping work */ - return tun_setaddr(this, addr, dstaddr, netmask); + return tun_setaddr4(this, addr, dstaddr, netmask); SYS_ERR(DTUN, LOGL_ERROR, errno, "Setting multiple addresses not possible on Solaris"); @@ -403,9 +410,8 @@ } -int tun_setaddr(struct tun_t *this, - struct in_addr *addr, - struct in_addr *dstaddr, struct in_addr *netmask) +static int tun_setaddr4(struct tun_t *this, struct in_addr *addr, + struct in_addr *dstaddr, struct in_addr *netmask) { struct ifreq ifr; int fd; @@ -498,13 +504,112 @@ tun_sifflags(this, IFF_UP | IFF_RUNNING); #if defined(__FreeBSD__) || defined (__APPLE__) - tun_addroute(this, dstaddr, addr, netmask); + tun_addroute(this, dstaddr, addr, &this->netmask); this->routes = 1; #endif return 0; } +static int tun_setaddr6(struct tun_t *this, struct in6_addr *addr, struct in6_addr *dstaddr, + size_t prefixlen) +{ + struct in6_ifreq ifr; + int fd; + + memset(&ifr, 0, sizeof(ifr)); + +#if defined(__linux__) + ifr.ifr6_prefixlen = prefixlen; + ifr.ifr6_ifindex = if_nametoindex(this->devname); + if (ifr.ifr6_ifindex == 0) { + SYS_ERR(DTUN, LOGL_ERROR, 0, "Error getting ifindex for %s\n", this->devname); + return -1; + } +#elif defined(__FreeBSD__) || defined (__APPLE__) + strncpy(ifr.ifr_name, this->devname, IFNAMSIZ); +#endif + + /* Create a channel to the NET kernel */ + if ((fd = socket(AF_INET6, SOCK_DGRAM, 0)) < 0) { + SYS_ERR(DTUN, LOGL_ERROR, 0, "socket() failed"); + return -1; + } + +#if defined(__linux__) + if (addr) { + memcpy(&this->addr, addr, sizeof(*addr)); + memcpy(&ifr.ifr6_addr, addr, sizeof(*addr)); + if (ioctl(fd, SIOCSIFADDR, (void *) &ifr) < 0) { + if (errno != EEXIST) { + SYS_ERR(DTUN, LOGL_ERROR, 0, "ioctl(SIOCSIFADDR) failed"); + } else { + SYS_ERR(DTUN, LOGL_NOTICE, 0, "ioctl(SIOCSIFADDR): Address alreadsy exists"); + } + close(fd); + return -1; + } + } + +#if 0 + /* FIXME: looks like this is not possible/necessary for IPv6? */ + if (dstaddr) { + memcpy(&this->dstaddr, dstaddr, sizeof(*dstaddr)); + memcpy(&ifr.ifr6_addr, dstaddr, sizeof(*dstaddr)); + if (ioctl(fd, SIOCSIFDSTADDR, (caddr_t *) &ifr) < 0) { + SYS_ERR(DTUN, LOGL_ERROR, "ioctl(SIOCSIFDSTADDR) failed"); + close(fd); + return -1; + } + } +#endif + +#elif defined(__FreeBSD__) || defined (__APPLE__) + if (addr) + memcpy(&ifr.ifr_ifru.ifru_addr, addr, sizeof(ifr.ifr_ifru.ifru_addr)); + if (dstaddr) + memcpy(&ifr.ifr_ifru.ifru_dstaddr, dstaddr, sizeof(ifr.ifr_ifru.ifru_dstaddr)); + + if (ioctl(fd, SIOCSIFADDR_IN6, (struct ifreq *)&ifr) < 0) { + SYS_ERR(DTUN, LOGL_ERROR, 0, "ioctl(SIOCSIFADDR_IN6) failed"); + close(fd); + return -1; + } +#endif + + close(fd); + this->addrs++; + + /* On linux the route to the interface is set automatically + on FreeBSD we have to do this manually */ + + /* TODO: How does it work on Solaris? */ + + tun_sifflags(this, IFF_UP | IFF_RUNNING); + +#if 0 /* FIXME */ +//#if defined(__FreeBSD__) || defined (__APPLE__) + tun_addroute6(this, dstaddr, addr, prefixlen); + this->routes = 1; +#endif + + return 0; +} + +int tun_setaddr(struct tun_t *this, struct in46_addr *addr, struct in46_addr *dstaddr, size_t prefixlen) +{ + struct in_addr netmask; + switch (addr->len) { + case 4: + netmask.s_addr = htonl(0xffffffff << (32 - prefixlen)); + return tun_setaddr4(this, &addr->v4, dstaddr ? &dstaddr->v4 : NULL, &netmask); + case 16: + return tun_setaddr6(this, &addr->v6, dstaddr ? &dstaddr->v6 : NULL, prefixlen); + default: + return -1; + } +} + int tun_route(struct tun_t *this, struct in_addr *dst, struct in_addr *gateway, struct in_addr *mask, int delete) diff --git a/lib/tun.h b/lib/tun.h index c50bdf9..1cd0767 100644 --- a/lib/tun.h +++ b/lib/tun.h @@ -1,6 +1,7 @@ /* * TUN interface functions. * Copyright (C) 2002, 2003 Mondru AB. + * Copyright (C) 2017 by Harald Welte * * The contents of this file may be used under the terms of the GNU * General Public License Version 2, provided that the above copyright @@ -11,6 +12,8 @@ #ifndef _TUN_H #define _TUN_H + +#include "../lib/in46_addr.h" #define PACKET_MAX 8196 /* Maximum packet size we receive */ #define TUN_SCRIPTSIZE 256 @@ -66,8 +69,8 @@ extern int tun_addaddr(struct tun_t *this, struct in_addr *addr, struct in_addr *dstaddr, struct in_addr *netmask); -extern int tun_setaddr(struct tun_t *this, struct in_addr *our_adr, - struct in_addr *his_adr, struct in_addr *net_mask); +extern int tun_setaddr(struct tun_t *this, struct in46_addr *our_adr, + struct in46_addr *his_adr, size_t prefixlen); int tun_addroute(struct tun_t *this, struct in_addr *dst, struct in_addr *gateway, struct in_addr *mask); -- To view, visit https://gerrit.osmocom.org/3408 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I899d21e52d02e0b8384af29ddd489ff19c8f2cf6 Gerrit-PatchSet: 9 Gerrit-Project: openggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Fri Aug 11 11:12:45 2017 From: gerrit-no-reply at lists.osmocom.org (Pablo Neira Ayuso) Date: Fri, 11 Aug 2017 11:12:45 +0000 Subject: [PATCH] libsmpp34[master]: add esm_class definitions Message-ID: Review at https://gerrit.osmocom.org/3473 add esm_class definitions Add special message attributes definitions that are associated with the short message. Thus, we can get rid of magic numbers in our codebase. Change-Id: I91afd8b462b8fd3b2c4c5b54f4eeb7ec5b730b65 --- M src/smpp34.h 1 file changed, 11 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libsmpp34 refs/changes/73/3473/1 diff --git a/src/smpp34.h b/src/smpp34.h index 5fb6395..b114ba7 100644 --- a/src/smpp34.h +++ b/src/smpp34.h @@ -204,4 +204,15 @@ #define TLVID_its_reply_type 0x1380 /* CDMA */ #define TLVID_its_session_info 0x1383 /* CDMA */ +/* As defined by SMPP 3.4, Sect. 5.2.12 Parameter Definition esm_class. */ +enum smpp34_esm_class { + SMPP34_DATAGRAM_MODE = 0x01, + SMPP34_DELIVERY_RECEIPT = 0x04, + SMPP34_DELIVERY_ACK = 0x08, + SMPP34_UDHI_IND = 0x40, + SMPP34_REPLY_PATH = 0x80, +}; + +#define SMPP34_MSG_MODE_MASK 0x03 + #endif -- To view, visit https://gerrit.osmocom.org/3473 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I91afd8b462b8fd3b2c4c5b54f4eeb7ec5b730b65 Gerrit-PatchSet: 1 Gerrit-Project: libsmpp34 Gerrit-Branch: master Gerrit-Owner: Pablo Neira Ayuso From gerrit-no-reply at lists.osmocom.org Fri Aug 11 11:13:16 2017 From: gerrit-no-reply at lists.osmocom.org (Pablo Neira Ayuso) Date: Fri, 11 Aug 2017 11:13:16 +0000 Subject: openbsc[master]: libmsc: use smpp34_tlv_for_each() to avoid suboptimal TLV ha... In-Reply-To: References: Message-ID: Patch Set 2: Build breaks because this patch depends on a patch in libsmpp34. -- To view, visit https://gerrit.osmocom.org/3470 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I53a65164a6cc4abc6bf57d9a8dc275cf21c90222 Gerrit-PatchSet: 2 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Pablo Neira Ayuso Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pablo Neira Ayuso Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Aug 11 11:13:20 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 11 Aug 2017 11:13:20 +0000 Subject: openggsn[master]: Support setting TUN device IPv6 address + prefix In-Reply-To: References: Message-ID: Patch Set 9: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3408 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I899d21e52d02e0b8384af29ddd489ff19c8f2cf6 Gerrit-PatchSet: 9 Gerrit-Project: openggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Aug 11 11:13:27 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 11 Aug 2017 11:13:27 +0000 Subject: [MERGED] openggsn[master]: Support setting TUN device IPv6 address + prefix In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Support setting TUN device IPv6 address + prefix ...................................................................... Support setting TUN device IPv6 address + prefix As we can now have PDP contexts with IPv6 user IP payload, it is useful to extend the TUN related code to be able to configure the tun device IPv6 address + prefix length Change-Id: I899d21e52d02e0b8384af29ddd489ff19c8f2cf6 --- M ggsn/ggsn.c M lib/tun.c M lib/tun.h 3 files changed, 127 insertions(+), 19 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/ggsn/ggsn.c b/ggsn/ggsn.c index 991b54c..05a56ae 100644 --- a/ggsn/ggsn.c +++ b/ggsn/ggsn.c @@ -70,7 +70,7 @@ int maxfd = 0; /* For select() */ struct in_addr listen_; -struct in_addr netaddr, destaddr, net; /* Network interface */ +struct in46_addr netaddr, destaddr, net; /* Network interface */ size_t prefixlen; struct in46_addr dns1, dns2; /* PCO DNS address */ char *ipup, *ipdown; /* Filename of scripts */ @@ -547,16 +547,16 @@ /* net */ /* Store net as in_addr net and mask */ if (args_info.net_arg) { - struct in46_addr in46; - if (ippool_aton(&in46, &prefixlen, args_info.net_arg, 0)) { + if (ippool_aton(&net, &prefixlen, args_info.net_arg, 0)) { SYS_ERR(DGGSN, LOGL_ERROR, 0, "Invalid network address: %s!", args_info.net_arg); exit(1); } - net.s_addr = in46.v4.s_addr; - netaddr.s_addr = htonl(ntohl(net.s_addr) + 1); - destaddr.s_addr = htonl(ntohl(net.s_addr) + 1); + /* default for network + destination address = net + 1 */ + netaddr = net; + in46a_inc(&netaddr); + destaddr = netaddr; } else { SYS_ERR(DGGSN, LOGL_ERROR, 0, "Network address must be specified: %s!", @@ -710,7 +710,7 @@ maxfd = gsn->fd1u; /* use GTP kernel module for data packet encapsulation */ - if (gtp_kernel_init(gsn, &net, prefixlen, &args_info) < 0) + if (gtp_kernel_init(gsn, &net.v4, prefixlen, &args_info) < 0) goto err; gtp_set_cb_data_ind(gsn, encaps_tun); @@ -735,7 +735,7 @@ } DEBUGP(DGGSN, "Setting tun IP address\n"); - if (tun_setaddr(tun, &netaddr, &destaddr, &prefixlen)) { + if (tun_setaddr(tun, &netaddr, &destaddr, prefixlen)) { SYS_ERR(DGGSN, LOGL_ERROR, 0, "Failed to set tun IP address"); exit(1); } diff --git a/lib/tun.c b/lib/tun.c index 8325f5d..11ea7bc 100644 --- a/lib/tun.c +++ b/lib/tun.c @@ -1,6 +1,7 @@ /* * TUN interface functions. * Copyright (C) 2002, 2003, 2004 Mondru AB. + * Copyright (C) 2017 by Harald Welte * * The contents of this file may be used under the terms of the GNU * General Public License Version 2, provided that the above copyright @@ -37,16 +38,17 @@ #include #include #include +#include #if defined(__linux__) -#include #include #include #include #elif defined (__FreeBSD__) -#include #include +#include +#include #elif defined (__APPLE__) #include @@ -65,7 +67,12 @@ #include "tun.h" #include "syserr.h" +static int tun_setaddr4(struct tun_t *this, struct in_addr *addr, + struct in_addr *dstaddr, struct in_addr *netmask); + #if defined(__linux__) + +#include int tun_nlattr(struct nlmsghdr *n, int nsize, int type, void *d, int dlen) { @@ -247,7 +254,7 @@ struct msghdr msg; if (!this->addrs) /* Use ioctl for first addr to make ping work */ - return tun_setaddr(this, addr, dstaddr, netmask); + return tun_setaddr4(this, addr, dstaddr, netmask); memset(&req, 0, sizeof(req)); req.n.nlmsg_len = NLMSG_LENGTH(sizeof(struct ifaddrmsg)); @@ -345,7 +352,7 @@ /* TODO: Is this needed on FreeBSD? */ if (!this->addrs) /* Use ioctl for first addr to make ping work */ - return tun_setaddr(this, addr, dstaddr, netmask); /* TODO dstaddr */ + return tun_setaddr4(this, addr, dstaddr, netmask); /* TODO dstaddr */ memset(&areq, 0, sizeof(areq)); @@ -391,7 +398,7 @@ #elif defined (__sun__) if (!this->addrs) /* Use ioctl for first addr to make ping work */ - return tun_setaddr(this, addr, dstaddr, netmask); + return tun_setaddr4(this, addr, dstaddr, netmask); SYS_ERR(DTUN, LOGL_ERROR, errno, "Setting multiple addresses not possible on Solaris"); @@ -403,9 +410,8 @@ } -int tun_setaddr(struct tun_t *this, - struct in_addr *addr, - struct in_addr *dstaddr, struct in_addr *netmask) +static int tun_setaddr4(struct tun_t *this, struct in_addr *addr, + struct in_addr *dstaddr, struct in_addr *netmask) { struct ifreq ifr; int fd; @@ -498,13 +504,112 @@ tun_sifflags(this, IFF_UP | IFF_RUNNING); #if defined(__FreeBSD__) || defined (__APPLE__) - tun_addroute(this, dstaddr, addr, netmask); + tun_addroute(this, dstaddr, addr, &this->netmask); this->routes = 1; #endif return 0; } +static int tun_setaddr6(struct tun_t *this, struct in6_addr *addr, struct in6_addr *dstaddr, + size_t prefixlen) +{ + struct in6_ifreq ifr; + int fd; + + memset(&ifr, 0, sizeof(ifr)); + +#if defined(__linux__) + ifr.ifr6_prefixlen = prefixlen; + ifr.ifr6_ifindex = if_nametoindex(this->devname); + if (ifr.ifr6_ifindex == 0) { + SYS_ERR(DTUN, LOGL_ERROR, 0, "Error getting ifindex for %s\n", this->devname); + return -1; + } +#elif defined(__FreeBSD__) || defined (__APPLE__) + strncpy(ifr.ifr_name, this->devname, IFNAMSIZ); +#endif + + /* Create a channel to the NET kernel */ + if ((fd = socket(AF_INET6, SOCK_DGRAM, 0)) < 0) { + SYS_ERR(DTUN, LOGL_ERROR, 0, "socket() failed"); + return -1; + } + +#if defined(__linux__) + if (addr) { + memcpy(&this->addr, addr, sizeof(*addr)); + memcpy(&ifr.ifr6_addr, addr, sizeof(*addr)); + if (ioctl(fd, SIOCSIFADDR, (void *) &ifr) < 0) { + if (errno != EEXIST) { + SYS_ERR(DTUN, LOGL_ERROR, 0, "ioctl(SIOCSIFADDR) failed"); + } else { + SYS_ERR(DTUN, LOGL_NOTICE, 0, "ioctl(SIOCSIFADDR): Address alreadsy exists"); + } + close(fd); + return -1; + } + } + +#if 0 + /* FIXME: looks like this is not possible/necessary for IPv6? */ + if (dstaddr) { + memcpy(&this->dstaddr, dstaddr, sizeof(*dstaddr)); + memcpy(&ifr.ifr6_addr, dstaddr, sizeof(*dstaddr)); + if (ioctl(fd, SIOCSIFDSTADDR, (caddr_t *) &ifr) < 0) { + SYS_ERR(DTUN, LOGL_ERROR, "ioctl(SIOCSIFDSTADDR) failed"); + close(fd); + return -1; + } + } +#endif + +#elif defined(__FreeBSD__) || defined (__APPLE__) + if (addr) + memcpy(&ifr.ifr_ifru.ifru_addr, addr, sizeof(ifr.ifr_ifru.ifru_addr)); + if (dstaddr) + memcpy(&ifr.ifr_ifru.ifru_dstaddr, dstaddr, sizeof(ifr.ifr_ifru.ifru_dstaddr)); + + if (ioctl(fd, SIOCSIFADDR_IN6, (struct ifreq *)&ifr) < 0) { + SYS_ERR(DTUN, LOGL_ERROR, 0, "ioctl(SIOCSIFADDR_IN6) failed"); + close(fd); + return -1; + } +#endif + + close(fd); + this->addrs++; + + /* On linux the route to the interface is set automatically + on FreeBSD we have to do this manually */ + + /* TODO: How does it work on Solaris? */ + + tun_sifflags(this, IFF_UP | IFF_RUNNING); + +#if 0 /* FIXME */ +//#if defined(__FreeBSD__) || defined (__APPLE__) + tun_addroute6(this, dstaddr, addr, prefixlen); + this->routes = 1; +#endif + + return 0; +} + +int tun_setaddr(struct tun_t *this, struct in46_addr *addr, struct in46_addr *dstaddr, size_t prefixlen) +{ + struct in_addr netmask; + switch (addr->len) { + case 4: + netmask.s_addr = htonl(0xffffffff << (32 - prefixlen)); + return tun_setaddr4(this, &addr->v4, dstaddr ? &dstaddr->v4 : NULL, &netmask); + case 16: + return tun_setaddr6(this, &addr->v6, dstaddr ? &dstaddr->v6 : NULL, prefixlen); + default: + return -1; + } +} + int tun_route(struct tun_t *this, struct in_addr *dst, struct in_addr *gateway, struct in_addr *mask, int delete) diff --git a/lib/tun.h b/lib/tun.h index c50bdf9..1cd0767 100644 --- a/lib/tun.h +++ b/lib/tun.h @@ -1,6 +1,7 @@ /* * TUN interface functions. * Copyright (C) 2002, 2003 Mondru AB. + * Copyright (C) 2017 by Harald Welte * * The contents of this file may be used under the terms of the GNU * General Public License Version 2, provided that the above copyright @@ -11,6 +12,8 @@ #ifndef _TUN_H #define _TUN_H + +#include "../lib/in46_addr.h" #define PACKET_MAX 8196 /* Maximum packet size we receive */ #define TUN_SCRIPTSIZE 256 @@ -66,8 +69,8 @@ extern int tun_addaddr(struct tun_t *this, struct in_addr *addr, struct in_addr *dstaddr, struct in_addr *netmask); -extern int tun_setaddr(struct tun_t *this, struct in_addr *our_adr, - struct in_addr *his_adr, struct in_addr *net_mask); +extern int tun_setaddr(struct tun_t *this, struct in46_addr *our_adr, + struct in46_addr *his_adr, size_t prefixlen); int tun_addroute(struct tun_t *this, struct in_addr *dst, struct in_addr *gateway, struct in_addr *mask); -- To view, visit https://gerrit.osmocom.org/3408 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I899d21e52d02e0b8384af29ddd489ff19c8f2cf6 Gerrit-PatchSet: 9 Gerrit-Project: openggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Fri Aug 11 11:13:27 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 11 Aug 2017 11:13:27 +0000 Subject: [MERGED] openggsn[master]: IPv6: in46_addr: OSMO_ASSERT() in case of unsupported calls In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: IPv6: in46_addr: OSMO_ASSERT() in case of unsupported calls ...................................................................... IPv6: in46_addr: OSMO_ASSERT() in case of unsupported calls There's a bit of trickery with the ip_pool and it's "lengty=8" IPv6 prefix handling, let's make sure we don't accidentially call any support functions with addresses of wrong length. Change-Id: I444c190bdcd18780344e1f0dad4faf3bcf9da5a5 --- M lib/in46_addr.c 1 file changed, 6 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/lib/in46_addr.c b/lib/in46_addr.c index 1785377..8f5cc09 100644 --- a/lib/in46_addr.c +++ b/lib/in46_addr.c @@ -11,6 +11,8 @@ #include "../lib/in46_addr.h" +#include + #include #include #include @@ -29,6 +31,7 @@ case 16: return AF_INET6; default: + OSMO_ASSERT(0); return -1; } } @@ -49,6 +52,7 @@ sin6->sin6_addr = in->v6; break; default: + OSMO_ASSERT(0); return -1; } @@ -161,6 +165,7 @@ create_ipv6_netmask(&netmask6, prefixlen); return ipv6_within_mask(&addr->v6, &net->v6, &netmask6); default: + OSMO_ASSERT(0); return 0; } } @@ -184,6 +189,7 @@ memcpy(&eua->v[2], &src->v6, 16); /* Copy a 16 byte address */ break; default: + OSMO_ASSERT(0); return -1; } return 0; -- To view, visit https://gerrit.osmocom.org/3460 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I444c190bdcd18780344e1f0dad4faf3bcf9da5a5 Gerrit-PatchSet: 3 Gerrit-Project: openggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Fri Aug 11 11:13:28 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 11 Aug 2017 11:13:28 +0000 Subject: [MERGED] openggsn[master]: IPv6: Support PCO for IPv6 DNS addresses In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: IPv6: Support PCO for IPv6 DNS addresses ...................................................................... IPv6: Support PCO for IPv6 DNS addresses In IPv6, DNS server information is not passed along as IPCP6 like in IPv5 with IPCP. The reason is that IPCP6 (for PPP) doesn't support passing DNS server information. Rather, the relevant RFCs indicate DHCPv6 should be used even over point-to-point links. 3GPP decided to avoid DHCPv6 dependency for stateless autoconfiguration (the only mandatory IPv6 configuration mechanism) and added some new non-PPP-style PCO information elements ("containers") which can among other things inform a MS about IPV6 DNS servers. That same mechanism can also be used to inform the MS about IPv4 DNS servers, so for IPv4 there are now two competing mechanisms: IPCP and the new "native" PCO container. With this patch, we support both for IPv4. Change-Id: I21499afd61def8c925f7838bde76f34d28214b56 --- M ggsn/ggsn.c 1 file changed, 137 insertions(+), 42 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/ggsn/ggsn.c b/ggsn/ggsn.c index c307177..991b54c 100644 --- a/ggsn/ggsn.c +++ b/ggsn/ggsn.c @@ -72,7 +72,7 @@ struct in_addr listen_; struct in_addr netaddr, destaddr, net; /* Network interface */ size_t prefixlen; -struct in_addr dns1, dns2; /* PCO DNS address */ +struct in46_addr dns1, dns2; /* PCO DNS address */ char *ipup, *ipdown; /* Filename of scripts */ int debug; /* Print debug output */ struct ul255_t pco; @@ -175,6 +175,103 @@ return 0; } +#include + +/* 3GPP TS 24.008 10.6.5.3 */ +enum pco_protocols { + PCO_P_LCP = 0xC021, + PCO_P_PAP = 0xC023, + PCO_P_CHAP = 0xC223, + PCO_P_IPCP = 0x8021, + PCO_P_PCSCF_ADDR = 0x0001, + PCO_P_IM_CN_SS_F = 0x0002, + PCO_P_DNS_IPv6_ADDR = 0x0003, + PCO_P_POLICY_CTRL_REJ = 0x0004, /* only in Network->MS */ + PCO_P_MS_SUP_NETREQ_BCI = 0x0005, + /* reserved */ + PCO_P_DSMIPv6_HA_ADDR = 0x0007, + PCO_P_DSMIPv6_HN_PREF = 0x0008, + PCO_P_DSMIPv6_v4_HA_ADDR= 0x0009, + PCO_P_IP_ADDR_VIA_NAS = 0x000a, /* only MS->Network */ + PCO_P_IPv4_ADDR_VIA_DHCP= 0x000b, /* only MS->Netowrk */ + PCO_P_PCSCF_IPv4_ADDR = 0x000c, + PCO_P_DNS_IPv4_ADDR = 0x000d, + PCO_P_MSISDN = 0x000e, + PCO_P_IFOM_SUPPORT = 0x000f, + PCO_P_IPv4_LINK_MTU = 0x0010, + PCO_P_MS_SUPP_LOC_A_TFT = 0x0011, + PCO_P_PCSCF_RESEL_SUP = 0x0012, /* only MS->Network */ + PCO_P_NBIFOM_REQ = 0x0013, + PCO_P_NBIFOM_MODE = 0x0014, + PCO_P_NONIP_LINK_MTU = 0x0015, + PCO_P_APN_RATE_CTRL_SUP = 0x0016, + PCO_P_PS_DATA_OFF_UE = 0x0017, + PCO_P_REL_DATA_SVC = 0x0018, +}; + +/* determine if PCO contains given protocol */ +static bool pco_contains_proto(struct ul255_t *pco, uint16_t prot) +{ + uint8_t *cur = pco->v + 1; + + /* iterate over PCO and check if protocol contained */ + while (cur + 2 < pco->v + pco->l) { + uint16_t cur_prot = osmo_load16be(cur); + uint8_t cur_len = cur[2]; + if (cur_prot == prot) + return true; + if (cur_len == 0) + break; + cur += cur_len; + } + return false; +} + +/* determine if PDP context has IPv6 support */ +static bool pdp_has_v4(struct pdp_t *pdp) +{ + if (pdp->eua.l == 4+2) + return true; + else + return false; +} + +/* process one PCO request from a MS/UE, putting together the proper responses */ +static void process_pco(struct pdp_t *pdp) +{ + struct msgb *msg = msgb_alloc(256, "PCO"); + msgb_put_u8(msg, 0x80); /* ext-bit + configuration protocol byte */ + + /* FIXME: also check if primary / secondary DNS was requested */ + if (pdp_has_v4(pdp) && pco_contains_proto(&pdp->pco_req, PCO_P_IPCP)) { + /* FIXME: properly implement this for IPCP */ + uint8_t *cur = msgb_put(msg, pco.l-1); + memcpy(cur, pco.v+1, pco.l-1); + } + + if (pco_contains_proto(&pdp->pco_req, PCO_P_DNS_IPv6_ADDR)) { + if (dns1.len == 16) + msgb_t16lv_put(msg, PCO_P_DNS_IPv6_ADDR, dns1.len, dns1.v6.s6_addr); + if (dns2.len == 16) + msgb_t16lv_put(msg, PCO_P_DNS_IPv6_ADDR, dns2.len, dns2.v6.s6_addr); + } + + if (pco_contains_proto(&pdp->pco_req, PCO_P_DNS_IPv4_ADDR)) { + if (dns1.len == 4) + msgb_t16lv_put(msg, PCO_P_DNS_IPv4_ADDR, dns1.len, (uint8_t *)&dns1.v4); + if (dns2.len == 4) + msgb_t16lv_put(msg, PCO_P_DNS_IPv4_ADDR, dns2.len, (uint8_t *)&dns2.v4); + } + + if (msgb_length(msg) > 1) { + memcpy(pdp->pco_neg.v, msgb_data(msg), msgb_length(msg)); + pdp->pco_neg.l = msgb_length(msg); + } else + pdp->pco_neg.l = 0; + + msgb_free(msg); +} + int create_context_ind(struct pdp_t *pdp) { struct in46_addr addr; @@ -188,7 +285,6 @@ pdp->eua.l = 2; memcpy(pdp->qos_neg0, pdp->qos_req0, sizeof(pdp->qos_req0)); - memcpy(&pdp->pco_neg, &pco, sizeof(pdp->pco_neg)); memcpy(pdp->qos_neg.v, pdp->qos_req.v, pdp->qos_req.l); /* TODO */ pdp->qos_neg.l = pdp->qos_req.l; @@ -235,6 +331,8 @@ gtp_create_context_resp(gsn, pdp, GTPCAUSE_NO_RESOURCES); return 0; } + + process_pco(pdp); gtp_create_context_resp(gsn, pdp, GTPCAUSE_ACC_REQ); return 0; /* Success */ @@ -486,59 +584,56 @@ } /* DNS1 and DNS2 */ -#ifdef HAVE_INET_ATON - dns1.s_addr = 0; + memset(&dns1, 0, sizeof(dns1)); if (args_info.pcodns1_arg) { - if (0 == inet_aton(args_info.pcodns1_arg, &dns1)) { + size_t tmp; + if (ippool_aton(&dns1, &tmp, args_info.pcodns1_arg, 0) != 0) { SYS_ERR(DGGSN, LOGL_ERROR, 0, "Failed to convert pcodns1!"); exit(1); } } - dns2.s_addr = 0; + memset(&dns2, 0, sizeof(dns2)); if (args_info.pcodns2_arg) { - if (0 == inet_aton(args_info.pcodns2_arg, &dns2)) { + size_t tmp; + if (ippool_aton(&dns2, &tmp, args_info.pcodns2_arg, 0) != 0) { SYS_ERR(DGGSN, LOGL_ERROR, 0, "Failed to convert pcodns2!"); exit(1); } } -#else - dns1.s_addr = 0; - if (args_info.pcodns1_arg) { - dns1.s_addr = inet_addr(args_info.pcodns1_arg); - if (dns1.s_addr == -1) { - SYS_ERR(DGGSN, LOGL_ERROR, 0, - "Failed to convert pcodns1!"); - exit(1); - } - } - dns2.s_addr = 0; - if (args_info.pcodns2_arg) { - dns2.s_addr = inet_addr(args_info.pcodns2_arg); - if (dns2.s_addr == -1) { - SYS_ERR(DGGSN, LOGL_ERROR, 0, - "Failed to convert pcodns2!"); - exit(1); - } - } -#endif - pco.l = 20; - pco.v[0] = 0x80; /* x0000yyy x=1, yyy=000: PPP */ - pco.v[1] = 0x80; /* IPCP */ - pco.v[2] = 0x21; - pco.v[3] = 0x10; /* Length of contents */ - pco.v[4] = 0x02; /* ACK */ - pco.v[5] = 0x00; /* ID: Need to match request */ - pco.v[6] = 0x00; /* Length */ - pco.v[7] = 0x10; - pco.v[8] = 0x81; /* DNS 1 */ - pco.v[9] = 0x06; - memcpy(&pco.v[10], &dns1, sizeof(dns1)); - pco.v[14] = 0x83; - pco.v[15] = 0x06; /* DNS 2 */ - memcpy(&pco.v[16], &dns2, sizeof(dns2)); + unsigned int cur = 0; + pco.v[cur++] = 0x80; /* x0000yyy x=1, yyy=000: PPP */ + pco.v[cur++] = 0x80; /* IPCP */ + pco.v[cur++] = 0x21; + pco.v[cur++] = 0xFF; /* Length of contents */ + pco.v[cur++] = 0x02; /* ACK */ + pco.v[cur++] = 0x00; /* ID: Need to match request */ + pco.v[cur++] = 0x00; /* Length */ + pco.v[cur++] = 0xFF; /* overwritten */ + if (dns1.len == 4) { + pco.v[cur++] = 0x81; /* DNS 1 */ + pco.v[cur++] = 2 + dns1.len; + if (dns1.len == 4) + memcpy(&pco.v[cur], &dns1.v4, dns1.len); + else + memcpy(&pco.v[cur], &dns1.v6, dns1.len); + cur += dns1.len; + } + if (dns2.len == 4) { + pco.v[cur++] = 0x83; + pco.v[cur++] = 2 + dns2.len; /* DNS 2 */ + if (dns2.len == 4) + memcpy(&pco.v[cur], &dns2.v4, dns2.len); + else + memcpy(&pco.v[cur], &dns2.v6, dns2.len); + cur += dns2.len; + } + pco.l = cur; + /* patch in length values */ + pco.v[3] = pco.l - 4; + pco.v[7] = pco.l - 4; /* ipup */ ipup = args_info.ipup_arg; -- To view, visit https://gerrit.osmocom.org/3459 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I21499afd61def8c925f7838bde76f34d28214b56 Gerrit-PatchSet: 3 Gerrit-Project: openggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Fri Aug 11 11:13:28 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 11 Aug 2017 11:13:28 +0000 Subject: [MERGED] openggsn[master]: IPv6: Implement IPv6 prefix assignment via ICMPv6 router adv... In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: IPv6: Implement IPv6 prefix assignment via ICMPv6 router advertisement ...................................................................... IPv6: Implement IPv6 prefix assignment via ICMPv6 router advertisement The 3GPP specs are quite strange when it comes to how an IPv6 address or rather prefix is assigned to an IPv6 PDP context. The designated method for allocating the IPv6 address via the PDP EUA (End User Address) Information Element in the GTP signalling plane is *not* used to allocate the address/prefix. Instead, the EUA is used to allocate an "interface identifier" to the MS, which it the uses to derive its link-local source address to send a router solicitation. The GGSN subsequently answers witha router advertisement, advertising a single/64 prefix, whihcthe MS then uses to generate it's real IPv6 source address for subsequent communication. Change-Id: Icddf7d30e01d76a4784bcef5787b36f52f703a9f --- M ggsn/Makefile.am A ggsn/checksum.c A ggsn/checksum.h M ggsn/ggsn.c A ggsn/icmpv6.c A ggsn/icmpv6.h M lib/debug.c M lib/syserr.h 8 files changed, 510 insertions(+), 2 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/ggsn/Makefile.am b/ggsn/Makefile.am index 3ad3a6e..c945f0b 100644 --- a/ggsn/Makefile.am +++ b/ggsn/Makefile.am @@ -12,7 +12,7 @@ endif ggsn_DEPENDENCIES = ../gtp/libgtp.la ../lib/libmisc.a -ggsn_SOURCES = ggsn.c cmdline.c cmdline.h gtp-kernel.h +ggsn_SOURCES = ggsn.c cmdline.c cmdline.h gtp-kernel.h icmpv6.c icmpv6.h checksum.c checksum.h if ENABLE_GTP_KERNEL ggsn_SOURCES += gtp-kernel.c diff --git a/ggsn/checksum.c b/ggsn/checksum.c new file mode 100644 index 0000000..4b23897 --- /dev/null +++ b/ggsn/checksum.c @@ -0,0 +1,211 @@ +/* + * + * INET An implementation of the TCP/IP protocol suite for the LINUX + * operating system. INET is implemented using the BSD Socket + * interface as the means of communication with the user level. + * + * IP/TCP/UDP checksumming routines + * + * Authors: Jorge Cwik, + * Arnt Gulbrandsen, + * Tom May, + * Andreas Schwab, + * Lots of code moved from tcp.c and ip.c; see those files + * for more names. + * + * 03/02/96 Jes Sorensen, Andreas Schwab, Roman Hodek: + * Fixed some nasty bugs, causing some horrible crashes. + * A: At some points, the sum (%0) was used as + * length-counter instead of the length counter + * (%1). Thanks to Roman Hodek for pointing this out. + * B: GCC seems to mess up if one uses too many + * data-registers to hold input values and one tries to + * specify d0 and d1 as scratch registers. Letting gcc + * choose these registers itself solves the problem. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version + * 2 of the License, or (at your option) any later version. + */ + +/* Revised by Kenneth Albanowski for m68knommu. Basic problem: unaligned access + kills, so most of the assembly has to go. */ + +#if defined(__FreeBSD__) +#define _KERNEL /* needed on FreeBSD 10.x for s6_addr32 */ +#include +#include +#include +#endif + +#include "checksum.h" +#include + +static inline unsigned short from32to16(unsigned int x) +{ + /* add up 16-bit and 16-bit for 16+c bit */ + x = (x & 0xffff) + (x >> 16); + /* add up carry.. */ + x = (x & 0xffff) + (x >> 16); + return x; +} + +static unsigned int do_csum(const unsigned char *buff, int len) +{ + int odd; + unsigned int result = 0; + + if (len <= 0) + goto out; + odd = 1 & (unsigned long) buff; + if (odd) { +#if BYTE_ORDER == LITTLE_ENDIAN + result += (*buff << 8); +#else + result = *buff; +#endif + len--; + buff++; + } + if (len >= 2) { + if (2 & (unsigned long) buff) { + result += *(unsigned short *) buff; + len -= 2; + buff += 2; + } + if (len >= 4) { + const unsigned char *end = buff + ((unsigned)len & ~3); + unsigned int carry = 0; + do { + unsigned int w = *(unsigned int *) buff; + buff += 4; + result += carry; + result += w; + carry = (w > result); + } while (buff < end); + result += carry; + result = (result & 0xffff) + (result >> 16); + } + if (len & 2) { + result += *(unsigned short *) buff; + buff += 2; + } + } + if (len & 1) +#if BYTE_ORDER == LITTLE_ENDIAN + result += *buff; +#else + result += (*buff << 8); +#endif + result = from32to16(result); + if (odd) + result = ((result >> 8) & 0xff) | ((result & 0xff) << 8); +out: + return result; +} + +/* + * This is a version of ip_compute_csum() optimized for IP headers, + * which always checksum on 4 octet boundaries. + */ +uint16_t ip_fast_csum(const void *iph, unsigned int ihl) +{ + return (uint16_t)~do_csum(iph, ihl*4); +} + +/* + * computes the checksum of a memory block at buff, length len, + * and adds in "sum" (32-bit) + * + * returns a 32-bit number suitable for feeding into itself + * or csum_tcpudp_magic + * + * this function must be called with even lengths, except + * for the last fragment, which may be odd + * + * it's best to have buff aligned on a 32-bit boundary + */ +uint32_t csum_partial(const void *buff, int len, uint32_t wsum) +{ + unsigned int sum = (unsigned int)wsum; + unsigned int result = do_csum(buff, len); + + /* add in old sum, and carry.. */ + result += sum; + if (sum > result) + result += 1; + return (uint32_t)result; +} + +/* + * this routine is used for miscellaneous IP-like checksums, mainly + * in icmp.c + */ +uint16_t ip_compute_csum(const void *buff, int len) +{ + return (uint16_t)~do_csum(buff, len); +} + +uint16_t csum_ipv6_magic(const struct in6_addr *saddr, + const struct in6_addr *daddr, + uint32_t len, uint8_t proto, uint32_t csum) +{ + int carry; + uint32_t ulen; + uint32_t uproto; + uint32_t sum = (uint32_t)csum; + + sum += (uint32_t)saddr->s6_addr32[0]; + carry = (sum < (uint32_t)saddr->s6_addr32[0]); + sum += carry; + + sum += (uint32_t)saddr->s6_addr32[1]; + carry = (sum < (uint32_t)saddr->s6_addr32[1]); + sum += carry; + + sum += (uint32_t)saddr->s6_addr32[2]; + carry = (sum < (uint32_t)saddr->s6_addr32[2]); + sum += carry; + + sum += (uint32_t)saddr->s6_addr32[3]; + carry = (sum < (uint32_t)saddr->s6_addr32[3]); + sum += carry; + + sum += (uint32_t)daddr->s6_addr32[0]; + carry = (sum < (uint32_t)daddr->s6_addr32[0]); + sum += carry; + + sum += (uint32_t)daddr->s6_addr32[1]; + carry = (sum < (uint32_t)daddr->s6_addr32[1]); + sum += carry; + + sum += (uint32_t)daddr->s6_addr32[2]; + carry = (sum < (uint32_t)daddr->s6_addr32[2]); + sum += carry; + + sum += (uint32_t)daddr->s6_addr32[3]; + carry = (sum < (uint32_t)daddr->s6_addr32[3]); + sum += carry; + + ulen = (uint32_t)htonl((uint32_t) len); + sum += ulen; + carry = (sum < ulen); + sum += carry; + + uproto = (uint32_t)htonl(proto); + sum += uproto; + carry = (sum < uproto); + sum += carry; + + return csum_fold((uint32_t)sum); +} + +/* fold a partial checksum */ +uint16_t csum_fold(uint32_t csum) +{ + uint32_t sum = (uint32_t)csum; + sum = (sum & 0xffff) + (sum >> 16); + sum = (sum & 0xffff) + (sum >> 16); + return (uint16_t)~sum; +} diff --git a/ggsn/checksum.h b/ggsn/checksum.h new file mode 100644 index 0000000..4b22431 --- /dev/null +++ b/ggsn/checksum.h @@ -0,0 +1,13 @@ +#pragma once +#include +#include + +uint16_t ip_fast_csum(const void *iph, unsigned int ihl); +uint32_t csum_partial(const void *buff, int len, uint32_t wsum); +uint16_t ip_compute_csum(const void *buff, int len); + +uint16_t csum_ipv6_magic(const struct in6_addr *saddr, + const struct in6_addr *daddr, + uint32_t len, uint8_t proto, uint32_t csum); + +uint16_t csum_fold(uint32_t csum); diff --git a/ggsn/ggsn.c b/ggsn/ggsn.c index 9b11884..c307177 100644 --- a/ggsn/ggsn.c +++ b/ggsn/ggsn.c @@ -64,6 +64,7 @@ #include "../gtp/gtp.h" #include "cmdline.h" #include "gtp-kernel.h" +#include "icmpv6.h" int end = 0; int maxfd = 0; /* For select() */ @@ -206,11 +207,23 @@ return 0; /* Allready in use, or no more available */ } - in46a_to_eua(&member->addr, &pdp->eua); + if (addr.len == sizeof(struct in6_addr)) { + struct in46_addr tmp; + /* IPv6 doesn't really send the real/allocated address at this point, but just + * the link-identifier which the MS shall use for router solicitation */ + tmp.len = addr.len; + /* initialize upper 64 bits to prefix, they are discarded by MS anyway */ + memcpy(tmp.v6.s6_addr, &member->addr.v6, 8); + /* use allocated 64bit prefix as lower 64bit, used as link id by MS */ + memcpy(tmp.v6.s6_addr+8, &member->addr.v6, 8); + in46a_to_eua(&tmp, &pdp->eua); + } else + in46a_to_eua(&member->addr, &pdp->eua); pdp->peer = member; pdp->ipif = tun; /* TODO */ member->peer = pdp; + /* TODO: In IPv6, EUA doesn't contain the actual IP addr/prefix! */ if (gtp_kernel_tunnel_add(pdp) < 0) { SYS_ERR(DGGSN, LOGL_ERROR, 0, "Cannot add tunnel to kernel: %s\n", strerror(errno)); @@ -264,9 +277,30 @@ return 0; } +/* RFC3307 link-local scope multicast address */ +static const struct in6_addr all_router_mcast_addr = { + .s6_addr = { 0xff,0x02,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,2 } +}; + int encaps_tun(struct pdp_t *pdp, void *pack, unsigned len) { + struct iphdr *iph = (struct iphdr *)pack; + struct ip6_hdr *ip6h = (struct ip6_hdr *)pack; + DEBUGP(DGGSN, "encaps_tun. Packet received: forwarding to tun\n"); + + switch (iph->version) { + case 6: + /* daddr: all-routers multicast addr */ + if (IN6_ARE_ADDR_EQUAL(&ip6h->ip6_dst, &all_router_mcast_addr)) + return handle_router_mcast(gsn, pdp, pack, len); + break; + case 4: + break; + default: + LOGP(DGGSN, LOGL_ERROR, "Packet from MS is neither IPv4 nor IPv6\n"); + return -1; + } return tun_encaps((struct tun_t *)pdp->ipif, pack, len); } diff --git a/ggsn/icmpv6.c b/ggsn/icmpv6.c new file mode 100644 index 0000000..ac51bb1 --- /dev/null +++ b/ggsn/icmpv6.c @@ -0,0 +1,238 @@ +/* Minimal ICMPv6 code for generating router advertisements as required by + * relevant 3GPP specs for a GGSN with IPv6 PDP contexts */ + +/* (C) 2017 by Harald Welte + * + * The contents of this file may be used under the terms of the GNU + * General Public License Version 2, provided that the above copyright + * notice and this permission notice is included in all copies or + * substantial portions of the software. + */ + +#include +#include +#include +#include +#if defined(__FreeBSD__) +#include /* FreeBSD 10.x needs this before ip6.h */ +#include +#endif +#include + +#include +#include +#include "checksum.h" + +#include "../gtp/gtp.h" +#include "../gtp/pdp.h" +#include "../lib/ippool.h" +#include "../lib/syserr.h" +#include "config.h" + +/* 29.061 11.2.1.3.4 IPv6 Router Configuration Variables in GGSN */ +#define GGSN_MaxRtrAdvInterval 21600 /* 6 hours */ +#define GGSN_MinRtrAdvInterval 16200 /* 4.5 hours */ +#define GGSN_AdvValidLifetime 0xffffffff /* infinite */ +#define GGSN_AdvPreferredLifetime 0xffffffff /* infinite */ + +struct icmpv6_hdr { + uint8_t type; + uint8_t code; + uint16_t csum; +} __attribute__ ((packed)); + +/* RFC4861 Section 4.2 */ +struct icmpv6_radv_hdr { + struct icmpv6_hdr hdr; + uint8_t cur_ho_limit; +#if BYTE_ORDER == LITTLE_ENDIAN + uint8_t res:6, + m:1, + o:1; +#elif BYTE_ORDER == BIG_ENDIAN + uint8_t m:1, + o:1, + res:6; +#else +# error "Please fix " +#endif + uint16_t router_lifetime; + uint32_t reachable_time; + uint32_t retrans_timer; + uint8_t options[0]; +} __attribute__ ((packed)); + +/* RFC4861 Section 4.6 */ +struct icmpv6_opt_hdr { + uint8_t type; + /* length in units of 8 octets, including type+len! */ + uint8_t len; + uint8_t data[0]; +} __attribute__ ((packed)); + +/* RFC4861 Section 4.6.2 */ +struct icmpv6_opt_prefix { + struct icmpv6_opt_hdr hdr; + uint8_t prefix_len; +#if BYTE_ORDER == LITTLE_ENDIAN + uint8_t res:6, + a:1, + l:1; +#elif BYTE_ORDER == BIG_ENDIAN + uint8_t l:1, + a:1, + res:6; +#else +# error "Please fix " +#endif + uint32_t valid_lifetime; + uint32_t preferred_lifetime; + uint32_t res2; + uint8_t prefix[16]; +} __attribute__ ((packed)); + + +/*! construct a 3GPP 29.061 compliant router advertisement for a given prefix + * \param[in] saddr Source IPv6 address for router advertisement + * \param[in] daddr Destination IPv6 address for router advertisement IPv6 header + * \param[in] prefix The single prefix to be advertised (/64 implied!)i + * \returns callee-allocated message buffer containing router advertisement */ +struct msgb *icmpv6_construct_ra(const struct in6_addr *saddr, + const struct in6_addr *daddr, + const struct in6_addr *prefix) +{ + struct msgb *msg = msgb_alloc_headroom(512,128, "IPv6 RA"); + struct icmpv6_radv_hdr *ra; + struct icmpv6_opt_prefix *ra_opt_pref; + struct ip6_hdr *i6h; + uint32_t len; + uint16_t skb_csum; + + OSMO_ASSERT(msg); + + ra = (struct icmpv6_radv_hdr *) msgb_put(msg, sizeof(*ra)); + ra->hdr.type = 134; /* see RFC4861 4.2 */ + ra->hdr.code = 0; /* see RFC4861 4.2 */ + ra->hdr.csum = 0; /* updated below */ + ra->cur_ho_limit = 64; /* seems reasonable? */ + /* the GGSN shall leave the M-flag cleared in the Router + * Advertisement messages */ + ra->m = 0; + /* The GGSN may set the O-flag if there are additional + * configuration parameters that need to be fetched by the MS */ + ra->o = 0; /* no DHCPv6 */ + ra->res = 0; + /* RFC4861 Default: 3 * MaxRtrAdvInterval */ + ra->router_lifetime = htons(3*GGSN_MaxRtrAdvInterval); + ra->reachable_time = 0; /* Unspecified */ + + /* RFC4861 Section 4.6.2 */ + ra_opt_pref = (struct icmpv6_opt_prefix *) msgb_put(msg, sizeof(*ra_opt_pref)); + ra_opt_pref->hdr.type = 3; /* RFC4861 4.6.2 */ + ra_opt_pref->hdr.len = 4; /* RFC4861 4.6.2 */ + ra_opt_pref->prefix_len = 64; /* only prefix length as per 3GPP */ + /* The Prefix is contained in the Prefix Information Option of + * the Router Advertisements and shall have the A-flag set + * and the L-flag cleared */ + ra_opt_pref->a = 1; + ra_opt_pref->l = 0; + ra_opt_pref->res = 0; + /* The lifetime of the prefix shall be set to infinity */ + ra_opt_pref->valid_lifetime = htonl(GGSN_AdvValidLifetime); + ra_opt_pref->preferred_lifetime = htonl(GGSN_AdvPreferredLifetime); + ra_opt_pref->res2 = 0; + memcpy(ra_opt_pref->prefix, prefix, sizeof(ra_opt_pref->prefix)); + + /* checksum */ + skb_csum = csum_partial(msgb_data(msg), msgb_length(msg), 0); + len = msgb_length(msg); + ra->hdr.csum = csum_ipv6_magic(saddr, daddr, len, IPPROTO_ICMPV6, skb_csum); + + /* Push IPv6 header in front of ICMPv6 packet */ + i6h = (struct ip6_hdr *) msgb_push(msg, sizeof(*i6h)); + /* 4 bits version, 8 bits TC, 20 bits flow-ID */ + i6h->ip6_ctlun.ip6_un1.ip6_un1_flow = htonl(0x60000000); + i6h->ip6_ctlun.ip6_un1.ip6_un1_plen = htons(len); + i6h->ip6_ctlun.ip6_un1.ip6_un1_nxt = IPPROTO_ICMPV6; + i6h->ip6_ctlun.ip6_un1.ip6_un1_hlim = 255; + i6h->ip6_src = *saddr; + i6h->ip6_dst = *daddr; + + return msg; +} + +/* Walidate an ICMPv6 router solicitation according to RFC4861 6.1.1 */ +static bool icmpv6_validate_router_solicit(const uint8_t *pack, unsigned len) +{ + const struct ip6_hdr *ip6h = (struct ip6_hdr *)pack; + //const struct icmpv6_hdr *ic6h = (struct icmpv6_hdr *) (pack + sizeof(*ip6h)); + + /* Hop limit field must have 255 */ + if (ip6h->ip6_ctlun.ip6_un1.ip6_un1_hlim != 255) + return false; + /* FIXME: ICMP checksum is valid */ + /* ICMP length (derived from IP length) is 8 or more octets */ + if (ip6h->ip6_ctlun.ip6_un1.ip6_un1_plen < 8) + return false; + /* FIXME: All included options have a length > 0 */ + /* FIXME: If IP source is unspecified, no source link-layer addr option */ + return true; +} + +/* RFC3307 link-local scope multicast address */ +static const struct in6_addr my_local_addr = { + .s6_addr = { 0x01,0x02,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0xff } +}; + +/* handle incoming packets to the all-routers multicast address */ +int handle_router_mcast(struct gsn_t *gsn, struct pdp_t *pdp, const uint8_t *pack, unsigned len) +{ + struct ippoolm_t *member = pdp->peer; + const struct ip6_hdr *ip6h = (struct ip6_hdr *)pack; + const struct icmpv6_hdr *ic6h = (struct icmpv6_hdr *) (pack + sizeof(*ip6h)); + struct msgb *msg; + + OSMO_ASSERT(pdp); + OSMO_ASSERT(member); + + if (len < sizeof(*ip6h)) { + LOGP(DICMP6, LOGL_NOTICE, "Packet too short: %u bytes\n", len); + return -1; + } + + /* we only treat ICMPv6 here */ + if (ip6h->ip6_ctlun.ip6_un1.ip6_un1_nxt != IPPROTO_ICMPV6) { + LOGP(DICMP6, LOGL_DEBUG, "Ignoring non-ICMP to all-routers mcast\n"); + return 0; + } + + if (len < sizeof(*ip6h) + sizeof(*ic6h)) { + LOGP(DICMP6, LOGL_NOTICE, "Short ICMPv6 packet: %s\n", osmo_hexdump(pack, len)); + return -1; + } + + switch (ic6h->type) { + case 133: /* router solicitation */ + if (ic6h->code != 0) { + LOGP(DICMP6, LOGL_NOTICE, "ICMPv6 type 133 but code %d\n", ic6h->code); + return -1; + } + if (!icmpv6_validate_router_solicit(pack, len)) { + LOGP(DICMP6, LOGL_NOTICE, "Invalid Router Solicitation: %s\n", + osmo_hexdump(pack, len)); + return -1; + } + /* FIXME: Send router advertisement from GGSN link-local + * address to MS link-local address, including prefix + * allocated to this PDP context */ + msg = icmpv6_construct_ra(&my_local_addr, &ip6h->ip6_src, &member->addr.v6); + /* Send the constructed RA to the MS */ + gtp_data_req(gsn, pdp, msgb_data(msg), msgb_length(msg)); + msgb_free(msg); + break; + default: + LOGP(DICMP6, LOGL_DEBUG, "Unknown ICMPv6 type %u\n", ic6h->type); + break; + } + return 0; +} diff --git a/ggsn/icmpv6.h b/ggsn/icmpv6.h new file mode 100644 index 0000000..ebff04e --- /dev/null +++ b/ggsn/icmpv6.h @@ -0,0 +1,6 @@ +#pragma once + +#include "../gtp/gtp.h" +#include "../gtp/pdp.h" + +int handle_router_mcast(struct gsn_t *gsn, struct pdp_t *pdp, const uint8_t *pack, unsigned len); diff --git a/lib/debug.c b/lib/debug.c index b3850f9..83423dc 100644 --- a/lib/debug.c +++ b/lib/debug.c @@ -26,6 +26,11 @@ .description = "SGSN Emulator", .enabled = 1, .loglevel = LOGL_NOTICE, }, + [DICMP6] = { + .name = "DICMP6", + .description = "ICMPv6", + .enabled = 1, .loglevel = LOGL_DEBUG, + }, }; const struct log_info log_info = { diff --git a/lib/syserr.h b/lib/syserr.h index 0c50a5f..adc5840 100644 --- a/lib/syserr.h +++ b/lib/syserr.h @@ -19,6 +19,7 @@ DTUN, DGGSN, DSGSN, + DICMP6, }; #define SYS_ERR(sub, pri, en, fmt, args...) \ -- To view, visit https://gerrit.osmocom.org/3458 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Icddf7d30e01d76a4784bcef5787b36f52f703a9f Gerrit-PatchSet: 3 Gerrit-Project: openggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Fri Aug 11 11:14:09 2017 From: gerrit-no-reply at lists.osmocom.org (Pablo Neira Ayuso) Date: Fri, 11 Aug 2017 11:14:09 +0000 Subject: [PATCH] openbsc[master]: libmsc: use new smpp34 esm_class definitions Message-ID: Review at https://gerrit.osmocom.org/3474 libmsc: use new smpp34 esm_class definitions Replace magic numbers by esm_class definitions. Change-Id: I6c458690da60c8f3637680efbd718f6e8c6feb4c --- M openbsc/src/libmsc/smpp_openbsc.c 1 file changed, 8 insertions(+), 10 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/74/3474/1 diff --git a/openbsc/src/libmsc/smpp_openbsc.c b/openbsc/src/libmsc/smpp_openbsc.c index 7e23abd..ddb24b5 100644 --- a/openbsc/src/libmsc/smpp_openbsc.c +++ b/openbsc/src/libmsc/smpp_openbsc.c @@ -157,14 +157,13 @@ osmo_strlcpy(sms->src.addr, (char *)submit->source_addr, sizeof(sms->src.addr)); - /* This is a Delivery Acknowledgment. */ - if (submit->esm_class == 0x08) + if (submit->esm_class == SMPP34_DELIVERY_ACK) sms->is_report = true; - if (submit->esm_class & 0x40) + if (submit->esm_class & SMPP34_UDHI_IND) sms->ud_hdr_ind = 1; - if (submit->esm_class & 0x80) { + if (submit->esm_class & SMPP34_REPLY_PATH) { sms->reply_path_req = 1; #warning Implement reply path } @@ -240,7 +239,7 @@ sms->smpp.esme = esme; sms->protocol_id = submit->protocol_id; - switch (submit->esm_class & 3) { + switch (submit->esm_class & SMPP34_MSG_MODE_MASK) { case 0: /* default */ case 1: /* datagram */ case 3: /* store-and-forward */ @@ -664,16 +663,15 @@ memcpy(deliver.destination_addr, sms->dst.addr, sizeof(deliver.destination_addr)); - /* Short message contains a delivery receipt? Sect. 5.2.12. */ if (sms->is_report) - deliver.esm_class = 0x04; + deliver.esm_class = SMPP34_DELIVERY_RECEIPT; else - deliver.esm_class = 1; /* datagram mode */ + deliver.esm_class = SMPP34_DATAGRAM_MODE; if (sms->ud_hdr_ind) - deliver.esm_class |= 0x40; + deliver.esm_class |= SMPP34_UDHI_IND; if (sms->reply_path_req) - deliver.esm_class |= 0x80; + deliver.esm_class |= SMPP34_REPLY_PATH; deliver.protocol_id = sms->protocol_id; deliver.priority_flag = 0; -- To view, visit https://gerrit.osmocom.org/3474 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I6c458690da60c8f3637680efbd718f6e8c6feb4c Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Pablo Neira Ayuso From gerrit-no-reply at lists.osmocom.org Fri Aug 11 11:14:51 2017 From: gerrit-no-reply at lists.osmocom.org (Pablo Neira Ayuso) Date: Fri, 11 Aug 2017 11:14:51 +0000 Subject: openbsc[master]: libmsc: use new smpp34 esm_class definitions In-Reply-To: References: Message-ID: Patch Set 1: This jenkins build will fail too, because it depends on a patch in libsmpp34 that I have just submitted. -- To view, visit https://gerrit.osmocom.org/3474 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I6c458690da60c8f3637680efbd718f6e8c6feb4c Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Pablo Neira Ayuso Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pablo Neira Ayuso Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Aug 11 11:19:03 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Fri, 11 Aug 2017 11:19:03 +0000 Subject: openbsc[master]: libmsc: use smpp34_tlv_for_each() to avoid suboptimal TLV ha... In-Reply-To: References: Message-ID: Patch Set 2: You could provide info about the dependency in the form "Requires libsmpp34 Change-Id XYZ" in the commit message, or at least here as a comment. This way is easier to track what needs to be merged, or which version of the library is used. -- To view, visit https://gerrit.osmocom.org/3470 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I53a65164a6cc4abc6bf57d9a8dc275cf21c90222 Gerrit-PatchSet: 2 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Pablo Neira Ayuso Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pablo Neira Ayuso Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Aug 11 11:28:23 2017 From: gerrit-no-reply at lists.osmocom.org (Pablo Neira Ayuso) Date: Fri, 11 Aug 2017 11:28:23 +0000 Subject: openbsc[master]: libmsc: use smpp34_tlv_for_each() to avoid suboptimal TLV ha... In-Reply-To: References: Message-ID: Patch Set 2: OK, will include this info once patches for libsmpp34 get in. So this also helps re-kick Jenkins building. -- To view, visit https://gerrit.osmocom.org/3470 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I53a65164a6cc4abc6bf57d9a8dc275cf21c90222 Gerrit-PatchSet: 2 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Pablo Neira Ayuso Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pablo Neira Ayuso Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Aug 11 11:29:20 2017 From: gerrit-no-reply at lists.osmocom.org (Pablo Neira Ayuso) Date: Fri, 11 Aug 2017 11:29:20 +0000 Subject: openbsc[master]: libmsc: use smpp34_tlv_for_each() to avoid suboptimal TLV ha... In-Reply-To: References: Message-ID: Patch Set 2: Oh, I forgot. You can probably speed up the process if you give me +X to my libsmpp34 patches (if you're familiar with that code). Thanks! -- To view, visit https://gerrit.osmocom.org/3470 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I53a65164a6cc4abc6bf57d9a8dc275cf21c90222 Gerrit-PatchSet: 2 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Pablo Neira Ayuso Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pablo Neira Ayuso Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Aug 11 11:33:48 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 11 Aug 2017 11:33:48 +0000 Subject: openggsn[master]: replace hand-coded tun_gifindex() with standard POSIX if_nam... In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3471 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I738472765ab09f530dcf071455e1bb4e6fb3f6e5 Gerrit-PatchSet: 2 Gerrit-Project: openggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Aug 11 11:33:52 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 11 Aug 2017 11:33:52 +0000 Subject: openggsn[master]: tun_new(): Fix array overflow in FreeBSD related code In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3472 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I096e3b614e82e402886163274cfcf9355bd57580 Gerrit-PatchSet: 2 Gerrit-Project: openggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Aug 11 11:33:54 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 11 Aug 2017 11:33:54 +0000 Subject: [MERGED] openggsn[master]: tun_new(): Fix array overflow in FreeBSD related code In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: tun_new(): Fix array overflow in FreeBSD related code ...................................................................... tun_new(): Fix array overflow in FreeBSD related code Change-Id: I096e3b614e82e402886163274cfcf9355bd57580 --- M lib/tun.c 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/lib/tun.c b/lib/tun.c index f6869ef..c4b7d10 100644 --- a/lib/tun.c +++ b/lib/tun.c @@ -784,7 +784,7 @@ } snprintf((*tun)->devname, sizeof((*tun)->devname), "tun%d", devnum); - (*tun)->devname[sizeof((*tun)->devname)] = 0; + (*tun)->devname[sizeof((*tun)->devname)-1] = 0; /* The tun device we found might have "old" IP addresses allocated */ /* We need to delete those. This problem is not present on Linux */ -- To view, visit https://gerrit.osmocom.org/3472 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I096e3b614e82e402886163274cfcf9355bd57580 Gerrit-PatchSet: 2 Gerrit-Project: openggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Fri Aug 11 11:33:55 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 11 Aug 2017 11:33:55 +0000 Subject: [MERGED] openggsn[master]: replace hand-coded tun_gifindex() with standard POSIX if_nam... In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: replace hand-coded tun_gifindex() with standard POSIX if_nametoindex() ...................................................................... replace hand-coded tun_gifindex() with standard POSIX if_nametoindex() Change-Id: I738472765ab09f530dcf071455e1bb4e6fb3f6e5 --- M lib/tun.c 1 file changed, 3 insertions(+), 25 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/lib/tun.c b/lib/tun.c index 11ea7bc..f6869ef 100644 --- a/lib/tun.c +++ b/lib/tun.c @@ -87,30 +87,6 @@ n->nlmsg_len = alen + len; return 0; } - -int tun_gifindex(struct tun_t *this, __u32 * index) -{ - struct ifreq ifr; - int fd; - - memset(&ifr, '\0', sizeof(ifr)); - ifr.ifr_addr.sa_family = AF_INET; - ifr.ifr_dstaddr.sa_family = AF_INET; - ifr.ifr_netmask.sa_family = AF_INET; - strncpy(ifr.ifr_name, this->devname, IFNAMSIZ); - ifr.ifr_name[IFNAMSIZ - 1] = 0; /* Make sure to terminate */ - if ((fd = socket(AF_INET, SOCK_DGRAM, 0)) < 0) { - SYS_ERR(DTUN, LOGL_ERROR, errno, "socket() failed"); - } - if (ioctl(fd, SIOCGIFINDEX, &ifr)) { - SYS_ERR(DTUN, LOGL_ERROR, errno, "ioctl() failed"); - close(fd); - return -1; - } - close(fd); - *index = ifr.ifr_ifindex; - return 0; -} #endif int tun_sifflags(struct tun_t *this, int flags) @@ -264,7 +240,9 @@ req.i.ifa_prefixlen = 32; /* 32 FOR IPv4 */ req.i.ifa_flags = 0; req.i.ifa_scope = RT_SCOPE_HOST; /* TODO or 0 */ - if (tun_gifindex(this, &req.i.ifa_index)) { + req.i.ifa_index = if_nametoindex(this->devname); + if (!req.i.ifa_index) { + SYS_ERR(DTUN, LOGL_ERROR, errno, "Unable to get ifindex for %s", this->devname); return -1; } -- To view, visit https://gerrit.osmocom.org/3471 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I738472765ab09f530dcf071455e1bb4e6fb3f6e5 Gerrit-PatchSet: 2 Gerrit-Project: openggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Fri Aug 11 11:34:49 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 11 Aug 2017 11:34:49 +0000 Subject: libsmpp34[master]: add smpp34_tlv_for_each() helper In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3469 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I446929feed049d0411e1629ca263e2bc41f714cc Gerrit-PatchSet: 1 Gerrit-Project: libsmpp34 Gerrit-Branch: master Gerrit-Owner: Pablo Neira Ayuso Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Aug 11 11:36:45 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 11 Aug 2017 11:36:45 +0000 Subject: libsmpp34[master]: add esm_class definitions In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 (1 comment) https://gerrit.osmocom.org/#/c/3473/1/src/smpp34.h File src/smpp34.h: Line 213: SMPP34_REPLY_PATH = 0x80, I think an enum only makes sense for fields that are not a bit/flag mask. The biggest benefit of using enum's is that you will get compiler warnings in case you forgot to handle one of the cases. However, for bit-mask values, that won't work either. Aynway, not critical. To me it seems like the "mode" could be an enum, but everything else is flags masked into the same byte? -- To view, visit https://gerrit.osmocom.org/3473 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I91afd8b462b8fd3b2c4c5b54f4eeb7ec5b730b65 Gerrit-PatchSet: 1 Gerrit-Project: libsmpp34 Gerrit-Branch: master Gerrit-Owner: Pablo Neira Ayuso Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Fri Aug 11 11:45:41 2017 From: gerrit-no-reply at lists.osmocom.org (Pablo Neira Ayuso) Date: Fri, 11 Aug 2017 11:45:41 +0000 Subject: libsmpp34[master]: add esm_class definitions In-Reply-To: References: Message-ID: Patch Set 1: Frankly, I would have used a define in first place. But I kind of understood enum is the policy for osmocom projects, so I followed this path. -- To view, visit https://gerrit.osmocom.org/3473 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I91afd8b462b8fd3b2c4c5b54f4eeb7ec5b730b65 Gerrit-PatchSet: 1 Gerrit-Project: libsmpp34 Gerrit-Branch: master Gerrit-Owner: Pablo Neira Ayuso Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pablo Neira Ayuso Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Aug 11 11:46:31 2017 From: gerrit-no-reply at lists.osmocom.org (Pablo Neira Ayuso) Date: Fri, 11 Aug 2017 11:46:31 +0000 Subject: [MERGED] libsmpp34[master]: add smpp34_tlv_for_each() helper In-Reply-To: References: Message-ID: Pablo Neira Ayuso has submitted this change and it was merged. Change subject: add smpp34_tlv_for_each() helper ...................................................................... add smpp34_tlv_for_each() helper So we don't need to remember this is an opencoded list of TLVs. Change-Id: I446929feed049d0411e1629ca263e2bc41f714cc --- M src/smpp34_structs.h 1 file changed, 3 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/smpp34_structs.h b/src/smpp34_structs.h index b9effb2..025109d 100644 --- a/src/smpp34_structs.h +++ b/src/smpp34_structs.h @@ -86,6 +86,9 @@ OCTET16( inst, octet, size ); \ } par; +#define smpp34_tlv_for_each(pos, head) \ + for (pos = (head); pos != NULL; pos = pos->next) + #define DAD( inst, par, do_dest_address ) dad_t *par; #define UU2( inst, par, size ) union { \ struct { \ -- To view, visit https://gerrit.osmocom.org/3469 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I446929feed049d0411e1629ca263e2bc41f714cc Gerrit-PatchSet: 1 Gerrit-Project: libsmpp34 Gerrit-Branch: master Gerrit-Owner: Pablo Neira Ayuso Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pablo Neira Ayuso From gerrit-no-reply at lists.osmocom.org Fri Aug 11 11:49:35 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 11 Aug 2017 11:49:35 +0000 Subject: [PATCH] openggsn[master]: Use osmocom-style git-version-gen / .version magic Message-ID: Review at https://gerrit.osmocom.org/3475 Use osmocom-style git-version-gen / .version magic This generates the version number from the latest tag + git history Change-Id: I71e1c3f8f534d9e9690c94068eccdee29a6fee12 --- M Makefile.am M configure.ac M debian/rules A git-version-gen 4 files changed, 163 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openggsn refs/changes/75/3475/1 diff --git a/Makefile.am b/Makefile.am index 8232770..970fbf7 100644 --- a/Makefile.am +++ b/Makefile.am @@ -4,4 +4,10 @@ pkgconfigdir = $(libdir)/pkgconfig pkgconfig_DATA = libgtp.pc -EXTRA_DIST = README.md README.FreeBSD README.MacOSX README.Solaris +BUILT_SOURCES = $(top_srcdir)/.version +$(top_srcdir)/.version: + echo $(VERSION) > $@-t && mv $@-t $@ +dist-hook: + echo $(VERSION) > $(distdir)/.tarball-version + +EXTRA_DIST = git-version-gen .version README.md README.FreeBSD README.MacOSX README.Solaris diff --git a/configure.ac b/configure.ac index b7e6793..63d3117 100644 --- a/configure.ac +++ b/configure.ac @@ -1,5 +1,5 @@ # Process this file with autoconf to produce a configure script. -AC_INIT(openggsn, 0.93, laforge at gnumonks.org) +AC_INIT(openggsn, m4_esyscmd([./git-version-gen .tarball-version]), osmocom-net-gprs at lists.osmocom.org) AC_CONFIG_SRCDIR([gtp/gtp.c]) AM_CONFIG_HEADER([config.h]) #AC_CONFIG_HEADER([config.h]) diff --git a/debian/rules b/debian/rules index 5562909..8710fa0 100755 --- a/debian/rules +++ b/debian/rules @@ -12,3 +12,7 @@ override_dh_strip: dh_strip --dbg-package=openggsn-dbg + +override_dh_autoreconf: + echo $(VERSION) > .tarball-version + dh_autoreconf diff --git a/git-version-gen b/git-version-gen new file mode 100755 index 0000000..42cf3d2 --- /dev/null +++ b/git-version-gen @@ -0,0 +1,151 @@ +#!/bin/sh +# Print a version string. +scriptversion=2010-01-28.01 + +# Copyright (C) 2007-2010 Free Software Foundation, Inc. +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +# This script is derived from GIT-VERSION-GEN from GIT: http://git.or.cz/. +# It may be run two ways: +# - from a git repository in which the "git describe" command below +# produces useful output (thus requiring at least one signed tag) +# - from a non-git-repo directory containing a .tarball-version file, which +# presumes this script is invoked like "./git-version-gen .tarball-version". + +# In order to use intra-version strings in your project, you will need two +# separate generated version string files: +# +# .tarball-version - present only in a distribution tarball, and not in +# a checked-out repository. Created with contents that were learned at +# the last time autoconf was run, and used by git-version-gen. Must not +# be present in either $(srcdir) or $(builddir) for git-version-gen to +# give accurate answers during normal development with a checked out tree, +# but must be present in a tarball when there is no version control system. +# Therefore, it cannot be used in any dependencies. GNUmakefile has +# hooks to force a reconfigure at distribution time to get the value +# correct, without penalizing normal development with extra reconfigures. +# +# .version - present in a checked-out repository and in a distribution +# tarball. Usable in dependencies, particularly for files that don't +# want to depend on config.h but do want to track version changes. +# Delete this file prior to any autoconf run where you want to rebuild +# files to pick up a version string change; and leave it stale to +# minimize rebuild time after unrelated changes to configure sources. +# +# It is probably wise to add these two files to .gitignore, so that you +# don't accidentally commit either generated file. +# +# Use the following line in your configure.ac, so that $(VERSION) will +# automatically be up-to-date each time configure is run (and note that +# since configure.ac no longer includes a version string, Makefile rules +# should not depend on configure.ac for version updates). +# +# AC_INIT([GNU project], +# m4_esyscmd([build-aux/git-version-gen .tarball-version]), +# [bug-project at example]) +# +# Then use the following lines in your Makefile.am, so that .version +# will be present for dependencies, and so that .tarball-version will +# exist in distribution tarballs. +# +# BUILT_SOURCES = $(top_srcdir)/.version +# $(top_srcdir)/.version: +# echo $(VERSION) > $@-t && mv $@-t $@ +# dist-hook: +# echo $(VERSION) > $(distdir)/.tarball-version + +case $# in + 1) ;; + *) echo 1>&2 "Usage: $0 \$srcdir/.tarball-version"; exit 1;; +esac + +tarball_version_file=$1 +nl=' +' + +# First see if there is a tarball-only version file. +# then try "git describe", then default. +if test -f $tarball_version_file +then + v=`cat $tarball_version_file` || exit 1 + case $v in + *$nl*) v= ;; # reject multi-line output + [0-9]*) ;; + *) v= ;; + esac + test -z "$v" \ + && echo "$0: WARNING: $tarball_version_file seems to be damaged" 1>&2 +fi + +if test -n "$v" +then + : # use $v +elif + v=`git describe --abbrev=4 --match='v*' HEAD 2>/dev/null \ + || git describe --abbrev=4 HEAD 2>/dev/null` \ + && case $v in + [0-9]*) ;; + v[0-9]*) ;; + *) (exit 1) ;; + esac +then + # Is this a new git that lists number of commits since the last + # tag or the previous older version that did not? + # Newer: v6.10-77-g0f8faeb + # Older: v6.10-g0f8faeb + case $v in + *-*-*) : git describe is okay three part flavor ;; + *-*) + : git describe is older two part flavor + # Recreate the number of commits and rewrite such that the + # result is the same as if we were using the newer version + # of git describe. + vtag=`echo "$v" | sed 's/-.*//'` + numcommits=`git rev-list "$vtag"..HEAD | wc -l` + v=`echo "$v" | sed "s/\(.*\)-\(.*\)/\1-$numcommits-\2/"`; + ;; + esac + + # Change the first '-' to a '.', so version-comparing tools work properly. + # Remove the "g" in git describe's output string, to save a byte. + v=`echo "$v" | sed 's/-/./;s/\(.*\)-g/\1-/'`; +else + v=UNKNOWN +fi + +v=`echo "$v" |sed 's/^v//'` + +# Don't declare a version "dirty" merely because a time stamp has changed. +git status > /dev/null 2>&1 + +dirty=`sh -c 'git diff-index --name-only HEAD' 2>/dev/null` || dirty= +case "$dirty" in + '') ;; + *) # Append the suffix only if there isn't one already. + case $v in + *-dirty) ;; + *) v="$v-dirty" ;; + esac ;; +esac + +# Omit the trailing newline, so that m4_esyscmd can use the result directly. +echo "$v" | tr -d '\012' + +# Local variables: +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "scriptversion=" +# time-stamp-format: "%:y-%02m-%02d.%02H" +# time-stamp-end: "$" +# End: -- To view, visit https://gerrit.osmocom.org/3475 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I71e1c3f8f534d9e9690c94068eccdee29a6fee12 Gerrit-PatchSet: 1 Gerrit-Project: openggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Fri Aug 11 11:51:16 2017 From: gerrit-no-reply at lists.osmocom.org (Pablo Neira Ayuso) Date: Fri, 11 Aug 2017 11:51:16 +0000 Subject: [PATCH] libsmpp34[master]: add esm_class definitions 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/3473 to look at the new patch set (#2). add esm_class definitions Add special message attributes definitions that are associated with the short message. Thus, we can get rid of magic numbers in our codebase. Change-Id: I91afd8b462b8fd3b2c4c5b54f4eeb7ec5b730b65 --- M src/smpp34.h 1 file changed, 8 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libsmpp34 refs/changes/73/3473/2 diff --git a/src/smpp34.h b/src/smpp34.h index 5fb6395..9d51a4a 100644 --- a/src/smpp34.h +++ b/src/smpp34.h @@ -204,4 +204,12 @@ #define TLVID_its_reply_type 0x1380 /* CDMA */ #define TLVID_its_session_info 0x1383 /* CDMA */ +/* As defined by SMPP 3.4, Sect. 5.2.12 Parameter Definition esm_class. */ +#define SMPP34_DATAGRAM_MODE 0x01 +#define SMPP34_MSG_MODE_MASK 0x03 +#define SMPP34_DELIVERY_RECEIPT 0x04 +#define SMPP34_DELIVERY_ACK 0x08 +#define SMPP34_UDHI_IND 0x40 +#define SMPP34_REPLY_PATH 0x80 + #endif -- To view, visit https://gerrit.osmocom.org/3473 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I91afd8b462b8fd3b2c4c5b54f4eeb7ec5b730b65 Gerrit-PatchSet: 2 Gerrit-Project: libsmpp34 Gerrit-Branch: master Gerrit-Owner: Pablo Neira Ayuso Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pablo Neira Ayuso From gerrit-no-reply at lists.osmocom.org Fri Aug 11 11:55:37 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 11 Aug 2017 11:55:37 +0000 Subject: openggsn[master]: Use osmocom-style git-version-gen / .version magic In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3475 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I71e1c3f8f534d9e9690c94068eccdee29a6fee12 Gerrit-PatchSet: 1 Gerrit-Project: openggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Aug 11 11:57:10 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 11 Aug 2017 11:57:10 +0000 Subject: [MERGED] openggsn[master]: Use osmocom-style git-version-gen / .version magic In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Use osmocom-style git-version-gen / .version magic ...................................................................... Use osmocom-style git-version-gen / .version magic This generates the version number from the latest tag + git history Change-Id: I71e1c3f8f534d9e9690c94068eccdee29a6fee12 --- M Makefile.am M configure.ac M debian/rules A git-version-gen 4 files changed, 163 insertions(+), 2 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/Makefile.am b/Makefile.am index 8232770..970fbf7 100644 --- a/Makefile.am +++ b/Makefile.am @@ -4,4 +4,10 @@ pkgconfigdir = $(libdir)/pkgconfig pkgconfig_DATA = libgtp.pc -EXTRA_DIST = README.md README.FreeBSD README.MacOSX README.Solaris +BUILT_SOURCES = $(top_srcdir)/.version +$(top_srcdir)/.version: + echo $(VERSION) > $@-t && mv $@-t $@ +dist-hook: + echo $(VERSION) > $(distdir)/.tarball-version + +EXTRA_DIST = git-version-gen .version README.md README.FreeBSD README.MacOSX README.Solaris diff --git a/configure.ac b/configure.ac index b7e6793..63d3117 100644 --- a/configure.ac +++ b/configure.ac @@ -1,5 +1,5 @@ # Process this file with autoconf to produce a configure script. -AC_INIT(openggsn, 0.93, laforge at gnumonks.org) +AC_INIT(openggsn, m4_esyscmd([./git-version-gen .tarball-version]), osmocom-net-gprs at lists.osmocom.org) AC_CONFIG_SRCDIR([gtp/gtp.c]) AM_CONFIG_HEADER([config.h]) #AC_CONFIG_HEADER([config.h]) diff --git a/debian/rules b/debian/rules index 5562909..8710fa0 100755 --- a/debian/rules +++ b/debian/rules @@ -12,3 +12,7 @@ override_dh_strip: dh_strip --dbg-package=openggsn-dbg + +override_dh_autoreconf: + echo $(VERSION) > .tarball-version + dh_autoreconf diff --git a/git-version-gen b/git-version-gen new file mode 100755 index 0000000..42cf3d2 --- /dev/null +++ b/git-version-gen @@ -0,0 +1,151 @@ +#!/bin/sh +# Print a version string. +scriptversion=2010-01-28.01 + +# Copyright (C) 2007-2010 Free Software Foundation, Inc. +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +# This script is derived from GIT-VERSION-GEN from GIT: http://git.or.cz/. +# It may be run two ways: +# - from a git repository in which the "git describe" command below +# produces useful output (thus requiring at least one signed tag) +# - from a non-git-repo directory containing a .tarball-version file, which +# presumes this script is invoked like "./git-version-gen .tarball-version". + +# In order to use intra-version strings in your project, you will need two +# separate generated version string files: +# +# .tarball-version - present only in a distribution tarball, and not in +# a checked-out repository. Created with contents that were learned at +# the last time autoconf was run, and used by git-version-gen. Must not +# be present in either $(srcdir) or $(builddir) for git-version-gen to +# give accurate answers during normal development with a checked out tree, +# but must be present in a tarball when there is no version control system. +# Therefore, it cannot be used in any dependencies. GNUmakefile has +# hooks to force a reconfigure at distribution time to get the value +# correct, without penalizing normal development with extra reconfigures. +# +# .version - present in a checked-out repository and in a distribution +# tarball. Usable in dependencies, particularly for files that don't +# want to depend on config.h but do want to track version changes. +# Delete this file prior to any autoconf run where you want to rebuild +# files to pick up a version string change; and leave it stale to +# minimize rebuild time after unrelated changes to configure sources. +# +# It is probably wise to add these two files to .gitignore, so that you +# don't accidentally commit either generated file. +# +# Use the following line in your configure.ac, so that $(VERSION) will +# automatically be up-to-date each time configure is run (and note that +# since configure.ac no longer includes a version string, Makefile rules +# should not depend on configure.ac for version updates). +# +# AC_INIT([GNU project], +# m4_esyscmd([build-aux/git-version-gen .tarball-version]), +# [bug-project at example]) +# +# Then use the following lines in your Makefile.am, so that .version +# will be present for dependencies, and so that .tarball-version will +# exist in distribution tarballs. +# +# BUILT_SOURCES = $(top_srcdir)/.version +# $(top_srcdir)/.version: +# echo $(VERSION) > $@-t && mv $@-t $@ +# dist-hook: +# echo $(VERSION) > $(distdir)/.tarball-version + +case $# in + 1) ;; + *) echo 1>&2 "Usage: $0 \$srcdir/.tarball-version"; exit 1;; +esac + +tarball_version_file=$1 +nl=' +' + +# First see if there is a tarball-only version file. +# then try "git describe", then default. +if test -f $tarball_version_file +then + v=`cat $tarball_version_file` || exit 1 + case $v in + *$nl*) v= ;; # reject multi-line output + [0-9]*) ;; + *) v= ;; + esac + test -z "$v" \ + && echo "$0: WARNING: $tarball_version_file seems to be damaged" 1>&2 +fi + +if test -n "$v" +then + : # use $v +elif + v=`git describe --abbrev=4 --match='v*' HEAD 2>/dev/null \ + || git describe --abbrev=4 HEAD 2>/dev/null` \ + && case $v in + [0-9]*) ;; + v[0-9]*) ;; + *) (exit 1) ;; + esac +then + # Is this a new git that lists number of commits since the last + # tag or the previous older version that did not? + # Newer: v6.10-77-g0f8faeb + # Older: v6.10-g0f8faeb + case $v in + *-*-*) : git describe is okay three part flavor ;; + *-*) + : git describe is older two part flavor + # Recreate the number of commits and rewrite such that the + # result is the same as if we were using the newer version + # of git describe. + vtag=`echo "$v" | sed 's/-.*//'` + numcommits=`git rev-list "$vtag"..HEAD | wc -l` + v=`echo "$v" | sed "s/\(.*\)-\(.*\)/\1-$numcommits-\2/"`; + ;; + esac + + # Change the first '-' to a '.', so version-comparing tools work properly. + # Remove the "g" in git describe's output string, to save a byte. + v=`echo "$v" | sed 's/-/./;s/\(.*\)-g/\1-/'`; +else + v=UNKNOWN +fi + +v=`echo "$v" |sed 's/^v//'` + +# Don't declare a version "dirty" merely because a time stamp has changed. +git status > /dev/null 2>&1 + +dirty=`sh -c 'git diff-index --name-only HEAD' 2>/dev/null` || dirty= +case "$dirty" in + '') ;; + *) # Append the suffix only if there isn't one already. + case $v in + *-dirty) ;; + *) v="$v-dirty" ;; + esac ;; +esac + +# Omit the trailing newline, so that m4_esyscmd can use the result directly. +echo "$v" | tr -d '\012' + +# Local variables: +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "scriptversion=" +# time-stamp-format: "%:y-%02m-%02d.%02H" +# time-stamp-end: "$" +# End: -- To view, visit https://gerrit.osmocom.org/3475 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I71e1c3f8f534d9e9690c94068eccdee29a6fee12 Gerrit-PatchSet: 1 Gerrit-Project: openggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Fri Aug 11 12:28:36 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Fri, 11 Aug 2017 12:28:36 +0000 Subject: openbsc[master]: libmsc: use smpp34_tlv_for_each() to avoid suboptimal TLV ha... In-Reply-To: References: Message-ID: Patch Set 2: I never looked at that library so far, and I cannot give +2 on it anyway, sorry for that. Regarding your "retrigger by pushing again", I give you a tip for that: You can re-trigger the jenkins job which was launched by Gerrit and it if succeeds, it will automatically give Verify+1 to the patch. You can find the link to the last job in one of the old comments in this patch, which is posted by "Jenkins Builder". Follow the link to jenkins and press "Retrigger" button which, if you have enough permissions, should appear on the left side of the web page. -- To view, visit https://gerrit.osmocom.org/3470 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I53a65164a6cc4abc6bf57d9a8dc275cf21c90222 Gerrit-PatchSet: 2 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Pablo Neira Ayuso Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pablo Neira Ayuso Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Aug 11 12:41:45 2017 From: gerrit-no-reply at lists.osmocom.org (Pablo Neira Ayuso) Date: Fri, 11 Aug 2017 12:41:45 +0000 Subject: [PATCH] openbsc[master]: libmsc: use smpp34_tlv_for_each() to avoid suboptimal TLV ha... In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3470 to look at the new patch set (#3). libmsc: use smpp34_tlv_for_each() to avoid suboptimal TLV handling submit_to_sms() now handles two TLVs, so find_tlv() is suboptiomal and it can be removed, since it would result in two passes on the TLV list. Use new smpp34_tlv_for_each() helper to iterate over the list of TLVs that is available since I446929feed049d0411e1629ca263e2bc41f714cc. Change-Id: I53a65164a6cc4abc6bf57d9a8dc275cf21c90222 --- M openbsc/src/libmsc/smpp_openbsc.c 1 file changed, 41 insertions(+), 31 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/70/3470/3 diff --git a/openbsc/src/libmsc/smpp_openbsc.c b/openbsc/src/libmsc/smpp_openbsc.c index 85de040..7e23abd 100644 --- a/openbsc/src/libmsc/smpp_openbsc.c +++ b/openbsc/src/libmsc/smpp_openbsc.c @@ -72,26 +72,31 @@ return subscr; } -/*! \brief find a TLV with given tag in list of libsmpp34 TLVs */ -static struct tlv_t *find_tlv(struct tlv_t *head, uint16_t tag) +static int smpp34_submit_tlv_msg_payload(const struct tlv_t *t, + const struct submit_sm_t *submit, + const uint8_t **sms_msg, + unsigned int *sms_msg_len) { - struct tlv_t *t; - - for (t = head; t != NULL; t = t->next) { - if (t->tag == tag) - return t; + if (submit->sm_length) { + LOGP(DLSMS, LOGL_ERROR, + "SMPP cannot have payload in TLV _and_ in the header\n"); + return -1; } - return NULL; + *sms_msg = t->value.octet; + *sms_msg_len = t->length; + + return 0; } /*! \brief convert from submit_sm_t to gsm_sms */ static int submit_to_sms(struct gsm_sms **psms, struct gsm_network *net, const struct submit_sm_t *submit) { + const uint8_t *sms_msg = NULL; struct gsm_subscriber *dest; + uint16_t msg_ref = 0; struct gsm_sms *sms; struct tlv_t *t; - const uint8_t *sms_msg; unsigned int sms_msg_len; int mode; @@ -105,31 +110,40 @@ return ESME_RINVDSTADR; } - t = find_tlv(submit->tlv, TLVID_message_payload); - if (t) { - if (submit->sm_length) { - /* ERROR: we cannot have both! */ - LOGP(DLSMS, LOGL_ERROR, "SMPP Cannot have payload in " - "TLV _and_ in the header\n"); - subscr_put(dest); - return ESME_ROPTPARNOTALLWD; + smpp34_tlv_for_each(t, submit->tlv) { + switch (t->tag) { + case TLVID_message_payload: + if (smpp34_submit_tlv_msg_payload(t, submit, &sms_msg, + &sms_msg_len) < 0) { + subscr_put(dest); + return ESME_ROPTPARNOTALLWD; + } + break; + case TLVID_user_message_reference: + msg_ref = ntohs(t->value.val16); + break; + default: + break; } - sms_msg = t->value.octet; - sms_msg_len = t->length; - } else if (submit->sm_length > 0 && submit->sm_length < 255) { - sms_msg = submit->short_message; - sms_msg_len = submit->sm_length; - } else { - LOGP(DLSMS, LOGL_ERROR, - "SMPP neither message payload nor valid sm_length.\n"); - subscr_put(dest); - return ESME_RINVPARLEN; + } + + if (!sms_msg) { + if (submit->sm_length > 0 && submit->sm_length < 255) { + sms_msg = submit->short_message; + sms_msg_len = submit->sm_length; + } else { + LOGP(DLSMS, LOGL_ERROR, + "SMPP neither message payload nor valid sm_length.\n"); + subscr_put(dest); + return ESME_RINVPARLEN; + } } sms = sms_alloc(); sms->source = SMS_SOURCE_SMPP; sms->smpp.sequence_nr = submit->sequence_number; sms->status_rep_req = submit->registered_delivery; + sms->msg_ref = msg_ref; /* fill in the destination address */ sms->receiver = dest; @@ -203,10 +217,6 @@ memcpy(sms->user_data, sms_msg, sms_msg_len); sms->user_data_len = sms_msg_len; } - - t = find_tlv(submit->tlv, TLVID_user_message_reference); - if (t) - sms->msg_ref = ntohs(t->value.val16); *psms = sms; return ESME_ROK; -- To view, visit https://gerrit.osmocom.org/3470 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I53a65164a6cc4abc6bf57d9a8dc275cf21c90222 Gerrit-PatchSet: 3 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Pablo Neira Ayuso Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pablo Neira Ayuso Gerrit-Reviewer: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Fri Aug 11 13:05:00 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Fri, 11 Aug 2017 13:05:00 +0000 Subject: [PATCH] osmo-gsm-manuals[master]: osmux: Fix description for Dummy frames FT field Message-ID: Review at https://gerrit.osmocom.org/3478 osmux: Fix description for Dummy frames FT field Change-Id: Ia421655bd1be45101da3db2a0af44fbb3cc111c1 --- M OsmoBSC/osmux-reference.adoc 1 file changed, 3 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-manuals refs/changes/78/3478/1 diff --git a/OsmoBSC/osmux-reference.adoc b/OsmoBSC/osmux-reference.adoc index 4d03a4b..929f442 100644 --- a/OsmoBSC/osmux-reference.adoc +++ b/OsmoBSC/osmux-reference.adoc @@ -159,7 +159,7 @@ ---- Field Type (FT): 2 bits:: -The Field Type allocated for LAPD Signalling is "0". +The Field Type allocated for LAPD Signalling frames is "0". This frame type is not yet supported inside OsmoCom and may be subject to change in future versions of the protocol. @@ -197,7 +197,7 @@ talkspurt. Field Type (FT): 2 bits:: -The Field Type allocated for AMR codec is "1". +The Field Type allocated for AMR Codec frames is "1". Frame Counter (CTR): 2 bits:: Provides the number of batched AMR payloads (starting 0) after the header. For @@ -284,7 +284,7 @@ ---- Field Type (FT): 2 bits:: -The Field Type allocated for AMR codec is "2". +The Field Type allocated for Dummy frames is "2". Frame Counter (CTR): 2 bits:: Provides the number of dummy batched AMR payloads (starting 0) after the header. -- To view, visit https://gerrit.osmocom.org/3478 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ia421655bd1be45101da3db2a0af44fbb3cc111c1 Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Fri Aug 11 13:40:51 2017 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Fri, 11 Aug 2017 13:40:51 +0000 Subject: [PATCH] libosmo-sccp[master]: sccp: fix handling of default IP addresses in osmo_sccp_simp... Message-ID: Review at https://gerrit.osmocom.org/3479 sccp: fix handling of default IP addresses in osmo_sccp_simple_client() When the default IP addresses (remote or local) the respective struct value should be set to NULL. Fix wrong ?:-notation. Change-Id: I312caf9d54cedb02034e4ef88fdd2e6ad9ca1c34 --- M src/sccp_user.c 1 file changed, 4 insertions(+), 4 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-sccp refs/changes/79/3479/1 diff --git a/src/sccp_user.c b/src/sccp_user.c index 9116b60..4e28aa0 100644 --- a/src/sccp_user.c +++ b/src/sccp_user.c @@ -404,10 +404,10 @@ goto out_rt; asp_created = true; - default_local_ip ? asp->cfg.local.host = - talloc_strdup(asp, default_local_ip) : NULL; - default_remote_ip ? asp->cfg.remote.host = - talloc_strdup(asp, default_remote_ip) : NULL; + asp->cfg.local.host = + default_local_ip ? asp->cfg.local.host : NULL; + asp->cfg.remote.host = + default_remote_ip ? asp->cfg.remote.host : NULL; osmo_ss7_as_add_asp(as, asp->cfg.name); } -- To view, visit https://gerrit.osmocom.org/3479 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I312caf9d54cedb02034e4ef88fdd2e6ad9ca1c34 Gerrit-PatchSet: 1 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: dexter From gerrit-no-reply at lists.osmocom.org Fri Aug 11 13:40:51 2017 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Fri, 11 Aug 2017 13:40:51 +0000 Subject: [PATCH] libosmo-sccp[master]: sccp: check for valid point code in osmo_sccp_simple_client() Message-ID: Review at https://gerrit.osmocom.org/3480 sccp: check for valid point code in osmo_sccp_simple_client() The point-code is not checked in the beginning, only the ASP checks the point code at a very late stage and fails in case an invalid point-code is detected. Remove the check in the ASP creation. Add a new check after the SS7 initalization that checks the point-code. If none is set, the default point-code will be used. Change-Id: I334d90e769bd9952f67c51b12a945f22bd268fa8 --- M src/sccp_user.c 1 file changed, 10 insertions(+), 6 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-sccp refs/changes/80/3480/1 diff --git a/src/sccp_user.c b/src/sccp_user.c index 4e28aa0..387061c 100644 --- a/src/sccp_user.c +++ b/src/sccp_user.c @@ -342,6 +342,16 @@ ss7->cfg.primary_pc = default_pc; ss7_created = true; } + + /* In case no valid point-code has been configured via the VTY, we + * will fall back to the default pointcode. */ + if (!osmo_ss7_pc_is_valid(ss7->cfg.primary_pc)) { + LOGP(DLSCCP, LOGL_ERROR, + "SS7 instance %u: no primary point-code set, using default point-code\n", + ss7->cfg.id); + ss7->cfg.primary_pc = default_pc; + } + LOGP(DLSCCP, LOGL_NOTICE, "%s: Using SS7 instance %u, pc:%s\n", name, ss7->cfg.id, osmo_ss7_pointcode_print(ss7, ss7->cfg.primary_pc)); @@ -364,12 +374,6 @@ if (!as) goto out_ss7; as_created = true; - - if (!osmo_ss7_pc_is_valid(ss7->cfg.primary_pc)) { - LOGP(DLSCCP, LOGL_ERROR, "SS7 instance %u: no primary point-code set\n", - ss7->cfg.id); - goto out_ss7; - } as->cfg.routing_key.pc = ss7->cfg.primary_pc; } LOGP(DLSCCP, LOGL_NOTICE, "%s: Using AS instance %s\n", name, -- To view, visit https://gerrit.osmocom.org/3480 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I334d90e769bd9952f67c51b12a945f22bd268fa8 Gerrit-PatchSet: 1 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: dexter From gerrit-no-reply at lists.osmocom.org Fri Aug 11 13:40:51 2017 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Fri, 11 Aug 2017 13:40:51 +0000 Subject: [PATCH] libosmo-sccp[master]: sccp: add doxgen comments for osmo_sccp_simple_client() Message-ID: Review at https://gerrit.osmocom.org/3481 sccp: add doxgen comments for osmo_sccp_simple_client() Some of the functons in sccp_user.c have already doygen comments on them. Add doxygen comments for the simple client functions as well Change-Id: I9143bdc54d729f9f50e69fe38cd1798e065f2497 --- M src/sccp_user.c 1 file changed, 32 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-sccp refs/changes/81/3481/1 diff --git a/src/sccp_user.c b/src/sccp_user.c index 387061c..c0e2b5a 100644 --- a/src/sccp_user.c +++ b/src/sccp_user.c @@ -295,6 +295,18 @@ * Convenience function for CLIENT ***********************************************************************/ +/*! \brief request an sccp client instance + * \param[in] ctx talloc context + * \param[in] ss7_id of the SS7/CS7 instance + * \param[in] name human readable name + * \param[in] default_pc pointcode to be used on missing VTY setting + * \param[in] prot protocol to be used (e.g OSMO_SS7_ASP_PROT_M3UA) + * \param[in] default_local_port local port to be usd on missing VTY setting + * \param[in] default_local_ip local IP-address to be usd on missing VTY setting + * \param[in] default_remote_port remote port to be usd on missing VTY setting + * \param[in] default_remote_ip remote IP-address to be usd on missing VTY setting + * \returns callee-allocated SCCP instance on success; NULL on error */ + struct osmo_sccp_instance * osmo_sccp_simple_client_on_ss7_id(void *ctx, uint32_t ss7_id, const char *name, uint32_t default_pc, @@ -313,6 +325,12 @@ struct osmo_ss7_asp *asp; bool asp_created = false; char *as_name, *asp_name = NULL; + + /*! The function will examine the given CS7 instance and its sub + * components (as, asp, etc.). If necessary it will allocate + * the missing components. If no CS7 instance can be detected + * under the caller supplied ID, a new instance will be created + * beforehand. */ /* Choose default ports when the caller does not supply valid port * numbers. */ @@ -450,12 +468,26 @@ return NULL; } +/*! \brief request an sccp client instance + * \param[in] ctx talloc context + * \param[in] name human readable name + * \param[in] default_pc pointcode to be used on missing VTY setting + * \param[in] prot protocol to be used (e.g OSMO_SS7_ASP_PROT_M3UA) + * \param[in] default_local_port local port to be usd on missing VTY setting + * \param[in] default_local_ip local IP-address to be usd on missing VTY setting + * \param[in] default_remote_port remote port to be usd on missing VTY setting + * \param[in] default_remote_ip remote IP-address to be usd on missing VTY setting + * \returns callee-allocated SCCP instance on success; NULL on error */ struct osmo_sccp_instance * osmo_sccp_simple_client(void *ctx, const char *name, uint32_t default_pc, enum osmo_ss7_asp_protocol prot, int default_local_port, const char *default_local_ip, int default_remote_port, const char *default_remote_ip) { + /*! This is simplified version of osmo_sccp_simple_client_on_ss7_id(). + * the only difference is that the ID of the CS7 instance will be + * set to 1 statically */ + return osmo_sccp_simple_client_on_ss7_id(ctx, 1, name, default_pc, prot, default_local_port, default_local_ip, -- To view, visit https://gerrit.osmocom.org/3481 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I9143bdc54d729f9f50e69fe38cd1798e065f2497 Gerrit-PatchSet: 1 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: dexter From gerrit-no-reply at lists.osmocom.org Fri Aug 11 13:40:51 2017 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Fri, 11 Aug 2017 13:40:51 +0000 Subject: [PATCH] libosmo-sccp[master]: sccp: make osmo_sccp_addr_name() available Message-ID: Review at https://gerrit.osmocom.org/3482 sccp: make osmo_sccp_addr_name() available osmo_sccp_addr_name() is not listed in any header file. Add osmo_sccp_addr_name() to sccp_helpers.h in order to make it available. Change-Id: I092dd55948faeeff78f28f7d50c5b84b9e69ef24 --- M include/osmocom/sigtran/sccp_helpers.h 1 file changed, 1 insertion(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-sccp refs/changes/82/3482/1 diff --git a/include/osmocom/sigtran/sccp_helpers.h b/include/osmocom/sigtran/sccp_helpers.h index 2f318f4..c2175f4 100644 --- a/include/osmocom/sigtran/sccp_helpers.h +++ b/include/osmocom/sigtran/sccp_helpers.h @@ -54,3 +54,4 @@ char *osmo_sccp_gt_dump(const struct osmo_sccp_gt *gt); char *osmo_sccp_addr_dump(const struct osmo_sccp_addr *addr); +char *osmo_sccp_addr_name(const struct osmo_ss7_instance *ss7, const struct osmo_sccp_addr *addr); -- To view, visit https://gerrit.osmocom.org/3482 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I092dd55948faeeff78f28f7d50c5b84b9e69ef24 Gerrit-PatchSet: 1 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: dexter From gerrit-no-reply at lists.osmocom.org Fri Aug 11 14:49:18 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Fri, 11 Aug 2017 14:49:18 +0000 Subject: [PATCH] openbsc[master]: mgcp_osmux: Remove unused parameter Message-ID: Review at https://gerrit.osmocom.org/3483 mgcp_osmux: Remove unused parameter Change-Id: Icb1e7cb15fe04642578f5292124ebc1eac9c9aa3 --- M openbsc/include/openbsc/osmux.h M openbsc/src/libmgcp/mgcp_osmux.c 2 files changed, 4 insertions(+), 8 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/83/3483/1 diff --git a/openbsc/include/openbsc/osmux.h b/openbsc/include/openbsc/osmux.h index 0b64a7f..f3ea72a 100644 --- a/openbsc/include/openbsc/osmux.h +++ b/openbsc/include/openbsc/osmux.h @@ -11,8 +11,7 @@ }; int osmux_init(int role, struct mgcp_config *cfg); -int osmux_enable_endpoint(struct mgcp_endpoint *endp, int role, - struct in_addr *addr, uint16_t port); +int osmux_enable_endpoint(struct mgcp_endpoint *endp, struct in_addr *addr, uint16_t port); void osmux_disable_endpoint(struct mgcp_endpoint *endp); void osmux_allocate_cid(struct mgcp_endpoint *endp); void osmux_release_cid(struct mgcp_endpoint *endp); diff --git a/openbsc/src/libmgcp/mgcp_osmux.c b/openbsc/src/libmgcp/mgcp_osmux.c index b46a80e..c52984b 100644 --- a/openbsc/src/libmgcp/mgcp_osmux.c +++ b/openbsc/src/libmgcp/mgcp_osmux.c @@ -340,8 +340,7 @@ if (endp->osmux.state == OSMUX_STATE_ENABLED) goto out; - if (osmux_enable_endpoint(endp, OSMUX_ROLE_BSC_NAT, - &addr->sin_addr, addr->sin_port) < 0 ){ + if (osmux_enable_endpoint(endp, &addr->sin_addr, addr->sin_port) < 0 ) { LOGP(DMGCP, LOGL_ERROR, "Could not enable osmux in endpoint %d\n", ENDPOINT_NUMBER(endp)); @@ -433,8 +432,7 @@ return 0; } -int osmux_enable_endpoint(struct mgcp_endpoint *endp, int role, - struct in_addr *addr, uint16_t port) +int osmux_enable_endpoint(struct mgcp_endpoint *endp, struct in_addr *addr, uint16_t port) { /* If osmux is enabled, initialize the output handler. This handler is * used to reconstruct the RTP flow from osmux. The RTP SSRC is @@ -522,8 +520,7 @@ return 0; if (endp->osmux.state == OSMUX_STATE_ACTIVATING) { - if (osmux_enable_endpoint(endp, OSMUX_ROLE_BSC, - &endp->net_end.addr, + if (osmux_enable_endpoint(endp, &endp->net_end.addr, htons(endp->cfg->osmux_port)) < 0) { LOGP(DMGCP, LOGL_ERROR, "Could not activate osmux in endpoint %d\n", -- To view, visit https://gerrit.osmocom.org/3483 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Icb1e7cb15fe04642578f5292124ebc1eac9c9aa3 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Fri Aug 11 15:33:47 2017 From: gerrit-no-reply at lists.osmocom.org (Pablo Neira Ayuso) Date: Fri, 11 Aug 2017 15:33:47 +0000 Subject: openbsc[master]: mgcp_osmux: Remove unused parameter In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/3483 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Icb1e7cb15fe04642578f5292124ebc1eac9c9aa3 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pablo Neira Ayuso Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Aug 11 15:35:02 2017 From: gerrit-no-reply at lists.osmocom.org (Pablo Neira Ayuso) Date: Fri, 11 Aug 2017 15:35:02 +0000 Subject: osmo-gsm-manuals[master]: osmux: Fix description for Dummy frames FT field In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/3478 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ia421655bd1be45101da3db2a0af44fbb3cc111c1 Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pablo Neira Ayuso Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Aug 11 15:43:08 2017 From: gerrit-no-reply at lists.osmocom.org (Pablo Neira Ayuso) Date: Fri, 11 Aug 2017 15:43:08 +0000 Subject: osmo-msc[master]: 04.08: log protocol discriminators and message types by name In-Reply-To: References: Message-ID: Patch Set 6: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/3350 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ida205d217e304337d816b14fd15e2ee435e7397d Gerrit-PatchSet: 6 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pablo Neira Ayuso Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Aug 11 15:51:52 2017 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Fri, 11 Aug 2017 15:51:52 +0000 Subject: [PATCH] libosmo-sccp[master]: sccp: function to get sccp instance from sccp user Message-ID: Review at https://gerrit.osmocom.org/3484 sccp: function to get sccp instance from sccp user It is currently impossible to find out which SCCP instance handles a particular user. Introduce function to lookup the SCCP instance from a given SCCP user. Change-Id: I9562c4f1d00e2ebb3252c5dea598b643aa393719 --- M include/osmocom/sigtran/sccp_sap.h M src/sccp_user.c 2 files changed, 11 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-sccp refs/changes/84/3484/1 diff --git a/include/osmocom/sigtran/sccp_sap.h b/include/osmocom/sigtran/sccp_sap.h index 796597f..bf1b368 100644 --- a/include/osmocom/sigtran/sccp_sap.h +++ b/include/osmocom/sigtran/sccp_sap.h @@ -247,6 +247,7 @@ osmo_sccp_instance_create(struct osmo_ss7_instance *ss7, void *priv); void osmo_sccp_instance_destroy(struct osmo_sccp_instance *inst); struct osmo_ss7_instance *osmo_sccp_get_ss7(struct osmo_sccp_instance *sccp); +struct osmo_sccp_instance *osmo_sccp_get_sccp(const struct osmo_sccp_user *scu); void osmo_sccp_user_unbind(struct osmo_sccp_user *scu); void osmo_sccp_user_set_priv(struct osmo_sccp_user *scu, void *priv); diff --git a/src/sccp_user.c b/src/sccp_user.c index c0e2b5a..a4568cf 100644 --- a/src/sccp_user.c +++ b/src/sccp_user.c @@ -602,3 +602,13 @@ { return sccp->ss7; } + +/*! \brief get the SCCP instance that is related to the given sccp user + * \param[in] scu SCCP user + * \returns SCCP instance; NULL if scu was NULL */ +struct osmo_sccp_instance *osmo_sccp_get_sccp(const struct osmo_sccp_user *scu) +{ + if (!scu) + return NULL; + return scu->inst; +} -- To view, visit https://gerrit.osmocom.org/3484 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I9562c4f1d00e2ebb3252c5dea598b643aa393719 Gerrit-PatchSet: 1 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: dexter From gerrit-no-reply at lists.osmocom.org Fri Aug 11 15:51:52 2017 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Fri, 11 Aug 2017 15:51:52 +0000 Subject: [PATCH] libosmo-sccp[master]: sccp: fixup for osmo_sccp_get_ss7() Message-ID: Review at https://gerrit.osmocom.org/3485 sccp: fixup for osmo_sccp_get_ss7() osmo_sccp_get_ss7() has the risk of a nullpointer dereference, when sccp is NULL. Return NULL when the sccp instance is NULL. Add doxygen comment Change-Id: I84d484e4441fd37443fff8c67e17df8fb15d5b2e --- M include/osmocom/sigtran/sccp_sap.h M src/sccp_user.c 2 files changed, 7 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-sccp refs/changes/85/3485/1 diff --git a/include/osmocom/sigtran/sccp_sap.h b/include/osmocom/sigtran/sccp_sap.h index bf1b368..5524bd8 100644 --- a/include/osmocom/sigtran/sccp_sap.h +++ b/include/osmocom/sigtran/sccp_sap.h @@ -246,7 +246,7 @@ struct osmo_sccp_instance * osmo_sccp_instance_create(struct osmo_ss7_instance *ss7, void *priv); void osmo_sccp_instance_destroy(struct osmo_sccp_instance *inst); -struct osmo_ss7_instance *osmo_sccp_get_ss7(struct osmo_sccp_instance *sccp); +struct osmo_ss7_instance *osmo_sccp_get_ss7(const struct osmo_sccp_instance *sccp); struct osmo_sccp_instance *osmo_sccp_get_sccp(const struct osmo_sccp_user *scu); void osmo_sccp_user_unbind(struct osmo_sccp_user *scu); diff --git a/src/sccp_user.c b/src/sccp_user.c index a4568cf..b0a807d 100644 --- a/src/sccp_user.c +++ b/src/sccp_user.c @@ -598,8 +598,13 @@ return NULL; } -struct osmo_ss7_instance *osmo_sccp_get_ss7(struct osmo_sccp_instance *sccp) +/*! \brief get the SS7 instance that is related to the given SCCP instance + * \param[in] sccp SCCP instance + * \returns SS7 instance; NULL if sccp was NULL */ +struct osmo_ss7_instance *osmo_sccp_get_ss7(const struct osmo_sccp_instance *sccp) { + if (!sccp) + return NULL; return sccp->ss7; } -- To view, visit https://gerrit.osmocom.org/3485 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I84d484e4441fd37443fff8c67e17df8fb15d5b2e Gerrit-PatchSet: 1 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: dexter From gerrit-no-reply at lists.osmocom.org Fri Aug 11 16:30:09 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 11 Aug 2017 16:30:09 +0000 Subject: [PATCH] osmo-msc[master]: Implement IuCS (large refactoring and addition) In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3347 to look at the new patch set (#6). Implement IuCS (large refactoring and addition) osmo-nitb becomes osmo-msc add DIUCS debug log constant add iucs.[hc] add msc vty, remove nitb vty add libiudummy, to avoid linking Iu deps in tests Use new msc_tx_dtap() instead of gsm0808_submit_dtap() libmgcp: add mgcpgw client API bridge calls via mgcpgw Enable MSC specific CTRL commands, bsc_base_ctrl_cmds_install() still needs to be split up. Change-Id: I5b5b6a9678b458affa86800afb1ec726e66eed88 --- M .gitignore M configure.ac M doc/examples/osmo-bsc_mgcp/mgcp.cfg A doc/examples/osmo-msc/osmo-msc.cfg D doc/examples/osmo-nitb/bs11/openbsc-1bts-2trx-hopping.cfg D doc/examples/osmo-nitb/bs11/openbsc-1bts-2trx.cfg D doc/examples/osmo-nitb/bs11/openbsc-2bts-2trx.cfg D doc/examples/osmo-nitb/bs11/openbsc.cfg D doc/examples/osmo-nitb/nanobts/openbsc-multitrx.cfg D doc/examples/osmo-nitb/nanobts/openbsc.cfg D doc/examples/osmo-nitb/nokia/openbsc_nokia_3trx.cfg D doc/examples/osmo-nitb/rbs2308/openbsc.cfg D doc/examples/osmo-nitb/sysmobts/openbsc.cfg M include/openbsc/Makefile.am A include/openbsc/common.h M include/openbsc/debug.h M include/openbsc/gprs_gmm.h M include/openbsc/gsm_data.h M include/openbsc/gsm_subscriber.h M include/openbsc/iu.h A include/openbsc/iucs.h A include/openbsc/iucs_ranap.h M include/openbsc/mgcp.h M include/openbsc/mgcp_internal.h A include/openbsc/mgcpgw_client.h M include/openbsc/msc_ifaces.h M include/openbsc/osmo_msc.h M include/openbsc/sgsn.h M include/openbsc/transaction.h M include/openbsc/vlr.h M include/openbsc/vty.h M osmoappdesc.py M src/Makefile.am M src/gprs/gprs_gmm.c M src/gprs/gprs_sgsn.c M src/gprs/sgsn_libgtp.c M src/gprs/sgsn_main.c M src/gprs/sgsn_vty.c M src/libbsc/bsc_init.c M src/libbsc/paging.c M src/libcommon/debug.c M src/libcommon/gsm_data.c M src/libiu/iu.c M src/libiu/iu_vty.c M src/libmgcp/Makefile.am A src/libmgcp/mgcp_common.c M src/libmgcp/mgcp_network.c M src/libmgcp/mgcp_protocol.c A src/libmgcp/mgcpgw_client.c A src/libmgcp/mgcpgw_client_vty.c M src/libmsc/Makefile.am M src/libmsc/a_iface.c M src/libmsc/gsm_04_08.c M src/libmsc/gsm_04_11.c M src/libmsc/gsm_04_80.c M src/libmsc/gsm_subscriber.c A src/libmsc/iu_dummy.c A src/libmsc/iucs.c A src/libmsc/iucs_ranap.c M src/libmsc/msc_ifaces.c A src/libmsc/msc_vty.c M src/libmsc/osmo_msc.c M src/libmsc/silent_call.c M src/libmsc/subscr_conn.c M src/libmsc/transaction.c M src/libmsc/vty_interface_layer3.c M src/libvlr/vlr.c M src/libvlr/vlr_access_req_fsm.c M src/libvlr/vlr_lu_fsm.c M src/osmo-bsc/osmo_bsc_api.c R src/osmo-msc/Makefile.am A src/osmo-msc/msc_main.c D src/osmo-nitb/bsc_hack.c M tests/ctrl_test_runner.py M tests/db/Makefile.am M tests/db/db_test.c M tests/mgcp/Makefile.am A tests/mgcp/mgcpgw_client_test.c A tests/mgcp/mgcpgw_client_test.err A tests/mgcp/mgcpgw_client_test.ok M tests/msc_vlr/Makefile.am M tests/msc_vlr/msc_vlr_test_gsm_authen.err M tests/msc_vlr/msc_vlr_test_gsm_ciph.err M tests/msc_vlr/msc_vlr_test_hlr_reject.err M tests/msc_vlr/msc_vlr_test_hlr_timeout.err M tests/msc_vlr/msc_vlr_test_ms_timeout.err M tests/msc_vlr/msc_vlr_test_no_authen.c M tests/msc_vlr/msc_vlr_test_no_authen.err M tests/msc_vlr/msc_vlr_test_reject_concurrency.err M tests/msc_vlr/msc_vlr_test_rest.err M tests/msc_vlr/msc_vlr_test_umts_authen.c M tests/msc_vlr/msc_vlr_test_umts_authen.err M tests/msc_vlr/msc_vlr_tests.c M tests/msc_vlr/msc_vlr_tests.h M tests/smpp_test_runner.py M tests/sms_queue/Makefile.am M tests/testsuite.at M tests/vty_test_runner.py 98 files changed, 5,030 insertions(+), 3,347 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/47/3347/6 -- To view, visit https://gerrit.osmocom.org/3347 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I5b5b6a9678b458affa86800afb1ec726e66eed88 Gerrit-PatchSet: 6 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Fri Aug 11 16:30:11 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 11 Aug 2017 16:30:11 +0000 Subject: [PATCH] osmo-msc[master]: Implement AoIP, port to M3UA SIGTRAN (large addition and ref... Message-ID: Review at https://gerrit.osmocom.org/3486 Implement AoIP, port to M3UA SIGTRAN (large addition and refactoring) This was originally a long series of commits converging to the final result seen in this patch. It does not make much sense to review the smaller steps' trial and error, we need to review this entire change as a whole. Implement AoIP in osmo-msc and osmo-bsc. Change over to the new libosmo-sigtran API with support for proper SCCP/M3UA/SCTP stacking, as mandated by 3GPP specifications for the IuCS and IuPS interfaces. >From here on, a separate osmo-stp process is required for SCCP routing between OsmoBSC / OsmoHNBGW <-> OsmoMSC / OsmoSGSN Patch-by: pmaier, nhofmeyr, laforge Change-Id: I5ae4e05ee7c57cad341ea5e86af37c1f6b0ffa77 --- M configure.ac M include/openbsc/Makefile.am A include/openbsc/a_iface.h A include/openbsc/a_iface_bssap.h A include/openbsc/a_reset.h M include/openbsc/bsc_msc.h M include/openbsc/bsc_msc_data.h M include/openbsc/debug.h M include/openbsc/gsm_04_08.h M include/openbsc/gsm_data.h M include/openbsc/gsm_data_shared.h M include/openbsc/iu.h M include/openbsc/mgcpgw_client.h M include/openbsc/msc_ifaces.h M include/openbsc/osmo_bsc.h A include/openbsc/osmo_bsc_reset.h A include/openbsc/osmo_bsc_sigtran.h M include/openbsc/osmo_msc.h M include/openbsc/transaction.h M src/gprs/Makefile.am M src/gprs/sgsn_main.c M src/libbsc/abis_rsl.c M src/libcommon-cs/Makefile.am A src/libcommon-cs/a_reset.c M src/libcommon-cs/common_cs.c M src/libcommon/common_vty.c M src/libcommon/debug.c M src/libiu/iu.c M src/libiu/iu_vty.c M src/libmgcp/mgcp_protocol.c M src/libmgcp/mgcpgw_client.c M src/libmgcp/mgcpgw_client_vty.c M src/libmsc/Makefile.am M src/libmsc/a_iface.c A src/libmsc/a_iface_bssap.c M src/libmsc/gsm_04_08.c M src/libmsc/gsm_subscriber.c M src/libmsc/iucs.c M src/libmsc/msc_ifaces.c M src/libmsc/msc_vty.c M src/libmsc/osmo_msc.c M src/libmsc/subscr_conn.c M src/osmo-bsc/Makefile.am M src/osmo-bsc/osmo_bsc_api.c M src/osmo-bsc/osmo_bsc_audio.c M src/osmo-bsc/osmo_bsc_bssap.c M src/osmo-bsc/osmo_bsc_main.c M src/osmo-bsc/osmo_bsc_msc.c A src/osmo-bsc/osmo_bsc_reset.c D src/osmo-bsc/osmo_bsc_sccp.c A src/osmo-bsc/osmo_bsc_sigtran.c M src/osmo-bsc/osmo_bsc_vty.c M src/osmo-bsc_mgcp/Makefile.am M src/osmo-bsc_nat/Makefile.am M src/osmo-msc/msc_main.c M tests/msc_vlr/Makefile.am M tests/msc_vlr/msc_vlr_test_gsm_authen.c M tests/msc_vlr/msc_vlr_test_gsm_authen.err M tests/msc_vlr/msc_vlr_test_gsm_ciph.c M tests/msc_vlr/msc_vlr_test_gsm_ciph.err M tests/msc_vlr/msc_vlr_test_hlr_reject.c M tests/msc_vlr/msc_vlr_test_hlr_reject.err M tests/msc_vlr/msc_vlr_test_hlr_timeout.c M tests/msc_vlr/msc_vlr_test_hlr_timeout.err M tests/msc_vlr/msc_vlr_test_ms_timeout.c M tests/msc_vlr/msc_vlr_test_ms_timeout.err M tests/msc_vlr/msc_vlr_test_no_authen.c M tests/msc_vlr/msc_vlr_test_no_authen.err M tests/msc_vlr/msc_vlr_test_reject_concurrency.c M tests/msc_vlr/msc_vlr_test_reject_concurrency.err M tests/msc_vlr/msc_vlr_test_rest.c M tests/msc_vlr/msc_vlr_test_rest.err M tests/msc_vlr/msc_vlr_test_umts_authen.c M tests/msc_vlr/msc_vlr_test_umts_authen.err M tests/msc_vlr/msc_vlr_tests.c M tests/msc_vlr/msc_vlr_tests.h 76 files changed, 4,255 insertions(+), 706 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/86/3486/1 -- To view, visit https://gerrit.osmocom.org/3486 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I5ae4e05ee7c57cad341ea5e86af37c1f6b0ffa77 Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: dexter From gerrit-no-reply at lists.osmocom.org Fri Aug 11 16:30:11 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 11 Aug 2017 16:30:11 +0000 Subject: [PATCH] osmo-msc[master]: mgcp: add VTY Option to force-realloc endpoints Message-ID: Review at https://gerrit.osmocom.org/3487 mgcp: add VTY Option to force-realloc endpoints Currently the force_realloc feature is turnd on and of in a hardcoded way. This patch makes the option available via VTY. Change-Id: Ic8740512c5ea0766ff6ceb1c28b9c2b3fe46e75f --- M src/libmgcp/mgcp_vty.c M src/osmo-bsc_mgcp/mgcp_main.c M src/osmo-bsc_nat/bsc_mgcp_utils.c M src/osmo-bsc_nat/bsc_nat.c 4 files changed, 18 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/87/3487/1 diff --git a/src/libmgcp/mgcp_vty.c b/src/libmgcp/mgcp_vty.c index 7d4b2da..51889d9 100644 --- a/src/libmgcp/mgcp_vty.c +++ b/src/libmgcp/mgcp_vty.c @@ -591,6 +591,16 @@ return CMD_SUCCESS; } +DEFUN(cfg_mgcp_force_realloc, + cfg_mgcp_force_realloc_cmd, + "force-realloc (0|1)", + "Force endpoint reallocation when the endpoint is still seized\n" + "Don't force reallocation\n" "force reallocation\n") +{ + g_cfg->trunk.force_realloc = atoi(argv[0]); + return CMD_SUCCESS; +} + DEFUN(cfg_mgcp_number_endp, cfg_mgcp_number_endp_cmd, "number endpoints <0-65534>", @@ -803,9 +813,10 @@ trunk->keepalive_interval, VTY_NEWLINE); else vty_out(vty, " no rtp keep-alive%s", VTY_NEWLINE); - vty_out(vty, " loop %d%s", trunk->audio_loop, VTY_NEWLINE); + vty_out(vty, " force-realloc %d%s", + trunk->force_realloc, VTY_NEWLINE); if (trunk->omit_rtcp) vty_out(vty, " rtcp-omit%s", VTY_NEWLINE); else @@ -1379,6 +1390,7 @@ install_element(MGCP_NODE, &cfg_mgcp_sdp_payload_number_cmd_old); install_element(MGCP_NODE, &cfg_mgcp_sdp_payload_name_cmd_old); install_element(MGCP_NODE, &cfg_mgcp_loop_cmd); + install_element(MGCP_NODE, &cfg_mgcp_force_realloc_cmd); install_element(MGCP_NODE, &cfg_mgcp_number_endp_cmd); install_element(MGCP_NODE, &cfg_mgcp_omit_rtcp_cmd); install_element(MGCP_NODE, &cfg_mgcp_no_omit_rtcp_cmd); diff --git a/src/osmo-bsc_mgcp/mgcp_main.c b/src/osmo-bsc_mgcp/mgcp_main.c index 4ea0700..6cf9ab7 100644 --- a/src/osmo-bsc_mgcp/mgcp_main.c +++ b/src/osmo-bsc_mgcp/mgcp_main.c @@ -218,6 +218,8 @@ cfg->get_net_downlink_format_cb = &mgcp_transcoding_net_downlink_format; #endif + cfg->trunk.force_realloc = 1; + vty_info.copyright = openbsc_copyright; vty_init(&vty_info); logging_vty_add_cmds(NULL); diff --git a/src/osmo-bsc_nat/bsc_mgcp_utils.c b/src/osmo-bsc_nat/bsc_mgcp_utils.c index 4884786..7df362f 100644 --- a/src/osmo-bsc_nat/bsc_mgcp_utils.c +++ b/src/osmo-bsc_nat/bsc_mgcp_utils.c @@ -1101,7 +1101,6 @@ /* some more MGCP config handling */ cfg->data = nat; cfg->policy_cb = bsc_mgcp_policy_cb; - cfg->trunk.force_realloc = 1; if (cfg->bts_ip) talloc_free(cfg->bts_ip); diff --git a/src/osmo-bsc_nat/bsc_nat.c b/src/osmo-bsc_nat/bsc_nat.c index daa066d..d15ba87 100644 --- a/src/osmo-bsc_nat/bsc_nat.c +++ b/src/osmo-bsc_nat/bsc_nat.c @@ -1628,6 +1628,9 @@ rate_ctr_init(tall_bsc_ctx); osmo_stats_init(tall_bsc_ctx); + /* Ensure that forced enpoint allocation is turned on by default */ + cfg->trunk.force_realloc = 1; + /* init vty and parse */ if (mgcp_parse_config(config_file, nat->mgcp_cfg, MGCP_BSC_NAT) < 0) { fprintf(stderr, "Failed to parse the config file: '%s'\n", config_file); -- To view, visit https://gerrit.osmocom.org/3487 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ic8740512c5ea0766ff6ceb1c28b9c2b3fe46e75f Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: dexter From gerrit-no-reply at lists.osmocom.org Fri Aug 11 16:30:11 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 11 Aug 2017 16:30:11 +0000 Subject: [PATCH] osmo-msc[master]: MSC, SGSN: use OSMO_GSUP_PORT == 4222 instead of 2222 Message-ID: Review at https://gerrit.osmocom.org/3488 MSC,SGSN: use OSMO_GSUP_PORT == 4222 instead of 2222 In SGSN, actually place the port in the SGSN config by default, so that the gsup port may now be omitted in the VTY config (the IP address suffices). Adjust the osmo-sgsn.cfg example. Depends: I4222e21686c823985be8ff1f16b1182be8ad6175 (libosmocore) Change-Id: I50f2040e2eb0baacb43849e93cfed10cbc2fc156 --- M doc/examples/osmo-sgsn/osmo-sgsn.cfg 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/88/3488/1 diff --git a/doc/examples/osmo-sgsn/osmo-sgsn.cfg b/doc/examples/osmo-sgsn/osmo-sgsn.cfg index 01be513..4189adc 100644 --- a/doc/examples/osmo-sgsn/osmo-sgsn.cfg +++ b/doc/examples/osmo-sgsn/osmo-sgsn.cfg @@ -11,7 +11,7 @@ ggsn 0 gtp-version 1 auth-policy remote gsup remote-ip 127.0.0.1 - gsup remote-port 2222 + gsup remote-port 4222 ! ns timer tns-block 3 -- To view, visit https://gerrit.osmocom.org/3488 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I50f2040e2eb0baacb43849e93cfed10cbc2fc156 Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Fri Aug 11 16:30:12 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 11 Aug 2017 16:30:12 +0000 Subject: [PATCH] osmo-msc[master]: move libiu to osmo-iuh/libosmo-ranap Message-ID: Review at https://gerrit.osmocom.org/3489 move libiu to osmo-iuh/libosmo-ranap Remove libiu here, use the functions from libosmo-ranap instead, by applying the ranap_ / RANAP_ prefix. Corresponding change-id in osmo-iuh.git is I6a3f7ad15be03fb94689b4af6ccfa828c25f45c0 To be able to run the msc_vlr tests for RAN_UTRAN_IU without Iu client headers available, add iu_dummy.h, containing mere function signatures that match iu_dummy.c. Change-Id: Ib8c4fcdb4766c5e575618b95ce16dce51063206b --- M configure.ac M include/openbsc/Makefile.am M include/openbsc/gprs_sgsn.h M include/openbsc/gsm_data.h D include/openbsc/iu.h A include/openbsc/iu_dummy.h M include/openbsc/iucs.h M include/openbsc/iucs_ranap.h M include/openbsc/sgsn.h M src/Makefile.am M src/gprs/Makefile.am M src/gprs/gprs_gmm.c M src/gprs/gprs_sgsn.c M src/gprs/sgsn_libgtp.c M src/gprs/sgsn_main.c M src/gprs/sgsn_vty.c D src/libiu/Makefile.am D src/libiu/iu.c D src/libiu/iu_vty.c M src/libmsc/Makefile.am M src/libmsc/a_iface_bssap.c M src/libmsc/gsm_04_08.c M src/libmsc/gsm_subscriber.c M src/libmsc/iu_dummy.c M src/libmsc/iucs.c M src/libmsc/iucs_ranap.c M src/libmsc/msc_ifaces.c M src/libmsc/msc_vty.c M src/libmsc/osmo_msc.c M src/libmsc/subscr_conn.c M src/osmo-msc/Makefile.am M src/osmo-msc/msc_main.c M tests/msc_vlr/Makefile.am M tests/msc_vlr/msc_vlr_tests.c M tests/sgsn/Makefile.am M tests/sms_queue/Makefile.am 36 files changed, 194 insertions(+), 1,148 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/89/3489/1 diff --git a/configure.ac b/configure.ac index 803f739..dc2a4ad 100644 --- a/configure.ac +++ b/configure.ac @@ -229,7 +229,6 @@ src/libmgcp/Makefile src/libcommon/Makefile src/libfilter/Makefile - src/libiu/Makefile src/libcommon-cs/Makefile src/osmo-msc/Makefile src/osmo-bsc/Makefile diff --git a/include/openbsc/Makefile.am b/include/openbsc/Makefile.am index e5377a0..9dfb506 100644 --- a/include/openbsc/Makefile.am +++ b/include/openbsc/Makefile.am @@ -48,9 +48,9 @@ handover.h \ handover_decision.h \ ipaccess.h \ - iu.h \ iucs.h \ iucs_ranap.h \ + iu_dummy.h \ meas_feed.h \ meas_rep.h \ mgcp.h \ diff --git a/include/openbsc/gprs_sgsn.h b/include/openbsc/gprs_sgsn.h index fd86174..52fba66 100644 --- a/include/openbsc/gprs_sgsn.h +++ b/include/openbsc/gprs_sgsn.h @@ -117,7 +117,7 @@ uint16_t pdp_status; }; -struct ue_conn_ctx; +struct ranap_ue_conn_ctx; /* According to TS 03.60, Table 5: SGSN MM and PDP Contexts */ /* Extended by 3GPP TS 23.060, Table 6: SGSN MM and PDP Contexts */ @@ -159,7 +159,7 @@ /* CSG Subscription Data */ /* LIPA Allowed */ /* Voice Support Match Indicator */ - struct ue_conn_ctx *ue_ctx; + struct ranap_ue_conn_ctx *ue_ctx; struct service_info service; } iu; /* VLR number */ diff --git a/include/openbsc/gsm_data.h b/include/openbsc/gsm_data.h index 849381a..2467bf0 100644 --- a/include/openbsc/gsm_data.h +++ b/include/openbsc/gsm_data.h @@ -30,7 +30,7 @@ struct bsc_subscr; struct vlr_instance; struct vlr_subscr; -struct ue_conn_ctx; +struct ranap_ue_conn_ctx; #define OBSC_LINKID_CB(__msgb) (__msgb)->cb[3] @@ -203,7 +203,7 @@ /* which Iu-CS connection, if any. */ struct { - struct ue_conn_ctx *ue_ctx; + struct ranap_ue_conn_ctx *ue_ctx; uint8_t rab_id; } iu; @@ -485,7 +485,7 @@ struct { /* CS7 instance id number (set via VTY) */ uint32_t cs7_instance; - enum nsap_addr_enc rab_assign_addr_enc; + int rab_assign_addr_enc; struct osmo_sccp_instance *sccp; } iu; diff --git a/include/openbsc/iu.h b/include/openbsc/iu.h deleted file mode 100644 index 08e4cd0..0000000 --- a/include/openbsc/iu.h +++ /dev/null @@ -1,77 +0,0 @@ -#pragma once - -#include -#include - -#include -#include -#include - -#include - -struct sgsn_pdp_ctx; -struct msgb; -struct gsm_auth_tuple; -struct osmo_sccp_addr; -struct osmo_ss7_instance; - -struct RANAP_RAB_SetupOrModifiedItemIEs_s; -struct RANAP_GlobalRNC_ID; -struct RANAP_Cause; - -/* Debugging switches from asn1c and osmo-iuh */ -extern int asn_debug; -extern int asn1_xer_print; - -struct ue_conn_ctx { - struct llist_head list; - /* TODO: It's not needed to store the full SCCP address for each - * UE. Rather than that, a pointer to the RNC should be far - * sufficient */ - struct osmo_sccp_addr sccp_addr; - uint32_t conn_id; - int integrity_active; - struct gprs_ra_id ra_id; - enum nsap_addr_enc rab_assign_addr_enc; -}; - -enum iu_event_type { - IU_EVENT_RAB_ASSIGN, - IU_EVENT_SECURITY_MODE_COMPLETE, - IU_EVENT_IU_RELEASE, /* An actual Iu Release message was received */ - IU_EVENT_LINK_INVALIDATED, /* A SUA link was lost or closed down */ -}; - -extern const struct value_string iu_event_type_names[]; -static inline const char *iu_event_type_str(enum iu_event_type e) -{ - return get_value_string(iu_event_type_names, e); -} - -/* Implementations of iu_recv_cb_t shall find the ue_conn_ctx in msg->dst. */ -typedef int (* iu_recv_cb_t )(struct msgb *msg, struct gprs_ra_id *ra_id, - uint16_t *sai); - -typedef int (* iu_event_cb_t )(struct ue_conn_ctx *ue_ctx, - enum iu_event_type type, void *data); - -typedef int (* iu_rab_ass_resp_cb_t )(struct ue_conn_ctx *ue_ctx, uint8_t rab_id, - struct RANAP_RAB_SetupOrModifiedItemIEs_s *setup_ies); - -int iu_init(void *ctx, struct osmo_sccp_instance *sccp, - iu_recv_cb_t iu_recv_cb, iu_event_cb_t iu_event_cb); - -int iu_tx(struct msgb *msg, uint8_t sapi); - -int iu_page_cs(const char *imsi, const uint32_t *tmsi, uint16_t lac); -int iu_page_ps(const char *imsi, const uint32_t *ptmsi, uint16_t lac, uint8_t rac); - -int iu_rab_act(struct ue_conn_ctx *ue_ctx, struct msgb *msg); -int iu_rab_deact(struct ue_conn_ctx *ue_ctx, uint8_t rab_id); -int iu_tx_sec_mode_cmd(struct ue_conn_ctx *uectx, struct gsm_auth_tuple *tp, - int send_ck, int new_key); -int iu_tx_common_id(struct ue_conn_ctx *ue_ctx, const char *imsi); -int iu_tx_release(struct ue_conn_ctx *ctx, const struct RANAP_Cause *cause); - -void iu_vty_init(int iu_parent_node, enum nsap_addr_enc *rab_assign_addr_enc); -int iu_vty_config_write(struct vty *vty, const char *indent); diff --git a/include/openbsc/iu_dummy.h b/include/openbsc/iu_dummy.h new file mode 100644 index 0000000..ccb2099 --- /dev/null +++ b/include/openbsc/iu_dummy.h @@ -0,0 +1,45 @@ +/* Trivial switch-off of external Iu dependencies, + * allowing to run full unit tests even when built without Iu support. */ + +/* + * (C) 2016,2017 by sysmocom s.f.m.c. GmbH + * + * Author: Neels Hofmeyr + * + * All Rights Reserved + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + * + */ + +#include +#include + +struct msgb; +struct ranap_ue_conn_ctx; +struct gsm_auth_tuple; +struct RANAP_Cause; +struct osmo_auth_vector; + +int ranap_iu_tx(struct msgb *msg, uint8_t sapi); +int ranap_iu_tx_sec_mode_cmd(struct ranap_ue_conn_ctx *uectx, struct osmo_auth_vector *vec, + int send_ck); +int ranap_iu_page_cs(const char *imsi, const uint32_t *tmsi, uint16_t lac); +int ranap_iu_page_ps(const char *imsi, const uint32_t *ptmsi, uint16_t lac, uint8_t rac); +struct msgb *ranap_new_msg_rab_assign_voice(uint8_t rab_id, uint32_t rtp_ip, + uint16_t rtp_port, + bool use_x213_nsap); +int ranap_iu_rab_act(struct ranap_ue_conn_ctx *ue_ctx, struct msgb *msg); +int ranap_iu_tx_common_id(struct ranap_ue_conn_ctx *uectx, const char *imsi); +int ranap_iu_tx_release(struct ranap_ue_conn_ctx *ctx, const struct RANAP_Cause *cause); diff --git a/include/openbsc/iucs.h b/include/openbsc/iucs.h index fb61a5c..b7d6064 100644 --- a/include/openbsc/iucs.h +++ b/include/openbsc/iucs.h @@ -4,4 +4,4 @@ uint16_t *lac); struct gsm_subscriber_connection *subscr_conn_lookup_iu(struct gsm_network *network, - struct ue_conn_ctx *ue); + struct ranap_ue_conn_ctx *ue); diff --git a/include/openbsc/iucs_ranap.h b/include/openbsc/iucs_ranap.h index 748de23..c2ff5f9 100644 --- a/include/openbsc/iucs_ranap.h +++ b/include/openbsc/iucs_ranap.h @@ -1,7 +1,7 @@ #pragma once struct gsm_network; -struct ue_conn_ctx; +struct ranap_ue_conn_ctx; int iucs_rx_ranap_event(struct gsm_network *network, - struct ue_conn_ctx *ue_ctx, int type, void *data); + struct ranap_ue_conn_ctx *ue_ctx, int type, void *data); diff --git a/include/openbsc/sgsn.h b/include/openbsc/sgsn.h index 57b2978..f371dc6 100644 --- a/include/openbsc/sgsn.h +++ b/include/openbsc/sgsn.h @@ -112,7 +112,7 @@ } dcomp_v42bis; struct { - enum nsap_addr_enc rab_assign_addr_enc; + int rab_assign_addr_enc; } iu; }; diff --git a/src/Makefile.am b/src/Makefile.am index 7e9e1dc..bd69738 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -31,13 +31,6 @@ libcommon-cs \ $(NULL) -# Conditional Libraries -if BUILD_IU -SUBDIRS += \ - libiu \ - $(NULL) -endif - # Programs SUBDIRS += \ osmo-msc \ diff --git a/src/gprs/Makefile.am b/src/gprs/Makefile.am index e05eb79..39a4c12 100644 --- a/src/gprs/Makefile.am +++ b/src/gprs/Makefile.am @@ -106,7 +106,6 @@ $(NULL) if BUILD_IU osmo_sgsn_LDADD += \ - $(top_builddir)/src/libiu/libiu.a \ $(LIBOSMOSIGTRAN_LIBS) \ $(LIBOSMORANAP_LIBS) \ $(LIBASN1C_LIBS) \ diff --git a/src/gprs/gprs_gmm.c b/src/gprs/gprs_gmm.c index 15e2fed..032137f 100644 --- a/src/gprs/gprs_gmm.c +++ b/src/gprs/gprs_gmm.c @@ -52,6 +52,7 @@ #ifdef BUILD_IU #include #include +#include #endif #include @@ -67,7 +68,6 @@ #include #include #include -#include #include #include @@ -174,7 +174,7 @@ #ifdef BUILD_IU int sgsn_ranap_rab_ass_resp(struct sgsn_mm_ctx *ctx, RANAP_RAB_SetupOrModifiedItemIEs_t *setup_ies); -int sgsn_ranap_iu_event(struct ue_conn_ctx *ctx, enum iu_event_type type, void *data) +int sgsn_ranap_iu_event(struct ranap_ue_conn_ctx *ctx, enum ranap_iu_event_type type, void *data) { struct sgsn_mm_ctx *mm; int rc = -1; @@ -188,14 +188,14 @@ } switch (type) { - case IU_EVENT_RAB_ASSIGN: + case RANAP_IU_EVENT_RAB_ASSIGN: REQUIRE_MM rc = sgsn_ranap_rab_ass_resp(mm, (RANAP_RAB_SetupOrModifiedItemIEs_t *)data); break; - case IU_EVENT_IU_RELEASE: + case RANAP_IU_EVENT_IU_RELEASE: /* fall thru */ - case IU_EVENT_LINK_INVALIDATED: - /* Clean up ue_conn_ctx here */ + case RANAP_IU_EVENT_LINK_INVALIDATED: + /* Clean up ranap_ue_conn_ctx here */ if (mm) LOGMMCTXP(LOGL_INFO, mm, "IU release for imsi %s\n", mm->imsi); else @@ -205,7 +205,7 @@ mmctx_set_pmm_state(mm, PMM_IDLE); rc = 0; break; - case IU_EVENT_SECURITY_MODE_COMPLETE: + case RANAP_IU_EVENT_SECURITY_MODE_COMPLETE: REQUIRE_MM /* Continue authentication here */ mm->iu.ue_ctx->integrity_active = 1; @@ -262,16 +262,16 @@ rate_ctr_inc(&mm->ctrg->ctr[GMM_CTR_PKTS_SIG_OUT]); #ifdef BUILD_IU if (mm->ran_type == MM_CTX_T_UTRAN_Iu) - return iu_tx(msg, GPRS_SAPI_GMM); + return ranap_iu_tx(msg, GPRS_SAPI_GMM); #endif } #ifdef BUILD_IU - /* In Iu mode, msg->dst contains the ue_conn_ctx pointer, in Gb mode + /* In Iu mode, msg->dst contains the ranap_ue_conn_ctx pointer, in Gb mode * dst is empty. */ /* FIXME: have a more explicit indicator for Iu messages */ if (msg->dst) - return iu_tx(msg, GPRS_SAPI_GMM); + return ranap_iu_tx(msg, GPRS_SAPI_GMM); #endif /* caller needs to provide TLLI, BVCI and NSEI */ @@ -296,9 +296,12 @@ /* In case a Iu connection is reconnected we need to update the ue ctx */ mm->iu.ue_ctx = msg->dst; if (mm->ran_type == MM_CTX_T_UTRAN_Iu - && mm->iu.ue_ctx) + && mm->iu.ue_ctx) { +#ifdef BUILD_IU mm->iu.ue_ctx->rab_assign_addr_enc = sgsn->cfg.iu.rab_assign_addr_enc; +#endif + } } /* Store BVCI/NSEI in MM context */ @@ -1048,7 +1051,7 @@ /* The MS is authorized */ #ifdef BUILD_IU if (ctx->ran_type == MM_CTX_T_UTRAN_Iu && !ctx->iu.ue_ctx->integrity_active) { - rc = iu_tx_sec_mode_cmd(ctx->iu.ue_ctx, &ctx->auth_triplet, 0, ctx->iu.new_key); + rc = ranap_iu_tx_sec_mode_cmd(ctx->iu.ue_ctx, &ctx->auth_triplet.vec, 0, ctx->iu.new_key); ctx->iu.new_key = 0; return rc; } @@ -1259,14 +1262,20 @@ * with a foreign TLLI (P-TMSI that was allocated to the MS before), * or with random TLLI. */ - /* In Iu mode, msg->dst contains the ue_conn_ctx pointer, in Gb mode + /* In Iu mode, msg->dst contains the ranap_ue_conn_ctx pointer, in Gb mode * dst is empty. */ /* FIXME: have a more explicit indicator for Iu messages */ if (!msg->dst) { /* Gb mode */ cid = bssgp_parse_cell_id(&ra_id, msgb_bcid(msg)); - } else - ra_id = ((struct ue_conn_ctx*)msg->dst)->ra_id; + } else { +#ifdef BUILD_IU + ra_id = ((struct ranap_ue_conn_ctx*)msg->dst)->ra_id; +#else + LOGMMCTXP(LOGL_ERROR, ctx, "Cannot handle Iu Attach Request, built without Iu support\n"); + return -ENOTSUP; +#endif + } /* MS network capability 10.5.5.12 */ msnc_len = *cur++; @@ -1627,7 +1636,7 @@ * is an optimization to avoid the RA reject (impl detached) * below, which will cause a new attach cycle. */ /* Look-up the MM context based on old RA-ID and TLLI */ - /* In Iu mode, msg->dst contains the ue_conn_ctx pointer, in Gb + /* In Iu mode, msg->dst contains the ranap_ue_conn_ctx pointer, in Gb * mode dst is empty. */ /* FIXME: have a more explicit indicator for Iu messages */ if (!msg->dst) { @@ -2905,12 +2914,12 @@ { struct msgb *msg; struct sgsn_mm_ctx *mm = pdp->mm; - struct ue_conn_ctx *uectx; + struct ranap_ue_conn_ctx *uectx; uint32_t ggsn_ip; bool use_x213_nsap; uectx = mm->iu.ue_ctx; - use_x213_nsap = (uectx->rab_assign_addr_enc == NSAP_ADDR_ENC_X213); + use_x213_nsap = (uectx->rab_assign_addr_enc == RANAP_NSAP_ADDR_ENC_X213); /* Get the IP address for ggsn user plane */ memcpy(&ggsn_ip, pdp->lib->gsnru.v, pdp->lib->gsnru.l); @@ -2923,6 +2932,6 @@ msg = ranap_new_msg_rab_assign_data(rab_id, ggsn_ip, pdp->lib->teid_gn, use_x213_nsap); msg->l2h = msg->data; - return iu_rab_act(uectx, msg); + return ranap_iu_rab_act(uectx, msg); } #endif diff --git a/src/gprs/gprs_sgsn.c b/src/gprs/gprs_sgsn.c index 18625ae..340fcb0 100644 --- a/src/gprs/gprs_sgsn.c +++ b/src/gprs/gprs_sgsn.c @@ -30,6 +30,7 @@ #include #include #include +#include #include #include @@ -39,7 +40,6 @@ #include #include #include "openbsc/gprs_llc.h" -#include #include diff --git a/src/gprs/sgsn_libgtp.c b/src/gprs/sgsn_libgtp.c index 7595bf8..1da31d2 100644 --- a/src/gprs/sgsn_libgtp.c +++ b/src/gprs/sgsn_libgtp.c @@ -52,7 +52,7 @@ #include #ifdef BUILD_IU -#include +#include #include #endif @@ -533,7 +533,7 @@ } else { #ifdef BUILD_IU /* Deactivate radio bearer */ - iu_rab_deact(pctx->mm->iu.ue_ctx, 1); + ranap_iu_rab_deact(pctx->mm->iu.ue_ctx, 1); #else return -ENOTSUP; #endif @@ -672,7 +672,7 @@ #ifdef BUILD_IU /* Ignore the packet for now and page the UE to get the RAB * reestablished */ - iu_page_ps(mm->imsi, &mm->p_tmsi, mm->ra.lac, mm->ra.rac); + ranap_iu_page_ps(mm->imsi, &mm->p_tmsi, mm->ra.lac, mm->ra.rac); return 0; #else diff --git a/src/gprs/sgsn_main.c b/src/gprs/sgsn_main.c index 95b81bf..ca21151 100644 --- a/src/gprs/sgsn_main.c +++ b/src/gprs/sgsn_main.c @@ -52,13 +52,14 @@ #include +#include + #include #include #include #include #include #include -#include #include #include @@ -321,7 +322,7 @@ .num_cat = ARRAY_SIZE(gprs_categories), }; -int sgsn_ranap_iu_event(struct ue_conn_ctx *ctx, enum iu_event_type type, void *data); +int sgsn_ranap_iu_event(struct ue_conn_ctx *ctx, enum ranap_iu_event_type type, void *data); int main(int argc, char **argv) { @@ -449,7 +450,7 @@ return 8; } - iu_init(tall_bsc_ctx, sccp, gsm0408_gprs_rcvmsg_iu, sgsn_ranap_iu_event); + ranap_iu_init(tall_bsc_ctx, DRANAP, "OsmoSGSN-IuPS", sccp, gsm0408_gprs_rcvmsg_iu, sgsn_ranap_iu_event); #endif if (daemonize) { diff --git a/src/gprs/sgsn_vty.c b/src/gprs/sgsn_vty.c index 888f53a..8469b01 100644 --- a/src/gprs/sgsn_vty.c +++ b/src/gprs/sgsn_vty.c @@ -47,7 +47,7 @@ #include "../../bscconfig.h" #ifdef BUILD_IU -#include +#include #endif static struct sgsn_config *g_cfg = NULL; @@ -304,7 +304,7 @@ vty_out(vty, " no compression v42bis%s", VTY_NEWLINE); #ifdef BUILD_IU - iu_vty_config_write(vty, " "); + ranap_iu_vty_config_write(vty, " "); #endif return CMD_SUCCESS; @@ -1296,7 +1296,7 @@ install_element(SGSN_NODE, &cfg_comp_v42bisp_cmd); #ifdef BUILD_IU - iu_vty_init(SGSN_NODE, &g_cfg->iu.rab_assign_addr_enc); + ranap_iu_vty_init(SGSN_NODE, &g_cfg->iu.rab_assign_addr_enc); #endif return 0; } diff --git a/src/libiu/Makefile.am b/src/libiu/Makefile.am deleted file mode 100644 index e5f9e27..0000000 --- a/src/libiu/Makefile.am +++ /dev/null @@ -1,28 +0,0 @@ -AM_CPPFLAGS = \ - $(all_includes) \ - -I$(top_srcdir)/include \ - -I$(top_builddir) \ - $(NULL) - -AM_CFLAGS = \ - -Wall \ - $(COVERAGE_CFLAGS) \ - $(LIBCRYPTO_CFLAGS) \ - $(LIBASN1C_CFLAGS) \ - $(LIBOSMOCORE_CFLAGS) \ - $(LIBOSMOVTY_CFLAGS) \ - $(LIBOSMOGSM_CFLAGS) \ - $(LIBOSMOABIS_CFLAGS) \ - $(LIBOSMOSIGTRAN_CFLAGS) \ - $(LIBOSMORANAP_CFLAGS) \ - $(NULL) - -noinst_LIBRARIES = \ - libiu.a \ - $(NULL) - -libiu_a_SOURCES = \ - iu.c \ - iu_vty.c \ - $(NULL) - diff --git a/src/libiu/iu.c b/src/libiu/iu.c deleted file mode 100644 index 7794977..0000000 --- a/src/libiu/iu.c +++ /dev/null @@ -1,771 +0,0 @@ -/* Common parts of IuCS and IuPS interfaces implementation */ - -/* (C) 2016 by sysmocom s.f.m.c. GmbH - * All Rights Reserved - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - * - */ - -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include - -#include -#include - -#include -#include -#include -#include - -#include -#include -#include - -#include - -#include -#include -#include -#include - -#include - -/* Parsed global RNC id. See also struct RANAP_GlobalRNC_ID, and note that the - * PLMN identity is a BCD representation of the MCC and MNC. - * See iu_grnc_id_parse(). */ -struct iu_grnc_id { - uint16_t mcc; - uint16_t mnc; - uint16_t rnc_id; -}; - -/* A remote RNC (Radio Network Controller, like BSC but for UMTS) that has - * called us and is currently reachable at the given osmo_sccp_addr. So, when we - * know a LAC for a subscriber, we can page it at the RNC matching that LAC or - * RAC. An HNB-GW typically presents itself as if it were a single RNC, even - * though it may have several RNCs in hNodeBs connected to it. Those will then - * share the same RNC id, which they actually receive and adopt from the HNB-GW - * in the HNBAP HNB REGISTER ACCEPT message. */ -struct iu_rnc { - struct llist_head entry; - - uint16_t rnc_id; - uint16_t lac; /* Location Area Code (used for CS and PS) */ - uint8_t rac; /* Routing Area Code (used for PS only) */ - struct osmo_sccp_addr sccp_addr; -}; - -void *talloc_iu_ctx; - -/* Implement the extern asn_debug from libasn1c to indicate whether to print - * asn.1 debug messages (see libasn1c). */ -int asn_debug = 0; - -/* Implement the extern asn1_xer_print to indicate whether the ASN.1 binary - * code decoded and encoded during Iu communication should be logged to stderr - * (see asn.1 generated code in osmo-iuh). */ -int asn1_xer_print = 0; - -void *talloc_asn1_ctx; - -iu_recv_cb_t global_iu_recv_cb = NULL; -iu_event_cb_t global_iu_event_cb = NULL; - -static LLIST_HEAD(ue_conn_ctx_list); -static LLIST_HEAD(rnc_list); - -static struct osmo_sccp_instance *g_sccp; -static struct osmo_sccp_user *g_scu; - -const struct value_string iu_event_type_names[] = { - OSMO_VALUE_STRING(IU_EVENT_RAB_ASSIGN), - OSMO_VALUE_STRING(IU_EVENT_SECURITY_MODE_COMPLETE), - OSMO_VALUE_STRING(IU_EVENT_IU_RELEASE), - OSMO_VALUE_STRING(IU_EVENT_LINK_INVALIDATED), - { 0, NULL } -}; - -struct ue_conn_ctx *ue_conn_ctx_alloc(struct osmo_sccp_addr *addr, uint32_t conn_id) -{ - struct ue_conn_ctx *ctx = talloc_zero(talloc_iu_ctx, struct ue_conn_ctx); - - ctx->sccp_addr = *addr; - ctx->conn_id = conn_id; - llist_add(&ctx->list, &ue_conn_ctx_list); - - return ctx; -} - -struct ue_conn_ctx *ue_conn_ctx_find(uint32_t conn_id) -{ - struct ue_conn_ctx *ctx; - - llist_for_each_entry(ctx, &ue_conn_ctx_list, list) { - if (ctx->conn_id == conn_id) - return ctx; - } - return NULL; -} - -static struct iu_rnc *iu_rnc_alloc(uint16_t rnc_id, uint16_t lac, uint8_t rac, - struct osmo_sccp_addr *addr) -{ - struct iu_rnc *rnc = talloc_zero(talloc_iu_ctx, struct iu_rnc); - - rnc->rnc_id = rnc_id; - rnc->lac = lac; - rnc->rac = rac; - rnc->sccp_addr = *addr; - llist_add(&rnc->entry, &rnc_list); - - LOGP(DRANAP, LOGL_NOTICE, "New RNC %d (LAC=%d RAC=%d)\n", - rnc->rnc_id, rnc->lac, rnc->rac); - - return rnc; -} - -static struct iu_rnc *iu_rnc_register(uint16_t rnc_id, uint16_t lac, - uint8_t rac, struct osmo_sccp_addr *addr) -{ - struct iu_rnc *rnc; - llist_for_each_entry(rnc, &rnc_list, entry) { - if (rnc->rnc_id != rnc_id) - continue; - - /* We have this RNC Id registered already. Make sure that the - * details match. */ - - /* TODO should a mismatch be an error? */ - if (rnc->lac != lac || rnc->rac != rac) - LOGP(DRANAP, LOGL_NOTICE, "RNC %d changes its details:" - " LAC=%d RAC=%d --> LAC=%d RAC=%d\n", - rnc->rnc_id, rnc->lac, rnc->rac, - lac, rac); - rnc->lac = lac; - rnc->rac = rac; - - if (addr && memcmp(&rnc->sccp_addr, addr, sizeof(*addr))) - LOGP(DRANAP, LOGL_NOTICE, "RNC %d on New SCCP Addr %s" - " (LAC=%d RAC=%d)\n", - rnc->rnc_id, osmo_sccp_addr_dump(addr), rnc->lac, rnc->rac); - rnc->sccp_addr = *addr; - return rnc; - } - - /* Not found, make a new one. */ - return iu_rnc_alloc(rnc_id, lac, rac, addr); -} - -/*********************************************************************** - * RANAP handling - ***********************************************************************/ - -int iu_rab_act(struct ue_conn_ctx *ue_ctx, struct msgb *msg) -{ - struct osmo_scu_prim *prim; - - /* wrap RANAP message in SCCP N-DATA.req */ - prim = (struct osmo_scu_prim *) msgb_push(msg, sizeof(*prim)); - prim->u.data.conn_id = ue_ctx->conn_id; - osmo_prim_init(&prim->oph, - SCCP_SAP_USER, - OSMO_SCU_PRIM_N_DATA, - PRIM_OP_REQUEST, - msg); - return osmo_sccp_user_sap_down(g_scu, &prim->oph); -} - -int iu_rab_deact(struct ue_conn_ctx *ue_ctx, uint8_t rab_id) -{ - /* FIXME */ - return -1; -} - -int iu_tx_sec_mode_cmd(struct ue_conn_ctx *uectx, struct gsm_auth_tuple *tp, - int send_ck, int new_key) -{ - struct osmo_scu_prim *prim; - struct msgb *msg; - - /* create RANAP message */ - msg = ranap_new_msg_sec_mod_cmd(tp->vec.ik, send_ck? tp->vec.ck : NULL, - new_key ? RANAP_KeyStatus_new : RANAP_KeyStatus_old); - msg->l2h = msg->data; - /* wrap RANAP message in SCCP N-DATA.req */ - prim = (struct osmo_scu_prim *) msgb_push(msg, sizeof(*prim)); - prim->u.data.conn_id = uectx->conn_id; - osmo_prim_init(&prim->oph, SCCP_SAP_USER, - OSMO_SCU_PRIM_N_DATA, - PRIM_OP_REQUEST, msg); - osmo_sccp_user_sap_down(g_scu, &prim->oph); - - return 0; -} - -int iu_tx_common_id(struct ue_conn_ctx *uectx, const char *imsi) -{ - struct msgb *msg; - struct osmo_scu_prim *prim; - - LOGP(DRANAP, LOGL_INFO, "Transmitting RANAP CommonID (SCCP conn_id %u)\n", - uectx->conn_id); - - msg = ranap_new_msg_common_id(imsi); - msg->l2h = msg->data; - prim = (struct osmo_scu_prim *) msgb_push(msg, sizeof(*prim)); - prim->u.data.conn_id = uectx->conn_id; - osmo_prim_init(&prim->oph, SCCP_SAP_USER, - OSMO_SCU_PRIM_N_DATA, - PRIM_OP_REQUEST, msg); - osmo_sccp_user_sap_down(g_scu, &prim->oph); - return 0; -} - -static int iu_grnc_id_parse(struct iu_grnc_id *dst, - struct RANAP_GlobalRNC_ID *src) -{ - /* The size is coming from arbitrary sender, check it gracefully */ - if (src->pLMNidentity.size != 3) { - LOGP(DRANAP, LOGL_ERROR, "Invalid PLMN Identity size:" - " should be 3, is %d\n", src->pLMNidentity.size); - return -1; - } - gsm48_mcc_mnc_from_bcd(&src->pLMNidentity.buf[0], - &dst->mcc, &dst->mnc); - dst->rnc_id = (uint16_t)src->rNC_ID; - return 0; -} - -#if 0 - -- not used at present -- -static int iu_grnc_id_compose(struct iu_grnc_id *src, - struct RANAP_GlobalRNC_ID *dst) -{ - /* The caller must ensure proper size */ - OSMO_ASSERT(dst->pLMNidentity.size == 3); - gsm48_mcc_mnc_to_bcd(&dst->pLMNidentity.buf[0], - src->mcc, src->mnc); - dst->rNC_ID = src->rnc_id; - return 0; -} -#endif - -static int ranap_handle_co_initial_ue(void *ctx, RANAP_InitialUE_MessageIEs_t *ies) -{ - struct ue_conn_ctx *ue_conn = ctx; - struct gprs_ra_id ra_id; - struct iu_grnc_id grnc_id; - uint16_t sai; - struct msgb *msg = msgb_alloc(256, "RANAP->NAS"); - - if (ranap_parse_lai(&ra_id, &ies->lai) != 0) { - LOGP(DRANAP, LOGL_ERROR, "Failed to parse RANAP LAI IE\n"); - return -1; - } - - if (ies->presenceMask & INITIALUE_MESSAGEIES_RANAP_RAC_PRESENT) { - ra_id.rac = asn1str_to_u8(&ies->rac); - } - - if (iu_grnc_id_parse(&grnc_id, &ies->globalRNC_ID) != 0) { - LOGP(DRANAP, LOGL_ERROR, - "Failed to parse RANAP Global-RNC-ID IE\n"); - return -1; - } - - sai = asn1str_to_u16(&ies->sai.sAC); - msgb_gmmh(msg) = msgb_put(msg, ies->nas_pdu.size); - memcpy(msgb_gmmh(msg), ies->nas_pdu.buf, ies->nas_pdu.size); - - /* Make sure we know the RNC Id and LAC+RAC coming in on this connection. */ - iu_rnc_register(grnc_id.rnc_id, ra_id.lac, ra_id.rac, &ue_conn->sccp_addr); - ue_conn->ra_id = ra_id; - - /* Feed into the MM layer */ - msg->dst = ctx; - global_iu_recv_cb(msg, &ra_id, &sai); - - msgb_free(msg); - - return 0; -} - -static int ranap_handle_co_dt(void *ctx, RANAP_DirectTransferIEs_t *ies) -{ - struct gprs_ra_id _ra_id, *ra_id = NULL; - uint16_t _sai, *sai = NULL; - struct msgb *msg = msgb_alloc(256, "RANAP->NAS"); - - if (ies->presenceMask & DIRECTTRANSFERIES_RANAP_LAI_PRESENT) { - if (ranap_parse_lai(&_ra_id, &ies->lai) != 0) { - LOGP(DRANAP, LOGL_ERROR, "Failed to parse RANAP LAI IE\n"); - return -1; - } - ra_id = &_ra_id; - if (ies->presenceMask & DIRECTTRANSFERIES_RANAP_RAC_PRESENT) { - _ra_id.rac = asn1str_to_u8(&ies->rac); - } - if (ies->presenceMask & DIRECTTRANSFERIES_RANAP_SAI_PRESENT) { - _sai = asn1str_to_u16(&ies->sai.sAC); - sai = &_sai; - } - } - - msgb_gmmh(msg) = msgb_put(msg, ies->nas_pdu.size); - memcpy(msgb_gmmh(msg), ies->nas_pdu.buf, ies->nas_pdu.size); - - /* Feed into the MM/CC/SMS-CP layer */ - msg->dst = ctx; - global_iu_recv_cb(msg, ra_id, sai); - - msgb_free(msg); - - return 0; -} - -static int ranap_handle_co_err_ind(void *ctx, RANAP_ErrorIndicationIEs_t *ies) -{ - if (ies->presenceMask & ERRORINDICATIONIES_RANAP_CAUSE_PRESENT) - LOGP(DRANAP, LOGL_ERROR, "Rx Error Indication (%s)\n", - ranap_cause_str(&ies->cause)); - else - LOGP(DRANAP, LOGL_ERROR, "Rx Error Indication\n"); - - return 0; -} - -int iu_tx(struct msgb *msg_nas, uint8_t sapi) -{ - struct ue_conn_ctx *uectx = msg_nas->dst; - struct msgb *msg; - struct osmo_scu_prim *prim; - - LOGP(DRANAP, LOGL_INFO, "Transmitting L3 Message as RANAP DT (SCCP conn_id %u)\n", - uectx->conn_id); - - msg = ranap_new_msg_dt(sapi, msg_nas->data, msgb_length(msg_nas)); - msgb_free(msg_nas); - msg->l2h = msg->data; - prim = (struct osmo_scu_prim *) msgb_push(msg, sizeof(*prim)); - prim->u.data.conn_id = uectx->conn_id; - osmo_prim_init(&prim->oph, SCCP_SAP_USER, - OSMO_SCU_PRIM_N_DATA, - PRIM_OP_REQUEST, msg); - osmo_sccp_user_sap_down(g_scu, &prim->oph); - return 0; -} - -/* Send Iu Release for the given UE connection. - * If cause is NULL, the standard "No remaining RAB" cause is sent, otherwise - * the provided cause. */ -int iu_tx_release(struct ue_conn_ctx *ctx, const struct RANAP_Cause *cause) -{ - struct msgb *msg; - struct osmo_scu_prim *prim; - static const struct RANAP_Cause default_cause = { - .present = RANAP_Cause_PR_radioNetwork, - .choice.radioNetwork = RANAP_CauseRadioNetwork_no_remaining_rab, - }; - - if (!cause) - cause = &default_cause; - - LOGP(DRANAP, LOGL_INFO, "Transmitting Iu Release (SCCP conn_id %u)\n", - ctx->conn_id); - - msg = ranap_new_msg_iu_rel_cmd(cause); - msg->l2h = msg->data; - prim = (struct osmo_scu_prim *) msgb_push(msg, sizeof(*prim)); - prim->u.data.conn_id = ctx->conn_id; - osmo_prim_init(&prim->oph, SCCP_SAP_USER, - OSMO_SCU_PRIM_N_DATA, - PRIM_OP_REQUEST, msg); - return osmo_sccp_user_sap_down(g_scu, &prim->oph); -} - -static int ranap_handle_co_iu_rel_req(struct ue_conn_ctx *ctx, RANAP_Iu_ReleaseRequestIEs_t *ies) -{ - LOGP(DRANAP, LOGL_INFO, "Received Iu Release Request, Sending Release Command\n"); - iu_tx_release(ctx, &ies->cause); - return 0; -} - -static int ranap_handle_co_rab_ass_resp(struct ue_conn_ctx *ctx, RANAP_RAB_AssignmentResponseIEs_t *ies) -{ - int rc = -1; - - LOGP(DRANAP, LOGL_INFO, - "Rx RAB Assignment Response for UE conn_id %u\n", ctx->conn_id); - if (ies->presenceMask & RAB_ASSIGNMENTRESPONSEIES_RANAP_RAB_SETUPORMODIFIEDLIST_PRESENT) { - /* TODO: Iterate over list of SetupOrModifiedList IEs and handle each one */ - RANAP_IE_t *ranap_ie = ies->raB_SetupOrModifiedList.raB_SetupOrModifiedList_ies.list.array[0]; - RANAP_RAB_SetupOrModifiedItemIEs_t setup_ies; - - rc = ranap_decode_rab_setupormodifieditemies_fromlist(&setup_ies, &ranap_ie->value); - if (rc) { - LOGP(DRANAP, LOGL_ERROR, "Error in ranap_decode_rab_setupormodifieditemies()\n"); - return rc; - } - - rc = global_iu_event_cb(ctx, IU_EVENT_RAB_ASSIGN, &setup_ies); - - ranap_free_rab_setupormodifieditemies(&setup_ies); - } - /* FIXME: handle RAB Ass failure? */ - - return rc; -} - -/* Entry point for connection-oriented RANAP message */ -static void cn_ranap_handle_co(void *ctx, ranap_message *message) -{ - int rc; - - LOGP(DRANAP, LOGL_NOTICE, "handle_co(dir=%u, proc=%u)\n", message->direction, message->procedureCode); - - switch (message->direction) { - case RANAP_RANAP_PDU_PR_initiatingMessage: - switch (message->procedureCode) { - case RANAP_ProcedureCode_id_InitialUE_Message: - rc = ranap_handle_co_initial_ue(ctx, &message->msg.initialUE_MessageIEs); - break; - case RANAP_ProcedureCode_id_DirectTransfer: - rc = ranap_handle_co_dt(ctx, &message->msg.directTransferIEs); - break; - case RANAP_ProcedureCode_id_ErrorIndication: - rc = ranap_handle_co_err_ind(ctx, &message->msg.errorIndicationIEs); - break; - case RANAP_ProcedureCode_id_Iu_ReleaseRequest: - /* Iu Release Request */ - rc = ranap_handle_co_iu_rel_req(ctx, &message->msg.iu_ReleaseRequestIEs); - break; - default: - LOGP(DRANAP, LOGL_ERROR, "Received Initiating Message: unknown Procedure Code %d\n", - message->procedureCode); - rc = -1; - break; - } - break; - case RANAP_RANAP_PDU_PR_successfulOutcome: - switch (message->procedureCode) { - case RANAP_ProcedureCode_id_SecurityModeControl: - /* Security Mode Complete */ - rc = global_iu_event_cb(ctx, IU_EVENT_SECURITY_MODE_COMPLETE, NULL); - break; - case RANAP_ProcedureCode_id_Iu_Release: - /* Iu Release Complete */ - rc = global_iu_event_cb(ctx, IU_EVENT_IU_RELEASE, NULL); - if (rc) { - LOGP(DRANAP, LOGL_ERROR, "Iu Release event: Iu Event callback returned %d\n", - rc); - } - break; - default: - LOGP(DRANAP, LOGL_ERROR, "Received Successful Outcome: unknown Procedure Code %d\n", - message->procedureCode); - rc = -1; - break; - } - break; - case RANAP_RANAP_PDU_PR_outcome: - switch (message->procedureCode) { - case RANAP_ProcedureCode_id_RAB_Assignment: - /* RAB Assignment Response */ - rc = ranap_handle_co_rab_ass_resp(ctx, &message->msg.raB_AssignmentResponseIEs); - break; - default: - LOGP(DRANAP, LOGL_ERROR, "Received Outcome: unknown Procedure Code %d\n", - message->procedureCode); - rc = -1; - break; - } - break; - case RANAP_RANAP_PDU_PR_unsuccessfulOutcome: - default: - LOGP(DRANAP, LOGL_ERROR, "Received Unsuccessful Outcome: Procedure Code %d\n", - message->procedureCode); - rc = -1; - break; - } - - if (rc) { - LOGP(DRANAP, LOGL_ERROR, "Error in cn_ranap_handle_co (%d)\n", - rc); - /* TODO handling of the error? */ - } -} - -static int ranap_handle_cl_reset_req(void *ctx, RANAP_ResetIEs_t *ies) -{ - /* FIXME: send reset response */ - return -1; -} - -static int ranap_handle_cl_err_ind(void *ctx, RANAP_ErrorIndicationIEs_t *ies) -{ - if (ies->presenceMask & ERRORINDICATIONIES_RANAP_CAUSE_PRESENT) - LOGP(DRANAP, LOGL_ERROR, "Rx Error Indication (%s)\n", - ranap_cause_str(&ies->cause)); - else - LOGP(DRANAP, LOGL_ERROR, "Rx Error Indication\n"); - - return 0; -} - -/* Entry point for connection-less RANAP message */ -static void cn_ranap_handle_cl(void *ctx, ranap_message *message) -{ - int rc; - - switch (message->direction) { - case RANAP_RANAP_PDU_PR_initiatingMessage: - switch (message->procedureCode) { - case RANAP_ProcedureCode_id_Reset: - /* received reset.req, send reset.resp */ - rc = ranap_handle_cl_reset_req(ctx, &message->msg.resetIEs); - break; - case RANAP_ProcedureCode_id_ErrorIndication: - rc = ranap_handle_cl_err_ind(ctx, &message->msg.errorIndicationIEs); - break; - default: - rc = -1; - break; - } - break; - case RANAP_RANAP_PDU_PR_successfulOutcome: - case RANAP_RANAP_PDU_PR_unsuccessfulOutcome: - case RANAP_RANAP_PDU_PR_outcome: - default: - rc = -1; - break; - } - - if (rc) { - LOGP(DRANAP, LOGL_ERROR, "Error in cn_ranap_handle_cl (%d)\n", - rc); - /* TODO handling of the error? */ - } -} - -/*********************************************************************** - * Paging - ***********************************************************************/ - -struct osmo_sccp_addr local_sccp_addr = { - .presence = OSMO_SCCP_ADDR_T_SSN | OSMO_SCCP_ADDR_T_PC, - .ri = OSMO_SCCP_RI_SSN_PC, - .ssn = OSMO_SCCP_SSN_RANAP, - .pc = 1, -}; - -/* Send a paging command down a given SCCP User. tmsi and paging_cause are - * optional and may be passed NULL and 0, respectively, to disable their use. - * See enum RANAP_PagingCause. - * - * If TMSI is given, the IMSI is not sent over the air interface. Nevertheless, - * the IMSI is still required for resolution in the HNB-GW and/or(?) RNC. */ -static int iu_tx_paging_cmd(struct osmo_sccp_addr *called_addr, - const char *imsi, const uint32_t *tmsi, - bool is_ps, uint32_t paging_cause) -{ - struct msgb *msg; - msg = ranap_new_msg_paging_cmd(imsi, tmsi, is_ps? 1 : 0, paging_cause); - msg->l2h = msg->data; - osmo_sccp_tx_unitdata_msg(g_scu, &local_sccp_addr, called_addr, msg); - return 0; -} - -static int iu_page(const char *imsi, const uint32_t *tmsi_or_ptimsi, - uint16_t lac, uint8_t rac, bool is_ps) -{ - struct iu_rnc *rnc; - int pagings_sent = 0; - - if (tmsi_or_ptimsi) { - LOGP(DRANAP, LOGL_DEBUG, "%s: Looking for RNCs to page for IMSI %s" - " (paging will use %s %x)\n", - is_ps? "IuPS" : "IuCS", - imsi, - is_ps? "PTMSI" : "TMSI", - *tmsi_or_ptimsi); - } else { - LOGP(DRANAP, LOGL_DEBUG, "%s: Looking for RNCs to page for IMSI %s" - " (paging will use IMSI)\n", - is_ps? "IuPS" : "IuCS", - imsi - ); - } - - llist_for_each_entry(rnc, &rnc_list, entry) { - if (rnc->lac != lac) - continue; - if (is_ps && rnc->rac != rac) - continue; - - /* Found a match! */ - if (iu_tx_paging_cmd(&rnc->sccp_addr, imsi, tmsi_or_ptimsi, is_ps, 0) - == 0) { - LOGP(DRANAP, LOGL_DEBUG, - "%s: Paged for IMSI %s on RNC %d, on SCCP addr %s\n", - is_ps? "IuPS" : "IuCS", - imsi, rnc->rnc_id, osmo_sccp_addr_dump(&rnc->sccp_addr)); - pagings_sent ++; - } - } - - /* Some logging... */ - if (pagings_sent > 0) { - LOGP(DRANAP, LOGL_DEBUG, - "%s: %d RNCs were paged for IMSI %s.\n", - is_ps? "IuPS" : "IuCS", - pagings_sent, imsi); - } - else { - if (is_ps) { - LOGP(DRANAP, LOGL_ERROR, "IuPS: Found no RNC to page for" - " LAC %d RAC %d (would have paged IMSI %s)\n", - lac, rac, imsi); - } - else { - LOGP(DRANAP, LOGL_ERROR, "IuCS: Found no RNC to page for" - " LAC %d (would have paged IMSI %s)\n", - lac, imsi); - } - } - - return pagings_sent; -} - -int iu_page_cs(const char *imsi, const uint32_t *tmsi, uint16_t lac) -{ - return iu_page(imsi, tmsi, lac, 0, false); -} - -int iu_page_ps(const char *imsi, const uint32_t *ptmsi, uint16_t lac, uint8_t rac) -{ - return iu_page(imsi, ptmsi, lac, rac, true); -} - - -/*********************************************************************** - * - ***********************************************************************/ - -int tx_unitdata(struct osmo_sccp_user *scu); -int tx_conn_req(struct osmo_sccp_user *scu, uint32_t conn_id); - -struct osmo_prim_hdr *make_conn_req(uint32_t conn_id); -struct osmo_prim_hdr *make_dt1_req(uint32_t conn_id, const uint8_t *data, unsigned int len); - -struct osmo_prim_hdr *make_conn_resp(struct osmo_scu_connect_param *param) -{ - struct msgb *msg = msgb_alloc(1024, "conn_resp"); - struct osmo_scu_prim *prim; - - prim = (struct osmo_scu_prim *) msgb_put(msg, sizeof(*prim)); - osmo_prim_init(&prim->oph, SCCP_SAP_USER, - OSMO_SCU_PRIM_N_CONNECT, - PRIM_OP_RESPONSE, msg); - memcpy(&prim->u.connect, param, sizeof(prim->u.connect)); - return &prim->oph; -} - -static int sccp_sap_up(struct osmo_prim_hdr *oph, void *_scu) -{ - struct osmo_sccp_user *scu = _scu; - struct osmo_scu_prim *prim = (struct osmo_scu_prim *) oph; - struct osmo_prim_hdr *resp = NULL; - int rc; - struct ue_conn_ctx *ue; - - DEBUGP(DRANAP, "sccp_sap_up(%s)\n", osmo_scu_prim_name(oph)); - - switch (OSMO_PRIM_HDR(oph)) { - case OSMO_PRIM(OSMO_SCU_PRIM_N_CONNECT, PRIM_OP_CONFIRM): - /* confirmation of outbound connection */ - rc = -1; - break; - case OSMO_PRIM(OSMO_SCU_PRIM_N_CONNECT, PRIM_OP_INDICATION): - /* indication of new inbound connection request*/ - DEBUGP(DRANAP, "N-CONNECT.ind(X->%u)\n", prim->u.connect.conn_id); - if (/* prim->u.connect.called_addr.ssn != OSMO_SCCP_SSN_RANAP || */ - !msgb_l2(oph->msg) || msgb_l2len(oph->msg) == 0) { - LOGP(DRANAP, LOGL_NOTICE, - "Received invalid N-CONNECT.ind\n"); - return 0; - } - ue = ue_conn_ctx_alloc(&prim->u.connect.calling_addr, prim->u.connect.conn_id); - /* first ensure the local SCCP socket is ACTIVE */ - resp = make_conn_resp(&prim->u.connect); - osmo_sccp_user_sap_down(scu, resp); - /* then handle the RANAP payload */ - rc = ranap_cn_rx_co(cn_ranap_handle_co, ue, msgb_l2(oph->msg), msgb_l2len(oph->msg)); - break; - case OSMO_PRIM(OSMO_SCU_PRIM_N_DISCONNECT, PRIM_OP_INDICATION): - /* indication of disconnect */ - DEBUGP(DRANAP, "N-DISCONNECT.ind(%u)\n", - prim->u.disconnect.conn_id); - ue = ue_conn_ctx_find(prim->u.disconnect.conn_id); - rc = ranap_cn_rx_co(cn_ranap_handle_co, ue, msgb_l2(oph->msg), msgb_l2len(oph->msg)); - break; - case OSMO_PRIM(OSMO_SCU_PRIM_N_DATA, PRIM_OP_INDICATION): - /* connection-oriented data received */ - DEBUGP(DRANAP, "N-DATA.ind(%u, %s)\n", prim->u.data.conn_id, - osmo_hexdump(msgb_l2(oph->msg), msgb_l2len(oph->msg))); - /* resolve UE context */ - ue = ue_conn_ctx_find(prim->u.data.conn_id); - rc = ranap_cn_rx_co(cn_ranap_handle_co, ue, msgb_l2(oph->msg), msgb_l2len(oph->msg)); - break; - case OSMO_PRIM(OSMO_SCU_PRIM_N_UNITDATA, PRIM_OP_INDICATION): - /* connection-less data received */ - DEBUGP(DRANAP, "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)); - break; - default: - rc = -1; - break; - } - - msgb_free(oph->msg); - return rc; -} - -int iu_init(void *ctx, struct osmo_sccp_instance *sccp, - iu_recv_cb_t iu_recv_cb, iu_event_cb_t iu_event_cb) -{ - talloc_iu_ctx = talloc_named_const(ctx, 1, "iu"); - talloc_asn1_ctx = talloc_named_const(talloc_iu_ctx, 1, "asn1"); - - global_iu_recv_cb = iu_recv_cb; - global_iu_event_cb = iu_event_cb; - g_sccp = sccp; - g_scu = osmo_sccp_user_bind(g_sccp, "OsmoMSC-Iu", sccp_sap_up, OSMO_SCCP_SSN_RANAP); - - return 0; -} - diff --git a/src/libiu/iu_vty.c b/src/libiu/iu_vty.c deleted file mode 100644 index 0b42e34..0000000 --- a/src/libiu/iu_vty.c +++ /dev/null @@ -1,130 +0,0 @@ -/* OpenBSC Iu related interface to quagga VTY */ -/* (C) 2016 by sysmocom s.m.f.c. GmbH - * All Rights Reserved - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - * - */ - -#include -#include - -#include -#include -#include -#include -#include - -#include - -static enum nsap_addr_enc *g_rab_assign_addr_enc = NULL; - -DEFUN(logging_asn_debug, - logging_asn_debug_cmd, - "logging asn1-debug (1|0)", - LOGGING_STR - "Log ASN.1 debug messages to stderr\n" - "Log ASN.1 debug messages to stderr\n" - "Do not log ASN.1 debug messages to stderr\n") -{ - asn_debug = atoi(argv[0]); - return CMD_SUCCESS; -} - -DEFUN(logging_asn_xer_print, - logging_asn_xer_print_cmd, - "logging asn1-xer-print (1|0)", - LOGGING_STR - "Log human readable representations of all ASN.1 messages to stderr\n" - "Log decoded ASN.1 messages to stderr\n" - "Do not log decoded ASN.1 messages to stderr\n") -{ - asn1_xer_print = atoi(argv[0]); - return CMD_SUCCESS; -} - -#define IU_STR "Iu interface protocol options\n" -DEFUN(cfg_iu_rab_assign_addr_enc, cfg_iu_rab_assign_addr_enc_cmd, - "iu rab-assign-addr-enc (x213|v4raw)", - IU_STR - "Choose RAB Assignment's Transport Layer Address encoding\n" - "ITU-T X.213 compliant address encoding (default)\n" - "32bit length raw IPv4 address (for ip.access nano3G)\n") -{ - if (!g_rab_assign_addr_enc) { - vty_out(vty, "%%RAB Assignment Transport Layer Address" - " encoding not available%s", VTY_NEWLINE); - return CMD_WARNING; - } - - if (strcmp(argv[0], "v4raw") == 0) - *g_rab_assign_addr_enc = NSAP_ADDR_ENC_V4RAW; - else - *g_rab_assign_addr_enc = NSAP_ADDR_ENC_X213; - return CMD_SUCCESS; -} - -extern struct osmo_sccp_addr local_sccp_addr; - -DEFUN(cfg_iu_local_addr_pc, cfg_iu_local_addr_pc_cmd, - "iu local-address point-code PC", - IU_STR "Local SCCP Address\n") -{ - local_sccp_addr.presence = OSMO_SCCP_ADDR_T_PC | OSMO_SCCP_ADDR_T_SSN; - local_sccp_addr.ri = OSMO_SCCP_RI_SSN_PC; - local_sccp_addr.pc = osmo_ss7_pointcode_parse(NULL, argv[0]); - - return CMD_SUCCESS; -} - -/* TODO: GT address configuration, in line with 4.5.1.1.1 of TS 25.410 */ - -int iu_vty_config_write(struct vty *vty, const char *indent) -{ - if (!g_rab_assign_addr_enc) { - vty_out(vty, "%%RAB Assignment Transport Layer Address" - " encoding not available%s", VTY_NEWLINE); - return CMD_WARNING; - } - - switch (*g_rab_assign_addr_enc) { - case NSAP_ADDR_ENC_V4RAW: - vty_out(vty, "%siu rab-assign-addr-enc v4raw%s", indent, - VTY_NEWLINE); - break; - case NSAP_ADDR_ENC_X213: - /* default value, no need to write anything */ - break; - default: - LOGP(0, LOGL_ERROR, "Invalid value for" - " net.iu.rab_assign_addr_enc: %d\n", - *g_rab_assign_addr_enc); - return CMD_WARNING; - } - - vty_out(vty, "%siu local-address point-code %s%s", indent, - osmo_ss7_pointcode_print(NULL, local_sccp_addr.pc), VTY_NEWLINE); - - return CMD_SUCCESS; -} - -void iu_vty_init(int iu_parent_node, enum nsap_addr_enc *rab_assign_addr_enc) -{ - g_rab_assign_addr_enc = rab_assign_addr_enc; - - install_element(CFG_LOG_NODE, &logging_asn_debug_cmd); - install_element(CFG_LOG_NODE, &logging_asn_xer_print_cmd); - install_element(iu_parent_node, &cfg_iu_rab_assign_addr_enc_cmd); - install_element(iu_parent_node, &cfg_iu_local_addr_pc_cmd); -} diff --git a/src/libmsc/Makefile.am b/src/libmsc/Makefile.am index 7669666..9083530 100644 --- a/src/libmsc/Makefile.am +++ b/src/libmsc/Makefile.am @@ -34,8 +34,6 @@ gsm_04_11.c \ gsm_04_80.c \ gsm_subscriber.c \ - iucs.c \ - iucs_ranap.c \ mncc.c \ mncc_builtin.c \ mncc_sock.c \ @@ -51,7 +49,12 @@ meas_feed.c \ subscr_conn.c \ $(NULL) -if !BUILD_IU +if BUILD_IU +libmsc_a_SOURCES += \ + iucs.c \ + iucs_ranap.c \ + $(NULL) +else libmsc_a_SOURCES += \ iu_dummy.c \ $(NULL) diff --git a/src/libmsc/a_iface_bssap.c b/src/libmsc/a_iface_bssap.c index ac40940..4ed5f94 100644 --- a/src/libmsc/a_iface_bssap.c +++ b/src/libmsc/a_iface_bssap.c @@ -29,7 +29,6 @@ #include #include #include -#include #include #include #include diff --git a/src/libmsc/gsm_04_08.c b/src/libmsc/gsm_04_08.c index 631bb98..be23c64 100644 --- a/src/libmsc/gsm_04_08.c +++ b/src/libmsc/gsm_04_08.c @@ -71,13 +71,11 @@ #include #include #include - -#include - #ifdef BUILD_IU -#include +#include #endif +#include #include #include @@ -3401,7 +3399,7 @@ #ifdef BUILD_IU DEBUGP(DMM, "-> SECURITY MODE CONTROL %s\n", vlr_subscr_name(conn->vsub)); - return iu_tx_sec_mode_cmd(conn->iu.ue_ctx, tuple, 0, 1); + return ranap_iu_tx_sec_mode_cmd(conn->iu.ue_ctx, &tuple->vec, 0, 1); #else LOGP(DMM, LOGL_ERROR, "Cannot send Security Mode Control over RAN_UTRAN_IU," " built without Iu support\n"); diff --git a/src/libmsc/gsm_subscriber.c b/src/libmsc/gsm_subscriber.c index 73361a1..09540c1 100644 --- a/src/libmsc/gsm_subscriber.c +++ b/src/libmsc/gsm_subscriber.c @@ -20,6 +20,8 @@ * */ +#include "../../bscconfig.h" + #include #include #include @@ -32,6 +34,12 @@ #include +#ifdef BUILD_IU +#include +#else +#include +#endif + #include #include #include @@ -40,7 +48,6 @@ #include #include #include -#include #include #include #include @@ -108,10 +115,10 @@ case RAN_GERAN_A: return a_iface_tx_paging(vsub->imsi, vsub->tmsi, vsub->lac); case RAN_UTRAN_IU: - return iu_page_cs(vsub->imsi, - vsub->tmsi == GSM_RESERVED_TMSI? - NULL : &vsub->tmsi, - vsub->lac); + return ranap_iu_page_cs(vsub->imsi, + vsub->tmsi == GSM_RESERVED_TMSI? + NULL : &vsub->tmsi, + vsub->lac); default: break; } diff --git a/src/libmsc/iu_dummy.c b/src/libmsc/iu_dummy.c index 1f5dffb..e9d335e 100644 --- a/src/libmsc/iu_dummy.c +++ b/src/libmsc/iu_dummy.c @@ -26,39 +26,39 @@ #include "../../bscconfig.h" #ifndef BUILD_IU -#include -#include +#include #include #include #include struct msgb; -struct ue_conn_ctx; +struct ranap_ue_conn_ctx; struct gsm_auth_tuple; struct RANAP_Cause; +struct osmo_auth_vector; -int iu_tx(struct msgb *msg, uint8_t sapi) +int ranap_iu_tx(struct msgb *msg, uint8_t sapi) { LOGP(DLGLOBAL, LOGL_INFO, "iu_tx() dummy called, NOT transmitting %d bytes: %s\n", msg->len, osmo_hexdump(msg->data, msg->len)); return 0; } -int iu_tx_sec_mode_cmd(struct ue_conn_ctx *uectx, struct gsm_auth_tuple *tp, - int send_ck) +int ranap_iu_tx_sec_mode_cmd(struct ranap_ue_conn_ctx *uectx, struct osmo_auth_vector *vec, + int send_ck) { LOGP(DLGLOBAL, LOGL_INFO, "iu_tx_sec_mode_cmd() dummy called, NOT transmitting Security Mode Command\n"); return 0; } -int iu_page_cs(const char *imsi, const uint32_t *tmsi, uint16_t lac) +int ranap_iu_page_cs(const char *imsi, const uint32_t *tmsi, uint16_t lac) { LOGP(DLGLOBAL, LOGL_INFO, "iu_page_cs() dummy called, NOT paging\n"); return 23; } -int iu_page_ps(const char *imsi, const uint32_t *ptmsi, uint16_t lac, uint8_t rac) +int ranap_iu_page_ps(const char *imsi, const uint32_t *ptmsi, uint16_t lac, uint8_t rac) { LOGP(DLGLOBAL, LOGL_INFO, "iu_page_ps() dummy called, NOT paging\n"); return 0; @@ -72,19 +72,19 @@ return NULL; } -int iu_rab_act(struct ue_conn_ctx *ue_ctx, struct msgb *msg) +int ranap_iu_rab_act(struct ranap_ue_conn_ctx *ue_ctx, struct msgb *msg) { LOGP(DLGLOBAL, LOGL_INFO, "iu_rab_act() dummy called, NOT activating RAB\n"); return 0; } -int iu_tx_common_id(struct ue_conn_ctx *uectx, const char *imsi) +int ranap_iu_tx_common_id(struct ranap_ue_conn_ctx *uectx, const char *imsi) { LOGP(DLGLOBAL, LOGL_INFO, "iu_tx_common_id() dummy called, NOT sending CommonID\n"); return 0; } -int iu_tx_release(struct ue_conn_ctx *ctx, const struct RANAP_Cause *cause) +int ranap_iu_tx_release(struct ranap_ue_conn_ctx *ctx, const struct RANAP_Cause *cause) { LOGP(DLGLOBAL, LOGL_INFO, "iu_tx_release() dummy called, NOT sending Release\n"); return 0; diff --git a/src/libmsc/iucs.c b/src/libmsc/iucs.c index be026c8..04b9ece 100644 --- a/src/libmsc/iucs.c +++ b/src/libmsc/iucs.c @@ -25,17 +25,17 @@ #include #include +#include #include #include -#include #include #include #include /* For A-interface see libbsc/bsc_api.c subscr_con_allocate() */ static struct gsm_subscriber_connection *subscr_conn_allocate_iu(struct gsm_network *network, - struct ue_conn_ctx *ue, + struct ranap_ue_conn_ctx *ue, uint16_t lac) { struct gsm_subscriber_connection *conn; @@ -57,7 +57,7 @@ return conn; } -static int same_ue_conn(struct ue_conn_ctx *a, struct ue_conn_ctx *b) +static int same_ue_conn(struct ranap_ue_conn_ctx *a, struct ranap_ue_conn_ctx *b) { if (a == b) return 1; @@ -103,7 +103,7 @@ * connection IDs, or return NULL if not found. */ struct gsm_subscriber_connection *subscr_conn_lookup_iu( struct gsm_network *network, - struct ue_conn_ctx *ue) + struct ranap_ue_conn_ctx *ue) { struct gsm_subscriber_connection *conn; @@ -126,7 +126,7 @@ } /* Receive MM/CC/... message from IuCS (SCCP user SAP). - * msg->dst must reference a struct ue_conn_ctx, which identifies the peer that + * msg->dst must reference a struct ranap_ue_conn_ctx, which identifies the peer that * sent the msg. * * For A-interface see libbsc/bsc_api.c gsm0408_rcvmsg(). */ @@ -134,10 +134,10 @@ uint16_t *lac) { int rc; - struct ue_conn_ctx *ue_ctx; + struct ranap_ue_conn_ctx *ue_ctx; struct gsm_subscriber_connection *conn; - ue_ctx = (struct ue_conn_ctx*)msg->dst; + ue_ctx = (struct ranap_ue_conn_ctx*)msg->dst; /* TODO: are there message types that could allow us to skip this * search? */ diff --git a/src/libmsc/iucs_ranap.c b/src/libmsc/iucs_ranap.c index c016474..45de1ca 100644 --- a/src/libmsc/iucs_ranap.c +++ b/src/libmsc/iucs_ranap.c @@ -27,11 +27,11 @@ #include #include +#include #include #include #include -#include #include #include #include @@ -67,7 +67,7 @@ } int iucs_rx_ranap_event(struct gsm_network *network, - struct ue_conn_ctx *ue_ctx, int type, void *data) + struct ranap_ue_conn_ctx *ue_ctx, int type, void *data) { struct gsm_subscriber_connection *conn; @@ -79,19 +79,19 @@ } switch (type) { - case IU_EVENT_IU_RELEASE: - case IU_EVENT_LINK_INVALIDATED: + case RANAP_IU_EVENT_IU_RELEASE: + case RANAP_IU_EVENT_LINK_INVALIDATED: LOGP(DIUCS, LOGL_INFO, "IuCS release for %s\n", vlr_subscr_name(conn->vsub)); msc_subscr_conn_close(conn, 0); return 0; - case IU_EVENT_SECURITY_MODE_COMPLETE: + case RANAP_IU_EVENT_SECURITY_MODE_COMPLETE: LOGP(DIUCS, LOGL_INFO, "IuCS security mode complete for %s\n", vlr_subscr_name(conn->vsub)); return iucs_rx_sec_mode_compl(conn, (RANAP_SecurityModeCompleteIEs_t*)data); - case IU_EVENT_RAB_ASSIGN: + case RANAP_IU_EVENT_RAB_ASSIGN: return iucs_rx_rab_assign(conn, (RANAP_RAB_SetupOrModifiedItemIEs_t*)data); default: diff --git a/src/libmsc/msc_ifaces.c b/src/libmsc/msc_ifaces.c index 7d2e898..262bf98 100644 --- a/src/libmsc/msc_ifaces.c +++ b/src/libmsc/msc_ifaces.c @@ -23,7 +23,6 @@ #include #include #include -#include #include #include #include @@ -34,10 +33,13 @@ #include "../../bscconfig.h" #ifdef BUILD_IU +#include extern struct msgb *ranap_new_msg_rab_assign_voice(uint8_t rab_id, uint32_t rtp_ip, uint16_t rtp_port, bool use_x213_nsap); +#else +#include #endif /* BUILD_IU */ static int msc_tx(struct gsm_subscriber_connection *conn, struct msgb *msg) @@ -57,7 +59,7 @@ case RAN_UTRAN_IU: msg->dst = conn->iu.ue_ctx; - return iu_tx(msg, 0); + return ranap_iu_tx(msg, 0); default: LOGP(DMSC, LOGL_ERROR, @@ -134,10 +136,10 @@ DEBUGP(DIUCS, "%s: tx CommonID %s\n", vlr_subscr_name(conn->vsub), conn->vsub->imsi); - return iu_tx_common_id(conn->iu.ue_ctx, conn->vsub->imsi); + return ranap_iu_tx_common_id(conn->iu.ue_ctx, conn->vsub->imsi); } -static int iu_rab_act_cs(struct ue_conn_ctx *uectx, uint8_t rab_id, +static int iu_rab_act_cs(struct ranap_ue_conn_ctx *uectx, uint8_t rab_id, uint32_t rtp_ip, uint16_t rtp_port) { #ifdef BUILD_IU @@ -145,7 +147,7 @@ bool use_x213_nsap; uint32_t conn_id = uectx->conn_id; - use_x213_nsap = (uectx->rab_assign_addr_enc == NSAP_ADDR_ENC_X213); + use_x213_nsap = (uectx->rab_assign_addr_enc == RANAP_NSAP_ADDR_ENC_X213); LOGP(DIUCS, LOGL_DEBUG, "Assigning RAB: conn_id=%u, rab_id=%d," " rtp=%x:%u, use_x213_nsap=%d\n", conn_id, rab_id, rtp_ip, @@ -155,7 +157,7 @@ use_x213_nsap); msg->l2h = msg->data; - if (iu_rab_act(uectx, msg)) + if (ranap_iu_rab_act(uectx, msg)) LOGP(DIUCS, LOGL_ERROR, "Failed to send RAB Assignment:" " conn_id=%d rab_id=%d rtp=%x:%u\n", conn_id, rab_id, rtp_ip, rtp_port); @@ -170,7 +172,6 @@ { struct gsm_trans *trans = priv; struct gsm_subscriber_connection *conn = trans->conn; - struct ue_conn_ctx *uectx = conn->iu.ue_ctx; uint32_t rtp_ip; int rc; @@ -195,7 +196,7 @@ if (trans->conn->via_ran == RAN_UTRAN_IU) { /* Assign a voice channel via RANAP on 3G */ - if (iu_rab_act_cs(uectx, conn->iu.rab_id, rtp_ip, conn->rtp.port_subscr)) + if (iu_rab_act_cs(conn->iu.ue_ctx, conn->iu.rab_id, rtp_ip, conn->rtp.port_subscr)) goto rab_act_cs_error; } else if (trans->conn->via_ran == RAN_GERAN_A) { /* Assign a voice channel via A on 2G */ @@ -234,7 +235,7 @@ mgcp = conn->network->mgcpgw.client; #ifdef BUILD_IU - /* FIXME: HACK. where to scope the RAB Id? At the conn / subscriber / ue_conn_ctx? */ + /* FIXME: HACK. where to scope the RAB Id? At the conn / subscriber / ranap_ue_conn_ctx? */ static uint8_t next_iu_rab_id = 1; if (conn->via_ran == RAN_UTRAN_IU) conn->iu.rab_id = next_iu_rab_id ++; diff --git a/src/libmsc/msc_vty.c b/src/libmsc/msc_vty.c index 01e7e82..6ae4529 100644 --- a/src/libmsc/msc_vty.c +++ b/src/libmsc/msc_vty.c @@ -23,15 +23,19 @@ /* NOTE: I would have liked to call this the MSC_NODE instead of the MSC_NODE, * but MSC_NODE already exists to configure a remote MSC for osmo-bsc. */ +#include "../../bscconfig.h" + #include #include +#ifdef BUILD_IU +#include +#endif #include #include #include #include -#include static struct cmd_node msc_node = { MSC_NODE, @@ -99,7 +103,7 @@ mgcpgw_client_config_write(vty, " "); #ifdef BUILD_IU - iu_vty_config_write(vty, " "); + ranap_iu_vty_config_write(vty, " "); #endif return CMD_SUCCESS; @@ -153,6 +157,6 @@ mgcpgw_client_vty_init(MSC_NODE, &msc_network->mgcpgw.conf); #ifdef BUILD_IU - iu_vty_init(MSC_NODE, &msc_network->iu.rab_assign_addr_enc); + ranap_iu_vty_init(MSC_NODE, &msc_network->iu.rab_assign_addr_enc); #endif } diff --git a/src/libmsc/osmo_msc.c b/src/libmsc/osmo_msc.c index 866cfbd..4d24f22 100644 --- a/src/libmsc/osmo_msc.c +++ b/src/libmsc/osmo_msc.c @@ -28,10 +28,16 @@ #include #include #include -#include #include #include + +#include "../../bscconfig.h" +#ifdef BUILD_IU +#include +#else +#include +#endif /* Receive a SAPI-N-REJECT from BSC */ void msc_sapi_n_reject(struct gsm_subscriber_connection *conn, int dlci) @@ -285,7 +291,7 @@ switch (conn->via_ran) { case RAN_UTRAN_IU: - iu_tx_release(conn->iu.ue_ctx, NULL); + ranap_iu_tx_release(conn->iu.ue_ctx, NULL); /* FIXME: keep the conn until the Iu Release Outcome is * received from the UE, or a timeout expires. For now, the log * says "unknown UE" for each release outcome. */ diff --git a/src/libmsc/subscr_conn.c b/src/libmsc/subscr_conn.c index cdeeae9..bcab8e4 100644 --- a/src/libmsc/subscr_conn.c +++ b/src/libmsc/subscr_conn.c @@ -30,9 +30,7 @@ #include #include #include -#include #include - #define SUBSCR_CONN_TIMEOUT 5 /* seconds */ diff --git a/src/osmo-msc/Makefile.am b/src/osmo-msc/Makefile.am index bd734d1..87b6133 100644 --- a/src/osmo-msc/Makefile.am +++ b/src/osmo-msc/Makefile.am @@ -50,7 +50,6 @@ $(NULL) if BUILD_IU osmo_msc_LDADD += \ - $(top_builddir)/src/libiu/libiu.a \ $(LIBOSMORANAP_LIBS) \ $(LIBASN1C_LIBS) \ $(NULL) diff --git a/src/osmo-msc/msc_main.c b/src/osmo-msc/msc_main.c index 4affb0a..9cfffaa 100644 --- a/src/osmo-msc/msc_main.c +++ b/src/osmo-msc/msc_main.c @@ -66,9 +66,11 @@ #include #include -#include +#ifdef BUILD_IU +#include +#endif -#include +#include #include #include #include @@ -313,6 +315,7 @@ .is_config_node = bsc_vty_is_config_node, }; +#ifdef BUILD_IU static int rcvmsg_iu_cs(struct msgb *msg, struct gprs_ra_id *ra_id, uint16_t *sai) { DEBUGP(DIUCS, "got IuCS message" @@ -327,14 +330,15 @@ return gsm0408_rcvmsg_iucs(msc_network, msg, ra_id? &ra_id->lac : NULL); } -static int rx_iu_event(struct ue_conn_ctx *ctx, enum iu_event_type type, +static int rx_iu_event(struct ranap_ue_conn_ctx *ctx, enum ranap_iu_event_type type, void *data) { DEBUGP(DIUCS, "got IuCS event %u: %s\n", type, - iu_event_type_str(type)); + ranap_iu_event_type_str(type)); return iucs_rx_ranap_event(msc_network, ctx, type, data); } +#endif #define DEFAULT_M3UA_REMOTE_IP "127.0.0.1" #define DEFAULT_LOCAL_PC (1 << 11) /* pc 1.0.0 in 3-8-3 format */ @@ -343,9 +347,11 @@ int ss7_setup(void *ctx) { char *sccp_inst_name_a = "OsmoMSC-A"; - char *sccp_inst_name_iu = "OsmoMSC-Iu"; uint32_t cs7_instance_a = msc_network->a.cs7_instance; +#if BUILD_IU + char *sccp_inst_name_iu = "OsmoMSC-Iu"; uint32_t cs7_instance_iu = msc_network->iu.cs7_instance; +#endif LOGP(DMSC, LOGL_NOTICE, "CS7 Instance identifier, A-Interface: %u\n", cs7_instance_a); @@ -557,7 +563,7 @@ #ifdef BUILD_IU /* Set up IuCS */ - iu_init(tall_msc_ctx, msc_network->iu.sccp, rcvmsg_iu_cs, rx_iu_event); + ranap_iu_init(tall_msc_ctx, DRANAP, "OsmoMSC-IuCS", msc_network->iu.sccp, rcvmsg_iu_cs, rx_iu_event); #endif /* Set up A interface */ diff --git a/tests/msc_vlr/Makefile.am b/tests/msc_vlr/Makefile.am index 6d51d6e..3ae0c84 100644 --- a/tests/msc_vlr/Makefile.am +++ b/tests/msc_vlr/Makefile.am @@ -50,13 +50,6 @@ $(top_builddir)/src/libtrau/libtrau.a \ $(top_builddir)/src/libmgcp/libmgcp.a \ $(top_builddir)/src/libcommon/libcommon.a \ - $(NULL) -if BUILD_IU -COMMON_LDADD += \ - $(top_builddir)/src/libiu/libiu.a \ - $(NULL) -endif -COMMON_LDADD += \ $(LIBSMPP34_LIBS) \ $(LIBOSMOCORE_LIBS) \ $(LIBOSMOGSM_LIBS) \ @@ -76,10 +69,10 @@ -Wl,--wrap=a_iface_tx_dtap \ -Wl,--wrap=a_iface_tx_clear_cmd \ -Wl,--wrap=a_iface_tx_paging \ - -Wl,--wrap=iu_tx \ - -Wl,--wrap=iu_tx_release \ - -Wl,--wrap=iu_tx_common_id \ - -Wl,--wrap=iu_page_cs \ + -Wl,--wrap=ranap_iu_tx \ + -Wl,--wrap=ranap_iu_tx_release \ + -Wl,--wrap=ranap_iu_tx_common_id \ + -Wl,--wrap=ranap_iu_page_cs \ -Wl,--wrap=msc_stop_paging \ -Wl,--wrap=gsm340_gen_scts \ -Wl,--wrap=RAND_bytes \ diff --git a/tests/msc_vlr/msc_vlr_tests.c b/tests/msc_vlr/msc_vlr_tests.c index 179f49d..c555603 100644 --- a/tests/msc_vlr/msc_vlr_tests.c +++ b/tests/msc_vlr/msc_vlr_tests.c @@ -30,11 +30,11 @@ #include #include #include +#include #include #include #include #include -#include #include #include "msc_vlr_tests.h" @@ -152,8 +152,8 @@ conn->bts = the_bts; conn->via_ran = rx_from_ran; if (conn->via_ran == RAN_UTRAN_IU) { - struct ue_conn_ctx *ue_ctx = talloc_zero(conn, struct ue_conn_ctx); - *ue_ctx = (struct ue_conn_ctx){ + struct ranap_ue_conn_ctx *ue_ctx = talloc_zero(conn, struct ranap_ue_conn_ctx); + *ue_ctx = (struct ranap_ue_conn_ctx){ .conn_id = 42, }; conn->iu.ue_ctx = ue_ctx; @@ -295,9 +295,9 @@ return 1; } -/* override, requires '-Wl,--wrap=iu_page_cs' */ -int __real_iu_page_cs(const char *imsi, const uint32_t *tmsi, uint16_t lac); -int __wrap_iu_page_cs(const char *imsi, const uint32_t *tmsi, uint16_t lac) +/* override, requires '-Wl,--wrap=ranap_iu_page_cs' */ +int __real_ranap_iu_page_cs(const char *imsi, const uint32_t *tmsi, uint16_t lac); +int __wrap_ranap_iu_page_cs(const char *imsi, const uint32_t *tmsi, uint16_t lac) { return _paging_sent(RAN_UTRAN_IU, imsi, tmsi ? *tmsi : GSM_RESERVED_TMSI, lac); } @@ -472,16 +472,16 @@ return 0; } -/* override, requires '-Wl,--wrap=iu_tx' */ -int __real_iu_tx(struct msgb *msg, uint8_t sapi); -int __wrap_iu_tx(struct msgb *msg, uint8_t sapi) +/* override, requires '-Wl,--wrap=ranap_iu_tx' */ +int __real_ranap_iu_tx(struct msgb *msg, uint8_t sapi); +int __wrap_ranap_iu_tx(struct msgb *msg, uint8_t sapi) { return _validate_dtap(msg, RAN_UTRAN_IU); } -/* override, requires '-Wl,--wrap=iu_tx_release' */ -int __real_iu_tx_release(struct ue_conn_ctx *ctx, const struct RANAP_Cause *cause); -int __wrap_iu_tx_release(struct ue_conn_ctx *ctx, const struct RANAP_Cause *cause) +/* override, requires '-Wl,--wrap=ranap_iu_tx_release' */ +int __real_ranap_iu_tx_release(struct ranap_ue_conn_ctx *ctx, const struct RANAP_Cause *cause); +int __wrap_ranap_iu_tx_release(struct ranap_ue_conn_ctx *ctx, const struct RANAP_Cause *cause) { btw("Iu Release --%s--> MS", ran_type_name(RAN_UTRAN_IU)); OSMO_ASSERT(iu_release_expected); @@ -491,8 +491,8 @@ } /* override, requires '-Wl,--wrap=iu_tx_common_id' */ -int __real_iu_tx_common_id(struct ue_conn_ctx *ue_ctx, const char *imsi); -int __wrap_iu_tx_common_id(struct ue_conn_ctx *ue_ctx, const char *imsi) +int __real_ranap_iu_tx_common_id(struct ranap_ue_conn_ctx *ue_ctx, const char *imsi); +int __wrap_ranap_iu_tx_common_id(struct ranap_ue_conn_ctx *ue_ctx, const char *imsi) { btw("Iu Common ID --%s--> MS (IMSI=%s)", ran_type_name(RAN_UTRAN_IU), imsi); return 0; diff --git a/tests/sgsn/Makefile.am b/tests/sgsn/Makefile.am index f1606cb..ccb8f44 100644 --- a/tests/sgsn/Makefile.am +++ b/tests/sgsn/Makefile.am @@ -74,7 +74,6 @@ if BUILD_IU sgsn_test_LDADD += \ - $(top_builddir)/src/libiu/libiu.a \ $(LIBOSMORANAP_LIBS) \ $(LIBOSMOSIGTRAN_LIBS) \ $(LIBASN1C_LIBS) \ diff --git a/tests/sms_queue/Makefile.am b/tests/sms_queue/Makefile.am index d17f996..62c479b 100644 --- a/tests/sms_queue/Makefile.am +++ b/tests/sms_queue/Makefile.am @@ -37,13 +37,6 @@ $(top_builddir)/src/libmgcp/libmgcp.a \ $(top_builddir)/src/libcommon/libcommon.a \ $(top_builddir)/src/libcommon-cs/libcommon-cs.a \ - $(NULL) -if BUILD_IU -sms_queue_test_LDADD += \ - $(top_builddir)/src/libiu/libiu.a \ - $(NULL) -endif -sms_queue_test_LDADD += \ $(LIBSMPP34_LIBS) \ $(LIBOSMOCORE_LIBS) \ $(LIBOSMOGSM_LIBS) \ -- To view, visit https://gerrit.osmocom.org/3489 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ib8c4fcdb4766c5e575618b95ce16dce51063206b Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Fri Aug 11 16:30:12 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 11 Aug 2017 16:30:12 +0000 Subject: [PATCH] osmo-msc[master]: cosmetic: msc_vlr_tests: drop unused var Message-ID: Review at https://gerrit.osmocom.org/3490 cosmetic: msc_vlr_tests: drop unused var Change-Id: I584c0dfffe005597563dbd72fad8a087c554ba3d --- M tests/msc_vlr/msc_vlr_tests.c 1 file changed, 0 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/90/3490/1 diff --git a/tests/msc_vlr/msc_vlr_tests.c b/tests/msc_vlr/msc_vlr_tests.c index c555603..6a7d648 100644 --- a/tests/msc_vlr/msc_vlr_tests.c +++ b/tests/msc_vlr/msc_vlr_tests.c @@ -449,7 +449,6 @@ int _validate_dtap(struct msgb *msg, enum ran_type to_ran) { - struct gsm48_hdr *gh = (void*)msg->data; btw("DTAP --%s--> MS: %s: %s", ran_type_name(to_ran), msg_type_name(msg), osmo_hexdump_nospc(msg->data, msg->len)); -- To view, visit https://gerrit.osmocom.org/3490 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I584c0dfffe005597563dbd72fad8a087c554ba3d Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Fri Aug 11 16:30:12 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 11 Aug 2017 16:30:12 +0000 Subject: [PATCH] osmo-msc[master]: .gitignore: cosmetic: use globs to ignore test binaries Message-ID: Review at https://gerrit.osmocom.org/3491 .gitignore: cosmetic: use globs to ignore test binaries Change-Id: I840e4333a4cad646d751ebafe7e0ef23e7a9c708 --- M .gitignore 1 file changed, 7 insertions(+), 39 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/91/3491/1 diff --git a/.gitignore b/.gitignore index cf5542d..a9e6b84 100644 --- a/.gitignore +++ b/.gitignore @@ -62,45 +62,13 @@ #tests tests/testsuite.dir -tests/bsc-nat/bsc_nat_test -tests/bsc-nat-trie/bsc_nat_trie_test -tests/channel/channel_test -tests/db/db_test -tests/debug/debug_test -tests/gsm0408/gsm0408_test -tests/mgcp/mgcp_test -tests/sccp/sccp_test -tests/sms/sms_test -tests/timer/timer_test -tests/gprs/gprs_test -tests/gbproxy/gbproxy_test -tests/abis/abis_test -tests/si/si_test -tests/smpp/smpp_test -tests/bsc/bsc_test -tests/trau/trau_test -tests/mgcp/mgcp_transcoding_test -tests/sgsn/sgsn_test -tests/subscr/subscr_test -tests/subscr/bsc_subscr_test -tests/oap/oap_test -tests/gtphub/gtphub_test -tests/mm_auth/mm_auth_test -tests/xid/xid_test -tests/sndcp_xid/sndcp_xid_test -tests/slhc/slhc_test -tests/v42bis/v42bis_test -tests/nanobts_omlattr/nanobts_omlattr_test -tests/oap/oap_client_test -tests/msc_vlr/msc_vlr_test_no_authen -tests/msc_vlr/msc_vlr_test_gsm_authen -tests/msc_vlr/msc_vlr_test_gsm_ciph -tests/msc_vlr/msc_vlr_test_umts_authen -tests/msc_vlr/msc_vlr_test_hlr_reject -tests/msc_vlr/msc_vlr_test_hlr_timeout -tests/msc_vlr/msc_vlr_test_ms_timeout -tests/msc_vlr/msc_vlr_test_reject_concurrency -tests/msc_vlr/msc_vlr_test_rest +tests/*/*_test +# ignore compiled binaries like msc_vlr_test_foo; do not ignore +# msc_vlr_test_foo.{c,ok,err}, but do still ignore the corresponding .o object +# files: +tests/msc_vlr/msc_vlr_test_* +!tests/msc_vlr/msc_vlr_test_*.* +tests/msc_vlr/msc_vlr_test_*.o tests/atconfig -- To view, visit https://gerrit.osmocom.org/3491 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I840e4333a4cad646d751ebafe7e0ef23e7a9c708 Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Fri Aug 11 16:30:13 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 11 Aug 2017 16:30:13 +0000 Subject: [PATCH] osmo-msc[master]: replace internal libmgcp with libosmo-legacy-mgcp Message-ID: Review at https://gerrit.osmocom.org/3492 replace internal libmgcp with libosmo-legacy-mgcp Change-Id: Ic99d681759edce11564da62500c2aac5cf5fffe2 --- M configure.ac M include/openbsc/Makefile.am M include/openbsc/bsc_nat.h M include/openbsc/gsm_data.h D include/openbsc/mgcp.h D include/openbsc/mgcp_internal.h D include/openbsc/mgcp_transcode.h D include/openbsc/mgcpgw_client.h M src/Makefile.am M src/libfilter/bsc_msg_acc.c D src/libmgcp/Makefile.am D src/libmgcp/g711common.h D src/libmgcp/mgcp_common.c D src/libmgcp/mgcp_network.c D src/libmgcp/mgcp_osmux.c D src/libmgcp/mgcp_protocol.c D src/libmgcp/mgcp_sdp.c D src/libmgcp/mgcp_transcode.c D src/libmgcp/mgcp_vty.c D src/libmgcp/mgcpgw_client.c D src/libmgcp/mgcpgw_client_vty.c M src/libmsc/a_iface.c M src/libmsc/msc_ifaces.c M src/libmsc/msc_vty.c D src/osmo-bsc_mgcp/Makefile.am D src/osmo-bsc_mgcp/mgcp_main.c M src/osmo-msc/Makefile.am M src/osmo-msc/msc_main.c M tests/Makefile.am D tests/mgcp/Makefile.am D tests/mgcp/mgcp_test.c D tests/mgcp/mgcp_test.ok D tests/mgcp/mgcp_transcoding_test.c D tests/mgcp/mgcp_transcoding_test.ok D tests/mgcp/mgcpgw_client_test.c D tests/mgcp/mgcpgw_client_test.err D tests/mgcp/mgcpgw_client_test.ok M tests/msc_vlr/Makefile.am M tests/sms_queue/Makefile.am M tests/testsuite.at 40 files changed, 20 insertions(+), 11,344 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/92/3492/1 -- To view, visit https://gerrit.osmocom.org/3492 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ic99d681759edce11564da62500c2aac5cf5fffe2 Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Fri Aug 11 16:30:13 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 11 Aug 2017 16:30:13 +0000 Subject: [PATCH] osmo-msc[master]: gsup client: move not-connected to error loglevel Message-ID: Review at https://gerrit.osmocom.org/3493 gsup client: move not-connected to error loglevel Change-Id: I8290963aedb7237da89c9ff98adf4cd33beb5031 --- M src/libcommon/gsup_client.c 1 file changed, 2 insertions(+), 10 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/93/3493/1 diff --git a/src/libcommon/gsup_client.c b/src/libcommon/gsup_client.c index 258f230..fd65e7b 100644 --- a/src/libcommon/gsup_client.c +++ b/src/libcommon/gsup_client.c @@ -330,18 +330,10 @@ int gsup_client_send(struct gsup_client *gsupc, struct msgb *msg) { - if (!gsupc) { - LOGP(DGPRS, LOGL_NOTICE, "No GSUP client, unable to " - "send %s\n", msgb_hexdump(msg)); + if (!gsupc || !gsupc->is_connected) { + LOGP(DGPRS, LOGL_ERROR, "GSUP not connected, unable to send %s\n", msgb_hexdump(msg)); msgb_free(msg); return -ENOTCONN; - } - - if (!gsupc->is_connected) { - LOGP(DGPRS, LOGL_NOTICE, "GSUP not connected, unable to " - "send %s\n", msgb_hexdump(msg)); - msgb_free(msg); - return -EAGAIN; } client_send(gsupc, IPAC_PROTO_EXT_GSUP, msg); -- To view, visit https://gerrit.osmocom.org/3493 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I8290963aedb7237da89c9ff98adf4cd33beb5031 Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Fri Aug 11 16:30:13 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 11 Aug 2017 16:30:13 +0000 Subject: [PATCH] osmo-msc[master]: msc_vlr tests: add IMEISV tests Message-ID: Review at https://gerrit.osmocom.org/3494 msc_vlr tests: add IMEISV tests Change-Id: I752afef2ae3ce04e813c7e9fea0e883e607c0e14 --- M tests/msc_vlr/msc_vlr_test_gsm_authen.c M tests/msc_vlr/msc_vlr_test_gsm_authen.err M tests/msc_vlr/msc_vlr_test_gsm_ciph.c M tests/msc_vlr/msc_vlr_test_gsm_ciph.err M tests/msc_vlr/msc_vlr_test_no_authen.c M tests/msc_vlr/msc_vlr_test_no_authen.err 6 files changed, 1,324 insertions(+), 48 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/94/3494/1 diff --git a/tests/msc_vlr/msc_vlr_test_gsm_authen.c b/tests/msc_vlr/msc_vlr_test_gsm_authen.c index 44e4052..70b7614 100644 --- a/tests/msc_vlr/msc_vlr_test_gsm_authen.c +++ b/tests/msc_vlr/msc_vlr_test_gsm_authen.c @@ -563,7 +563,7 @@ btw("MS replies with an Identity Response"); expect_bssap_clear(); - ms_sends_msg("0559084a32244332244332"); + ms_sends_msg("0559084a32244332244302"); VERBOSE_ASSERT(bssap_clear_sent, == true, "%d"); btw("LU was successful, and the conn has already been closed"); @@ -573,7 +573,7 @@ btw("Subscriber has the IMEI"); vsub = vlr_subscr_find_by_imsi(net->vlr, imsi); OSMO_ASSERT(vsub); - VERBOSE_ASSERT(strcmp(vsub->imei, "423423423423423"), == 0, "%d"); + VERBOSE_ASSERT(strcmp(vsub->imei, "423423423423420"), == 0, "%d"); vlr_subscr_put(vsub); BTW("subscriber detaches"); @@ -661,7 +661,7 @@ thwart_rx_non_initial_requests(); btw("MS replies with an Identity Response"); - ms_sends_msg("0559084a32244332244332"); + ms_sends_msg("0559084a32244332244302"); btw("a LU Accept with a new TMSI was sent, waiting for TMSI Realloc Compl"); EXPECT_CONN_COUNT(1); @@ -688,7 +688,7 @@ btw("Subscriber has the IMEI and TMSI"); vsub = vlr_subscr_find_by_imsi(net->vlr, imsi); OSMO_ASSERT(vsub); - VERBOSE_ASSERT(strcmp(vsub->imei, "423423423423423"), == 0, "%d"); + VERBOSE_ASSERT(strcmp(vsub->imei, "423423423423420"), == 0, "%d"); VERBOSE_ASSERT(vsub->tmsi, == 0x03020100, "0x%08x"); vlr_subscr_put(vsub); diff --git a/tests/msc_vlr/msc_vlr_test_gsm_authen.err b/tests/msc_vlr/msc_vlr_test_gsm_authen.err index bca64a4..c12eba1 100644 --- a/tests/msc_vlr/msc_vlr_test_gsm_authen.err +++ b/tests/msc_vlr/msc_vlr_test_gsm_authen.err @@ -1250,8 +1250,8 @@ MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_ID_RESP DREF MSISDN:46071: MSC conn use + 1 == 2 DRLL Dispatching 04.08 message GSM48_MT_MM_ID_RESP (0x5:0x19) -DMM IDENTITY RESPONSE: MI(IMEI)=423423423423423 -DVLR set IMEI on subscriber; IMSI=901700000004620 IMEI=423423423423423 +DMM IDENTITY RESPONSE: MI(IMEI)=423423423423420 +DVLR set IMEI on subscriber; IMSI=901700000004620 IMEI=423423423423420 DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_WAIT_LU_COMPL}: Received Event VLR_ULA_E_ID_IMEI DVLR lu_compl_vlr_fsm(901700000004620){LU_COMPL_VLR_S_WAIT_IMEI}: Received Event LU_COMPL_VLR_E_IMEI_CHECK_ACK - sending LU Accept for MSISDN:46071 @@ -1289,7 +1289,7 @@ llist_count(&net->subscr_conns) == 0 - Subscriber has the IMEI DREF VLR subscr MSISDN:46071 usage increases to: 2 - strcmp(vsub->imei, "423423423423423") == 0 + strcmp(vsub->imei, "423423423423420") == 0 DREF VLR subscr MSISDN:46071 usage decreases to: 1 --- - subscriber detaches @@ -1469,8 +1469,8 @@ MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_ID_RESP DREF MSISDN:46071: MSC conn use + 1 == 2 DRLL Dispatching 04.08 message GSM48_MT_MM_ID_RESP (0x5:0x19) -DMM IDENTITY RESPONSE: MI(IMEI)=423423423423423 -DVLR set IMEI on subscriber; IMSI=901700000004620 IMEI=423423423423423 +DMM IDENTITY RESPONSE: MI(IMEI)=423423423423420 +DVLR set IMEI on subscriber; IMSI=901700000004620 IMEI=423423423423420 DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_WAIT_LU_COMPL}: Received Event VLR_ULA_E_ID_IMEI DVLR lu_compl_vlr_fsm(901700000004620){LU_COMPL_VLR_S_WAIT_IMEI_TMSI}: Received Event LU_COMPL_VLR_E_IMEI_CHECK_ACK DVLR lu_compl_vlr_fsm(901700000004620){LU_COMPL_VLR_S_WAIT_IMEI_TMSI}: lu_compl_vlr_new_tmsi() @@ -1538,7 +1538,7 @@ llist_count(&net->subscr_conns) == 0 - Subscriber has the IMEI and TMSI DREF VLR subscr MSISDN:46071 usage increases to: 2 - strcmp(vsub->imei, "423423423423423") == 0 + strcmp(vsub->imei, "423423423423420") == 0 vsub->tmsi == 0x03020100 DREF VLR subscr MSISDN:46071 usage decreases to: 1 --- diff --git a/tests/msc_vlr/msc_vlr_test_gsm_ciph.c b/tests/msc_vlr/msc_vlr_test_gsm_ciph.c index 42e7c73..e0bd967 100644 --- a/tests/msc_vlr/msc_vlr_test_gsm_ciph.c +++ b/tests/msc_vlr/msc_vlr_test_gsm_ciph.c @@ -553,7 +553,7 @@ btw("MS replies with an Identity Response"); expect_bssap_clear(); - ms_sends_msg("0559084a32244332244332"); + ms_sends_msg("0559084a32244332244302"); VERBOSE_ASSERT(bssap_clear_sent, == true, "%d"); btw("LU was successful, and the conn has already been closed"); @@ -563,7 +563,7 @@ btw("Subscriber has the IMEI"); vsub = vlr_subscr_find_by_imsi(net->vlr, imsi); OSMO_ASSERT(vsub); - VERBOSE_ASSERT(strcmp(vsub->imei, "423423423423423"), == 0, "%d"); + VERBOSE_ASSERT(strcmp(vsub->imei, "423423423423420"), == 0, "%d"); vlr_subscr_put(vsub); BTW("subscriber detaches"); @@ -638,20 +638,17 @@ btw("MS sends Ciphering Mode Complete with IMEISV, VLR accepts and sends GSUP LU Req to HLR"); gsup_expect_tx("04010809710000004026f0"); - ms_sends_msg("063217094b32244332244332f5"); + ms_sends_msg("063217094b32244332244372f5"); VERBOSE_ASSERT(lu_result_sent, == RES_NONE, "%d"); btw("Subscriber has the IMEISV"); vsub = vlr_subscr_find_by_imsi(net->vlr, imsi); OSMO_ASSERT(vsub); - VERBOSE_ASSERT(strcmp(vsub->imeisv, "4234234234234235"), == 0, "%d"); + VERBOSE_ASSERT(strcmp(vsub->imeisv, "4234234234234275"), == 0, "%d"); vlr_subscr_put(vsub); EXPECT_ACCEPTED(false); thwart_rx_non_initial_requests(); - - btw("MS replies with an Identity Response"); - ms_sends_msg("0559084a32244332244332"); btw("HLR sends _INSERT_DATA_REQUEST, VLR responds with _INSERT_DATA_RESULT"); gsup_rx("10010809710000004026f00804036470f1", @@ -756,7 +753,7 @@ thwart_rx_non_initial_requests(); btw("MS replies with an Identity Response"); - ms_sends_msg("0559084a32244332244332"); + ms_sends_msg("0559084a32244332244302"); btw("a LU Accept with a new TMSI was sent, waiting for TMSI Realloc Compl"); EXPECT_CONN_COUNT(1); @@ -783,7 +780,7 @@ btw("Subscriber has the IMEI and TMSI"); vsub = vlr_subscr_find_by_imsi(net->vlr, imsi); OSMO_ASSERT(vsub); - VERBOSE_ASSERT(strcmp(vsub->imei, "423423423423423"), == 0, "%d"); + VERBOSE_ASSERT(strcmp(vsub->imei, "423423423423420"), == 0, "%d"); VERBOSE_ASSERT(vsub->tmsi, == 0x03020100, "0x%08x"); vlr_subscr_put(vsub); diff --git a/tests/msc_vlr/msc_vlr_test_gsm_ciph.err b/tests/msc_vlr/msc_vlr_test_gsm_ciph.err index c219b49..b26f0d2 100644 --- a/tests/msc_vlr/msc_vlr_test_gsm_ciph.err +++ b/tests/msc_vlr/msc_vlr_test_gsm_ciph.err @@ -1152,8 +1152,8 @@ MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_ID_RESP DREF MSISDN:46071: MSC conn use + 1 == 2 DRLL Dispatching 04.08 message GSM48_MT_MM_ID_RESP (0x5:0x19) -DMM IDENTITY RESPONSE: MI(IMEI)=423423423423423 -DVLR set IMEI on subscriber; IMSI=901700000004620 IMEI=423423423423423 +DMM IDENTITY RESPONSE: MI(IMEI)=423423423423420 +DVLR set IMEI on subscriber; IMSI=901700000004620 IMEI=423423423423420 DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_WAIT_LU_COMPL}: Received Event VLR_ULA_E_ID_IMEI DVLR lu_compl_vlr_fsm(901700000004620){LU_COMPL_VLR_S_WAIT_IMEI}: Received Event LU_COMPL_VLR_E_IMEI_CHECK_ACK - sending LU Accept for MSISDN:46071 @@ -1191,7 +1191,7 @@ llist_count(&net->subscr_conns) == 0 - Subscriber has the IMEI DREF VLR subscr MSISDN:46071 usage increases to: 2 - strcmp(vsub->imei, "423423423423423") == 0 + strcmp(vsub->imei, "423423423423420") == 0 DREF VLR subscr MSISDN:46071 usage decreases to: 1 --- - subscriber detaches @@ -1305,8 +1305,8 @@ MSC <--RAN_GERAN_A-- MS: GSM48_MT_RR_CIPH_M_COMPL DRR IMSI:901700000004620: CIPHERING MODE COMPLETE DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_WAIT_CIPH}: Received Event VLR_ULA_E_CIPH_RES -DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_WAIT_CIPH}: got IMEISV: 4234234234234235F -DVLR set IMEISV on subscriber; IMSI=901700000004620 IMEISV=4234234234234235 +DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_WAIT_CIPH}: got IMEISV: 4234234234234275F +DVLR set IMEISV on subscriber; IMSI=901700000004620 IMEISV=4234234234234275 DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_WAIT_CIPH}: vlr_loc_upd_post_ciph() DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_WAIT_CIPH}: vlr_loc_upd_node_4() DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_WAIT_CIPH}: state_chg to VLR_ULA_S_WAIT_HLR_UPD @@ -1319,7 +1319,7 @@ lu_result_sent == 0 - Subscriber has the IMEISV DREF VLR subscr IMSI:901700000004620 usage increases to: 2 - strcmp(vsub->imeisv, "4234234234234235") == 0 + strcmp(vsub->imeisv, "4234234234234275") == 0 DREF VLR subscr IMSI:901700000004620 usage decreases to: 1 msc_subscr_conn_is_accepted() == false requests shall be thwarted @@ -1331,16 +1331,6 @@ DRLL subscr IMSI:901700000004620: Message not permitted for initial conn: GSM48_MT_RR_SYSINFO_1 DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) DRLL subscr IMSI:901700000004620: Message not permitted for initial conn: GSM48_PDISC_SMS:0x01 -- MS replies with an Identity Response - MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_ID_RESP -DREF IMSI:901700000004620: MSC conn use + 1 == 2 -DRLL Dispatching 04.08 message GSM48_MT_MM_ID_RESP (0x5:0x19) -DMM IDENTITY RESPONSE: MI(IMEI)=423423423423423 -DVLR set IMEI on subscriber; IMSI=901700000004620 IMEI=423423423423423 -DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_WAIT_HLR_UPD}: Received Event VLR_ULA_E_ID_IMEI -DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_WAIT_HLR_UPD}: Event VLR_ULA_E_ID_IMEI not permitted -DMM IMSI:901700000004620: bump: conn still being established (SUBSCR_CONN_S_NEW) -DREF IMSI:901700000004620: MSC conn use - 1 == 1 - HLR sends _INSERT_DATA_REQUEST, VLR responds with _INSERT_DATA_RESULT <-- GSUP rx OSMO_GSUP_MSGT_INSERT_DATA_REQUEST: 10010809710000004026f00804036470f1 DVLR GSUP rx 17: 10010809710000004026f00804036470f1 @@ -1589,8 +1579,8 @@ MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_ID_RESP DREF MSISDN:46071: MSC conn use + 1 == 2 DRLL Dispatching 04.08 message GSM48_MT_MM_ID_RESP (0x5:0x19) -DMM IDENTITY RESPONSE: MI(IMEI)=423423423423423 -DVLR set IMEI on subscriber; IMSI=901700000004620 IMEI=423423423423423 +DMM IDENTITY RESPONSE: MI(IMEI)=423423423423420 +DVLR set IMEI on subscriber; IMSI=901700000004620 IMEI=423423423423420 DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_WAIT_LU_COMPL}: Received Event VLR_ULA_E_ID_IMEI DVLR lu_compl_vlr_fsm(901700000004620){LU_COMPL_VLR_S_WAIT_IMEI_TMSI}: Received Event LU_COMPL_VLR_E_IMEI_CHECK_ACK DVLR lu_compl_vlr_fsm(901700000004620){LU_COMPL_VLR_S_WAIT_IMEI_TMSI}: lu_compl_vlr_new_tmsi() @@ -1658,7 +1648,7 @@ llist_count(&net->subscr_conns) == 0 - Subscriber has the IMEI and TMSI DREF VLR subscr MSISDN:46071 usage increases to: 2 - strcmp(vsub->imei, "423423423423423") == 0 + strcmp(vsub->imei, "423423423423420") == 0 vsub->tmsi == 0x03020100 DREF VLR subscr MSISDN:46071 usage decreases to: 1 --- diff --git a/tests/msc_vlr/msc_vlr_test_no_authen.c b/tests/msc_vlr/msc_vlr_test_no_authen.c index 34e392e..32e0b40 100644 --- a/tests/msc_vlr/msc_vlr_test_no_authen.c +++ b/tests/msc_vlr/msc_vlr_test_no_authen.c @@ -425,7 +425,9 @@ btw("MS replies with an Identity Response"); expect_bssap_clear(); - ms_sends_msg("0559084a32244332244332"); + /* 3GPP TS 23.003: 6.2.1 Composition of IMEI: the IMEI ends with a + * spare digit that shall be sent as zero by the MS. */ + ms_sends_msg("0559084a32244332244302"); VERBOSE_ASSERT(bssap_clear_sent, == true, "%d"); btw("LU was successful, and the conn has already been closed"); @@ -435,7 +437,7 @@ btw("Subscriber has the IMEI"); vsub = vlr_subscr_find_by_imsi(net->vlr, imsi); OSMO_ASSERT(vsub); - VERBOSE_ASSERT(strcmp(vsub->imei, "423423423423423"), == 0, "%d"); + VERBOSE_ASSERT(strcmp(vsub->imei, "423423423423420"), == 0, "%d"); vlr_subscr_put(vsub); BTW("subscriber detaches"); @@ -491,7 +493,7 @@ thwart_rx_non_initial_requests(); btw("MS replies with an Identity Response"); - ms_sends_msg("0559084a32244332244332"); + ms_sends_msg("0559084a32244332244302"); btw("a LU Accept with a new TMSI was sent, waiting for TMSI Realloc Compl"); EXPECT_CONN_COUNT(1); @@ -511,7 +513,7 @@ btw("Subscriber has the IMEI and TMSI"); vsub = vlr_subscr_find_by_imsi(net->vlr, imsi); OSMO_ASSERT(vsub); - VERBOSE_ASSERT(strcmp(vsub->imei, "423423423423423"), == 0, "%d"); + VERBOSE_ASSERT(strcmp(vsub->imei, "423423423423420"), == 0, "%d"); VERBOSE_ASSERT(vsub->tmsi, == 0x03020100, "0x%08x"); vlr_subscr_put(vsub); @@ -525,10 +527,382 @@ comment_end(); } +void test_no_authen_imeisv() +{ + struct vlr_subscr *vsub; + const char *imsi = "901700000004620"; + + /* No auth only works on GERAN */ + rx_from_ran = RAN_GERAN_A; + + comment_start(); + + net->vlr->cfg.retrieve_imeisv_early = true; + + btw("Location Update request causes an IMEISV ID request back to the MS"); + lu_result_sent = RES_NONE; + dtap_expect_tx("051803"); + ms_sends_msg("050802008168000130089910070000006402"); + OSMO_ASSERT(dtap_tx_confirmed); + + btw("MS replies with an Identity Response, causes LU to commence with a GSUP LU request to HLR"); + gsup_expect_tx("04010809710000004026f0"); + ms_sends_msg("0559094332244332244372f5"); + OSMO_ASSERT(gsup_tx_confirmed); + VERBOSE_ASSERT(lu_result_sent, == RES_NONE, "%d"); + + btw("Subscriber has the IMEISV from the ID Response"); + vsub = vlr_subscr_find_by_imsi(net->vlr, imsi); + OSMO_ASSERT(vsub); + VERBOSE_ASSERT(strcmp(vsub->imeisv, "4234234234234275"), == 0, "%d"); + vlr_subscr_put(vsub); + + btw("HLR sends _INSERT_DATA_REQUEST, VLR responds with _INSERT_DATA_RESULT"); + gsup_rx("10010809710000004026f00804036470f1", + "12010809710000004026f0"); + VERBOSE_ASSERT(lu_result_sent, == RES_NONE, "%d"); + + btw("having received subscriber data does not mean acceptance"); + EXPECT_ACCEPTED(false); + + thwart_rx_non_initial_requests(); + + VERBOSE_ASSERT(lu_result_sent, == RES_NONE, "%d"); + + btw("HLR also sends GSUP _UPDATE_LOCATION_RESULT"); + expect_bssap_clear(); + gsup_rx("06010809710000004026f0", NULL); + + btw("LU was successful, and the conn has already been closed"); + VERBOSE_ASSERT(lu_result_sent, == RES_ACCEPT, "%d"); + VERBOSE_ASSERT(bssap_clear_sent, == true, "%d"); + EXPECT_CONN_COUNT(0); + + BTW("subscriber detaches"); + expect_bssap_clear(); + ms_sends_msg("050130089910070000006402"); + VERBOSE_ASSERT(bssap_clear_sent, == true, "%d"); + + EXPECT_CONN_COUNT(0); + clear_vlr(); + comment_end(); +} + +void test_no_authen_imeisv_imei() +{ + struct vlr_subscr *vsub; + const char *imsi = "901700000004620"; + + rx_from_ran = RAN_GERAN_A; + + comment_start(); + + net->vlr->cfg.retrieve_imeisv_early = true; + net->vlr->cfg.check_imei_rqd = true; + + btw("Location Update request causes an IMEISV ID request back to the MS"); + lu_result_sent = RES_NONE; + dtap_expect_tx("051803"); + ms_sends_msg("050802008168000130089910070000006402"); + OSMO_ASSERT(dtap_tx_confirmed); + + btw("MS replies with an Identity Response, causes LU to commence with a GSUP LU request to HLR"); + gsup_expect_tx("04010809710000004026f0"); + ms_sends_msg("0559094332244332244372f5"); + OSMO_ASSERT(gsup_tx_confirmed); + VERBOSE_ASSERT(lu_result_sent, == RES_NONE, "%d"); + + btw("Subscriber has the IMEISV from the ID Response"); + vsub = vlr_subscr_find_by_imsi(net->vlr, imsi); + OSMO_ASSERT(vsub); + VERBOSE_ASSERT(strcmp(vsub->imeisv, "4234234234234275"), == 0, "%d"); + vlr_subscr_put(vsub); + + btw("HLR sends _INSERT_DATA_REQUEST, VLR responds with _INSERT_DATA_RESULT"); + gsup_rx("10010809710000004026f00804036470f1", + "12010809710000004026f0"); + VERBOSE_ASSERT(lu_result_sent, == RES_NONE, "%d"); + + btw("having received subscriber data does not mean acceptance"); + EXPECT_ACCEPTED(false); + thwart_rx_non_initial_requests(); + VERBOSE_ASSERT(lu_result_sent, == RES_NONE, "%d"); + + btw("HLR also sends GSUP _UPDATE_LOCATION_RESULT, and we send an ID Request for the IMEI to the MS"); + dtap_expect_tx("051802"); + gsup_rx("06010809710000004026f0", NULL); + + btw("We will only do business when the IMEI is known"); + EXPECT_CONN_COUNT(1); + vsub = vlr_subscr_find_by_imsi(net->vlr, imsi); + OSMO_ASSERT(vsub); + VERBOSE_ASSERT(vsub->imei[0], == 0, "%d"); + vlr_subscr_put(vsub); + EXPECT_ACCEPTED(false); + thwart_rx_non_initial_requests(); + + btw("MS replies with an Identity Response"); + expect_bssap_clear(); + ms_sends_msg("0559084a32244332244302"); + VERBOSE_ASSERT(bssap_clear_sent, == true, "%d"); + + btw("LU was successful, and the conn has already been closed"); + VERBOSE_ASSERT(lu_result_sent, == RES_ACCEPT, "%d"); + EXPECT_CONN_COUNT(0); + + btw("Subscriber has the IMEI"); + vsub = vlr_subscr_find_by_imsi(net->vlr, imsi); + OSMO_ASSERT(vsub); + VERBOSE_ASSERT(strcmp(vsub->imei, "423423423423420"), == 0, "%d"); + vlr_subscr_put(vsub); + + BTW("subscriber detaches"); + expect_bssap_clear(); + ms_sends_msg("050130089910070000006402"); + VERBOSE_ASSERT(bssap_clear_sent, == true, "%d"); + + EXPECT_CONN_COUNT(0); + clear_vlr(); + comment_end(); +} + +void test_no_authen_imeisv_tmsi() +{ + struct vlr_subscr *vsub; + const char *imsi = "901700000004620"; + + rx_from_ran = RAN_GERAN_A; + + comment_start(); + + net->vlr->cfg.retrieve_imeisv_early = true; + net->vlr->cfg.assign_tmsi = true; + + btw("Location Update request causes an IMEISV ID request back to the MS"); + lu_result_sent = RES_NONE; + dtap_expect_tx("051803"); + ms_sends_msg("050802008168000130089910070000006402"); + OSMO_ASSERT(dtap_tx_confirmed); + + btw("MS replies with an Identity Response, causes LU to commence with a GSUP LU request to HLR"); + gsup_expect_tx("04010809710000004026f0"); + ms_sends_msg("0559094332244332244372f5"); + OSMO_ASSERT(gsup_tx_confirmed); + VERBOSE_ASSERT(lu_result_sent, == RES_NONE, "%d"); + + btw("Subscriber has the IMEISV from the ID Response"); + vsub = vlr_subscr_find_by_imsi(net->vlr, imsi); + OSMO_ASSERT(vsub); + VERBOSE_ASSERT(strcmp(vsub->imeisv, "4234234234234275"), == 0, "%d"); + vlr_subscr_put(vsub); + + btw("HLR sends _INSERT_DATA_REQUEST, VLR responds with _INSERT_DATA_RESULT"); + gsup_rx("10010809710000004026f00804036470f1", + "12010809710000004026f0"); + VERBOSE_ASSERT(lu_result_sent, == RES_NONE, "%d"); + + btw("having received subscriber data does not mean acceptance"); + EXPECT_ACCEPTED(false); + thwart_rx_non_initial_requests(); + VERBOSE_ASSERT(lu_result_sent, == RES_NONE, "%d"); + + btw("HLR also sends GSUP _UPDATE_LOCATION_RESULT"); + gsup_rx("06010809710000004026f0", NULL); + + btw("a LU Accept with a new TMSI was sent, waiting for TMSI Realloc Compl"); + EXPECT_CONN_COUNT(1); + VERBOSE_ASSERT(lu_result_sent, == RES_ACCEPT, "%d"); + EXPECT_ACCEPTED(false); + thwart_rx_non_initial_requests(); + + btw("even though the TMSI is not acked, we can already find the subscr with it"); + vsub = vlr_subscr_find_by_tmsi(net->vlr, 0x03020100); + VERBOSE_ASSERT(vsub != NULL, == true, "%d"); + VERBOSE_ASSERT(strcmp(vsub->imsi, imsi), == 0, "%d"); + VERBOSE_ASSERT(vsub->tmsi_new, == 0x03020100, "0x%08x"); + VERBOSE_ASSERT(vsub->tmsi, == GSM_RESERVED_TMSI, "0x%08x"); + vlr_subscr_put(vsub); + + btw("MS sends TMSI Realloc Complete"); + expect_bssap_clear(); + ms_sends_msg("055b"); + VERBOSE_ASSERT(bssap_clear_sent, == true, "%d"); + + btw("LU was successful, and the conn has already been closed"); + EXPECT_CONN_COUNT(0); + + + BTW("subscriber sends LU Request, this time with the TMSI"); + btw("Location Update request causes an IMEISV ID request back to the MS"); + lu_result_sent = RES_NONE; + dtap_expect_tx("051803"); + ms_sends_msg("050802008168000130089910070000006402"); + OSMO_ASSERT(dtap_tx_confirmed); + + btw("MS replies with an Identity Response, causes LU to commence with a GSUP LU request to HLR"); + gsup_expect_tx("04010809710000004026f0"); + ms_sends_msg("0559095332244332244372f6"); + OSMO_ASSERT(gsup_tx_confirmed); + VERBOSE_ASSERT(lu_result_sent, == RES_NONE, "%d"); + + btw("Subscriber has the IMEISV from the ID Response"); + vsub = vlr_subscr_find_by_imsi(net->vlr, imsi); + OSMO_ASSERT(vsub); + VERBOSE_ASSERT(strcmp(vsub->imeisv, "5234234234234276"), == 0, "%d"); + vlr_subscr_put(vsub); + + btw("HLR sends _INSERT_DATA_REQUEST, VLR responds with _INSERT_DATA_RESULT"); + gsup_rx("10010809710000004026f00804036470f1", + "12010809710000004026f0"); + VERBOSE_ASSERT(lu_result_sent, == RES_NONE, "%d"); + + btw("having received subscriber data does not mean acceptance"); + EXPECT_ACCEPTED(false); + thwart_rx_non_initial_requests(); + VERBOSE_ASSERT(lu_result_sent, == RES_NONE, "%d"); + + btw("HLR also sends GSUP _UPDATE_LOCATION_RESULT"); + gsup_rx("06010809710000004026f0", NULL); + + btw("a LU Accept with a new TMSI was sent, waiting for TMSI Realloc Compl"); + EXPECT_CONN_COUNT(1); + VERBOSE_ASSERT(lu_result_sent, == RES_ACCEPT, "%d"); + EXPECT_ACCEPTED(false); + thwart_rx_non_initial_requests(); + + btw("even though the TMSI is not acked, we can already find the subscr with it"); + vsub = vlr_subscr_find_by_tmsi(net->vlr, 0x07060504); + VERBOSE_ASSERT(vsub != NULL, == true, "%d"); + VERBOSE_ASSERT(strcmp(vsub->imsi, imsi), == 0, "%d"); + VERBOSE_ASSERT(vsub->tmsi_new, == 0x07060504, "0x%08x"); + VERBOSE_ASSERT(vsub->tmsi, == 0x03020100, "0x%08x"); + vlr_subscr_put(vsub); + + btw("MS sends TMSI Realloc Complete"); + expect_bssap_clear(); + ms_sends_msg("055b"); + VERBOSE_ASSERT(bssap_clear_sent, == true, "%d"); + + btw("LU was successful, and the conn has already been closed"); + EXPECT_CONN_COUNT(0); + + btw("subscriber has the new TMSI"); + vsub = vlr_subscr_find_by_tmsi(net->vlr, 0x07060504); + VERBOSE_ASSERT(vsub != NULL, == true, "%d"); + VERBOSE_ASSERT(strcmp(vsub->imsi, imsi), == 0, "%d"); + VERBOSE_ASSERT(vsub->tmsi_new, == GSM_RESERVED_TMSI, "0x%08x"); + VERBOSE_ASSERT(vsub->tmsi, == 0x07060504, "0x%08x"); + vlr_subscr_put(vsub); + + BTW("subscriber detaches, using new TMSI"); + expect_bssap_clear(); + ms_sends_msg("050130" "05f4" "07060504"); + VERBOSE_ASSERT(bssap_clear_sent, == true, "%d"); + + EXPECT_CONN_COUNT(0); + clear_vlr(); + comment_end(); +} + +void test_no_authen_imeisv_tmsi_imei() +{ + struct vlr_subscr *vsub; + const char *imsi = "901700000004620"; + + rx_from_ran = RAN_GERAN_A; + + comment_start(); + + net->vlr->cfg.retrieve_imeisv_early = true; + net->vlr->cfg.assign_tmsi = true; + net->vlr->cfg.check_imei_rqd = true; + + btw("Location Update request causes an IMEISV ID request back to the MS"); + lu_result_sent = RES_NONE; + dtap_expect_tx("051803"); + ms_sends_msg("050802008168000130089910070000006402"); + OSMO_ASSERT(dtap_tx_confirmed); + + btw("MS replies with an Identity Response, causes LU to commence with a GSUP LU request to HLR"); + gsup_expect_tx("04010809710000004026f0"); + ms_sends_msg("0559094332244332244372f5"); + OSMO_ASSERT(gsup_tx_confirmed); + VERBOSE_ASSERT(lu_result_sent, == RES_NONE, "%d"); + + btw("Subscriber has the IMEISV from the ID Response"); + vsub = vlr_subscr_find_by_imsi(net->vlr, imsi); + OSMO_ASSERT(vsub); + VERBOSE_ASSERT(strcmp(vsub->imeisv, "4234234234234275"), == 0, "%d"); + vlr_subscr_put(vsub); + + btw("HLR sends _INSERT_DATA_REQUEST, VLR responds with _INSERT_DATA_RESULT"); + gsup_rx("10010809710000004026f00804036470f1", + "12010809710000004026f0"); + VERBOSE_ASSERT(lu_result_sent, == RES_NONE, "%d"); + + btw("having received subscriber data does not mean acceptance"); + EXPECT_ACCEPTED(false); + thwart_rx_non_initial_requests(); + VERBOSE_ASSERT(lu_result_sent, == RES_NONE, "%d"); + + btw("HLR also sends GSUP _UPDATE_LOCATION_RESULT, and we send an ID Request for the IMEI to the MS"); + dtap_expect_tx("051802"); + gsup_rx("06010809710000004026f0", NULL); + + btw("We will only do business when the IMEI is known"); + EXPECT_CONN_COUNT(1); + vsub = vlr_subscr_find_by_imsi(net->vlr, imsi); + OSMO_ASSERT(vsub); + VERBOSE_ASSERT(vsub->imei[0], == 0, "%d"); + vlr_subscr_put(vsub); + EXPECT_ACCEPTED(false); + thwart_rx_non_initial_requests(); + + btw("MS replies with an Identity Response"); + ms_sends_msg("0559084a32244332244302"); + + btw("a LU Accept with a new TMSI was sent, waiting for TMSI Realloc Compl"); + EXPECT_CONN_COUNT(1); + VERBOSE_ASSERT(lu_result_sent, == RES_ACCEPT, "%d"); + EXPECT_ACCEPTED(false); + thwart_rx_non_initial_requests(); + + btw("MS sends TMSI Realloc Complete"); + expect_bssap_clear(); + ms_sends_msg("055b"); + VERBOSE_ASSERT(bssap_clear_sent, == true, "%d"); + + btw("LU was successful, and the conn has already been closed"); + VERBOSE_ASSERT(lu_result_sent, == RES_ACCEPT, "%d"); + EXPECT_CONN_COUNT(0); + + btw("Subscriber has the IMEISV, IMEI and TMSI"); + vsub = vlr_subscr_find_by_imsi(net->vlr, imsi); + OSMO_ASSERT(vsub); + VERBOSE_ASSERT(strcmp(vsub->imeisv, "4234234234234275"), == 0, "%d"); + VERBOSE_ASSERT(strcmp(vsub->imei, "423423423423420"), == 0, "%d"); + VERBOSE_ASSERT(vsub->tmsi, == 0x03020100, "0x%08x"); + vlr_subscr_put(vsub); + + BTW("subscriber detaches"); + expect_bssap_clear(); + ms_sends_msg("050130089910070000006402"); + VERBOSE_ASSERT(bssap_clear_sent, == true, "%d"); + + EXPECT_CONN_COUNT(0); + clear_vlr(); + comment_end(); +} + + msc_vlr_test_func_t msc_vlr_tests[] = { test_no_authen, test_no_authen_tmsi, test_no_authen_imei, test_no_authen_tmsi_imei, + test_no_authen_imeisv, + test_no_authen_imeisv_imei, + test_no_authen_imeisv_tmsi, + test_no_authen_imeisv_tmsi_imei, NULL }; diff --git a/tests/msc_vlr/msc_vlr_test_no_authen.err b/tests/msc_vlr/msc_vlr_test_no_authen.err index 4f40736..931a72f 100644 --- a/tests/msc_vlr/msc_vlr_test_no_authen.err +++ b/tests/msc_vlr/msc_vlr_test_no_authen.err @@ -938,8 +938,8 @@ MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_ID_RESP DREF MSISDN:46071: MSC conn use + 1 == 2 DRLL Dispatching 04.08 message GSM48_MT_MM_ID_RESP (0x5:0x19) -DMM IDENTITY RESPONSE: MI(IMEI)=423423423423423 -DVLR set IMEI on subscriber; IMSI=901700000004620 IMEI=423423423423423 +DMM IDENTITY RESPONSE: MI(IMEI)=423423423423420 +DVLR set IMEI on subscriber; IMSI=901700000004620 IMEI=423423423423420 DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_WAIT_LU_COMPL}: Received Event VLR_ULA_E_ID_IMEI DVLR lu_compl_vlr_fsm(901700000004620){LU_COMPL_VLR_S_WAIT_IMEI}: Received Event LU_COMPL_VLR_E_IMEI_CHECK_ACK - sending LU Accept for MSISDN:46071 @@ -977,7 +977,7 @@ llist_count(&net->subscr_conns) == 0 - Subscriber has the IMEI DREF VLR subscr MSISDN:46071 usage increases to: 2 - strcmp(vsub->imei, "423423423423423") == 0 + strcmp(vsub->imei, "423423423423420") == 0 DREF VLR subscr MSISDN:46071 usage decreases to: 1 --- - subscriber detaches @@ -1110,8 +1110,8 @@ MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_ID_RESP DREF MSISDN:46071: MSC conn use + 1 == 2 DRLL Dispatching 04.08 message GSM48_MT_MM_ID_RESP (0x5:0x19) -DMM IDENTITY RESPONSE: MI(IMEI)=423423423423423 -DVLR set IMEI on subscriber; IMSI=901700000004620 IMEI=423423423423423 +DMM IDENTITY RESPONSE: MI(IMEI)=423423423423420 +DVLR set IMEI on subscriber; IMSI=901700000004620 IMEI=423423423423420 DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_WAIT_LU_COMPL}: Received Event VLR_ULA_E_ID_IMEI DVLR lu_compl_vlr_fsm(901700000004620){LU_COMPL_VLR_S_WAIT_IMEI_TMSI}: Received Event LU_COMPL_VLR_E_IMEI_CHECK_ACK DVLR lu_compl_vlr_fsm(901700000004620){LU_COMPL_VLR_S_WAIT_IMEI_TMSI}: lu_compl_vlr_new_tmsi() @@ -1173,7 +1173,7 @@ llist_count(&net->subscr_conns) == 0 - Subscriber has the IMEI and TMSI DREF VLR subscr MSISDN:46071 usage increases to: 2 - strcmp(vsub->imei, "423423423423423") == 0 + strcmp(vsub->imei, "423423423423420") == 0 vsub->tmsi == 0x03020100 DREF VLR subscr MSISDN:46071 usage decreases to: 1 --- @@ -1199,6 +1199,921 @@ full talloc report on 'msgb' (total 0 bytes in 1 blocks) talloc_total_blocks(tall_bsc_ctx) == 9 +===== test_no_authen_imeisv +- Location Update request causes an IMEISV ID request back to the MS + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_LOC_UPD_REQUEST + new conn +DREF unknown: MSC conn use + 1 == 1 +DRLL Dispatching 04.08 message GSM48_MT_MM_LOC_UPD_REQUEST (0x5:0x8) +DREF unknown: MSC conn use + 1 == 2 +DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Allocated +DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Received Event SUBSCR_CONN_E_START +DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: state_chg to SUBSCR_CONN_S_NEW +DMM LOCATION UPDATING REQUEST: MI(IMSI)=901700000004620 type=IMSI ATTACH +DMM LU/new-LAC: 1/0 +DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_IDLE}: Allocated +DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_IDLE}: is child of Subscr_Conn(901700000004620) +DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_IDLE}: rev=GSM net=GERAN (no Auth) +DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_IDLE}: Received Event VLR_ULA_E_UPDATE_LA +DREF VLR subscr unknown usage increases to: 1 +DVLR set IMSI on subscriber; IMSI=901700000004620 id=901700000004620 +DVLR New subscr, IMSI: 901700000004620 +DREF VLR subscr IMSI:901700000004620 usage increases to: 2 +DREF VLR subscr IMSI:901700000004620 usage decreases to: 1 +DMSC msc_tx 3 bytes to IMSI:901700000004620 via RAN_GERAN_A +- DTAP --RAN_GERAN_A--> MS: GSM48_MT_MM_ID_REQ: 051803 +- DTAP matches expected message +DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_IDLE}: state_chg to VLR_ULA_S_WAIT_IMEISV +DMM IMSI:901700000004620: bump: conn still being established (SUBSCR_CONN_S_NEW) +DREF IMSI:901700000004620: MSC conn use - 1 == 1 +- MS replies with an Identity Response, causes LU to commence with a GSUP LU request to HLR + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_ID_RESP +DREF IMSI:901700000004620: MSC conn use + 1 == 2 +DRLL Dispatching 04.08 message GSM48_MT_MM_ID_RESP (0x5:0x19) +DMM IDENTITY RESPONSE: MI(IMEI-SV)=4234234234234275 +DVLR set IMEISV on subscriber; IMSI=901700000004620 IMEISV=4234234234234275 +DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_WAIT_IMEISV}: Received Event VLR_ULA_E_ID_IMEISV +DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_WAIT_IMEISV}: vlr_loc_upd_node1() +DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_WAIT_IMEISV}: vlr_loc_upd_post_auth() +DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_WAIT_IMEISV}: vlr_loc_upd_post_ciph() +DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_WAIT_IMEISV}: vlr_loc_upd_node_4() +DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_WAIT_IMEISV}: state_chg to VLR_ULA_S_WAIT_HLR_UPD +DVLR upd_hlr_vlr_fsm(901700000004620){UPD_HLR_VLR_S_INIT}: Allocated +DVLR upd_hlr_vlr_fsm(901700000004620){UPD_HLR_VLR_S_INIT}: is child of vlr_lu_fsm(901700000004620) +DVLR upd_hlr_vlr_fsm(901700000004620){UPD_HLR_VLR_S_INIT}: Received Event UPD_HLR_VLR_E_START +DVLR GSUP tx: 04010809710000004026f0 +GSUP --> HLR: OSMO_GSUP_MSGT_UPDATE_LOCATION_REQUEST: 04010809710000004026f0 +DVLR upd_hlr_vlr_fsm(901700000004620){UPD_HLR_VLR_S_INIT}: state_chg to UPD_HLR_VLR_S_WAIT_FOR_DATA +DMM IMSI:901700000004620: bump: conn still being established (SUBSCR_CONN_S_NEW) +DREF IMSI:901700000004620: MSC conn use - 1 == 1 + lu_result_sent == 0 +- Subscriber has the IMEISV from the ID Response +DREF VLR subscr IMSI:901700000004620 usage increases to: 2 + strcmp(vsub->imeisv, "4234234234234275") == 0 +DREF VLR subscr IMSI:901700000004620 usage decreases to: 1 +- HLR sends _INSERT_DATA_REQUEST, VLR responds with _INSERT_DATA_RESULT +<-- GSUP rx OSMO_GSUP_MSGT_INSERT_DATA_REQUEST: 10010809710000004026f00804036470f1 +DVLR GSUP rx 17: 10010809710000004026f00804036470f1 +DREF VLR subscr IMSI:901700000004620 usage increases to: 2 +DVLR IMSI:901700000004620 has MSISDN:46071 +DVLR GSUP tx: 12010809710000004026f0 +GSUP --> HLR: OSMO_GSUP_MSGT_INSERT_DATA_RESULT: 12010809710000004026f0 +DREF VLR subscr MSISDN:46071 usage decreases to: 1 +<-- GSUP rx OSMO_GSUP_MSGT_INSERT_DATA_REQUEST: vlr_gsupc_read_cb() returns 0 + lu_result_sent == 0 +- having received subscriber data does not mean acceptance +msc_subscr_conn_is_accepted() == false + requests shall be thwarted +DRLL Dispatching 04.08 message GSM48_MT_CC_SETUP (0x3:0x5) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_MT_CC_SETUP +DRLL Dispatching 04.08 message unknown 0x33 (0x5:0x33) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: unknown 0x33 +DRLL Dispatching 04.08 message GSM48_MT_RR_SYSINFO_1 (0x6:0x19) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_MT_RR_SYSINFO_1 +DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_PDISC_SMS:0x01 + lu_result_sent == 0 +- HLR also sends GSUP _UPDATE_LOCATION_RESULT +<-- GSUP rx OSMO_GSUP_MSGT_UPDATE_LOCATION_RESULT: 06010809710000004026f0 +DVLR GSUP rx 11: 06010809710000004026f0 +DREF VLR subscr MSISDN:46071 usage increases to: 2 +DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_WAIT_HLR_UPD}: Received Event VLR_ULA_E_HLR_LU_RES +DVLR upd_hlr_vlr_fsm(901700000004620){UPD_HLR_VLR_S_WAIT_FOR_DATA}: Received Event UPD_HLR_VLR_E_UPD_LOC_ACK +DVLR upd_hlr_vlr_fsm(901700000004620){UPD_HLR_VLR_S_WAIT_FOR_DATA}: state_chg to UPD_HLR_VLR_S_DONE +DVLR upd_hlr_vlr_fsm(901700000004620){UPD_HLR_VLR_S_DONE}: Terminating (cause = OSMO_FSM_TERM_REGULAR) +DVLR upd_hlr_vlr_fsm(901700000004620){UPD_HLR_VLR_S_DONE}: Removing from parent vlr_lu_fsm(901700000004620) +DVLR upd_hlr_vlr_fsm(901700000004620){UPD_HLR_VLR_S_DONE}: Freeing instance +DVLR upd_hlr_vlr_fsm(901700000004620){UPD_HLR_VLR_S_DONE}: Deallocated +DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_WAIT_HLR_UPD}: Received Event VLR_ULA_E_UPD_HLR_COMPL +DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_WAIT_HLR_UPD}: state_chg to VLR_ULA_S_WAIT_LU_COMPL +DVLR lu_compl_vlr_fsm(901700000004620){LU_COMPL_VLR_S_INIT}: Allocated +DVLR lu_compl_vlr_fsm(901700000004620){LU_COMPL_VLR_S_INIT}: is child of vlr_lu_fsm(901700000004620) +DVLR lu_compl_vlr_fsm(901700000004620){LU_COMPL_VLR_S_INIT}: Received Event LU_COMPL_VLR_E_START +DVLR lu_compl_vlr_fsm(901700000004620){LU_COMPL_VLR_S_INIT}: state_chg to LU_COMPL_VLR_S_WAIT_SUB_PRES +DVLR sub_pres_vlr_fsm(901700000004620){SUB_PRES_VLR_S_INIT}: Allocated +DVLR sub_pres_vlr_fsm(901700000004620){SUB_PRES_VLR_S_INIT}: is child of lu_compl_vlr_fsm(901700000004620) +DVLR sub_pres_vlr_fsm(901700000004620){SUB_PRES_VLR_S_INIT}: Received Event SUB_PRES_VLR_E_START +DVLR sub_pres_vlr_fsm(901700000004620){SUB_PRES_VLR_S_INIT}: state_chg to SUB_PRES_VLR_S_DONE +DVLR sub_pres_vlr_fsm(901700000004620){SUB_PRES_VLR_S_DONE}: Terminating (cause = OSMO_FSM_TERM_REGULAR) +DVLR sub_pres_vlr_fsm(901700000004620){SUB_PRES_VLR_S_DONE}: Removing from parent lu_compl_vlr_fsm(901700000004620) +DVLR sub_pres_vlr_fsm(901700000004620){SUB_PRES_VLR_S_DONE}: Freeing instance +DVLR sub_pres_vlr_fsm(901700000004620){SUB_PRES_VLR_S_DONE}: Deallocated +DVLR lu_compl_vlr_fsm(901700000004620){LU_COMPL_VLR_S_WAIT_SUB_PRES}: Received Event LU_COMPL_VLR_E_SUB_PRES_COMPL +- sending LU Accept for MSISDN:46071 +DREF VLR subscr MSISDN:46071 usage increases to: 3 +DVLR lu_compl_vlr_fsm(901700000004620){LU_COMPL_VLR_S_WAIT_SUB_PRES}: state_chg to LU_COMPL_VLR_S_DONE +DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_WAIT_LU_COMPL}: Received Event VLR_ULA_E_LU_COMPL_SUCCESS +DVLR lu_compl_vlr_fsm(901700000004620){LU_COMPL_VLR_S_DONE}: Terminating (cause = OSMO_FSM_TERM_PARENT) +DVLR lu_compl_vlr_fsm(901700000004620){LU_COMPL_VLR_S_DONE}: Removing from parent vlr_lu_fsm(901700000004620) +DVLR lu_compl_vlr_fsm(901700000004620){LU_COMPL_VLR_S_DONE}: Freeing instance +DVLR lu_compl_vlr_fsm(901700000004620){LU_COMPL_VLR_S_DONE}: Deallocated +DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_WAIT_LU_COMPL}: state_chg to VLR_ULA_S_DONE +DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_NEW}: Received Event SUBSCR_CONN_E_ACCEPTED +DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_NEW}: SUBSCR_CONN_FROM_LU +DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_NEW}: state_chg to SUBSCR_CONN_S_ACCEPTED +DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_BUMP +DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_ACCEPTED}: bump: releasing conn +DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_ACCEPTED}: state_chg to SUBSCR_CONN_S_RELEASED +DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_RELEASED}: Terminating (cause = OSMO_FSM_TERM_REGULAR) +DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_DONE}: Terminating (cause = OSMO_FSM_TERM_PARENT) +DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_DONE}: Removing from parent Subscr_Conn(901700000004620) +DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_DONE}: fsm_lu_cleanup called with cause OSMO_FSM_TERM_PARENT +DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_DONE}: Freeing instance +DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_DONE}: Deallocated +DMM msc_subscr_conn_close(vsub=MSISDN:46071, cause=2): no conn fsm, releasing directly without release event. +- BSSAP Clear --RAN_GERAN_A--> MS +DREF MSISDN:46071: MSC conn use - 1 == 0 +DRLL subscr MSISDN:46071: Freeing subscriber connection +DREF VLR subscr MSISDN:46071 usage decreases to: 2 +DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_RELEASED}: Freeing instance +DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_RELEASED}: Deallocated +DREF VLR subscr MSISDN:46071 usage decreases to: 1 +<-- GSUP rx OSMO_GSUP_MSGT_UPDATE_LOCATION_RESULT: vlr_gsupc_read_cb() returns 0 +- LU was successful, and the conn has already been closed + lu_result_sent == 1 + bssap_clear_sent == 1 + llist_count(&net->subscr_conns) == 0 +--- +- subscriber detaches + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_IMSI_DETACH_IND + new conn +DREF unknown: MSC conn use + 1 == 1 +DRLL Dispatching 04.08 message GSM48_MT_MM_IMSI_DETACH_IND (0x5:0x1) +DMM IMSI DETACH INDICATION: MI(IMSI)=901700000004620 +DREF VLR subscr MSISDN:46071 usage increases to: 2 +DMM IMSI DETACH for MSISDN:46071 +DREF VLR subscr MSISDN:46071 usage decreases to: 1 +DREF VLR subscr MSISDN:46071 usage decreases to: 0 +DREF freeing VLR subscr MSISDN:46071 +DMM msc_subscr_conn_close(vsub=unknown, cause=0): no conn fsm, releasing directly without release event. +- BSSAP Clear --RAN_GERAN_A--> MS +DREF unknown: MSC conn use - 1 == 0 +DRLL Freeing subscriber connection with NULL subscriber + bssap_clear_sent == 1 + llist_count(&net->subscr_conns) == 0 +===== test_no_authen_imeisv: SUCCESS + +full talloc report on 'msgb' (total 0 bytes in 1 blocks) +talloc_total_blocks(tall_bsc_ctx) == 9 + +===== test_no_authen_imeisv_imei +- Location Update request causes an IMEISV ID request back to the MS + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_LOC_UPD_REQUEST + new conn +DREF unknown: MSC conn use + 1 == 1 +DRLL Dispatching 04.08 message GSM48_MT_MM_LOC_UPD_REQUEST (0x5:0x8) +DREF unknown: MSC conn use + 1 == 2 +DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Allocated +DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Received Event SUBSCR_CONN_E_START +DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: state_chg to SUBSCR_CONN_S_NEW +DMM LOCATION UPDATING REQUEST: MI(IMSI)=901700000004620 type=IMSI ATTACH +DMM LU/new-LAC: 1/0 +DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_IDLE}: Allocated +DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_IDLE}: is child of Subscr_Conn(901700000004620) +DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_IDLE}: rev=GSM net=GERAN (no Auth) +DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_IDLE}: Received Event VLR_ULA_E_UPDATE_LA +DREF VLR subscr unknown usage increases to: 1 +DVLR set IMSI on subscriber; IMSI=901700000004620 id=901700000004620 +DVLR New subscr, IMSI: 901700000004620 +DREF VLR subscr IMSI:901700000004620 usage increases to: 2 +DREF VLR subscr IMSI:901700000004620 usage decreases to: 1 +DMSC msc_tx 3 bytes to IMSI:901700000004620 via RAN_GERAN_A +- DTAP --RAN_GERAN_A--> MS: GSM48_MT_MM_ID_REQ: 051803 +- DTAP matches expected message +DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_IDLE}: state_chg to VLR_ULA_S_WAIT_IMEISV +DMM IMSI:901700000004620: bump: conn still being established (SUBSCR_CONN_S_NEW) +DREF IMSI:901700000004620: MSC conn use - 1 == 1 +- MS replies with an Identity Response, causes LU to commence with a GSUP LU request to HLR + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_ID_RESP +DREF IMSI:901700000004620: MSC conn use + 1 == 2 +DRLL Dispatching 04.08 message GSM48_MT_MM_ID_RESP (0x5:0x19) +DMM IDENTITY RESPONSE: MI(IMEI-SV)=4234234234234275 +DVLR set IMEISV on subscriber; IMSI=901700000004620 IMEISV=4234234234234275 +DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_WAIT_IMEISV}: Received Event VLR_ULA_E_ID_IMEISV +DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_WAIT_IMEISV}: vlr_loc_upd_node1() +DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_WAIT_IMEISV}: vlr_loc_upd_post_auth() +DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_WAIT_IMEISV}: vlr_loc_upd_post_ciph() +DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_WAIT_IMEISV}: vlr_loc_upd_node_4() +DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_WAIT_IMEISV}: state_chg to VLR_ULA_S_WAIT_HLR_UPD +DVLR upd_hlr_vlr_fsm(901700000004620){UPD_HLR_VLR_S_INIT}: Allocated +DVLR upd_hlr_vlr_fsm(901700000004620){UPD_HLR_VLR_S_INIT}: is child of vlr_lu_fsm(901700000004620) +DVLR upd_hlr_vlr_fsm(901700000004620){UPD_HLR_VLR_S_INIT}: Received Event UPD_HLR_VLR_E_START +DVLR GSUP tx: 04010809710000004026f0 +GSUP --> HLR: OSMO_GSUP_MSGT_UPDATE_LOCATION_REQUEST: 04010809710000004026f0 +DVLR upd_hlr_vlr_fsm(901700000004620){UPD_HLR_VLR_S_INIT}: state_chg to UPD_HLR_VLR_S_WAIT_FOR_DATA +DMM IMSI:901700000004620: bump: conn still being established (SUBSCR_CONN_S_NEW) +DREF IMSI:901700000004620: MSC conn use - 1 == 1 + lu_result_sent == 0 +- Subscriber has the IMEISV from the ID Response +DREF VLR subscr IMSI:901700000004620 usage increases to: 2 + strcmp(vsub->imeisv, "4234234234234275") == 0 +DREF VLR subscr IMSI:901700000004620 usage decreases to: 1 +- HLR sends _INSERT_DATA_REQUEST, VLR responds with _INSERT_DATA_RESULT +<-- GSUP rx OSMO_GSUP_MSGT_INSERT_DATA_REQUEST: 10010809710000004026f00804036470f1 +DVLR GSUP rx 17: 10010809710000004026f00804036470f1 +DREF VLR subscr IMSI:901700000004620 usage increases to: 2 +DVLR IMSI:901700000004620 has MSISDN:46071 +DVLR GSUP tx: 12010809710000004026f0 +GSUP --> HLR: OSMO_GSUP_MSGT_INSERT_DATA_RESULT: 12010809710000004026f0 +DREF VLR subscr MSISDN:46071 usage decreases to: 1 +<-- GSUP rx OSMO_GSUP_MSGT_INSERT_DATA_REQUEST: vlr_gsupc_read_cb() returns 0 + lu_result_sent == 0 +- having received subscriber data does not mean acceptance +msc_subscr_conn_is_accepted() == false + requests shall be thwarted +DRLL Dispatching 04.08 message GSM48_MT_CC_SETUP (0x3:0x5) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_MT_CC_SETUP +DRLL Dispatching 04.08 message unknown 0x33 (0x5:0x33) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: unknown 0x33 +DRLL Dispatching 04.08 message GSM48_MT_RR_SYSINFO_1 (0x6:0x19) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_MT_RR_SYSINFO_1 +DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_PDISC_SMS:0x01 + lu_result_sent == 0 +- HLR also sends GSUP _UPDATE_LOCATION_RESULT, and we send an ID Request for the IMEI to the MS +<-- GSUP rx OSMO_GSUP_MSGT_UPDATE_LOCATION_RESULT: 06010809710000004026f0 +DVLR GSUP rx 11: 06010809710000004026f0 +DREF VLR subscr MSISDN:46071 usage increases to: 2 +DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_WAIT_HLR_UPD}: Received Event VLR_ULA_E_HLR_LU_RES +DVLR upd_hlr_vlr_fsm(901700000004620){UPD_HLR_VLR_S_WAIT_FOR_DATA}: Received Event UPD_HLR_VLR_E_UPD_LOC_ACK +DVLR upd_hlr_vlr_fsm(901700000004620){UPD_HLR_VLR_S_WAIT_FOR_DATA}: state_chg to UPD_HLR_VLR_S_DONE +DVLR upd_hlr_vlr_fsm(901700000004620){UPD_HLR_VLR_S_DONE}: Terminating (cause = OSMO_FSM_TERM_REGULAR) +DVLR upd_hlr_vlr_fsm(901700000004620){UPD_HLR_VLR_S_DONE}: Removing from parent vlr_lu_fsm(901700000004620) +DVLR upd_hlr_vlr_fsm(901700000004620){UPD_HLR_VLR_S_DONE}: Freeing instance +DVLR upd_hlr_vlr_fsm(901700000004620){UPD_HLR_VLR_S_DONE}: Deallocated +DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_WAIT_HLR_UPD}: Received Event VLR_ULA_E_UPD_HLR_COMPL +DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_WAIT_HLR_UPD}: state_chg to VLR_ULA_S_WAIT_LU_COMPL +DVLR lu_compl_vlr_fsm(901700000004620){LU_COMPL_VLR_S_INIT}: Allocated +DVLR lu_compl_vlr_fsm(901700000004620){LU_COMPL_VLR_S_INIT}: is child of vlr_lu_fsm(901700000004620) +DVLR lu_compl_vlr_fsm(901700000004620){LU_COMPL_VLR_S_INIT}: Received Event LU_COMPL_VLR_E_START +DVLR lu_compl_vlr_fsm(901700000004620){LU_COMPL_VLR_S_INIT}: state_chg to LU_COMPL_VLR_S_WAIT_SUB_PRES +DVLR sub_pres_vlr_fsm(901700000004620){SUB_PRES_VLR_S_INIT}: Allocated +DVLR sub_pres_vlr_fsm(901700000004620){SUB_PRES_VLR_S_INIT}: is child of lu_compl_vlr_fsm(901700000004620) +DVLR sub_pres_vlr_fsm(901700000004620){SUB_PRES_VLR_S_INIT}: Received Event SUB_PRES_VLR_E_START +DVLR sub_pres_vlr_fsm(901700000004620){SUB_PRES_VLR_S_INIT}: state_chg to SUB_PRES_VLR_S_DONE +DVLR sub_pres_vlr_fsm(901700000004620){SUB_PRES_VLR_S_DONE}: Terminating (cause = OSMO_FSM_TERM_REGULAR) +DVLR sub_pres_vlr_fsm(901700000004620){SUB_PRES_VLR_S_DONE}: Removing from parent lu_compl_vlr_fsm(901700000004620) +DVLR sub_pres_vlr_fsm(901700000004620){SUB_PRES_VLR_S_DONE}: Freeing instance +DVLR sub_pres_vlr_fsm(901700000004620){SUB_PRES_VLR_S_DONE}: Deallocated +DVLR lu_compl_vlr_fsm(901700000004620){LU_COMPL_VLR_S_WAIT_SUB_PRES}: Received Event LU_COMPL_VLR_E_SUB_PRES_COMPL +DVLR lu_compl_vlr_fsm(901700000004620){LU_COMPL_VLR_S_WAIT_SUB_PRES}: state_chg to LU_COMPL_VLR_S_WAIT_IMEI +DMSC msc_tx 3 bytes to MSISDN:46071 via RAN_GERAN_A +- DTAP --RAN_GERAN_A--> MS: GSM48_MT_MM_ID_REQ: 051802 +- DTAP matches expected message +DREF VLR subscr MSISDN:46071 usage decreases to: 1 +<-- GSUP rx OSMO_GSUP_MSGT_UPDATE_LOCATION_RESULT: vlr_gsupc_read_cb() returns 0 +- We will only do business when the IMEI is known + llist_count(&net->subscr_conns) == 1 +DREF VLR subscr MSISDN:46071 usage increases to: 2 + vsub->imei[0] == 0 +DREF VLR subscr MSISDN:46071 usage decreases to: 1 +msc_subscr_conn_is_accepted() == false + requests shall be thwarted +DRLL Dispatching 04.08 message GSM48_MT_CC_SETUP (0x3:0x5) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_MT_CC_SETUP +DRLL Dispatching 04.08 message unknown 0x33 (0x5:0x33) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: unknown 0x33 +DRLL Dispatching 04.08 message GSM48_MT_RR_SYSINFO_1 (0x6:0x19) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_MT_RR_SYSINFO_1 +DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_PDISC_SMS:0x01 +- MS replies with an Identity Response + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_ID_RESP +DREF MSISDN:46071: MSC conn use + 1 == 2 +DRLL Dispatching 04.08 message GSM48_MT_MM_ID_RESP (0x5:0x19) +DMM IDENTITY RESPONSE: MI(IMEI)=423423423423420 +DVLR set IMEI on subscriber; IMSI=901700000004620 IMEI=423423423423420 +DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_WAIT_LU_COMPL}: Received Event VLR_ULA_E_ID_IMEI +DVLR lu_compl_vlr_fsm(901700000004620){LU_COMPL_VLR_S_WAIT_IMEI}: Received Event LU_COMPL_VLR_E_IMEI_CHECK_ACK +- sending LU Accept for MSISDN:46071 +DREF VLR subscr MSISDN:46071 usage increases to: 2 +DVLR lu_compl_vlr_fsm(901700000004620){LU_COMPL_VLR_S_WAIT_IMEI}: state_chg to LU_COMPL_VLR_S_DONE +DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_WAIT_LU_COMPL}: Received Event VLR_ULA_E_LU_COMPL_SUCCESS +DVLR lu_compl_vlr_fsm(901700000004620){LU_COMPL_VLR_S_DONE}: Terminating (cause = OSMO_FSM_TERM_PARENT) +DVLR lu_compl_vlr_fsm(901700000004620){LU_COMPL_VLR_S_DONE}: Removing from parent vlr_lu_fsm(901700000004620) +DVLR lu_compl_vlr_fsm(901700000004620){LU_COMPL_VLR_S_DONE}: Freeing instance +DVLR lu_compl_vlr_fsm(901700000004620){LU_COMPL_VLR_S_DONE}: Deallocated +DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_WAIT_LU_COMPL}: state_chg to VLR_ULA_S_DONE +DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_NEW}: Received Event SUBSCR_CONN_E_ACCEPTED +DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_NEW}: SUBSCR_CONN_FROM_LU +DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_NEW}: state_chg to SUBSCR_CONN_S_ACCEPTED +DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_BUMP +DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_ACCEPTED}: bump: releasing conn +DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_ACCEPTED}: state_chg to SUBSCR_CONN_S_RELEASED +DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_RELEASED}: Terminating (cause = OSMO_FSM_TERM_REGULAR) +DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_DONE}: Terminating (cause = OSMO_FSM_TERM_PARENT) +DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_DONE}: Removing from parent Subscr_Conn(901700000004620) +DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_DONE}: fsm_lu_cleanup called with cause OSMO_FSM_TERM_PARENT +DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_DONE}: Freeing instance +DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_DONE}: Deallocated +DMM msc_subscr_conn_close(vsub=MSISDN:46071, cause=2): no conn fsm, releasing directly without release event. +- BSSAP Clear --RAN_GERAN_A--> MS +DREF MSISDN:46071: MSC conn use - 1 == 1 +DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_RELEASED}: Freeing instance +DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_RELEASED}: Deallocated +DREF MSISDN:46071: MSC conn use - 1 == 0 +DRLL subscr MSISDN:46071: Freeing subscriber connection +DREF VLR subscr MSISDN:46071 usage decreases to: 1 + bssap_clear_sent == 1 +- LU was successful, and the conn has already been closed + lu_result_sent == 1 + llist_count(&net->subscr_conns) == 0 +- Subscriber has the IMEI +DREF VLR subscr MSISDN:46071 usage increases to: 2 + strcmp(vsub->imei, "423423423423420") == 0 +DREF VLR subscr MSISDN:46071 usage decreases to: 1 +--- +- subscriber detaches + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_IMSI_DETACH_IND + new conn +DREF unknown: MSC conn use + 1 == 1 +DRLL Dispatching 04.08 message GSM48_MT_MM_IMSI_DETACH_IND (0x5:0x1) +DMM IMSI DETACH INDICATION: MI(IMSI)=901700000004620 +DREF VLR subscr MSISDN:46071 usage increases to: 2 +DMM IMSI DETACH for MSISDN:46071 +DREF VLR subscr MSISDN:46071 usage decreases to: 1 +DREF VLR subscr MSISDN:46071 usage decreases to: 0 +DREF freeing VLR subscr MSISDN:46071 +DMM msc_subscr_conn_close(vsub=unknown, cause=0): no conn fsm, releasing directly without release event. +- BSSAP Clear --RAN_GERAN_A--> MS +DREF unknown: MSC conn use - 1 == 0 +DRLL Freeing subscriber connection with NULL subscriber + bssap_clear_sent == 1 + llist_count(&net->subscr_conns) == 0 +===== test_no_authen_imeisv_imei: SUCCESS + +full talloc report on 'msgb' (total 0 bytes in 1 blocks) +talloc_total_blocks(tall_bsc_ctx) == 9 + +===== test_no_authen_imeisv_tmsi +- Location Update request causes an IMEISV ID request back to the MS + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_LOC_UPD_REQUEST + new conn +DREF unknown: MSC conn use + 1 == 1 +DRLL Dispatching 04.08 message GSM48_MT_MM_LOC_UPD_REQUEST (0x5:0x8) +DREF unknown: MSC conn use + 1 == 2 +DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Allocated +DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Received Event SUBSCR_CONN_E_START +DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: state_chg to SUBSCR_CONN_S_NEW +DMM LOCATION UPDATING REQUEST: MI(IMSI)=901700000004620 type=IMSI ATTACH +DMM LU/new-LAC: 1/0 +DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_IDLE}: Allocated +DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_IDLE}: is child of Subscr_Conn(901700000004620) +DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_IDLE}: rev=GSM net=GERAN (no Auth) +DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_IDLE}: Received Event VLR_ULA_E_UPDATE_LA +DREF VLR subscr unknown usage increases to: 1 +DVLR set IMSI on subscriber; IMSI=901700000004620 id=901700000004620 +DVLR New subscr, IMSI: 901700000004620 +DREF VLR subscr IMSI:901700000004620 usage increases to: 2 +DREF VLR subscr IMSI:901700000004620 usage decreases to: 1 +DMSC msc_tx 3 bytes to IMSI:901700000004620 via RAN_GERAN_A +- DTAP --RAN_GERAN_A--> MS: GSM48_MT_MM_ID_REQ: 051803 +- DTAP matches expected message +DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_IDLE}: state_chg to VLR_ULA_S_WAIT_IMEISV +DMM IMSI:901700000004620: bump: conn still being established (SUBSCR_CONN_S_NEW) +DREF IMSI:901700000004620: MSC conn use - 1 == 1 +- MS replies with an Identity Response, causes LU to commence with a GSUP LU request to HLR + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_ID_RESP +DREF IMSI:901700000004620: MSC conn use + 1 == 2 +DRLL Dispatching 04.08 message GSM48_MT_MM_ID_RESP (0x5:0x19) +DMM IDENTITY RESPONSE: MI(IMEI-SV)=4234234234234275 +DVLR set IMEISV on subscriber; IMSI=901700000004620 IMEISV=4234234234234275 +DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_WAIT_IMEISV}: Received Event VLR_ULA_E_ID_IMEISV +DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_WAIT_IMEISV}: vlr_loc_upd_node1() +DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_WAIT_IMEISV}: vlr_loc_upd_post_auth() +DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_WAIT_IMEISV}: vlr_loc_upd_post_ciph() +DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_WAIT_IMEISV}: vlr_loc_upd_node_4() +DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_WAIT_IMEISV}: state_chg to VLR_ULA_S_WAIT_HLR_UPD +DVLR upd_hlr_vlr_fsm(901700000004620){UPD_HLR_VLR_S_INIT}: Allocated +DVLR upd_hlr_vlr_fsm(901700000004620){UPD_HLR_VLR_S_INIT}: is child of vlr_lu_fsm(901700000004620) +DVLR upd_hlr_vlr_fsm(901700000004620){UPD_HLR_VLR_S_INIT}: Received Event UPD_HLR_VLR_E_START +DVLR GSUP tx: 04010809710000004026f0 +GSUP --> HLR: OSMO_GSUP_MSGT_UPDATE_LOCATION_REQUEST: 04010809710000004026f0 +DVLR upd_hlr_vlr_fsm(901700000004620){UPD_HLR_VLR_S_INIT}: state_chg to UPD_HLR_VLR_S_WAIT_FOR_DATA +DMM IMSI:901700000004620: bump: conn still being established (SUBSCR_CONN_S_NEW) +DREF IMSI:901700000004620: MSC conn use - 1 == 1 + lu_result_sent == 0 +- Subscriber has the IMEISV from the ID Response +DREF VLR subscr IMSI:901700000004620 usage increases to: 2 + strcmp(vsub->imeisv, "4234234234234275") == 0 +DREF VLR subscr IMSI:901700000004620 usage decreases to: 1 +- HLR sends _INSERT_DATA_REQUEST, VLR responds with _INSERT_DATA_RESULT +<-- GSUP rx OSMO_GSUP_MSGT_INSERT_DATA_REQUEST: 10010809710000004026f00804036470f1 +DVLR GSUP rx 17: 10010809710000004026f00804036470f1 +DREF VLR subscr IMSI:901700000004620 usage increases to: 2 +DVLR IMSI:901700000004620 has MSISDN:46071 +DVLR GSUP tx: 12010809710000004026f0 +GSUP --> HLR: OSMO_GSUP_MSGT_INSERT_DATA_RESULT: 12010809710000004026f0 +DREF VLR subscr MSISDN:46071 usage decreases to: 1 +<-- GSUP rx OSMO_GSUP_MSGT_INSERT_DATA_REQUEST: vlr_gsupc_read_cb() returns 0 + lu_result_sent == 0 +- having received subscriber data does not mean acceptance +msc_subscr_conn_is_accepted() == false + requests shall be thwarted +DRLL Dispatching 04.08 message GSM48_MT_CC_SETUP (0x3:0x5) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_MT_CC_SETUP +DRLL Dispatching 04.08 message unknown 0x33 (0x5:0x33) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: unknown 0x33 +DRLL Dispatching 04.08 message GSM48_MT_RR_SYSINFO_1 (0x6:0x19) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_MT_RR_SYSINFO_1 +DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_PDISC_SMS:0x01 + lu_result_sent == 0 +- HLR also sends GSUP _UPDATE_LOCATION_RESULT +<-- GSUP rx OSMO_GSUP_MSGT_UPDATE_LOCATION_RESULT: 06010809710000004026f0 +DVLR GSUP rx 11: 06010809710000004026f0 +DREF VLR subscr MSISDN:46071 usage increases to: 2 +DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_WAIT_HLR_UPD}: Received Event VLR_ULA_E_HLR_LU_RES +DVLR upd_hlr_vlr_fsm(901700000004620){UPD_HLR_VLR_S_WAIT_FOR_DATA}: Received Event UPD_HLR_VLR_E_UPD_LOC_ACK +DVLR upd_hlr_vlr_fsm(901700000004620){UPD_HLR_VLR_S_WAIT_FOR_DATA}: state_chg to UPD_HLR_VLR_S_DONE +DVLR upd_hlr_vlr_fsm(901700000004620){UPD_HLR_VLR_S_DONE}: Terminating (cause = OSMO_FSM_TERM_REGULAR) +DVLR upd_hlr_vlr_fsm(901700000004620){UPD_HLR_VLR_S_DONE}: Removing from parent vlr_lu_fsm(901700000004620) +DVLR upd_hlr_vlr_fsm(901700000004620){UPD_HLR_VLR_S_DONE}: Freeing instance +DVLR upd_hlr_vlr_fsm(901700000004620){UPD_HLR_VLR_S_DONE}: Deallocated +DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_WAIT_HLR_UPD}: Received Event VLR_ULA_E_UPD_HLR_COMPL +DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_WAIT_HLR_UPD}: state_chg to VLR_ULA_S_WAIT_LU_COMPL +DVLR lu_compl_vlr_fsm(901700000004620){LU_COMPL_VLR_S_INIT}: Allocated +DVLR lu_compl_vlr_fsm(901700000004620){LU_COMPL_VLR_S_INIT}: is child of vlr_lu_fsm(901700000004620) +DVLR lu_compl_vlr_fsm(901700000004620){LU_COMPL_VLR_S_INIT}: Received Event LU_COMPL_VLR_E_START +DVLR lu_compl_vlr_fsm(901700000004620){LU_COMPL_VLR_S_INIT}: state_chg to LU_COMPL_VLR_S_WAIT_SUB_PRES +DVLR sub_pres_vlr_fsm(901700000004620){SUB_PRES_VLR_S_INIT}: Allocated +DVLR sub_pres_vlr_fsm(901700000004620){SUB_PRES_VLR_S_INIT}: is child of lu_compl_vlr_fsm(901700000004620) +DVLR sub_pres_vlr_fsm(901700000004620){SUB_PRES_VLR_S_INIT}: Received Event SUB_PRES_VLR_E_START +DVLR sub_pres_vlr_fsm(901700000004620){SUB_PRES_VLR_S_INIT}: state_chg to SUB_PRES_VLR_S_DONE +DVLR sub_pres_vlr_fsm(901700000004620){SUB_PRES_VLR_S_DONE}: Terminating (cause = OSMO_FSM_TERM_REGULAR) +DVLR sub_pres_vlr_fsm(901700000004620){SUB_PRES_VLR_S_DONE}: Removing from parent lu_compl_vlr_fsm(901700000004620) +DVLR sub_pres_vlr_fsm(901700000004620){SUB_PRES_VLR_S_DONE}: Freeing instance +DVLR sub_pres_vlr_fsm(901700000004620){SUB_PRES_VLR_S_DONE}: Deallocated +DVLR lu_compl_vlr_fsm(901700000004620){LU_COMPL_VLR_S_WAIT_SUB_PRES}: Received Event LU_COMPL_VLR_E_SUB_PRES_COMPL +DVLR lu_compl_vlr_fsm(901700000004620){LU_COMPL_VLR_S_WAIT_SUB_PRES}: lu_compl_vlr_new_tmsi() +DVLR lu_compl_vlr_fsm(901700000004620){LU_COMPL_VLR_S_WAIT_SUB_PRES}: state_chg to LU_COMPL_VLR_S_WAIT_TMSI_CNF +- sending LU Accept for MSISDN:46071, with TMSI 0x03020100 +DREF VLR subscr MSISDN:46071 usage decreases to: 1 +<-- GSUP rx OSMO_GSUP_MSGT_UPDATE_LOCATION_RESULT: vlr_gsupc_read_cb() returns 0 +- a LU Accept with a new TMSI was sent, waiting for TMSI Realloc Compl + llist_count(&net->subscr_conns) == 1 + lu_result_sent == 1 +msc_subscr_conn_is_accepted() == false + requests shall be thwarted +DRLL Dispatching 04.08 message GSM48_MT_CC_SETUP (0x3:0x5) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_MT_CC_SETUP +DRLL Dispatching 04.08 message unknown 0x33 (0x5:0x33) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: unknown 0x33 +DRLL Dispatching 04.08 message GSM48_MT_RR_SYSINFO_1 (0x6:0x19) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_MT_RR_SYSINFO_1 +DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_PDISC_SMS:0x01 +- even though the TMSI is not acked, we can already find the subscr with it +DREF VLR subscr MSISDN:46071 usage increases to: 2 + vsub != NULL == 1 + strcmp(vsub->imsi, imsi) == 0 + vsub->tmsi_new == 0x03020100 + vsub->tmsi == 0xffffffff +DREF VLR subscr MSISDN:46071 usage decreases to: 1 +- MS sends TMSI Realloc Complete + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_TMSI_REALL_COMPL +DREF MSISDN:46071: MSC conn use + 1 == 2 +DRLL Dispatching 04.08 message GSM48_MT_MM_TMSI_REALL_COMPL (0x5:0x1b) +DMM TMSI Reallocation Completed. Subscriber: MSISDN:46071 +DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_WAIT_LU_COMPL}: Received Event VLR_ULA_E_NEW_TMSI_ACK +DVLR lu_compl_vlr_fsm(901700000004620){LU_COMPL_VLR_S_WAIT_TMSI_CNF}: Received Event LU_COMPL_VLR_E_NEW_TMSI_ACK +DREF VLR subscr MSISDN:46071 usage increases to: 2 +DVLR lu_compl_vlr_fsm(901700000004620){LU_COMPL_VLR_S_WAIT_TMSI_CNF}: state_chg to LU_COMPL_VLR_S_DONE +DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_WAIT_LU_COMPL}: Received Event VLR_ULA_E_LU_COMPL_SUCCESS +DVLR lu_compl_vlr_fsm(901700000004620){LU_COMPL_VLR_S_DONE}: Terminating (cause = OSMO_FSM_TERM_PARENT) +DVLR lu_compl_vlr_fsm(901700000004620){LU_COMPL_VLR_S_DONE}: Removing from parent vlr_lu_fsm(901700000004620) +DVLR lu_compl_vlr_fsm(901700000004620){LU_COMPL_VLR_S_DONE}: Freeing instance +DVLR lu_compl_vlr_fsm(901700000004620){LU_COMPL_VLR_S_DONE}: Deallocated +DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_WAIT_LU_COMPL}: state_chg to VLR_ULA_S_DONE +DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_NEW}: Received Event SUBSCR_CONN_E_ACCEPTED +DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_NEW}: SUBSCR_CONN_FROM_LU +DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_NEW}: state_chg to SUBSCR_CONN_S_ACCEPTED +DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_BUMP +DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_ACCEPTED}: bump: releasing conn +DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_ACCEPTED}: state_chg to SUBSCR_CONN_S_RELEASED +DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_RELEASED}: Terminating (cause = OSMO_FSM_TERM_REGULAR) +DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_DONE}: Terminating (cause = OSMO_FSM_TERM_PARENT) +DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_DONE}: Removing from parent Subscr_Conn(901700000004620) +DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_DONE}: fsm_lu_cleanup called with cause OSMO_FSM_TERM_PARENT +DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_DONE}: Freeing instance +DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_DONE}: Deallocated +DMM msc_subscr_conn_close(vsub=MSISDN:46071, cause=2): no conn fsm, releasing directly without release event. +- BSSAP Clear --RAN_GERAN_A--> MS +DREF MSISDN:46071: MSC conn use - 1 == 1 +DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_RELEASED}: Freeing instance +DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_RELEASED}: Deallocated +DREF MSISDN:46071: MSC conn use - 1 == 0 +DRLL subscr MSISDN:46071: Freeing subscriber connection +DREF VLR subscr MSISDN:46071 usage decreases to: 1 + bssap_clear_sent == 1 +- LU was successful, and the conn has already been closed + llist_count(&net->subscr_conns) == 0 +--- +- subscriber sends LU Request, this time with the TMSI +- Location Update request causes an IMEISV ID request back to the MS + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_LOC_UPD_REQUEST + new conn +DREF unknown: MSC conn use + 1 == 1 +DRLL Dispatching 04.08 message GSM48_MT_MM_LOC_UPD_REQUEST (0x5:0x8) +DREF unknown: MSC conn use + 1 == 2 +DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Allocated +DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Received Event SUBSCR_CONN_E_START +DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: state_chg to SUBSCR_CONN_S_NEW +DMM LOCATION UPDATING REQUEST: MI(IMSI)=901700000004620 type=IMSI ATTACH +DMM LU/new-LAC: 1/0 +DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_IDLE}: Allocated +DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_IDLE}: is child of Subscr_Conn(901700000004620) +DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_IDLE}: rev=GSM net=GERAN (no Auth) +DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_IDLE}: Received Event VLR_ULA_E_UPDATE_LA +DREF VLR subscr MSISDN:46071 usage increases to: 2 +DREF VLR subscr MSISDN:46071 usage increases to: 3 +DREF VLR subscr MSISDN:46071 usage decreases to: 2 +DMSC msc_tx 3 bytes to MSISDN:46071 via RAN_GERAN_A +- DTAP --RAN_GERAN_A--> MS: GSM48_MT_MM_ID_REQ: 051803 +- DTAP matches expected message +DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_IDLE}: state_chg to VLR_ULA_S_WAIT_IMEISV +DMM MSISDN:46071: bump: conn still being established (SUBSCR_CONN_S_NEW) +DREF MSISDN:46071: MSC conn use - 1 == 1 +- MS replies with an Identity Response, causes LU to commence with a GSUP LU request to HLR + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_ID_RESP +DREF MSISDN:46071: MSC conn use + 1 == 2 +DRLL Dispatching 04.08 message GSM48_MT_MM_ID_RESP (0x5:0x19) +DMM IDENTITY RESPONSE: MI(IMEI-SV)=5234234234234276 +DVLR set IMEISV on subscriber; IMSI=901700000004620 IMEISV=5234234234234276 +DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_WAIT_IMEISV}: Received Event VLR_ULA_E_ID_IMEISV +DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_WAIT_IMEISV}: vlr_loc_upd_node1() +DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_WAIT_IMEISV}: vlr_loc_upd_post_auth() +DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_WAIT_IMEISV}: vlr_loc_upd_post_ciph() +DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_WAIT_IMEISV}: vlr_loc_upd_node_4() +DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_WAIT_IMEISV}: state_chg to VLR_ULA_S_WAIT_HLR_UPD +DVLR upd_hlr_vlr_fsm(901700000004620){UPD_HLR_VLR_S_INIT}: Allocated +DVLR upd_hlr_vlr_fsm(901700000004620){UPD_HLR_VLR_S_INIT}: is child of vlr_lu_fsm(901700000004620) +DVLR upd_hlr_vlr_fsm(901700000004620){UPD_HLR_VLR_S_INIT}: Received Event UPD_HLR_VLR_E_START +DVLR GSUP tx: 04010809710000004026f0 +GSUP --> HLR: OSMO_GSUP_MSGT_UPDATE_LOCATION_REQUEST: 04010809710000004026f0 +DVLR upd_hlr_vlr_fsm(901700000004620){UPD_HLR_VLR_S_INIT}: state_chg to UPD_HLR_VLR_S_WAIT_FOR_DATA +DMM MSISDN:46071: bump: conn still being established (SUBSCR_CONN_S_NEW) +DREF MSISDN:46071: MSC conn use - 1 == 1 + lu_result_sent == 0 +- Subscriber has the IMEISV from the ID Response +DREF VLR subscr MSISDN:46071 usage increases to: 3 + strcmp(vsub->imeisv, "5234234234234276") == 0 +DREF VLR subscr MSISDN:46071 usage decreases to: 2 +- HLR sends _INSERT_DATA_REQUEST, VLR responds with _INSERT_DATA_RESULT +<-- GSUP rx OSMO_GSUP_MSGT_INSERT_DATA_REQUEST: 10010809710000004026f00804036470f1 +DVLR GSUP rx 17: 10010809710000004026f00804036470f1 +DREF VLR subscr MSISDN:46071 usage increases to: 3 +DVLR IMSI:901700000004620 has MSISDN:46071 +DVLR GSUP tx: 12010809710000004026f0 +GSUP --> HLR: OSMO_GSUP_MSGT_INSERT_DATA_RESULT: 12010809710000004026f0 +DREF VLR subscr MSISDN:46071 usage decreases to: 2 +<-- GSUP rx OSMO_GSUP_MSGT_INSERT_DATA_REQUEST: vlr_gsupc_read_cb() returns 0 + lu_result_sent == 0 +- having received subscriber data does not mean acceptance +msc_subscr_conn_is_accepted() == false + requests shall be thwarted +DRLL Dispatching 04.08 message GSM48_MT_CC_SETUP (0x3:0x5) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_MT_CC_SETUP +DRLL Dispatching 04.08 message unknown 0x33 (0x5:0x33) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: unknown 0x33 +DRLL Dispatching 04.08 message GSM48_MT_RR_SYSINFO_1 (0x6:0x19) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_MT_RR_SYSINFO_1 +DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_PDISC_SMS:0x01 + lu_result_sent == 0 +- HLR also sends GSUP _UPDATE_LOCATION_RESULT +<-- GSUP rx OSMO_GSUP_MSGT_UPDATE_LOCATION_RESULT: 06010809710000004026f0 +DVLR GSUP rx 11: 06010809710000004026f0 +DREF VLR subscr MSISDN:46071 usage increases to: 3 +DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_WAIT_HLR_UPD}: Received Event VLR_ULA_E_HLR_LU_RES +DVLR upd_hlr_vlr_fsm(901700000004620){UPD_HLR_VLR_S_WAIT_FOR_DATA}: Received Event UPD_HLR_VLR_E_UPD_LOC_ACK +DVLR upd_hlr_vlr_fsm(901700000004620){UPD_HLR_VLR_S_WAIT_FOR_DATA}: state_chg to UPD_HLR_VLR_S_DONE +DVLR upd_hlr_vlr_fsm(901700000004620){UPD_HLR_VLR_S_DONE}: Terminating (cause = OSMO_FSM_TERM_REGULAR) +DVLR upd_hlr_vlr_fsm(901700000004620){UPD_HLR_VLR_S_DONE}: Removing from parent vlr_lu_fsm(901700000004620) +DVLR upd_hlr_vlr_fsm(901700000004620){UPD_HLR_VLR_S_DONE}: Freeing instance +DVLR upd_hlr_vlr_fsm(901700000004620){UPD_HLR_VLR_S_DONE}: Deallocated +DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_WAIT_HLR_UPD}: Received Event VLR_ULA_E_UPD_HLR_COMPL +DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_WAIT_HLR_UPD}: state_chg to VLR_ULA_S_WAIT_LU_COMPL +DVLR lu_compl_vlr_fsm(901700000004620){LU_COMPL_VLR_S_INIT}: Allocated +DVLR lu_compl_vlr_fsm(901700000004620){LU_COMPL_VLR_S_INIT}: is child of vlr_lu_fsm(901700000004620) +DVLR lu_compl_vlr_fsm(901700000004620){LU_COMPL_VLR_S_INIT}: Received Event LU_COMPL_VLR_E_START +DVLR lu_compl_vlr_fsm(901700000004620){LU_COMPL_VLR_S_INIT}: state_chg to LU_COMPL_VLR_S_WAIT_SUB_PRES +DVLR sub_pres_vlr_fsm(901700000004620){SUB_PRES_VLR_S_INIT}: Allocated +DVLR sub_pres_vlr_fsm(901700000004620){SUB_PRES_VLR_S_INIT}: is child of lu_compl_vlr_fsm(901700000004620) +DVLR sub_pres_vlr_fsm(901700000004620){SUB_PRES_VLR_S_INIT}: Received Event SUB_PRES_VLR_E_START +DVLR sub_pres_vlr_fsm(901700000004620){SUB_PRES_VLR_S_INIT}: state_chg to SUB_PRES_VLR_S_DONE +DVLR sub_pres_vlr_fsm(901700000004620){SUB_PRES_VLR_S_DONE}: Terminating (cause = OSMO_FSM_TERM_REGULAR) +DVLR sub_pres_vlr_fsm(901700000004620){SUB_PRES_VLR_S_DONE}: Removing from parent lu_compl_vlr_fsm(901700000004620) +DVLR sub_pres_vlr_fsm(901700000004620){SUB_PRES_VLR_S_DONE}: Freeing instance +DVLR sub_pres_vlr_fsm(901700000004620){SUB_PRES_VLR_S_DONE}: Deallocated +DVLR lu_compl_vlr_fsm(901700000004620){LU_COMPL_VLR_S_WAIT_SUB_PRES}: Received Event LU_COMPL_VLR_E_SUB_PRES_COMPL +DVLR lu_compl_vlr_fsm(901700000004620){LU_COMPL_VLR_S_WAIT_SUB_PRES}: lu_compl_vlr_new_tmsi() +DVLR lu_compl_vlr_fsm(901700000004620){LU_COMPL_VLR_S_WAIT_SUB_PRES}: state_chg to LU_COMPL_VLR_S_WAIT_TMSI_CNF +- sending LU Accept for MSISDN:46071, with TMSI 0x07060504 +DREF VLR subscr MSISDN:46071 usage decreases to: 2 +<-- GSUP rx OSMO_GSUP_MSGT_UPDATE_LOCATION_RESULT: vlr_gsupc_read_cb() returns 0 +- a LU Accept with a new TMSI was sent, waiting for TMSI Realloc Compl + llist_count(&net->subscr_conns) == 1 + lu_result_sent == 1 +msc_subscr_conn_is_accepted() == false + requests shall be thwarted +DRLL Dispatching 04.08 message GSM48_MT_CC_SETUP (0x3:0x5) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_MT_CC_SETUP +DRLL Dispatching 04.08 message unknown 0x33 (0x5:0x33) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: unknown 0x33 +DRLL Dispatching 04.08 message GSM48_MT_RR_SYSINFO_1 (0x6:0x19) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_MT_RR_SYSINFO_1 +DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_PDISC_SMS:0x01 +- even though the TMSI is not acked, we can already find the subscr with it +DREF VLR subscr MSISDN:46071 usage increases to: 3 + vsub != NULL == 1 + strcmp(vsub->imsi, imsi) == 0 + vsub->tmsi_new == 0x07060504 + vsub->tmsi == 0x03020100 +DREF VLR subscr MSISDN:46071 usage decreases to: 2 +- MS sends TMSI Realloc Complete + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_TMSI_REALL_COMPL +DREF MSISDN:46071: MSC conn use + 1 == 2 +DRLL Dispatching 04.08 message GSM48_MT_MM_TMSI_REALL_COMPL (0x5:0x1b) +DMM TMSI Reallocation Completed. Subscriber: MSISDN:46071 +DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_WAIT_LU_COMPL}: Received Event VLR_ULA_E_NEW_TMSI_ACK +DVLR lu_compl_vlr_fsm(901700000004620){LU_COMPL_VLR_S_WAIT_TMSI_CNF}: Received Event LU_COMPL_VLR_E_NEW_TMSI_ACK +DVLR lu_compl_vlr_fsm(901700000004620){LU_COMPL_VLR_S_WAIT_TMSI_CNF}: state_chg to LU_COMPL_VLR_S_DONE +DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_WAIT_LU_COMPL}: Received Event VLR_ULA_E_LU_COMPL_SUCCESS +DVLR lu_compl_vlr_fsm(901700000004620){LU_COMPL_VLR_S_DONE}: Terminating (cause = OSMO_FSM_TERM_PARENT) +DVLR lu_compl_vlr_fsm(901700000004620){LU_COMPL_VLR_S_DONE}: Removing from parent vlr_lu_fsm(901700000004620) +DVLR lu_compl_vlr_fsm(901700000004620){LU_COMPL_VLR_S_DONE}: Freeing instance +DVLR lu_compl_vlr_fsm(901700000004620){LU_COMPL_VLR_S_DONE}: Deallocated +DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_WAIT_LU_COMPL}: state_chg to VLR_ULA_S_DONE +DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_NEW}: Received Event SUBSCR_CONN_E_ACCEPTED +DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_NEW}: SUBSCR_CONN_FROM_LU +DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_NEW}: state_chg to SUBSCR_CONN_S_ACCEPTED +DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_BUMP +DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_ACCEPTED}: bump: releasing conn +DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_ACCEPTED}: state_chg to SUBSCR_CONN_S_RELEASED +DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_RELEASED}: Terminating (cause = OSMO_FSM_TERM_REGULAR) +DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_DONE}: Terminating (cause = OSMO_FSM_TERM_PARENT) +DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_DONE}: Removing from parent Subscr_Conn(901700000004620) +DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_DONE}: fsm_lu_cleanup called with cause OSMO_FSM_TERM_PARENT +DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_DONE}: Freeing instance +DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_DONE}: Deallocated +DMM msc_subscr_conn_close(vsub=MSISDN:46071, cause=2): no conn fsm, releasing directly without release event. +- BSSAP Clear --RAN_GERAN_A--> MS +DREF MSISDN:46071: MSC conn use - 1 == 1 +DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_RELEASED}: Freeing instance +DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_RELEASED}: Deallocated +DREF MSISDN:46071: MSC conn use - 1 == 0 +DRLL subscr MSISDN:46071: Freeing subscriber connection +DREF VLR subscr MSISDN:46071 usage decreases to: 1 + bssap_clear_sent == 1 +- LU was successful, and the conn has already been closed + llist_count(&net->subscr_conns) == 0 +- subscriber has the new TMSI +DREF VLR subscr MSISDN:46071 usage increases to: 2 + vsub != NULL == 1 + strcmp(vsub->imsi, imsi) == 0 + vsub->tmsi_new == 0xffffffff + vsub->tmsi == 0x07060504 +DREF VLR subscr MSISDN:46071 usage decreases to: 1 +--- +- subscriber detaches, using new TMSI + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_IMSI_DETACH_IND + new conn +DREF unknown: MSC conn use + 1 == 1 +DRLL Dispatching 04.08 message GSM48_MT_MM_IMSI_DETACH_IND (0x5:0x1) +DMM IMSI DETACH INDICATION: MI(TMSI)=117835012 +DREF VLR subscr MSISDN:46071 usage increases to: 2 +DMM IMSI DETACH for MSISDN:46071 +DREF VLR subscr MSISDN:46071 usage decreases to: 1 +DREF VLR subscr MSISDN:46071 usage decreases to: 0 +DREF freeing VLR subscr MSISDN:46071 +DMM msc_subscr_conn_close(vsub=unknown, cause=0): no conn fsm, releasing directly without release event. +- BSSAP Clear --RAN_GERAN_A--> MS +DREF unknown: MSC conn use - 1 == 0 +DRLL Freeing subscriber connection with NULL subscriber + bssap_clear_sent == 1 + llist_count(&net->subscr_conns) == 0 +===== test_no_authen_imeisv_tmsi: SUCCESS + +full talloc report on 'msgb' (total 0 bytes in 1 blocks) +talloc_total_blocks(tall_bsc_ctx) == 9 + +===== test_no_authen_imeisv_tmsi_imei +- Location Update request causes an IMEISV ID request back to the MS + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_LOC_UPD_REQUEST + new conn +DREF unknown: MSC conn use + 1 == 1 +DRLL Dispatching 04.08 message GSM48_MT_MM_LOC_UPD_REQUEST (0x5:0x8) +DREF unknown: MSC conn use + 1 == 2 +DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Allocated +DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Received Event SUBSCR_CONN_E_START +DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: state_chg to SUBSCR_CONN_S_NEW +DMM LOCATION UPDATING REQUEST: MI(IMSI)=901700000004620 type=IMSI ATTACH +DMM LU/new-LAC: 1/0 +DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_IDLE}: Allocated +DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_IDLE}: is child of Subscr_Conn(901700000004620) +DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_IDLE}: rev=GSM net=GERAN (no Auth) +DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_IDLE}: Received Event VLR_ULA_E_UPDATE_LA +DREF VLR subscr unknown usage increases to: 1 +DVLR set IMSI on subscriber; IMSI=901700000004620 id=901700000004620 +DVLR New subscr, IMSI: 901700000004620 +DREF VLR subscr IMSI:901700000004620 usage increases to: 2 +DREF VLR subscr IMSI:901700000004620 usage decreases to: 1 +DMSC msc_tx 3 bytes to IMSI:901700000004620 via RAN_GERAN_A +- DTAP --RAN_GERAN_A--> MS: GSM48_MT_MM_ID_REQ: 051803 +- DTAP matches expected message +DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_IDLE}: state_chg to VLR_ULA_S_WAIT_IMEISV +DMM IMSI:901700000004620: bump: conn still being established (SUBSCR_CONN_S_NEW) +DREF IMSI:901700000004620: MSC conn use - 1 == 1 +- MS replies with an Identity Response, causes LU to commence with a GSUP LU request to HLR + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_ID_RESP +DREF IMSI:901700000004620: MSC conn use + 1 == 2 +DRLL Dispatching 04.08 message GSM48_MT_MM_ID_RESP (0x5:0x19) +DMM IDENTITY RESPONSE: MI(IMEI-SV)=4234234234234275 +DVLR set IMEISV on subscriber; IMSI=901700000004620 IMEISV=4234234234234275 +DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_WAIT_IMEISV}: Received Event VLR_ULA_E_ID_IMEISV +DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_WAIT_IMEISV}: vlr_loc_upd_node1() +DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_WAIT_IMEISV}: vlr_loc_upd_post_auth() +DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_WAIT_IMEISV}: vlr_loc_upd_post_ciph() +DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_WAIT_IMEISV}: vlr_loc_upd_node_4() +DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_WAIT_IMEISV}: state_chg to VLR_ULA_S_WAIT_HLR_UPD +DVLR upd_hlr_vlr_fsm(901700000004620){UPD_HLR_VLR_S_INIT}: Allocated +DVLR upd_hlr_vlr_fsm(901700000004620){UPD_HLR_VLR_S_INIT}: is child of vlr_lu_fsm(901700000004620) +DVLR upd_hlr_vlr_fsm(901700000004620){UPD_HLR_VLR_S_INIT}: Received Event UPD_HLR_VLR_E_START +DVLR GSUP tx: 04010809710000004026f0 +GSUP --> HLR: OSMO_GSUP_MSGT_UPDATE_LOCATION_REQUEST: 04010809710000004026f0 +DVLR upd_hlr_vlr_fsm(901700000004620){UPD_HLR_VLR_S_INIT}: state_chg to UPD_HLR_VLR_S_WAIT_FOR_DATA +DMM IMSI:901700000004620: bump: conn still being established (SUBSCR_CONN_S_NEW) +DREF IMSI:901700000004620: MSC conn use - 1 == 1 + lu_result_sent == 0 +- Subscriber has the IMEISV from the ID Response +DREF VLR subscr IMSI:901700000004620 usage increases to: 2 + strcmp(vsub->imeisv, "4234234234234275") == 0 +DREF VLR subscr IMSI:901700000004620 usage decreases to: 1 +- HLR sends _INSERT_DATA_REQUEST, VLR responds with _INSERT_DATA_RESULT +<-- GSUP rx OSMO_GSUP_MSGT_INSERT_DATA_REQUEST: 10010809710000004026f00804036470f1 +DVLR GSUP rx 17: 10010809710000004026f00804036470f1 +DREF VLR subscr IMSI:901700000004620 usage increases to: 2 +DVLR IMSI:901700000004620 has MSISDN:46071 +DVLR GSUP tx: 12010809710000004026f0 +GSUP --> HLR: OSMO_GSUP_MSGT_INSERT_DATA_RESULT: 12010809710000004026f0 +DREF VLR subscr MSISDN:46071 usage decreases to: 1 +<-- GSUP rx OSMO_GSUP_MSGT_INSERT_DATA_REQUEST: vlr_gsupc_read_cb() returns 0 + lu_result_sent == 0 +- having received subscriber data does not mean acceptance +msc_subscr_conn_is_accepted() == false + requests shall be thwarted +DRLL Dispatching 04.08 message GSM48_MT_CC_SETUP (0x3:0x5) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_MT_CC_SETUP +DRLL Dispatching 04.08 message unknown 0x33 (0x5:0x33) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: unknown 0x33 +DRLL Dispatching 04.08 message GSM48_MT_RR_SYSINFO_1 (0x6:0x19) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_MT_RR_SYSINFO_1 +DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_PDISC_SMS:0x01 + lu_result_sent == 0 +- HLR also sends GSUP _UPDATE_LOCATION_RESULT, and we send an ID Request for the IMEI to the MS +<-- GSUP rx OSMO_GSUP_MSGT_UPDATE_LOCATION_RESULT: 06010809710000004026f0 +DVLR GSUP rx 11: 06010809710000004026f0 +DREF VLR subscr MSISDN:46071 usage increases to: 2 +DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_WAIT_HLR_UPD}: Received Event VLR_ULA_E_HLR_LU_RES +DVLR upd_hlr_vlr_fsm(901700000004620){UPD_HLR_VLR_S_WAIT_FOR_DATA}: Received Event UPD_HLR_VLR_E_UPD_LOC_ACK +DVLR upd_hlr_vlr_fsm(901700000004620){UPD_HLR_VLR_S_WAIT_FOR_DATA}: state_chg to UPD_HLR_VLR_S_DONE +DVLR upd_hlr_vlr_fsm(901700000004620){UPD_HLR_VLR_S_DONE}: Terminating (cause = OSMO_FSM_TERM_REGULAR) +DVLR upd_hlr_vlr_fsm(901700000004620){UPD_HLR_VLR_S_DONE}: Removing from parent vlr_lu_fsm(901700000004620) +DVLR upd_hlr_vlr_fsm(901700000004620){UPD_HLR_VLR_S_DONE}: Freeing instance +DVLR upd_hlr_vlr_fsm(901700000004620){UPD_HLR_VLR_S_DONE}: Deallocated +DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_WAIT_HLR_UPD}: Received Event VLR_ULA_E_UPD_HLR_COMPL +DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_WAIT_HLR_UPD}: state_chg to VLR_ULA_S_WAIT_LU_COMPL +DVLR lu_compl_vlr_fsm(901700000004620){LU_COMPL_VLR_S_INIT}: Allocated +DVLR lu_compl_vlr_fsm(901700000004620){LU_COMPL_VLR_S_INIT}: is child of vlr_lu_fsm(901700000004620) +DVLR lu_compl_vlr_fsm(901700000004620){LU_COMPL_VLR_S_INIT}: Received Event LU_COMPL_VLR_E_START +DVLR lu_compl_vlr_fsm(901700000004620){LU_COMPL_VLR_S_INIT}: state_chg to LU_COMPL_VLR_S_WAIT_SUB_PRES +DVLR sub_pres_vlr_fsm(901700000004620){SUB_PRES_VLR_S_INIT}: Allocated +DVLR sub_pres_vlr_fsm(901700000004620){SUB_PRES_VLR_S_INIT}: is child of lu_compl_vlr_fsm(901700000004620) +DVLR sub_pres_vlr_fsm(901700000004620){SUB_PRES_VLR_S_INIT}: Received Event SUB_PRES_VLR_E_START +DVLR sub_pres_vlr_fsm(901700000004620){SUB_PRES_VLR_S_INIT}: state_chg to SUB_PRES_VLR_S_DONE +DVLR sub_pres_vlr_fsm(901700000004620){SUB_PRES_VLR_S_DONE}: Terminating (cause = OSMO_FSM_TERM_REGULAR) +DVLR sub_pres_vlr_fsm(901700000004620){SUB_PRES_VLR_S_DONE}: Removing from parent lu_compl_vlr_fsm(901700000004620) +DVLR sub_pres_vlr_fsm(901700000004620){SUB_PRES_VLR_S_DONE}: Freeing instance +DVLR sub_pres_vlr_fsm(901700000004620){SUB_PRES_VLR_S_DONE}: Deallocated +DVLR lu_compl_vlr_fsm(901700000004620){LU_COMPL_VLR_S_WAIT_SUB_PRES}: Received Event LU_COMPL_VLR_E_SUB_PRES_COMPL +DVLR lu_compl_vlr_fsm(901700000004620){LU_COMPL_VLR_S_WAIT_SUB_PRES}: state_chg to LU_COMPL_VLR_S_WAIT_IMEI_TMSI +DMSC msc_tx 3 bytes to MSISDN:46071 via RAN_GERAN_A +- DTAP --RAN_GERAN_A--> MS: GSM48_MT_MM_ID_REQ: 051802 +- DTAP matches expected message +DREF VLR subscr MSISDN:46071 usage decreases to: 1 +<-- GSUP rx OSMO_GSUP_MSGT_UPDATE_LOCATION_RESULT: vlr_gsupc_read_cb() returns 0 +- We will only do business when the IMEI is known + llist_count(&net->subscr_conns) == 1 +DREF VLR subscr MSISDN:46071 usage increases to: 2 + vsub->imei[0] == 0 +DREF VLR subscr MSISDN:46071 usage decreases to: 1 +msc_subscr_conn_is_accepted() == false + requests shall be thwarted +DRLL Dispatching 04.08 message GSM48_MT_CC_SETUP (0x3:0x5) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_MT_CC_SETUP +DRLL Dispatching 04.08 message unknown 0x33 (0x5:0x33) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: unknown 0x33 +DRLL Dispatching 04.08 message GSM48_MT_RR_SYSINFO_1 (0x6:0x19) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_MT_RR_SYSINFO_1 +DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_PDISC_SMS:0x01 +- MS replies with an Identity Response + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_ID_RESP +DREF MSISDN:46071: MSC conn use + 1 == 2 +DRLL Dispatching 04.08 message GSM48_MT_MM_ID_RESP (0x5:0x19) +DMM IDENTITY RESPONSE: MI(IMEI)=423423423423420 +DVLR set IMEI on subscriber; IMSI=901700000004620 IMEI=423423423423420 +DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_WAIT_LU_COMPL}: Received Event VLR_ULA_E_ID_IMEI +DVLR lu_compl_vlr_fsm(901700000004620){LU_COMPL_VLR_S_WAIT_IMEI_TMSI}: Received Event LU_COMPL_VLR_E_IMEI_CHECK_ACK +DVLR lu_compl_vlr_fsm(901700000004620){LU_COMPL_VLR_S_WAIT_IMEI_TMSI}: lu_compl_vlr_new_tmsi() +DVLR lu_compl_vlr_fsm(901700000004620){LU_COMPL_VLR_S_WAIT_IMEI_TMSI}: state_chg to LU_COMPL_VLR_S_WAIT_TMSI_CNF +- sending LU Accept for MSISDN:46071, with TMSI 0x03020100 +DMM MSISDN:46071: bump: conn still being established (SUBSCR_CONN_S_NEW) +DREF MSISDN:46071: MSC conn use - 1 == 1 +- a LU Accept with a new TMSI was sent, waiting for TMSI Realloc Compl + llist_count(&net->subscr_conns) == 1 + lu_result_sent == 1 +msc_subscr_conn_is_accepted() == false + requests shall be thwarted +DRLL Dispatching 04.08 message GSM48_MT_CC_SETUP (0x3:0x5) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_MT_CC_SETUP +DRLL Dispatching 04.08 message unknown 0x33 (0x5:0x33) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: unknown 0x33 +DRLL Dispatching 04.08 message GSM48_MT_RR_SYSINFO_1 (0x6:0x19) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_MT_RR_SYSINFO_1 +DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_PDISC_SMS:0x01 +- MS sends TMSI Realloc Complete + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_TMSI_REALL_COMPL +DREF MSISDN:46071: MSC conn use + 1 == 2 +DRLL Dispatching 04.08 message GSM48_MT_MM_TMSI_REALL_COMPL (0x5:0x1b) +DMM TMSI Reallocation Completed. Subscriber: MSISDN:46071 +DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_WAIT_LU_COMPL}: Received Event VLR_ULA_E_NEW_TMSI_ACK +DVLR lu_compl_vlr_fsm(901700000004620){LU_COMPL_VLR_S_WAIT_TMSI_CNF}: Received Event LU_COMPL_VLR_E_NEW_TMSI_ACK +DREF VLR subscr MSISDN:46071 usage increases to: 2 +DVLR lu_compl_vlr_fsm(901700000004620){LU_COMPL_VLR_S_WAIT_TMSI_CNF}: state_chg to LU_COMPL_VLR_S_DONE +DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_WAIT_LU_COMPL}: Received Event VLR_ULA_E_LU_COMPL_SUCCESS +DVLR lu_compl_vlr_fsm(901700000004620){LU_COMPL_VLR_S_DONE}: Terminating (cause = OSMO_FSM_TERM_PARENT) +DVLR lu_compl_vlr_fsm(901700000004620){LU_COMPL_VLR_S_DONE}: Removing from parent vlr_lu_fsm(901700000004620) +DVLR lu_compl_vlr_fsm(901700000004620){LU_COMPL_VLR_S_DONE}: Freeing instance +DVLR lu_compl_vlr_fsm(901700000004620){LU_COMPL_VLR_S_DONE}: Deallocated +DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_WAIT_LU_COMPL}: state_chg to VLR_ULA_S_DONE +DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_NEW}: Received Event SUBSCR_CONN_E_ACCEPTED +DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_NEW}: SUBSCR_CONN_FROM_LU +DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_NEW}: state_chg to SUBSCR_CONN_S_ACCEPTED +DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_BUMP +DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_ACCEPTED}: bump: releasing conn +DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_ACCEPTED}: state_chg to SUBSCR_CONN_S_RELEASED +DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_RELEASED}: Terminating (cause = OSMO_FSM_TERM_REGULAR) +DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_DONE}: Terminating (cause = OSMO_FSM_TERM_PARENT) +DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_DONE}: Removing from parent Subscr_Conn(901700000004620) +DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_DONE}: fsm_lu_cleanup called with cause OSMO_FSM_TERM_PARENT +DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_DONE}: Freeing instance +DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_DONE}: Deallocated +DMM msc_subscr_conn_close(vsub=MSISDN:46071, cause=2): no conn fsm, releasing directly without release event. +- BSSAP Clear --RAN_GERAN_A--> MS +DREF MSISDN:46071: MSC conn use - 1 == 1 +DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_RELEASED}: Freeing instance +DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_RELEASED}: Deallocated +DREF MSISDN:46071: MSC conn use - 1 == 0 +DRLL subscr MSISDN:46071: Freeing subscriber connection +DREF VLR subscr MSISDN:46071 usage decreases to: 1 + bssap_clear_sent == 1 +- LU was successful, and the conn has already been closed + lu_result_sent == 1 + llist_count(&net->subscr_conns) == 0 +- Subscriber has the IMEISV, IMEI and TMSI +DREF VLR subscr MSISDN:46071 usage increases to: 2 + strcmp(vsub->imeisv, "4234234234234275") == 0 + strcmp(vsub->imei, "423423423423420") == 0 + vsub->tmsi == 0x03020100 +DREF VLR subscr MSISDN:46071 usage decreases to: 1 +--- +- subscriber detaches + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_IMSI_DETACH_IND + new conn +DREF unknown: MSC conn use + 1 == 1 +DRLL Dispatching 04.08 message GSM48_MT_MM_IMSI_DETACH_IND (0x5:0x1) +DMM IMSI DETACH INDICATION: MI(IMSI)=901700000004620 +DREF VLR subscr MSISDN:46071 usage increases to: 2 +DMM IMSI DETACH for MSISDN:46071 +DREF VLR subscr MSISDN:46071 usage decreases to: 1 +DREF VLR subscr MSISDN:46071 usage decreases to: 0 +DREF freeing VLR subscr MSISDN:46071 +DMM msc_subscr_conn_close(vsub=unknown, cause=0): no conn fsm, releasing directly without release event. +- BSSAP Clear --RAN_GERAN_A--> MS +DREF unknown: MSC conn use - 1 == 0 +DRLL Freeing subscriber connection with NULL subscriber + bssap_clear_sent == 1 + llist_count(&net->subscr_conns) == 0 +===== test_no_authen_imeisv_tmsi_imei: SUCCESS + +full talloc report on 'msgb' (total 0 bytes in 1 blocks) +talloc_total_blocks(tall_bsc_ctx) == 9 + full talloc report on 'msgb' (total 0 bytes in 1 blocks) talloc_total_blocks(tall_bsc_ctx) == 9 -- To view, visit https://gerrit.osmocom.org/3494 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I752afef2ae3ce04e813c7e9fea0e883e607c0e14 Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Fri Aug 11 16:30:13 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 11 Aug 2017 16:30:13 +0000 Subject: [PATCH] osmo-msc[master]: vlr: set require IMEI by default Message-ID: Review at https://gerrit.osmocom.org/3495 vlr: set require IMEI by default Change-Id: I91d8f3e79cdaa206f8cd32b42bd7c23933f9631a --- M src/libvlr/vlr.c 1 file changed, 3 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/95/3495/1 diff --git a/src/libvlr/vlr.c b/src/libvlr/vlr.c index d95d1b7..22898b1 100644 --- a/src/libvlr/vlr.c +++ b/src/libvlr/vlr.c @@ -980,6 +980,9 @@ INIT_LLIST_HEAD(&vlr->operations); memcpy(&vlr->ops, ops, sizeof(vlr->ops)); + /* defaults */ + vlr->cfg.check_imei_rqd = true; + /* osmo_auth_fsm.c */ osmo_fsm_register(&vlr_auth_fsm); /* osmo_lu_fsm.c */ -- To view, visit https://gerrit.osmocom.org/3495 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I91d8f3e79cdaa206f8cd32b42bd7c23933f9631a Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Fri Aug 11 16:30:14 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 11 Aug 2017 16:30:14 +0000 Subject: [PATCH] osmo-msc[master]: add msg type to SMS rx logging Message-ID: Review at https://gerrit.osmocom.org/3496 add msg type to SMS rx logging Change-Id: I73ea4eebe57b2d1008045a27f174072178b9f077 --- M src/libmsc/gsm_04_11.c 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/96/3496/1 diff --git a/src/libmsc/gsm_04_11.c b/src/libmsc/gsm_04_11.c index bdf2ad7..6949ac5 100644 --- a/src/libmsc/gsm_04_11.c +++ b/src/libmsc/gsm_04_11.c @@ -809,7 +809,7 @@ return -EIO; /* FIXME: send some error message */ - DEBUGP(DLSMS, "receiving data (trans_id=%x)\n", transaction_id); + DEBUGP(DLSMS, "receiving data (trans_id=%x, msg_type=%d)\n", transaction_id, msg_type); trans = trans_find_by_id(conn, GSM48_PDISC_SMS, transaction_id); /* -- To view, visit https://gerrit.osmocom.org/3496 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I73ea4eebe57b2d1008045a27f174072178b9f077 Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Fri Aug 11 16:30:14 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 11 Aug 2017 16:30:14 +0000 Subject: [PATCH] osmo-msc[master]: split off osmo-msc: remove files, apply build, rename Message-ID: Review at https://gerrit.osmocom.org/3497 split off osmo-msc: remove files, apply build, rename Change-Id: Icf025e5ea8d180613b3114282951c9afa67af9a7 --- M configure.ac D debian/osmo-gtphub.default D debian/osmo-gtphub.examples D debian/osmo-gtphub.init D debian/osmo-gtphub.install D debian/osmocom-bs11-utils.install D debian/osmocom-bsc-nat.init D debian/osmocom-bsc-nat.install D debian/osmocom-bsc.examples D debian/osmocom-bsc.install D debian/osmocom-gbproxy.init D debian/osmocom-gbproxy.install D debian/osmocom-ipaccess-utils.install D debian/osmocom-sgsn.default D debian/osmocom-sgsn.examples D debian/osmocom-sgsn.init D debian/osmocom-sgsn.install D doc/BS11-OML.txt D doc/channel_release.txt D doc/examples/osmo-bsc/osmo-bsc.cfg D doc/examples/osmo-bsc_mgcp/mgcp.cfg D doc/examples/osmo-bsc_nat/black-list.cfg D doc/examples/osmo-bsc_nat/osmo-bsc_nat.cfg D doc/examples/osmo-gbproxy/osmo-gbproxy-legacy.cfg D doc/examples/osmo-gbproxy/osmo-gbproxy.cfg D doc/examples/osmo-gtphub/gtphub-example.txt D doc/examples/osmo-gtphub/osmo-gtphub-1iface.cfg D doc/examples/osmo-gtphub/osmo-gtphub.cfg D doc/examples/osmo-sgsn/osmo-sgsn.cfg D doc/oml-interface.txt M include/Makefile.am D include/compat_af_isdn.h D include/mISDNif.h M include/openbsc/Makefile.am D include/openbsc/bsc_nat.h D include/openbsc/bsc_nat_callstats.h D include/openbsc/bsc_nat_sccp.h D include/openbsc/bsc_subscriber.h D include/openbsc/gb_proxy.h D include/openbsc/gprs_gb_parse.h D include/openbsc/gprs_gmm.h D include/openbsc/gprs_llc.h D include/openbsc/gprs_llc_xid.h D include/openbsc/gprs_sgsn.h D include/openbsc/gprs_sndcp.h D include/openbsc/gprs_sndcp_comp.h D include/openbsc/gprs_sndcp_dcomp.h D include/openbsc/gprs_sndcp_pcomp.h D include/openbsc/gprs_sndcp_xid.h D include/openbsc/gprs_subscriber.h D include/openbsc/gprs_utils.h D include/openbsc/nat_rewrite_trie.h M include/openbsc/paging.h D include/openbsc/pcu_if.h D include/openbsc/pcuif_proto.h D include/openbsc/sgsn.h D include/openbsc/v42bis.h D include/openbsc/v42bis_private.h M src/Makefile.am D src/gprs/.gitignore D src/gprs/Makefile.am D src/gprs/crc24.c D src/gprs/gb_proxy.c D src/gprs/gb_proxy_main.c D src/gprs/gb_proxy_patch.c D src/gprs/gb_proxy_peer.c D src/gprs/gb_proxy_tlli.c D src/gprs/gb_proxy_vty.c D src/gprs/gprs_gb_parse.c D src/gprs/gprs_gmm.c D src/gprs/gprs_llc.c D src/gprs/gprs_llc_parse.c D src/gprs/gprs_llc_vty.c D src/gprs/gprs_llc_xid.c D src/gprs/gprs_sgsn.c D src/gprs/gprs_sndcp.c D src/gprs/gprs_sndcp_comp.c D src/gprs/gprs_sndcp_dcomp.c D src/gprs/gprs_sndcp_pcomp.c D src/gprs/gprs_sndcp_vty.c D src/gprs/gprs_sndcp_xid.c D src/gprs/gprs_subscriber.c D src/gprs/gprs_utils.c D src/gprs/gtphub.c D src/gprs/gtphub_ares.c D src/gprs/gtphub_main.c D src/gprs/gtphub_sock.c D src/gprs/gtphub_vty.c D src/gprs/osmo_sgsn.cfg D src/gprs/sgsn_ares.c D src/gprs/sgsn_auth.c D src/gprs/sgsn_cdr.c D src/gprs/sgsn_ctrl.c D src/gprs/sgsn_libgtp.c D src/gprs/sgsn_main.c D src/gprs/sgsn_vty.c D src/gprs/slhc.c D src/gprs/v42bis.c D src/ipaccess/Makefile.am D src/ipaccess/abisip-find.c D src/ipaccess/ipaccess-config.c D src/ipaccess/ipaccess-firmware.c D src/ipaccess/ipaccess-proxy.c D src/ipaccess/network_listen.c D src/libbsc/Makefile.am D src/libbsc/abis_nm.c D src/libbsc/abis_nm_ipaccess.c D src/libbsc/abis_nm_vty.c D src/libbsc/abis_om2000.c D src/libbsc/abis_om2000_vty.c D src/libbsc/abis_rsl.c D src/libbsc/arfcn_range_encode.c D src/libbsc/bsc_api.c D src/libbsc/bsc_ctrl_commands.c D src/libbsc/bsc_ctrl_lookup.c D src/libbsc/bsc_dyn_ts.c D src/libbsc/bsc_init.c D src/libbsc/bsc_msc.c D src/libbsc/bsc_rf_ctrl.c D src/libbsc/bsc_rll.c D src/libbsc/bsc_subscriber.c D src/libbsc/bsc_vty.c D src/libbsc/bts_ericsson_rbs2000.c D src/libbsc/bts_init.c D src/libbsc/bts_ipaccess_nanobts.c D src/libbsc/bts_ipaccess_nanobts_omlattr.c D src/libbsc/bts_nokia_site.c D src/libbsc/bts_siemens_bs11.c D src/libbsc/bts_sysmobts.c D src/libbsc/bts_unknown.c D src/libbsc/chan_alloc.c D src/libbsc/e1_config.c D src/libbsc/gsm_04_08_utils.c D src/libbsc/gsm_04_80_utils.c D src/libbsc/handover_decision.c D src/libbsc/handover_logic.c D src/libbsc/meas_proc.c D src/libbsc/meas_rep.c D src/libbsc/net_init.c D src/libbsc/paging.c D src/libbsc/pcu_sock.c D src/libbsc/rest_octets.c D src/libbsc/system_information.c M src/libcommon/common_vty.c D src/libfilter/Makefile.am D src/libfilter/bsc_msg_acc.c D src/libfilter/bsc_msg_filter.c D src/libfilter/bsc_msg_vty.c M src/libmsc/vty_interface_layer3.c D src/libtrau/Makefile.am D src/libtrau/rtp_proxy.c D src/libtrau/trau_mux.c D src/libtrau/trau_upqueue.c M src/libvlr/vlr.c D src/osmo-bsc/Makefile.am D src/osmo-bsc/osmo_bsc_api.c D src/osmo-bsc/osmo_bsc_audio.c D src/osmo-bsc/osmo_bsc_bssap.c D src/osmo-bsc/osmo_bsc_ctrl.c D src/osmo-bsc/osmo_bsc_filter.c D src/osmo-bsc/osmo_bsc_grace.c D src/osmo-bsc/osmo_bsc_main.c D src/osmo-bsc/osmo_bsc_msc.c D src/osmo-bsc/osmo_bsc_reset.c D src/osmo-bsc/osmo_bsc_sigtran.c D src/osmo-bsc/osmo_bsc_vty.c D src/osmo-bsc_nat/Makefile.am D src/osmo-bsc_nat/bsc_filter.c D src/osmo-bsc_nat/bsc_mgcp_utils.c D src/osmo-bsc_nat/bsc_nat.c D src/osmo-bsc_nat/bsc_nat_ctrl.c D src/osmo-bsc_nat/bsc_nat_filter.c D src/osmo-bsc_nat/bsc_nat_rewrite.c D src/osmo-bsc_nat/bsc_nat_rewrite_trie.c D src/osmo-bsc_nat/bsc_nat_utils.c D src/osmo-bsc_nat/bsc_nat_vty.c D src/osmo-bsc_nat/bsc_sccp.c D src/osmo-bsc_nat/bsc_ussd.c M src/osmo-msc/Makefile.am M src/utils/Makefile.am D src/utils/bs11_config.c D src/utils/isdnsync.c M tests/Makefile.am D tests/abis/Makefile.am D tests/abis/abis_test.c D tests/abis/abis_test.ok D tests/bsc-nat-trie/Makefile.am D tests/bsc-nat-trie/bsc_nat_trie_test.c D tests/bsc-nat-trie/bsc_nat_trie_test.ok D tests/bsc-nat-trie/prefixes.csv D tests/bsc-nat/Makefile.am D tests/bsc-nat/barr.cfg D tests/bsc-nat/barr_dup.cfg D tests/bsc-nat/bsc_data.c D tests/bsc-nat/bsc_nat_test.c D tests/bsc-nat/bsc_nat_test.ok D tests/bsc-nat/prefixes.csv D tests/bsc/Makefile.am D tests/bsc/bsc_test.c D tests/bsc/bsc_test.ok D tests/channel/Makefile.am D tests/channel/channel_test.c D tests/channel/channel_test.ok D tests/gbproxy/Makefile.am D tests/gbproxy/gbproxy_test.c D tests/gbproxy/gbproxy_test.ok D tests/gprs/Makefile.am D tests/gprs/gprs_test.c D tests/gprs/gprs_test.ok D tests/gsm0408/Makefile.am D tests/gsm0408/gsm0408_test.c D tests/gsm0408/gsm0408_test.ok D tests/gtphub/Makefile.am D tests/gtphub/gtphub_test.c D tests/gtphub/gtphub_test.ok M tests/msc_vlr/Makefile.am M tests/msc_vlr/msc_vlr_tests.c D tests/nanobts_omlattr/Makefile.am D tests/nanobts_omlattr/nanobts_omlattr_test.c D tests/nanobts_omlattr/nanobts_omlattr_test.ok D tests/oap/Makefile.am D tests/oap/oap_client_test.c D tests/oap/oap_client_test.err D tests/oap/oap_client_test.ok D tests/sgsn/Makefile.am D tests/sgsn/sgsn_test.c D tests/sgsn/sgsn_test.ok D tests/slhc/Makefile.am D tests/slhc/slhc_test.c D tests/slhc/slhc_test.ok M tests/sms_queue/Makefile.am D tests/sndcp_xid/Makefile.am D tests/sndcp_xid/sndcp_xid_test.c D tests/sndcp_xid/sndcp_xid_test.ok D tests/subscr/Makefile.am D tests/subscr/bsc_subscr_test.c D tests/subscr/bsc_subscr_test.err D tests/subscr/bsc_subscr_test.ok M tests/testsuite.at D tests/trau/Makefile.am D tests/trau/trau_test.c D tests/trau/trau_test.ok D tests/v42bis/Makefile.am D tests/v42bis/v42bis_test.c D tests/v42bis/v42bis_test.ok D tests/xid/Makefile.am D tests/xid/xid_test.c D tests/xid/xid_test.ok D tools/hlrstat.pl 249 files changed, 15 insertions(+), 99,282 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/97/3497/1 -- To view, visit https://gerrit.osmocom.org/3497 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Icf025e5ea8d180613b3114282951c9afa67af9a7 Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Fri Aug 11 16:30:14 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 11 Aug 2017 16:30:14 +0000 Subject: [PATCH] osmo-msc[master]: libmsc: make pitfall in gsm0408_dispatch() more obvious Message-ID: Review at https://gerrit.osmocom.org/3498 libmsc: make pitfall in gsm0408_dispatch() more obvious The function gsm0408_dispatch() accepts a message buffer pointer and accesses the l3h pointer. Even in a properly allocated message buffer, this may lead into a segfault if the user forgets to set the l3h pointer. This commit adds assertions to popup a more expressive error message. Change-Id: I43bd9bd1c170559aaa8dacaef25dba090744bcd5 --- M src/libmsc/gsm_04_08.c 1 file changed, 6 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/98/3498/1 diff --git a/src/libmsc/gsm_04_08.c b/src/libmsc/gsm_04_08.c index be23c64..f16cca0 100644 --- a/src/libmsc/gsm_04_08.c +++ b/src/libmsc/gsm_04_08.c @@ -3208,13 +3208,17 @@ /* Main entry point for GSM 04.08/44.008 Layer 3 data (e.g. from the BSC). */ int gsm0408_dispatch(struct gsm_subscriber_connection *conn, struct msgb *msg) { - struct gsm48_hdr *gh = msgb_l3(msg); - uint8_t pdisc = gsm48_hdr_pdisc(gh); + struct gsm48_hdr *gh; + uint8_t pdisc; int rc = 0; + OSMO_ASSERT(msg->l3h) OSMO_ASSERT(conn); OSMO_ASSERT(msg); + gh = msgb_l3(msg); + pdisc = gsm48_hdr_pdisc(gh); + LOGP(DRLL, LOGL_DEBUG, "Dispatching 04.08 message %s (0x%x:0x%x)\n", gsm48_pdisc_msgtype_name(pdisc, gsm48_hdr_msg_type(gh)), pdisc, gsm48_hdr_msg_type(gh)); -- To view, visit https://gerrit.osmocom.org/3498 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I43bd9bd1c170559aaa8dacaef25dba090744bcd5 Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: dexter From gerrit-no-reply at lists.osmocom.org Fri Aug 11 16:30:14 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 11 Aug 2017 16:30:14 +0000 Subject: [PATCH] osmo-msc[master]: rework debian packages support Message-ID: Review at https://gerrit.osmocom.org/3499 rework debian packages support Remove old leftover from split of osmo-mgw out of openbsc. Change-Id: I77544cb38c31777c3fab52979d19488a63e52de3 --- D debian/autoreconf M debian/changelog M debian/control M debian/copyright D debian/docs D debian/openbsc-dev.install A debian/osmo-msc.install D debian/osmocom-nitb.default D debian/osmocom-nitb.dirs D debian/osmocom-nitb.examples D debian/osmocom-nitb.init D debian/osmocom-nitb.install M debian/rules 13 files changed, 240 insertions(+), 557 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/99/3499/1 diff --git a/debian/autoreconf b/debian/autoreconf deleted file mode 100644 index 9a3a67f..0000000 --- a/debian/autoreconf +++ /dev/null @@ -1 +0,0 @@ -openbsc diff --git a/debian/changelog b/debian/changelog index e9a4212..a1b3dda 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,75 +1,5 @@ -openbsc (0.15.1) UNRELEASED; urgency=medium +osmo-msc (0.1.0) UNRELEASED; urgency=low - * Move forward toward a new release. - * Prevent SGSN starting with 'auth-policy remote' when no 'gsup remote-*' are configured. - Note: such configs are broken without extra workarounds anyway. + * Initial release. - -- Holger Hans Peter Freyther Tue, 24 May 2016 23:14:31 +0200 - -openbsc (0.14.0) unstable; urgency=low - - * New upstream tag and additional patches. - - -- Holger Hans Peter Freyther Sat, 14 Mar 2015 20:33:25 +0100 - -openbsc (0.12.0+git26-7) unstable; urgency=low - - * 64bit fix for the MGCP rewriting - - -- Holger Hans Peter Freyther Wed, 07 Nov 2012 11:39:34 +0100 - -openbsc (0.12.0+git26-6) precise; urgency=low - - * Added init script for osmocom-sgsn. - - -- Eric Butler Fri, 24 Aug 2012 21:04:32 -0700 - -openbsc (0.12.0+git26-5) precise; urgency=low - - * Don't enable MNCC sock by default. - * Automatically create important directories. - * Fix init script 'stop' command. - - -- Eric Butler Fri, 24 Aug 2012 20:56:33 -0700 - -openbsc (0.12.0+git26-4) precise; urgency=low - - * Specify HLR path and enable RTP proxy. - - -- Eric Butler Mon, 20 Aug 2012 00:21:07 -0700 - -openbsc (0.12.0+git26-3) precise; urgency=low - - * Fix init script. - - -- Eric Butler Sun, 19 Aug 2012 16:05:44 -0700 - -openbsc (0.12.0+git26-2) precise; urgency=low - - * Fix libdbi package dependency. - - -- Eric Butler Wed, 15 Aug 2012 00:35:37 -0700 - -openbsc (0.12.0+git26-1) precise; urgency=low - - * Fix version issue. - - -- Eric Butler Tue, 14 Aug 2012 21:00:51 -0700 - -openbsc (0.12.0+git26) precise; urgency=low - - * Updated ubuntu package. - - -- Eric Butler Tue, 14 Aug 2012 17:36:51 -0700 - -openbsc (0.9.13.115.eb113-1) natty; urgency=low - - * New upstream release - - -- Harald Welte Wed, 11 May 2011 18:41:24 +0000 - -openbsc (0.9.4-1) unstable; urgency=low - - * Initial release - - -- Harald Welte Tue, 24 Aug 2010 13:34:24 +0200 + -- Alexander Couzens Tue, 08 Aug 2017 01:13:01 +0000 diff --git a/debian/control b/debian/control index 87b6f07..907ec38 100644 --- a/debian/control +++ b/debian/control @@ -1,181 +1,41 @@ -Source: openbsc -Maintainer: Harald Welte +Source: osmo-msc Section: net -Priority: optional -Build-Depends: debhelper (>= 9), - autotools-dev, - autoconf-archive, - pkg-config, - libgtp-dev, - libosmocore-dev, - libosmo-sccp-dev, - libdbi0-dev, +Priority: extra +Maintainer: Alexander Couzens +Build-Depends: debhelper (>=9), dh-autoreconf, - libosmo-abis-dev, - libosmo-netif-dev, - libdbd-sqlite3, - libpcap-dev, + autotools-dev, + autoconf, + automake, + libtool, + pkg-config, + libdbi-dev, + libtalloc-dev, libssl-dev, libc-ares-dev, - libsmpp34-dev + libgtp-dev, + libasn1c-dev, + libc-ares-dev, + libosmocore-dev, + libosmo-sccp-dev, + libosmo-abis-dev, + libosmo-legacy-mgcp-dev, + libosmo-netif-dev, + libosmo-ranap-dev Standards-Version: 3.9.8 -Vcs-Git: git://bs11-abis.gnumonks.org/openbsc.git -Vcs-Browser: http://openbsc.osmocom.org/trac/browser -Homepage: https://projects.osmocom.org/projects/openbsc +Vcs-Git: git://git.osmocom.org/osmo-bsc.git +Vcs-Browser: https://git.osmocom.org/osmo-bsc/ +Homepage: https://projects.osmocom.org/projects/osmo-bsc -Package: osmocom-bsc +Package: osmo-msc Architecture: any -Depends: ${shlibs:Depends}, - ${misc:Depends} -Description: GSM Base Station Controller - This is the BSC-only version of OpenBSC. It requires a Mobile Switching Center - (MSC) to operate. - . - You might rather prefer to use osmocom-nitb which is considered a - "GSM Network-in-a-Box" and does not depend on a MSC. +Multi-Arch: foreign +Depends: ${misc:Depends}, ${shlibs:Depends} +Description: OsmoMSC: Osmocom's Mobile Switching Center for 2G and 3G circuit-switched mobile networks -Package: osmocom-nitb -Architecture: any -Depends: ${shlibs:Depends}, - ${misc:Depends}, - libdbd-sqlite3 -Description: GSM Network-in-a-Box, implements BSC, MSC, SMSC, HLR, VLR - This is the Network-in-a-Box version of OpenBSC. It has all the GSM network - components bundled together. When using osmocom-nitb, there is no need for a - Mobile Switching Center (MSC) which is needed when using osmocom-bsc. - -Package: osmocom-ipaccess-utils -Architecture: any -Depends: ${shlibs:Depends}, - ${misc:Depends} -Description: Command line utilities for ip.access nanoBTS - This package contains utilities that are specific for nanoBTS when being used - together with OpenBSC. It contains mainly three tools: ipaccess-find, - ipaccess-config and ipaccess-proxy. - -Package: osmocom-bs11-utils -Architecture: any -Depends: ${shlibs:Depends}, - ${misc:Depends} -Description: Command line utilities for Siemens BS-11 BTS - There is a tool in this package for configuring the Siemens BS-11 BTS. - Additionally, it contains one tool for making use of an ISDN-card and the - public telephone network as frequency standard for the E1 line. - -Package: osmocom-sgsn -Architecture: any -Depends: ${shlibs:Depends}, - ${misc:Depends} -Suggests: osmocom-bsc -Description: Osmocom Serving GPRS Support Node - This is an implementation of the GPRS Serving GPRS Support Node (SGSN). As - such it implements the GPRS Mobility Management (GMM) and SM (Session - Management). - . - The SGSN connects via the Gb-interface to the BSS (like the osmo-pcu or an - ip.access nanoBTS), and it connects via the GTP protocol to a Gateway GPRS - Support Node (GGSN) like openggsn. - -Package: osmocom-gbproxy -Architecture: any -Depends: ${shlibs:Depends}, - ${misc:Depends} -Recommends: osmocom-sgsn -Description: Osmocom GPRS Gb Interface Proxy - The purpose of the Gb proxy is to aggregate the Gb links of multiple - BSS's and present them in one Gb link to the SGSN. - . - This package is part of OpenBSC and closely related to osmocom-sgsn. - -Package: osmocom-bsc-nat -Architecture: any -Depends: ${shlibs:Depends}, - ${misc:Depends} -Recommends: osmocom-bsc -Description: Osmocom Base Station Controller Network Address Translation - This NAT is useful for masquerading multiple BSCs behind one. It listens - for incoming BSCs on port 5000 and connects to a specified Mobile Switching - Center (MSC). - . - This package is part of OpenBSC and closely related to osmocom-bsc. - -Package: openbsc-dev -Architecture: all -Depends: ${misc:Depends} -Description: Header file needed by tools tightly integrated - Some other programs depend on gsm_data_shared.h and gsm_data_shared.c - from OpenBSC. This package installs these files to your file system so - that the other packages can build-depend on this package. - . - The directory structure is copied after the structure in the repository - and the header and .c file are installed into /usr/src/osmocom/openbsc/. - -Package: osmo-gtphub -Architecture: any -Depends: ${shlibs:Depends}, ${misc:Depends} -Description: Osmocom GTP Hub - Proxy for comms between multiple SGSNs and GGSNs. - -Package: osmocom-bsc-dbg -Architecture: any +Package: osmo-msc-dbg Section: debug -Priority: extra -Depends: osmocom-bsc (= ${binary:Version}), ${misc:Depends} -Description: Debug symbols for the OpenBSC BSC - Make debugging possible - -Package: osmocom-nitb-dbg Architecture: any -Section: debug -Priority: extra -Depends: osmocom-nitb (= ${binary:Version}), ${misc:Depends} -Description: Debug symbols for the OpenBSC NITB - Make debugging possible - -Package: osmocom-ipaccess-utils-dbg -Architecture: any -Section: debug -Priority: extra -Depends: osmocom-ipaccess-utils (= ${binary:Version}), ${misc:Depends} -Description: Debug symbols for the OpenBSC ip.access utils - Make debugging possible - -Package: osmocom-bs11-utils-dbg -Architecture: any -Section: debug -Priority: extra -Depends: osmocom-bs11-utils (= ${binary:Version}), ${misc:Depends} -Description: Debug symbols for the OpenBSC BS11 utils - Make debugging possible - -Package: osmocom-sgsn-dbg -Architecture: any -Section: debug -Priority: extra -Depends: osmocom-sgsn (= ${binary:Version}), ${misc:Depends} -Description: Debug symbols for the OpenBSC Serving GPRS Support Node - Make debugging possible - -Package: osmocom-gbproxy-dbg -Architecture: any -Section: debug -Priority: extra -Depends: osmocom-gbproxy (= ${binary:Version}), ${misc:Depends} -Description: Debug symbols for the OpenBSC GPRS GBProxy - Make debugging possible - -Package: osmocom-bsc-nat-dbg -Architecture: any -Section: debug -Priority: extra -Depends: osmocom-bsc-nat (= ${binary:Version}), ${misc:Depends} -Description: Debug symbols for the OpenBSC Network Address Translation - Make debugging possible - -Package: osmo-gtphub-dbg -Architecture: any -Section: debug -Priority: extra -Depends: osmo-gtphub (= ${binary:Version}), ${misc:Depends} -Description: Debug symbols for Osmocom GTP Hub - Make debugging possible +Multi-Arch: same +Depends: osmo-msc (= ${binary:Version}), ${misc:Depends} +Description: OsmoMSC: Osmocom's Mobile Switching Center for 2G and 3G circuit-switched mobile networks diff --git a/debian/copyright b/debian/copyright index 1e4dee1..e3cd9b3 100644 --- a/debian/copyright +++ b/debian/copyright @@ -1,75 +1,83 @@ Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ -Upstream-Name: OpenBSC -Source: http://openbsc.osmocom.org/ +Upstream-Name: osmo-msc +Source: git://git.osmocom.org/osmo-msc -Files: * -Copyright: 2008-2015 Harald Welte - 2008-2015 Holger Hans Peter Freyther - 2009-2015 On-Waves - 2008 Jan Luebbe - 2008,2010-2011 Daniel Willmann - 2009,2011,2013 Andreas Eversberg - 2009,2011 Dieter Spaar - 2009 Mike Haben - 2010 Sylvain Munaut <246tnt at gmail.com> - 2012-2013 Pablo Neira Ayuso - 2013-2015 Sysmocom s.f.m.c. GmbH (Jacob Erlbeck) - 2014 Alexander Chemeris -License: AGPL-3+ -Comment: Contributions by Stefan Schmidt as well - -Files: wireshark/0001-abis_oml.patch - wireshark/0002-ericsson_rbs2409.patch - wireshark/0003-lucent-hnb.patch - wireshark/0005-rsl-hsl.patch -Copyright: 1998 Gerald Combs - 2007,2011 Anders Broman - 2009 Holger Hans Peter Freyther - 2009-2011 Harald Welte -License: GPL-2+ - -Files: openbsc/include/mISDNif.h -Copyright: 2008 Karsten Keil -License: LGPL-2.1 - -Files: openbsc/src/libmgcp/g711common.h -Copyright: 2009 Abramo Bagnara -License: GPL-2+ - -Files: openbsc/git-version-gen -Copyright: 2007-2010 Free Software Foundation -License: GPL-3+ - -Files: openbsc/osmoappdesc.py - openbsc/tests/smpp_test_runner.py - openbsc/tests/ctrl_test_runner.py - openbsc/tests/vty_test_runner.py -Copyright: 2013 Katerina Barone-Adesi - 2013 Jacob Erlbeck - 2013-2014 Holger Hans Peter Freyther -License: GPL-3+ - -Files: openbsc/src/libbsc/bsc_ctrl_lookup.c -Copyright: 2010-2011 Daniel Willmann - 2010-2011 On-Waves -License: GPL-2+ - -Files: openbsc/src/libmsc/mncc_sock.c - openbsc/src/libmsc/mncc_builtin.c -Copyright: 2008-2010 Harald Welte - 2009 Andreas Eversberg - 2012 Holger Hans Peter Freyther -License: GPL-2+ - -Files: debian/* -Copyright: 2012-2015 Holger Hans Peter Freyther - 2016 Ruben Undheim -License: GPL-2+ - - -License: AGPL-3+ - This package is free software; you can redistribute it and/or modify +Files: * +Copyright: 2008 Daniel Willmann + 2008 Jan Luebbe + 2008-2015 Holger Hans Peter Freyther + 2008-2016 Harald Welte + 2009 Andreas Eversberg + 2009 Mike Haben + 2010 Sylvain Munaut + 2010-2013 On-Waves + 2013 Jacob Erlbeck + 2011 Andreas Eversberg + 2011-2017 sysmocom s.f.m.c. GmbH + 2014-2015 Alexander Chemeris +License: AGPL-3.0+ + This program is free software; you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + . + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Affero General Public License for more details. + . + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see . + +Files: src/libmsc/mncc_builtin.c + src/libmsc/mncc_sock.c +Copyright: 2008-2010 Harald Welte + 2009 Andreas Eversberg + 2012 Holger Hans Peter Freyther +License: GPL-2.0+ + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + . + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + . + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + . + On Debian systems, the complete text of the GNU General Public License + Version 2 can be found in `/usr/share/common-licenses/GPL-2'. + +Files: osmoappdesc.py +Copyright: 2013 Katerina Barone-Adesi +License: GPL-3.0+ + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + . + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + . + You should have received a copy of the GNU General Public License + along with this program. If not, see + . + Most systems won't be able to use these, so they're separated out + . + On Debian systems, the complete text of the GNU General Public License + Version 3 can be found in `/usr/share/common-licenses/GPL-3'. + +Files: git-version-gen +Copyright: 2007-2010 Free Software Foundation, Inc. +License: GPL-3.0+ + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. . @@ -78,60 +86,88 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. . - You should have received a copy of the GNU Affero General Public License - along with this program. If not, see . - - -License: GPL-2+ - This package is free software: you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 2 of the License, or (at - your option) any later version. - . - This program is distributed in the hope that it will be useful, but - WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - for more details. - . You should have received a copy of the GNU General Public License along with this program. If not, see . . - On Debian systems, the complete text of the GNU General Public - License version 2 can be found in "/usr/share/common-licenses/GPL-2". - - -License: GPL-3+ - This package is free software: you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or (at - your option) any later version. + This script is derived from GIT-VERSION-GEN from GIT: http://git.or.cz/. + It may be run two ways: + - from a git repository in which the "git describe" command below + produces useful output (thus requiring at least one signed tag) + - from a non-git-repo directory containing a .tarball-version file, which + presumes this script is invoked like "./git-version-gen .tarball-version". . - This program is distributed in the hope that it will be useful, but - WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - for more details. + In order to use intra-version strings in your project, you will need two + separate generated version string files: . - You should have received a copy of the GNU General Public License - along with this program. If not, see . + .tarball-version - present only in a distribution tarball, and not in + a checked-out repository. Created with contents that were learned at + the last time autoconf was run, and used by git-version-gen. Must not + be present in either $(srcdir) or $(builddir) for git-version-gen to + give accurate answers during normal development with a checked out tree, + but must be present in a tarball when there is no version control system. + Therefore, it cannot be used in any dependencies. GNUmakefile has + hooks to force a reconfigure at distribution time to get the value + correct, without penalizing normal development with extra reconfigures. . - On Debian systems, the complete text of the GNU General Public - License version 3 can be found in "/usr/share/common-licenses/GPL-3". + .version - present in a checked-out repository and in a distribution + tarball. Usable in dependencies, particularly for files that don't + want to depend on config.h but do want to track version changes. + Delete this file prior to any autoconf run where you want to rebuild + files to pick up a version string change; and leave it stale to + minimize rebuild time after unrelated changes to configure sources. + . + It is probably wise to add these two files to .gitignore, so that you + don't accidentally commit either generated file. + . + Use the following line in your configure.ac, so that $(VERSION) will + automatically be up-to-date each time configure is run (and note that + since configure.ac no longer includes a version string, Makefile rules + should not depend on configure.ac for version updates). + . + On Debian systems, the complete text of the GNU General Public License + Version 3 can be found in `/usr/share/common-licenses/GPL-3'. - -License: LGPL-2.1 - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; version - 2.1 of the License. +Files: tests/vty_test_runner.py +Copyright: 2013 Holger Hans Peter Freyther + 2013 Katerina Barone-Adesi +License: GPL-3.0+ + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. . - This library is distributed in the hope that it will be useful, + This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. . - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, see . + You should have received a copy of the GNU General Public License + along with this program. If not, see . . - On Debian systems, the complete text of the GNU Lesser General - Public License version 2.1 can be found in - "/usr/share/common-licenses/LGPL-2.1". + On Debian systems, the complete text of the GNU General Public License + Version 3 can be found in `/usr/share/common-licenses/GPL-3'. + +Files: include/openbsc/slhc.h +Copyright: 1989 Regents of the University of California. +License: __UNKNOWN__ + Redistribution and use in source and binary forms are permitted + provided that the above copyright notice and this paragraph are + duplicated in all such forms and that any documentation, + advertising materials, and other materials related to such + distribution and use acknowledge that the software was developed + by the University of California, Berkeley. The name of the + University may not be used to endorse or promote products derived + from this software without specific prior written permission. + THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. + . + Van Jacobson (van at helios.ee.lbl.gov), Dec 31, 1989: + - Initial distribution. + . + modified for KA9Q Internet Software Package by + Katie Stevens (dkstevens at ucdavis.edu) + University of California, Davis + Computing Services + - 01-31-90 initial adaptation + diff --git a/debian/docs b/debian/docs deleted file mode 100644 index cd545c2..0000000 --- a/debian/docs +++ /dev/null @@ -1 +0,0 @@ -openbsc/README diff --git a/debian/openbsc-dev.install b/debian/openbsc-dev.install deleted file mode 100644 index 0c05545..0000000 --- a/debian/openbsc-dev.install +++ /dev/null @@ -1,4 +0,0 @@ -openbsc/include/openbsc/gsm_data_shared.h usr/src/osmocom/openbsc/openbsc/include/openbsc/ -openbsc/include/openbsc/common_cs.h usr/src/osmocom/openbsc/openbsc/include/openbsc/ -openbsc/src/libcommon/gsm_data_shared.c usr/src/osmocom/openbsc/openbsc/src/libcommon/ -usr/lib/*/pkgconfig/openbsc.pc diff --git a/debian/osmo-msc.install b/debian/osmo-msc.install new file mode 100644 index 0000000..2c733e0 --- /dev/null +++ b/debian/osmo-msc.install @@ -0,0 +1,2 @@ +usr/bin +usr/share/doc/openbsc/examples/osmo-msc/osmo-msc.cfg diff --git a/debian/osmocom-nitb.default b/debian/osmocom-nitb.default deleted file mode 100644 index ef76a5f..0000000 --- a/debian/osmocom-nitb.default +++ /dev/null @@ -1,8 +0,0 @@ -CONFIG_FILE="/etc/osmocom/osmo-nitb.cfg" -HLR_FILE="/var/lib/osmocom/hlr.sqlite3" - -DAEMON_ARGS="-P" - -# Uncomment if using LCR+Asterisk -# DAEMON_ARGS="-m -P" - diff --git a/debian/osmocom-nitb.dirs b/debian/osmocom-nitb.dirs deleted file mode 100644 index efbca2b..0000000 --- a/debian/osmocom-nitb.dirs +++ /dev/null @@ -1,3 +0,0 @@ -/etc/osmocom -/var/log/osmocom -/var/lib/osmocom diff --git a/debian/osmocom-nitb.examples b/debian/osmocom-nitb.examples deleted file mode 100644 index c098d5c..0000000 --- a/debian/osmocom-nitb.examples +++ /dev/null @@ -1 +0,0 @@ -openbsc/doc/examples/osmo-nitb diff --git a/debian/osmocom-nitb.init b/debian/osmocom-nitb.init deleted file mode 100755 index 0747446..0000000 --- a/debian/osmocom-nitb.init +++ /dev/null @@ -1,152 +0,0 @@ -#!/bin/sh -### BEGIN INIT INFO -# Provides: osmo-nitb -# Required-Start: $network $local_fs -# Required-Stop: -# Default-Start: 2 3 4 5 -# Default-Stop: 0 1 6 -# Short-Description: Osmocom GSM network-in-a-box -# Description: A minimal implementation of the GSM Base Station Controller, -# Mobile Switching Center, Home Location regster and all other -# components to run a self-contained GSM network. -### END INIT INFO - -# Author: Harald Welte - -# PATH should only include /usr/* if it runs after the mountnfs.sh script -PATH=/sbin:/usr/sbin:/bin:/usr/bin -NAME=osmo-nitb # Introduce the short server's name here -DESC="Osmocom GSM Network-in-a-Box" # Introduce a short description here -DAEMON=/usr/bin/osmo-nitb # Introduce the server's location here -SCRIPTNAME=/etc/init.d/osmocom-nitb - -# Exit if the package is not installed -[ -x $DAEMON ] || exit 0 - -# Read configuration variable file if it is present -[ -r /etc/default/osmocom-nitb ] && . /etc/default/osmocom-nitb - -# Load the VERBOSE setting and other rcS variables -. /lib/init/vars.sh - -# Define LSB log_* functions. -# Depend on lsb-base (>= 3.0-6) to ensure that this file is present. -. /lib/lsb/init-functions - -DAEMON_ARGS="$DAEMON_ARGS -D -c $CONFIG_FILE -l $HLR_FILE" - -# -# Function that starts the daemon/service -# -do_start() -{ - # Return - # 0 if daemon has been started - # 1 if daemon was already running - # 2 if daemon could not be started - start-stop-daemon --start --quiet --exec $DAEMON --test > /dev/null \ - || return 1 - start-stop-daemon --start --quiet --exec $DAEMON -- \ - $DAEMON_ARGS \ - || return 2 - # Add code here, if necessary, that waits for the process to be ready - # to handle requests from services started subsequently which depend - # on this one. As a last resort, sleep for some time. -} - -# -# Function that stops the daemon/service -# -do_stop() -{ - # Return - # 0 if daemon has been stopped - # 1 if daemon was already stopped - # 2 if daemon could not be stopped - # other if a failure occurred - start-stop-daemon --stop --quiet --retry=TERM/30/KILL/5 --name $NAME - RETVAL="$?" - [ "$RETVAL" = 2 ] && return 2 - # Wait for children to finish too if this is a daemon that forks - # and if the daemon is only ever run from this initscript. - # If the above conditions are not satisfied then add some other code - # that waits for the process to drop all resources that could be - # needed by services started subsequently. A last resort is to - # sleep for some time. - start-stop-daemon --stop --quiet --oknodo --retry=0/30/KILL/5 --exec $DAEMON - [ "$?" = 2 ] && return 2 - return "$RETVAL" -} - -# -# Function that sends a SIGHUP to the daemon/service -# -do_reload() { - # - # If the daemon can reload its configuration without - # restarting (for example, when it is sent a SIGHUP), - # then implement that here. - # - start-stop-daemon --stop --signal 1 --quiet $PIDFILE --name $NAME - return 0 -} - -case "$1" in - start) - [ "$VERBOSE" != no ] && log_daemon_msg "Starting $DESC " "$NAME" - do_start - case "$?" in - 0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;; - 2) [ "$VERBOSE" != no ] && log_end_msg 1 ;; - esac - ;; - stop) - [ "$VERBOSE" != no ] && log_daemon_msg "Stopping $DESC" "$NAME" - do_stop - case "$?" in - 0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;; - 2) [ "$VERBOSE" != no ] && log_end_msg 1 ;; - esac - ;; - status) - status_of_proc "$DAEMON" "$NAME" && exit 0 || exit $? - ;; - #reload|force-reload) - # - # If do_reload() is not implemented then leave this commented out - # and leave 'force-reload' as an alias for 'restart'. - # - #log_daemon_msg "Reloading $DESC" "$NAME" - #do_reload - #log_end_msg $? - #;; - restart|force-reload) - # - # If the "reload" option is implemented then remove the - # 'force-reload' alias - # - log_daemon_msg "Restarting $DESC" "$NAME" - do_stop - case "$?" in - 0|1) - do_start - case "$?" in - 0) log_end_msg 0 ;; - 1) log_end_msg 1 ;; # Old process is still running - *) log_end_msg 1 ;; # Failed to start - esac - ;; - *) - # Failed to stop - log_end_msg 1 - ;; - esac - ;; - *) - #echo "Usage: $SCRIPTNAME {start|stop|restart|reload|force-reload}" >&2 - echo "Usage: $SCRIPTNAME {start|stop|status|restart|force-reload}" >&2 - exit 3 - ;; -esac - -: diff --git a/debian/osmocom-nitb.install b/debian/osmocom-nitb.install deleted file mode 100644 index 26caf71..0000000 --- a/debian/osmocom-nitb.install +++ /dev/null @@ -1,2 +0,0 @@ -/usr/bin/osmo-nitb -openbsc/contrib/*.py usr/bin/ \ No newline at end of file diff --git a/debian/rules b/debian/rules index 4e187a6..3500fbb 100755 --- a/debian/rules +++ b/debian/rules @@ -1,32 +1,59 @@ #!/usr/bin/make -f +# You must remove unused comment lines for the released package. +# See debhelper(7) (uncomment to enable) +# This is an autogenerated template for debian/rules. +# +# Output every command that modifies files on the build system. +#export DH_VERBOSE = 1 +# +# Copy some variable definitions from pkg-info.mk and vendor.mk +# under /usr/share/dpkg/ to here if they are useful. +# +# See FEATURE AREAS/ENVIRONMENT in dpkg-buildflags(1) +# Apply all hardening options +#export DEB_BUILD_MAINT_OPTIONS = hardening=+all +# Package maintainers to append CFLAGS +#export DEB_CFLAGS_MAINT_APPEND = -Wall -pedantic +# Package maintainers to append LDFLAGS +#export DEB_LDFLAGS_MAINT_APPEND = -Wl,--as-needed +# +# With debhelper version 9 or newer, the dh command exports +# all buildflags. So there is no need to include the +# /usr/share/dpkg/buildflags.mk file here if compat is 9 or newer. +# +# These are rarely used code. (START) +# +# The following include for *.mk magically sets miscellaneous +# variables while honoring existing values of pertinent +# environment variables: +# +# Architecture-related variables such as DEB_TARGET_MULTIARCH: +#include /usr/share/dpkg/architecture.mk +# Vendor-related variables such as DEB_VENDOR: +#include /usr/share/dpkg/vendor.mk +# Package-related variables such as DEB_DISTRIBUTION +#include /usr/share/dpkg/pkg-info.mk +# +# You may alternatively set them susing a simple script such as: +# DEB_VENDOR ?= $(shell dpkg-vendor --query Vendor) +# +# These are rarely used code. (END) +# -# Uncomment this to turn on verbose mode. -#export DH_VERBOSE=1 - -DEBIAN := $(shell dpkg-parsechangelog | grep ^Version: | cut -d' ' -f2) -DEBVERS := $(shell echo '$(DEBIAN)' | cut -d- -f1) -VERSION := $(shell echo '$(DEBVERS)' | sed -e 's/[+-].*//' -e 's/~//g') - -export DEB_BUILD_MAINT_OPTIONS = hardening=+all - +# main packaging script based on dh7 syntax %: - dh $@ --sourcedirectory=openbsc --with autoreconf + dh $@ --with autoreconf -# This is needed for debian stable (squeeze) -override_dh_autoreconf: - cd openbsc && autoreconf --install --force - -override_dh_strip: - dh_strip -posmocom-bsc --dbg-package=osmocom-bsc-dbg - dh_strip -posmocom-nitb --dbg-package=osmocom-nitb-dbg - dh_strip -posmocom-ipaccess-utils --dbg-package=osmocom-ipaccess-utils-dbg - dh_strip -posmocom-bs11-utils --dbg-package=osmocom-bs11-utils-dbg - dh_strip -posmocom-sgsn --dbg-package=osmocom-sgsn-dbg - dh_strip -posmocom-gbproxy --dbg-package=osmocom-gbproxy-dbg - dh_strip -posmocom-bsc-nat --dbg-package=osmocom-bsc-nat-dbg - dh_strip -posmo-gtphub --dbg-package=osmo-gtphub-dbg - +# debmake generated override targets +# Set options for ./configure +CONFIGURE_FLAGS += --enable-iu override_dh_auto_configure: - echo $(VERSION) > openbsc/.tarball-version - dh_auto_configure --sourcedirectory=openbsc -- --enable-nat --enable-osmo-bsc --enable-smpp + dh_auto_configure -- $(CONFIGURE_FLAGS) +# +# Do not install libtool archive, python .pyc .pyo +#override_dh_install: +# dh_install --list-missing -X.la -X.pyc -X.pyo +# See https://www.debian.org/doc/manuals/developers-reference/best-pkging-practices.html#bpp-dbg +override_dh_strip: + dh_strip --dbg-package=osmo-msc-dbg -- To view, visit https://gerrit.osmocom.org/3499 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I77544cb38c31777c3fab52979d19488a63e52de3 Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: lynxis lazus From admin at opensuse.org Fri Aug 11 20:03:19 2017 From: admin at opensuse.org (OBS Notification) Date: Fri, 11 Aug 2017 20:03:19 +0000 Subject: Build failure of network:osmocom:nightly/openbsc in xUbuntu_17.04/i586 In-Reply-To: References: Message-ID: <598e0d89b5420_25b5602f84271825@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/openbsc/xUbuntu_17.04/i586 Package network:osmocom:nightly/openbsc failed to build in xUbuntu_17.04/i586 Check out the package for editing: osc checkout network:osmocom:nightly openbsc Last lines of build log: [ 172s] make[4]: Leaving directory '/usr/src/packages/BUILD/openbsc/tests' [ 172s] make[3]: Leaving directory '/usr/src/packages/BUILD/openbsc/tests' [ 172s] make[3]: Entering directory '/usr/src/packages/BUILD/openbsc' [ 172s] make[4]: Entering directory '/usr/src/packages/BUILD/openbsc' [ 172s] make[4]: Nothing to be done for 'install-exec-am'. [ 172s] /bin/mkdir -p '/usr/src/packages/BUILD/debian/tmp/usr/lib/i386-linux-gnu/pkgconfig' [ 172s] /usr/bin/install -c -m 644 openbsc.pc '/usr/src/packages/BUILD/debian/tmp/usr/lib/i386-linux-gnu/pkgconfig' [ 172s] make[4]: Leaving directory '/usr/src/packages/BUILD/openbsc' [ 172s] make[3]: Leaving directory '/usr/src/packages/BUILD/openbsc' [ 172s] make[2]: Leaving directory '/usr/src/packages/BUILD/openbsc' [ 172s] make[1]: Leaving directory '/usr/src/packages/BUILD/openbsc' [ 172s] dh_install -O--sourcedirectory=openbsc [ 172s] dh_install: Cannot find (any matches for) "/usr/bin/osmo-sgsn" (tried in "." and "debian/tmp") [ 172s] dh_install: osmocom-sgsn missing files: /usr/bin/osmo-sgsn [ 172s] dh_install: Cannot find (any matches for) "/usr/bin/osmo-gtphub" (tried in "." and "debian/tmp") [ 172s] dh_install: osmo-gtphub missing files: /usr/bin/osmo-gtphub [ 172s] dh_install: missing files, aborting [ 172s] debian/rules:13: recipe for target 'binary' failed [ 172s] make: *** [binary] Error 2 [ 172s] dpkg-buildpackage: error: fakeroot debian/rules binary gave error exit status 2 [ 172s] [ 172s] lamb54 failed "build openbsc_0.15.1.20170811.dsc" at Fri Aug 11 20:03:08 UTC 2017. [ 172s] [ 172s] ### VM INTERACTION START ### [ 175s] [ 164.411962] reboot: Power down [ 175s] ### VM INTERACTION END ### [ 175s] [ 175s] lamb54 failed "build openbsc_0.15.1.20170811.dsc" at Fri Aug 11 20:03:11 UTC 2017. [ 175s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Fri Aug 11 20:03:19 2017 From: admin at opensuse.org (OBS Notification) Date: Fri, 11 Aug 2017 20:03:19 +0000 Subject: Build failure of network:osmocom:nightly/openbsc in xUbuntu_17.04/x86_64 In-Reply-To: References: Message-ID: <598e0d8acd417_25b5602f842720bd@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/openbsc/xUbuntu_17.04/x86_64 Package network:osmocom:nightly/openbsc failed to build in xUbuntu_17.04/x86_64 Check out the package for editing: osc checkout network:osmocom:nightly openbsc Last lines of build log: [ 101s] make[4]: Leaving directory '/usr/src/packages/BUILD/openbsc/tests' [ 101s] make[3]: Leaving directory '/usr/src/packages/BUILD/openbsc/tests' [ 101s] make[3]: Entering directory '/usr/src/packages/BUILD/openbsc' [ 101s] make[4]: Entering directory '/usr/src/packages/BUILD/openbsc' [ 101s] make[4]: Nothing to be done for 'install-exec-am'. [ 101s] /bin/mkdir -p '/usr/src/packages/BUILD/debian/tmp/usr/lib/x86_64-linux-gnu/pkgconfig' [ 101s] /usr/bin/install -c -m 644 openbsc.pc '/usr/src/packages/BUILD/debian/tmp/usr/lib/x86_64-linux-gnu/pkgconfig' [ 101s] make[4]: Leaving directory '/usr/src/packages/BUILD/openbsc' [ 101s] make[3]: Leaving directory '/usr/src/packages/BUILD/openbsc' [ 101s] make[2]: Leaving directory '/usr/src/packages/BUILD/openbsc' [ 101s] make[1]: Leaving directory '/usr/src/packages/BUILD/openbsc' [ 101s] dh_install -O--sourcedirectory=openbsc [ 101s] dh_install: Cannot find (any matches for) "/usr/bin/osmo-sgsn" (tried in "." and "debian/tmp") [ 101s] dh_install: osmocom-sgsn missing files: /usr/bin/osmo-sgsn [ 101s] dh_install: Cannot find (any matches for) "/usr/bin/osmo-gtphub" (tried in "." and "debian/tmp") [ 101s] dh_install: osmo-gtphub missing files: /usr/bin/osmo-gtphub [ 101s] dh_install: missing files, aborting [ 101s] debian/rules:13: recipe for target 'binary' failed [ 101s] make: *** [binary] Error 2 [ 101s] dpkg-buildpackage: error: fakeroot debian/rules binary gave error exit status 2 [ 101s] [ 101s] build84 failed "build openbsc_0.15.1.20170811.dsc" at Fri Aug 11 20:03:09 UTC 2017. [ 101s] [ 101s] ### VM INTERACTION START ### [ 105s] [ 96.912828] reboot: Power down [ 105s] ### VM INTERACTION END ### [ 106s] [ 106s] build84 failed "build openbsc_0.15.1.20170811.dsc" at Fri Aug 11 20:03:14 UTC 2017. [ 106s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Fri Aug 11 20:03:19 2017 From: admin at opensuse.org (OBS Notification) Date: Fri, 11 Aug 2017 20:03:19 +0000 Subject: Build failure of network:osmocom:nightly/openbsc in xUbuntu_17.04/i586 In-Reply-To: References: Message-ID: <598e0d8965f13_25b5602f842717ab@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/openbsc/xUbuntu_17.04/i586 Package network:osmocom:nightly/openbsc failed to build in xUbuntu_17.04/i586 Check out the package for editing: osc checkout network:osmocom:nightly openbsc Last lines of build log: [ 172s] make[4]: Leaving directory '/usr/src/packages/BUILD/openbsc/tests' [ 172s] make[3]: Leaving directory '/usr/src/packages/BUILD/openbsc/tests' [ 172s] make[3]: Entering directory '/usr/src/packages/BUILD/openbsc' [ 172s] make[4]: Entering directory '/usr/src/packages/BUILD/openbsc' [ 172s] make[4]: Nothing to be done for 'install-exec-am'. [ 172s] /bin/mkdir -p '/usr/src/packages/BUILD/debian/tmp/usr/lib/i386-linux-gnu/pkgconfig' [ 172s] /usr/bin/install -c -m 644 openbsc.pc '/usr/src/packages/BUILD/debian/tmp/usr/lib/i386-linux-gnu/pkgconfig' [ 172s] make[4]: Leaving directory '/usr/src/packages/BUILD/openbsc' [ 172s] make[3]: Leaving directory '/usr/src/packages/BUILD/openbsc' [ 172s] make[2]: Leaving directory '/usr/src/packages/BUILD/openbsc' [ 172s] make[1]: Leaving directory '/usr/src/packages/BUILD/openbsc' [ 172s] dh_install -O--sourcedirectory=openbsc [ 172s] dh_install: Cannot find (any matches for) "/usr/bin/osmo-sgsn" (tried in "." and "debian/tmp") [ 172s] dh_install: osmocom-sgsn missing files: /usr/bin/osmo-sgsn [ 172s] dh_install: Cannot find (any matches for) "/usr/bin/osmo-gtphub" (tried in "." and "debian/tmp") [ 172s] dh_install: osmo-gtphub missing files: /usr/bin/osmo-gtphub [ 172s] dh_install: missing files, aborting [ 172s] debian/rules:13: recipe for target 'binary' failed [ 172s] make: *** [binary] Error 2 [ 172s] dpkg-buildpackage: error: fakeroot debian/rules binary gave error exit status 2 [ 172s] [ 172s] lamb54 failed "build openbsc_0.15.1.20170811.dsc" at Fri Aug 11 20:03:08 UTC 2017. [ 172s] [ 172s] ### VM INTERACTION START ### [ 175s] [ 164.411962] reboot: Power down [ 175s] ### VM INTERACTION END ### [ 175s] [ 175s] lamb54 failed "build openbsc_0.15.1.20170811.dsc" at Fri Aug 11 20:03:11 UTC 2017. [ 175s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Fri Aug 11 20:03:19 2017 From: admin at opensuse.org (OBS Notification) Date: Fri, 11 Aug 2017 20:03:19 +0000 Subject: Build failure of network:osmocom:nightly/openbsc in xUbuntu_17.04/x86_64 In-Reply-To: References: Message-ID: <598e0d8a98415_25b5602f842719d8@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/openbsc/xUbuntu_17.04/x86_64 Package network:osmocom:nightly/openbsc failed to build in xUbuntu_17.04/x86_64 Check out the package for editing: osc checkout network:osmocom:nightly openbsc Last lines of build log: [ 101s] make[4]: Leaving directory '/usr/src/packages/BUILD/openbsc/tests' [ 101s] make[3]: Leaving directory '/usr/src/packages/BUILD/openbsc/tests' [ 101s] make[3]: Entering directory '/usr/src/packages/BUILD/openbsc' [ 101s] make[4]: Entering directory '/usr/src/packages/BUILD/openbsc' [ 101s] make[4]: Nothing to be done for 'install-exec-am'. [ 101s] /bin/mkdir -p '/usr/src/packages/BUILD/debian/tmp/usr/lib/x86_64-linux-gnu/pkgconfig' [ 101s] /usr/bin/install -c -m 644 openbsc.pc '/usr/src/packages/BUILD/debian/tmp/usr/lib/x86_64-linux-gnu/pkgconfig' [ 101s] make[4]: Leaving directory '/usr/src/packages/BUILD/openbsc' [ 101s] make[3]: Leaving directory '/usr/src/packages/BUILD/openbsc' [ 101s] make[2]: Leaving directory '/usr/src/packages/BUILD/openbsc' [ 101s] make[1]: Leaving directory '/usr/src/packages/BUILD/openbsc' [ 101s] dh_install -O--sourcedirectory=openbsc [ 101s] dh_install: Cannot find (any matches for) "/usr/bin/osmo-sgsn" (tried in "." and "debian/tmp") [ 101s] dh_install: osmocom-sgsn missing files: /usr/bin/osmo-sgsn [ 101s] dh_install: Cannot find (any matches for) "/usr/bin/osmo-gtphub" (tried in "." and "debian/tmp") [ 101s] dh_install: osmo-gtphub missing files: /usr/bin/osmo-gtphub [ 101s] dh_install: missing files, aborting [ 101s] debian/rules:13: recipe for target 'binary' failed [ 101s] make: *** [binary] Error 2 [ 101s] dpkg-buildpackage: error: fakeroot debian/rules binary gave error exit status 2 [ 101s] [ 101s] build84 failed "build openbsc_0.15.1.20170811.dsc" at Fri Aug 11 20:03:09 UTC 2017. [ 101s] [ 101s] ### VM INTERACTION START ### [ 105s] [ 96.912828] reboot: Power down [ 105s] ### VM INTERACTION END ### [ 106s] [ 106s] build84 failed "build openbsc_0.15.1.20170811.dsc" at Fri Aug 11 20:03:14 UTC 2017. [ 106s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Fri Aug 11 20:04:10 2017 From: admin at opensuse.org (OBS Notification) Date: Fri, 11 Aug 2017 20:04:10 +0000 Subject: Build failure of network:osmocom:nightly/openbsc in Debian_9.0/x86_64 In-Reply-To: References: Message-ID: <598e0dc4b9068_25b5602f8427240@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/openbsc/Debian_9.0/x86_64 Package network:osmocom:nightly/openbsc failed to build in Debian_9.0/x86_64 Check out the package for editing: osc checkout network:osmocom:nightly openbsc Last lines of build log: [ 176s] make[4]: Leaving directory '/usr/src/packages/BUILD/openbsc/tests' [ 176s] make[3]: Leaving directory '/usr/src/packages/BUILD/openbsc/tests' [ 176s] make[3]: Entering directory '/usr/src/packages/BUILD/openbsc' [ 176s] make[4]: Entering directory '/usr/src/packages/BUILD/openbsc' [ 176s] make[4]: Nothing to be done for 'install-exec-am'. [ 176s] /bin/mkdir -p '/usr/src/packages/BUILD/debian/tmp/usr/lib/x86_64-linux-gnu/pkgconfig' [ 176s] /usr/bin/install -c -m 644 openbsc.pc '/usr/src/packages/BUILD/debian/tmp/usr/lib/x86_64-linux-gnu/pkgconfig' [ 176s] make[4]: Leaving directory '/usr/src/packages/BUILD/openbsc' [ 176s] make[3]: Leaving directory '/usr/src/packages/BUILD/openbsc' [ 176s] make[2]: Leaving directory '/usr/src/packages/BUILD/openbsc' [ 176s] make[1]: Leaving directory '/usr/src/packages/BUILD/openbsc' [ 176s] dh_install -O--sourcedirectory=openbsc [ 176s] dh_install: Cannot find (any matches for) "/usr/bin/osmo-sgsn" (tried in "." and "debian/tmp") [ 176s] dh_install: osmocom-sgsn missing files: /usr/bin/osmo-sgsn [ 176s] dh_install: Cannot find (any matches for) "/usr/bin/osmo-gtphub" (tried in "." and "debian/tmp") [ 176s] dh_install: osmo-gtphub missing files: /usr/bin/osmo-gtphub [ 176s] dh_install: missing files, aborting [ 176s] debian/rules:13: recipe for target 'binary' failed [ 176s] make: *** [binary] Error 2 [ 176s] dpkg-buildpackage: error: fakeroot debian/rules binary gave error exit status 2 [ 176s] [ 176s] lamb17 failed "build openbsc_0.15.1.20170811.dsc" at Fri Aug 11 20:03:59 UTC 2017. [ 176s] [ 176s] ### VM INTERACTION START ### [ 180s] [ 168.503704] reboot: Power down [ 180s] ### VM INTERACTION END ### [ 180s] [ 180s] lamb17 failed "build openbsc_0.15.1.20170811.dsc" at Fri Aug 11 20:04:03 UTC 2017. [ 180s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Fri Aug 11 20:04:10 2017 From: admin at opensuse.org (OBS Notification) Date: Fri, 11 Aug 2017 20:04:10 +0000 Subject: Build failure of network:osmocom:nightly/openbsc in Debian_9.0/x86_64 In-Reply-To: References: Message-ID: <598e0dc53c425_25b5602f842725e2@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/openbsc/Debian_9.0/x86_64 Package network:osmocom:nightly/openbsc failed to build in Debian_9.0/x86_64 Check out the package for editing: osc checkout network:osmocom:nightly openbsc Last lines of build log: [ 176s] make[4]: Leaving directory '/usr/src/packages/BUILD/openbsc/tests' [ 176s] make[3]: Leaving directory '/usr/src/packages/BUILD/openbsc/tests' [ 176s] make[3]: Entering directory '/usr/src/packages/BUILD/openbsc' [ 176s] make[4]: Entering directory '/usr/src/packages/BUILD/openbsc' [ 176s] make[4]: Nothing to be done for 'install-exec-am'. [ 176s] /bin/mkdir -p '/usr/src/packages/BUILD/debian/tmp/usr/lib/x86_64-linux-gnu/pkgconfig' [ 176s] /usr/bin/install -c -m 644 openbsc.pc '/usr/src/packages/BUILD/debian/tmp/usr/lib/x86_64-linux-gnu/pkgconfig' [ 176s] make[4]: Leaving directory '/usr/src/packages/BUILD/openbsc' [ 176s] make[3]: Leaving directory '/usr/src/packages/BUILD/openbsc' [ 176s] make[2]: Leaving directory '/usr/src/packages/BUILD/openbsc' [ 176s] make[1]: Leaving directory '/usr/src/packages/BUILD/openbsc' [ 176s] dh_install -O--sourcedirectory=openbsc [ 176s] dh_install: Cannot find (any matches for) "/usr/bin/osmo-sgsn" (tried in "." and "debian/tmp") [ 176s] dh_install: osmocom-sgsn missing files: /usr/bin/osmo-sgsn [ 176s] dh_install: Cannot find (any matches for) "/usr/bin/osmo-gtphub" (tried in "." and "debian/tmp") [ 176s] dh_install: osmo-gtphub missing files: /usr/bin/osmo-gtphub [ 176s] dh_install: missing files, aborting [ 176s] debian/rules:13: recipe for target 'binary' failed [ 176s] make: *** [binary] Error 2 [ 176s] dpkg-buildpackage: error: fakeroot debian/rules binary gave error exit status 2 [ 176s] [ 176s] lamb17 failed "build openbsc_0.15.1.20170811.dsc" at Fri Aug 11 20:03:59 UTC 2017. [ 176s] [ 176s] ### VM INTERACTION START ### [ 180s] [ 168.503704] reboot: Power down [ 180s] ### VM INTERACTION END ### [ 180s] [ 180s] lamb17 failed "build openbsc_0.15.1.20170811.dsc" at Fri Aug 11 20:04:03 UTC 2017. [ 180s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Fri Aug 11 20:06:34 2017 From: admin at opensuse.org (OBS Notification) Date: Fri, 11 Aug 2017 20:06:34 +0000 Subject: Build failure of network:osmocom:nightly/openbsc in xUbuntu_16.10/x86_64 In-Reply-To: References: Message-ID: <598e0e58f3b4d_25b5602f84273948@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/openbsc/xUbuntu_16.10/x86_64 Package network:osmocom:nightly/openbsc failed to build in xUbuntu_16.10/x86_64 Check out the package for editing: osc checkout network:osmocom:nightly openbsc Last lines of build log: [ 188s] make[4]: Leaving directory '/usr/src/packages/BUILD/openbsc/tests' [ 188s] make[3]: Leaving directory '/usr/src/packages/BUILD/openbsc/tests' [ 188s] make[3]: Entering directory '/usr/src/packages/BUILD/openbsc' [ 188s] make[4]: Entering directory '/usr/src/packages/BUILD/openbsc' [ 188s] make[4]: Nothing to be done for 'install-exec-am'. [ 188s] /bin/mkdir -p '/usr/src/packages/BUILD/debian/tmp/usr/lib/x86_64-linux-gnu/pkgconfig' [ 188s] /usr/bin/install -c -m 644 openbsc.pc '/usr/src/packages/BUILD/debian/tmp/usr/lib/x86_64-linux-gnu/pkgconfig' [ 188s] make[4]: Leaving directory '/usr/src/packages/BUILD/openbsc' [ 188s] make[3]: Leaving directory '/usr/src/packages/BUILD/openbsc' [ 188s] make[2]: Leaving directory '/usr/src/packages/BUILD/openbsc' [ 188s] make[1]: Leaving directory '/usr/src/packages/BUILD/openbsc' [ 188s] dh_install -O--sourcedirectory=openbsc [ 188s] dh_install: Cannot find (any matches for) "/usr/bin/osmo-sgsn" (tried in "." and "debian/tmp") [ 188s] dh_install: osmocom-sgsn missing files: /usr/bin/osmo-sgsn [ 188s] dh_install: Cannot find (any matches for) "/usr/bin/osmo-gtphub" (tried in "." and "debian/tmp") [ 188s] dh_install: osmo-gtphub missing files: /usr/bin/osmo-gtphub [ 188s] dh_install: missing files, aborting [ 188s] debian/rules:13: recipe for target 'binary' failed [ 188s] make: *** [binary] Error 2 [ 188s] dpkg-buildpackage: error: fakeroot debian/rules binary gave error exit status 2 [ 188s] [ 188s] cloud137 failed "build openbsc_0.15.1.20170811.dsc" at Fri Aug 11 20:06:23 UTC 2017. [ 188s] [ 188s] ### VM INTERACTION START ### [ 191s] [ 170.110907] reboot: Power down [ 193s] ### VM INTERACTION END ### [ 193s] [ 193s] cloud137 failed "build openbsc_0.15.1.20170811.dsc" at Fri Aug 11 20:06:29 UTC 2017. [ 193s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Fri Aug 11 20:06:34 2017 From: admin at opensuse.org (OBS Notification) Date: Fri, 11 Aug 2017 20:06:34 +0000 Subject: Build failure of network:osmocom:nightly/openbsc in xUbuntu_16.10/x86_64 In-Reply-To: References: Message-ID: <598e0e5a2c9a5_25b5602f842741db@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/openbsc/xUbuntu_16.10/x86_64 Package network:osmocom:nightly/openbsc failed to build in xUbuntu_16.10/x86_64 Check out the package for editing: osc checkout network:osmocom:nightly openbsc Last lines of build log: [ 188s] make[4]: Leaving directory '/usr/src/packages/BUILD/openbsc/tests' [ 188s] make[3]: Leaving directory '/usr/src/packages/BUILD/openbsc/tests' [ 188s] make[3]: Entering directory '/usr/src/packages/BUILD/openbsc' [ 188s] make[4]: Entering directory '/usr/src/packages/BUILD/openbsc' [ 188s] make[4]: Nothing to be done for 'install-exec-am'. [ 188s] /bin/mkdir -p '/usr/src/packages/BUILD/debian/tmp/usr/lib/x86_64-linux-gnu/pkgconfig' [ 188s] /usr/bin/install -c -m 644 openbsc.pc '/usr/src/packages/BUILD/debian/tmp/usr/lib/x86_64-linux-gnu/pkgconfig' [ 188s] make[4]: Leaving directory '/usr/src/packages/BUILD/openbsc' [ 188s] make[3]: Leaving directory '/usr/src/packages/BUILD/openbsc' [ 188s] make[2]: Leaving directory '/usr/src/packages/BUILD/openbsc' [ 188s] make[1]: Leaving directory '/usr/src/packages/BUILD/openbsc' [ 188s] dh_install -O--sourcedirectory=openbsc [ 188s] dh_install: Cannot find (any matches for) "/usr/bin/osmo-sgsn" (tried in "." and "debian/tmp") [ 188s] dh_install: osmocom-sgsn missing files: /usr/bin/osmo-sgsn [ 188s] dh_install: Cannot find (any matches for) "/usr/bin/osmo-gtphub" (tried in "." and "debian/tmp") [ 188s] dh_install: osmo-gtphub missing files: /usr/bin/osmo-gtphub [ 188s] dh_install: missing files, aborting [ 188s] debian/rules:13: recipe for target 'binary' failed [ 188s] make: *** [binary] Error 2 [ 188s] dpkg-buildpackage: error: fakeroot debian/rules binary gave error exit status 2 [ 188s] [ 188s] cloud137 failed "build openbsc_0.15.1.20170811.dsc" at Fri Aug 11 20:06:23 UTC 2017. [ 188s] [ 188s] ### VM INTERACTION START ### [ 191s] [ 170.110907] reboot: Power down [ 193s] ### VM INTERACTION END ### [ 193s] [ 193s] cloud137 failed "build openbsc_0.15.1.20170811.dsc" at Fri Aug 11 20:06:29 UTC 2017. [ 193s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Fri Aug 11 20:06:34 2017 From: admin at opensuse.org (OBS Notification) Date: Fri, 11 Aug 2017 20:06:34 +0000 Subject: Build failure of network:osmocom:nightly/openbsc in xUbuntu_16.04/x86_64 In-Reply-To: References: Message-ID: <598e0e5b3e1df_25b5602f84274337@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/openbsc/xUbuntu_16.04/x86_64 Package network:osmocom:nightly/openbsc failed to build in xUbuntu_16.04/x86_64 Check out the package for editing: osc checkout network:osmocom:nightly openbsc Last lines of build log: [ 186s] make[5]: Nothing to be done for 'install-data-am'. [ 186s] make[5]: Leaving directory '/usr/src/packages/BUILD/openbsc/tests' [ 186s] make[4]: Leaving directory '/usr/src/packages/BUILD/openbsc/tests' [ 186s] make[3]: Leaving directory '/usr/src/packages/BUILD/openbsc/tests' [ 186s] make[3]: Entering directory '/usr/src/packages/BUILD/openbsc' [ 186s] make[4]: Entering directory '/usr/src/packages/BUILD/openbsc' [ 186s] make[4]: Nothing to be done for 'install-exec-am'. [ 186s] /bin/mkdir -p '/usr/src/packages/BUILD/debian/tmp/usr/lib/x86_64-linux-gnu/pkgconfig' [ 186s] /usr/bin/install -c -m 644 openbsc.pc '/usr/src/packages/BUILD/debian/tmp/usr/lib/x86_64-linux-gnu/pkgconfig' [ 186s] make[4]: Leaving directory '/usr/src/packages/BUILD/openbsc' [ 186s] make[3]: Leaving directory '/usr/src/packages/BUILD/openbsc' [ 186s] make[2]: Leaving directory '/usr/src/packages/BUILD/openbsc' [ 186s] make[1]: Leaving directory '/usr/src/packages/BUILD/openbsc' [ 186s] dh_install -O--sourcedirectory=openbsc [ 186s] dh_install: osmocom-sgsn missing files: /usr/bin/osmo-sgsn [ 186s] dh_install: osmo-gtphub missing files: /usr/bin/osmo-gtphub [ 186s] dh_install: missing files, aborting [ 186s] debian/rules:13: recipe for target 'binary' failed [ 186s] make: *** [binary] Error 2 [ 186s] dpkg-buildpackage: error: fakeroot debian/rules binary gave error exit status 2 [ 186s] [ 186s] lamb53 failed "build openbsc_0.15.1.20170811.dsc" at Fri Aug 11 20:06:20 UTC 2017. [ 186s] [ 186s] ### VM INTERACTION START ### [ 190s] [ 178.677392] reboot: Power down [ 190s] ### VM INTERACTION END ### [ 190s] [ 190s] lamb53 failed "build openbsc_0.15.1.20170811.dsc" at Fri Aug 11 20:06:24 UTC 2017. [ 190s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Fri Aug 11 20:06:34 2017 From: admin at opensuse.org (OBS Notification) Date: Fri, 11 Aug 2017 20:06:34 +0000 Subject: Build failure of network:osmocom:nightly/openbsc in xUbuntu_16.04/x86_64 In-Reply-To: References: Message-ID: <598e0e5c38956_25b5602f84274420@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/openbsc/xUbuntu_16.04/x86_64 Package network:osmocom:nightly/openbsc failed to build in xUbuntu_16.04/x86_64 Check out the package for editing: osc checkout network:osmocom:nightly openbsc Last lines of build log: [ 186s] make[5]: Nothing to be done for 'install-data-am'. [ 186s] make[5]: Leaving directory '/usr/src/packages/BUILD/openbsc/tests' [ 186s] make[4]: Leaving directory '/usr/src/packages/BUILD/openbsc/tests' [ 186s] make[3]: Leaving directory '/usr/src/packages/BUILD/openbsc/tests' [ 186s] make[3]: Entering directory '/usr/src/packages/BUILD/openbsc' [ 186s] make[4]: Entering directory '/usr/src/packages/BUILD/openbsc' [ 186s] make[4]: Nothing to be done for 'install-exec-am'. [ 186s] /bin/mkdir -p '/usr/src/packages/BUILD/debian/tmp/usr/lib/x86_64-linux-gnu/pkgconfig' [ 186s] /usr/bin/install -c -m 644 openbsc.pc '/usr/src/packages/BUILD/debian/tmp/usr/lib/x86_64-linux-gnu/pkgconfig' [ 186s] make[4]: Leaving directory '/usr/src/packages/BUILD/openbsc' [ 186s] make[3]: Leaving directory '/usr/src/packages/BUILD/openbsc' [ 186s] make[2]: Leaving directory '/usr/src/packages/BUILD/openbsc' [ 186s] make[1]: Leaving directory '/usr/src/packages/BUILD/openbsc' [ 186s] dh_install -O--sourcedirectory=openbsc [ 186s] dh_install: osmocom-sgsn missing files: /usr/bin/osmo-sgsn [ 186s] dh_install: osmo-gtphub missing files: /usr/bin/osmo-gtphub [ 186s] dh_install: missing files, aborting [ 186s] debian/rules:13: recipe for target 'binary' failed [ 186s] make: *** [binary] Error 2 [ 186s] dpkg-buildpackage: error: fakeroot debian/rules binary gave error exit status 2 [ 186s] [ 186s] lamb53 failed "build openbsc_0.15.1.20170811.dsc" at Fri Aug 11 20:06:20 UTC 2017. [ 186s] [ 186s] ### VM INTERACTION START ### [ 190s] [ 178.677392] reboot: Power down [ 190s] ### VM INTERACTION END ### [ 190s] [ 190s] lamb53 failed "build openbsc_0.15.1.20170811.dsc" at Fri Aug 11 20:06:24 UTC 2017. [ 190s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Fri Aug 11 20:07:59 2017 From: admin at opensuse.org (OBS Notification) Date: Fri, 11 Aug 2017 20:07:59 +0000 Subject: Build failure of network:osmocom:nightly/openbsc in Debian_9.0/i586 In-Reply-To: References: Message-ID: <598e0eb3c9361_25b5602f842745f9@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/openbsc/Debian_9.0/i586 Package network:osmocom:nightly/openbsc failed to build in Debian_9.0/i586 Check out the package for editing: osc checkout network:osmocom:nightly openbsc Last lines of build log: [ 179s] make[4]: Leaving directory '/usr/src/packages/BUILD/openbsc/tests' [ 179s] make[3]: Leaving directory '/usr/src/packages/BUILD/openbsc/tests' [ 179s] make[3]: Entering directory '/usr/src/packages/BUILD/openbsc' [ 179s] make[4]: Entering directory '/usr/src/packages/BUILD/openbsc' [ 179s] make[4]: Nothing to be done for 'install-exec-am'. [ 179s] /bin/mkdir -p '/usr/src/packages/BUILD/debian/tmp/usr/lib/i386-linux-gnu/pkgconfig' [ 179s] /usr/bin/install -c -m 644 openbsc.pc '/usr/src/packages/BUILD/debian/tmp/usr/lib/i386-linux-gnu/pkgconfig' [ 179s] make[4]: Leaving directory '/usr/src/packages/BUILD/openbsc' [ 179s] make[3]: Leaving directory '/usr/src/packages/BUILD/openbsc' [ 179s] make[2]: Leaving directory '/usr/src/packages/BUILD/openbsc' [ 179s] make[1]: Leaving directory '/usr/src/packages/BUILD/openbsc' [ 179s] dh_install -O--sourcedirectory=openbsc [ 179s] dh_install: Cannot find (any matches for) "/usr/bin/osmo-sgsn" (tried in "." and "debian/tmp") [ 179s] dh_install: osmocom-sgsn missing files: /usr/bin/osmo-sgsn [ 179s] dh_install: Cannot find (any matches for) "/usr/bin/osmo-gtphub" (tried in "." and "debian/tmp") [ 179s] dh_install: osmo-gtphub missing files: /usr/bin/osmo-gtphub [ 179s] dh_install: missing files, aborting [ 179s] debian/rules:13: recipe for target 'binary' failed [ 179s] make: *** [binary] Error 2 [ 179s] dpkg-buildpackage: error: fakeroot debian/rules binary gave error exit status 2 [ 179s] [ 179s] lamb09 failed "build openbsc_0.15.1.20170811.dsc" at Fri Aug 11 20:07:50 UTC 2017. [ 179s] [ 179s] ### VM INTERACTION START ### [ 183s] [ 170.722626] reboot: Power down [ 183s] ### VM INTERACTION END ### [ 183s] [ 183s] lamb09 failed "build openbsc_0.15.1.20170811.dsc" at Fri Aug 11 20:07:54 UTC 2017. [ 183s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Fri Aug 11 20:07:59 2017 From: admin at opensuse.org (OBS Notification) Date: Fri, 11 Aug 2017 20:07:59 +0000 Subject: Build failure of network:osmocom:nightly/openbsc in Debian_9.0/i586 In-Reply-To: References: Message-ID: <598e0eb4a0c15_25b5602f8427467d@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/openbsc/Debian_9.0/i586 Package network:osmocom:nightly/openbsc failed to build in Debian_9.0/i586 Check out the package for editing: osc checkout network:osmocom:nightly openbsc Last lines of build log: [ 179s] make[4]: Leaving directory '/usr/src/packages/BUILD/openbsc/tests' [ 179s] make[3]: Leaving directory '/usr/src/packages/BUILD/openbsc/tests' [ 179s] make[3]: Entering directory '/usr/src/packages/BUILD/openbsc' [ 179s] make[4]: Entering directory '/usr/src/packages/BUILD/openbsc' [ 179s] make[4]: Nothing to be done for 'install-exec-am'. [ 179s] /bin/mkdir -p '/usr/src/packages/BUILD/debian/tmp/usr/lib/i386-linux-gnu/pkgconfig' [ 179s] /usr/bin/install -c -m 644 openbsc.pc '/usr/src/packages/BUILD/debian/tmp/usr/lib/i386-linux-gnu/pkgconfig' [ 179s] make[4]: Leaving directory '/usr/src/packages/BUILD/openbsc' [ 179s] make[3]: Leaving directory '/usr/src/packages/BUILD/openbsc' [ 179s] make[2]: Leaving directory '/usr/src/packages/BUILD/openbsc' [ 179s] make[1]: Leaving directory '/usr/src/packages/BUILD/openbsc' [ 179s] dh_install -O--sourcedirectory=openbsc [ 179s] dh_install: Cannot find (any matches for) "/usr/bin/osmo-sgsn" (tried in "." and "debian/tmp") [ 179s] dh_install: osmocom-sgsn missing files: /usr/bin/osmo-sgsn [ 179s] dh_install: Cannot find (any matches for) "/usr/bin/osmo-gtphub" (tried in "." and "debian/tmp") [ 179s] dh_install: osmo-gtphub missing files: /usr/bin/osmo-gtphub [ 179s] dh_install: missing files, aborting [ 179s] debian/rules:13: recipe for target 'binary' failed [ 179s] make: *** [binary] Error 2 [ 179s] dpkg-buildpackage: error: fakeroot debian/rules binary gave error exit status 2 [ 179s] [ 179s] lamb09 failed "build openbsc_0.15.1.20170811.dsc" at Fri Aug 11 20:07:50 UTC 2017. [ 179s] [ 179s] ### VM INTERACTION START ### [ 183s] [ 170.722626] reboot: Power down [ 183s] ### VM INTERACTION END ### [ 183s] [ 183s] lamb09 failed "build openbsc_0.15.1.20170811.dsc" at Fri Aug 11 20:07:54 UTC 2017. [ 183s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Fri Aug 11 20:11:40 2017 From: admin at opensuse.org (OBS Notification) Date: Fri, 11 Aug 2017 20:11:40 +0000 Subject: Build failure of network:osmocom:nightly/openbsc in xUbuntu_16.10/i586 In-Reply-To: References: Message-ID: <598e0f89ea9a7_25b5602f84275771@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/openbsc/xUbuntu_16.10/i586 Package network:osmocom:nightly/openbsc failed to build in xUbuntu_16.10/i586 Check out the package for editing: osc checkout network:osmocom:nightly openbsc Last lines of build log: [ 159s] make[4]: Leaving directory '/usr/src/packages/BUILD/openbsc/tests' [ 159s] make[3]: Leaving directory '/usr/src/packages/BUILD/openbsc/tests' [ 159s] make[3]: Entering directory '/usr/src/packages/BUILD/openbsc' [ 159s] make[4]: Entering directory '/usr/src/packages/BUILD/openbsc' [ 159s] make[4]: Nothing to be done for 'install-exec-am'. [ 159s] /bin/mkdir -p '/usr/src/packages/BUILD/debian/tmp/usr/lib/i386-linux-gnu/pkgconfig' [ 159s] /usr/bin/install -c -m 644 openbsc.pc '/usr/src/packages/BUILD/debian/tmp/usr/lib/i386-linux-gnu/pkgconfig' [ 159s] make[4]: Leaving directory '/usr/src/packages/BUILD/openbsc' [ 159s] make[3]: Leaving directory '/usr/src/packages/BUILD/openbsc' [ 159s] make[2]: Leaving directory '/usr/src/packages/BUILD/openbsc' [ 159s] make[1]: Leaving directory '/usr/src/packages/BUILD/openbsc' [ 159s] dh_install -O--sourcedirectory=openbsc [ 159s] dh_install: Cannot find (any matches for) "/usr/bin/osmo-sgsn" (tried in "." and "debian/tmp") [ 159s] dh_install: osmocom-sgsn missing files: /usr/bin/osmo-sgsn [ 159s] dh_install: Cannot find (any matches for) "/usr/bin/osmo-gtphub" (tried in "." and "debian/tmp") [ 159s] dh_install: osmo-gtphub missing files: /usr/bin/osmo-gtphub [ 159s] dh_install: missing files, aborting [ 159s] debian/rules:13: recipe for target 'binary' failed [ 159s] make: *** [binary] Error 2 [ 159s] dpkg-buildpackage: error: fakeroot debian/rules binary gave error exit status 2 [ 159s] [ 159s] lamb12 failed "build openbsc_0.15.1.20170811.dsc" at Fri Aug 11 20:11:24 UTC 2017. [ 159s] [ 159s] ### VM INTERACTION START ### [ 162s] [ 151.517993] reboot: Power down [ 162s] ### VM INTERACTION END ### [ 162s] [ 162s] lamb12 failed "build openbsc_0.15.1.20170811.dsc" at Fri Aug 11 20:11:27 UTC 2017. [ 162s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Fri Aug 11 20:11:40 2017 From: admin at opensuse.org (OBS Notification) Date: Fri, 11 Aug 2017 20:11:40 +0000 Subject: Build failure of network:osmocom:nightly/openbsc in xUbuntu_16.10/i586 In-Reply-To: References: Message-ID: <598e0f8a4899e_25b5602f842758b@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/openbsc/xUbuntu_16.10/i586 Package network:osmocom:nightly/openbsc failed to build in xUbuntu_16.10/i586 Check out the package for editing: osc checkout network:osmocom:nightly openbsc Last lines of build log: [ 159s] make[4]: Leaving directory '/usr/src/packages/BUILD/openbsc/tests' [ 159s] make[3]: Leaving directory '/usr/src/packages/BUILD/openbsc/tests' [ 159s] make[3]: Entering directory '/usr/src/packages/BUILD/openbsc' [ 159s] make[4]: Entering directory '/usr/src/packages/BUILD/openbsc' [ 159s] make[4]: Nothing to be done for 'install-exec-am'. [ 159s] /bin/mkdir -p '/usr/src/packages/BUILD/debian/tmp/usr/lib/i386-linux-gnu/pkgconfig' [ 159s] /usr/bin/install -c -m 644 openbsc.pc '/usr/src/packages/BUILD/debian/tmp/usr/lib/i386-linux-gnu/pkgconfig' [ 159s] make[4]: Leaving directory '/usr/src/packages/BUILD/openbsc' [ 159s] make[3]: Leaving directory '/usr/src/packages/BUILD/openbsc' [ 159s] make[2]: Leaving directory '/usr/src/packages/BUILD/openbsc' [ 159s] make[1]: Leaving directory '/usr/src/packages/BUILD/openbsc' [ 159s] dh_install -O--sourcedirectory=openbsc [ 159s] dh_install: Cannot find (any matches for) "/usr/bin/osmo-sgsn" (tried in "." and "debian/tmp") [ 159s] dh_install: osmocom-sgsn missing files: /usr/bin/osmo-sgsn [ 159s] dh_install: Cannot find (any matches for) "/usr/bin/osmo-gtphub" (tried in "." and "debian/tmp") [ 159s] dh_install: osmo-gtphub missing files: /usr/bin/osmo-gtphub [ 159s] dh_install: missing files, aborting [ 159s] debian/rules:13: recipe for target 'binary' failed [ 159s] make: *** [binary] Error 2 [ 159s] dpkg-buildpackage: error: fakeroot debian/rules binary gave error exit status 2 [ 159s] [ 159s] lamb12 failed "build openbsc_0.15.1.20170811.dsc" at Fri Aug 11 20:11:24 UTC 2017. [ 159s] [ 159s] ### VM INTERACTION START ### [ 162s] [ 151.517993] reboot: Power down [ 162s] ### VM INTERACTION END ### [ 162s] [ 162s] lamb12 failed "build openbsc_0.15.1.20170811.dsc" at Fri Aug 11 20:11:27 UTC 2017. [ 162s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From gerrit-no-reply at lists.osmocom.org Fri Aug 11 23:53:53 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 11 Aug 2017 23:53:53 +0000 Subject: osmo-msc[master]: examples: Change IP address of config files In-Reply-To: References: Message-ID: Patch Set 2: Hmm. In the example config file, we set a local IP address that is useful for OE packaging, because it matches a sysmocom device's actual IP address configuration. It's a good idea to actually use the example and thus be sure that we have a usable example config in doc/. But this now fails the python tests that try to launch an SGSN binding to a local address of 10.23.24.1. The 127.0.0.1 worked because it is available everywhere. It seems that we cannot use the example for OE as-is. Solution pending. -- To view, visit https://gerrit.osmocom.org/3419 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ie3a25f6771ed6e620cb2b315638c622a9a24e530 Gerrit-PatchSet: 2 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: daniel Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sat Aug 12 01:13:49 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sat, 12 Aug 2017 01:13:49 +0000 Subject: osmo-msc[master]: Implement AoIP, port to M3UA SIGTRAN (large addition and ref... In-Reply-To: References: Message-ID: Patch Set 1: Code-Review-1 (1 comment) https://gerrit.osmocom.org/#/c/3486/1/src/osmo-bsc/osmo_bsc_vty.c File src/osmo-bsc/osmo_bsc_vty.c: Line 192: * store the string names instead. */ This has to be fixed before the vty tests can go through. Currently it prints '(null)' as address name for the reason described in this FIXME comment, which obviously cannot be read back in. -- To view, visit https://gerrit.osmocom.org/3486 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I5ae4e05ee7c57cad341ea5e86af37c1f6b0ffa77 Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: dexter Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Sat Aug 12 02:17:13 2017 From: gerrit-no-reply at lists.osmocom.org (lynxis lazus) Date: Sat, 12 Aug 2017 02:17:13 +0000 Subject: [PATCH] libasn1c[master]: add /debian to build a package In-Reply-To: References: Message-ID: Hello Neels Hofmeyr, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3440 to look at the new patch set (#2). add /debian to build a package debian files need a release so start with release 0.1.0 Change-Id: I135d975b84027d51cb1dc534e04dd314bbd20289 --- A debian/changelog A debian/compat A debian/control A debian/copyright A debian/libasn1c-dev.install A debian/libasn1c0.install A debian/rules A debian/source/format 8 files changed, 168 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libasn1c refs/changes/40/3440/2 diff --git a/debian/changelog b/debian/changelog new file mode 100644 index 0000000..f56c11a --- /dev/null +++ b/debian/changelog @@ -0,0 +1,5 @@ +libasn1c (0.1.0) UNRELEASED; urgency=low + + * Initial release. + + -- Alexander Couzens Sun, 06 Aug 2017 22:25:03 +0000 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..4313249 --- /dev/null +++ b/debian/control @@ -0,0 +1,33 @@ +Source: libasn1c +Section: libs +Priority: extra +Maintainer: Alexander Couzens +Build-Depends: debhelper (>=9), + dh-autoreconf, + libtalloc-dev +Standards-Version: 3.9.8 +Vcs-Git: git://git.osmocom.org/libasn1c.git +Vcs-Browser: http://git.osmocom.org/gitweb?p=libasn1c.git;a=summary +Homepage: https://projects.osmocom.org/projects/libasn1c + +Package: libasn1c0 +Section: libs +Architecture: any +Multi-Arch: same +Pre-Depends: ${misc:Pre-Depends} +Depends: ${misc:Depends}, ${shlibs:Depends} +Description: asn1c runtime code as shared library + +Package: libasn1c-dbg +Section: debug +Architecture: any +Multi-Arch: same +Depends: libasn1c0 (= ${binary:Version}), ${misc:Depends} +Description: asn1c runtime code as shared library + +Package: libasn1c-dev +Section: libdevel +Architecture: any +Multi-Arch: same +Depends: libasn1c0 (= ${binary:Version}), ${misc:Depends} +Description: asn1c runtime code as shared library diff --git a/debian/copyright b/debian/copyright new file mode 100644 index 0000000..91a7cb9 --- /dev/null +++ b/debian/copyright @@ -0,0 +1,64 @@ +Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ +Upstream-Name: libasn1c +Source: git://git.osmocom.org/libasn1c + +Files: * +Copyright: 2005-2014 Lev Walkin +License: BSD-3-Clause + +Files: src/xer_support.c +Copyright: 2003,2004 X/IO Labs, xiolabs.com. + 2003,2004,2005 Lev Walkin . +License: BSD-3-Clause + +Files: include/asn1c/xer_support.h +Copyright: 2003,2004 X/IO Labs, xiolabs.com + 2003,2004 Lev Walkin +License: BSD-3-Clause + +Files: src/asn1helpers.c +Copyright: 2014-2015 by Harald Welte +License: AGPL-3.0+ + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU Affero General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + . + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Affero General Public License for more details. + . + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see . + +Files: debian/* +Copyright: 2017 Alexander Couzens +License: BSD-3-Clause + +License: BSD-3-Clause + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + . + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + 3. Neither the name of the University nor the names of its contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + . + THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + SUCH DAMAGE. + diff --git a/debian/libasn1c-dev.install b/debian/libasn1c-dev.install new file mode 100644 index 0000000..d8a8a49 --- /dev/null +++ b/debian/libasn1c-dev.install @@ -0,0 +1,4 @@ +usr/include +usr/lib/*/pkgconfig/*.pc +usr/lib/*/*.a +usr/lib/*/lib*.so diff --git a/debian/libasn1c0.install b/debian/libasn1c0.install new file mode 100644 index 0000000..3de3b10 --- /dev/null +++ b/debian/libasn1c0.install @@ -0,0 +1 @@ +usr/lib/*/*.so.* diff --git a/debian/rules b/debian/rules new file mode 100755 index 0000000..267bea9 --- /dev/null +++ b/debian/rules @@ -0,0 +1,59 @@ +#!/usr/bin/make -f +# You must remove unused comment lines for the released package. +# See debhelper(7) (uncomment to enable) +# This is an autogenerated template for debian/rules. +# +# Output every command that modifies files on the build system. +#export DH_VERBOSE = 1 +# +# Copy some variable definitions from pkg-info.mk and vendor.mk +# under /usr/share/dpkg/ to here if they are useful. +# +# See FEATURE AREAS/ENVIRONMENT in dpkg-buildflags(1) +# Apply all hardening options +#export DEB_BUILD_MAINT_OPTIONS = hardening=+all +# Package maintainers to append CFLAGS +#export DEB_CFLAGS_MAINT_APPEND = -Wall -pedantic +# Package maintainers to append LDFLAGS +#export DEB_LDFLAGS_MAINT_APPEND = -Wl,--as-needed +# +# With debhelper version 9 or newer, the dh command exports +# all buildflags. So there is no need to include the +# /usr/share/dpkg/buildflags.mk file here if compat is 9 or newer. +# +# These are rarely used code. (START) +# +# The following include for *.mk magically sets miscellaneous +# variables while honoring existing values of pertinent +# environment variables: +# +# Architecture-related variables such as DEB_TARGET_MULTIARCH: +#include /usr/share/dpkg/architecture.mk +# Vendor-related variables such as DEB_VENDOR: +#include /usr/share/dpkg/vendor.mk +# Package-related variables such as DEB_DISTRIBUTION +#include /usr/share/dpkg/pkg-info.mk +# +# You may alternatively set them susing a simple script such as: +# DEB_VENDOR ?= $(shell dpkg-vendor --query Vendor) +# +# These are rarely used code. (END) +# + +# main packaging script based on dh7 syntax +%: + dh $@ --with autoreconf + +# debmake generated override targets +# Set options for ./configure +#CONFIGURE_FLAGS = +#overrride_dh_configure: +# dh_configure -- $(CONFIGURE_FLAGS) +# +# Do not install libtool archive, python .pyc .pyo +#override_dh_install: +# dh_install --list-missing -X.la -X.pyc -X.pyo + +# See https://www.debian.org/doc/manuals/developers-reference/best-pkging-practices.html#bpp-dbg +override_dh_strip: + dh_strip --dbg-package=libasn1c-dbg 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/3440 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I135d975b84027d51cb1dc534e04dd314bbd20289 Gerrit-PatchSet: 2 Gerrit-Project: libasn1c Gerrit-Branch: master Gerrit-Owner: lynxis lazus Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Sat Aug 12 02:18:39 2017 From: gerrit-no-reply at lists.osmocom.org (lynxis lazus) Date: Sat, 12 Aug 2017 02:18:39 +0000 Subject: libasn1c[master]: add /debian to build a package In-Reply-To: References: Message-ID: Patch Set 2: done -- To view, visit https://gerrit.osmocom.org/3440 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I135d975b84027d51cb1dc534e04dd314bbd20289 Gerrit-PatchSet: 2 Gerrit-Project: libasn1c Gerrit-Branch: master Gerrit-Owner: lynxis lazus Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: lynxis lazus Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sat Aug 12 02:43:53 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sat, 12 Aug 2017 02:43:53 +0000 Subject: libasn1c[master]: add /debian to build a package In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+1 (1 comment) https://gerrit.osmocom.org/#/c/3440/2/debian/copyright File debian/copyright: Line 65 @hwelte, are the licenses making sense now? -- To view, visit https://gerrit.osmocom.org/3440 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I135d975b84027d51cb1dc534e04dd314bbd20289 Gerrit-PatchSet: 2 Gerrit-Project: libasn1c Gerrit-Branch: master Gerrit-Owner: lynxis lazus Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: lynxis lazus Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Sat Aug 12 09:44:38 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 12 Aug 2017 09:44:38 +0000 Subject: [PATCH] libosmocore[master]: add osmo_fd_setup() convenience function to fill-in osmo_fd Message-ID: Review at https://gerrit.osmocom.org/3500 add osmo_fd_setup() convenience function to fill-in osmo_fd This basically follows the concept of osmo_timer_setup() and allows the caller to fill-in all configurable fields of osmo_fd in one line of code, rather than open-coding it in 5 lines everywhere. Change-Id: I6dbf19ea22fd65302bfc5424c10418d1b7939094 --- M include/osmocom/core/select.h M src/select.c 2 files changed, 22 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/00/3500/1 diff --git a/include/osmocom/core/select.h b/include/osmocom/core/select.h index 2abda2d..b6fed3c 100644 --- a/include/osmocom/core/select.h +++ b/include/osmocom/core/select.h @@ -36,6 +36,10 @@ unsigned int priv_nr; }; +void osmo_fd_setup(struct osmo_fd *ofd, int fd, unsigned int when, + int (*cb)(struct osmo_fd *fd, unsigned int what), + void *data, unsigned int priv_nr); + bool osmo_fd_is_registered(struct osmo_fd *fd); int osmo_fd_register(struct osmo_fd *fd); void osmo_fd_unregister(struct osmo_fd *fd); diff --git a/src/select.c b/src/select.c index 0ba8bc6..4b98b62 100644 --- a/src/select.c +++ b/src/select.c @@ -47,6 +47,24 @@ static LLIST_HEAD(osmo_fds); static int unregistered_count; +/*! Set up an osmo-fd. Will not register it. + * \param[inout] ofd Osmo FD to be set-up + * \param[in] fd OS-level file descriptor number + * \param[in] when bit-mask of BSC_FD_{READ,WRITE,EXECEPT} + * \param[in] cb Call-back function to be called + * \param[in] data Private context pointer + * \param[in] priv_nr Private number + */ +void osmo_fd_setup(struct osmo_fd *ofd, int fd, unsigned int when, + int (*cb)(struct osmo_fd *fd, unsigned int what), + void *data, unsigned int priv_nr) +{ + ofd->fd = fd; + ofd->when = when; + ofd->cb = cb; + ofd->data = data; + ofd->priv_nr = priv_nr; +} /*! Check if a file descriptor is already registered * \param[in] fd osmocom file descriptor to be checked -- To view, visit https://gerrit.osmocom.org/3500 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I6dbf19ea22fd65302bfc5424c10418d1b7939094 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Sat Aug 12 15:38:42 2017 From: gerrit-no-reply at lists.osmocom.org (Alexander Chemeris) Date: Sat, 12 Aug 2017 15:38:42 +0000 Subject: [PATCH] openbsc[master]: libcommon: Fix log output for bts>0. In-Reply-To: References: Message-ID: Hello Max, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3185 to look at the new patch set (#3). libcommon: Fix log output for bts>0. Fixes regression probably introduced in c696cc28. For bts>0 logging doesn't show bts number correctly when printing lchan identification string - it will always show it as "bts=0". The reason for this is that the identification string is cached before bts->nr value is set to a proper value. This patch sets bts->nr as part of the first step of the bts structure initialization, before caching happens thus making sure the cached identification string is cached with the correct values. Change-Id: I61c18a7f021fcb1ec00d34a745f4e3ab03416c2d --- M openbsc/include/openbsc/gsm_data_shared.h M openbsc/src/libcommon/gsm_data.c M openbsc/src/libcommon/gsm_data_shared.c M openbsc/tests/channel/channel_test.c M openbsc/tests/channel/channel_test.ok M openbsc/tests/gsm0408/gsm0408_test.c 6 files changed, 44 insertions(+), 10 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/85/3185/3 diff --git a/openbsc/include/openbsc/gsm_data_shared.h b/openbsc/include/openbsc/gsm_data_shared.h index 4c71a07..369668d 100644 --- a/openbsc/include/openbsc/gsm_data_shared.h +++ b/openbsc/include/openbsc/gsm_data_shared.h @@ -900,7 +900,7 @@ }; -struct gsm_bts *gsm_bts_alloc(void *talloc_ctx); +struct gsm_bts *gsm_bts_alloc(void *talloc_ctx, uint8_t bts_num); struct gsm_bts *gsm_bts_num(struct gsm_network *net, int num); struct gsm_bts_trx *gsm_bts_trx_alloc(struct gsm_bts *bts); diff --git a/openbsc/src/libcommon/gsm_data.c b/openbsc/src/libcommon/gsm_data.c index db7de08..f1049e9 100644 --- a/openbsc/src/libcommon/gsm_data.c +++ b/openbsc/src/libcommon/gsm_data.c @@ -286,12 +286,13 @@ if (!model && type != GSM_BTS_TYPE_UNKNOWN) return NULL; - bts = gsm_bts_alloc(net); + bts = gsm_bts_alloc(net, net->num_bts); if (!bts) return NULL; + net->num_bts++; + bts->network = net; - bts->nr = net->num_bts++; bts->type = type; bts->model = model; bts->bsic = bsic; diff --git a/openbsc/src/libcommon/gsm_data_shared.c b/openbsc/src/libcommon/gsm_data_shared.c index 8992636..d792f3b 100644 --- a/openbsc/src/libcommon/gsm_data_shared.c +++ b/openbsc/src/libcommon/gsm_data_shared.c @@ -312,7 +312,7 @@ .initial_mcs = 6, }; -struct gsm_bts *gsm_bts_alloc(void *ctx) +struct gsm_bts *gsm_bts_alloc(void *ctx, uint8_t bts_num) { struct gsm_bts *bts = talloc_zero(ctx, struct gsm_bts); int i; @@ -320,6 +320,7 @@ if (!bts) return NULL; + bts->nr = bts_num; bts->num_trx = 0; INIT_LLIST_HEAD(&bts->trx_list); bts->ms_max_power = 15; /* dBm */ diff --git a/openbsc/tests/channel/channel_test.c b/openbsc/tests/channel/channel_test.c index 88293d0..cf19aab 100644 --- a/openbsc/tests/channel/channel_test.c +++ b/openbsc/tests/channel/channel_test.c @@ -70,7 +70,7 @@ network = bsc_network_init(tall_bsc_ctx, 1, 1, NULL); if (!network) exit(1); - bts = gsm_bts_alloc(network); + bts = gsm_bts_alloc(network, 0); bts->location_area_code = 23; s_conn.network = network; @@ -91,6 +91,36 @@ OSMO_ASSERT(s_end); } + + +void test_bts_debug_print(void) +{ + struct gsm_network *network; + struct gsm_bts *bts; + struct gsm_bts_trx *trx; + + printf("Testing the lchan printing:"); + + /* Create a dummy network */ + network = bsc_network_init(tall_bsc_ctx, 1, 1, NULL); + if (!network) + exit(1); + /* Add a BTS with some reasonanbly non-zero id */ + bts = gsm_bts_alloc(network, 45); + /* Add a second TRX to test on multiple TRXs */ + gsm_bts_trx_alloc(bts); + + llist_for_each_entry(trx, &bts->trx_list, list) { + char *name = gsm_lchan_name(&trx->ts[3].lchan[4]); + + if (name) + printf(" %s", name); + else + printf("NULL name"); + } + printf("\n"); +} + void test_dyn_ts_subslots(void) { @@ -128,6 +158,7 @@ test_request_chan(); test_dyn_ts_subslots(); + test_bts_debug_print(); return EXIT_SUCCESS; } diff --git a/openbsc/tests/channel/channel_test.ok b/openbsc/tests/channel/channel_test.ok index 33c8193..e2e93ef 100644 --- a/openbsc/tests/channel/channel_test.ok +++ b/openbsc/tests/channel/channel_test.ok @@ -1,3 +1,4 @@ Testing the gsm_subscriber chan logic Reached, didn't crash, test passed Testing subslot numbers for pchan types +Testing the lchan printing: (bts=45,trx=0,ts=3,ss=4) (bts=45,trx=1,ts=3,ss=4) diff --git a/openbsc/tests/gsm0408/gsm0408_test.c b/openbsc/tests/gsm0408/gsm0408_test.c index 5a8c6ca..63b5c7c 100644 --- a/openbsc/tests/gsm0408/gsm0408_test.c +++ b/openbsc/tests/gsm0408/gsm0408_test.c @@ -153,7 +153,7 @@ if (!network) exit(1); - bts = gsm_bts_alloc(network); + bts = gsm_bts_alloc(network, 0); _bts_uarfcn_add(bts, 10564, 319, 0); _bts_uarfcn_add(bts, 10612, 319, 0); @@ -168,7 +168,7 @@ if (!network) exit(1); - bts = gsm_bts_alloc(network); + bts = gsm_bts_alloc(network, 0); _bts_uarfcn_add(bts, 10564, 318, 0); _bts_uarfcn_add(bts, 10612, 319, 0); @@ -188,7 +188,7 @@ if (!network) exit(1); - bts = gsm_bts_alloc(network); + bts = gsm_bts_alloc(network, 0); /* first generate invalid SI as no UARFCN added */ gen(bts, __func__); @@ -216,7 +216,7 @@ if (!network) exit(1); - bts = gsm_bts_alloc(network); + bts = gsm_bts_alloc(network, 0); bts->si_common.si2quater_neigh_list.arfcn = bts->si_common.data.earfcn_list; bts->si_common.si2quater_neigh_list.meas_bw = bts->si_common.data.meas_bw_list; @@ -249,7 +249,7 @@ if (!network) exit(1); - bts = gsm_bts_alloc(network); + bts = gsm_bts_alloc(network, 0); bts->si_common.si2quater_neigh_list.arfcn = bts->si_common.data.earfcn_list; bts->si_common.si2quater_neigh_list.meas_bw = bts->si_common.data.meas_bw_list; -- To view, visit https://gerrit.osmocom.org/3185 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I61c18a7f021fcb1ec00d34a745f4e3ab03416c2d Gerrit-PatchSet: 3 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Alexander Chemeris Gerrit-Reviewer: Alexander Chemeris Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max From gerrit-no-reply at lists.osmocom.org Sat Aug 12 18:06:04 2017 From: gerrit-no-reply at lists.osmocom.org (Alexander Chemeris) Date: Sat, 12 Aug 2017 18:06:04 +0000 Subject: openbsc[master]: libcommon: Fix log output for bts>0. In-Reply-To: References: Message-ID: Patch Set 3: Harald - I've added a test. Hope it's enough. It doesn't look like the build failure is due to my change.. Not sure if I need to do anything? -- To view, visit https://gerrit.osmocom.org/3185 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I61c18a7f021fcb1ec00d34a745f4e3ab03416c2d Gerrit-PatchSet: 3 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Alexander Chemeris Gerrit-Reviewer: Alexander Chemeris Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-HasComments: No From admin at opensuse.org Sat Aug 12 20:02:44 2017 From: admin at opensuse.org (OBS Notification) Date: Sat, 12 Aug 2017 20:02:44 +0000 Subject: Build failure of network:osmocom:nightly/openbsc in xUbuntu_17.04/i586 In-Reply-To: References: Message-ID: <598f5ef354248_25b5602f84554338@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/openbsc/xUbuntu_17.04/i586 Package network:osmocom:nightly/openbsc failed to build in xUbuntu_17.04/i586 Check out the package for editing: osc checkout network:osmocom:nightly openbsc Last lines of build log: [ 166s] make[4]: Leaving directory '/usr/src/packages/BUILD/openbsc/tests' [ 166s] make[3]: Leaving directory '/usr/src/packages/BUILD/openbsc/tests' [ 166s] make[3]: Entering directory '/usr/src/packages/BUILD/openbsc' [ 166s] make[4]: Entering directory '/usr/src/packages/BUILD/openbsc' [ 166s] make[4]: Nothing to be done for 'install-exec-am'. [ 166s] /bin/mkdir -p '/usr/src/packages/BUILD/debian/tmp/usr/lib/i386-linux-gnu/pkgconfig' [ 166s] /usr/bin/install -c -m 644 openbsc.pc '/usr/src/packages/BUILD/debian/tmp/usr/lib/i386-linux-gnu/pkgconfig' [ 166s] make[4]: Leaving directory '/usr/src/packages/BUILD/openbsc' [ 166s] make[3]: Leaving directory '/usr/src/packages/BUILD/openbsc' [ 166s] make[2]: Leaving directory '/usr/src/packages/BUILD/openbsc' [ 166s] make[1]: Leaving directory '/usr/src/packages/BUILD/openbsc' [ 166s] dh_install -O--sourcedirectory=openbsc [ 166s] dh_install: Cannot find (any matches for) "/usr/bin/osmo-sgsn" (tried in "." and "debian/tmp") [ 166s] dh_install: osmocom-sgsn missing files: /usr/bin/osmo-sgsn [ 166s] dh_install: Cannot find (any matches for) "/usr/bin/osmo-gtphub" (tried in "." and "debian/tmp") [ 166s] dh_install: osmo-gtphub missing files: /usr/bin/osmo-gtphub [ 166s] dh_install: missing files, aborting [ 166s] debian/rules:13: recipe for target 'binary' failed [ 166s] make: *** [binary] Error 2 [ 166s] dpkg-buildpackage: error: fakeroot debian/rules binary gave error exit status 2 [ 166s] [ 166s] lamb53 failed "build openbsc_0.15.1.20170812.dsc" at Sat Aug 12 20:02:36 UTC 2017. [ 166s] [ 166s] ### VM INTERACTION START ### [ 169s] [ 159.371774] reboot: Power down [ 169s] ### VM INTERACTION END ### [ 170s] [ 170s] lamb53 failed "build openbsc_0.15.1.20170812.dsc" at Sat Aug 12 20:02:40 UTC 2017. [ 170s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Sat Aug 12 20:02:44 2017 From: admin at opensuse.org (OBS Notification) Date: Sat, 12 Aug 2017 20:02:44 +0000 Subject: Build failure of network:osmocom:nightly/openbsc in xUbuntu_17.04/x86_64 In-Reply-To: References: Message-ID: <598f5ef3af843_25b5602f84554449@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/openbsc/xUbuntu_17.04/x86_64 Package network:osmocom:nightly/openbsc failed to build in xUbuntu_17.04/x86_64 Check out the package for editing: osc checkout network:osmocom:nightly openbsc Last lines of build log: [ 150s] make[4]: Leaving directory '/usr/src/packages/BUILD/openbsc/tests' [ 150s] make[3]: Leaving directory '/usr/src/packages/BUILD/openbsc/tests' [ 150s] make[3]: Entering directory '/usr/src/packages/BUILD/openbsc' [ 150s] make[4]: Entering directory '/usr/src/packages/BUILD/openbsc' [ 150s] make[4]: Nothing to be done for 'install-exec-am'. [ 150s] /bin/mkdir -p '/usr/src/packages/BUILD/debian/tmp/usr/lib/x86_64-linux-gnu/pkgconfig' [ 150s] /usr/bin/install -c -m 644 openbsc.pc '/usr/src/packages/BUILD/debian/tmp/usr/lib/x86_64-linux-gnu/pkgconfig' [ 150s] make[4]: Leaving directory '/usr/src/packages/BUILD/openbsc' [ 150s] make[3]: Leaving directory '/usr/src/packages/BUILD/openbsc' [ 150s] make[2]: Leaving directory '/usr/src/packages/BUILD/openbsc' [ 150s] make[1]: Leaving directory '/usr/src/packages/BUILD/openbsc' [ 150s] dh_install -O--sourcedirectory=openbsc [ 150s] dh_install: Cannot find (any matches for) "/usr/bin/osmo-sgsn" (tried in "." and "debian/tmp") [ 150s] dh_install: osmocom-sgsn missing files: /usr/bin/osmo-sgsn [ 150s] dh_install: Cannot find (any matches for) "/usr/bin/osmo-gtphub" (tried in "." and "debian/tmp") [ 150s] dh_install: osmo-gtphub missing files: /usr/bin/osmo-gtphub [ 150s] dh_install: missing files, aborting [ 150s] debian/rules:13: recipe for target 'binary' failed [ 150s] make: *** [binary] Error 2 [ 150s] dpkg-buildpackage: error: fakeroot debian/rules binary gave error exit status 2 [ 150s] [ 150s] lamb26 failed "build openbsc_0.15.1.20170812.dsc" at Sat Aug 12 20:02:39 UTC 2017. [ 150s] [ 150s] ### VM INTERACTION START ### [ 153s] [ 142.808323] reboot: Power down [ 153s] ### VM INTERACTION END ### [ 153s] [ 153s] lamb26 failed "build openbsc_0.15.1.20170812.dsc" at Sat Aug 12 20:02:42 UTC 2017. [ 153s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Sat Aug 12 20:04:27 2017 From: admin at opensuse.org (OBS Notification) Date: Sat, 12 Aug 2017 20:04:27 +0000 Subject: Build failure of network:osmocom:nightly/openbsc in xUbuntu_16.10/x86_64 In-Reply-To: References: Message-ID: <598f5f511972a_25b5602f8455476f@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/openbsc/xUbuntu_16.10/x86_64 Package network:osmocom:nightly/openbsc failed to build in xUbuntu_16.10/x86_64 Check out the package for editing: osc checkout network:osmocom:nightly openbsc Last lines of build log: [ 147s] make[4]: Leaving directory '/usr/src/packages/BUILD/openbsc/tests' [ 147s] make[3]: Leaving directory '/usr/src/packages/BUILD/openbsc/tests' [ 147s] make[3]: Entering directory '/usr/src/packages/BUILD/openbsc' [ 147s] make[4]: Entering directory '/usr/src/packages/BUILD/openbsc' [ 147s] make[4]: Nothing to be done for 'install-exec-am'. [ 147s] /bin/mkdir -p '/usr/src/packages/BUILD/debian/tmp/usr/lib/x86_64-linux-gnu/pkgconfig' [ 147s] /usr/bin/install -c -m 644 openbsc.pc '/usr/src/packages/BUILD/debian/tmp/usr/lib/x86_64-linux-gnu/pkgconfig' [ 147s] make[4]: Leaving directory '/usr/src/packages/BUILD/openbsc' [ 147s] make[3]: Leaving directory '/usr/src/packages/BUILD/openbsc' [ 147s] make[2]: Leaving directory '/usr/src/packages/BUILD/openbsc' [ 147s] make[1]: Leaving directory '/usr/src/packages/BUILD/openbsc' [ 147s] dh_install -O--sourcedirectory=openbsc [ 147s] dh_install: Cannot find (any matches for) "/usr/bin/osmo-sgsn" (tried in "." and "debian/tmp") [ 147s] dh_install: osmocom-sgsn missing files: /usr/bin/osmo-sgsn [ 147s] dh_install: Cannot find (any matches for) "/usr/bin/osmo-gtphub" (tried in "." and "debian/tmp") [ 147s] dh_install: osmo-gtphub missing files: /usr/bin/osmo-gtphub [ 147s] dh_install: missing files, aborting [ 147s] debian/rules:13: recipe for target 'binary' failed [ 147s] make: *** [binary] Error 2 [ 147s] dpkg-buildpackage: error: fakeroot debian/rules binary gave error exit status 2 [ 147s] [ 147s] lamb09 failed "build openbsc_0.15.1.20170812.dsc" at Sat Aug 12 20:04:11 UTC 2017. [ 147s] [ 147s] ### VM INTERACTION START ### [ 151s] [ 140.194938] reboot: Power down [ 151s] ### VM INTERACTION END ### [ 151s] [ 151s] lamb09 failed "build openbsc_0.15.1.20170812.dsc" at Sat Aug 12 20:04:15 UTC 2017. [ 151s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Sat Aug 12 20:04:27 2017 From: admin at opensuse.org (OBS Notification) Date: Sat, 12 Aug 2017 20:04:27 +0000 Subject: Build failure of network:osmocom:nightly/openbsc in xUbuntu_16.10/x86_64 In-Reply-To: References: Message-ID: <598f5f515b20f_25b5602f845548f2@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/openbsc/xUbuntu_16.10/x86_64 Package network:osmocom:nightly/openbsc failed to build in xUbuntu_16.10/x86_64 Check out the package for editing: osc checkout network:osmocom:nightly openbsc Last lines of build log: [ 147s] make[4]: Leaving directory '/usr/src/packages/BUILD/openbsc/tests' [ 147s] make[3]: Leaving directory '/usr/src/packages/BUILD/openbsc/tests' [ 147s] make[3]: Entering directory '/usr/src/packages/BUILD/openbsc' [ 147s] make[4]: Entering directory '/usr/src/packages/BUILD/openbsc' [ 147s] make[4]: Nothing to be done for 'install-exec-am'. [ 147s] /bin/mkdir -p '/usr/src/packages/BUILD/debian/tmp/usr/lib/x86_64-linux-gnu/pkgconfig' [ 147s] /usr/bin/install -c -m 644 openbsc.pc '/usr/src/packages/BUILD/debian/tmp/usr/lib/x86_64-linux-gnu/pkgconfig' [ 147s] make[4]: Leaving directory '/usr/src/packages/BUILD/openbsc' [ 147s] make[3]: Leaving directory '/usr/src/packages/BUILD/openbsc' [ 147s] make[2]: Leaving directory '/usr/src/packages/BUILD/openbsc' [ 147s] make[1]: Leaving directory '/usr/src/packages/BUILD/openbsc' [ 147s] dh_install -O--sourcedirectory=openbsc [ 147s] dh_install: Cannot find (any matches for) "/usr/bin/osmo-sgsn" (tried in "." and "debian/tmp") [ 147s] dh_install: osmocom-sgsn missing files: /usr/bin/osmo-sgsn [ 147s] dh_install: Cannot find (any matches for) "/usr/bin/osmo-gtphub" (tried in "." and "debian/tmp") [ 147s] dh_install: osmo-gtphub missing files: /usr/bin/osmo-gtphub [ 147s] dh_install: missing files, aborting [ 147s] debian/rules:13: recipe for target 'binary' failed [ 147s] make: *** [binary] Error 2 [ 147s] dpkg-buildpackage: error: fakeroot debian/rules binary gave error exit status 2 [ 147s] [ 147s] lamb09 failed "build openbsc_0.15.1.20170812.dsc" at Sat Aug 12 20:04:11 UTC 2017. [ 147s] [ 147s] ### VM INTERACTION START ### [ 151s] [ 140.194938] reboot: Power down [ 151s] ### VM INTERACTION END ### [ 151s] [ 151s] lamb09 failed "build openbsc_0.15.1.20170812.dsc" at Sat Aug 12 20:04:15 UTC 2017. [ 151s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Sat Aug 12 20:04:44 2017 From: admin at opensuse.org (OBS Notification) Date: Sat, 12 Aug 2017 20:04:44 +0000 Subject: Build failure of network:osmocom:nightly/openbsc in xUbuntu_16.10/i586 In-Reply-To: References: Message-ID: <598f5f6c34526_25b5602f845549fe@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/openbsc/xUbuntu_16.10/i586 Package network:osmocom:nightly/openbsc failed to build in xUbuntu_16.10/i586 Check out the package for editing: osc checkout network:osmocom:nightly openbsc Last lines of build log: [ 191s] make[4]: Leaving directory '/usr/src/packages/BUILD/openbsc/tests' [ 191s] make[3]: Leaving directory '/usr/src/packages/BUILD/openbsc/tests' [ 191s] make[3]: Entering directory '/usr/src/packages/BUILD/openbsc' [ 191s] make[4]: Entering directory '/usr/src/packages/BUILD/openbsc' [ 191s] make[4]: Nothing to be done for 'install-exec-am'. [ 191s] /bin/mkdir -p '/usr/src/packages/BUILD/debian/tmp/usr/lib/i386-linux-gnu/pkgconfig' [ 191s] /usr/bin/install -c -m 644 openbsc.pc '/usr/src/packages/BUILD/debian/tmp/usr/lib/i386-linux-gnu/pkgconfig' [ 191s] make[4]: Leaving directory '/usr/src/packages/BUILD/openbsc' [ 191s] make[3]: Leaving directory '/usr/src/packages/BUILD/openbsc' [ 191s] make[2]: Leaving directory '/usr/src/packages/BUILD/openbsc' [ 191s] make[1]: Leaving directory '/usr/src/packages/BUILD/openbsc' [ 191s] dh_install -O--sourcedirectory=openbsc [ 191s] dh_install: Cannot find (any matches for) "/usr/bin/osmo-sgsn" (tried in "." and "debian/tmp") [ 191s] dh_install: osmocom-sgsn missing files: /usr/bin/osmo-sgsn [ 191s] dh_install: Cannot find (any matches for) "/usr/bin/osmo-gtphub" (tried in "." and "debian/tmp") [ 191s] dh_install: osmo-gtphub missing files: /usr/bin/osmo-gtphub [ 191s] dh_install: missing files, aborting [ 191s] debian/rules:13: recipe for target 'binary' failed [ 191s] make: *** [binary] Error 2 [ 191s] dpkg-buildpackage: error: fakeroot debian/rules binary gave error exit status 2 [ 191s] [ 191s] cloud123 failed "build openbsc_0.15.1.20170812.dsc" at Sat Aug 12 20:04:31 UTC 2017. [ 191s] [ 191s] ### VM INTERACTION START ### [ 195s] [ 173.897557] reboot: Power down [ 197s] ### VM INTERACTION END ### [ 197s] [ 197s] cloud123 failed "build openbsc_0.15.1.20170812.dsc" at Sat Aug 12 20:04:38 UTC 2017. [ 197s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Sat Aug 12 20:04:44 2017 From: admin at opensuse.org (OBS Notification) Date: Sat, 12 Aug 2017 20:04:44 +0000 Subject: Build failure of network:osmocom:nightly/openbsc in xUbuntu_16.10/i586 In-Reply-To: References: Message-ID: <598f5f6c73d67_25b5602f845550dc@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/openbsc/xUbuntu_16.10/i586 Package network:osmocom:nightly/openbsc failed to build in xUbuntu_16.10/i586 Check out the package for editing: osc checkout network:osmocom:nightly openbsc Last lines of build log: [ 191s] make[4]: Leaving directory '/usr/src/packages/BUILD/openbsc/tests' [ 191s] make[3]: Leaving directory '/usr/src/packages/BUILD/openbsc/tests' [ 191s] make[3]: Entering directory '/usr/src/packages/BUILD/openbsc' [ 191s] make[4]: Entering directory '/usr/src/packages/BUILD/openbsc' [ 191s] make[4]: Nothing to be done for 'install-exec-am'. [ 191s] /bin/mkdir -p '/usr/src/packages/BUILD/debian/tmp/usr/lib/i386-linux-gnu/pkgconfig' [ 191s] /usr/bin/install -c -m 644 openbsc.pc '/usr/src/packages/BUILD/debian/tmp/usr/lib/i386-linux-gnu/pkgconfig' [ 191s] make[4]: Leaving directory '/usr/src/packages/BUILD/openbsc' [ 191s] make[3]: Leaving directory '/usr/src/packages/BUILD/openbsc' [ 191s] make[2]: Leaving directory '/usr/src/packages/BUILD/openbsc' [ 191s] make[1]: Leaving directory '/usr/src/packages/BUILD/openbsc' [ 191s] dh_install -O--sourcedirectory=openbsc [ 191s] dh_install: Cannot find (any matches for) "/usr/bin/osmo-sgsn" (tried in "." and "debian/tmp") [ 191s] dh_install: osmocom-sgsn missing files: /usr/bin/osmo-sgsn [ 191s] dh_install: Cannot find (any matches for) "/usr/bin/osmo-gtphub" (tried in "." and "debian/tmp") [ 191s] dh_install: osmo-gtphub missing files: /usr/bin/osmo-gtphub [ 191s] dh_install: missing files, aborting [ 191s] debian/rules:13: recipe for target 'binary' failed [ 191s] make: *** [binary] Error 2 [ 191s] dpkg-buildpackage: error: fakeroot debian/rules binary gave error exit status 2 [ 191s] [ 191s] cloud123 failed "build openbsc_0.15.1.20170812.dsc" at Sat Aug 12 20:04:31 UTC 2017. [ 191s] [ 191s] ### VM INTERACTION START ### [ 195s] [ 173.897557] reboot: Power down [ 197s] ### VM INTERACTION END ### [ 197s] [ 197s] cloud123 failed "build openbsc_0.15.1.20170812.dsc" at Sat Aug 12 20:04:38 UTC 2017. [ 197s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Sat Aug 12 20:04:44 2017 From: admin at opensuse.org (OBS Notification) Date: Sat, 12 Aug 2017 20:04:44 +0000 Subject: Build failure of network:osmocom:nightly/openbsc in xUbuntu_16.04/x86_64 In-Reply-To: References: Message-ID: <598f5f6cc490f_25b5602f8455517b@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/openbsc/xUbuntu_16.04/x86_64 Package network:osmocom:nightly/openbsc failed to build in xUbuntu_16.04/x86_64 Check out the package for editing: osc checkout network:osmocom:nightly openbsc Last lines of build log: [ 167s] make[5]: Nothing to be done for 'install-data-am'. [ 167s] make[5]: Leaving directory '/usr/src/packages/BUILD/openbsc/tests' [ 167s] make[4]: Leaving directory '/usr/src/packages/BUILD/openbsc/tests' [ 167s] make[3]: Leaving directory '/usr/src/packages/BUILD/openbsc/tests' [ 167s] make[3]: Entering directory '/usr/src/packages/BUILD/openbsc' [ 167s] make[4]: Entering directory '/usr/src/packages/BUILD/openbsc' [ 167s] make[4]: Nothing to be done for 'install-exec-am'. [ 167s] /bin/mkdir -p '/usr/src/packages/BUILD/debian/tmp/usr/lib/x86_64-linux-gnu/pkgconfig' [ 167s] /usr/bin/install -c -m 644 openbsc.pc '/usr/src/packages/BUILD/debian/tmp/usr/lib/x86_64-linux-gnu/pkgconfig' [ 167s] make[4]: Leaving directory '/usr/src/packages/BUILD/openbsc' [ 167s] make[3]: Leaving directory '/usr/src/packages/BUILD/openbsc' [ 167s] make[2]: Leaving directory '/usr/src/packages/BUILD/openbsc' [ 167s] make[1]: Leaving directory '/usr/src/packages/BUILD/openbsc' [ 167s] dh_install -O--sourcedirectory=openbsc [ 167s] dh_install: osmocom-sgsn missing files: /usr/bin/osmo-sgsn [ 167s] dh_install: osmo-gtphub missing files: /usr/bin/osmo-gtphub [ 167s] dh_install: missing files, aborting [ 167s] debian/rules:13: recipe for target 'binary' failed [ 167s] make: *** [binary] Error 2 [ 167s] dpkg-buildpackage: error: fakeroot debian/rules binary gave error exit status 2 [ 167s] [ 167s] lamb68 failed "build openbsc_0.15.1.20170812.dsc" at Sat Aug 12 20:04:37 UTC 2017. [ 167s] [ 167s] ### VM INTERACTION START ### [ 171s] [ 160.677164] reboot: Power down [ 171s] ### VM INTERACTION END ### [ 171s] [ 171s] lamb68 failed "build openbsc_0.15.1.20170812.dsc" at Sat Aug 12 20:04:40 UTC 2017. [ 171s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Sat Aug 12 20:04:44 2017 From: admin at opensuse.org (OBS Notification) Date: Sat, 12 Aug 2017 20:04:44 +0000 Subject: Build failure of network:osmocom:nightly/openbsc in xUbuntu_16.04/x86_64 In-Reply-To: References: Message-ID: <598f5f6d24aa0_25b5602f845552c0@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/openbsc/xUbuntu_16.04/x86_64 Package network:osmocom:nightly/openbsc failed to build in xUbuntu_16.04/x86_64 Check out the package for editing: osc checkout network:osmocom:nightly openbsc Last lines of build log: [ 167s] make[5]: Nothing to be done for 'install-data-am'. [ 167s] make[5]: Leaving directory '/usr/src/packages/BUILD/openbsc/tests' [ 167s] make[4]: Leaving directory '/usr/src/packages/BUILD/openbsc/tests' [ 167s] make[3]: Leaving directory '/usr/src/packages/BUILD/openbsc/tests' [ 167s] make[3]: Entering directory '/usr/src/packages/BUILD/openbsc' [ 167s] make[4]: Entering directory '/usr/src/packages/BUILD/openbsc' [ 167s] make[4]: Nothing to be done for 'install-exec-am'. [ 167s] /bin/mkdir -p '/usr/src/packages/BUILD/debian/tmp/usr/lib/x86_64-linux-gnu/pkgconfig' [ 167s] /usr/bin/install -c -m 644 openbsc.pc '/usr/src/packages/BUILD/debian/tmp/usr/lib/x86_64-linux-gnu/pkgconfig' [ 167s] make[4]: Leaving directory '/usr/src/packages/BUILD/openbsc' [ 167s] make[3]: Leaving directory '/usr/src/packages/BUILD/openbsc' [ 167s] make[2]: Leaving directory '/usr/src/packages/BUILD/openbsc' [ 167s] make[1]: Leaving directory '/usr/src/packages/BUILD/openbsc' [ 167s] dh_install -O--sourcedirectory=openbsc [ 167s] dh_install: osmocom-sgsn missing files: /usr/bin/osmo-sgsn [ 167s] dh_install: osmo-gtphub missing files: /usr/bin/osmo-gtphub [ 167s] dh_install: missing files, aborting [ 167s] debian/rules:13: recipe for target 'binary' failed [ 167s] make: *** [binary] Error 2 [ 167s] dpkg-buildpackage: error: fakeroot debian/rules binary gave error exit status 2 [ 167s] [ 167s] lamb68 failed "build openbsc_0.15.1.20170812.dsc" at Sat Aug 12 20:04:37 UTC 2017. [ 167s] [ 167s] ### VM INTERACTION START ### [ 171s] [ 160.677164] reboot: Power down [ 171s] ### VM INTERACTION END ### [ 171s] [ 171s] lamb68 failed "build openbsc_0.15.1.20170812.dsc" at Sat Aug 12 20:04:40 UTC 2017. [ 171s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Sat Aug 12 20:05:52 2017 From: admin at opensuse.org (OBS Notification) Date: Sat, 12 Aug 2017 20:05:52 +0000 Subject: Build failure of network:osmocom:nightly/openbsc in Debian_9.0/x86_64 In-Reply-To: References: Message-ID: <598f5fabbb584_25b5602f845554ab@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/openbsc/Debian_9.0/x86_64 Package network:osmocom:nightly/openbsc failed to build in Debian_9.0/x86_64 Check out the package for editing: osc checkout network:osmocom:nightly openbsc Last lines of build log: [ 206s] make[4]: Leaving directory '/usr/src/packages/BUILD/openbsc/tests' [ 206s] make[3]: Leaving directory '/usr/src/packages/BUILD/openbsc/tests' [ 206s] make[3]: Entering directory '/usr/src/packages/BUILD/openbsc' [ 206s] make[4]: Entering directory '/usr/src/packages/BUILD/openbsc' [ 206s] make[4]: Nothing to be done for 'install-exec-am'. [ 206s] /bin/mkdir -p '/usr/src/packages/BUILD/debian/tmp/usr/lib/x86_64-linux-gnu/pkgconfig' [ 206s] /usr/bin/install -c -m 644 openbsc.pc '/usr/src/packages/BUILD/debian/tmp/usr/lib/x86_64-linux-gnu/pkgconfig' [ 206s] make[4]: Leaving directory '/usr/src/packages/BUILD/openbsc' [ 206s] make[3]: Leaving directory '/usr/src/packages/BUILD/openbsc' [ 206s] make[2]: Leaving directory '/usr/src/packages/BUILD/openbsc' [ 206s] make[1]: Leaving directory '/usr/src/packages/BUILD/openbsc' [ 206s] dh_install -O--sourcedirectory=openbsc [ 206s] dh_install: Cannot find (any matches for) "/usr/bin/osmo-sgsn" (tried in "." and "debian/tmp") [ 206s] dh_install: osmocom-sgsn missing files: /usr/bin/osmo-sgsn [ 206s] dh_install: Cannot find (any matches for) "/usr/bin/osmo-gtphub" (tried in "." and "debian/tmp") [ 206s] dh_install: osmo-gtphub missing files: /usr/bin/osmo-gtphub [ 206s] dh_install: missing files, aborting [ 206s] debian/rules:13: recipe for target 'binary' failed [ 206s] make: *** [binary] Error 2 [ 206s] dpkg-buildpackage: error: fakeroot debian/rules binary gave error exit status 2 [ 206s] [ 206s] cloud120 failed "build openbsc_0.15.1.20170812.dsc" at Sat Aug 12 20:05:37 UTC 2017. [ 206s] [ 206s] ### VM INTERACTION START ### [ 210s] [ 183.781802] reboot: Power down [ 214s] ### VM INTERACTION END ### [ 214s] [ 214s] cloud120 failed "build openbsc_0.15.1.20170812.dsc" at Sat Aug 12 20:05:44 UTC 2017. [ 214s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Sat Aug 12 20:05:52 2017 From: admin at opensuse.org (OBS Notification) Date: Sat, 12 Aug 2017 20:05:52 +0000 Subject: Build failure of network:osmocom:nightly/openbsc in Debian_9.0/x86_64 In-Reply-To: References: Message-ID: <598f5fad947b8_25b5602f8455558d@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/openbsc/Debian_9.0/x86_64 Package network:osmocom:nightly/openbsc failed to build in Debian_9.0/x86_64 Check out the package for editing: osc checkout network:osmocom:nightly openbsc Last lines of build log: [ 206s] make[4]: Leaving directory '/usr/src/packages/BUILD/openbsc/tests' [ 206s] make[3]: Leaving directory '/usr/src/packages/BUILD/openbsc/tests' [ 206s] make[3]: Entering directory '/usr/src/packages/BUILD/openbsc' [ 206s] make[4]: Entering directory '/usr/src/packages/BUILD/openbsc' [ 206s] make[4]: Nothing to be done for 'install-exec-am'. [ 206s] /bin/mkdir -p '/usr/src/packages/BUILD/debian/tmp/usr/lib/x86_64-linux-gnu/pkgconfig' [ 206s] /usr/bin/install -c -m 644 openbsc.pc '/usr/src/packages/BUILD/debian/tmp/usr/lib/x86_64-linux-gnu/pkgconfig' [ 206s] make[4]: Leaving directory '/usr/src/packages/BUILD/openbsc' [ 206s] make[3]: Leaving directory '/usr/src/packages/BUILD/openbsc' [ 206s] make[2]: Leaving directory '/usr/src/packages/BUILD/openbsc' [ 206s] make[1]: Leaving directory '/usr/src/packages/BUILD/openbsc' [ 206s] dh_install -O--sourcedirectory=openbsc [ 206s] dh_install: Cannot find (any matches for) "/usr/bin/osmo-sgsn" (tried in "." and "debian/tmp") [ 206s] dh_install: osmocom-sgsn missing files: /usr/bin/osmo-sgsn [ 206s] dh_install: Cannot find (any matches for) "/usr/bin/osmo-gtphub" (tried in "." and "debian/tmp") [ 206s] dh_install: osmo-gtphub missing files: /usr/bin/osmo-gtphub [ 206s] dh_install: missing files, aborting [ 206s] debian/rules:13: recipe for target 'binary' failed [ 206s] make: *** [binary] Error 2 [ 206s] dpkg-buildpackage: error: fakeroot debian/rules binary gave error exit status 2 [ 206s] [ 206s] cloud120 failed "build openbsc_0.15.1.20170812.dsc" at Sat Aug 12 20:05:37 UTC 2017. [ 206s] [ 206s] ### VM INTERACTION START ### [ 210s] [ 183.781802] reboot: Power down [ 214s] ### VM INTERACTION END ### [ 214s] [ 214s] cloud120 failed "build openbsc_0.15.1.20170812.dsc" at Sat Aug 12 20:05:44 UTC 2017. [ 214s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Sat Aug 12 20:06:09 2017 From: admin at opensuse.org (OBS Notification) Date: Sat, 12 Aug 2017 20:06:09 +0000 Subject: Build failure of network:osmocom:nightly/openbsc in Debian_9.0/i586 In-Reply-To: References: Message-ID: <598f5fc892f52_25b5602f84555810@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/openbsc/Debian_9.0/i586 Package network:osmocom:nightly/openbsc failed to build in Debian_9.0/i586 Check out the package for editing: osc checkout network:osmocom:nightly openbsc Last lines of build log: [ 180s] make[4]: Leaving directory '/usr/src/packages/BUILD/openbsc/tests' [ 180s] make[3]: Leaving directory '/usr/src/packages/BUILD/openbsc/tests' [ 180s] make[3]: Entering directory '/usr/src/packages/BUILD/openbsc' [ 180s] make[4]: Entering directory '/usr/src/packages/BUILD/openbsc' [ 180s] make[4]: Nothing to be done for 'install-exec-am'. [ 180s] /bin/mkdir -p '/usr/src/packages/BUILD/debian/tmp/usr/lib/i386-linux-gnu/pkgconfig' [ 180s] /usr/bin/install -c -m 644 openbsc.pc '/usr/src/packages/BUILD/debian/tmp/usr/lib/i386-linux-gnu/pkgconfig' [ 180s] make[4]: Leaving directory '/usr/src/packages/BUILD/openbsc' [ 180s] make[3]: Leaving directory '/usr/src/packages/BUILD/openbsc' [ 180s] make[2]: Leaving directory '/usr/src/packages/BUILD/openbsc' [ 180s] make[1]: Leaving directory '/usr/src/packages/BUILD/openbsc' [ 180s] dh_install -O--sourcedirectory=openbsc [ 180s] dh_install: Cannot find (any matches for) "/usr/bin/osmo-sgsn" (tried in "." and "debian/tmp") [ 180s] dh_install: osmocom-sgsn missing files: /usr/bin/osmo-sgsn [ 180s] dh_install: Cannot find (any matches for) "/usr/bin/osmo-gtphub" (tried in "." and "debian/tmp") [ 180s] dh_install: osmo-gtphub missing files: /usr/bin/osmo-gtphub [ 180s] dh_install: missing files, aborting [ 180s] debian/rules:13: recipe for target 'binary' failed [ 180s] make: *** [binary] Error 2 [ 180s] dpkg-buildpackage: error: fakeroot debian/rules binary gave error exit status 2 [ 180s] [ 180s] lamb21 failed "build openbsc_0.15.1.20170812.dsc" at Sat Aug 12 20:05:49 UTC 2017. [ 180s] [ 180s] ### VM INTERACTION START ### [ 183s] [ 171.033914] reboot: Power down [ 183s] ### VM INTERACTION END ### [ 183s] [ 183s] lamb21 failed "build openbsc_0.15.1.20170812.dsc" at Sat Aug 12 20:05:52 UTC 2017. [ 183s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Sat Aug 12 20:06:09 2017 From: admin at opensuse.org (OBS Notification) Date: Sat, 12 Aug 2017 20:06:09 +0000 Subject: Build failure of network:osmocom:nightly/openbsc in Debian_9.0/i586 In-Reply-To: References: Message-ID: <598f5fc8d5f4d_25b5602f8455599f@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/openbsc/Debian_9.0/i586 Package network:osmocom:nightly/openbsc failed to build in Debian_9.0/i586 Check out the package for editing: osc checkout network:osmocom:nightly openbsc Last lines of build log: [ 180s] make[4]: Leaving directory '/usr/src/packages/BUILD/openbsc/tests' [ 180s] make[3]: Leaving directory '/usr/src/packages/BUILD/openbsc/tests' [ 180s] make[3]: Entering directory '/usr/src/packages/BUILD/openbsc' [ 180s] make[4]: Entering directory '/usr/src/packages/BUILD/openbsc' [ 180s] make[4]: Nothing to be done for 'install-exec-am'. [ 180s] /bin/mkdir -p '/usr/src/packages/BUILD/debian/tmp/usr/lib/i386-linux-gnu/pkgconfig' [ 180s] /usr/bin/install -c -m 644 openbsc.pc '/usr/src/packages/BUILD/debian/tmp/usr/lib/i386-linux-gnu/pkgconfig' [ 180s] make[4]: Leaving directory '/usr/src/packages/BUILD/openbsc' [ 180s] make[3]: Leaving directory '/usr/src/packages/BUILD/openbsc' [ 180s] make[2]: Leaving directory '/usr/src/packages/BUILD/openbsc' [ 180s] make[1]: Leaving directory '/usr/src/packages/BUILD/openbsc' [ 180s] dh_install -O--sourcedirectory=openbsc [ 180s] dh_install: Cannot find (any matches for) "/usr/bin/osmo-sgsn" (tried in "." and "debian/tmp") [ 180s] dh_install: osmocom-sgsn missing files: /usr/bin/osmo-sgsn [ 180s] dh_install: Cannot find (any matches for) "/usr/bin/osmo-gtphub" (tried in "." and "debian/tmp") [ 180s] dh_install: osmo-gtphub missing files: /usr/bin/osmo-gtphub [ 180s] dh_install: missing files, aborting [ 180s] debian/rules:13: recipe for target 'binary' failed [ 180s] make: *** [binary] Error 2 [ 180s] dpkg-buildpackage: error: fakeroot debian/rules binary gave error exit status 2 [ 180s] [ 180s] lamb21 failed "build openbsc_0.15.1.20170812.dsc" at Sat Aug 12 20:05:49 UTC 2017. [ 180s] [ 180s] ### VM INTERACTION START ### [ 183s] [ 171.033914] reboot: Power down [ 183s] ### VM INTERACTION END ### [ 183s] [ 183s] lamb21 failed "build openbsc_0.15.1.20170812.dsc" at Sat Aug 12 20:05:52 UTC 2017. [ 183s] -- 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 Aug 12 20:56:16 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 12 Aug 2017 20:56:16 +0000 Subject: [PATCH] openggsn[master]: Properly format IMSI before using it in trap Message-ID: Review at https://gerrit.osmocom.org/3501 Properly format IMSI before using it in trap For some reason Max' commits introducing the CTRL/trap interface about one year ago didn't convert the IMSI to its actual textual representation before usign it in the CTRL interface. Let's clean that up by properly interpreting the IMSI. Change-Id: I8b20d2e47a29de266d93a7ddd5e6877f7e346a63 --- M ggsn/ggsn.c M gtp/gtp.c M gtp/gtp.h 3 files changed, 30 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/openggsn refs/changes/01/3501/1 diff --git a/ggsn/ggsn.c b/ggsn/ggsn.c index 05a56ae..c6a6dac 100644 --- a/ggsn/ggsn.c +++ b/ggsn/ggsn.c @@ -146,7 +146,7 @@ const char *addrstr = in46a_ntop(&member->addr, addrbuf, sizeof(addrbuf)); - snprintf(val, sizeof(val), "%" PRIu64 ",%s", pdp->imsi, addrstr); + snprintf(val, sizeof(val), "%s,%s", imsi_gtp2str(&pdp->imsi), addrstr); if (ctrl_cmd_send_trap(gsn->ctrl, var, val) < 0) { LOGP(DGGSN, LOGL_ERROR, "Failed to create and send TRAP for IMSI %" PRIu64 " [%s].\n", pdp->imsi, var); diff --git a/gtp/gtp.c b/gtp/gtp.c index 801664d..4aa6eb1 100644 --- a/gtp/gtp.c +++ b/gtp/gtp.c @@ -3244,3 +3244,31 @@ memcpy(gsna->v, src, gsna->l); return 0; } + +/* TS 29.060 has yet again a different encoding for IMSIs than + * what we have in other places, so we cannot use the gsm48 + * decoding functions. Also, libgtp uses an uint64_t in + * _network byte order_ to contain BCD digits ?!? */ +const char *imsi_gtp2str(const uint64_t *imsi) +{ + static char buf[sizeof(*imsi)+1]; + const uint8_t *imsi8 = (const uint8_t *) imsi; + unsigned int i, j = 0; + + for (i = 0; i < sizeof(*imsi); i++) { + uint8_t nibble; + + nibble = imsi8[i] & 0xf; + if (nibble == 0xf) + break; + buf[j++] = osmo_bcd2char(nibble); + + nibble = imsi8[i] >> 4; + if (nibble == 0xf) + break; + buf[j++] = osmo_bcd2char(nibble); + } + + buf[j++] = '\0'; + return buf; +} diff --git a/gtp/gtp.h b/gtp/gtp.h index fd138cc..8f13ed2 100644 --- a/gtp/gtp.h +++ b/gtp/gtp.h @@ -402,5 +402,6 @@ extern int eua2ipv4(struct in_addr *dst, struct ul66_t *eua); extern int gsna2in_addr(struct in_addr *dst, struct ul16_t *gsna); extern int in_addr2gsna(struct ul16_t *gsna, struct in_addr *src); +extern const char *imsi_gtp2str(const uint64_t *imsi); #endif /* !_GTP_H */ -- To view, visit https://gerrit.osmocom.org/3501 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I8b20d2e47a29de266d93a7ddd5e6877f7e346a63 Gerrit-PatchSet: 1 Gerrit-Project: openggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Sat Aug 12 20:56:17 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 12 Aug 2017 20:56:17 +0000 Subject: [PATCH] openggsn[master]: libgtp: Add missing mandatory IEs in GTP Error Indication Message-ID: Review at https://gerrit.osmocom.org/3502 libgtp: Add missing mandatory IEs in GTP Error Indication Change-Id: Iadd1fe3de7c476576a4409f22f5e84e9eade6b6e --- M gtp/gtp.c 1 file changed, 11 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/openggsn refs/changes/02/3502/1 diff --git a/gtp/gtp.c b/gtp/gtp.c index 4aa6eb1..a4e8e2b 100644 --- a/gtp/gtp.c +++ b/gtp/gtp.c @@ -2555,7 +2555,7 @@ return 0; } -/* Send Error Indication (response to a GPDU message */ +/* Send Error Indication (response to a GPDU message) - 3GPP TS 29.060 7.3.7 */ int gtp_error_ind_resp(struct gsn_t *gsn, int version, struct sockaddr_in *peer, int fd, void *pack, unsigned len) @@ -2563,6 +2563,16 @@ union gtp_packet packet; unsigned int length = get_default_gtp(version, GTP_ERROR, &packet); + if (version == 1) { + /* Mandatory 7.7.13 TEI Data I */ + gtpie_tv4(&packet, &length, GTP_MAX, GTPIE_TEI_DI, + ntoh32(((union gtp_packet *)pack)->gtp1l.h.tei)); + + /* Mandatory 7.7.32 GSN Address */ + gtpie_tlv(&packet, &length, GTP_MAX, GTPIE_GSN_ADDR, + sizeof(gsn->gsnu), &gsn->gsnu); + } + return gtp_resp(version, gsn, NULL, &packet, length, peer, fd, get_seq(pack), get_tid(pack)); } -- To view, visit https://gerrit.osmocom.org/3502 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Iadd1fe3de7c476576a4409f22f5e84e9eade6b6e Gerrit-PatchSet: 1 Gerrit-Project: openggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Sat Aug 12 21:31:25 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 12 Aug 2017 21:31:25 +0000 Subject: openggsn[master]: Properly format IMSI before using it in trap In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3501 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I8b20d2e47a29de266d93a7ddd5e6877f7e346a63 Gerrit-PatchSet: 1 Gerrit-Project: openggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sat Aug 12 21:31:27 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 12 Aug 2017 21:31:27 +0000 Subject: [MERGED] openggsn[master]: Properly format IMSI before using it in trap In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Properly format IMSI before using it in trap ...................................................................... Properly format IMSI before using it in trap For some reason Max' commits introducing the CTRL/trap interface about one year ago didn't convert the IMSI to its actual textual representation before usign it in the CTRL interface. Let's clean that up by properly interpreting the IMSI. Change-Id: I8b20d2e47a29de266d93a7ddd5e6877f7e346a63 --- M ggsn/ggsn.c M gtp/gtp.c M gtp/gtp.h 3 files changed, 30 insertions(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/ggsn/ggsn.c b/ggsn/ggsn.c index 05a56ae..c6a6dac 100644 --- a/ggsn/ggsn.c +++ b/ggsn/ggsn.c @@ -146,7 +146,7 @@ const char *addrstr = in46a_ntop(&member->addr, addrbuf, sizeof(addrbuf)); - snprintf(val, sizeof(val), "%" PRIu64 ",%s", pdp->imsi, addrstr); + snprintf(val, sizeof(val), "%s,%s", imsi_gtp2str(&pdp->imsi), addrstr); if (ctrl_cmd_send_trap(gsn->ctrl, var, val) < 0) { LOGP(DGGSN, LOGL_ERROR, "Failed to create and send TRAP for IMSI %" PRIu64 " [%s].\n", pdp->imsi, var); diff --git a/gtp/gtp.c b/gtp/gtp.c index 801664d..4aa6eb1 100644 --- a/gtp/gtp.c +++ b/gtp/gtp.c @@ -3244,3 +3244,31 @@ memcpy(gsna->v, src, gsna->l); return 0; } + +/* TS 29.060 has yet again a different encoding for IMSIs than + * what we have in other places, so we cannot use the gsm48 + * decoding functions. Also, libgtp uses an uint64_t in + * _network byte order_ to contain BCD digits ?!? */ +const char *imsi_gtp2str(const uint64_t *imsi) +{ + static char buf[sizeof(*imsi)+1]; + const uint8_t *imsi8 = (const uint8_t *) imsi; + unsigned int i, j = 0; + + for (i = 0; i < sizeof(*imsi); i++) { + uint8_t nibble; + + nibble = imsi8[i] & 0xf; + if (nibble == 0xf) + break; + buf[j++] = osmo_bcd2char(nibble); + + nibble = imsi8[i] >> 4; + if (nibble == 0xf) + break; + buf[j++] = osmo_bcd2char(nibble); + } + + buf[j++] = '\0'; + return buf; +} diff --git a/gtp/gtp.h b/gtp/gtp.h index fd138cc..8f13ed2 100644 --- a/gtp/gtp.h +++ b/gtp/gtp.h @@ -402,5 +402,6 @@ extern int eua2ipv4(struct in_addr *dst, struct ul66_t *eua); extern int gsna2in_addr(struct in_addr *dst, struct ul16_t *gsna); extern int in_addr2gsna(struct ul16_t *gsna, struct in_addr *src); +extern const char *imsi_gtp2str(const uint64_t *imsi); #endif /* !_GTP_H */ -- To view, visit https://gerrit.osmocom.org/3501 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I8b20d2e47a29de266d93a7ddd5e6877f7e346a63 Gerrit-PatchSet: 1 Gerrit-Project: openggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max From gerrit-no-reply at lists.osmocom.org Sat Aug 12 21:34:57 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 12 Aug 2017 21:34:57 +0000 Subject: openggsn[master]: libgtp: Add missing mandatory IEs in GTP Error Indication In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3502 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Iadd1fe3de7c476576a4409f22f5e84e9eade6b6e Gerrit-PatchSet: 1 Gerrit-Project: openggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sat Aug 12 21:34:59 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 12 Aug 2017 21:34:59 +0000 Subject: [MERGED] openggsn[master]: libgtp: Add missing mandatory IEs in GTP Error Indication In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: libgtp: Add missing mandatory IEs in GTP Error Indication ...................................................................... libgtp: Add missing mandatory IEs in GTP Error Indication Change-Id: Iadd1fe3de7c476576a4409f22f5e84e9eade6b6e --- M gtp/gtp.c 1 file changed, 11 insertions(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/gtp/gtp.c b/gtp/gtp.c index 4aa6eb1..a4e8e2b 100644 --- a/gtp/gtp.c +++ b/gtp/gtp.c @@ -2555,7 +2555,7 @@ return 0; } -/* Send Error Indication (response to a GPDU message */ +/* Send Error Indication (response to a GPDU message) - 3GPP TS 29.060 7.3.7 */ int gtp_error_ind_resp(struct gsn_t *gsn, int version, struct sockaddr_in *peer, int fd, void *pack, unsigned len) @@ -2563,6 +2563,16 @@ union gtp_packet packet; unsigned int length = get_default_gtp(version, GTP_ERROR, &packet); + if (version == 1) { + /* Mandatory 7.7.13 TEI Data I */ + gtpie_tv4(&packet, &length, GTP_MAX, GTPIE_TEI_DI, + ntoh32(((union gtp_packet *)pack)->gtp1l.h.tei)); + + /* Mandatory 7.7.32 GSN Address */ + gtpie_tlv(&packet, &length, GTP_MAX, GTPIE_GSN_ADDR, + sizeof(gsn->gsnu), &gsn->gsnu); + } + return gtp_resp(version, gsn, NULL, &packet, length, peer, fd, get_seq(pack), get_tid(pack)); } -- To view, visit https://gerrit.osmocom.org/3502 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Iadd1fe3de7c476576a4409f22f5e84e9eade6b6e Gerrit-PatchSet: 1 Gerrit-Project: openggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sat Aug 12 22:03:08 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 12 Aug 2017 22:03:08 +0000 Subject: [PATCH] openggsn[master]: libgtp: Delete PDP context on receiving GTPv1 Error Indication Message-ID: Review at https://gerrit.osmocom.org/3503 libgtp: Delete PDP context on receiving GTPv1 Error Indication When a peer GSN receives a GPDU for an unknown PDP context, it sends a GTP Error Indication. This Error Indication should be used to delete the offending PDP context locally. In GTPv1, the Error Indication contains some mandatory IEs using which we can look up the PDP context and delete it. The existing code only dealt with GTPv0 Error Indications which lack those IEs and use the TEI in the header instead. Change-Id: I3e843f9ef1d6fd7868cc992e083c0891d16b6da9 Closes: OS#2426 --- M gtp/gtp.c M gtp/pdp.c M gtp/pdp.h 3 files changed, 53 insertions(+), 6 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openggsn refs/changes/03/3503/1 diff --git a/gtp/gtp.c b/gtp/gtp.c index a4e8e2b..012aa79 100644 --- a/gtp/gtp.c +++ b/gtp/gtp.c @@ -2581,17 +2581,44 @@ int gtp_error_ind_conf(struct gsn_t *gsn, int version, struct sockaddr_in *peer, void *pack, unsigned len) { + union gtpie_member *ie[GTPIE_SIZE]; struct pdp_t *pdp; /* Find the context in question */ - if (pdp_tidget(&pdp, be64toh(((union gtp_packet *)pack)->gtp0.h.tid))) { - gsn->err_unknownpdp++; - GTP_LOGPKG(LOGL_ERROR, peer, pack, len, - "Unknown PDP context\n"); - return EOF; + if (version == 0) { + if (pdp_tidget(&pdp, be64toh(((union gtp_packet *)pack)->gtp0.h.tid))) { + gsn->err_unknownpdp++; + GTP_LOGPKG(LOGL_ERROR, peer, pack, len, + "Unknown PDP context\n"); + return EOF; + } + } else if (version == 1) { + /* we have to look-up based on the *peer* TEID */ + int hlen = get_hlen(pack); + uint32_t teid_gn; + + /* Decode information elements */ + if (gtpie_decaps(ie, version, pack + hlen, len - hlen)) { + gsn->invalid++; + GTP_LOGPKG(LOGL_ERROR, peer, pack, len, + "Invalid message format\n"); + return EOF; + } + + if (gtpie_gettv4(ie, GTPIE_TEI_DI, 0, &teid_gn)) { + gsn->missing++; + GTP_LOGPKG(LOGL_ERROR, peer, pack, len, + "Missing mandatory information field\n"); + return EOF; + } + + if (pdp_getgtp1_peer_d(&pdp, peer, teid_gn)) { + gsn->err_unknownpdp++; + GTP_LOGPKG(LOGL_ERROR, peer, pack, len, "Unknown PDP context\n"); + return EOF; + } } - gsn->err_unknownpdp++; /* TODO: Change counter */ GTP_LOGPKG(LOGL_ERROR, peer, pack, len, "Received Error Indication\n"); diff --git a/gtp/pdp.c b/gtp/pdp.c index f297af9..c576a4e 100644 --- a/gtp/pdp.c +++ b/gtp/pdp.c @@ -28,6 +28,7 @@ #include #include #include "pdp.h" +#include "gtp.h" #include "lookupa.h" /* *********************************************************** @@ -202,6 +203,24 @@ } } +/* get a PDP based on the *peer* address + TEI-Data. Used for matching inbound Error Ind */ +int pdp_getgtp1_peer_d(struct pdp_t **pdp, const struct sockaddr_in *peer, uint32_t teid_gn) +{ + unsigned int i; + + /* this is O(n) but we don't have (nor want) another hash... */ + for (i = 0; i < PDP_MAX; i++) { + struct pdp_t *candidate = &pdpa[i]; + if (candidate->inuse && candidate->teid_gn == teid_gn && + candidate->gsnru.l == sizeof(peer->sin_addr) && + !memcmp(&peer->sin_addr, candidate->gsnru.v, sizeof(peer->sin_addr))) { + *pdp = &pdpa[i]; + return 0; + } + } + return EOF; +} + int pdp_tidhash(uint64_t tid) { return (lookup(&tid, sizeof(tid), 0) % PDP_MAX); diff --git a/gtp/pdp.h b/gtp/pdp.h index 217b1d6..432f1df 100644 --- a/gtp/pdp.h +++ b/gtp/pdp.h @@ -232,6 +232,7 @@ int pdp_getgtp0(struct pdp_t **pdp, uint16_t fl); int pdp_getgtp1(struct pdp_t **pdp, uint32_t tei); +int pdp_getgtp1_peer_d(struct pdp_t **pdp, const struct sockaddr_in *peer, uint32_t teid_gn); int pdp_getimsi(struct pdp_t **pdp, uint64_t imsi, uint8_t nsapi); -- To view, visit https://gerrit.osmocom.org/3503 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I3e843f9ef1d6fd7868cc992e083c0891d16b6da9 Gerrit-PatchSet: 1 Gerrit-Project: openggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Sat Aug 12 23:17:05 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 12 Aug 2017 23:17:05 +0000 Subject: [PATCH] openbsc[master]: Migrate from gprs_apn_to_str() to libosmocore osmo_apn_to_str() Message-ID: Review at https://gerrit.osmocom.org/3504 Migrate from gprs_apn_to_str() to libosmocore osmo_apn_to_str() In 2015, Jacob moved/copied related functions to libosmocore, but for some reason didn't remove the copies here. Let's follow-up on that and remove duplicated code. The libosmocore commit introducing osmo_apn_to_str() was 8114294bf29ac6e44822c0ae43d4b0819f11b022 Change-Id: I7315ffcbed8a54cca2056f313bb7783ad82d0ee9 --- M openbsc/include/openbsc/gprs_utils.h M openbsc/src/gprs/gb_proxy_patch.c M openbsc/src/gprs/gb_proxy_vty.c M openbsc/src/gprs/gprs_sgsn.c M openbsc/src/gprs/gprs_subscriber.c M openbsc/src/gprs/gprs_utils.c M openbsc/src/gprs/gtphub.c M openbsc/src/gprs/sgsn_cdr.c M openbsc/src/gprs/sgsn_vty.c 9 files changed, 17 insertions(+), 52 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/04/3504/1 diff --git a/openbsc/include/openbsc/gprs_utils.h b/openbsc/include/openbsc/gprs_utils.h index 603605c..574f5c5 100644 --- a/openbsc/include/openbsc/gprs_utils.h +++ b/openbsc/include/openbsc/gprs_utils.h @@ -30,7 +30,6 @@ struct msgb *gprs_msgb_copy(const struct msgb *msg, const char *name); int gprs_msgb_resize_area(struct msgb *msg, uint8_t *area, size_t old_size, size_t new_size); -char *gprs_apn_to_str(char *out_str, const uint8_t *apn_enc, size_t rest_chars); int gprs_str_to_apn(uint8_t *apn_enc, size_t max_len, const char *str); /* GSM 04.08, 10.5.7.3 GPRS Timer */ diff --git a/openbsc/src/gprs/gb_proxy_patch.c b/openbsc/src/gprs/gb_proxy_patch.c index 7bddc44..210fb2b 100644 --- a/openbsc/src/gprs/gb_proxy_patch.c +++ b/openbsc/src/gprs/gb_proxy_patch.c @@ -28,6 +28,7 @@ #include #include +#include /* patch RA identifier in place */ static void gbproxy_patch_raid(uint8_t *raid_enc, struct gbproxy_peer *peer, @@ -101,7 +102,7 @@ LOGP(DGPRS, LOGL_DEBUG, "Patching %s to SGSN: Removing APN '%s'\n", log_text, - gprs_apn_to_str(str1, apn, apn_len)); + osmo_apn_to_str(str1, apn, apn_len)); *new_apn_ie_len = 0; gprs_msgb_resize_area(msg, apn_ie, apn_ie_len, 0); @@ -116,8 +117,8 @@ "Patching %s to SGSN: " "Replacing APN '%s' -> '%s'\n", log_text, - gprs_apn_to_str(str1, apn, apn_len), - gprs_apn_to_str(str2, peer->cfg->core_apn, + osmo_apn_to_str(str1, apn, apn_len), + osmo_apn_to_str(str2, peer->cfg->core_apn, peer->cfg->core_apn_size)); *new_apn_ie_len = peer->cfg->core_apn_size + 2; diff --git a/openbsc/src/gprs/gb_proxy_vty.c b/openbsc/src/gprs/gb_proxy_vty.c index 933b6b0..86d65a8 100644 --- a/openbsc/src/gprs/gb_proxy_vty.c +++ b/openbsc/src/gprs/gb_proxy_vty.c @@ -29,6 +29,7 @@ #include #include +#include #include #include @@ -107,7 +108,7 @@ if (g_cfg->core_apn_size > 0) { char str[500] = {0}; vty_out(vty, " core-access-point-name %s%s", - gprs_apn_to_str(str, g_cfg->core_apn, + osmo_apn_to_str(str, g_cfg->core_apn, g_cfg->core_apn_size), VTY_NEWLINE); } else { diff --git a/openbsc/src/gprs/gprs_sgsn.c b/openbsc/src/gprs/gprs_sgsn.c index 3c363bc..acaf781 100644 --- a/openbsc/src/gprs/gprs_sgsn.c +++ b/openbsc/src/gprs/gprs_sgsn.c @@ -30,6 +30,7 @@ #include #include #include +#include #include #include @@ -757,7 +758,7 @@ return NULL; } - gprs_apn_to_str(req_apn_str, + osmo_apn_to_str(req_apn_str, TLVP_VAL(tp, GSM48_IE_GSM_APN), TLVP_LEN(tp, GSM48_IE_GSM_APN)); diff --git a/openbsc/src/gprs/gprs_subscriber.c b/openbsc/src/gprs/gprs_subscriber.c index c90ba70..d13bd83 100644 --- a/openbsc/src/gprs/gprs_subscriber.c +++ b/openbsc/src/gprs/gprs_subscriber.c @@ -22,6 +22,7 @@ #include #include +#include #include #include #include @@ -370,7 +371,7 @@ OSMO_ASSERT(pdp_data != NULL); pdp_data->pdp_type = pdp_info->pdp_type; - gprs_apn_to_str(pdp_data->apn_str, + osmo_apn_to_str(pdp_data->apn_str, pdp_info->apn_enc, pdp_info->apn_enc_len); memcpy(pdp_data->qos_subscribed, pdp_info->qos_enc, pdp_info->qos_enc_len); pdp_data->qos_subscribed_len = pdp_info->qos_enc_len; diff --git a/openbsc/src/gprs/gprs_utils.c b/openbsc/src/gprs/gprs_utils.c index 64ed978..91a09d2 100644 --- a/openbsc/src/gprs/gprs_utils.c +++ b/openbsc/src/gprs/gprs_utils.c @@ -114,34 +114,6 @@ return 0; } -/* TODO: Move these conversion functions to a utils file. */ -/* TODO: consolidate with gprs_apn2str(). */ -/** memmove apn_enc to out_str, replacing the length octets in apn_enc with '.' - * (omitting the first one) and terminating with a '\0'. - * out_str needs to have rest_chars amount of bytes or 1 whatever is bigger. - */ -char * gprs_apn_to_str(char *out_str, const uint8_t *apn_enc, size_t rest_chars) -{ - char *str = out_str; - - while (rest_chars > 0 && apn_enc[0]) { - size_t label_size = apn_enc[0]; - if (label_size + 1 > rest_chars) - return NULL; - - memmove(str, apn_enc + 1, label_size); - str += label_size; - rest_chars -= label_size + 1; - apn_enc += label_size + 1; - - if (rest_chars) - *(str++) = '.'; - } - str[0] = '\0'; - - return out_str; -} - int gprs_str_to_apn(uint8_t *apn_enc, size_t max_len, const char *str) { uint8_t *last_len_field; diff --git a/openbsc/src/gprs/gtphub.c b/openbsc/src/gprs/gtphub.c index 5e7520e..0a8e375 100644 --- a/openbsc/src/gprs/gtphub.c +++ b/openbsc/src/gprs/gtphub.c @@ -42,6 +42,8 @@ #include #include +#include + static const int GTPH_GC_TICK_SECONDS = 1; @@ -498,7 +500,7 @@ len = sizeof(apn_buf) - 1; apn_buf[len] = '\0'; - *apn_str = gprs_apn_to_str(apn_buf, (uint8_t*)apn_buf, len); + *apn_str = osmo_apn_to_str(apn_buf, (uint8_t*)apn_buf, len); if (!(*apn_str)) { LOG(LOGL_ERROR, "APN IE: present but cannot be decoded: %s\n", osmo_hexdump((uint8_t*)apn_buf, len)); diff --git a/openbsc/src/gprs/sgsn_cdr.c b/openbsc/src/gprs/sgsn_cdr.c index 0910896..16ea9d4 100644 --- a/openbsc/src/gprs/sgsn_cdr.c +++ b/openbsc/src/gprs/sgsn_cdr.c @@ -22,6 +22,7 @@ #include #include #include +#include #include @@ -145,7 +146,7 @@ if (pdp->lib) { - gprs_apn_to_str(apni, pdp->lib->apn_use.v, pdp->lib->apn_use.l); + osmo_apn_to_str(apni, pdp->lib->apn_use.v, pdp->lib->apn_use.l); inet_ntop(AF_INET, &pdp->lib->hisaddr0.s_addr, ggsn_addr, sizeof(ggsn_addr)); extract_eua(&pdp->lib->eua, eua_addr); } diff --git a/openbsc/src/gprs/sgsn_vty.c b/openbsc/src/gprs/sgsn_vty.c index e09a029..b5d2eae 100644 --- a/openbsc/src/gprs/sgsn_vty.c +++ b/openbsc/src/gprs/sgsn_vty.c @@ -28,6 +28,7 @@ #include #include #include +#include #include #include @@ -110,7 +111,6 @@ #define GSM48_MAX_APN_LEN 102 /* 10.5.6.1 */ -/* TODO: consolidate with gprs_apn_to_str(). */ /** Copy apn to a static buffer, replacing the length octets in apn_enc with '.' * and terminating with a '\0'. Return the static buffer. * len: the length of the encoded APN (which has no terminating zero). @@ -118,23 +118,10 @@ static char *gprs_apn2str(uint8_t *apn, unsigned int len) { static char apnbuf[GSM48_MAX_APN_LEN+1]; - unsigned int i = 0; if (!apn) return ""; - - if (len > sizeof(apnbuf)-1) - len = sizeof(apnbuf)-1; - - memcpy(apnbuf, apn, len); - apnbuf[len] = '\0'; - - /* replace the domain name step sizes with dots */ - while (i < len) { - unsigned int step = apnbuf[i]; - apnbuf[i] = '.'; - i += step+1; - } + osmo_apn_to_str(apnbuf, apn, len); return apnbuf+1; } -- To view, visit https://gerrit.osmocom.org/3504 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I7315ffcbed8a54cca2056f313bb7783ad82d0ee9 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Sat Aug 12 23:17:09 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 12 Aug 2017 23:17:09 +0000 Subject: [PATCH] openbsc[master]: sgsn_vty: Don't assume pdp->lib is always valid Message-ID: Review at https://gerrit.osmocom.org/3505 sgsn_vty: Don't assume pdp->lib is always valid We can only print libgtp pdp information if a library context is attached to this pdp context. This is not always the case, particuarly during some teardown scenarios. Change-Id: Ia3184877f9709db65f5f93a98403f2ef5b04a8ca --- M openbsc/src/gprs/sgsn_vty.c 1 file changed, 16 insertions(+), 14 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/05/3505/1 diff --git a/openbsc/src/gprs/sgsn_vty.c b/openbsc/src/gprs/sgsn_vty.c index b5d2eae..d4447e1 100644 --- a/openbsc/src/gprs/sgsn_vty.c +++ b/openbsc/src/gprs/sgsn_vty.c @@ -445,20 +445,22 @@ const char *imsi = pdp->mm ? pdp->mm->imsi : "(detaching)"; vty_out(vty, "%sPDP Context IMSI: %s, SAPI: %u, NSAPI: %u, TI: %u%s", pfx, imsi, pdp->sapi, pdp->nsapi, pdp->ti, VTY_NEWLINE); - vty_out(vty, "%s APN: %s%s", pfx, - gprs_apn2str(pdp->lib->apn_use.v, pdp->lib->apn_use.l), - VTY_NEWLINE); - vty_out(vty, "%s PDP Address: %s%s", pfx, - gprs_pdpaddr2str(pdp->lib->eua.v, pdp->lib->eua.l), - VTY_NEWLINE); - vty_out(vty, "%s GTP Local Control(%s / TEIC: 0x%08x) ", pfx, - gtp_ntoa(&pdp->lib->gsnlc), pdp->lib->teic_own); - vty_out(vty, "Data(%s / TEID: 0x%08x)%s", - gtp_ntoa(&pdp->lib->gsnlu), pdp->lib->teid_own, VTY_NEWLINE); - vty_out(vty, "%s GTP Remote Control(%s / TEIC: 0x%08x) ", pfx, - gtp_ntoa(&pdp->lib->gsnrc), pdp->lib->teic_gn); - vty_out(vty, "Data(%s / TEID: 0x%08x)%s", - gtp_ntoa(&pdp->lib->gsnru), pdp->lib->teid_gn, VTY_NEWLINE); + if (pdp->lib) { + vty_out(vty, "%s APN: %s%s", pfx, + gprs_apn2str(pdp->lib->apn_use.v, pdp->lib->apn_use.l), + VTY_NEWLINE); + vty_out(vty, "%s PDP Address: %s%s", pfx, + gprs_pdpaddr2str(pdp->lib->eua.v, pdp->lib->eua.l), + VTY_NEWLINE); + vty_out(vty, "%s GTP Local Control(%s / TEIC: 0x%08x) ", pfx, + gtp_ntoa(&pdp->lib->gsnlc), pdp->lib->teic_own); + vty_out(vty, "Data(%s / TEID: 0x%08x)%s", + gtp_ntoa(&pdp->lib->gsnlu), pdp->lib->teid_own, VTY_NEWLINE); + vty_out(vty, "%s GTP Remote Control(%s / TEIC: 0x%08x) ", pfx, + gtp_ntoa(&pdp->lib->gsnrc), pdp->lib->teic_gn); + vty_out(vty, "Data(%s / TEID: 0x%08x)%s", + gtp_ntoa(&pdp->lib->gsnru), pdp->lib->teid_gn, VTY_NEWLINE); + } vty_out_rate_ctr_group(vty, " ", pdp->ctrg); } -- To view, visit https://gerrit.osmocom.org/3505 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ia3184877f9709db65f5f93a98403f2ef5b04a8ca Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Sat Aug 12 23:17:39 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 12 Aug 2017 23:17:39 +0000 Subject: openggsn[master]: libgtp: Delete PDP context on receiving GTPv1 Error Indication In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3503 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I3e843f9ef1d6fd7868cc992e083c0891d16b6da9 Gerrit-PatchSet: 1 Gerrit-Project: openggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sat Aug 12 23:17:40 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 12 Aug 2017 23:17:40 +0000 Subject: [MERGED] openggsn[master]: libgtp: Delete PDP context on receiving GTPv1 Error Indication In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: libgtp: Delete PDP context on receiving GTPv1 Error Indication ...................................................................... libgtp: Delete PDP context on receiving GTPv1 Error Indication When a peer GSN receives a GPDU for an unknown PDP context, it sends a GTP Error Indication. This Error Indication should be used to delete the offending PDP context locally. In GTPv1, the Error Indication contains some mandatory IEs using which we can look up the PDP context and delete it. The existing code only dealt with GTPv0 Error Indications which lack those IEs and use the TEI in the header instead. Change-Id: I3e843f9ef1d6fd7868cc992e083c0891d16b6da9 Closes: OS#2426 --- M gtp/gtp.c M gtp/pdp.c M gtp/pdp.h 3 files changed, 53 insertions(+), 6 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/gtp/gtp.c b/gtp/gtp.c index a4e8e2b..012aa79 100644 --- a/gtp/gtp.c +++ b/gtp/gtp.c @@ -2581,17 +2581,44 @@ int gtp_error_ind_conf(struct gsn_t *gsn, int version, struct sockaddr_in *peer, void *pack, unsigned len) { + union gtpie_member *ie[GTPIE_SIZE]; struct pdp_t *pdp; /* Find the context in question */ - if (pdp_tidget(&pdp, be64toh(((union gtp_packet *)pack)->gtp0.h.tid))) { - gsn->err_unknownpdp++; - GTP_LOGPKG(LOGL_ERROR, peer, pack, len, - "Unknown PDP context\n"); - return EOF; + if (version == 0) { + if (pdp_tidget(&pdp, be64toh(((union gtp_packet *)pack)->gtp0.h.tid))) { + gsn->err_unknownpdp++; + GTP_LOGPKG(LOGL_ERROR, peer, pack, len, + "Unknown PDP context\n"); + return EOF; + } + } else if (version == 1) { + /* we have to look-up based on the *peer* TEID */ + int hlen = get_hlen(pack); + uint32_t teid_gn; + + /* Decode information elements */ + if (gtpie_decaps(ie, version, pack + hlen, len - hlen)) { + gsn->invalid++; + GTP_LOGPKG(LOGL_ERROR, peer, pack, len, + "Invalid message format\n"); + return EOF; + } + + if (gtpie_gettv4(ie, GTPIE_TEI_DI, 0, &teid_gn)) { + gsn->missing++; + GTP_LOGPKG(LOGL_ERROR, peer, pack, len, + "Missing mandatory information field\n"); + return EOF; + } + + if (pdp_getgtp1_peer_d(&pdp, peer, teid_gn)) { + gsn->err_unknownpdp++; + GTP_LOGPKG(LOGL_ERROR, peer, pack, len, "Unknown PDP context\n"); + return EOF; + } } - gsn->err_unknownpdp++; /* TODO: Change counter */ GTP_LOGPKG(LOGL_ERROR, peer, pack, len, "Received Error Indication\n"); diff --git a/gtp/pdp.c b/gtp/pdp.c index f297af9..c576a4e 100644 --- a/gtp/pdp.c +++ b/gtp/pdp.c @@ -28,6 +28,7 @@ #include #include #include "pdp.h" +#include "gtp.h" #include "lookupa.h" /* *********************************************************** @@ -202,6 +203,24 @@ } } +/* get a PDP based on the *peer* address + TEI-Data. Used for matching inbound Error Ind */ +int pdp_getgtp1_peer_d(struct pdp_t **pdp, const struct sockaddr_in *peer, uint32_t teid_gn) +{ + unsigned int i; + + /* this is O(n) but we don't have (nor want) another hash... */ + for (i = 0; i < PDP_MAX; i++) { + struct pdp_t *candidate = &pdpa[i]; + if (candidate->inuse && candidate->teid_gn == teid_gn && + candidate->gsnru.l == sizeof(peer->sin_addr) && + !memcmp(&peer->sin_addr, candidate->gsnru.v, sizeof(peer->sin_addr))) { + *pdp = &pdpa[i]; + return 0; + } + } + return EOF; +} + int pdp_tidhash(uint64_t tid) { return (lookup(&tid, sizeof(tid), 0) % PDP_MAX); diff --git a/gtp/pdp.h b/gtp/pdp.h index 217b1d6..432f1df 100644 --- a/gtp/pdp.h +++ b/gtp/pdp.h @@ -232,6 +232,7 @@ int pdp_getgtp0(struct pdp_t **pdp, uint16_t fl); int pdp_getgtp1(struct pdp_t **pdp, uint32_t tei); +int pdp_getgtp1_peer_d(struct pdp_t **pdp, const struct sockaddr_in *peer, uint32_t teid_gn); int pdp_getimsi(struct pdp_t **pdp, uint64_t imsi, uint8_t nsapi); -- To view, visit https://gerrit.osmocom.org/3503 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I3e843f9ef1d6fd7868cc992e083c0891d16b6da9 Gerrit-PatchSet: 1 Gerrit-Project: openggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sat Aug 12 23:17:48 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 12 Aug 2017 23:17:48 +0000 Subject: openbsc[master]: sgsn_vty: Don't assume pdp->lib is always valid In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3505 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ia3184877f9709db65f5f93a98403f2ef5b04a8ca Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sat Aug 12 23:20:20 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 12 Aug 2017 23:20:20 +0000 Subject: libosmocore[master]: add osmo_fd_setup() convenience function to fill-in osmo_fd In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3500 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I6dbf19ea22fd65302bfc5424c10418d1b7939094 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sat Aug 12 23:20:37 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 12 Aug 2017 23:20:37 +0000 Subject: [MERGED] libosmocore[master]: add osmo_fd_setup() convenience function to fill-in osmo_fd In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: add osmo_fd_setup() convenience function to fill-in osmo_fd ...................................................................... add osmo_fd_setup() convenience function to fill-in osmo_fd This basically follows the concept of osmo_timer_setup() and allows the caller to fill-in all configurable fields of osmo_fd in one line of code, rather than open-coding it in 5 lines everywhere. Change-Id: I6dbf19ea22fd65302bfc5424c10418d1b7939094 --- M include/osmocom/core/select.h M src/select.c 2 files changed, 22 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/include/osmocom/core/select.h b/include/osmocom/core/select.h index 2abda2d..b6fed3c 100644 --- a/include/osmocom/core/select.h +++ b/include/osmocom/core/select.h @@ -36,6 +36,10 @@ unsigned int priv_nr; }; +void osmo_fd_setup(struct osmo_fd *ofd, int fd, unsigned int when, + int (*cb)(struct osmo_fd *fd, unsigned int what), + void *data, unsigned int priv_nr); + bool osmo_fd_is_registered(struct osmo_fd *fd); int osmo_fd_register(struct osmo_fd *fd); void osmo_fd_unregister(struct osmo_fd *fd); diff --git a/src/select.c b/src/select.c index 0ba8bc6..4b98b62 100644 --- a/src/select.c +++ b/src/select.c @@ -47,6 +47,24 @@ static LLIST_HEAD(osmo_fds); static int unregistered_count; +/*! Set up an osmo-fd. Will not register it. + * \param[inout] ofd Osmo FD to be set-up + * \param[in] fd OS-level file descriptor number + * \param[in] when bit-mask of BSC_FD_{READ,WRITE,EXECEPT} + * \param[in] cb Call-back function to be called + * \param[in] data Private context pointer + * \param[in] priv_nr Private number + */ +void osmo_fd_setup(struct osmo_fd *ofd, int fd, unsigned int when, + int (*cb)(struct osmo_fd *fd, unsigned int what), + void *data, unsigned int priv_nr) +{ + ofd->fd = fd; + ofd->when = when; + ofd->cb = cb; + ofd->data = data; + ofd->priv_nr = priv_nr; +} /*! Check if a file descriptor is already registered * \param[in] fd osmocom file descriptor to be checked -- To view, visit https://gerrit.osmocom.org/3500 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I6dbf19ea22fd65302bfc5424c10418d1b7939094 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sat Aug 12 23:20:50 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 12 Aug 2017 23:20:50 +0000 Subject: libsmpp34[master]: add esm_class definitions In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3473 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I91afd8b462b8fd3b2c4c5b54f4eeb7ec5b730b65 Gerrit-PatchSet: 2 Gerrit-Project: libsmpp34 Gerrit-Branch: master Gerrit-Owner: Pablo Neira Ayuso Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pablo Neira Ayuso Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sat Aug 12 23:20:52 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 12 Aug 2017 23:20:52 +0000 Subject: [MERGED] libsmpp34[master]: add esm_class definitions In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: add esm_class definitions ...................................................................... add esm_class definitions Add special message attributes definitions that are associated with the short message. Thus, we can get rid of magic numbers in our codebase. Change-Id: I91afd8b462b8fd3b2c4c5b54f4eeb7ec5b730b65 --- M src/smpp34.h 1 file changed, 8 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/smpp34.h b/src/smpp34.h index 5fb6395..9d51a4a 100644 --- a/src/smpp34.h +++ b/src/smpp34.h @@ -204,4 +204,12 @@ #define TLVID_its_reply_type 0x1380 /* CDMA */ #define TLVID_its_session_info 0x1383 /* CDMA */ +/* As defined by SMPP 3.4, Sect. 5.2.12 Parameter Definition esm_class. */ +#define SMPP34_DATAGRAM_MODE 0x01 +#define SMPP34_MSG_MODE_MASK 0x03 +#define SMPP34_DELIVERY_RECEIPT 0x04 +#define SMPP34_DELIVERY_ACK 0x08 +#define SMPP34_UDHI_IND 0x40 +#define SMPP34_REPLY_PATH 0x80 + #endif -- To view, visit https://gerrit.osmocom.org/3473 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I91afd8b462b8fd3b2c4c5b54f4eeb7ec5b730b65 Gerrit-PatchSet: 2 Gerrit-Project: libsmpp34 Gerrit-Branch: master Gerrit-Owner: Pablo Neira Ayuso Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pablo Neira Ayuso From gerrit-no-reply at lists.osmocom.org Sat Aug 12 23:21:28 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 12 Aug 2017 23:21:28 +0000 Subject: openbsc[master]: libmsc: use smpp34_tlv_for_each() to avoid suboptimal TLV ha... In-Reply-To: References: Message-ID: Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3470 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I53a65164a6cc4abc6bf57d9a8dc275cf21c90222 Gerrit-PatchSet: 3 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Pablo Neira Ayuso Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pablo Neira Ayuso Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sat Aug 12 23:21:35 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 12 Aug 2017 23:21:35 +0000 Subject: [MERGED] openbsc[master]: libmsc: use smpp34_tlv_for_each() to avoid suboptimal TLV ha... In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: libmsc: use smpp34_tlv_for_each() to avoid suboptimal TLV handling ...................................................................... libmsc: use smpp34_tlv_for_each() to avoid suboptimal TLV handling submit_to_sms() now handles two TLVs, so find_tlv() is suboptiomal and it can be removed, since it would result in two passes on the TLV list. Use new smpp34_tlv_for_each() helper to iterate over the list of TLVs that is available since I446929feed049d0411e1629ca263e2bc41f714cc. Change-Id: I53a65164a6cc4abc6bf57d9a8dc275cf21c90222 --- M openbsc/src/libmsc/smpp_openbsc.c 1 file changed, 41 insertions(+), 31 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/openbsc/src/libmsc/smpp_openbsc.c b/openbsc/src/libmsc/smpp_openbsc.c index 85de040..7e23abd 100644 --- a/openbsc/src/libmsc/smpp_openbsc.c +++ b/openbsc/src/libmsc/smpp_openbsc.c @@ -72,26 +72,31 @@ return subscr; } -/*! \brief find a TLV with given tag in list of libsmpp34 TLVs */ -static struct tlv_t *find_tlv(struct tlv_t *head, uint16_t tag) +static int smpp34_submit_tlv_msg_payload(const struct tlv_t *t, + const struct submit_sm_t *submit, + const uint8_t **sms_msg, + unsigned int *sms_msg_len) { - struct tlv_t *t; - - for (t = head; t != NULL; t = t->next) { - if (t->tag == tag) - return t; + if (submit->sm_length) { + LOGP(DLSMS, LOGL_ERROR, + "SMPP cannot have payload in TLV _and_ in the header\n"); + return -1; } - return NULL; + *sms_msg = t->value.octet; + *sms_msg_len = t->length; + + return 0; } /*! \brief convert from submit_sm_t to gsm_sms */ static int submit_to_sms(struct gsm_sms **psms, struct gsm_network *net, const struct submit_sm_t *submit) { + const uint8_t *sms_msg = NULL; struct gsm_subscriber *dest; + uint16_t msg_ref = 0; struct gsm_sms *sms; struct tlv_t *t; - const uint8_t *sms_msg; unsigned int sms_msg_len; int mode; @@ -105,31 +110,40 @@ return ESME_RINVDSTADR; } - t = find_tlv(submit->tlv, TLVID_message_payload); - if (t) { - if (submit->sm_length) { - /* ERROR: we cannot have both! */ - LOGP(DLSMS, LOGL_ERROR, "SMPP Cannot have payload in " - "TLV _and_ in the header\n"); - subscr_put(dest); - return ESME_ROPTPARNOTALLWD; + smpp34_tlv_for_each(t, submit->tlv) { + switch (t->tag) { + case TLVID_message_payload: + if (smpp34_submit_tlv_msg_payload(t, submit, &sms_msg, + &sms_msg_len) < 0) { + subscr_put(dest); + return ESME_ROPTPARNOTALLWD; + } + break; + case TLVID_user_message_reference: + msg_ref = ntohs(t->value.val16); + break; + default: + break; } - sms_msg = t->value.octet; - sms_msg_len = t->length; - } else if (submit->sm_length > 0 && submit->sm_length < 255) { - sms_msg = submit->short_message; - sms_msg_len = submit->sm_length; - } else { - LOGP(DLSMS, LOGL_ERROR, - "SMPP neither message payload nor valid sm_length.\n"); - subscr_put(dest); - return ESME_RINVPARLEN; + } + + if (!sms_msg) { + if (submit->sm_length > 0 && submit->sm_length < 255) { + sms_msg = submit->short_message; + sms_msg_len = submit->sm_length; + } else { + LOGP(DLSMS, LOGL_ERROR, + "SMPP neither message payload nor valid sm_length.\n"); + subscr_put(dest); + return ESME_RINVPARLEN; + } } sms = sms_alloc(); sms->source = SMS_SOURCE_SMPP; sms->smpp.sequence_nr = submit->sequence_number; sms->status_rep_req = submit->registered_delivery; + sms->msg_ref = msg_ref; /* fill in the destination address */ sms->receiver = dest; @@ -203,10 +217,6 @@ memcpy(sms->user_data, sms_msg, sms_msg_len); sms->user_data_len = sms_msg_len; } - - t = find_tlv(submit->tlv, TLVID_user_message_reference); - if (t) - sms->msg_ref = ntohs(t->value.val16); *psms = sms; return ESME_ROK; -- To view, visit https://gerrit.osmocom.org/3470 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I53a65164a6cc4abc6bf57d9a8dc275cf21c90222 Gerrit-PatchSet: 4 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Pablo Neira Ayuso Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pablo Neira Ayuso Gerrit-Reviewer: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Sun Aug 13 00:39:27 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sun, 13 Aug 2017 00:39:27 +0000 Subject: [PATCH] osmo-iuh[master]: add /debian package support Message-ID: Review at https://gerrit.osmocom.org/3506 add /debian package support Change-Id: I985805aea0e48fe70619de8b81206098e4e37613 --- A debian/changelog A debian/compat A debian/control A debian/copyright A debian/libosmo-ranap-dev.install A debian/libosmo-ranap0.install A debian/osmo-hnbgw.install A debian/rules A debian/source/format 9 files changed, 142 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-iuh refs/changes/06/3506/1 diff --git a/debian/changelog b/debian/changelog new file mode 100644 index 0000000..91bd155 --- /dev/null +++ b/debian/changelog @@ -0,0 +1,5 @@ +osmo-iuh (0.1.0) UNRELEASED; urgency=low + + * Initial release. + + -- Alexander Couzens Tue, 08 Aug 2017 04:13:19 +0000 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..56a7667 --- /dev/null +++ b/debian/control @@ -0,0 +1,60 @@ +Source: osmo-iuh +Section: libs +Priority: extra +Maintainer: Alexander Couzens +Build-Depends: debhelper (>=9), + dh-autoreconf, + pkg-config, + autoconf, + automake, + libtool, + git, + libasn1c-dev, + libsctp-dev, + libosmo-netif-dev, + libosmocore-dev, + libosmo-netif-dev, + libosmo-sccp-dev, + python (>= 2.7) +Standards-Version: 3.9.8 +Vcs-Git: git://git.osmocom.org/osmo-iuh.git +Vcs-Browser: https://git.osmocom.org/osmo-iuh/ +Homepage: https://projects.osmocom.org/projects/osmohnbgw + +Package: osmo-hnbgw +Section: net +Architecture: any +Multi-Arch: no +Pre-Depends: ${misc:Pre-Depends} +Depends: ${misc:Depends}, ${shlibs:Depends} +Description: osmocom Home Node B Gateway + +Package: osmo-hnbgw-dbg +Section: debug +Architecture: any +Multi-Arch: no +Pre-Depends: ${misc:Pre-Depends} +Depends: osmo-hnbgw (= ${binary:Version}), ${misc:Depends} +Description: osmocom Home Node B Gateway + +Package: libosmo-ranap0 +Section: libs +Architecture: any +Multi-Arch: same +Pre-Depends: ${misc:Pre-Depends} +Depends: ${misc:Depends}, ${shlibs:Depends} +Description: Osmocom code for the Iuh interface (HNBAP, RUA, RANAP) + +Package: libosmo-ranap-dbg +Section: debug +Architecture: any +Multi-Arch: same +Depends: libosmo-ranap0 (= ${binary:Version}), ${misc:Depends} +Description: Osmocom code for the Iuh interface (HNBAP, RUA, RANAP) + +Package: libosmo-ranap-dev +Section: libdevel +Architecture: any +Multi-Arch: same +Depends: libosmo-ranap0 (= ${binary:Version}), ${misc:Depends} +Description: Osmocom code for the Iuh interface (HNBAP, RUA, RANAP) diff --git a/debian/copyright b/debian/copyright new file mode 100644 index 0000000..601e3c5 --- /dev/null +++ b/debian/copyright @@ -0,0 +1,51 @@ +Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ +Upstream-Name: osmo-iuh +Source: git://git.osmocom.org/ + +Files: * +Copyright: 2015 Daniel Willmann + 2015 Harald Welte + 2015 Sysmocom s.f.m.c. GmbH + 2015 sysmocom s.f.m.c GmbH + 2016 sysmocom s.m.f.c. GmbH + 2016-2017 sysmocom s.f.m.c. GmbH +License: AGPL-3.0+ + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU Affero General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + . + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Affero General Public License for more details. + . + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see . + +Files: asn1/rua/eurecom/rua_decoder.c + asn1/rua/eurecom/rua_encoder.c + asn1/rua/eurecom/rua_ies_defs.h +Copyright: 1999-2012 Eurecom +License: GPL-2.0 + This program is free software; you can redistribute it and/or modify it + under the terms and conditions of the GNU General Public License, + version 2, as published by the Free Software Foundation. + . + This program is distributed in the hope 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 St - Fifth Floor, Boston, MA 02110-1301 USA. + . + The full GNU General Public License is included in this distribution in + the file called "COPYING". + . + Contact Information + . + 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-ranap-dev.install b/debian/libosmo-ranap-dev.install new file mode 100644 index 0000000..5bd9dd0 --- /dev/null +++ b/debian/libosmo-ranap-dev.install @@ -0,0 +1,3 @@ +usr/include +usr/lib/*/*.so +usr/lib/*/pkgconfig/*.pc diff --git a/debian/libosmo-ranap0.install b/debian/libosmo-ranap0.install new file mode 100644 index 0000000..3de3b10 --- /dev/null +++ b/debian/libosmo-ranap0.install @@ -0,0 +1 @@ +usr/lib/*/*.so.* diff --git a/debian/osmo-hnbgw.install b/debian/osmo-hnbgw.install new file mode 100644 index 0000000..e230915 --- /dev/null +++ b/debian/osmo-hnbgw.install @@ -0,0 +1,2 @@ +usr/bin/osmo-hnbgw +usr/share/doc/osmo-iuh/examples/osmo-hnbgw.cfg diff --git a/debian/rules b/debian/rules new file mode 100755 index 0000000..0f6fc11 --- /dev/null +++ b/debian/rules @@ -0,0 +1,18 @@ +#!/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') + +# main packaging script based on dh7 syntax +%: + dh $@ --with autoreconf + +override_dh_autoreconf: + echo $(VERSION) > .tarball-version + dh_autoreconf + +# See https://www.debian.org/doc/manuals/developers-reference/best-pkging-practices.html#bpp-dbg +override_dh_strip: + dh_strip --dbg-package=libosmo-ranap-dbg + dh_strip --dbg-package=osmo-hnbgw 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/3506 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I985805aea0e48fe70619de8b81206098e4e37613 Gerrit-PatchSet: 1 Gerrit-Project: osmo-iuh Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: lynxis lazus From gerrit-no-reply at lists.osmocom.org Sun Aug 13 00:39:27 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sun, 13 Aug 2017 00:39:27 +0000 Subject: [PATCH] osmo-iuh[master]: iu_client: derive local SCCP addr from sccp instance Message-ID: Review at https://gerrit.osmocom.org/3507 iu_client: derive local SCCP addr from sccp instance ranap_iu_init() is passed an sccp instance that has a local primary point code. Use this primary PC by default as the local address for IuCS and IuPS clients. Remove the current vty command 'iu local-address point-code PC': - It is possible that we would like to configure a differing local point code at some point; this should then happen via sccp address book entries, not parsing PC directly. - Obtaining the local PC from the SCCP instance makes this command obsolete for all setups we're currently aiming at: one local PC per SCCP instance. - There are vty doc failures in this vty command, which cause osmo-msc and osmo-bsc vty test failures; rather than fixing this, let's drop it entirely until we see a need for it (and then do it properly with the address book). Cosmetic: prefix the local static variable with g_* like g_sccp and g_scu and define it in the same place. No default values are needed anymore, it gets overwritten in ranap_iu_init(). Change-Id: I3bb7fc1cd5261d214c6ba0cccfe95f637e6db087 --- M src/iu_client.c M src/iu_client_vty.c 2 files changed, 3 insertions(+), 27 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-iuh refs/changes/07/3507/1 diff --git a/src/iu_client.c b/src/iu_client.c index 83ed276..17d955d 100644 --- a/src/iu_client.c +++ b/src/iu_client.c @@ -83,6 +83,7 @@ static struct osmo_sccp_instance *g_sccp; static struct osmo_sccp_user *g_scu; +static struct osmo_sccp_addr g_local_sccp_addr; const struct value_string ranap_iu_event_type_names[] = { OSMO_VALUE_STRING(RANAP_IU_EVENT_RAB_ASSIGN), @@ -584,13 +585,6 @@ * Paging ***********************************************************************/ -struct osmo_sccp_addr local_sccp_addr = { - .presence = OSMO_SCCP_ADDR_T_SSN | OSMO_SCCP_ADDR_T_PC, - .ri = OSMO_SCCP_RI_SSN_PC, - .ssn = OSMO_SCCP_SSN_RANAP, - .pc = 1, -}; - /* Send a paging command down a given SCCP User. tmsi and paging_cause are * optional and may be passed NULL and 0, respectively, to disable their use. * See enum RANAP_PagingCause. @@ -604,7 +598,7 @@ struct msgb *msg; msg = ranap_new_msg_paging_cmd(imsi, tmsi, is_ps? 1 : 0, paging_cause); msg->l2h = msg->data; - osmo_sccp_tx_unitdata_msg(g_scu, &local_sccp_addr, called_addr, msg); + osmo_sccp_tx_unitdata_msg(g_scu, &g_local_sccp_addr, called_addr, msg); return 0; } @@ -776,6 +770,7 @@ global_iu_recv_cb = iu_recv_cb; global_iu_event_cb = iu_event_cb; g_sccp = sccp; + osmo_sccp_local_addr_by_instance(&g_local_sccp_addr, sccp, OSMO_SCCP_SSN_RANAP); g_scu = osmo_sccp_user_bind(g_sccp, sccp_user_name, sccp_sap_up, OSMO_SCCP_SSN_RANAP); return 0; diff --git a/src/iu_client_vty.c b/src/iu_client_vty.c index b809b2a..a99facd 100644 --- a/src/iu_client_vty.c +++ b/src/iu_client_vty.c @@ -75,21 +75,6 @@ return CMD_SUCCESS; } -extern struct osmo_sccp_addr local_sccp_addr; - -DEFUN(cfg_iu_local_addr_pc, cfg_iu_local_addr_pc_cmd, - "iu local-address point-code PC", - IU_STR "Local SCCP Address\n") -{ - local_sccp_addr.presence = OSMO_SCCP_ADDR_T_PC | OSMO_SCCP_ADDR_T_SSN; - local_sccp_addr.ri = OSMO_SCCP_RI_SSN_PC; - local_sccp_addr.pc = osmo_ss7_pointcode_parse(NULL, argv[0]); - - return CMD_SUCCESS; -} - -/* TODO: GT address configuration, in line with 4.5.1.1.1 of TS 25.410 */ - int ranap_iu_vty_config_write(struct vty *vty, const char *indent) { if (!g_rab_assign_addr_enc) { @@ -113,9 +98,6 @@ return CMD_WARNING; } - vty_out(vty, "%siu local-address point-code %s%s", indent, - osmo_ss7_pointcode_print(NULL, local_sccp_addr.pc), VTY_NEWLINE); - if (asn_debug) vty_out(vty, "%sasn1 debug 1%s", indent, VTY_NEWLINE); @@ -130,7 +112,6 @@ g_rab_assign_addr_enc = rab_assign_addr_enc; install_element(iu_parent_node, &cfg_iu_rab_assign_addr_enc_cmd); - install_element(iu_parent_node, &cfg_iu_local_addr_pc_cmd); /* Technically, these are global ASN.1 settings and not necessarily limited to the Iu interface. * Practically, only Iu users will use ASN.1 in Osmocom programs -- at least so far. So it is -- To view, visit https://gerrit.osmocom.org/3507 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I3bb7fc1cd5261d214c6ba0cccfe95f637e6db087 Gerrit-PatchSet: 1 Gerrit-Project: osmo-iuh Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Sun Aug 13 01:12:05 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sun, 13 Aug 2017 01:12:05 +0000 Subject: osmo-iuh[master]: add /debian package support In-Reply-To: References: Message-ID: Patch Set 1: Code-Review-1 (2 comments) https://gerrit.osmocom.org/#/c/3506/1/debian/copyright File debian/copyright: Line 11: 2016-2017 sysmocom s.f.m.c. GmbH interesting list of copyrights :) https://gerrit.osmocom.org/#/c/3506/1/debian/rules File debian/rules: Line 9: dh $@ --with autoreconf (whitespace?) -- To view, visit https://gerrit.osmocom.org/3506 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I985805aea0e48fe70619de8b81206098e4e37613 Gerrit-PatchSet: 1 Gerrit-Project: osmo-iuh Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: lynxis lazus Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Sun Aug 13 02:21:27 2017 From: gerrit-no-reply at lists.osmocom.org (lynxis lazus) Date: Sun, 13 Aug 2017 02:21:27 +0000 Subject: [PATCH] osmo-iuh[master]: add /debian package support In-Reply-To: References: Message-ID: Hello Neels Hofmeyr, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3506 to look at the new patch set (#2). add /debian package support Change-Id: I985805aea0e48fe70619de8b81206098e4e37613 --- A debian/changelog A debian/compat A debian/control A debian/copyright A debian/libosmo-ranap-dev.install A debian/libosmo-ranap0.install A debian/osmo-hnbgw.install A debian/rules A debian/source/format 9 files changed, 139 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-iuh refs/changes/06/3506/2 diff --git a/debian/changelog b/debian/changelog new file mode 100644 index 0000000..91bd155 --- /dev/null +++ b/debian/changelog @@ -0,0 +1,5 @@ +osmo-iuh (0.1.0) UNRELEASED; urgency=low + + * Initial release. + + -- Alexander Couzens Tue, 08 Aug 2017 04:13:19 +0000 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..56a7667 --- /dev/null +++ b/debian/control @@ -0,0 +1,60 @@ +Source: osmo-iuh +Section: libs +Priority: extra +Maintainer: Alexander Couzens +Build-Depends: debhelper (>=9), + dh-autoreconf, + pkg-config, + autoconf, + automake, + libtool, + git, + libasn1c-dev, + libsctp-dev, + libosmo-netif-dev, + libosmocore-dev, + libosmo-netif-dev, + libosmo-sccp-dev, + python (>= 2.7) +Standards-Version: 3.9.8 +Vcs-Git: git://git.osmocom.org/osmo-iuh.git +Vcs-Browser: https://git.osmocom.org/osmo-iuh/ +Homepage: https://projects.osmocom.org/projects/osmohnbgw + +Package: osmo-hnbgw +Section: net +Architecture: any +Multi-Arch: no +Pre-Depends: ${misc:Pre-Depends} +Depends: ${misc:Depends}, ${shlibs:Depends} +Description: osmocom Home Node B Gateway + +Package: osmo-hnbgw-dbg +Section: debug +Architecture: any +Multi-Arch: no +Pre-Depends: ${misc:Pre-Depends} +Depends: osmo-hnbgw (= ${binary:Version}), ${misc:Depends} +Description: osmocom Home Node B Gateway + +Package: libosmo-ranap0 +Section: libs +Architecture: any +Multi-Arch: same +Pre-Depends: ${misc:Pre-Depends} +Depends: ${misc:Depends}, ${shlibs:Depends} +Description: Osmocom code for the Iuh interface (HNBAP, RUA, RANAP) + +Package: libosmo-ranap-dbg +Section: debug +Architecture: any +Multi-Arch: same +Depends: libosmo-ranap0 (= ${binary:Version}), ${misc:Depends} +Description: Osmocom code for the Iuh interface (HNBAP, RUA, RANAP) + +Package: libosmo-ranap-dev +Section: libdevel +Architecture: any +Multi-Arch: same +Depends: libosmo-ranap0 (= ${binary:Version}), ${misc:Depends} +Description: Osmocom code for the Iuh interface (HNBAP, RUA, RANAP) diff --git a/debian/copyright b/debian/copyright new file mode 100644 index 0000000..5cb4a3a --- /dev/null +++ b/debian/copyright @@ -0,0 +1,48 @@ +Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ +Upstream-Name: osmo-iuh +Source: git://git.osmocom.org/ + +Files: * +Copyright: 2015 Daniel Willmann + 2015 Harald Welte + 2015-2017 sysmocom s.f.m.c. GmbH +License: AGPL-3.0+ + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU Affero General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + . + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Affero General Public License for more details. + . + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see . + +Files: asn1/rua/eurecom/rua_decoder.c + asn1/rua/eurecom/rua_encoder.c + asn1/rua/eurecom/rua_ies_defs.h +Copyright: 1999-2012 Eurecom +License: GPL-2.0 + This program is free software; you can redistribute it and/or modify it + under the terms and conditions of the GNU General Public License, + version 2, as published by the Free Software Foundation. + . + This program is distributed in the hope 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 St - Fifth Floor, Boston, MA 02110-1301 USA. + . + The full GNU General Public License is included in this distribution in + the file called "COPYING". + . + Contact Information + . + 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-ranap-dev.install b/debian/libosmo-ranap-dev.install new file mode 100644 index 0000000..5bd9dd0 --- /dev/null +++ b/debian/libosmo-ranap-dev.install @@ -0,0 +1,3 @@ +usr/include +usr/lib/*/*.so +usr/lib/*/pkgconfig/*.pc diff --git a/debian/libosmo-ranap0.install b/debian/libosmo-ranap0.install new file mode 100644 index 0000000..3de3b10 --- /dev/null +++ b/debian/libosmo-ranap0.install @@ -0,0 +1 @@ +usr/lib/*/*.so.* diff --git a/debian/osmo-hnbgw.install b/debian/osmo-hnbgw.install new file mode 100644 index 0000000..e230915 --- /dev/null +++ b/debian/osmo-hnbgw.install @@ -0,0 +1,2 @@ +usr/bin/osmo-hnbgw +usr/share/doc/osmo-iuh/examples/osmo-hnbgw.cfg diff --git a/debian/rules b/debian/rules new file mode 100755 index 0000000..03432e6 --- /dev/null +++ b/debian/rules @@ -0,0 +1,18 @@ +#!/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') + +# main packaging script based on dh7 syntax +%: + dh $@ --with autoreconf + +override_dh_autoreconf: + echo $(VERSION) > .tarball-version + dh_autoreconf + +# See https://www.debian.org/doc/manuals/developers-reference/best-pkging-practices.html#bpp-dbg +override_dh_strip: + dh_strip --dbg-package=libosmo-ranap-dbg + dh_strip --dbg-package=osmo-hnbgw 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/3506 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I985805aea0e48fe70619de8b81206098e4e37613 Gerrit-PatchSet: 2 Gerrit-Project: osmo-iuh Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: lynxis lazus From admin at opensuse.org Sun Aug 13 20:06:00 2017 From: admin at opensuse.org (OBS Notification) Date: Sun, 13 Aug 2017 20:06:00 +0000 Subject: Build failure of network:osmocom:nightly/openbsc in xUbuntu_16.10/x86_64 In-Reply-To: References: Message-ID: <5990b12c48dc2_25b5602f847359cf@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/openbsc/xUbuntu_16.10/x86_64 Package network:osmocom:nightly/openbsc failed to build in xUbuntu_16.10/x86_64 Check out the package for editing: osc checkout network:osmocom:nightly openbsc Last lines of build log: [ 173s] make[4]: Leaving directory '/usr/src/packages/BUILD/openbsc/tests' [ 173s] make[3]: Leaving directory '/usr/src/packages/BUILD/openbsc/tests' [ 173s] make[3]: Entering directory '/usr/src/packages/BUILD/openbsc' [ 173s] make[4]: Entering directory '/usr/src/packages/BUILD/openbsc' [ 173s] make[4]: Nothing to be done for 'install-exec-am'. [ 173s] /bin/mkdir -p '/usr/src/packages/BUILD/debian/tmp/usr/lib/x86_64-linux-gnu/pkgconfig' [ 173s] /usr/bin/install -c -m 644 openbsc.pc '/usr/src/packages/BUILD/debian/tmp/usr/lib/x86_64-linux-gnu/pkgconfig' [ 173s] make[4]: Leaving directory '/usr/src/packages/BUILD/openbsc' [ 173s] make[3]: Leaving directory '/usr/src/packages/BUILD/openbsc' [ 173s] make[2]: Leaving directory '/usr/src/packages/BUILD/openbsc' [ 173s] make[1]: Leaving directory '/usr/src/packages/BUILD/openbsc' [ 173s] dh_install -O--sourcedirectory=openbsc [ 173s] dh_install: Cannot find (any matches for) "/usr/bin/osmo-sgsn" (tried in "." and "debian/tmp") [ 173s] dh_install: osmocom-sgsn missing files: /usr/bin/osmo-sgsn [ 173s] dh_install: Cannot find (any matches for) "/usr/bin/osmo-gtphub" (tried in "." and "debian/tmp") [ 173s] dh_install: osmo-gtphub missing files: /usr/bin/osmo-gtphub [ 173s] dh_install: missing files, aborting [ 173s] debian/rules:13: recipe for target 'binary' failed [ 173s] make: *** [binary] Error 2 [ 173s] dpkg-buildpackage: error: fakeroot debian/rules binary gave error exit status 2 [ 174s] [ 174s] lamb02 failed "build openbsc_0.15.1.20170813.dsc" at Sun Aug 13 20:05:50 UTC 2017. [ 174s] [ 174s] ### VM INTERACTION START ### [ 177s] [ 166.615285] reboot: Power down [ 177s] ### VM INTERACTION END ### [ 177s] [ 177s] lamb02 failed "build openbsc_0.15.1.20170813.dsc" at Sun Aug 13 20:05:53 UTC 2017. [ 177s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Sun Aug 13 20:06:00 2017 From: admin at opensuse.org (OBS Notification) Date: Sun, 13 Aug 2017 20:06:00 +0000 Subject: Build failure of network:osmocom:nightly/openbsc in xUbuntu_16.10/x86_64 In-Reply-To: References: Message-ID: <5990b12e63506_25b5602f84736010@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/openbsc/xUbuntu_16.10/x86_64 Package network:osmocom:nightly/openbsc failed to build in xUbuntu_16.10/x86_64 Check out the package for editing: osc checkout network:osmocom:nightly openbsc Last lines of build log: [ 173s] make[4]: Leaving directory '/usr/src/packages/BUILD/openbsc/tests' [ 173s] make[3]: Leaving directory '/usr/src/packages/BUILD/openbsc/tests' [ 173s] make[3]: Entering directory '/usr/src/packages/BUILD/openbsc' [ 173s] make[4]: Entering directory '/usr/src/packages/BUILD/openbsc' [ 173s] make[4]: Nothing to be done for 'install-exec-am'. [ 173s] /bin/mkdir -p '/usr/src/packages/BUILD/debian/tmp/usr/lib/x86_64-linux-gnu/pkgconfig' [ 173s] /usr/bin/install -c -m 644 openbsc.pc '/usr/src/packages/BUILD/debian/tmp/usr/lib/x86_64-linux-gnu/pkgconfig' [ 173s] make[4]: Leaving directory '/usr/src/packages/BUILD/openbsc' [ 173s] make[3]: Leaving directory '/usr/src/packages/BUILD/openbsc' [ 173s] make[2]: Leaving directory '/usr/src/packages/BUILD/openbsc' [ 173s] make[1]: Leaving directory '/usr/src/packages/BUILD/openbsc' [ 173s] dh_install -O--sourcedirectory=openbsc [ 173s] dh_install: Cannot find (any matches for) "/usr/bin/osmo-sgsn" (tried in "." and "debian/tmp") [ 173s] dh_install: osmocom-sgsn missing files: /usr/bin/osmo-sgsn [ 173s] dh_install: Cannot find (any matches for) "/usr/bin/osmo-gtphub" (tried in "." and "debian/tmp") [ 173s] dh_install: osmo-gtphub missing files: /usr/bin/osmo-gtphub [ 173s] dh_install: missing files, aborting [ 173s] debian/rules:13: recipe for target 'binary' failed [ 173s] make: *** [binary] Error 2 [ 173s] dpkg-buildpackage: error: fakeroot debian/rules binary gave error exit status 2 [ 174s] [ 174s] lamb02 failed "build openbsc_0.15.1.20170813.dsc" at Sun Aug 13 20:05:50 UTC 2017. [ 174s] [ 174s] ### VM INTERACTION START ### [ 177s] [ 166.615285] reboot: Power down [ 177s] ### VM INTERACTION END ### [ 177s] [ 177s] lamb02 failed "build openbsc_0.15.1.20170813.dsc" at Sun Aug 13 20:05:53 UTC 2017. [ 177s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Sun Aug 13 20:07:08 2017 From: admin at opensuse.org (OBS Notification) Date: Sun, 13 Aug 2017 20:07:08 +0000 Subject: Build failure of network:osmocom:nightly/openbsc in xUbuntu_17.04/i586 In-Reply-To: References: Message-ID: <5990b185e771e_25b5602f847361d8@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/openbsc/xUbuntu_17.04/i586 Package network:osmocom:nightly/openbsc failed to build in xUbuntu_17.04/i586 Check out the package for editing: osc checkout network:osmocom:nightly openbsc Last lines of build log: [ 217s] make[4]: Leaving directory '/usr/src/packages/BUILD/openbsc/tests' [ 217s] make[3]: Leaving directory '/usr/src/packages/BUILD/openbsc/tests' [ 217s] make[3]: Entering directory '/usr/src/packages/BUILD/openbsc' [ 217s] make[4]: Entering directory '/usr/src/packages/BUILD/openbsc' [ 217s] make[4]: Nothing to be done for 'install-exec-am'. [ 217s] /bin/mkdir -p '/usr/src/packages/BUILD/debian/tmp/usr/lib/i386-linux-gnu/pkgconfig' [ 217s] /usr/bin/install -c -m 644 openbsc.pc '/usr/src/packages/BUILD/debian/tmp/usr/lib/i386-linux-gnu/pkgconfig' [ 217s] make[4]: Leaving directory '/usr/src/packages/BUILD/openbsc' [ 217s] make[3]: Leaving directory '/usr/src/packages/BUILD/openbsc' [ 217s] make[2]: Leaving directory '/usr/src/packages/BUILD/openbsc' [ 217s] make[1]: Leaving directory '/usr/src/packages/BUILD/openbsc' [ 217s] dh_install -O--sourcedirectory=openbsc [ 218s] dh_install: Cannot find (any matches for) "/usr/bin/osmo-sgsn" (tried in "." and "debian/tmp") [ 218s] dh_install: osmocom-sgsn missing files: /usr/bin/osmo-sgsn [ 218s] dh_install: Cannot find (any matches for) "/usr/bin/osmo-gtphub" (tried in "." and "debian/tmp") [ 218s] dh_install: osmo-gtphub missing files: /usr/bin/osmo-gtphub [ 218s] dh_install: missing files, aborting [ 218s] debian/rules:13: recipe for target 'binary' failed [ 218s] make: *** [binary] Error 2 [ 218s] dpkg-buildpackage: error: fakeroot debian/rules binary gave error exit status 2 [ 218s] [ 218s] lamb15 failed "build openbsc_0.15.1.20170813.dsc" at Sun Aug 13 20:06:54 UTC 2017. [ 218s] [ 218s] ### VM INTERACTION START ### [ 221s] [ 205.602194] reboot: Power down [ 221s] ### VM INTERACTION END ### [ 221s] [ 221s] lamb15 failed "build openbsc_0.15.1.20170813.dsc" at Sun Aug 13 20:06:57 UTC 2017. [ 221s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Sun Aug 13 20:07:08 2017 From: admin at opensuse.org (OBS Notification) Date: Sun, 13 Aug 2017 20:07:08 +0000 Subject: Build failure of network:osmocom:nightly/openbsc in xUbuntu_17.04/i586 In-Reply-To: References: Message-ID: <5990b186cc9e0_25b5602f84736299@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/openbsc/xUbuntu_17.04/i586 Package network:osmocom:nightly/openbsc failed to build in xUbuntu_17.04/i586 Check out the package for editing: osc checkout network:osmocom:nightly openbsc Last lines of build log: [ 217s] make[4]: Leaving directory '/usr/src/packages/BUILD/openbsc/tests' [ 217s] make[3]: Leaving directory '/usr/src/packages/BUILD/openbsc/tests' [ 217s] make[3]: Entering directory '/usr/src/packages/BUILD/openbsc' [ 217s] make[4]: Entering directory '/usr/src/packages/BUILD/openbsc' [ 217s] make[4]: Nothing to be done for 'install-exec-am'. [ 217s] /bin/mkdir -p '/usr/src/packages/BUILD/debian/tmp/usr/lib/i386-linux-gnu/pkgconfig' [ 217s] /usr/bin/install -c -m 644 openbsc.pc '/usr/src/packages/BUILD/debian/tmp/usr/lib/i386-linux-gnu/pkgconfig' [ 217s] make[4]: Leaving directory '/usr/src/packages/BUILD/openbsc' [ 217s] make[3]: Leaving directory '/usr/src/packages/BUILD/openbsc' [ 217s] make[2]: Leaving directory '/usr/src/packages/BUILD/openbsc' [ 217s] make[1]: Leaving directory '/usr/src/packages/BUILD/openbsc' [ 217s] dh_install -O--sourcedirectory=openbsc [ 218s] dh_install: Cannot find (any matches for) "/usr/bin/osmo-sgsn" (tried in "." and "debian/tmp") [ 218s] dh_install: osmocom-sgsn missing files: /usr/bin/osmo-sgsn [ 218s] dh_install: Cannot find (any matches for) "/usr/bin/osmo-gtphub" (tried in "." and "debian/tmp") [ 218s] dh_install: osmo-gtphub missing files: /usr/bin/osmo-gtphub [ 218s] dh_install: missing files, aborting [ 218s] debian/rules:13: recipe for target 'binary' failed [ 218s] make: *** [binary] Error 2 [ 218s] dpkg-buildpackage: error: fakeroot debian/rules binary gave error exit status 2 [ 218s] [ 218s] lamb15 failed "build openbsc_0.15.1.20170813.dsc" at Sun Aug 13 20:06:54 UTC 2017. [ 218s] [ 218s] ### VM INTERACTION START ### [ 221s] [ 205.602194] reboot: Power down [ 221s] ### VM INTERACTION END ### [ 221s] [ 221s] lamb15 failed "build openbsc_0.15.1.20170813.dsc" at Sun Aug 13 20:06:57 UTC 2017. [ 221s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Sun Aug 13 20:07:25 2017 From: admin at opensuse.org (OBS Notification) Date: Sun, 13 Aug 2017 20:07:25 +0000 Subject: Build failure of network:osmocom:nightly/openbsc in xUbuntu_16.10/i586 In-Reply-To: References: Message-ID: <5990b187ef965_25b5602f8473634b@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/openbsc/xUbuntu_16.10/i586 Package network:osmocom:nightly/openbsc failed to build in xUbuntu_16.10/i586 Check out the package for editing: osc checkout network:osmocom:nightly openbsc Last lines of build log: [ 168s] make[4]: Leaving directory '/usr/src/packages/BUILD/openbsc/tests' [ 168s] make[3]: Leaving directory '/usr/src/packages/BUILD/openbsc/tests' [ 168s] make[3]: Entering directory '/usr/src/packages/BUILD/openbsc' [ 168s] make[4]: Entering directory '/usr/src/packages/BUILD/openbsc' [ 168s] make[4]: Nothing to be done for 'install-exec-am'. [ 168s] /bin/mkdir -p '/usr/src/packages/BUILD/debian/tmp/usr/lib/i386-linux-gnu/pkgconfig' [ 168s] /usr/bin/install -c -m 644 openbsc.pc '/usr/src/packages/BUILD/debian/tmp/usr/lib/i386-linux-gnu/pkgconfig' [ 168s] make[4]: Leaving directory '/usr/src/packages/BUILD/openbsc' [ 168s] make[3]: Leaving directory '/usr/src/packages/BUILD/openbsc' [ 168s] make[2]: Leaving directory '/usr/src/packages/BUILD/openbsc' [ 168s] make[1]: Leaving directory '/usr/src/packages/BUILD/openbsc' [ 168s] dh_install -O--sourcedirectory=openbsc [ 168s] dh_install: Cannot find (any matches for) "/usr/bin/osmo-sgsn" (tried in "." and "debian/tmp") [ 168s] dh_install: osmocom-sgsn missing files: /usr/bin/osmo-sgsn [ 168s] dh_install: Cannot find (any matches for) "/usr/bin/osmo-gtphub" (tried in "." and "debian/tmp") [ 168s] dh_install: osmo-gtphub missing files: /usr/bin/osmo-gtphub [ 168s] dh_install: missing files, aborting [ 168s] debian/rules:13: recipe for target 'binary' failed [ 168s] make: *** [binary] Error 2 [ 168s] dpkg-buildpackage: error: fakeroot debian/rules binary gave error exit status 2 [ 168s] [ 168s] lamb17 failed "build openbsc_0.15.1.20170813.dsc" at Sun Aug 13 20:07:06 UTC 2017. [ 168s] [ 168s] ### VM INTERACTION START ### [ 172s] [ 161.086257] reboot: Power down [ 172s] ### VM INTERACTION END ### [ 172s] [ 172s] lamb17 failed "build openbsc_0.15.1.20170813.dsc" at Sun Aug 13 20:07:10 UTC 2017. [ 172s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Sun Aug 13 20:07:25 2017 From: admin at opensuse.org (OBS Notification) Date: Sun, 13 Aug 2017 20:07:25 +0000 Subject: Build failure of network:osmocom:nightly/openbsc in xUbuntu_16.10/i586 In-Reply-To: References: Message-ID: <5990b1884cdbb_25b5602f8473649d@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/openbsc/xUbuntu_16.10/i586 Package network:osmocom:nightly/openbsc failed to build in xUbuntu_16.10/i586 Check out the package for editing: osc checkout network:osmocom:nightly openbsc Last lines of build log: [ 168s] make[4]: Leaving directory '/usr/src/packages/BUILD/openbsc/tests' [ 168s] make[3]: Leaving directory '/usr/src/packages/BUILD/openbsc/tests' [ 168s] make[3]: Entering directory '/usr/src/packages/BUILD/openbsc' [ 168s] make[4]: Entering directory '/usr/src/packages/BUILD/openbsc' [ 168s] make[4]: Nothing to be done for 'install-exec-am'. [ 168s] /bin/mkdir -p '/usr/src/packages/BUILD/debian/tmp/usr/lib/i386-linux-gnu/pkgconfig' [ 168s] /usr/bin/install -c -m 644 openbsc.pc '/usr/src/packages/BUILD/debian/tmp/usr/lib/i386-linux-gnu/pkgconfig' [ 168s] make[4]: Leaving directory '/usr/src/packages/BUILD/openbsc' [ 168s] make[3]: Leaving directory '/usr/src/packages/BUILD/openbsc' [ 168s] make[2]: Leaving directory '/usr/src/packages/BUILD/openbsc' [ 168s] make[1]: Leaving directory '/usr/src/packages/BUILD/openbsc' [ 168s] dh_install -O--sourcedirectory=openbsc [ 168s] dh_install: Cannot find (any matches for) "/usr/bin/osmo-sgsn" (tried in "." and "debian/tmp") [ 168s] dh_install: osmocom-sgsn missing files: /usr/bin/osmo-sgsn [ 168s] dh_install: Cannot find (any matches for) "/usr/bin/osmo-gtphub" (tried in "." and "debian/tmp") [ 168s] dh_install: osmo-gtphub missing files: /usr/bin/osmo-gtphub [ 168s] dh_install: missing files, aborting [ 168s] debian/rules:13: recipe for target 'binary' failed [ 168s] make: *** [binary] Error 2 [ 168s] dpkg-buildpackage: error: fakeroot debian/rules binary gave error exit status 2 [ 168s] [ 168s] lamb17 failed "build openbsc_0.15.1.20170813.dsc" at Sun Aug 13 20:07:06 UTC 2017. [ 168s] [ 168s] ### VM INTERACTION START ### [ 172s] [ 161.086257] reboot: Power down [ 172s] ### VM INTERACTION END ### [ 172s] [ 172s] lamb17 failed "build openbsc_0.15.1.20170813.dsc" at Sun Aug 13 20:07:10 UTC 2017. [ 172s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Sun Aug 13 20:08:00 2017 From: admin at opensuse.org (OBS Notification) Date: Sun, 13 Aug 2017 20:08:00 +0000 Subject: Build failure of network:osmocom:nightly/openbsc in Debian_9.0/x86_64 In-Reply-To: References: Message-ID: <5990b1a67d9b6_25b5602f8473656d@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/openbsc/Debian_9.0/x86_64 Package network:osmocom:nightly/openbsc failed to build in Debian_9.0/x86_64 Check out the package for editing: osc checkout network:osmocom:nightly openbsc Last lines of build log: [ 118s] make[4]: Leaving directory '/usr/src/packages/BUILD/openbsc/tests' [ 118s] make[3]: Leaving directory '/usr/src/packages/BUILD/openbsc/tests' [ 118s] make[3]: Entering directory '/usr/src/packages/BUILD/openbsc' [ 118s] make[4]: Entering directory '/usr/src/packages/BUILD/openbsc' [ 118s] make[4]: Nothing to be done for 'install-exec-am'. [ 118s] /bin/mkdir -p '/usr/src/packages/BUILD/debian/tmp/usr/lib/x86_64-linux-gnu/pkgconfig' [ 118s] /usr/bin/install -c -m 644 openbsc.pc '/usr/src/packages/BUILD/debian/tmp/usr/lib/x86_64-linux-gnu/pkgconfig' [ 118s] make[4]: Leaving directory '/usr/src/packages/BUILD/openbsc' [ 118s] make[3]: Leaving directory '/usr/src/packages/BUILD/openbsc' [ 118s] make[2]: Leaving directory '/usr/src/packages/BUILD/openbsc' [ 118s] make[1]: Leaving directory '/usr/src/packages/BUILD/openbsc' [ 118s] dh_install -O--sourcedirectory=openbsc [ 118s] dh_install: Cannot find (any matches for) "/usr/bin/osmo-sgsn" (tried in "." and "debian/tmp") [ 118s] dh_install: osmocom-sgsn missing files: /usr/bin/osmo-sgsn [ 118s] dh_install: Cannot find (any matches for) "/usr/bin/osmo-gtphub" (tried in "." and "debian/tmp") [ 118s] dh_install: osmo-gtphub missing files: /usr/bin/osmo-gtphub [ 118s] dh_install: missing files, aborting [ 118s] debian/rules:13: recipe for target 'binary' failed [ 118s] make: *** [binary] Error 2 [ 118s] dpkg-buildpackage: error: fakeroot debian/rules binary gave error exit status 2 [ 118s] [ 118s] build77 failed "build openbsc_0.15.1.20170813.dsc" at Sun Aug 13 20:07:46 UTC 2017. [ 118s] [ 118s] ### VM INTERACTION START ### [ 121s] [ 105.862345] reboot: Power down [ 121s] ### VM INTERACTION END ### [ 121s] [ 121s] build77 failed "build openbsc_0.15.1.20170813.dsc" at Sun Aug 13 20:07:49 UTC 2017. [ 121s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Sun Aug 13 20:08:00 2017 From: admin at opensuse.org (OBS Notification) Date: Sun, 13 Aug 2017 20:08:00 +0000 Subject: Build failure of network:osmocom:nightly/openbsc in Debian_9.0/x86_64 In-Reply-To: References: Message-ID: <5990b1a6c7395_25b5602f847366fb@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/openbsc/Debian_9.0/x86_64 Package network:osmocom:nightly/openbsc failed to build in Debian_9.0/x86_64 Check out the package for editing: osc checkout network:osmocom:nightly openbsc Last lines of build log: [ 118s] make[4]: Leaving directory '/usr/src/packages/BUILD/openbsc/tests' [ 118s] make[3]: Leaving directory '/usr/src/packages/BUILD/openbsc/tests' [ 118s] make[3]: Entering directory '/usr/src/packages/BUILD/openbsc' [ 118s] make[4]: Entering directory '/usr/src/packages/BUILD/openbsc' [ 118s] make[4]: Nothing to be done for 'install-exec-am'. [ 118s] /bin/mkdir -p '/usr/src/packages/BUILD/debian/tmp/usr/lib/x86_64-linux-gnu/pkgconfig' [ 118s] /usr/bin/install -c -m 644 openbsc.pc '/usr/src/packages/BUILD/debian/tmp/usr/lib/x86_64-linux-gnu/pkgconfig' [ 118s] make[4]: Leaving directory '/usr/src/packages/BUILD/openbsc' [ 118s] make[3]: Leaving directory '/usr/src/packages/BUILD/openbsc' [ 118s] make[2]: Leaving directory '/usr/src/packages/BUILD/openbsc' [ 118s] make[1]: Leaving directory '/usr/src/packages/BUILD/openbsc' [ 118s] dh_install -O--sourcedirectory=openbsc [ 118s] dh_install: Cannot find (any matches for) "/usr/bin/osmo-sgsn" (tried in "." and "debian/tmp") [ 118s] dh_install: osmocom-sgsn missing files: /usr/bin/osmo-sgsn [ 118s] dh_install: Cannot find (any matches for) "/usr/bin/osmo-gtphub" (tried in "." and "debian/tmp") [ 118s] dh_install: osmo-gtphub missing files: /usr/bin/osmo-gtphub [ 118s] dh_install: missing files, aborting [ 118s] debian/rules:13: recipe for target 'binary' failed [ 118s] make: *** [binary] Error 2 [ 118s] dpkg-buildpackage: error: fakeroot debian/rules binary gave error exit status 2 [ 118s] [ 118s] build77 failed "build openbsc_0.15.1.20170813.dsc" at Sun Aug 13 20:07:46 UTC 2017. [ 118s] [ 118s] ### VM INTERACTION START ### [ 121s] [ 105.862345] reboot: Power down [ 121s] ### VM INTERACTION END ### [ 121s] [ 121s] build77 failed "build openbsc_0.15.1.20170813.dsc" at Sun Aug 13 20:07:49 UTC 2017. [ 121s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Sun Aug 13 20:08:17 2017 From: admin at opensuse.org (OBS Notification) Date: Sun, 13 Aug 2017 20:08:17 +0000 Subject: Build failure of network:osmocom:nightly/openbsc in xUbuntu_17.04/x86_64 In-Reply-To: References: Message-ID: <5990b1c11e8c3_25b5602f8473679a@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/openbsc/xUbuntu_17.04/x86_64 Package network:osmocom:nightly/openbsc failed to build in xUbuntu_17.04/x86_64 Check out the package for editing: osc checkout network:osmocom:nightly openbsc Last lines of build log: [ 151s] make[4]: Leaving directory '/usr/src/packages/BUILD/openbsc/tests' [ 151s] make[3]: Leaving directory '/usr/src/packages/BUILD/openbsc/tests' [ 151s] make[3]: Entering directory '/usr/src/packages/BUILD/openbsc' [ 151s] make[4]: Entering directory '/usr/src/packages/BUILD/openbsc' [ 151s] make[4]: Nothing to be done for 'install-exec-am'. [ 151s] /bin/mkdir -p '/usr/src/packages/BUILD/debian/tmp/usr/lib/x86_64-linux-gnu/pkgconfig' [ 151s] /usr/bin/install -c -m 644 openbsc.pc '/usr/src/packages/BUILD/debian/tmp/usr/lib/x86_64-linux-gnu/pkgconfig' [ 151s] make[4]: Leaving directory '/usr/src/packages/BUILD/openbsc' [ 151s] make[3]: Leaving directory '/usr/src/packages/BUILD/openbsc' [ 151s] make[2]: Leaving directory '/usr/src/packages/BUILD/openbsc' [ 151s] make[1]: Leaving directory '/usr/src/packages/BUILD/openbsc' [ 151s] dh_install -O--sourcedirectory=openbsc [ 151s] dh_install: Cannot find (any matches for) "/usr/bin/osmo-sgsn" (tried in "." and "debian/tmp") [ 151s] dh_install: osmocom-sgsn missing files: /usr/bin/osmo-sgsn [ 151s] dh_install: Cannot find (any matches for) "/usr/bin/osmo-gtphub" (tried in "." and "debian/tmp") [ 151s] dh_install: osmo-gtphub missing files: /usr/bin/osmo-gtphub [ 151s] dh_install: missing files, aborting [ 151s] debian/rules:13: recipe for target 'binary' failed [ 151s] make: *** [binary] Error 2 [ 151s] dpkg-buildpackage: error: fakeroot debian/rules binary gave error exit status 2 [ 151s] [ 151s] lamb09 failed "build openbsc_0.15.1.20170813.dsc" at Sun Aug 13 20:08:02 UTC 2017. [ 151s] [ 151s] ### VM INTERACTION START ### [ 154s] [ 143.780142] reboot: Power down [ 154s] ### VM INTERACTION END ### [ 154s] [ 154s] lamb09 failed "build openbsc_0.15.1.20170813.dsc" at Sun Aug 13 20:08:05 UTC 2017. [ 154s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Sun Aug 13 20:08:17 2017 From: admin at opensuse.org (OBS Notification) Date: Sun, 13 Aug 2017 20:08:17 +0000 Subject: Build failure of network:osmocom:nightly/openbsc in Debian_9.0/i586 In-Reply-To: References: Message-ID: <5990b1c367e71_25b5602f84736848@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/openbsc/Debian_9.0/i586 Package network:osmocom:nightly/openbsc failed to build in Debian_9.0/i586 Check out the package for editing: osc checkout network:osmocom:nightly openbsc Last lines of build log: [ 189s] make[4]: Leaving directory '/usr/src/packages/BUILD/openbsc/tests' [ 189s] make[3]: Leaving directory '/usr/src/packages/BUILD/openbsc/tests' [ 189s] make[3]: Entering directory '/usr/src/packages/BUILD/openbsc' [ 189s] make[4]: Entering directory '/usr/src/packages/BUILD/openbsc' [ 189s] make[4]: Nothing to be done for 'install-exec-am'. [ 189s] /bin/mkdir -p '/usr/src/packages/BUILD/debian/tmp/usr/lib/i386-linux-gnu/pkgconfig' [ 189s] /usr/bin/install -c -m 644 openbsc.pc '/usr/src/packages/BUILD/debian/tmp/usr/lib/i386-linux-gnu/pkgconfig' [ 189s] make[4]: Leaving directory '/usr/src/packages/BUILD/openbsc' [ 189s] make[3]: Leaving directory '/usr/src/packages/BUILD/openbsc' [ 189s] make[2]: Leaving directory '/usr/src/packages/BUILD/openbsc' [ 189s] make[1]: Leaving directory '/usr/src/packages/BUILD/openbsc' [ 189s] dh_install -O--sourcedirectory=openbsc [ 190s] dh_install: Cannot find (any matches for) "/usr/bin/osmo-sgsn" (tried in "." and "debian/tmp") [ 190s] dh_install: osmocom-sgsn missing files: /usr/bin/osmo-sgsn [ 190s] dh_install: Cannot find (any matches for) "/usr/bin/osmo-gtphub" (tried in "." and "debian/tmp") [ 190s] dh_install: osmo-gtphub missing files: /usr/bin/osmo-gtphub [ 190s] dh_install: missing files, aborting [ 190s] debian/rules:13: recipe for target 'binary' failed [ 190s] make: *** [binary] Error 2 [ 190s] dpkg-buildpackage: error: fakeroot debian/rules binary gave error exit status 2 [ 190s] [ 190s] lamb74 failed "build openbsc_0.15.1.20170813.dsc" at Sun Aug 13 20:08:00 UTC 2017. [ 190s] [ 190s] ### VM INTERACTION START ### [ 193s] [ 181.166056] reboot: Power down [ 193s] ### VM INTERACTION END ### [ 193s] [ 193s] lamb74 failed "build openbsc_0.15.1.20170813.dsc" at Sun Aug 13 20:08:04 UTC 2017. [ 193s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Sun Aug 13 20:08:17 2017 From: admin at opensuse.org (OBS Notification) Date: Sun, 13 Aug 2017 20:08:17 +0000 Subject: Build failure of network:osmocom:nightly/openbsc in Debian_9.0/i586 In-Reply-To: References: Message-ID: <5990b1c3d2116_25b5602f8473699@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/openbsc/Debian_9.0/i586 Package network:osmocom:nightly/openbsc failed to build in Debian_9.0/i586 Check out the package for editing: osc checkout network:osmocom:nightly openbsc Last lines of build log: [ 189s] make[4]: Leaving directory '/usr/src/packages/BUILD/openbsc/tests' [ 189s] make[3]: Leaving directory '/usr/src/packages/BUILD/openbsc/tests' [ 189s] make[3]: Entering directory '/usr/src/packages/BUILD/openbsc' [ 189s] make[4]: Entering directory '/usr/src/packages/BUILD/openbsc' [ 189s] make[4]: Nothing to be done for 'install-exec-am'. [ 189s] /bin/mkdir -p '/usr/src/packages/BUILD/debian/tmp/usr/lib/i386-linux-gnu/pkgconfig' [ 189s] /usr/bin/install -c -m 644 openbsc.pc '/usr/src/packages/BUILD/debian/tmp/usr/lib/i386-linux-gnu/pkgconfig' [ 189s] make[4]: Leaving directory '/usr/src/packages/BUILD/openbsc' [ 189s] make[3]: Leaving directory '/usr/src/packages/BUILD/openbsc' [ 189s] make[2]: Leaving directory '/usr/src/packages/BUILD/openbsc' [ 189s] make[1]: Leaving directory '/usr/src/packages/BUILD/openbsc' [ 189s] dh_install -O--sourcedirectory=openbsc [ 190s] dh_install: Cannot find (any matches for) "/usr/bin/osmo-sgsn" (tried in "." and "debian/tmp") [ 190s] dh_install: osmocom-sgsn missing files: /usr/bin/osmo-sgsn [ 190s] dh_install: Cannot find (any matches for) "/usr/bin/osmo-gtphub" (tried in "." and "debian/tmp") [ 190s] dh_install: osmo-gtphub missing files: /usr/bin/osmo-gtphub [ 190s] dh_install: missing files, aborting [ 190s] debian/rules:13: recipe for target 'binary' failed [ 190s] make: *** [binary] Error 2 [ 190s] dpkg-buildpackage: error: fakeroot debian/rules binary gave error exit status 2 [ 190s] [ 190s] lamb74 failed "build openbsc_0.15.1.20170813.dsc" at Sun Aug 13 20:08:00 UTC 2017. [ 190s] [ 190s] ### VM INTERACTION START ### [ 193s] [ 181.166056] reboot: Power down [ 193s] ### VM INTERACTION END ### [ 193s] [ 193s] lamb74 failed "build openbsc_0.15.1.20170813.dsc" at Sun Aug 13 20:08:04 UTC 2017. [ 193s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Sun Aug 13 20:08:17 2017 From: admin at opensuse.org (OBS Notification) Date: Sun, 13 Aug 2017 20:08:17 +0000 Subject: Build failure of network:osmocom:nightly/openbsc in xUbuntu_17.04/x86_64 In-Reply-To: References: Message-ID: <5990b1c434a82_25b5602f847370bd@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/openbsc/xUbuntu_17.04/x86_64 Package network:osmocom:nightly/openbsc failed to build in xUbuntu_17.04/x86_64 Check out the package for editing: osc checkout network:osmocom:nightly openbsc Last lines of build log: [ 151s] make[4]: Leaving directory '/usr/src/packages/BUILD/openbsc/tests' [ 151s] make[3]: Leaving directory '/usr/src/packages/BUILD/openbsc/tests' [ 151s] make[3]: Entering directory '/usr/src/packages/BUILD/openbsc' [ 151s] make[4]: Entering directory '/usr/src/packages/BUILD/openbsc' [ 151s] make[4]: Nothing to be done for 'install-exec-am'. [ 151s] /bin/mkdir -p '/usr/src/packages/BUILD/debian/tmp/usr/lib/x86_64-linux-gnu/pkgconfig' [ 151s] /usr/bin/install -c -m 644 openbsc.pc '/usr/src/packages/BUILD/debian/tmp/usr/lib/x86_64-linux-gnu/pkgconfig' [ 151s] make[4]: Leaving directory '/usr/src/packages/BUILD/openbsc' [ 151s] make[3]: Leaving directory '/usr/src/packages/BUILD/openbsc' [ 151s] make[2]: Leaving directory '/usr/src/packages/BUILD/openbsc' [ 151s] make[1]: Leaving directory '/usr/src/packages/BUILD/openbsc' [ 151s] dh_install -O--sourcedirectory=openbsc [ 151s] dh_install: Cannot find (any matches for) "/usr/bin/osmo-sgsn" (tried in "." and "debian/tmp") [ 151s] dh_install: osmocom-sgsn missing files: /usr/bin/osmo-sgsn [ 151s] dh_install: Cannot find (any matches for) "/usr/bin/osmo-gtphub" (tried in "." and "debian/tmp") [ 151s] dh_install: osmo-gtphub missing files: /usr/bin/osmo-gtphub [ 151s] dh_install: missing files, aborting [ 151s] debian/rules:13: recipe for target 'binary' failed [ 151s] make: *** [binary] Error 2 [ 151s] dpkg-buildpackage: error: fakeroot debian/rules binary gave error exit status 2 [ 151s] [ 151s] lamb09 failed "build openbsc_0.15.1.20170813.dsc" at Sun Aug 13 20:08:02 UTC 2017. [ 151s] [ 151s] ### VM INTERACTION START ### [ 154s] [ 143.780142] reboot: Power down [ 154s] ### VM INTERACTION END ### [ 154s] [ 154s] lamb09 failed "build openbsc_0.15.1.20170813.dsc" at Sun Aug 13 20:08:05 UTC 2017. [ 154s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Sun Aug 13 20:09:08 2017 From: admin at opensuse.org (OBS Notification) Date: Sun, 13 Aug 2017 20:09:08 +0000 Subject: Build failure of network:osmocom:nightly/openbsc in xUbuntu_16.04/x86_64 In-Reply-To: References: Message-ID: <5990b1fc891a6_25b5602f8473716d@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/openbsc/xUbuntu_16.04/x86_64 Package network:osmocom:nightly/openbsc failed to build in xUbuntu_16.04/x86_64 Check out the package for editing: osc checkout network:osmocom:nightly openbsc Last lines of build log: [ 248s] make[5]: Nothing to be done for 'install-data-am'. [ 248s] make[5]: Leaving directory '/usr/src/packages/BUILD/openbsc/tests' [ 248s] make[4]: Leaving directory '/usr/src/packages/BUILD/openbsc/tests' [ 248s] make[3]: Leaving directory '/usr/src/packages/BUILD/openbsc/tests' [ 248s] make[3]: Entering directory '/usr/src/packages/BUILD/openbsc' [ 248s] make[4]: Entering directory '/usr/src/packages/BUILD/openbsc' [ 248s] make[4]: Nothing to be done for 'install-exec-am'. [ 248s] /bin/mkdir -p '/usr/src/packages/BUILD/debian/tmp/usr/lib/x86_64-linux-gnu/pkgconfig' [ 248s] /usr/bin/install -c -m 644 openbsc.pc '/usr/src/packages/BUILD/debian/tmp/usr/lib/x86_64-linux-gnu/pkgconfig' [ 248s] make[4]: Leaving directory '/usr/src/packages/BUILD/openbsc' [ 248s] make[3]: Leaving directory '/usr/src/packages/BUILD/openbsc' [ 248s] make[2]: Leaving directory '/usr/src/packages/BUILD/openbsc' [ 248s] make[1]: Leaving directory '/usr/src/packages/BUILD/openbsc' [ 248s] dh_install -O--sourcedirectory=openbsc [ 248s] dh_install: osmocom-sgsn missing files: /usr/bin/osmo-sgsn [ 248s] dh_install: osmo-gtphub missing files: /usr/bin/osmo-gtphub [ 248s] dh_install: missing files, aborting [ 248s] debian/rules:13: recipe for target 'binary' failed [ 248s] make: *** [binary] Error 2 [ 248s] dpkg-buildpackage: error: fakeroot debian/rules binary gave error exit status 2 [ 248s] [ 248s] cloud127 failed "build openbsc_0.15.1.20170813.dsc" at Sun Aug 13 20:08:58 UTC 2017. [ 248s] [ 248s] ### VM INTERACTION START ### [ 251s] [ 213.137996] reboot: Power down [ 255s] ### VM INTERACTION END ### [ 255s] [ 255s] cloud127 failed "build openbsc_0.15.1.20170813.dsc" at Sun Aug 13 20:09:05 UTC 2017. [ 255s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Sun Aug 13 20:09:08 2017 From: admin at opensuse.org (OBS Notification) Date: Sun, 13 Aug 2017 20:09:08 +0000 Subject: Build failure of network:osmocom:nightly/openbsc in xUbuntu_16.04/x86_64 In-Reply-To: References: Message-ID: <5990b1fcdd698_25b5602f847372ea@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/openbsc/xUbuntu_16.04/x86_64 Package network:osmocom:nightly/openbsc failed to build in xUbuntu_16.04/x86_64 Check out the package for editing: osc checkout network:osmocom:nightly openbsc Last lines of build log: [ 248s] make[5]: Nothing to be done for 'install-data-am'. [ 248s] make[5]: Leaving directory '/usr/src/packages/BUILD/openbsc/tests' [ 248s] make[4]: Leaving directory '/usr/src/packages/BUILD/openbsc/tests' [ 248s] make[3]: Leaving directory '/usr/src/packages/BUILD/openbsc/tests' [ 248s] make[3]: Entering directory '/usr/src/packages/BUILD/openbsc' [ 248s] make[4]: Entering directory '/usr/src/packages/BUILD/openbsc' [ 248s] make[4]: Nothing to be done for 'install-exec-am'. [ 248s] /bin/mkdir -p '/usr/src/packages/BUILD/debian/tmp/usr/lib/x86_64-linux-gnu/pkgconfig' [ 248s] /usr/bin/install -c -m 644 openbsc.pc '/usr/src/packages/BUILD/debian/tmp/usr/lib/x86_64-linux-gnu/pkgconfig' [ 248s] make[4]: Leaving directory '/usr/src/packages/BUILD/openbsc' [ 248s] make[3]: Leaving directory '/usr/src/packages/BUILD/openbsc' [ 248s] make[2]: Leaving directory '/usr/src/packages/BUILD/openbsc' [ 248s] make[1]: Leaving directory '/usr/src/packages/BUILD/openbsc' [ 248s] dh_install -O--sourcedirectory=openbsc [ 248s] dh_install: osmocom-sgsn missing files: /usr/bin/osmo-sgsn [ 248s] dh_install: osmo-gtphub missing files: /usr/bin/osmo-gtphub [ 248s] dh_install: missing files, aborting [ 248s] debian/rules:13: recipe for target 'binary' failed [ 248s] make: *** [binary] Error 2 [ 248s] dpkg-buildpackage: error: fakeroot debian/rules binary gave error exit status 2 [ 248s] [ 248s] cloud127 failed "build openbsc_0.15.1.20170813.dsc" at Sun Aug 13 20:08:58 UTC 2017. [ 248s] [ 248s] ### VM INTERACTION START ### [ 251s] [ 213.137996] reboot: Power down [ 255s] ### VM INTERACTION END ### [ 255s] [ 255s] cloud127 failed "build openbsc_0.15.1.20170813.dsc" at Sun Aug 13 20:09:05 UTC 2017. [ 255s] -- 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 Aug 13 22:23:17 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 13 Aug 2017 22:23:17 +0000 Subject: [PATCH] openggsn[master]: update debian/changelog to 0.94 + fix pkg-config version Message-ID: Review at https://gerrit.osmocom.org/3508 update debian/changelog to 0.94 + fix pkg-config version This updates the debian changelog to 0.94 and adds some logic to debian/rulres which fixes the version of the libgtp.pc file built as part of our OBS builds (used to be UNKNOWN since commit 23eea1d132120198745dcca32728906d5f05dc5f) Change-Id: I883feaef35ff5ffd1b22fb255b7c36112b4a8f3b --- M debian/changelog M debian/rules 2 files changed, 13 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openggsn refs/changes/08/3508/1 diff --git a/debian/changelog b/debian/changelog index 5d52bfd..17a0a36 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,9 +1,16 @@ -openggsn (0.93) UNRELEASED; urgency=medium +openggsn (0.94) UNRELEASED; urgency=medium + [ Holger Hans Peter Freyther ] * Bump version to ease upgrading from Debian SID. * Bump libgtp SO version after ABI change. - -- Holger Hans Peter Freyther Tue, 24 Jan 2017 17:26:26 +0100 + [ Harald Welte ] + * various documentation / README updates + * improve error logging and propagation + * endian-safe definition of IP header + * IPv6 user plane support + + -- Harald Welte Sun, 13 Aug 2017 09:34:20 +0200 openggsn (0.92) precise; urgency=medium diff --git a/debian/rules b/debian/rules index 8710fa0..aa95e28 100755 --- a/debian/rules +++ b/debian/rules @@ -3,6 +3,10 @@ # Uncomment this to turn on verbose mode. #export DH_VERBOSE=1 +DEBIAN := $(shell dpkg-parsechangelog | grep ^Version: | cut -d' ' -f2) +DEBVERS := $(shell echo '$(DEBIAN)' | cut -d- -f1) +VERSION := $(shell echo '$(DEBVERS)' | sed -e 's/[+-].*//' -e 's/~//g') + # This has to be exported to make some magic below work. #export DH_OPTIONS export DEB_BUILD_MAINT_OPTIONS = hardening=+all -- To view, visit https://gerrit.osmocom.org/3508 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I883feaef35ff5ffd1b22fb255b7c36112b4a8f3b Gerrit-PatchSet: 1 Gerrit-Project: openggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Sun Aug 13 22:23:45 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 13 Aug 2017 22:23:45 +0000 Subject: openggsn[master]: update debian/changelog to 0.94 + fix pkg-config version In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3508 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I883feaef35ff5ffd1b22fb255b7c36112b4a8f3b Gerrit-PatchSet: 1 Gerrit-Project: openggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sun Aug 13 22:33:49 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 13 Aug 2017 22:33:49 +0000 Subject: [MERGED] openggsn[master]: update debian/changelog to 0.94 + fix pkg-config version In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: update debian/changelog to 0.94 + fix pkg-config version ...................................................................... update debian/changelog to 0.94 + fix pkg-config version This updates the debian changelog to 0.94 and adds some logic to debian/rulres which fixes the version of the libgtp.pc file built as part of our OBS builds (used to be UNKNOWN since commit 23eea1d132120198745dcca32728906d5f05dc5f) Change-Id: I883feaef35ff5ffd1b22fb255b7c36112b4a8f3b --- M debian/changelog M debian/rules 2 files changed, 13 insertions(+), 2 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/debian/changelog b/debian/changelog index 5d52bfd..17a0a36 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,9 +1,16 @@ -openggsn (0.93) UNRELEASED; urgency=medium +openggsn (0.94) UNRELEASED; urgency=medium + [ Holger Hans Peter Freyther ] * Bump version to ease upgrading from Debian SID. * Bump libgtp SO version after ABI change. - -- Holger Hans Peter Freyther Tue, 24 Jan 2017 17:26:26 +0100 + [ Harald Welte ] + * various documentation / README updates + * improve error logging and propagation + * endian-safe definition of IP header + * IPv6 user plane support + + -- Harald Welte Sun, 13 Aug 2017 09:34:20 +0200 openggsn (0.92) precise; urgency=medium diff --git a/debian/rules b/debian/rules index 8710fa0..aa95e28 100755 --- a/debian/rules +++ b/debian/rules @@ -3,6 +3,10 @@ # Uncomment this to turn on verbose mode. #export DH_VERBOSE=1 +DEBIAN := $(shell dpkg-parsechangelog | grep ^Version: | cut -d' ' -f2) +DEBVERS := $(shell echo '$(DEBIAN)' | cut -d- -f1) +VERSION := $(shell echo '$(DEBVERS)' | sed -e 's/[+-].*//' -e 's/~//g') + # This has to be exported to make some magic below work. #export DH_OPTIONS export DEB_BUILD_MAINT_OPTIONS = hardening=+all -- To view, visit https://gerrit.osmocom.org/3508 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I883feaef35ff5ffd1b22fb255b7c36112b4a8f3b Gerrit-PatchSet: 1 Gerrit-Project: openggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sun Aug 13 22:35:50 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 13 Aug 2017 22:35:50 +0000 Subject: [PATCH] openbsc[master]: libmsc: use new smpp34 esm_class definitions In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3474 to look at the new patch set (#3). libmsc: use new smpp34 esm_class definitions Replace magic numbers by esm_class definitions, which have been added to latest libsmpp34 in Change-Id I91afd8b462b8fd3b2c4c5b54f4eeb7ec5b730b65 Change-Id: I6c458690da60c8f3637680efbd718f6e8c6feb4c --- M openbsc/src/libmsc/smpp_openbsc.c 1 file changed, 8 insertions(+), 10 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/74/3474/3 diff --git a/openbsc/src/libmsc/smpp_openbsc.c b/openbsc/src/libmsc/smpp_openbsc.c index 7e23abd..ddb24b5 100644 --- a/openbsc/src/libmsc/smpp_openbsc.c +++ b/openbsc/src/libmsc/smpp_openbsc.c @@ -157,14 +157,13 @@ osmo_strlcpy(sms->src.addr, (char *)submit->source_addr, sizeof(sms->src.addr)); - /* This is a Delivery Acknowledgment. */ - if (submit->esm_class == 0x08) + if (submit->esm_class == SMPP34_DELIVERY_ACK) sms->is_report = true; - if (submit->esm_class & 0x40) + if (submit->esm_class & SMPP34_UDHI_IND) sms->ud_hdr_ind = 1; - if (submit->esm_class & 0x80) { + if (submit->esm_class & SMPP34_REPLY_PATH) { sms->reply_path_req = 1; #warning Implement reply path } @@ -240,7 +239,7 @@ sms->smpp.esme = esme; sms->protocol_id = submit->protocol_id; - switch (submit->esm_class & 3) { + switch (submit->esm_class & SMPP34_MSG_MODE_MASK) { case 0: /* default */ case 1: /* datagram */ case 3: /* store-and-forward */ @@ -664,16 +663,15 @@ memcpy(deliver.destination_addr, sms->dst.addr, sizeof(deliver.destination_addr)); - /* Short message contains a delivery receipt? Sect. 5.2.12. */ if (sms->is_report) - deliver.esm_class = 0x04; + deliver.esm_class = SMPP34_DELIVERY_RECEIPT; else - deliver.esm_class = 1; /* datagram mode */ + deliver.esm_class = SMPP34_DATAGRAM_MODE; if (sms->ud_hdr_ind) - deliver.esm_class |= 0x40; + deliver.esm_class |= SMPP34_UDHI_IND; if (sms->reply_path_req) - deliver.esm_class |= 0x80; + deliver.esm_class |= SMPP34_REPLY_PATH; deliver.protocol_id = sms->protocol_id; deliver.priority_flag = 0; -- To view, visit https://gerrit.osmocom.org/3474 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I6c458690da60c8f3637680efbd718f6e8c6feb4c Gerrit-PatchSet: 3 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Pablo Neira Ayuso Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pablo Neira Ayuso From gerrit-no-reply at lists.osmocom.org Sun Aug 13 22:35:59 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 13 Aug 2017 22:35:59 +0000 Subject: openbsc[master]: libmsc: use new smpp34 esm_class definitions In-Reply-To: References: Message-ID: Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3474 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I6c458690da60c8f3637680efbd718f6e8c6feb4c Gerrit-PatchSet: 3 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Pablo Neira Ayuso Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pablo Neira Ayuso Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sun Aug 13 22:36:01 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 13 Aug 2017 22:36:01 +0000 Subject: [MERGED] openbsc[master]: libmsc: use new smpp34 esm_class definitions In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: libmsc: use new smpp34 esm_class definitions ...................................................................... libmsc: use new smpp34 esm_class definitions Replace magic numbers by esm_class definitions, which have been added to latest libsmpp34 in Change-Id I91afd8b462b8fd3b2c4c5b54f4eeb7ec5b730b65 Change-Id: I6c458690da60c8f3637680efbd718f6e8c6feb4c --- M openbsc/src/libmsc/smpp_openbsc.c 1 file changed, 8 insertions(+), 10 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/openbsc/src/libmsc/smpp_openbsc.c b/openbsc/src/libmsc/smpp_openbsc.c index 7e23abd..ddb24b5 100644 --- a/openbsc/src/libmsc/smpp_openbsc.c +++ b/openbsc/src/libmsc/smpp_openbsc.c @@ -157,14 +157,13 @@ osmo_strlcpy(sms->src.addr, (char *)submit->source_addr, sizeof(sms->src.addr)); - /* This is a Delivery Acknowledgment. */ - if (submit->esm_class == 0x08) + if (submit->esm_class == SMPP34_DELIVERY_ACK) sms->is_report = true; - if (submit->esm_class & 0x40) + if (submit->esm_class & SMPP34_UDHI_IND) sms->ud_hdr_ind = 1; - if (submit->esm_class & 0x80) { + if (submit->esm_class & SMPP34_REPLY_PATH) { sms->reply_path_req = 1; #warning Implement reply path } @@ -240,7 +239,7 @@ sms->smpp.esme = esme; sms->protocol_id = submit->protocol_id; - switch (submit->esm_class & 3) { + switch (submit->esm_class & SMPP34_MSG_MODE_MASK) { case 0: /* default */ case 1: /* datagram */ case 3: /* store-and-forward */ @@ -664,16 +663,15 @@ memcpy(deliver.destination_addr, sms->dst.addr, sizeof(deliver.destination_addr)); - /* Short message contains a delivery receipt? Sect. 5.2.12. */ if (sms->is_report) - deliver.esm_class = 0x04; + deliver.esm_class = SMPP34_DELIVERY_RECEIPT; else - deliver.esm_class = 1; /* datagram mode */ + deliver.esm_class = SMPP34_DATAGRAM_MODE; if (sms->ud_hdr_ind) - deliver.esm_class |= 0x40; + deliver.esm_class |= SMPP34_UDHI_IND; if (sms->reply_path_req) - deliver.esm_class |= 0x80; + deliver.esm_class |= SMPP34_REPLY_PATH; deliver.protocol_id = sms->protocol_id; deliver.priority_flag = 0; -- To view, visit https://gerrit.osmocom.org/3474 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I6c458690da60c8f3637680efbd718f6e8c6feb4c Gerrit-PatchSet: 3 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Pablo Neira Ayuso Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pablo Neira Ayuso From gerrit-no-reply at lists.osmocom.org Sun Aug 13 22:37:04 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 13 Aug 2017 22:37:04 +0000 Subject: osmo-iuh[master]: iu_client: derive local SCCP addr from sccp instance In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3507 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I3bb7fc1cd5261d214c6ba0cccfe95f637e6db087 Gerrit-PatchSet: 1 Gerrit-Project: osmo-iuh Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sun Aug 13 22:37:50 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 13 Aug 2017 22:37:50 +0000 Subject: osmo-iuh[master]: add /debian package support In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3506 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I985805aea0e48fe70619de8b81206098e4e37613 Gerrit-PatchSet: 2 Gerrit-Project: osmo-iuh Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: lynxis lazus Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sun Aug 13 22:38:02 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 13 Aug 2017 22:38:02 +0000 Subject: openbsc[master]: libcommon: Fix log output for bts>0. In-Reply-To: References: Message-ID: Patch Set 4: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3185 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I61c18a7f021fcb1ec00d34a745f4e3ab03416c2d Gerrit-PatchSet: 4 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Alexander Chemeris Gerrit-Reviewer: Alexander Chemeris Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sun Aug 13 22:38:04 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 13 Aug 2017 22:38:04 +0000 Subject: [MERGED] openbsc[master]: libcommon: Fix log output for bts>0. In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: libcommon: Fix log output for bts>0. ...................................................................... libcommon: Fix log output for bts>0. Fixes regression probably introduced in c696cc28. For bts>0 logging doesn't show bts number correctly when printing lchan identification string - it will always show it as "bts=0". The reason for this is that the identification string is cached before bts->nr value is set to a proper value. This patch sets bts->nr as part of the first step of the bts structure initialization, before caching happens thus making sure the cached identification string is cached with the correct values. Change-Id: I61c18a7f021fcb1ec00d34a745f4e3ab03416c2d --- M openbsc/include/openbsc/gsm_data_shared.h M openbsc/src/libcommon/gsm_data.c M openbsc/src/libcommon/gsm_data_shared.c M openbsc/tests/channel/channel_test.c M openbsc/tests/channel/channel_test.ok M openbsc/tests/gsm0408/gsm0408_test.c 6 files changed, 44 insertions(+), 10 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/openbsc/include/openbsc/gsm_data_shared.h b/openbsc/include/openbsc/gsm_data_shared.h index 4c71a07..369668d 100644 --- a/openbsc/include/openbsc/gsm_data_shared.h +++ b/openbsc/include/openbsc/gsm_data_shared.h @@ -900,7 +900,7 @@ }; -struct gsm_bts *gsm_bts_alloc(void *talloc_ctx); +struct gsm_bts *gsm_bts_alloc(void *talloc_ctx, uint8_t bts_num); struct gsm_bts *gsm_bts_num(struct gsm_network *net, int num); struct gsm_bts_trx *gsm_bts_trx_alloc(struct gsm_bts *bts); diff --git a/openbsc/src/libcommon/gsm_data.c b/openbsc/src/libcommon/gsm_data.c index db7de08..f1049e9 100644 --- a/openbsc/src/libcommon/gsm_data.c +++ b/openbsc/src/libcommon/gsm_data.c @@ -286,12 +286,13 @@ if (!model && type != GSM_BTS_TYPE_UNKNOWN) return NULL; - bts = gsm_bts_alloc(net); + bts = gsm_bts_alloc(net, net->num_bts); if (!bts) return NULL; + net->num_bts++; + bts->network = net; - bts->nr = net->num_bts++; bts->type = type; bts->model = model; bts->bsic = bsic; diff --git a/openbsc/src/libcommon/gsm_data_shared.c b/openbsc/src/libcommon/gsm_data_shared.c index 8992636..d792f3b 100644 --- a/openbsc/src/libcommon/gsm_data_shared.c +++ b/openbsc/src/libcommon/gsm_data_shared.c @@ -312,7 +312,7 @@ .initial_mcs = 6, }; -struct gsm_bts *gsm_bts_alloc(void *ctx) +struct gsm_bts *gsm_bts_alloc(void *ctx, uint8_t bts_num) { struct gsm_bts *bts = talloc_zero(ctx, struct gsm_bts); int i; @@ -320,6 +320,7 @@ if (!bts) return NULL; + bts->nr = bts_num; bts->num_trx = 0; INIT_LLIST_HEAD(&bts->trx_list); bts->ms_max_power = 15; /* dBm */ diff --git a/openbsc/tests/channel/channel_test.c b/openbsc/tests/channel/channel_test.c index 88293d0..cf19aab 100644 --- a/openbsc/tests/channel/channel_test.c +++ b/openbsc/tests/channel/channel_test.c @@ -70,7 +70,7 @@ network = bsc_network_init(tall_bsc_ctx, 1, 1, NULL); if (!network) exit(1); - bts = gsm_bts_alloc(network); + bts = gsm_bts_alloc(network, 0); bts->location_area_code = 23; s_conn.network = network; @@ -91,6 +91,36 @@ OSMO_ASSERT(s_end); } + + +void test_bts_debug_print(void) +{ + struct gsm_network *network; + struct gsm_bts *bts; + struct gsm_bts_trx *trx; + + printf("Testing the lchan printing:"); + + /* Create a dummy network */ + network = bsc_network_init(tall_bsc_ctx, 1, 1, NULL); + if (!network) + exit(1); + /* Add a BTS with some reasonanbly non-zero id */ + bts = gsm_bts_alloc(network, 45); + /* Add a second TRX to test on multiple TRXs */ + gsm_bts_trx_alloc(bts); + + llist_for_each_entry(trx, &bts->trx_list, list) { + char *name = gsm_lchan_name(&trx->ts[3].lchan[4]); + + if (name) + printf(" %s", name); + else + printf("NULL name"); + } + printf("\n"); +} + void test_dyn_ts_subslots(void) { @@ -128,6 +158,7 @@ test_request_chan(); test_dyn_ts_subslots(); + test_bts_debug_print(); return EXIT_SUCCESS; } diff --git a/openbsc/tests/channel/channel_test.ok b/openbsc/tests/channel/channel_test.ok index 33c8193..e2e93ef 100644 --- a/openbsc/tests/channel/channel_test.ok +++ b/openbsc/tests/channel/channel_test.ok @@ -1,3 +1,4 @@ Testing the gsm_subscriber chan logic Reached, didn't crash, test passed Testing subslot numbers for pchan types +Testing the lchan printing: (bts=45,trx=0,ts=3,ss=4) (bts=45,trx=1,ts=3,ss=4) diff --git a/openbsc/tests/gsm0408/gsm0408_test.c b/openbsc/tests/gsm0408/gsm0408_test.c index 5a8c6ca..63b5c7c 100644 --- a/openbsc/tests/gsm0408/gsm0408_test.c +++ b/openbsc/tests/gsm0408/gsm0408_test.c @@ -153,7 +153,7 @@ if (!network) exit(1); - bts = gsm_bts_alloc(network); + bts = gsm_bts_alloc(network, 0); _bts_uarfcn_add(bts, 10564, 319, 0); _bts_uarfcn_add(bts, 10612, 319, 0); @@ -168,7 +168,7 @@ if (!network) exit(1); - bts = gsm_bts_alloc(network); + bts = gsm_bts_alloc(network, 0); _bts_uarfcn_add(bts, 10564, 318, 0); _bts_uarfcn_add(bts, 10612, 319, 0); @@ -188,7 +188,7 @@ if (!network) exit(1); - bts = gsm_bts_alloc(network); + bts = gsm_bts_alloc(network, 0); /* first generate invalid SI as no UARFCN added */ gen(bts, __func__); @@ -216,7 +216,7 @@ if (!network) exit(1); - bts = gsm_bts_alloc(network); + bts = gsm_bts_alloc(network, 0); bts->si_common.si2quater_neigh_list.arfcn = bts->si_common.data.earfcn_list; bts->si_common.si2quater_neigh_list.meas_bw = bts->si_common.data.meas_bw_list; @@ -249,7 +249,7 @@ if (!network) exit(1); - bts = gsm_bts_alloc(network); + bts = gsm_bts_alloc(network, 0); bts->si_common.si2quater_neigh_list.arfcn = bts->si_common.data.earfcn_list; bts->si_common.si2quater_neigh_list.meas_bw = bts->si_common.data.meas_bw_list; -- To view, visit https://gerrit.osmocom.org/3185 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I61c18a7f021fcb1ec00d34a745f4e3ab03416c2d Gerrit-PatchSet: 5 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Alexander Chemeris Gerrit-Reviewer: Alexander Chemeris Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max From gerrit-no-reply at lists.osmocom.org Sun Aug 13 22:38:38 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 13 Aug 2017 22:38:38 +0000 Subject: libasn1c[master]: add /debian to build a package In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3440 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I135d975b84027d51cb1dc534e04dd314bbd20289 Gerrit-PatchSet: 2 Gerrit-Project: libasn1c Gerrit-Branch: master Gerrit-Owner: lynxis lazus Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: lynxis lazus Gerrit-HasComments: No From admin at opensuse.org Sun Aug 13 22:39:43 2017 From: admin at opensuse.org (OBS Notification) Date: Sun, 13 Aug 2017 22:39:43 +0000 Subject: Build failure of network:osmocom:nightly/openbsc in Debian_8.0/x86_64 In-Reply-To: References: Message-ID: <5990d54314d3_25b5602f8477486c@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/openbsc/Debian_8.0/x86_64 Package network:osmocom:nightly/openbsc failed to build in Debian_8.0/x86_64 Check out the package for editing: osc checkout network:osmocom:nightly openbsc Last lines of build log: [ 157s] make[5]: Nothing to be done for 'install-data-am'. [ 157s] make[5]: Leaving directory '/usr/src/packages/BUILD/openbsc/tests' [ 157s] make[4]: Leaving directory '/usr/src/packages/BUILD/openbsc/tests' [ 157s] make[3]: Leaving directory '/usr/src/packages/BUILD/openbsc/tests' [ 157s] make[3]: Entering directory '/usr/src/packages/BUILD/openbsc' [ 157s] make[4]: Entering directory '/usr/src/packages/BUILD/openbsc' [ 157s] make[4]: Nothing to be done for 'install-exec-am'. [ 157s] /bin/mkdir -p '/usr/src/packages/BUILD/debian/tmp/usr/lib/x86_64-linux-gnu/pkgconfig' [ 157s] /usr/bin/install -c -m 644 openbsc.pc '/usr/src/packages/BUILD/debian/tmp/usr/lib/x86_64-linux-gnu/pkgconfig' [ 157s] make[4]: Leaving directory '/usr/src/packages/BUILD/openbsc' [ 157s] make[3]: Leaving directory '/usr/src/packages/BUILD/openbsc' [ 157s] make[2]: Leaving directory '/usr/src/packages/BUILD/openbsc' [ 157s] make[1]: Leaving directory '/usr/src/packages/BUILD/openbsc' [ 157s] dh_install -O--sourcedirectory=openbsc [ 157s] cp: cannot stat 'debian/tmp//usr/bin/osmo-sgsn': No such file or directory [ 157s] dh_install: cp -a debian/tmp//usr/bin/osmo-sgsn debian/osmocom-sgsn///usr/bin/ returned exit code 1 [ 157s] debian/rules:13: recipe for target 'binary' failed [ 157s] make: *** [binary] Error 2 [ 157s] dpkg-buildpackage: error: fakeroot debian/rules binary gave error exit status 2 [ 157s] [ 157s] lamb12 failed "build openbsc_0.15.1.20170813.dsc" at Sun Aug 13 22:39:29 UTC 2017. [ 157s] [ 157s] ### VM INTERACTION START ### [ 158s] Powering off. [ 158s] [ 145.955730] reboot: Power down [ 158s] ### VM INTERACTION END ### [ 158s] [ 158s] lamb12 failed "build openbsc_0.15.1.20170813.dsc" at Sun Aug 13 22:39:30 UTC 2017. [ 158s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Sun Aug 13 22:39:43 2017 From: admin at opensuse.org (OBS Notification) Date: Sun, 13 Aug 2017 22:39:43 +0000 Subject: Build failure of network:osmocom:nightly/openbsc in Debian_8.0/x86_64 In-Reply-To: References: Message-ID: <5990d5439a43d_25b5602f847749f0@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/openbsc/Debian_8.0/x86_64 Package network:osmocom:nightly/openbsc failed to build in Debian_8.0/x86_64 Check out the package for editing: osc checkout network:osmocom:nightly openbsc Last lines of build log: [ 157s] make[5]: Nothing to be done for 'install-data-am'. [ 157s] make[5]: Leaving directory '/usr/src/packages/BUILD/openbsc/tests' [ 157s] make[4]: Leaving directory '/usr/src/packages/BUILD/openbsc/tests' [ 157s] make[3]: Leaving directory '/usr/src/packages/BUILD/openbsc/tests' [ 157s] make[3]: Entering directory '/usr/src/packages/BUILD/openbsc' [ 157s] make[4]: Entering directory '/usr/src/packages/BUILD/openbsc' [ 157s] make[4]: Nothing to be done for 'install-exec-am'. [ 157s] /bin/mkdir -p '/usr/src/packages/BUILD/debian/tmp/usr/lib/x86_64-linux-gnu/pkgconfig' [ 157s] /usr/bin/install -c -m 644 openbsc.pc '/usr/src/packages/BUILD/debian/tmp/usr/lib/x86_64-linux-gnu/pkgconfig' [ 157s] make[4]: Leaving directory '/usr/src/packages/BUILD/openbsc' [ 157s] make[3]: Leaving directory '/usr/src/packages/BUILD/openbsc' [ 157s] make[2]: Leaving directory '/usr/src/packages/BUILD/openbsc' [ 157s] make[1]: Leaving directory '/usr/src/packages/BUILD/openbsc' [ 157s] dh_install -O--sourcedirectory=openbsc [ 157s] cp: cannot stat 'debian/tmp//usr/bin/osmo-sgsn': No such file or directory [ 157s] dh_install: cp -a debian/tmp//usr/bin/osmo-sgsn debian/osmocom-sgsn///usr/bin/ returned exit code 1 [ 157s] debian/rules:13: recipe for target 'binary' failed [ 157s] make: *** [binary] Error 2 [ 157s] dpkg-buildpackage: error: fakeroot debian/rules binary gave error exit status 2 [ 157s] [ 157s] lamb12 failed "build openbsc_0.15.1.20170813.dsc" at Sun Aug 13 22:39:29 UTC 2017. [ 157s] [ 157s] ### VM INTERACTION START ### [ 158s] Powering off. [ 158s] [ 145.955730] reboot: Power down [ 158s] ### VM INTERACTION END ### [ 158s] [ 158s] lamb12 failed "build openbsc_0.15.1.20170813.dsc" at Sun Aug 13 22:39:30 UTC 2017. [ 158s] -- 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 Aug 13 22:41:36 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 13 Aug 2017 22:41:36 +0000 Subject: libasn1c[master]: add /debian to build a package In-Reply-To: References: Message-ID: Patch Set 2: Verified+1 -- To view, visit https://gerrit.osmocom.org/3440 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I135d975b84027d51cb1dc534e04dd314bbd20289 Gerrit-PatchSet: 2 Gerrit-Project: libasn1c Gerrit-Branch: master Gerrit-Owner: lynxis lazus Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: lynxis lazus Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sun Aug 13 22:41:37 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 13 Aug 2017 22:41:37 +0000 Subject: [MERGED] libasn1c[master]: add /debian to build a package In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: add /debian to build a package ...................................................................... add /debian to build a package debian files need a release so start with release 0.1.0 Change-Id: I135d975b84027d51cb1dc534e04dd314bbd20289 --- A debian/changelog A debian/compat A debian/control A debian/copyright A debian/libasn1c-dev.install A debian/libasn1c0.install A debian/rules A debian/source/format 8 files changed, 168 insertions(+), 0 deletions(-) Approvals: Neels Hofmeyr: Looks good to me, but someone else must approve Harald Welte: Looks good to me, approved; Verified diff --git a/debian/changelog b/debian/changelog new file mode 100644 index 0000000..f56c11a --- /dev/null +++ b/debian/changelog @@ -0,0 +1,5 @@ +libasn1c (0.1.0) UNRELEASED; urgency=low + + * Initial release. + + -- Alexander Couzens Sun, 06 Aug 2017 22:25:03 +0000 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..4313249 --- /dev/null +++ b/debian/control @@ -0,0 +1,33 @@ +Source: libasn1c +Section: libs +Priority: extra +Maintainer: Alexander Couzens +Build-Depends: debhelper (>=9), + dh-autoreconf, + libtalloc-dev +Standards-Version: 3.9.8 +Vcs-Git: git://git.osmocom.org/libasn1c.git +Vcs-Browser: http://git.osmocom.org/gitweb?p=libasn1c.git;a=summary +Homepage: https://projects.osmocom.org/projects/libasn1c + +Package: libasn1c0 +Section: libs +Architecture: any +Multi-Arch: same +Pre-Depends: ${misc:Pre-Depends} +Depends: ${misc:Depends}, ${shlibs:Depends} +Description: asn1c runtime code as shared library + +Package: libasn1c-dbg +Section: debug +Architecture: any +Multi-Arch: same +Depends: libasn1c0 (= ${binary:Version}), ${misc:Depends} +Description: asn1c runtime code as shared library + +Package: libasn1c-dev +Section: libdevel +Architecture: any +Multi-Arch: same +Depends: libasn1c0 (= ${binary:Version}), ${misc:Depends} +Description: asn1c runtime code as shared library diff --git a/debian/copyright b/debian/copyright new file mode 100644 index 0000000..91a7cb9 --- /dev/null +++ b/debian/copyright @@ -0,0 +1,64 @@ +Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ +Upstream-Name: libasn1c +Source: git://git.osmocom.org/libasn1c + +Files: * +Copyright: 2005-2014 Lev Walkin +License: BSD-3-Clause + +Files: src/xer_support.c +Copyright: 2003,2004 X/IO Labs, xiolabs.com. + 2003,2004,2005 Lev Walkin . +License: BSD-3-Clause + +Files: include/asn1c/xer_support.h +Copyright: 2003,2004 X/IO Labs, xiolabs.com + 2003,2004 Lev Walkin +License: BSD-3-Clause + +Files: src/asn1helpers.c +Copyright: 2014-2015 by Harald Welte +License: AGPL-3.0+ + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU Affero General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + . + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Affero General Public License for more details. + . + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see . + +Files: debian/* +Copyright: 2017 Alexander Couzens +License: BSD-3-Clause + +License: BSD-3-Clause + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + . + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + 3. Neither the name of the University nor the names of its contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + . + THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + SUCH DAMAGE. + diff --git a/debian/libasn1c-dev.install b/debian/libasn1c-dev.install new file mode 100644 index 0000000..d8a8a49 --- /dev/null +++ b/debian/libasn1c-dev.install @@ -0,0 +1,4 @@ +usr/include +usr/lib/*/pkgconfig/*.pc +usr/lib/*/*.a +usr/lib/*/lib*.so diff --git a/debian/libasn1c0.install b/debian/libasn1c0.install new file mode 100644 index 0000000..3de3b10 --- /dev/null +++ b/debian/libasn1c0.install @@ -0,0 +1 @@ +usr/lib/*/*.so.* diff --git a/debian/rules b/debian/rules new file mode 100755 index 0000000..267bea9 --- /dev/null +++ b/debian/rules @@ -0,0 +1,59 @@ +#!/usr/bin/make -f +# You must remove unused comment lines for the released package. +# See debhelper(7) (uncomment to enable) +# This is an autogenerated template for debian/rules. +# +# Output every command that modifies files on the build system. +#export DH_VERBOSE = 1 +# +# Copy some variable definitions from pkg-info.mk and vendor.mk +# under /usr/share/dpkg/ to here if they are useful. +# +# See FEATURE AREAS/ENVIRONMENT in dpkg-buildflags(1) +# Apply all hardening options +#export DEB_BUILD_MAINT_OPTIONS = hardening=+all +# Package maintainers to append CFLAGS +#export DEB_CFLAGS_MAINT_APPEND = -Wall -pedantic +# Package maintainers to append LDFLAGS +#export DEB_LDFLAGS_MAINT_APPEND = -Wl,--as-needed +# +# With debhelper version 9 or newer, the dh command exports +# all buildflags. So there is no need to include the +# /usr/share/dpkg/buildflags.mk file here if compat is 9 or newer. +# +# These are rarely used code. (START) +# +# The following include for *.mk magically sets miscellaneous +# variables while honoring existing values of pertinent +# environment variables: +# +# Architecture-related variables such as DEB_TARGET_MULTIARCH: +#include /usr/share/dpkg/architecture.mk +# Vendor-related variables such as DEB_VENDOR: +#include /usr/share/dpkg/vendor.mk +# Package-related variables such as DEB_DISTRIBUTION +#include /usr/share/dpkg/pkg-info.mk +# +# You may alternatively set them susing a simple script such as: +# DEB_VENDOR ?= $(shell dpkg-vendor --query Vendor) +# +# These are rarely used code. (END) +# + +# main packaging script based on dh7 syntax +%: + dh $@ --with autoreconf + +# debmake generated override targets +# Set options for ./configure +#CONFIGURE_FLAGS = +#overrride_dh_configure: +# dh_configure -- $(CONFIGURE_FLAGS) +# +# Do not install libtool archive, python .pyc .pyo +#override_dh_install: +# dh_install --list-missing -X.la -X.pyc -X.pyo + +# See https://www.debian.org/doc/manuals/developers-reference/best-pkging-practices.html#bpp-dbg +override_dh_strip: + dh_strip --dbg-package=libasn1c-dbg 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/3440 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I135d975b84027d51cb1dc534e04dd314bbd20289 Gerrit-PatchSet: 2 Gerrit-Project: libasn1c Gerrit-Branch: master Gerrit-Owner: lynxis lazus Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: lynxis lazus From gerrit-no-reply at lists.osmocom.org Sun Aug 13 22:45:26 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 13 Aug 2017 22:45:26 +0000 Subject: [PATCH] libasn1c[master]: Re-license asn1helper.c under identical license as upstream Message-ID: Review at https://gerrit.osmocom.org/3509 Re-license asn1helper.c under identical license as upstream asn1helpers.c originally existed in the repository of an application (osmo-hnbgw, IIRC), and hence was under AGPLv3. When moving it to this repository, it should have been relicensed but wasn't. The intention was never to "contaminate" (lib)asn1c with AGPLv3 code. Change-Id: I8e714d4c51d771b1eabec7aa06e7daae73f48b15 --- M debian/copyright M src/asn1helpers.c 2 files changed, 3 insertions(+), 26 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libasn1c refs/changes/09/3509/1 diff --git a/debian/copyright b/debian/copyright index 91a7cb9..2eef07a 100644 --- a/debian/copyright +++ b/debian/copyright @@ -18,19 +18,7 @@ Files: src/asn1helpers.c Copyright: 2014-2015 by Harald Welte -License: AGPL-3.0+ - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU Affero General Public License as published by - the Free Software Foundation; either version 3 of the License, or - (at your option) any later version. - . - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU Affero General Public License for more details. - . - You should have received a copy of the GNU Affero General Public License - along with this program. If not, see . +License: BSD-2-Clause Files: debian/* Copyright: 2017 Alexander Couzens diff --git a/src/asn1helpers.c b/src/asn1helpers.c index aca5300..a4ced70 100644 --- a/src/asn1helpers.c +++ b/src/asn1helpers.c @@ -3,19 +3,8 @@ /* (C) 2014-2015 by Harald Welte * All Rights Reserved * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - * + * Redistribution and modifications are permitted subject to BSD license + * contained in COPYING file. */ #include -- To view, visit https://gerrit.osmocom.org/3509 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I8e714d4c51d771b1eabec7aa06e7daae73f48b15 Gerrit-PatchSet: 1 Gerrit-Project: libasn1c Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Sun Aug 13 22:45:26 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 13 Aug 2017 22:45:26 +0000 Subject: [PATCH] libasn1c[master]: debian/copyright: Code in this repository is under BSD-2-Clause Message-ID: Review at https://gerrit.osmocom.org/3510 debian/copyright: Code in this repository is under BSD-2-Clause The license is not a 3-clause BSD, but a 2-clause BSD. Couldn't find any trace to a 3rd clause anywhere. Change-Id: I4f908ce4f670e062e6808ac7966d0e52bfe6b4f9 --- M debian/copyright 1 file changed, 3 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libasn1c refs/changes/10/3510/1 diff --git a/debian/copyright b/debian/copyright index 2eef07a..0494a0a 100644 --- a/debian/copyright +++ b/debian/copyright @@ -4,17 +4,17 @@ Files: * Copyright: 2005-2014 Lev Walkin -License: BSD-3-Clause +License: BSD-2-Clause Files: src/xer_support.c Copyright: 2003,2004 X/IO Labs, xiolabs.com. 2003,2004,2005 Lev Walkin . -License: BSD-3-Clause +License: BSD-2-Clause Files: include/asn1c/xer_support.h Copyright: 2003,2004 X/IO Labs, xiolabs.com 2003,2004 Lev Walkin -License: BSD-3-Clause +License: BSD-2-Clause Files: src/asn1helpers.c Copyright: 2014-2015 by Harald Welte -- To view, visit https://gerrit.osmocom.org/3510 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I4f908ce4f670e062e6808ac7966d0e52bfe6b4f9 Gerrit-PatchSet: 1 Gerrit-Project: libasn1c Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Sun Aug 13 22:45:41 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 13 Aug 2017 22:45:41 +0000 Subject: libasn1c[master]: Re-license asn1helper.c under identical license as upstream In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3509 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I8e714d4c51d771b1eabec7aa06e7daae73f48b15 Gerrit-PatchSet: 1 Gerrit-Project: libasn1c Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sun Aug 13 22:45:45 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 13 Aug 2017 22:45:45 +0000 Subject: libasn1c[master]: debian/copyright: Code in this repository is under BSD-2-Clause In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3510 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I4f908ce4f670e062e6808ac7966d0e52bfe6b4f9 Gerrit-PatchSet: 1 Gerrit-Project: libasn1c Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sun Aug 13 22:46:04 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 13 Aug 2017 22:46:04 +0000 Subject: [MERGED] osmo-iuh[master]: add /debian package support In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: add /debian package support ...................................................................... add /debian package support Change-Id: I985805aea0e48fe70619de8b81206098e4e37613 --- A debian/changelog A debian/compat A debian/control A debian/copyright A debian/libosmo-ranap-dev.install A debian/libosmo-ranap0.install A debian/osmo-hnbgw.install A debian/rules A debian/source/format 9 files changed, 139 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..91bd155 --- /dev/null +++ b/debian/changelog @@ -0,0 +1,5 @@ +osmo-iuh (0.1.0) UNRELEASED; urgency=low + + * Initial release. + + -- Alexander Couzens Tue, 08 Aug 2017 04:13:19 +0000 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..56a7667 --- /dev/null +++ b/debian/control @@ -0,0 +1,60 @@ +Source: osmo-iuh +Section: libs +Priority: extra +Maintainer: Alexander Couzens +Build-Depends: debhelper (>=9), + dh-autoreconf, + pkg-config, + autoconf, + automake, + libtool, + git, + libasn1c-dev, + libsctp-dev, + libosmo-netif-dev, + libosmocore-dev, + libosmo-netif-dev, + libosmo-sccp-dev, + python (>= 2.7) +Standards-Version: 3.9.8 +Vcs-Git: git://git.osmocom.org/osmo-iuh.git +Vcs-Browser: https://git.osmocom.org/osmo-iuh/ +Homepage: https://projects.osmocom.org/projects/osmohnbgw + +Package: osmo-hnbgw +Section: net +Architecture: any +Multi-Arch: no +Pre-Depends: ${misc:Pre-Depends} +Depends: ${misc:Depends}, ${shlibs:Depends} +Description: osmocom Home Node B Gateway + +Package: osmo-hnbgw-dbg +Section: debug +Architecture: any +Multi-Arch: no +Pre-Depends: ${misc:Pre-Depends} +Depends: osmo-hnbgw (= ${binary:Version}), ${misc:Depends} +Description: osmocom Home Node B Gateway + +Package: libosmo-ranap0 +Section: libs +Architecture: any +Multi-Arch: same +Pre-Depends: ${misc:Pre-Depends} +Depends: ${misc:Depends}, ${shlibs:Depends} +Description: Osmocom code for the Iuh interface (HNBAP, RUA, RANAP) + +Package: libosmo-ranap-dbg +Section: debug +Architecture: any +Multi-Arch: same +Depends: libosmo-ranap0 (= ${binary:Version}), ${misc:Depends} +Description: Osmocom code for the Iuh interface (HNBAP, RUA, RANAP) + +Package: libosmo-ranap-dev +Section: libdevel +Architecture: any +Multi-Arch: same +Depends: libosmo-ranap0 (= ${binary:Version}), ${misc:Depends} +Description: Osmocom code for the Iuh interface (HNBAP, RUA, RANAP) diff --git a/debian/copyright b/debian/copyright new file mode 100644 index 0000000..5cb4a3a --- /dev/null +++ b/debian/copyright @@ -0,0 +1,48 @@ +Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ +Upstream-Name: osmo-iuh +Source: git://git.osmocom.org/ + +Files: * +Copyright: 2015 Daniel Willmann + 2015 Harald Welte + 2015-2017 sysmocom s.f.m.c. GmbH +License: AGPL-3.0+ + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU Affero General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + . + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Affero General Public License for more details. + . + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see . + +Files: asn1/rua/eurecom/rua_decoder.c + asn1/rua/eurecom/rua_encoder.c + asn1/rua/eurecom/rua_ies_defs.h +Copyright: 1999-2012 Eurecom +License: GPL-2.0 + This program is free software; you can redistribute it and/or modify it + under the terms and conditions of the GNU General Public License, + version 2, as published by the Free Software Foundation. + . + This program is distributed in the hope 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 St - Fifth Floor, Boston, MA 02110-1301 USA. + . + The full GNU General Public License is included in this distribution in + the file called "COPYING". + . + Contact Information + . + 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-ranap-dev.install b/debian/libosmo-ranap-dev.install new file mode 100644 index 0000000..5bd9dd0 --- /dev/null +++ b/debian/libosmo-ranap-dev.install @@ -0,0 +1,3 @@ +usr/include +usr/lib/*/*.so +usr/lib/*/pkgconfig/*.pc diff --git a/debian/libosmo-ranap0.install b/debian/libosmo-ranap0.install new file mode 100644 index 0000000..3de3b10 --- /dev/null +++ b/debian/libosmo-ranap0.install @@ -0,0 +1 @@ +usr/lib/*/*.so.* diff --git a/debian/osmo-hnbgw.install b/debian/osmo-hnbgw.install new file mode 100644 index 0000000..e230915 --- /dev/null +++ b/debian/osmo-hnbgw.install @@ -0,0 +1,2 @@ +usr/bin/osmo-hnbgw +usr/share/doc/osmo-iuh/examples/osmo-hnbgw.cfg diff --git a/debian/rules b/debian/rules new file mode 100755 index 0000000..03432e6 --- /dev/null +++ b/debian/rules @@ -0,0 +1,18 @@ +#!/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') + +# main packaging script based on dh7 syntax +%: + dh $@ --with autoreconf + +override_dh_autoreconf: + echo $(VERSION) > .tarball-version + dh_autoreconf + +# See https://www.debian.org/doc/manuals/developers-reference/best-pkging-practices.html#bpp-dbg +override_dh_strip: + dh_strip --dbg-package=libosmo-ranap-dbg + dh_strip --dbg-package=osmo-hnbgw 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/3506 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I985805aea0e48fe70619de8b81206098e4e37613 Gerrit-PatchSet: 2 Gerrit-Project: osmo-iuh Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: lynxis lazus From gerrit-no-reply at lists.osmocom.org Sun Aug 13 22:46:05 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 13 Aug 2017 22:46:05 +0000 Subject: [MERGED] osmo-iuh[master]: iu_client: derive local SCCP addr from sccp instance In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: iu_client: derive local SCCP addr from sccp instance ...................................................................... iu_client: derive local SCCP addr from sccp instance ranap_iu_init() is passed an sccp instance that has a local primary point code. Use this primary PC by default as the local address for IuCS and IuPS clients. Remove the current vty command 'iu local-address point-code PC': - It is possible that we would like to configure a differing local point code at some point; this should then happen via sccp address book entries, not parsing PC directly. - Obtaining the local PC from the SCCP instance makes this command obsolete for all setups we're currently aiming at: one local PC per SCCP instance. - There are vty doc failures in this vty command, which cause osmo-msc and osmo-bsc vty test failures; rather than fixing this, let's drop it entirely until we see a need for it (and then do it properly with the address book). Cosmetic: prefix the local static variable with g_* like g_sccp and g_scu and define it in the same place. No default values are needed anymore, it gets overwritten in ranap_iu_init(). Change-Id: I3bb7fc1cd5261d214c6ba0cccfe95f637e6db087 --- M src/iu_client.c M src/iu_client_vty.c 2 files changed, 3 insertions(+), 27 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/iu_client.c b/src/iu_client.c index 83ed276..17d955d 100644 --- a/src/iu_client.c +++ b/src/iu_client.c @@ -83,6 +83,7 @@ static struct osmo_sccp_instance *g_sccp; static struct osmo_sccp_user *g_scu; +static struct osmo_sccp_addr g_local_sccp_addr; const struct value_string ranap_iu_event_type_names[] = { OSMO_VALUE_STRING(RANAP_IU_EVENT_RAB_ASSIGN), @@ -584,13 +585,6 @@ * Paging ***********************************************************************/ -struct osmo_sccp_addr local_sccp_addr = { - .presence = OSMO_SCCP_ADDR_T_SSN | OSMO_SCCP_ADDR_T_PC, - .ri = OSMO_SCCP_RI_SSN_PC, - .ssn = OSMO_SCCP_SSN_RANAP, - .pc = 1, -}; - /* Send a paging command down a given SCCP User. tmsi and paging_cause are * optional and may be passed NULL and 0, respectively, to disable their use. * See enum RANAP_PagingCause. @@ -604,7 +598,7 @@ struct msgb *msg; msg = ranap_new_msg_paging_cmd(imsi, tmsi, is_ps? 1 : 0, paging_cause); msg->l2h = msg->data; - osmo_sccp_tx_unitdata_msg(g_scu, &local_sccp_addr, called_addr, msg); + osmo_sccp_tx_unitdata_msg(g_scu, &g_local_sccp_addr, called_addr, msg); return 0; } @@ -776,6 +770,7 @@ global_iu_recv_cb = iu_recv_cb; global_iu_event_cb = iu_event_cb; g_sccp = sccp; + osmo_sccp_local_addr_by_instance(&g_local_sccp_addr, sccp, OSMO_SCCP_SSN_RANAP); g_scu = osmo_sccp_user_bind(g_sccp, sccp_user_name, sccp_sap_up, OSMO_SCCP_SSN_RANAP); return 0; diff --git a/src/iu_client_vty.c b/src/iu_client_vty.c index b809b2a..a99facd 100644 --- a/src/iu_client_vty.c +++ b/src/iu_client_vty.c @@ -75,21 +75,6 @@ return CMD_SUCCESS; } -extern struct osmo_sccp_addr local_sccp_addr; - -DEFUN(cfg_iu_local_addr_pc, cfg_iu_local_addr_pc_cmd, - "iu local-address point-code PC", - IU_STR "Local SCCP Address\n") -{ - local_sccp_addr.presence = OSMO_SCCP_ADDR_T_PC | OSMO_SCCP_ADDR_T_SSN; - local_sccp_addr.ri = OSMO_SCCP_RI_SSN_PC; - local_sccp_addr.pc = osmo_ss7_pointcode_parse(NULL, argv[0]); - - return CMD_SUCCESS; -} - -/* TODO: GT address configuration, in line with 4.5.1.1.1 of TS 25.410 */ - int ranap_iu_vty_config_write(struct vty *vty, const char *indent) { if (!g_rab_assign_addr_enc) { @@ -113,9 +98,6 @@ return CMD_WARNING; } - vty_out(vty, "%siu local-address point-code %s%s", indent, - osmo_ss7_pointcode_print(NULL, local_sccp_addr.pc), VTY_NEWLINE); - if (asn_debug) vty_out(vty, "%sasn1 debug 1%s", indent, VTY_NEWLINE); @@ -130,7 +112,6 @@ g_rab_assign_addr_enc = rab_assign_addr_enc; install_element(iu_parent_node, &cfg_iu_rab_assign_addr_enc_cmd); - install_element(iu_parent_node, &cfg_iu_local_addr_pc_cmd); /* Technically, these are global ASN.1 settings and not necessarily limited to the Iu interface. * Practically, only Iu users will use ASN.1 in Osmocom programs -- at least so far. So it is -- To view, visit https://gerrit.osmocom.org/3507 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I3bb7fc1cd5261d214c6ba0cccfe95f637e6db087 Gerrit-PatchSet: 2 Gerrit-Project: osmo-iuh Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sun Aug 13 22:46:47 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 13 Aug 2017 22:46:47 +0000 Subject: libosmo-sccp[master]: sccp: fix handling of default IP addresses in osmo_sccp_simp... In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3479 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I312caf9d54cedb02034e4ef88fdd2e6ad9ca1c34 Gerrit-PatchSet: 1 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sun Aug 13 22:47:08 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 13 Aug 2017 22:47:08 +0000 Subject: libosmo-sccp[master]: sccp: check for valid point code in osmo_sccp_simple_client() In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3480 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I334d90e769bd9952f67c51b12a945f22bd268fa8 Gerrit-PatchSet: 1 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sun Aug 13 22:47:19 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 13 Aug 2017 22:47:19 +0000 Subject: libosmo-sccp[master]: sccp: add doxgen comments for osmo_sccp_simple_client() In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3481 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I9143bdc54d729f9f50e69fe38cd1798e065f2497 Gerrit-PatchSet: 1 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sun Aug 13 22:47:26 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 13 Aug 2017 22:47:26 +0000 Subject: libosmo-sccp[master]: sccp: make osmo_sccp_addr_name() available In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3482 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I092dd55948faeeff78f28f7d50c5b84b9e69ef24 Gerrit-PatchSet: 1 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sun Aug 13 22:47:43 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 13 Aug 2017 22:47:43 +0000 Subject: libosmo-sccp[master]: sccp: function to get sccp instance from sccp user In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3484 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I9562c4f1d00e2ebb3252c5dea598b643aa393719 Gerrit-PatchSet: 1 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sun Aug 13 22:47:53 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 13 Aug 2017 22:47:53 +0000 Subject: libosmo-sccp[master]: sccp: fixup for osmo_sccp_get_ss7() In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3485 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I84d484e4441fd37443fff8c67e17df8fb15d5b2e Gerrit-PatchSet: 1 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sun Aug 13 22:47:54 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 13 Aug 2017 22:47:54 +0000 Subject: [MERGED] libosmo-sccp[master]: sccp: fixup for osmo_sccp_get_ss7() In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: sccp: fixup for osmo_sccp_get_ss7() ...................................................................... sccp: fixup for osmo_sccp_get_ss7() osmo_sccp_get_ss7() has the risk of a nullpointer dereference, when sccp is NULL. Return NULL when the sccp instance is NULL. Add doxygen comment Change-Id: I84d484e4441fd37443fff8c67e17df8fb15d5b2e --- M include/osmocom/sigtran/sccp_sap.h M src/sccp_user.c 2 files changed, 7 insertions(+), 2 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/include/osmocom/sigtran/sccp_sap.h b/include/osmocom/sigtran/sccp_sap.h index bf1b368..5524bd8 100644 --- a/include/osmocom/sigtran/sccp_sap.h +++ b/include/osmocom/sigtran/sccp_sap.h @@ -246,7 +246,7 @@ struct osmo_sccp_instance * osmo_sccp_instance_create(struct osmo_ss7_instance *ss7, void *priv); void osmo_sccp_instance_destroy(struct osmo_sccp_instance *inst); -struct osmo_ss7_instance *osmo_sccp_get_ss7(struct osmo_sccp_instance *sccp); +struct osmo_ss7_instance *osmo_sccp_get_ss7(const struct osmo_sccp_instance *sccp); struct osmo_sccp_instance *osmo_sccp_get_sccp(const struct osmo_sccp_user *scu); void osmo_sccp_user_unbind(struct osmo_sccp_user *scu); diff --git a/src/sccp_user.c b/src/sccp_user.c index a4568cf..b0a807d 100644 --- a/src/sccp_user.c +++ b/src/sccp_user.c @@ -598,8 +598,13 @@ return NULL; } -struct osmo_ss7_instance *osmo_sccp_get_ss7(struct osmo_sccp_instance *sccp) +/*! \brief get the SS7 instance that is related to the given SCCP instance + * \param[in] sccp SCCP instance + * \returns SS7 instance; NULL if sccp was NULL */ +struct osmo_ss7_instance *osmo_sccp_get_ss7(const struct osmo_sccp_instance *sccp) { + if (!sccp) + return NULL; return sccp->ss7; } -- To view, visit https://gerrit.osmocom.org/3485 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I84d484e4441fd37443fff8c67e17df8fb15d5b2e Gerrit-PatchSet: 1 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sun Aug 13 22:47:55 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 13 Aug 2017 22:47:55 +0000 Subject: [MERGED] libosmo-sccp[master]: sccp: function to get sccp instance from sccp user In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: sccp: function to get sccp instance from sccp user ...................................................................... sccp: function to get sccp instance from sccp user It is currently impossible to find out which SCCP instance handles a particular user. Introduce function to lookup the SCCP instance from a given SCCP user. Change-Id: I9562c4f1d00e2ebb3252c5dea598b643aa393719 --- M include/osmocom/sigtran/sccp_sap.h M src/sccp_user.c 2 files changed, 11 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/include/osmocom/sigtran/sccp_sap.h b/include/osmocom/sigtran/sccp_sap.h index 796597f..bf1b368 100644 --- a/include/osmocom/sigtran/sccp_sap.h +++ b/include/osmocom/sigtran/sccp_sap.h @@ -247,6 +247,7 @@ osmo_sccp_instance_create(struct osmo_ss7_instance *ss7, void *priv); void osmo_sccp_instance_destroy(struct osmo_sccp_instance *inst); struct osmo_ss7_instance *osmo_sccp_get_ss7(struct osmo_sccp_instance *sccp); +struct osmo_sccp_instance *osmo_sccp_get_sccp(const struct osmo_sccp_user *scu); void osmo_sccp_user_unbind(struct osmo_sccp_user *scu); void osmo_sccp_user_set_priv(struct osmo_sccp_user *scu, void *priv); diff --git a/src/sccp_user.c b/src/sccp_user.c index c0e2b5a..a4568cf 100644 --- a/src/sccp_user.c +++ b/src/sccp_user.c @@ -602,3 +602,13 @@ { return sccp->ss7; } + +/*! \brief get the SCCP instance that is related to the given sccp user + * \param[in] scu SCCP user + * \returns SCCP instance; NULL if scu was NULL */ +struct osmo_sccp_instance *osmo_sccp_get_sccp(const struct osmo_sccp_user *scu) +{ + if (!scu) + return NULL; + return scu->inst; +} -- To view, visit https://gerrit.osmocom.org/3484 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I9562c4f1d00e2ebb3252c5dea598b643aa393719 Gerrit-PatchSet: 1 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sun Aug 13 22:47:55 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 13 Aug 2017 22:47:55 +0000 Subject: [MERGED] libosmo-sccp[master]: sccp: make osmo_sccp_addr_name() available In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: sccp: make osmo_sccp_addr_name() available ...................................................................... sccp: make osmo_sccp_addr_name() available osmo_sccp_addr_name() is not listed in any header file. Add osmo_sccp_addr_name() to sccp_helpers.h in order to make it available. Change-Id: I092dd55948faeeff78f28f7d50c5b84b9e69ef24 --- M include/osmocom/sigtran/sccp_helpers.h 1 file changed, 1 insertion(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/include/osmocom/sigtran/sccp_helpers.h b/include/osmocom/sigtran/sccp_helpers.h index 2f318f4..c2175f4 100644 --- a/include/osmocom/sigtran/sccp_helpers.h +++ b/include/osmocom/sigtran/sccp_helpers.h @@ -54,3 +54,4 @@ char *osmo_sccp_gt_dump(const struct osmo_sccp_gt *gt); char *osmo_sccp_addr_dump(const struct osmo_sccp_addr *addr); +char *osmo_sccp_addr_name(const struct osmo_ss7_instance *ss7, const struct osmo_sccp_addr *addr); -- To view, visit https://gerrit.osmocom.org/3482 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I092dd55948faeeff78f28f7d50c5b84b9e69ef24 Gerrit-PatchSet: 1 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sun Aug 13 22:47:55 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 13 Aug 2017 22:47:55 +0000 Subject: [MERGED] libosmo-sccp[master]: sccp: add doxgen comments for osmo_sccp_simple_client() In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: sccp: add doxgen comments for osmo_sccp_simple_client() ...................................................................... sccp: add doxgen comments for osmo_sccp_simple_client() Some of the functons in sccp_user.c have already doygen comments on them. Add doxygen comments for the simple client functions as well Change-Id: I9143bdc54d729f9f50e69fe38cd1798e065f2497 --- M src/sccp_user.c 1 file changed, 32 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/sccp_user.c b/src/sccp_user.c index 387061c..c0e2b5a 100644 --- a/src/sccp_user.c +++ b/src/sccp_user.c @@ -295,6 +295,18 @@ * Convenience function for CLIENT ***********************************************************************/ +/*! \brief request an sccp client instance + * \param[in] ctx talloc context + * \param[in] ss7_id of the SS7/CS7 instance + * \param[in] name human readable name + * \param[in] default_pc pointcode to be used on missing VTY setting + * \param[in] prot protocol to be used (e.g OSMO_SS7_ASP_PROT_M3UA) + * \param[in] default_local_port local port to be usd on missing VTY setting + * \param[in] default_local_ip local IP-address to be usd on missing VTY setting + * \param[in] default_remote_port remote port to be usd on missing VTY setting + * \param[in] default_remote_ip remote IP-address to be usd on missing VTY setting + * \returns callee-allocated SCCP instance on success; NULL on error */ + struct osmo_sccp_instance * osmo_sccp_simple_client_on_ss7_id(void *ctx, uint32_t ss7_id, const char *name, uint32_t default_pc, @@ -313,6 +325,12 @@ struct osmo_ss7_asp *asp; bool asp_created = false; char *as_name, *asp_name = NULL; + + /*! The function will examine the given CS7 instance and its sub + * components (as, asp, etc.). If necessary it will allocate + * the missing components. If no CS7 instance can be detected + * under the caller supplied ID, a new instance will be created + * beforehand. */ /* Choose default ports when the caller does not supply valid port * numbers. */ @@ -450,12 +468,26 @@ return NULL; } +/*! \brief request an sccp client instance + * \param[in] ctx talloc context + * \param[in] name human readable name + * \param[in] default_pc pointcode to be used on missing VTY setting + * \param[in] prot protocol to be used (e.g OSMO_SS7_ASP_PROT_M3UA) + * \param[in] default_local_port local port to be usd on missing VTY setting + * \param[in] default_local_ip local IP-address to be usd on missing VTY setting + * \param[in] default_remote_port remote port to be usd on missing VTY setting + * \param[in] default_remote_ip remote IP-address to be usd on missing VTY setting + * \returns callee-allocated SCCP instance on success; NULL on error */ struct osmo_sccp_instance * osmo_sccp_simple_client(void *ctx, const char *name, uint32_t default_pc, enum osmo_ss7_asp_protocol prot, int default_local_port, const char *default_local_ip, int default_remote_port, const char *default_remote_ip) { + /*! This is simplified version of osmo_sccp_simple_client_on_ss7_id(). + * the only difference is that the ID of the CS7 instance will be + * set to 1 statically */ + return osmo_sccp_simple_client_on_ss7_id(ctx, 1, name, default_pc, prot, default_local_port, default_local_ip, -- To view, visit https://gerrit.osmocom.org/3481 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I9143bdc54d729f9f50e69fe38cd1798e065f2497 Gerrit-PatchSet: 1 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sun Aug 13 22:47:55 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 13 Aug 2017 22:47:55 +0000 Subject: [MERGED] libosmo-sccp[master]: sccp: check for valid point code in osmo_sccp_simple_client() In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: sccp: check for valid point code in osmo_sccp_simple_client() ...................................................................... sccp: check for valid point code in osmo_sccp_simple_client() The point-code is not checked in the beginning, only the ASP checks the point code at a very late stage and fails in case an invalid point-code is detected. Remove the check in the ASP creation. Add a new check after the SS7 initalization that checks the point-code. If none is set, the default point-code will be used. Change-Id: I334d90e769bd9952f67c51b12a945f22bd268fa8 --- M src/sccp_user.c 1 file changed, 10 insertions(+), 6 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/sccp_user.c b/src/sccp_user.c index 4e28aa0..387061c 100644 --- a/src/sccp_user.c +++ b/src/sccp_user.c @@ -342,6 +342,16 @@ ss7->cfg.primary_pc = default_pc; ss7_created = true; } + + /* In case no valid point-code has been configured via the VTY, we + * will fall back to the default pointcode. */ + if (!osmo_ss7_pc_is_valid(ss7->cfg.primary_pc)) { + LOGP(DLSCCP, LOGL_ERROR, + "SS7 instance %u: no primary point-code set, using default point-code\n", + ss7->cfg.id); + ss7->cfg.primary_pc = default_pc; + } + LOGP(DLSCCP, LOGL_NOTICE, "%s: Using SS7 instance %u, pc:%s\n", name, ss7->cfg.id, osmo_ss7_pointcode_print(ss7, ss7->cfg.primary_pc)); @@ -364,12 +374,6 @@ if (!as) goto out_ss7; as_created = true; - - if (!osmo_ss7_pc_is_valid(ss7->cfg.primary_pc)) { - LOGP(DLSCCP, LOGL_ERROR, "SS7 instance %u: no primary point-code set\n", - ss7->cfg.id); - goto out_ss7; - } as->cfg.routing_key.pc = ss7->cfg.primary_pc; } LOGP(DLSCCP, LOGL_NOTICE, "%s: Using AS instance %s\n", name, -- To view, visit https://gerrit.osmocom.org/3480 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I334d90e769bd9952f67c51b12a945f22bd268fa8 Gerrit-PatchSet: 1 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sun Aug 13 22:47:56 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 13 Aug 2017 22:47:56 +0000 Subject: [MERGED] libosmo-sccp[master]: sccp: fix handling of default IP addresses in osmo_sccp_simp... In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: sccp: fix handling of default IP addresses in osmo_sccp_simple_client() ...................................................................... sccp: fix handling of default IP addresses in osmo_sccp_simple_client() When the default IP addresses (remote or local) the respective struct value should be set to NULL. Fix wrong ?:-notation. Change-Id: I312caf9d54cedb02034e4ef88fdd2e6ad9ca1c34 --- M src/sccp_user.c 1 file changed, 4 insertions(+), 4 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/sccp_user.c b/src/sccp_user.c index 9116b60..4e28aa0 100644 --- a/src/sccp_user.c +++ b/src/sccp_user.c @@ -404,10 +404,10 @@ goto out_rt; asp_created = true; - default_local_ip ? asp->cfg.local.host = - talloc_strdup(asp, default_local_ip) : NULL; - default_remote_ip ? asp->cfg.remote.host = - talloc_strdup(asp, default_remote_ip) : NULL; + asp->cfg.local.host = + default_local_ip ? asp->cfg.local.host : NULL; + asp->cfg.remote.host = + default_remote_ip ? asp->cfg.remote.host : NULL; osmo_ss7_as_add_asp(as, asp->cfg.name); } -- To view, visit https://gerrit.osmocom.org/3479 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I312caf9d54cedb02034e4ef88fdd2e6ad9ca1c34 Gerrit-PatchSet: 1 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sun Aug 13 22:48:14 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 13 Aug 2017 22:48:14 +0000 Subject: osmo-gsm-manuals[master]: osmux: Fix description for Dummy frames FT field In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3478 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ia421655bd1be45101da3db2a0af44fbb3cc111c1 Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pablo Neira Ayuso Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sun Aug 13 22:48:20 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 13 Aug 2017 22:48:20 +0000 Subject: [MERGED] osmo-gsm-manuals[master]: osmux: Fix description for Dummy frames FT field In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: osmux: Fix description for Dummy frames FT field ...................................................................... osmux: Fix description for Dummy frames FT field Change-Id: Ia421655bd1be45101da3db2a0af44fbb3cc111c1 --- M OsmoBSC/osmux-reference.adoc 1 file changed, 3 insertions(+), 3 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified Pablo Neira Ayuso: Looks good to me, but someone else must approve diff --git a/OsmoBSC/osmux-reference.adoc b/OsmoBSC/osmux-reference.adoc index 4d03a4b..929f442 100644 --- a/OsmoBSC/osmux-reference.adoc +++ b/OsmoBSC/osmux-reference.adoc @@ -159,7 +159,7 @@ ---- Field Type (FT): 2 bits:: -The Field Type allocated for LAPD Signalling is "0". +The Field Type allocated for LAPD Signalling frames is "0". This frame type is not yet supported inside OsmoCom and may be subject to change in future versions of the protocol. @@ -197,7 +197,7 @@ talkspurt. Field Type (FT): 2 bits:: -The Field Type allocated for AMR codec is "1". +The Field Type allocated for AMR Codec frames is "1". Frame Counter (CTR): 2 bits:: Provides the number of batched AMR payloads (starting 0) after the header. For @@ -284,7 +284,7 @@ ---- Field Type (FT): 2 bits:: -The Field Type allocated for AMR codec is "2". +The Field Type allocated for Dummy frames is "2". Frame Counter (CTR): 2 bits:: Provides the number of dummy batched AMR payloads (starting 0) after the header. -- To view, visit https://gerrit.osmocom.org/3478 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ia421655bd1be45101da3db2a0af44fbb3cc111c1 Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pablo Neira Ayuso From gerrit-no-reply at lists.osmocom.org Sun Aug 13 22:48:38 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 13 Aug 2017 22:48:38 +0000 Subject: openbsc[master]: mgcp_osmux: Remove unused parameter In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3483 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Icb1e7cb15fe04642578f5292124ebc1eac9c9aa3 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pablo Neira Ayuso Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sun Aug 13 22:48:39 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 13 Aug 2017 22:48:39 +0000 Subject: [MERGED] openbsc[master]: mgcp_osmux: Remove unused parameter In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: mgcp_osmux: Remove unused parameter ...................................................................... mgcp_osmux: Remove unused parameter Change-Id: Icb1e7cb15fe04642578f5292124ebc1eac9c9aa3 --- M openbsc/include/openbsc/osmux.h M openbsc/src/libmgcp/mgcp_osmux.c 2 files changed, 4 insertions(+), 8 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified Pablo Neira Ayuso: Looks good to me, but someone else must approve diff --git a/openbsc/include/openbsc/osmux.h b/openbsc/include/openbsc/osmux.h index 0b64a7f..f3ea72a 100644 --- a/openbsc/include/openbsc/osmux.h +++ b/openbsc/include/openbsc/osmux.h @@ -11,8 +11,7 @@ }; int osmux_init(int role, struct mgcp_config *cfg); -int osmux_enable_endpoint(struct mgcp_endpoint *endp, int role, - struct in_addr *addr, uint16_t port); +int osmux_enable_endpoint(struct mgcp_endpoint *endp, struct in_addr *addr, uint16_t port); void osmux_disable_endpoint(struct mgcp_endpoint *endp); void osmux_allocate_cid(struct mgcp_endpoint *endp); void osmux_release_cid(struct mgcp_endpoint *endp); diff --git a/openbsc/src/libmgcp/mgcp_osmux.c b/openbsc/src/libmgcp/mgcp_osmux.c index b46a80e..c52984b 100644 --- a/openbsc/src/libmgcp/mgcp_osmux.c +++ b/openbsc/src/libmgcp/mgcp_osmux.c @@ -340,8 +340,7 @@ if (endp->osmux.state == OSMUX_STATE_ENABLED) goto out; - if (osmux_enable_endpoint(endp, OSMUX_ROLE_BSC_NAT, - &addr->sin_addr, addr->sin_port) < 0 ){ + if (osmux_enable_endpoint(endp, &addr->sin_addr, addr->sin_port) < 0 ) { LOGP(DMGCP, LOGL_ERROR, "Could not enable osmux in endpoint %d\n", ENDPOINT_NUMBER(endp)); @@ -433,8 +432,7 @@ return 0; } -int osmux_enable_endpoint(struct mgcp_endpoint *endp, int role, - struct in_addr *addr, uint16_t port) +int osmux_enable_endpoint(struct mgcp_endpoint *endp, struct in_addr *addr, uint16_t port) { /* If osmux is enabled, initialize the output handler. This handler is * used to reconstruct the RTP flow from osmux. The RTP SSRC is @@ -522,8 +520,7 @@ return 0; if (endp->osmux.state == OSMUX_STATE_ACTIVATING) { - if (osmux_enable_endpoint(endp, OSMUX_ROLE_BSC, - &endp->net_end.addr, + if (osmux_enable_endpoint(endp, &endp->net_end.addr, htons(endp->cfg->osmux_port)) < 0) { LOGP(DMGCP, LOGL_ERROR, "Could not activate osmux in endpoint %d\n", -- To view, visit https://gerrit.osmocom.org/3483 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Icb1e7cb15fe04642578f5292124ebc1eac9c9aa3 Gerrit-PatchSet: 2 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pablo Neira Ayuso From gerrit-no-reply at lists.osmocom.org Sun Aug 13 22:49:02 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 13 Aug 2017 22:49:02 +0000 Subject: [MERGED] openbsc[master]: handover_logic: set correct link to bts for subscriber_conne... In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: handover_logic: set correct link to bts for subscriber_connection in case of moving this connection to another bts ...................................................................... handover_logic: set correct link to bts for subscriber_connection in case of moving this connection to another bts In case of successful completion of handover gsm_subscriber_connection could be moved from one bts to another, so connection link to bts should be replaced by link to bts, which owns new_lchan. This bug was detected, because conn->bts->nr is used in call control log messages and wrong number of bts was observed in these messages after handover. Change-Id: Idc7dd412b7580c451e716b73ef7549826c60b0d9 --- M openbsc/src/libbsc/handover_logic.c 1 file changed, 1 insertion(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/openbsc/src/libbsc/handover_logic.c b/openbsc/src/libbsc/handover_logic.c index 4dd913b..795a2ee 100644 --- a/openbsc/src/libbsc/handover_logic.c +++ b/openbsc/src/libbsc/handover_logic.c @@ -281,6 +281,7 @@ new_lchan->conn->ho_lchan = NULL; new_lchan->conn->lchan = new_lchan; + new_lchan->conn->bts = new_lchan->ts->trx->bts; ho->old_lchan->conn = NULL; lchan_release(ho->old_lchan, 0, RSL_REL_LOCAL_END); -- To view, visit https://gerrit.osmocom.org/3466 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Idc7dd412b7580c451e716b73ef7549826c60b0d9 Gerrit-PatchSet: 2 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Ivan Kluchnikov Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From admin at opensuse.org Sun Aug 13 23:11:09 2017 From: admin at opensuse.org (OBS Notification) Date: Sun, 13 Aug 2017 23:11:09 +0000 Subject: Build failure of network:osmocom:nightly/osmo-bts in xUbuntu_17.04/i586 In-Reply-To: References: Message-ID: <5990dca6375a_25b5602f847755dd@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-bts/xUbuntu_17.04/i586 Package network:osmocom:nightly/osmo-bts failed to build in xUbuntu_17.04/i586 Check out the package for editing: osc checkout network:osmocom:nightly osmo-bts Last lines of build log: [ 47s] from main.c:43: [ 47s] ../../include/openbsc/gsm_data_shared.h:903:17: note: declared here [ 47s] struct gsm_bts *gsm_bts_alloc(void *talloc_ctx, uint8_t bts_num); [ 47s] ^~~~~~~~~~~~~ [ 47s] Makefile:396: recipe for target 'main.o' failed [ 47s] make[4]: *** [main.o] Error 1 [ 47s] make[4]: Leaving directory '/usr/src/packages/BUILD/src/common' [ 47s] Makefile:346: recipe for target 'all-recursive' failed [ 47s] make[3]: *** [all-recursive] Error 1 [ 47s] make[3]: Leaving directory '/usr/src/packages/BUILD/src' [ 47s] Makefile:398: recipe for target 'all-recursive' failed [ 47s] make[2]: *** [all-recursive] Error 1 [ 47s] make[2]: Leaving directory '/usr/src/packages/BUILD' [ 47s] Makefile:339: recipe for target 'all' failed [ 47s] make[1]: *** [all] Error 2 [ 47s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 47s] dh_auto_build: make -j1 returned exit code 2 [ 47s] debian/rules:12: recipe for target 'build' failed [ 47s] make: *** [build] Error 2 [ 47s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 47s] [ 47s] build70 failed "build osmo-bts_0.5.0.20170814.dsc" at Sun Aug 13 23:10:53 UTC 2017. [ 47s] [ 47s] ### VM INTERACTION START ### [ 50s] [ 43.311209] reboot: Power down [ 50s] ### VM INTERACTION END ### [ 50s] [ 50s] build70 failed "build osmo-bts_0.5.0.20170814.dsc" at Sun Aug 13 23:10:57 UTC 2017. [ 50s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Sun Aug 13 23:11:09 2017 From: admin at opensuse.org (OBS Notification) Date: Sun, 13 Aug 2017 23:11:09 +0000 Subject: Build failure of network:osmocom:nightly/osmo-bts in xUbuntu_17.04/i586 In-Reply-To: References: Message-ID: <5990dca642dc7_25b5602f84775655@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-bts/xUbuntu_17.04/i586 Package network:osmocom:nightly/osmo-bts failed to build in xUbuntu_17.04/i586 Check out the package for editing: osc checkout network:osmocom:nightly osmo-bts Last lines of build log: [ 47s] from main.c:43: [ 47s] ../../include/openbsc/gsm_data_shared.h:903:17: note: declared here [ 47s] struct gsm_bts *gsm_bts_alloc(void *talloc_ctx, uint8_t bts_num); [ 47s] ^~~~~~~~~~~~~ [ 47s] Makefile:396: recipe for target 'main.o' failed [ 47s] make[4]: *** [main.o] Error 1 [ 47s] make[4]: Leaving directory '/usr/src/packages/BUILD/src/common' [ 47s] Makefile:346: recipe for target 'all-recursive' failed [ 47s] make[3]: *** [all-recursive] Error 1 [ 47s] make[3]: Leaving directory '/usr/src/packages/BUILD/src' [ 47s] Makefile:398: recipe for target 'all-recursive' failed [ 47s] make[2]: *** [all-recursive] Error 1 [ 47s] make[2]: Leaving directory '/usr/src/packages/BUILD' [ 47s] Makefile:339: recipe for target 'all' failed [ 47s] make[1]: *** [all] Error 2 [ 47s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 47s] dh_auto_build: make -j1 returned exit code 2 [ 47s] debian/rules:12: recipe for target 'build' failed [ 47s] make: *** [build] Error 2 [ 47s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 47s] [ 47s] build70 failed "build osmo-bts_0.5.0.20170814.dsc" at Sun Aug 13 23:10:53 UTC 2017. [ 47s] [ 47s] ### VM INTERACTION START ### [ 50s] [ 43.311209] reboot: Power down [ 50s] ### VM INTERACTION END ### [ 50s] [ 50s] build70 failed "build osmo-bts_0.5.0.20170814.dsc" at Sun Aug 13 23:10:57 UTC 2017. [ 50s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Sun Aug 13 23:12:01 2017 From: admin at opensuse.org (OBS Notification) Date: Sun, 13 Aug 2017 23:12:01 +0000 Subject: Build failure of network:osmocom:nightly/osmo-bts in xUbuntu_16.10/x86_64 In-Reply-To: References: Message-ID: <5990dcc73c835_25b5602f8477593e@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-bts/xUbuntu_16.10/x86_64 Package network:osmocom:nightly/osmo-bts failed to build in xUbuntu_16.10/x86_64 Check out the package for editing: osc checkout network:osmocom:nightly osmo-bts Last lines of build log: [ 84s] from main.c:43: [ 84s] ../../include/openbsc/gsm_data_shared.h:903:17: note: declared here [ 84s] struct gsm_bts *gsm_bts_alloc(void *talloc_ctx, uint8_t bts_num); [ 84s] ^~~~~~~~~~~~~ [ 84s] Makefile:396: recipe for target 'main.o' failed [ 84s] make[4]: *** [main.o] Error 1 [ 84s] make[4]: Leaving directory '/usr/src/packages/BUILD/src/common' [ 84s] Makefile:346: recipe for target 'all-recursive' failed [ 84s] make[3]: *** [all-recursive] Error 1 [ 84s] make[3]: Leaving directory '/usr/src/packages/BUILD/src' [ 84s] Makefile:398: recipe for target 'all-recursive' failed [ 84s] make[2]: *** [all-recursive] Error 1 [ 84s] make[2]: Leaving directory '/usr/src/packages/BUILD' [ 84s] Makefile:339: recipe for target 'all' failed [ 84s] make[1]: *** [all] Error 2 [ 84s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 84s] dh_auto_build: make -j1 returned exit code 2 [ 84s] debian/rules:12: recipe for target 'build' failed [ 84s] make: *** [build] Error 2 [ 84s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 84s] [ 84s] lamb51 failed "build osmo-bts_0.5.0.20170814.dsc" at Sun Aug 13 23:11:57 UTC 2017. [ 84s] [ 84s] ### VM INTERACTION START ### [ 87s] [ 76.207386] reboot: Power down [ 87s] ### VM INTERACTION END ### [ 87s] [ 87s] lamb51 failed "build osmo-bts_0.5.0.20170814.dsc" at Sun Aug 13 23:12:00 UTC 2017. [ 87s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Sun Aug 13 23:12:01 2017 From: admin at opensuse.org (OBS Notification) Date: Sun, 13 Aug 2017 23:12:01 +0000 Subject: Build failure of network:osmocom:nightly/osmo-bts in xUbuntu_16.10/x86_64 In-Reply-To: References: Message-ID: <5990dcc788f11_25b5602f8477603b@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-bts/xUbuntu_16.10/x86_64 Package network:osmocom:nightly/osmo-bts failed to build in xUbuntu_16.10/x86_64 Check out the package for editing: osc checkout network:osmocom:nightly osmo-bts Last lines of build log: [ 84s] from main.c:43: [ 84s] ../../include/openbsc/gsm_data_shared.h:903:17: note: declared here [ 84s] struct gsm_bts *gsm_bts_alloc(void *talloc_ctx, uint8_t bts_num); [ 84s] ^~~~~~~~~~~~~ [ 84s] Makefile:396: recipe for target 'main.o' failed [ 84s] make[4]: *** [main.o] Error 1 [ 84s] make[4]: Leaving directory '/usr/src/packages/BUILD/src/common' [ 84s] Makefile:346: recipe for target 'all-recursive' failed [ 84s] make[3]: *** [all-recursive] Error 1 [ 84s] make[3]: Leaving directory '/usr/src/packages/BUILD/src' [ 84s] Makefile:398: recipe for target 'all-recursive' failed [ 84s] make[2]: *** [all-recursive] Error 1 [ 84s] make[2]: Leaving directory '/usr/src/packages/BUILD' [ 84s] Makefile:339: recipe for target 'all' failed [ 84s] make[1]: *** [all] Error 2 [ 84s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 84s] dh_auto_build: make -j1 returned exit code 2 [ 84s] debian/rules:12: recipe for target 'build' failed [ 84s] make: *** [build] Error 2 [ 84s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 84s] [ 84s] lamb51 failed "build osmo-bts_0.5.0.20170814.dsc" at Sun Aug 13 23:11:57 UTC 2017. [ 84s] [ 84s] ### VM INTERACTION START ### [ 87s] [ 76.207386] reboot: Power down [ 87s] ### VM INTERACTION END ### [ 87s] [ 87s] lamb51 failed "build osmo-bts_0.5.0.20170814.dsc" at Sun Aug 13 23:12:00 UTC 2017. [ 87s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Sun Aug 13 23:12:52 2017 From: admin at opensuse.org (OBS Notification) Date: Sun, 13 Aug 2017 23:12:52 +0000 Subject: Build failure of network:osmocom:nightly/osmo-bts in Debian_9.0/i586 In-Reply-To: References: Message-ID: <5990dd0110883_25b5602f847761eb@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-bts/Debian_9.0/i586 Package network:osmocom:nightly/osmo-bts failed to build in Debian_9.0/i586 Check out the package for editing: osc checkout network:osmocom:nightly osmo-bts Last lines of build log: [ 101s] from main.c:43: [ 101s] ../../include/openbsc/gsm_data_shared.h:903:17: note: declared here [ 101s] struct gsm_bts *gsm_bts_alloc(void *talloc_ctx, uint8_t bts_num); [ 101s] ^~~~~~~~~~~~~ [ 101s] Makefile:396: recipe for target 'main.o' failed [ 101s] make[4]: *** [main.o] Error 1 [ 101s] make[4]: Leaving directory '/usr/src/packages/BUILD/src/common' [ 101s] Makefile:346: recipe for target 'all-recursive' failed [ 101s] make[3]: *** [all-recursive] Error 1 [ 101s] make[3]: Leaving directory '/usr/src/packages/BUILD/src' [ 101s] Makefile:398: recipe for target 'all-recursive' failed [ 101s] make[2]: *** [all-recursive] Error 1 [ 101s] make[2]: Leaving directory '/usr/src/packages/BUILD' [ 101s] Makefile:339: recipe for target 'all' failed [ 101s] make[1]: *** [all] Error 2 [ 101s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 101s] dh_auto_build: make -j1 returned exit code 2 [ 101s] debian/rules:12: recipe for target 'build' failed [ 101s] make: *** [build] Error 2 [ 101s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 101s] [ 101s] lamb13 failed "build osmo-bts_0.5.0.20170814.dsc" at Sun Aug 13 23:12:44 UTC 2017. [ 101s] [ 101s] ### VM INTERACTION START ### [ 104s] [ 91.652317] reboot: Power down [ 104s] ### VM INTERACTION END ### [ 104s] [ 104s] lamb13 failed "build osmo-bts_0.5.0.20170814.dsc" at Sun Aug 13 23:12:47 UTC 2017. [ 104s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Sun Aug 13 23:12:52 2017 From: admin at opensuse.org (OBS Notification) Date: Sun, 13 Aug 2017 23:12:52 +0000 Subject: Build failure of network:osmocom:nightly/osmo-bts in Debian_9.0/i586 In-Reply-To: References: Message-ID: <5990dd016e353_25b5602f84776244@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-bts/Debian_9.0/i586 Package network:osmocom:nightly/osmo-bts failed to build in Debian_9.0/i586 Check out the package for editing: osc checkout network:osmocom:nightly osmo-bts Last lines of build log: [ 101s] from main.c:43: [ 101s] ../../include/openbsc/gsm_data_shared.h:903:17: note: declared here [ 101s] struct gsm_bts *gsm_bts_alloc(void *talloc_ctx, uint8_t bts_num); [ 101s] ^~~~~~~~~~~~~ [ 101s] Makefile:396: recipe for target 'main.o' failed [ 101s] make[4]: *** [main.o] Error 1 [ 101s] make[4]: Leaving directory '/usr/src/packages/BUILD/src/common' [ 101s] Makefile:346: recipe for target 'all-recursive' failed [ 101s] make[3]: *** [all-recursive] Error 1 [ 101s] make[3]: Leaving directory '/usr/src/packages/BUILD/src' [ 101s] Makefile:398: recipe for target 'all-recursive' failed [ 101s] make[2]: *** [all-recursive] Error 1 [ 101s] make[2]: Leaving directory '/usr/src/packages/BUILD' [ 101s] Makefile:339: recipe for target 'all' failed [ 101s] make[1]: *** [all] Error 2 [ 101s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 101s] dh_auto_build: make -j1 returned exit code 2 [ 101s] debian/rules:12: recipe for target 'build' failed [ 101s] make: *** [build] Error 2 [ 101s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 101s] [ 101s] lamb13 failed "build osmo-bts_0.5.0.20170814.dsc" at Sun Aug 13 23:12:44 UTC 2017. [ 101s] [ 101s] ### VM INTERACTION START ### [ 104s] [ 91.652317] reboot: Power down [ 104s] ### VM INTERACTION END ### [ 104s] [ 104s] lamb13 failed "build osmo-bts_0.5.0.20170814.dsc" at Sun Aug 13 23:12:47 UTC 2017. [ 104s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Sun Aug 13 23:13:26 2017 From: admin at opensuse.org (OBS Notification) Date: Sun, 13 Aug 2017 23:13:26 +0000 Subject: Build failure of network:osmocom:nightly/osmo-bts in Debian_8.0/x86_64 In-Reply-To: References: Message-ID: <5990dd1c3d712_25b5602f84776393@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-bts/Debian_8.0/x86_64 Package network:osmocom:nightly/osmo-bts failed to build in Debian_8.0/x86_64 Check out the package for editing: osc checkout network:osmocom:nightly osmo-bts Last lines of build log: [ 125s] ../../include/openbsc/gsm_data_shared.h:903:17: note: declared here [ 125s] struct gsm_bts *gsm_bts_alloc(void *talloc_ctx, uint8_t bts_num); [ 125s] ^ [ 125s] Makefile:386: recipe for target 'main.o' failed [ 125s] make[4]: *** [main.o] Error 1 [ 125s] make[4]: Leaving directory '/usr/src/packages/BUILD/src/common' [ 125s] Makefile:335: recipe for target 'all-recursive' failed [ 125s] make[3]: *** [all-recursive] Error 1 [ 125s] make[3]: Leaving directory '/usr/src/packages/BUILD/src' [ 125s] Makefile:387: recipe for target 'all-recursive' failed [ 125s] make[2]: *** [all-recursive] Error 1 [ 125s] make[2]: Leaving directory '/usr/src/packages/BUILD' [ 125s] Makefile:327: recipe for target 'all' failed [ 125s] make[1]: *** [all] Error 2 [ 125s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 125s] dh_auto_build: make -j1 returned exit code 2 [ 125s] debian/rules:12: recipe for target 'build' failed [ 125s] make: *** [build] Error 2 [ 125s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 125s] [ 125s] cloud111 failed "build osmo-bts_0.5.0.20170814.dsc" at Sun Aug 13 23:13:15 UTC 2017. [ 125s] [ 125s] ### VM INTERACTION START ### [ 126s] Powering off. [ 126s] [ 105.708963] reboot: Power down [ 128s] ### VM INTERACTION END ### [ 128s] [ 128s] cloud111 failed "build osmo-bts_0.5.0.20170814.dsc" at Sun Aug 13 23:13:19 UTC 2017. [ 128s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Sun Aug 13 23:13:26 2017 From: admin at opensuse.org (OBS Notification) Date: Sun, 13 Aug 2017 23:13:26 +0000 Subject: Build failure of network:osmocom:nightly/osmo-bts in Debian_8.0/x86_64 In-Reply-To: References: Message-ID: <5990dd1c7a697_25b5602f84776468@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-bts/Debian_8.0/x86_64 Package network:osmocom:nightly/osmo-bts failed to build in Debian_8.0/x86_64 Check out the package for editing: osc checkout network:osmocom:nightly osmo-bts Last lines of build log: [ 125s] ../../include/openbsc/gsm_data_shared.h:903:17: note: declared here [ 125s] struct gsm_bts *gsm_bts_alloc(void *talloc_ctx, uint8_t bts_num); [ 125s] ^ [ 125s] Makefile:386: recipe for target 'main.o' failed [ 125s] make[4]: *** [main.o] Error 1 [ 125s] make[4]: Leaving directory '/usr/src/packages/BUILD/src/common' [ 125s] Makefile:335: recipe for target 'all-recursive' failed [ 125s] make[3]: *** [all-recursive] Error 1 [ 125s] make[3]: Leaving directory '/usr/src/packages/BUILD/src' [ 125s] Makefile:387: recipe for target 'all-recursive' failed [ 125s] make[2]: *** [all-recursive] Error 1 [ 125s] make[2]: Leaving directory '/usr/src/packages/BUILD' [ 125s] Makefile:327: recipe for target 'all' failed [ 125s] make[1]: *** [all] Error 2 [ 125s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 125s] dh_auto_build: make -j1 returned exit code 2 [ 125s] debian/rules:12: recipe for target 'build' failed [ 125s] make: *** [build] Error 2 [ 125s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 125s] [ 125s] cloud111 failed "build osmo-bts_0.5.0.20170814.dsc" at Sun Aug 13 23:13:15 UTC 2017. [ 125s] [ 125s] ### VM INTERACTION START ### [ 126s] Powering off. [ 126s] [ 105.708963] reboot: Power down [ 128s] ### VM INTERACTION END ### [ 128s] [ 128s] cloud111 failed "build osmo-bts_0.5.0.20170814.dsc" at Sun Aug 13 23:13:19 UTC 2017. [ 128s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Sun Aug 13 23:14:01 2017 From: admin at opensuse.org (OBS Notification) Date: Sun, 13 Aug 2017 23:14:01 +0000 Subject: Build failure of network:osmocom:nightly/osmo-bts in xUbuntu_16.10/i586 In-Reply-To: References: Message-ID: <5990dd3c7b2dd_25b5602f84776522@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-bts/xUbuntu_16.10/i586 Package network:osmocom:nightly/osmo-bts failed to build in xUbuntu_16.10/i586 Check out the package for editing: osc checkout network:osmocom:nightly osmo-bts Last lines of build log: [ 74s] from main.c:43: [ 74s] ../../include/openbsc/gsm_data_shared.h:903:17: note: declared here [ 74s] struct gsm_bts *gsm_bts_alloc(void *talloc_ctx, uint8_t bts_num); [ 74s] ^~~~~~~~~~~~~ [ 74s] Makefile:396: recipe for target 'main.o' failed [ 74s] make[4]: *** [main.o] Error 1 [ 74s] make[4]: Leaving directory '/usr/src/packages/BUILD/src/common' [ 74s] Makefile:346: recipe for target 'all-recursive' failed [ 74s] make[3]: *** [all-recursive] Error 1 [ 74s] make[3]: Leaving directory '/usr/src/packages/BUILD/src' [ 74s] Makefile:398: recipe for target 'all-recursive' failed [ 74s] make[2]: *** [all-recursive] Error 1 [ 74s] make[2]: Leaving directory '/usr/src/packages/BUILD' [ 74s] Makefile:339: recipe for target 'all' failed [ 74s] make[1]: *** [all] Error 2 [ 74s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 74s] dh_auto_build: make -j1 returned exit code 2 [ 74s] debian/rules:12: recipe for target 'build' failed [ 74s] make: *** [build] Error 2 [ 74s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 74s] [ 74s] wildcard3 failed "build osmo-bts_0.5.0.20170814.dsc" at Sun Aug 13 23:13:39 UTC 2017. [ 74s] [ 74s] ### VM INTERACTION START ### [ 77s] [ 63.476883] reboot: Power down [ 79s] ### VM INTERACTION END ### [ 79s] [ 79s] wildcard3 failed "build osmo-bts_0.5.0.20170814.dsc" at Sun Aug 13 23:13:45 UTC 2017. [ 79s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Sun Aug 13 23:14:01 2017 From: admin at opensuse.org (OBS Notification) Date: Sun, 13 Aug 2017 23:14:01 +0000 Subject: Build failure of network:osmocom:nightly/osmo-bts in xUbuntu_16.10/i586 In-Reply-To: References: Message-ID: <5990dd3cc480a_25b5602f84776684@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-bts/xUbuntu_16.10/i586 Package network:osmocom:nightly/osmo-bts failed to build in xUbuntu_16.10/i586 Check out the package for editing: osc checkout network:osmocom:nightly osmo-bts Last lines of build log: [ 74s] from main.c:43: [ 74s] ../../include/openbsc/gsm_data_shared.h:903:17: note: declared here [ 74s] struct gsm_bts *gsm_bts_alloc(void *talloc_ctx, uint8_t bts_num); [ 74s] ^~~~~~~~~~~~~ [ 74s] Makefile:396: recipe for target 'main.o' failed [ 74s] make[4]: *** [main.o] Error 1 [ 74s] make[4]: Leaving directory '/usr/src/packages/BUILD/src/common' [ 74s] Makefile:346: recipe for target 'all-recursive' failed [ 74s] make[3]: *** [all-recursive] Error 1 [ 74s] make[3]: Leaving directory '/usr/src/packages/BUILD/src' [ 74s] Makefile:398: recipe for target 'all-recursive' failed [ 74s] make[2]: *** [all-recursive] Error 1 [ 74s] make[2]: Leaving directory '/usr/src/packages/BUILD' [ 74s] Makefile:339: recipe for target 'all' failed [ 74s] make[1]: *** [all] Error 2 [ 74s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 74s] dh_auto_build: make -j1 returned exit code 2 [ 74s] debian/rules:12: recipe for target 'build' failed [ 74s] make: *** [build] Error 2 [ 74s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 74s] [ 74s] wildcard3 failed "build osmo-bts_0.5.0.20170814.dsc" at Sun Aug 13 23:13:39 UTC 2017. [ 74s] [ 74s] ### VM INTERACTION START ### [ 77s] [ 63.476883] reboot: Power down [ 79s] ### VM INTERACTION END ### [ 79s] [ 79s] wildcard3 failed "build osmo-bts_0.5.0.20170814.dsc" at Sun Aug 13 23:13:45 UTC 2017. [ 79s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Sun Aug 13 23:14:18 2017 From: admin at opensuse.org (OBS Notification) Date: Sun, 13 Aug 2017 23:14:18 +0000 Subject: Build failure of network:osmocom:nightly/osmo-bts in Debian_9.0/x86_64 In-Reply-To: References: Message-ID: <5990dd5761d3e_25b5602f84776773@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-bts/Debian_9.0/x86_64 Package network:osmocom:nightly/osmo-bts failed to build in Debian_9.0/x86_64 Check out the package for editing: osc checkout network:osmocom:nightly osmo-bts Last lines of build log: [ 133s] from main.c:43: [ 133s] ../../include/openbsc/gsm_data_shared.h:903:17: note: declared here [ 133s] struct gsm_bts *gsm_bts_alloc(void *talloc_ctx, uint8_t bts_num); [ 133s] ^~~~~~~~~~~~~ [ 133s] Makefile:396: recipe for target 'main.o' failed [ 133s] make[4]: *** [main.o] Error 1 [ 133s] make[4]: Leaving directory '/usr/src/packages/BUILD/src/common' [ 133s] Makefile:346: recipe for target 'all-recursive' failed [ 133s] make[3]: *** [all-recursive] Error 1 [ 133s] make[3]: Leaving directory '/usr/src/packages/BUILD/src' [ 133s] Makefile:398: recipe for target 'all-recursive' failed [ 133s] make[2]: *** [all-recursive] Error 1 [ 133s] make[2]: Leaving directory '/usr/src/packages/BUILD' [ 133s] Makefile:339: recipe for target 'all' failed [ 133s] make[1]: *** [all] Error 2 [ 133s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 133s] dh_auto_build: make -j1 returned exit code 2 [ 133s] debian/rules:12: recipe for target 'build' failed [ 133s] make: *** [build] Error 2 [ 133s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 133s] [ 133s] cloud136 failed "build osmo-bts_0.5.0.20170814.dsc" at Sun Aug 13 23:14:02 UTC 2017. [ 133s] [ 133s] ### VM INTERACTION START ### [ 136s] [ 112.893740] reboot: Power down [ 138s] ### VM INTERACTION END ### [ 138s] [ 138s] cloud136 failed "build osmo-bts_0.5.0.20170814.dsc" at Sun Aug 13 23:14:08 UTC 2017. [ 138s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Sun Aug 13 23:14:18 2017 From: admin at opensuse.org (OBS Notification) Date: Sun, 13 Aug 2017 23:14:18 +0000 Subject: Build failure of network:osmocom:nightly/osmo-bts in Debian_9.0/x86_64 In-Reply-To: References: Message-ID: <5990dd57a45ae_25b5602f84776846@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-bts/Debian_9.0/x86_64 Package network:osmocom:nightly/osmo-bts failed to build in Debian_9.0/x86_64 Check out the package for editing: osc checkout network:osmocom:nightly osmo-bts Last lines of build log: [ 133s] from main.c:43: [ 133s] ../../include/openbsc/gsm_data_shared.h:903:17: note: declared here [ 133s] struct gsm_bts *gsm_bts_alloc(void *talloc_ctx, uint8_t bts_num); [ 133s] ^~~~~~~~~~~~~ [ 133s] Makefile:396: recipe for target 'main.o' failed [ 133s] make[4]: *** [main.o] Error 1 [ 133s] make[4]: Leaving directory '/usr/src/packages/BUILD/src/common' [ 133s] Makefile:346: recipe for target 'all-recursive' failed [ 133s] make[3]: *** [all-recursive] Error 1 [ 133s] make[3]: Leaving directory '/usr/src/packages/BUILD/src' [ 133s] Makefile:398: recipe for target 'all-recursive' failed [ 133s] make[2]: *** [all-recursive] Error 1 [ 133s] make[2]: Leaving directory '/usr/src/packages/BUILD' [ 133s] Makefile:339: recipe for target 'all' failed [ 133s] make[1]: *** [all] Error 2 [ 133s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 133s] dh_auto_build: make -j1 returned exit code 2 [ 133s] debian/rules:12: recipe for target 'build' failed [ 133s] make: *** [build] Error 2 [ 133s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 133s] [ 133s] cloud136 failed "build osmo-bts_0.5.0.20170814.dsc" at Sun Aug 13 23:14:02 UTC 2017. [ 133s] [ 133s] ### VM INTERACTION START ### [ 136s] [ 112.893740] reboot: Power down [ 138s] ### VM INTERACTION END ### [ 138s] [ 138s] cloud136 failed "build osmo-bts_0.5.0.20170814.dsc" at Sun Aug 13 23:14:08 UTC 2017. [ 138s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Sun Aug 13 23:15:26 2017 From: admin at opensuse.org (OBS Notification) Date: Sun, 13 Aug 2017 23:15:26 +0000 Subject: Build failure of network:osmocom:nightly/osmo-bts in xUbuntu_17.04/x86_64 In-Reply-To: References: Message-ID: <5990dd944ff9a_25b5602f84777119@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-bts/xUbuntu_17.04/x86_64 Package network:osmocom:nightly/osmo-bts failed to build in xUbuntu_17.04/x86_64 Check out the package for editing: osc checkout network:osmocom:nightly osmo-bts Last lines of build log: [ 84s] from main.c:43: [ 84s] ../../include/openbsc/gsm_data_shared.h:903:17: note: declared here [ 84s] struct gsm_bts *gsm_bts_alloc(void *talloc_ctx, uint8_t bts_num); [ 84s] ^~~~~~~~~~~~~ [ 84s] Makefile:396: recipe for target 'main.o' failed [ 84s] make[4]: *** [main.o] Error 1 [ 84s] make[4]: Leaving directory '/usr/src/packages/BUILD/src/common' [ 84s] Makefile:346: recipe for target 'all-recursive' failed [ 84s] make[3]: *** [all-recursive] Error 1 [ 84s] make[3]: Leaving directory '/usr/src/packages/BUILD/src' [ 84s] Makefile:398: recipe for target 'all-recursive' failed [ 84s] make[2]: *** [all-recursive] Error 1 [ 84s] make[2]: Leaving directory '/usr/src/packages/BUILD' [ 84s] Makefile:339: recipe for target 'all' failed [ 84s] make[1]: *** [all] Error 2 [ 84s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 84s] dh_auto_build: make -j1 returned exit code 2 [ 84s] debian/rules:12: recipe for target 'build' failed [ 84s] make: *** [build] Error 2 [ 84s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 84s] [ 84s] lamb06 failed "build osmo-bts_0.5.0.20170814.dsc" at Sun Aug 13 23:15:13 UTC 2017. [ 84s] [ 84s] ### VM INTERACTION START ### [ 87s] [ 76.058816] reboot: Power down [ 87s] ### VM INTERACTION END ### [ 87s] [ 87s] lamb06 failed "build osmo-bts_0.5.0.20170814.dsc" at Sun Aug 13 23:15:17 UTC 2017. [ 87s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Sun Aug 13 23:15:26 2017 From: admin at opensuse.org (OBS Notification) Date: Sun, 13 Aug 2017 23:15:26 +0000 Subject: Build failure of network:osmocom:nightly/osmo-bts in xUbuntu_17.04/x86_64 In-Reply-To: References: Message-ID: <5990dd94858dd_25b5602f84777287@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-bts/xUbuntu_17.04/x86_64 Package network:osmocom:nightly/osmo-bts failed to build in xUbuntu_17.04/x86_64 Check out the package for editing: osc checkout network:osmocom:nightly osmo-bts Last lines of build log: [ 84s] from main.c:43: [ 84s] ../../include/openbsc/gsm_data_shared.h:903:17: note: declared here [ 84s] struct gsm_bts *gsm_bts_alloc(void *talloc_ctx, uint8_t bts_num); [ 84s] ^~~~~~~~~~~~~ [ 84s] Makefile:396: recipe for target 'main.o' failed [ 84s] make[4]: *** [main.o] Error 1 [ 84s] make[4]: Leaving directory '/usr/src/packages/BUILD/src/common' [ 84s] Makefile:346: recipe for target 'all-recursive' failed [ 84s] make[3]: *** [all-recursive] Error 1 [ 84s] make[3]: Leaving directory '/usr/src/packages/BUILD/src' [ 84s] Makefile:398: recipe for target 'all-recursive' failed [ 84s] make[2]: *** [all-recursive] Error 1 [ 84s] make[2]: Leaving directory '/usr/src/packages/BUILD' [ 84s] Makefile:339: recipe for target 'all' failed [ 84s] make[1]: *** [all] Error 2 [ 84s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 84s] dh_auto_build: make -j1 returned exit code 2 [ 84s] debian/rules:12: recipe for target 'build' failed [ 84s] make: *** [build] Error 2 [ 84s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 84s] [ 84s] lamb06 failed "build osmo-bts_0.5.0.20170814.dsc" at Sun Aug 13 23:15:13 UTC 2017. [ 84s] [ 84s] ### VM INTERACTION START ### [ 87s] [ 76.058816] reboot: Power down [ 87s] ### VM INTERACTION END ### [ 87s] [ 87s] lamb06 failed "build osmo-bts_0.5.0.20170814.dsc" at Sun Aug 13 23:15:17 UTC 2017. [ 87s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Sun Aug 13 23:16:02 2017 From: admin at opensuse.org (OBS Notification) Date: Sun, 13 Aug 2017 23:16:02 +0000 Subject: Build failure of network:osmocom:nightly/osmo-bts in xUbuntu_16.04/x86_64 In-Reply-To: References: Message-ID: <5990ddb4b6fe4_25b5602f847773d7@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-bts/xUbuntu_16.04/x86_64 Package network:osmocom:nightly/osmo-bts failed to build in xUbuntu_16.04/x86_64 Check out the package for editing: osc checkout network:osmocom:nightly osmo-bts Last lines of build log: [ 107s] from main.c:43: [ 107s] ../../include/openbsc/gsm_data_shared.h:903:17: note: declared here [ 107s] struct gsm_bts *gsm_bts_alloc(void *talloc_ctx, uint8_t bts_num); [ 107s] ^ [ 107s] Makefile:396: recipe for target 'main.o' failed [ 107s] make[4]: *** [main.o] Error 1 [ 107s] make[4]: Leaving directory '/usr/src/packages/BUILD/src/common' [ 107s] Makefile:346: recipe for target 'all-recursive' failed [ 107s] make[3]: *** [all-recursive] Error 1 [ 107s] make[3]: Leaving directory '/usr/src/packages/BUILD/src' [ 107s] Makefile:398: recipe for target 'all-recursive' failed [ 107s] make[2]: *** [all-recursive] Error 1 [ 107s] make[2]: Leaving directory '/usr/src/packages/BUILD' [ 107s] Makefile:339: recipe for target 'all' failed [ 107s] make[1]: *** [all] Error 2 [ 107s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 107s] dh_auto_build: make -j1 returned exit code 2 [ 107s] debian/rules:12: recipe for target 'build' failed [ 107s] make: *** [build] Error 2 [ 107s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 107s] [ 107s] lamb15 failed "build osmo-bts_0.5.0.20170814.dsc" at Sun Aug 13 23:15:52 UTC 2017. [ 107s] [ 107s] ### VM INTERACTION START ### [ 110s] [ 99.859000] reboot: Power down [ 110s] ### VM INTERACTION END ### [ 110s] [ 110s] lamb15 failed "build osmo-bts_0.5.0.20170814.dsc" at Sun Aug 13 23:15:55 UTC 2017. [ 110s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Sun Aug 13 23:16:02 2017 From: admin at opensuse.org (OBS Notification) Date: Sun, 13 Aug 2017 23:16:02 +0000 Subject: Build failure of network:osmocom:nightly/osmo-bts in xUbuntu_16.04/x86_64 In-Reply-To: References: Message-ID: <5990ddb57603_25b5602f84777419@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-bts/xUbuntu_16.04/x86_64 Package network:osmocom:nightly/osmo-bts failed to build in xUbuntu_16.04/x86_64 Check out the package for editing: osc checkout network:osmocom:nightly osmo-bts Last lines of build log: [ 107s] from main.c:43: [ 107s] ../../include/openbsc/gsm_data_shared.h:903:17: note: declared here [ 107s] struct gsm_bts *gsm_bts_alloc(void *talloc_ctx, uint8_t bts_num); [ 107s] ^ [ 107s] Makefile:396: recipe for target 'main.o' failed [ 107s] make[4]: *** [main.o] Error 1 [ 107s] make[4]: Leaving directory '/usr/src/packages/BUILD/src/common' [ 107s] Makefile:346: recipe for target 'all-recursive' failed [ 107s] make[3]: *** [all-recursive] Error 1 [ 107s] make[3]: Leaving directory '/usr/src/packages/BUILD/src' [ 107s] Makefile:398: recipe for target 'all-recursive' failed [ 107s] make[2]: *** [all-recursive] Error 1 [ 107s] make[2]: Leaving directory '/usr/src/packages/BUILD' [ 107s] Makefile:339: recipe for target 'all' failed [ 107s] make[1]: *** [all] Error 2 [ 107s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 107s] dh_auto_build: make -j1 returned exit code 2 [ 107s] debian/rules:12: recipe for target 'build' failed [ 107s] make: *** [build] Error 2 [ 107s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 107s] [ 107s] lamb15 failed "build osmo-bts_0.5.0.20170814.dsc" at Sun Aug 13 23:15:52 UTC 2017. [ 107s] [ 107s] ### VM INTERACTION START ### [ 110s] [ 99.859000] reboot: Power down [ 110s] ### VM INTERACTION END ### [ 110s] [ 110s] lamb15 failed "build osmo-bts_0.5.0.20170814.dsc" at Sun Aug 13 23:15:55 UTC 2017. [ 110s] -- 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 Aug 13 23:22:31 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 13 Aug 2017 23:22:31 +0000 Subject: [PATCH] osmo-bts[master]: Fix build after recent gsm_bts_alloc() change Message-ID: Review at https://gerrit.osmocom.org/3511 Fix build after recent gsm_bts_alloc() change In openbsc.git Change-Id I61c18a7f021fcb1ec00d34a745f4e3ab03416c2d we changed the gsm_bts_alloc() function signature to include a second argument (the BTS number). This broke omso-bts, and this commit is intended to make it build again. Change-Id: I7ef7654d48c1cfc7e4ecb0b771553ec0740ce2bf --- M src/common/main.c M tests/agch/agch_test.c M tests/cipher/cipher_test.c M tests/handover/handover_test.c M tests/meas/meas_test.c M tests/paging/paging_test.c M tests/tx_power/tx_power_test.c 7 files changed, 7 insertions(+), 7 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/11/3511/1 diff --git a/src/common/main.c b/src/common/main.c index 4c51848..6c13663 100644 --- a/src/common/main.c +++ b/src/common/main.c @@ -241,7 +241,7 @@ handle_options(argc, argv); - bts = gsm_bts_alloc(tall_bts_ctx); + bts = gsm_bts_alloc(tall_bts_ctx, 0); if (!bts) { fprintf(stderr, "Failed to create BTS structure\n"); exit(1); diff --git a/tests/agch/agch_test.c b/tests/agch/agch_test.c index e275c64..7c4e6cd 100644 --- a/tests/agch/agch_test.c +++ b/tests/agch/agch_test.c @@ -229,7 +229,7 @@ bts_log_init(NULL); - bts = gsm_bts_alloc(tall_bts_ctx); + bts = gsm_bts_alloc(tall_bts_ctx, 0); if (bts_init(bts) < 0) { fprintf(stderr, "unable to open bts\n"); exit(1); diff --git a/tests/cipher/cipher_test.c b/tests/cipher/cipher_test.c index c913925..07d9fde 100644 --- a/tests/cipher/cipher_test.c +++ b/tests/cipher/cipher_test.c @@ -71,7 +71,7 @@ bts_log_init(NULL); - bts = gsm_bts_alloc(tall_bts_ctx); + bts = gsm_bts_alloc(tall_bts_ctx, 0); if (bts_init(bts) < 0) { fprintf(stderr, "unable to open bts\n"); exit(1); diff --git a/tests/handover/handover_test.c b/tests/handover/handover_test.c index 611c441..adc4d65 100644 --- a/tests/handover/handover_test.c +++ b/tests/handover/handover_test.c @@ -71,7 +71,7 @@ bts_log_init(NULL); osmo_stderr_target->categories[DHO].loglevel = LOGL_DEBUG; - bts = gsm_bts_alloc(tall_bts_ctx); + bts = gsm_bts_alloc(tall_bts_ctx, 0); if (!bts) { fprintf(stderr, "Failed to create BTS structure\n"); exit(1); diff --git a/tests/meas/meas_test.c b/tests/meas/meas_test.c index c87350b..6c514ca 100644 --- a/tests/meas/meas_test.c +++ b/tests/meas/meas_test.c @@ -97,7 +97,7 @@ bts_log_init(NULL); osmo_stderr_target->categories[DMEAS].loglevel = LOGL_DEBUG; - bts = gsm_bts_alloc(tall_bts_ctx); + bts = gsm_bts_alloc(tall_bts_ctx, 0); if (!bts) { fprintf(stderr, "Failed to create BTS structure\n"); exit(1); diff --git a/tests/paging/paging_test.c b/tests/paging/paging_test.c index 1d5f216..2573b3f 100644 --- a/tests/paging/paging_test.c +++ b/tests/paging/paging_test.c @@ -117,7 +117,7 @@ bts_log_init(NULL); - bts = gsm_bts_alloc(tall_bts_ctx); + bts = gsm_bts_alloc(tall_bts_ctx, 0); if (bts_init(bts) < 0) { fprintf(stderr, "unable to open bts\n"); exit(1); diff --git a/tests/tx_power/tx_power_test.c b/tests/tx_power/tx_power_test.c index fb23409..a47d186 100644 --- a/tests/tx_power/tx_power_test.c +++ b/tests/tx_power/tx_power_test.c @@ -215,7 +215,7 @@ osmo_stderr_target->categories[DL1C].loglevel = LOGL_DEBUG; log_set_print_filename(osmo_stderr_target, 0); - bts = gsm_bts_alloc(tall_bts_ctx); + bts = gsm_bts_alloc(tall_bts_ctx, 0); if (!bts) { fprintf(stderr, "Failed to create BTS structure\n"); exit(1); -- To view, visit https://gerrit.osmocom.org/3511 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I7ef7654d48c1cfc7e4ecb0b771553ec0740ce2bf Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Sun Aug 13 23:23:11 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 13 Aug 2017 23:23:11 +0000 Subject: osmo-bts[master]: Fix build after recent gsm_bts_alloc() change In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3511 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I7ef7654d48c1cfc7e4ecb0b771553ec0740ce2bf Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sun Aug 13 23:23:51 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 13 Aug 2017 23:23:51 +0000 Subject: osmo-bts[master]: Fix build after recent gsm_bts_alloc() change In-Reply-To: References: Message-ID: Patch Set 1: Verified+1 -- To view, visit https://gerrit.osmocom.org/3511 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I7ef7654d48c1cfc7e4ecb0b771553ec0740ce2bf Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sun Aug 13 23:24:06 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 13 Aug 2017 23:24:06 +0000 Subject: [MERGED] osmo-bts[master]: Fix build after recent gsm_bts_alloc() change In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Fix build after recent gsm_bts_alloc() change ...................................................................... Fix build after recent gsm_bts_alloc() change In openbsc.git Change-Id I61c18a7f021fcb1ec00d34a745f4e3ab03416c2d we changed the gsm_bts_alloc() function signature to include a second argument (the BTS number). This broke omso-bts, and this commit is intended to make it build again. Change-Id: I7ef7654d48c1cfc7e4ecb0b771553ec0740ce2bf --- M src/common/main.c M tests/agch/agch_test.c M tests/cipher/cipher_test.c M tests/handover/handover_test.c M tests/meas/meas_test.c M tests/paging/paging_test.c M tests/tx_power/tx_power_test.c 7 files changed, 7 insertions(+), 7 deletions(-) Approvals: Harald Welte: Looks good to me, approved; Verified diff --git a/src/common/main.c b/src/common/main.c index 4c51848..6c13663 100644 --- a/src/common/main.c +++ b/src/common/main.c @@ -241,7 +241,7 @@ handle_options(argc, argv); - bts = gsm_bts_alloc(tall_bts_ctx); + bts = gsm_bts_alloc(tall_bts_ctx, 0); if (!bts) { fprintf(stderr, "Failed to create BTS structure\n"); exit(1); diff --git a/tests/agch/agch_test.c b/tests/agch/agch_test.c index e275c64..7c4e6cd 100644 --- a/tests/agch/agch_test.c +++ b/tests/agch/agch_test.c @@ -229,7 +229,7 @@ bts_log_init(NULL); - bts = gsm_bts_alloc(tall_bts_ctx); + bts = gsm_bts_alloc(tall_bts_ctx, 0); if (bts_init(bts) < 0) { fprintf(stderr, "unable to open bts\n"); exit(1); diff --git a/tests/cipher/cipher_test.c b/tests/cipher/cipher_test.c index c913925..07d9fde 100644 --- a/tests/cipher/cipher_test.c +++ b/tests/cipher/cipher_test.c @@ -71,7 +71,7 @@ bts_log_init(NULL); - bts = gsm_bts_alloc(tall_bts_ctx); + bts = gsm_bts_alloc(tall_bts_ctx, 0); if (bts_init(bts) < 0) { fprintf(stderr, "unable to open bts\n"); exit(1); diff --git a/tests/handover/handover_test.c b/tests/handover/handover_test.c index 611c441..adc4d65 100644 --- a/tests/handover/handover_test.c +++ b/tests/handover/handover_test.c @@ -71,7 +71,7 @@ bts_log_init(NULL); osmo_stderr_target->categories[DHO].loglevel = LOGL_DEBUG; - bts = gsm_bts_alloc(tall_bts_ctx); + bts = gsm_bts_alloc(tall_bts_ctx, 0); if (!bts) { fprintf(stderr, "Failed to create BTS structure\n"); exit(1); diff --git a/tests/meas/meas_test.c b/tests/meas/meas_test.c index c87350b..6c514ca 100644 --- a/tests/meas/meas_test.c +++ b/tests/meas/meas_test.c @@ -97,7 +97,7 @@ bts_log_init(NULL); osmo_stderr_target->categories[DMEAS].loglevel = LOGL_DEBUG; - bts = gsm_bts_alloc(tall_bts_ctx); + bts = gsm_bts_alloc(tall_bts_ctx, 0); if (!bts) { fprintf(stderr, "Failed to create BTS structure\n"); exit(1); diff --git a/tests/paging/paging_test.c b/tests/paging/paging_test.c index 1d5f216..2573b3f 100644 --- a/tests/paging/paging_test.c +++ b/tests/paging/paging_test.c @@ -117,7 +117,7 @@ bts_log_init(NULL); - bts = gsm_bts_alloc(tall_bts_ctx); + bts = gsm_bts_alloc(tall_bts_ctx, 0); if (bts_init(bts) < 0) { fprintf(stderr, "unable to open bts\n"); exit(1); diff --git a/tests/tx_power/tx_power_test.c b/tests/tx_power/tx_power_test.c index fb23409..a47d186 100644 --- a/tests/tx_power/tx_power_test.c +++ b/tests/tx_power/tx_power_test.c @@ -215,7 +215,7 @@ osmo_stderr_target->categories[DL1C].loglevel = LOGL_DEBUG; log_set_print_filename(osmo_stderr_target, 0); - bts = gsm_bts_alloc(tall_bts_ctx); + bts = gsm_bts_alloc(tall_bts_ctx, 0); if (!bts) { fprintf(stderr, "Failed to create BTS structure\n"); exit(1); -- To view, visit https://gerrit.osmocom.org/3511 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I7ef7654d48c1cfc7e4ecb0b771553ec0740ce2bf Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Mon Aug 14 06:12:53 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 14 Aug 2017 06:12:53 +0000 Subject: [PATCH] libasn1c[master]: add contrib/jenkins.sh script for jenkins build testing Message-ID: Review at https://gerrit.osmocom.org/3512 add contrib/jenkins.sh script for jenkins build testing Change-Id: I22fc707814e87b50e956d3b4fda6e5e31f0b62a7 --- A contrib/jenkins.sh 1 file changed, 16 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libasn1c refs/changes/12/3512/1 diff --git a/contrib/jenkins.sh b/contrib/jenkins.sh new file mode 100755 index 0000000..d9901e3 --- /dev/null +++ b/contrib/jenkins.sh @@ -0,0 +1,16 @@ +#!/usr/bin/env bash +# jenkins build helper script for libasn1c. This is how we build on jenkins.osmocom.org + +set +x +echo +echo +echo +echo " =============================== libasn1c ===============================" +echo +set -x + +autoreconf --install --force +./configure CFLAGS="-Werror" CPPFLAGS="-Werror" +$MAKE $PARALLEL_MAKE +$MAKE distcheck \ + || cat-testlogs.sh -- To view, visit https://gerrit.osmocom.org/3512 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I22fc707814e87b50e956d3b4fda6e5e31f0b62a7 Gerrit-PatchSet: 1 Gerrit-Project: libasn1c Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Mon Aug 14 06:14:09 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 14 Aug 2017 06:14:09 +0000 Subject: libasn1c[master]: add contrib/jenkins.sh script for jenkins build testing In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3512 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I22fc707814e87b50e956d3b4fda6e5e31f0b62a7 Gerrit-PatchSet: 1 Gerrit-Project: libasn1c Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Aug 14 06:14:11 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 14 Aug 2017 06:14:11 +0000 Subject: [MERGED] libasn1c[master]: add contrib/jenkins.sh script for jenkins build testing In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: add contrib/jenkins.sh script for jenkins build testing ...................................................................... add contrib/jenkins.sh script for jenkins build testing Change-Id: I22fc707814e87b50e956d3b4fda6e5e31f0b62a7 --- A contrib/jenkins.sh 1 file changed, 16 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/contrib/jenkins.sh b/contrib/jenkins.sh new file mode 100755 index 0000000..d9901e3 --- /dev/null +++ b/contrib/jenkins.sh @@ -0,0 +1,16 @@ +#!/usr/bin/env bash +# jenkins build helper script for libasn1c. This is how we build on jenkins.osmocom.org + +set +x +echo +echo +echo +echo " =============================== libasn1c ===============================" +echo +set -x + +autoreconf --install --force +./configure CFLAGS="-Werror" CPPFLAGS="-Werror" +$MAKE $PARALLEL_MAKE +$MAKE distcheck \ + || cat-testlogs.sh -- To view, visit https://gerrit.osmocom.org/3512 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I22fc707814e87b50e956d3b4fda6e5e31f0b62a7 Gerrit-PatchSet: 1 Gerrit-Project: libasn1c Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Mon Aug 14 06:14:20 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 14 Aug 2017 06:14:20 +0000 Subject: libasn1c[master]: debian/copyright: Code in this repository is under BSD-2-Clause In-Reply-To: References: Message-ID: Patch Set 1: Verified+1 -- To view, visit https://gerrit.osmocom.org/3510 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I4f908ce4f670e062e6808ac7966d0e52bfe6b4f9 Gerrit-PatchSet: 1 Gerrit-Project: libasn1c Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Aug 14 06:14:24 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 14 Aug 2017 06:14:24 +0000 Subject: libasn1c[master]: Re-license asn1helper.c under identical license as upstream In-Reply-To: References: Message-ID: Patch Set 1: Verified+1 -- To view, visit https://gerrit.osmocom.org/3509 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I8e714d4c51d771b1eabec7aa06e7daae73f48b15 Gerrit-PatchSet: 1 Gerrit-Project: libasn1c Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Aug 14 06:15:23 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 14 Aug 2017 06:15:23 +0000 Subject: [MERGED] libasn1c[master]: Re-license asn1helper.c under identical license as upstream In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Re-license asn1helper.c under identical license as upstream ...................................................................... Re-license asn1helper.c under identical license as upstream asn1helpers.c originally existed in the repository of an application (osmo-hnbgw, IIRC), and hence was under AGPLv3. When moving it to this repository, it should have been relicensed but wasn't. The intention was never to "contaminate" (lib)asn1c with AGPLv3 code. Change-Id: I8e714d4c51d771b1eabec7aa06e7daae73f48b15 --- M debian/copyright M src/asn1helpers.c 2 files changed, 3 insertions(+), 26 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/debian/copyright b/debian/copyright index 91a7cb9..2eef07a 100644 --- a/debian/copyright +++ b/debian/copyright @@ -18,19 +18,7 @@ Files: src/asn1helpers.c Copyright: 2014-2015 by Harald Welte -License: AGPL-3.0+ - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU Affero General Public License as published by - the Free Software Foundation; either version 3 of the License, or - (at your option) any later version. - . - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU Affero General Public License for more details. - . - You should have received a copy of the GNU Affero General Public License - along with this program. If not, see . +License: BSD-2-Clause Files: debian/* Copyright: 2017 Alexander Couzens diff --git a/src/asn1helpers.c b/src/asn1helpers.c index aca5300..a4ced70 100644 --- a/src/asn1helpers.c +++ b/src/asn1helpers.c @@ -3,19 +3,8 @@ /* (C) 2014-2015 by Harald Welte * All Rights Reserved * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - * + * Redistribution and modifications are permitted subject to BSD license + * contained in COPYING file. */ #include -- To view, visit https://gerrit.osmocom.org/3509 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I8e714d4c51d771b1eabec7aa06e7daae73f48b15 Gerrit-PatchSet: 2 Gerrit-Project: libasn1c Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Mon Aug 14 06:30:24 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 14 Aug 2017 06:30:24 +0000 Subject: [MERGED] libasn1c[master]: debian/copyright: Code in this repository is under BSD-2-Clause In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: debian/copyright: Code in this repository is under BSD-2-Clause ...................................................................... debian/copyright: Code in this repository is under BSD-2-Clause The license is not a 3-clause BSD, but a 2-clause BSD. Couldn't find any trace to a 3rd clause anywhere. Change-Id: I4f908ce4f670e062e6808ac7966d0e52bfe6b4f9 --- M debian/copyright 1 file changed, 3 insertions(+), 3 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/debian/copyright b/debian/copyright index 2eef07a..0494a0a 100644 --- a/debian/copyright +++ b/debian/copyright @@ -4,17 +4,17 @@ Files: * Copyright: 2005-2014 Lev Walkin -License: BSD-3-Clause +License: BSD-2-Clause Files: src/xer_support.c Copyright: 2003,2004 X/IO Labs, xiolabs.com. 2003,2004,2005 Lev Walkin . -License: BSD-3-Clause +License: BSD-2-Clause Files: include/asn1c/xer_support.h Copyright: 2003,2004 X/IO Labs, xiolabs.com 2003,2004 Lev Walkin -License: BSD-3-Clause +License: BSD-2-Clause Files: src/asn1helpers.c Copyright: 2014-2015 by Harald Welte -- To view, visit https://gerrit.osmocom.org/3510 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I4f908ce4f670e062e6808ac7966d0e52bfe6b4f9 Gerrit-PatchSet: 2 Gerrit-Project: libasn1c Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Mon Aug 14 08:38:09 2017 From: gerrit-no-reply at lists.osmocom.org (Pablo Neira Ayuso) Date: Mon, 14 Aug 2017 08:38:09 +0000 Subject: [PATCH] libsmpp34[master]: add delivery receipt definitions Message-ID: Review at https://gerrit.osmocom.org/3513 add delivery receipt definitions The registered_delivery field in SMPP message is a toggle on/off, this patch adds two new definition so we don't have to use magic numbers from the code. Change-Id: I5b3afff1b3b77cccd949e0606914c7ac3ba6114c --- M src/smpp34.h 1 file changed, 4 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libsmpp34 refs/changes/13/3513/1 diff --git a/src/smpp34.h b/src/smpp34.h index 9d51a4a..b66d47f 100644 --- a/src/smpp34.h +++ b/src/smpp34.h @@ -212,4 +212,8 @@ #define SMPP34_UDHI_IND 0x40 #define SMPP34_REPLY_PATH 0x80 +/* Sect. 5.2.17 registered_delivery. */ +#define SMPP34_DELIVERY_RECEIPT_OFF 0x00 +#define SMPP34_DELIVERY_RECEIPT_ON 0x01 + #endif -- To view, visit https://gerrit.osmocom.org/3513 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I5b3afff1b3b77cccd949e0606914c7ac3ba6114c Gerrit-PatchSet: 1 Gerrit-Project: libsmpp34 Gerrit-Branch: master Gerrit-Owner: Pablo Neira Ayuso From gerrit-no-reply at lists.osmocom.org Mon Aug 14 09:07:48 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Mon, 14 Aug 2017 09:07:48 +0000 Subject: [PATCH] openbsc[master]: mgcp: Fix uplink activation of Osmux stream Message-ID: Review at https://gerrit.osmocom.org/3514 mgcp: Fix uplink activation of Osmux stream Commit 575420637981828b64c1292ada015d7170b89390 introduced OSMUX_STATE_NEGOTIATING to fix a race condition present in osmo-bsc_nat. However, after this change osmo-bsc_mgcp cannot switch to OSMUX_STATE_ACTIVATING anymore, which means during osmux_send_dummy time it won't call osmux_enable_endpoint(), which in turn won't set endp type to MGCP_OSMUX_BSC. If MGCP_OSMUX_BSC is not set, uplink streams are sent using regular RTP instead of Osmux not matter it is enabled in config or not. Change-Id: Ibcb59aa1ca25408f82cc88c2d5b81177b5f276dc --- M openbsc/src/libmgcp/mgcp_protocol.c 1 file changed, 4 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/14/3514/1 diff --git a/openbsc/src/libmgcp/mgcp_protocol.c b/openbsc/src/libmgcp/mgcp_protocol.c index 4fcadd9..7cc6256 100644 --- a/openbsc/src/libmgcp/mgcp_protocol.c +++ b/openbsc/src/libmgcp/mgcp_protocol.c @@ -277,10 +277,12 @@ if (!addr) addr = mgcp_net_src_addr(endp); - if (endp->osmux.state == OSMUX_STATE_NEGOTIATING) + if (endp->osmux.state == OSMUX_STATE_NEGOTIATING) { sprintf(osmux_extension, "\nX-Osmux: %u", endp->osmux.cid); - else + endp->osmux.state = OSMUX_STATE_ACTIVATING; + } else { osmux_extension[0] = '\0'; + } len = snprintf(sdp_record, sizeof(sdp_record), "I: %u%s\n\n", endp->ci, osmux_extension); -- To view, visit https://gerrit.osmocom.org/3514 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ibcb59aa1ca25408f82cc88c2d5b81177b5f276dc Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Mon Aug 14 09:12:37 2017 From: gerrit-no-reply at lists.osmocom.org (Pablo Neira Ayuso) Date: Mon, 14 Aug 2017 09:12:37 +0000 Subject: [PATCH] openbsc[master]: libmsc: use SMPP34_DELIVERY_RECEIPT_* in libsmpp34 Message-ID: Review at https://gerrit.osmocom.org/3515 libmsc: use SMPP34_DELIVERY_RECEIPT_* in libsmpp34 Use new definitions for the registered_delivery field in libsmpp34 with I5b3afff1b3b77cccd949e0606914c7ac3ba6114c. Moreover, do not set this header field to zero if status reports are off, the deliver_t structure has been already zeroed so this not required. Change-Id: Ie78e17323796120f576b9c0e1bc5ccc32da8ee12 --- M openbsc/src/libmsc/smpp_openbsc.c 1 file changed, 1 insertion(+), 7 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/15/3515/1 diff --git a/openbsc/src/libmsc/smpp_openbsc.c b/openbsc/src/libmsc/smpp_openbsc.c index ddb24b5..f2a036d 100644 --- a/openbsc/src/libmsc/smpp_openbsc.c +++ b/openbsc/src/libmsc/smpp_openbsc.c @@ -627,10 +627,6 @@ return NULL; } -/* See SMPP 3.4, Section 5.2.17. registered_delivery (1 byte field). */ -#define SMPP34_NO_DELIVERY_RECEIPT 0x0 -#define SMPP34_DELIVERY_RECEIPT_REQ 0x1 - static int deliver_to_esme(struct osmo_esme *esme, struct gsm_sms *sms, struct gsm_subscriber_connection *conn) { @@ -676,9 +672,7 @@ deliver.protocol_id = sms->protocol_id; deliver.priority_flag = 0; if (sms->status_rep_req) - deliver.registered_delivery = SMPP34_DELIVERY_RECEIPT_REQ; - else - deliver.registered_delivery = SMPP34_NO_DELIVERY_RECEIPT; + deliver.registered_delivery = SMPP34_DELIVERY_RECEIPT_ON; /* Figure out SMPP DCS from TP-DCS */ dcs = sms->data_coding_scheme; -- To view, visit https://gerrit.osmocom.org/3515 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ie78e17323796120f576b9c0e1bc5ccc32da8ee12 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Pablo Neira Ayuso From gerrit-no-reply at lists.osmocom.org Mon Aug 14 09:34:10 2017 From: gerrit-no-reply at lists.osmocom.org (Pablo Neira Ayuso) Date: Mon, 14 Aug 2017 09:34:10 +0000 Subject: openbsc[master]: libmsc: use SMPP34_DELIVERY_RECEIPT_* in libsmpp34 In-Reply-To: References: Message-ID: Patch Set 1: Just for the record, this patch depends on: https://gerrit.osmocom.org/#/c/3513/ that's why Jenkins fails to build this. -- To view, visit https://gerrit.osmocom.org/3515 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ie78e17323796120f576b9c0e1bc5ccc32da8ee12 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Pablo Neira Ayuso Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pablo Neira Ayuso Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Aug 14 09:41:54 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Mon, 14 Aug 2017 09:41:54 +0000 Subject: openbsc[master]: mgcp: Fix uplink activation of Osmux stream In-Reply-To: References: Message-ID: Patch Set 1: I tested I can successfully call voice service and a call between 2 mobiles phones, I can speak + hear and checked all traffic is sent using Osmux. -- To view, visit https://gerrit.osmocom.org/3514 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ibcb59aa1ca25408f82cc88c2d5b81177b5f276dc Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: daniel Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Aug 14 10:22:54 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 14 Aug 2017 10:22:54 +0000 Subject: openbsc[master]: mgcp: Fix uplink activation of Osmux stream In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3514 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ibcb59aa1ca25408f82cc88c2d5b81177b5f276dc Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: daniel Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Aug 14 10:23:39 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 14 Aug 2017 10:23:39 +0000 Subject: libsmpp34[master]: add delivery receipt definitions In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3513 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I5b3afff1b3b77cccd949e0606914c7ac3ba6114c Gerrit-PatchSet: 1 Gerrit-Project: libsmpp34 Gerrit-Branch: master Gerrit-Owner: Pablo Neira Ayuso Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Aug 14 10:24:21 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 14 Aug 2017 10:24:21 +0000 Subject: libsmpp34[master]: add delivery receipt definitions In-Reply-To: References: Message-ID: Patch Set 1: are you planning more libsmpp schanges currently? if not, I would like to tag a new version number, so we can adjust the autoconf in openbsc.git and others to require that new version of the library. -- To view, visit https://gerrit.osmocom.org/3513 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I5b3afff1b3b77cccd949e0606914c7ac3ba6114c Gerrit-PatchSet: 1 Gerrit-Project: libsmpp34 Gerrit-Branch: master Gerrit-Owner: Pablo Neira Ayuso Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Aug 14 10:24:36 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 14 Aug 2017 10:24:36 +0000 Subject: [MERGED] openbsc[master]: mgcp: Fix uplink activation of Osmux stream In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: mgcp: Fix uplink activation of Osmux stream ...................................................................... mgcp: Fix uplink activation of Osmux stream Commit 575420637981828b64c1292ada015d7170b89390 introduced OSMUX_STATE_NEGOTIATING to fix a race condition present in osmo-bsc_nat. However, after this change osmo-bsc_mgcp cannot switch to OSMUX_STATE_ACTIVATING anymore, which means during osmux_send_dummy time it won't call osmux_enable_endpoint(), which in turn won't set endp type to MGCP_OSMUX_BSC. If MGCP_OSMUX_BSC is not set, uplink streams are sent using regular RTP instead of Osmux not matter it is enabled in config or not. Change-Id: Ibcb59aa1ca25408f82cc88c2d5b81177b5f276dc --- M openbsc/src/libmgcp/mgcp_protocol.c 1 file changed, 4 insertions(+), 2 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/openbsc/src/libmgcp/mgcp_protocol.c b/openbsc/src/libmgcp/mgcp_protocol.c index 4fcadd9..7cc6256 100644 --- a/openbsc/src/libmgcp/mgcp_protocol.c +++ b/openbsc/src/libmgcp/mgcp_protocol.c @@ -277,10 +277,12 @@ if (!addr) addr = mgcp_net_src_addr(endp); - if (endp->osmux.state == OSMUX_STATE_NEGOTIATING) + if (endp->osmux.state == OSMUX_STATE_NEGOTIATING) { sprintf(osmux_extension, "\nX-Osmux: %u", endp->osmux.cid); - else + endp->osmux.state = OSMUX_STATE_ACTIVATING; + } else { osmux_extension[0] = '\0'; + } len = snprintf(sdp_record, sizeof(sdp_record), "I: %u%s\n\n", endp->ci, osmux_extension); -- To view, visit https://gerrit.osmocom.org/3514 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ibcb59aa1ca25408f82cc88c2d5b81177b5f276dc Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: daniel From gerrit-no-reply at lists.osmocom.org Mon Aug 14 10:27:12 2017 From: gerrit-no-reply at lists.osmocom.org (Pablo Neira Ayuso) Date: Mon, 14 Aug 2017 10:27:12 +0000 Subject: libsmpp34[master]: add delivery receipt definitions In-Reply-To: References: Message-ID: Patch Set 1: My queue is now empty :-), unless someone needs any more cleanups ;-) -- To view, visit https://gerrit.osmocom.org/3513 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I5b3afff1b3b77cccd949e0606914c7ac3ba6114c Gerrit-PatchSet: 1 Gerrit-Project: libsmpp34 Gerrit-Branch: master Gerrit-Owner: Pablo Neira Ayuso Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pablo Neira Ayuso Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Aug 14 10:27:27 2017 From: gerrit-no-reply at lists.osmocom.org (Pablo Neira Ayuso) Date: Mon, 14 Aug 2017 10:27:27 +0000 Subject: [MERGED] libsmpp34[master]: add delivery receipt definitions In-Reply-To: References: Message-ID: Pablo Neira Ayuso has submitted this change and it was merged. Change subject: add delivery receipt definitions ...................................................................... add delivery receipt definitions The registered_delivery field in SMPP message is a toggle on/off, this patch adds two new definition so we don't have to use magic numbers from the code. Change-Id: I5b3afff1b3b77cccd949e0606914c7ac3ba6114c --- M src/smpp34.h 1 file changed, 4 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/smpp34.h b/src/smpp34.h index 9d51a4a..b66d47f 100644 --- a/src/smpp34.h +++ b/src/smpp34.h @@ -212,4 +212,8 @@ #define SMPP34_UDHI_IND 0x40 #define SMPP34_REPLY_PATH 0x80 +/* Sect. 5.2.17 registered_delivery. */ +#define SMPP34_DELIVERY_RECEIPT_OFF 0x00 +#define SMPP34_DELIVERY_RECEIPT_ON 0x01 + #endif -- To view, visit https://gerrit.osmocom.org/3513 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I5b3afff1b3b77cccd949e0606914c7ac3ba6114c Gerrit-PatchSet: 1 Gerrit-Project: libsmpp34 Gerrit-Branch: master Gerrit-Owner: Pablo Neira Ayuso Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pablo Neira Ayuso From gerrit-no-reply at lists.osmocom.org Mon Aug 14 10:32:10 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 14 Aug 2017 10:32:10 +0000 Subject: [PATCH] openbsc[master]: Migrate from gprs_apn_to_str() to libosmocore osmo_apn_to_str() In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3504 to look at the new patch set (#2). Migrate from gprs_apn_to_str() to libosmocore osmo_apn_to_str() In 2015, Jacob moved/copied related functions to libosmocore, but for some reason didn't remove the copies here. Let's follow-up on that and remove duplicated code. The libosmocore commit introducing osmo_apn_to_str() was 8114294bf29ac6e44822c0ae43d4b0819f11b022 Change-Id: I7315ffcbed8a54cca2056f313bb7783ad82d0ee9 --- M openbsc/include/openbsc/gprs_utils.h M openbsc/src/gprs/gb_proxy_patch.c M openbsc/src/gprs/gb_proxy_vty.c M openbsc/src/gprs/gprs_sgsn.c M openbsc/src/gprs/gprs_subscriber.c M openbsc/src/gprs/gprs_utils.c M openbsc/src/gprs/gtphub.c M openbsc/src/gprs/sgsn_cdr.c M openbsc/src/gprs/sgsn_vty.c M openbsc/tests/gprs/gprs_test.c M openbsc/tests/gtphub/Makefile.am 11 files changed, 19 insertions(+), 148 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/04/3504/2 diff --git a/openbsc/include/openbsc/gprs_utils.h b/openbsc/include/openbsc/gprs_utils.h index 603605c..574f5c5 100644 --- a/openbsc/include/openbsc/gprs_utils.h +++ b/openbsc/include/openbsc/gprs_utils.h @@ -30,7 +30,6 @@ struct msgb *gprs_msgb_copy(const struct msgb *msg, const char *name); int gprs_msgb_resize_area(struct msgb *msg, uint8_t *area, size_t old_size, size_t new_size); -char *gprs_apn_to_str(char *out_str, const uint8_t *apn_enc, size_t rest_chars); int gprs_str_to_apn(uint8_t *apn_enc, size_t max_len, const char *str); /* GSM 04.08, 10.5.7.3 GPRS Timer */ diff --git a/openbsc/src/gprs/gb_proxy_patch.c b/openbsc/src/gprs/gb_proxy_patch.c index 7bddc44..210fb2b 100644 --- a/openbsc/src/gprs/gb_proxy_patch.c +++ b/openbsc/src/gprs/gb_proxy_patch.c @@ -28,6 +28,7 @@ #include #include +#include /* patch RA identifier in place */ static void gbproxy_patch_raid(uint8_t *raid_enc, struct gbproxy_peer *peer, @@ -101,7 +102,7 @@ LOGP(DGPRS, LOGL_DEBUG, "Patching %s to SGSN: Removing APN '%s'\n", log_text, - gprs_apn_to_str(str1, apn, apn_len)); + osmo_apn_to_str(str1, apn, apn_len)); *new_apn_ie_len = 0; gprs_msgb_resize_area(msg, apn_ie, apn_ie_len, 0); @@ -116,8 +117,8 @@ "Patching %s to SGSN: " "Replacing APN '%s' -> '%s'\n", log_text, - gprs_apn_to_str(str1, apn, apn_len), - gprs_apn_to_str(str2, peer->cfg->core_apn, + osmo_apn_to_str(str1, apn, apn_len), + osmo_apn_to_str(str2, peer->cfg->core_apn, peer->cfg->core_apn_size)); *new_apn_ie_len = peer->cfg->core_apn_size + 2; diff --git a/openbsc/src/gprs/gb_proxy_vty.c b/openbsc/src/gprs/gb_proxy_vty.c index 933b6b0..86d65a8 100644 --- a/openbsc/src/gprs/gb_proxy_vty.c +++ b/openbsc/src/gprs/gb_proxy_vty.c @@ -29,6 +29,7 @@ #include #include +#include #include #include @@ -107,7 +108,7 @@ if (g_cfg->core_apn_size > 0) { char str[500] = {0}; vty_out(vty, " core-access-point-name %s%s", - gprs_apn_to_str(str, g_cfg->core_apn, + osmo_apn_to_str(str, g_cfg->core_apn, g_cfg->core_apn_size), VTY_NEWLINE); } else { diff --git a/openbsc/src/gprs/gprs_sgsn.c b/openbsc/src/gprs/gprs_sgsn.c index 3c363bc..acaf781 100644 --- a/openbsc/src/gprs/gprs_sgsn.c +++ b/openbsc/src/gprs/gprs_sgsn.c @@ -30,6 +30,7 @@ #include #include #include +#include #include #include @@ -757,7 +758,7 @@ return NULL; } - gprs_apn_to_str(req_apn_str, + osmo_apn_to_str(req_apn_str, TLVP_VAL(tp, GSM48_IE_GSM_APN), TLVP_LEN(tp, GSM48_IE_GSM_APN)); diff --git a/openbsc/src/gprs/gprs_subscriber.c b/openbsc/src/gprs/gprs_subscriber.c index c90ba70..d13bd83 100644 --- a/openbsc/src/gprs/gprs_subscriber.c +++ b/openbsc/src/gprs/gprs_subscriber.c @@ -22,6 +22,7 @@ #include #include +#include #include #include #include @@ -370,7 +371,7 @@ OSMO_ASSERT(pdp_data != NULL); pdp_data->pdp_type = pdp_info->pdp_type; - gprs_apn_to_str(pdp_data->apn_str, + osmo_apn_to_str(pdp_data->apn_str, pdp_info->apn_enc, pdp_info->apn_enc_len); memcpy(pdp_data->qos_subscribed, pdp_info->qos_enc, pdp_info->qos_enc_len); pdp_data->qos_subscribed_len = pdp_info->qos_enc_len; diff --git a/openbsc/src/gprs/gprs_utils.c b/openbsc/src/gprs/gprs_utils.c index 64ed978..91a09d2 100644 --- a/openbsc/src/gprs/gprs_utils.c +++ b/openbsc/src/gprs/gprs_utils.c @@ -114,34 +114,6 @@ return 0; } -/* TODO: Move these conversion functions to a utils file. */ -/* TODO: consolidate with gprs_apn2str(). */ -/** memmove apn_enc to out_str, replacing the length octets in apn_enc with '.' - * (omitting the first one) and terminating with a '\0'. - * out_str needs to have rest_chars amount of bytes or 1 whatever is bigger. - */ -char * gprs_apn_to_str(char *out_str, const uint8_t *apn_enc, size_t rest_chars) -{ - char *str = out_str; - - while (rest_chars > 0 && apn_enc[0]) { - size_t label_size = apn_enc[0]; - if (label_size + 1 > rest_chars) - return NULL; - - memmove(str, apn_enc + 1, label_size); - str += label_size; - rest_chars -= label_size + 1; - apn_enc += label_size + 1; - - if (rest_chars) - *(str++) = '.'; - } - str[0] = '\0'; - - return out_str; -} - int gprs_str_to_apn(uint8_t *apn_enc, size_t max_len, const char *str) { uint8_t *last_len_field; diff --git a/openbsc/src/gprs/gtphub.c b/openbsc/src/gprs/gtphub.c index 5e7520e..0a8e375 100644 --- a/openbsc/src/gprs/gtphub.c +++ b/openbsc/src/gprs/gtphub.c @@ -42,6 +42,8 @@ #include #include +#include + static const int GTPH_GC_TICK_SECONDS = 1; @@ -498,7 +500,7 @@ len = sizeof(apn_buf) - 1; apn_buf[len] = '\0'; - *apn_str = gprs_apn_to_str(apn_buf, (uint8_t*)apn_buf, len); + *apn_str = osmo_apn_to_str(apn_buf, (uint8_t*)apn_buf, len); if (!(*apn_str)) { LOG(LOGL_ERROR, "APN IE: present but cannot be decoded: %s\n", osmo_hexdump((uint8_t*)apn_buf, len)); diff --git a/openbsc/src/gprs/sgsn_cdr.c b/openbsc/src/gprs/sgsn_cdr.c index 0910896..16ea9d4 100644 --- a/openbsc/src/gprs/sgsn_cdr.c +++ b/openbsc/src/gprs/sgsn_cdr.c @@ -22,6 +22,7 @@ #include #include #include +#include #include @@ -145,7 +146,7 @@ if (pdp->lib) { - gprs_apn_to_str(apni, pdp->lib->apn_use.v, pdp->lib->apn_use.l); + osmo_apn_to_str(apni, pdp->lib->apn_use.v, pdp->lib->apn_use.l); inet_ntop(AF_INET, &pdp->lib->hisaddr0.s_addr, ggsn_addr, sizeof(ggsn_addr)); extract_eua(&pdp->lib->eua, eua_addr); } diff --git a/openbsc/src/gprs/sgsn_vty.c b/openbsc/src/gprs/sgsn_vty.c index e09a029..b5d2eae 100644 --- a/openbsc/src/gprs/sgsn_vty.c +++ b/openbsc/src/gprs/sgsn_vty.c @@ -28,6 +28,7 @@ #include #include #include +#include #include #include @@ -110,7 +111,6 @@ #define GSM48_MAX_APN_LEN 102 /* 10.5.6.1 */ -/* TODO: consolidate with gprs_apn_to_str(). */ /** Copy apn to a static buffer, replacing the length octets in apn_enc with '.' * and terminating with a '\0'. Return the static buffer. * len: the length of the encoded APN (which has no terminating zero). @@ -118,23 +118,10 @@ static char *gprs_apn2str(uint8_t *apn, unsigned int len) { static char apnbuf[GSM48_MAX_APN_LEN+1]; - unsigned int i = 0; if (!apn) return ""; - - if (len > sizeof(apnbuf)-1) - len = sizeof(apnbuf)-1; - - memcpy(apnbuf, apn, len); - apnbuf[len] = '\0'; - - /* replace the domain name step sizes with dots */ - while (i < len) { - unsigned int step = apnbuf[i]; - apnbuf[i] = '.'; - i += step+1; - } + osmo_apn_to_str(apnbuf, apn, len); return apnbuf+1; } diff --git a/openbsc/tests/gprs/gprs_test.c b/openbsc/tests/gprs/gprs_test.c index ff77404..aac9bb8 100644 --- a/openbsc/tests/gprs/gprs_test.c +++ b/openbsc/tests/gprs/gprs_test.c @@ -48,101 +48,6 @@ ASSERT_FALSE(nu_is_retransmission(479, 511)); // wrapped } -static void apn_round_trip(const uint8_t *input, size_t len, const char *wanted_output) -{ - char output[len ? len : 1]; - uint8_t encoded[len + 50]; - char *out_str; - int enc_len; - - /* decode and verify we have what we want */ - out_str = gprs_apn_to_str(output, input, len); - OSMO_ASSERT(out_str); - OSMO_ASSERT(out_str == &output[0]); - OSMO_ASSERT(strlen(out_str) == strlen(wanted_output)); - OSMO_ASSERT(strcmp(out_str, wanted_output) == 0); - - /* encode and verify it */ - if (len != 0) { - enc_len = gprs_str_to_apn(encoded, ARRAY_SIZE(encoded), wanted_output); - OSMO_ASSERT(enc_len == len); - OSMO_ASSERT(memcmp(encoded, input, enc_len) == 0); - } else { - enc_len = gprs_str_to_apn(encoded, 0, wanted_output); - OSMO_ASSERT(enc_len == -1); - } -} - -static void test_gsm_03_03_apn(void) -{ - - { - /* test invalid writes */ - const uint8_t ref[10] = { 0xAB, 0xAC, 0xAD, 0xAE, 0xAF, 0xAB, 0xAC, 0xAD, 0xAE, 0xAF }; - uint8_t output[10]; - int enc_len; - - memcpy(output, ref, ARRAY_SIZE(output)); - enc_len = gprs_str_to_apn(output, 0, ""); - OSMO_ASSERT(enc_len == -1); - OSMO_ASSERT(memcmp(ref, output, ARRAY_SIZE(ref)) == 0); - - memcpy(output, ref, ARRAY_SIZE(output)); - enc_len = gprs_str_to_apn(output, 0, "foo"); - OSMO_ASSERT(enc_len == -1); - OSMO_ASSERT(memcmp(ref, output, ARRAY_SIZE(ref)) == 0); - - memcpy(output, ref, ARRAY_SIZE(output)); - enc_len = gprs_str_to_apn(output, 1, "foo"); - OSMO_ASSERT(enc_len == -1); - OSMO_ASSERT(memcmp(ref + 1, output + 1, ARRAY_SIZE(ref) - 1) == 0); - - memcpy(output, ref, ARRAY_SIZE(output)); - enc_len = gprs_str_to_apn(output, 2, "foo"); - OSMO_ASSERT(enc_len == -1); - OSMO_ASSERT(memcmp(ref + 2, output + 2, ARRAY_SIZE(ref) - 2) == 0); - - memcpy(output, ref, ARRAY_SIZE(output)); - enc_len = gprs_str_to_apn(output, 3, "foo"); - OSMO_ASSERT(enc_len == -1); - OSMO_ASSERT(memcmp(ref + 3, output + 3, ARRAY_SIZE(ref) - 3) == 0); - } - - { - /* single empty label */ - uint8_t input[] = { 0x0 }; - const char *output = ""; - apn_round_trip(input, ARRAY_SIZE(input), output); - } - - { - /* no label */ - uint8_t input[] = { }; - const char *output = ""; - apn_round_trip(input, ARRAY_SIZE(input), output); - } - - { - /* single label with A */ - uint8_t input[] = { 0x1, 65 }; - const char *output = "A"; - apn_round_trip(input, ARRAY_SIZE(input), output); - OSMO_ASSERT(gprs_apn_to_str(NULL, input, ARRAY_SIZE(input) - 1) == NULL); - } - - { - uint8_t input[] = { 0x3, 65, 66, 67, 0x2, 90, 122 }; - const char *output = "ABC.Zz"; - char tmp[strlen(output) + 1]; - apn_round_trip(input, ARRAY_SIZE(input), output); - OSMO_ASSERT(gprs_apn_to_str(tmp, input, ARRAY_SIZE(input) - 1) == NULL); - OSMO_ASSERT(gprs_apn_to_str(tmp, input, ARRAY_SIZE(input) - 2) == NULL); - OSMO_ASSERT(gprs_apn_to_str(tmp, input, ARRAY_SIZE(input) - 4) == NULL); - OSMO_ASSERT(gprs_apn_to_str(tmp, input, ARRAY_SIZE(input) - 5) == NULL); - OSMO_ASSERT(gprs_apn_to_str(tmp, input, ARRAY_SIZE(input) - 6) == NULL); - } -} - static void test_gprs_timer_enc_dec(void) { int i, u, secs, tmr; @@ -228,7 +133,6 @@ osmo_init_logging(&info); test_8_4_2(); - test_gsm_03_03_apn(); test_gprs_timer_enc_dec(); printf("Done.\n"); diff --git a/openbsc/tests/gtphub/Makefile.am b/openbsc/tests/gtphub/Makefile.am index 5c834b7..f2a6b88 100644 --- a/openbsc/tests/gtphub/Makefile.am +++ b/openbsc/tests/gtphub/Makefile.am @@ -8,6 +8,7 @@ -ggdb3 \ $(LIBOSMOCORE_CFLAGS) \ $(LIBOSMOABIS_CFLAGS) \ + $(LIBOSMOGSM_CFLAGS) \ $(LIBGTP_CFLAGS) \ $(NULL) @@ -37,6 +38,7 @@ $(top_builddir)/src/gprs/gtphub.o \ $(top_builddir)/src/gprs/gprs_utils.o \ $(LIBOSMOCORE_LIBS) \ + $(LIBOSMOGSM_LIBS) \ $(LIBGTP_LIBS) \ -lrt \ $(NULL) -- To view, visit https://gerrit.osmocom.org/3504 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I7315ffcbed8a54cca2056f313bb7783ad82d0ee9 Gerrit-PatchSet: 2 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Mon Aug 14 10:35:10 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 14 Aug 2017 10:35:10 +0000 Subject: osmo-msc[master]: mscsplit: various preparations to separate MSC from BSC In-Reply-To: References: Message-ID: Patch Set 4: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3345 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Id3705236350d5f69e447046b0a764bbabc3d493c Gerrit-PatchSet: 4 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Aug 14 10:38:22 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 14 Aug 2017 10:38:22 +0000 Subject: osmo-msc[master]: Implement IuCS (large refactoring and addition) In-Reply-To: References: Message-ID: Patch Set 6: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3347 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I5b5b6a9678b458affa86800afb1ec726e66eed88 Gerrit-PatchSet: 6 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Aug 14 10:39:25 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 14 Aug 2017 10:39:25 +0000 Subject: osmo-msc[master]: mgcp: hack RAB success from nano3G: patch first RTP payload In-Reply-To: References: Message-ID: Patch Set 6: Code-Review+1 I think we should have big fat HACK comment around it and explain in the code that the proper thing to do is implement Iu-UP parsing/encoding inside the MGW itself. Also, open a redmine issue to keep track of this. -- To view, visit https://gerrit.osmocom.org/3349 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I5eff04dcb0936e21690e427ae5e49228cd459bd4 Gerrit-PatchSet: 6 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Aug 14 10:40:06 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 14 Aug 2017 10:40:06 +0000 Subject: osmo-msc[master]: 04.08: log protocol discriminators and message types by name In-Reply-To: References: Message-ID: Patch Set 7: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3350 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ida205d217e304337d816b14fd15e2ee435e7397d Gerrit-PatchSet: 7 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pablo Neira Ayuso Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Aug 14 10:40:31 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 14 Aug 2017 10:40:31 +0000 Subject: osmo-msc[master]: examples/sgsn: Use osmo-hlr with auth-policy remote by default In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 (1 comment) https://gerrit.osmocom.org/#/c/3421/1/doc/examples/osmo-sgsn/osmo-sgsn.cfg File doc/examples/osmo-sgsn/osmo-sgsn.cfg: Line 14: gsup remote-port 2222 is this the port we want to use? It's quite far from our usual 42.. range. Is the port listed in the wiki + manual as the port for OsmoHLR? -- To view, visit https://gerrit.osmocom.org/3421 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ie3b2013198d3e2b780a4e31c36b89b58129dcacd Gerrit-PatchSet: 2 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: daniel Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Mon Aug 14 10:42:23 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 14 Aug 2017 10:42:23 +0000 Subject: osmo-msc[master]: MSC, SGSN: use OSMO_GSUP_PORT == 4222 instead of 2222 In-Reply-To: References: Message-ID: Patch Set 1: can we just fold/squash this into https://gerrit.osmocom.org/#/c/3421 please? -- To view, visit https://gerrit.osmocom.org/3488 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I50f2040e2eb0baacb43849e93cfed10cbc2fc156 Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Aug 14 10:43:25 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 14 Aug 2017 10:43:25 +0000 Subject: osmo-msc[master]: move libiu to osmo-iuh/libosmo-ranap In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3489 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ib8c4fcdb4766c5e575618b95ce16dce51063206b Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Aug 14 10:43:37 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 14 Aug 2017 10:43:37 +0000 Subject: osmo-msc[master]: cosmetic: msc_vlr_tests: drop unused var In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3490 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I584c0dfffe005597563dbd72fad8a087c554ba3d Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Aug 14 10:43:46 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 14 Aug 2017 10:43:46 +0000 Subject: osmo-msc[master]: .gitignore: cosmetic: use globs to ignore test binaries In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3491 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I840e4333a4cad646d751ebafe7e0ef23e7a9c708 Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Aug 14 10:44:04 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 14 Aug 2017 10:44:04 +0000 Subject: osmo-msc[master]: gsup client: move not-connected to error loglevel In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3493 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I8290963aedb7237da89c9ff98adf4cd33beb5031 Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Aug 14 10:44:23 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 14 Aug 2017 10:44:23 +0000 Subject: osmo-msc[master]: msc_vlr tests: add IMEISV tests In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3494 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I752afef2ae3ce04e813c7e9fea0e883e607c0e14 Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Aug 14 10:44:44 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 14 Aug 2017 10:44:44 +0000 Subject: osmo-msc[master]: vlr: set require IMEI by default In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 would be good to state the reason/rationale -- To view, visit https://gerrit.osmocom.org/3495 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I91d8f3e79cdaa206f8cd32b42bd7c23933f9631a Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Aug 14 10:45:55 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 14 Aug 2017 10:45:55 +0000 Subject: osmo-msc[master]: add msg type to SMS rx logging In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 (1 comment) https://gerrit.osmocom.org/#/c/3496/1/src/libmsc/gsm_04_11.c File src/libmsc/gsm_04_11.c: Line 812: DEBUGP(DLSMS, "receiving data (trans_id=%x, msg_type=%d)\n", transaction_id, msg_type); hex values are usually more useful for this (and don't we have a value_string?) , but nevermind. -- To view, visit https://gerrit.osmocom.org/3496 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I73ea4eebe57b2d1008045a27f174072178b9f077 Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Mon Aug 14 10:46:47 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 14 Aug 2017 10:46:47 +0000 Subject: osmo-msc[master]: split off osmo-msc: remove files, apply build, rename In-Reply-To: References: Message-ID: Patch Set 1: this could also have a more verbose description that can be unsderstood by the "uninitiated" outsider. Might even make sense to create a wiki page on the split explaining what part of code went where, etc and link this from here. -- To view, visit https://gerrit.osmocom.org/3497 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Icf025e5ea8d180613b3114282951c9afa67af9a7 Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Aug 14 10:47:10 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 14 Aug 2017 10:47:10 +0000 Subject: osmo-msc[master]: libmsc: make pitfall in gsm0408_dispatch() more obvious In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3498 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I43bd9bd1c170559aaa8dacaef25dba090744bcd5 Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: dexter Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Aug 14 10:47:51 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 14 Aug 2017 10:47:51 +0000 Subject: osmo-msc[master]: rework debian packages support In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3499 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I77544cb38c31777c3fab52979d19488a63e52de3 Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: lynxis lazus Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Aug 14 12:03:59 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 14 Aug 2017 12:03:59 +0000 Subject: openbsc[master]: Fix gsm_pchan2chan_nr() to use RSL_CHAN_OSMO_PDCH In-Reply-To: References: Message-ID: Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3399 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ie34219e64a6d89da4a79f2db8ec73d1909fb8280 Gerrit-PatchSet: 3 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Aug 14 12:04:07 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 14 Aug 2017 12:04:07 +0000 Subject: [MERGED] openbsc[master]: Fix gsm_pchan2chan_nr() to use RSL_CHAN_OSMO_PDCH In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Fix gsm_pchan2chan_nr() to use RSL_CHAN_OSMO_PDCH ...................................................................... Fix gsm_pchan2chan_nr() to use RSL_CHAN_OSMO_PDCH When converting from GSM_PCHAN_PDCH, we should generate a RSL channel number IE with the osmocom extension RSL_CHAN_OSMO_PDCH rather than claiming it is a regular TCH/F channel. This is important as this function is used by osmo-bts, too - and it decides which channel number IE is put in the GSMTAP header for both GSMTAP tracing as well as the GSMTAP based osmo-bts-virtual. In order to avoid any unintended effect on libbsc, we make sure to modify rsl_ipacc_pdch_activate() to always use GSM_PCHAN_TCH_F in related RSL message. Change-Id: Ie34219e64a6d89da4a79f2db8ec73d1909fb8280 --- M openbsc/src/libbsc/abis_rsl.c M openbsc/src/libcommon/gsm_data_shared.c 2 files changed, 5 insertions(+), 2 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/openbsc/src/libbsc/abis_rsl.c b/openbsc/src/libbsc/abis_rsl.c index f4fd6de..0ce2748 100644 --- a/openbsc/src/libbsc/abis_rsl.c +++ b/openbsc/src/libbsc/abis_rsl.c @@ -2439,7 +2439,7 @@ dh = (struct abis_rsl_dchan_hdr *) msgb_put(msg, sizeof(*dh)); init_dchan_hdr(dh, msg_type); dh->c.msg_discr = ABIS_RSL_MDISC_DED_CHAN; - dh->chan_nr = gsm_pchan2chan_nr(GSM_PCHAN_PDCH, ts->nr, 0); + dh->chan_nr = gsm_pchan2chan_nr(GSM_PCHAN_TCH_F, ts->nr, 0); DEBUGP(DRSL, "%s IPAC PDCH %sACT\n", gsm_ts_name(ts), act ? "" : "DE"); diff --git a/openbsc/src/libcommon/gsm_data_shared.c b/openbsc/src/libcommon/gsm_data_shared.c index d792f3b..2696273 100644 --- a/openbsc/src/libcommon/gsm_data_shared.c +++ b/openbsc/src/libcommon/gsm_data_shared.c @@ -644,11 +644,14 @@ switch (pchan) { case GSM_PCHAN_TCH_F: - case GSM_PCHAN_PDCH: case GSM_PCHAN_TCH_F_PDCH: OSMO_ASSERT(lchan_nr == 0); cbits = 0x01; break; + case GSM_PCHAN_PDCH: + OSMO_ASSERT(lchan_nr == 0); + cbits = RSL_CHAN_OSMO_PDCH >> 3; + break; case GSM_PCHAN_TCH_H: OSMO_ASSERT(lchan_nr < 2); cbits = 0x02; -- To view, visit https://gerrit.osmocom.org/3399 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ie34219e64a6d89da4a79f2db8ec73d1909fb8280 Gerrit-PatchSet: 3 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Mon Aug 14 12:04:07 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 14 Aug 2017 12:04:07 +0000 Subject: [MERGED] openbsc[master]: SGSN: Fix RAN information exposed on GTP during PDP CTX CREATE In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: SGSN: Fix RAN information exposed on GTP during PDP CTX CREATE ...................................................................... SGSN: Fix RAN information exposed on GTP during PDP CTX CREATE In the PDP Context Create from SGSN to GGSN, we include information about the RAN type (GERAN/UTRAN) and the Cell of the MS. This was all hard-coded to GERAN, and wasn't updated when we added UTRAN support to the SGSN. Change-Id: I6c79e42c5e08b28fe8182555302a5505fbbaa313 --- M openbsc/src/gprs/sgsn_libgtp.c 1 file changed, 14 insertions(+), 4 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/openbsc/src/gprs/sgsn_libgtp.c b/openbsc/src/gprs/sgsn_libgtp.c index 387b95f..e90b66d 100644 --- a/openbsc/src/gprs/sgsn_libgtp.c +++ b/openbsc/src/gprs/sgsn_libgtp.c @@ -251,9 +251,12 @@ memcpy(pdp->gsnlu.v, &sgsn->cfg.gtp_listenaddr.sin_addr, sizeof(sgsn->cfg.gtp_listenaddr.sin_addr)); - /* Assume we are a GERAN system */ + /* Encode RAT Type according to TS 29.060 7.7.50 */ pdp->rattype.l = 1; - pdp->rattype.v[0] = 2; + if (mmctx->ran_type == MM_CTX_T_UTRAN_Iu) + pdp->rattype.v[0] = 1; + else + pdp->rattype.v[0] = 2; pdp->rattype_given = 1; /* Include RAI and ULI all the time */ @@ -264,10 +267,17 @@ raid.rac = 0xFF; gsm48_construct_ra(pdp->rai.v, &raid); + /* Encode User Location Information accordint to TS 29.060 7.7.51 */ pdp->userloc_given = 1; pdp->userloc.l = 8; - pdp->userloc.v[0] = 0; /* CGI for GERAN */ - bssgp_create_cell_id(&pdp->userloc.v[1], &mmctx->ra, mmctx->gb.cell_id); + if (mmctx->ran_type == MM_CTX_T_UTRAN_Iu) { + pdp->userloc.v[0] = 1; /* SAI for UTRAN */ + /* SAI is like CGI but with SAC instead of CID, so we can abuse this function */ + bssgp_create_cell_id(&pdp->userloc.v[1], &mmctx->ra, mmctx->iu.sac); + } else { + pdp->userloc.v[0] = 0; /* CGI for GERAN */ + bssgp_create_cell_id(&pdp->userloc.v[1], &mmctx->ra, mmctx->gb.cell_id); + } /* include the IMEI(SV) */ pdp->imeisv_given = 1; -- To view, visit https://gerrit.osmocom.org/3400 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I6c79e42c5e08b28fe8182555302a5505fbbaa313 Gerrit-PatchSet: 5 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Mon Aug 14 12:04:36 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 14 Aug 2017 12:04:36 +0000 Subject: openbsc[master]: Migrate from gprs_apn_to_str() to libosmocore osmo_apn_to_str() In-Reply-To: References: Message-ID: Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3504 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I7315ffcbed8a54cca2056f313bb7783ad82d0ee9 Gerrit-PatchSet: 3 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Aug 14 12:04:46 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 14 Aug 2017 12:04:46 +0000 Subject: [MERGED] openbsc[master]: sgsn_vty: Don't assume pdp->lib is always valid In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: sgsn_vty: Don't assume pdp->lib is always valid ...................................................................... sgsn_vty: Don't assume pdp->lib is always valid We can only print libgtp pdp information if a library context is attached to this pdp context. This is not always the case, particuarly during some teardown scenarios. Change-Id: Ia3184877f9709db65f5f93a98403f2ef5b04a8ca --- M openbsc/src/gprs/sgsn_vty.c 1 file changed, 16 insertions(+), 14 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/openbsc/src/gprs/sgsn_vty.c b/openbsc/src/gprs/sgsn_vty.c index e09a029..38f173c 100644 --- a/openbsc/src/gprs/sgsn_vty.c +++ b/openbsc/src/gprs/sgsn_vty.c @@ -458,20 +458,22 @@ const char *imsi = pdp->mm ? pdp->mm->imsi : "(detaching)"; vty_out(vty, "%sPDP Context IMSI: %s, SAPI: %u, NSAPI: %u, TI: %u%s", pfx, imsi, pdp->sapi, pdp->nsapi, pdp->ti, VTY_NEWLINE); - vty_out(vty, "%s APN: %s%s", pfx, - gprs_apn2str(pdp->lib->apn_use.v, pdp->lib->apn_use.l), - VTY_NEWLINE); - vty_out(vty, "%s PDP Address: %s%s", pfx, - gprs_pdpaddr2str(pdp->lib->eua.v, pdp->lib->eua.l), - VTY_NEWLINE); - vty_out(vty, "%s GTP Local Control(%s / TEIC: 0x%08x) ", pfx, - gtp_ntoa(&pdp->lib->gsnlc), pdp->lib->teic_own); - vty_out(vty, "Data(%s / TEID: 0x%08x)%s", - gtp_ntoa(&pdp->lib->gsnlu), pdp->lib->teid_own, VTY_NEWLINE); - vty_out(vty, "%s GTP Remote Control(%s / TEIC: 0x%08x) ", pfx, - gtp_ntoa(&pdp->lib->gsnrc), pdp->lib->teic_gn); - vty_out(vty, "Data(%s / TEID: 0x%08x)%s", - gtp_ntoa(&pdp->lib->gsnru), pdp->lib->teid_gn, VTY_NEWLINE); + if (pdp->lib) { + vty_out(vty, "%s APN: %s%s", pfx, + gprs_apn2str(pdp->lib->apn_use.v, pdp->lib->apn_use.l), + VTY_NEWLINE); + vty_out(vty, "%s PDP Address: %s%s", pfx, + gprs_pdpaddr2str(pdp->lib->eua.v, pdp->lib->eua.l), + VTY_NEWLINE); + vty_out(vty, "%s GTP Local Control(%s / TEIC: 0x%08x) ", pfx, + gtp_ntoa(&pdp->lib->gsnlc), pdp->lib->teic_own); + vty_out(vty, "Data(%s / TEID: 0x%08x)%s", + gtp_ntoa(&pdp->lib->gsnlu), pdp->lib->teid_own, VTY_NEWLINE); + vty_out(vty, "%s GTP Remote Control(%s / TEIC: 0x%08x) ", pfx, + gtp_ntoa(&pdp->lib->gsnrc), pdp->lib->teic_gn); + vty_out(vty, "Data(%s / TEID: 0x%08x)%s", + gtp_ntoa(&pdp->lib->gsnru), pdp->lib->teid_gn, VTY_NEWLINE); + } vty_out_rate_ctr_group(vty, " ", pdp->ctrg); } -- To view, visit https://gerrit.osmocom.org/3505 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ia3184877f9709db65f5f93a98403f2ef5b04a8ca Gerrit-PatchSet: 4 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Mon Aug 14 12:04:53 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 14 Aug 2017 12:04:53 +0000 Subject: [MERGED] openbsc[master]: Migrate from gprs_apn_to_str() to libosmocore osmo_apn_to_str() In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Migrate from gprs_apn_to_str() to libosmocore osmo_apn_to_str() ...................................................................... Migrate from gprs_apn_to_str() to libosmocore osmo_apn_to_str() In 2015, Jacob moved/copied related functions to libosmocore, but for some reason didn't remove the copies here. Let's follow-up on that and remove duplicated code. The libosmocore commit introducing osmo_apn_to_str() was 8114294bf29ac6e44822c0ae43d4b0819f11b022 Change-Id: I7315ffcbed8a54cca2056f313bb7783ad82d0ee9 --- M openbsc/include/openbsc/gprs_utils.h M openbsc/src/gprs/gb_proxy_patch.c M openbsc/src/gprs/gb_proxy_vty.c M openbsc/src/gprs/gprs_sgsn.c M openbsc/src/gprs/gprs_subscriber.c M openbsc/src/gprs/gprs_utils.c M openbsc/src/gprs/gtphub.c M openbsc/src/gprs/sgsn_cdr.c M openbsc/src/gprs/sgsn_vty.c M openbsc/tests/gprs/gprs_test.c M openbsc/tests/gtphub/Makefile.am 11 files changed, 19 insertions(+), 148 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/openbsc/include/openbsc/gprs_utils.h b/openbsc/include/openbsc/gprs_utils.h index 603605c..574f5c5 100644 --- a/openbsc/include/openbsc/gprs_utils.h +++ b/openbsc/include/openbsc/gprs_utils.h @@ -30,7 +30,6 @@ struct msgb *gprs_msgb_copy(const struct msgb *msg, const char *name); int gprs_msgb_resize_area(struct msgb *msg, uint8_t *area, size_t old_size, size_t new_size); -char *gprs_apn_to_str(char *out_str, const uint8_t *apn_enc, size_t rest_chars); int gprs_str_to_apn(uint8_t *apn_enc, size_t max_len, const char *str); /* GSM 04.08, 10.5.7.3 GPRS Timer */ diff --git a/openbsc/src/gprs/gb_proxy_patch.c b/openbsc/src/gprs/gb_proxy_patch.c index 7bddc44..210fb2b 100644 --- a/openbsc/src/gprs/gb_proxy_patch.c +++ b/openbsc/src/gprs/gb_proxy_patch.c @@ -28,6 +28,7 @@ #include #include +#include /* patch RA identifier in place */ static void gbproxy_patch_raid(uint8_t *raid_enc, struct gbproxy_peer *peer, @@ -101,7 +102,7 @@ LOGP(DGPRS, LOGL_DEBUG, "Patching %s to SGSN: Removing APN '%s'\n", log_text, - gprs_apn_to_str(str1, apn, apn_len)); + osmo_apn_to_str(str1, apn, apn_len)); *new_apn_ie_len = 0; gprs_msgb_resize_area(msg, apn_ie, apn_ie_len, 0); @@ -116,8 +117,8 @@ "Patching %s to SGSN: " "Replacing APN '%s' -> '%s'\n", log_text, - gprs_apn_to_str(str1, apn, apn_len), - gprs_apn_to_str(str2, peer->cfg->core_apn, + osmo_apn_to_str(str1, apn, apn_len), + osmo_apn_to_str(str2, peer->cfg->core_apn, peer->cfg->core_apn_size)); *new_apn_ie_len = peer->cfg->core_apn_size + 2; diff --git a/openbsc/src/gprs/gb_proxy_vty.c b/openbsc/src/gprs/gb_proxy_vty.c index 933b6b0..86d65a8 100644 --- a/openbsc/src/gprs/gb_proxy_vty.c +++ b/openbsc/src/gprs/gb_proxy_vty.c @@ -29,6 +29,7 @@ #include #include +#include #include #include @@ -107,7 +108,7 @@ if (g_cfg->core_apn_size > 0) { char str[500] = {0}; vty_out(vty, " core-access-point-name %s%s", - gprs_apn_to_str(str, g_cfg->core_apn, + osmo_apn_to_str(str, g_cfg->core_apn, g_cfg->core_apn_size), VTY_NEWLINE); } else { diff --git a/openbsc/src/gprs/gprs_sgsn.c b/openbsc/src/gprs/gprs_sgsn.c index 3c363bc..acaf781 100644 --- a/openbsc/src/gprs/gprs_sgsn.c +++ b/openbsc/src/gprs/gprs_sgsn.c @@ -30,6 +30,7 @@ #include #include #include +#include #include #include @@ -757,7 +758,7 @@ return NULL; } - gprs_apn_to_str(req_apn_str, + osmo_apn_to_str(req_apn_str, TLVP_VAL(tp, GSM48_IE_GSM_APN), TLVP_LEN(tp, GSM48_IE_GSM_APN)); diff --git a/openbsc/src/gprs/gprs_subscriber.c b/openbsc/src/gprs/gprs_subscriber.c index c90ba70..d13bd83 100644 --- a/openbsc/src/gprs/gprs_subscriber.c +++ b/openbsc/src/gprs/gprs_subscriber.c @@ -22,6 +22,7 @@ #include #include +#include #include #include #include @@ -370,7 +371,7 @@ OSMO_ASSERT(pdp_data != NULL); pdp_data->pdp_type = pdp_info->pdp_type; - gprs_apn_to_str(pdp_data->apn_str, + osmo_apn_to_str(pdp_data->apn_str, pdp_info->apn_enc, pdp_info->apn_enc_len); memcpy(pdp_data->qos_subscribed, pdp_info->qos_enc, pdp_info->qos_enc_len); pdp_data->qos_subscribed_len = pdp_info->qos_enc_len; diff --git a/openbsc/src/gprs/gprs_utils.c b/openbsc/src/gprs/gprs_utils.c index 64ed978..91a09d2 100644 --- a/openbsc/src/gprs/gprs_utils.c +++ b/openbsc/src/gprs/gprs_utils.c @@ -114,34 +114,6 @@ return 0; } -/* TODO: Move these conversion functions to a utils file. */ -/* TODO: consolidate with gprs_apn2str(). */ -/** memmove apn_enc to out_str, replacing the length octets in apn_enc with '.' - * (omitting the first one) and terminating with a '\0'. - * out_str needs to have rest_chars amount of bytes or 1 whatever is bigger. - */ -char * gprs_apn_to_str(char *out_str, const uint8_t *apn_enc, size_t rest_chars) -{ - char *str = out_str; - - while (rest_chars > 0 && apn_enc[0]) { - size_t label_size = apn_enc[0]; - if (label_size + 1 > rest_chars) - return NULL; - - memmove(str, apn_enc + 1, label_size); - str += label_size; - rest_chars -= label_size + 1; - apn_enc += label_size + 1; - - if (rest_chars) - *(str++) = '.'; - } - str[0] = '\0'; - - return out_str; -} - int gprs_str_to_apn(uint8_t *apn_enc, size_t max_len, const char *str) { uint8_t *last_len_field; diff --git a/openbsc/src/gprs/gtphub.c b/openbsc/src/gprs/gtphub.c index 5e7520e..0a8e375 100644 --- a/openbsc/src/gprs/gtphub.c +++ b/openbsc/src/gprs/gtphub.c @@ -42,6 +42,8 @@ #include #include +#include + static const int GTPH_GC_TICK_SECONDS = 1; @@ -498,7 +500,7 @@ len = sizeof(apn_buf) - 1; apn_buf[len] = '\0'; - *apn_str = gprs_apn_to_str(apn_buf, (uint8_t*)apn_buf, len); + *apn_str = osmo_apn_to_str(apn_buf, (uint8_t*)apn_buf, len); if (!(*apn_str)) { LOG(LOGL_ERROR, "APN IE: present but cannot be decoded: %s\n", osmo_hexdump((uint8_t*)apn_buf, len)); diff --git a/openbsc/src/gprs/sgsn_cdr.c b/openbsc/src/gprs/sgsn_cdr.c index 0910896..16ea9d4 100644 --- a/openbsc/src/gprs/sgsn_cdr.c +++ b/openbsc/src/gprs/sgsn_cdr.c @@ -22,6 +22,7 @@ #include #include #include +#include #include @@ -145,7 +146,7 @@ if (pdp->lib) { - gprs_apn_to_str(apni, pdp->lib->apn_use.v, pdp->lib->apn_use.l); + osmo_apn_to_str(apni, pdp->lib->apn_use.v, pdp->lib->apn_use.l); inet_ntop(AF_INET, &pdp->lib->hisaddr0.s_addr, ggsn_addr, sizeof(ggsn_addr)); extract_eua(&pdp->lib->eua, eua_addr); } diff --git a/openbsc/src/gprs/sgsn_vty.c b/openbsc/src/gprs/sgsn_vty.c index 38f173c..d4447e1 100644 --- a/openbsc/src/gprs/sgsn_vty.c +++ b/openbsc/src/gprs/sgsn_vty.c @@ -28,6 +28,7 @@ #include #include #include +#include #include #include @@ -110,7 +111,6 @@ #define GSM48_MAX_APN_LEN 102 /* 10.5.6.1 */ -/* TODO: consolidate with gprs_apn_to_str(). */ /** Copy apn to a static buffer, replacing the length octets in apn_enc with '.' * and terminating with a '\0'. Return the static buffer. * len: the length of the encoded APN (which has no terminating zero). @@ -118,23 +118,10 @@ static char *gprs_apn2str(uint8_t *apn, unsigned int len) { static char apnbuf[GSM48_MAX_APN_LEN+1]; - unsigned int i = 0; if (!apn) return ""; - - if (len > sizeof(apnbuf)-1) - len = sizeof(apnbuf)-1; - - memcpy(apnbuf, apn, len); - apnbuf[len] = '\0'; - - /* replace the domain name step sizes with dots */ - while (i < len) { - unsigned int step = apnbuf[i]; - apnbuf[i] = '.'; - i += step+1; - } + osmo_apn_to_str(apnbuf, apn, len); return apnbuf+1; } diff --git a/openbsc/tests/gprs/gprs_test.c b/openbsc/tests/gprs/gprs_test.c index ff77404..aac9bb8 100644 --- a/openbsc/tests/gprs/gprs_test.c +++ b/openbsc/tests/gprs/gprs_test.c @@ -48,101 +48,6 @@ ASSERT_FALSE(nu_is_retransmission(479, 511)); // wrapped } -static void apn_round_trip(const uint8_t *input, size_t len, const char *wanted_output) -{ - char output[len ? len : 1]; - uint8_t encoded[len + 50]; - char *out_str; - int enc_len; - - /* decode and verify we have what we want */ - out_str = gprs_apn_to_str(output, input, len); - OSMO_ASSERT(out_str); - OSMO_ASSERT(out_str == &output[0]); - OSMO_ASSERT(strlen(out_str) == strlen(wanted_output)); - OSMO_ASSERT(strcmp(out_str, wanted_output) == 0); - - /* encode and verify it */ - if (len != 0) { - enc_len = gprs_str_to_apn(encoded, ARRAY_SIZE(encoded), wanted_output); - OSMO_ASSERT(enc_len == len); - OSMO_ASSERT(memcmp(encoded, input, enc_len) == 0); - } else { - enc_len = gprs_str_to_apn(encoded, 0, wanted_output); - OSMO_ASSERT(enc_len == -1); - } -} - -static void test_gsm_03_03_apn(void) -{ - - { - /* test invalid writes */ - const uint8_t ref[10] = { 0xAB, 0xAC, 0xAD, 0xAE, 0xAF, 0xAB, 0xAC, 0xAD, 0xAE, 0xAF }; - uint8_t output[10]; - int enc_len; - - memcpy(output, ref, ARRAY_SIZE(output)); - enc_len = gprs_str_to_apn(output, 0, ""); - OSMO_ASSERT(enc_len == -1); - OSMO_ASSERT(memcmp(ref, output, ARRAY_SIZE(ref)) == 0); - - memcpy(output, ref, ARRAY_SIZE(output)); - enc_len = gprs_str_to_apn(output, 0, "foo"); - OSMO_ASSERT(enc_len == -1); - OSMO_ASSERT(memcmp(ref, output, ARRAY_SIZE(ref)) == 0); - - memcpy(output, ref, ARRAY_SIZE(output)); - enc_len = gprs_str_to_apn(output, 1, "foo"); - OSMO_ASSERT(enc_len == -1); - OSMO_ASSERT(memcmp(ref + 1, output + 1, ARRAY_SIZE(ref) - 1) == 0); - - memcpy(output, ref, ARRAY_SIZE(output)); - enc_len = gprs_str_to_apn(output, 2, "foo"); - OSMO_ASSERT(enc_len == -1); - OSMO_ASSERT(memcmp(ref + 2, output + 2, ARRAY_SIZE(ref) - 2) == 0); - - memcpy(output, ref, ARRAY_SIZE(output)); - enc_len = gprs_str_to_apn(output, 3, "foo"); - OSMO_ASSERT(enc_len == -1); - OSMO_ASSERT(memcmp(ref + 3, output + 3, ARRAY_SIZE(ref) - 3) == 0); - } - - { - /* single empty label */ - uint8_t input[] = { 0x0 }; - const char *output = ""; - apn_round_trip(input, ARRAY_SIZE(input), output); - } - - { - /* no label */ - uint8_t input[] = { }; - const char *output = ""; - apn_round_trip(input, ARRAY_SIZE(input), output); - } - - { - /* single label with A */ - uint8_t input[] = { 0x1, 65 }; - const char *output = "A"; - apn_round_trip(input, ARRAY_SIZE(input), output); - OSMO_ASSERT(gprs_apn_to_str(NULL, input, ARRAY_SIZE(input) - 1) == NULL); - } - - { - uint8_t input[] = { 0x3, 65, 66, 67, 0x2, 90, 122 }; - const char *output = "ABC.Zz"; - char tmp[strlen(output) + 1]; - apn_round_trip(input, ARRAY_SIZE(input), output); - OSMO_ASSERT(gprs_apn_to_str(tmp, input, ARRAY_SIZE(input) - 1) == NULL); - OSMO_ASSERT(gprs_apn_to_str(tmp, input, ARRAY_SIZE(input) - 2) == NULL); - OSMO_ASSERT(gprs_apn_to_str(tmp, input, ARRAY_SIZE(input) - 4) == NULL); - OSMO_ASSERT(gprs_apn_to_str(tmp, input, ARRAY_SIZE(input) - 5) == NULL); - OSMO_ASSERT(gprs_apn_to_str(tmp, input, ARRAY_SIZE(input) - 6) == NULL); - } -} - static void test_gprs_timer_enc_dec(void) { int i, u, secs, tmr; @@ -228,7 +133,6 @@ osmo_init_logging(&info); test_8_4_2(); - test_gsm_03_03_apn(); test_gprs_timer_enc_dec(); printf("Done.\n"); diff --git a/openbsc/tests/gtphub/Makefile.am b/openbsc/tests/gtphub/Makefile.am index 5c834b7..f2a6b88 100644 --- a/openbsc/tests/gtphub/Makefile.am +++ b/openbsc/tests/gtphub/Makefile.am @@ -8,6 +8,7 @@ -ggdb3 \ $(LIBOSMOCORE_CFLAGS) \ $(LIBOSMOABIS_CFLAGS) \ + $(LIBOSMOGSM_CFLAGS) \ $(LIBGTP_CFLAGS) \ $(NULL) @@ -37,6 +38,7 @@ $(top_builddir)/src/gprs/gtphub.o \ $(top_builddir)/src/gprs/gprs_utils.o \ $(LIBOSMOCORE_LIBS) \ + $(LIBOSMOGSM_LIBS) \ $(LIBGTP_LIBS) \ -lrt \ $(NULL) -- To view, visit https://gerrit.osmocom.org/3504 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I7315ffcbed8a54cca2056f313bb7783ad82d0ee9 Gerrit-PatchSet: 4 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Mon Aug 14 13:18:02 2017 From: gerrit-no-reply at lists.osmocom.org (Keith Whyte) Date: Mon, 14 Aug 2017 13:18:02 +0000 Subject: [PATCH] openbsc[master]: LIBMSC: gsm_04_11.c Message-ID: Review at https://gerrit.osmocom.org/3516 LIBMSC: gsm_04_11.c gsm340_gen_sms_status_report_tpdu() When we construct the status report PDU, use sms->src instead of sms->dst as the destination address This way we tell the MS that the message was delivered to the destination and not to itself. This is relevant for phones that display a textual representation of the delivery report. Change-Id: I2d4f87ac777465de9bfb5a775a789a2691755ee9 --- M openbsc/src/libmsc/gsm_04_11.c 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/16/3516/1 diff --git a/openbsc/src/libmsc/gsm_04_11.c b/openbsc/src/libmsc/gsm_04_11.c index 8b4ffce..d56a97c 100644 --- a/openbsc/src/libmsc/gsm_04_11.c +++ b/openbsc/src/libmsc/gsm_04_11.c @@ -301,7 +301,7 @@ *smsp = sms->msg_ref; /* generate recipient address */ - oa_len = gsm340_gen_oa_sub(oa, sizeof(oa), &sms->dst); + oa_len = gsm340_gen_oa_sub(oa, sizeof(oa), &sms->src); if (oa_len < 0) return -ENOSPC; -- To view, visit https://gerrit.osmocom.org/3516 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I2d4f87ac777465de9bfb5a775a789a2691755ee9 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Keith Whyte From gerrit-no-reply at lists.osmocom.org Mon Aug 14 13:18:05 2017 From: gerrit-no-reply at lists.osmocom.org (Keith Whyte) Date: Mon, 14 Aug 2017 13:18:05 +0000 Subject: [PATCH] openbsc[master]: LIBMSC: gsm_04_11.c Message-ID: Review at https://gerrit.osmocom.org/3517 LIBMSC: gsm_04_11.c sms_report_alloc() Use the sms->text, not the sms->user_data to construct the report body. This also prevents the potential output of non printable characters to the log and or vty. Change-Id: Id51bc9483ad6f52d6da74135605cfd12434c7c96 --- M openbsc/src/libmsc/gsm_04_11.c 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/17/3517/1 diff --git a/openbsc/src/libmsc/gsm_04_11.c b/openbsc/src/libmsc/gsm_04_11.c index d56a97c..5e736b3 100644 --- a/openbsc/src/libmsc/gsm_04_11.c +++ b/openbsc/src/libmsc/gsm_04_11.c @@ -666,7 +666,7 @@ len = snprintf((char *)sms_report->user_data, sizeof(sms_report->user_data), "id:%.08llu sub:000 dlvrd:000 submit date:YYMMDDhhmm done date:YYMMDDhhmm stat:DELIVRD err:000 text:%.20s", - sms->id, sms->user_data); + sms->id, sms->text); sms_report->user_data_len = len; LOGP(DLSMS, LOGL_NOTICE, "%s\n", sms_report->user_data); -- To view, visit https://gerrit.osmocom.org/3517 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Id51bc9483ad6f52d6da74135605cfd12434c7c96 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Keith Whyte From gerrit-no-reply at lists.osmocom.org Mon Aug 14 13:22:38 2017 From: gerrit-no-reply at lists.osmocom.org (Keith Whyte) Date: Mon, 14 Aug 2017 13:22:38 +0000 Subject: [PATCH] openbsc[master]: LIBMSC: Use sms->text, not sms->user_data to construct repor... In-Reply-To: References: Message-ID: LIBMSC: Use sms->text, not sms->user_data to construct report body gsm_04_11.c sms_report_alloc() Use the sms->text, not the sms->user_data to construct the report body. This also prevents the potential output of non printable characters to the log and or vty. Change-Id: Id51bc9483ad6f52d6da74135605cfd12434c7c96 --- M openbsc/src/libmsc/gsm_04_11.c 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/17/3517/2 diff --git a/openbsc/src/libmsc/gsm_04_11.c b/openbsc/src/libmsc/gsm_04_11.c index d56a97c..5e736b3 100644 --- a/openbsc/src/libmsc/gsm_04_11.c +++ b/openbsc/src/libmsc/gsm_04_11.c @@ -666,7 +666,7 @@ len = snprintf((char *)sms_report->user_data, sizeof(sms_report->user_data), "id:%.08llu sub:000 dlvrd:000 submit date:YYMMDDhhmm done date:YYMMDDhhmm stat:DELIVRD err:000 text:%.20s", - sms->id, sms->user_data); + sms->id, sms->text); sms_report->user_data_len = len; LOGP(DLSMS, LOGL_NOTICE, "%s\n", sms_report->user_data); -- To view, visit https://gerrit.osmocom.org/3517 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Id51bc9483ad6f52d6da74135605cfd12434c7c96 Gerrit-PatchSet: 2 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Keith Whyte From gerrit-no-reply at lists.osmocom.org Mon Aug 14 13:28:30 2017 From: gerrit-no-reply at lists.osmocom.org (Keith Whyte) Date: Mon, 14 Aug 2017 13:28:30 +0000 Subject: [PATCH] openbsc[master]: LIBMSC: Place correct dst address in status report In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3516 to look at the new patch set (#2). LIBMSC: Place correct dst address in status report gsm_04_11.c: gsm340_gen_sms_status_report_tpdu() When we construct the status report PDU, use sms->src instead of sms->dst as the destination address This way we tell the MS that the message was delivered to the destination and not to itself. This is relevant for phones that display a textual representation of the delivery report. Change-Id: I2d4f87ac777465de9bfb5a775a789a2691755ee9 --- M openbsc/src/libmsc/gsm_04_11.c 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/16/3516/2 diff --git a/openbsc/src/libmsc/gsm_04_11.c b/openbsc/src/libmsc/gsm_04_11.c index 8b4ffce..d56a97c 100644 --- a/openbsc/src/libmsc/gsm_04_11.c +++ b/openbsc/src/libmsc/gsm_04_11.c @@ -301,7 +301,7 @@ *smsp = sms->msg_ref; /* generate recipient address */ - oa_len = gsm340_gen_oa_sub(oa, sizeof(oa), &sms->dst); + oa_len = gsm340_gen_oa_sub(oa, sizeof(oa), &sms->src); if (oa_len < 0) return -ENOSPC; -- To view, visit https://gerrit.osmocom.org/3516 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I2d4f87ac777465de9bfb5a775a789a2691755ee9 Gerrit-PatchSet: 2 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Keith Whyte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Mon Aug 14 13:28:30 2017 From: gerrit-no-reply at lists.osmocom.org (Keith Whyte) Date: Mon, 14 Aug 2017 13:28:30 +0000 Subject: [PATCH] openbsc[master]: LIBMSC: Use sms->text, not sms->user_data to construct repor... In-Reply-To: References: Message-ID: LIBMSC: Use sms->text, not sms->user_data to construct report body gsm_04_11.c sms_report_alloc() Use the sms->text, not the sms->user_data to construct the report body. This also prevents the potential output of non printable characters to the log and or vty. Change-Id: Id51bc9483ad6f52d6da74135605cfd12434c7c96 --- M openbsc/src/libmsc/gsm_04_11.c 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/17/3517/3 diff --git a/openbsc/src/libmsc/gsm_04_11.c b/openbsc/src/libmsc/gsm_04_11.c index d56a97c..5e736b3 100644 --- a/openbsc/src/libmsc/gsm_04_11.c +++ b/openbsc/src/libmsc/gsm_04_11.c @@ -666,7 +666,7 @@ len = snprintf((char *)sms_report->user_data, sizeof(sms_report->user_data), "id:%.08llu sub:000 dlvrd:000 submit date:YYMMDDhhmm done date:YYMMDDhhmm stat:DELIVRD err:000 text:%.20s", - sms->id, sms->user_data); + sms->id, sms->text); sms_report->user_data_len = len; LOGP(DLSMS, LOGL_NOTICE, "%s\n", sms_report->user_data); -- To view, visit https://gerrit.osmocom.org/3517 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Id51bc9483ad6f52d6da74135605cfd12434c7c96 Gerrit-PatchSet: 3 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Keith Whyte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pablo Neira Ayuso From gerrit-no-reply at lists.osmocom.org Mon Aug 14 14:54:25 2017 From: gerrit-no-reply at lists.osmocom.org (Pablo Neira Ayuso) Date: Mon, 14 Aug 2017 14:54:25 +0000 Subject: openbsc[master]: LIBMSC: Place correct dst address in status report In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+1 Thanks for fixing up this! -- To view, visit https://gerrit.osmocom.org/3516 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I2d4f87ac777465de9bfb5a775a789a2691755ee9 Gerrit-PatchSet: 2 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Keith Whyte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pablo Neira Ayuso Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Aug 14 14:57:22 2017 From: gerrit-no-reply at lists.osmocom.org (Pablo Neira Ayuso) Date: Mon, 14 Aug 2017 14:57:22 +0000 Subject: openbsc[master]: LIBMSC: Use sms->text, not sms->user_data to construct repor... In-Reply-To: References: Message-ID: Patch Set 3: Code-Review+1 LGTM. Thanks for fixing up this issue too. -- To view, visit https://gerrit.osmocom.org/3517 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Id51bc9483ad6f52d6da74135605cfd12434c7c96 Gerrit-PatchSet: 3 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Keith Whyte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pablo Neira Ayuso Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Aug 14 15:18:24 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 14 Aug 2017 15:18:24 +0000 Subject: [MERGED] osmo-pcu[master]: Move DL assignment to TBF-DL In-Reply-To: References: Message-ID: Max has submitted this change and it was merged. Change subject: Move DL assignment to TBF-DL ...................................................................... Move DL assignment to TBF-DL This function does not really belongs to BTS and it heavily relies on direct access to TBF-DL members anyway. Change-Id: I04584103018675a2f35cfb565473bfd81a208d7c Closes: OS#1540 --- M src/bts.cpp M src/bts.h M src/tbf.cpp M src/tbf.h M src/tbf_dl.cpp 5 files changed, 38 insertions(+), 39 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/bts.cpp b/src/bts.cpp index a89e881..0f67536 100644 --- a/src/bts.cpp +++ b/src/bts.cpp @@ -788,40 +788,6 @@ return sb; } -/* depending on the current TBF, we assign on PACCH or AGCH */ -void BTS::trigger_dl_ass( - struct gprs_rlcmac_dl_tbf *dl_tbf, - struct gprs_rlcmac_tbf *old_tbf) -{ - /* stop pending timer */ - dl_tbf->stop_timer(); - - /* check for downlink tbf: */ - if (old_tbf) { - LOGP(DRLCMAC, LOGL_DEBUG, "Send dowlink assignment on " - "PACCH, because %s exists\n", tbf_name(old_tbf)); - old_tbf->dl_ass_state = GPRS_RLCMAC_DL_ASS_SEND_ASS; - - old_tbf->was_releasing = old_tbf->state_is(GPRS_RLCMAC_WAIT_RELEASE); - - /* change state */ - dl_tbf->set_state(GPRS_RLCMAC_ASSIGN); - if (!(dl_tbf->state_flags & (1 << GPRS_RLCMAC_FLAG_CCCH))) - dl_tbf->state_flags |= (1 << GPRS_RLCMAC_FLAG_PACCH); - /* start timer */ - tbf_timer_start(dl_tbf, 0, Tassign_pacch); - } else { - LOGP(DRLCMAC, LOGL_DEBUG, "Send dowlink assignment for %s on PCH, no TBF exist (IMSI=%s)\n", tbf_name(dl_tbf), dl_tbf->imsi()); - dl_tbf->was_releasing = dl_tbf->state_is(GPRS_RLCMAC_WAIT_RELEASE); - /* change state */ - dl_tbf->set_state(GPRS_RLCMAC_ASSIGN); - dl_tbf->state_flags |= (1 << GPRS_RLCMAC_FLAG_CCCH); - /* send immediate assignment */ - dl_tbf->bts->snd_dl_ass(dl_tbf, 0, dl_tbf->imsi()); - dl_tbf->m_wait_confirm = 1; - } -} - void BTS::snd_dl_ass(gprs_rlcmac_tbf *tbf, uint8_t poll, const char *imsi) { int plen; diff --git a/src/bts.h b/src/bts.h index cff0020..1f1dae2 100644 --- a/src/bts.h +++ b/src/bts.h @@ -373,7 +373,6 @@ int rcv_rach(uint16_t ra, uint32_t Fn, int16_t qta, uint8_t is_11bit, enum ph_burst_type burst_type); - void trigger_dl_ass(gprs_rlcmac_dl_tbf *tbf, gprs_rlcmac_tbf *old_tbf); void snd_dl_ass(gprs_rlcmac_tbf *tbf, uint8_t poll, const char *imsi); GprsMsStorage &ms_store(); @@ -501,7 +500,6 @@ /* list of downlink TBFs */ LListHead m_dl_tbfs; -private: /* disable copying to avoid slicing */ BTS(const BTS&); BTS& operator=(const BTS&); diff --git a/src/tbf.cpp b/src/tbf.cpp index 1ac33d7..5b28d9b 100644 --- a/src/tbf.cpp +++ b/src/tbf.cpp @@ -1011,7 +1011,7 @@ dl_tbf->update(); - dl_tbf->bts->trigger_dl_ass(dl_tbf, dl_tbf); + dl_tbf->trigger_ass(dl_tbf); } else LOGP(DRLCMAC, LOGL_NOTICE, "%s Continue flow after " "IMM.ASS confirm\n", tbf_name(dl_tbf)); @@ -1299,7 +1299,7 @@ LOGP(DRLCMAC, LOGL_DEBUG, "%s Trigger downlink assignment on PACCH\n", tbf_name(this)); - bts->trigger_dl_ass(new_tbf, this); + new_tbf->trigger_ass(this); return 0; } diff --git a/src/tbf.h b/src/tbf.h index ecdf5f8..9cc70e6 100644 --- a/src/tbf.h +++ b/src/tbf.h @@ -424,6 +424,7 @@ int rcvd_dl_ack(uint8_t final, uint8_t ssn, uint8_t *rbb); int rcvd_dl_ack(uint8_t final_ack, unsigned first_bsn, struct bitvec *rbb); struct msgb *create_dl_acked_block(uint32_t fn, uint8_t ts); + void trigger_ass(struct gprs_rlcmac_tbf *old_tbf); void clear_poll_timeout_flag(); bool handle_ack_nack(); void request_dl_ack(); diff --git a/src/tbf_dl.cpp b/src/tbf_dl.cpp index 505d488..8ce13a7 100644 --- a/src/tbf_dl.cpp +++ b/src/tbf_dl.cpp @@ -165,7 +165,7 @@ * we don't use old_downlink, so the possible uplink is used * to trigger downlink assignment. if there is no uplink, * AGCH is used. */ - dl_tbf->bts->trigger_dl_ass(dl_tbf, old_ul_tbf); + dl_tbf->trigger_ass(old_ul_tbf); *tbf = dl_tbf; return 0; } @@ -484,6 +484,40 @@ return create_dl_acked_block(fn, ts, bsn, bsn2); } +/* depending on the current TBF, we assign on PACCH or AGCH */ +void gprs_rlcmac_dl_tbf::trigger_ass(struct gprs_rlcmac_tbf *old_tbf) +{ + /* stop pending timer */ + stop_timer(); + + /* check for downlink tbf: */ + if (old_tbf) { + LOGP(DRLCMACDL, LOGL_DEBUG, "Send dowlink assignment on PACCH, because %s exists\n", tbf_name(old_tbf)); + old_tbf->dl_ass_state = GPRS_RLCMAC_DL_ASS_SEND_ASS; + old_tbf->was_releasing = old_tbf->state_is(GPRS_RLCMAC_WAIT_RELEASE); + + /* change state */ + set_state(GPRS_RLCMAC_ASSIGN); + if (!(state_flags & (1 << GPRS_RLCMAC_FLAG_CCCH))) + state_flags |= (1 << GPRS_RLCMAC_FLAG_PACCH); + + /* start timer */ + tbf_timer_start(this, 0, Tassign_pacch); + } else { + LOGP(DRLCMACDL, LOGL_DEBUG, "Send dowlink assignment for %s on PCH, no TBF exist (IMSI=%s)\n", + tbf_name(this), imsi()); + was_releasing = state_is(GPRS_RLCMAC_WAIT_RELEASE); + + /* change state */ + set_state(GPRS_RLCMAC_ASSIGN); + state_flags |= (1 << GPRS_RLCMAC_FLAG_CCCH); + + /* send immediate assignment */ + bts->snd_dl_ass(this, 0, imsi()); + m_wait_confirm = 1; + } +} + void gprs_rlcmac_dl_tbf::schedule_next_frame() { struct msgb *msg; -- To view, visit https://gerrit.osmocom.org/3157 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I04584103018675a2f35cfb565473bfd81a208d7c Gerrit-PatchSet: 4 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max From gerrit-no-reply at lists.osmocom.org Mon Aug 14 15:18:25 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 14 Aug 2017 15:18:25 +0000 Subject: [MERGED] osmo-pcu[master]: Move common code into functions In-Reply-To: References: Message-ID: Max has submitted this change and it was merged. Change subject: Move common code into functions ...................................................................... Move common code into functions * separate channel request responder into inline function * move generic TBF poll check into inline function Change-Id: I9ec3ab8de100f0bc75044f55ac769d1083d52806 Related: OS#1539 --- M src/bts.cpp 1 file changed, 36 insertions(+), 57 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/bts.cpp b/src/bts.cpp index e00bd76..a89e881 100644 --- a/src/bts.cpp +++ b/src/bts.cpp @@ -380,39 +380,37 @@ gsmtap_send(m_bts.gsmtap, arfcn, ts_no, channel, 0, fn, 0, 0, data, len); } +static inline bool tbf_check(gprs_rlcmac_tbf *tbf, uint32_t fn, uint8_t trx_no, uint8_t ts) +{ + if (tbf->state_is_not(GPRS_RLCMAC_RELEASING) && tbf->poll_state == GPRS_RLCMAC_POLL_SCHED + && tbf->poll_fn == fn && tbf->trx->trx_no == trx_no && tbf->poll_ts == ts) + return true; + + return false; +} + gprs_rlcmac_dl_tbf *BTS::dl_tbf_by_poll_fn(uint32_t fn, uint8_t trx, uint8_t ts) { - struct gprs_rlcmac_dl_tbf *tbf; LListHead *pos; /* only one TBF can poll on specific TS/FN, because scheduler can only * schedule one downlink control block (with polling) at a FN per TS */ llist_for_each(pos, &m_dl_tbfs) { - tbf = as_dl_tbf(pos->entry()); - if (tbf->state_is_not(GPRS_RLCMAC_RELEASING) - && tbf->poll_state == GPRS_RLCMAC_POLL_SCHED - && tbf->poll_fn == fn && tbf->trx->trx_no == trx - && tbf->poll_ts == ts) { - return tbf; - } + if (tbf_check(pos->entry(), fn, trx, ts)) + return as_dl_tbf(pos->entry()); } return NULL; } + gprs_rlcmac_ul_tbf *BTS::ul_tbf_by_poll_fn(uint32_t fn, uint8_t trx, uint8_t ts) { - struct gprs_rlcmac_ul_tbf *tbf; LListHead *pos; /* only one TBF can poll on specific TS/FN, because scheduler can only * schedule one downlink control block (with polling) at a FN per TS */ llist_for_each(pos, &m_ul_tbfs) { - tbf = as_ul_tbf(pos->entry()); - if (tbf->state_is_not(GPRS_RLCMAC_RELEASING) - && tbf->poll_state == GPRS_RLCMAC_POLL_SCHED - && tbf->poll_fn == fn && tbf->trx->trx_no == trx - && tbf->poll_ts == ts) { - return tbf; - } + if (tbf_check(pos->entry(), fn, trx, ts)) + return as_ul_tbf(pos->entry()); } return NULL; } @@ -1167,6 +1165,24 @@ } } +static inline void sched_ul_ass_or_rej(BTS *bts, gprs_rlcmac_bts *bts_data, struct gprs_rlcmac_dl_tbf *tbf) +{ + bts->channel_request_description(); + + /* This call will register the new TBF with the MS on success */ + gprs_rlcmac_ul_tbf *ul_tbf = tbf_alloc_ul(bts_data, tbf->trx->trx_no, tbf->ms_class(), + tbf->ms()->egprs_ms_class(), tbf->tlli(), tbf->ta(), tbf->ms()); + + /* schedule uplink assignment or reject */ + if (ul_tbf) { + LOGP(DRLCMAC, LOGL_DEBUG, "MS requests UL TBF in ack message, so we provide one:\n"); + tbf->ul_ass_state = GPRS_RLCMAC_UL_ASS_SEND_ASS; + } else { + LOGP(DRLCMAC, LOGL_DEBUG, "MS requests UL TBF in ack message, so we packet access reject:\n"); + tbf->ul_ass_state = GPRS_RLCMAC_UL_ASS_SEND_ASS_REJ; + } +} + void gprs_rlcmac_pdch::rcv_control_dl_ack_nack(Packet_Downlink_Ack_Nack_t *ack_nack, uint32_t fn) { int8_t tfi = 0; /* must be signed */ @@ -1221,27 +1237,9 @@ return; } /* check for channel request */ - if (ack_nack->Exist_Channel_Request_Description) { + if (ack_nack->Exist_Channel_Request_Description) + sched_ul_ass_or_rej(bts(), bts_data(), tbf); - bts()->channel_request_description(); - - /* This call will register the new TBF with the MS on success */ - gprs_rlcmac_ul_tbf *ul_tbf = tbf_alloc_ul(bts_data(), - tbf->trx->trx_no, - tbf->ms_class(), tbf->ms()->egprs_ms_class(), - tbf->tlli(), tbf->ta(), tbf->ms()); - - /* schedule uplink assignment or reject*/ - if (ul_tbf) { - LOGP(DRLCMAC, LOGL_DEBUG, "MS requests UL TBF in ack " - "message, so we provide one:\n"); - tbf->ul_ass_state = GPRS_RLCMAC_UL_ASS_SEND_ASS; - } else { - LOGP(DRLCMAC, LOGL_DEBUG, "MS requests UL TBF in ack " - "message, so we pacekt access reject:\n"); - tbf->ul_ass_state = GPRS_RLCMAC_UL_ASS_SEND_ASS_REJ; - } - } /* get measurements */ if (tbf->ms()) { get_meas(&meas, &ack_nack->Channel_Quality_Report); @@ -1326,27 +1324,8 @@ } /* check for channel request */ - if (ack_nack->Exist_ChannelRequestDescription) { - - bts()->channel_request_description(); - - /* This call will register the new TBF with the MS on success */ - gprs_rlcmac_ul_tbf *ul_tbf = tbf_alloc_ul(bts_data(), - tbf->trx->trx_no, - tbf->ms_class(), tbf->ms()->egprs_ms_class(), - tbf->tlli(), tbf->ta(), tbf->ms()); - - /* schedule uplink assignment or reject*/ - if (ul_tbf) { - LOGP(DRLCMAC, LOGL_DEBUG, "MS requests UL TBF in ack " - "message, so we provide one:\n"); - tbf->ul_ass_state = GPRS_RLCMAC_UL_ASS_SEND_ASS; - } else { - LOGP(DRLCMAC, LOGL_DEBUG, "MS requests UL TBF in ack " - "message, so we send packet access reject:\n"); - tbf->ul_ass_state = GPRS_RLCMAC_UL_ASS_SEND_ASS_REJ; - } - } + if (ack_nack->Exist_ChannelRequestDescription) + sched_ul_ass_or_rej(bts(), bts_data(), tbf); /* get measurements */ if (tbf->ms()) { -- To view, visit https://gerrit.osmocom.org/3156 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I9ec3ab8de100f0bc75044f55ac769d1083d52806 Gerrit-PatchSet: 5 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max From gerrit-no-reply at lists.osmocom.org Mon Aug 14 15:18:25 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 14 Aug 2017 15:18:25 +0000 Subject: [MERGED] osmo-pcu[master]: Encapsulate handling of UL ACK timeout In-Reply-To: References: Message-ID: Max has submitted this change and it was merged. Change subject: Encapsulate handling of UL ACK timeout ...................................................................... Encapsulate handling of UL ACK timeout Use helper methods instead checking and manipulating flag directly. Change-Id: Ia3f009c52118db95b38a077e08eecda844e7f8d1 Related: OS#1539 --- M src/bts.cpp M src/tbf.cpp M src/tbf.h M src/tbf_ul.cpp 4 files changed, 39 insertions(+), 21 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/bts.cpp b/src/bts.cpp index 2bafd63..e00bd76 100644 --- a/src/bts.cpp +++ b/src/bts.cpp @@ -998,6 +998,7 @@ struct gprs_rlcmac_tbf *tbf, *new_tbf; uint32_t tlli = packet->TLLI; GprsMs *ms = bts()->ms_by_tlli(tlli); + gprs_rlcmac_ul_tbf *ul_tbf; tbf = bts()->ul_tbf_by_poll_fn(fn, trx_no(), ts_no); if (!tbf) @@ -1024,16 +1025,12 @@ tbf->poll_state = GPRS_RLCMAC_POLL_NONE; /* check if this control ack belongs to packet uplink ack */ - if (tbf->ul_ack_state == GPRS_RLCMAC_UL_ACK_WAIT_ACK) { + ul_tbf = as_ul_tbf(tbf); + if (ul_tbf && ul_tbf->handle_ctrl_ack()) { LOGP(DRLCMAC, LOGL_DEBUG, "TBF: [UPLINK] END %s\n", tbf_name(tbf)); - tbf->ul_ack_state = GPRS_RLCMAC_UL_ACK_NONE; - if ((tbf->state_flags & - (1 << GPRS_RLCMAC_FLAG_TO_UL_ACK))) { - tbf->state_flags &= - ~(1 << GPRS_RLCMAC_FLAG_TO_UL_ACK); - LOGP(DRLCMAC, LOGL_NOTICE, "Recovered uplink " - "ack for UL %s\n", tbf_name(tbf)); - } + if (ul_tbf->ctrl_ack_to_toggle()) + LOGP(DRLCMAC, LOGL_NOTICE, "Recovered uplink ack for UL %s\n", tbf_name(tbf)); + tbf_free(tbf); return; } diff --git a/src/tbf.cpp b/src/tbf.cpp index bbed29c..1ac33d7 100644 --- a/src/tbf.cpp +++ b/src/tbf.cpp @@ -607,27 +607,25 @@ void gprs_rlcmac_tbf::poll_timeout() { + gprs_rlcmac_ul_tbf *ul_tbf = as_ul_tbf(this); + LOGP(DRLCMAC, LOGL_NOTICE, "%s poll timeout for FN=%d, TS=%d (curr FN %d)\n", tbf_name(this), poll_fn, poll_ts, bts->current_frame_number()); poll_state = GPRS_RLCMAC_POLL_NONE; - if (ul_ack_state == GPRS_RLCMAC_UL_ACK_WAIT_ACK) { - if (!(state_flags & (1 << GPRS_RLCMAC_FLAG_TO_UL_ACK))) { - LOGP(DRLCMAC, LOGL_NOTICE, "- Timeout for polling " - "PACKET CONTROL ACK for PACKET UPLINK ACK\n"); + if (ul_tbf && ul_tbf->handle_ctrl_ack()) { + if (!ul_tbf->ctrl_ack_to_toggle()) { + LOGP(DRLCMAC, LOGL_NOTICE, "- Timeout for polling PACKET CONTROL ACK for PACKET UPLINK ACK\n"); rlcmac_diag(); - state_flags |= (1 << GPRS_RLCMAC_FLAG_TO_UL_ACK); } - ul_ack_state = GPRS_RLCMAC_UL_ACK_NONE; bts->rlc_ack_timedout(); bts->pkt_ul_ack_nack_poll_timedout(); if (state_is(GPRS_RLCMAC_FINISHED)) { - gprs_rlcmac_ul_tbf *ul_tbf = as_ul_tbf(this); ul_tbf->m_n3103++; if (ul_tbf->m_n3103 == ul_tbf->bts->bts_data()->n3103) { LOGP(DRLCMAC, LOGL_NOTICE, - "- N3103 exceeded\n"); + "- N3103 exceeded\n"); bts->pkt_ul_ack_nack_poll_failed(); ul_tbf->set_state(GPRS_RLCMAC_RELEASING); tbf_timer_start(ul_tbf, 3169, ul_tbf->bts->bts_data()->t3169, 0); @@ -640,10 +638,10 @@ } else if (ul_ass_state == GPRS_RLCMAC_UL_ASS_WAIT_ACK) { if (!(state_flags & (1 << GPRS_RLCMAC_FLAG_TO_UL_ASS))) { LOGP(DRLCMAC, LOGL_NOTICE, "- Timeout for polling " - "PACKET CONTROL ACK for PACKET UPLINK " - "ASSIGNMENT.\n"); - rlcmac_diag(); - state_flags |= (1 << GPRS_RLCMAC_FLAG_TO_UL_ASS); + "PACKET CONTROL ACK for PACKET UPLINK " + "ASSIGNMENT.\n"); + rlcmac_diag(); + state_flags |= (1 << GPRS_RLCMAC_FLAG_TO_UL_ASS); } ul_ass_state = GPRS_RLCMAC_UL_ASS_NONE; n3105++; diff --git a/src/tbf.h b/src/tbf.h index 87aa7a5..ecdf5f8 100644 --- a/src/tbf.h +++ b/src/tbf.h @@ -503,6 +503,8 @@ gprs_rlcmac_ul_tbf(BTS *bts); struct msgb *create_ul_ack(uint32_t fn, uint8_t ts); + bool ctrl_ack_to_toggle(); + bool handle_ctrl_ack(); /* blocks were acked */ int rcv_data_block_acknowledged( diff --git a/src/tbf_ul.cpp b/src/tbf_ul.cpp index 1eee41a..1e0898a 100644 --- a/src/tbf_ul.cpp +++ b/src/tbf_ul.cpp @@ -95,6 +95,27 @@ return 0; } +bool gprs_rlcmac_ul_tbf::ctrl_ack_to_toggle() +{ + if ((state_flags & (1 << GPRS_RLCMAC_FLAG_TO_UL_ACK))) { + state_flags &= ~(1 << GPRS_RLCMAC_FLAG_TO_UL_ACK); + return true; /* GPRS_RLCMAC_FLAG_TO_UL_ACK was set, now cleared */ + } + + state_flags |= (1 << GPRS_RLCMAC_FLAG_TO_UL_ACK); + return false; /* GPRS_RLCMAC_FLAG_TO_UL_ACK was unset, now set */ +} + +bool gprs_rlcmac_ul_tbf::handle_ctrl_ack() +{ + /* check if this control ack belongs to packet uplink ack */ + if (ul_ack_state == GPRS_RLCMAC_UL_ACK_WAIT_ACK) { + ul_ack_state = GPRS_RLCMAC_UL_ACK_NONE; + return true; + } + + return false; +} struct msgb *gprs_rlcmac_ul_tbf::create_ul_ack(uint32_t fn, uint8_t ts) { -- To view, visit https://gerrit.osmocom.org/3155 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ia3f009c52118db95b38a077e08eecda844e7f8d1 Gerrit-PatchSet: 4 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max From gerrit-no-reply at lists.osmocom.org Mon Aug 14 15:26:17 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 14 Aug 2017 15:26:17 +0000 Subject: [MERGED] osmo-pcu[master]: Simplify polling troubleshooting In-Reply-To: References: Message-ID: Max has submitted this change and it was merged. Change subject: Simplify polling troubleshooting ...................................................................... Simplify polling troubleshooting * introduce enum describing poll kind and use it in set_polling() * move state change into set_polling() * move logging into set_polling() and unify output * move duplicated code into static function * adjust tests to match unified logging output Change-Id: I14074207f8bbc18b3ebd60875bb99a0a3a4b399d Related: OS#1524 --- M src/bts.cpp M src/tbf.cpp M src/tbf.h M src/tbf_dl.cpp M src/tbf_ul.cpp M tests/tbf/TbfTest.err 6 files changed, 100 insertions(+), 103 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/bts.cpp b/src/bts.cpp index 0f67536..add6ab3 100644 --- a/src/bts.cpp +++ b/src/bts.cpp @@ -1381,7 +1381,9 @@ } /* set control ts to current MS's TS, until assignment complete */ - LOGP(DRLCMAC, LOGL_DEBUG, "Change control TS to %d until assinment is complete.\n", ts_no); + LOGP(DRLCMAC, LOGL_DEBUG, "%s change control TS %d -> %d until assinment is complete.\n", + tbf_name(ul_tbf), ul_tbf->control_ts, ts_no); + ul_tbf->control_ts = ts_no; /* schedule uplink assignment */ ul_tbf->ul_ass_state = GPRS_RLCMAC_UL_ASS_SEND_ASS; diff --git a/src/tbf.cpp b/src/tbf.cpp index 5b28d9b..c5f4348 100644 --- a/src/tbf.cpp +++ b/src/tbf.cpp @@ -593,16 +593,50 @@ return 0; } -void gprs_rlcmac_tbf::set_polling(uint32_t new_poll_fn, uint8_t ts) +void gprs_rlcmac_tbf::set_polling(uint32_t new_poll_fn, uint8_t ts, enum gprs_rlcmac_tbf_poll_type t) { - LOGP(DRLCMAC, LOGL_DEBUG, - "%s: Scheduling polling at FN %d TS %d\n", - name(), new_poll_fn, ts); + const char *chan = "UNKNOWN"; + + if (state_flags & (1 << (GPRS_RLCMAC_FLAG_CCCH))) + chan = "CCCH"; + + if (state_flags & (1 << (GPRS_RLCMAC_FLAG_PACCH))) + chan = "PACCH"; + + if ((state_flags & (1 << (GPRS_RLCMAC_FLAG_PACCH))) && (state_flags & (1 << (GPRS_RLCMAC_FLAG_CCCH)))) + LOGP(DRLCMACDL, LOGL_ERROR, + "%s Attempt to schedule polling on %s (FN=%d, TS=%d) with both CCCH and PACCH flags set - FIXME!\n", + name(), chan, poll_fn, poll_ts); /* schedule polling */ poll_state = GPRS_RLCMAC_POLL_SCHED; poll_fn = new_poll_fn; poll_ts = ts; + + switch (t) { + case GPRS_RLCMAC_POLL_UL_ASS: + ul_ass_state = GPRS_RLCMAC_UL_ASS_WAIT_ACK; + + LOGP(DRLCMACDL, LOGL_INFO, "%s Scheduled UL Assignment polling on %s (FN=%d, TS=%d)\n", + name(), chan, poll_fn, poll_ts); + break; + case GPRS_RLCMAC_POLL_DL_ASS: + dl_ass_state = GPRS_RLCMAC_DL_ASS_WAIT_ACK; + + LOGP(DRLCMACDL, LOGL_INFO, "%s Scheduled DL Assignment polling on %s (FN=%d, TS=%d)\n", + name(), chan, poll_fn, poll_ts); + break; + case GPRS_RLCMAC_POLL_UL_ACK: + ul_ack_state = GPRS_RLCMAC_UL_ACK_WAIT_ACK; + + LOGP(DRLCMACUL, LOGL_DEBUG, "%s Scheduled UL Acknowledgement polling on %s (FN=%d, TS=%d)\n", + name(), chan, poll_fn, poll_ts); + break; + case GPRS_RLCMAC_POLL_DL_ACK: + LOGP(DRLCMACDL, LOGL_DEBUG, "%s Scheduled DL Acknowledgement polling on %s (FN=%d, TS=%d)\n", + name(), chan, poll_fn, poll_ts); + break; + } } void gprs_rlcmac_tbf::poll_timeout() @@ -1152,11 +1186,7 @@ talloc_free(mac_control_block); if (poll_ass_dl) { - set_polling(new_poll_fn, ts); - dl_ass_state = GPRS_RLCMAC_DL_ASS_WAIT_ACK; - LOGP(DRLCMACDL, LOGL_INFO, - "%s Scheduled DL Assignment polling on FN=%d, TS=%d\n", - name(), poll_fn, poll_ts); + set_polling(new_poll_fn, ts, GPRS_RLCMAC_POLL_DL_ASS); } else { dl_ass_state = GPRS_RLCMAC_DL_ASS_NONE; new_dl_tbf->set_state(GPRS_RLCMAC_FLOW); @@ -1253,11 +1283,7 @@ bitvec_free(ass_vec); talloc_free(mac_control_block); - set_polling(new_poll_fn, ts); - ul_ass_state = GPRS_RLCMAC_UL_ASS_WAIT_ACK; - LOGP(DRLCMACDL, LOGL_INFO, - "%s Scheduled UL Assignment polling on FN=%d, TS=%d\n", - name(), poll_fn, poll_ts); + set_polling(new_poll_fn, ts, GPRS_RLCMAC_POLL_UL_ASS); return msg; } diff --git a/src/tbf.h b/src/tbf.h index 9cc70e6..95e1e89 100644 --- a/src/tbf.h +++ b/src/tbf.h @@ -54,6 +54,13 @@ GPRS_RLCMAC_RELEASING, /* releasing, wait to free TBI/USF */ }; +enum gprs_rlcmac_tbf_poll_type { + GPRS_RLCMAC_POLL_UL_ASS, + GPRS_RLCMAC_POLL_DL_ASS, + GPRS_RLCMAC_POLL_UL_ACK, + GPRS_RLCMAC_POLL_DL_ACK, +}; + enum gprs_rlcmac_tbf_poll_state { GPRS_RLCMAC_POLL_NONE = 0, GPRS_RLCMAC_POLL_SCHED, /* a polling was scheduled */ @@ -173,7 +180,7 @@ int check_polling(uint32_t fn, uint8_t ts, uint32_t *poll_fn, unsigned int *rrbp); - void set_polling(uint32_t poll_fn, uint8_t ts); + void set_polling(uint32_t poll_fn, uint8_t ts, enum gprs_rlcmac_tbf_poll_type t); void poll_timeout(); /** tlli handling */ diff --git a/src/tbf_dl.cpp b/src/tbf_dl.cpp index 8ce13a7..b350720 100644 --- a/src/tbf_dl.cpp +++ b/src/tbf_dl.cpp @@ -853,10 +853,8 @@ rc = check_polling(fn, ts, &new_poll_fn, &rrbp); if (rc >= 0) { - set_polling(new_poll_fn, ts); + set_polling(new_poll_fn, ts, GPRS_RLCMAC_POLL_DL_ACK); - LOGP(DRLCMACDL, LOGL_DEBUG, "Polling scheduled in this " - "TS %d\n", ts); m_tx_counter = 0; /* start timer whenever we send the final block */ if (is_final) diff --git a/src/tbf_ul.cpp b/src/tbf_ul.cpp index 1e0898a..81d3b24 100644 --- a/src/tbf_ul.cpp +++ b/src/tbf_ul.cpp @@ -158,9 +158,8 @@ m_contention_resolution_done = 1; if (final) { - set_polling(new_poll_fn, ts); + set_polling(new_poll_fn, ts, GPRS_RLCMAC_POLL_UL_ACK); /* waiting for final acknowledge */ - ul_ack_state = GPRS_RLCMAC_UL_ACK_WAIT_ACK; m_final_ack_sent = 1; } else ul_ack_state = GPRS_RLCMAC_UL_ACK_NONE; diff --git a/tests/tbf/TbfTest.err b/tests/tbf/TbfTest.err index 2002379..5f1e00d 100644 --- a/tests/tbf/TbfTest.err +++ b/tests/tbf/TbfTest.err @@ -63,8 +63,7 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) start Packet Downlink Assignment (PACCH) +++++++++++++++++++++++++ TX : Packet Downlink Assignment +++++++++++++++++++++++++ ------------------------- TX : Packet Downlink Assignment ------------------------- -TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW): Scheduling polling at FN 13 TS 4 -TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) Scheduled DL Assignment polling on FN=13, TS=4 +TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) Scheduled DL Assignment polling on UNKNOWN (FN=13, TS=4) Scheduling control message at RTS for TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) (TRX=0, TS=4) Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=0 block=0 data=4f 08 20 00 44 02 00 02 08 04 00 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b Scheduling data message at RTS for DL TFI=0 (TRX=0, TS=4) prio=3 @@ -151,8 +150,7 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) start Packet Downlink Assignment (PACCH) +++++++++++++++++++++++++ TX : Packet Downlink Assignment +++++++++++++++++++++++++ ------------------------- TX : Packet Downlink Assignment ------------------------- -TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW): Scheduling polling at FN 13 TS 4 -TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) Scheduled DL Assignment polling on FN=13, TS=4 +TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) Scheduled DL Assignment polling on UNKNOWN (FN=13, TS=4) Scheduling control message at RTS for TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) (TRX=0, TS=4) Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=0 block=0 data=4f 08 20 00 44 02 00 02 08 04 00 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b Scheduling data message at RTS for DL TFI=0 (TRX=0, TS=4) prio=3 @@ -239,8 +237,7 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) start Packet Downlink Assignment (PACCH) +++++++++++++++++++++++++ TX : Packet Downlink Assignment +++++++++++++++++++++++++ ------------------------- TX : Packet Downlink Assignment ------------------------- -TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW): Scheduling polling at FN 13 TS 4 -TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) Scheduled DL Assignment polling on FN=13, TS=4 +TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) Scheduled DL Assignment polling on UNKNOWN (FN=13, TS=4) Scheduling control message at RTS for TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) (TRX=0, TS=4) Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=0 block=0 data=4f 08 20 00 44 02 00 02 08 04 00 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b Scheduling data message at RTS for DL TFI=0 (TRX=0, TS=4) prio=3 @@ -1617,12 +1614,11 @@ TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=ASSIGN) starting timer 3169. Modifying MS object, UL TLLI: 0x00000000 -> 0xf1223344, not yet confirmed Modifying MS object, TLLI = 0xf1223344, TA 220 -> 7 -Change control TS to 7 until assinment is complete. +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN) change control TS 7 -> 7 until assinment is complete. TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN)s start Packet Uplink Assignment (PACCH) +++++++++++++++++++++++++ TX : Packet Uplink Assignment +++++++++++++++++++++++++ ------------------------- TX : Packet Uplink Assignment ------------------------- -TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN): Scheduling polling at FN 2654283 TS 7 -TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN) Scheduled UL Assignment polling on FN=2654283, TS=7 +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN) Scheduled UL Assignment polling on PACCH (FN=2654283, TS=7) Scheduling control message at RTS for TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN) (TRX=0, TS=7) Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654270 block=8 data=4f 28 5e 24 46 68 8f 1d 00 00 88 00 08 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b Got RLC block, coding scheme: CS-1, length: 23 (23)) @@ -1702,12 +1698,11 @@ TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=ASSIGN) starting timer 3169. Modifying MS object, UL TLLI: 0x00000000 -> 0xf1223344, not yet confirmed Modifying MS object, TLLI = 0xf1223344, TA 220 -> 7 -Change control TS to 7 until assinment is complete. +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN) change control TS 7 -> 7 until assinment is complete. TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN)s start Packet Uplink Assignment (PACCH) +++++++++++++++++++++++++ TX : Packet Uplink Assignment +++++++++++++++++++++++++ ------------------------- TX : Packet Uplink Assignment ------------------------- -TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN): Scheduling polling at FN 2654283 TS 7 -TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN) Scheduled UL Assignment polling on FN=2654283, TS=7 +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN) Scheduled UL Assignment polling on PACCH (FN=2654283, TS=7) Scheduling control message at RTS for TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN) (TRX=0, TS=7) Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654270 block=8 data=4f 28 5e 24 46 68 8f 1d 00 00 88 00 08 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b Got RLC block, coding scheme: CS-1, length: 23 (23)) @@ -1757,8 +1752,7 @@ TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=ASSIGN) start Packet Downlink Assignment (PACCH) +++++++++++++++++++++++++ TX : Packet Downlink Assignment +++++++++++++++++++++++++ ------------------------- TX : Packet Downlink Assignment ------------------------- -TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW): Scheduling polling at FN 2654288 TS 7 -TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW) Scheduled DL Assignment polling on FN=2654288, TS=7 +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW) Scheduled DL Assignment polling on PACCH (FN=2654288, TS=7) Scheduling control message at RTS for TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW) (TRX=0, TS=7) Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654275 block=9 data=48 08 00 00 0c 72 00 02 08 00 80 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b Got RLC block, coding scheme: CS-1, length: 23 (23)) @@ -1788,8 +1782,7 @@ - need_padding 0 spb_status 0 spb 0(BSN1 0 BSN2 -1) - Copying data unit 0 (BSN 0) - Scheduling Ack/Nack polling, because is was requested explicitly (e.g. first final block sent). -TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=FINISHED): Scheduling polling at FN 2654292 TS 7 -Polling scheduled in this TS 7 +TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=FINISHED) Scheduled DL Acknowledgement polling on PACCH (FN=2654292, TS=7) TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=FINISHED) starting timer 3191. TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=FINISHED) Scheduled Ack/Nack polling on FN=2654292, TS=7 msg block (BSN 0, CS-4): 0f 01 00 29 52 41 55 5f 41 43 43 45 50 54 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 00 @@ -1840,13 +1833,12 @@ TBF(TFI=1 TLLI=0x00000000 DIR=UL STATE=ASSIGN) starting timer 3169. Modifying MS object, UL TLLI: 0x00000000 -> 0xf5667788, not yet confirmed Modifying MS object, TLLI = 0xf5667788, TA 220 -> 7 -Change control TS to 7 until assinment is complete. +TBF(TFI=1 TLLI=0xf5667788 DIR=UL STATE=ASSIGN) change control TS 7 -> 7 until assinment is complete. Received RTS for PDCH: TRX=0 TS=7 FN=2654335 block_nr=11 scheduling USF=0 for required uplink resource of UL TFI=0 TBF(TFI=1 TLLI=0xf5667788 DIR=UL STATE=ASSIGN)s start Packet Uplink Assignment (PACCH) +++++++++++++++++++++++++ TX : Packet Uplink Assignment +++++++++++++++++++++++++ ------------------------- TX : Packet Uplink Assignment ------------------------- -TBF(TFI=1 TLLI=0xf5667788 DIR=UL STATE=ASSIGN): Scheduling polling at FN 2654348 TS 7 -TBF(TFI=1 TLLI=0xf5667788 DIR=UL STATE=ASSIGN) Scheduled UL Assignment polling on FN=2654348, TS=7 +TBF(TFI=1 TLLI=0xf5667788 DIR=UL STATE=ASSIGN) Scheduled UL Assignment polling on PACCH (FN=2654348, TS=7) Scheduling control message at RTS for TBF(TFI=1 TLLI=0xf5667788 DIR=UL STATE=ASSIGN) (TRX=0, TS=7) Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654335 block=11 data=48 28 5e ac ce f1 0f 1d 00 00 88 40 09 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b Got RLC block, coding scheme: CS-1, length: 23 (23)) @@ -1912,12 +1904,11 @@ TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=ASSIGN) starting timer 3169. Modifying MS object, UL TLLI: 0x00000000 -> 0xf1223344, not yet confirmed Modifying MS object, TLLI = 0xf1223344, TA 220 -> 7 -Change control TS to 7 until assinment is complete. +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN) change control TS 7 -> 7 until assinment is complete. TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN)s start Packet Uplink Assignment (PACCH) +++++++++++++++++++++++++ TX : Packet Uplink Assignment +++++++++++++++++++++++++ ------------------------- TX : Packet Uplink Assignment ------------------------- -TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN): Scheduling polling at FN 2654283 TS 7 -TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN) Scheduled UL Assignment polling on FN=2654283, TS=7 +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN) Scheduled UL Assignment polling on PACCH (FN=2654283, TS=7) Scheduling control message at RTS for TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN) (TRX=0, TS=7) Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654270 block=8 data=4f 28 5e 24 46 68 83 1d 00 00 88 00 08 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b Got RLC block, coding scheme: CS-1, length: 23 (23)) @@ -2008,12 +1999,11 @@ Allocated TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=NULL): trx = 0, ul_slots = 80, dl_slots = 00 TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=NULL) changes state from NULL to ASSIGN TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN) starting timer 3169. -Change control TS to 7 until assinment is complete. +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN) change control TS 7 -> 7 until assinment is complete. TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN)s start Packet Uplink Assignment (PACCH) +++++++++++++++++++++++++ TX : Packet Uplink Assignment +++++++++++++++++++++++++ ------------------------- TX : Packet Uplink Assignment ------------------------- -TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN): Scheduling polling at FN 2654340 TS 7 -TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN) Scheduled UL Assignment polling on FN=2654340, TS=7 +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN) Scheduled UL Assignment polling on PACCH (FN=2654340, TS=7) Scheduling control message at RTS for TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN) (TRX=0, TS=7) Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654327 block=9 data=4f 28 5e 24 46 68 83 1d 00 00 88 00 08 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b Got RLC block, coding scheme: CS-1, length: 23 (23)) @@ -2089,12 +2079,11 @@ TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=ASSIGN) starting timer 3169. Modifying MS object, UL TLLI: 0x00000000 -> 0xf1223344, not yet confirmed Modifying MS object, TLLI = 0xf1223344, TA 220 -> 7 -Change control TS to 7 until assinment is complete. +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN) change control TS 7 -> 7 until assinment is complete. TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN)s start Packet Uplink Assignment (PACCH) +++++++++++++++++++++++++ TX : Packet Uplink Assignment +++++++++++++++++++++++++ ------------------------- TX : Packet Uplink Assignment ------------------------- -TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN): Scheduling polling at FN 2654283 TS 7 -TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN) Scheduled UL Assignment polling on FN=2654283, TS=7 +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN) Scheduled UL Assignment polling on PACCH (FN=2654283, TS=7) Scheduling control message at RTS for TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN) (TRX=0, TS=7) Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654270 block=8 data=4f 28 5e 24 46 68 83 1d 00 00 88 00 08 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b Got RLC block, coding scheme: CS-1, length: 23 (23)) @@ -2243,12 +2232,11 @@ TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=ASSIGN) starting timer 3169. Modifying MS object, UL TLLI: 0x00000000 -> 0xf1223344, not yet confirmed Modifying MS object, TLLI = 0xf1223344, TA 220 -> 7 -Change control TS to 7 until assinment is complete. +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN) change control TS 7 -> 7 until assinment is complete. TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN)s start Packet Uplink Assignment (PACCH) +++++++++++++++++++++++++ TX : Packet Uplink Assignment +++++++++++++++++++++++++ ------------------------- TX : Packet Uplink Assignment ------------------------- -TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN): Scheduling polling at FN 2654283 TS 7 -TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN) Scheduled UL Assignment polling on FN=2654283, TS=7 +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN) Scheduled UL Assignment polling on PACCH (FN=2654283, TS=7) Scheduling control message at RTS for TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN) (TRX=0, TS=7) Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654270 block=8 data=4f 28 5e 24 46 68 83 1d 00 00 88 00 08 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b Got RLC block, coding scheme: CS-1, length: 23 (23)) @@ -2337,8 +2325,7 @@ TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=ASSIGN) start Packet Downlink Assignment (PACCH) +++++++++++++++++++++++++ TX : Packet Downlink Assignment +++++++++++++++++++++++++ ------------------------- TX : Packet Downlink Assignment ------------------------- -TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW): Scheduling polling at FN 2654288 TS 7 -TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW) Scheduled DL Assignment polling on FN=2654288, TS=7 +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW) Scheduled DL Assignment polling on PACCH (FN=2654288, TS=7) Scheduling control message at RTS for TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW) (TRX=0, TS=7) Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654275 block=9 data=48 08 00 00 0c 72 00 02 08 00 80 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b Got RLC block, coding scheme: CS-1, length: 23 (23)) @@ -2795,8 +2782,7 @@ - need_padding 0 spb_status 0 spb 0(BSN1 20 BSN2 -1) - Copying data unit 0 (BSN 20) - Scheduling Ack/Nack polling, because 20 blocks sent. -TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=FLOW): Scheduling polling at FN 2654379 TS 7 -Polling scheduled in this TS 7 +TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=FLOW) Scheduled DL Acknowledgement polling on PACCH (FN=2654379, TS=7) TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=FLOW) Scheduled Ack/Nack polling on FN=2654379, TS=7 msg block (BSN 20, CS-1): 0f 00 28 16 35 45 54 20 32 38 4c 4c 43 20 50 41 43 4b 45 54 20 32 39 Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654366 block=6 data=08 00 28 16 35 45 54 20 32 38 4c 4c 43 20 50 41 43 4b 45 54 20 32 39 @@ -3024,8 +3010,7 @@ TBF(TFI=1 TLLI=0xf1223344 DIR=DL STATE=ASSIGN) start Packet Downlink Assignment (PACCH) +++++++++++++++++++++++++ TX : Packet Downlink Assignment +++++++++++++++++++++++++ ------------------------- TX : Packet Downlink Assignment ------------------------- -TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=WAIT RELEASE): Scheduling polling at FN 2654413 TS 7 -TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=WAIT RELEASE) Scheduled DL Assignment polling on FN=2654413, TS=7 +TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=WAIT RELEASE) Scheduled DL Assignment polling on UNKNOWN (FN=2654413, TS=7) Scheduling control message at RTS for TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=WAIT RELEASE) (TRX=0, TS=7) Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654400 block=2 data=48 08 20 08 0c 72 00 02 18 00 80 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b Got RLC block, coding scheme: CS-1, length: 23 (23)) @@ -3258,8 +3243,7 @@ - need_padding 0 spb_status 0 spb 0(BSN1 10 BSN2 -1) - Copying data unit 0 (BSN 10) - Scheduling Ack/Nack polling, because is was requested explicitly (e.g. first final block sent). -TBF(TFI=1 TLLI=0xf1223344 DIR=DL STATE=FINISHED): Scheduling polling at FN 2654461 TS 7 -Polling scheduled in this TS 7 +TBF(TFI=1 TLLI=0xf1223344 DIR=DL STATE=FINISHED) Scheduled DL Acknowledgement polling on PACCH (FN=2654461, TS=7) TBF(TFI=1 TLLI=0xf1223344 DIR=DL STATE=FINISHED) starting timer 3191. TBF(TFI=1 TLLI=0xf1223344 DIR=DL STATE=FINISHED) Scheduled Ack/Nack polling on FN=2654461, TS=7 msg block (BSN 10, CS-1): 0f 03 14 4d 43 20 50 41 43 4b 45 54 20 30 39 20 28 54 42 46 20 32 29 @@ -3383,13 +3367,12 @@ TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=ASSIGN EGPRS) starting timer 3169. Modifying MS object, UL TLLI: 0x00000000 -> 0xf1223344, not yet confirmed Modifying MS object, TLLI = 0xf1223344, TA 220 -> 7 -Change control TS to 7 until assinment is complete. +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN EGPRS) change control TS 7 -> 7 until assinment is complete. max_cs_ul cannot be derived (current UL CS: UNKNOWN) TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN EGPRS)s start Packet Uplink Assignment (PACCH) +++++++++++++++++++++++++ TX : Packet Uplink Assignment +++++++++++++++++++++++++ ------------------------- TX : Packet Uplink Assignment ------------------------- -TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN EGPRS): Scheduling polling at FN 2654283 TS 7 -TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN EGPRS) Scheduled UL Assignment polling on FN=2654283, TS=7 +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN EGPRS) Scheduled UL Assignment polling on PACCH (FN=2654283, TS=7) Scheduling control message at RTS for TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN EGPRS) (TRX=0, TS=7) Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654270 block=8 data=4f 28 5e 24 46 68 90 f8 0a 39 00 00 88 00 08 2b 2b 2b 2b 2b 2b 2b 2b Got RLC block, coding scheme: CS-1, length: 23 (23)) @@ -3478,13 +3461,12 @@ TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=ASSIGN EGPRS) starting timer 3169. Modifying MS object, UL TLLI: 0x00000000 -> 0xf1223344, not yet confirmed Modifying MS object, TLLI = 0xf1223344, TA 220 -> 7 -Change control TS to 7 until assinment is complete. +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN EGPRS) change control TS 7 -> 7 until assinment is complete. max_cs_ul cannot be derived (current UL CS: UNKNOWN) TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN EGPRS)s start Packet Uplink Assignment (PACCH) +++++++++++++++++++++++++ TX : Packet Uplink Assignment +++++++++++++++++++++++++ ------------------------- TX : Packet Uplink Assignment ------------------------- -TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN EGPRS): Scheduling polling at FN 2654283 TS 7 -TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN EGPRS) Scheduled UL Assignment polling on FN=2654283, TS=7 +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN EGPRS) Scheduled UL Assignment polling on PACCH (FN=2654283, TS=7) Scheduling control message at RTS for TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN EGPRS) (TRX=0, TS=7) Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654270 block=8 data=4f 28 5e 24 46 68 90 f8 0a 39 00 00 88 00 08 2b 2b 2b 2b 2b 2b 2b 2b Got RLC block, coding scheme: CS-1, length: 23 (23)) @@ -3728,8 +3710,7 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) start Packet Downlink Assignment (PACCH) +++++++++++++++++++++++++ TX : Packet Downlink Assignment +++++++++++++++++++++++++ ------------------------- TX : Packet Downlink Assignment ------------------------- -TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS): Scheduling polling at FN 13 TS 4 -TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Scheduled DL Assignment polling on FN=13, TS=4 +TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Scheduled DL Assignment polling on UNKNOWN (FN=13, TS=4) Scheduling control message at RTS for TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) (TRX=0, TS=4) Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=0 block=0 data=4f 08 20 00 44 02 00 02 08 04 00 c0 03 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b Scheduling data message at RTS for DL TFI=0 (TRX=0, TS=4) prio=3 @@ -4063,8 +4044,7 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) start Packet Downlink Assignment (PACCH) +++++++++++++++++++++++++ TX : Packet Downlink Assignment +++++++++++++++++++++++++ ------------------------- TX : Packet Downlink Assignment ------------------------- -TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS): Scheduling polling at FN 13 TS 4 -TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Scheduled DL Assignment polling on FN=13, TS=4 +TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Scheduled DL Assignment polling on UNKNOWN (FN=13, TS=4) Scheduling control message at RTS for TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) (TRX=0, TS=4) Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=0 block=0 data=4f 08 20 00 44 02 00 02 08 04 00 c0 03 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b Scheduling data message at RTS for DL TFI=0 (TRX=0, TS=4) prio=3 @@ -4343,8 +4323,7 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) start Packet Downlink Assignment (PACCH) +++++++++++++++++++++++++ TX : Packet Downlink Assignment +++++++++++++++++++++++++ ------------------------- TX : Packet Downlink Assignment ------------------------- -TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS): Scheduling polling at FN 13 TS 4 -TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Scheduled DL Assignment polling on FN=13, TS=4 +TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Scheduled DL Assignment polling on UNKNOWN (FN=13, TS=4) Scheduling control message at RTS for TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) (TRX=0, TS=4) Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=0 block=0 data=4f 08 20 00 44 02 00 02 08 04 00 c0 03 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b Scheduling data message at RTS for DL TFI=0 (TRX=0, TS=4) prio=3 @@ -4582,8 +4561,7 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) start Packet Downlink Assignment (PACCH) +++++++++++++++++++++++++ TX : Packet Downlink Assignment +++++++++++++++++++++++++ ------------------------- TX : Packet Downlink Assignment ------------------------- -TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS): Scheduling polling at FN 13 TS 4 -TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Scheduled DL Assignment polling on FN=13, TS=4 +TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Scheduled DL Assignment polling on UNKNOWN (FN=13, TS=4) Scheduling control message at RTS for TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) (TRX=0, TS=4) Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=0 block=0 data=4f 08 20 00 44 02 00 02 08 04 00 c0 03 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b Scheduling data message at RTS for DL TFI=0 (TRX=0, TS=4) prio=3 @@ -4785,8 +4763,7 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) start Packet Downlink Assignment (PACCH) +++++++++++++++++++++++++ TX : Packet Downlink Assignment +++++++++++++++++++++++++ ------------------------- TX : Packet Downlink Assignment ------------------------- -TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS): Scheduling polling at FN 13 TS 4 -TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Scheduled DL Assignment polling on FN=13, TS=4 +TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Scheduled DL Assignment polling on UNKNOWN (FN=13, TS=4) Scheduling control message at RTS for TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) (TRX=0, TS=4) Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=0 block=0 data=4f 08 20 00 44 02 00 02 08 04 00 c0 03 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b Scheduling data message at RTS for DL TFI=0 (TRX=0, TS=4) prio=3 @@ -4966,8 +4943,7 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) start Packet Downlink Assignment (PACCH) +++++++++++++++++++++++++ TX : Packet Downlink Assignment +++++++++++++++++++++++++ ------------------------- TX : Packet Downlink Assignment ------------------------- -TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS): Scheduling polling at FN 13 TS 4 -TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Scheduled DL Assignment polling on FN=13, TS=4 +TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Scheduled DL Assignment polling on UNKNOWN (FN=13, TS=4) Scheduling control message at RTS for TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) (TRX=0, TS=4) Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=0 block=0 data=4f 08 20 00 44 02 00 02 08 04 00 c0 03 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b Scheduling data message at RTS for DL TFI=0 (TRX=0, TS=4) prio=3 @@ -5128,8 +5104,7 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) start Packet Downlink Assignment (PACCH) +++++++++++++++++++++++++ TX : Packet Downlink Assignment +++++++++++++++++++++++++ ------------------------- TX : Packet Downlink Assignment ------------------------- -TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS): Scheduling polling at FN 13 TS 4 -TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Scheduled DL Assignment polling on FN=13, TS=4 +TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Scheduled DL Assignment polling on UNKNOWN (FN=13, TS=4) Scheduling control message at RTS for TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) (TRX=0, TS=4) Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=0 block=0 data=4f 08 20 00 44 02 00 02 08 04 00 c0 03 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b Scheduling data message at RTS for DL TFI=0 (TRX=0, TS=4) prio=3 @@ -5286,8 +5261,7 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) start Packet Downlink Assignment (PACCH) +++++++++++++++++++++++++ TX : Packet Downlink Assignment +++++++++++++++++++++++++ ------------------------- TX : Packet Downlink Assignment ------------------------- -TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS): Scheduling polling at FN 13 TS 4 -TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Scheduled DL Assignment polling on FN=13, TS=4 +TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Scheduled DL Assignment polling on UNKNOWN (FN=13, TS=4) Scheduling control message at RTS for TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) (TRX=0, TS=4) Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=0 block=0 data=4f 08 20 00 44 02 00 02 08 04 00 c0 03 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b Scheduling data message at RTS for DL TFI=0 (TRX=0, TS=4) prio=3 @@ -5431,8 +5405,7 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) start Packet Downlink Assignment (PACCH) +++++++++++++++++++++++++ TX : Packet Downlink Assignment +++++++++++++++++++++++++ ------------------------- TX : Packet Downlink Assignment ------------------------- -TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS): Scheduling polling at FN 13 TS 4 -TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Scheduled DL Assignment polling on FN=13, TS=4 +TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Scheduled DL Assignment polling on UNKNOWN (FN=13, TS=4) Scheduling control message at RTS for TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) (TRX=0, TS=4) Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=0 block=0 data=4f 08 20 00 44 02 00 02 08 04 00 c0 03 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b Scheduling data message at RTS for DL TFI=0 (TRX=0, TS=4) prio=3 @@ -5749,8 +5722,7 @@ - need_padding 0 spb_status 0 spb 0(BSN1 1 BSN2 -1) - Copying data unit 0 (BSN 1) - Scheduling Ack/Nack polling, because is was requested explicitly (e.g. first final block sent). -TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS): Scheduling polling at FN 21 TS 4 -Polling scheduled in this TS 4 +TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Scheduled DL Acknowledgement polling on UNKNOWN (FN=21, TS=4) TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Scheduled Ack/Nack polling on FN=21, TS=4 msg block (BSN 1, MCS-5): 0f 40 00 08 56 05 4e 8e ce 0e 4f 8f cf 0f 50 90 d0 10 51 91 d1 11 52 92 d2 12 53 93 d3 13 54 94 d4 14 55 95 d5 15 56 96 d6 16 57 97 d7 17 58 98 d8 d8 10 70 c0 ca ca ca ca ca ca 0a TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) downlink (V(A)==0 .. V(S)==2) @@ -5820,8 +5792,7 @@ - need_padding 0 spb_status 0 spb 0(BSN1 1 BSN2 -1) - Copying data unit 0 (BSN 1) - Scheduling Ack/Nack polling, because is was requested explicitly (e.g. first final block sent). -TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS): Scheduling polling at FN 21 TS 4 -Polling scheduled in this TS 4 +TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Scheduled DL Acknowledgement polling on UNKNOWN (FN=21, TS=4) TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Scheduled Ack/Nack polling on FN=21, TS=4 msg block (BSN 1, MCS-6): 0f 40 00 00 4d 97 d2 12 53 93 d3 13 54 94 d4 14 55 95 d5 15 56 96 d6 16 57 97 d7 17 58 98 d8 d8 10 70 c0 ca ca ca ca ca ca ca ca ca ca ca ca ca ca ca ca ca ca ca ca ca ca ca ca ca ca ca ca ca ca ca ca ca ca ca ca ca ca ca ca ca ca 0a TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) downlink (V(A)==0 .. V(S)==2) @@ -5888,8 +5859,7 @@ - Copying data unit 0 (BSN 0) - Copying data unit 1 (BSN 1) - Scheduling Ack/Nack polling, because is was requested explicitly (e.g. first final block sent). -TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS): Scheduling polling at FN 17 TS 4 -Polling scheduled in this TS 4 +TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Scheduled DL Acknowledgement polling on UNKNOWN (FN=17, TS=4) TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Scheduled Ack/Nack polling on FN=17, TS=4 msg block (BSN 0, MCS-7): 0f 00 00 02 a0 01 04 08 0c 10 14 18 1c 20 24 28 2c 30 34 38 3c 40 44 48 4c 50 54 58 5c 60 64 68 6c 70 74 78 7c 80 84 88 8c 90 94 98 9c a0 a4 a8 ac b0 b4 b8 bc c0 c4 c8 cc d0 d4 d8 dc 80 55 81 93 a3 b3 c3 d3 e3 f3 03 14 24 34 44 54 64 74 84 94 a4 b4 c4 d4 e4 f4 04 15 25 35 45 55 65 75 85 95 a5 b5 c5 d5 e5 f5 05 16 26 36 36 04 1c b0 b2 b2 b2 b2 b2 b2 02 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) downlink (V(A)==0 .. V(S)==2) @@ -5959,8 +5929,7 @@ - Copying data unit 0 (BSN 0) - Copying data unit 1 (BSN 1) - Scheduling Ack/Nack polling, because is was requested explicitly (e.g. first final block sent). -TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS): Scheduling polling at FN 17 TS 4 -Polling scheduled in this TS 4 +TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Scheduled DL Acknowledgement polling on UNKNOWN (FN=17, TS=4) TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Scheduled Ack/Nack polling on FN=17, TS=4 msg block (BSN 0, MCS-9): 0f 00 00 02 00 01 04 08 0c 10 14 18 1c 20 24 28 2c 30 34 38 3c 40 44 48 4c 50 54 58 5c 60 64 68 6c 70 74 78 7c 80 84 88 8c 90 94 98 9c a0 a4 a8 ac b0 b4 b8 bc c0 c4 c8 cc d0 d4 d8 dc e0 e4 e8 ec f0 f4 f8 fc 00 05 09 0d 11 15 19 1d 21 25 41 d3 a5 b4 c4 d4 e4 f4 04 15 25 35 45 55 65 75 85 95 a5 b5 c5 d5 e5 f5 05 16 26 36 36 04 1c b0 b2 b2 b2 b2 b2 b2 b2 b2 b2 b2 b2 b2 b2 b2 b2 b2 b2 b2 b2 b2 b2 b2 b2 b2 b2 b2 b2 b2 b2 b2 b2 b2 b2 b2 b2 b2 b2 b2 b2 b2 b2 b2 02 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) downlink (V(A)==0 .. V(S)==2) @@ -6263,13 +6232,12 @@ TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=ASSIGN EGPRS) starting timer 3169. Modifying MS object, UL TLLI: 0x00000000 -> 0xf1223344, not yet confirmed Modifying MS object, TLLI = 0xf1223344, TA 220 -> 7 -Change control TS to 7 until assinment is complete. +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN EGPRS) change control TS 7 -> 7 until assinment is complete. max_cs_ul cannot be derived (current UL CS: UNKNOWN) TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN EGPRS)s start Packet Uplink Assignment (PACCH) +++++++++++++++++++++++++ TX : Packet Uplink Assignment +++++++++++++++++++++++++ ------------------------- TX : Packet Uplink Assignment ------------------------- -TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN EGPRS): Scheduling polling at FN 2654283 TS 7 -TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN EGPRS) Scheduled UL Assignment polling on FN=2654283, TS=7 +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN EGPRS) Scheduled UL Assignment polling on PACCH (FN=2654283, TS=7) Scheduling control message at RTS for TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN EGPRS) (TRX=0, TS=7) Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654270 block=8 data=4f 28 5e 24 46 68 90 f8 0a 39 00 00 88 00 08 2b 2b 2b 2b 2b 2b 2b 2b Got RLC block, coding scheme: CS-1, length: 23 (23)) @@ -6440,13 +6408,12 @@ TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=ASSIGN EGPRS) starting timer 3169. Modifying MS object, UL TLLI: 0x00000000 -> 0xf1223344, not yet confirmed Modifying MS object, TLLI = 0xf1223344, TA 220 -> 7 -Change control TS to 7 until assinment is complete. +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN EGPRS) change control TS 7 -> 7 until assinment is complete. max_cs_ul cannot be derived (current UL CS: UNKNOWN) TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN EGPRS)s start Packet Uplink Assignment (PACCH) +++++++++++++++++++++++++ TX : Packet Uplink Assignment +++++++++++++++++++++++++ ------------------------- TX : Packet Uplink Assignment ------------------------- -TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN EGPRS): Scheduling polling at FN 2654283 TS 7 -TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN EGPRS) Scheduled UL Assignment polling on FN=2654283, TS=7 +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN EGPRS) Scheduled UL Assignment polling on PACCH (FN=2654283, TS=7) Scheduling control message at RTS for TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN EGPRS) (TRX=0, TS=7) Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654270 block=8 data=4f 28 5e 24 46 68 90 f8 0a 39 00 00 88 00 08 2b 2b 2b 2b 2b 2b 2b 2b Got RLC block, coding scheme: CS-1, length: 23 (23)) @@ -6901,13 +6868,12 @@ TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=ASSIGN EGPRS) starting timer 3169. Modifying MS object, UL TLLI: 0x00000000 -> 0xf1223344, not yet confirmed Modifying MS object, TLLI = 0xf1223344, TA 220 -> 7 -Change control TS to 7 until assinment is complete. +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN EGPRS) change control TS 7 -> 7 until assinment is complete. max_cs_ul cannot be derived (current UL CS: UNKNOWN) TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN EGPRS)s start Packet Uplink Assignment (PACCH) +++++++++++++++++++++++++ TX : Packet Uplink Assignment +++++++++++++++++++++++++ ------------------------- TX : Packet Uplink Assignment ------------------------- -TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN EGPRS): Scheduling polling at FN 2654283 TS 7 -TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN EGPRS) Scheduled UL Assignment polling on FN=2654283, TS=7 +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN EGPRS) Scheduled UL Assignment polling on PACCH (FN=2654283, TS=7) Scheduling control message at RTS for TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN EGPRS) (TRX=0, TS=7) Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654270 block=8 data=4f 28 5e 24 46 68 90 f9 0a 39 00 00 88 00 08 2b 2b 2b 2b 2b 2b 2b 2b Got RLC block, coding scheme: CS-1, length: 23 (23)) @@ -7991,8 +7957,7 @@ TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=ASSIGN EGPRS) start Packet Downlink Assignment (PACCH) +++++++++++++++++++++++++ TX : Packet Downlink Assignment +++++++++++++++++++++++++ ------------------------- TX : Packet Downlink Assignment ------------------------- -TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): Scheduling polling at FN 2654292 TS 7 -TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS) Scheduled DL Assignment polling on FN=2654292, TS=7 +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS) Scheduled DL Assignment polling on PACCH (FN=2654292, TS=7) Scheduling control message at RTS for TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS) (TRX=0, TS=7) Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654279 block=10 data=48 08 00 00 0c 72 00 02 08 00 80 c8 03 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b Got 'TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS)', TA=7 -- To view, visit https://gerrit.osmocom.org/2859 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I14074207f8bbc18b3ebd60875bb99a0a3a4b399d Gerrit-PatchSet: 8 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max From gerrit-no-reply at lists.osmocom.org Mon Aug 14 15:33:25 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 14 Aug 2017 15:33:25 +0000 Subject: [PATCH] osmo-pcu[master]: Move DL scheduling and RTS handler to trx level In-Reply-To: References: Message-ID: Hello Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3150 to look at the new patch set (#5). Move DL scheduling and RTS handler to trx level Use TRX object directly instead of BTS singleton and trx_no. This is necessary to facilitate the move of UL/DL TBF lists to TRX level. Change-Id: Ia176245647c19fa1551fb6f5c8225b2529f73cbf Related: OS#1541 --- M src/bts.cpp M src/bts.h M src/gprs_rlcmac.h M src/gprs_rlcmac_sched.cpp M src/pcu_l1_if.cpp M src/tbf.cpp M src/tbf.h M tests/tbf/TbfTest.cpp 8 files changed, 58 insertions(+), 68 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/50/3150/5 diff --git a/src/bts.cpp b/src/bts.cpp index add6ab3..ada8456 100644 --- a/src/bts.cpp +++ b/src/bts.cpp @@ -1375,8 +1375,7 @@ egprs_ms_class, tlli, ta, ms); if (!ul_tbf) { - handle_tbf_reject(bts_data(), ms, tlli, - trx_no(), ts_no); + handle_tbf_reject(get_trx(), ms, tlli, ts_no); return; } diff --git a/src/bts.h b/src/bts.h index 1f1dae2..71dfb7b 100644 --- a/src/bts.h +++ b/src/bts.h @@ -91,7 +91,7 @@ gprs_rlcmac_bts *bts_data() const; BTS *bts() const; uint8_t trx_no() const; - + gprs_rlcmac_trx *get_trx(); struct gprs_rlcmac_ul_tbf *ul_tbf_by_tfi(uint8_t tfi); struct gprs_rlcmac_dl_tbf *dl_tbf_by_tfi(uint8_t tfi); @@ -692,6 +692,11 @@ return trx->bts->bts_data(); } +inline gprs_rlcmac_trx *gprs_rlcmac_pdch::get_trx() +{ + return trx; +} + inline uint8_t gprs_rlcmac_pdch::trx_no() const { return trx->trx_no; diff --git a/src/gprs_rlcmac.h b/src/gprs_rlcmac.h index be1e686..3d825a8 100644 --- a/src/gprs_rlcmac.h +++ b/src/gprs_rlcmac.h @@ -89,9 +89,7 @@ int gprs_rlcmac_paging_request(uint8_t *ptmsi, uint16_t ptmsi_len, const char *imsi); -int gprs_rlcmac_rcv_rts_block(struct gprs_rlcmac_bts *bts, - uint8_t trx, uint8_t ts, - uint32_t fn, uint8_t block_nr); +int gprs_rlcmac_rcv_rts_block(struct gprs_rlcmac_trx *trx, uint8_t ts, uint32_t fn, uint8_t block_nr); int gprs_alloc_max_dl_slots_per_ms(struct gprs_rlcmac_bts *bts, uint8_t ms_class = 0); diff --git a/src/gprs_rlcmac_sched.cpp b/src/gprs_rlcmac_sched.cpp index 42f0308..007fb79 100644 --- a/src/gprs_rlcmac_sched.cpp +++ b/src/gprs_rlcmac_sched.cpp @@ -25,12 +25,10 @@ #include "pcu_utils.h" -static uint32_t sched_poll(BTS *bts, - uint8_t trx, uint8_t ts, uint32_t fn, uint8_t block_nr, - struct gprs_rlcmac_tbf **poll_tbf, - struct gprs_rlcmac_tbf **ul_ass_tbf, - struct gprs_rlcmac_tbf **dl_ass_tbf, - struct gprs_rlcmac_ul_tbf **ul_ack_tbf) +static uint32_t sched_poll(struct gprs_rlcmac_trx *trx, uint8_t ts, uint32_t fn, uint8_t block_nr, + struct gprs_rlcmac_tbf **poll_tbf, + struct gprs_rlcmac_tbf **ul_ass_tbf, struct gprs_rlcmac_tbf **dl_ass_tbf, + struct gprs_rlcmac_ul_tbf **ul_ack_tbf) { struct gprs_rlcmac_ul_tbf *ul_tbf; struct gprs_rlcmac_dl_tbf *dl_tbf; @@ -42,11 +40,11 @@ if ((block_nr % 3) == 2) poll_fn ++; poll_fn = poll_fn % GSM_MAX_FN; - llist_for_each(pos, &bts->ul_tbfs()) { + llist_for_each(pos, &trx->bts->ul_tbfs()) { ul_tbf = as_ul_tbf(pos->entry()); OSMO_ASSERT(ul_tbf); /* this trx, this ts */ - if (ul_tbf->trx->trx_no != trx || !ul_tbf->is_control_ts(ts)) + if (ul_tbf->trx->trx_no != trx->trx_no || !ul_tbf->is_control_ts(ts)) continue; /* polling for next uplink block */ if (ul_tbf->poll_state == GPRS_RLCMAC_POLL_SCHED @@ -62,11 +60,11 @@ *ul_ass_tbf = ul_tbf; #warning "Is this supposed to be fair? The last TBF for each wins? Maybe use llist_add_tail and skip once we have all states?" } - llist_for_each(pos, &bts->dl_tbfs()) { + llist_for_each(pos, &trx->bts->dl_tbfs()) { dl_tbf = as_dl_tbf(pos->entry()); OSMO_ASSERT(dl_tbf); /* this trx, this ts */ - if (dl_tbf->trx->trx_no != trx || !dl_tbf->is_control_ts(ts)) + if (dl_tbf->trx->trx_no != trx->trx_no || !dl_tbf->is_control_ts(ts)) continue; /* polling for next uplink block */ if (dl_tbf->poll_state == GPRS_RLCMAC_POLL_SCHED @@ -206,9 +204,8 @@ return NULL; } -static struct msgb *sched_select_downlink(struct gprs_rlcmac_bts *bts, - uint8_t trx, uint8_t ts, uint32_t fn, - uint8_t block_nr, struct gprs_rlcmac_pdch *pdch) +static struct msgb *sched_select_downlink(struct gprs_rlcmac_trx *trx, uint8_t ts, uint32_t fn, uint8_t block_nr, + struct gprs_rlcmac_pdch *pdch) { struct msgb *msg = NULL; struct gprs_rlcmac_dl_tbf *tbf, *prio_tbf = NULL; @@ -225,7 +222,7 @@ int age; const int age_thresh1 = msecs_to_frames(200); const int high_prio_msecs = - OSMO_MIN(BTS::TIMER_T3190_MSEC/2, bts->dl_tbf_idle_msec); + OSMO_MIN(BTS::TIMER_T3190_MSEC/2, trx->bts->bts_data()->dl_tbf_idle_msec); const int age_thresh2 = msecs_to_frames(high_prio_msecs); /* select downlink resource */ @@ -277,7 +274,7 @@ if (prio_tbf) { LOGP(DRLCMACSCHED, LOGL_DEBUG, "Scheduling data message at " "RTS for DL TFI=%d (TRX=%d, TS=%d) prio=%d\n", - prio_tfi, trx, ts, max_prio); + prio_tfi, trx->trx_no, ts, max_prio); /* next TBF to handle resource is the next one */ pdch->next_dl_tfi = (prio_tfi + 1) & 31; /* generate DL data block */ @@ -307,9 +304,7 @@ return msg; } -int gprs_rlcmac_rcv_rts_block(struct gprs_rlcmac_bts *bts, - uint8_t trx, uint8_t ts, - uint32_t fn, uint8_t block_nr) +int gprs_rlcmac_rcv_rts_block(struct gprs_rlcmac_trx *trx, uint8_t ts, uint32_t fn, uint8_t block_nr) { struct gprs_rlcmac_pdch *pdch; struct gprs_rlcmac_tbf *poll_tbf = NULL, *dl_ass_tbf = NULL, @@ -319,55 +314,53 @@ struct msgb *msg = NULL; uint32_t poll_fn, sba_fn; - if (trx >= 8 || ts >= 8) + if (trx->trx_no >= 8 || ts >= 8) return -EINVAL; - pdch = &bts->trx[trx].pdch[ts]; + pdch = &trx->pdch[ts]; if (!pdch->is_enabled()) { LOGP(DRLCMACSCHED, LOGL_ERROR, "Received RTS on disabled PDCH: " - "TRX=%d TS=%d\n", trx, ts); + "TRX=%d TS=%d\n", trx->trx_no, ts); return -EIO; } /* store last frame number of RTS */ pdch->last_rts_fn = fn; - poll_fn = sched_poll(bts->bts, trx, ts, fn, block_nr, &poll_tbf, &ul_ass_tbf, - &dl_ass_tbf, &ul_ack_tbf); + poll_fn = sched_poll(trx, ts, fn, block_nr, &poll_tbf, &ul_ass_tbf, &dl_ass_tbf, &ul_ack_tbf); /* check uplink resource for polling */ if (poll_tbf) LOGP(DRLCMACSCHED, LOGL_DEBUG, "Received RTS for PDCH: TRX=%d " "TS=%d FN=%d block_nr=%d scheduling free USF for " - "polling at FN=%d of %s\n", trx, ts, fn, + "polling at FN=%d of %s\n", trx->trx_no, ts, fn, block_nr, poll_fn, tbf_name(poll_tbf)); /* use free USF */ /* else. check for sba */ - else if ((sba_fn = bts->bts->sba()->sched(trx, ts, fn, block_nr) != 0xffffffff)) + else if ((sba_fn = trx->bts->sba()->sched(trx->trx_no, ts, fn, block_nr) != 0xffffffff)) LOGP(DRLCMACSCHED, LOGL_DEBUG, "Received RTS for PDCH: TRX=%d " "TS=%d FN=%d block_nr=%d scheduling free USF for " - "single block allocation at FN=%d\n", trx, ts, fn, + "single block allocation at FN=%d\n", trx->trx_no, ts, fn, block_nr, sba_fn); /* use free USF */ /* else, we search for uplink resource */ else - usf = sched_select_uplink(trx, ts, fn, block_nr, pdch); + usf = sched_select_uplink(trx->trx_no, ts, fn, block_nr, pdch); /* Prio 1: select control message */ - msg = sched_select_ctrl_msg(trx, ts, fn, block_nr, pdch, ul_ass_tbf, - dl_ass_tbf, ul_ack_tbf); + msg = sched_select_ctrl_msg(trx->trx_no, ts, fn, block_nr, pdch, ul_ass_tbf, dl_ass_tbf, ul_ack_tbf); if (msg) { - bts->bts->rlc_sent_control(); - bts->bts->send_gsmtap(PCU_GSMTAP_C_DL_CTRL, false, trx, ts, GSMTAP_CHANNEL_PACCH, fn, msg->data, msg->len); + trx->bts->bts->rlc_sent_control(); + trx->bts->bts->send_gsmtap(PCU_GSMTAP_C_DL_CTRL, false, trx, ts, GSMTAP_CHANNEL_PACCH, fn, msg->data, msg->len); } /* Prio 2: select data message for downlink */ if (!msg) { - msg = sched_select_downlink(bts, trx, ts, fn, block_nr, pdch); + msg = sched_select_downlink(trx, ts, fn, block_nr, pdch); if (msg) { - bts->bts->rlc_sent(); + trx->bts->bts->rlc_sent(); /* FIXME: distinguish between GPRS and EGPRS */ - bts->bts->send_gsmtap(PCU_GSMTAP_C_DL_DATA_GPRS, false, trx, ts, GSMTAP_CHANNEL_PDTCH, fn, msg->data, msg->len); + trx->bts->bts->send_gsmtap(PCU_GSMTAP_C_DL_DATA_GPRS, false, trx, ts, GSMTAP_CHANNEL_PDTCH, fn, msg->data, msg->len); } } @@ -376,15 +369,15 @@ /* increase counter */ msg = sched_dummy(); if (msg) { - bts->bts->rlc_sent_dummy(); - bts->bts->send_gsmtap(PCU_GSMTAP_C_DL_DUMMY, false, trx, ts, GSMTAP_CHANNEL_PACCH, fn, msg->data, msg->len); + trx->bts->bts->rlc_sent_dummy(); + trx->bts->bts->send_gsmtap(PCU_GSMTAP_C_DL_DUMMY, false, trx, ts, GSMTAP_CHANNEL_PACCH, fn, msg->data, msg->len); } } if (!msg) return -ENOMEM; /* msg is now available */ - bts->bts->rlc_dl_bytes(msg->data_len); + trx->bts->bts->rlc_dl_bytes(msg->data_len); /* set USF */ OSMO_ASSERT(msgb_length(msg) > 0); @@ -394,7 +387,7 @@ gprs_bssgp_update_frames_sent(); /* send PDTCH/PACCH to L1 */ - pcu_l1if_tx_pdtch(msg, trx, ts, bts->trx[trx].arfcn, fn, block_nr); + pcu_l1if_tx_pdtch(msg, trx->trx_no, ts, trx->arfcn, fn, block_nr); return 0; } diff --git a/src/pcu_l1_if.cpp b/src/pcu_l1_if.cpp index 8ea2ad5..b38244b 100644 --- a/src/pcu_l1_if.cpp +++ b/src/pcu_l1_if.cpp @@ -307,11 +307,13 @@ } // FIXME: remove this, when changed from c++ to c. -extern "C" int pcu_rx_rts_req_pdtch(uint8_t trx, uint8_t ts, +extern "C" int pcu_rx_rts_req_pdtch(uint8_t trx_no, uint8_t ts, uint32_t fn, uint8_t block_nr) { - return gprs_rlcmac_rcv_rts_block(bts_main_data(), - trx, ts, fn, block_nr); + struct gprs_rlcmac_bts *bts = bts_main_data(); + struct gprs_rlcmac_trx *trx = &bts->trx[trx_no]; + + return gprs_rlcmac_rcv_rts_block(trx, ts, fn, block_nr); } static int pcu_rx_rts_req(struct gsm_pcu_if_rts_req *rts_req) diff --git a/src/tbf.cpp b/src/tbf.cpp index c5f4348..f143960 100644 --- a/src/tbf.cpp +++ b/src/tbf.cpp @@ -1450,24 +1450,22 @@ return ts == control_ts; } -struct gprs_rlcmac_ul_tbf *handle_tbf_reject(struct gprs_rlcmac_bts *bts, - GprsMs *ms, uint32_t tlli, uint8_t trx_no, uint8_t ts) +struct gprs_rlcmac_ul_tbf *handle_tbf_reject(struct gprs_rlcmac_trx *trx, GprsMs *ms, uint32_t tlli, uint8_t ts) { struct gprs_rlcmac_ul_tbf *ul_tbf = NULL; - struct gprs_rlcmac_trx *trx = &bts->trx[trx_no]; ul_tbf = talloc(tall_pcu_ctx, struct gprs_rlcmac_ul_tbf); if (!ul_tbf) return ul_tbf; talloc_set_destructor(ul_tbf, ul_tbf_dtor); - new (ul_tbf) gprs_rlcmac_ul_tbf(bts->bts); + new (ul_tbf) gprs_rlcmac_ul_tbf(trx->bts); if (!ms) - ms = bts->bts->ms_alloc(0, 0); + ms = trx->bts->ms_alloc(0, 0); ms->set_tlli(tlli); - llist_add(&ul_tbf->list(), &bts->bts->ul_tbfs()); + llist_add(&ul_tbf->list(), &trx->bts->ul_tbfs()); ul_tbf->bts->tbf_ul_created(); ul_tbf->set_state(GPRS_RLCMAC_ASSIGN); ul_tbf->state_flags |= (1 << GPRS_RLCMAC_FLAG_PACCH); diff --git a/src/tbf.h b/src/tbf.h index 95e1e89..c13e61f 100644 --- a/src/tbf.h +++ b/src/tbf.h @@ -324,8 +324,7 @@ void tbf_free(struct gprs_rlcmac_tbf *tbf); -struct gprs_rlcmac_ul_tbf *handle_tbf_reject(struct gprs_rlcmac_bts *bts, - GprsMs *ms, uint32_t tlli, uint8_t trx_no, uint8_t ts_no); +struct gprs_rlcmac_ul_tbf *handle_tbf_reject(struct gprs_rlcmac_trx *trx, GprsMs *ms, uint32_t tlli, uint8_t ts_no); int tbf_assign_control_ts(struct gprs_rlcmac_tbf *tbf); diff --git a/tests/tbf/TbfTest.cpp b/tests/tbf/TbfTest.cpp index 0db7fde..886856a 100644 --- a/tests/tbf/TbfTest.cpp +++ b/tests/tbf/TbfTest.cpp @@ -203,7 +203,8 @@ uint32_t *fn, uint8_t *block_nr = NULL) { uint8_t bn = fn2bn(*fn); - gprs_rlcmac_rcv_rts_block(bts, trx_no, ts_no, *fn, bn); + struct gprs_rlcmac_trx *trx = &bts->trx[trx_no]; + gprs_rlcmac_rcv_rts_block(trx, ts_no, *fn, bn); *fn = fn_add_blocks(*fn, 1); bn += 1; if (block_nr) @@ -1651,9 +1652,8 @@ for (ts_no = 0 ; ts_no < 8; ts_no += 1) { if (!(slots & (1 << ts_no))) continue; - gprs_rlcmac_rcv_rts_block(the_bts->bts_data(), - dl_tbf->trx->trx_no, ts_no, - *fn, bn); + struct gprs_rlcmac_trx *trx = &the_bts->bts_data()->trx[dl_tbf->trx->trx_no]; + gprs_rlcmac_rcv_rts_block(trx, ts_no, *fn, bn); } *fn = fn_add_blocks(*fn, 1); } @@ -3222,17 +3222,14 @@ setup_bts(&the_bts, ts_no, 4); int rc = 0; - - ul_tbf = handle_tbf_reject(the_bts.bts_data(), NULL, tlli, - trx_no, ts_no); + struct gprs_rlcmac_trx *trx = &the_bts.bts_data()->trx[trx_no]; + ul_tbf = handle_tbf_reject(trx, NULL, tlli, ts_no); OSMO_ASSERT(ul_tbf != 0); /* trigger packet access reject */ uint8_t bn = fn2bn(fn); - - rc = gprs_rlcmac_rcv_rts_block(the_bts.bts_data(), - trx_no, ts_no, fn, bn); + rc = gprs_rlcmac_rcv_rts_block(trx, ts_no, fn, bn); OSMO_ASSERT(rc == 0); @@ -3307,9 +3304,8 @@ /* trigger packet access reject */ uint8_t bn = fn2bn(fn); - - rc = gprs_rlcmac_rcv_rts_block(the_bts.bts_data(), - trx_no, ts_no, fn, bn); + struct gprs_rlcmac_trx *trx = &the_bts.bts_data()->trx[trx_no]; + rc = gprs_rlcmac_rcv_rts_block(trx, ts_no, fn, bn); OSMO_ASSERT(rc == 0); -- To view, visit https://gerrit.osmocom.org/3150 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ia176245647c19fa1551fb6f5c8225b2529f73cbf Gerrit-PatchSet: 5 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Mon Aug 14 15:40:27 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 14 Aug 2017 15:40:27 +0000 Subject: [PATCH] osmo-pcu[master]: Move DL scheduling and RTS handler to trx level In-Reply-To: References: Message-ID: Hello Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3150 to look at the new patch set (#6). Move DL scheduling and RTS handler to trx level Use TRX object directly instead of BTS singleton and trx_no. This is necessary to facilitate the move of UL/DL TBF lists to TRX level. Change-Id: Ia176245647c19fa1551fb6f5c8225b2529f73cbf Related: OS#1541 --- M src/bts.cpp M src/bts.h M src/gprs_rlcmac.h M src/gprs_rlcmac_sched.cpp M src/pcu_l1_if.cpp M src/tbf.cpp M src/tbf.h M tests/tbf/TbfTest.cpp 8 files changed, 58 insertions(+), 68 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/50/3150/6 diff --git a/src/bts.cpp b/src/bts.cpp index add6ab3..ada8456 100644 --- a/src/bts.cpp +++ b/src/bts.cpp @@ -1375,8 +1375,7 @@ egprs_ms_class, tlli, ta, ms); if (!ul_tbf) { - handle_tbf_reject(bts_data(), ms, tlli, - trx_no(), ts_no); + handle_tbf_reject(get_trx(), ms, tlli, ts_no); return; } diff --git a/src/bts.h b/src/bts.h index 1f1dae2..71dfb7b 100644 --- a/src/bts.h +++ b/src/bts.h @@ -91,7 +91,7 @@ gprs_rlcmac_bts *bts_data() const; BTS *bts() const; uint8_t trx_no() const; - + gprs_rlcmac_trx *get_trx(); struct gprs_rlcmac_ul_tbf *ul_tbf_by_tfi(uint8_t tfi); struct gprs_rlcmac_dl_tbf *dl_tbf_by_tfi(uint8_t tfi); @@ -692,6 +692,11 @@ return trx->bts->bts_data(); } +inline gprs_rlcmac_trx *gprs_rlcmac_pdch::get_trx() +{ + return trx; +} + inline uint8_t gprs_rlcmac_pdch::trx_no() const { return trx->trx_no; diff --git a/src/gprs_rlcmac.h b/src/gprs_rlcmac.h index be1e686..3d825a8 100644 --- a/src/gprs_rlcmac.h +++ b/src/gprs_rlcmac.h @@ -89,9 +89,7 @@ int gprs_rlcmac_paging_request(uint8_t *ptmsi, uint16_t ptmsi_len, const char *imsi); -int gprs_rlcmac_rcv_rts_block(struct gprs_rlcmac_bts *bts, - uint8_t trx, uint8_t ts, - uint32_t fn, uint8_t block_nr); +int gprs_rlcmac_rcv_rts_block(struct gprs_rlcmac_trx *trx, uint8_t ts, uint32_t fn, uint8_t block_nr); int gprs_alloc_max_dl_slots_per_ms(struct gprs_rlcmac_bts *bts, uint8_t ms_class = 0); diff --git a/src/gprs_rlcmac_sched.cpp b/src/gprs_rlcmac_sched.cpp index 42f0308..c5fbf84 100644 --- a/src/gprs_rlcmac_sched.cpp +++ b/src/gprs_rlcmac_sched.cpp @@ -25,12 +25,10 @@ #include "pcu_utils.h" -static uint32_t sched_poll(BTS *bts, - uint8_t trx, uint8_t ts, uint32_t fn, uint8_t block_nr, - struct gprs_rlcmac_tbf **poll_tbf, - struct gprs_rlcmac_tbf **ul_ass_tbf, - struct gprs_rlcmac_tbf **dl_ass_tbf, - struct gprs_rlcmac_ul_tbf **ul_ack_tbf) +static uint32_t sched_poll(struct gprs_rlcmac_trx *trx, uint8_t ts, uint32_t fn, uint8_t block_nr, + struct gprs_rlcmac_tbf **poll_tbf, + struct gprs_rlcmac_tbf **ul_ass_tbf, struct gprs_rlcmac_tbf **dl_ass_tbf, + struct gprs_rlcmac_ul_tbf **ul_ack_tbf) { struct gprs_rlcmac_ul_tbf *ul_tbf; struct gprs_rlcmac_dl_tbf *dl_tbf; @@ -42,11 +40,11 @@ if ((block_nr % 3) == 2) poll_fn ++; poll_fn = poll_fn % GSM_MAX_FN; - llist_for_each(pos, &bts->ul_tbfs()) { + llist_for_each(pos, &trx->bts->ul_tbfs()) { ul_tbf = as_ul_tbf(pos->entry()); OSMO_ASSERT(ul_tbf); /* this trx, this ts */ - if (ul_tbf->trx->trx_no != trx || !ul_tbf->is_control_ts(ts)) + if (ul_tbf->trx->trx_no != trx->trx_no || !ul_tbf->is_control_ts(ts)) continue; /* polling for next uplink block */ if (ul_tbf->poll_state == GPRS_RLCMAC_POLL_SCHED @@ -62,11 +60,11 @@ *ul_ass_tbf = ul_tbf; #warning "Is this supposed to be fair? The last TBF for each wins? Maybe use llist_add_tail and skip once we have all states?" } - llist_for_each(pos, &bts->dl_tbfs()) { + llist_for_each(pos, &trx->bts->dl_tbfs()) { dl_tbf = as_dl_tbf(pos->entry()); OSMO_ASSERT(dl_tbf); /* this trx, this ts */ - if (dl_tbf->trx->trx_no != trx || !dl_tbf->is_control_ts(ts)) + if (dl_tbf->trx->trx_no != trx->trx_no || !dl_tbf->is_control_ts(ts)) continue; /* polling for next uplink block */ if (dl_tbf->poll_state == GPRS_RLCMAC_POLL_SCHED @@ -206,9 +204,8 @@ return NULL; } -static struct msgb *sched_select_downlink(struct gprs_rlcmac_bts *bts, - uint8_t trx, uint8_t ts, uint32_t fn, - uint8_t block_nr, struct gprs_rlcmac_pdch *pdch) +static struct msgb *sched_select_downlink(struct gprs_rlcmac_trx *trx, uint8_t ts, uint32_t fn, uint8_t block_nr, + struct gprs_rlcmac_pdch *pdch) { struct msgb *msg = NULL; struct gprs_rlcmac_dl_tbf *tbf, *prio_tbf = NULL; @@ -225,7 +222,7 @@ int age; const int age_thresh1 = msecs_to_frames(200); const int high_prio_msecs = - OSMO_MIN(BTS::TIMER_T3190_MSEC/2, bts->dl_tbf_idle_msec); + OSMO_MIN(BTS::TIMER_T3190_MSEC/2, trx->bts->bts_data()->dl_tbf_idle_msec); const int age_thresh2 = msecs_to_frames(high_prio_msecs); /* select downlink resource */ @@ -277,7 +274,7 @@ if (prio_tbf) { LOGP(DRLCMACSCHED, LOGL_DEBUG, "Scheduling data message at " "RTS for DL TFI=%d (TRX=%d, TS=%d) prio=%d\n", - prio_tfi, trx, ts, max_prio); + prio_tfi, trx->trx_no, ts, max_prio); /* next TBF to handle resource is the next one */ pdch->next_dl_tfi = (prio_tfi + 1) & 31; /* generate DL data block */ @@ -307,9 +304,7 @@ return msg; } -int gprs_rlcmac_rcv_rts_block(struct gprs_rlcmac_bts *bts, - uint8_t trx, uint8_t ts, - uint32_t fn, uint8_t block_nr) +int gprs_rlcmac_rcv_rts_block(struct gprs_rlcmac_trx *trx, uint8_t ts, uint32_t fn, uint8_t block_nr) { struct gprs_rlcmac_pdch *pdch; struct gprs_rlcmac_tbf *poll_tbf = NULL, *dl_ass_tbf = NULL, @@ -319,55 +314,53 @@ struct msgb *msg = NULL; uint32_t poll_fn, sba_fn; - if (trx >= 8 || ts >= 8) + if (trx->trx_no >= 8 || ts >= 8) return -EINVAL; - pdch = &bts->trx[trx].pdch[ts]; + pdch = &trx->pdch[ts]; if (!pdch->is_enabled()) { LOGP(DRLCMACSCHED, LOGL_ERROR, "Received RTS on disabled PDCH: " - "TRX=%d TS=%d\n", trx, ts); + "TRX=%d TS=%d\n", trx->trx_no, ts); return -EIO; } /* store last frame number of RTS */ pdch->last_rts_fn = fn; - poll_fn = sched_poll(bts->bts, trx, ts, fn, block_nr, &poll_tbf, &ul_ass_tbf, - &dl_ass_tbf, &ul_ack_tbf); + poll_fn = sched_poll(trx, ts, fn, block_nr, &poll_tbf, &ul_ass_tbf, &dl_ass_tbf, &ul_ack_tbf); /* check uplink resource for polling */ if (poll_tbf) LOGP(DRLCMACSCHED, LOGL_DEBUG, "Received RTS for PDCH: TRX=%d " "TS=%d FN=%d block_nr=%d scheduling free USF for " - "polling at FN=%d of %s\n", trx, ts, fn, + "polling at FN=%d of %s\n", trx->trx_no, ts, fn, block_nr, poll_fn, tbf_name(poll_tbf)); /* use free USF */ /* else. check for sba */ - else if ((sba_fn = bts->bts->sba()->sched(trx, ts, fn, block_nr) != 0xffffffff)) + else if ((sba_fn = trx->bts->sba()->sched(trx->trx_no, ts, fn, block_nr) != 0xffffffff)) LOGP(DRLCMACSCHED, LOGL_DEBUG, "Received RTS for PDCH: TRX=%d " "TS=%d FN=%d block_nr=%d scheduling free USF for " - "single block allocation at FN=%d\n", trx, ts, fn, + "single block allocation at FN=%d\n", trx->trx_no, ts, fn, block_nr, sba_fn); /* use free USF */ /* else, we search for uplink resource */ else - usf = sched_select_uplink(trx, ts, fn, block_nr, pdch); + usf = sched_select_uplink(trx->trx_no, ts, fn, block_nr, pdch); /* Prio 1: select control message */ - msg = sched_select_ctrl_msg(trx, ts, fn, block_nr, pdch, ul_ass_tbf, - dl_ass_tbf, ul_ack_tbf); + msg = sched_select_ctrl_msg(trx->trx_no, ts, fn, block_nr, pdch, ul_ass_tbf, dl_ass_tbf, ul_ack_tbf); if (msg) { - bts->bts->rlc_sent_control(); - bts->bts->send_gsmtap(PCU_GSMTAP_C_DL_CTRL, false, trx, ts, GSMTAP_CHANNEL_PACCH, fn, msg->data, msg->len); + trx->bts->rlc_sent_control(); + trx->bts->send_gsmtap(PCU_GSMTAP_C_DL_CTRL, false, trx, ts, GSMTAP_CHANNEL_PACCH, fn, msg->data, msg->len); } /* Prio 2: select data message for downlink */ if (!msg) { - msg = sched_select_downlink(bts, trx, ts, fn, block_nr, pdch); + msg = sched_select_downlink(trx, ts, fn, block_nr, pdch); if (msg) { - bts->bts->rlc_sent(); + trx->bts->rlc_sent(); /* FIXME: distinguish between GPRS and EGPRS */ - bts->bts->send_gsmtap(PCU_GSMTAP_C_DL_DATA_GPRS, false, trx, ts, GSMTAP_CHANNEL_PDTCH, fn, msg->data, msg->len); + trx->bts->send_gsmtap(PCU_GSMTAP_C_DL_DATA_GPRS, false, trx, ts, GSMTAP_CHANNEL_PDTCH, fn, msg->data, msg->len); } } @@ -376,15 +369,15 @@ /* increase counter */ msg = sched_dummy(); if (msg) { - bts->bts->rlc_sent_dummy(); - bts->bts->send_gsmtap(PCU_GSMTAP_C_DL_DUMMY, false, trx, ts, GSMTAP_CHANNEL_PACCH, fn, msg->data, msg->len); + trx->bts->rlc_sent_dummy(); + trx->bts->send_gsmtap(PCU_GSMTAP_C_DL_DUMMY, false, trx, ts, GSMTAP_CHANNEL_PACCH, fn, msg->data, msg->len); } } if (!msg) return -ENOMEM; /* msg is now available */ - bts->bts->rlc_dl_bytes(msg->data_len); + trx->bts->rlc_dl_bytes(msg->data_len); /* set USF */ OSMO_ASSERT(msgb_length(msg) > 0); @@ -394,7 +387,7 @@ gprs_bssgp_update_frames_sent(); /* send PDTCH/PACCH to L1 */ - pcu_l1if_tx_pdtch(msg, trx, ts, bts->trx[trx].arfcn, fn, block_nr); + pcu_l1if_tx_pdtch(msg, trx->trx_no, ts, trx->arfcn, fn, block_nr); return 0; } diff --git a/src/pcu_l1_if.cpp b/src/pcu_l1_if.cpp index 8ea2ad5..b38244b 100644 --- a/src/pcu_l1_if.cpp +++ b/src/pcu_l1_if.cpp @@ -307,11 +307,13 @@ } // FIXME: remove this, when changed from c++ to c. -extern "C" int pcu_rx_rts_req_pdtch(uint8_t trx, uint8_t ts, +extern "C" int pcu_rx_rts_req_pdtch(uint8_t trx_no, uint8_t ts, uint32_t fn, uint8_t block_nr) { - return gprs_rlcmac_rcv_rts_block(bts_main_data(), - trx, ts, fn, block_nr); + struct gprs_rlcmac_bts *bts = bts_main_data(); + struct gprs_rlcmac_trx *trx = &bts->trx[trx_no]; + + return gprs_rlcmac_rcv_rts_block(trx, ts, fn, block_nr); } static int pcu_rx_rts_req(struct gsm_pcu_if_rts_req *rts_req) diff --git a/src/tbf.cpp b/src/tbf.cpp index c5f4348..f143960 100644 --- a/src/tbf.cpp +++ b/src/tbf.cpp @@ -1450,24 +1450,22 @@ return ts == control_ts; } -struct gprs_rlcmac_ul_tbf *handle_tbf_reject(struct gprs_rlcmac_bts *bts, - GprsMs *ms, uint32_t tlli, uint8_t trx_no, uint8_t ts) +struct gprs_rlcmac_ul_tbf *handle_tbf_reject(struct gprs_rlcmac_trx *trx, GprsMs *ms, uint32_t tlli, uint8_t ts) { struct gprs_rlcmac_ul_tbf *ul_tbf = NULL; - struct gprs_rlcmac_trx *trx = &bts->trx[trx_no]; ul_tbf = talloc(tall_pcu_ctx, struct gprs_rlcmac_ul_tbf); if (!ul_tbf) return ul_tbf; talloc_set_destructor(ul_tbf, ul_tbf_dtor); - new (ul_tbf) gprs_rlcmac_ul_tbf(bts->bts); + new (ul_tbf) gprs_rlcmac_ul_tbf(trx->bts); if (!ms) - ms = bts->bts->ms_alloc(0, 0); + ms = trx->bts->ms_alloc(0, 0); ms->set_tlli(tlli); - llist_add(&ul_tbf->list(), &bts->bts->ul_tbfs()); + llist_add(&ul_tbf->list(), &trx->bts->ul_tbfs()); ul_tbf->bts->tbf_ul_created(); ul_tbf->set_state(GPRS_RLCMAC_ASSIGN); ul_tbf->state_flags |= (1 << GPRS_RLCMAC_FLAG_PACCH); diff --git a/src/tbf.h b/src/tbf.h index 95e1e89..c13e61f 100644 --- a/src/tbf.h +++ b/src/tbf.h @@ -324,8 +324,7 @@ void tbf_free(struct gprs_rlcmac_tbf *tbf); -struct gprs_rlcmac_ul_tbf *handle_tbf_reject(struct gprs_rlcmac_bts *bts, - GprsMs *ms, uint32_t tlli, uint8_t trx_no, uint8_t ts_no); +struct gprs_rlcmac_ul_tbf *handle_tbf_reject(struct gprs_rlcmac_trx *trx, GprsMs *ms, uint32_t tlli, uint8_t ts_no); int tbf_assign_control_ts(struct gprs_rlcmac_tbf *tbf); diff --git a/tests/tbf/TbfTest.cpp b/tests/tbf/TbfTest.cpp index 0db7fde..886856a 100644 --- a/tests/tbf/TbfTest.cpp +++ b/tests/tbf/TbfTest.cpp @@ -203,7 +203,8 @@ uint32_t *fn, uint8_t *block_nr = NULL) { uint8_t bn = fn2bn(*fn); - gprs_rlcmac_rcv_rts_block(bts, trx_no, ts_no, *fn, bn); + struct gprs_rlcmac_trx *trx = &bts->trx[trx_no]; + gprs_rlcmac_rcv_rts_block(trx, ts_no, *fn, bn); *fn = fn_add_blocks(*fn, 1); bn += 1; if (block_nr) @@ -1651,9 +1652,8 @@ for (ts_no = 0 ; ts_no < 8; ts_no += 1) { if (!(slots & (1 << ts_no))) continue; - gprs_rlcmac_rcv_rts_block(the_bts->bts_data(), - dl_tbf->trx->trx_no, ts_no, - *fn, bn); + struct gprs_rlcmac_trx *trx = &the_bts->bts_data()->trx[dl_tbf->trx->trx_no]; + gprs_rlcmac_rcv_rts_block(trx, ts_no, *fn, bn); } *fn = fn_add_blocks(*fn, 1); } @@ -3222,17 +3222,14 @@ setup_bts(&the_bts, ts_no, 4); int rc = 0; - - ul_tbf = handle_tbf_reject(the_bts.bts_data(), NULL, tlli, - trx_no, ts_no); + struct gprs_rlcmac_trx *trx = &the_bts.bts_data()->trx[trx_no]; + ul_tbf = handle_tbf_reject(trx, NULL, tlli, ts_no); OSMO_ASSERT(ul_tbf != 0); /* trigger packet access reject */ uint8_t bn = fn2bn(fn); - - rc = gprs_rlcmac_rcv_rts_block(the_bts.bts_data(), - trx_no, ts_no, fn, bn); + rc = gprs_rlcmac_rcv_rts_block(trx, ts_no, fn, bn); OSMO_ASSERT(rc == 0); @@ -3307,9 +3304,8 @@ /* trigger packet access reject */ uint8_t bn = fn2bn(fn); - - rc = gprs_rlcmac_rcv_rts_block(the_bts.bts_data(), - trx_no, ts_no, fn, bn); + struct gprs_rlcmac_trx *trx = &the_bts.bts_data()->trx[trx_no]; + rc = gprs_rlcmac_rcv_rts_block(trx, ts_no, fn, bn); OSMO_ASSERT(rc == 0); -- To view, visit https://gerrit.osmocom.org/3150 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ia176245647c19fa1551fb6f5c8225b2529f73cbf Gerrit-PatchSet: 6 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Mon Aug 14 15:59:45 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 14 Aug 2017 15:59:45 +0000 Subject: [PATCH] osmo-pcu[master]: Move DL scheduling and RTS handler to trx level In-Reply-To: References: Message-ID: Hello Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3150 to look at the new patch set (#7). Move DL scheduling and RTS handler to trx level Use TRX object directly instead of BTS singleton and trx_no. This is necessary to facilitate the move of UL/DL TBF lists to TRX level. Change-Id: Ia176245647c19fa1551fb6f5c8225b2529f73cbf Related: OS#1541 --- M src/bts.cpp M src/bts.h M src/gprs_rlcmac.h M src/gprs_rlcmac_sched.cpp M src/pcu_l1_if.cpp M src/tbf.cpp M src/tbf.h M tests/tbf/TbfTest.cpp 8 files changed, 58 insertions(+), 68 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/50/3150/7 diff --git a/src/bts.cpp b/src/bts.cpp index add6ab3..ada8456 100644 --- a/src/bts.cpp +++ b/src/bts.cpp @@ -1375,8 +1375,7 @@ egprs_ms_class, tlli, ta, ms); if (!ul_tbf) { - handle_tbf_reject(bts_data(), ms, tlli, - trx_no(), ts_no); + handle_tbf_reject(get_trx(), ms, tlli, ts_no); return; } diff --git a/src/bts.h b/src/bts.h index 1f1dae2..71dfb7b 100644 --- a/src/bts.h +++ b/src/bts.h @@ -91,7 +91,7 @@ gprs_rlcmac_bts *bts_data() const; BTS *bts() const; uint8_t trx_no() const; - + gprs_rlcmac_trx *get_trx(); struct gprs_rlcmac_ul_tbf *ul_tbf_by_tfi(uint8_t tfi); struct gprs_rlcmac_dl_tbf *dl_tbf_by_tfi(uint8_t tfi); @@ -692,6 +692,11 @@ return trx->bts->bts_data(); } +inline gprs_rlcmac_trx *gprs_rlcmac_pdch::get_trx() +{ + return trx; +} + inline uint8_t gprs_rlcmac_pdch::trx_no() const { return trx->trx_no; diff --git a/src/gprs_rlcmac.h b/src/gprs_rlcmac.h index be1e686..3d825a8 100644 --- a/src/gprs_rlcmac.h +++ b/src/gprs_rlcmac.h @@ -89,9 +89,7 @@ int gprs_rlcmac_paging_request(uint8_t *ptmsi, uint16_t ptmsi_len, const char *imsi); -int gprs_rlcmac_rcv_rts_block(struct gprs_rlcmac_bts *bts, - uint8_t trx, uint8_t ts, - uint32_t fn, uint8_t block_nr); +int gprs_rlcmac_rcv_rts_block(struct gprs_rlcmac_trx *trx, uint8_t ts, uint32_t fn, uint8_t block_nr); int gprs_alloc_max_dl_slots_per_ms(struct gprs_rlcmac_bts *bts, uint8_t ms_class = 0); diff --git a/src/gprs_rlcmac_sched.cpp b/src/gprs_rlcmac_sched.cpp index 42f0308..af9c3bf 100644 --- a/src/gprs_rlcmac_sched.cpp +++ b/src/gprs_rlcmac_sched.cpp @@ -25,12 +25,10 @@ #include "pcu_utils.h" -static uint32_t sched_poll(BTS *bts, - uint8_t trx, uint8_t ts, uint32_t fn, uint8_t block_nr, - struct gprs_rlcmac_tbf **poll_tbf, - struct gprs_rlcmac_tbf **ul_ass_tbf, - struct gprs_rlcmac_tbf **dl_ass_tbf, - struct gprs_rlcmac_ul_tbf **ul_ack_tbf) +static uint32_t sched_poll(struct gprs_rlcmac_trx *trx, uint8_t ts, uint32_t fn, uint8_t block_nr, + struct gprs_rlcmac_tbf **poll_tbf, + struct gprs_rlcmac_tbf **ul_ass_tbf, struct gprs_rlcmac_tbf **dl_ass_tbf, + struct gprs_rlcmac_ul_tbf **ul_ack_tbf) { struct gprs_rlcmac_ul_tbf *ul_tbf; struct gprs_rlcmac_dl_tbf *dl_tbf; @@ -42,11 +40,11 @@ if ((block_nr % 3) == 2) poll_fn ++; poll_fn = poll_fn % GSM_MAX_FN; - llist_for_each(pos, &bts->ul_tbfs()) { + llist_for_each(pos, &trx->bts->ul_tbfs()) { ul_tbf = as_ul_tbf(pos->entry()); OSMO_ASSERT(ul_tbf); /* this trx, this ts */ - if (ul_tbf->trx->trx_no != trx || !ul_tbf->is_control_ts(ts)) + if (ul_tbf->trx->trx_no != trx->trx_no || !ul_tbf->is_control_ts(ts)) continue; /* polling for next uplink block */ if (ul_tbf->poll_state == GPRS_RLCMAC_POLL_SCHED @@ -62,11 +60,11 @@ *ul_ass_tbf = ul_tbf; #warning "Is this supposed to be fair? The last TBF for each wins? Maybe use llist_add_tail and skip once we have all states?" } - llist_for_each(pos, &bts->dl_tbfs()) { + llist_for_each(pos, &trx->bts->dl_tbfs()) { dl_tbf = as_dl_tbf(pos->entry()); OSMO_ASSERT(dl_tbf); /* this trx, this ts */ - if (dl_tbf->trx->trx_no != trx || !dl_tbf->is_control_ts(ts)) + if (dl_tbf->trx->trx_no != trx->trx_no || !dl_tbf->is_control_ts(ts)) continue; /* polling for next uplink block */ if (dl_tbf->poll_state == GPRS_RLCMAC_POLL_SCHED @@ -206,9 +204,8 @@ return NULL; } -static struct msgb *sched_select_downlink(struct gprs_rlcmac_bts *bts, - uint8_t trx, uint8_t ts, uint32_t fn, - uint8_t block_nr, struct gprs_rlcmac_pdch *pdch) +static struct msgb *sched_select_downlink(struct gprs_rlcmac_trx *trx, uint8_t ts, uint32_t fn, uint8_t block_nr, + struct gprs_rlcmac_pdch *pdch) { struct msgb *msg = NULL; struct gprs_rlcmac_dl_tbf *tbf, *prio_tbf = NULL; @@ -225,7 +222,7 @@ int age; const int age_thresh1 = msecs_to_frames(200); const int high_prio_msecs = - OSMO_MIN(BTS::TIMER_T3190_MSEC/2, bts->dl_tbf_idle_msec); + OSMO_MIN(BTS::TIMER_T3190_MSEC/2, trx->bts->bts_data()->dl_tbf_idle_msec); const int age_thresh2 = msecs_to_frames(high_prio_msecs); /* select downlink resource */ @@ -277,7 +274,7 @@ if (prio_tbf) { LOGP(DRLCMACSCHED, LOGL_DEBUG, "Scheduling data message at " "RTS for DL TFI=%d (TRX=%d, TS=%d) prio=%d\n", - prio_tfi, trx, ts, max_prio); + prio_tfi, trx->trx_no, ts, max_prio); /* next TBF to handle resource is the next one */ pdch->next_dl_tfi = (prio_tfi + 1) & 31; /* generate DL data block */ @@ -307,9 +304,7 @@ return msg; } -int gprs_rlcmac_rcv_rts_block(struct gprs_rlcmac_bts *bts, - uint8_t trx, uint8_t ts, - uint32_t fn, uint8_t block_nr) +int gprs_rlcmac_rcv_rts_block(struct gprs_rlcmac_trx *trx, uint8_t ts, uint32_t fn, uint8_t block_nr) { struct gprs_rlcmac_pdch *pdch; struct gprs_rlcmac_tbf *poll_tbf = NULL, *dl_ass_tbf = NULL, @@ -319,55 +314,53 @@ struct msgb *msg = NULL; uint32_t poll_fn, sba_fn; - if (trx >= 8 || ts >= 8) + if (trx->trx_no >= 8 || ts >= 8) return -EINVAL; - pdch = &bts->trx[trx].pdch[ts]; + pdch = &trx->pdch[ts]; if (!pdch->is_enabled()) { LOGP(DRLCMACSCHED, LOGL_ERROR, "Received RTS on disabled PDCH: " - "TRX=%d TS=%d\n", trx, ts); + "TRX=%d TS=%d\n", trx->trx_no, ts); return -EIO; } /* store last frame number of RTS */ pdch->last_rts_fn = fn; - poll_fn = sched_poll(bts->bts, trx, ts, fn, block_nr, &poll_tbf, &ul_ass_tbf, - &dl_ass_tbf, &ul_ack_tbf); + poll_fn = sched_poll(trx, ts, fn, block_nr, &poll_tbf, &ul_ass_tbf, &dl_ass_tbf, &ul_ack_tbf); /* check uplink resource for polling */ if (poll_tbf) LOGP(DRLCMACSCHED, LOGL_DEBUG, "Received RTS for PDCH: TRX=%d " "TS=%d FN=%d block_nr=%d scheduling free USF for " - "polling at FN=%d of %s\n", trx, ts, fn, + "polling at FN=%d of %s\n", trx->trx_no, ts, fn, block_nr, poll_fn, tbf_name(poll_tbf)); /* use free USF */ /* else. check for sba */ - else if ((sba_fn = bts->bts->sba()->sched(trx, ts, fn, block_nr) != 0xffffffff)) + else if ((sba_fn = trx->bts->sba()->sched(trx->trx_no, ts, fn, block_nr) != 0xffffffff)) LOGP(DRLCMACSCHED, LOGL_DEBUG, "Received RTS for PDCH: TRX=%d " "TS=%d FN=%d block_nr=%d scheduling free USF for " - "single block allocation at FN=%d\n", trx, ts, fn, + "single block allocation at FN=%d\n", trx->trx_no, ts, fn, block_nr, sba_fn); /* use free USF */ /* else, we search for uplink resource */ else - usf = sched_select_uplink(trx, ts, fn, block_nr, pdch); + usf = sched_select_uplink(trx->trx_no, ts, fn, block_nr, pdch); /* Prio 1: select control message */ - msg = sched_select_ctrl_msg(trx, ts, fn, block_nr, pdch, ul_ass_tbf, - dl_ass_tbf, ul_ack_tbf); + msg = sched_select_ctrl_msg(trx->trx_no, ts, fn, block_nr, pdch, ul_ass_tbf, dl_ass_tbf, ul_ack_tbf); if (msg) { - bts->bts->rlc_sent_control(); - bts->bts->send_gsmtap(PCU_GSMTAP_C_DL_CTRL, false, trx, ts, GSMTAP_CHANNEL_PACCH, fn, msg->data, msg->len); + trx->bts->rlc_sent_control(); + trx->bts->send_gsmtap(PCU_GSMTAP_C_DL_CTRL, false, trx->trx_no, ts, GSMTAP_CHANNEL_PACCH, fn, msg->data, msg->len); } /* Prio 2: select data message for downlink */ if (!msg) { - msg = sched_select_downlink(bts, trx, ts, fn, block_nr, pdch); + msg = sched_select_downlink(trx, ts, fn, block_nr, pdch); if (msg) { - bts->bts->rlc_sent(); + trx->bts->rlc_sent(); /* FIXME: distinguish between GPRS and EGPRS */ - bts->bts->send_gsmtap(PCU_GSMTAP_C_DL_DATA_GPRS, false, trx, ts, GSMTAP_CHANNEL_PDTCH, fn, msg->data, msg->len); + trx->bts->send_gsmtap(PCU_GSMTAP_C_DL_DATA_GPRS, false, trx->trx_no, ts, GSMTAP_CHANNEL_PDTCH, fn, msg->data, msg->len); } } @@ -376,15 +369,15 @@ /* increase counter */ msg = sched_dummy(); if (msg) { - bts->bts->rlc_sent_dummy(); - bts->bts->send_gsmtap(PCU_GSMTAP_C_DL_DUMMY, false, trx, ts, GSMTAP_CHANNEL_PACCH, fn, msg->data, msg->len); + trx->bts->rlc_sent_dummy(); + trx->bts->send_gsmtap(PCU_GSMTAP_C_DL_DUMMY, false, trx->trx_no, ts, GSMTAP_CHANNEL_PACCH, fn, msg->data, msg->len); } } if (!msg) return -ENOMEM; /* msg is now available */ - bts->bts->rlc_dl_bytes(msg->data_len); + trx->bts->rlc_dl_bytes(msg->data_len); /* set USF */ OSMO_ASSERT(msgb_length(msg) > 0); @@ -394,7 +387,7 @@ gprs_bssgp_update_frames_sent(); /* send PDTCH/PACCH to L1 */ - pcu_l1if_tx_pdtch(msg, trx, ts, bts->trx[trx].arfcn, fn, block_nr); + pcu_l1if_tx_pdtch(msg, trx->trx_no, ts, trx->arfcn, fn, block_nr); return 0; } diff --git a/src/pcu_l1_if.cpp b/src/pcu_l1_if.cpp index 8ea2ad5..b38244b 100644 --- a/src/pcu_l1_if.cpp +++ b/src/pcu_l1_if.cpp @@ -307,11 +307,13 @@ } // FIXME: remove this, when changed from c++ to c. -extern "C" int pcu_rx_rts_req_pdtch(uint8_t trx, uint8_t ts, +extern "C" int pcu_rx_rts_req_pdtch(uint8_t trx_no, uint8_t ts, uint32_t fn, uint8_t block_nr) { - return gprs_rlcmac_rcv_rts_block(bts_main_data(), - trx, ts, fn, block_nr); + struct gprs_rlcmac_bts *bts = bts_main_data(); + struct gprs_rlcmac_trx *trx = &bts->trx[trx_no]; + + return gprs_rlcmac_rcv_rts_block(trx, ts, fn, block_nr); } static int pcu_rx_rts_req(struct gsm_pcu_if_rts_req *rts_req) diff --git a/src/tbf.cpp b/src/tbf.cpp index c5f4348..f143960 100644 --- a/src/tbf.cpp +++ b/src/tbf.cpp @@ -1450,24 +1450,22 @@ return ts == control_ts; } -struct gprs_rlcmac_ul_tbf *handle_tbf_reject(struct gprs_rlcmac_bts *bts, - GprsMs *ms, uint32_t tlli, uint8_t trx_no, uint8_t ts) +struct gprs_rlcmac_ul_tbf *handle_tbf_reject(struct gprs_rlcmac_trx *trx, GprsMs *ms, uint32_t tlli, uint8_t ts) { struct gprs_rlcmac_ul_tbf *ul_tbf = NULL; - struct gprs_rlcmac_trx *trx = &bts->trx[trx_no]; ul_tbf = talloc(tall_pcu_ctx, struct gprs_rlcmac_ul_tbf); if (!ul_tbf) return ul_tbf; talloc_set_destructor(ul_tbf, ul_tbf_dtor); - new (ul_tbf) gprs_rlcmac_ul_tbf(bts->bts); + new (ul_tbf) gprs_rlcmac_ul_tbf(trx->bts); if (!ms) - ms = bts->bts->ms_alloc(0, 0); + ms = trx->bts->ms_alloc(0, 0); ms->set_tlli(tlli); - llist_add(&ul_tbf->list(), &bts->bts->ul_tbfs()); + llist_add(&ul_tbf->list(), &trx->bts->ul_tbfs()); ul_tbf->bts->tbf_ul_created(); ul_tbf->set_state(GPRS_RLCMAC_ASSIGN); ul_tbf->state_flags |= (1 << GPRS_RLCMAC_FLAG_PACCH); diff --git a/src/tbf.h b/src/tbf.h index 95e1e89..c13e61f 100644 --- a/src/tbf.h +++ b/src/tbf.h @@ -324,8 +324,7 @@ void tbf_free(struct gprs_rlcmac_tbf *tbf); -struct gprs_rlcmac_ul_tbf *handle_tbf_reject(struct gprs_rlcmac_bts *bts, - GprsMs *ms, uint32_t tlli, uint8_t trx_no, uint8_t ts_no); +struct gprs_rlcmac_ul_tbf *handle_tbf_reject(struct gprs_rlcmac_trx *trx, GprsMs *ms, uint32_t tlli, uint8_t ts_no); int tbf_assign_control_ts(struct gprs_rlcmac_tbf *tbf); diff --git a/tests/tbf/TbfTest.cpp b/tests/tbf/TbfTest.cpp index 0db7fde..886856a 100644 --- a/tests/tbf/TbfTest.cpp +++ b/tests/tbf/TbfTest.cpp @@ -203,7 +203,8 @@ uint32_t *fn, uint8_t *block_nr = NULL) { uint8_t bn = fn2bn(*fn); - gprs_rlcmac_rcv_rts_block(bts, trx_no, ts_no, *fn, bn); + struct gprs_rlcmac_trx *trx = &bts->trx[trx_no]; + gprs_rlcmac_rcv_rts_block(trx, ts_no, *fn, bn); *fn = fn_add_blocks(*fn, 1); bn += 1; if (block_nr) @@ -1651,9 +1652,8 @@ for (ts_no = 0 ; ts_no < 8; ts_no += 1) { if (!(slots & (1 << ts_no))) continue; - gprs_rlcmac_rcv_rts_block(the_bts->bts_data(), - dl_tbf->trx->trx_no, ts_no, - *fn, bn); + struct gprs_rlcmac_trx *trx = &the_bts->bts_data()->trx[dl_tbf->trx->trx_no]; + gprs_rlcmac_rcv_rts_block(trx, ts_no, *fn, bn); } *fn = fn_add_blocks(*fn, 1); } @@ -3222,17 +3222,14 @@ setup_bts(&the_bts, ts_no, 4); int rc = 0; - - ul_tbf = handle_tbf_reject(the_bts.bts_data(), NULL, tlli, - trx_no, ts_no); + struct gprs_rlcmac_trx *trx = &the_bts.bts_data()->trx[trx_no]; + ul_tbf = handle_tbf_reject(trx, NULL, tlli, ts_no); OSMO_ASSERT(ul_tbf != 0); /* trigger packet access reject */ uint8_t bn = fn2bn(fn); - - rc = gprs_rlcmac_rcv_rts_block(the_bts.bts_data(), - trx_no, ts_no, fn, bn); + rc = gprs_rlcmac_rcv_rts_block(trx, ts_no, fn, bn); OSMO_ASSERT(rc == 0); @@ -3307,9 +3304,8 @@ /* trigger packet access reject */ uint8_t bn = fn2bn(fn); - - rc = gprs_rlcmac_rcv_rts_block(the_bts.bts_data(), - trx_no, ts_no, fn, bn); + struct gprs_rlcmac_trx *trx = &the_bts.bts_data()->trx[trx_no]; + rc = gprs_rlcmac_rcv_rts_block(trx, ts_no, fn, bn); OSMO_ASSERT(rc == 0); -- To view, visit https://gerrit.osmocom.org/3150 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ia176245647c19fa1551fb6f5c8225b2529f73cbf Gerrit-PatchSet: 7 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Mon Aug 14 16:11:26 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 14 Aug 2017 16:11:26 +0000 Subject: openbsc[master]: LIBMSC: Use sms->text, not sms->user_data to construct repor... In-Reply-To: References: Message-ID: Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3517 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Id51bc9483ad6f52d6da74135605cfd12434c7c96 Gerrit-PatchSet: 3 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Keith Whyte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pablo Neira Ayuso Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Aug 14 16:53:04 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 14 Aug 2017 16:53:04 +0000 Subject: osmo-msc[master]: rework debian packages support In-Reply-To: References: Message-ID: Patch Set 1: How was this tested? It seems to require .deb from osmo-iuh but I have trouble building master. Shall I use specific branch? -- To view, visit https://gerrit.osmocom.org/3499 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I77544cb38c31777c3fab52979d19488a63e52de3 Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: lynxis lazus Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Aug 14 16:59:15 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 14 Aug 2017 16:59:15 +0000 Subject: osmo-pcu[master]: Forward GPRS SUSPEND REQ from BTS to SGSN using BSSGP In-Reply-To: References: Message-ID: Patch Set 3: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/3384 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I7b4beb413a6f974373a404b5a11c44d86ba695d3 Gerrit-PatchSet: 3 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Aug 14 17:03:44 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 14 Aug 2017 17:03:44 +0000 Subject: libosmocore[master]: Fix LAPD UA msgb memory leak. In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/3257 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ia4f0606810e00aa6f1779d11893e4acc01976f9a Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: jfdionne Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Aug 14 17:12:05 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 14 Aug 2017 17:12:05 +0000 Subject: [PATCH] libsmpp34[master]: Use osmocom-style versioning in Makefile, configure, debian/... Message-ID: Review at https://gerrit.osmocom.org/3518 Use osmocom-style versioning in Makefile, configure, debian/rules We have a particular method of generating package version information in the Osmocom project, based on a 'git-version-gen' script that looks up the latest git tag and generates a version from that. This version is then used in pkgconfig, etc. Change-Id: I1e6ed7af7107f8a74010721acd34f92a3237a7a1 --- M Makefile.am M configure.ac M debian/rules A git-version-gen 4 files changed, 166 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/libsmpp34 refs/changes/18/3518/1 diff --git a/Makefile.am b/Makefile.am index 752e34e..b274f45 100644 --- a/Makefile.am +++ b/Makefile.am @@ -4,6 +4,12 @@ SUBDIRS += test_apps endif +BUILT_SOURCES = $(top_srcdir)/.version +$(top_srcdir)/.version: + echo $(VERSION) > $@-t && mv $@-t $@ +dist-hook: + echo $(VERSION) > $(distdir)/.tarball-version + EXTRA_DIST = src/Makefile.am\ test_pdu/Makefile.am\ test_apps/Makefile.am \ diff --git a/configure.ac b/configure.ac index 9f816bb..0354ab9 100644 --- a/configure.ac +++ b/configure.ac @@ -2,7 +2,8 @@ # Process this file with autoconf to produce a configure script. AC_PREREQ(2.57) -AC_INIT(libsmpp34, 1.10, ultraismo at yahoo.com) +AC_INIT(libsmpp34, m4_esyscmd([./git-version-gen .tarball-version]), ultraismo at yahoo.com) + AC_CONFIG_AUX_DIR(aux_config) AM_INIT_AUTOMAKE([foreign]) AM_CONFIG_HEADER([aux_config/config.h]) diff --git a/debian/rules b/debian/rules index 7b245b1..bedd9e0 100755 --- a/debian/rules +++ b/debian/rules @@ -4,9 +4,16 @@ #export DH_VERBOSE=1 export DEB_BUILD_MAINT_OPTIONS = hardening=+all +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') + %: dh $@ --with autoreconf --fail-missing override_dh_strip: dh_strip --dbg-package=libsmpp34-dbg +override_dh_autoreconf: + echo $(VERSION) > .tarball-version + dh_autoreconf diff --git a/git-version-gen b/git-version-gen new file mode 100755 index 0000000..42cf3d2 --- /dev/null +++ b/git-version-gen @@ -0,0 +1,151 @@ +#!/bin/sh +# Print a version string. +scriptversion=2010-01-28.01 + +# Copyright (C) 2007-2010 Free Software Foundation, Inc. +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +# This script is derived from GIT-VERSION-GEN from GIT: http://git.or.cz/. +# It may be run two ways: +# - from a git repository in which the "git describe" command below +# produces useful output (thus requiring at least one signed tag) +# - from a non-git-repo directory containing a .tarball-version file, which +# presumes this script is invoked like "./git-version-gen .tarball-version". + +# In order to use intra-version strings in your project, you will need two +# separate generated version string files: +# +# .tarball-version - present only in a distribution tarball, and not in +# a checked-out repository. Created with contents that were learned at +# the last time autoconf was run, and used by git-version-gen. Must not +# be present in either $(srcdir) or $(builddir) for git-version-gen to +# give accurate answers during normal development with a checked out tree, +# but must be present in a tarball when there is no version control system. +# Therefore, it cannot be used in any dependencies. GNUmakefile has +# hooks to force a reconfigure at distribution time to get the value +# correct, without penalizing normal development with extra reconfigures. +# +# .version - present in a checked-out repository and in a distribution +# tarball. Usable in dependencies, particularly for files that don't +# want to depend on config.h but do want to track version changes. +# Delete this file prior to any autoconf run where you want to rebuild +# files to pick up a version string change; and leave it stale to +# minimize rebuild time after unrelated changes to configure sources. +# +# It is probably wise to add these two files to .gitignore, so that you +# don't accidentally commit either generated file. +# +# Use the following line in your configure.ac, so that $(VERSION) will +# automatically be up-to-date each time configure is run (and note that +# since configure.ac no longer includes a version string, Makefile rules +# should not depend on configure.ac for version updates). +# +# AC_INIT([GNU project], +# m4_esyscmd([build-aux/git-version-gen .tarball-version]), +# [bug-project at example]) +# +# Then use the following lines in your Makefile.am, so that .version +# will be present for dependencies, and so that .tarball-version will +# exist in distribution tarballs. +# +# BUILT_SOURCES = $(top_srcdir)/.version +# $(top_srcdir)/.version: +# echo $(VERSION) > $@-t && mv $@-t $@ +# dist-hook: +# echo $(VERSION) > $(distdir)/.tarball-version + +case $# in + 1) ;; + *) echo 1>&2 "Usage: $0 \$srcdir/.tarball-version"; exit 1;; +esac + +tarball_version_file=$1 +nl=' +' + +# First see if there is a tarball-only version file. +# then try "git describe", then default. +if test -f $tarball_version_file +then + v=`cat $tarball_version_file` || exit 1 + case $v in + *$nl*) v= ;; # reject multi-line output + [0-9]*) ;; + *) v= ;; + esac + test -z "$v" \ + && echo "$0: WARNING: $tarball_version_file seems to be damaged" 1>&2 +fi + +if test -n "$v" +then + : # use $v +elif + v=`git describe --abbrev=4 --match='v*' HEAD 2>/dev/null \ + || git describe --abbrev=4 HEAD 2>/dev/null` \ + && case $v in + [0-9]*) ;; + v[0-9]*) ;; + *) (exit 1) ;; + esac +then + # Is this a new git that lists number of commits since the last + # tag or the previous older version that did not? + # Newer: v6.10-77-g0f8faeb + # Older: v6.10-g0f8faeb + case $v in + *-*-*) : git describe is okay three part flavor ;; + *-*) + : git describe is older two part flavor + # Recreate the number of commits and rewrite such that the + # result is the same as if we were using the newer version + # of git describe. + vtag=`echo "$v" | sed 's/-.*//'` + numcommits=`git rev-list "$vtag"..HEAD | wc -l` + v=`echo "$v" | sed "s/\(.*\)-\(.*\)/\1-$numcommits-\2/"`; + ;; + esac + + # Change the first '-' to a '.', so version-comparing tools work properly. + # Remove the "g" in git describe's output string, to save a byte. + v=`echo "$v" | sed 's/-/./;s/\(.*\)-g/\1-/'`; +else + v=UNKNOWN +fi + +v=`echo "$v" |sed 's/^v//'` + +# Don't declare a version "dirty" merely because a time stamp has changed. +git status > /dev/null 2>&1 + +dirty=`sh -c 'git diff-index --name-only HEAD' 2>/dev/null` || dirty= +case "$dirty" in + '') ;; + *) # Append the suffix only if there isn't one already. + case $v in + *-dirty) ;; + *) v="$v-dirty" ;; + esac ;; +esac + +# Omit the trailing newline, so that m4_esyscmd can use the result directly. +echo "$v" | tr -d '\012' + +# Local variables: +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "scriptversion=" +# time-stamp-format: "%:y-%02m-%02d.%02H" +# time-stamp-end: "$" +# End: -- To view, visit https://gerrit.osmocom.org/3518 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I1e6ed7af7107f8a74010721acd34f92a3237a7a1 Gerrit-PatchSet: 1 Gerrit-Project: libsmpp34 Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Mon Aug 14 17:12:05 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 14 Aug 2017 17:12:05 +0000 Subject: [PATCH] libsmpp34[master]: update .gitignore Message-ID: Review at https://gerrit.osmocom.org/3519 update .gitignore Change-Id: Ie294cb355a6618295e9864358413052837c35a03 --- M .gitignore 1 file changed, 7 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libsmpp34 refs/changes/19/3519/1 diff --git a/.gitignore b/.gitignore index dd8c4d6..20adb5a 100644 --- a/.gitignore +++ b/.gitignore @@ -12,3 +12,10 @@ config.status libsmpp34.pc libtool +.version +.tarball-version +debian/.debhelper +debian/autoreconf* +debian/tmp +debian/*.log +debian/*.substvars -- To view, visit https://gerrit.osmocom.org/3519 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ie294cb355a6618295e9864358413052837c35a03 Gerrit-PatchSet: 1 Gerrit-Project: libsmpp34 Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Mon Aug 14 17:12:06 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 14 Aug 2017 17:12:06 +0000 Subject: [PATCH] libsmpp34[master]: prepare for 1.12 release Message-ID: Review at https://gerrit.osmocom.org/3520 prepare for 1.12 release Change-Id: If21d2456dd8ebf4bcea0592a841741269b33a308 --- M debian/changelog 1 file changed, 9 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libsmpp34 refs/changes/20/3520/1 diff --git a/debian/changelog b/debian/changelog index aae6e0d..c0c3948 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,8 +1,15 @@ -libsmpp34 (1.11) UNRELEASED; urgency=medium +libsmpp34 (1.12) UNRELEASED; urgency=medium + [ Holger Hans Peter Freyther ] * Move forward towards a new release. - -- Holger Hans Peter Freyther Tue, 24 May 2016 23:07:49 +0200 + [ Harald Welte ] + * it's been four years with various cleanups + * SMPP_DELIVERY_RECEIPT_* constants + * SMPP ESM class parameter definitions + * smpp34_tlv_for_each() helper macro + + -- Harald Welte Mon, 14 Aug 2017 19:08:37 +0200 libsmpp34 (1.10z1) stable; urgency=low -- To view, visit https://gerrit.osmocom.org/3520 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: If21d2456dd8ebf4bcea0592a841741269b33a308 Gerrit-PatchSet: 1 Gerrit-Project: libsmpp34 Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Mon Aug 14 17:13:12 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Mon, 14 Aug 2017 17:13:12 +0000 Subject: [PATCH] libosmo-netif[master]: osmux: Fix buffer overflow in osmux_snprintf Message-ID: Review at https://gerrit.osmocom.org/3521 osmux: Fix buffer overflow in osmux_snprintf When running osmux_test on my PC, the process was aborted with a "stack smashing detected" error. Change-Id: I8a7cc422c181c0c5712ac8976a5be5f0ad44a9c0 --- M src/osmux.c 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-netif refs/changes/21/3521/1 diff --git a/src/osmux.c b/src/osmux.c index 23a6440..2481d6a 100644 --- a/src/osmux.c +++ b/src/osmux.c @@ -847,7 +847,7 @@ } #define SNPRINTF_BUFFER_SIZE(ret, size, len, offset) \ - size += ret; \ + size -= ret; \ if (ret > len) \ ret = len; \ offset += ret; \ -- To view, visit https://gerrit.osmocom.org/3521 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I8a7cc422c181c0c5712ac8976a5be5f0ad44a9c0 Gerrit-PatchSet: 1 Gerrit-Project: libosmo-netif Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Mon Aug 14 17:13:12 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Mon, 14 Aug 2017 17:13:12 +0000 Subject: [PATCH] libosmo-netif[master]: osmux: Slightly improve output format of osmux_snprintf Message-ID: Review at https://gerrit.osmocom.org/3522 osmux: Slightly improve output format of osmux_snprintf The buffer for osmux_test is increased as the former doesn't seem to be able to cope with the whole output. Change-Id: Ic838dd9d7ad89b4510ccfa58c0390c69a075b616 --- M src/osmux.c M tests/osmux/osmux_test.c 2 files changed, 5 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-netif refs/changes/22/3522/1 diff --git a/src/osmux.c b/src/osmux.c index 2481d6a..b3c43e2 100644 --- a/src/osmux.c +++ b/src/osmux.c @@ -877,12 +877,15 @@ int ret, i; int len = size, offset = 0; + ret = snprintf(buf+offset, len, "[ "); + SNPRINTF_BUFFER_SIZE(ret, size, len, offset); + for (i=0; i From gerrit-no-reply at lists.osmocom.org Mon Aug 14 17:13:49 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 14 Aug 2017 17:13:49 +0000 Subject: libosmo-netif[master]: osmux: Fix buffer overflow in osmux_snprintf In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3521 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I8a7cc422c181c0c5712ac8976a5be5f0ad44a9c0 Gerrit-PatchSet: 1 Gerrit-Project: libosmo-netif Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Aug 14 17:14:13 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 14 Aug 2017 17:14:13 +0000 Subject: libosmo-netif[master]: osmux: Slightly improve output format of osmux_snprintf In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3522 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ic838dd9d7ad89b4510ccfa58c0390c69a075b616 Gerrit-PatchSet: 1 Gerrit-Project: libosmo-netif Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Aug 14 17:14:21 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 14 Aug 2017 17:14:21 +0000 Subject: libsmpp34[master]: prepare for 1.12 release In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3520 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: If21d2456dd8ebf4bcea0592a841741269b33a308 Gerrit-PatchSet: 1 Gerrit-Project: libsmpp34 Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Aug 14 17:14:24 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 14 Aug 2017 17:14:24 +0000 Subject: libsmpp34[master]: update .gitignore In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3519 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ie294cb355a6618295e9864358413052837c35a03 Gerrit-PatchSet: 1 Gerrit-Project: libsmpp34 Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Aug 14 17:14:25 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 14 Aug 2017 17:14:25 +0000 Subject: libsmpp34[master]: Use osmocom-style versioning in Makefile, configure, debian/... In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3518 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I1e6ed7af7107f8a74010721acd34f92a3237a7a1 Gerrit-PatchSet: 1 Gerrit-Project: libsmpp34 Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Aug 14 17:14:28 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 14 Aug 2017 17:14:28 +0000 Subject: [MERGED] libsmpp34[master]: Use osmocom-style versioning in Makefile, configure, debian/... In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Use osmocom-style versioning in Makefile, configure, debian/rules ...................................................................... Use osmocom-style versioning in Makefile, configure, debian/rules We have a particular method of generating package version information in the Osmocom project, based on a 'git-version-gen' script that looks up the latest git tag and generates a version from that. This version is then used in pkgconfig, etc. Change-Id: I1e6ed7af7107f8a74010721acd34f92a3237a7a1 --- M Makefile.am M configure.ac M debian/rules A git-version-gen 4 files changed, 166 insertions(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/Makefile.am b/Makefile.am index 752e34e..b274f45 100644 --- a/Makefile.am +++ b/Makefile.am @@ -4,6 +4,12 @@ SUBDIRS += test_apps endif +BUILT_SOURCES = $(top_srcdir)/.version +$(top_srcdir)/.version: + echo $(VERSION) > $@-t && mv $@-t $@ +dist-hook: + echo $(VERSION) > $(distdir)/.tarball-version + EXTRA_DIST = src/Makefile.am\ test_pdu/Makefile.am\ test_apps/Makefile.am \ diff --git a/configure.ac b/configure.ac index 9f816bb..0354ab9 100644 --- a/configure.ac +++ b/configure.ac @@ -2,7 +2,8 @@ # Process this file with autoconf to produce a configure script. AC_PREREQ(2.57) -AC_INIT(libsmpp34, 1.10, ultraismo at yahoo.com) +AC_INIT(libsmpp34, m4_esyscmd([./git-version-gen .tarball-version]), ultraismo at yahoo.com) + AC_CONFIG_AUX_DIR(aux_config) AM_INIT_AUTOMAKE([foreign]) AM_CONFIG_HEADER([aux_config/config.h]) diff --git a/debian/rules b/debian/rules index 7b245b1..bedd9e0 100755 --- a/debian/rules +++ b/debian/rules @@ -4,9 +4,16 @@ #export DH_VERBOSE=1 export DEB_BUILD_MAINT_OPTIONS = hardening=+all +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') + %: dh $@ --with autoreconf --fail-missing override_dh_strip: dh_strip --dbg-package=libsmpp34-dbg +override_dh_autoreconf: + echo $(VERSION) > .tarball-version + dh_autoreconf diff --git a/git-version-gen b/git-version-gen new file mode 100755 index 0000000..42cf3d2 --- /dev/null +++ b/git-version-gen @@ -0,0 +1,151 @@ +#!/bin/sh +# Print a version string. +scriptversion=2010-01-28.01 + +# Copyright (C) 2007-2010 Free Software Foundation, Inc. +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +# This script is derived from GIT-VERSION-GEN from GIT: http://git.or.cz/. +# It may be run two ways: +# - from a git repository in which the "git describe" command below +# produces useful output (thus requiring at least one signed tag) +# - from a non-git-repo directory containing a .tarball-version file, which +# presumes this script is invoked like "./git-version-gen .tarball-version". + +# In order to use intra-version strings in your project, you will need two +# separate generated version string files: +# +# .tarball-version - present only in a distribution tarball, and not in +# a checked-out repository. Created with contents that were learned at +# the last time autoconf was run, and used by git-version-gen. Must not +# be present in either $(srcdir) or $(builddir) for git-version-gen to +# give accurate answers during normal development with a checked out tree, +# but must be present in a tarball when there is no version control system. +# Therefore, it cannot be used in any dependencies. GNUmakefile has +# hooks to force a reconfigure at distribution time to get the value +# correct, without penalizing normal development with extra reconfigures. +# +# .version - present in a checked-out repository and in a distribution +# tarball. Usable in dependencies, particularly for files that don't +# want to depend on config.h but do want to track version changes. +# Delete this file prior to any autoconf run where you want to rebuild +# files to pick up a version string change; and leave it stale to +# minimize rebuild time after unrelated changes to configure sources. +# +# It is probably wise to add these two files to .gitignore, so that you +# don't accidentally commit either generated file. +# +# Use the following line in your configure.ac, so that $(VERSION) will +# automatically be up-to-date each time configure is run (and note that +# since configure.ac no longer includes a version string, Makefile rules +# should not depend on configure.ac for version updates). +# +# AC_INIT([GNU project], +# m4_esyscmd([build-aux/git-version-gen .tarball-version]), +# [bug-project at example]) +# +# Then use the following lines in your Makefile.am, so that .version +# will be present for dependencies, and so that .tarball-version will +# exist in distribution tarballs. +# +# BUILT_SOURCES = $(top_srcdir)/.version +# $(top_srcdir)/.version: +# echo $(VERSION) > $@-t && mv $@-t $@ +# dist-hook: +# echo $(VERSION) > $(distdir)/.tarball-version + +case $# in + 1) ;; + *) echo 1>&2 "Usage: $0 \$srcdir/.tarball-version"; exit 1;; +esac + +tarball_version_file=$1 +nl=' +' + +# First see if there is a tarball-only version file. +# then try "git describe", then default. +if test -f $tarball_version_file +then + v=`cat $tarball_version_file` || exit 1 + case $v in + *$nl*) v= ;; # reject multi-line output + [0-9]*) ;; + *) v= ;; + esac + test -z "$v" \ + && echo "$0: WARNING: $tarball_version_file seems to be damaged" 1>&2 +fi + +if test -n "$v" +then + : # use $v +elif + v=`git describe --abbrev=4 --match='v*' HEAD 2>/dev/null \ + || git describe --abbrev=4 HEAD 2>/dev/null` \ + && case $v in + [0-9]*) ;; + v[0-9]*) ;; + *) (exit 1) ;; + esac +then + # Is this a new git that lists number of commits since the last + # tag or the previous older version that did not? + # Newer: v6.10-77-g0f8faeb + # Older: v6.10-g0f8faeb + case $v in + *-*-*) : git describe is okay three part flavor ;; + *-*) + : git describe is older two part flavor + # Recreate the number of commits and rewrite such that the + # result is the same as if we were using the newer version + # of git describe. + vtag=`echo "$v" | sed 's/-.*//'` + numcommits=`git rev-list "$vtag"..HEAD | wc -l` + v=`echo "$v" | sed "s/\(.*\)-\(.*\)/\1-$numcommits-\2/"`; + ;; + esac + + # Change the first '-' to a '.', so version-comparing tools work properly. + # Remove the "g" in git describe's output string, to save a byte. + v=`echo "$v" | sed 's/-/./;s/\(.*\)-g/\1-/'`; +else + v=UNKNOWN +fi + +v=`echo "$v" |sed 's/^v//'` + +# Don't declare a version "dirty" merely because a time stamp has changed. +git status > /dev/null 2>&1 + +dirty=`sh -c 'git diff-index --name-only HEAD' 2>/dev/null` || dirty= +case "$dirty" in + '') ;; + *) # Append the suffix only if there isn't one already. + case $v in + *-dirty) ;; + *) v="$v-dirty" ;; + esac ;; +esac + +# Omit the trailing newline, so that m4_esyscmd can use the result directly. +echo "$v" | tr -d '\012' + +# Local variables: +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "scriptversion=" +# time-stamp-format: "%:y-%02m-%02d.%02H" +# time-stamp-end: "$" +# End: -- To view, visit https://gerrit.osmocom.org/3518 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I1e6ed7af7107f8a74010721acd34f92a3237a7a1 Gerrit-PatchSet: 1 Gerrit-Project: libsmpp34 Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Mon Aug 14 17:14:28 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 14 Aug 2017 17:14:28 +0000 Subject: [MERGED] libsmpp34[master]: update .gitignore In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: update .gitignore ...................................................................... update .gitignore Change-Id: Ie294cb355a6618295e9864358413052837c35a03 --- M .gitignore 1 file changed, 7 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/.gitignore b/.gitignore index dd8c4d6..20adb5a 100644 --- a/.gitignore +++ b/.gitignore @@ -12,3 +12,10 @@ config.status libsmpp34.pc libtool +.version +.tarball-version +debian/.debhelper +debian/autoreconf* +debian/tmp +debian/*.log +debian/*.substvars -- To view, visit https://gerrit.osmocom.org/3519 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ie294cb355a6618295e9864358413052837c35a03 Gerrit-PatchSet: 1 Gerrit-Project: libsmpp34 Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Mon Aug 14 17:14:28 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 14 Aug 2017 17:14:28 +0000 Subject: [MERGED] libsmpp34[master]: prepare for 1.12 release In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: prepare for 1.12 release ...................................................................... prepare for 1.12 release Change-Id: If21d2456dd8ebf4bcea0592a841741269b33a308 --- M debian/changelog 1 file changed, 9 insertions(+), 2 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/debian/changelog b/debian/changelog index aae6e0d..c0c3948 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,8 +1,15 @@ -libsmpp34 (1.11) UNRELEASED; urgency=medium +libsmpp34 (1.12) UNRELEASED; urgency=medium + [ Holger Hans Peter Freyther ] * Move forward towards a new release. - -- Holger Hans Peter Freyther Tue, 24 May 2016 23:07:49 +0200 + [ Harald Welte ] + * it's been four years with various cleanups + * SMPP_DELIVERY_RECEIPT_* constants + * SMPP ESM class parameter definitions + * smpp34_tlv_for_each() helper macro + + -- Harald Welte Mon, 14 Aug 2017 19:08:37 +0200 libsmpp34 (1.10z1) stable; urgency=low -- To view, visit https://gerrit.osmocom.org/3520 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: If21d2456dd8ebf4bcea0592a841741269b33a308 Gerrit-PatchSet: 1 Gerrit-Project: libsmpp34 Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Mon Aug 14 17:15:41 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Mon, 14 Aug 2017 17:15:41 +0000 Subject: [MERGED] libosmo-netif[master]: osmux: Slightly improve output format of osmux_snprintf In-Reply-To: References: Message-ID: Pau Espin Pedrol has submitted this change and it was merged. Change subject: osmux: Slightly improve output format of osmux_snprintf ...................................................................... osmux: Slightly improve output format of osmux_snprintf The buffer for osmux_test is increased as the former doesn't seem to be able to cope with the whole output. Change-Id: Ic838dd9d7ad89b4510ccfa58c0390c69a075b616 --- M src/osmux.c M tests/osmux/osmux_test.c 2 files changed, 5 insertions(+), 2 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/osmux.c b/src/osmux.c index 2481d6a..b3c43e2 100644 --- a/src/osmux.c +++ b/src/osmux.c @@ -877,12 +877,15 @@ int ret, i; int len = size, offset = 0; + ret = snprintf(buf+offset, len, "[ "); + SNPRINTF_BUFFER_SIZE(ret, size, len, offset); + for (i=0; i Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Mon Aug 14 17:15:42 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Mon, 14 Aug 2017 17:15:42 +0000 Subject: [MERGED] libosmo-netif[master]: osmux: Fix buffer overflow in osmux_snprintf In-Reply-To: References: Message-ID: Pau Espin Pedrol has submitted this change and it was merged. Change subject: osmux: Fix buffer overflow in osmux_snprintf ...................................................................... osmux: Fix buffer overflow in osmux_snprintf When running osmux_test on my PC, the process was aborted with a "stack smashing detected" error. Change-Id: I8a7cc422c181c0c5712ac8976a5be5f0ad44a9c0 --- M src/osmux.c 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/osmux.c b/src/osmux.c index 23a6440..2481d6a 100644 --- a/src/osmux.c +++ b/src/osmux.c @@ -847,7 +847,7 @@ } #define SNPRINTF_BUFFER_SIZE(ret, size, len, offset) \ - size += ret; \ + size -= ret; \ if (ret > len) \ ret = len; \ offset += ret; \ -- To view, visit https://gerrit.osmocom.org/3521 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I8a7cc422c181c0c5712ac8976a5be5f0ad44a9c0 Gerrit-PatchSet: 1 Gerrit-Project: libosmo-netif Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Mon Aug 14 17:17:25 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 14 Aug 2017 17:17:25 +0000 Subject: [PATCH] openbsc[master]: increase libsmpp34 version requirement to 1.12 Message-ID: Review at https://gerrit.osmocom.org/3523 increase libsmpp34 version requirement to 1.12 Only 1.12 contains some of the #defines that we're using with recent commits. Change-Id: I3743b10a1a5d2f1d42a61204273c1d00dc22b600 --- M openbsc/configure.ac 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/23/3523/1 diff --git a/openbsc/configure.ac b/openbsc/configure.ac index ff51ccf..b155769 100644 --- a/openbsc/configure.ac +++ b/openbsc/configure.ac @@ -66,7 +66,7 @@ AC_ARG_ENABLE([smpp], [AS_HELP_STRING([--enable-smpp], [Build the SMPP interface])], [osmo_ac_build_smpp="$enableval"],[osmo_ac_build_smpp="no"]) if test "$osmo_ac_build_smpp" = "yes" ; then - PKG_CHECK_MODULES(LIBSMPP34, libsmpp34 >= 1.10) + PKG_CHECK_MODULES(LIBSMPP34, libsmpp34 >= 1.12) AC_DEFINE(BUILD_SMPP, 1, [Define if we want to build SMPP]) fi AM_CONDITIONAL(BUILD_SMPP, test "x$osmo_ac_build_smpp" = "xyes") -- To view, visit https://gerrit.osmocom.org/3523 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I3743b10a1a5d2f1d42a61204273c1d00dc22b600 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Mon Aug 14 17:20:25 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 14 Aug 2017 17:20:25 +0000 Subject: openbsc[master]: increase libsmpp34 version requirement to 1.12 In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3523 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I3743b10a1a5d2f1d42a61204273c1d00dc22b600 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Aug 14 17:49:15 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 14 Aug 2017 17:49:15 +0000 Subject: [MERGED] openbsc[master]: increase libsmpp34 version requirement to 1.12 In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: increase libsmpp34 version requirement to 1.12 ...................................................................... increase libsmpp34 version requirement to 1.12 Only 1.12 contains some of the #defines that we're using with recent commits. Change-Id: I3743b10a1a5d2f1d42a61204273c1d00dc22b600 --- M openbsc/configure.ac 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/openbsc/configure.ac b/openbsc/configure.ac index ff51ccf..b155769 100644 --- a/openbsc/configure.ac +++ b/openbsc/configure.ac @@ -66,7 +66,7 @@ AC_ARG_ENABLE([smpp], [AS_HELP_STRING([--enable-smpp], [Build the SMPP interface])], [osmo_ac_build_smpp="$enableval"],[osmo_ac_build_smpp="no"]) if test "$osmo_ac_build_smpp" = "yes" ; then - PKG_CHECK_MODULES(LIBSMPP34, libsmpp34 >= 1.10) + PKG_CHECK_MODULES(LIBSMPP34, libsmpp34 >= 1.12) AC_DEFINE(BUILD_SMPP, 1, [Define if we want to build SMPP]) fi AM_CONDITIONAL(BUILD_SMPP, test "x$osmo_ac_build_smpp" = "xyes") -- To view, visit https://gerrit.osmocom.org/3523 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I3743b10a1a5d2f1d42a61204273c1d00dc22b600 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Mon Aug 14 19:21:09 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Mon, 14 Aug 2017 19:21:09 +0000 Subject: [PATCH] openbsc[master]: smpp: Fix compilation warning Message-ID: Review at https://gerrit.osmocom.org/3524 smpp: Fix compilation warning I already stumbled into 2 compilation environments which had Werror enabled for -Wmaybe-uninitialized and the build failed, so let's workaround this warning. | smpp_openbsc.c: In function 'handle_smpp_submit': | smpp_openbsc.c:216:9: error: 'sms_msg_len' may be used uninitialized in this function [-Werror=maybe-uninitialized] | memcpy(sms->user_data, sms_msg, sms_msg_len); | ^ | smpp_openbsc.c:100:15: note: 'sms_msg_len' was declared here | unsigned int sms_msg_len; | ^ | cc1: some warnings being treated as errors Change-Id: I0901ddadb5f72e1585cb1797ac22c8ab95e83146 --- M openbsc/src/libmsc/smpp_openbsc.c 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/24/3524/1 diff --git a/openbsc/src/libmsc/smpp_openbsc.c b/openbsc/src/libmsc/smpp_openbsc.c index ddb24b5..331aba2 100644 --- a/openbsc/src/libmsc/smpp_openbsc.c +++ b/openbsc/src/libmsc/smpp_openbsc.c @@ -97,7 +97,7 @@ uint16_t msg_ref = 0; struct gsm_sms *sms; struct tlv_t *t; - unsigned int sms_msg_len; + unsigned int sms_msg_len = 0; /* initialization not needed but compilers cry with -Wmaybe-uninitialized */ int mode; dest = subscr_by_dst(net, submit->dest_addr_npi, -- To view, visit https://gerrit.osmocom.org/3524 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I0901ddadb5f72e1585cb1797ac22c8ab95e83146 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Mon Aug 14 22:10:06 2017 From: gerrit-no-reply at lists.osmocom.org (Pablo Neira Ayuso) Date: Mon, 14 Aug 2017 22:10:06 +0000 Subject: openbsc[master]: smpp: Fix compilation warning In-Reply-To: References: Message-ID: Patch Set 1: (1 comment) https://gerrit.osmocom.org/#/c/3524/1/openbsc/src/libmsc/smpp_openbsc.c File openbsc/src/libmsc/smpp_openbsc.c: Line 100: unsigned int sms_msg_len = 0; /* initialization not needed but compilers cry with -Wmaybe-uninitialized */ This comment on the right is too much... We have 'git annotate' these days... BTW, in the kernel, this is preferred: const uint8_t *sms_msg = NULL; unsigned int sms_msg_len = 0; struct gsm_subscriber *dest; uint16_t msg_ref = 0; struct gsm_sms *sms; struct tlv_t *t; ie. variables are declared from longer line to smaller line, it makes things more readable... Just a couple of nitpicks... Nothing very much relevant here. -- To view, visit https://gerrit.osmocom.org/3524 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I0901ddadb5f72e1585cb1797ac22c8ab95e83146 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pablo Neira Ayuso Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Mon Aug 14 22:26:22 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Mon, 14 Aug 2017 22:26:22 +0000 Subject: [PATCH] openbsc[master]: smpp: Fix compilation warning In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3524 to look at the new patch set (#2). smpp: Fix compilation warning I already stumbled into 2 compilation environments which had Werror enabled for -Wmaybe-uninitialized and the build failed, so let's workaround this warning. | smpp_openbsc.c: In function 'handle_smpp_submit': | smpp_openbsc.c:216:9: error: 'sms_msg_len' may be used uninitialized in this function [-Werror=maybe-uninitialized] | memcpy(sms->user_data, sms_msg, sms_msg_len); | ^ | smpp_openbsc.c:100:15: note: 'sms_msg_len' was declared here | unsigned int sms_msg_len; | ^ | cc1: some warnings being treated as errors Change-Id: I0901ddadb5f72e1585cb1797ac22c8ab95e83146 --- M openbsc/src/libmsc/smpp_openbsc.c 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/24/3524/2 diff --git a/openbsc/src/libmsc/smpp_openbsc.c b/openbsc/src/libmsc/smpp_openbsc.c index ddb24b5..df4db73 100644 --- a/openbsc/src/libmsc/smpp_openbsc.c +++ b/openbsc/src/libmsc/smpp_openbsc.c @@ -93,11 +93,11 @@ const struct submit_sm_t *submit) { const uint8_t *sms_msg = NULL; + unsigned int sms_msg_len = 0; struct gsm_subscriber *dest; uint16_t msg_ref = 0; struct gsm_sms *sms; struct tlv_t *t; - unsigned int sms_msg_len; int mode; dest = subscr_by_dst(net, submit->dest_addr_npi, -- To view, visit https://gerrit.osmocom.org/3524 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I0901ddadb5f72e1585cb1797ac22c8ab95e83146 Gerrit-PatchSet: 2 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pablo Neira Ayuso From gerrit-no-reply at lists.osmocom.org Tue Aug 15 04:15:13 2017 From: gerrit-no-reply at lists.osmocom.org (Holger Freyther) Date: Tue, 15 Aug 2017 04:15:13 +0000 Subject: libosmo-netif[master]: osmux: Fix buffer overflow in osmux_snprintf In-Reply-To: References: Message-ID: Patch Set 1: Ouch! I didn't see that when reviewing the original. But the result of sprintf might be negative as well? But I think there might be more errors in this routine... * size is of type size_t but snprint returns int * snprintf returns the number of characters that would have been printed (or error) (on OSX: " except for snprintf() and vsnprintf(), which return the number of characters that would have been printed if the size were unlimite" let's say we have... size_t size = 8 int ret = snprintf(buf, size, "%s", "123456890"); size -= ret; => now size_t should be very big or do I miss something? -- To view, visit https://gerrit.osmocom.org/3521 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I8a7cc422c181c0c5712ac8976a5be5f0ad44a9c0 Gerrit-PatchSet: 1 Gerrit-Project: libosmo-netif Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Aug 15 08:48:21 2017 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Tue, 15 Aug 2017 08:48:21 +0000 Subject: [PATCH] libosmo-sccp[master]: vty: fix (null) string in vty config Message-ID: Review at https://gerrit.osmocom.org/3525 vty: fix (null) string in vty config The asp->cfg.remote.host is allowed to be NULL in cases where the localhost is used. Check if asp->cfg.remote.host is NULL when writing the config file and omit it when it is set to NULL. Change-Id: I18f79cc4d4f1db8f2858e8e95098c5821d50594f --- M src/osmo_ss7_vty.c 1 file changed, 2 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-sccp refs/changes/25/3525/1 diff --git a/src/osmo_ss7_vty.c b/src/osmo_ss7_vty.c index 9343edd..b58c3cb 100644 --- a/src/osmo_ss7_vty.c +++ b/src/osmo_ss7_vty.c @@ -632,7 +632,8 @@ osmo_ss7_asp_protocol_name(asp->cfg.proto), VTY_NEWLINE); if (asp->cfg.description) vty_out(vty, " description %s%s", asp->cfg.description, VTY_NEWLINE); - vty_out(vty, " remote-ip %s%s", asp->cfg.remote.host, VTY_NEWLINE); + if (asp->cfg.remote.host) + vty_out(vty, " remote-ip %s%s", asp->cfg.remote.host, VTY_NEWLINE); if (asp->cfg.qos_class) vty_out(vty, " qos-class %u%s", asp->cfg.qos_class, VTY_NEWLINE); } -- To view, visit https://gerrit.osmocom.org/3525 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I18f79cc4d4f1db8f2858e8e95098c5821d50594f Gerrit-PatchSet: 1 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: dexter From gerrit-no-reply at lists.osmocom.org Tue Aug 15 08:55:55 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Tue, 15 Aug 2017 08:55:55 +0000 Subject: libosmo-netif[master]: osmux: Fix buffer overflow in osmux_snprintf In-Reply-To: References: Message-ID: Patch Set 1: Yes, and I see other issues in the current code, such as: ret = osmux_snprintf_header(buf+offset, size, osmuxh); if (ret < 0) Which should not happen unless there's a parsing error inside osmux_snprintf_header, and in that case it should be better to not return a negative value IMHO. This SNPRINTF_BUFFER_SIZE() macro looks quite difficult to follow, so I'm in favour of removing it and cleaning the entire code. I'll create a task to do this later, hopefully today. -- To view, visit https://gerrit.osmocom.org/3521 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I8a7cc422c181c0c5712ac8976a5be5f0ad44a9c0 Gerrit-PatchSet: 1 Gerrit-Project: libosmo-netif Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Aug 15 09:22:01 2017 From: gerrit-no-reply at lists.osmocom.org (Pablo Neira Ayuso) Date: Tue, 15 Aug 2017 09:22:01 +0000 Subject: openbsc[master]: smpp: Fix compilation warning In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/3524 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I0901ddadb5f72e1585cb1797ac22c8ab95e83146 Gerrit-PatchSet: 2 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pablo Neira Ayuso Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Aug 15 09:23:19 2017 From: gerrit-no-reply at lists.osmocom.org (Pablo Neira Ayuso) Date: Tue, 15 Aug 2017 09:23:19 +0000 Subject: [PATCH] openbsc[master]: libmsc: use SMPP34_DELIVERY_RECEIPT_* in libsmpp34 In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3515 to look at the new patch set (#2). libmsc: use SMPP34_DELIVERY_RECEIPT_* in libsmpp34 Use new definitions in libsmpp34 to set the registered_delivery field accordingly, as provided by I5b3afff1b3b77cccd949e0606914c7ac3ba6114c. Moreover, do not set this header field to zero if status reports are off, the deliver_t structure has been already zeroed so this not required. Change-Id: Ie78e17323796120f576b9c0e1bc5ccc32da8ee12 --- M openbsc/src/libmsc/smpp_openbsc.c 1 file changed, 1 insertion(+), 7 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/15/3515/2 diff --git a/openbsc/src/libmsc/smpp_openbsc.c b/openbsc/src/libmsc/smpp_openbsc.c index ddb24b5..f2a036d 100644 --- a/openbsc/src/libmsc/smpp_openbsc.c +++ b/openbsc/src/libmsc/smpp_openbsc.c @@ -627,10 +627,6 @@ return NULL; } -/* See SMPP 3.4, Section 5.2.17. registered_delivery (1 byte field). */ -#define SMPP34_NO_DELIVERY_RECEIPT 0x0 -#define SMPP34_DELIVERY_RECEIPT_REQ 0x1 - static int deliver_to_esme(struct osmo_esme *esme, struct gsm_sms *sms, struct gsm_subscriber_connection *conn) { @@ -676,9 +672,7 @@ deliver.protocol_id = sms->protocol_id; deliver.priority_flag = 0; if (sms->status_rep_req) - deliver.registered_delivery = SMPP34_DELIVERY_RECEIPT_REQ; - else - deliver.registered_delivery = SMPP34_NO_DELIVERY_RECEIPT; + deliver.registered_delivery = SMPP34_DELIVERY_RECEIPT_ON; /* Figure out SMPP DCS from TP-DCS */ dcs = sms->data_coding_scheme; -- To view, visit https://gerrit.osmocom.org/3515 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ie78e17323796120f576b9c0e1bc5ccc32da8ee12 Gerrit-PatchSet: 2 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Pablo Neira Ayuso Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pablo Neira Ayuso From gerrit-no-reply at lists.osmocom.org Tue Aug 15 13:00:40 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Tue, 15 Aug 2017 13:00:40 +0000 Subject: [PATCH] osmo-bts[master]: osmo-bts-trx: Enable osmotrx tx-attenuation oml by default Message-ID: Review at https://gerrit.osmocom.org/3526 osmo-bts-trx: Enable osmotrx tx-attenuation oml by default There are currently two ways to specify power reductions to be sent to osmo-trx from osmo-bts-trx: * osmotrx tx-attenuation oml * osmotrx tx-attenuation <0-50> None of them is enabled by default, which means if none of them is specified in the config file of osmo-bts-trx, SETPOWER cmd won't be sent to osmo-trx, which in turn won't turn on the transciever. Let's enable osmo tx-attenuation oml by default and leave it up to the bsc to decide which power reduction to use. If the user wants to configure a specific tx-attentuation, it can still do so in exactly the same way he used to do it. Change-Id: Ia8640751630ee37e5f5d1f470bad892a08e80654 --- M src/osmo-bts-trx/main.c 1 file changed, 2 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/26/3526/1 diff --git a/src/osmo-bts-trx/main.c b/src/osmo-bts-trx/main.c index da3dc60..283e549 100644 --- a/src/osmo-bts-trx/main.c +++ b/src/osmo-bts-trx/main.c @@ -130,6 +130,8 @@ l1h = talloc_zero(tall_bts_ctx, struct trx_l1h); l1h->phy_inst = pinst; pinst->u.osmotrx.hdl = l1h; + + l1h->config.power_oml = 1; } int main(int argc, char **argv) -- To view, visit https://gerrit.osmocom.org/3526 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ia8640751630ee37e5f5d1f470bad892a08e80654 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Tue Aug 15 13:03:58 2017 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Tue, 15 Aug 2017 13:03:58 +0000 Subject: [PATCH] osmo-bts[master]: octphy: implement support for dynamic timeslots Message-ID: Review at https://gerrit.osmocom.org/3527 octphy: implement support for dynamic timeslots Implement API functions bts_model_ts_connect() and bts_model_ts_disconnect() in order to support dynamic timeslot allocation. Change-Id: Ia109d4bfade7bc28442127581f4bb0289146ea71 --- M src/osmo-bts-octphy/l1_if.c M src/osmo-bts-octphy/l1_oml.c 2 files changed, 126 insertions(+), 13 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/27/3527/1 diff --git a/src/osmo-bts-octphy/l1_if.c b/src/osmo-bts-octphy/l1_if.c index cb792d7..e4ab538 100644 --- a/src/osmo-bts-octphy/l1_if.c +++ b/src/osmo-bts-octphy/l1_if.c @@ -329,11 +329,30 @@ return 0; } -static uint8_t chan_nr_by_sapi(enum gsm_phys_chan_config pchan, +static enum gsm_phys_chan_config pick_pchan(struct gsm_bts_trx_ts *ts) +{ + switch (ts->pchan) { + case GSM_PCHAN_TCH_F_PDCH: + if (ts->flags & TS_F_PDCH_ACTIVE) + return GSM_PCHAN_PDCH; + return GSM_PCHAN_TCH_F; + case GSM_PCHAN_TCH_F_TCH_H_PDCH: + return ts->dyn.pchan_is; + default: + return ts->pchan; + } +} + +static uint8_t chan_nr_by_sapi(struct gsm_bts_trx_ts *ts, tOCTVC1_GSM_SAPI_ENUM sapi, uint8_t subCh, uint8_t u8Tn, uint32_t u32Fn) { uint8_t cbits = 0; + enum gsm_phys_chan_config pchan = pick_pchan(ts); + + OSMO_ASSERT(pchan != GSM_PCHAN_TCH_F_PDCH); + OSMO_ASSERT(pchan != GSM_PCHAN_TCH_F_TCH_H_PDCH); + switch (sapi) { case cOCTVC1_GSM_SAPI_ENUM_BCCH: cbits = 0x10; @@ -476,7 +495,7 @@ if (!L1SAP_IS_CHAN_TCHF(chan_nr) && !L1SAP_IS_CHAN_PDCH(chan_nr)) subCh = l1sap_chan2ss(chan_nr); } else if (L1SAP_IS_CHAN_TCHF(chan_nr) || L1SAP_IS_CHAN_PDCH(chan_nr)) { - if (trx->ts[u8Tn].pchan == GSM_PCHAN_PDCH) { + if (ts_is_pdch(&trx->ts[u8Tn])) { if (L1SAP_IS_PTCCH(u32Fn)) { sapi = cOCTVC1_GSM_SAPI_ENUM_PTCCH; } else { @@ -932,7 +951,7 @@ get_value_string(octphy_l1sapi_names, sapi)); /* in case we need to forward primitive to common part */ - chan_nr = chan_nr_by_sapi(trx->ts[ts_num].pchan, sapi, sc, ts_num, fn); + chan_nr = chan_nr_by_sapi(&trx->ts[ts_num], sapi, sc, ts_num, fn); if (chan_nr) { if (sapi == cOCTVC1_GSM_SAPI_ENUM_SACCH) link_id = LID_SACCH; @@ -1053,7 +1072,7 @@ fn = data_ind->Data.ulFrameNumber; /* chan_nr and link_id */ - chan_nr = chan_nr_by_sapi(trx->ts[ts_num].pchan, sapi, sc, ts_num, fn); + chan_nr = chan_nr_by_sapi(&trx->ts[ts_num], sapi, sc, ts_num, fn); if (!chan_nr) { LOGP(DL1C, LOGL_ERROR, "Rx PH-DATA.ind for unknown L1 SAPI %s\n", diff --git a/src/osmo-bts-octphy/l1_oml.c b/src/osmo-bts-octphy/l1_oml.c index 03ff547..d1d5bf6 100644 --- a/src/osmo-bts-octphy/l1_oml.c +++ b/src/osmo-bts-octphy/l1_oml.c @@ -1406,21 +1406,24 @@ return opstart_compl(mo); } -static int ts_connect(struct gsm_bts_trx_ts *ts) +static int ts_connect_as(struct gsm_bts_trx_ts *ts, + enum gsm_phys_chan_config pchan, + l1if_compl_cb * cb, void *data) { struct phy_instance *pinst = trx_phy_instance(ts->trx); struct octphy_hdl *fl1h = pinst->phy_link->u.octphy.hdl; struct msgb *msg = l1p_msgb_alloc(); tOCTVC1_GSM_MSG_TRX_ACTIVATE_PHYSICAL_CHANNEL_CMD *oc = - (tOCTVC1_GSM_MSG_TRX_ACTIVATE_PHYSICAL_CHANNEL_CMD *) oc; + (tOCTVC1_GSM_MSG_TRX_ACTIVATE_PHYSICAL_CHANNEL_CMD *) oc; - oc = (tOCTVC1_GSM_MSG_TRX_ACTIVATE_PHYSICAL_CHANNEL_CMD *) msgb_put(msg, sizeof(*oc)); + oc = (tOCTVC1_GSM_MSG_TRX_ACTIVATE_PHYSICAL_CHANNEL_CMD*) + msgb_put(msg, sizeof(*oc)); l1if_fill_msg_hdr(&oc->Header, msg, fl1h, cOCTVC1_MSG_TYPE_COMMAND, cOCTVC1_GSM_MSG_TRX_ACTIVATE_PHYSICAL_CHANNEL_CID); oc->TrxId.byTrxId = pinst->u.octphy.trx_id; oc->PchId.byTimeslotNb = ts->nr; - oc->ulChannelType = pchan_to_logChComb[ts->pchan]; + oc->ulChannelType = pchan_to_logChComb[pchan]; /* TODO: how should we know the payload type here? Also, why * would the payload type have to be the same for both halves of @@ -1436,11 +1439,71 @@ } LOGP(DL1C, LOGL_INFO, "PCHAN-ACT.req(trx=%u, ts=%u, chcomb=%u)\n", - ts->trx->nr, ts->nr, ts->pchan); + ts->trx->nr, ts->nr, pchan); mOCTVC1_GSM_MSG_TRX_ACTIVATE_PHYSICAL_CHANNEL_CMD_SWAP(oc); - return l1if_req_compl(fl1h, msg, pchan_act_compl_cb, NULL); + return l1if_req_compl(fl1h, msg, cb, data); +} + +/* Dynamic timeslots: Disconnect callback, reports completed disconnection + * to higher layers */ +static int ts_disconnect_cb(struct octphy_hdl *fl1, struct msgb *resp, + void *data) +{ + tOCTVC1_GSM_MSG_TRX_DEACTIVATE_PHYSICAL_CHANNEL_RSP *ar = + (tOCTVC1_GSM_MSG_TRX_DEACTIVATE_PHYSICAL_CHANNEL_RSP *) resp->l2h; + uint8_t ts_nr; + struct gsm_bts_trx *trx; + struct gsm_bts_trx_ts *ts; + + trx = trx_by_l1h(fl1, ar->TrxId.byTrxId); + ts_nr = ar->PchId.byTimeslotNb; + ts = &trx->ts[ts_nr]; + + cb_ts_disconnected(ts); + + return 0; +} + +/* Dynamic timeslots: Connect callback, reports completed disconnection to + * higher layers */ +static int ts_connect_cb(struct octphy_hdl *fl1, struct msgb *resp, void *data) +{ + tOCTVC1_GSM_MSG_TRX_ACTIVATE_PHYSICAL_CHANNEL_RSP *ar = + (tOCTVC1_GSM_MSG_TRX_ACTIVATE_PHYSICAL_CHANNEL_RSP *) resp->l2h; + uint8_t ts_nr; + struct gsm_bts_trx *trx; + struct gsm_bts_trx_ts *ts; + + /* in a completion call-back, we take msgb ownership and must + * release it before returning */ + + mOCTVC1_GSM_MSG_TRX_ACTIVATE_PHYSICAL_CHANNEL_RSP_SWAP(ar); + trx = trx_by_l1h(fl1, ar->TrxId.byTrxId); + ts_nr = ar->PchId.byTimeslotNb; + OSMO_ASSERT(ts_nr <= ARRAY_SIZE(trx->ts)); + + ts = &trx->ts[ts_nr]; + + LOGP(DL1C, LOGL_INFO, "PCHAN-ACT.conf(trx=%u, ts=%u, chcomb=%u) = %s\n", + ts->trx->nr, ts->nr, ts->pchan, + octvc1_rc2string(ar->Header.ulReturnCode)); + + if (ar->Header.ulReturnCode != cOCTVC1_RC_OK) { + LOGP(DL1C, LOGL_ERROR, + "PCHAN-ACT failed: %s\n\n", + octvc1_rc2string(ar->Header.ulReturnCode)); + LOGP(DL1C, LOGL_ERROR, "Exiting... \n\n"); + msgb_free(resp); + exit(-1); + } + + msgb_free(resp); + + cb_ts_connected(ts); + + return 0; } /*********************************************************************** @@ -1583,13 +1646,15 @@ int bts_model_opstart(struct gsm_bts *bts, struct gsm_abis_mo *mo, void *obj) { int rc = -1; + struct gsm_bts_trx_ts *ts; switch (mo->obj_class) { case NM_OC_RADIO_CARRIER: rc = trx_init(obj); break; case NM_OC_CHANNEL: - rc = ts_connect(obj); + ts = (struct gsm_bts_trx_ts*) obj; + rc = ts_connect_as(ts, ts->pchan, pchan_act_compl_cb, NULL); break; case NM_OC_BTS: case NM_OC_SITE_MANAGER: @@ -1614,11 +1679,40 @@ int bts_model_ts_disconnect(struct gsm_bts_trx_ts *ts) { - return -ENOTSUP; + struct phy_instance *pinst = trx_phy_instance(ts->trx); + struct octphy_hdl *fl1h = pinst->phy_link->u.octphy.hdl; + struct msgb *msg = l1p_msgb_alloc(); + tOCTVC1_GSM_MSG_TRX_DEACTIVATE_PHYSICAL_CHANNEL_CMD *oc = + (tOCTVC1_GSM_MSG_TRX_DEACTIVATE_PHYSICAL_CHANNEL_CMD *) oc; + + oc = (tOCTVC1_GSM_MSG_TRX_DEACTIVATE_PHYSICAL_CHANNEL_CMD *) + msgb_put(msg, sizeof(*oc)); + l1if_fill_msg_hdr(&oc->Header, msg, fl1h, cOCTVC1_MSG_TYPE_COMMAND, + cOCTVC1_GSM_MSG_TRX_DEACTIVATE_PHYSICAL_CHANNEL_CID); + + oc->TrxId.byTrxId = pinst->u.octphy.trx_id; + oc->PchId.byTimeslotNb = ts->nr; + + LOGP(DL1C, LOGL_INFO, "PCHAN-DEACT.req(trx=%u, ts=%u, chcomb=%u)\n", + ts->trx->nr, ts->nr, ts->pchan); + + mOCTVC1_GSM_MSG_TRX_DEACTIVATE_PHYSICAL_CHANNEL_CMD_SWAP(oc); + + return l1if_req_compl(fl1h, msg, ts_disconnect_cb, NULL); } int bts_model_ts_connect(struct gsm_bts_trx_ts *ts, enum gsm_phys_chan_config as_pchan) { - return -ENOTSUP; + if (as_pchan == GSM_PCHAN_TCH_F_PDCH + || as_pchan == GSM_PCHAN_TCH_F_TCH_H_PDCH) { + LOGP(DL1C, LOGL_ERROR, + "%s Requested TS connect as %s," + " expected a specific pchan instead\n", + gsm_ts_and_pchan_name(ts), gsm_pchan_name(as_pchan)); + exit(1); + return -EINVAL; + } + + return ts_connect_as(ts, as_pchan, ts_connect_cb, NULL); } -- To view, visit https://gerrit.osmocom.org/3527 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ia109d4bfade7bc28442127581f4bb0289146ea71 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: dexter From gerrit-no-reply at lists.osmocom.org Tue Aug 15 13:25:19 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 15 Aug 2017 13:25:19 +0000 Subject: openbsc[master]: libmsc: use SMPP34_DELIVERY_RECEIPT_* in libsmpp34 In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3515 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ie78e17323796120f576b9c0e1bc5ccc32da8ee12 Gerrit-PatchSet: 2 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Pablo Neira Ayuso Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pablo Neira Ayuso Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Aug 15 13:25:38 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 15 Aug 2017 13:25:38 +0000 Subject: [MERGED] openbsc[master]: libmsc: use SMPP34_DELIVERY_RECEIPT_* in libsmpp34 In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: libmsc: use SMPP34_DELIVERY_RECEIPT_* in libsmpp34 ...................................................................... libmsc: use SMPP34_DELIVERY_RECEIPT_* in libsmpp34 Use new definitions in libsmpp34 to set the registered_delivery field accordingly, as provided by I5b3afff1b3b77cccd949e0606914c7ac3ba6114c. Moreover, do not set this header field to zero if status reports are off, the deliver_t structure has been already zeroed so this not required. Change-Id: Ie78e17323796120f576b9c0e1bc5ccc32da8ee12 --- M openbsc/src/libmsc/smpp_openbsc.c 1 file changed, 1 insertion(+), 7 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/openbsc/src/libmsc/smpp_openbsc.c b/openbsc/src/libmsc/smpp_openbsc.c index ddb24b5..f2a036d 100644 --- a/openbsc/src/libmsc/smpp_openbsc.c +++ b/openbsc/src/libmsc/smpp_openbsc.c @@ -627,10 +627,6 @@ return NULL; } -/* See SMPP 3.4, Section 5.2.17. registered_delivery (1 byte field). */ -#define SMPP34_NO_DELIVERY_RECEIPT 0x0 -#define SMPP34_DELIVERY_RECEIPT_REQ 0x1 - static int deliver_to_esme(struct osmo_esme *esme, struct gsm_sms *sms, struct gsm_subscriber_connection *conn) { @@ -676,9 +672,7 @@ deliver.protocol_id = sms->protocol_id; deliver.priority_flag = 0; if (sms->status_rep_req) - deliver.registered_delivery = SMPP34_DELIVERY_RECEIPT_REQ; - else - deliver.registered_delivery = SMPP34_NO_DELIVERY_RECEIPT; + deliver.registered_delivery = SMPP34_DELIVERY_RECEIPT_ON; /* Figure out SMPP DCS from TP-DCS */ dcs = sms->data_coding_scheme; -- To view, visit https://gerrit.osmocom.org/3515 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ie78e17323796120f576b9c0e1bc5ccc32da8ee12 Gerrit-PatchSet: 3 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Pablo Neira Ayuso Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pablo Neira Ayuso From gerrit-no-reply at lists.osmocom.org Tue Aug 15 13:26:55 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 15 Aug 2017 13:26:55 +0000 Subject: osmo-bts[master]: octphy: implement support for dynamic timeslots In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3527 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ia109d4bfade7bc28442127581f4bb0289146ea71 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Aug 15 13:27:13 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 15 Aug 2017 13:27:13 +0000 Subject: osmo-bts[master]: osmo-bts-trx: Enable osmotrx tx-attenuation oml by default In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3526 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ia8640751630ee37e5f5d1f470bad892a08e80654 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Aug 15 13:27:27 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 15 Aug 2017 13:27:27 +0000 Subject: [MERGED] osmo-bts[master]: osmo-bts-trx: Enable osmotrx tx-attenuation oml by default In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: osmo-bts-trx: Enable osmotrx tx-attenuation oml by default ...................................................................... osmo-bts-trx: Enable osmotrx tx-attenuation oml by default There are currently two ways to specify power reductions to be sent to osmo-trx from osmo-bts-trx: * osmotrx tx-attenuation oml * osmotrx tx-attenuation <0-50> None of them is enabled by default, which means if none of them is specified in the config file of osmo-bts-trx, SETPOWER cmd won't be sent to osmo-trx, which in turn won't turn on the transciever. Let's enable osmo tx-attenuation oml by default and leave it up to the bsc to decide which power reduction to use. If the user wants to configure a specific tx-attentuation, it can still do so in exactly the same way he used to do it. Change-Id: Ia8640751630ee37e5f5d1f470bad892a08e80654 --- M src/osmo-bts-trx/main.c 1 file changed, 2 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/osmo-bts-trx/main.c b/src/osmo-bts-trx/main.c index da3dc60..283e549 100644 --- a/src/osmo-bts-trx/main.c +++ b/src/osmo-bts-trx/main.c @@ -130,6 +130,8 @@ l1h = talloc_zero(tall_bts_ctx, struct trx_l1h); l1h->phy_inst = pinst; pinst->u.osmotrx.hdl = l1h; + + l1h->config.power_oml = 1; } int main(int argc, char **argv) -- To view, visit https://gerrit.osmocom.org/3526 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ia8640751630ee37e5f5d1f470bad892a08e80654 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Tue Aug 15 13:28:35 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 15 Aug 2017 13:28:35 +0000 Subject: openbsc[master]: LIBMSC: Place correct dst address in status report In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3516 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I2d4f87ac777465de9bfb5a775a789a2691755ee9 Gerrit-PatchSet: 2 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Keith Whyte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pablo Neira Ayuso Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Aug 15 13:28:37 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 15 Aug 2017 13:28:37 +0000 Subject: [MERGED] openbsc[master]: LIBMSC: Place correct dst address in status report In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: LIBMSC: Place correct dst address in status report ...................................................................... LIBMSC: Place correct dst address in status report gsm_04_11.c: gsm340_gen_sms_status_report_tpdu() When we construct the status report PDU, use sms->src instead of sms->dst as the destination address This way we tell the MS that the message was delivered to the destination and not to itself. This is relevant for phones that display a textual representation of the delivery report. Change-Id: I2d4f87ac777465de9bfb5a775a789a2691755ee9 --- M openbsc/src/libmsc/gsm_04_11.c 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified Pablo Neira Ayuso: Looks good to me, but someone else must approve diff --git a/openbsc/src/libmsc/gsm_04_11.c b/openbsc/src/libmsc/gsm_04_11.c index 8b4ffce..d56a97c 100644 --- a/openbsc/src/libmsc/gsm_04_11.c +++ b/openbsc/src/libmsc/gsm_04_11.c @@ -301,7 +301,7 @@ *smsp = sms->msg_ref; /* generate recipient address */ - oa_len = gsm340_gen_oa_sub(oa, sizeof(oa), &sms->dst); + oa_len = gsm340_gen_oa_sub(oa, sizeof(oa), &sms->src); if (oa_len < 0) return -ENOSPC; -- To view, visit https://gerrit.osmocom.org/3516 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I2d4f87ac777465de9bfb5a775a789a2691755ee9 Gerrit-PatchSet: 3 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Keith Whyte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pablo Neira Ayuso From gerrit-no-reply at lists.osmocom.org Tue Aug 15 15:11:06 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Tue, 15 Aug 2017 15:11:06 +0000 Subject: [PATCH] osmo-gsm-tester[master]: Split osmo-trx from osmo-bts-trx Message-ID: Review at https://gerrit.osmocom.org/3528 Split osmo-trx from osmo-bts-trx In the future, some environments/products may come with a trx interface pre-installed. Start work to easily disable launching it. Change-Id: I556c3e2ba16753393c7e70800c533a18122daeaa --- M contrib/jenkins-build-osmo-bts-trx.sh A contrib/jenkins-build-osmo-trx.sh M src/osmo_gsm_tester/bts_osmotrx.py 3 files changed, 50 insertions(+), 12 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-tester refs/changes/28/3528/1 diff --git a/contrib/jenkins-build-osmo-bts-trx.sh b/contrib/jenkins-build-osmo-bts-trx.sh index c4bdcaf..8664a08 100755 --- a/contrib/jenkins-build-osmo-bts-trx.sh +++ b/contrib/jenkins-build-osmo-bts-trx.sh @@ -9,7 +9,6 @@ build_repo libosmocore --disable-doxygen build_repo libosmo-abis -build_repo osmo-trx --without-sse build_repo osmo-bts --enable-trx --with-openbsc=$base/openbsc/openbsc/include create_bin_tgz diff --git a/contrib/jenkins-build-osmo-trx.sh b/contrib/jenkins-build-osmo-trx.sh new file mode 100755 index 0000000..7d2a5b6 --- /dev/null +++ b/contrib/jenkins-build-osmo-trx.sh @@ -0,0 +1,9 @@ +#!/bin/sh +set -e -x +base="$PWD" +name="osmo-trx" +. "$(dirname "$0")/jenkins-build-common.sh" + +build_repo osmo-trx --without-sse + +create_bin_tgz diff --git a/src/osmo_gsm_tester/bts_osmotrx.py b/src/osmo_gsm_tester/bts_osmotrx.py index d8675cb..7496ce8 100644 --- a/src/osmo_gsm_tester/bts_osmotrx.py +++ b/src/osmo_gsm_tester/bts_osmotrx.py @@ -27,9 +27,8 @@ run_dir = None inst = None env = None - proc_trx = None + trx = None - BIN_TRX = 'osmo-trx' BIN_BTS_TRX = 'osmo-bts-trx' BIN_PCU = 'osmo-pcu' @@ -54,26 +53,22 @@ self.run_dir = util.Dir(self.suite_run.get_test_run_dir().new_dir(self.name())) self.configure() + self.trx = OsmoTrx(self.suite_run) + self.trx.start() + self.log('Waiting for osmo-trx to start up...') + event_loop.wait(self, self.trx.trx_ready) + self.inst = util.Dir(os.path.abspath(self.suite_run.trial.get_inst(OsmoBtsTrx.BIN_BTS_TRX))) lib = self.inst.child('lib') if not os.path.isdir(lib): raise RuntimeError('No lib/ in %r' % self.inst) self.env = { 'LD_LIBRARY_PATH': util.prepend_library_path(lib) } - self.proc_trx = self.launch_process(OsmoBtsTrx.BIN_TRX, '-x') - self.log('Waiting for osmo-trx to start up...') - event_loop.wait(self, self.trx_ready) - self.proc_trx.log(self.proc_trx.get_stdout_tail(1)) self.launch_process(OsmoBtsTrx.BIN_BTS_TRX, '-r', '1', '-c', os.path.abspath(self.config_file), '-i', self.bsc.addr()) #self.launch_process(OsmoBtsTrx.BIN_PCU, '-r', '1') self.suite_run.poll() - - def trx_ready(self): - if not self.proc_trx or not self.proc_trx.is_running: - return False - return '-- Transceiver active with' in (self.proc_trx.get_stdout() or '') def launch_process(self, binary_name, *args): binary = os.path.abspath(self.inst.child('bin', binary_name)) @@ -120,4 +115,39 @@ def set_bsc(self, bsc): self.bsc = bsc +class OsmoTrx(log.Origin): + suite_run = None + run_dir = None + inst = None + env = None + proc_trx = None + + BIN_TRX = 'osmo-trx' + + def __init__(self, suite_run): + super().__init__(log.C_RUN, OsmoTrx.BIN_TRX) + self.suite_run = suite_run + self.env = {} + + def start(self): + self.run_dir = util.Dir(self.suite_run.get_test_run_dir().new_dir(self.name())) + self.inst = util.Dir(os.path.abspath(self.suite_run.trial.get_inst(OsmoTrx.BIN_TRX))) + self.proc_trx = self.launch_process(OsmoTrx.BIN_TRX, '-x') + + def launch_process(self, binary_name, *args): + binary = os.path.abspath(self.inst.child('bin', binary_name)) + run_dir = self.run_dir.new_dir(binary_name) + if not os.path.isfile(binary): + raise RuntimeError('Binary missing: %r' % binary) + proc = process.Process(binary_name, run_dir, + (binary,) + args, + env=self.env) + self.suite_run.remember_to_stop(proc) + proc.launch() + return proc + + def trx_ready(self): + if not self.proc_trx or not self.proc_trx.is_running: + return False + return '-- Transceiver active with' in (self.proc_trx.get_stdout() or '') # vim: expandtab tabstop=4 shiftwidth=4 -- To view, visit https://gerrit.osmocom.org/3528 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I556c3e2ba16753393c7e70800c533a18122daeaa Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Tue Aug 15 15:13:20 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Tue, 15 Aug 2017 15:13:20 +0000 Subject: osmo-gsm-tester[master]: Split osmo-trx from osmo-bts-trx In-Reply-To: References: Message-ID: Patch Set 1: Together with this, I added all required jenkins infra: - Added job osmo-gsm-tester_build-osmo-trx - Make osmo-gsm-tester_run look after osmo-gsm-tester_build-osmo-trx - Modified osmo-gsm-tester-manual_run-all to also use new contrib script to build osmo-trx. I run a successful test using jobs in R&D to test that everything's handled correctly. -- To view, visit https://gerrit.osmocom.org/3528 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I556c3e2ba16753393c7e70800c533a18122daeaa Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Aug 15 15:14:44 2017 From: gerrit-no-reply at lists.osmocom.org (lynxis lazus) Date: Tue, 15 Aug 2017 15:14:44 +0000 Subject: [PATCH] osmo-ci[master]: create osmocom-nightly-nitb-split.sh based on osmocom-nightl... Message-ID: Review at https://gerrit.osmocom.org/3529 create osmocom-nightly-nitb-split.sh based on osmocom-nightly-packages.sh Create a snapshot of the nitb split and upload it to OBS. Change-Id: I8bf9fce1547e98c44b62a693ac4aaa4beed1aef9 --- A scripts/osmocom-nightly-nitb-split.sh 1 file changed, 119 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ci refs/changes/29/3529/1 diff --git a/scripts/osmocom-nightly-nitb-split.sh b/scripts/osmocom-nightly-nitb-split.sh new file mode 100755 index 0000000..ee39a5b --- /dev/null +++ b/scripts/osmocom-nightly-nitb-split.sh @@ -0,0 +1,119 @@ +#!/bin/bash + +set -e +set -x + +DT=$(date +%Y%m%d) +PROJ=network:osmocom:nitb-split:nightly + +### common +checkout() { + local name=$1 + local branch=$2 + local url="git://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() { + # clean up the whole space + mkdir -p "$REPO/osc/" + cd "$REPO/osc" + osc co "$PROJ" +} + +build() { + local name=$1 + local repodir=$REPO/$name + local oscdir=$REPO/osc/$PROJ/$name + + if [ -d "$oscdir" ] ; then + # remove earlier version + cd "$oscdir" + osc rm -- * || true + else + # new package + mkdir -p "$oscdir/" + cd "$REPO/osc/$PROJ/" + osc add "$name" + fi + + cd "$repodir" + + VER=$(head -1 debian/changelog | cut -d ' ' -f 2 | sed 's,(,,' | sed 's,),,') + dch -v "$VER.$DT" -m "Snapshot build" + git commit -m "$DT snapshot" debian/ + + mkdir -p "$DATA/$name" + # source code build without dependency checks and unsigned source and unsigned change log + gbp buildpackage -S -uc -us -d --git-ignore-branch "--git-export-dir=$DATA/$name" + + mv "$DATA/$name/"*.tar* "$DATA/$name/"*.dsc "$oscdir/" + + cd "$oscdir" + osc add -- *.tar* *.dsc + osc ci -m "Snapshot $name $DT" +} + +post() { + cd "$REPO/osc/$PROJ/" + osc status +} + +build_osmocom() { + BASE=$PWD + DATA=$BASE/data + REPO=$BASE/repo + + # rather than including a dangerous 'rm -rf *' here, lets delegate to the user: + if [ -n "$(ls)" ]; then + echo "ERROR: I need to run in an empty directory." + exit 1 + fi + + prepare + + checkout libosmocore + checkout libosmo-abis + checkout libosmo-netif + checkout libosmo-sccp + checkout libsmpp34 + checkout libasn1c + checkout osmo-iuh lynxis/pre_release + checkout osmo-hlr + checkout openggsn + checkout osmo-mgw pre_release + checkout osmo-bsc lynxis/pre_release + checkout osmo-msc pre_release + checkout osmo-sgsn pre_release + + build libosmocore + build libosmo-abis + build libosmo-netif + build libosmo-sccp + build libsmpp34 + build libasn1c + build osmo-iuh + build osmo-hlr + build openggsn + build osmo-mgw + build osmo-bsc + build osmo-msc + build osmo-sgsn + + post +} + +TMPDIR=$(mktemp -d nightly-3g_XXXXXX) +cd "$TMPDIR" +build_osmocom +rm -rf "./$TMPDIR/" -- To view, visit https://gerrit.osmocom.org/3529 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I8bf9fce1547e98c44b62a693ac4aaa4beed1aef9 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Owner: lynxis lazus From gerrit-no-reply at lists.osmocom.org Tue Aug 15 15:14:44 2017 From: gerrit-no-reply at lists.osmocom.org (lynxis lazus) Date: Tue, 15 Aug 2017 15:14:44 +0000 Subject: [PATCH] osmo-ci[master]: add jenkins job builder files for osmocom-nightly-nitb-split.sh Message-ID: Review at https://gerrit.osmocom.org/3530 add jenkins job builder files for osmocom-nightly-nitb-split.sh jenkins job builder is a python library to write jenkins jobs in .yml or .json including templating and basic substition operation. To update the job call: Create your own jenkins_jobs.ini based on the exmaple and call jenkins-jobs --conf ./jenkins_jobs.ini update osmocom-nightly-nitb-split.yml Change-Id: Ie7c655c6e0e3761e7970e479cadb5ae14faa2c1c --- M .gitignore A scripts/jenkins_jobs.ini.example A scripts/osmocom-nightly-nitb-split.yml 3 files changed, 27 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ci refs/changes/30/3530/1 diff --git a/.gitignore b/.gitignore index 4e25b2f..4163eb6 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,4 @@ install-* tokens.txt .*.sw? +jenkins_jobs.ini diff --git a/scripts/jenkins_jobs.ini.example b/scripts/jenkins_jobs.ini.example new file mode 100644 index 0000000..3a28c40 --- /dev/null +++ b/scripts/jenkins_jobs.ini.example @@ -0,0 +1,6 @@ +[jenkins] +user=example +# To get a token: Go to Jenkins via Web -> Login -> Press up right Corner on your Username -> Configure -> API token in the body +password=get_a_token +url=https://jenkins.osmocom.org +query_plugins_info=False diff --git a/scripts/osmocom-nightly-nitb-split.yml b/scripts/osmocom-nightly-nitb-split.yml new file mode 100644 index 0000000..cb4c50f --- /dev/null +++ b/scripts/osmocom-nightly-nitb-split.yml @@ -0,0 +1,20 @@ +--- +- project: + name: Osmocom_nightly_nitb_split + jobs: + - Osmocom_nightly_nitb_split + +- job: + name: 'Osmocom_nightly_nitb_split' + project-type: freestyle + defaults: global + description: 'Generated by job-builder' + node: linux_amd64_debian8 + builders: + - shell: + ./scripts/osmocom-nightly-nitb-split.sh + scm: + - git: + url: git://git.osmocom.org/osmo-ci + git-config-name: 'Jenkins Builder' + git-config-email: 'admax at fe80.eu' -- To view, visit https://gerrit.osmocom.org/3530 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ie7c655c6e0e3761e7970e479cadb5ae14faa2c1c Gerrit-PatchSet: 1 Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Owner: lynxis lazus From gerrit-no-reply at lists.osmocom.org Tue Aug 15 15:16:32 2017 From: gerrit-no-reply at lists.osmocom.org (lynxis lazus) Date: Tue, 15 Aug 2017 15:16:32 +0000 Subject: [PATCH] osmo-ci[master]: add jenkins job builder files for osmocom-nightly-nitb-split.sh In-Reply-To: References: Message-ID: add jenkins job builder files for osmocom-nightly-nitb-split.sh jenkins job builder is a python library to write jenkins jobs in .yml or .json including templating and basic substition operation. To update the job call: Create your own jenkins_jobs.ini based on the exmaple and call jenkins-jobs --conf ./jenkins_jobs.ini update osmocom-nightly-nitb-split.yml Change-Id: Ie7c655c6e0e3761e7970e479cadb5ae14faa2c1c --- M .gitignore A scripts/jenkins_jobs.ini.example A scripts/osmocom-nightly-nitb-split.yml 3 files changed, 27 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ci refs/changes/30/3530/2 diff --git a/.gitignore b/.gitignore index 4e25b2f..4163eb6 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,4 @@ install-* tokens.txt .*.sw? +jenkins_jobs.ini diff --git a/scripts/jenkins_jobs.ini.example b/scripts/jenkins_jobs.ini.example new file mode 100644 index 0000000..639b399 --- /dev/null +++ b/scripts/jenkins_jobs.ini.example @@ -0,0 +1,6 @@ +[jenkins] +user=example +# To get a token: Go to Jenkins via Web -> Login -> Press up right Corner on your Username -> Configure -> API token in the body +password=get_a_token +url=https://jenkins.osmocom.org/jenkins +query_plugins_info=False diff --git a/scripts/osmocom-nightly-nitb-split.yml b/scripts/osmocom-nightly-nitb-split.yml new file mode 100644 index 0000000..cb4c50f --- /dev/null +++ b/scripts/osmocom-nightly-nitb-split.yml @@ -0,0 +1,20 @@ +--- +- project: + name: Osmocom_nightly_nitb_split + jobs: + - Osmocom_nightly_nitb_split + +- job: + name: 'Osmocom_nightly_nitb_split' + project-type: freestyle + defaults: global + description: 'Generated by job-builder' + node: linux_amd64_debian8 + builders: + - shell: + ./scripts/osmocom-nightly-nitb-split.sh + scm: + - git: + url: git://git.osmocom.org/osmo-ci + git-config-name: 'Jenkins Builder' + git-config-email: 'admax at fe80.eu' -- To view, visit https://gerrit.osmocom.org/3530 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ie7c655c6e0e3761e7970e479cadb5ae14faa2c1c Gerrit-PatchSet: 2 Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Owner: lynxis lazus Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther From gerrit-no-reply at lists.osmocom.org Tue Aug 15 15:42:41 2017 From: gerrit-no-reply at lists.osmocom.org (Keith Whyte) Date: Tue, 15 Aug 2017 15:42:41 +0000 Subject: [MERGED] openbsc[master]: LIBMSC: Use sms->text, not sms->user_data to construct repor... In-Reply-To: References: Message-ID: Keith Whyte has submitted this change and it was merged. Change subject: LIBMSC: Use sms->text, not sms->user_data to construct report body ...................................................................... LIBMSC: Use sms->text, not sms->user_data to construct report body gsm_04_11.c sms_report_alloc() Use the sms->text, not the sms->user_data to construct the report body. This also prevents the potential output of non printable characters to the log and or vty. Change-Id: Id51bc9483ad6f52d6da74135605cfd12434c7c96 --- M openbsc/src/libmsc/gsm_04_11.c 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified Pablo Neira Ayuso: Looks good to me, but someone else must approve diff --git a/openbsc/src/libmsc/gsm_04_11.c b/openbsc/src/libmsc/gsm_04_11.c index d56a97c..5e736b3 100644 --- a/openbsc/src/libmsc/gsm_04_11.c +++ b/openbsc/src/libmsc/gsm_04_11.c @@ -666,7 +666,7 @@ len = snprintf((char *)sms_report->user_data, sizeof(sms_report->user_data), "id:%.08llu sub:000 dlvrd:000 submit date:YYMMDDhhmm done date:YYMMDDhhmm stat:DELIVRD err:000 text:%.20s", - sms->id, sms->user_data); + sms->id, sms->text); sms_report->user_data_len = len; LOGP(DLSMS, LOGL_NOTICE, "%s\n", sms_report->user_data); -- To view, visit https://gerrit.osmocom.org/3517 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Id51bc9483ad6f52d6da74135605cfd12434c7c96 Gerrit-PatchSet: 4 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Keith Whyte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Keith Whyte Gerrit-Reviewer: Pablo Neira Ayuso From gerrit-no-reply at lists.osmocom.org Tue Aug 15 16:11:36 2017 From: gerrit-no-reply at lists.osmocom.org (lynxis lazus) Date: Tue, 15 Aug 2017 16:11:36 +0000 Subject: [PATCH] osmo-ci[master]: add jenkins job builder files for osmocom-nightly-nitb-split.sh In-Reply-To: References: Message-ID: add jenkins job builder files for osmocom-nightly-nitb-split.sh jenkins job builder is a python library to write jenkins jobs in .yml or .json including templating and basic substition operation. To update the job call: Create your own jenkins_jobs.ini based on the exmaple and call jenkins-jobs --conf ./jenkins_jobs.ini update osmocom-nightly-nitb-split.yml Change-Id: Ie7c655c6e0e3761e7970e479cadb5ae14faa2c1c --- M .gitignore A scripts/jenkins_jobs.ini.example A scripts/osmocom-nightly-nitb-split.yml 3 files changed, 27 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ci refs/changes/30/3530/3 diff --git a/.gitignore b/.gitignore index 4e25b2f..4163eb6 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,4 @@ install-* tokens.txt .*.sw? +jenkins_jobs.ini diff --git a/scripts/jenkins_jobs.ini.example b/scripts/jenkins_jobs.ini.example new file mode 100644 index 0000000..639b399 --- /dev/null +++ b/scripts/jenkins_jobs.ini.example @@ -0,0 +1,6 @@ +[jenkins] +user=example +# To get a token: Go to Jenkins via Web -> Login -> Press up right Corner on your Username -> Configure -> API token in the body +password=get_a_token +url=https://jenkins.osmocom.org/jenkins +query_plugins_info=False diff --git a/scripts/osmocom-nightly-nitb-split.yml b/scripts/osmocom-nightly-nitb-split.yml new file mode 100644 index 0000000..6c264fd --- /dev/null +++ b/scripts/osmocom-nightly-nitb-split.yml @@ -0,0 +1,20 @@ +--- +- project: + name: Osmocom_nightly_nitb_split + jobs: + - Osmocom_nightly_nitb_split + +- job: + name: 'Osmocom_nightly_nitb_split' + project-type: freestyle + defaults: global + description: 'Generated by job-builder' + node: linux_amd64_debian8 + builders: + - shell: + ./scripts/osmocom-nightly-nitb-split.sh + scm: + - git: + url: git://git.osmocom.org/osmo-ci + git-config-name: 'Jenkins Builder' + git-config-email: 'jenkins at osmocom.org -- To view, visit https://gerrit.osmocom.org/3530 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ie7c655c6e0e3761e7970e479cadb5ae14faa2c1c Gerrit-PatchSet: 3 Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Owner: lynxis lazus Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther From gerrit-no-reply at lists.osmocom.org Tue Aug 15 17:34:12 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 15 Aug 2017 17:34:12 +0000 Subject: [PATCH] osmo-iuh[master]: hnbgw_cn.c: use new signature of osmo_sccp_addr_name(osmo_ss... Message-ID: Review at https://gerrit.osmocom.org/3531 hnbgw_cn.c: use new signature of osmo_sccp_addr_name(osmo_ss7_instance *ss7, osmo_sccp_addr *addr) libosmo-sccp introduce the new signature in 564ff618004b ("sccp: make osmo_sccp_addr_name() available") Change-Id: I5c9abba321ec182d293c33bcffea3462f8717045 --- M src/hnbgw_cn.c 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-iuh refs/changes/31/3531/1 diff --git a/src/hnbgw_cn.c b/src/hnbgw_cn.c index 4aa3422..3b828b4 100644 --- a/src/hnbgw_cn.c +++ b/src/hnbgw_cn.c @@ -439,7 +439,7 @@ if (!addr_has_pc_and_ssn(dest)) { LOGP(DMAIN, LOGL_ERROR, "Invalid/incomplete %s remote-addr: %s\n", - label, osmo_sccp_addr_name(dest)); + label, osmo_sccp_addr_name(*ss7, dest)); return -1; } -- To view, visit https://gerrit.osmocom.org/3531 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I5c9abba321ec182d293c33bcffea3462f8717045 Gerrit-PatchSet: 1 Gerrit-Project: osmo-iuh Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: lynxis lazus From gerrit-no-reply at lists.osmocom.org Tue Aug 15 17:58:50 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 15 Aug 2017 17:58:50 +0000 Subject: osmo-iuh[master]: hnbgw_cn.c: use new signature of osmo_sccp_addr_name(osmo_ss... In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3531 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I5c9abba321ec182d293c33bcffea3462f8717045 Gerrit-PatchSet: 1 Gerrit-Project: osmo-iuh Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: lynxis lazus Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Aug 15 17:58:55 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 15 Aug 2017 17:58:55 +0000 Subject: [MERGED] osmo-iuh[master]: hnbgw_cn.c: use new signature of osmo_sccp_addr_name(osmo_ss... In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: hnbgw_cn.c: use new signature of osmo_sccp_addr_name(osmo_ss7_instance *ss7, osmo_sccp_addr *addr) ...................................................................... hnbgw_cn.c: use new signature of osmo_sccp_addr_name(osmo_ss7_instance *ss7, osmo_sccp_addr *addr) libosmo-sccp introduce the new signature in 564ff618004b ("sccp: make osmo_sccp_addr_name() available") Change-Id: I5c9abba321ec182d293c33bcffea3462f8717045 --- M src/hnbgw_cn.c 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/hnbgw_cn.c b/src/hnbgw_cn.c index 4aa3422..3b828b4 100644 --- a/src/hnbgw_cn.c +++ b/src/hnbgw_cn.c @@ -439,7 +439,7 @@ if (!addr_has_pc_and_ssn(dest)) { LOGP(DMAIN, LOGL_ERROR, "Invalid/incomplete %s remote-addr: %s\n", - label, osmo_sccp_addr_name(dest)); + label, osmo_sccp_addr_name(*ss7, dest)); return -1; } -- To view, visit https://gerrit.osmocom.org/3531 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I5c9abba321ec182d293c33bcffea3462f8717045 Gerrit-PatchSet: 1 Gerrit-Project: osmo-iuh Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: lynxis lazus From gerrit-no-reply at lists.osmocom.org Tue Aug 15 18:25:00 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 15 Aug 2017 18:25:00 +0000 Subject: [PATCH] osmo-hlr[master]: jenkins.sh: Proper error message if local environment isn't ... Message-ID: Review at https://gerrit.osmocom.org/3532 jenkins.sh: Proper error message if local environment isn't set up Change-Id: I5251ba148f36014f70ce2838caff70062c1a3db1 --- M contrib/jenkins.sh 1 file changed, 7 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-hlr refs/changes/32/3532/1 diff --git a/contrib/jenkins.sh b/contrib/jenkins.sh index 591d6c7..12b2be9 100755 --- a/contrib/jenkins.sh +++ b/contrib/jenkins.sh @@ -1,4 +1,11 @@ #!/bin/sh +# jenkins build helper script for osmo-hlr. This is how we build on jenkins.osmocom.org + +if ! [ -x "$(command -v osmo-build-dep.sh)" ]; then + echo "Error: We need to have scripts/osmo-deps.sh from http://git.osmocom.org/osmo-ci/ in PATH !" + exit 2 +fi + set -ex -- To view, visit https://gerrit.osmocom.org/3532 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I5251ba148f36014f70ce2838caff70062c1a3db1 Gerrit-PatchSet: 1 Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Tue Aug 15 18:27:56 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 15 Aug 2017 18:27:56 +0000 Subject: osmo-ci[master]: create osmocom-nightly-nitb-split.sh based on osmocom-nightl... In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3529 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I8bf9fce1547e98c44b62a693ac4aaa4beed1aef9 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Owner: lynxis lazus Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Aug 15 18:28:15 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 15 Aug 2017 18:28:15 +0000 Subject: osmo-ci[master]: add jenkins job builder files for osmocom-nightly-nitb-split.sh In-Reply-To: References: Message-ID: Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3530 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ie7c655c6e0e3761e7970e479cadb5ae14faa2c1c Gerrit-PatchSet: 3 Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Owner: lynxis lazus Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Aug 15 18:28:18 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 15 Aug 2017 18:28:18 +0000 Subject: osmo-ci[master]: add jenkins job builder files for osmocom-nightly-nitb-split.sh In-Reply-To: References: Message-ID: Patch Set 3: Verified+1 -- To view, visit https://gerrit.osmocom.org/3530 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ie7c655c6e0e3761e7970e479cadb5ae14faa2c1c Gerrit-PatchSet: 3 Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Owner: lynxis lazus Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Aug 15 18:28:20 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 15 Aug 2017 18:28:20 +0000 Subject: osmo-ci[master]: create osmocom-nightly-nitb-split.sh based on osmocom-nightl... In-Reply-To: References: Message-ID: Patch Set 1: Verified+1 -- To view, visit https://gerrit.osmocom.org/3529 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I8bf9fce1547e98c44b62a693ac4aaa4beed1aef9 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Owner: lynxis lazus Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Aug 15 18:28:21 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 15 Aug 2017 18:28:21 +0000 Subject: [MERGED] osmo-ci[master]: create osmocom-nightly-nitb-split.sh based on osmocom-nightl... In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: create osmocom-nightly-nitb-split.sh based on osmocom-nightly-packages.sh ...................................................................... create osmocom-nightly-nitb-split.sh based on osmocom-nightly-packages.sh Create a snapshot of the nitb split and upload it to OBS. Change-Id: I8bf9fce1547e98c44b62a693ac4aaa4beed1aef9 --- A scripts/osmocom-nightly-nitb-split.sh 1 file changed, 119 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved; Verified diff --git a/scripts/osmocom-nightly-nitb-split.sh b/scripts/osmocom-nightly-nitb-split.sh new file mode 100755 index 0000000..ee39a5b --- /dev/null +++ b/scripts/osmocom-nightly-nitb-split.sh @@ -0,0 +1,119 @@ +#!/bin/bash + +set -e +set -x + +DT=$(date +%Y%m%d) +PROJ=network:osmocom:nitb-split:nightly + +### common +checkout() { + local name=$1 + local branch=$2 + local url="git://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() { + # clean up the whole space + mkdir -p "$REPO/osc/" + cd "$REPO/osc" + osc co "$PROJ" +} + +build() { + local name=$1 + local repodir=$REPO/$name + local oscdir=$REPO/osc/$PROJ/$name + + if [ -d "$oscdir" ] ; then + # remove earlier version + cd "$oscdir" + osc rm -- * || true + else + # new package + mkdir -p "$oscdir/" + cd "$REPO/osc/$PROJ/" + osc add "$name" + fi + + cd "$repodir" + + VER=$(head -1 debian/changelog | cut -d ' ' -f 2 | sed 's,(,,' | sed 's,),,') + dch -v "$VER.$DT" -m "Snapshot build" + git commit -m "$DT snapshot" debian/ + + mkdir -p "$DATA/$name" + # source code build without dependency checks and unsigned source and unsigned change log + gbp buildpackage -S -uc -us -d --git-ignore-branch "--git-export-dir=$DATA/$name" + + mv "$DATA/$name/"*.tar* "$DATA/$name/"*.dsc "$oscdir/" + + cd "$oscdir" + osc add -- *.tar* *.dsc + osc ci -m "Snapshot $name $DT" +} + +post() { + cd "$REPO/osc/$PROJ/" + osc status +} + +build_osmocom() { + BASE=$PWD + DATA=$BASE/data + REPO=$BASE/repo + + # rather than including a dangerous 'rm -rf *' here, lets delegate to the user: + if [ -n "$(ls)" ]; then + echo "ERROR: I need to run in an empty directory." + exit 1 + fi + + prepare + + checkout libosmocore + checkout libosmo-abis + checkout libosmo-netif + checkout libosmo-sccp + checkout libsmpp34 + checkout libasn1c + checkout osmo-iuh lynxis/pre_release + checkout osmo-hlr + checkout openggsn + checkout osmo-mgw pre_release + checkout osmo-bsc lynxis/pre_release + checkout osmo-msc pre_release + checkout osmo-sgsn pre_release + + build libosmocore + build libosmo-abis + build libosmo-netif + build libosmo-sccp + build libsmpp34 + build libasn1c + build osmo-iuh + build osmo-hlr + build openggsn + build osmo-mgw + build osmo-bsc + build osmo-msc + build osmo-sgsn + + post +} + +TMPDIR=$(mktemp -d nightly-3g_XXXXXX) +cd "$TMPDIR" +build_osmocom +rm -rf "./$TMPDIR/" -- To view, visit https://gerrit.osmocom.org/3529 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I8bf9fce1547e98c44b62a693ac4aaa4beed1aef9 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Owner: lynxis lazus Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther From gerrit-no-reply at lists.osmocom.org Tue Aug 15 18:28:32 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 15 Aug 2017 18:28:32 +0000 Subject: [MERGED] osmo-ci[master]: add jenkins job builder files for osmocom-nightly-nitb-split.sh In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: add jenkins job builder files for osmocom-nightly-nitb-split.sh ...................................................................... add jenkins job builder files for osmocom-nightly-nitb-split.sh jenkins job builder is a python library to write jenkins jobs in .yml or .json including templating and basic substition operation. To update the job call: Create your own jenkins_jobs.ini based on the exmaple and call jenkins-jobs --conf ./jenkins_jobs.ini update osmocom-nightly-nitb-split.yml Change-Id: Ie7c655c6e0e3761e7970e479cadb5ae14faa2c1c --- M .gitignore A scripts/jenkins_jobs.ini.example A scripts/osmocom-nightly-nitb-split.yml 3 files changed, 27 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved; Verified diff --git a/.gitignore b/.gitignore index 4e25b2f..4163eb6 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,4 @@ install-* tokens.txt .*.sw? +jenkins_jobs.ini diff --git a/scripts/jenkins_jobs.ini.example b/scripts/jenkins_jobs.ini.example new file mode 100644 index 0000000..639b399 --- /dev/null +++ b/scripts/jenkins_jobs.ini.example @@ -0,0 +1,6 @@ +[jenkins] +user=example +# To get a token: Go to Jenkins via Web -> Login -> Press up right Corner on your Username -> Configure -> API token in the body +password=get_a_token +url=https://jenkins.osmocom.org/jenkins +query_plugins_info=False diff --git a/scripts/osmocom-nightly-nitb-split.yml b/scripts/osmocom-nightly-nitb-split.yml new file mode 100644 index 0000000..6c264fd --- /dev/null +++ b/scripts/osmocom-nightly-nitb-split.yml @@ -0,0 +1,20 @@ +--- +- project: + name: Osmocom_nightly_nitb_split + jobs: + - Osmocom_nightly_nitb_split + +- job: + name: 'Osmocom_nightly_nitb_split' + project-type: freestyle + defaults: global + description: 'Generated by job-builder' + node: linux_amd64_debian8 + builders: + - shell: + ./scripts/osmocom-nightly-nitb-split.sh + scm: + - git: + url: git://git.osmocom.org/osmo-ci + git-config-name: 'Jenkins Builder' + git-config-email: 'jenkins at osmocom.org -- To view, visit https://gerrit.osmocom.org/3530 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ie7c655c6e0e3761e7970e479cadb5ae14faa2c1c Gerrit-PatchSet: 3 Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Owner: lynxis lazus Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther From gerrit-no-reply at lists.osmocom.org Tue Aug 15 18:28:47 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 15 Aug 2017 18:28:47 +0000 Subject: osmo-hlr[master]: jenkins.sh: Proper error message if local environment isn't ... In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3532 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I5251ba148f36014f70ce2838caff70062c1a3db1 Gerrit-PatchSet: 1 Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Aug 15 18:28:50 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 15 Aug 2017 18:28:50 +0000 Subject: [MERGED] osmo-hlr[master]: jenkins.sh: Proper error message if local environment isn't ... In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: jenkins.sh: Proper error message if local environment isn't set up ...................................................................... jenkins.sh: Proper error message if local environment isn't set up Change-Id: I5251ba148f36014f70ce2838caff70062c1a3db1 --- M contrib/jenkins.sh 1 file changed, 7 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/contrib/jenkins.sh b/contrib/jenkins.sh index 591d6c7..12b2be9 100755 --- a/contrib/jenkins.sh +++ b/contrib/jenkins.sh @@ -1,4 +1,11 @@ #!/bin/sh +# jenkins build helper script for osmo-hlr. This is how we build on jenkins.osmocom.org + +if ! [ -x "$(command -v osmo-build-dep.sh)" ]; then + echo "Error: We need to have scripts/osmo-deps.sh from http://git.osmocom.org/osmo-ci/ in PATH !" + exit 2 +fi + set -ex -- To view, visit https://gerrit.osmocom.org/3532 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I5251ba148f36014f70ce2838caff70062c1a3db1 Gerrit-PatchSet: 1 Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Tue Aug 15 18:29:21 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 15 Aug 2017 18:29:21 +0000 Subject: [MERGED] osmo-bts[master]: octphy: implement support for dynamic timeslots In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: octphy: implement support for dynamic timeslots ...................................................................... octphy: implement support for dynamic timeslots Implement API functions bts_model_ts_connect() and bts_model_ts_disconnect() in order to support dynamic timeslot allocation. Change-Id: Ia109d4bfade7bc28442127581f4bb0289146ea71 --- M src/osmo-bts-octphy/l1_if.c M src/osmo-bts-octphy/l1_oml.c 2 files changed, 126 insertions(+), 13 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/osmo-bts-octphy/l1_if.c b/src/osmo-bts-octphy/l1_if.c index cb792d7..e4ab538 100644 --- a/src/osmo-bts-octphy/l1_if.c +++ b/src/osmo-bts-octphy/l1_if.c @@ -329,11 +329,30 @@ return 0; } -static uint8_t chan_nr_by_sapi(enum gsm_phys_chan_config pchan, +static enum gsm_phys_chan_config pick_pchan(struct gsm_bts_trx_ts *ts) +{ + switch (ts->pchan) { + case GSM_PCHAN_TCH_F_PDCH: + if (ts->flags & TS_F_PDCH_ACTIVE) + return GSM_PCHAN_PDCH; + return GSM_PCHAN_TCH_F; + case GSM_PCHAN_TCH_F_TCH_H_PDCH: + return ts->dyn.pchan_is; + default: + return ts->pchan; + } +} + +static uint8_t chan_nr_by_sapi(struct gsm_bts_trx_ts *ts, tOCTVC1_GSM_SAPI_ENUM sapi, uint8_t subCh, uint8_t u8Tn, uint32_t u32Fn) { uint8_t cbits = 0; + enum gsm_phys_chan_config pchan = pick_pchan(ts); + + OSMO_ASSERT(pchan != GSM_PCHAN_TCH_F_PDCH); + OSMO_ASSERT(pchan != GSM_PCHAN_TCH_F_TCH_H_PDCH); + switch (sapi) { case cOCTVC1_GSM_SAPI_ENUM_BCCH: cbits = 0x10; @@ -476,7 +495,7 @@ if (!L1SAP_IS_CHAN_TCHF(chan_nr) && !L1SAP_IS_CHAN_PDCH(chan_nr)) subCh = l1sap_chan2ss(chan_nr); } else if (L1SAP_IS_CHAN_TCHF(chan_nr) || L1SAP_IS_CHAN_PDCH(chan_nr)) { - if (trx->ts[u8Tn].pchan == GSM_PCHAN_PDCH) { + if (ts_is_pdch(&trx->ts[u8Tn])) { if (L1SAP_IS_PTCCH(u32Fn)) { sapi = cOCTVC1_GSM_SAPI_ENUM_PTCCH; } else { @@ -932,7 +951,7 @@ get_value_string(octphy_l1sapi_names, sapi)); /* in case we need to forward primitive to common part */ - chan_nr = chan_nr_by_sapi(trx->ts[ts_num].pchan, sapi, sc, ts_num, fn); + chan_nr = chan_nr_by_sapi(&trx->ts[ts_num], sapi, sc, ts_num, fn); if (chan_nr) { if (sapi == cOCTVC1_GSM_SAPI_ENUM_SACCH) link_id = LID_SACCH; @@ -1053,7 +1072,7 @@ fn = data_ind->Data.ulFrameNumber; /* chan_nr and link_id */ - chan_nr = chan_nr_by_sapi(trx->ts[ts_num].pchan, sapi, sc, ts_num, fn); + chan_nr = chan_nr_by_sapi(&trx->ts[ts_num], sapi, sc, ts_num, fn); if (!chan_nr) { LOGP(DL1C, LOGL_ERROR, "Rx PH-DATA.ind for unknown L1 SAPI %s\n", diff --git a/src/osmo-bts-octphy/l1_oml.c b/src/osmo-bts-octphy/l1_oml.c index 03ff547..d1d5bf6 100644 --- a/src/osmo-bts-octphy/l1_oml.c +++ b/src/osmo-bts-octphy/l1_oml.c @@ -1406,21 +1406,24 @@ return opstart_compl(mo); } -static int ts_connect(struct gsm_bts_trx_ts *ts) +static int ts_connect_as(struct gsm_bts_trx_ts *ts, + enum gsm_phys_chan_config pchan, + l1if_compl_cb * cb, void *data) { struct phy_instance *pinst = trx_phy_instance(ts->trx); struct octphy_hdl *fl1h = pinst->phy_link->u.octphy.hdl; struct msgb *msg = l1p_msgb_alloc(); tOCTVC1_GSM_MSG_TRX_ACTIVATE_PHYSICAL_CHANNEL_CMD *oc = - (tOCTVC1_GSM_MSG_TRX_ACTIVATE_PHYSICAL_CHANNEL_CMD *) oc; + (tOCTVC1_GSM_MSG_TRX_ACTIVATE_PHYSICAL_CHANNEL_CMD *) oc; - oc = (tOCTVC1_GSM_MSG_TRX_ACTIVATE_PHYSICAL_CHANNEL_CMD *) msgb_put(msg, sizeof(*oc)); + oc = (tOCTVC1_GSM_MSG_TRX_ACTIVATE_PHYSICAL_CHANNEL_CMD*) + msgb_put(msg, sizeof(*oc)); l1if_fill_msg_hdr(&oc->Header, msg, fl1h, cOCTVC1_MSG_TYPE_COMMAND, cOCTVC1_GSM_MSG_TRX_ACTIVATE_PHYSICAL_CHANNEL_CID); oc->TrxId.byTrxId = pinst->u.octphy.trx_id; oc->PchId.byTimeslotNb = ts->nr; - oc->ulChannelType = pchan_to_logChComb[ts->pchan]; + oc->ulChannelType = pchan_to_logChComb[pchan]; /* TODO: how should we know the payload type here? Also, why * would the payload type have to be the same for both halves of @@ -1436,11 +1439,71 @@ } LOGP(DL1C, LOGL_INFO, "PCHAN-ACT.req(trx=%u, ts=%u, chcomb=%u)\n", - ts->trx->nr, ts->nr, ts->pchan); + ts->trx->nr, ts->nr, pchan); mOCTVC1_GSM_MSG_TRX_ACTIVATE_PHYSICAL_CHANNEL_CMD_SWAP(oc); - return l1if_req_compl(fl1h, msg, pchan_act_compl_cb, NULL); + return l1if_req_compl(fl1h, msg, cb, data); +} + +/* Dynamic timeslots: Disconnect callback, reports completed disconnection + * to higher layers */ +static int ts_disconnect_cb(struct octphy_hdl *fl1, struct msgb *resp, + void *data) +{ + tOCTVC1_GSM_MSG_TRX_DEACTIVATE_PHYSICAL_CHANNEL_RSP *ar = + (tOCTVC1_GSM_MSG_TRX_DEACTIVATE_PHYSICAL_CHANNEL_RSP *) resp->l2h; + uint8_t ts_nr; + struct gsm_bts_trx *trx; + struct gsm_bts_trx_ts *ts; + + trx = trx_by_l1h(fl1, ar->TrxId.byTrxId); + ts_nr = ar->PchId.byTimeslotNb; + ts = &trx->ts[ts_nr]; + + cb_ts_disconnected(ts); + + return 0; +} + +/* Dynamic timeslots: Connect callback, reports completed disconnection to + * higher layers */ +static int ts_connect_cb(struct octphy_hdl *fl1, struct msgb *resp, void *data) +{ + tOCTVC1_GSM_MSG_TRX_ACTIVATE_PHYSICAL_CHANNEL_RSP *ar = + (tOCTVC1_GSM_MSG_TRX_ACTIVATE_PHYSICAL_CHANNEL_RSP *) resp->l2h; + uint8_t ts_nr; + struct gsm_bts_trx *trx; + struct gsm_bts_trx_ts *ts; + + /* in a completion call-back, we take msgb ownership and must + * release it before returning */ + + mOCTVC1_GSM_MSG_TRX_ACTIVATE_PHYSICAL_CHANNEL_RSP_SWAP(ar); + trx = trx_by_l1h(fl1, ar->TrxId.byTrxId); + ts_nr = ar->PchId.byTimeslotNb; + OSMO_ASSERT(ts_nr <= ARRAY_SIZE(trx->ts)); + + ts = &trx->ts[ts_nr]; + + LOGP(DL1C, LOGL_INFO, "PCHAN-ACT.conf(trx=%u, ts=%u, chcomb=%u) = %s\n", + ts->trx->nr, ts->nr, ts->pchan, + octvc1_rc2string(ar->Header.ulReturnCode)); + + if (ar->Header.ulReturnCode != cOCTVC1_RC_OK) { + LOGP(DL1C, LOGL_ERROR, + "PCHAN-ACT failed: %s\n\n", + octvc1_rc2string(ar->Header.ulReturnCode)); + LOGP(DL1C, LOGL_ERROR, "Exiting... \n\n"); + msgb_free(resp); + exit(-1); + } + + msgb_free(resp); + + cb_ts_connected(ts); + + return 0; } /*********************************************************************** @@ -1583,13 +1646,15 @@ int bts_model_opstart(struct gsm_bts *bts, struct gsm_abis_mo *mo, void *obj) { int rc = -1; + struct gsm_bts_trx_ts *ts; switch (mo->obj_class) { case NM_OC_RADIO_CARRIER: rc = trx_init(obj); break; case NM_OC_CHANNEL: - rc = ts_connect(obj); + ts = (struct gsm_bts_trx_ts*) obj; + rc = ts_connect_as(ts, ts->pchan, pchan_act_compl_cb, NULL); break; case NM_OC_BTS: case NM_OC_SITE_MANAGER: @@ -1614,11 +1679,40 @@ int bts_model_ts_disconnect(struct gsm_bts_trx_ts *ts) { - return -ENOTSUP; + struct phy_instance *pinst = trx_phy_instance(ts->trx); + struct octphy_hdl *fl1h = pinst->phy_link->u.octphy.hdl; + struct msgb *msg = l1p_msgb_alloc(); + tOCTVC1_GSM_MSG_TRX_DEACTIVATE_PHYSICAL_CHANNEL_CMD *oc = + (tOCTVC1_GSM_MSG_TRX_DEACTIVATE_PHYSICAL_CHANNEL_CMD *) oc; + + oc = (tOCTVC1_GSM_MSG_TRX_DEACTIVATE_PHYSICAL_CHANNEL_CMD *) + msgb_put(msg, sizeof(*oc)); + l1if_fill_msg_hdr(&oc->Header, msg, fl1h, cOCTVC1_MSG_TYPE_COMMAND, + cOCTVC1_GSM_MSG_TRX_DEACTIVATE_PHYSICAL_CHANNEL_CID); + + oc->TrxId.byTrxId = pinst->u.octphy.trx_id; + oc->PchId.byTimeslotNb = ts->nr; + + LOGP(DL1C, LOGL_INFO, "PCHAN-DEACT.req(trx=%u, ts=%u, chcomb=%u)\n", + ts->trx->nr, ts->nr, ts->pchan); + + mOCTVC1_GSM_MSG_TRX_DEACTIVATE_PHYSICAL_CHANNEL_CMD_SWAP(oc); + + return l1if_req_compl(fl1h, msg, ts_disconnect_cb, NULL); } int bts_model_ts_connect(struct gsm_bts_trx_ts *ts, enum gsm_phys_chan_config as_pchan) { - return -ENOTSUP; + if (as_pchan == GSM_PCHAN_TCH_F_PDCH + || as_pchan == GSM_PCHAN_TCH_F_TCH_H_PDCH) { + LOGP(DL1C, LOGL_ERROR, + "%s Requested TS connect as %s," + " expected a specific pchan instead\n", + gsm_ts_and_pchan_name(ts), gsm_pchan_name(as_pchan)); + exit(1); + return -EINVAL; + } + + return ts_connect_as(ts, as_pchan, ts_connect_cb, NULL); } -- To view, visit https://gerrit.osmocom.org/3527 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ia109d4bfade7bc28442127581f4bb0289146ea71 Gerrit-PatchSet: 2 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Tue Aug 15 18:29:40 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 15 Aug 2017 18:29:40 +0000 Subject: libosmo-sccp[master]: vty: fix (null) string in vty config In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3525 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I18f79cc4d4f1db8f2858e8e95098c5821d50594f Gerrit-PatchSet: 1 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Aug 15 18:29:44 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 15 Aug 2017 18:29:44 +0000 Subject: [MERGED] libosmo-sccp[master]: vty: fix (null) string in vty config In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: vty: fix (null) string in vty config ...................................................................... vty: fix (null) string in vty config The asp->cfg.remote.host is allowed to be NULL in cases where the localhost is used. Check if asp->cfg.remote.host is NULL when writing the config file and omit it when it is set to NULL. Change-Id: I18f79cc4d4f1db8f2858e8e95098c5821d50594f --- M src/osmo_ss7_vty.c 1 file changed, 2 insertions(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/osmo_ss7_vty.c b/src/osmo_ss7_vty.c index 9343edd..b58c3cb 100644 --- a/src/osmo_ss7_vty.c +++ b/src/osmo_ss7_vty.c @@ -632,7 +632,8 @@ osmo_ss7_asp_protocol_name(asp->cfg.proto), VTY_NEWLINE); if (asp->cfg.description) vty_out(vty, " description %s%s", asp->cfg.description, VTY_NEWLINE); - vty_out(vty, " remote-ip %s%s", asp->cfg.remote.host, VTY_NEWLINE); + if (asp->cfg.remote.host) + vty_out(vty, " remote-ip %s%s", asp->cfg.remote.host, VTY_NEWLINE); if (asp->cfg.qos_class) vty_out(vty, " qos-class %u%s", asp->cfg.qos_class, VTY_NEWLINE); } -- To view, visit https://gerrit.osmocom.org/3525 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I18f79cc4d4f1db8f2858e8e95098c5821d50594f Gerrit-PatchSet: 1 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Tue Aug 15 18:58:50 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 15 Aug 2017 18:58:50 +0000 Subject: [PATCH] meta-telephony[201705]: update libsmpp to 1.12 Message-ID: Review at https://gerrit.osmocom.org/3533 update libsmpp to 1.12 Also, link to the osmocom project page, not to the upstream source (which is unmaintained, AFAIK). Change-Id: If10f94c574b5dd89d9cb336bcf85dea2887c44d8 --- D recipes-misc/libsmpp/libsmpp34_1.10.bb A recipes-misc/libsmpp/libsmpp34_1.12.bb M recipes-misc/libsmpp/libsmpp34_git.bb 3 files changed, 19 insertions(+), 20 deletions(-) git pull ssh://gerrit.osmocom.org:29418/meta-telephony refs/changes/33/3533/1 diff --git a/recipes-misc/libsmpp/libsmpp34_1.10.bb b/recipes-misc/libsmpp/libsmpp34_1.10.bb deleted file mode 100644 index dbd4f5c..0000000 --- a/recipes-misc/libsmpp/libsmpp34_1.10.bb +++ /dev/null @@ -1,19 +0,0 @@ -DESCRIPTION = "C Open SMPP library" -HOMEPAGE = "http://sourceforge.net/projects/c-open-smpp-34/" -LICENSE = "LGPLv2.1+" -LIC_FILES_CHKSUM = "file://COPYING;md5=fbc093901857fcd118f065f900982c24" -SECTION = "libs" -DEPENDS = "libxml2" - -PR = "r3" - -SRC_URI = "${SOURCEFORGE_MIRROR}/c-open-smpp-34/c-open-smpp-34/libsmpp34-1.10%20%28LGPL%29/libsmpp34-${PV}.tar.gz" -SRC_URI = "git://git.osmocom.org/${PN}" -SRCREV = "9288d59cfdc452fa3a92728149537372ee5c6c56" -S = "${WORKDIR}/git" - -PARALLEL_MAKE = "" - -inherit autotools - - diff --git a/recipes-misc/libsmpp/libsmpp34_1.12.bb b/recipes-misc/libsmpp/libsmpp34_1.12.bb new file mode 100644 index 0000000..c73fb5d --- /dev/null +++ b/recipes-misc/libsmpp/libsmpp34_1.12.bb @@ -0,0 +1,18 @@ +DESCRIPTION = "C Open SMPP library" +HOMEPAGE = "http://osmocom.org/projects/libsmpp34" +LICENSE = "LGPLv2.1+" +LIC_FILES_CHKSUM = "file://COPYING;md5=fbc093901857fcd118f065f900982c24" +SECTION = "libs" +DEPENDS = "libxml2" + +PR = "r1" + +SRC_URI = "git://git.osmocom.org/${PN}" +SRCREV = "6d47c170cccd8a72eae985c7ecffba3f07d3861a" +S = "${WORKDIR}/git" + +PARALLEL_MAKE = "" + +inherit autotools + + diff --git a/recipes-misc/libsmpp/libsmpp34_git.bb b/recipes-misc/libsmpp/libsmpp34_git.bb index 4edbebd..235c908 100644 --- a/recipes-misc/libsmpp/libsmpp34_git.bb +++ b/recipes-misc/libsmpp/libsmpp34_git.bb @@ -1,5 +1,5 @@ DESCRIPTION = "C Open SMPP library" -HOMEPAGE = "http://sourceforge.net/projects/c-open-smpp-34/" +HOMEPAGE = "http://osmocom.org/projects/libsmpp34/" LICENSE = "LGPLv2.1+" LIC_FILES_CHKSUM = "file://COPYING;md5=fbc093901857fcd118f065f900982c24" SECTION = "libs" -- To view, visit https://gerrit.osmocom.org/3533 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: If10f94c574b5dd89d9cb336bcf85dea2887c44d8 Gerrit-PatchSet: 1 Gerrit-Project: meta-telephony Gerrit-Branch: 201705 Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Tue Aug 15 19:07:22 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 15 Aug 2017 19:07:22 +0000 Subject: [PATCH] meta-telephony[201705]: Add recipe for osmo-pcap, both server and client Message-ID: Review at https://gerrit.osmocom.org/3534 Add recipe for osmo-pcap, both server and client Change-Id: I5bb85b118029d1559a958803184690a9d0f23e4a --- A recipes-osmocom/osmo-pcap/files/0001-Makefile-Allow-cross-compilation-environment-to-spec.patch A recipes-osmocom/osmo-pcap/files/0001-Rename-osmo_pcap_-client_server-executables-to-osmo-.patch A recipes-osmocom/osmo-pcap/files/0001-sock_src_init-Don-t-freeaddrinfo-undefined-src_resul.patch A recipes-osmocom/osmo-pcap/files/0002-Use-TCP-port-numbers-for-VTY-that-don-t-overlap-with.patch A recipes-osmocom/osmo-pcap/files/osmo-pcap-client.service A recipes-osmocom/osmo-pcap/files/osmo-pcap-server.service A recipes-osmocom/osmo-pcap/osmo-pcap_git.bb 7 files changed, 252 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/meta-telephony refs/changes/34/3534/1 diff --git a/recipes-osmocom/osmo-pcap/files/0001-Makefile-Allow-cross-compilation-environment-to-spec.patch b/recipes-osmocom/osmo-pcap/files/0001-Makefile-Allow-cross-compilation-environment-to-spec.patch new file mode 100644 index 0000000..8952773 --- /dev/null +++ b/recipes-osmocom/osmo-pcap/files/0001-Makefile-Allow-cross-compilation-environment-to-spec.patch @@ -0,0 +1,25 @@ +From d6bd89581ac104a56441f63ca4a8f2139917f9f6 Mon Sep 17 00:00:00 2001 +From: Harald Welte +Date: Mon, 10 Jul 2017 13:58:58 +0200 +Subject: [PATCH] Makefile: Allow cross-compilation environment to specify CC + +--- + Makefile | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/Makefile b/Makefile +index b670978..9af3c99 100644 +--- a/Makefile ++++ b/Makefile +@@ -4,7 +4,7 @@ N2N_OSNAME=$(shell uname -p) + + ######## + +-CC=gcc ++CC?=gcc + DEBUG?=-g3 + #OPTIMIZATION?=-O2 + WARN?=-Wall -Wshadow -Wpointer-arith -Wmissing-declarations -Wnested-externs +-- +2.11.0 + diff --git a/recipes-osmocom/osmo-pcap/files/0001-Rename-osmo_pcap_-client_server-executables-to-osmo-.patch b/recipes-osmocom/osmo-pcap/files/0001-Rename-osmo_pcap_-client_server-executables-to-osmo-.patch new file mode 100644 index 0000000..64d7353 --- /dev/null +++ b/recipes-osmocom/osmo-pcap/files/0001-Rename-osmo_pcap_-client_server-executables-to-osmo-.patch @@ -0,0 +1,32 @@ +From 29cbf9b031fc425032c9acf2dce2095c2cc67bf4 Mon Sep 17 00:00:00 2001 +From: Harald Welte +Date: Fri, 21 Jul 2017 11:45:38 +0200 +Subject: [PATCH] Rename osmo_pcap_{client_server} executables to + osmo-pcap-{client,server} + +This naming is more in line with what all the other osmocom programs are +doing (e.g. osmo-pcu, osmo-bts-sysmo, osmo-bsc, ...). We don't +generally use osmo_ anywhere else, so I suggest to change it for more +uniformity. + +Change-Id: If1e3ce76f93266e0f01c801204769432b571fdb1 +--- + src/Makefile.am | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/Makefile.am b/src/Makefile.am +index 0532acf..17ed4e3 100644 +--- a/src/Makefile.am ++++ b/src/Makefile.am +@@ -1,7 +1,7 @@ + AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include -I$(top_builddir)/ + AM_CFLAGS = -Wall $(LIBOSMOCORE_CFLAGS) $(LIBOSMOVTY_CFLAGS) $(PCAP_CFLAGS) $(LIBGNUTLS_CFLAGS) + +-bin_PROGRAMS = osmo_pcap_client osmo_pcap_server ++bin_PROGRAMS = osmo-pcap-client osmo-pcap-server + + osmo_pcap_client_SOURCES = osmo_client_main.c osmo_common.c \ + osmo_client_core.c osmo_client_vty.c \ +-- +2.13.3 + diff --git a/recipes-osmocom/osmo-pcap/files/0001-sock_src_init-Don-t-freeaddrinfo-undefined-src_resul.patch b/recipes-osmocom/osmo-pcap/files/0001-sock_src_init-Don-t-freeaddrinfo-undefined-src_resul.patch new file mode 100644 index 0000000..d612cbe --- /dev/null +++ b/recipes-osmocom/osmo-pcap/files/0001-sock_src_init-Don-t-freeaddrinfo-undefined-src_resul.patch @@ -0,0 +1,32 @@ +From 2c679da8a6fba49511a453f21e2311d9d0e281d0 Mon Sep 17 00:00:00 2001 +From: Harald Welte +Date: Fri, 21 Jul 2017 13:06:15 +0200 +Subject: [PATCH] sock_src_init(): Don't freeaddrinfo() undefined src_result + +src_result is only valid "if (src)", so we cannot unconditionally +free it: + +(gdb) bt + host=0x52 , src=0x0) + at /usr/src/debug/osmo-pcap/0.0.6+gitrAUTOINC+4776b2972e-r1d/git/src/osmo_client_network.c:165 +--- + src/osmo_client_network.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/src/osmo_client_network.c b/src/osmo_client_network.c +index 937caa0..27c649a 100644 +--- a/src/osmo_client_network.c ++++ b/src/osmo_client_network.c +@@ -162,7 +162,8 @@ static int sock_src_init(uint16_t family, uint16_t type, uint8_t proto, + close(sfd); + } + freeaddrinfo(result); +- freeaddrinfo(src_result); ++ if (src) ++ freeaddrinfo(src_result); + + if (rp == NULL) { + fprintf(stderr, "unable to connect/bind socket: %s:%u: %s\n", +-- +2.11.0 + diff --git a/recipes-osmocom/osmo-pcap/files/0002-Use-TCP-port-numbers-for-VTY-that-don-t-overlap-with.patch b/recipes-osmocom/osmo-pcap/files/0002-Use-TCP-port-numbers-for-VTY-that-don-t-overlap-with.patch new file mode 100644 index 0000000..8ab2c19 --- /dev/null +++ b/recipes-osmocom/osmo-pcap/files/0002-Use-TCP-port-numbers-for-VTY-that-don-t-overlap-with.patch @@ -0,0 +1,84 @@ +From 285808ea15ff4e81abd3114101e10b800e120be2 Mon Sep 17 00:00:00 2001 +From: Harald Welte +Date: Fri, 21 Jul 2017 11:55:04 +0200 +Subject: [PATCH] Use TCP port numbers for VTY that don't overlap with other + Osmocom Software + +osmo-pcap historically was using port numbers that ware already used by +OsmoPCU and OsmoBTS. This leads to problems when wanting to run related +software together on one system. Let's break the historical assumptions +and start with non-overlapping port numbers that are allocated/assigned +from https://osmocom.org/projects/cellular-infrastructure/wiki/Port_Numbers + +Change-Id: I638ac0534517931d0987ce9f72f5db4f5b6c16b7 +--- + include/osmo-pcap/common.h | 9 +++++++++ + osmoappdesc.py | 4 ++-- + src/osmo_client_main.c | 2 +- + src/osmo_server_main.c | 2 +- + 4 files changed, 13 insertions(+), 4 deletions(-) + +diff --git a/include/osmo-pcap/common.h b/include/osmo-pcap/common.h +index 13c76e1..27fd514 100644 +--- a/include/osmo-pcap/common.h ++++ b/include/osmo-pcap/common.h +@@ -28,6 +28,15 @@ + #include + #include + #include ++#include ++ ++/* support old versions of libosmocore */ ++#ifndef OSMO_VTY_PORT_PCAP_CLIENT ++#define OSMO_VTY_PORT_PCAP_CLIENT 4237 ++#endif ++#ifndef OSMO_VTY_PORT_PCAP_SERVER ++#define OSMO_VTY_PORT_PCAP_SERVER 4238 ++#endif + + enum { + DPCAP, +diff --git a/osmoappdesc.py b/osmoappdesc.py +index 39928eb..6f66702 100644 +--- a/osmoappdesc.py ++++ b/osmoappdesc.py +@@ -20,8 +20,8 @@ app_configs = { + } + + apps = [ +- (4241, "src/osmo_pcap_server", "OsmoPCAPServer", "osmo-pcap-server"), +- (4240, "src/osmo_pcap_client", "OsmoPCAPClient", "osmo-pcap-client"), ++ (4238, "src/osmo_pcap_server", "OsmoPCAPServer", "osmo-pcap-server"), ++ (4237, "src/osmo_pcap_client", "OsmoPCAPClient", "osmo-pcap-client"), + ] + + vty_command = ["src/osmo_pcap_server", "-c", "contrib/osmo-pcap-server.cfg"] +diff --git a/src/osmo_client_main.c b/src/osmo_client_main.c +index 89d7e04..46a49b5 100644 +--- a/src/osmo_client_main.c ++++ b/src/osmo_client_main.c +@@ -206,7 +206,7 @@ int main(int argc, char **argv) + + osmo_tls_init(); + +- rc = telnet_init(tall_bsc_ctx, NULL, 4240); ++ rc = telnet_init(tall_bsc_ctx, NULL, OSMO_VTY_PORT_PCAP_CLIENT); + if (rc < 0) { + LOGP(DCLIENT, LOGL_ERROR, "Failed to bind telnet interface\n"); + exit(1); +diff --git a/src/osmo_server_main.c b/src/osmo_server_main.c +index 37a9632..95f3ce1 100644 +--- a/src/osmo_server_main.c ++++ b/src/osmo_server_main.c +@@ -219,7 +219,7 @@ int main(int argc, char **argv) + + osmo_tls_init(); + +- rc = telnet_init(tall_bsc_ctx, NULL, 4241); ++ rc = telnet_init(tall_bsc_ctx, NULL, OSMO_VTY_PORT_PCAP_SERVER); + if (rc < 0) { + LOGP(DCLIENT, LOGL_ERROR, "Failed to bind telnet interface\n"); + exit(1); +-- +2.13.3 + diff --git a/recipes-osmocom/osmo-pcap/files/osmo-pcap-client.service b/recipes-osmocom/osmo-pcap/files/osmo-pcap-client.service new file mode 100644 index 0000000..43e6c62 --- /dev/null +++ b/recipes-osmocom/osmo-pcap/files/osmo-pcap-client.service @@ -0,0 +1,12 @@ +[Unit] +Description=Osmocom PCAP aggregation client (probe) + +[Service] +Type=simple +ExecStart=/usr/bin/osmo-pcap-client -c /etc/osmocom/osmo-pcap-client.cfg +Restart=always +RestartSec=2 +RestartPreventExitStatus=1 + +[Install] +WantedBy=multi-user.target diff --git a/recipes-osmocom/osmo-pcap/files/osmo-pcap-server.service b/recipes-osmocom/osmo-pcap/files/osmo-pcap-server.service new file mode 100644 index 0000000..fcadeb2 --- /dev/null +++ b/recipes-osmocom/osmo-pcap/files/osmo-pcap-server.service @@ -0,0 +1,12 @@ +[Unit] +Description=Osmocom PCAP aggregation server + +[Service] +Type=simple +ExecStart=/usr/bin/osmo-pcap-server -c /etc/osmocom/osmo-pcap-server.cfg +Restart=always +RestartSec=2 +RestartPreventExitStatus=1 + +[Install] +WantedBy=multi-user.target diff --git a/recipes-osmocom/osmo-pcap/osmo-pcap_git.bb b/recipes-osmocom/osmo-pcap/osmo-pcap_git.bb new file mode 100644 index 0000000..f004de2 --- /dev/null +++ b/recipes-osmocom/osmo-pcap/osmo-pcap_git.bb @@ -0,0 +1,55 @@ +DESCRITOPN = "Osmocom PCAP clint (probe) and server (aggregator)" +LICENSE = "AGPLv3+" +LIC_FILES_CHKSUM = "file://COPYING;md5=73f1eb20517c55bf9493b7dd6e480788" +PV = "0.0.6+gitr${SRCPV}" +PR = "r1h" + +SRCREV = "${AUTOREV}" +SRC_URI = "git://git.osmocom.org/osmo-pcap \ + file://0001-Rename-osmo_pcap_-client_server-executables-to-osmo-.patch \ + file://0002-Use-TCP-port-numbers-for-VTY-that-don-t-overlap-with.patch \ + file://0001-sock_src_init-Don-t-freeaddrinfo-undefined-src_resul.patch \ + file://osmo-pcap-client.service \ + file://osmo-pcap-server.service \ + " +S = "${WORKDIR}/git" + +DEPENDS = "libosmocore zeromq libpcap gnutls" + +PACKAGES =+ "osmo-pcap-server osmo-pcap-client" + +inherit autotools pkgconfig systemd + +SYSTEMD_PACKAGES = "osmo-pcap-server osmo-pcap-client" + +EXTRA_OECONF += "--with-pcap-config=no" + +do_configure_prepend() { + export PCAP_LIBS="-lpcap" +} + +do_install_append() { + install -d ${D}${systemd_unitdir}/system + install -m 0644 ${WORKDIR}/osmo-pcap-client.service ${D}${systemd_unitdir}/system/ + install -m 0644 ${WORKDIR}/osmo-pcap-server.service ${D}${systemd_unitdir}/system/ + + install -d ${D}${sysconfdir}/osmocom + install -m 0660 ${S}/contrib/osmo-pcap-client.cfg ${D}${sysconfdir}/osmocom/ + install -m 0660 ${S}/contrib/osmo-pcap-server.cfg ${D}${sysconfdir}/osmocom/ + + install -d ${D}${sysconfdir}/cron.daily + mv ${D}${datadir}/osmo-pcap/osmo_pcap_clean_old ${D}${sysconfdir}/cron.daily/ + rmdir ${D}${datadir}/osmo-pcap + rmdir ${D}${datadir} +} + + +FILES_osmo-pcap-server = "${bindir}/osmo-pcap-server \ + ${systemd_unitdir}/system/osmo-pcap-server.service \ + ${sysconfdir}/osmocom/osmo-pcap-server.cfg \ + ${sysconfdir}/cron.daily/osmo_pcap_clean_old" + +FILES_osmo-pcap-client = "${bindir}/osmo-pcap-client \ + ${systemd_unitdir}/system/osmo-pcap-client.service \ + ${sysconfdir}/osmocom/osmo-pcap-client.cfg \ + ${sysconfdir}/cron.d/cron.daily/osmo_pcap_clean_old" -- To view, visit https://gerrit.osmocom.org/3534 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I5bb85b118029d1559a958803184690a9d0f23e4a Gerrit-PatchSet: 1 Gerrit-Project: meta-telephony Gerrit-Branch: 201705 Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Tue Aug 15 19:09:33 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 15 Aug 2017 19:09:33 +0000 Subject: meta-telephony[201705]: Add recipe for osmo-pcap, both server and client In-Reply-To: References: Message-ID: Patch Set 1: Code-Review-1 3 out of for patches have been merged to master, so this needs an update. but kep it here to not forget about it -- To view, visit https://gerrit.osmocom.org/3534 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I5bb85b118029d1559a958803184690a9d0f23e4a Gerrit-PatchSet: 1 Gerrit-Project: meta-telephony Gerrit-Branch: 201705 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Aug 15 19:13:19 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 15 Aug 2017 19:13:19 +0000 Subject: meta-telephony[201705]: update libsmpp to 1.12 In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3533 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: If10f94c574b5dd89d9cb336bcf85dea2887c44d8 Gerrit-PatchSet: 1 Gerrit-Project: meta-telephony Gerrit-Branch: 201705 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Aug 15 21:30:28 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 15 Aug 2017 21:30:28 +0000 Subject: [PATCH] libosmo-sccp[master]: Fix SCCP client crash on xUA server (STP) disconnect Message-ID: Review at https://gerrit.osmocom.org/3535 Fix SCCP client crash on xUA server (STP) disconnect When the server (STP) disappears from a live SCCP client, then the xUA default layer manager receives LM_E_SCTP_DISC_IND, which is traversing retart_asp(). In there, we first terminate the current instance of the layer manager FSM, and then re-initialize the ASP to use the default layer manager using osmo_ss7_asp_use_default_lm(). However, osmo_ss7_asp_use_default_lm() uses the presence of an asp->lm_priv pointer as a sign that the old layer manager is still running and attempts to terminate it - despite being terminated just before in restart_as(). So let's simply remove the termination from restart_asp(), and leave it to osmo_ss7_asp_use_default_lm(). Fixes: OS#2402 Change-Id: I062d3af17539de864b56d079fe9b8d76ad99cf1e --- M src/xua_default_lm_fsm.c 1 file changed, 0 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-sccp refs/changes/35/3535/1 diff --git a/src/xua_default_lm_fsm.c b/src/xua_default_lm_fsm.c index 2a03cbc..64f26c3 100644 --- a/src/xua_default_lm_fsm.c +++ b/src/xua_default_lm_fsm.c @@ -126,7 +126,6 @@ int log_level = fi->log_level; osmo_ss7_asp_restart(asp); - osmo_fsm_inst_term(fi, OSMO_FSM_TERM_ERROR, NULL); osmo_ss7_asp_use_default_lm(asp, log_level); } -- To view, visit https://gerrit.osmocom.org/3535 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I062d3af17539de864b56d079fe9b8d76ad99cf1e Gerrit-PatchSet: 1 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Tue Aug 15 21:33:19 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 15 Aug 2017 21:33:19 +0000 Subject: libosmo-sccp[master]: Fix SCCP client crash on xUA server (STP) disconnect In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3535 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I062d3af17539de864b56d079fe9b8d76ad99cf1e Gerrit-PatchSet: 1 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Aug 15 21:33:20 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 15 Aug 2017 21:33:20 +0000 Subject: [MERGED] libosmo-sccp[master]: Fix SCCP client crash on xUA server (STP) disconnect In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Fix SCCP client crash on xUA server (STP) disconnect ...................................................................... Fix SCCP client crash on xUA server (STP) disconnect When the server (STP) disappears from a live SCCP client, then the xUA default layer manager receives LM_E_SCTP_DISC_IND, which is traversing retart_asp(). In there, we first terminate the current instance of the layer manager FSM, and then re-initialize the ASP to use the default layer manager using osmo_ss7_asp_use_default_lm(). However, osmo_ss7_asp_use_default_lm() uses the presence of an asp->lm_priv pointer as a sign that the old layer manager is still running and attempts to terminate it - despite being terminated just before in restart_as(). So let's simply remove the termination from restart_asp(), and leave it to osmo_ss7_asp_use_default_lm(). Fixes: OS#2402 Change-Id: I062d3af17539de864b56d079fe9b8d76ad99cf1e --- M src/xua_default_lm_fsm.c 1 file changed, 0 insertions(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/xua_default_lm_fsm.c b/src/xua_default_lm_fsm.c index 2a03cbc..64f26c3 100644 --- a/src/xua_default_lm_fsm.c +++ b/src/xua_default_lm_fsm.c @@ -126,7 +126,6 @@ int log_level = fi->log_level; osmo_ss7_asp_restart(asp); - osmo_fsm_inst_term(fi, OSMO_FSM_TERM_ERROR, NULL); osmo_ss7_asp_use_default_lm(asp, log_level); } -- To view, visit https://gerrit.osmocom.org/3535 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I062d3af17539de864b56d079fe9b8d76ad99cf1e Gerrit-PatchSet: 1 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Aug 16 02:14:55 2017 From: gerrit-no-reply at lists.osmocom.org (Holger Freyther) Date: Wed, 16 Aug 2017 02:14:55 +0000 Subject: osmo-ci[master]: add jenkins job builder files for osmocom-nightly-nitb-split.sh In-Reply-To: References: Message-ID: Patch Set 3: Could you add a "requirement.txt" so one can do pip install -r requirement.txt to install the python dependency? -- To view, visit https://gerrit.osmocom.org/3530 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ie7c655c6e0e3761e7970e479cadb5ae14faa2c1c Gerrit-PatchSet: 3 Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Owner: lynxis lazus Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Aug 16 06:52:14 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Wed, 16 Aug 2017 06:52:14 +0000 Subject: meta-telephony[201705]: update libsmpp to 1.12 In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 (1 comment) https://gerrit.osmocom.org/#/c/3533/1/recipes-misc/libsmpp/libsmpp34_1.12.bb File recipes-misc/libsmpp/libsmpp34_1.12.bb: Line 8: PR = "r1" If I recall correctly PR usually start from r0, not r1, but I could be wrong here, and it's not that important anyways. -- To view, visit https://gerrit.osmocom.org/3533 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: If10f94c574b5dd89d9cb336bcf85dea2887c44d8 Gerrit-PatchSet: 1 Gerrit-Project: meta-telephony Gerrit-Branch: 201705 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Wed Aug 16 07:56:28 2017 From: gerrit-no-reply at lists.osmocom.org (Holger Freyther) Date: Wed, 16 Aug 2017 07:56:28 +0000 Subject: openbsc[master]: smpp: Fix compilation warning In-Reply-To: References: Message-ID: Patch Set 2: (1 comment) https://gerrit.osmocom.org/#/c/3524/2/openbsc/src/libmsc/smpp_openbsc.c File openbsc/src/libmsc/smpp_openbsc.c: Line 120: } maybe initialize this before the msg_payload call? -- To view, visit https://gerrit.osmocom.org/3524 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I0901ddadb5f72e1585cb1797ac22c8ab95e83146 Gerrit-PatchSet: 2 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pablo Neira Ayuso Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Wed Aug 16 09:35:38 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Wed, 16 Aug 2017 09:35:38 +0000 Subject: [PATCH] openbsc[master]: sgsn_test: Fix wrong definition of wrap func Message-ID: Review at https://gerrit.osmocom.org/3536 sgsn_test: Fix wrong definition of wrap func Commit 058cd573d8 added 2 new pointer parameters to gprs_subscr_request_auth_info, but forgot to update wraps of the function in sgsn_test. I catched this today because openbsc build test sgsn_test was failing. Closed look up to the logs showed: Assert failed (auts != NULL) == (auts_rand != NULL) openbsc/openbsc/src/gprs/gprs_subscriber.c:791 Change-Id: Ie9e4af6da0339536fb20ca0b7bbcf6f485bd522c --- M openbsc/tests/sgsn/sgsn_test.c 1 file changed, 5 insertions(+), 5 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/36/3536/1 diff --git a/openbsc/tests/sgsn/sgsn_test.c b/openbsc/tests/sgsn/sgsn_test.c index 2f1513a..d66c5dd 100644 --- a/openbsc/tests/sgsn/sgsn_test.c +++ b/openbsc/tests/sgsn/sgsn_test.c @@ -139,12 +139,12 @@ }; /* override, requires '-Wl,--wrap=gprs_subscr_request_auth_info' */ -int __real_gprs_subscr_request_auth_info(struct sgsn_mm_ctx *mmctx); -int (*subscr_request_auth_info_cb)(struct sgsn_mm_ctx *mmctx) = +int __real_gprs_subscr_request_auth_info(struct sgsn_mm_ctx *mmctx, const uint8_t *auts, const uint8_t *auts_rand); +int (*subscr_request_auth_info_cb)(struct sgsn_mm_ctx *mmctx, const uint8_t *auts, const uint8_t *auts_rand) = &__real_gprs_subscr_request_auth_info; -int __wrap_gprs_subscr_request_auth_info(struct sgsn_mm_ctx *mmctx) { - return (*subscr_request_auth_info_cb)(mmctx); +int __wrap_gprs_subscr_request_auth_info(struct sgsn_mm_ctx *mmctx, const uint8_t *auts, const uint8_t *auts_rand) { + return (*subscr_request_auth_info_cb)(mmctx, auts, auts_rand); }; /* override, requires '-Wl,--wrap=gsup_client_send' */ @@ -1160,7 +1160,7 @@ cleanup_test(); } -int my_subscr_request_auth_info_real_auth(struct sgsn_mm_ctx *mmctx) +int my_subscr_request_auth_info_real_auth(struct sgsn_mm_ctx *mmctx, const uint8_t *auts, const uint8_t *auts_rand) { struct gsm_auth_tuple at = { .vec.sres = {0x51, 0xe5, 0x51, 0xe5}, -- To view, visit https://gerrit.osmocom.org/3536 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ie9e4af6da0339536fb20ca0b7bbcf6f485bd522c Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Wed Aug 16 10:10:22 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Wed, 16 Aug 2017 10:10:22 +0000 Subject: openbsc[master]: smpp: Fix compilation warning In-Reply-To: References: Message-ID: Patch Set 2: (1 comment) https://gerrit.osmocom.org/#/c/3524/2/openbsc/src/libmsc/smpp_openbsc.c File openbsc/src/libmsc/smpp_openbsc.c: Line 120: } > maybe initialize this before the msg_payload call? I tried doing this: case TLVID_message_payload: sms_msg_len = 0; if (smpp34_submit_tlv_msg_payload(t, submit, &sms_msg, But compilation error is still triggered. It's also clearer for me to just initialize it at the start of the function. -- To view, visit https://gerrit.osmocom.org/3524 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I0901ddadb5f72e1585cb1797ac22c8ab95e83146 Gerrit-PatchSet: 2 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pablo Neira Ayuso Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Wed Aug 16 11:26:37 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 16 Aug 2017 11:26:37 +0000 Subject: osmo-msc[master]: rework debian packages support In-Reply-To: References: Message-ID: Patch Set 1: > How was this tested? It seems to require .deb from osmo-iuh but I > have trouble building master. Shall I use specific branch? lynxis has temporarily (?) set up his own package build thing on obs: https://build.opensuse.org/project/show/home:lynxis:osmocom which includes an osmo-iuh.deb. It should work, but there may still be numerous errors and rough edges, given the ongoing effort of openbsc.git repository split up. -- To view, visit https://gerrit.osmocom.org/3499 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I77544cb38c31777c3fab52979d19488a63e52de3 Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: lynxis lazus Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Aug 16 11:50:28 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Wed, 16 Aug 2017 11:50:28 +0000 Subject: osmo-msc[master]: rework debian packages support In-Reply-To: References: Message-ID: Patch Set 1: So it was tested using lynxis' .deb? -- To view, visit https://gerrit.osmocom.org/3499 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I77544cb38c31777c3fab52979d19488a63e52de3 Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: lynxis lazus Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Aug 16 13:29:11 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Wed, 16 Aug 2017 13:29:11 +0000 Subject: [PATCH] libosmo-netif[master]: osmux: Re-write osmux_snprintf Message-ID: Review at https://gerrit.osmocom.org/3537 osmux: Re-write osmux_snprintf After last small changes, it was spotted that some cases may still be able to make osmux_snprintf acces unexpected memory. This patch attemps to try harder at fixing those issue. See OS-#2443 for more information. Change-Id: I695771d099833842db37a415b636035d17f1bba7 --- M src/osmux.c 1 file changed, 40 insertions(+), 50 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-netif refs/changes/37/3537/1 diff --git a/src/osmux.c b/src/osmux.c index b3c43e2..2b1bef8 100644 --- a/src/osmux.c +++ b/src/osmux.c @@ -846,19 +846,17 @@ h->rtp_ssrc = rtp_ssrc; } -#define SNPRINTF_BUFFER_SIZE(ret, size, len, offset) \ - size -= ret; \ - if (ret > len) \ - ret = len; \ - offset += ret; \ - len -= ret; +#define SNPRINTF_BUFFER_SIZE(ret, buffer_offset, size) \ + if (ret < 0) \ + return ret; \ + if (ret >= size - buf_offset - 1) \ + return size - 1; /* full, early return */ \ + buf_offset += ret; \ + static int osmux_snprintf_header(char *buf, size_t size, struct osmux_hdr *osmuxh) { - int ret; - int len = size, offset = 0; - - ret = snprintf(buf, len, "OSMUX seq=%03u ccid=%03u " + return snprintf(buf, size, "OSMUX seq=%03u ccid=%03u " "ft=%01u ctr=%01u " "amr_f=%01u amr_q=%01u " "amr_ft=%02u amr_cmr=%02u ", @@ -866,82 +864,74 @@ osmuxh->ft, osmuxh->ctr, osmuxh->amr_f, osmuxh->amr_q, osmuxh->amr_ft, osmuxh->amr_cmr); - SNPRINTF_BUFFER_SIZE(ret, size, len, offset); - - return offset; } static int osmux_snprintf_payload(char *buf, size_t size, const uint8_t *payload, int payload_len) { + unsigned int buf_offset = 0; int ret, i; - int len = size, offset = 0; - ret = snprintf(buf+offset, len, "[ "); - SNPRINTF_BUFFER_SIZE(ret, size, len, offset); + ret = snprintf(buf + buf_offset, size - buf_offset, "[ "); + SNPRINTF_BUFFER_SIZE(ret, buf_offset, size); - for (i=0; ilen, len = size; + unsigned int msg_offset = 0; + unsigned int buf_offset = 0; struct osmux_hdr *osmuxh; - int this_len, msg_off = 0; - while (msg_len > 0) { - if (msg_len < sizeof(struct osmux_hdr)) { + while (msg->len > msg_offset) { + if (msg->len - msg_offset < sizeof(struct osmux_hdr)) { LOGP(DLMIB, LOGL_ERROR, - "No room for OSMUX header: only %d bytes\n", - msg_len); + "No room for OSMUX header: only %u bytes\n", + msg->len - msg_offset); return -1; } - osmuxh = (struct osmux_hdr *)((uint8_t *)msg->data + msg_off); + osmuxh = (struct osmux_hdr *)((uint8_t *)msg->data + msg_offset); - if (!osmo_amr_ft_valid(osmuxh->amr_ft)) { - LOGP(DLMIB, LOGL_ERROR, "Bad AMR FT %d, skipping\n", + if (osmuxh->ft == OSMUX_FT_VOICE_AMR && !osmo_amr_ft_valid(osmuxh->amr_ft)) { + LOGP(DLMIB, LOGL_ERROR, "Bad AMR FT 0x%x, skipping\n", osmuxh->amr_ft); return -1; } - ret = osmux_snprintf_header(buf+offset, size, osmuxh); - if (ret < 0) - break; - SNPRINTF_BUFFER_SIZE(ret, size, len, offset); + ret = osmux_snprintf_header(buf + buf_offset, size - buf_offset, osmuxh); + SNPRINTF_BUFFER_SIZE(ret, buf_offset, size); - this_len = sizeof(struct osmux_hdr) + - osmux_get_payload_len(osmuxh); - msg_off += this_len; + msg_offset += sizeof(struct osmux_hdr) + osmux_get_payload_len(osmuxh); - if (msg_len < this_len) { + if (msg_offset > msg->len) { LOGP(DLMIB, LOGL_ERROR, "No room for OSMUX payload: only %d bytes\n", - msg_len); + msg->len - msg_offset); return -1; } - ret = osmux_snprintf_payload(buf+offset, size, + ret = osmux_snprintf_payload(buf + buf_offset, size - buf_offset, osmux_get_payload(osmuxh), osmux_get_payload_len(osmuxh)); - if (ret < 0) - break; - SNPRINTF_BUFFER_SIZE(ret, size, len, offset); - - msg_len -= this_len; + SNPRINTF_BUFFER_SIZE(ret, buf_offset, size); } - - return offset; + return buf_offset; } /*! @} */ -- To view, visit https://gerrit.osmocom.org/3537 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I695771d099833842db37a415b636035d17f1bba7 Gerrit-PatchSet: 1 Gerrit-Project: libosmo-netif Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Wed Aug 16 15:07:42 2017 From: gerrit-no-reply at lists.osmocom.org (Minh-Quang Nguyen) Date: Wed, 16 Aug 2017 15:07:42 +0000 Subject: [PATCH] osmo-pcu[master]: EDGE: Fix UL link adaption. Message-ID: Review at https://gerrit.osmocom.org/3538 EDGE: Fix UL link adaption. We have seen that UL MCS5- MCS9 link adaptation has not been implemented in current PCU implementation. If the MS slowly moves far away from the BTS, the UL MCS will always stick at MCS9 no matter UL link quality values leading to poor data service experience. The UL MCS is expected to adapt from MCS9 -> MCSx due to bad UL quality. Below PCU traces indicate that UL MCS is quickly increasing to MCS9 (max MCS 9 was used in this test) and it never changes to other UL MCS due zero thresholds. <0004> gprs_ms.cpp:670 MS (IMSI ): Link quality 23dB (23dB) left window [0, 0], modifying uplink CS level: MCS-6 -> MCS-7 <0004> gprs_ms.cpp:670 MS (IMSI 000): Link quality 23dB (23dB) left window [0, 0], modifying uplink CS level: MCS-7 -> MCS-8 <0004> gprs_ms.cpp:670 MS (IMSI 000): Link quality 23dB (23dB) left window [0, 0], modifying uplink CS level: MCS-8 -> MCS-9 Change-Id: I9272c337ad6399da4a47cc6e2736e25f24e099d8 --- M src/bts.h M src/gprs_ms.cpp M src/pcu_main.cpp M src/pcu_vty.c 4 files changed, 117 insertions(+), 4 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/38/3538/1 diff --git a/src/bts.h b/src/bts.h index 1f1dae2..b1fb8cc 100644 --- a/src/bts.h +++ b/src/bts.h @@ -221,6 +221,7 @@ uint8_t cs_adj_upper_limit; uint8_t cs_adj_lower_limit; struct {int16_t low; int16_t high; } cs_lqual_ranges[MAX_GPRS_CS]; + struct {int16_t low; int16_t high; } mcs_lqual_ranges[MAX_GPRS_CS]; uint16_t cs_downgrade_threshold; /* downgrade if less packets left (DL) */ uint16_t ws_base; uint16_t ws_pdch; /* increase WS by this value per PDCH */ diff --git a/src/gprs_ms.cpp b/src/gprs_ms.cpp index c6b7e34..2f25d00 100644 --- a/src/gprs_ms.cpp +++ b/src/gprs_ms.cpp @@ -624,7 +624,7 @@ bts_data = m_bts->bts_data(); if (!max_cs_ul) { - LOGP(DRLCMACDL, LOGL_ERROR, + LOGP(DRLCMACMEAS, LOGL_ERROR, "max_cs_ul cannot be derived (current UL CS: %s)\n", m_current_cs_ul.name()); return; @@ -645,8 +645,8 @@ /* TODO, use separate table */ if (current_cs_num > MAX_GPRS_CS) current_cs_num = MAX_GPRS_CS; - low = bts_data->cs_lqual_ranges[current_cs_num-1].low; - high = bts_data->cs_lqual_ranges[current_cs_num-1].high; + low = bts_data->mcs_lqual_ranges[current_cs_num-1].low; + high = bts_data->mcs_lqual_ranges[current_cs_num-1].high; } else { return; } @@ -661,7 +661,7 @@ new_cs_ul.inc(mode()); if (m_current_cs_ul != new_cs_ul) { - LOGP(DRLCMACDL, LOGL_INFO, + LOGP(DRLCMACMEAS, LOGL_INFO, "MS (IMSI %s): " "Link quality %ddB (%ddB) left window [%d, %d], " "modifying uplink CS level: %s -> %s\n", diff --git a/src/pcu_main.cpp b/src/pcu_main.cpp index 8e7cde8..e909b75 100644 --- a/src/pcu_main.cpp +++ b/src/pcu_main.cpp @@ -200,6 +200,28 @@ bts->cs_lqual_ranges[2].high = 13; bts->cs_lqual_ranges[3].low = 12; bts->cs_lqual_ranges[3].high = 256; + + /* MCS-1 to MCS-9 */ + /* Default thresholds are referenced from literature */ + /* Fig. 2.3, Chapter 2, Optimizing Wireless Communication Systems, Springer (2009) */ + bts->mcs_lqual_ranges[0].low = -256; + bts->mcs_lqual_ranges[0].high = 6; + bts->mcs_lqual_ranges[1].low = 5; + bts->mcs_lqual_ranges[1].high = 8; + bts->mcs_lqual_ranges[2].low = 7; + bts->mcs_lqual_ranges[2].high = 13; + bts->mcs_lqual_ranges[3].low = 12; + bts->mcs_lqual_ranges[3].high = 15; + bts->mcs_lqual_ranges[4].low = 14; + bts->mcs_lqual_ranges[4].high = 17; + bts->mcs_lqual_ranges[5].low = 16; + bts->mcs_lqual_ranges[5].high = 18; + bts->mcs_lqual_ranges[6].low = 17; + bts->mcs_lqual_ranges[6].high = 20; + bts->mcs_lqual_ranges[7].low = 19; + bts->mcs_lqual_ranges[7].high = 24; + bts->mcs_lqual_ranges[8].low = 23; + bts->mcs_lqual_ranges[8].high = 256; bts->cs_downgrade_threshold = 200; /* TODO: increase them when CRBB decoding is implemented */ diff --git a/src/pcu_vty.c b/src/pcu_vty.c index 68d2f55..d77c7b4 100644 --- a/src/pcu_vty.c +++ b/src/pcu_vty.c @@ -178,6 +178,25 @@ bts->cs_lqual_ranges[3].low, VTY_NEWLINE); + vty_out(vty, " mcs link-quality-ranges mcs1 %d mcs2 %d %d mcs3 %d %d mcs4 %d %d mcs5 %d %d mcs6 %d %d mcs7 %d %d mcs8 %d %d mcs9 %d%s", + bts->mcs_lqual_ranges[0].high, + bts->mcs_lqual_ranges[1].low, + bts->mcs_lqual_ranges[1].high, + bts->mcs_lqual_ranges[2].low, + bts->mcs_lqual_ranges[2].high, + bts->mcs_lqual_ranges[3].low, + bts->mcs_lqual_ranges[3].high, + bts->mcs_lqual_ranges[4].low, + bts->mcs_lqual_ranges[4].high, + bts->mcs_lqual_ranges[5].low, + bts->mcs_lqual_ranges[5].high, + bts->mcs_lqual_ranges[6].low, + bts->mcs_lqual_ranges[6].high, + bts->mcs_lqual_ranges[7].low, + bts->mcs_lqual_ranges[7].high, + bts->mcs_lqual_ranges[8].low, + VTY_NEWLINE); + if (bts->initial_mcs_dl != 1 && bts->initial_mcs_ul != 1) { if (bts->initial_mcs_ul == bts->initial_mcs_dl) vty_out(vty, " mcs %d%s", bts->initial_mcs_dl, @@ -186,6 +205,7 @@ vty_out(vty, " mcs %d %d%s", bts->initial_mcs_dl, bts->initial_mcs_ul, VTY_NEWLINE); } + if (bts->max_mcs_dl && bts->max_mcs_ul) { if (bts->max_mcs_ul == bts->max_mcs_dl) vty_out(vty, " mcs max %d%s", bts->max_mcs_dl, @@ -969,6 +989,75 @@ return CMD_SUCCESS; } +DEFUN(cfg_pcu_mcs_lqual_ranges, + cfg_pcu_mcs_lqual_ranges_cmd, + "mcs link-quality-ranges mcs1 <0-35> mcs2 <0-35> <0-35> mcs3 <0-35> <0-35> mcs4 <0-35> <0-35> mcs5 <0-35> <0-35> mcs6 <0-35> <0-35> mcs7 <0-35> <0-35> mcs8 <0-35> <0-35> mcs9 <0-35>", + CS_STR "Set link quality ranges\n" + "Set quality range for MCS-1 (high value only)\n" + "MCS-1 high (dB)\n" + "Set quality range for MCS-2\n" + "MCS-2 high (dB)\n" + "MCS-2 low (dB)\n" + "Set quality range for MCS-3\n" + "MCS-3 high (dB)\n" + "MCS-3 low (dB)\n" + "Set quality range for MCS-4\n" + "MCS-4 high (dB)\n" + "MCS-4 low (dB)\n" + "Set quality range for MCS-5\n" + "MCS-5 high (dB)\n" + "MCS-5 low (dB)\n" + "Set quality range for MCS-6\n" + "MCS-6 low (dB)\n" + "MCS-6 high (dB)\n" + "Set quality range for MCS-7\n" + "MCS-7 low (dB)\n" + "MCS-7 high (dB)\n" + "Set quality range for MCS-8\n" + "MCS-8 low (dB)\n" + "MCS-8 high (dB)\n" + "Set quality range for MCS-9 (low value only)\n" + "MCS-9 low (dB)\n") +{ + struct gprs_rlcmac_bts *bts = bts_main_data(); + + uint8_t mcs1_high = atoi(argv[0]); + uint8_t mcs2_low = atoi(argv[1]); + uint8_t mcs2_high = atoi(argv[2]); + uint8_t mcs3_low = atoi(argv[3]); + uint8_t mcs3_high = atoi(argv[4]); + uint8_t mcs4_low = atoi(argv[5]); + uint8_t mcs4_high = atoi(argv[6]); + uint8_t mcs5_low = atoi(argv[7]); + uint8_t mcs5_high = atoi(argv[8]); + uint8_t mcs6_low = atoi(argv[9]); + uint8_t mcs6_high = atoi(argv[10]); + uint8_t mcs7_low = atoi(argv[11]); + uint8_t mcs7_high = atoi(argv[12]); + uint8_t mcs8_low = atoi(argv[13]); + uint8_t mcs8_high = atoi(argv[14]); + uint8_t mcs9_low = atoi(argv[15]); + + bts->mcs_lqual_ranges[0].high = mcs1_high; + bts->mcs_lqual_ranges[1].low = mcs2_low; + bts->mcs_lqual_ranges[1].high = mcs2_high; + bts->mcs_lqual_ranges[2].low = mcs3_low; + bts->mcs_lqual_ranges[2].high = mcs3_high; + bts->mcs_lqual_ranges[3].low = mcs4_low; + bts->mcs_lqual_ranges[3].high = mcs4_high; + bts->mcs_lqual_ranges[4].low = mcs5_low; + bts->mcs_lqual_ranges[4].high = mcs5_high; + bts->mcs_lqual_ranges[5].low = mcs6_low; + bts->mcs_lqual_ranges[5].high = mcs6_high; + bts->mcs_lqual_ranges[6].low = mcs7_low; + bts->mcs_lqual_ranges[6].high = mcs7_high; + bts->mcs_lqual_ranges[7].low = mcs8_low; + bts->mcs_lqual_ranges[7].high = mcs8_high; + bts->mcs_lqual_ranges[8].low = mcs9_low; + + return CMD_SUCCESS; +} + DEFUN(cfg_pcu_sock, cfg_pcu_sock_cmd, "pcu-socket PATH", @@ -1079,6 +1168,7 @@ install_element(PCU_NODE, &cfg_pcu_cs_downgrade_thrsh_cmd); install_element(PCU_NODE, &cfg_pcu_no_cs_downgrade_thrsh_cmd); install_element(PCU_NODE, &cfg_pcu_cs_lqual_ranges_cmd); + install_element(PCU_NODE, &cfg_pcu_mcs_lqual_ranges_cmd); install_element(PCU_NODE, &cfg_pcu_mcs_cmd); install_element(PCU_NODE, &cfg_pcu_dl_arq_cmd); install_element(PCU_NODE, &cfg_pcu_no_mcs_cmd); -- To view, visit https://gerrit.osmocom.org/3538 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I9272c337ad6399da4a47cc6e2736e25f24e099d8 Gerrit-PatchSet: 1 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Minh-Quang Nguyen From gerrit-no-reply at lists.osmocom.org Wed Aug 16 16:05:26 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Wed, 16 Aug 2017 16:05:26 +0000 Subject: [PATCH] osmo-trx[master]: Add -j option to bind to specific address Message-ID: Review at https://gerrit.osmocom.org/3539 Add -j option to bind to specific address Before this patch, the binding of the listening sockets was hardcoded to a local IP. Change-Id: I9ba184a1251c823e413a9230943ed263e52142ec --- M CommonLibs/Sockets.cpp M CommonLibs/Sockets.h M CommonLibs/SocketsTest.cpp M Transceiver52M/Transceiver.cpp M Transceiver52M/Transceiver.h M Transceiver52M/osmo-trx.cpp 6 files changed, 40 insertions(+), 28 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-trx refs/changes/39/3539/1 diff --git a/CommonLibs/Sockets.cpp b/CommonLibs/Sockets.cpp index 9030a86..a65d62b 100644 --- a/CommonLibs/Sockets.cpp +++ b/CommonLibs/Sockets.cpp @@ -223,18 +223,18 @@ -UDPSocket::UDPSocket(unsigned short wSrcPort) +UDPSocket::UDPSocket(const char *wSrcIP, unsigned short wSrcPort) :DatagramSocket() { - open(wSrcPort); + open(wSrcPort, wSrcIP); } -UDPSocket::UDPSocket(unsigned short wSrcPort, - const char * wDestIP, unsigned short wDestPort ) +UDPSocket::UDPSocket(const char *wSrcIP, unsigned short wSrcPort, + const char *wDestIP, unsigned short wDestPort) :DatagramSocket() { - open(wSrcPort); + open(wSrcPort, wSrcIP); destination(wDestPort, wDestIP); } @@ -246,7 +246,7 @@ } -void UDPSocket::open(unsigned short localPort) +void UDPSocket::open(unsigned short localPort, const char *wlocalIP) { // create mSocketFD = socket(AF_INET,SOCK_DGRAM,0); @@ -265,7 +265,7 @@ size_t length = sizeof(address); bzero(&address,length); address.sin_family = AF_INET; - address.sin_addr.s_addr = htonl(INADDR_LOOPBACK); + address.sin_addr.s_addr = inet_addr(wlocalIP); address.sin_port = htons(localPort); if (bind(mSocketFD,(struct sockaddr*)&address,length)<0) { perror("bind() failed"); diff --git a/CommonLibs/Sockets.h b/CommonLibs/Sockets.h index 0a70269..8312843 100644 --- a/CommonLibs/Sockets.h +++ b/CommonLibs/Sockets.h @@ -144,11 +144,11 @@ public: /** Open a USP socket with an OS-assigned port and no default destination. */ - UDPSocket( unsigned short localPort=0); + UDPSocket(const char *localIP, unsigned short localPort); /** Given a full specification, open the socket and set the dest address. */ - UDPSocket( unsigned short localPort, - const char * remoteIP, unsigned short remotePort); + UDPSocket(const char *localIP, unsigned short localPort, + const char *remoteIP, unsigned short remotePort); /** Set the destination port. */ void destination( unsigned short wDestPort, const char * wDestIP ); @@ -157,7 +157,7 @@ unsigned short port() const; /** Open and bind the UDP socket to a local port. */ - void open(unsigned short localPort=0); + void open(unsigned short localPort=0, const char *wlocalIP="127.0.0.1"); /** Give the return address of the most recently received packet. */ const struct sockaddr_in* source() const { return (const struct sockaddr_in*)mSource; } diff --git a/CommonLibs/SocketsTest.cpp b/CommonLibs/SocketsTest.cpp index 1fa8bbd..c2849e0 100644 --- a/CommonLibs/SocketsTest.cpp +++ b/CommonLibs/SocketsTest.cpp @@ -37,7 +37,7 @@ void *testReaderIP(void *) { - UDPSocket readSocket(5934, "localhost", 5061); + UDPSocket readSocket("127.0.0.1", 5934, "localhost", 5061); readSocket.nonblocking(); int rc = 0; while (rc mDataSockets; ///< socket for writing to/reading from GSM core std::vector mCtrlSockets; ///< socket for writing/reading control commands from GSM core diff --git a/Transceiver52M/osmo-trx.cpp b/Transceiver52M/osmo-trx.cpp index 61b3098..3f72fb7 100644 --- a/Transceiver52M/osmo-trx.cpp +++ b/Transceiver52M/osmo-trx.cpp @@ -62,7 +62,8 @@ struct trx_config { std::string log_level; - std::string addr; + std::string local_addr; + std::string remote_addr; std::string dev_args; unsigned port; unsigned tx_sps; @@ -134,7 +135,8 @@ ost << " Log Level............... " << config->log_level << std::endl; ost << " Device args............. " << config->dev_args << std::endl; ost << " TRX Base Port........... " << config->port << std::endl; - ost << " TRX Address............. " << config->addr << std::endl; + ost << " TRX Address............. " << config->local_addr << std::endl; + ost << " GSM Core Address........." << config->remote_addr << std::endl; ost << " Channels................ " << config->chans << std::endl; ost << " Tx Samples-per-Symbol... " << config->tx_sps << std::endl; ost << " Rx Samples-per-Symbol... " << config->rx_sps << std::endl; @@ -200,9 +202,10 @@ Transceiver *trx; VectorFIFO *fifo; - trx = new Transceiver(config->port, config->addr.c_str(), - config->tx_sps, config->rx_sps, config->chans, - GSM::Time(3,0), radio, config->rssi_offset); + trx = new Transceiver(config->port, config->local_addr.c_str(), + config->remote_addr.c_str(), config->tx_sps, + config->rx_sps, config->chans, GSM::Time(3,0), + radio, config->rssi_offset); if (!trx->init(config->filler, config->rtsc, config->rach_delay, config->edge)) { LOG(ALERT) << "Failed to initialize transceiver"; @@ -248,6 +251,7 @@ " -a UHD device args\n" " -l Logging level (%s)\n" " -i IP address of GSM core\n" + " -j IP address of osmo-trx\n" " -p Base port number\n" " -e Enable EDGE receiver\n" " -m Enable multi-ARFCN transceiver (default=disabled)\n" @@ -271,7 +275,8 @@ int option; config->log_level = "NOTICE"; - config->addr = DEFAULT_TRX_IP; + config->local_addr = DEFAULT_TRX_IP; + config->remote_addr = DEFAULT_TRX_IP; config->port = DEFAULT_TRX_PORT; config->tx_sps = DEFAULT_TX_SPS; config->rx_sps = DEFAULT_RX_SPS; @@ -288,7 +293,7 @@ config->edge = false; config->sched_rr = -1; - while ((option = getopt(argc, argv, "ha:l:i:p:c:dmxgfo:s:b:r:A:R:Set:")) != -1) { + while ((option = getopt(argc, argv, "ha:l:i:j:p:c:dmxgfo:s:b:r:A:R:Set:")) != -1) { switch (option) { case 'h': print_help(); @@ -301,7 +306,10 @@ config->log_level = optarg; break; case 'i': - config->addr = optarg; + config->remote_addr = optarg; + break; + case 'j': + config->local_addr = optarg; break; case 'p': config->port = atoi(optarg); -- To view, visit https://gerrit.osmocom.org/3539 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I9ba184a1251c823e413a9230943ed263e52142ec Gerrit-PatchSet: 1 Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Wed Aug 16 17:32:39 2017 From: gerrit-no-reply at lists.osmocom.org (lynxis lazus) Date: Wed, 16 Aug 2017 17:32:39 +0000 Subject: osmo-msc[master]: rework debian packages support In-Reply-To: References: Message-ID: Patch Set 1: it was moved yesterday to: https://build.opensuse.org/project/show/network:osmocom:nitb-split:nightly -- To view, visit https://gerrit.osmocom.org/3499 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I77544cb38c31777c3fab52979d19488a63e52de3 Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: lynxis lazus Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Aug 16 20:48:31 2017 From: gerrit-no-reply at lists.osmocom.org (Keith Whyte) Date: Wed, 16 Aug 2017 20:48:31 +0000 Subject: [PATCH] openbsc[master]: SMS Delivery reports: Use actual delivery time, not time of ... Message-ID: Review at https://gerrit.osmocom.org/3540 SMS Delivery reports: Use actual delivery time, not time of report creation. Set the time on the status report to the time the message was delivered, as this may not be the same as the time when we are delivering the report to the originating MS. Also, ask sqlite to give us the localtime rather than GMT, as the MS expects localtime Change-Id: I9056429d40bf02731f004b7833f1de45a0d1add8 --- M openbsc/include/openbsc/gsm_data.h M openbsc/src/libmsc/db.c M openbsc/src/libmsc/gsm_04_11.c 3 files changed, 7 insertions(+), 5 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/40/3540/1 diff --git a/openbsc/include/openbsc/gsm_data.h b/openbsc/include/openbsc/gsm_data.h index 6829d22..593adb3 100644 --- a/openbsc/include/openbsc/gsm_data.h +++ b/openbsc/include/openbsc/gsm_data.h @@ -457,6 +457,7 @@ unsigned long validity_minutes; bool is_report; + time_t created; uint8_t reply_path_req; uint8_t status_rep_req; uint8_t ud_hdr_ind; diff --git a/openbsc/src/libmsc/db.c b/openbsc/src/libmsc/db.c index 631e05f..56b1441 100644 --- a/openbsc/src/libmsc/db.c +++ b/openbsc/src/libmsc/db.c @@ -1641,6 +1641,7 @@ /* FIXME: validity */ /* FIXME: those should all be get_uchar, but sqlite3 is braindead */ + sms->created = dbi_result_get_datetime(result, "created"); sms->reply_path_req = dbi_result_get_ulonglong(result, "reply_path_req"); sms->status_rep_req = dbi_result_get_ulonglong(result, "status_rep_req"); sms->is_report = dbi_result_get_ulonglong(result, "is_report"); @@ -1704,7 +1705,7 @@ struct gsm_sms *sms; result = dbi_conn_queryf(conn, - "SELECT SMS.* " + "SELECT datetime(SMS.created,'localtime') as created, SMS.* " "FROM SMS JOIN Subscriber ON " "SMS.dest_addr = Subscriber.extension " "WHERE SMS.id >= %llu AND SMS.sent IS NULL " @@ -1734,7 +1735,7 @@ struct gsm_sms *sms; result = dbi_conn_queryf(conn, - "SELECT SMS.* " + "SELECT datetime(SMS.created,'localtime') as created, SMS.* " "FROM SMS JOIN Subscriber ON " "SMS.dest_addr = Subscriber.extension " "WHERE Subscriber.id >= %llu AND SMS.sent IS NULL " @@ -1763,7 +1764,7 @@ struct gsm_sms *sms; result = dbi_conn_queryf(conn, - "SELECT SMS.* " + "SELECT datetime(SMS.created,'localtime') as created, SMS.* " "FROM SMS JOIN Subscriber ON " "SMS.dest_addr = Subscriber.extension " "WHERE Subscriber.id = %llu AND SMS.sent IS NULL " diff --git a/openbsc/src/libmsc/gsm_04_11.c b/openbsc/src/libmsc/gsm_04_11.c index 5e736b3..ddef444 100644 --- a/openbsc/src/libmsc/gsm_04_11.c +++ b/openbsc/src/libmsc/gsm_04_11.c @@ -310,11 +310,11 @@ /* generate TP-SCTS (Service centre timestamp) */ smsp = msgb_put(msg, 7); - gsm340_gen_scts(smsp, time(NULL)); + gsm340_gen_scts(smsp, sms->created); /* generate TP-DT (Discharge time, in TP-SCTS format). */ smsp = msgb_put(msg, 7); - gsm340_gen_scts(smsp, time(NULL)); + gsm340_gen_scts(smsp, sms->created); /* TP-ST (status) */ smsp = msgb_put(msg, 1); -- To view, visit https://gerrit.osmocom.org/3540 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I9056429d40bf02731f004b7833f1de45a0d1add8 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Keith Whyte From gerrit-no-reply at lists.osmocom.org Wed Aug 16 20:52:41 2017 From: gerrit-no-reply at lists.osmocom.org (Keith Whyte) Date: Wed, 16 Aug 2017 20:52:41 +0000 Subject: openbsc[master]: SMS Delivery reports: Use actual delivery time, not time of ... In-Reply-To: References: Message-ID: Patch Set 1: (1 comment) https://gerrit.osmocom.org/#/c/3540/1/openbsc/src/libmsc/gsm_04_11.c File openbsc/src/libmsc/gsm_04_11.c: Line 313: gsm340_gen_scts(smsp, sms->created); Maybe this one should be "now" -- To view, visit https://gerrit.osmocom.org/3540 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I9056429d40bf02731f004b7833f1de45a0d1add8 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Keith Whyte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Keith Whyte Gerrit-Reviewer: Pablo Neira Ayuso Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Wed Aug 16 21:00:36 2017 From: gerrit-no-reply at lists.osmocom.org (Keith Whyte) Date: Wed, 16 Aug 2017 21:00:36 +0000 Subject: openbsc[master]: SMS Delivery reports: Use actual delivery time, not time of ... In-Reply-To: References: Message-ID: Patch Set 1: (1 comment) https://gerrit.osmocom.org/#/c/3540/1/openbsc/src/libmsc/db.c File openbsc/src/libmsc/db.c: Line 1708: "SELECT datetime(SMS.created,'localtime') as created, SMS.* " Hmm, this passes the test on my build box, but I guess I was being lazy here anyway.. -- To view, visit https://gerrit.osmocom.org/3540 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I9056429d40bf02731f004b7833f1de45a0d1add8 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Keith Whyte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Keith Whyte Gerrit-Reviewer: Pablo Neira Ayuso Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Wed Aug 16 21:32:58 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 16 Aug 2017 21:32:58 +0000 Subject: [PATCH] libosmocore[master]: auth_milenage: Fix non-AUTS case with OP Message-ID: Review at https://gerrit.osmocom.org/3541 auth_milenage: Fix non-AUTS case with OP We only implemented OPC generation from OP in the AUTS case, but not in the case of normal authentication vector generation. This never really was visible so far due to the fact that we use OPC at sysmocom, and never the shared OP value. Change-Id: Id3fa038dfc2ff1ba63616fa5e8eab0520481ff26 --- M include/osmocom/vty/ports.h M src/gsm/auth_milenage.c 2 files changed, 25 insertions(+), 12 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/41/3541/1 diff --git a/include/osmocom/vty/ports.h b/include/osmocom/vty/ports.h index 8f8ef75..c3ad389 100644 --- a/include/osmocom/vty/ports.h +++ b/include/osmocom/vty/ports.h @@ -26,4 +26,5 @@ #define OSMO_VTY_PORT_MNCC_SIP 4256 /* 4257 used by control interface */ #define OSMO_VTY_PORT_HLR 4258 +#define OSMO_VTY_PORT_GGSN 4259 /* When adding/changing port numbers, keep docs and wiki in sync. See above. */ diff --git a/src/gsm/auth_milenage.c b/src/gsm/auth_milenage.c index 8d50990..6dd4f45 100644 --- a/src/gsm/auth_milenage.c +++ b/src/gsm/auth_milenage.c @@ -30,16 +30,36 @@ * @{ */ +static const uint8_t *gen_opc_if_needed(const struct osmo_sub_auth_data *aud, uint8_t *gen_opc) +{ + int rc; + + /* Check if we only know OP and compute OPC if required */ + if (aud->type == OSMO_AUTH_TYPE_UMTS && aud->u.umts.opc_is_op) { + rc = milenage_opc_gen(gen_opc, aud->u.umts.k, aud->u.umts.opc); + if (rc < 0) + return NULL; + return gen_opc; + } else + return aud->u.umts.opc; +} + static int milenage_gen_vec(struct osmo_auth_vector *vec, struct osmo_sub_auth_data *aud, const uint8_t *_rand) { size_t res_len = sizeof(vec->res); uint64_t next_sqn; + uint8_t gen_opc[16]; + const uint8_t *opc; uint8_t sqn[6]; uint64_t ind_mask; uint64_t seq_1; int rc; + + opc = gen_opc_if_needed(aud, gen_opc); + if (!opc) + return -1; /* Determine next SQN, according to 3GPP TS 33.102: * SQN consists of SEQ and a lower significant part of IND bits: @@ -106,11 +126,11 @@ next_sqn = ((aud->u.umts.sqn + seq_1) & ind_mask) + aud->u.umts.ind; osmo_store64be_ext(next_sqn, sqn, 6); - milenage_generate(aud->u.umts.opc, aud->u.umts.amf, aud->u.umts.k, + milenage_generate(opc, aud->u.umts.amf, aud->u.umts.k, sqn, _rand, vec->autn, vec->ik, vec->ck, vec->res, &res_len); vec->res_len = res_len; - rc = gsm_milenage(aud->u.umts.opc, aud->u.umts.k, _rand, vec->sres, vec->kc); + rc = gsm_milenage(opc, aud->u.umts.k, _rand, vec->sres, vec->kc); if (rc < 0) return rc; @@ -129,18 +149,10 @@ { uint8_t sqn_out[6]; uint8_t gen_opc[16]; - uint8_t *opc; + const uint8_t *opc; int rc; - /* Check if we only know OP and compute OPC if required */ - if (aud->type == OSMO_AUTH_TYPE_UMTS && aud->u.umts.opc_is_op) { - rc = milenage_opc_gen(gen_opc, aud->u.umts.k, - aud->u.umts.opc); - if (rc < 0) - return rc; - opc = gen_opc; - } else - opc = aud->u.umts.opc; + opc = gen_opc_if_needed(aud, gen_opc); rc = milenage_auts(opc, aud->u.umts.k, rand_auts, auts, sqn_out); if (rc < 0) -- To view, visit https://gerrit.osmocom.org/3541 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Id3fa038dfc2ff1ba63616fa5e8eab0520481ff26 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Wed Aug 16 21:36:53 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 16 Aug 2017 21:36:53 +0000 Subject: libosmocore[master]: auth_milenage: Fix non-AUTS case with OP In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3541 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Id3fa038dfc2ff1ba63616fa5e8eab0520481ff26 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Aug 16 21:37:11 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 16 Aug 2017 21:37:11 +0000 Subject: libosmocore[master]: auth_milenage: Fix non-AUTS case with OP In-Reply-To: References: Message-ID: Patch Set 1: Code-Review-1 -- To view, visit https://gerrit.osmocom.org/3541 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Id3fa038dfc2ff1ba63616fa5e8eab0520481ff26 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Aug 16 21:37:56 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 16 Aug 2017 21:37:56 +0000 Subject: [PATCH] libosmocore[master]: auth_milenage: Fix non-AUTS case with OP In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3541 to look at the new patch set (#2). auth_milenage: Fix non-AUTS case with OP We only implemented OPC generation from OP in the AUTS case, but not in the case of normal authentication vector generation. This never really was visible so far due to the fact that we use OPC at sysmocom, and never the shared OP value. Change-Id: Id3fa038dfc2ff1ba63616fa5e8eab0520481ff26 --- M src/gsm/auth_milenage.c 1 file changed, 24 insertions(+), 12 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/41/3541/2 diff --git a/src/gsm/auth_milenage.c b/src/gsm/auth_milenage.c index 8d50990..6dd4f45 100644 --- a/src/gsm/auth_milenage.c +++ b/src/gsm/auth_milenage.c @@ -30,16 +30,36 @@ * @{ */ +static const uint8_t *gen_opc_if_needed(const struct osmo_sub_auth_data *aud, uint8_t *gen_opc) +{ + int rc; + + /* Check if we only know OP and compute OPC if required */ + if (aud->type == OSMO_AUTH_TYPE_UMTS && aud->u.umts.opc_is_op) { + rc = milenage_opc_gen(gen_opc, aud->u.umts.k, aud->u.umts.opc); + if (rc < 0) + return NULL; + return gen_opc; + } else + return aud->u.umts.opc; +} + static int milenage_gen_vec(struct osmo_auth_vector *vec, struct osmo_sub_auth_data *aud, const uint8_t *_rand) { size_t res_len = sizeof(vec->res); uint64_t next_sqn; + uint8_t gen_opc[16]; + const uint8_t *opc; uint8_t sqn[6]; uint64_t ind_mask; uint64_t seq_1; int rc; + + opc = gen_opc_if_needed(aud, gen_opc); + if (!opc) + return -1; /* Determine next SQN, according to 3GPP TS 33.102: * SQN consists of SEQ and a lower significant part of IND bits: @@ -106,11 +126,11 @@ next_sqn = ((aud->u.umts.sqn + seq_1) & ind_mask) + aud->u.umts.ind; osmo_store64be_ext(next_sqn, sqn, 6); - milenage_generate(aud->u.umts.opc, aud->u.umts.amf, aud->u.umts.k, + milenage_generate(opc, aud->u.umts.amf, aud->u.umts.k, sqn, _rand, vec->autn, vec->ik, vec->ck, vec->res, &res_len); vec->res_len = res_len; - rc = gsm_milenage(aud->u.umts.opc, aud->u.umts.k, _rand, vec->sres, vec->kc); + rc = gsm_milenage(opc, aud->u.umts.k, _rand, vec->sres, vec->kc); if (rc < 0) return rc; @@ -129,18 +149,10 @@ { uint8_t sqn_out[6]; uint8_t gen_opc[16]; - uint8_t *opc; + const uint8_t *opc; int rc; - /* Check if we only know OP and compute OPC if required */ - if (aud->type == OSMO_AUTH_TYPE_UMTS && aud->u.umts.opc_is_op) { - rc = milenage_opc_gen(gen_opc, aud->u.umts.k, - aud->u.umts.opc); - if (rc < 0) - return rc; - opc = gen_opc; - } else - opc = aud->u.umts.opc; + opc = gen_opc_if_needed(aud, gen_opc); rc = milenage_auts(opc, aud->u.umts.k, rand_auts, auts, sqn_out); if (rc < 0) -- To view, visit https://gerrit.osmocom.org/3541 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Id3fa038dfc2ff1ba63616fa5e8eab0520481ff26 Gerrit-PatchSet: 2 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Aug 16 21:39:21 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 16 Aug 2017 21:39:21 +0000 Subject: [PATCH] libosmocore[master]: ports.h: Add VTY port for GGSN Message-ID: Review at https://gerrit.osmocom.org/3542 ports.h: Add VTY port for GGSN Change-Id: I5bd49fbc19e88db96b4adbd56c82e7936059551c --- M include/osmocom/vty/ports.h 1 file changed, 1 insertion(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/42/3542/1 diff --git a/include/osmocom/vty/ports.h b/include/osmocom/vty/ports.h index 8f8ef75..c3ad389 100644 --- a/include/osmocom/vty/ports.h +++ b/include/osmocom/vty/ports.h @@ -26,4 +26,5 @@ #define OSMO_VTY_PORT_MNCC_SIP 4256 /* 4257 used by control interface */ #define OSMO_VTY_PORT_HLR 4258 +#define OSMO_VTY_PORT_GGSN 4259 /* When adding/changing port numbers, keep docs and wiki in sync. See above. */ -- To view, visit https://gerrit.osmocom.org/3542 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I5bd49fbc19e88db96b4adbd56c82e7936059551c Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Wed Aug 16 21:40:51 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 16 Aug 2017 21:40:51 +0000 Subject: [PATCH] libosmocore[master]: ports.h: Add VTY port for GGSN In-Reply-To: References: Message-ID: ports.h: Add VTY port for GGSN Change-Id: I5bd49fbc19e88db96b4adbd56c82e7936059551c --- M include/osmocom/vty/ports.h 1 file changed, 1 insertion(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/42/3542/2 diff --git a/include/osmocom/vty/ports.h b/include/osmocom/vty/ports.h index 8f8ef75..7e2a331 100644 --- a/include/osmocom/vty/ports.h +++ b/include/osmocom/vty/ports.h @@ -26,4 +26,5 @@ #define OSMO_VTY_PORT_MNCC_SIP 4256 /* 4257 used by control interface */ #define OSMO_VTY_PORT_HLR 4258 +#define OSMO_VTY_PORT_GGSN 4260 /* When adding/changing port numbers, keep docs and wiki in sync. See above. */ -- To view, visit https://gerrit.osmocom.org/3542 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I5bd49fbc19e88db96b4adbd56c82e7936059551c Gerrit-PatchSet: 2 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Aug 16 21:40:56 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 16 Aug 2017 21:40:56 +0000 Subject: libosmocore[master]: auth_milenage: Fix non-AUTS case with OP In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3541 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Id3fa038dfc2ff1ba63616fa5e8eab0520481ff26 Gerrit-PatchSet: 2 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Aug 16 21:40:58 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 16 Aug 2017 21:40:58 +0000 Subject: [MERGED] libosmocore[master]: auth_milenage: Fix non-AUTS case with OP In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: auth_milenage: Fix non-AUTS case with OP ...................................................................... auth_milenage: Fix non-AUTS case with OP We only implemented OPC generation from OP in the AUTS case, but not in the case of normal authentication vector generation. This never really was visible so far due to the fact that we use OPC at sysmocom, and never the shared OP value. Change-Id: Id3fa038dfc2ff1ba63616fa5e8eab0520481ff26 --- M src/gsm/auth_milenage.c 1 file changed, 24 insertions(+), 12 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/gsm/auth_milenage.c b/src/gsm/auth_milenage.c index 8d50990..6dd4f45 100644 --- a/src/gsm/auth_milenage.c +++ b/src/gsm/auth_milenage.c @@ -30,16 +30,36 @@ * @{ */ +static const uint8_t *gen_opc_if_needed(const struct osmo_sub_auth_data *aud, uint8_t *gen_opc) +{ + int rc; + + /* Check if we only know OP and compute OPC if required */ + if (aud->type == OSMO_AUTH_TYPE_UMTS && aud->u.umts.opc_is_op) { + rc = milenage_opc_gen(gen_opc, aud->u.umts.k, aud->u.umts.opc); + if (rc < 0) + return NULL; + return gen_opc; + } else + return aud->u.umts.opc; +} + static int milenage_gen_vec(struct osmo_auth_vector *vec, struct osmo_sub_auth_data *aud, const uint8_t *_rand) { size_t res_len = sizeof(vec->res); uint64_t next_sqn; + uint8_t gen_opc[16]; + const uint8_t *opc; uint8_t sqn[6]; uint64_t ind_mask; uint64_t seq_1; int rc; + + opc = gen_opc_if_needed(aud, gen_opc); + if (!opc) + return -1; /* Determine next SQN, according to 3GPP TS 33.102: * SQN consists of SEQ and a lower significant part of IND bits: @@ -106,11 +126,11 @@ next_sqn = ((aud->u.umts.sqn + seq_1) & ind_mask) + aud->u.umts.ind; osmo_store64be_ext(next_sqn, sqn, 6); - milenage_generate(aud->u.umts.opc, aud->u.umts.amf, aud->u.umts.k, + milenage_generate(opc, aud->u.umts.amf, aud->u.umts.k, sqn, _rand, vec->autn, vec->ik, vec->ck, vec->res, &res_len); vec->res_len = res_len; - rc = gsm_milenage(aud->u.umts.opc, aud->u.umts.k, _rand, vec->sres, vec->kc); + rc = gsm_milenage(opc, aud->u.umts.k, _rand, vec->sres, vec->kc); if (rc < 0) return rc; @@ -129,18 +149,10 @@ { uint8_t sqn_out[6]; uint8_t gen_opc[16]; - uint8_t *opc; + const uint8_t *opc; int rc; - /* Check if we only know OP and compute OPC if required */ - if (aud->type == OSMO_AUTH_TYPE_UMTS && aud->u.umts.opc_is_op) { - rc = milenage_opc_gen(gen_opc, aud->u.umts.k, - aud->u.umts.opc); - if (rc < 0) - return rc; - opc = gen_opc; - } else - opc = aud->u.umts.opc; + opc = gen_opc_if_needed(aud, gen_opc); rc = milenage_auts(opc, aud->u.umts.k, rand_auts, auts, sqn_out); if (rc < 0) -- To view, visit https://gerrit.osmocom.org/3541 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Id3fa038dfc2ff1ba63616fa5e8eab0520481ff26 Gerrit-PatchSet: 2 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Aug 16 21:41:33 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 16 Aug 2017 21:41:33 +0000 Subject: [PATCH] libosmocore[master]: ports.h: Add VTY port for GGSN In-Reply-To: References: Message-ID: ports.h: Add VTY port for GGSN Change-Id: I5bd49fbc19e88db96b4adbd56c82e7936059551c --- M include/osmocom/vty/ports.h 1 file changed, 2 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/42/3542/3 diff --git a/include/osmocom/vty/ports.h b/include/osmocom/vty/ports.h index 8f8ef75..ab3e1d5 100644 --- a/include/osmocom/vty/ports.h +++ b/include/osmocom/vty/ports.h @@ -26,4 +26,6 @@ #define OSMO_VTY_PORT_MNCC_SIP 4256 /* 4257 used by control interface */ #define OSMO_VTY_PORT_HLR 4258 +/* 4259 used by control interface */ +#define OSMO_VTY_PORT_GGSN 4260 /* When adding/changing port numbers, keep docs and wiki in sync. See above. */ -- To view, visit https://gerrit.osmocom.org/3542 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I5bd49fbc19e88db96b4adbd56c82e7936059551c Gerrit-PatchSet: 3 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Aug 16 21:42:49 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 16 Aug 2017 21:42:49 +0000 Subject: [PATCH] osmo-gsm-manuals[master]: Add VTY port number for GGSN Message-ID: Review at https://gerrit.osmocom.org/3543 Add VTY port number for GGSN Change-Id: I199f0d10b819215442885629ffc9955c949133ca --- M OsmoBSC/aoip-mgw-options.adoc M common/chapters/port_numbers.adoc 2 files changed, 57 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-manuals refs/changes/43/3543/1 diff --git a/OsmoBSC/aoip-mgw-options.adoc b/OsmoBSC/aoip-mgw-options.adoc index 8ce3b91..79de15b 100644 --- a/OsmoBSC/aoip-mgw-options.adoc +++ b/OsmoBSC/aoip-mgw-options.adoc @@ -75,3 +75,59 @@ ---- include::mgw/osmo-bsc-new-mgw-e1.msc[] ---- + + +== BSC Design Notes + +=== channel assignment FSM + +* have a FSM for a channel assignment +** started by BSSAP ASSGN REQ from MSC +** RF channel allocation +** RSL channel activation +** MGCP for A side (AoIP) +** MGCP for Abis side to bsc-mgcp +** IPA RSL xxCX (Abis/IP) +** queueing? + +* should this simply be a 'lchan fsm'? +* should lchan be separate sub-fsm? +* each MGCP operation sub-fsm? + +=== MGCP CallAgent Endpoint FSM + +* Transmit + Retransmit CRCX, MDCX, DLCX +* Receive ACK/NACKs +* user API to create/modify/delete + +=== IPA xxCX CallAgent Endpoint FSM + +* Transmit + Retransmit CRCX, MDCX, DLCX +* Receive ACK/NACKs +* user API to create/modify/delete +** share that API/SAP with MGCP CA + +=== lchan FSM + +* Transmit RSL CHAN ACT +* Receive RSL CHAN ACT ACK/NACK +* SAPI handling? + + +== MGW Design Notes + +=== Functionality + +* use libosmo-abis to open traffic E1/T1 slots +* subch_demux for 16k sub-slots +* TRAU frame parsing/generation for all codecs +* fully controlled by MGCP +* different endpoint classes +** endpoints to PCM ports +** endpoints attached to 'RTP packet bridge' +** osMUX endpoints +* transcoding between codecs +* de-jitter + + +=== MGCP MGW Endpoint FSM diff --git a/common/chapters/port_numbers.adoc b/common/chapters/port_numbers.adoc index d5cba8f..08d9b3c 100644 --- a/common/chapters/port_numbers.adoc +++ b/common/chapters/port_numbers.adoc @@ -34,6 +34,7 @@ |TCP|4257|Control Interface|ggsn (OpenGGSN) |TCP|4258|telnet (VTY)|osmo-hlr |TCP|4259|Control Interface|osmo-hlr +|TCP|4260|telnet (VTY)|ggsn (OpenGGSN) |UDP|4729|GSMTAP|Almost every osmocom project |TCP|5000|A/IP|osmo-bsc, osmo-bsc_nat |UDP|2427|GSMTAP|osmo-pcu, osmo-bts -- To view, visit https://gerrit.osmocom.org/3543 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I199f0d10b819215442885629ffc9955c949133ca Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Wed Aug 16 21:43:37 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 16 Aug 2017 21:43:37 +0000 Subject: [PATCH] osmo-gsm-manuals[master]: Add VTY port number for GGSN In-Reply-To: References: Message-ID: Add VTY port number for GGSN Change-Id: I199f0d10b819215442885629ffc9955c949133ca --- M common/chapters/port_numbers.adoc 1 file changed, 1 insertion(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-manuals refs/changes/43/3543/2 diff --git a/common/chapters/port_numbers.adoc b/common/chapters/port_numbers.adoc index d5cba8f..08d9b3c 100644 --- a/common/chapters/port_numbers.adoc +++ b/common/chapters/port_numbers.adoc @@ -34,6 +34,7 @@ |TCP|4257|Control Interface|ggsn (OpenGGSN) |TCP|4258|telnet (VTY)|osmo-hlr |TCP|4259|Control Interface|osmo-hlr +|TCP|4260|telnet (VTY)|ggsn (OpenGGSN) |UDP|4729|GSMTAP|Almost every osmocom project |TCP|5000|A/IP|osmo-bsc, osmo-bsc_nat |UDP|2427|GSMTAP|osmo-pcu, osmo-bts -- To view, visit https://gerrit.osmocom.org/3543 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I199f0d10b819215442885629ffc9955c949133ca Gerrit-PatchSet: 2 Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Aug 16 21:44:35 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 16 Aug 2017 21:44:35 +0000 Subject: osmo-trx[master]: Add -j option to bind to specific address In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/3539 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I9ba184a1251c823e413a9230943ed263e52142ec Gerrit-PatchSet: 1 Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Aug 16 21:48:30 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 16 Aug 2017 21:48:30 +0000 Subject: osmo-pcu[master]: EDGE: Fix UL link adaption. In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 (2 comments) https://gerrit.osmocom.org/#/c/3538/1/src/gprs_ms.cpp File src/gprs_ms.cpp: Line 645: /* TODO, use separate table */ I think this TODO can now be removed as you are introducing a separate table? https://gerrit.osmocom.org/#/c/3538/1/src/pcu_vty.c File src/pcu_vty.c: Line 1024: uint8_t mcs1_high = atoi(argv[0]); why have all those local variables first and then another assignment to the respective table? I think it would save some 18 lines of code without affecting readability if we join those lines. Not criticial, but much appreciated if you could change. -- To view, visit https://gerrit.osmocom.org/3538 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I9272c337ad6399da4a47cc6e2736e25f24e099d8 Gerrit-PatchSet: 1 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Minh-Quang Nguyen Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Wed Aug 16 21:48:58 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 16 Aug 2017 21:48:58 +0000 Subject: openbsc[master]: sgsn_test: Fix wrong definition of wrap func In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3536 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ie9e4af6da0339536fb20ca0b7bbcf6f485bd522c Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Aug 16 21:49:00 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 16 Aug 2017 21:49:00 +0000 Subject: [MERGED] openbsc[master]: sgsn_test: Fix wrong definition of wrap func In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: sgsn_test: Fix wrong definition of wrap func ...................................................................... sgsn_test: Fix wrong definition of wrap func Commit 058cd573d8 added 2 new pointer parameters to gprs_subscr_request_auth_info, but forgot to update wraps of the function in sgsn_test. I catched this today because openbsc build test sgsn_test was failing. Closed look up to the logs showed: Assert failed (auts != NULL) == (auts_rand != NULL) openbsc/openbsc/src/gprs/gprs_subscriber.c:791 Change-Id: Ie9e4af6da0339536fb20ca0b7bbcf6f485bd522c --- M openbsc/tests/sgsn/sgsn_test.c 1 file changed, 5 insertions(+), 5 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/openbsc/tests/sgsn/sgsn_test.c b/openbsc/tests/sgsn/sgsn_test.c index 2f1513a..d66c5dd 100644 --- a/openbsc/tests/sgsn/sgsn_test.c +++ b/openbsc/tests/sgsn/sgsn_test.c @@ -139,12 +139,12 @@ }; /* override, requires '-Wl,--wrap=gprs_subscr_request_auth_info' */ -int __real_gprs_subscr_request_auth_info(struct sgsn_mm_ctx *mmctx); -int (*subscr_request_auth_info_cb)(struct sgsn_mm_ctx *mmctx) = +int __real_gprs_subscr_request_auth_info(struct sgsn_mm_ctx *mmctx, const uint8_t *auts, const uint8_t *auts_rand); +int (*subscr_request_auth_info_cb)(struct sgsn_mm_ctx *mmctx, const uint8_t *auts, const uint8_t *auts_rand) = &__real_gprs_subscr_request_auth_info; -int __wrap_gprs_subscr_request_auth_info(struct sgsn_mm_ctx *mmctx) { - return (*subscr_request_auth_info_cb)(mmctx); +int __wrap_gprs_subscr_request_auth_info(struct sgsn_mm_ctx *mmctx, const uint8_t *auts, const uint8_t *auts_rand) { + return (*subscr_request_auth_info_cb)(mmctx, auts, auts_rand); }; /* override, requires '-Wl,--wrap=gsup_client_send' */ @@ -1160,7 +1160,7 @@ cleanup_test(); } -int my_subscr_request_auth_info_real_auth(struct sgsn_mm_ctx *mmctx) +int my_subscr_request_auth_info_real_auth(struct sgsn_mm_ctx *mmctx, const uint8_t *auts, const uint8_t *auts_rand) { struct gsm_auth_tuple at = { .vec.sres = {0x51, 0xe5, 0x51, 0xe5}, -- To view, visit https://gerrit.osmocom.org/3536 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ie9e4af6da0339536fb20ca0b7bbcf6f485bd522c Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Wed Aug 16 21:49:29 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 16 Aug 2017 21:49:29 +0000 Subject: [PATCH] meta-telephony[201705]: update libsmpp to 1.12 In-Reply-To: References: Message-ID: Hello Pau Espin Pedrol, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3533 to look at the new patch set (#2). update libsmpp to 1.12 Also, link to the osmocom project page, not to the upstream source (which is unmaintained, AFAIK). Change-Id: If10f94c574b5dd89d9cb336bcf85dea2887c44d8 --- D recipes-misc/libsmpp/libsmpp34_1.10.bb A recipes-misc/libsmpp/libsmpp34_1.12.bb M recipes-misc/libsmpp/libsmpp34_git.bb 3 files changed, 19 insertions(+), 20 deletions(-) git pull ssh://gerrit.osmocom.org:29418/meta-telephony refs/changes/33/3533/2 diff --git a/recipes-misc/libsmpp/libsmpp34_1.10.bb b/recipes-misc/libsmpp/libsmpp34_1.10.bb deleted file mode 100644 index dbd4f5c..0000000 --- a/recipes-misc/libsmpp/libsmpp34_1.10.bb +++ /dev/null @@ -1,19 +0,0 @@ -DESCRIPTION = "C Open SMPP library" -HOMEPAGE = "http://sourceforge.net/projects/c-open-smpp-34/" -LICENSE = "LGPLv2.1+" -LIC_FILES_CHKSUM = "file://COPYING;md5=fbc093901857fcd118f065f900982c24" -SECTION = "libs" -DEPENDS = "libxml2" - -PR = "r3" - -SRC_URI = "${SOURCEFORGE_MIRROR}/c-open-smpp-34/c-open-smpp-34/libsmpp34-1.10%20%28LGPL%29/libsmpp34-${PV}.tar.gz" -SRC_URI = "git://git.osmocom.org/${PN}" -SRCREV = "9288d59cfdc452fa3a92728149537372ee5c6c56" -S = "${WORKDIR}/git" - -PARALLEL_MAKE = "" - -inherit autotools - - diff --git a/recipes-misc/libsmpp/libsmpp34_1.12.bb b/recipes-misc/libsmpp/libsmpp34_1.12.bb new file mode 100644 index 0000000..b106c3e --- /dev/null +++ b/recipes-misc/libsmpp/libsmpp34_1.12.bb @@ -0,0 +1,18 @@ +DESCRIPTION = "C Open SMPP library" +HOMEPAGE = "http://osmocom.org/projects/libsmpp34" +LICENSE = "LGPLv2.1+" +LIC_FILES_CHKSUM = "file://COPYING;md5=fbc093901857fcd118f065f900982c24" +SECTION = "libs" +DEPENDS = "libxml2" + +PR = "r0" + +SRC_URI = "git://git.osmocom.org/${PN}" +SRCREV = "6d47c170cccd8a72eae985c7ecffba3f07d3861a" +S = "${WORKDIR}/git" + +PARALLEL_MAKE = "" + +inherit autotools + + diff --git a/recipes-misc/libsmpp/libsmpp34_git.bb b/recipes-misc/libsmpp/libsmpp34_git.bb index 4edbebd..235c908 100644 --- a/recipes-misc/libsmpp/libsmpp34_git.bb +++ b/recipes-misc/libsmpp/libsmpp34_git.bb @@ -1,5 +1,5 @@ DESCRIPTION = "C Open SMPP library" -HOMEPAGE = "http://sourceforge.net/projects/c-open-smpp-34/" +HOMEPAGE = "http://osmocom.org/projects/libsmpp34/" LICENSE = "LGPLv2.1+" LIC_FILES_CHKSUM = "file://COPYING;md5=fbc093901857fcd118f065f900982c24" SECTION = "libs" -- To view, visit https://gerrit.osmocom.org/3533 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: If10f94c574b5dd89d9cb336bcf85dea2887c44d8 Gerrit-PatchSet: 2 Gerrit-Project: meta-telephony Gerrit-Branch: 201705 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Wed Aug 16 21:49:37 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 16 Aug 2017 21:49:37 +0000 Subject: meta-telephony[201705]: update libsmpp to 1.12 In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 Verified+1 -- To view, visit https://gerrit.osmocom.org/3533 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: If10f94c574b5dd89d9cb336bcf85dea2887c44d8 Gerrit-PatchSet: 2 Gerrit-Project: meta-telephony Gerrit-Branch: 201705 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Aug 16 21:49:39 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 16 Aug 2017 21:49:39 +0000 Subject: [MERGED] meta-telephony[201705]: update libsmpp to 1.12 In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: update libsmpp to 1.12 ...................................................................... update libsmpp to 1.12 Also, link to the osmocom project page, not to the upstream source (which is unmaintained, AFAIK). Change-Id: If10f94c574b5dd89d9cb336bcf85dea2887c44d8 --- D recipes-misc/libsmpp/libsmpp34_1.10.bb A recipes-misc/libsmpp/libsmpp34_1.12.bb M recipes-misc/libsmpp/libsmpp34_git.bb 3 files changed, 19 insertions(+), 20 deletions(-) Approvals: Harald Welte: Looks good to me, approved; Verified diff --git a/recipes-misc/libsmpp/libsmpp34_1.10.bb b/recipes-misc/libsmpp/libsmpp34_1.10.bb deleted file mode 100644 index dbd4f5c..0000000 --- a/recipes-misc/libsmpp/libsmpp34_1.10.bb +++ /dev/null @@ -1,19 +0,0 @@ -DESCRIPTION = "C Open SMPP library" -HOMEPAGE = "http://sourceforge.net/projects/c-open-smpp-34/" -LICENSE = "LGPLv2.1+" -LIC_FILES_CHKSUM = "file://COPYING;md5=fbc093901857fcd118f065f900982c24" -SECTION = "libs" -DEPENDS = "libxml2" - -PR = "r3" - -SRC_URI = "${SOURCEFORGE_MIRROR}/c-open-smpp-34/c-open-smpp-34/libsmpp34-1.10%20%28LGPL%29/libsmpp34-${PV}.tar.gz" -SRC_URI = "git://git.osmocom.org/${PN}" -SRCREV = "9288d59cfdc452fa3a92728149537372ee5c6c56" -S = "${WORKDIR}/git" - -PARALLEL_MAKE = "" - -inherit autotools - - diff --git a/recipes-misc/libsmpp/libsmpp34_1.12.bb b/recipes-misc/libsmpp/libsmpp34_1.12.bb new file mode 100644 index 0000000..b106c3e --- /dev/null +++ b/recipes-misc/libsmpp/libsmpp34_1.12.bb @@ -0,0 +1,18 @@ +DESCRIPTION = "C Open SMPP library" +HOMEPAGE = "http://osmocom.org/projects/libsmpp34" +LICENSE = "LGPLv2.1+" +LIC_FILES_CHKSUM = "file://COPYING;md5=fbc093901857fcd118f065f900982c24" +SECTION = "libs" +DEPENDS = "libxml2" + +PR = "r0" + +SRC_URI = "git://git.osmocom.org/${PN}" +SRCREV = "6d47c170cccd8a72eae985c7ecffba3f07d3861a" +S = "${WORKDIR}/git" + +PARALLEL_MAKE = "" + +inherit autotools + + diff --git a/recipes-misc/libsmpp/libsmpp34_git.bb b/recipes-misc/libsmpp/libsmpp34_git.bb index 4edbebd..235c908 100644 --- a/recipes-misc/libsmpp/libsmpp34_git.bb +++ b/recipes-misc/libsmpp/libsmpp34_git.bb @@ -1,5 +1,5 @@ DESCRIPTION = "C Open SMPP library" -HOMEPAGE = "http://sourceforge.net/projects/c-open-smpp-34/" +HOMEPAGE = "http://osmocom.org/projects/libsmpp34/" LICENSE = "LGPLv2.1+" LIC_FILES_CHKSUM = "file://COPYING;md5=fbc093901857fcd118f065f900982c24" SECTION = "libs" -- To view, visit https://gerrit.osmocom.org/3533 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: If10f94c574b5dd89d9cb336bcf85dea2887c44d8 Gerrit-PatchSet: 2 Gerrit-Project: meta-telephony Gerrit-Branch: 201705 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Wed Aug 16 21:49:50 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 16 Aug 2017 21:49:50 +0000 Subject: osmo-gsm-manuals[master]: Add VTY port number for GGSN In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3543 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I199f0d10b819215442885629ffc9955c949133ca Gerrit-PatchSet: 2 Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Aug 16 21:49:54 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 16 Aug 2017 21:49:54 +0000 Subject: [MERGED] osmo-gsm-manuals[master]: Add VTY port number for GGSN In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Add VTY port number for GGSN ...................................................................... Add VTY port number for GGSN Change-Id: I199f0d10b819215442885629ffc9955c949133ca --- M common/chapters/port_numbers.adoc 1 file changed, 1 insertion(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/common/chapters/port_numbers.adoc b/common/chapters/port_numbers.adoc index d5cba8f..08d9b3c 100644 --- a/common/chapters/port_numbers.adoc +++ b/common/chapters/port_numbers.adoc @@ -34,6 +34,7 @@ |TCP|4257|Control Interface|ggsn (OpenGGSN) |TCP|4258|telnet (VTY)|osmo-hlr |TCP|4259|Control Interface|osmo-hlr +|TCP|4260|telnet (VTY)|ggsn (OpenGGSN) |UDP|4729|GSMTAP|Almost every osmocom project |TCP|5000|A/IP|osmo-bsc, osmo-bsc_nat |UDP|2427|GSMTAP|osmo-pcu, osmo-bts -- To view, visit https://gerrit.osmocom.org/3543 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I199f0d10b819215442885629ffc9955c949133ca Gerrit-PatchSet: 2 Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Aug 16 21:50:25 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 16 Aug 2017 21:50:25 +0000 Subject: osmo-msc[master]: MSC, SGSN: use OSMO_GSUP_PORT == 4222 instead of 2222 In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3488 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I50f2040e2eb0baacb43849e93cfed10cbc2fc156 Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Aug 16 21:51:05 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 16 Aug 2017 21:51:05 +0000 Subject: openbsc[master]: smpp: Fix compilation warning In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3524 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I0901ddadb5f72e1585cb1797ac22c8ab95e83146 Gerrit-PatchSet: 2 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pablo Neira Ayuso Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Aug 16 21:51:06 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 16 Aug 2017 21:51:06 +0000 Subject: [MERGED] openbsc[master]: smpp: Fix compilation warning In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: smpp: Fix compilation warning ...................................................................... smpp: Fix compilation warning I already stumbled into 2 compilation environments which had Werror enabled for -Wmaybe-uninitialized and the build failed, so let's workaround this warning. | smpp_openbsc.c: In function 'handle_smpp_submit': | smpp_openbsc.c:216:9: error: 'sms_msg_len' may be used uninitialized in this function [-Werror=maybe-uninitialized] | memcpy(sms->user_data, sms_msg, sms_msg_len); | ^ | smpp_openbsc.c:100:15: note: 'sms_msg_len' was declared here | unsigned int sms_msg_len; | ^ | cc1: some warnings being treated as errors Change-Id: I0901ddadb5f72e1585cb1797ac22c8ab95e83146 --- M openbsc/src/libmsc/smpp_openbsc.c 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified Pablo Neira Ayuso: Looks good to me, but someone else must approve diff --git a/openbsc/src/libmsc/smpp_openbsc.c b/openbsc/src/libmsc/smpp_openbsc.c index f2a036d..e656376 100644 --- a/openbsc/src/libmsc/smpp_openbsc.c +++ b/openbsc/src/libmsc/smpp_openbsc.c @@ -93,11 +93,11 @@ const struct submit_sm_t *submit) { const uint8_t *sms_msg = NULL; + unsigned int sms_msg_len = 0; struct gsm_subscriber *dest; uint16_t msg_ref = 0; struct gsm_sms *sms; struct tlv_t *t; - unsigned int sms_msg_len; int mode; dest = subscr_by_dst(net, submit->dest_addr_npi, -- To view, visit https://gerrit.osmocom.org/3524 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I0901ddadb5f72e1585cb1797ac22c8ab95e83146 Gerrit-PatchSet: 3 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pablo Neira Ayuso Gerrit-Reviewer: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Wed Aug 16 21:57:54 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 16 Aug 2017 21:57:54 +0000 Subject: libosmocore[master]: ports.h: Add VTY port for GGSN In-Reply-To: References: Message-ID: Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3542 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I5bd49fbc19e88db96b4adbd56c82e7936059551c Gerrit-PatchSet: 3 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Aug 16 21:57:56 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 16 Aug 2017 21:57:56 +0000 Subject: [MERGED] libosmocore[master]: ports.h: Add VTY port for GGSN In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: ports.h: Add VTY port for GGSN ...................................................................... ports.h: Add VTY port for GGSN Change-Id: I5bd49fbc19e88db96b4adbd56c82e7936059551c --- M include/osmocom/vty/ports.h 1 file changed, 2 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/include/osmocom/vty/ports.h b/include/osmocom/vty/ports.h index 8f8ef75..ab3e1d5 100644 --- a/include/osmocom/vty/ports.h +++ b/include/osmocom/vty/ports.h @@ -26,4 +26,6 @@ #define OSMO_VTY_PORT_MNCC_SIP 4256 /* 4257 used by control interface */ #define OSMO_VTY_PORT_HLR 4258 +/* 4259 used by control interface */ +#define OSMO_VTY_PORT_GGSN 4260 /* When adding/changing port numbers, keep docs and wiki in sync. See above. */ -- To view, visit https://gerrit.osmocom.org/3542 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I5bd49fbc19e88db96b4adbd56c82e7936059551c Gerrit-PatchSet: 3 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Aug 16 22:27:56 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 16 Aug 2017 22:27:56 +0000 Subject: [PATCH] meta-telephony[201705]: libsmpp34_1.12: Further unif with libsmpp_git Message-ID: Review at https://gerrit.osmocom.org/3544 libsmpp34_1.12: Further unif with libsmpp_git Among cosmetic changes, this also introduces a requirement to pkg-config, which was missing so far and breaking the build Change-Id: I18792e6fdb7a970c5714e174a32b076fa893ecd4 --- M recipes-misc/libsmpp/libsmpp34_1.12.bb 1 file changed, 7 insertions(+), 6 deletions(-) git pull ssh://gerrit.osmocom.org:29418/meta-telephony refs/changes/44/3544/1 diff --git a/recipes-misc/libsmpp/libsmpp34_1.12.bb b/recipes-misc/libsmpp/libsmpp34_1.12.bb index b106c3e..406fa45 100644 --- a/recipes-misc/libsmpp/libsmpp34_1.12.bb +++ b/recipes-misc/libsmpp/libsmpp34_1.12.bb @@ -1,18 +1,19 @@ DESCRIPTION = "C Open SMPP library" -HOMEPAGE = "http://osmocom.org/projects/libsmpp34" +HOMEPAGE = "http://osmocom.org/projects/libsmpp34/" LICENSE = "LGPLv2.1+" LIC_FILES_CHKSUM = "file://COPYING;md5=fbc093901857fcd118f065f900982c24" SECTION = "libs" DEPENDS = "libxml2" -PR = "r0" - -SRC_URI = "git://git.osmocom.org/${PN}" -SRCREV = "6d47c170cccd8a72eae985c7ecffba3f07d3861a" S = "${WORKDIR}/git" +SRCREV = "6d47c170cccd8a72eae985c7ecffba3f07d3861a" +SRC_URI = "git://git.osmocom.org/libsmpp34.git;protocol=git" +PR = "r1" PARALLEL_MAKE = "" -inherit autotools +inherit autotools pkgconfig +PACKAGES =+ "${PN}-apps" +FILES_${PN}-apps = "${bindir}/*" -- To view, visit https://gerrit.osmocom.org/3544 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I18792e6fdb7a970c5714e174a32b076fa893ecd4 Gerrit-PatchSet: 1 Gerrit-Project: meta-telephony Gerrit-Branch: 201705 Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Wed Aug 16 22:51:29 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 16 Aug 2017 22:51:29 +0000 Subject: [PATCH] osmo-pcu[master]: GSMTAP: fix category checks in pcu_rx_data_ind and pcu_l1if_... Message-ID: Review at https://gerrit.osmocom.org/3545 GSMTAP: fix category checks in pcu_rx_data_ind and pcu_l1if_tx_ptcch We needto shift the PCU_GSMTAP_C_* constants before comparing against the mask of enabled GSMTAP categories. Change-Id: Ieb9332c65ed7bd57baf1aeab5ab722f92fc23b24 --- M src/pcu_l1_if.cpp 1 file changed, 2 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/45/3545/1 diff --git a/src/pcu_l1_if.cpp b/src/pcu_l1_if.cpp index 8ea2ad5..50e181e 100644 --- a/src/pcu_l1_if.cpp +++ b/src/pcu_l1_if.cpp @@ -183,7 +183,7 @@ { struct gprs_rlcmac_bts *bts = bts_main_data(); - if (bts->gsmtap_categ_mask & PCU_GSMTAP_C_DL_PTCCH) + if (bts->gsmtap_categ_mask & (1 << PCU_GSMTAP_C_DL_PTCCH)) gsmtap_send(bts->gsmtap, arfcn, ts, GSMTAP_CHANNEL_PTCCH, 0, fn, 0, 0, msg->data, msg->len); #ifdef ENABLE_DIRECT_PHY if (bts->trx[trx].fl1h) { @@ -277,7 +277,7 @@ rc = -EINVAL; } - if (rc < 0 && (bts->gsmtap_categ_mask & PCU_GSMTAP_C_UL_UNKNOWN)) { + if (rc < 0 && (bts->gsmtap_categ_mask & (1 <gsmtap, data_ind->arfcn | GSMTAP_ARFCN_F_UPLINK, data_ind->ts_nr, GSMTAP_CHANNEL_PACCH, 0, data_ind->fn, 0, 0, data_ind->data, data_ind->len); } -- To view, visit https://gerrit.osmocom.org/3545 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ieb9332c65ed7bd57baf1aeab5ab722f92fc23b24 Gerrit-PatchSet: 1 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Wed Aug 16 23:02:25 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 16 Aug 2017 23:02:25 +0000 Subject: meta-telephony[201705]: libsmpp34_1.12: Further unif with libsmpp_git In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 Verified+1 verified in local oe build -- To view, visit https://gerrit.osmocom.org/3544 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I18792e6fdb7a970c5714e174a32b076fa893ecd4 Gerrit-PatchSet: 1 Gerrit-Project: meta-telephony Gerrit-Branch: 201705 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Aug 16 23:02:32 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 16 Aug 2017 23:02:32 +0000 Subject: [MERGED] meta-telephony[201705]: libsmpp34_1.12: Further unif with libsmpp_git In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: libsmpp34_1.12: Further unif with libsmpp_git ...................................................................... libsmpp34_1.12: Further unif with libsmpp_git Among cosmetic changes, this also introduces a requirement to pkg-config, which was missing so far and breaking the build Change-Id: I18792e6fdb7a970c5714e174a32b076fa893ecd4 --- M recipes-misc/libsmpp/libsmpp34_1.12.bb 1 file changed, 7 insertions(+), 6 deletions(-) Approvals: Harald Welte: Looks good to me, approved; Verified diff --git a/recipes-misc/libsmpp/libsmpp34_1.12.bb b/recipes-misc/libsmpp/libsmpp34_1.12.bb index b106c3e..406fa45 100644 --- a/recipes-misc/libsmpp/libsmpp34_1.12.bb +++ b/recipes-misc/libsmpp/libsmpp34_1.12.bb @@ -1,18 +1,19 @@ DESCRIPTION = "C Open SMPP library" -HOMEPAGE = "http://osmocom.org/projects/libsmpp34" +HOMEPAGE = "http://osmocom.org/projects/libsmpp34/" LICENSE = "LGPLv2.1+" LIC_FILES_CHKSUM = "file://COPYING;md5=fbc093901857fcd118f065f900982c24" SECTION = "libs" DEPENDS = "libxml2" -PR = "r0" - -SRC_URI = "git://git.osmocom.org/${PN}" -SRCREV = "6d47c170cccd8a72eae985c7ecffba3f07d3861a" S = "${WORKDIR}/git" +SRCREV = "6d47c170cccd8a72eae985c7ecffba3f07d3861a" +SRC_URI = "git://git.osmocom.org/libsmpp34.git;protocol=git" +PR = "r1" PARALLEL_MAKE = "" -inherit autotools +inherit autotools pkgconfig +PACKAGES =+ "${PN}-apps" +FILES_${PN}-apps = "${bindir}/*" -- To view, visit https://gerrit.osmocom.org/3544 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I18792e6fdb7a970c5714e174a32b076fa893ecd4 Gerrit-PatchSet: 1 Gerrit-Project: meta-telephony Gerrit-Branch: 201705 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte From gerrit-no-reply at lists.osmocom.org Thu Aug 17 06:21:33 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 17 Aug 2017 06:21:33 +0000 Subject: osmo-pcu[master]: GSMTAP: fix category checks in pcu_rx_data_ind and pcu_l1if_... In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3545 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ieb9332c65ed7bd57baf1aeab5ab722f92fc23b24 Gerrit-PatchSet: 1 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Aug 17 06:21:44 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 17 Aug 2017 06:21:44 +0000 Subject: [MERGED] osmo-pcu[master]: GSMTAP: fix category checks in pcu_rx_data_ind and pcu_l1if_... In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: GSMTAP: fix category checks in pcu_rx_data_ind and pcu_l1if_tx_ptcch ...................................................................... GSMTAP: fix category checks in pcu_rx_data_ind and pcu_l1if_tx_ptcch We needto shift the PCU_GSMTAP_C_* constants before comparing against the mask of enabled GSMTAP categories. Change-Id: Ieb9332c65ed7bd57baf1aeab5ab722f92fc23b24 --- M src/pcu_l1_if.cpp 1 file changed, 2 insertions(+), 2 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/pcu_l1_if.cpp b/src/pcu_l1_if.cpp index 8ea2ad5..50e181e 100644 --- a/src/pcu_l1_if.cpp +++ b/src/pcu_l1_if.cpp @@ -183,7 +183,7 @@ { struct gprs_rlcmac_bts *bts = bts_main_data(); - if (bts->gsmtap_categ_mask & PCU_GSMTAP_C_DL_PTCCH) + if (bts->gsmtap_categ_mask & (1 << PCU_GSMTAP_C_DL_PTCCH)) gsmtap_send(bts->gsmtap, arfcn, ts, GSMTAP_CHANNEL_PTCCH, 0, fn, 0, 0, msg->data, msg->len); #ifdef ENABLE_DIRECT_PHY if (bts->trx[trx].fl1h) { @@ -277,7 +277,7 @@ rc = -EINVAL; } - if (rc < 0 && (bts->gsmtap_categ_mask & PCU_GSMTAP_C_UL_UNKNOWN)) { + if (rc < 0 && (bts->gsmtap_categ_mask & (1 <gsmtap, data_ind->arfcn | GSMTAP_ARFCN_F_UPLINK, data_ind->ts_nr, GSMTAP_CHANNEL_PACCH, 0, data_ind->fn, 0, 0, data_ind->data, data_ind->len); } -- To view, visit https://gerrit.osmocom.org/3545 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ieb9332c65ed7bd57baf1aeab5ab722f92fc23b24 Gerrit-PatchSet: 1 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Thu Aug 17 08:54:58 2017 From: gerrit-no-reply at lists.osmocom.org (Pablo Neira Ayuso) Date: Thu, 17 Aug 2017 08:54:58 +0000 Subject: openbsc[master]: SMS Delivery reports: Use actual delivery time, not time of ... In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 (3 comments) Apart from the obvious the existing issues, it's great you have tracked down and fixed this little aspect, so this is my +1 :) https://gerrit.osmocom.org/#/c/3540/1//COMMIT_MSG Commit Message: Line 7: SMS Delivery reports: Use actual delivery time, not time of report creation. Probably good to keep using consistent names in patch titles, so I would propose as patch title: "libmsc: Use actual delivery time in delivery reports" Not sure there's a policy in osmocom, but this info is good for grepping in logs from time to time. Anyway, not a big issue. https://gerrit.osmocom.org/#/c/3540/1/openbsc/src/libmsc/db.c File openbsc/src/libmsc/db.c: Line 1708: "SELECT datetime(SMS.created,'localtime') as created, SMS.* " > Hmm, this passes the test on my build box, but I guess I was being lazy her Probably this is breaking openbsc/tests/db/db_test ? https://gerrit.osmocom.org/#/c/3540/1/openbsc/src/libmsc/gsm_04_11.c File openbsc/src/libmsc/gsm_04_11.c: Line 313: gsm340_gen_scts(smsp, sms->created); > Maybe this one should be "now" Not sure what your question is? :-) -- To view, visit https://gerrit.osmocom.org/3540 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I9056429d40bf02731f004b7833f1de45a0d1add8 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Keith Whyte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Keith Whyte Gerrit-Reviewer: Pablo Neira Ayuso Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Thu Aug 17 09:00:13 2017 From: gerrit-no-reply at lists.osmocom.org (Pablo Neira Ayuso) Date: Thu, 17 Aug 2017 09:00:13 +0000 Subject: openbsc[master]: SMS Delivery reports: Use actual delivery time, not time of ... In-Reply-To: References: Message-ID: Patch Set 1: (1 comment) https://gerrit.osmocom.org/#/c/3540/1/openbsc/include/openbsc/gsm_data.h File openbsc/include/openbsc/gsm_data.h: Line 460: time_t created; This creates a "hole" in the structure, I would place it before "bool is_report;" See "pahole" utility for what I mean, it shows the structure layout in binary, including alignments. This is not a big issue here, since neither reducing memory is a real concern nor trying to fit this structure into a cacheline to speed up things (performance) is a major goal I would say... but it's a good thing in general to keep things tidy in this regard. It's just a matter of placing this new field definition before bool is_report; so it doesn't take much time to do this. -- To view, visit https://gerrit.osmocom.org/3540 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I9056429d40bf02731f004b7833f1de45a0d1add8 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Keith Whyte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Keith Whyte Gerrit-Reviewer: Pablo Neira Ayuso Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Thu Aug 17 12:35:04 2017 From: gerrit-no-reply at lists.osmocom.org (Minh-Quang Nguyen) Date: Thu, 17 Aug 2017 12:35:04 +0000 Subject: [PATCH] osmo-pcu[master]: EDGE: Fix UL link adaptation. 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/3538 to look at the new patch set (#2). EDGE: Fix UL link adaptation. We have seen that UL MCS5- MCS9 link adaptation has not been implemented in current PCU implementation. If the MS slowly moves far away from the BTS, the UL MCS will always stick at MCS9 no matter UL link quality values leading to poor data service experience. The UL MCS is expected to adapt from MCS9 -> MCSx due to bad UL quality. Below PCU traces indicate that UL MCS is quickly increasing to MCS9 (max MCS 9 was used in this test) and it never changes to other UL MCS due zero thresholds. <0004> gprs_ms.cpp:670 MS (IMSI ): Link quality 23dB (23dB) left window [0, 0], modifying uplink CS level: MCS-6 -> MCS-7 <0004> gprs_ms.cpp:670 MS (IMSI 000): Link quality 23dB (23dB) left window [0, 0], modifying uplink CS level: MCS-7 -> MCS-8 <0004> gprs_ms.cpp:670 MS (IMSI 000): Link quality 23dB (23dB) left window [0, 0], modifying uplink CS level: MCS-8 -> MCS-9 Change-Id: I9272c337ad6399da4a47cc6e2736e25f24e099d8 --- M src/bts.h M src/gprs_ms.cpp M src/pcu_main.cpp M src/pcu_vty.c 4 files changed, 100 insertions(+), 5 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/38/3538/2 diff --git a/src/bts.h b/src/bts.h index 1f1dae2..b1fb8cc 100644 --- a/src/bts.h +++ b/src/bts.h @@ -221,6 +221,7 @@ uint8_t cs_adj_upper_limit; uint8_t cs_adj_lower_limit; struct {int16_t low; int16_t high; } cs_lqual_ranges[MAX_GPRS_CS]; + struct {int16_t low; int16_t high; } mcs_lqual_ranges[MAX_GPRS_CS]; uint16_t cs_downgrade_threshold; /* downgrade if less packets left (DL) */ uint16_t ws_base; uint16_t ws_pdch; /* increase WS by this value per PDCH */ diff --git a/src/gprs_ms.cpp b/src/gprs_ms.cpp index c6b7e34..66312fa 100644 --- a/src/gprs_ms.cpp +++ b/src/gprs_ms.cpp @@ -624,7 +624,7 @@ bts_data = m_bts->bts_data(); if (!max_cs_ul) { - LOGP(DRLCMACDL, LOGL_ERROR, + LOGP(DRLCMACMEAS, LOGL_ERROR, "max_cs_ul cannot be derived (current UL CS: %s)\n", m_current_cs_ul.name()); return; @@ -642,11 +642,10 @@ low = bts_data->cs_lqual_ranges[current_cs_num-1].low; high = bts_data->cs_lqual_ranges[current_cs_num-1].high; } else if (m_current_cs_ul.isEgprs()) { - /* TODO, use separate table */ if (current_cs_num > MAX_GPRS_CS) current_cs_num = MAX_GPRS_CS; - low = bts_data->cs_lqual_ranges[current_cs_num-1].low; - high = bts_data->cs_lqual_ranges[current_cs_num-1].high; + low = bts_data->mcs_lqual_ranges[current_cs_num-1].low; + high = bts_data->mcs_lqual_ranges[current_cs_num-1].high; } else { return; } @@ -661,7 +660,7 @@ new_cs_ul.inc(mode()); if (m_current_cs_ul != new_cs_ul) { - LOGP(DRLCMACDL, LOGL_INFO, + LOGP(DRLCMACMEAS, LOGL_INFO, "MS (IMSI %s): " "Link quality %ddB (%ddB) left window [%d, %d], " "modifying uplink CS level: %s -> %s\n", diff --git a/src/pcu_main.cpp b/src/pcu_main.cpp index 8e7cde8..e909b75 100644 --- a/src/pcu_main.cpp +++ b/src/pcu_main.cpp @@ -200,6 +200,28 @@ bts->cs_lqual_ranges[2].high = 13; bts->cs_lqual_ranges[3].low = 12; bts->cs_lqual_ranges[3].high = 256; + + /* MCS-1 to MCS-9 */ + /* Default thresholds are referenced from literature */ + /* Fig. 2.3, Chapter 2, Optimizing Wireless Communication Systems, Springer (2009) */ + bts->mcs_lqual_ranges[0].low = -256; + bts->mcs_lqual_ranges[0].high = 6; + bts->mcs_lqual_ranges[1].low = 5; + bts->mcs_lqual_ranges[1].high = 8; + bts->mcs_lqual_ranges[2].low = 7; + bts->mcs_lqual_ranges[2].high = 13; + bts->mcs_lqual_ranges[3].low = 12; + bts->mcs_lqual_ranges[3].high = 15; + bts->mcs_lqual_ranges[4].low = 14; + bts->mcs_lqual_ranges[4].high = 17; + bts->mcs_lqual_ranges[5].low = 16; + bts->mcs_lqual_ranges[5].high = 18; + bts->mcs_lqual_ranges[6].low = 17; + bts->mcs_lqual_ranges[6].high = 20; + bts->mcs_lqual_ranges[7].low = 19; + bts->mcs_lqual_ranges[7].high = 24; + bts->mcs_lqual_ranges[8].low = 23; + bts->mcs_lqual_ranges[8].high = 256; bts->cs_downgrade_threshold = 200; /* TODO: increase them when CRBB decoding is implemented */ diff --git a/src/pcu_vty.c b/src/pcu_vty.c index 68d2f55..5ec16ea 100644 --- a/src/pcu_vty.c +++ b/src/pcu_vty.c @@ -178,6 +178,25 @@ bts->cs_lqual_ranges[3].low, VTY_NEWLINE); + vty_out(vty, " mcs link-quality-ranges mcs1 %d mcs2 %d %d mcs3 %d %d mcs4 %d %d mcs5 %d %d mcs6 %d %d mcs7 %d %d mcs8 %d %d mcs9 %d%s", + bts->mcs_lqual_ranges[0].high, + bts->mcs_lqual_ranges[1].low, + bts->mcs_lqual_ranges[1].high, + bts->mcs_lqual_ranges[2].low, + bts->mcs_lqual_ranges[2].high, + bts->mcs_lqual_ranges[3].low, + bts->mcs_lqual_ranges[3].high, + bts->mcs_lqual_ranges[4].low, + bts->mcs_lqual_ranges[4].high, + bts->mcs_lqual_ranges[5].low, + bts->mcs_lqual_ranges[5].high, + bts->mcs_lqual_ranges[6].low, + bts->mcs_lqual_ranges[6].high, + bts->mcs_lqual_ranges[7].low, + bts->mcs_lqual_ranges[7].high, + bts->mcs_lqual_ranges[8].low, + VTY_NEWLINE); + if (bts->initial_mcs_dl != 1 && bts->initial_mcs_ul != 1) { if (bts->initial_mcs_ul == bts->initial_mcs_dl) vty_out(vty, " mcs %d%s", bts->initial_mcs_dl, @@ -186,6 +205,7 @@ vty_out(vty, " mcs %d %d%s", bts->initial_mcs_dl, bts->initial_mcs_ul, VTY_NEWLINE); } + if (bts->max_mcs_dl && bts->max_mcs_ul) { if (bts->max_mcs_ul == bts->max_mcs_dl) vty_out(vty, " mcs max %d%s", bts->max_mcs_dl, @@ -969,6 +989,58 @@ return CMD_SUCCESS; } +DEFUN(cfg_pcu_mcs_lqual_ranges, + cfg_pcu_mcs_lqual_ranges_cmd, + "mcs link-quality-ranges mcs1 <0-35> mcs2 <0-35> <0-35> mcs3 <0-35> <0-35> mcs4 <0-35> <0-35> mcs5 <0-35> <0-35> mcs6 <0-35> <0-35> mcs7 <0-35> <0-35> mcs8 <0-35> <0-35> mcs9 <0-35>", + CS_STR "Set link quality ranges\n" + "Set quality range for MCS-1 (high value only)\n" + "MCS-1 high (dB)\n" + "Set quality range for MCS-2\n" + "MCS-2 high (dB)\n" + "MCS-2 low (dB)\n" + "Set quality range for MCS-3\n" + "MCS-3 high (dB)\n" + "MCS-3 low (dB)\n" + "Set quality range for MCS-4\n" + "MCS-4 high (dB)\n" + "MCS-4 low (dB)\n" + "Set quality range for MCS-5\n" + "MCS-5 high (dB)\n" + "MCS-5 low (dB)\n" + "Set quality range for MCS-6\n" + "MCS-6 low (dB)\n" + "MCS-6 high (dB)\n" + "Set quality range for MCS-7\n" + "MCS-7 low (dB)\n" + "MCS-7 high (dB)\n" + "Set quality range for MCS-8\n" + "MCS-8 low (dB)\n" + "MCS-8 high (dB)\n" + "Set quality range for MCS-9 (low value only)\n" + "MCS-9 low (dB)\n") +{ + struct gprs_rlcmac_bts *bts = bts_main_data(); + + bts->mcs_lqual_ranges[0].high = atoi(argv[0]); + bts->mcs_lqual_ranges[1].low = atoi(argv[1]); + bts->mcs_lqual_ranges[1].high = atoi(argv[2]); + bts->mcs_lqual_ranges[2].low = atoi(argv[3]); + bts->mcs_lqual_ranges[2].high = atoi(argv[4]); + bts->mcs_lqual_ranges[3].low = atoi(argv[5]); + bts->mcs_lqual_ranges[3].high = atoi(argv[6]); + bts->mcs_lqual_ranges[4].low = atoi(argv[7]); + bts->mcs_lqual_ranges[4].high = atoi(argv[8]); + bts->mcs_lqual_ranges[5].low = atoi(argv[9]); + bts->mcs_lqual_ranges[5].high = atoi(argv[10]); + bts->mcs_lqual_ranges[6].low = atoi(argv[11]); + bts->mcs_lqual_ranges[6].high = atoi(argv[12]); + bts->mcs_lqual_ranges[7].low = atoi(argv[13]); + bts->mcs_lqual_ranges[7].high = atoi(argv[14]); + bts->mcs_lqual_ranges[8].low = atoi(argv[15]); + + return CMD_SUCCESS; +} + DEFUN(cfg_pcu_sock, cfg_pcu_sock_cmd, "pcu-socket PATH", @@ -1079,6 +1151,7 @@ install_element(PCU_NODE, &cfg_pcu_cs_downgrade_thrsh_cmd); install_element(PCU_NODE, &cfg_pcu_no_cs_downgrade_thrsh_cmd); install_element(PCU_NODE, &cfg_pcu_cs_lqual_ranges_cmd); + install_element(PCU_NODE, &cfg_pcu_mcs_lqual_ranges_cmd); install_element(PCU_NODE, &cfg_pcu_mcs_cmd); install_element(PCU_NODE, &cfg_pcu_dl_arq_cmd); install_element(PCU_NODE, &cfg_pcu_no_mcs_cmd); -- To view, visit https://gerrit.osmocom.org/3538 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I9272c337ad6399da4a47cc6e2736e25f24e099d8 Gerrit-PatchSet: 2 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Minh-Quang Nguyen Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Thu Aug 17 12:43:47 2017 From: gerrit-no-reply at lists.osmocom.org (Minh-Quang Nguyen) Date: Thu, 17 Aug 2017 12:43:47 +0000 Subject: osmo-pcu[master]: EDGE: Fix UL link adaptation. In-Reply-To: References: Message-ID: Patch Set 2: > (2 comments) Thanks Harald. I have modified the codes to make them look cleaner in patch set #2. -- To view, visit https://gerrit.osmocom.org/3538 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I9272c337ad6399da4a47cc6e2736e25f24e099d8 Gerrit-PatchSet: 2 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Minh-Quang Nguyen Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Minh-Quang Nguyen Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Aug 17 12:51:52 2017 From: gerrit-no-reply at lists.osmocom.org (Keith Whyte) Date: Thu, 17 Aug 2017 12:51:52 +0000 Subject: openbsc[master]: SMS Delivery reports: Use actual delivery time, not time of ... In-Reply-To: References: Message-ID: Patch Set 1: (1 comment) https://gerrit.osmocom.org/#/c/3540/1/openbsc/src/libmsc/db.c File openbsc/src/libmsc/db.c: Line 1708: "SELECT datetime(SMS.created,'localtime') as created, SMS.* " > Probably this is breaking openbsc/tests/db/db_test ? Funny enough, not on my local box. But then, if one does a SELECT x as created, * from table, and table has a field called created, the result set contain two 'created's. No idea what libdbi does with this. The error is from dbi_result_get_datetime(result, "created"); DBI: -7: The requested variable type does not match what libdbi thinks it should be There is a FIXME in sms_from_result() /* FIXME: those should all be get_uchar, but sqlite3 is braindead */ followed by dbi_result_get_ulonglong() for all fields except dest_addr, src_addr and user data. I might ask Holger if he wrote that FIXME -- To view, visit https://gerrit.osmocom.org/3540 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I9056429d40bf02731f004b7833f1de45a0d1add8 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Keith Whyte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Keith Whyte Gerrit-Reviewer: Pablo Neira Ayuso Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Thu Aug 17 13:28:38 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Thu, 17 Aug 2017 13:28:38 +0000 Subject: osmo-pcu[master]: EDGE: Fix UL link adaptation. In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/3538 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I9272c337ad6399da4a47cc6e2736e25f24e099d8 Gerrit-PatchSet: 2 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Minh-Quang Nguyen Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Minh-Quang Nguyen Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Aug 17 14:37:04 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 17 Aug 2017 14:37:04 +0000 Subject: [PATCH] osmo-gsm-manuals[master]: mgw: Fix endpoint names for new MGW Message-ID: Review at https://gerrit.osmocom.org/3546 mgw: Fix endpoint names for new MGW According to RFC3435, an RTP bridge forrwarding packets, transcoding or otherwise, is a single endpoint with two connections. Let's treat it as such. We introduce the "rtpbridge/" prefix to identify such special RTP endpoints. Change-Id: Id1f079307225faf05d298dcb12aa1c421bfa680a --- M OsmoBSC/mgw/osmo-bsc-new-mgw-e1.msc M OsmoBSC/mgw/osmo-bsc-new-mgw.msc 2 files changed, 16 insertions(+), 16 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-manuals refs/changes/46/3546/1 diff --git a/OsmoBSC/mgw/osmo-bsc-new-mgw-e1.msc b/OsmoBSC/mgw/osmo-bsc-new-mgw-e1.msc index 7912a73..04b114f 100644 --- a/OsmoBSC/mgw/osmo-bsc-new-mgw-e1.msc +++ b/OsmoBSC/mgw/osmo-bsc-new-mgw-e1.msc @@ -17,9 +17,9 @@ ms <-> bsc [label="Assignment"]; ...; - mgcp <- bsc [label="MGCP CRCX ts1/ss2 at abis (MSC:4000)"]; + mgcp <- bsc [label="MGCP CRCX ts1/ss2 at mgw (MSC:4000)"]; mgcp box mgcp [label="Bind to MGW-local RTP Port (3000)\nConnect to MSC:4000"]; - mgcp -> bsc [label="MGCP CRCX ts1/ss2 at a OK (MGW:3000)"]; + mgcp -> bsc [label="MGCP CRCX ts1/ss2 at mgw OK (MGW:3000)"]; ...; bsc -> m_sc [label="BSSAP ASSGN CMPL (3GPP AoIP MGW:3000)"]; @@ -44,7 +44,7 @@ bsc <- m_sc [label="SCCP RLSD"]; bsc -> m_sc [label="SCCP RLC"]; ...; - mgcp <- bsc [label="MGCP DLCX ts1/ss2 at a"]; + mgcp <- bsc [label="MGCP DLCX ts1/ss2 at mgw"]; mgcp box mgcp [label="Release MSC-facing local RTP port (3000)"]; - mgcp -> bsc [label="MGCP DLCX ts1/ss2 at a OK"]; + mgcp -> bsc [label="MGCP DLCX ts1/ss2 at mgw OK"]; } diff --git a/OsmoBSC/mgw/osmo-bsc-new-mgw.msc b/OsmoBSC/mgw/osmo-bsc-new-mgw.msc index 2bab84d..e618bb7 100644 --- a/OsmoBSC/mgw/osmo-bsc-new-mgw.msc +++ b/OsmoBSC/mgw/osmo-bsc-new-mgw.msc @@ -20,19 +20,19 @@ bts <- bsc [label="IPA CRCX"]; bts box bts [label="Bind to BTS-local RTP Port (1000)"]; bts -> bsc [label="IPA CRCX ACK (BTS:1000)"]; - bsc -> mgcp [label="MGCP CRCX 2 at abis (BTS:1000)"]; + bsc -> mgcp [label="MGCP CRCX rtpbridge/2 at mgw (BTS:1000)"]; mgcp box mgcp [label="Bind to MGW-local RTP Port (2000)\nConnect to BTS:1000"]; - bsc <- mgcp [label="MGCP CRCX 2 at abis OK (MGW:2000)"]; - bts <- bsc [label="IPA MDCX 2 at abis (MGW:2000)"]; + bsc <- mgcp [label="MGCP CRCX rtpbridge/2 at mgw OK (MGW:2000)"]; + bts <- bsc [label="IPA MDCX (MGW:2000)"]; bts box bts [label="Connect RTP socket to remote (MGW) RTP Port"]; - bts -> bsc [label="IPA MDCX 2 at abis ACK"]; - #bsc -> mgcp [label="MGCP MDCX 2 at abis (optional)"]; - #bsc <- mgcp [label="MGCP MDCX 2 at abis OK (optional)"]; + bts -> bsc [label="IPA MDCX ACK"]; + #bsc -> mgcp [label="MGCP MDCX rtpbridge/2 at mgw (optional)"]; + #bsc <- mgcp [label="MGCP MDCX rtpbridge/2 at mgw OK (optional)"]; ...; - mgcp <- bsc [label="MGCP CRCX 1 at a (MSC:4000)"]; + mgcp <- bsc [label="MGCP CRCX rtpbridge/2 at mgw (MSC:4000)"]; mgcp box mgcp [label="Bind to MGW-local RTP Port (3000)\nConnect to MSC:4000"]; - mgcp -> bsc [label="MGCP CRCX 1 at a OK (MGW:3000)"]; + mgcp -> bsc [label="MGCP CRCX rtpbridge/2 at mgw OK (MGW:3000)"]; ...; bsc -> m_sc [label="BSSAP ASSGN CMPL (3GPP AoIP MGW:3000)"]; @@ -57,13 +57,13 @@ bsc <- m_sc [label="SCCP RLSD"]; bsc -> m_sc [label="SCCP RLC"]; ...; - mgcp <- bsc [label="MGCP DLCX 1 at a"]; + mgcp <- bsc [label="MGCP DLCX rtpbridge/2 at mgw"]; mgcp box mgcp [label="Release MSC-facing local RTP port (3000)"]; - mgcp -> bsc [label="MGCP DLCX 1 at a OK"]; + mgcp -> bsc [label="MGCP DLCX rtpbridge/2 at mgw OK"]; - bsc -> mgcp [label="MGCP DLCX 2 at abis"]; + mgcp <- bsc [label="MGCP DLCX rtpbridge/2 at mgw"]; mgcp box mgcp [label="Release BTS-facing local RTP port (2000)"]; - bsc <- mgcp [label="MGCP DLCX 2 at abis OK"]; + mgcp -> bsc [label="MGCP DLCX rtpbridge/2 at mgw OK"]; bts <- bsc [label="IPA DLCX"]; bts box bts [label="Release BTS-local RTP port (1000)"]; -- To view, visit https://gerrit.osmocom.org/3546 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Id1f079307225faf05d298dcb12aa1c421bfa680a Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Thu Aug 17 14:37:05 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 17 Aug 2017 14:37:05 +0000 Subject: [PATCH] osmo-gsm-manuals[master]: MGW: Include MGCP endpoint naming scheme of old IPA/SCCPlite... Message-ID: Review at https://gerrit.osmocom.org/3547 MGW: Include MGCP endpoint naming scheme of old IPA/SCCPlite approach Change-Id: Ib1fe96f0041534fa027b70ee67978cb7c6bc5207 --- M OsmoBSC/mgw/osmo-bsc-old-sccplite.msc 1 file changed, 8 insertions(+), 8 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-manuals refs/changes/47/3547/1 diff --git a/OsmoBSC/mgw/osmo-bsc-old-sccplite.msc b/OsmoBSC/mgw/osmo-bsc-old-sccplite.msc index f7298bf..067721c 100644 --- a/OsmoBSC/mgw/osmo-bsc-old-sccplite.msc +++ b/OsmoBSC/mgw/osmo-bsc-old-sccplite.msc @@ -24,12 +24,12 @@ bts box bts [label="Connect RTP socket to remote (bsc_mgcp) RTP Port"]; bts -> bsc [label="IPA MDCX ACK"]; - mgcp <- m_sc [label="MGCP CRCX"]; + mgcp <- m_sc [label="MGCP CRCX 1 at mgw"]; mgcp box mgcp [label="Bind to BTS-local RTP Port"]; - mgcp -> m_sc [label="MGCP CRCX OK"]; - mgcp <- m_sc [label="MGCP MDCX (recvonly) "]; + mgcp -> m_sc [label="MGCP CRCX 1 at mgw OK"]; + mgcp <- m_sc [label="MGCP MDCX 1 at mgw (recvonly) "]; mgcp box mgcp [label="Connect RTP socket to remote (MSC) RTP Port"]; - mgcp -> m_sc [label="MGCP MDCX OK"]; + mgcp -> m_sc [label="MGCP MDCX 1 at mgw OK"]; mgcp <= m_sc [label="RTP Audio"]; bts <= mgcp [label="RTP Audio"]; ms <= bts [label="Um Audio (unidirectional)"]; @@ -45,9 +45,9 @@ ...; ms <- m_sc [label="DTAP CC CONNECT"]; ms -> m_sc [label="DTAP CC CONNECT ACK"]; - mgcp <- m_sc [label="MGCP MDCX (sndrecv) "]; + mgcp <- m_sc [label="MGCP MDCX 1 at mgw (sndrecv) "]; mgcp box mgcp [label="Why?"]; - mgcp -> m_sc [label="MGCP MDCX OK"]; + mgcp -> m_sc [label="MGCP MDCX 1 at mgw OK"]; --- [label="Voice Call in Progress"]; ms <- m_sc [label="DTAP CC DISCONNET"]; ms <- m_sc [label="DTAP CC RELEASE"]; @@ -58,7 +58,7 @@ bsc <- m_sc [label="SCCP RLSD"]; bsc -> m_sc [label="SCCP RLC"]; ...; - mgcp <- m_sc [label="MGCP DLCX"]; + mgcp <- m_sc [label="MGCP DLCX 1 at mgw"]; mgcp box mgcp [label="Release local RTP port"]; - mgcp -> m_sc [label="MGCP DLCX OK"]; + mgcp -> m_sc [label="MGCP DLCX 1 at mgw OK"]; } -- To view, visit https://gerrit.osmocom.org/3547 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ib1fe96f0041534fa027b70ee67978cb7c6bc5207 Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Thu Aug 17 15:03:40 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 17 Aug 2017 15:03:40 +0000 Subject: [PATCH] osmo-gsm-tester[master]: esme: smpp pdu field is a string and needs conversion Message-ID: Review at https://gerrit.osmocom.org/3548 esme: smpp pdu field is a string and needs conversion I take the chance to also swap the two log parameters, because they are included into a dictionary and shown in swapped order in the log anyway, which distracts me every time I look at the values. Change-Id: I6e6ec5b9980958de82ade40e4cd898dc6f1b889f --- M src/osmo_gsm_tester/esme.py 1 file changed, 3 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-tester refs/changes/48/3548/1 diff --git a/src/osmo_gsm_tester/esme.py b/src/osmo_gsm_tester/esme.py index 376152a..47eaaff 100644 --- a/src/osmo_gsm_tester/esme.py +++ b/src/osmo_gsm_tester/esme.py @@ -121,8 +121,9 @@ if isinstance(pdu, smpplib.command.AlertNotification): self.dbg('message received: AlertNotification:', ms_availability_status=pdu.ms_availability_status) elif isinstance(pdu, smpplib.command.DeliverSM): - self.dbg('message received:', user_message_reference=pdu.user_message_reference, references_pending_receipt=self.references_pending_receipt) - self.references_pending_receipt.remove(pdu.user_message_reference) + umref = int(pdu.user_message_reference) + self.dbg('message received:', references_pending_receipt=self.references_pending_receipt, user_message_reference=umref) + self.references_pending_receipt.remove(umref) def receipt_was_received(self, umref): # return umref not in self.references_pending_receipt -- To view, visit https://gerrit.osmocom.org/3548 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I6e6ec5b9980958de82ade40e4cd898dc6f1b889f Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Thu Aug 17 15:07:59 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 17 Aug 2017 15:07:59 +0000 Subject: [PATCH] osmo-gsm-tester[master]: esme: smpp pdu field is a string and needs conversion In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3548 to look at the new patch set (#2). esme: smpp pdu field is a string and needs conversion I take the chance to also swap the two log parameters, because they are included into a dictionary and shown in swapped order in the log anyway, which distracts me every time I look at the values. Change-Id: I6e6ec5b9980958de82ade40e4cd898dc6f1b889f --- M src/osmo_gsm_tester/esme.py 1 file changed, 3 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-tester refs/changes/48/3548/2 diff --git a/src/osmo_gsm_tester/esme.py b/src/osmo_gsm_tester/esme.py index 376152a..c838841 100644 --- a/src/osmo_gsm_tester/esme.py +++ b/src/osmo_gsm_tester/esme.py @@ -121,8 +121,9 @@ if isinstance(pdu, smpplib.command.AlertNotification): self.dbg('message received: AlertNotification:', ms_availability_status=pdu.ms_availability_status) elif isinstance(pdu, smpplib.command.DeliverSM): - self.dbg('message received:', user_message_reference=pdu.user_message_reference, references_pending_receipt=self.references_pending_receipt) - self.references_pending_receipt.remove(pdu.user_message_reference) + umref = int(pdu.user_message_reference) + self.dbg('message received: DeliverSM', references_pending_receipt=self.references_pending_receipt, user_message_reference=umref) + self.references_pending_receipt.remove(umref) def receipt_was_received(self, umref): # return umref not in self.references_pending_receipt -- To view, visit https://gerrit.osmocom.org/3548 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I6e6ec5b9980958de82ade40e4cd898dc6f1b889f Gerrit-PatchSet: 2 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Thu Aug 17 15:08:48 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 17 Aug 2017 15:08:48 +0000 Subject: osmo-gsm-tester[master]: esme: smpp pdu field is a string and needs conversion In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3548 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I6e6ec5b9980958de82ade40e4cd898dc6f1b889f Gerrit-PatchSet: 2 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Aug 17 15:08:50 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 17 Aug 2017 15:08:50 +0000 Subject: [MERGED] osmo-gsm-tester[master]: esme: smpp pdu field is a string and needs conversion In-Reply-To: References: Message-ID: Pau Espin Pedrol has submitted this change and it was merged. Change subject: esme: smpp pdu field is a string and needs conversion ...................................................................... esme: smpp pdu field is a string and needs conversion I take the chance to also swap the two log parameters, because they are included into a dictionary and shown in swapped order in the log anyway, which distracts me every time I look at the values. Change-Id: I6e6ec5b9980958de82ade40e4cd898dc6f1b889f --- M src/osmo_gsm_tester/esme.py 1 file changed, 3 insertions(+), 2 deletions(-) Approvals: Pau Espin Pedrol: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/osmo_gsm_tester/esme.py b/src/osmo_gsm_tester/esme.py index 376152a..c838841 100644 --- a/src/osmo_gsm_tester/esme.py +++ b/src/osmo_gsm_tester/esme.py @@ -121,8 +121,9 @@ if isinstance(pdu, smpplib.command.AlertNotification): self.dbg('message received: AlertNotification:', ms_availability_status=pdu.ms_availability_status) elif isinstance(pdu, smpplib.command.DeliverSM): - self.dbg('message received:', user_message_reference=pdu.user_message_reference, references_pending_receipt=self.references_pending_receipt) - self.references_pending_receipt.remove(pdu.user_message_reference) + umref = int(pdu.user_message_reference) + self.dbg('message received: DeliverSM', references_pending_receipt=self.references_pending_receipt, user_message_reference=umref) + self.references_pending_receipt.remove(umref) def receipt_was_received(self, umref): # return umref not in self.references_pending_receipt -- To view, visit https://gerrit.osmocom.org/3548 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I6e6ec5b9980958de82ade40e4cd898dc6f1b889f Gerrit-PatchSet: 2 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Thu Aug 17 15:43:45 2017 From: gerrit-no-reply at lists.osmocom.org (Keith Whyte) Date: Thu, 17 Aug 2017 15:43:45 +0000 Subject: openbsc[master]: SMS Delivery reports: Use actual delivery time, not time of ... In-Reply-To: References: Message-ID: Patch Set 1: > (1 comment) After reading the spec again, getting localtime from sqlite is wrong anyway. It should be as it is: Use UTC and specific the timezone offset in libosmocore in gsm340_gen_scts(). Only I'm getting tm->tm_gmtoff = 0 and tm->tm_zone = GMT. from gmtime() there, even though the box running the nitb is all setup for CEST. I set TZ before running osmo-nitb. What's more, If I manually over ride tm->tm_gmtoff in gsm340_gen_scts(): -*scts++ = gsm411_bcdify(tm->tm_gmtoff/(60*15)); +*scts++ = gsm411_bcdify(8); the phone still shows the message received two hours before it was sent :-/ -- To view, visit https://gerrit.osmocom.org/3540 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I9056429d40bf02731f004b7833f1de45a0d1add8 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Keith Whyte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Keith Whyte Gerrit-Reviewer: Pablo Neira Ayuso Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Aug 17 15:49:45 2017 From: gerrit-no-reply at lists.osmocom.org (Keith Whyte) Date: Thu, 17 Aug 2017 15:49:45 +0000 Subject: [PATCH] openbsc[master]: libmsc: Use actual delivery time in delivery reports. In-Reply-To: References: Message-ID: Hello Jenkins Builder, Pablo Neira Ayuso, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3540 to look at the new patch set (#2). libmsc: Use actual delivery time in delivery reports. Set the time on the status report to the time the message was delivered, as this may not be the same as the time when we are delivering the report to the originating MS. Also, ask sqlite to give us the localtime rather than GMT, as the MS expects localtime Change-Id: I9056429d40bf02731f004b7833f1de45a0d1add8 --- M openbsc/include/openbsc/gsm_data.h M openbsc/src/libmsc/db.c M openbsc/src/libmsc/gsm_04_11.c 3 files changed, 4 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/40/3540/2 diff --git a/openbsc/include/openbsc/gsm_data.h b/openbsc/include/openbsc/gsm_data.h index 6829d22..4035b39 100644 --- a/openbsc/include/openbsc/gsm_data.h +++ b/openbsc/include/openbsc/gsm_data.h @@ -456,6 +456,7 @@ } smpp; unsigned long validity_minutes; + time_t created; bool is_report; uint8_t reply_path_req; uint8_t status_rep_req; diff --git a/openbsc/src/libmsc/db.c b/openbsc/src/libmsc/db.c index 631e05f..4ba12ca 100644 --- a/openbsc/src/libmsc/db.c +++ b/openbsc/src/libmsc/db.c @@ -1641,6 +1641,7 @@ /* FIXME: validity */ /* FIXME: those should all be get_uchar, but sqlite3 is braindead */ + sms->created = dbi_result_get_datetime(result, "created"); sms->reply_path_req = dbi_result_get_ulonglong(result, "reply_path_req"); sms->status_rep_req = dbi_result_get_ulonglong(result, "status_rep_req"); sms->is_report = dbi_result_get_ulonglong(result, "is_report"); diff --git a/openbsc/src/libmsc/gsm_04_11.c b/openbsc/src/libmsc/gsm_04_11.c index 5e736b3..ddef444 100644 --- a/openbsc/src/libmsc/gsm_04_11.c +++ b/openbsc/src/libmsc/gsm_04_11.c @@ -310,11 +310,11 @@ /* generate TP-SCTS (Service centre timestamp) */ smsp = msgb_put(msg, 7); - gsm340_gen_scts(smsp, time(NULL)); + gsm340_gen_scts(smsp, sms->created); /* generate TP-DT (Discharge time, in TP-SCTS format). */ smsp = msgb_put(msg, 7); - gsm340_gen_scts(smsp, time(NULL)); + gsm340_gen_scts(smsp, sms->created); /* TP-ST (status) */ smsp = msgb_put(msg, 1); -- To view, visit https://gerrit.osmocom.org/3540 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I9056429d40bf02731f004b7833f1de45a0d1add8 Gerrit-PatchSet: 2 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Keith Whyte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Keith Whyte Gerrit-Reviewer: Pablo Neira Ayuso From gerrit-no-reply at lists.osmocom.org Thu Aug 17 15:52:24 2017 From: gerrit-no-reply at lists.osmocom.org (Keith Whyte) Date: Thu, 17 Aug 2017 15:52:24 +0000 Subject: openbsc[master]: libmsc: Use actual delivery time in delivery reports. In-Reply-To: References: Message-ID: Patch Set 1: (1 comment) https://gerrit.osmocom.org/#/c/3540/1/openbsc/src/libmsc/gsm_04_11.c File openbsc/src/libmsc/gsm_04_11.c: Line 313: gsm340_gen_scts(smsp, sms->created); > Not sure what your question is? :-) It's not clear from the spec what the SCTS should be in this case? The time we are sending the report, or the time the report relates to? The spec is pretty clear about the Discharge time: "The TP-Discharge-Time field indicates the time at which a previously submitted SMS-SUBMIT was successfully delivered to or attempted to deliver to the recipient SME or disposed of by the SC." -- To view, visit https://gerrit.osmocom.org/3540 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I9056429d40bf02731f004b7833f1de45a0d1add8 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Keith Whyte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Keith Whyte Gerrit-Reviewer: Pablo Neira Ayuso Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Thu Aug 17 15:59:05 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 17 Aug 2017 15:59:05 +0000 Subject: [PATCH] osmo-gsm-tester[master]: esme: user_message_referece values should be smaller than 256 Message-ID: Review at https://gerrit.osmocom.org/3549 esme: user_message_referece values should be smaller than 256 SMPP specs say message reference is 16 bits field. However, message reference field in GSM03.40 spec is only 8 bits. Change-Id: I52968a10089d14e0e3b0f9be678c261e3f92939c --- M src/osmo_gsm_tester/esme.py 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-tester refs/changes/49/3549/1 diff --git a/src/osmo_gsm_tester/esme.py b/src/osmo_gsm_tester/esme.py index c838841..9dbc5a3 100644 --- a/src/osmo_gsm_tester/esme.py +++ b/src/osmo_gsm_tester/esme.py @@ -145,7 +145,7 @@ seqs = [] self.log('Sending SMS "%s" to %s' % (str(sms_obj), sms_obj.dst_msisdn())) umref = self.next_user_message_reference - self.next_user_message_reference += 1 + self.next_user_message_reference = (self.next_user_message_reference + 1) % (1 << 8) for part in parts: pdu = self.client.send_message( source_addr_ton=smpplib.consts.SMPP_TON_INTL, -- To view, visit https://gerrit.osmocom.org/3549 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I52968a10089d14e0e3b0f9be678c261e3f92939c Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Thu Aug 17 16:20:52 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 17 Aug 2017 16:20:52 +0000 Subject: osmo-gsm-tester[master]: esme: user_message_referece values should be smaller than 256 In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3549 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I52968a10089d14e0e3b0f9be678c261e3f92939c Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Aug 17 16:20:54 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 17 Aug 2017 16:20:54 +0000 Subject: [MERGED] osmo-gsm-tester[master]: esme: user_message_referece values should be smaller than 256 In-Reply-To: References: Message-ID: Pau Espin Pedrol has submitted this change and it was merged. Change subject: esme: user_message_referece values should be smaller than 256 ...................................................................... esme: user_message_referece values should be smaller than 256 SMPP specs say message reference is 16 bits field. However, message reference field in GSM03.40 spec is only 8 bits. Change-Id: I52968a10089d14e0e3b0f9be678c261e3f92939c --- M src/osmo_gsm_tester/esme.py 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Pau Espin Pedrol: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/osmo_gsm_tester/esme.py b/src/osmo_gsm_tester/esme.py index c838841..9dbc5a3 100644 --- a/src/osmo_gsm_tester/esme.py +++ b/src/osmo_gsm_tester/esme.py @@ -145,7 +145,7 @@ seqs = [] self.log('Sending SMS "%s" to %s' % (str(sms_obj), sms_obj.dst_msisdn())) umref = self.next_user_message_reference - self.next_user_message_reference += 1 + self.next_user_message_reference = (self.next_user_message_reference + 1) % (1 << 8) for part in parts: pdu = self.client.send_message( source_addr_ton=smpplib.consts.SMPP_TON_INTL, -- To view, visit https://gerrit.osmocom.org/3549 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I52968a10089d14e0e3b0f9be678c261e3f92939c Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Thu Aug 17 16:41:39 2017 From: gerrit-no-reply at lists.osmocom.org (Keith Whyte) Date: Thu, 17 Aug 2017 16:41:39 +0000 Subject: [PATCH] openbsc[master]: libmsc: Use actual delivery time in delivery reports. In-Reply-To: References: Message-ID: Hello Jenkins Builder, Pablo Neira Ayuso, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3540 to look at the new patch set (#3). libmsc: Use actual delivery time in delivery reports. Set the time on the status report to the time the message was delivered, as this may not be the same as the time when we are delivering the report to the originating MS. Change-Id: I9056429d40bf02731f004b7833f1de45a0d1add8 --- M openbsc/include/openbsc/gsm_data.h M openbsc/src/libmsc/db.c M openbsc/src/libmsc/gsm_04_11.c 3 files changed, 4 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/40/3540/3 diff --git a/openbsc/include/openbsc/gsm_data.h b/openbsc/include/openbsc/gsm_data.h index 6829d22..4035b39 100644 --- a/openbsc/include/openbsc/gsm_data.h +++ b/openbsc/include/openbsc/gsm_data.h @@ -456,6 +456,7 @@ } smpp; unsigned long validity_minutes; + time_t created; bool is_report; uint8_t reply_path_req; uint8_t status_rep_req; diff --git a/openbsc/src/libmsc/db.c b/openbsc/src/libmsc/db.c index 631e05f..4ba12ca 100644 --- a/openbsc/src/libmsc/db.c +++ b/openbsc/src/libmsc/db.c @@ -1641,6 +1641,7 @@ /* FIXME: validity */ /* FIXME: those should all be get_uchar, but sqlite3 is braindead */ + sms->created = dbi_result_get_datetime(result, "created"); sms->reply_path_req = dbi_result_get_ulonglong(result, "reply_path_req"); sms->status_rep_req = dbi_result_get_ulonglong(result, "status_rep_req"); sms->is_report = dbi_result_get_ulonglong(result, "is_report"); diff --git a/openbsc/src/libmsc/gsm_04_11.c b/openbsc/src/libmsc/gsm_04_11.c index 5e736b3..ddef444 100644 --- a/openbsc/src/libmsc/gsm_04_11.c +++ b/openbsc/src/libmsc/gsm_04_11.c @@ -310,11 +310,11 @@ /* generate TP-SCTS (Service centre timestamp) */ smsp = msgb_put(msg, 7); - gsm340_gen_scts(smsp, time(NULL)); + gsm340_gen_scts(smsp, sms->created); /* generate TP-DT (Discharge time, in TP-SCTS format). */ smsp = msgb_put(msg, 7); - gsm340_gen_scts(smsp, time(NULL)); + gsm340_gen_scts(smsp, sms->created); /* TP-ST (status) */ smsp = msgb_put(msg, 1); -- To view, visit https://gerrit.osmocom.org/3540 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I9056429d40bf02731f004b7833f1de45a0d1add8 Gerrit-PatchSet: 3 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Keith Whyte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Keith Whyte Gerrit-Reviewer: Pablo Neira Ayuso From gerrit-no-reply at lists.osmocom.org Thu Aug 17 17:34:22 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Thu, 17 Aug 2017 17:34:22 +0000 Subject: [PATCH] openbsc[master]: gbproxy: log unhandled BSSGP PDU as text Message-ID: Review at https://gerrit.osmocom.org/3550 gbproxy: log unhandled BSSGP PDU as text Change-Id: Ibe3c8bd353b3a178e26b0936f25b2e1959f9990c --- M openbsc/src/gprs/gb_proxy.c 1 file changed, 1 insertion(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/50/3550/1 diff --git a/openbsc/src/gprs/gb_proxy.c b/openbsc/src/gprs/gb_proxy.c index 3603e14..b98a9a5 100644 --- a/openbsc/src/gprs/gb_proxy.c +++ b/openbsc/src/gprs/gb_proxy.c @@ -1266,8 +1266,7 @@ rc = bssgp_tx_status(BSSGP_CAUSE_PDU_INCOMP_FEAT, NULL, orig_msg); break; default: - LOGP(DGPRS, LOGL_NOTICE, "BSSGP PDU type 0x%02x unknown\n", - pdu_type); + LOGP(DGPRS, LOGL_NOTICE, "BSSGP PDU type %s not supported\n", bssgp_pdu_str(pdu_type)); rate_ctr_inc(&cfg->ctrg-> ctr[GBPROX_GLOB_CTR_PROTO_ERR_SGSN]); rc = bssgp_tx_status(BSSGP_CAUSE_PROTO_ERR_UNSPEC, NULL, orig_msg); -- To view, visit https://gerrit.osmocom.org/3550 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ibe3c8bd353b3a178e26b0936f25b2e1959f9990c Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Thu Aug 17 19:45:03 2017 From: gerrit-no-reply at lists.osmocom.org (Keith Whyte) Date: Thu, 17 Aug 2017 19:45:03 +0000 Subject: [PATCH] libosmocore[master]: gsm0411_utils: GSM03.40 9.2.3.11 SCTS should be local Message-ID: Review at https://gerrit.osmocom.org/3551 gsm0411_utils: GSM03.40 9.2.3.11 SCTS should be local >From GSM 03.40: "The Service-Centre-Time-Stamp, and any other times coded in this format that are defined in this specification, represent the time local to the sending entity." Change-Id: I4efdb1eaae43aced33961b64d4f14b0040321c10 --- M src/gsm/gsm0411_utils.c 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/51/3551/1 diff --git a/src/gsm/gsm0411_utils.c b/src/gsm/gsm0411_utils.c index 1d3ef49..a4e9d0d 100644 --- a/src/gsm/gsm0411_utils.c +++ b/src/gsm/gsm0411_utils.c @@ -89,7 +89,7 @@ * \param[in] time to encode */ void gsm340_gen_scts(uint8_t *scts, time_t time) { - struct tm *tm = gmtime(&time); + struct tm *tm = localtime(&time); *scts++ = gsm411_bcdify(tm->tm_year % 100); *scts++ = gsm411_bcdify(tm->tm_mon + 1); -- To view, visit https://gerrit.osmocom.org/3551 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I4efdb1eaae43aced33961b64d4f14b0040321c10 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Keith Whyte From gerrit-no-reply at lists.osmocom.org Fri Aug 18 00:54:36 2017 From: gerrit-no-reply at lists.osmocom.org (Alexander Chemeris) Date: Fri, 18 Aug 2017 00:54:36 +0000 Subject: [PATCH] osmo-bts[master]: Fix static build of osmo-bts-trx and osmo-bts-virtual. Message-ID: Review at https://gerrit.osmocom.org/3552 Fix static build of osmo-bts-trx and osmo-bts-virtual. New libosmocore has some plugin system which requires dlopen(). So we need to make sure we always link with libdl, even when building statically. Note that this doesn't fix static build of tests - they are still failing with some errors. Change-Id: I8315d6e032e34528def268a49fd88d07bc06ab2e --- M src/osmo-bts-trx/Makefile.am M src/osmo-bts-virtual/Makefile.am 2 files changed, 2 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/52/3552/1 diff --git a/src/osmo-bts-trx/Makefile.am b/src/osmo-bts-trx/Makefile.am index 8676685..0a97251 100644 --- a/src/osmo-bts-trx/Makefile.am +++ b/src/osmo-bts-trx/Makefile.am @@ -1,6 +1,6 @@ AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include -I$(OPENBSC_INCDIR) AM_CFLAGS = -Wall -fno-strict-aliasing $(LIBOSMOCORE_CFLAGS) $(LIBOSMOGSM_CFLAGS) $(LIBOSMOCODEC_CFLAGS) $(LIBOSMOCODING_CFLAGS) $(LIBOSMOVTY_CFLAGS) $(LIBOSMOTRAU_CFLAGS) $(LIBOSMOABIS_CFLAGS) $(LIBOSMOCTRL_CFLAGS) $(ORTP_CFLAGS) -LDADD = $(LIBOSMOCORE_LIBS) $(LIBOSMOGSM_LIBS) $(LIBOSMOCODEC_LIBS) $(LIBOSMOCODING_LIBS) $(LIBOSMOVTY_LIBS) $(LIBOSMOTRAU_LIBS) $(LIBOSMOABIS_LIBS) $(LIBOSMOCTRL_LIBS) $(ORTP_LIBS) +LDADD = $(LIBOSMOCORE_LIBS) $(LIBOSMOGSM_LIBS) $(LIBOSMOCODEC_LIBS) $(LIBOSMOCODING_LIBS) $(LIBOSMOVTY_LIBS) $(LIBOSMOTRAU_LIBS) $(LIBOSMOABIS_LIBS) $(LIBOSMOCTRL_LIBS) $(ORTP_LIBS) -ldl EXTRA_DIST = trx_if.h l1_if.h loops.h diff --git a/src/osmo-bts-virtual/Makefile.am b/src/osmo-bts-virtual/Makefile.am index 30069d4..d1f05af 100644 --- a/src/osmo-bts-virtual/Makefile.am +++ b/src/osmo-bts-virtual/Makefile.am @@ -1,6 +1,6 @@ AM_CFLAGS = -Wall -fno-strict-aliasing $(LIBOSMOCORE_CFLAGS) $(LIBOSMOGSM_CFLAGS) $(LIBOSMOVTY_CFLAGS) $(LIBOSMOTRAU_CFLAGS) $(LIBOSMOABIS_CFLAGS) $(LIBOSMOCTRL_CFLAGS) $(LIBOSMOABIS_CFLAGS) $(LIBGPS_CFLAGS) $(ORTP_CFLAGS) AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include -I$(OPENBSC_INCDIR) -Iinclude -COMMON_LDADD = $(LIBOSMOCORE_LIBS) $(LIBOSMOGSM_LIBS) $(LIBOSMOVTY_LIBS) $(LIBOSMOTRAU_LIBS) $(LIBOSMOABIS_LIBS) $(LIBOSMOCTRL_LIBS) $(ORTP_LIBS) +COMMON_LDADD = $(LIBOSMOCORE_LIBS) $(LIBOSMOGSM_LIBS) $(LIBOSMOVTY_LIBS) $(LIBOSMOTRAU_LIBS) $(LIBOSMOABIS_LIBS) $(LIBOSMOCTRL_LIBS) $(ORTP_LIBS) -ldl noinst_HEADERS = l1_if.h osmo_mcast_sock.h virtual_um.h -- To view, visit https://gerrit.osmocom.org/3552 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I8315d6e032e34528def268a49fd88d07bc06ab2e Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Alexander Chemeris From gerrit-no-reply at lists.osmocom.org Fri Aug 18 01:28:50 2017 From: gerrit-no-reply at lists.osmocom.org (Alexander Chemeris) Date: Fri, 18 Aug 2017 01:28:50 +0000 Subject: osmo-bts[master]: Check for suitable lchan type when detecting HO In-Reply-To: References: Message-ID: Patch Set 3: Tom - do you think we can avoid RACH detection for non-SACCH and DCCH in osmo-trx, following the same logic as here? Right now we're detecting RACH on every burst IIRC. -- To view, visit https://gerrit.osmocom.org/1960 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Iacbcc8441d6cfbb8f808948a8baddde1ebca488a Gerrit-PatchSet: 3 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Alexander Chemeris Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Tom Tsou Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Aug 18 07:58:45 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Fri, 18 Aug 2017 07:58:45 +0000 Subject: osmo-gsm-tester[master]: Split osmo-trx from osmo-bts-trx In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3528 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I556c3e2ba16753393c7e70800c533a18122daeaa Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Aug 18 07:58:52 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Fri, 18 Aug 2017 07:58:52 +0000 Subject: [MERGED] osmo-gsm-tester[master]: Split osmo-trx from osmo-bts-trx In-Reply-To: References: Message-ID: Pau Espin Pedrol has submitted this change and it was merged. Change subject: Split osmo-trx from osmo-bts-trx ...................................................................... Split osmo-trx from osmo-bts-trx In the future, some environments/products may come with a trx interface pre-installed. Start work to easily disable launching it. Change-Id: I556c3e2ba16753393c7e70800c533a18122daeaa --- M contrib/jenkins-build-osmo-bts-trx.sh A contrib/jenkins-build-osmo-trx.sh M src/osmo_gsm_tester/bts_osmotrx.py 3 files changed, 50 insertions(+), 12 deletions(-) Approvals: Pau Espin Pedrol: Looks good to me, approved Jenkins Builder: Verified diff --git a/contrib/jenkins-build-osmo-bts-trx.sh b/contrib/jenkins-build-osmo-bts-trx.sh index c4bdcaf..8664a08 100755 --- a/contrib/jenkins-build-osmo-bts-trx.sh +++ b/contrib/jenkins-build-osmo-bts-trx.sh @@ -9,7 +9,6 @@ build_repo libosmocore --disable-doxygen build_repo libosmo-abis -build_repo osmo-trx --without-sse build_repo osmo-bts --enable-trx --with-openbsc=$base/openbsc/openbsc/include create_bin_tgz diff --git a/contrib/jenkins-build-osmo-trx.sh b/contrib/jenkins-build-osmo-trx.sh new file mode 100755 index 0000000..7d2a5b6 --- /dev/null +++ b/contrib/jenkins-build-osmo-trx.sh @@ -0,0 +1,9 @@ +#!/bin/sh +set -e -x +base="$PWD" +name="osmo-trx" +. "$(dirname "$0")/jenkins-build-common.sh" + +build_repo osmo-trx --without-sse + +create_bin_tgz diff --git a/src/osmo_gsm_tester/bts_osmotrx.py b/src/osmo_gsm_tester/bts_osmotrx.py index d8675cb..7496ce8 100644 --- a/src/osmo_gsm_tester/bts_osmotrx.py +++ b/src/osmo_gsm_tester/bts_osmotrx.py @@ -27,9 +27,8 @@ run_dir = None inst = None env = None - proc_trx = None + trx = None - BIN_TRX = 'osmo-trx' BIN_BTS_TRX = 'osmo-bts-trx' BIN_PCU = 'osmo-pcu' @@ -54,26 +53,22 @@ self.run_dir = util.Dir(self.suite_run.get_test_run_dir().new_dir(self.name())) self.configure() + self.trx = OsmoTrx(self.suite_run) + self.trx.start() + self.log('Waiting for osmo-trx to start up...') + event_loop.wait(self, self.trx.trx_ready) + self.inst = util.Dir(os.path.abspath(self.suite_run.trial.get_inst(OsmoBtsTrx.BIN_BTS_TRX))) lib = self.inst.child('lib') if not os.path.isdir(lib): raise RuntimeError('No lib/ in %r' % self.inst) self.env = { 'LD_LIBRARY_PATH': util.prepend_library_path(lib) } - self.proc_trx = self.launch_process(OsmoBtsTrx.BIN_TRX, '-x') - self.log('Waiting for osmo-trx to start up...') - event_loop.wait(self, self.trx_ready) - self.proc_trx.log(self.proc_trx.get_stdout_tail(1)) self.launch_process(OsmoBtsTrx.BIN_BTS_TRX, '-r', '1', '-c', os.path.abspath(self.config_file), '-i', self.bsc.addr()) #self.launch_process(OsmoBtsTrx.BIN_PCU, '-r', '1') self.suite_run.poll() - - def trx_ready(self): - if not self.proc_trx or not self.proc_trx.is_running: - return False - return '-- Transceiver active with' in (self.proc_trx.get_stdout() or '') def launch_process(self, binary_name, *args): binary = os.path.abspath(self.inst.child('bin', binary_name)) @@ -120,4 +115,39 @@ def set_bsc(self, bsc): self.bsc = bsc +class OsmoTrx(log.Origin): + suite_run = None + run_dir = None + inst = None + env = None + proc_trx = None + + BIN_TRX = 'osmo-trx' + + def __init__(self, suite_run): + super().__init__(log.C_RUN, OsmoTrx.BIN_TRX) + self.suite_run = suite_run + self.env = {} + + def start(self): + self.run_dir = util.Dir(self.suite_run.get_test_run_dir().new_dir(self.name())) + self.inst = util.Dir(os.path.abspath(self.suite_run.trial.get_inst(OsmoTrx.BIN_TRX))) + self.proc_trx = self.launch_process(OsmoTrx.BIN_TRX, '-x') + + def launch_process(self, binary_name, *args): + binary = os.path.abspath(self.inst.child('bin', binary_name)) + run_dir = self.run_dir.new_dir(binary_name) + if not os.path.isfile(binary): + raise RuntimeError('Binary missing: %r' % binary) + proc = process.Process(binary_name, run_dir, + (binary,) + args, + env=self.env) + self.suite_run.remember_to_stop(proc) + proc.launch() + return proc + + def trx_ready(self): + if not self.proc_trx or not self.proc_trx.is_running: + return False + return '-- Transceiver active with' in (self.proc_trx.get_stdout() or '') # vim: expandtab tabstop=4 shiftwidth=4 -- To view, visit https://gerrit.osmocom.org/3528 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I556c3e2ba16753393c7e70800c533a18122daeaa Gerrit-PatchSet: 2 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Fri Aug 18 09:28:16 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 18 Aug 2017 09:28:16 +0000 Subject: [PATCH] openbsc[master]: NITB: remove 'help' output about '-a' option that is removed... Message-ID: Review at https://gerrit.osmocom.org/3553 NITB: remove 'help' output about '-a' option that is removed for ages This option was present in very early versions of the NITB, but at least since 2011 it is no longer supported. It's still listed in --help output, which is wrong. Change-Id: I1d2cceb588ec5fb34ec5e2c05a7d8c93310bee88 --- M openbsc/src/osmo-nitb/bsc_hack.c 1 file changed, 0 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/53/3553/1 diff --git a/openbsc/src/osmo-nitb/bsc_hack.c b/openbsc/src/osmo-nitb/bsc_hack.c index 17b23b2..c2fe1c9 100644 --- a/openbsc/src/osmo-nitb/bsc_hack.c +++ b/openbsc/src/osmo-nitb/bsc_hack.c @@ -99,7 +99,6 @@ printf(" -c --config-file filename The config file to use.\n"); printf(" -s --disable-color\n"); printf(" -l --database db-name The database to use.\n"); - printf(" -a --authorize-everyone Authorize every new subscriber. Dangerous!\n"); printf(" -T --timestamp Prefix every log line with a timestamp.\n"); printf(" -V --version Print the version of OpenBSC.\n"); printf(" -P --rtp-proxy Enable the RTP Proxy code inside OpenBSC.\n"); @@ -122,7 +121,6 @@ {"config-file", 1, 0, 'c'}, {"disable-color", 0, 0, 's'}, {"database", 1, 0, 'l'}, - {"authorize-everyone", 0, 0, 'a'}, {"pcap", 1, 0, 'p'}, {"timestamp", 0, 0, 'T'}, {"version", 0, 0, 'V' }, -- To view, visit https://gerrit.osmocom.org/3553 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I1d2cceb588ec5fb34ec5e2c05a7d8c93310bee88 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Fri Aug 18 09:38:12 2017 From: gerrit-no-reply at lists.osmocom.org (Pablo Neira Ayuso) Date: Fri, 18 Aug 2017 09:38:12 +0000 Subject: openbsc[master]: libmsc: Use actual delivery time in delivery reports. In-Reply-To: References: Message-ID: Patch Set 3: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/3540 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I9056429d40bf02731f004b7833f1de45a0d1add8 Gerrit-PatchSet: 3 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Keith Whyte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Keith Whyte Gerrit-Reviewer: Pablo Neira Ayuso Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Aug 18 10:06:10 2017 From: gerrit-no-reply at lists.osmocom.org (Pablo Neira Ayuso) Date: Fri, 18 Aug 2017 10:06:10 +0000 Subject: libosmocore[master]: gsm0411_utils: GSM03.40 9.2.3.11 SCTS should be local In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 This oneliner LGTM. Is this fixing up the issue you were observing with Delivery Reports with wrong dates? -- To view, visit https://gerrit.osmocom.org/3551 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I4efdb1eaae43aced33961b64d4f14b0040321c10 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Keith Whyte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pablo Neira Ayuso Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Aug 18 10:11:15 2017 From: gerrit-no-reply at lists.osmocom.org (Pablo Neira Ayuso) Date: Fri, 18 Aug 2017 10:11:15 +0000 Subject: libosmo-netif[master]: osmux: Re-write osmux_snprintf In-Reply-To: References: Message-ID: Patch Set 1: (1 comment) https://gerrit.osmocom.org/#/c/3537/1/src/osmux.c File src/osmux.c: PS1, Line 849: I'm still trying to understand this update, not sure what corner case you're trying to catch. Why this code below not just enough to address this? http://git.netfilter.org/nftables/tree/include/utils.h#n84 -- To view, visit https://gerrit.osmocom.org/3537 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I695771d099833842db37a415b636035d17f1bba7 Gerrit-PatchSet: 1 Gerrit-Project: libosmo-netif Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pablo Neira Ayuso Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Fri Aug 18 10:29:06 2017 From: gerrit-no-reply at lists.osmocom.org (Keith Whyte) Date: Fri, 18 Aug 2017 10:29:06 +0000 Subject: libosmocore[master]: gsm0411_utils: GSM03.40 9.2.3.11 SCTS should be local In-Reply-To: References: Message-ID: Patch Set 1: > This oneliner LGTM. > > Is this fixing up the issue you were observing with Delivery > Reports with wrong dates? wrong dates/times... Yes. The phones that actually show the date/time show it as it is placed into the SCTS field. The spec is clear that this should be local to SME. The spec mentions that the GMT offset /can/ be used by the phone if it is aware of it's own timezone. As far as I can make out, with gmtime() the offset is ALWAYS going to be 0. There is another issue, as far as I can see, if the offset is negative, this is never going to be encoded correctly by gsm411_bcdify() Note that I am very much doing virgoan nitpicking here, nowadays the number of phones that actual display this time is minimal, it seems most of them use their own clock to timestamp messages. :) -- To view, visit https://gerrit.osmocom.org/3551 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I4efdb1eaae43aced33961b64d4f14b0040321c10 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Keith Whyte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Keith Whyte Gerrit-Reviewer: Pablo Neira Ayuso Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Aug 18 10:36:41 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Fri, 18 Aug 2017 10:36:41 +0000 Subject: [PATCH] openbsc[master]: libmsc: Fix wrong handling of user_message_reference parameter Message-ID: Review at https://gerrit.osmocom.org/3554 libmsc: Fix wrong handling of user_message_reference parameter libsmpp34 already converts received TLV integer values to native endianess in libsmpp34_(un)pack. Converting them again at receive time swaps the 2 bytes of user_message_reference, then using a wrong value. As GSM03.40 spec uses only 1 byte for the id, then only the high byte of the initial value is used and eventually sent back to the ESME. Again, at that time, htons() is not needed because libsmpp34 already handles that part. Change-Id: If748548a4a223e529a1110c89e483b599b406e8b --- M openbsc/src/libmsc/smpp_openbsc.c 1 file changed, 2 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/54/3554/1 diff --git a/openbsc/src/libmsc/smpp_openbsc.c b/openbsc/src/libmsc/smpp_openbsc.c index e656376..af2d1be 100644 --- a/openbsc/src/libmsc/smpp_openbsc.c +++ b/openbsc/src/libmsc/smpp_openbsc.c @@ -120,7 +120,7 @@ } break; case TLVID_user_message_reference: - msg_ref = ntohs(t->value.val16); + msg_ref = t->value.val16; break; default: break; @@ -436,7 +436,7 @@ memset(&tlv, 0, sizeof(tlv)); tlv.tag = tag; tlv.length = 2; - tlv.value.val16 = htons(val); + tlv.value.val16 = val; build_tlv(req_tlv, &tlv); } -- To view, visit https://gerrit.osmocom.org/3554 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: If748548a4a223e529a1110c89e483b599b406e8b Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Fri Aug 18 10:49:12 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Fri, 18 Aug 2017 10:49:12 +0000 Subject: [PATCH] openbsc[master]: libmsc: Fix wrong handling of user_message_reference parameter In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3554 to look at the new patch set (#2). libmsc: Fix wrong handling of user_message_reference parameter libsmpp34 already converts received TLV integer values to native endianess in libsmpp34_(un)pack. Converting them again at receive time swaps the 2 bytes of user_message_reference, then using a wrong value. As GSM03.40 spec uses only 1 byte for the id, then only the high byte of the initial value is used and eventually sent back to the ESME. Again, at that time, htons() is not needed because libsmpp34 already handles that part. See OS-#2429 for more details. Change-Id: If748548a4a223e529a1110c89e483b599b406e8b --- M openbsc/src/libmsc/smpp_openbsc.c 1 file changed, 2 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/54/3554/2 diff --git a/openbsc/src/libmsc/smpp_openbsc.c b/openbsc/src/libmsc/smpp_openbsc.c index e656376..af2d1be 100644 --- a/openbsc/src/libmsc/smpp_openbsc.c +++ b/openbsc/src/libmsc/smpp_openbsc.c @@ -120,7 +120,7 @@ } break; case TLVID_user_message_reference: - msg_ref = ntohs(t->value.val16); + msg_ref = t->value.val16; break; default: break; @@ -436,7 +436,7 @@ memset(&tlv, 0, sizeof(tlv)); tlv.tag = tag; tlv.length = 2; - tlv.value.val16 = htons(val); + tlv.value.val16 = val; build_tlv(req_tlv, &tlv); } -- To view, visit https://gerrit.osmocom.org/3554 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: If748548a4a223e529a1110c89e483b599b406e8b Gerrit-PatchSet: 2 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pablo Neira Ayuso From gerrit-no-reply at lists.osmocom.org Fri Aug 18 11:41:16 2017 From: gerrit-no-reply at lists.osmocom.org (Pablo Neira Ayuso) Date: Fri, 18 Aug 2017 11:41:16 +0000 Subject: libosmocore[master]: gsm0411_utils: GSM03.40 9.2.3.11 SCTS should be local In-Reply-To: References: Message-ID: Patch Set 1: My impression is that noone didn't have the resources/time to have a careful look at this so far... So now you're the GSM03.40 9.2.3.11 SCTS expert ;-). These small details are a bit non-essencial (in terms of network operation) but they can be very time-consuming... I think follow up patches to polish this would be good if times allows there. -- To view, visit https://gerrit.osmocom.org/3551 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I4efdb1eaae43aced33961b64d4f14b0040321c10 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Keith Whyte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Keith Whyte Gerrit-Reviewer: Pablo Neira Ayuso Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Aug 18 11:41:56 2017 From: gerrit-no-reply at lists.osmocom.org (Pablo Neira Ayuso) Date: Fri, 18 Aug 2017 11:41:56 +0000 Subject: openbsc[master]: libmsc: Fix wrong handling of user_message_reference parameter In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+1 Thanks a lot for fixing up this Pau. -- To view, visit https://gerrit.osmocom.org/3554 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: If748548a4a223e529a1110c89e483b599b406e8b Gerrit-PatchSet: 2 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pablo Neira Ayuso Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Aug 18 13:28:50 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Fri, 18 Aug 2017 13:28:50 +0000 Subject: [PATCH] meta-telephony[201705]: lksctp-tools: Use bb.utils.contains instead of deprecated ba... Message-ID: Review at https://gerrit.osmocom.org/3555 lksctp-tools: Use bb.utils.contains instead of deprecated base_contains Change-Id: Ic5fb0f35e5c9a3c48748b2941f471f0704a41e75 --- M recipes-misc/lksctp-tools/lksctp-tools_1.0.16.bb 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/meta-telephony refs/changes/55/3555/1 diff --git a/recipes-misc/lksctp-tools/lksctp-tools_1.0.16.bb b/recipes-misc/lksctp-tools/lksctp-tools_1.0.16.bb index d3e6a5d..f69e71c 100644 --- a/recipes-misc/lksctp-tools/lksctp-tools_1.0.16.bb +++ b/recipes-misc/lksctp-tools/lksctp-tools_1.0.16.bb @@ -21,7 +21,7 @@ #| /home/jenkins/oe/world/shr-core/tmp-eglibc/sysroots/x86_64-linux/usr/libexec/arm-oe-linux-gnueabi/gcc/arm-oe-linux-gnueabi/4.9.0/ld: error: symbol sctp_connectx has undefined version #| collect2: error: ld returned 1 exit status #| make[4]: *** [libsctp.la] Error 1 -PNBLACKLIST[lksctp-tools] ?= "${@base_contains('DISTRO_FEATURES', 'ld-is-gold', "BROKEN: fails to link against sctp_connectx symbol", '', d)}" +PNBLACKLIST[lksctp-tools] ?= "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-gold', "BROKEN: fails to link against sctp_connectx symbol", '', d)}" S = "${WORKDIR}/${BP}" -- To view, visit https://gerrit.osmocom.org/3555 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ic5fb0f35e5c9a3c48748b2941f471f0704a41e75 Gerrit-PatchSet: 1 Gerrit-Project: meta-telephony Gerrit-Branch: 201705 Gerrit-Owner: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Fri Aug 18 14:24:09 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Fri, 18 Aug 2017 14:24:09 +0000 Subject: [PATCH] openbsc[master]: gbproxy: log signal value as string Message-ID: Review at https://gerrit.osmocom.org/3556 gbproxy: log signal value as string Change-Id: I6ed923f5c60a8d64305f4b8e90d1362d6510e1c5 --- M openbsc/src/gprs/gb_proxy.c 1 file changed, 2 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/56/3556/1 diff --git a/openbsc/src/gprs/gb_proxy.c b/openbsc/src/gprs/gb_proxy.c index 3603e14..cefeefb 100644 --- a/openbsc/src/gprs/gb_proxy.c +++ b/openbsc/src/gprs/gb_proxy.c @@ -1370,9 +1370,8 @@ /* from BSS to SGSN */ peer = gbproxy_peer_by_nsei(cfg, nsvc->nsei); if (!peer) { - LOGP(DGPRS, LOGL_NOTICE, "signal %u for unknown peer " - "NSEI=%u/NSVCI=%u\n", signal, nsvc->nsei, - nsvc->nsvci); + LOGP(DGPRS, LOGL_NOTICE, "signal '%s' for unknown peer NSEI=%u/NSVCI=%u\n", + get_value_string(gprs_ns_signal_ns_names, signal), nsvc->nsei, nsvc->nsvci); return 0; } switch (signal) { -- To view, visit https://gerrit.osmocom.org/3556 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I6ed923f5c60a8d64305f4b8e90d1362d6510e1c5 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Fri Aug 18 14:33:58 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Fri, 18 Aug 2017 14:33:58 +0000 Subject: [PATCH] openbsc[master]: gbproxy: log signal value as text In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3556 to look at the new patch set (#2). gbproxy: log signal value as text Change-Id: I6ed923f5c60a8d64305f4b8e90d1362d6510e1c5 --- M openbsc/src/gprs/gb_proxy.c 1 file changed, 4 insertions(+), 6 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/56/3556/2 diff --git a/openbsc/src/gprs/gb_proxy.c b/openbsc/src/gprs/gb_proxy.c index 3603e14..58f914a 100644 --- a/openbsc/src/gprs/gb_proxy.c +++ b/openbsc/src/gprs/gb_proxy.c @@ -1370,9 +1370,8 @@ /* from BSS to SGSN */ peer = gbproxy_peer_by_nsei(cfg, nsvc->nsei); if (!peer) { - LOGP(DGPRS, LOGL_NOTICE, "signal %u for unknown peer " - "NSEI=%u/NSVCI=%u\n", signal, nsvc->nsei, - nsvc->nsvci); + LOGP(DGPRS, LOGL_NOTICE, "signal '%s' for unknown peer NSEI=%u/NSVCI=%u\n", + get_value_string(gprs_ns_signal_ns_names, signal), nsvc->nsei, nsvc->nsvci); return 0; } switch (signal) { @@ -1380,9 +1379,8 @@ case S_NS_BLOCK: if (!peer->blocked) break; - LOGP(DGPRS, LOGL_NOTICE, "Converting NS_RESET from " - "NSEI=%u/NSVCI=%u into BSSGP_BVC_BLOCK to SGSN\n", - nsvc->nsei, nsvc->nsvci); + LOGP(DGPRS, LOGL_NOTICE, "Converting '%s' from NSEI=%u/NSVCI=%u into BSSGP_BVC_BLOCK to SGSN\n", + get_value_string(gprs_ns_signal_ns_names, signal), nsvc->nsei, nsvc->nsvci); bssgp_tx_simple_bvci(BSSGP_PDUT_BVC_BLOCK, nsvc->nsei, peer->bvci, 0); break; -- To view, visit https://gerrit.osmocom.org/3556 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I6ed923f5c60a8d64305f4b8e90d1362d6510e1c5 Gerrit-PatchSet: 2 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Fri Aug 18 15:29:47 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Fri, 18 Aug 2017 15:29:47 +0000 Subject: [PATCH] osmo-gsm-tester[master]: esme: Remove temporary workaround for non-implemented delive... Message-ID: Review at https://gerrit.osmocom.org/3557 esme: Remove temporary workaround for non-implemented deliver_sm Openbsc has SMS Delivery Reports since recently, which means we are now receiving deliver_sm messages and this workaround introduced in commit db0d8ab4fcfac67e76729241d92ca128d4526240 is not required anymore. Closes OS-#2353. Change-Id: Iecf3983bfc24fec8023ba5d589c2d7620ec5d921 --- M src/osmo_gsm_tester/esme.py 1 file changed, 1 insertion(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-tester refs/changes/57/3557/1 diff --git a/src/osmo_gsm_tester/esme.py b/src/osmo_gsm_tester/esme.py index 9dbc5a3..63a1ded 100644 --- a/src/osmo_gsm_tester/esme.py +++ b/src/osmo_gsm_tester/esme.py @@ -126,9 +126,7 @@ self.references_pending_receipt.remove(umref) def receipt_was_received(self, umref): - # return umref not in self.references_pending_receipt - self.log('FIXME: wait_receipt disabled because receipts are not received, see OsmoNITB #2353') - return True + return umref not in self.references_pending_receipt def run_method_expect_failure(self, errcode, method, *args): try: -- To view, visit https://gerrit.osmocom.org/3557 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Iecf3983bfc24fec8023ba5d589c2d7620ec5d921 Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Fri Aug 18 15:30:17 2017 From: gerrit-no-reply at lists.osmocom.org (Keith Whyte) Date: Fri, 18 Aug 2017 15:30:17 +0000 Subject: libosmocore[master]: gsm0411_utils: GSM03.40 9.2.3.11 SCTS should be local In-Reply-To: References: Message-ID: Patch Set 1: > So now you're the GSM03.40 > 9.2.3.11 SCTS expert ;-). I hope I don't come across as: "OMG! I found something not compliant with the spec.. we must fix it NOW!!!" :-) -- To view, visit https://gerrit.osmocom.org/3551 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I4efdb1eaae43aced33961b64d4f14b0040321c10 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Keith Whyte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Keith Whyte Gerrit-Reviewer: Pablo Neira Ayuso Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Aug 18 18:02:29 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 18 Aug 2017 18:02:29 +0000 Subject: libosmocore[master]: gsm0411_utils: GSM03.40 9.2.3.11 SCTS should be local In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3551 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I4efdb1eaae43aced33961b64d4f14b0040321c10 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Keith Whyte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Keith Whyte Gerrit-Reviewer: Pablo Neira Ayuso Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Aug 18 18:02:31 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 18 Aug 2017 18:02:31 +0000 Subject: [MERGED] libosmocore[master]: gsm0411_utils: GSM03.40 9.2.3.11 SCTS should be local In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: gsm0411_utils: GSM03.40 9.2.3.11 SCTS should be local ...................................................................... gsm0411_utils: GSM03.40 9.2.3.11 SCTS should be local >From GSM 03.40: "The Service-Centre-Time-Stamp, and any other times coded in this format that are defined in this specification, represent the time local to the sending entity." Change-Id: I4efdb1eaae43aced33961b64d4f14b0040321c10 --- M src/gsm/gsm0411_utils.c 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified Pablo Neira Ayuso: Looks good to me, but someone else must approve diff --git a/src/gsm/gsm0411_utils.c b/src/gsm/gsm0411_utils.c index 1d3ef49..a4e9d0d 100644 --- a/src/gsm/gsm0411_utils.c +++ b/src/gsm/gsm0411_utils.c @@ -89,7 +89,7 @@ * \param[in] time to encode */ void gsm340_gen_scts(uint8_t *scts, time_t time) { - struct tm *tm = gmtime(&time); + struct tm *tm = localtime(&time); *scts++ = gsm411_bcdify(tm->tm_year % 100); *scts++ = gsm411_bcdify(tm->tm_mon + 1); -- To view, visit https://gerrit.osmocom.org/3551 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I4efdb1eaae43aced33961b64d4f14b0040321c10 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Keith Whyte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Keith Whyte Gerrit-Reviewer: Pablo Neira Ayuso From gerrit-no-reply at lists.osmocom.org Fri Aug 18 18:03:03 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 18 Aug 2017 18:03:03 +0000 Subject: osmo-gsm-tester[master]: esme: Remove temporary workaround for non-implemented delive... In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3557 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Iecf3983bfc24fec8023ba5d589c2d7620ec5d921 Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Aug 18 18:03:46 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 18 Aug 2017 18:03:46 +0000 Subject: openbsc[master]: gbproxy: log signal value as text In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3556 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I6ed923f5c60a8d64305f4b8e90d1362d6510e1c5 Gerrit-PatchSet: 2 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Aug 18 18:03:56 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 18 Aug 2017 18:03:56 +0000 Subject: openbsc[master]: gbproxy: log unhandled BSSGP PDU as text In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3550 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ibe3c8bd353b3a178e26b0936f25b2e1959f9990c Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Aug 18 18:04:13 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 18 Aug 2017 18:04:13 +0000 Subject: osmo-gsm-manuals[master]: OsmoGSMTester: use proper systemd service names In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3107 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ie017946b9099460ac6758ff84ec7a10df13390a1 Gerrit-PatchSet: 2 Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: neels Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Aug 18 18:04:52 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 18 Aug 2017 18:04:52 +0000 Subject: osmo-bts[master]: Simplify jenkins build scripts In-Reply-To: References: Message-ID: Patch Set 8: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3008 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I4d09c5f2693b5ac0a4d8f2c840971e13d1ec58cf Gerrit-PatchSet: 8 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Andr? Boddenberg Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: blobb Gerrit-Reviewer: neels Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Aug 18 18:05:26 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 18 Aug 2017 18:05:26 +0000 Subject: osmo-ci[master]: Add value string termination check from libosmocore In-Reply-To: References: Message-ID: Patch Set 3: Code-Review+2 Verified+1 -- To view, visit https://gerrit.osmocom.org/3065 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I079218b61f512975ec5bfc7dc23503ec369cbb5a Gerrit-PatchSet: 3 Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: blobb Gerrit-Reviewer: neels Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Aug 18 18:05:52 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 18 Aug 2017 18:05:52 +0000 Subject: meta-telephony[201705]: lksctp-tools: Use bb.utils.contains instead of deprecated ba... In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 Verified+1 -- To view, visit https://gerrit.osmocom.org/3555 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ic5fb0f35e5c9a3c48748b2941f471f0704a41e75 Gerrit-PatchSet: 1 Gerrit-Project: meta-telephony Gerrit-Branch: 201705 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Aug 18 18:05:54 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 18 Aug 2017 18:05:54 +0000 Subject: [MERGED] meta-telephony[201705]: lksctp-tools: Use bb.utils.contains instead of deprecated ba... In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: lksctp-tools: Use bb.utils.contains instead of deprecated base_contains ...................................................................... lksctp-tools: Use bb.utils.contains instead of deprecated base_contains Change-Id: Ic5fb0f35e5c9a3c48748b2941f471f0704a41e75 --- M recipes-misc/lksctp-tools/lksctp-tools_1.0.16.bb 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved; Verified diff --git a/recipes-misc/lksctp-tools/lksctp-tools_1.0.16.bb b/recipes-misc/lksctp-tools/lksctp-tools_1.0.16.bb index d3e6a5d..f69e71c 100644 --- a/recipes-misc/lksctp-tools/lksctp-tools_1.0.16.bb +++ b/recipes-misc/lksctp-tools/lksctp-tools_1.0.16.bb @@ -21,7 +21,7 @@ #| /home/jenkins/oe/world/shr-core/tmp-eglibc/sysroots/x86_64-linux/usr/libexec/arm-oe-linux-gnueabi/gcc/arm-oe-linux-gnueabi/4.9.0/ld: error: symbol sctp_connectx has undefined version #| collect2: error: ld returned 1 exit status #| make[4]: *** [libsctp.la] Error 1 -PNBLACKLIST[lksctp-tools] ?= "${@base_contains('DISTRO_FEATURES', 'ld-is-gold', "BROKEN: fails to link against sctp_connectx symbol", '', d)}" +PNBLACKLIST[lksctp-tools] ?= "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-gold', "BROKEN: fails to link against sctp_connectx symbol", '', d)}" S = "${WORKDIR}/${BP}" -- To view, visit https://gerrit.osmocom.org/3555 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ic5fb0f35e5c9a3c48748b2941f471f0704a41e75 Gerrit-PatchSet: 1 Gerrit-Project: meta-telephony Gerrit-Branch: 201705 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte From gerrit-no-reply at lists.osmocom.org Fri Aug 18 18:06:17 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 18 Aug 2017 18:06:17 +0000 Subject: openbsc[master]: libmsc: Fix wrong handling of user_message_reference parameter In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3554 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: If748548a4a223e529a1110c89e483b599b406e8b Gerrit-PatchSet: 2 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pablo Neira Ayuso Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Aug 18 18:06:18 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 18 Aug 2017 18:06:18 +0000 Subject: [MERGED] openbsc[master]: libmsc: Fix wrong handling of user_message_reference parameter In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: libmsc: Fix wrong handling of user_message_reference parameter ...................................................................... libmsc: Fix wrong handling of user_message_reference parameter libsmpp34 already converts received TLV integer values to native endianess in libsmpp34_(un)pack. Converting them again at receive time swaps the 2 bytes of user_message_reference, then using a wrong value. As GSM03.40 spec uses only 1 byte for the id, then only the high byte of the initial value is used and eventually sent back to the ESME. Again, at that time, htons() is not needed because libsmpp34 already handles that part. See OS-#2429 for more details. Change-Id: If748548a4a223e529a1110c89e483b599b406e8b --- M openbsc/src/libmsc/smpp_openbsc.c 1 file changed, 2 insertions(+), 2 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified Pablo Neira Ayuso: Looks good to me, but someone else must approve diff --git a/openbsc/src/libmsc/smpp_openbsc.c b/openbsc/src/libmsc/smpp_openbsc.c index e656376..af2d1be 100644 --- a/openbsc/src/libmsc/smpp_openbsc.c +++ b/openbsc/src/libmsc/smpp_openbsc.c @@ -120,7 +120,7 @@ } break; case TLVID_user_message_reference: - msg_ref = ntohs(t->value.val16); + msg_ref = t->value.val16; break; default: break; @@ -436,7 +436,7 @@ memset(&tlv, 0, sizeof(tlv)); tlv.tag = tag; tlv.length = 2; - tlv.value.val16 = htons(val); + tlv.value.val16 = val; build_tlv(req_tlv, &tlv); } -- To view, visit https://gerrit.osmocom.org/3554 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: If748548a4a223e529a1110c89e483b599b406e8b Gerrit-PatchSet: 2 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pablo Neira Ayuso From gerrit-no-reply at lists.osmocom.org Fri Aug 18 18:07:25 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Fri, 18 Aug 2017 18:07:25 +0000 Subject: [MERGED] openbsc[master]: gbproxy: log unhandled BSSGP PDU as text In-Reply-To: References: Message-ID: Max has submitted this change and it was merged. Change subject: gbproxy: log unhandled BSSGP PDU as text ...................................................................... gbproxy: log unhandled BSSGP PDU as text Change-Id: Ibe3c8bd353b3a178e26b0936f25b2e1959f9990c --- M openbsc/src/gprs/gb_proxy.c 1 file changed, 1 insertion(+), 2 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/openbsc/src/gprs/gb_proxy.c b/openbsc/src/gprs/gb_proxy.c index 3603e14..b98a9a5 100644 --- a/openbsc/src/gprs/gb_proxy.c +++ b/openbsc/src/gprs/gb_proxy.c @@ -1266,8 +1266,7 @@ rc = bssgp_tx_status(BSSGP_CAUSE_PDU_INCOMP_FEAT, NULL, orig_msg); break; default: - LOGP(DGPRS, LOGL_NOTICE, "BSSGP PDU type 0x%02x unknown\n", - pdu_type); + LOGP(DGPRS, LOGL_NOTICE, "BSSGP PDU type %s not supported\n", bssgp_pdu_str(pdu_type)); rate_ctr_inc(&cfg->ctrg-> ctr[GBPROX_GLOB_CTR_PROTO_ERR_SGSN]); rc = bssgp_tx_status(BSSGP_CAUSE_PROTO_ERR_UNSPEC, NULL, orig_msg); -- To view, visit https://gerrit.osmocom.org/3550 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ibe3c8bd353b3a178e26b0936f25b2e1959f9990c Gerrit-PatchSet: 2 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max From gerrit-no-reply at lists.osmocom.org Fri Aug 18 18:07:37 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Fri, 18 Aug 2017 18:07:37 +0000 Subject: [MERGED] openbsc[master]: gbproxy: log signal value as text In-Reply-To: References: Message-ID: Max has submitted this change and it was merged. Change subject: gbproxy: log signal value as text ...................................................................... gbproxy: log signal value as text Change-Id: I6ed923f5c60a8d64305f4b8e90d1362d6510e1c5 --- M openbsc/src/gprs/gb_proxy.c 1 file changed, 4 insertions(+), 6 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/openbsc/src/gprs/gb_proxy.c b/openbsc/src/gprs/gb_proxy.c index b98a9a5..cd38d23 100644 --- a/openbsc/src/gprs/gb_proxy.c +++ b/openbsc/src/gprs/gb_proxy.c @@ -1369,9 +1369,8 @@ /* from BSS to SGSN */ peer = gbproxy_peer_by_nsei(cfg, nsvc->nsei); if (!peer) { - LOGP(DGPRS, LOGL_NOTICE, "signal %u for unknown peer " - "NSEI=%u/NSVCI=%u\n", signal, nsvc->nsei, - nsvc->nsvci); + LOGP(DGPRS, LOGL_NOTICE, "signal '%s' for unknown peer NSEI=%u/NSVCI=%u\n", + get_value_string(gprs_ns_signal_ns_names, signal), nsvc->nsei, nsvc->nsvci); return 0; } switch (signal) { @@ -1379,9 +1378,8 @@ case S_NS_BLOCK: if (!peer->blocked) break; - LOGP(DGPRS, LOGL_NOTICE, "Converting NS_RESET from " - "NSEI=%u/NSVCI=%u into BSSGP_BVC_BLOCK to SGSN\n", - nsvc->nsei, nsvc->nsvci); + LOGP(DGPRS, LOGL_NOTICE, "Converting '%s' from NSEI=%u/NSVCI=%u into BSSGP_BVC_BLOCK to SGSN\n", + get_value_string(gprs_ns_signal_ns_names, signal), nsvc->nsei, nsvc->nsvci); bssgp_tx_simple_bvci(BSSGP_PDUT_BVC_BLOCK, nsvc->nsei, peer->bvci, 0); break; -- To view, visit https://gerrit.osmocom.org/3556 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I6ed923f5c60a8d64305f4b8e90d1362d6510e1c5 Gerrit-PatchSet: 3 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max From gerrit-no-reply at lists.osmocom.org Fri Aug 18 18:07:51 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 18 Aug 2017 18:07:51 +0000 Subject: openbsc[master]: libmsc: Use actual delivery time in delivery reports. In-Reply-To: References: Message-ID: Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3540 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I9056429d40bf02731f004b7833f1de45a0d1add8 Gerrit-PatchSet: 3 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Keith Whyte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Keith Whyte Gerrit-Reviewer: Pablo Neira Ayuso Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Aug 18 18:07:53 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 18 Aug 2017 18:07:53 +0000 Subject: [MERGED] openbsc[master]: libmsc: Use actual delivery time in delivery reports. In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: libmsc: Use actual delivery time in delivery reports. ...................................................................... libmsc: Use actual delivery time in delivery reports. Set the time on the status report to the time the message was delivered, as this may not be the same as the time when we are delivering the report to the originating MS. Change-Id: I9056429d40bf02731f004b7833f1de45a0d1add8 --- M openbsc/include/openbsc/gsm_data.h M openbsc/src/libmsc/db.c M openbsc/src/libmsc/gsm_04_11.c 3 files changed, 4 insertions(+), 2 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified Pablo Neira Ayuso: Looks good to me, but someone else must approve diff --git a/openbsc/include/openbsc/gsm_data.h b/openbsc/include/openbsc/gsm_data.h index 6829d22..4035b39 100644 --- a/openbsc/include/openbsc/gsm_data.h +++ b/openbsc/include/openbsc/gsm_data.h @@ -456,6 +456,7 @@ } smpp; unsigned long validity_minutes; + time_t created; bool is_report; uint8_t reply_path_req; uint8_t status_rep_req; diff --git a/openbsc/src/libmsc/db.c b/openbsc/src/libmsc/db.c index 631e05f..4ba12ca 100644 --- a/openbsc/src/libmsc/db.c +++ b/openbsc/src/libmsc/db.c @@ -1641,6 +1641,7 @@ /* FIXME: validity */ /* FIXME: those should all be get_uchar, but sqlite3 is braindead */ + sms->created = dbi_result_get_datetime(result, "created"); sms->reply_path_req = dbi_result_get_ulonglong(result, "reply_path_req"); sms->status_rep_req = dbi_result_get_ulonglong(result, "status_rep_req"); sms->is_report = dbi_result_get_ulonglong(result, "is_report"); diff --git a/openbsc/src/libmsc/gsm_04_11.c b/openbsc/src/libmsc/gsm_04_11.c index 5e736b3..ddef444 100644 --- a/openbsc/src/libmsc/gsm_04_11.c +++ b/openbsc/src/libmsc/gsm_04_11.c @@ -310,11 +310,11 @@ /* generate TP-SCTS (Service centre timestamp) */ smsp = msgb_put(msg, 7); - gsm340_gen_scts(smsp, time(NULL)); + gsm340_gen_scts(smsp, sms->created); /* generate TP-DT (Discharge time, in TP-SCTS format). */ smsp = msgb_put(msg, 7); - gsm340_gen_scts(smsp, time(NULL)); + gsm340_gen_scts(smsp, sms->created); /* TP-ST (status) */ smsp = msgb_put(msg, 1); -- To view, visit https://gerrit.osmocom.org/3540 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I9056429d40bf02731f004b7833f1de45a0d1add8 Gerrit-PatchSet: 4 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Keith Whyte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Keith Whyte Gerrit-Reviewer: Pablo Neira Ayuso From gerrit-no-reply at lists.osmocom.org Fri Aug 18 18:08:00 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Fri, 18 Aug 2017 18:08:00 +0000 Subject: [MERGED] osmo-gsm-manuals[master]: OsmoGSMTester: use proper systemd service names In-Reply-To: References: Message-ID: Max has submitted this change and it was merged. Change subject: OsmoGSMTester: use proper systemd service names ...................................................................... OsmoGSMTester: use proper systemd service names * use osmo-bts-sysmo for sysmoBTS systemd service name which is available since 114293a414bd5b7c86622ec8c293c4034c80d243 * use osmo-pcu for OsmoPCU systemd service name which is available since 241f5bcb00f9c6fee4200a3aea9aa497bf0d3eee Change-Id: Ie017946b9099460ac6758ff84ec7a10df13390a1 --- M OsmoGSMTester/chapters/install.adoc 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Pau Espin Pedrol: Looks good to me, but someone else must approve Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/OsmoGSMTester/chapters/install.adoc b/OsmoGSMTester/chapters/install.adoc index 0c69dcd..f58c611 100644 --- a/OsmoGSMTester/chapters/install.adoc +++ b/OsmoGSMTester/chapters/install.adoc @@ -541,7 +541,7 @@ be disabled: ---- -systemctl mask osmo-nitb sysmobts sysmopcu sysmobts-mgr +systemctl mask osmo-nitb osmo-bts-sysmo osmo-pcu sysmobts-mgr ---- This stops the stock setup keeping the BTS in operation and hence allows the -- To view, visit https://gerrit.osmocom.org/3107 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ie017946b9099460ac6758ff84ec7a10df13390a1 Gerrit-PatchSet: 3 Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: neels From gerrit-no-reply at lists.osmocom.org Fri Aug 18 18:08:13 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 18 Aug 2017 18:08:13 +0000 Subject: openbsc[master]: NITB: remove 'help' output about '-a' option that is removed... In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3553 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I1d2cceb588ec5fb34ec5e2c05a7d8c93310bee88 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Aug 18 18:08:14 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 18 Aug 2017 18:08:14 +0000 Subject: [MERGED] openbsc[master]: NITB: remove 'help' output about '-a' option that is removed... In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: NITB: remove 'help' output about '-a' option that is removed for ages ...................................................................... NITB: remove 'help' output about '-a' option that is removed for ages This option was present in very early versions of the NITB, but at least since 2011 it is no longer supported. It's still listed in --help output, which is wrong. Change-Id: I1d2cceb588ec5fb34ec5e2c05a7d8c93310bee88 --- M openbsc/src/osmo-nitb/bsc_hack.c 1 file changed, 0 insertions(+), 2 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/openbsc/src/osmo-nitb/bsc_hack.c b/openbsc/src/osmo-nitb/bsc_hack.c index 17b23b2..c2fe1c9 100644 --- a/openbsc/src/osmo-nitb/bsc_hack.c +++ b/openbsc/src/osmo-nitb/bsc_hack.c @@ -99,7 +99,6 @@ printf(" -c --config-file filename The config file to use.\n"); printf(" -s --disable-color\n"); printf(" -l --database db-name The database to use.\n"); - printf(" -a --authorize-everyone Authorize every new subscriber. Dangerous!\n"); printf(" -T --timestamp Prefix every log line with a timestamp.\n"); printf(" -V --version Print the version of OpenBSC.\n"); printf(" -P --rtp-proxy Enable the RTP Proxy code inside OpenBSC.\n"); @@ -122,7 +121,6 @@ {"config-file", 1, 0, 'c'}, {"disable-color", 0, 0, 's'}, {"database", 1, 0, 'l'}, - {"authorize-everyone", 0, 0, 'a'}, {"pcap", 1, 0, 'p'}, {"timestamp", 0, 0, 'T'}, {"version", 0, 0, 'V' }, -- To view, visit https://gerrit.osmocom.org/3553 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I1d2cceb588ec5fb34ec5e2c05a7d8c93310bee88 Gerrit-PatchSet: 2 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Fri Aug 18 18:08:16 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Fri, 18 Aug 2017 18:08:16 +0000 Subject: [MERGED] osmo-ci[master]: Add value string termination check from libosmocore In-Reply-To: References: Message-ID: Max has submitted this change and it was merged. Change subject: Add value string termination check from libosmocore ...................................................................... Add value string termination check from libosmocore The script by Neels Hofmeyr has actually nothing to do with libosmocore itself - it's a generic build-time check used by jenkins so it should be part of this repo to avoid extra checkout of libosmocore just for this script. Change-Id: I079218b61f512975ec5bfc7dc23503ec369cbb5a --- A scripts/verify_value_string_arrays_are_terminated.py 1 file changed, 33 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved; Verified diff --git a/scripts/verify_value_string_arrays_are_terminated.py b/scripts/verify_value_string_arrays_are_terminated.py new file mode 100755 index 0000000..020bb4d --- /dev/null +++ b/scripts/verify_value_string_arrays_are_terminated.py @@ -0,0 +1,33 @@ +#!/usr/bin/env python3 +# vim: expandtab tabstop=2 shiftwidth=2 nocin + +''' +Usage: + verify_value_string_arrays_are_terminated.py PATH [PATH [...]] + +e.g. +libosmocore/contrib/verify_value_string_arrays_are_terminated.py $(find . -name "*.[hc]") +''' + +import re +import sys +import codecs + +value_string_array_re = re.compile( + r'((\bstruct\s+value_string\b[^{;]*?)\s*=[^{;]*{[^;]*}\s*;)', + re.MULTILINE | re.DOTALL) + +members = r'(\.(value|str)\s*=\s*)?' +terminator_re = re.compile('{\s*' + members + '(0|NULL)\s*,' + '\s*' + members + '(0|NULL)\s*}') +errors_found = 0 + +for f in sys.argv[1:]: + arrays = value_string_array_re.findall(codecs.open(f, "r", "utf-8").read()) + for array_def, name in arrays: + if not terminator_re.search(array_def): + print('ERROR: file contains unterminated value_string %r: %r' + % (name, f)) + errors_found += 1 + +sys.exit(errors_found) -- To view, visit https://gerrit.osmocom.org/3065 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I079218b61f512975ec5bfc7dc23503ec369cbb5a Gerrit-PatchSet: 4 Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Max Gerrit-Reviewer: blobb Gerrit-Reviewer: neels From gerrit-no-reply at lists.osmocom.org Fri Aug 18 18:08:26 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 18 Aug 2017 18:08:26 +0000 Subject: osmo-gsm-manuals[master]: mgw: Fix endpoint names for new MGW In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3546 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Id1f079307225faf05d298dcb12aa1c421bfa680a Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Aug 18 18:08:28 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 18 Aug 2017 18:08:28 +0000 Subject: osmo-gsm-manuals[master]: MGW: Include MGCP endpoint naming scheme of old IPA/SCCPlite... In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3547 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ib1fe96f0041534fa027b70ee67978cb7c6bc5207 Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Aug 18 18:08:32 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Fri, 18 Aug 2017 18:08:32 +0000 Subject: [MERGED] osmo-bts[master]: Simplify jenkins build scripts In-Reply-To: References: Message-ID: Max has submitted this change and it was merged. Change subject: Simplify jenkins build scripts ...................................................................... Simplify jenkins build scripts * move duplicated code into separate functions in jenkins_common.sh * use that function in individual builds Change-Id: I4d09c5f2693b5ac0a4d8f2c840971e13d1ec58cf --- M contrib/jenkins_bts_trx.sh M contrib/jenkins_common.sh M contrib/jenkins_lc15.sh M contrib/jenkins_oct.sh M contrib/jenkins_oct_and_bts_trx.sh M contrib/jenkins_sysmobts.sh 6 files changed, 34 insertions(+), 86 deletions(-) Approvals: Andr? Boddenberg: Looks good to me, but someone else must approve Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/contrib/jenkins_bts_trx.sh b/contrib/jenkins_bts_trx.sh index 9e95809..47ccde3 100755 --- a/contrib/jenkins_bts_trx.sh +++ b/contrib/jenkins_bts_trx.sh @@ -16,26 +16,9 @@ # Get osmo-pcu for pcuif_proto.h osmo-deps.sh osmo-pcu -cd "$base" - -set +x -echo -echo -echo -echo " =============================== osmo-bts-trx ===============================" -echo -set -x - -autoreconf --install --force configure_flags="\ - --with-openbsc=$deps/openbsc/openbsc/include \ --with-osmo-pcu=$deps/osmo-pcu/include \ --enable-trx \ " -./configure $configure_flags -$MAKE $PARALLEL_MAKE -$MAKE check \ - || cat-testlogs.sh -DISTCHECK_CONFIGURE_FLAGS="$configure_flags" \ - $MAKE distcheck \ - || cat-testlogs.sh + +build_bts "osmo-bts-trx" "$configure_flags" diff --git a/contrib/jenkins_common.sh b/contrib/jenkins_common.sh index bce771d..78ca0af 100644 --- a/contrib/jenkins_common.sh +++ b/contrib/jenkins_common.sh @@ -25,9 +25,30 @@ # Get libosmocore for verify_value_string_arrays_are_terminated.py osmo-deps.sh libosmocore -# Get OpenBSC for gsm_data_shared.* -osmo-deps.sh openbsc - cd "$base" "$deps"/libosmocore/contrib/verify_value_string_arrays_are_terminated.py $(find . -name "*.[hc]") + +# generic project build function, usage: +# build "PROJECT-NAME" "CONFIGURE OPTIONS" +build_bts() { + set +x + echo + echo + echo + echo " =============================== $1 ===============================" + echo + set -x + + cd $deps + osmo-deps.sh openbsc + conf_flags="--with-openbsc=$deps/openbsc/openbsc/include" + cd $base + shift + conf_flags="$conf_flags $*" + autoreconf --install --force + ./configure $conf_flags + $MAKE $PARALLEL_MAKE + $MAKE check || cat-testlogs.sh + DISTCHECK_CONFIGURE_FLAGS=$conf_flags $MAKE distcheck || cat-testlogs.sh +} diff --git a/contrib/jenkins_lc15.sh b/contrib/jenkins_lc15.sh index a2d9514..314d85c 100755 --- a/contrib/jenkins_lc15.sh +++ b/contrib/jenkins_lc15.sh @@ -13,18 +13,7 @@ cd "$deps" osmo-layer1-headers.sh lc15 "$FIRMWARE_VERSION" -cd "$base" -set +x -echo -echo -echo -echo " =============================== osmo-bts-lc15 ===============================" -echo -set -x +configure_flags="--with-litecell15=$deps/layer1-headers/inc/ --enable-litecell15" -autoreconf --install --force -./configure --with-openbsc="$deps/openbsc/openbsc/include" --with-litecell15="$deps/layer1-headers/inc/" --enable-litecell15 -$MAKE $PARALLEL_MAKE -$MAKE check || cat-testlogs.sh -DISTCHECK_CONFIGURE_FLAGS="--with-litecell15=$deps/layer1-headers/inc/ --with-openbsc=$deps/openbsc/openbsc/include --enable-litecell15" $MAKE distcheck || cat-testlogs.sh +build_bts "osmo-bts-lc15" "$configure_flags" diff --git a/contrib/jenkins_oct.sh b/contrib/jenkins_oct.sh index b3dc07f..8a351c5 100755 --- a/contrib/jenkins_oct.sh +++ b/contrib/jenkins_oct.sh @@ -13,21 +13,7 @@ cd "$deps" osmo-layer1-headers.sh oct "$FIRMWARE_VERSION" -cd "$base" -set +x -echo -echo -echo -echo " =============================== osmo-bts-octphy ===============================" -echo -set -x +configure_flags="--with-octsdr-2g=$deps/layer1-headers/ --enable-octphy" -autoreconf --install --force -./configure --with-openbsc="$deps/openbsc/openbsc/include" --with-octsdr-2g="$deps/layer1-headers/" --enable-octphy -$MAKE $PARALLEL_MAKE -$MAKE check \ - || cat-testlogs.sh -DISTCHECK_CONFIGURE_FLAGS="--with-octsdr-2g=$deps/layer1-headers/ --with-openbsc=$deps/openbsc/openbsc/include --enable-octphy" \ - $MAKE distcheck \ - || cat-testlogs.sh +build_bts "osmo-bts-octphy" "$configure_flags" diff --git a/contrib/jenkins_oct_and_bts_trx.sh b/contrib/jenkins_oct_and_bts_trx.sh index c23009d..964fb94 100755 --- a/contrib/jenkins_oct_and_bts_trx.sh +++ b/contrib/jenkins_oct_and_bts_trx.sh @@ -18,28 +18,11 @@ osmo-layer1-headers.sh oct "$FIRMWARE_VERSION" -cd "$base" - -set +x -echo -echo -echo -echo " =============================== osmo-bts-octphy+trx ===============================" -echo -set -x - -autoreconf --install --force configure_flags="\ - --with-openbsc=$deps/openbsc/openbsc/include \ --with-osmo-pcu=$deps/osmo-pcu/include \ --with-octsdr-2g=$deps/layer1-headers/ \ --enable-octphy \ --enable-trx \ " -./configure $configure_flags -$MAKE $PARALLEL_MAKE -$MAKE check \ - || cat-testlogs.sh -DISTCHECK_CONFIGURE_FLAGS="$configure_flags" \ - $MAKE distcheck \ - || cat-testlogs.sh + +build_bts "osmo-bts-octphy+trx" "$configure_flags" diff --git a/contrib/jenkins_sysmobts.sh b/contrib/jenkins_sysmobts.sh index 6645181..ca12e76 100755 --- a/contrib/jenkins_sysmobts.sh +++ b/contrib/jenkins_sysmobts.sh @@ -15,24 +15,10 @@ osmo-layer1-headers.sh sysmo "$FIRMWARE_VERSION" mkdir -p "$inst/include/sysmocom/femtobts" ln -s $deps/layer1-headers/include/* "$inst/include/sysmocom/femtobts/" -cd "$base" -set +x -echo -echo -echo -echo " =============================== osmo-bts-sysmo ===============================" -echo -set -x +configure_flags="--enable-sysmocom-bts" -autoreconf --install --force -./configure --enable-sysmocom-bts --with-openbsc="$deps/openbsc/openbsc/include" -$MAKE $PARALLEL_MAKE -$MAKE check \ - || cat-testlogs.sh -DISTCHECK_CONFIGURE_FLAGS="--enable-sysmocom-bts --with-openbsc=$deps/openbsc/openbsc/include" \ - $MAKE distcheck \ - || cat-testlogs.sh +build_bts "osmo-bts-sysmo" "$configure_flags" # This will not work for the femtobts if [ $FIRMWARE_VERSION != "femtobts_v2.7" ]; then -- To view, visit https://gerrit.osmocom.org/3008 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I4d09c5f2693b5ac0a4d8f2c840971e13d1ec58cf Gerrit-PatchSet: 9 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Andr? Boddenberg Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: blobb Gerrit-Reviewer: neels From gerrit-no-reply at lists.osmocom.org Fri Aug 18 18:08:34 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 18 Aug 2017 18:08:34 +0000 Subject: [MERGED] osmo-gsm-manuals[master]: MGW: Include MGCP endpoint naming scheme of old IPA/SCCPlite... In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: MGW: Include MGCP endpoint naming scheme of old IPA/SCCPlite approach ...................................................................... MGW: Include MGCP endpoint naming scheme of old IPA/SCCPlite approach Change-Id: Ib1fe96f0041534fa027b70ee67978cb7c6bc5207 --- M OsmoBSC/mgw/osmo-bsc-old-sccplite.msc 1 file changed, 8 insertions(+), 8 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/OsmoBSC/mgw/osmo-bsc-old-sccplite.msc b/OsmoBSC/mgw/osmo-bsc-old-sccplite.msc index f7298bf..067721c 100644 --- a/OsmoBSC/mgw/osmo-bsc-old-sccplite.msc +++ b/OsmoBSC/mgw/osmo-bsc-old-sccplite.msc @@ -24,12 +24,12 @@ bts box bts [label="Connect RTP socket to remote (bsc_mgcp) RTP Port"]; bts -> bsc [label="IPA MDCX ACK"]; - mgcp <- m_sc [label="MGCP CRCX"]; + mgcp <- m_sc [label="MGCP CRCX 1 at mgw"]; mgcp box mgcp [label="Bind to BTS-local RTP Port"]; - mgcp -> m_sc [label="MGCP CRCX OK"]; - mgcp <- m_sc [label="MGCP MDCX (recvonly) "]; + mgcp -> m_sc [label="MGCP CRCX 1 at mgw OK"]; + mgcp <- m_sc [label="MGCP MDCX 1 at mgw (recvonly) "]; mgcp box mgcp [label="Connect RTP socket to remote (MSC) RTP Port"]; - mgcp -> m_sc [label="MGCP MDCX OK"]; + mgcp -> m_sc [label="MGCP MDCX 1 at mgw OK"]; mgcp <= m_sc [label="RTP Audio"]; bts <= mgcp [label="RTP Audio"]; ms <= bts [label="Um Audio (unidirectional)"]; @@ -45,9 +45,9 @@ ...; ms <- m_sc [label="DTAP CC CONNECT"]; ms -> m_sc [label="DTAP CC CONNECT ACK"]; - mgcp <- m_sc [label="MGCP MDCX (sndrecv) "]; + mgcp <- m_sc [label="MGCP MDCX 1 at mgw (sndrecv) "]; mgcp box mgcp [label="Why?"]; - mgcp -> m_sc [label="MGCP MDCX OK"]; + mgcp -> m_sc [label="MGCP MDCX 1 at mgw OK"]; --- [label="Voice Call in Progress"]; ms <- m_sc [label="DTAP CC DISCONNET"]; ms <- m_sc [label="DTAP CC RELEASE"]; @@ -58,7 +58,7 @@ bsc <- m_sc [label="SCCP RLSD"]; bsc -> m_sc [label="SCCP RLC"]; ...; - mgcp <- m_sc [label="MGCP DLCX"]; + mgcp <- m_sc [label="MGCP DLCX 1 at mgw"]; mgcp box mgcp [label="Release local RTP port"]; - mgcp -> m_sc [label="MGCP DLCX OK"]; + mgcp -> m_sc [label="MGCP DLCX 1 at mgw OK"]; } -- To view, visit https://gerrit.osmocom.org/3547 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ib1fe96f0041534fa027b70ee67978cb7c6bc5207 Gerrit-PatchSet: 2 Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Fri Aug 18 18:08:35 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 18 Aug 2017 18:08:35 +0000 Subject: [MERGED] osmo-gsm-manuals[master]: mgw: Fix endpoint names for new MGW In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: mgw: Fix endpoint names for new MGW ...................................................................... mgw: Fix endpoint names for new MGW According to RFC3435, an RTP bridge forrwarding packets, transcoding or otherwise, is a single endpoint with two connections. Let's treat it as such. We introduce the "rtpbridge/" prefix to identify such special RTP endpoints. Change-Id: Id1f079307225faf05d298dcb12aa1c421bfa680a --- M OsmoBSC/mgw/osmo-bsc-new-mgw-e1.msc M OsmoBSC/mgw/osmo-bsc-new-mgw.msc 2 files changed, 16 insertions(+), 16 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/OsmoBSC/mgw/osmo-bsc-new-mgw-e1.msc b/OsmoBSC/mgw/osmo-bsc-new-mgw-e1.msc index 7912a73..04b114f 100644 --- a/OsmoBSC/mgw/osmo-bsc-new-mgw-e1.msc +++ b/OsmoBSC/mgw/osmo-bsc-new-mgw-e1.msc @@ -17,9 +17,9 @@ ms <-> bsc [label="Assignment"]; ...; - mgcp <- bsc [label="MGCP CRCX ts1/ss2 at abis (MSC:4000)"]; + mgcp <- bsc [label="MGCP CRCX ts1/ss2 at mgw (MSC:4000)"]; mgcp box mgcp [label="Bind to MGW-local RTP Port (3000)\nConnect to MSC:4000"]; - mgcp -> bsc [label="MGCP CRCX ts1/ss2 at a OK (MGW:3000)"]; + mgcp -> bsc [label="MGCP CRCX ts1/ss2 at mgw OK (MGW:3000)"]; ...; bsc -> m_sc [label="BSSAP ASSGN CMPL (3GPP AoIP MGW:3000)"]; @@ -44,7 +44,7 @@ bsc <- m_sc [label="SCCP RLSD"]; bsc -> m_sc [label="SCCP RLC"]; ...; - mgcp <- bsc [label="MGCP DLCX ts1/ss2 at a"]; + mgcp <- bsc [label="MGCP DLCX ts1/ss2 at mgw"]; mgcp box mgcp [label="Release MSC-facing local RTP port (3000)"]; - mgcp -> bsc [label="MGCP DLCX ts1/ss2 at a OK"]; + mgcp -> bsc [label="MGCP DLCX ts1/ss2 at mgw OK"]; } diff --git a/OsmoBSC/mgw/osmo-bsc-new-mgw.msc b/OsmoBSC/mgw/osmo-bsc-new-mgw.msc index 2bab84d..e618bb7 100644 --- a/OsmoBSC/mgw/osmo-bsc-new-mgw.msc +++ b/OsmoBSC/mgw/osmo-bsc-new-mgw.msc @@ -20,19 +20,19 @@ bts <- bsc [label="IPA CRCX"]; bts box bts [label="Bind to BTS-local RTP Port (1000)"]; bts -> bsc [label="IPA CRCX ACK (BTS:1000)"]; - bsc -> mgcp [label="MGCP CRCX 2 at abis (BTS:1000)"]; + bsc -> mgcp [label="MGCP CRCX rtpbridge/2 at mgw (BTS:1000)"]; mgcp box mgcp [label="Bind to MGW-local RTP Port (2000)\nConnect to BTS:1000"]; - bsc <- mgcp [label="MGCP CRCX 2 at abis OK (MGW:2000)"]; - bts <- bsc [label="IPA MDCX 2 at abis (MGW:2000)"]; + bsc <- mgcp [label="MGCP CRCX rtpbridge/2 at mgw OK (MGW:2000)"]; + bts <- bsc [label="IPA MDCX (MGW:2000)"]; bts box bts [label="Connect RTP socket to remote (MGW) RTP Port"]; - bts -> bsc [label="IPA MDCX 2 at abis ACK"]; - #bsc -> mgcp [label="MGCP MDCX 2 at abis (optional)"]; - #bsc <- mgcp [label="MGCP MDCX 2 at abis OK (optional)"]; + bts -> bsc [label="IPA MDCX ACK"]; + #bsc -> mgcp [label="MGCP MDCX rtpbridge/2 at mgw (optional)"]; + #bsc <- mgcp [label="MGCP MDCX rtpbridge/2 at mgw OK (optional)"]; ...; - mgcp <- bsc [label="MGCP CRCX 1 at a (MSC:4000)"]; + mgcp <- bsc [label="MGCP CRCX rtpbridge/2 at mgw (MSC:4000)"]; mgcp box mgcp [label="Bind to MGW-local RTP Port (3000)\nConnect to MSC:4000"]; - mgcp -> bsc [label="MGCP CRCX 1 at a OK (MGW:3000)"]; + mgcp -> bsc [label="MGCP CRCX rtpbridge/2 at mgw OK (MGW:3000)"]; ...; bsc -> m_sc [label="BSSAP ASSGN CMPL (3GPP AoIP MGW:3000)"]; @@ -57,13 +57,13 @@ bsc <- m_sc [label="SCCP RLSD"]; bsc -> m_sc [label="SCCP RLC"]; ...; - mgcp <- bsc [label="MGCP DLCX 1 at a"]; + mgcp <- bsc [label="MGCP DLCX rtpbridge/2 at mgw"]; mgcp box mgcp [label="Release MSC-facing local RTP port (3000)"]; - mgcp -> bsc [label="MGCP DLCX 1 at a OK"]; + mgcp -> bsc [label="MGCP DLCX rtpbridge/2 at mgw OK"]; - bsc -> mgcp [label="MGCP DLCX 2 at abis"]; + mgcp <- bsc [label="MGCP DLCX rtpbridge/2 at mgw"]; mgcp box mgcp [label="Release BTS-facing local RTP port (2000)"]; - bsc <- mgcp [label="MGCP DLCX 2 at abis OK"]; + mgcp -> bsc [label="MGCP DLCX rtpbridge/2 at mgw OK"]; bts <- bsc [label="IPA DLCX"]; bts box bts [label="Release BTS-local RTP port (1000)"]; -- To view, visit https://gerrit.osmocom.org/3546 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Id1f079307225faf05d298dcb12aa1c421bfa680a Gerrit-PatchSet: 2 Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Fri Aug 18 18:09:23 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 18 Aug 2017 18:09:23 +0000 Subject: osmo-pcu[master]: EDGE: Fix UL link adaptation. In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3538 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I9272c337ad6399da4a47cc6e2736e25f24e099d8 Gerrit-PatchSet: 2 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Minh-Quang Nguyen Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Minh-Quang Nguyen Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Aug 18 18:09:25 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 18 Aug 2017 18:09:25 +0000 Subject: [MERGED] osmo-pcu[master]: EDGE: Fix UL link adaptation. In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: EDGE: Fix UL link adaptation. ...................................................................... EDGE: Fix UL link adaptation. We have seen that UL MCS5- MCS9 link adaptation has not been implemented in current PCU implementation. If the MS slowly moves far away from the BTS, the UL MCS will always stick at MCS9 no matter UL link quality values leading to poor data service experience. The UL MCS is expected to adapt from MCS9 -> MCSx due to bad UL quality. Below PCU traces indicate that UL MCS is quickly increasing to MCS9 (max MCS 9 was used in this test) and it never changes to other UL MCS due zero thresholds. <0004> gprs_ms.cpp:670 MS (IMSI ): Link quality 23dB (23dB) left window [0, 0], modifying uplink CS level: MCS-6 -> MCS-7 <0004> gprs_ms.cpp:670 MS (IMSI 000): Link quality 23dB (23dB) left window [0, 0], modifying uplink CS level: MCS-7 -> MCS-8 <0004> gprs_ms.cpp:670 MS (IMSI 000): Link quality 23dB (23dB) left window [0, 0], modifying uplink CS level: MCS-8 -> MCS-9 Change-Id: I9272c337ad6399da4a47cc6e2736e25f24e099d8 --- M src/bts.h M src/gprs_ms.cpp M src/pcu_main.cpp M src/pcu_vty.c 4 files changed, 100 insertions(+), 5 deletions(-) Approvals: Max: Looks good to me, but someone else must approve Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/bts.h b/src/bts.h index 1f1dae2..b1fb8cc 100644 --- a/src/bts.h +++ b/src/bts.h @@ -221,6 +221,7 @@ uint8_t cs_adj_upper_limit; uint8_t cs_adj_lower_limit; struct {int16_t low; int16_t high; } cs_lqual_ranges[MAX_GPRS_CS]; + struct {int16_t low; int16_t high; } mcs_lqual_ranges[MAX_GPRS_CS]; uint16_t cs_downgrade_threshold; /* downgrade if less packets left (DL) */ uint16_t ws_base; uint16_t ws_pdch; /* increase WS by this value per PDCH */ diff --git a/src/gprs_ms.cpp b/src/gprs_ms.cpp index c6b7e34..66312fa 100644 --- a/src/gprs_ms.cpp +++ b/src/gprs_ms.cpp @@ -624,7 +624,7 @@ bts_data = m_bts->bts_data(); if (!max_cs_ul) { - LOGP(DRLCMACDL, LOGL_ERROR, + LOGP(DRLCMACMEAS, LOGL_ERROR, "max_cs_ul cannot be derived (current UL CS: %s)\n", m_current_cs_ul.name()); return; @@ -642,11 +642,10 @@ low = bts_data->cs_lqual_ranges[current_cs_num-1].low; high = bts_data->cs_lqual_ranges[current_cs_num-1].high; } else if (m_current_cs_ul.isEgprs()) { - /* TODO, use separate table */ if (current_cs_num > MAX_GPRS_CS) current_cs_num = MAX_GPRS_CS; - low = bts_data->cs_lqual_ranges[current_cs_num-1].low; - high = bts_data->cs_lqual_ranges[current_cs_num-1].high; + low = bts_data->mcs_lqual_ranges[current_cs_num-1].low; + high = bts_data->mcs_lqual_ranges[current_cs_num-1].high; } else { return; } @@ -661,7 +660,7 @@ new_cs_ul.inc(mode()); if (m_current_cs_ul != new_cs_ul) { - LOGP(DRLCMACDL, LOGL_INFO, + LOGP(DRLCMACMEAS, LOGL_INFO, "MS (IMSI %s): " "Link quality %ddB (%ddB) left window [%d, %d], " "modifying uplink CS level: %s -> %s\n", diff --git a/src/pcu_main.cpp b/src/pcu_main.cpp index 8e7cde8..e909b75 100644 --- a/src/pcu_main.cpp +++ b/src/pcu_main.cpp @@ -200,6 +200,28 @@ bts->cs_lqual_ranges[2].high = 13; bts->cs_lqual_ranges[3].low = 12; bts->cs_lqual_ranges[3].high = 256; + + /* MCS-1 to MCS-9 */ + /* Default thresholds are referenced from literature */ + /* Fig. 2.3, Chapter 2, Optimizing Wireless Communication Systems, Springer (2009) */ + bts->mcs_lqual_ranges[0].low = -256; + bts->mcs_lqual_ranges[0].high = 6; + bts->mcs_lqual_ranges[1].low = 5; + bts->mcs_lqual_ranges[1].high = 8; + bts->mcs_lqual_ranges[2].low = 7; + bts->mcs_lqual_ranges[2].high = 13; + bts->mcs_lqual_ranges[3].low = 12; + bts->mcs_lqual_ranges[3].high = 15; + bts->mcs_lqual_ranges[4].low = 14; + bts->mcs_lqual_ranges[4].high = 17; + bts->mcs_lqual_ranges[5].low = 16; + bts->mcs_lqual_ranges[5].high = 18; + bts->mcs_lqual_ranges[6].low = 17; + bts->mcs_lqual_ranges[6].high = 20; + bts->mcs_lqual_ranges[7].low = 19; + bts->mcs_lqual_ranges[7].high = 24; + bts->mcs_lqual_ranges[8].low = 23; + bts->mcs_lqual_ranges[8].high = 256; bts->cs_downgrade_threshold = 200; /* TODO: increase them when CRBB decoding is implemented */ diff --git a/src/pcu_vty.c b/src/pcu_vty.c index 68d2f55..5ec16ea 100644 --- a/src/pcu_vty.c +++ b/src/pcu_vty.c @@ -178,6 +178,25 @@ bts->cs_lqual_ranges[3].low, VTY_NEWLINE); + vty_out(vty, " mcs link-quality-ranges mcs1 %d mcs2 %d %d mcs3 %d %d mcs4 %d %d mcs5 %d %d mcs6 %d %d mcs7 %d %d mcs8 %d %d mcs9 %d%s", + bts->mcs_lqual_ranges[0].high, + bts->mcs_lqual_ranges[1].low, + bts->mcs_lqual_ranges[1].high, + bts->mcs_lqual_ranges[2].low, + bts->mcs_lqual_ranges[2].high, + bts->mcs_lqual_ranges[3].low, + bts->mcs_lqual_ranges[3].high, + bts->mcs_lqual_ranges[4].low, + bts->mcs_lqual_ranges[4].high, + bts->mcs_lqual_ranges[5].low, + bts->mcs_lqual_ranges[5].high, + bts->mcs_lqual_ranges[6].low, + bts->mcs_lqual_ranges[6].high, + bts->mcs_lqual_ranges[7].low, + bts->mcs_lqual_ranges[7].high, + bts->mcs_lqual_ranges[8].low, + VTY_NEWLINE); + if (bts->initial_mcs_dl != 1 && bts->initial_mcs_ul != 1) { if (bts->initial_mcs_ul == bts->initial_mcs_dl) vty_out(vty, " mcs %d%s", bts->initial_mcs_dl, @@ -186,6 +205,7 @@ vty_out(vty, " mcs %d %d%s", bts->initial_mcs_dl, bts->initial_mcs_ul, VTY_NEWLINE); } + if (bts->max_mcs_dl && bts->max_mcs_ul) { if (bts->max_mcs_ul == bts->max_mcs_dl) vty_out(vty, " mcs max %d%s", bts->max_mcs_dl, @@ -969,6 +989,58 @@ return CMD_SUCCESS; } +DEFUN(cfg_pcu_mcs_lqual_ranges, + cfg_pcu_mcs_lqual_ranges_cmd, + "mcs link-quality-ranges mcs1 <0-35> mcs2 <0-35> <0-35> mcs3 <0-35> <0-35> mcs4 <0-35> <0-35> mcs5 <0-35> <0-35> mcs6 <0-35> <0-35> mcs7 <0-35> <0-35> mcs8 <0-35> <0-35> mcs9 <0-35>", + CS_STR "Set link quality ranges\n" + "Set quality range for MCS-1 (high value only)\n" + "MCS-1 high (dB)\n" + "Set quality range for MCS-2\n" + "MCS-2 high (dB)\n" + "MCS-2 low (dB)\n" + "Set quality range for MCS-3\n" + "MCS-3 high (dB)\n" + "MCS-3 low (dB)\n" + "Set quality range for MCS-4\n" + "MCS-4 high (dB)\n" + "MCS-4 low (dB)\n" + "Set quality range for MCS-5\n" + "MCS-5 high (dB)\n" + "MCS-5 low (dB)\n" + "Set quality range for MCS-6\n" + "MCS-6 low (dB)\n" + "MCS-6 high (dB)\n" + "Set quality range for MCS-7\n" + "MCS-7 low (dB)\n" + "MCS-7 high (dB)\n" + "Set quality range for MCS-8\n" + "MCS-8 low (dB)\n" + "MCS-8 high (dB)\n" + "Set quality range for MCS-9 (low value only)\n" + "MCS-9 low (dB)\n") +{ + struct gprs_rlcmac_bts *bts = bts_main_data(); + + bts->mcs_lqual_ranges[0].high = atoi(argv[0]); + bts->mcs_lqual_ranges[1].low = atoi(argv[1]); + bts->mcs_lqual_ranges[1].high = atoi(argv[2]); + bts->mcs_lqual_ranges[2].low = atoi(argv[3]); + bts->mcs_lqual_ranges[2].high = atoi(argv[4]); + bts->mcs_lqual_ranges[3].low = atoi(argv[5]); + bts->mcs_lqual_ranges[3].high = atoi(argv[6]); + bts->mcs_lqual_ranges[4].low = atoi(argv[7]); + bts->mcs_lqual_ranges[4].high = atoi(argv[8]); + bts->mcs_lqual_ranges[5].low = atoi(argv[9]); + bts->mcs_lqual_ranges[5].high = atoi(argv[10]); + bts->mcs_lqual_ranges[6].low = atoi(argv[11]); + bts->mcs_lqual_ranges[6].high = atoi(argv[12]); + bts->mcs_lqual_ranges[7].low = atoi(argv[13]); + bts->mcs_lqual_ranges[7].high = atoi(argv[14]); + bts->mcs_lqual_ranges[8].low = atoi(argv[15]); + + return CMD_SUCCESS; +} + DEFUN(cfg_pcu_sock, cfg_pcu_sock_cmd, "pcu-socket PATH", @@ -1079,6 +1151,7 @@ install_element(PCU_NODE, &cfg_pcu_cs_downgrade_thrsh_cmd); install_element(PCU_NODE, &cfg_pcu_no_cs_downgrade_thrsh_cmd); install_element(PCU_NODE, &cfg_pcu_cs_lqual_ranges_cmd); + install_element(PCU_NODE, &cfg_pcu_mcs_lqual_ranges_cmd); install_element(PCU_NODE, &cfg_pcu_mcs_cmd); install_element(PCU_NODE, &cfg_pcu_dl_arq_cmd); install_element(PCU_NODE, &cfg_pcu_no_mcs_cmd); -- To view, visit https://gerrit.osmocom.org/3538 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I9272c337ad6399da4a47cc6e2736e25f24e099d8 Gerrit-PatchSet: 3 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Minh-Quang Nguyen Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Minh-Quang Nguyen From gerrit-no-reply at lists.osmocom.org Fri Aug 18 19:19:17 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Fri, 18 Aug 2017 19:19:17 +0000 Subject: [MERGED] osmo-gsm-tester[master]: esme: Remove temporary workaround for non-implemented delive... In-Reply-To: References: Message-ID: Pau Espin Pedrol has submitted this change and it was merged. Change subject: esme: Remove temporary workaround for non-implemented deliver_sm ...................................................................... esme: Remove temporary workaround for non-implemented deliver_sm Openbsc has SMS Delivery Reports since recently, which means we are now receiving deliver_sm messages and this workaround introduced in commit db0d8ab4fcfac67e76729241d92ca128d4526240 is not required anymore. Closes OS-#2353. Change-Id: Iecf3983bfc24fec8023ba5d589c2d7620ec5d921 --- M src/osmo_gsm_tester/esme.py 1 file changed, 1 insertion(+), 3 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/osmo_gsm_tester/esme.py b/src/osmo_gsm_tester/esme.py index 9dbc5a3..63a1ded 100644 --- a/src/osmo_gsm_tester/esme.py +++ b/src/osmo_gsm_tester/esme.py @@ -126,9 +126,7 @@ self.references_pending_receipt.remove(umref) def receipt_was_received(self, umref): - # return umref not in self.references_pending_receipt - self.log('FIXME: wait_receipt disabled because receipts are not received, see OsmoNITB #2353') - return True + return umref not in self.references_pending_receipt def run_method_expect_failure(self, errcode, method, *args): try: -- To view, visit https://gerrit.osmocom.org/3557 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Iecf3983bfc24fec8023ba5d589c2d7620ec5d921 Gerrit-PatchSet: 2 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Fri Aug 18 21:36:34 2017 From: gerrit-no-reply at lists.osmocom.org (lynxis lazus) Date: Fri, 18 Aug 2017 21:36:34 +0000 Subject: [PATCH] osmo-ci[master]: osmocom-nightly-nitb-split.yml: schedule the job to be run a... Message-ID: Review at https://gerrit.osmocom.org/3558 osmocom-nightly-nitb-split.yml: schedule the job to be run at midnight Change-Id: I0d80e7d260f9092f44d4d80471a4dd67b7acc839 --- M scripts/osmocom-nightly-nitb-split.yml 1 file changed, 3 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ci refs/changes/58/3558/1 diff --git a/scripts/osmocom-nightly-nitb-split.yml b/scripts/osmocom-nightly-nitb-split.yml index 6c264fd..7dbf46f 100644 --- a/scripts/osmocom-nightly-nitb-split.yml +++ b/scripts/osmocom-nightly-nitb-split.yml @@ -17,4 +17,6 @@ - git: url: git://git.osmocom.org/osmo-ci git-config-name: 'Jenkins Builder' - git-config-email: 'jenkins at osmocom.org + git-config-email: 'jenkins at osmocom.org' + triggers: + - timed: "@midnight" -- To view, visit https://gerrit.osmocom.org/3558 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I0d80e7d260f9092f44d4d80471a4dd67b7acc839 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Owner: lynxis lazus From gerrit-no-reply at lists.osmocom.org Fri Aug 18 21:36:35 2017 From: gerrit-no-reply at lists.osmocom.org (lynxis lazus) Date: Fri, 18 Aug 2017 21:36:35 +0000 Subject: [PATCH] osmo-ci[master]: scripts: add requirements.txt to list jenkins-job-builder Message-ID: Review at https://gerrit.osmocom.org/3559 scripts: add requirements.txt to list jenkins-job-builder Change-Id: If25ce84593bbf6a393928a8f4e1670f320c48ca4 --- A scripts/requirements.txt 1 file changed, 1 insertion(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ci refs/changes/59/3559/1 diff --git a/scripts/requirements.txt b/scripts/requirements.txt new file mode 100644 index 0000000..6b700dc --- /dev/null +++ b/scripts/requirements.txt @@ -0,0 +1 @@ +jenkins-job-builder -- To view, visit https://gerrit.osmocom.org/3559 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: If25ce84593bbf6a393928a8f4e1670f320c48ca4 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Owner: lynxis lazus From gerrit-no-reply at lists.osmocom.org Fri Aug 18 22:26:07 2017 From: gerrit-no-reply at lists.osmocom.org (Alexander Chemeris) Date: Fri, 18 Aug 2017 22:26:07 +0000 Subject: osmo-trx[master]: Add -j option to bind to specific address In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/3539 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I9ba184a1251c823e413a9230943ed263e52142ec Gerrit-PatchSet: 1 Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Alexander Chemeris Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Aug 18 23:06:50 2017 From: gerrit-no-reply at lists.osmocom.org (Alexander Chemeris) Date: Fri, 18 Aug 2017 23:06:50 +0000 Subject: [PATCH] osmo-bts[master]: osmo-bts-trx: Fix MS power control loop. Message-ID: Review at https://gerrit.osmocom.org/3560 osmo-bts-trx: Fix MS power control loop. The following two commits from 2014-12-06 introduced a new variable to control MS power - ms_power_ctrl, but kept the old ms_power variable in place. They have also changed the meaning of the ms_power variable - it now keeps original RSL configured value. So when much later osmo-trx-bts code was merged to master the code was compiling fine and this change in the meaning was overlooked. In osmo-bts: 579651bf300de002731dfd3bd39985c9fd15616c power/sysmobts: Add a manual ms power level control In OpenBSC: f6f86b0eec18da165db136b14bf2db87fde4b4ac osmo-bts: Introduce new struct for a power loop in the BTS code Change-Id: I713e39b882db32a0d17aa04790d16fa79afa1fb1 --- M src/osmo-bts-trx/l1_if.c M src/osmo-bts-trx/loops.c 2 files changed, 12 insertions(+), 12 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/60/3560/1 diff --git a/src/osmo-bts-trx/l1_if.c b/src/osmo-bts-trx/l1_if.c index f69e587..c629a61 100644 --- a/src/osmo-bts-trx/l1_if.c +++ b/src/osmo-bts-trx/l1_if.c @@ -509,7 +509,7 @@ LOGP(DMEAS, LOGL_DEBUG, "RX L1 frame %s fn=%u chan_nr=0x%02x MS pwr=%ddBm rssi=%.1f dBFS " "ber=%.2f%% (%d/%d bits) L1_ta=%d rqd_ta=%d toa=%.2f\n", - gsm_lchan_name(lchan), fn, chan_nr, ms_pwr_dbm(lchan->ts->trx->bts->band, lchan->ms_power), + gsm_lchan_name(lchan), fn, chan_nr, ms_pwr_dbm(lchan->ts->trx->bts->band, lchan->ms_power_ctrl.current), rssi, ber*100, n_errors, n_bits_total, lchan->meas.l1_info[1], lchan->rqd_ta, toa); l1if_fill_meas_res(&l1sap, chan_nr, lchan->rqd_ta + toa, ber, rssi, fn); diff --git a/src/osmo-bts-trx/loops.c b/src/osmo-bts-trx/loops.c index 8070e80..8d6e5d7 100644 --- a/src/osmo-bts-trx/loops.c +++ b/src/osmo-bts-trx/loops.c @@ -48,7 +48,7 @@ uint16_t arfcn = trx->arfcn; int8_t new_power; - new_power = lchan->ms_power - (diff >> 1); + new_power = lchan->ms_power_ctrl.current - (diff >> 1); if (diff == 0) return 0; @@ -66,12 +66,12 @@ } /* a higher value means a lower level (and vice versa) */ - if (new_power > lchan->ms_power + MS_LOWER_MAX) - new_power = lchan->ms_power + MS_LOWER_MAX; - else if (new_power < lchan->ms_power - MS_RAISE_MAX) - new_power = lchan->ms_power - MS_RAISE_MAX; + if (new_power > lchan->ms_power_ctrl.current + MS_LOWER_MAX) + new_power = lchan->ms_power_ctrl.current + MS_LOWER_MAX; + else if (new_power < lchan->ms_power_ctrl.current - MS_RAISE_MAX) + new_power = lchan->ms_power_ctrl.current - MS_RAISE_MAX; - if (lchan->ms_power == new_power) { + if (lchan->ms_power_ctrl.current == new_power) { LOGP(DLOOP, LOGL_INFO, "Keeping MS new_power of trx=%u " "chan_nr=0x%02x at control level %d (%d dBm)\n", trx->nr, chan_nr, new_power, @@ -83,11 +83,11 @@ LOGP(DLOOP, LOGL_INFO, "%s MS new_power of trx=%u chan_nr=0x%02x from " "control level %d (%d dBm) to %d (%d dBm)\n", (diff > 0) ? "Raising" : "Lowering", - trx->nr, chan_nr, lchan->ms_power, - MS_PWR_DBM(arfcn, lchan->ms_power), new_power, + trx->nr, chan_nr, lchan->ms_power_ctrl.current, + MS_PWR_DBM(arfcn, lchan->ms_power_ctrl.current), new_power, MS_PWR_DBM(arfcn, new_power)); - lchan->ms_power = new_power; + lchan->ms_power_ctrl.current = new_power; return 0; } @@ -159,8 +159,8 @@ /* change RSSI */ LOGP(DLOOP, LOGL_DEBUG, "Lowest RSSI: %d Target RSSI: %d Current " "MS power: %d (%d dBm) of trx=%u chan_nr=0x%02x\n", rssi, - trx_target_rssi, lchan->ms_power, - MS_PWR_DBM(trx->arfcn, lchan->ms_power), + trx_target_rssi, lchan->ms_power_ctrl.current, + MS_PWR_DBM(trx->arfcn, lchan->ms_power_ctrl.current), trx->nr, chan_nr); ms_power_diff(lchan, chan_nr, trx_target_rssi - rssi); -- To view, visit https://gerrit.osmocom.org/3560 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I713e39b882db32a0d17aa04790d16fa79afa1fb1 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Alexander Chemeris From gerrit-no-reply at lists.osmocom.org Fri Aug 18 23:10:01 2017 From: gerrit-no-reply at lists.osmocom.org (Alexander Chemeris) Date: Fri, 18 Aug 2017 23:10:01 +0000 Subject: [PATCH] osmo-bts[master]: osmo-bts-trx: Remove an unused variable. Resolves a compiler... Message-ID: Review at https://gerrit.osmocom.org/3561 osmo-bts-trx: Remove an unused variable. Resolves a compiler warning. Change-Id: I2464e872f81021cbc3ccbc4e2e32c394d6afcf70 --- M src/osmo-bts-trx/loops.c 1 file changed, 0 insertions(+), 4 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/61/3561/1 diff --git a/src/osmo-bts-trx/loops.c b/src/osmo-bts-trx/loops.c index 8070e80..5710049 100644 --- a/src/osmo-bts-trx/loops.c +++ b/src/osmo-bts-trx/loops.c @@ -251,7 +251,6 @@ struct gsm_bts_trx *trx = l1t->trx; struct gsm_lchan *lchan = &trx->ts[L1SAP_CHAN2TS(chan_nr)] .lchan[l1sap_chan2ss(chan_nr)]; - int c_i; /* check if loop is enabled */ if (!chan_state->amr_loop) @@ -276,9 +275,6 @@ /* calculate average (reuse ber variable) */ ber = chan_state->ber_sum / chan_state->ber_num; - - /* FIXME: calculate C/I from BER */ - c_i = ber * 100; /* reset bit errors */ chan_state->ber_num = 0; -- To view, visit https://gerrit.osmocom.org/3561 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I2464e872f81021cbc3ccbc4e2e32c394d6afcf70 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Alexander Chemeris From gerrit-no-reply at lists.osmocom.org Fri Aug 18 23:17:53 2017 From: gerrit-no-reply at lists.osmocom.org (Alexander Chemeris) Date: Fri, 18 Aug 2017 23:17:53 +0000 Subject: [PATCH] osmo-bts[master]: osmo-bts-trx: Increase a maximum allowed MS power reduction ... Message-ID: Review at https://gerrit.osmocom.org/3562 osmo-bts-trx: Increase a maximum allowed MS power reduction step from 2dB to 4dB. We tend to start MS with high power to make sure distant phones get good QoS, but this also means that we need to reduce their power rather quickly. OTOH we can't make this step too high because this may lead to power output oscilation. From my (manual, limited) testing 2dB look like a reasonable compromise. Change-Id: I58785513e5739474b881ed7f2a312ecc690e7e60 --- M src/osmo-bts-trx/loops.h 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/62/3562/1 diff --git a/src/osmo-bts-trx/loops.h b/src/osmo-bts-trx/loops.h index 613d2d0..c0458c5 100644 --- a/src/osmo-bts-trx/loops.h +++ b/src/osmo-bts-trx/loops.h @@ -7,7 +7,7 @@ /* how much power levels do we raise/lower as maximum (1 level = 2 dB) */ #define MS_RAISE_MAX 4 -#define MS_LOWER_MAX 1 +#define MS_LOWER_MAX 2 /* * loops api -- To view, visit https://gerrit.osmocom.org/3562 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I58785513e5739474b881ed7f2a312ecc690e7e60 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Alexander Chemeris From gerrit-no-reply at lists.osmocom.org Sat Aug 19 08:23:49 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 19 Aug 2017 08:23:49 +0000 Subject: osmo-bts[master]: osmo-bts-trx: Increase a maximum allowed MS power reduction ... In-Reply-To: References: Message-ID: Patch Set 1: (1 comment) https://gerrit.osmocom.org/#/c/3562/1//COMMIT_MSG Commit Message: Line 12: oscilation. From my (manual, limited) testing 2dB look like a reasonable you mention 2dB here, but your change seems to change it from 2 to 4dB ? -- To view, visit https://gerrit.osmocom.org/3562 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I58785513e5739474b881ed7f2a312ecc690e7e60 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Alexander Chemeris Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Sat Aug 19 08:24:18 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 19 Aug 2017 08:24:18 +0000 Subject: osmo-bts[master]: osmo-bts-trx: Remove an unused variable. Resolves a compiler... In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3561 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I2464e872f81021cbc3ccbc4e2e32c394d6afcf70 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Alexander Chemeris Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sat Aug 19 08:25:26 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 19 Aug 2017 08:25:26 +0000 Subject: osmo-bts[master]: osmo-bts-trx: Fix MS power control loop. In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3560 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I713e39b882db32a0d17aa04790d16fa79afa1fb1 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Alexander Chemeris Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sat Aug 19 08:26:15 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 19 Aug 2017 08:26:15 +0000 Subject: osmo-bts[master]: osmo-bts-trx: Fix MS power control loop. In-Reply-To: References: Message-ID: Patch Set 1: Please also see http://osmocom.org/issues/1851 and http://osmocom.org/issues/1622 in this context -- To view, visit https://gerrit.osmocom.org/3560 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I713e39b882db32a0d17aa04790d16fa79afa1fb1 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Alexander Chemeris Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From admin at opensuse.org Sat Aug 19 19:54:18 2017 From: admin at opensuse.org (OBS Notification) Date: Sat, 19 Aug 2017 19:54:18 +0000 Subject: Build failure of network:osmocom:nightly/libosmocore in xUbuntu_16.10/x86_64 In-Reply-To: References: Message-ID: <599897858b14b_72a4790f7c520985@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/libosmocore/xUbuntu_16.10/x86_64 Package network:osmocom:nightly/libosmocore failed to build in xUbuntu_16.10/x86_64 Check out the package for editing: osc checkout network:osmocom:nightly libosmocore Last lines of build log: [ 222s] | [ 222s] | This file was extended by libosmocore config.status 0.9.6.20170819, which was [ 222s] | generated by GNU Autoconf 2.69. Invocation command line was [ 222s] | [ 222s] | CONFIG_FILES = [ 222s] | CONFIG_HEADERS = [ 222s] | CONFIG_LINKS = [ 222s] | CONFIG_COMMANDS = [ 222s] | $ ./config.status Doxyfile.core [ 222s] | [ 222s] | on cumulus3 [ 222s] | [ 222s] | config.status:1172: creating Doxyfile.core [ 222s] [ 222s] debian/rules:26: recipe for target 'override_dh_auto_test' failed [ 222s] make[1]: *** [override_dh_auto_test] Error 1 [ 222s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 222s] debian/rules:15: recipe for target 'build' failed [ 222s] make: *** [build] Error 2 [ 222s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 222s] [ 222s] cumulus3 failed "build libosmocore_0.9.6.20170819.dsc" at Sat Aug 19 19:54:10 UTC 2017. [ 222s] [ 222s] ### VM INTERACTION START ### [ 224s] [ 213.866756] reboot: Power down [ 224s] ### VM INTERACTION END ### [ 224s] [ 224s] cumulus3 failed "build libosmocore_0.9.6.20170819.dsc" at Sat Aug 19 19:54:13 UTC 2017. [ 224s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Sat Aug 19 19:54:18 2017 From: admin at opensuse.org (OBS Notification) Date: Sat, 19 Aug 2017 19:54:18 +0000 Subject: Build failure of network:osmocom:nightly/libosmocore in xUbuntu_16.10/x86_64 In-Reply-To: References: Message-ID: <59989785f203d_72a4790f7c521054@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/libosmocore/xUbuntu_16.10/x86_64 Package network:osmocom:nightly/libosmocore failed to build in xUbuntu_16.10/x86_64 Check out the package for editing: osc checkout network:osmocom:nightly libosmocore Last lines of build log: [ 222s] | [ 222s] | This file was extended by libosmocore config.status 0.9.6.20170819, which was [ 222s] | generated by GNU Autoconf 2.69. Invocation command line was [ 222s] | [ 222s] | CONFIG_FILES = [ 222s] | CONFIG_HEADERS = [ 222s] | CONFIG_LINKS = [ 222s] | CONFIG_COMMANDS = [ 222s] | $ ./config.status Doxyfile.core [ 222s] | [ 222s] | on cumulus3 [ 222s] | [ 222s] | config.status:1172: creating Doxyfile.core [ 222s] [ 222s] debian/rules:26: recipe for target 'override_dh_auto_test' failed [ 222s] make[1]: *** [override_dh_auto_test] Error 1 [ 222s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 222s] debian/rules:15: recipe for target 'build' failed [ 222s] make: *** [build] Error 2 [ 222s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 222s] [ 222s] cumulus3 failed "build libosmocore_0.9.6.20170819.dsc" at Sat Aug 19 19:54:10 UTC 2017. [ 222s] [ 222s] ### VM INTERACTION START ### [ 224s] [ 213.866756] reboot: Power down [ 224s] ### VM INTERACTION END ### [ 224s] [ 224s] cumulus3 failed "build libosmocore_0.9.6.20170819.dsc" at Sat Aug 19 19:54:13 UTC 2017. [ 224s] -- 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 Aug 19 22:35:11 2017 From: gerrit-no-reply at lists.osmocom.org (Alexander Chemeris) Date: Sat, 19 Aug 2017 22:35:11 +0000 Subject: [MERGED] osmo-bts[master]: osmo-bts-trx: Fix MS power control loop. In-Reply-To: References: Message-ID: Alexander Chemeris has submitted this change and it was merged. Change subject: osmo-bts-trx: Fix MS power control loop. ...................................................................... osmo-bts-trx: Fix MS power control loop. The following two commits from 2014-12-06 introduced a new variable to control MS power - ms_power_ctrl, but kept the old ms_power variable in place. They have also changed the meaning of the ms_power variable - it now keeps original RSL configured value. So when much later osmo-trx-bts code was merged to master the code was compiling fine and this change in the meaning was overlooked. In osmo-bts: 579651bf300de002731dfd3bd39985c9fd15616c power/sysmobts: Add a manual ms power level control In OpenBSC: f6f86b0eec18da165db136b14bf2db87fde4b4ac osmo-bts: Introduce new struct for a power loop in the BTS code Change-Id: I713e39b882db32a0d17aa04790d16fa79afa1fb1 --- M src/osmo-bts-trx/l1_if.c M src/osmo-bts-trx/loops.c 2 files changed, 12 insertions(+), 12 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/osmo-bts-trx/l1_if.c b/src/osmo-bts-trx/l1_if.c index f69e587..c629a61 100644 --- a/src/osmo-bts-trx/l1_if.c +++ b/src/osmo-bts-trx/l1_if.c @@ -509,7 +509,7 @@ LOGP(DMEAS, LOGL_DEBUG, "RX L1 frame %s fn=%u chan_nr=0x%02x MS pwr=%ddBm rssi=%.1f dBFS " "ber=%.2f%% (%d/%d bits) L1_ta=%d rqd_ta=%d toa=%.2f\n", - gsm_lchan_name(lchan), fn, chan_nr, ms_pwr_dbm(lchan->ts->trx->bts->band, lchan->ms_power), + gsm_lchan_name(lchan), fn, chan_nr, ms_pwr_dbm(lchan->ts->trx->bts->band, lchan->ms_power_ctrl.current), rssi, ber*100, n_errors, n_bits_total, lchan->meas.l1_info[1], lchan->rqd_ta, toa); l1if_fill_meas_res(&l1sap, chan_nr, lchan->rqd_ta + toa, ber, rssi, fn); diff --git a/src/osmo-bts-trx/loops.c b/src/osmo-bts-trx/loops.c index 8070e80..8d6e5d7 100644 --- a/src/osmo-bts-trx/loops.c +++ b/src/osmo-bts-trx/loops.c @@ -48,7 +48,7 @@ uint16_t arfcn = trx->arfcn; int8_t new_power; - new_power = lchan->ms_power - (diff >> 1); + new_power = lchan->ms_power_ctrl.current - (diff >> 1); if (diff == 0) return 0; @@ -66,12 +66,12 @@ } /* a higher value means a lower level (and vice versa) */ - if (new_power > lchan->ms_power + MS_LOWER_MAX) - new_power = lchan->ms_power + MS_LOWER_MAX; - else if (new_power < lchan->ms_power - MS_RAISE_MAX) - new_power = lchan->ms_power - MS_RAISE_MAX; + if (new_power > lchan->ms_power_ctrl.current + MS_LOWER_MAX) + new_power = lchan->ms_power_ctrl.current + MS_LOWER_MAX; + else if (new_power < lchan->ms_power_ctrl.current - MS_RAISE_MAX) + new_power = lchan->ms_power_ctrl.current - MS_RAISE_MAX; - if (lchan->ms_power == new_power) { + if (lchan->ms_power_ctrl.current == new_power) { LOGP(DLOOP, LOGL_INFO, "Keeping MS new_power of trx=%u " "chan_nr=0x%02x at control level %d (%d dBm)\n", trx->nr, chan_nr, new_power, @@ -83,11 +83,11 @@ LOGP(DLOOP, LOGL_INFO, "%s MS new_power of trx=%u chan_nr=0x%02x from " "control level %d (%d dBm) to %d (%d dBm)\n", (diff > 0) ? "Raising" : "Lowering", - trx->nr, chan_nr, lchan->ms_power, - MS_PWR_DBM(arfcn, lchan->ms_power), new_power, + trx->nr, chan_nr, lchan->ms_power_ctrl.current, + MS_PWR_DBM(arfcn, lchan->ms_power_ctrl.current), new_power, MS_PWR_DBM(arfcn, new_power)); - lchan->ms_power = new_power; + lchan->ms_power_ctrl.current = new_power; return 0; } @@ -159,8 +159,8 @@ /* change RSSI */ LOGP(DLOOP, LOGL_DEBUG, "Lowest RSSI: %d Target RSSI: %d Current " "MS power: %d (%d dBm) of trx=%u chan_nr=0x%02x\n", rssi, - trx_target_rssi, lchan->ms_power, - MS_PWR_DBM(trx->arfcn, lchan->ms_power), + trx_target_rssi, lchan->ms_power_ctrl.current, + MS_PWR_DBM(trx->arfcn, lchan->ms_power_ctrl.current), trx->nr, chan_nr); ms_power_diff(lchan, chan_nr, trx_target_rssi - rssi); -- To view, visit https://gerrit.osmocom.org/3560 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I713e39b882db32a0d17aa04790d16fa79afa1fb1 Gerrit-PatchSet: 2 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Alexander Chemeris Gerrit-Reviewer: Alexander Chemeris Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sat Aug 19 22:38:04 2017 From: gerrit-no-reply at lists.osmocom.org (Alexander Chemeris) Date: Sat, 19 Aug 2017 22:38:04 +0000 Subject: osmo-bts[master]: osmo-bts-trx: Fix MS power control loop. In-Reply-To: References: Message-ID: Patch Set 2: > Please also see http://osmocom.org/issues/1851 and > http://osmocom.org/issues/1622 in this context Thanks for pointing! I didn't realize we don't even follow the standard.. -- To view, visit https://gerrit.osmocom.org/3560 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I713e39b882db32a0d17aa04790d16fa79afa1fb1 Gerrit-PatchSet: 2 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Alexander Chemeris Gerrit-Reviewer: Alexander Chemeris Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sat Aug 19 22:38:20 2017 From: gerrit-no-reply at lists.osmocom.org (Alexander Chemeris) Date: Sat, 19 Aug 2017 22:38:20 +0000 Subject: [MERGED] osmo-bts[master]: osmo-bts-trx: Remove an unused variable. Resolves a compiler... In-Reply-To: References: Message-ID: Alexander Chemeris has submitted this change and it was merged. Change subject: osmo-bts-trx: Remove an unused variable. Resolves a compiler warning. ...................................................................... osmo-bts-trx: Remove an unused variable. Resolves a compiler warning. Change-Id: I2464e872f81021cbc3ccbc4e2e32c394d6afcf70 --- M src/osmo-bts-trx/loops.c 1 file changed, 0 insertions(+), 4 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/osmo-bts-trx/loops.c b/src/osmo-bts-trx/loops.c index 8d6e5d7..3da805c 100644 --- a/src/osmo-bts-trx/loops.c +++ b/src/osmo-bts-trx/loops.c @@ -251,7 +251,6 @@ struct gsm_bts_trx *trx = l1t->trx; struct gsm_lchan *lchan = &trx->ts[L1SAP_CHAN2TS(chan_nr)] .lchan[l1sap_chan2ss(chan_nr)]; - int c_i; /* check if loop is enabled */ if (!chan_state->amr_loop) @@ -276,9 +275,6 @@ /* calculate average (reuse ber variable) */ ber = chan_state->ber_sum / chan_state->ber_num; - - /* FIXME: calculate C/I from BER */ - c_i = ber * 100; /* reset bit errors */ chan_state->ber_num = 0; -- To view, visit https://gerrit.osmocom.org/3561 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I2464e872f81021cbc3ccbc4e2e32c394d6afcf70 Gerrit-PatchSet: 2 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Alexander Chemeris Gerrit-Reviewer: Alexander Chemeris Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sat Aug 19 22:42:49 2017 From: gerrit-no-reply at lists.osmocom.org (Alexander Chemeris) Date: Sat, 19 Aug 2017 22:42:49 +0000 Subject: [PATCH] osmo-bts[master]: osmo-bts-trx: Increase a maximum allowed MS power reduction ... In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3562 to look at the new patch set (#2). osmo-bts-trx: Increase a maximum allowed MS power reduction step from 2dB to 4dB. We tend to start MS with high power to make sure distant phones get good QoS, but this also means that we need to reduce their power rather quickly. OTOH we can't make this step too high because this may lead to power output oscillation. From my (manual, limited) testing 4dB look like a reasonable compromise. Change-Id: I58785513e5739474b881ed7f2a312ecc690e7e60 --- M src/osmo-bts-trx/loops.h 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/62/3562/2 diff --git a/src/osmo-bts-trx/loops.h b/src/osmo-bts-trx/loops.h index 613d2d0..c0458c5 100644 --- a/src/osmo-bts-trx/loops.h +++ b/src/osmo-bts-trx/loops.h @@ -7,7 +7,7 @@ /* how much power levels do we raise/lower as maximum (1 level = 2 dB) */ #define MS_RAISE_MAX 4 -#define MS_LOWER_MAX 1 +#define MS_LOWER_MAX 2 /* * loops api -- To view, visit https://gerrit.osmocom.org/3562 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I58785513e5739474b881ed7f2a312ecc690e7e60 Gerrit-PatchSet: 2 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Alexander Chemeris Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sat Aug 19 22:43:20 2017 From: gerrit-no-reply at lists.osmocom.org (Alexander Chemeris) Date: Sat, 19 Aug 2017 22:43:20 +0000 Subject: [PATCH] osmo-bts[master]: osmo-bts-trx: Increase a maximum allowed MS power reduction ... In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3562 to look at the new patch set (#3). osmo-bts-trx: Increase a maximum allowed MS power reduction step from 2dB to 4dB. We tend to start MS with high power to make sure distant phones get good QoS, but this also means that we need to reduce their power rather quickly. OTOH we can't make this step too high because this may lead to power output oscillation. From my (manual, limited) testing 4dB looks like a reasonable compromise. Change-Id: I58785513e5739474b881ed7f2a312ecc690e7e60 --- M src/osmo-bts-trx/loops.h 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/62/3562/3 diff --git a/src/osmo-bts-trx/loops.h b/src/osmo-bts-trx/loops.h index 613d2d0..c0458c5 100644 --- a/src/osmo-bts-trx/loops.h +++ b/src/osmo-bts-trx/loops.h @@ -7,7 +7,7 @@ /* how much power levels do we raise/lower as maximum (1 level = 2 dB) */ #define MS_RAISE_MAX 4 -#define MS_LOWER_MAX 1 +#define MS_LOWER_MAX 2 /* * loops api -- To view, visit https://gerrit.osmocom.org/3562 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I58785513e5739474b881ed7f2a312ecc690e7e60 Gerrit-PatchSet: 3 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Alexander Chemeris Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sat Aug 19 22:44:39 2017 From: gerrit-no-reply at lists.osmocom.org (Alexander Chemeris) Date: Sat, 19 Aug 2017 22:44:39 +0000 Subject: osmo-bts[master]: osmo-bts-trx: Increase a maximum allowed MS power reduction ... In-Reply-To: References: Message-ID: Patch Set 3: > you mention 2dB here, but your change seems to change it from 2 to 4dB ? Thank you! That's clearly a typo. Fixed in the new patch. -- To view, visit https://gerrit.osmocom.org/3562 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I58785513e5739474b881ed7f2a312ecc690e7e60 Gerrit-PatchSet: 3 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Alexander Chemeris Gerrit-Reviewer: Alexander Chemeris Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sun Aug 20 18:57:49 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 20 Aug 2017 18:57:49 +0000 Subject: [PATCH] libosmo-sccp[master]: OsmoSTP: Install our default set of signal handlers Message-ID: Review at https://gerrit.osmocom.org/3563 OsmoSTP: Install our default set of signal handlers Change-Id: Id5e37dc35923fd689e2cecd9923154774efd7f51 --- M stp/stp_main.c 1 file changed, 41 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-sccp refs/changes/63/3563/1 diff --git a/stp/stp_main.c b/stp/stp_main.c index ac8e6dd..8e3282c 100644 --- a/stp/stp_main.c +++ b/stp/stp_main.c @@ -23,8 +23,11 @@ #include #include #include +#include #include +#include +#include #include #include #include @@ -41,6 +44,8 @@ #include #include #include + +static void *tall_stp_ctx; /* we only use logging sub-systems of the various libraries so far */ static const struct log_info_cat log_info_cat[] = { @@ -122,9 +127,37 @@ } } +static void signal_handler(int signal) +{ + fprintf(stdout, "signal %u received\n", signal); + + switch (signal) { + case SIGINT: + case SIGTERM: + osmo_signal_dispatch(SS_L_GLOBAL, S_L_GLOBAL_SHUTDOWN, NULL); + sleep(1); + break; + case SIGABRT: + osmo_generate_backtrace(); + /* in case of abort, we want to obtain a talloc report + * and then return to the caller, who will abort the process */ + case SIGUSR1: + talloc_report(tall_vty_ctx, stderr); + talloc_report_full(tall_stp_ctx, stderr); + break; + case SIGUSR2: + talloc_report_full(tall_vty_ctx, stderr); + break; + default: + break; + } +} + int main(int argc, char **argv) { int rc; + + tall_stp_ctx = talloc_named_const(NULL, 1, "osmo-stp"); osmo_init_logging(&log_info); vty_init(&vty_info); @@ -137,7 +170,7 @@ osmo_ss7_init(); osmo_fsm_log_addr(false); logging_vty_add_cmds(&log_info); - osmo_ss7_vty_init_sg(NULL); + osmo_ss7_vty_init_sg(tall_stp_ctx); osmo_fsm_vty_add_cmds(); rc = vty_read_config_file(cmdline_config.config_file, NULL); @@ -153,6 +186,13 @@ exit(1); } + signal(SIGINT, &signal_handler); + signal(SIGTERM, &signal_handler); + signal(SIGABRT, &signal_handler); + signal(SIGUSR1, &signal_handler); + signal(SIGUSR2, &signal_handler); + osmo_init_ignore_signals(); + if (cmdline_config.daemonize) { rc = osmo_daemonize(); if (rc < 0) { -- To view, visit https://gerrit.osmocom.org/3563 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Id5e37dc35923fd689e2cecd9923154774efd7f51 Gerrit-PatchSet: 1 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Sun Aug 20 18:59:10 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 20 Aug 2017 18:59:10 +0000 Subject: [PATCH] openbsc[master]: Treat SIGTERM just like SIGINT in our programs Message-ID: Review at https://gerrit.osmocom.org/3564 Treat SIGTERM just like SIGINT in our programs When somebody kills the process, it's best to handle the signal and to use the opportunity for some cleanup. We always did this in the NITB on SIGINT, but never on SIGTERM. Let's change it. Change-Id: Iea6804325a6575ceab5edfd28dd20249462f143b --- M openbsc/src/gprs/gb_proxy_main.c M openbsc/src/gprs/gtphub_main.c M openbsc/src/gprs/sgsn_main.c M openbsc/src/osmo-bsc/osmo_bsc_main.c M openbsc/src/osmo-nitb/bsc_hack.c 5 files changed, 10 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/64/3564/1 diff --git a/openbsc/src/gprs/gb_proxy_main.c b/openbsc/src/gprs/gb_proxy_main.c index 69a93b6..caff27f 100644 --- a/openbsc/src/gprs/gb_proxy_main.c +++ b/openbsc/src/gprs/gb_proxy_main.c @@ -98,6 +98,7 @@ switch (signal) { case SIGINT: + case SIGTERM: osmo_signal_dispatch(SS_L_GLOBAL, S_L_GLOBAL_SHUTDOWN, NULL); sleep(1); exit(0); @@ -232,6 +233,7 @@ msgb_talloc_ctx_init(tall_bsc_ctx, 0); signal(SIGINT, &signal_handler); + signal(SIGTERM, &signal_handler); signal(SIGABRT, &signal_handler); signal(SIGUSR1, &signal_handler); signal(SIGUSR2, &signal_handler); diff --git a/openbsc/src/gprs/gtphub_main.c b/openbsc/src/gprs/gtphub_main.c index 73a122c..2b87d19 100644 --- a/openbsc/src/gprs/gtphub_main.c +++ b/openbsc/src/gprs/gtphub_main.c @@ -96,6 +96,7 @@ switch (signal) { case SIGINT: + case SIGTERM: osmo_signal_dispatch(SS_L_GLOBAL, S_L_GLOBAL_SHUTDOWN, NULL); sleep(1); exit(0); @@ -302,6 +303,7 @@ msgb_talloc_ctx_init(osmo_gtphub_ctx, 0); signal(SIGINT, &signal_handler); + signal(SIGTERM, &signal_handler); signal(SIGABRT, &signal_handler); signal(SIGUSR1, &signal_handler); signal(SIGUSR2, &signal_handler); diff --git a/openbsc/src/gprs/sgsn_main.c b/openbsc/src/gprs/sgsn_main.c index 04f2825..c1da585 100644 --- a/openbsc/src/gprs/sgsn_main.c +++ b/openbsc/src/gprs/sgsn_main.c @@ -142,6 +142,7 @@ switch (signal) { case SIGINT: + case SIGTERM: osmo_signal_dispatch(SS_L_GLOBAL, S_L_GLOBAL_SHUTDOWN, NULL); sleep(1); exit(0); @@ -335,6 +336,7 @@ msgb_talloc_ctx_init(tall_bsc_ctx, 0); signal(SIGINT, &signal_handler); + signal(SIGTERM, &signal_handler); signal(SIGABRT, &signal_handler); signal(SIGUSR1, &signal_handler); signal(SIGUSR2, &signal_handler); diff --git a/openbsc/src/osmo-bsc/osmo_bsc_main.c b/openbsc/src/osmo-bsc/osmo_bsc_main.c index ee094d6..90651b9 100644 --- a/openbsc/src/osmo-bsc/osmo_bsc_main.c +++ b/openbsc/src/osmo-bsc/osmo_bsc_main.c @@ -162,6 +162,7 @@ switch (signal) { case SIGINT: + case SIGTERM: bsc_shutdown_net(bsc_gsmnet); osmo_signal_dispatch(SS_L_GLOBAL, S_L_GLOBAL_SHUTDOWN, NULL); sleep(3); @@ -280,6 +281,7 @@ } signal(SIGINT, &signal_handler); + signal(SIGTERM, &signal_handler); signal(SIGABRT, &signal_handler); signal(SIGUSR1, &signal_handler); signal(SIGUSR2, &signal_handler); diff --git a/openbsc/src/osmo-nitb/bsc_hack.c b/openbsc/src/osmo-nitb/bsc_hack.c index c2fe1c9..2aeaa8f 100644 --- a/openbsc/src/osmo-nitb/bsc_hack.c +++ b/openbsc/src/osmo-nitb/bsc_hack.c @@ -202,6 +202,7 @@ switch (signal) { case SIGINT: + case SIGTERM: bsc_shutdown_net(bsc_gsmnet); osmo_signal_dispatch(SS_L_GLOBAL, S_L_GLOBAL_SHUTDOWN, NULL); sleep(3); @@ -376,6 +377,7 @@ osmo_timer_schedule(&bsc_gsmnet->subscr_expire_timer, EXPIRE_INTERVAL); signal(SIGINT, &signal_handler); + signal(SIGTERM, &signal_handler); signal(SIGABRT, &signal_handler); signal(SIGUSR1, &signal_handler); signal(SIGUSR2, &signal_handler); -- To view, visit https://gerrit.osmocom.org/3564 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Iea6804325a6575ceab5edfd28dd20249462f143b Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Sun Aug 20 19:01:59 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 20 Aug 2017 19:01:59 +0000 Subject: [PATCH] osmo-bts[master]: Treat SIGTERM just like SIGINT in our programs Message-ID: Review at https://gerrit.osmocom.org/3565 Treat SIGTERM just like SIGINT in our programs When somebody kills the process, it's best to handle the signal and to use the opportunity for some cleanup. We always did this in the BTS on SIGINT, but never on SIGTERM. Let's change it. Change-Id: I10009c08b7178988f646e2b6035197b9640ac9b5 --- M src/common/main.c M src/osmo-bts-litecell15/misc/lc15bts_mgr.c M src/osmo-bts-sysmo/misc/sysmobts_mgr.c 3 files changed, 6 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/65/3565/1 diff --git a/src/common/main.c b/src/common/main.c index 6c13663..c998c45 100644 --- a/src/common/main.c +++ b/src/common/main.c @@ -184,6 +184,7 @@ switch (signal) { case SIGINT: + case SIGTERM: if (!quit) { oml_fail_rep(OSMO_EVT_CRIT_PROC_STOP, "BTS: SIGINT received -> shutdown"); @@ -324,6 +325,7 @@ } signal(SIGINT, &signal_handler); + signal(SIGTERM, &signal_handler); //signal(SIGABRT, &signal_handler); signal(SIGUSR1, &signal_handler); signal(SIGUSR2, &signal_handler); diff --git a/src/osmo-bts-litecell15/misc/lc15bts_mgr.c b/src/osmo-bts-litecell15/misc/lc15bts_mgr.c index cec9a82..7886a5e 100644 --- a/src/osmo-bts-litecell15/misc/lc15bts_mgr.c +++ b/src/osmo-bts-litecell15/misc/lc15bts_mgr.c @@ -226,6 +226,7 @@ switch (signal) { case SIGINT: + case SIGTERM: lc15bts_check_temp(no_rom_write); lc15bts_check_power(no_rom_write); lc15bts_check_vswr(no_rom_write); @@ -297,6 +298,7 @@ osmo_init_ignore_signals(); signal(SIGINT, &signal_handler); + signal(SIGTERM, &signal_handler); signal(SIGUSR1, &signal_handler); signal(SIGUSR2, &signal_handler); diff --git a/src/osmo-bts-sysmo/misc/sysmobts_mgr.c b/src/osmo-bts-sysmo/misc/sysmobts_mgr.c index 6fadf0f..17a6d89 100644 --- a/src/osmo-bts-sysmo/misc/sysmobts_mgr.c +++ b/src/osmo-bts-sysmo/misc/sysmobts_mgr.c @@ -198,6 +198,7 @@ switch (signal) { case SIGINT: + case SIGTERM: sysmobts_check_temp(no_eeprom_write); sysmobts_update_hours(no_eeprom_write); exit(0); @@ -266,6 +267,7 @@ osmo_init_ignore_signals(); signal(SIGINT, &signal_handler); + signal(SIGTERM, &signal_handler); signal(SIGUSR1, &signal_handler); signal(SIGUSR2, &signal_handler); -- To view, visit https://gerrit.osmocom.org/3565 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I10009c08b7178988f646e2b6035197b9640ac9b5 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Sun Aug 20 19:02:09 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 20 Aug 2017 19:02:09 +0000 Subject: libosmo-sccp[master]: OsmoSTP: Install our default set of signal handlers In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3563 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Id5e37dc35923fd689e2cecd9923154774efd7f51 Gerrit-PatchSet: 1 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sun Aug 20 19:02:14 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 20 Aug 2017 19:02:14 +0000 Subject: [MERGED] libosmo-sccp[master]: OsmoSTP: Install our default set of signal handlers In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: OsmoSTP: Install our default set of signal handlers ...................................................................... OsmoSTP: Install our default set of signal handlers Change-Id: Id5e37dc35923fd689e2cecd9923154774efd7f51 --- M stp/stp_main.c 1 file changed, 41 insertions(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/stp/stp_main.c b/stp/stp_main.c index ac8e6dd..8e3282c 100644 --- a/stp/stp_main.c +++ b/stp/stp_main.c @@ -23,8 +23,11 @@ #include #include #include +#include #include +#include +#include #include #include #include @@ -41,6 +44,8 @@ #include #include #include + +static void *tall_stp_ctx; /* we only use logging sub-systems of the various libraries so far */ static const struct log_info_cat log_info_cat[] = { @@ -122,9 +127,37 @@ } } +static void signal_handler(int signal) +{ + fprintf(stdout, "signal %u received\n", signal); + + switch (signal) { + case SIGINT: + case SIGTERM: + osmo_signal_dispatch(SS_L_GLOBAL, S_L_GLOBAL_SHUTDOWN, NULL); + sleep(1); + break; + case SIGABRT: + osmo_generate_backtrace(); + /* in case of abort, we want to obtain a talloc report + * and then return to the caller, who will abort the process */ + case SIGUSR1: + talloc_report(tall_vty_ctx, stderr); + talloc_report_full(tall_stp_ctx, stderr); + break; + case SIGUSR2: + talloc_report_full(tall_vty_ctx, stderr); + break; + default: + break; + } +} + int main(int argc, char **argv) { int rc; + + tall_stp_ctx = talloc_named_const(NULL, 1, "osmo-stp"); osmo_init_logging(&log_info); vty_init(&vty_info); @@ -137,7 +170,7 @@ osmo_ss7_init(); osmo_fsm_log_addr(false); logging_vty_add_cmds(&log_info); - osmo_ss7_vty_init_sg(NULL); + osmo_ss7_vty_init_sg(tall_stp_ctx); osmo_fsm_vty_add_cmds(); rc = vty_read_config_file(cmdline_config.config_file, NULL); @@ -153,6 +186,13 @@ exit(1); } + signal(SIGINT, &signal_handler); + signal(SIGTERM, &signal_handler); + signal(SIGABRT, &signal_handler); + signal(SIGUSR1, &signal_handler); + signal(SIGUSR2, &signal_handler); + osmo_init_ignore_signals(); + if (cmdline_config.daemonize) { rc = osmo_daemonize(); if (rc < 0) { -- To view, visit https://gerrit.osmocom.org/3563 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Id5e37dc35923fd689e2cecd9923154774efd7f51 Gerrit-PatchSet: 1 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sun Aug 20 19:02:28 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 20 Aug 2017 19:02:28 +0000 Subject: osmo-bts[master]: Treat SIGTERM just like SIGINT in our programs In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3565 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I10009c08b7178988f646e2b6035197b9640ac9b5 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sun Aug 20 19:02:36 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 20 Aug 2017 19:02:36 +0000 Subject: openbsc[master]: Treat SIGTERM just like SIGINT in our programs In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3564 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Iea6804325a6575ceab5edfd28dd20249462f143b Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sun Aug 20 19:02:46 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 20 Aug 2017 19:02:46 +0000 Subject: osmo-bts[master]: osmo-bts-trx: Increase a maximum allowed MS power reduction ... In-Reply-To: References: Message-ID: Patch Set 4: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3562 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I58785513e5739474b881ed7f2a312ecc690e7e60 Gerrit-PatchSet: 4 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Alexander Chemeris Gerrit-Reviewer: Alexander Chemeris Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sun Aug 20 19:03:00 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 20 Aug 2017 19:03:00 +0000 Subject: [MERGED] osmo-bts[master]: osmo-bts-trx: Increase a maximum allowed MS power reduction ... In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: osmo-bts-trx: Increase a maximum allowed MS power reduction step from 2dB to 4dB. ...................................................................... osmo-bts-trx: Increase a maximum allowed MS power reduction step from 2dB to 4dB. We tend to start MS with high power to make sure distant phones get good QoS, but this also means that we need to reduce their power rather quickly. OTOH we can't make this step too high because this may lead to power output oscillation. From my (manual, limited) testing 4dB looks like a reasonable compromise. Change-Id: I58785513e5739474b881ed7f2a312ecc690e7e60 --- M src/osmo-bts-trx/loops.h 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/osmo-bts-trx/loops.h b/src/osmo-bts-trx/loops.h index 613d2d0..c0458c5 100644 --- a/src/osmo-bts-trx/loops.h +++ b/src/osmo-bts-trx/loops.h @@ -7,7 +7,7 @@ /* how much power levels do we raise/lower as maximum (1 level = 2 dB) */ #define MS_RAISE_MAX 4 -#define MS_LOWER_MAX 1 +#define MS_LOWER_MAX 2 /* * loops api -- To view, visit https://gerrit.osmocom.org/3562 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I58785513e5739474b881ed7f2a312ecc690e7e60 Gerrit-PatchSet: 4 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Alexander Chemeris Gerrit-Reviewer: Alexander Chemeris Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sun Aug 20 19:05:17 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 20 Aug 2017 19:05:17 +0000 Subject: osmo-bts[master]: Fix static build of osmo-bts-trx and osmo-bts-virtual. In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 (1 comment) https://gerrit.osmocom.org/#/c/3552/1//COMMIT_MSG Commit Message: Line 9: New libosmocore has some plugin system which requires dlopen(). So we need I'm not sure what's "new" about it? dlopen() has been introduced into libosmocore in 2010: commit b9ce51c5fd9773694856802a175efdd9b37a2242 Author: Harald Welte Date: Wed Jun 30 19:43:11 2010 +0200 -- To view, visit https://gerrit.osmocom.org/3552 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I8315d6e032e34528def268a49fd88d07bc06ab2e Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Alexander Chemeris Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Sun Aug 20 19:23:35 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 20 Aug 2017 19:23:35 +0000 Subject: [MERGED] osmo-bts[master]: Treat SIGTERM just like SIGINT in our programs In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Treat SIGTERM just like SIGINT in our programs ...................................................................... Treat SIGTERM just like SIGINT in our programs When somebody kills the process, it's best to handle the signal and to use the opportunity for some cleanup. We always did this in the BTS on SIGINT, but never on SIGTERM. Let's change it. Change-Id: I10009c08b7178988f646e2b6035197b9640ac9b5 --- M src/common/main.c M src/osmo-bts-litecell15/misc/lc15bts_mgr.c M src/osmo-bts-sysmo/misc/sysmobts_mgr.c 3 files changed, 6 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/common/main.c b/src/common/main.c index 6c13663..c998c45 100644 --- a/src/common/main.c +++ b/src/common/main.c @@ -184,6 +184,7 @@ switch (signal) { case SIGINT: + case SIGTERM: if (!quit) { oml_fail_rep(OSMO_EVT_CRIT_PROC_STOP, "BTS: SIGINT received -> shutdown"); @@ -324,6 +325,7 @@ } signal(SIGINT, &signal_handler); + signal(SIGTERM, &signal_handler); //signal(SIGABRT, &signal_handler); signal(SIGUSR1, &signal_handler); signal(SIGUSR2, &signal_handler); diff --git a/src/osmo-bts-litecell15/misc/lc15bts_mgr.c b/src/osmo-bts-litecell15/misc/lc15bts_mgr.c index cec9a82..7886a5e 100644 --- a/src/osmo-bts-litecell15/misc/lc15bts_mgr.c +++ b/src/osmo-bts-litecell15/misc/lc15bts_mgr.c @@ -226,6 +226,7 @@ switch (signal) { case SIGINT: + case SIGTERM: lc15bts_check_temp(no_rom_write); lc15bts_check_power(no_rom_write); lc15bts_check_vswr(no_rom_write); @@ -297,6 +298,7 @@ osmo_init_ignore_signals(); signal(SIGINT, &signal_handler); + signal(SIGTERM, &signal_handler); signal(SIGUSR1, &signal_handler); signal(SIGUSR2, &signal_handler); diff --git a/src/osmo-bts-sysmo/misc/sysmobts_mgr.c b/src/osmo-bts-sysmo/misc/sysmobts_mgr.c index 6fadf0f..17a6d89 100644 --- a/src/osmo-bts-sysmo/misc/sysmobts_mgr.c +++ b/src/osmo-bts-sysmo/misc/sysmobts_mgr.c @@ -198,6 +198,7 @@ switch (signal) { case SIGINT: + case SIGTERM: sysmobts_check_temp(no_eeprom_write); sysmobts_update_hours(no_eeprom_write); exit(0); @@ -266,6 +267,7 @@ osmo_init_ignore_signals(); signal(SIGINT, &signal_handler); + signal(SIGTERM, &signal_handler); signal(SIGUSR1, &signal_handler); signal(SIGUSR2, &signal_handler); -- To view, visit https://gerrit.osmocom.org/3565 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I10009c08b7178988f646e2b6035197b9640ac9b5 Gerrit-PatchSet: 2 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sun Aug 20 19:28:44 2017 From: gerrit-no-reply at lists.osmocom.org (Alexander Chemeris) Date: Sun, 20 Aug 2017 19:28:44 +0000 Subject: osmo-bts[master]: Fix static build of osmo-bts-trx and osmo-bts-virtual. In-Reply-To: References: Message-ID: Patch Set 1: > I'm not sure what's "new" about it? dlopen() has been introduced into libosmocore in 2010: Not sure. May be somehow it wasn't used previously and was optimized out by the linker and now it's used? Frankly I haven't looked at the reasons - I just noticed that it was building fine previously and now it requires -ldl. -- To view, visit https://gerrit.osmocom.org/3552 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I8315d6e032e34528def268a49fd88d07bc06ab2e Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Alexander Chemeris Gerrit-Reviewer: Alexander Chemeris Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sun Aug 20 19:29:30 2017 From: gerrit-no-reply at lists.osmocom.org (Alexander Chemeris) Date: Sun, 20 Aug 2017 19:29:30 +0000 Subject: [MERGED] osmo-bts[master]: Fix static build of osmo-bts-trx and osmo-bts-virtual. In-Reply-To: References: Message-ID: Alexander Chemeris has submitted this change and it was merged. Change subject: Fix static build of osmo-bts-trx and osmo-bts-virtual. ...................................................................... Fix static build of osmo-bts-trx and osmo-bts-virtual. New libosmocore has some plugin system which requires dlopen(). So we need to make sure we always link with libdl, even when building statically. Note that this doesn't fix static build of tests - they are still failing with some errors. Change-Id: I8315d6e032e34528def268a49fd88d07bc06ab2e --- M src/osmo-bts-trx/Makefile.am M src/osmo-bts-virtual/Makefile.am 2 files changed, 2 insertions(+), 2 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/osmo-bts-trx/Makefile.am b/src/osmo-bts-trx/Makefile.am index 8676685..0a97251 100644 --- a/src/osmo-bts-trx/Makefile.am +++ b/src/osmo-bts-trx/Makefile.am @@ -1,6 +1,6 @@ AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include -I$(OPENBSC_INCDIR) AM_CFLAGS = -Wall -fno-strict-aliasing $(LIBOSMOCORE_CFLAGS) $(LIBOSMOGSM_CFLAGS) $(LIBOSMOCODEC_CFLAGS) $(LIBOSMOCODING_CFLAGS) $(LIBOSMOVTY_CFLAGS) $(LIBOSMOTRAU_CFLAGS) $(LIBOSMOABIS_CFLAGS) $(LIBOSMOCTRL_CFLAGS) $(ORTP_CFLAGS) -LDADD = $(LIBOSMOCORE_LIBS) $(LIBOSMOGSM_LIBS) $(LIBOSMOCODEC_LIBS) $(LIBOSMOCODING_LIBS) $(LIBOSMOVTY_LIBS) $(LIBOSMOTRAU_LIBS) $(LIBOSMOABIS_LIBS) $(LIBOSMOCTRL_LIBS) $(ORTP_LIBS) +LDADD = $(LIBOSMOCORE_LIBS) $(LIBOSMOGSM_LIBS) $(LIBOSMOCODEC_LIBS) $(LIBOSMOCODING_LIBS) $(LIBOSMOVTY_LIBS) $(LIBOSMOTRAU_LIBS) $(LIBOSMOABIS_LIBS) $(LIBOSMOCTRL_LIBS) $(ORTP_LIBS) -ldl EXTRA_DIST = trx_if.h l1_if.h loops.h diff --git a/src/osmo-bts-virtual/Makefile.am b/src/osmo-bts-virtual/Makefile.am index 30069d4..d1f05af 100644 --- a/src/osmo-bts-virtual/Makefile.am +++ b/src/osmo-bts-virtual/Makefile.am @@ -1,6 +1,6 @@ AM_CFLAGS = -Wall -fno-strict-aliasing $(LIBOSMOCORE_CFLAGS) $(LIBOSMOGSM_CFLAGS) $(LIBOSMOVTY_CFLAGS) $(LIBOSMOTRAU_CFLAGS) $(LIBOSMOABIS_CFLAGS) $(LIBOSMOCTRL_CFLAGS) $(LIBOSMOABIS_CFLAGS) $(LIBGPS_CFLAGS) $(ORTP_CFLAGS) AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include -I$(OPENBSC_INCDIR) -Iinclude -COMMON_LDADD = $(LIBOSMOCORE_LIBS) $(LIBOSMOGSM_LIBS) $(LIBOSMOVTY_LIBS) $(LIBOSMOTRAU_LIBS) $(LIBOSMOABIS_LIBS) $(LIBOSMOCTRL_LIBS) $(ORTP_LIBS) +COMMON_LDADD = $(LIBOSMOCORE_LIBS) $(LIBOSMOGSM_LIBS) $(LIBOSMOVTY_LIBS) $(LIBOSMOTRAU_LIBS) $(LIBOSMOABIS_LIBS) $(LIBOSMOCTRL_LIBS) $(ORTP_LIBS) -ldl noinst_HEADERS = l1_if.h osmo_mcast_sock.h virtual_um.h -- To view, visit https://gerrit.osmocom.org/3552 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I8315d6e032e34528def268a49fd88d07bc06ab2e Gerrit-PatchSet: 2 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Alexander Chemeris Gerrit-Reviewer: Alexander Chemeris Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sun Aug 20 20:20:03 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 20 Aug 2017 20:20:03 +0000 Subject: [PATCH] osmocom-bb[master]: virtphy: Add SIGINT+SIGTERM handlers Message-ID: Review at https://gerrit.osmocom.org/3566 virtphy: Add SIGINT+SIGTERM handlers Change-Id: I2fe65e0c1912c4d72c276a2db169f0bdbcbda2b8 --- M src/host/virt_phy/src/virtphy.c 1 file changed, 6 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmocom-bb refs/changes/66/3566/1 diff --git a/src/host/virt_phy/src/virtphy.c b/src/host/virt_phy/src/virtphy.c index 412b742..153f890 100644 --- a/src/host/virt_phy/src/virtphy.c +++ b/src/host/virt_phy/src/virtphy.c @@ -177,6 +177,10 @@ LOGP(DMAIN, LOGL_NOTICE, "Signal %d received\n", signum); switch (signum) { + case SIGINT: + case SIGTERM: + exit(0); + break; case SIGUSR1: talloc_report_full(tall_vphy_ctx, stderr); break; @@ -190,6 +194,8 @@ tall_vphy_ctx = talloc_named_const(NULL, 1, "root"); msgb_talloc_ctx_init(tall_vphy_ctx, 0); + signal(SIGINT, &signal_handler); + signal(SIGTERM, &signal_handler); signal(SIGUSR1, &signal_handler); osmo_init_ignore_signals(); -- To view, visit https://gerrit.osmocom.org/3566 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I2fe65e0c1912c4d72c276a2db169f0bdbcbda2b8 Gerrit-PatchSet: 1 Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Sun Aug 20 20:20:03 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 20 Aug 2017 20:20:03 +0000 Subject: [PATCH] osmocom-bb[master]: VIRT-PHY: Support forwarding of CBCH similar to BCCH/CCCH Message-ID: Review at https://gerrit.osmocom.org/3567 VIRT-PHY: Support forwarding of CBCH similar to BCCH/CCCH Change-Id: I3e6f936603e43e885b28953be5ac262e3fb7c09a --- M src/host/virt_phy/src/gsmtapl1_if.c 1 file changed, 2 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmocom-bb refs/changes/67/3567/1 diff --git a/src/host/virt_phy/src/gsmtapl1_if.c b/src/host/virt_phy/src/gsmtapl1_if.c index 5454022..df1c124 100644 --- a/src/host/virt_phy/src/gsmtapl1_if.c +++ b/src/host/virt_phy/src/gsmtapl1_if.c @@ -154,6 +154,8 @@ case GSMTAP_CHANNEL_AGCH: case GSMTAP_CHANNEL_PCH: case GSMTAP_CHANNEL_BCCH: + case GSMTAP_CHANNEL_CBCH51: + case GSMTAP_CHANNEL_CBCH52: /* save to just forward here, as upper layer ignores messages that * do not fit the current state (e.g. gsm48_rr.c:2159) */ l1ctl_tx_data_ind(ms, msg, arfcn, link_id, chan_nr, fn, snr_db, signal_dbm, 0, 0); @@ -166,8 +168,6 @@ case GSMTAP_CHANNEL_PACCH: case GSMTAP_CHANNEL_PDCH: case GSMTAP_CHANNEL_PTCCH: - case GSMTAP_CHANNEL_CBCH51: - case GSMTAP_CHANNEL_CBCH52: LOGPMS(DVIRPHY, LOGL_NOTICE, ms, "Ignoring unsupported channel type %s\n", get_value_string(gsmtap_gsm_channel_names, gsmtap_chantype)); break; -- To view, visit https://gerrit.osmocom.org/3567 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I3e6f936603e43e885b28953be5ac262e3fb7c09a Gerrit-PatchSet: 1 Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Sun Aug 20 20:20:04 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 20 Aug 2017 20:20:04 +0000 Subject: [PATCH] osmocom-bb[master]: VIRT-PHY: virt_l1_sched: Pass timeslot number into call-back Message-ID: Review at https://gerrit.osmocom.org/3568 VIRT-PHY: virt_l1_sched: Pass timeslot number into call-back When we schedule a given frame for transmission, we save its timeslot number. However, the callback doesn't get informed about this so far. Change-Id: I608a91ae8e2a57a2d6f87f4b873c82edb0215bf6 --- M src/host/virt_phy/include/virtphy/gsmtapl1_if.h M src/host/virt_phy/include/virtphy/virt_l1_sched.h M src/host/virt_phy/src/gsmtapl1_if.c M src/host/virt_phy/src/virt_l1_sched_simple.c M src/host/virt_phy/src/virt_prim_data.c M src/host/virt_phy/src/virt_prim_rach.c M src/host/virt_phy/src/virt_prim_traffic.c 7 files changed, 10 insertions(+), 10 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmocom-bb refs/changes/68/3568/1 diff --git a/src/host/virt_phy/include/virtphy/gsmtapl1_if.h b/src/host/virt_phy/include/virtphy/gsmtapl1_if.h index 125ec11..8dab6b2 100644 --- a/src/host/virt_phy/include/virtphy/gsmtapl1_if.h +++ b/src/host/virt_phy/include/virtphy/gsmtapl1_if.h @@ -9,4 +9,4 @@ void gsmtapl1_init(struct l1_model_ms *model); void gsmtapl1_rx_from_virt_um_inst_cb(struct virt_um_inst *vui, struct msgb *msg); -void gsmtapl1_tx_to_virt_um_inst(struct l1_model_ms *ms, uint32_t fn, struct msgb *msg); +void gsmtapl1_tx_to_virt_um_inst(struct l1_model_ms *ms, uint32_t fn, uint8_t tn, struct msgb *msg); diff --git a/src/host/virt_phy/include/virtphy/virt_l1_sched.h b/src/host/virt_phy/include/virtphy/virt_l1_sched.h index f3e9b84..b8d401f 100644 --- a/src/host/virt_phy/include/virtphy/virt_l1_sched.h +++ b/src/host/virt_phy/include/virtphy/virt_l1_sched.h @@ -7,7 +7,7 @@ struct l1_model_ms; -typedef void virt_l1_sched_cb(struct l1_model_ms *ms, uint32_t fn, struct msgb * msg); +typedef void virt_l1_sched_cb(struct l1_model_ms *ms, uint32_t fn, uint8_t tn, struct msgb * msg); /* bucket containing items to be executed for a specific mframe number */ struct virt_l1_sched_mframe_item { diff --git a/src/host/virt_phy/src/gsmtapl1_if.c b/src/host/virt_phy/src/gsmtapl1_if.c index df1c124..8202046 100644 --- a/src/host/virt_phy/src/gsmtapl1_if.c +++ b/src/host/virt_phy/src/gsmtapl1_if.c @@ -51,7 +51,7 @@ /** * Replace l11 header of given msgb by a gsmtap header and send it over the virt um. */ -void gsmtapl1_tx_to_virt_um_inst(struct l1_model_ms *ms, uint32_t fn, struct msgb *msg) +void gsmtapl1_tx_to_virt_um_inst(struct l1_model_ms *ms, uint32_t fn, uint8_t tn, struct msgb *msg) { struct l1ctl_hdr *l1h = (struct l1ctl_hdr *)msg->data; struct l1ctl_info_ul *ul = (struct l1ctl_info_ul *)l1h->data; diff --git a/src/host/virt_phy/src/virt_l1_sched_simple.c b/src/host/virt_phy/src/virt_l1_sched_simple.c index ba8298f..4737135 100644 --- a/src/host/virt_phy/src/virt_l1_sched_simple.c +++ b/src/host/virt_phy/src/virt_l1_sched_simple.c @@ -94,7 +94,7 @@ /* exec tdma sched item's handler callback */ /* TODO: we do not have a TDMA scheduler currently and execute * all scheduled tdma items here at once */ - ti_next->handler_cb(ms, mi_next->fn, ti_next->msg); + ti_next->handler_cb(ms, mi_next->fn, ti_next->ts, ti_next->msg); /* remove handled tdma sched item */ llist_del(&ti_next->tdma_item_entry); } diff --git a/src/host/virt_phy/src/virt_prim_data.c b/src/host/virt_phy/src/virt_prim_data.c index 8931cf9..96534aa 100644 --- a/src/host/virt_phy/src/virt_prim_data.c +++ b/src/host/virt_phy/src/virt_prim_data.c @@ -44,9 +44,9 @@ * @param [in] fn frame number * @param [in] msg the msg to sent over virtual um. */ -static void virt_l1_sched_handler_cb(struct l1_model_ms *ms, uint32_t fn, struct msgb * msg) +static void virt_l1_sched_handler_cb(struct l1_model_ms *ms, uint32_t fn, uint8_t tn, struct msgb * msg) { - gsmtapl1_tx_to_virt_um_inst(ms, fn, msg); + gsmtapl1_tx_to_virt_um_inst(ms, fn, tn, msg); l1ctl_tx_data_conf(ms, fn, 0, ms->state.serving_cell.arfcn); } diff --git a/src/host/virt_phy/src/virt_prim_rach.c b/src/host/virt_phy/src/virt_prim_rach.c index 8fb0e2f..94076cf 100644 --- a/src/host/virt_phy/src/virt_prim_rach.c +++ b/src/host/virt_phy/src/virt_prim_rach.c @@ -56,9 +56,9 @@ * * @param [in] msg the msg to sent over virtual um. */ -static void virt_l1_sched_handler_cb(struct l1_model_ms *ms, uint32_t fn, struct msgb *msg) +static void virt_l1_sched_handler_cb(struct l1_model_ms *ms, uint32_t fn, uint8_t tn, struct msgb *msg) { - gsmtapl1_tx_to_virt_um_inst(ms, fn, msg); + gsmtapl1_tx_to_virt_um_inst(ms, fn, tn, msg); l1ctl_tx_rach_conf(ms, fn, ms->state.serving_cell.arfcn); } diff --git a/src/host/virt_phy/src/virt_prim_traffic.c b/src/host/virt_phy/src/virt_prim_traffic.c index 6798bc1..4e58de6 100644 --- a/src/host/virt_phy/src/virt_prim_traffic.c +++ b/src/host/virt_phy/src/virt_prim_traffic.c @@ -44,9 +44,9 @@ * @param [in] fn frame number * @param [in] msg the msg to sent over virtual um. */ -static void virt_l1_sched_handler_cb(struct l1_model_ms *ms, uint32_t fn, struct msgb * msg) +static void virt_l1_sched_handler_cb(struct l1_model_ms *ms, uint32_t fn, uint8_t tn, struct msgb * msg) { - gsmtapl1_tx_to_virt_um_inst(ms, fn, msg); + gsmtapl1_tx_to_virt_um_inst(ms, fn, tn, msg); l1ctl_tx_traffic_conf(ms, fn, 0, ms->state.serving_cell.arfcn); } -- To view, visit https://gerrit.osmocom.org/3568 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I608a91ae8e2a57a2d6f87f4b873c82edb0215bf6 Gerrit-PatchSet: 1 Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Sun Aug 20 20:20:04 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 20 Aug 2017 20:20:04 +0000 Subject: [PATCH] osmocom-bb[master]: VIRT-PHY: Add support for GPRS / TBF mode Message-ID: Review at https://gerrit.osmocom.org/3569 VIRT-PHY: Add support for GPRS / TBF mode we add a new STATE_TBF to vthe MS model and add some L1CTL primitives to configure that TBF mode as well as to enqueue transmissions for blocks at a given USF+TS. Change-Id: Ie6f37090bd45f463aa25d9e00bc06f563be5264a --- M include/l1ctl_proto.h M src/host/virt_phy/include/virtphy/virt_l1_model.h M src/host/virt_phy/src/gsmtapl1_if.c M src/host/virt_phy/src/l1ctl_sap.c 4 files changed, 293 insertions(+), 5 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmocom-bb refs/changes/69/3569/1 diff --git a/include/l1ctl_proto.h b/include/l1ctl_proto.h index 771bf1c..37d3d87 100644 --- a/include/l1ctl_proto.h +++ b/include/l1ctl_proto.h @@ -56,6 +56,13 @@ L1CTL_TRAFFIC_REQ, L1CTL_TRAFFIC_CONF, L1CTL_TRAFFIC_IND, + + /* configure TBF for uplink/downlink */ + L1CTL_TBF_CFG_REQ, + L1CTL_TBF_CFG_CONF, + + L1CTL_DATA_TBF_REQ, + L1CTL_DATA_TBF_CONF, }; enum ccch_mode { @@ -68,6 +75,23 @@ NEIGH_MODE_NONE = 0, NEIGH_MODE_PM, NEIGH_MODE_SB, +}; + +enum l1ctl_coding_scheme { + L1CTL_CS_NONE, + L1CTL_CS1, + L1CTL_CS2, + L1CTL_CS3, + L1CTL_CS4, + L1CTL_MCS1, + L1CTL_MCS2, + L1CTL_MCS3, + L1CTL_MCS4, + L1CTL_MCS5, + L1CTL_MCS6, + L1CTL_MCS7, + L1CTL_MCS8, + L1CTL_MCS9, }; #define TRAFFIC_DATA_LEN 40 @@ -149,6 +173,15 @@ uint8_t link_id; uint8_t padding[2]; + uint8_t payload[0]; +} __attribute__((packed)); + +struct l1ctl_info_ul_tbf { + /* references l1ctl_tbf_cfg_req.tbf_nr */ + uint8_t tbf_nr; + uint8_t coding_scheme; + uint8_t padding[2]; + /* RLC/MAC block, size determines CS */ uint8_t payload[0]; } __attribute__((packed)); @@ -300,4 +333,15 @@ uint8_t data[TRAFFIC_DATA_LEN]; } __attribute__((packed)); +struct l1ctl_tbf_cfg_req { + /* future support for multiple concurrent TBFs. 0 for now */ + uint8_t tbf_nr; + /* is this about an UL TBF (1) or DL (0) */ + uint8_t is_uplink; + uint8_t padding[2]; + + /* one USF for each TN, or 255 for invalid/unused */ + uint8_t usf[8]; +} __attribute__((packed)); + #endif /* __L1CTL_PROTO_H__ */ diff --git a/src/host/virt_phy/include/virtphy/virt_l1_model.h b/src/host/virt_phy/include/virtphy/virt_l1_model.h index fa79127..67c24bb 100644 --- a/src/host/virt_phy/include/virtphy/virt_l1_model.h +++ b/src/host/virt_phy/include/virtphy/virt_l1_model.h @@ -15,6 +15,7 @@ MS_STATE_IDLE_SYNCING, MS_STATE_IDLE_CAMPING, MS_STATE_DEDICATED, + MS_STATE_TBF }; @@ -74,6 +75,15 @@ uint8_t tsc; // training sequence code (ununsed in virtual um) uint8_t h; // hopping enabled flag (ununsed in virtual um) } dedicated; + struct { + struct { + uint8_t usf[8]; + struct llist_head tx_queue; + } ul; + struct { + uint8_t tfi[8]; + } dl; + } tbf; /* fbsb state */ struct { diff --git a/src/host/virt_phy/src/gsmtapl1_if.c b/src/host/virt_phy/src/gsmtapl1_if.c index 8202046..2cf9d2d 100644 --- a/src/host/virt_phy/src/gsmtapl1_if.c +++ b/src/host/virt_phy/src/gsmtapl1_if.c @@ -54,7 +54,7 @@ void gsmtapl1_tx_to_virt_um_inst(struct l1_model_ms *ms, uint32_t fn, uint8_t tn, struct msgb *msg) { struct l1ctl_hdr *l1h = (struct l1ctl_hdr *)msg->data; - struct l1ctl_info_ul *ul = (struct l1ctl_info_ul *)l1h->data; + struct l1ctl_info_ul *ul; struct gsmtap_hdr *gh; struct msgb *outmsg; /* msg to send with gsmtap header prepended */ uint16_t arfcn = ms->state.serving_cell.arfcn; /* arfcn of the cell we currently camp on */ @@ -68,8 +68,20 @@ uint8_t timeslot; /* tdma timeslot to send in (0-7) */ uint8_t gsmtap_chan; /* the gsmtap channel */ - rsl_dec_chan_nr(ul->chan_nr, &rsl_chantype, &subslot, ×lot); - gsmtap_chan = chantype_rsl2gsmtap(rsl_chantype, ul->link_id); + switch (l1h->msg_type) { + case L1CTL_DATA_TBF_REQ: + ul = NULL; + rsl_chantype = RSL_CHAN_OSMO_PDCH; + timeslot = tn; + subslot = 0; + gsmtap_chan = chantype_rsl2gsmtap(rsl_chantype, 0); + break; + default: + ul = (struct l1ctl_info_ul *)l1h->data; + rsl_dec_chan_nr(ul->chan_nr, &rsl_chantype, &subslot, ×lot); + gsmtap_chan = chantype_rsl2gsmtap(rsl_chantype, ul->link_id); + break; + } /* arfcn needs to be flagged to be able to distinguish between uplink and downlink */ outmsg = gsmtap_makemsg(arfcn | GSMTAP_ARFCN_F_UPLINK, timeslot, @@ -104,6 +116,77 @@ */ extern uint16_t prim_pm_set_sig_strength(struct l1_model_ms *ms, uint16_t arfcn, int16_t sig_lev); +/* determine if a received Downlink RLC/MAC block matches the current MS configuration */ +static bool gprs_dl_block_matches_ms(struct l1_model_ms *ms, struct msgb *msg, uint8_t timeslot) +{ + uint8_t payload_type; + uint8_t tfi; + + if (msgb_length(msg) < 1) + return false; + + /* FIXME: Ensure this will also work for EGPRS! */ + payload_type = msg->data[0] >> 6; + switch (payload_type) { + case 0: /* RLC Data Block */ + /* forward all RLD Data Blocks destined for TFI of MS */ + tfi = (msg->data[1] >> 1) & 0x1f; + if (ms->state.state == MS_STATE_TBF && ms->state.tbf.dl.tfi[timeslot] == tfi) + return true; + break; + case 1: /* RLC/MAC Control without optional octets */ + /* forward all RLC/MAC control blocks without optional octets, i.e. not adressed + * to a specific TFI */ + return true; + case 2: /* RLC/MAC with optional control octets */ + /* forward all RLD Control Blocks destined for TFI of MS */ + tfi = (msg->data[2] >> 1) & 0x1f; + if (ms->state.state == MS_STATE_TBF && ms->state.tbf.dl.tfi[timeslot] == tfi) + return true; + break; + default: + break; + } + return false; +} + +/* determine if given USF at given timeslot is relevant to given MS or not */ +static bool usf_matches_ms(struct l1_model_ms *ms, uint8_t usf, uint8_t timeslot) +{ + if (ms->state.state == MS_STATE_TBF && ms->state.tbf.ul.usf[timeslot] == usf) + return true; + + return false; +} + +/* extract USF from (E)GPRS RLC/MAC block */ +static uint8_t get_usf_from_block(struct msgb *msg) +{ + /* FIXME: Ensure this will also work for EGPRS! */ + return msg->data[0] & 0x7; +} + +/* MS is authorized to transmit a block in uplink for given USF on timeslot+arfcn at FN */ +static void ms_ul_tbf_may_transmit(struct l1_model_ms *ms, uint16_t arfcn, uint8_t timeslot, + uint32_t fn, uint8_t usf) +{ + struct msgb *msg; + + /* If USF is not for us, bail out */ + if (!usf_matches_ms(ms, usf, timeslot)) + return; + + /* attempt to de-queue pending msgb for this UL TBF and transmit it */ + msg = msgb_dequeue(&ms->state.tbf.ul.tx_queue); + if (!msg) { + printf("FN=%u, TN=%u, USF=%u: empty tx_queue, not transmitting\n", fn, timeslot, usf); + /* FIXME: send some dummy control frame? */ + } else { + printf("FN=%u, TN=%u, USF=%u: transmitting queued msg\n", fn, timeslot, usf); + gsmtapl1_tx_to_virt_um_inst(ms, fn, timeslot, msg); + } +} + static void l1ctl_from_virt_um(struct l1ctl_sock_client *lsc, struct msgb *msg, uint32_t fn, uint16_t arfcn, uint8_t timeslot, uint8_t subslot, uint8_t gsmtap_chantype, uint8_t chan_nr, uint8_t link_id, @@ -111,6 +194,7 @@ { struct l1_model_ms *ms = lsc->priv; uint8_t signal_dbm = dbm2rxlev(prim_pm_set_sig_strength(ms, arfcn & GSMTAP_ARFCN_MASK, MAX_SIG_LEV_DBM)); /* Power measurement with each received massage */ + uint8_t usf; gsm_fn2gsmtime(&ms->state.downlink_time, fn); @@ -163,10 +247,15 @@ case GSMTAP_CHANNEL_RACH: LOGPMS(DVIRPHY, LOGL_NOTICE, ms, "Ignoring unexpected RACH in downlink ?!?\n"); break; - case GSMTAP_CHANNEL_SDCCH: - case GSMTAP_CHANNEL_CCCH: case GSMTAP_CHANNEL_PACCH: case GSMTAP_CHANNEL_PDCH: + if (gprs_dl_block_matches_ms(ms, msg, timeslot)) + l1ctl_tx_data_ind(ms, msg, arfcn, link_id, chan_nr, fn, snr_db, signal_dbm, 0, 0); + usf = get_usf_from_block(msg); + ms_ul_tbf_may_transmit(ms, arfcn, timeslot, fn, usf); + break; + case GSMTAP_CHANNEL_SDCCH: + case GSMTAP_CHANNEL_CCCH: case GSMTAP_CHANNEL_PTCCH: LOGPMS(DVIRPHY, LOGL_NOTICE, ms, "Ignoring unsupported channel type %s\n", get_value_string(gsmtap_gsm_channel_names, gsmtap_chantype)); diff --git a/src/host/virt_phy/src/l1ctl_sap.c b/src/host/virt_phy/src/l1ctl_sap.c index d4b33f1..aac49bf 100644 --- a/src/host/virt_phy/src/l1ctl_sap.c +++ b/src/host/virt_phy/src/l1ctl_sap.c @@ -27,6 +27,7 @@ #include #include #include +#include #include #include #include @@ -38,6 +39,9 @@ #include #include #include + +static void l1ctl_rx_tbf_cfg_req(struct l1_model_ms *ms, struct msgb *msg); +static void l1ctl_rx_data_tbf_req(struct l1_model_ms *ms, struct msgb *msg); static void l1_model_tch_mode_set(struct l1_model_ms *ms, uint8_t tch_mode) { @@ -55,6 +59,8 @@ void l1ctl_sap_init(struct l1_model_ms *model) { INIT_LLIST_HEAD(&model->state.sched.mframe_items); + INIT_LLIST_HEAD(&model->state.tbf.ul.tx_queue); + prim_pm_init(model); } @@ -156,6 +162,8 @@ switch (msg_type) { case L1CTL_DATA_REQ: case L1CTL_DATA_CONF: + case L1CTL_DATA_TBF_REQ: + case L1CTL_DATA_TBF_CONF: case L1CTL_TRAFFIC_REQ: case L1CTL_TRAFFIC_CONF: case L1CTL_TRAFFIC_IND: @@ -238,6 +246,12 @@ case L1CTL_SIM_REQ: l1ctl_rx_sim_req(ms, msg); break; + case L1CTL_TBF_CFG_REQ: + l1ctl_rx_tbf_cfg_req(ms, msg); + break; + case L1CTL_DATA_TBF_REQ: + l1ctl_rx_data_tbf_req(ms, msg); + goto exit_nofree; } exit_msgbfree: @@ -529,12 +543,143 @@ } +static void l1ctl_tx_tbf_cfg_conf(struct l1_model_ms *ms, const struct l1ctl_tbf_cfg_req *in); + +static void l1ctl_rx_tbf_cfg_req(struct l1_model_ms *ms, struct msgb *msg) +{ + struct l1ctl_hdr *l1h = (struct l1ctl_hdr *) msg->data; + struct l1ctl_tbf_cfg_req *cfg_req = (struct l1ctl_tbf_cfg_req *) l1h->data; + unsigned int i; + + LOGPMS(DL1C, LOGL_INFO, ms, "Rx L1CTL_TBF_CFG_REQ (tbf_id=%u, dir=%s, " + "usf=[%d,%d,%d,%d,%d,%d,%d,%d]\n", cfg_req->tbf_nr, + cfg_req->is_uplink ? "UL" : "DL", cfg_req->usf[0], cfg_req->usf[1], + cfg_req->usf[2], cfg_req->usf[3], cfg_req->usf[4], cfg_req->usf[5], + cfg_req->usf[6], cfg_req->usf[7]); + + if (cfg_req->tbf_nr != 0) { + LOGPMS(DL1C, LOGL_ERROR, ms, "TBF_NR != 0 not supported yet!\n"); + return; + } + + if (ms->state.state == MS_STATE_DEDICATED) + LOGPMS(DL1C, LOGL_NOTICE, ms, "Harrd termiation of DEDICATED mode, fix L23!\n"); + + if (cfg_req->is_uplink) { + for (i = 0; i < 8; i++) + ms->state.tbf.ul.usf[i] = cfg_req->usf[i]; + } else { + for (i = 0; i < 8; i++) + ms->state.tbf.dl.tfi[i] = cfg_req->usf[i]; + } + ms->state.state = MS_STATE_TBF; + + l1ctl_tx_tbf_cfg_conf(ms, cfg_req); +} + +static const enum osmo_gprs_cs osmo_cs_by_l1ctl[] = { + [L1CTL_CS_NONE] = OSMO_GPRS_CS_NONE, + [L1CTL_CS1] = OSMO_GPRS_CS1, + [L1CTL_CS2] = OSMO_GPRS_CS2, + [L1CTL_CS3] = OSMO_GPRS_CS3, + [L1CTL_CS4] = OSMO_GPRS_CS4, + [L1CTL_MCS1] = OSMO_GPRS_MCS1, + [L1CTL_MCS2] = OSMO_GPRS_MCS2, + [L1CTL_MCS3] = OSMO_GPRS_MCS3, + [L1CTL_MCS4] = OSMO_GPRS_MCS4, + [L1CTL_MCS5] = OSMO_GPRS_MCS5, + [L1CTL_MCS6] = OSMO_GPRS_MCS6, + [L1CTL_MCS7] = OSMO_GPRS_MCS7, + [L1CTL_MCS8] = OSMO_GPRS_MCS8, + [L1CTL_MCS9] = OSMO_GPRS_MCS9, +}; + +static int get_osmo_cs_by_l1ctl(enum l1ctl_coding_scheme l1) +{ + if (l1 >= ARRAY_SIZE(osmo_cs_by_l1ctl)) + return -1; + return osmo_cs_by_l1ctl[l1]; +} + +static const enum l1ctl_coding_scheme l1ctl_cs_by_osmo[] = { + [OSMO_GPRS_CS_NONE] = L1CTL_CS_NONE, + [OSMO_GPRS_CS1] = L1CTL_CS1, + [OSMO_GPRS_CS2] = L1CTL_CS2, + [OSMO_GPRS_CS3] = L1CTL_CS3, + [OSMO_GPRS_CS4] = L1CTL_CS4, + [OSMO_GPRS_MCS1] = L1CTL_MCS1, + [OSMO_GPRS_MCS2] = L1CTL_MCS2, + [OSMO_GPRS_MCS3] = L1CTL_MCS3, + [OSMO_GPRS_MCS4] = L1CTL_MCS4, + [OSMO_GPRS_MCS5] = L1CTL_MCS5, + [OSMO_GPRS_MCS6] = L1CTL_MCS6, + [OSMO_GPRS_MCS7] = L1CTL_MCS7, + [OSMO_GPRS_MCS8] = L1CTL_MCS8, + [OSMO_GPRS_MCS9] = L1CTL_MCS9, +}; + +static int get_l1ctl_cs_by_osmo(enum osmo_gprs_cs in) +{ + if (in >= ARRAY_SIZE(l1ctl_cs_by_osmo)) + return -1; + return l1ctl_cs_by_osmo[in]; +} + +static void l1ctl_rx_data_tbf_req(struct l1_model_ms *ms, struct msgb *msg) +{ + struct l1ctl_hdr *l1h = (struct l1ctl_hdr *) msg->data; + struct l1ctl_info_ul_tbf *udt = (struct l1ctl_info_ul_tbf *) l1h->data; + enum osmo_gprs_cs osmo_cs; + int block_size; + + msg->l2h = udt->payload; + + LOGPMS(DL1P, LOGL_ERROR, ms, "Rx L1CTL_DATA_TBF_REQ (tbf_id=%d, data=%s)\n", + udt->tbf_nr, osmo_hexdump(msg->l2h, msgb_l2len(msg))); + if (udt->tbf_nr != 0) { + LOGPMS(DL1C, LOGL_ERROR, ms, "TBF_NR != 0 not supported yet!\n"); + return; + } + + if (ms->state.state != MS_STATE_TBF) { + LOGPMS(DL1P, LOGL_ERROR, ms, "DATA_TBF_REQ in state != TBF\n"); + return; + } + + osmo_cs = get_l1ctl_cs_by_osmo(udt->coding_scheme); + if (osmo_cs < 0) { + LOGPMS(DL1P, LOGL_ERROR, ms, "DATA_RBF_REQ with invalid CS\n"); + return; + } + block_size = osmo_gprs_ul_block_size_bytes(osmo_cs); + + if (msgb_l2len(msg) < block_size) { + int pad_len = block_size - msgb_l2len(msg); + uint8_t *pad = msgb_put(msg, pad_len); + memset(pad, GSM_MACBLOCK_PADDING, pad_len); + } + + msgb_enqueue(&ms->state.tbf.ul.tx_queue, msg); +} + /*************************************************************** * L1CTL TX ROUTINES ******************************************* * For more routines check the respective handler classes ****** * like virt_prim_rach.c *************************************** ***************************************************************/ +static void l1ctl_tx_tbf_cfg_conf(struct l1_model_ms *ms, const struct l1ctl_tbf_cfg_req *in) +{ + struct msgb *msg = l1ctl_msgb_alloc(L1CTL_TBF_CFG_CONF); + struct l1ctl_tbf_cfg_req *out; + + /* copy over the data from the request */ + out = (struct l1ctl_tbf_cfg_req *) msgb_put(msg, sizeof(*out)); + *out = *in; + + l1ctl_sap_tx_to_l23_inst(ms, msg); +} + /** * @brief Transmit L1CTL_RESET_IND or L1CTL_RESET_CONF to layer 23. * -- To view, visit https://gerrit.osmocom.org/3569 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ie6f37090bd45f463aa25d9e00bc06f563be5264a Gerrit-PatchSet: 1 Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Sun Aug 20 20:21:44 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 20 Aug 2017 20:21:44 +0000 Subject: osmocom-bb[master]: virtphy: Add SIGINT+SIGTERM handlers In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3566 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I2fe65e0c1912c4d72c276a2db169f0bdbcbda2b8 Gerrit-PatchSet: 1 Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sun Aug 20 20:21:45 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 20 Aug 2017 20:21:45 +0000 Subject: [MERGED] osmocom-bb[master]: virtphy: Add SIGINT+SIGTERM handlers In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: virtphy: Add SIGINT+SIGTERM handlers ...................................................................... virtphy: Add SIGINT+SIGTERM handlers Change-Id: I2fe65e0c1912c4d72c276a2db169f0bdbcbda2b8 --- M src/host/virt_phy/src/virtphy.c 1 file changed, 6 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/host/virt_phy/src/virtphy.c b/src/host/virt_phy/src/virtphy.c index 412b742..153f890 100644 --- a/src/host/virt_phy/src/virtphy.c +++ b/src/host/virt_phy/src/virtphy.c @@ -177,6 +177,10 @@ LOGP(DMAIN, LOGL_NOTICE, "Signal %d received\n", signum); switch (signum) { + case SIGINT: + case SIGTERM: + exit(0); + break; case SIGUSR1: talloc_report_full(tall_vphy_ctx, stderr); break; @@ -190,6 +194,8 @@ tall_vphy_ctx = talloc_named_const(NULL, 1, "root"); msgb_talloc_ctx_init(tall_vphy_ctx, 0); + signal(SIGINT, &signal_handler); + signal(SIGTERM, &signal_handler); signal(SIGUSR1, &signal_handler); osmo_init_ignore_signals(); -- To view, visit https://gerrit.osmocom.org/3566 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I2fe65e0c1912c4d72c276a2db169f0bdbcbda2b8 Gerrit-PatchSet: 1 Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sun Aug 20 20:21:53 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 20 Aug 2017 20:21:53 +0000 Subject: osmocom-bb[master]: VIRT-PHY: Support forwarding of CBCH similar to BCCH/CCCH In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3567 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I3e6f936603e43e885b28953be5ac262e3fb7c09a Gerrit-PatchSet: 1 Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sun Aug 20 20:21:55 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 20 Aug 2017 20:21:55 +0000 Subject: [MERGED] osmocom-bb[master]: VIRT-PHY: Support forwarding of CBCH similar to BCCH/CCCH In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: VIRT-PHY: Support forwarding of CBCH similar to BCCH/CCCH ...................................................................... VIRT-PHY: Support forwarding of CBCH similar to BCCH/CCCH Change-Id: I3e6f936603e43e885b28953be5ac262e3fb7c09a --- M src/host/virt_phy/src/gsmtapl1_if.c 1 file changed, 2 insertions(+), 2 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/host/virt_phy/src/gsmtapl1_if.c b/src/host/virt_phy/src/gsmtapl1_if.c index 5454022..df1c124 100644 --- a/src/host/virt_phy/src/gsmtapl1_if.c +++ b/src/host/virt_phy/src/gsmtapl1_if.c @@ -154,6 +154,8 @@ case GSMTAP_CHANNEL_AGCH: case GSMTAP_CHANNEL_PCH: case GSMTAP_CHANNEL_BCCH: + case GSMTAP_CHANNEL_CBCH51: + case GSMTAP_CHANNEL_CBCH52: /* save to just forward here, as upper layer ignores messages that * do not fit the current state (e.g. gsm48_rr.c:2159) */ l1ctl_tx_data_ind(ms, msg, arfcn, link_id, chan_nr, fn, snr_db, signal_dbm, 0, 0); @@ -166,8 +168,6 @@ case GSMTAP_CHANNEL_PACCH: case GSMTAP_CHANNEL_PDCH: case GSMTAP_CHANNEL_PTCCH: - case GSMTAP_CHANNEL_CBCH51: - case GSMTAP_CHANNEL_CBCH52: LOGPMS(DVIRPHY, LOGL_NOTICE, ms, "Ignoring unsupported channel type %s\n", get_value_string(gsmtap_gsm_channel_names, gsmtap_chantype)); break; -- To view, visit https://gerrit.osmocom.org/3567 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I3e6f936603e43e885b28953be5ac262e3fb7c09a Gerrit-PatchSet: 1 Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sun Aug 20 20:22:16 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 20 Aug 2017 20:22:16 +0000 Subject: osmocom-bb[master]: VIRT-PHY: virt_l1_sched: Pass timeslot number into call-back In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3568 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I608a91ae8e2a57a2d6f87f4b873c82edb0215bf6 Gerrit-PatchSet: 1 Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sun Aug 20 20:22:17 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 20 Aug 2017 20:22:17 +0000 Subject: [MERGED] osmocom-bb[master]: VIRT-PHY: virt_l1_sched: Pass timeslot number into call-back In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: VIRT-PHY: virt_l1_sched: Pass timeslot number into call-back ...................................................................... VIRT-PHY: virt_l1_sched: Pass timeslot number into call-back When we schedule a given frame for transmission, we save its timeslot number. However, the callback doesn't get informed about this so far. Change-Id: I608a91ae8e2a57a2d6f87f4b873c82edb0215bf6 --- M src/host/virt_phy/include/virtphy/gsmtapl1_if.h M src/host/virt_phy/include/virtphy/virt_l1_sched.h M src/host/virt_phy/src/gsmtapl1_if.c M src/host/virt_phy/src/virt_l1_sched_simple.c M src/host/virt_phy/src/virt_prim_data.c M src/host/virt_phy/src/virt_prim_rach.c M src/host/virt_phy/src/virt_prim_traffic.c 7 files changed, 10 insertions(+), 10 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/host/virt_phy/include/virtphy/gsmtapl1_if.h b/src/host/virt_phy/include/virtphy/gsmtapl1_if.h index 125ec11..8dab6b2 100644 --- a/src/host/virt_phy/include/virtphy/gsmtapl1_if.h +++ b/src/host/virt_phy/include/virtphy/gsmtapl1_if.h @@ -9,4 +9,4 @@ void gsmtapl1_init(struct l1_model_ms *model); void gsmtapl1_rx_from_virt_um_inst_cb(struct virt_um_inst *vui, struct msgb *msg); -void gsmtapl1_tx_to_virt_um_inst(struct l1_model_ms *ms, uint32_t fn, struct msgb *msg); +void gsmtapl1_tx_to_virt_um_inst(struct l1_model_ms *ms, uint32_t fn, uint8_t tn, struct msgb *msg); diff --git a/src/host/virt_phy/include/virtphy/virt_l1_sched.h b/src/host/virt_phy/include/virtphy/virt_l1_sched.h index f3e9b84..b8d401f 100644 --- a/src/host/virt_phy/include/virtphy/virt_l1_sched.h +++ b/src/host/virt_phy/include/virtphy/virt_l1_sched.h @@ -7,7 +7,7 @@ struct l1_model_ms; -typedef void virt_l1_sched_cb(struct l1_model_ms *ms, uint32_t fn, struct msgb * msg); +typedef void virt_l1_sched_cb(struct l1_model_ms *ms, uint32_t fn, uint8_t tn, struct msgb * msg); /* bucket containing items to be executed for a specific mframe number */ struct virt_l1_sched_mframe_item { diff --git a/src/host/virt_phy/src/gsmtapl1_if.c b/src/host/virt_phy/src/gsmtapl1_if.c index df1c124..8202046 100644 --- a/src/host/virt_phy/src/gsmtapl1_if.c +++ b/src/host/virt_phy/src/gsmtapl1_if.c @@ -51,7 +51,7 @@ /** * Replace l11 header of given msgb by a gsmtap header and send it over the virt um. */ -void gsmtapl1_tx_to_virt_um_inst(struct l1_model_ms *ms, uint32_t fn, struct msgb *msg) +void gsmtapl1_tx_to_virt_um_inst(struct l1_model_ms *ms, uint32_t fn, uint8_t tn, struct msgb *msg) { struct l1ctl_hdr *l1h = (struct l1ctl_hdr *)msg->data; struct l1ctl_info_ul *ul = (struct l1ctl_info_ul *)l1h->data; diff --git a/src/host/virt_phy/src/virt_l1_sched_simple.c b/src/host/virt_phy/src/virt_l1_sched_simple.c index ba8298f..4737135 100644 --- a/src/host/virt_phy/src/virt_l1_sched_simple.c +++ b/src/host/virt_phy/src/virt_l1_sched_simple.c @@ -94,7 +94,7 @@ /* exec tdma sched item's handler callback */ /* TODO: we do not have a TDMA scheduler currently and execute * all scheduled tdma items here at once */ - ti_next->handler_cb(ms, mi_next->fn, ti_next->msg); + ti_next->handler_cb(ms, mi_next->fn, ti_next->ts, ti_next->msg); /* remove handled tdma sched item */ llist_del(&ti_next->tdma_item_entry); } diff --git a/src/host/virt_phy/src/virt_prim_data.c b/src/host/virt_phy/src/virt_prim_data.c index 8931cf9..96534aa 100644 --- a/src/host/virt_phy/src/virt_prim_data.c +++ b/src/host/virt_phy/src/virt_prim_data.c @@ -44,9 +44,9 @@ * @param [in] fn frame number * @param [in] msg the msg to sent over virtual um. */ -static void virt_l1_sched_handler_cb(struct l1_model_ms *ms, uint32_t fn, struct msgb * msg) +static void virt_l1_sched_handler_cb(struct l1_model_ms *ms, uint32_t fn, uint8_t tn, struct msgb * msg) { - gsmtapl1_tx_to_virt_um_inst(ms, fn, msg); + gsmtapl1_tx_to_virt_um_inst(ms, fn, tn, msg); l1ctl_tx_data_conf(ms, fn, 0, ms->state.serving_cell.arfcn); } diff --git a/src/host/virt_phy/src/virt_prim_rach.c b/src/host/virt_phy/src/virt_prim_rach.c index 8fb0e2f..94076cf 100644 --- a/src/host/virt_phy/src/virt_prim_rach.c +++ b/src/host/virt_phy/src/virt_prim_rach.c @@ -56,9 +56,9 @@ * * @param [in] msg the msg to sent over virtual um. */ -static void virt_l1_sched_handler_cb(struct l1_model_ms *ms, uint32_t fn, struct msgb *msg) +static void virt_l1_sched_handler_cb(struct l1_model_ms *ms, uint32_t fn, uint8_t tn, struct msgb *msg) { - gsmtapl1_tx_to_virt_um_inst(ms, fn, msg); + gsmtapl1_tx_to_virt_um_inst(ms, fn, tn, msg); l1ctl_tx_rach_conf(ms, fn, ms->state.serving_cell.arfcn); } diff --git a/src/host/virt_phy/src/virt_prim_traffic.c b/src/host/virt_phy/src/virt_prim_traffic.c index 6798bc1..4e58de6 100644 --- a/src/host/virt_phy/src/virt_prim_traffic.c +++ b/src/host/virt_phy/src/virt_prim_traffic.c @@ -44,9 +44,9 @@ * @param [in] fn frame number * @param [in] msg the msg to sent over virtual um. */ -static void virt_l1_sched_handler_cb(struct l1_model_ms *ms, uint32_t fn, struct msgb * msg) +static void virt_l1_sched_handler_cb(struct l1_model_ms *ms, uint32_t fn, uint8_t tn, struct msgb * msg) { - gsmtapl1_tx_to_virt_um_inst(ms, fn, msg); + gsmtapl1_tx_to_virt_um_inst(ms, fn, tn, msg); l1ctl_tx_traffic_conf(ms, fn, 0, ms->state.serving_cell.arfcn); } -- To view, visit https://gerrit.osmocom.org/3568 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I608a91ae8e2a57a2d6f87f4b873c82edb0215bf6 Gerrit-PatchSet: 1 Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sun Aug 20 20:23:40 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 20 Aug 2017 20:23:40 +0000 Subject: osmocom-bb[master]: VIRT-PHY: Add support for GPRS / TBF mode In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3569 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ie6f37090bd45f463aa25d9e00bc06f563be5264a Gerrit-PatchSet: 1 Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sun Aug 20 20:23:41 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 20 Aug 2017 20:23:41 +0000 Subject: [MERGED] osmocom-bb[master]: VIRT-PHY: Add support for GPRS / TBF mode In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: VIRT-PHY: Add support for GPRS / TBF mode ...................................................................... VIRT-PHY: Add support for GPRS / TBF mode we add a new STATE_TBF to vthe MS model and add some L1CTL primitives to configure that TBF mode as well as to enqueue transmissions for blocks at a given USF+TS. Change-Id: Ie6f37090bd45f463aa25d9e00bc06f563be5264a --- M include/l1ctl_proto.h M src/host/virt_phy/include/virtphy/virt_l1_model.h M src/host/virt_phy/src/gsmtapl1_if.c M src/host/virt_phy/src/l1ctl_sap.c 4 files changed, 293 insertions(+), 5 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/include/l1ctl_proto.h b/include/l1ctl_proto.h index 771bf1c..37d3d87 100644 --- a/include/l1ctl_proto.h +++ b/include/l1ctl_proto.h @@ -56,6 +56,13 @@ L1CTL_TRAFFIC_REQ, L1CTL_TRAFFIC_CONF, L1CTL_TRAFFIC_IND, + + /* configure TBF for uplink/downlink */ + L1CTL_TBF_CFG_REQ, + L1CTL_TBF_CFG_CONF, + + L1CTL_DATA_TBF_REQ, + L1CTL_DATA_TBF_CONF, }; enum ccch_mode { @@ -68,6 +75,23 @@ NEIGH_MODE_NONE = 0, NEIGH_MODE_PM, NEIGH_MODE_SB, +}; + +enum l1ctl_coding_scheme { + L1CTL_CS_NONE, + L1CTL_CS1, + L1CTL_CS2, + L1CTL_CS3, + L1CTL_CS4, + L1CTL_MCS1, + L1CTL_MCS2, + L1CTL_MCS3, + L1CTL_MCS4, + L1CTL_MCS5, + L1CTL_MCS6, + L1CTL_MCS7, + L1CTL_MCS8, + L1CTL_MCS9, }; #define TRAFFIC_DATA_LEN 40 @@ -149,6 +173,15 @@ uint8_t link_id; uint8_t padding[2]; + uint8_t payload[0]; +} __attribute__((packed)); + +struct l1ctl_info_ul_tbf { + /* references l1ctl_tbf_cfg_req.tbf_nr */ + uint8_t tbf_nr; + uint8_t coding_scheme; + uint8_t padding[2]; + /* RLC/MAC block, size determines CS */ uint8_t payload[0]; } __attribute__((packed)); @@ -300,4 +333,15 @@ uint8_t data[TRAFFIC_DATA_LEN]; } __attribute__((packed)); +struct l1ctl_tbf_cfg_req { + /* future support for multiple concurrent TBFs. 0 for now */ + uint8_t tbf_nr; + /* is this about an UL TBF (1) or DL (0) */ + uint8_t is_uplink; + uint8_t padding[2]; + + /* one USF for each TN, or 255 for invalid/unused */ + uint8_t usf[8]; +} __attribute__((packed)); + #endif /* __L1CTL_PROTO_H__ */ diff --git a/src/host/virt_phy/include/virtphy/virt_l1_model.h b/src/host/virt_phy/include/virtphy/virt_l1_model.h index fa79127..67c24bb 100644 --- a/src/host/virt_phy/include/virtphy/virt_l1_model.h +++ b/src/host/virt_phy/include/virtphy/virt_l1_model.h @@ -15,6 +15,7 @@ MS_STATE_IDLE_SYNCING, MS_STATE_IDLE_CAMPING, MS_STATE_DEDICATED, + MS_STATE_TBF }; @@ -74,6 +75,15 @@ uint8_t tsc; // training sequence code (ununsed in virtual um) uint8_t h; // hopping enabled flag (ununsed in virtual um) } dedicated; + struct { + struct { + uint8_t usf[8]; + struct llist_head tx_queue; + } ul; + struct { + uint8_t tfi[8]; + } dl; + } tbf; /* fbsb state */ struct { diff --git a/src/host/virt_phy/src/gsmtapl1_if.c b/src/host/virt_phy/src/gsmtapl1_if.c index 8202046..2cf9d2d 100644 --- a/src/host/virt_phy/src/gsmtapl1_if.c +++ b/src/host/virt_phy/src/gsmtapl1_if.c @@ -54,7 +54,7 @@ void gsmtapl1_tx_to_virt_um_inst(struct l1_model_ms *ms, uint32_t fn, uint8_t tn, struct msgb *msg) { struct l1ctl_hdr *l1h = (struct l1ctl_hdr *)msg->data; - struct l1ctl_info_ul *ul = (struct l1ctl_info_ul *)l1h->data; + struct l1ctl_info_ul *ul; struct gsmtap_hdr *gh; struct msgb *outmsg; /* msg to send with gsmtap header prepended */ uint16_t arfcn = ms->state.serving_cell.arfcn; /* arfcn of the cell we currently camp on */ @@ -68,8 +68,20 @@ uint8_t timeslot; /* tdma timeslot to send in (0-7) */ uint8_t gsmtap_chan; /* the gsmtap channel */ - rsl_dec_chan_nr(ul->chan_nr, &rsl_chantype, &subslot, ×lot); - gsmtap_chan = chantype_rsl2gsmtap(rsl_chantype, ul->link_id); + switch (l1h->msg_type) { + case L1CTL_DATA_TBF_REQ: + ul = NULL; + rsl_chantype = RSL_CHAN_OSMO_PDCH; + timeslot = tn; + subslot = 0; + gsmtap_chan = chantype_rsl2gsmtap(rsl_chantype, 0); + break; + default: + ul = (struct l1ctl_info_ul *)l1h->data; + rsl_dec_chan_nr(ul->chan_nr, &rsl_chantype, &subslot, ×lot); + gsmtap_chan = chantype_rsl2gsmtap(rsl_chantype, ul->link_id); + break; + } /* arfcn needs to be flagged to be able to distinguish between uplink and downlink */ outmsg = gsmtap_makemsg(arfcn | GSMTAP_ARFCN_F_UPLINK, timeslot, @@ -104,6 +116,77 @@ */ extern uint16_t prim_pm_set_sig_strength(struct l1_model_ms *ms, uint16_t arfcn, int16_t sig_lev); +/* determine if a received Downlink RLC/MAC block matches the current MS configuration */ +static bool gprs_dl_block_matches_ms(struct l1_model_ms *ms, struct msgb *msg, uint8_t timeslot) +{ + uint8_t payload_type; + uint8_t tfi; + + if (msgb_length(msg) < 1) + return false; + + /* FIXME: Ensure this will also work for EGPRS! */ + payload_type = msg->data[0] >> 6; + switch (payload_type) { + case 0: /* RLC Data Block */ + /* forward all RLD Data Blocks destined for TFI of MS */ + tfi = (msg->data[1] >> 1) & 0x1f; + if (ms->state.state == MS_STATE_TBF && ms->state.tbf.dl.tfi[timeslot] == tfi) + return true; + break; + case 1: /* RLC/MAC Control without optional octets */ + /* forward all RLC/MAC control blocks without optional octets, i.e. not adressed + * to a specific TFI */ + return true; + case 2: /* RLC/MAC with optional control octets */ + /* forward all RLD Control Blocks destined for TFI of MS */ + tfi = (msg->data[2] >> 1) & 0x1f; + if (ms->state.state == MS_STATE_TBF && ms->state.tbf.dl.tfi[timeslot] == tfi) + return true; + break; + default: + break; + } + return false; +} + +/* determine if given USF at given timeslot is relevant to given MS or not */ +static bool usf_matches_ms(struct l1_model_ms *ms, uint8_t usf, uint8_t timeslot) +{ + if (ms->state.state == MS_STATE_TBF && ms->state.tbf.ul.usf[timeslot] == usf) + return true; + + return false; +} + +/* extract USF from (E)GPRS RLC/MAC block */ +static uint8_t get_usf_from_block(struct msgb *msg) +{ + /* FIXME: Ensure this will also work for EGPRS! */ + return msg->data[0] & 0x7; +} + +/* MS is authorized to transmit a block in uplink for given USF on timeslot+arfcn at FN */ +static void ms_ul_tbf_may_transmit(struct l1_model_ms *ms, uint16_t arfcn, uint8_t timeslot, + uint32_t fn, uint8_t usf) +{ + struct msgb *msg; + + /* If USF is not for us, bail out */ + if (!usf_matches_ms(ms, usf, timeslot)) + return; + + /* attempt to de-queue pending msgb for this UL TBF and transmit it */ + msg = msgb_dequeue(&ms->state.tbf.ul.tx_queue); + if (!msg) { + printf("FN=%u, TN=%u, USF=%u: empty tx_queue, not transmitting\n", fn, timeslot, usf); + /* FIXME: send some dummy control frame? */ + } else { + printf("FN=%u, TN=%u, USF=%u: transmitting queued msg\n", fn, timeslot, usf); + gsmtapl1_tx_to_virt_um_inst(ms, fn, timeslot, msg); + } +} + static void l1ctl_from_virt_um(struct l1ctl_sock_client *lsc, struct msgb *msg, uint32_t fn, uint16_t arfcn, uint8_t timeslot, uint8_t subslot, uint8_t gsmtap_chantype, uint8_t chan_nr, uint8_t link_id, @@ -111,6 +194,7 @@ { struct l1_model_ms *ms = lsc->priv; uint8_t signal_dbm = dbm2rxlev(prim_pm_set_sig_strength(ms, arfcn & GSMTAP_ARFCN_MASK, MAX_SIG_LEV_DBM)); /* Power measurement with each received massage */ + uint8_t usf; gsm_fn2gsmtime(&ms->state.downlink_time, fn); @@ -163,10 +247,15 @@ case GSMTAP_CHANNEL_RACH: LOGPMS(DVIRPHY, LOGL_NOTICE, ms, "Ignoring unexpected RACH in downlink ?!?\n"); break; - case GSMTAP_CHANNEL_SDCCH: - case GSMTAP_CHANNEL_CCCH: case GSMTAP_CHANNEL_PACCH: case GSMTAP_CHANNEL_PDCH: + if (gprs_dl_block_matches_ms(ms, msg, timeslot)) + l1ctl_tx_data_ind(ms, msg, arfcn, link_id, chan_nr, fn, snr_db, signal_dbm, 0, 0); + usf = get_usf_from_block(msg); + ms_ul_tbf_may_transmit(ms, arfcn, timeslot, fn, usf); + break; + case GSMTAP_CHANNEL_SDCCH: + case GSMTAP_CHANNEL_CCCH: case GSMTAP_CHANNEL_PTCCH: LOGPMS(DVIRPHY, LOGL_NOTICE, ms, "Ignoring unsupported channel type %s\n", get_value_string(gsmtap_gsm_channel_names, gsmtap_chantype)); diff --git a/src/host/virt_phy/src/l1ctl_sap.c b/src/host/virt_phy/src/l1ctl_sap.c index d4b33f1..aac49bf 100644 --- a/src/host/virt_phy/src/l1ctl_sap.c +++ b/src/host/virt_phy/src/l1ctl_sap.c @@ -27,6 +27,7 @@ #include #include #include +#include #include #include #include @@ -38,6 +39,9 @@ #include #include #include + +static void l1ctl_rx_tbf_cfg_req(struct l1_model_ms *ms, struct msgb *msg); +static void l1ctl_rx_data_tbf_req(struct l1_model_ms *ms, struct msgb *msg); static void l1_model_tch_mode_set(struct l1_model_ms *ms, uint8_t tch_mode) { @@ -55,6 +59,8 @@ void l1ctl_sap_init(struct l1_model_ms *model) { INIT_LLIST_HEAD(&model->state.sched.mframe_items); + INIT_LLIST_HEAD(&model->state.tbf.ul.tx_queue); + prim_pm_init(model); } @@ -156,6 +162,8 @@ switch (msg_type) { case L1CTL_DATA_REQ: case L1CTL_DATA_CONF: + case L1CTL_DATA_TBF_REQ: + case L1CTL_DATA_TBF_CONF: case L1CTL_TRAFFIC_REQ: case L1CTL_TRAFFIC_CONF: case L1CTL_TRAFFIC_IND: @@ -238,6 +246,12 @@ case L1CTL_SIM_REQ: l1ctl_rx_sim_req(ms, msg); break; + case L1CTL_TBF_CFG_REQ: + l1ctl_rx_tbf_cfg_req(ms, msg); + break; + case L1CTL_DATA_TBF_REQ: + l1ctl_rx_data_tbf_req(ms, msg); + goto exit_nofree; } exit_msgbfree: @@ -529,12 +543,143 @@ } +static void l1ctl_tx_tbf_cfg_conf(struct l1_model_ms *ms, const struct l1ctl_tbf_cfg_req *in); + +static void l1ctl_rx_tbf_cfg_req(struct l1_model_ms *ms, struct msgb *msg) +{ + struct l1ctl_hdr *l1h = (struct l1ctl_hdr *) msg->data; + struct l1ctl_tbf_cfg_req *cfg_req = (struct l1ctl_tbf_cfg_req *) l1h->data; + unsigned int i; + + LOGPMS(DL1C, LOGL_INFO, ms, "Rx L1CTL_TBF_CFG_REQ (tbf_id=%u, dir=%s, " + "usf=[%d,%d,%d,%d,%d,%d,%d,%d]\n", cfg_req->tbf_nr, + cfg_req->is_uplink ? "UL" : "DL", cfg_req->usf[0], cfg_req->usf[1], + cfg_req->usf[2], cfg_req->usf[3], cfg_req->usf[4], cfg_req->usf[5], + cfg_req->usf[6], cfg_req->usf[7]); + + if (cfg_req->tbf_nr != 0) { + LOGPMS(DL1C, LOGL_ERROR, ms, "TBF_NR != 0 not supported yet!\n"); + return; + } + + if (ms->state.state == MS_STATE_DEDICATED) + LOGPMS(DL1C, LOGL_NOTICE, ms, "Harrd termiation of DEDICATED mode, fix L23!\n"); + + if (cfg_req->is_uplink) { + for (i = 0; i < 8; i++) + ms->state.tbf.ul.usf[i] = cfg_req->usf[i]; + } else { + for (i = 0; i < 8; i++) + ms->state.tbf.dl.tfi[i] = cfg_req->usf[i]; + } + ms->state.state = MS_STATE_TBF; + + l1ctl_tx_tbf_cfg_conf(ms, cfg_req); +} + +static const enum osmo_gprs_cs osmo_cs_by_l1ctl[] = { + [L1CTL_CS_NONE] = OSMO_GPRS_CS_NONE, + [L1CTL_CS1] = OSMO_GPRS_CS1, + [L1CTL_CS2] = OSMO_GPRS_CS2, + [L1CTL_CS3] = OSMO_GPRS_CS3, + [L1CTL_CS4] = OSMO_GPRS_CS4, + [L1CTL_MCS1] = OSMO_GPRS_MCS1, + [L1CTL_MCS2] = OSMO_GPRS_MCS2, + [L1CTL_MCS3] = OSMO_GPRS_MCS3, + [L1CTL_MCS4] = OSMO_GPRS_MCS4, + [L1CTL_MCS5] = OSMO_GPRS_MCS5, + [L1CTL_MCS6] = OSMO_GPRS_MCS6, + [L1CTL_MCS7] = OSMO_GPRS_MCS7, + [L1CTL_MCS8] = OSMO_GPRS_MCS8, + [L1CTL_MCS9] = OSMO_GPRS_MCS9, +}; + +static int get_osmo_cs_by_l1ctl(enum l1ctl_coding_scheme l1) +{ + if (l1 >= ARRAY_SIZE(osmo_cs_by_l1ctl)) + return -1; + return osmo_cs_by_l1ctl[l1]; +} + +static const enum l1ctl_coding_scheme l1ctl_cs_by_osmo[] = { + [OSMO_GPRS_CS_NONE] = L1CTL_CS_NONE, + [OSMO_GPRS_CS1] = L1CTL_CS1, + [OSMO_GPRS_CS2] = L1CTL_CS2, + [OSMO_GPRS_CS3] = L1CTL_CS3, + [OSMO_GPRS_CS4] = L1CTL_CS4, + [OSMO_GPRS_MCS1] = L1CTL_MCS1, + [OSMO_GPRS_MCS2] = L1CTL_MCS2, + [OSMO_GPRS_MCS3] = L1CTL_MCS3, + [OSMO_GPRS_MCS4] = L1CTL_MCS4, + [OSMO_GPRS_MCS5] = L1CTL_MCS5, + [OSMO_GPRS_MCS6] = L1CTL_MCS6, + [OSMO_GPRS_MCS7] = L1CTL_MCS7, + [OSMO_GPRS_MCS8] = L1CTL_MCS8, + [OSMO_GPRS_MCS9] = L1CTL_MCS9, +}; + +static int get_l1ctl_cs_by_osmo(enum osmo_gprs_cs in) +{ + if (in >= ARRAY_SIZE(l1ctl_cs_by_osmo)) + return -1; + return l1ctl_cs_by_osmo[in]; +} + +static void l1ctl_rx_data_tbf_req(struct l1_model_ms *ms, struct msgb *msg) +{ + struct l1ctl_hdr *l1h = (struct l1ctl_hdr *) msg->data; + struct l1ctl_info_ul_tbf *udt = (struct l1ctl_info_ul_tbf *) l1h->data; + enum osmo_gprs_cs osmo_cs; + int block_size; + + msg->l2h = udt->payload; + + LOGPMS(DL1P, LOGL_ERROR, ms, "Rx L1CTL_DATA_TBF_REQ (tbf_id=%d, data=%s)\n", + udt->tbf_nr, osmo_hexdump(msg->l2h, msgb_l2len(msg))); + if (udt->tbf_nr != 0) { + LOGPMS(DL1C, LOGL_ERROR, ms, "TBF_NR != 0 not supported yet!\n"); + return; + } + + if (ms->state.state != MS_STATE_TBF) { + LOGPMS(DL1P, LOGL_ERROR, ms, "DATA_TBF_REQ in state != TBF\n"); + return; + } + + osmo_cs = get_l1ctl_cs_by_osmo(udt->coding_scheme); + if (osmo_cs < 0) { + LOGPMS(DL1P, LOGL_ERROR, ms, "DATA_RBF_REQ with invalid CS\n"); + return; + } + block_size = osmo_gprs_ul_block_size_bytes(osmo_cs); + + if (msgb_l2len(msg) < block_size) { + int pad_len = block_size - msgb_l2len(msg); + uint8_t *pad = msgb_put(msg, pad_len); + memset(pad, GSM_MACBLOCK_PADDING, pad_len); + } + + msgb_enqueue(&ms->state.tbf.ul.tx_queue, msg); +} + /*************************************************************** * L1CTL TX ROUTINES ******************************************* * For more routines check the respective handler classes ****** * like virt_prim_rach.c *************************************** ***************************************************************/ +static void l1ctl_tx_tbf_cfg_conf(struct l1_model_ms *ms, const struct l1ctl_tbf_cfg_req *in) +{ + struct msgb *msg = l1ctl_msgb_alloc(L1CTL_TBF_CFG_CONF); + struct l1ctl_tbf_cfg_req *out; + + /* copy over the data from the request */ + out = (struct l1ctl_tbf_cfg_req *) msgb_put(msg, sizeof(*out)); + *out = *in; + + l1ctl_sap_tx_to_l23_inst(ms, msg); +} + /** * @brief Transmit L1CTL_RESET_IND or L1CTL_RESET_CONF to layer 23. * -- To view, visit https://gerrit.osmocom.org/3569 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ie6f37090bd45f463aa25d9e00bc06f563be5264a Gerrit-PatchSet: 1 Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sun Aug 20 20:27:09 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 20 Aug 2017 20:27:09 +0000 Subject: [MERGED] openbsc[master]: Treat SIGTERM just like SIGINT in our programs In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Treat SIGTERM just like SIGINT in our programs ...................................................................... Treat SIGTERM just like SIGINT in our programs When somebody kills the process, it's best to handle the signal and to use the opportunity for some cleanup. We always did this in the NITB on SIGINT, but never on SIGTERM. Let's change it. Change-Id: Iea6804325a6575ceab5edfd28dd20249462f143b --- M openbsc/src/gprs/gb_proxy_main.c M openbsc/src/gprs/gtphub_main.c M openbsc/src/gprs/sgsn_main.c M openbsc/src/osmo-bsc/osmo_bsc_main.c M openbsc/src/osmo-nitb/bsc_hack.c 5 files changed, 10 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/openbsc/src/gprs/gb_proxy_main.c b/openbsc/src/gprs/gb_proxy_main.c index 69a93b6..caff27f 100644 --- a/openbsc/src/gprs/gb_proxy_main.c +++ b/openbsc/src/gprs/gb_proxy_main.c @@ -98,6 +98,7 @@ switch (signal) { case SIGINT: + case SIGTERM: osmo_signal_dispatch(SS_L_GLOBAL, S_L_GLOBAL_SHUTDOWN, NULL); sleep(1); exit(0); @@ -232,6 +233,7 @@ msgb_talloc_ctx_init(tall_bsc_ctx, 0); signal(SIGINT, &signal_handler); + signal(SIGTERM, &signal_handler); signal(SIGABRT, &signal_handler); signal(SIGUSR1, &signal_handler); signal(SIGUSR2, &signal_handler); diff --git a/openbsc/src/gprs/gtphub_main.c b/openbsc/src/gprs/gtphub_main.c index 73a122c..2b87d19 100644 --- a/openbsc/src/gprs/gtphub_main.c +++ b/openbsc/src/gprs/gtphub_main.c @@ -96,6 +96,7 @@ switch (signal) { case SIGINT: + case SIGTERM: osmo_signal_dispatch(SS_L_GLOBAL, S_L_GLOBAL_SHUTDOWN, NULL); sleep(1); exit(0); @@ -302,6 +303,7 @@ msgb_talloc_ctx_init(osmo_gtphub_ctx, 0); signal(SIGINT, &signal_handler); + signal(SIGTERM, &signal_handler); signal(SIGABRT, &signal_handler); signal(SIGUSR1, &signal_handler); signal(SIGUSR2, &signal_handler); diff --git a/openbsc/src/gprs/sgsn_main.c b/openbsc/src/gprs/sgsn_main.c index 04f2825..c1da585 100644 --- a/openbsc/src/gprs/sgsn_main.c +++ b/openbsc/src/gprs/sgsn_main.c @@ -142,6 +142,7 @@ switch (signal) { case SIGINT: + case SIGTERM: osmo_signal_dispatch(SS_L_GLOBAL, S_L_GLOBAL_SHUTDOWN, NULL); sleep(1); exit(0); @@ -335,6 +336,7 @@ msgb_talloc_ctx_init(tall_bsc_ctx, 0); signal(SIGINT, &signal_handler); + signal(SIGTERM, &signal_handler); signal(SIGABRT, &signal_handler); signal(SIGUSR1, &signal_handler); signal(SIGUSR2, &signal_handler); diff --git a/openbsc/src/osmo-bsc/osmo_bsc_main.c b/openbsc/src/osmo-bsc/osmo_bsc_main.c index ee094d6..90651b9 100644 --- a/openbsc/src/osmo-bsc/osmo_bsc_main.c +++ b/openbsc/src/osmo-bsc/osmo_bsc_main.c @@ -162,6 +162,7 @@ switch (signal) { case SIGINT: + case SIGTERM: bsc_shutdown_net(bsc_gsmnet); osmo_signal_dispatch(SS_L_GLOBAL, S_L_GLOBAL_SHUTDOWN, NULL); sleep(3); @@ -280,6 +281,7 @@ } signal(SIGINT, &signal_handler); + signal(SIGTERM, &signal_handler); signal(SIGABRT, &signal_handler); signal(SIGUSR1, &signal_handler); signal(SIGUSR2, &signal_handler); diff --git a/openbsc/src/osmo-nitb/bsc_hack.c b/openbsc/src/osmo-nitb/bsc_hack.c index c2fe1c9..2aeaa8f 100644 --- a/openbsc/src/osmo-nitb/bsc_hack.c +++ b/openbsc/src/osmo-nitb/bsc_hack.c @@ -202,6 +202,7 @@ switch (signal) { case SIGINT: + case SIGTERM: bsc_shutdown_net(bsc_gsmnet); osmo_signal_dispatch(SS_L_GLOBAL, S_L_GLOBAL_SHUTDOWN, NULL); sleep(3); @@ -376,6 +377,7 @@ osmo_timer_schedule(&bsc_gsmnet->subscr_expire_timer, EXPIRE_INTERVAL); signal(SIGINT, &signal_handler); + signal(SIGTERM, &signal_handler); signal(SIGABRT, &signal_handler); signal(SIGUSR1, &signal_handler); signal(SIGUSR2, &signal_handler); -- To view, visit https://gerrit.osmocom.org/3564 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Iea6804325a6575ceab5edfd28dd20249462f143b Gerrit-PatchSet: 2 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Mon Aug 21 02:58:47 2017 From: gerrit-no-reply at lists.osmocom.org (Holger Freyther) Date: Mon, 21 Aug 2017 02:58:47 +0000 Subject: libosmo-netif[master]: osmux: Re-write osmux_snprintf In-Reply-To: References: Message-ID: Patch Set 1: @pau: "last small changes" -> link to commit or change-id. Most people will not use git log --date to find it. ) @Pablo: https://gerrit.osmocom.org/#/c/3521/. I think size, len and offset could be presented in two variables (or change the name). E.g. when reading is "size" the capacity of the buffer or the bytes already used? If used bytes, what is the difference to "offset"? -- To view, visit https://gerrit.osmocom.org/3537 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I695771d099833842db37a415b636035d17f1bba7 Gerrit-PatchSet: 1 Gerrit-Project: libosmo-netif Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pablo Neira Ayuso Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Aug 21 10:12:19 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 21 Aug 2017 10:12:19 +0000 Subject: osmo-ci[master]: scripts: add requirements.txt to list jenkins-job-builder In-Reply-To: References: Message-ID: Patch Set 1: Could you elaborate: what uses this and how? -- To view, visit https://gerrit.osmocom.org/3559 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: If25ce84593bbf6a393928a8f4e1670f320c48ca4 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Owner: lynxis lazus Gerrit-Reviewer: Max Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Aug 21 10:14:38 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 21 Aug 2017 10:14:38 +0000 Subject: osmo-ci[master]: osmocom-nightly-nitb-split.yml: schedule the job to be run a... In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/3558 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I0d80e7d260f9092f44d4d80471a4dd67b7acc839 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Owner: lynxis lazus Gerrit-Reviewer: Max Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Aug 21 12:51:56 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 21 Aug 2017 12:51:56 +0000 Subject: [PATCH] openbsc[master]: Revert "factor out & introduce struct gsm_encr, in common_cs.h" Message-ID: Review at https://gerrit.osmocom.org/3570 Revert "factor out & introduce struct gsm_encr, in common_cs.h" This reverts commit ac1f1436e9d380f632dd850fcd253d3480f0fc2d. common_cs.h added to gsm_data_shared.h was a mistake, i.e. I added the dependency by accident. Including common_cs.h in the debian installation may have seemed like the logical consequence but was not intended. AFAICT for osmo-msc, the need for struct gsm_encr is obsoleted by libvlr, gsm_encr will only be used in osmo-bsc and can just stay an inline struct. Related: OS#2272 Change-Id: I15d60441c6c6f053486c0482258a8759bdd92df1 --- M openbsc/include/openbsc/common_cs.h M openbsc/include/openbsc/gsm_data_shared.h 2 files changed, 6 insertions(+), 11 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/70/3570/1 diff --git a/openbsc/include/openbsc/common_cs.h b/openbsc/include/openbsc/common_cs.h index 6dc956f..4282064 100644 --- a/openbsc/include/openbsc/common_cs.h +++ b/openbsc/include/openbsc/common_cs.h @@ -9,14 +9,6 @@ struct vty; -#define MAX_A5_KEY_LEN (128/8) - -struct gsm_encr { - uint8_t alg_id; - uint8_t key_len; - uint8_t key[MAX_A5_KEY_LEN]; -}; - struct gsm_network *gsm_network_init(void *ctx, uint16_t country_code, uint16_t network_code, diff --git a/openbsc/include/openbsc/gsm_data_shared.h b/openbsc/include/openbsc/gsm_data_shared.h index 369668d..6b2269e 100644 --- a/openbsc/include/openbsc/gsm_data_shared.h +++ b/openbsc/include/openbsc/gsm_data_shared.h @@ -24,8 +24,6 @@ #include #endif -#include - /* 16 is the max. number of SI2quater messages according to 3GPP TS 44.018 Table 10.5.2.33b.1: 4-bit index is used (2#1111 = 10#15) */ #define SI2Q_MAX_NUM 16 @@ -131,6 +129,7 @@ struct osmo_fsm_inst *fsm; }; +#define MAX_A5_KEY_LEN (128/8) #define A38_XOR_MIN_KEY_LEN 12 #define A38_XOR_MAX_KEY_LEN 16 #define A38_COMP128_KEY_LEN 16 @@ -232,7 +231,11 @@ uint8_t bs_power; uint8_t ms_power; /* Encryption information */ - struct gsm_encr encr; + struct { + uint8_t alg_id; + uint8_t key_len; + uint8_t key[MAX_A5_KEY_LEN]; + } encr; /* AMR bits */ uint8_t mr_ms_lv[7]; -- To view, visit https://gerrit.osmocom.org/3570 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I15d60441c6c6f053486c0482258a8759bdd92df1 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Mon Aug 21 13:16:30 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 21 Aug 2017 13:16:30 +0000 Subject: openbsc[master]: Revert "factor out & introduce struct gsm_encr, in common_cs.h" In-Reply-To: References: Message-ID: Patch Set 1: (2 comments) https://gerrit.osmocom.org/#/c/3570/1/openbsc/include/openbsc/gsm_data_shared.h File openbsc/include/openbsc/gsm_data_shared.h: Line 132: #define MAX_A5_KEY_LEN (128/8) I think it's better to put this next to actual a5 implementation in libosmocore. Line 235: uint8_t alg_id; Is this enum osmo_auth_algo or smth else? -- To view, visit https://gerrit.osmocom.org/3570 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I15d60441c6c6f053486c0482258a8759bdd92df1 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Mon Aug 21 13:28:32 2017 From: gerrit-no-reply at lists.osmocom.org (Pablo Neira Ayuso) Date: Mon, 21 Aug 2017 13:28:32 +0000 Subject: libosmo-netif[master]: osmux: Re-write osmux_snprintf In-Reply-To: References: Message-ID: Patch Set 1: size is the original buffer size, number of bytes you can fit into the buffer you provide. len is the number of byte that has been written into the buffer. offset is where you should continue to append more bytes. If you want to retain snprintf semantics, ie. return the number of bytes that would have been written, then you need to keep size and offset, because offset should not ever go over the boundary. Retaining snprintf semantics can be good to log how many bytes are missing in the buffer you provide. If you don't want snprintf semantics, then you can remove len and use offset in any case. -- To view, visit https://gerrit.osmocom.org/3537 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I695771d099833842db37a415b636035d17f1bba7 Gerrit-PatchSet: 1 Gerrit-Project: libosmo-netif Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pablo Neira Ayuso Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Aug 21 13:30:53 2017 From: gerrit-no-reply at lists.osmocom.org (Pablo Neira Ayuso) Date: Mon, 21 Aug 2017 13:30:53 +0000 Subject: libosmo-netif[master]: osmux: Re-write osmux_snprintf In-Reply-To: References: Message-ID: Patch Set 1: SOrry, I mean: If you want to retain snprintf semantics, ie. return the number of bytes that would have been written, then you need to keep 'len' and offset, because offset should not ever go over the boundary. But 'len' may indeed go over the boundary, since it expresses this "number of byte that would have been written". Under normal circumstances, this stands true: len == offset. If the buffer is too small, then len > offset. -- To view, visit https://gerrit.osmocom.org/3537 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I695771d099833842db37a415b636035d17f1bba7 Gerrit-PatchSet: 1 Gerrit-Project: libosmo-netif Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pablo Neira Ayuso Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Aug 21 13:32:20 2017 From: gerrit-no-reply at lists.osmocom.org (Holger Freyther) Date: Mon, 21 Aug 2017 13:32:20 +0000 Subject: libosmo-netif[master]: osmux: Re-write osmux_snprintf In-Reply-To: References: Message-ID: Patch Set 1: > size is the original buffer size, number of bytes you can fit into > the buffer you provide. right. but isn't size + ret then very fishy? (in the nftable macro too). How does the buffer grow? Shouldn't it be like a "constant"? -- To view, visit https://gerrit.osmocom.org/3537 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I695771d099833842db37a415b636035d17f1bba7 Gerrit-PatchSet: 1 Gerrit-Project: libosmo-netif Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pablo Neira Ayuso Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Aug 21 13:35:53 2017 From: gerrit-no-reply at lists.osmocom.org (Holger Freyther) Date: Mon, 21 Aug 2017 13:35:53 +0000 Subject: libosmo-netif[master]: osmux: Re-write osmux_snprintf In-Reply-To: References: Message-ID: Patch Set 1: > SOrry, I mean: If you want to retain snprintf semantics, ie. return > the number of bytes that would have been written, then you need to > keep 'len' and offset, because offset should not ever go over the > boundary. > > But 'len' may indeed go over the boundary, since it expresses this > "number of byte that would have been written". > > Under normal circumstances, this stands true: len == offset. > > If the buffer is too small, then len > offset. I see your point. But taking a step back (and I am not the one working on this code right now so my opinion should not be the deciding one). What semantic do we want? snprintf is quite powerful but from what I can see we only want: * Not have a buffer overrun * Know when formatting failed (and optionally help us to see how and where it failed) The first two items bring us closer to the streaming API Jacob did in the gbproxy. Only the last might be an argument for sprintf (and macro). -- To view, visit https://gerrit.osmocom.org/3537 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I695771d099833842db37a415b636035d17f1bba7 Gerrit-PatchSet: 1 Gerrit-Project: libosmo-netif Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pablo Neira Ayuso Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Aug 21 13:41:54 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Mon, 21 Aug 2017 13:41:54 +0000 Subject: libosmo-netif[master]: osmux: Re-write osmux_snprintf In-Reply-To: References: Message-ID: Patch Set 1: (1 comment) Hi sorry, it seems I wrote a comment a few days ago but I didn't "submit it". https://gerrit.osmocom.org/#/c/3537/1/src/osmux.c File src/osmux.c: PS1, Line 849: > I'm still trying to understand this update, not sure what corner case you'r I first submited this patch which was already merged, because I was getting a crash: https://gerrit.osmocom.org/#/c/3521/1 But now after seeing the examples in nftables I realize that actually the problem may be that osmux_snprintf_header() and osmux_snprintf_payload() are called passing parameter "size" to them, but they should be called with parameter "len". To be honest, I find these len and size variables quite confusing and here's proof of it. There's afaik no need to maintain 4 state variables instead of 3, so I'd prefer having the new implementation as I think it's easier to follow. I'm OK too with sending a new patchset reverting #3521 and a new patch to s/size/len/ when calling the functions state above, and another patch adding documentation and cosmetics. -- To view, visit https://gerrit.osmocom.org/3537 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I695771d099833842db37a415b636035d17f1bba7 Gerrit-PatchSet: 1 Gerrit-Project: libosmo-netif Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pablo Neira Ayuso Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Mon Aug 21 14:52:37 2017 From: gerrit-no-reply at lists.osmocom.org (Pablo Neira Ayuso) Date: Mon, 21 Aug 2017 14:52:37 +0000 Subject: libosmo-netif[master]: osmux: Re-write osmux_snprintf In-Reply-To: References: Message-ID: Patch Set 1: @Pau: You're not the only one getting confused with it, snprintf() is a mess, it's hard to deal with it, hence this macro that retains semantics that aims to simplify things... if you find any better, let me know I'd be happy to reuse it in my code moving forward :-). @Holger: Either way, I don't mind if you don't need the snprintf semantics, this is a _snprintf() function after all, just explaning here. So the intention at least that I can remember was to keep in sync with how snprintf() works. Anyway, feel free to simplify this. Anyway, I just wanted to make sure this patch was really fixing up the real issue. I understand you observe a crash, but not clear to me why the patch is fixing it. Cheers. -- To view, visit https://gerrit.osmocom.org/3537 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I695771d099833842db37a415b636035d17f1bba7 Gerrit-PatchSet: 1 Gerrit-Project: libosmo-netif Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pablo Neira Ayuso Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Aug 21 17:05:35 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Mon, 21 Aug 2017 17:05:35 +0000 Subject: [PATCH] osmo-gsm-tester[master]: bts_osmotrx: Allow LD_LIBRARY_PATH when loading osmo-trx Message-ID: Review at https://gerrit.osmocom.org/3571 bts_osmotrx: Allow LD_LIBRARY_PATH when loading osmo-trx When splitting osmo-trx to its own class the env injection part was removed because it seemed not needed as it has no dependencies included by default in the trial. However, it may still be required by the osmo-gsm-tester main unit to launch osmo-gsm-tester with LD_PRELOAD_PATH to point to specific versions of libuhd, so let's add the env injection back in there. Change-Id: I069ba69f4207665c8c575fed0fc8ff164c571e36 --- M src/osmo_gsm_tester/bts_osmotrx.py 1 file changed, 2 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-tester refs/changes/71/3571/1 diff --git a/src/osmo_gsm_tester/bts_osmotrx.py b/src/osmo_gsm_tester/bts_osmotrx.py index 7496ce8..9795a58 100644 --- a/src/osmo_gsm_tester/bts_osmotrx.py +++ b/src/osmo_gsm_tester/bts_osmotrx.py @@ -132,6 +132,8 @@ def start(self): self.run_dir = util.Dir(self.suite_run.get_test_run_dir().new_dir(self.name())) self.inst = util.Dir(os.path.abspath(self.suite_run.trial.get_inst(OsmoTrx.BIN_TRX))) + lib = self.inst.child('lib') + self.env = { 'LD_LIBRARY_PATH': util.prepend_library_path(lib) } self.proc_trx = self.launch_process(OsmoTrx.BIN_TRX, '-x') def launch_process(self, binary_name, *args): -- To view, visit https://gerrit.osmocom.org/3571 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I069ba69f4207665c8c575fed0fc8ff164c571e36 Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Mon Aug 21 17:07:20 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Mon, 21 Aug 2017 17:07:20 +0000 Subject: osmo-gsm-tester[master]: bts_osmotrx: Allow LD_LIBRARY_PATH when loading osmo-trx In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3571 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I069ba69f4207665c8c575fed0fc8ff164c571e36 Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Aug 21 17:07:27 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Mon, 21 Aug 2017 17:07:27 +0000 Subject: [MERGED] osmo-gsm-tester[master]: bts_osmotrx: Allow LD_LIBRARY_PATH when loading osmo-trx In-Reply-To: References: Message-ID: Pau Espin Pedrol has submitted this change and it was merged. Change subject: bts_osmotrx: Allow LD_LIBRARY_PATH when loading osmo-trx ...................................................................... bts_osmotrx: Allow LD_LIBRARY_PATH when loading osmo-trx When splitting osmo-trx to its own class the env injection part was removed because it seemed not needed as it has no dependencies included by default in the trial. However, it may still be required by the osmo-gsm-tester main unit to launch osmo-gsm-tester with LD_PRELOAD_PATH to point to specific versions of libuhd, so let's add the env injection back in there. Change-Id: I069ba69f4207665c8c575fed0fc8ff164c571e36 --- M src/osmo_gsm_tester/bts_osmotrx.py 1 file changed, 2 insertions(+), 0 deletions(-) Approvals: Pau Espin Pedrol: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/osmo_gsm_tester/bts_osmotrx.py b/src/osmo_gsm_tester/bts_osmotrx.py index 7496ce8..9795a58 100644 --- a/src/osmo_gsm_tester/bts_osmotrx.py +++ b/src/osmo_gsm_tester/bts_osmotrx.py @@ -132,6 +132,8 @@ def start(self): self.run_dir = util.Dir(self.suite_run.get_test_run_dir().new_dir(self.name())) self.inst = util.Dir(os.path.abspath(self.suite_run.trial.get_inst(OsmoTrx.BIN_TRX))) + lib = self.inst.child('lib') + self.env = { 'LD_LIBRARY_PATH': util.prepend_library_path(lib) } self.proc_trx = self.launch_process(OsmoTrx.BIN_TRX, '-x') def launch_process(self, binary_name, *args): -- To view, visit https://gerrit.osmocom.org/3571 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I069ba69f4207665c8c575fed0fc8ff164c571e36 Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Mon Aug 21 17:33:24 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Mon, 21 Aug 2017 17:33:24 +0000 Subject: [PATCH] osmo-gsm-tester[master]: Increase log verbosity for osmo-bts-trx Message-ID: Review at https://gerrit.osmocom.org/3572 Increase log verbosity for osmo-bts-trx The log levels changed are useful to understand clock failures we see from time to time in osmo-gsm-tester. See OS-2325. Change-Id: Id74af3ccb2f3db3c1793c7ff7b7a60a534e78e81 --- M src/osmo_gsm_tester/templates/osmo-bts-trx.cfg.tmpl 1 file changed, 2 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-tester refs/changes/72/3572/1 diff --git a/src/osmo_gsm_tester/templates/osmo-bts-trx.cfg.tmpl b/src/osmo_gsm_tester/templates/osmo-bts-trx.cfg.tmpl index 9ef2547..ddfd483 100644 --- a/src/osmo_gsm_tester/templates/osmo-bts-trx.cfg.tmpl +++ b/src/osmo_gsm_tester/templates/osmo-bts-trx.cfg.tmpl @@ -9,8 +9,9 @@ logging level rll debug logging level rr debug logging level rsl debug - logging level l1c notice + logging level l1c info logging level l1p error + logging level trx info ! phy 0 instance 0 -- To view, visit https://gerrit.osmocom.org/3572 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Id74af3ccb2f3db3c1793c7ff7b7a60a534e78e81 Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Mon Aug 21 17:34:14 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Mon, 21 Aug 2017 17:34:14 +0000 Subject: osmo-gsm-tester[master]: Increase log verbosity for osmo-bts-trx In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3572 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Id74af3ccb2f3db3c1793c7ff7b7a60a534e78e81 Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Aug 21 17:34:16 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Mon, 21 Aug 2017 17:34:16 +0000 Subject: [MERGED] osmo-gsm-tester[master]: Increase log verbosity for osmo-bts-trx In-Reply-To: References: Message-ID: Pau Espin Pedrol has submitted this change and it was merged. Change subject: Increase log verbosity for osmo-bts-trx ...................................................................... Increase log verbosity for osmo-bts-trx The log levels changed are useful to understand clock failures we see from time to time in osmo-gsm-tester. See OS-2325. Change-Id: Id74af3ccb2f3db3c1793c7ff7b7a60a534e78e81 --- M src/osmo_gsm_tester/templates/osmo-bts-trx.cfg.tmpl 1 file changed, 2 insertions(+), 1 deletion(-) Approvals: Pau Espin Pedrol: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/osmo_gsm_tester/templates/osmo-bts-trx.cfg.tmpl b/src/osmo_gsm_tester/templates/osmo-bts-trx.cfg.tmpl index 9ef2547..ddfd483 100644 --- a/src/osmo_gsm_tester/templates/osmo-bts-trx.cfg.tmpl +++ b/src/osmo_gsm_tester/templates/osmo-bts-trx.cfg.tmpl @@ -9,8 +9,9 @@ logging level rll debug logging level rr debug logging level rsl debug - logging level l1c notice + logging level l1c info logging level l1p error + logging level trx info ! phy 0 instance 0 -- To view, visit https://gerrit.osmocom.org/3572 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Id74af3ccb2f3db3c1793c7ff7b7a60a534e78e81 Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Mon Aug 21 18:15:59 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 21 Aug 2017 18:15:59 +0000 Subject: [PATCH] openggsn[master]: Print destination address on sendto error Message-ID: Review at https://gerrit.osmocom.org/3573 Print destination address on sendto error Change-Id: I0f8ad8687acb7f6f0eeeb962f007e87cca0c4c27 --- M gtp/gtp.c 1 file changed, 2 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openggsn refs/changes/73/3573/1 diff --git a/gtp/gtp.c b/gtp/gtp.c index 012aa79..69405b8 100644 --- a/gtp/gtp.c +++ b/gtp/gtp.c @@ -394,9 +394,8 @@ if (sendto(fd, packet, len, 0, (struct sockaddr *)&addr, sizeof(addr)) < 0) { gsn->err_sendto++; - LOGP(DLGTP, LOGL_ERROR, - "Sendto(fd=%d, msg=%lx, len=%d) failed: Error = %s\n", fd, - (unsigned long)&packet, len, strerror(errno)); + LOGP(DLGTP, LOGL_ERROR, "Sendto(fd=%d, msg=%lx, len=%d, dst=%s) failed: Error = %s\n", fd, + (unsigned long)&packet, len, inet_ntoa(addr.sin_addr), strerror(errno)); return -1; } -- To view, visit https://gerrit.osmocom.org/3573 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I0f8ad8687acb7f6f0eeeb962f007e87cca0c4c27 Gerrit-PatchSet: 1 Gerrit-Project: openggsn Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Tue Aug 22 08:40:48 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Tue, 22 Aug 2017 08:40:48 +0000 Subject: [PATCH] openggsn[master]: Print address length on conversion error Message-ID: Review at https://gerrit.osmocom.org/3574 Print address length on conversion error Change-Id: Id07d0a529c1b1222ab678814f3c2ffd737ce063a --- M gtp/gtp.c 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/openggsn refs/changes/74/3574/1 diff --git a/gtp/gtp.c b/gtp/gtp.c index 69405b8..7ebf7a8 100644 --- a/gtp/gtp.c +++ b/gtp/gtp.c @@ -2293,7 +2293,7 @@ if (gsna2in_addr(&addr, &pdp->gsnrc)) { gsn->err_address++; LOGP(DLGTP, LOGL_ERROR, - "GSN address conversion failed\n"); + "GSN address (len=%u) conversion failed\n", pdp->gsnrc.l); return EOF; } -- To view, visit https://gerrit.osmocom.org/3574 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Id07d0a529c1b1222ab678814f3c2ffd737ce063a Gerrit-PatchSet: 1 Gerrit-Project: openggsn Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Tue Aug 22 09:30:30 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Tue, 22 Aug 2017 09:30:30 +0000 Subject: [PATCH] openggsn[master]: libgtp: expand logging In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3573 to look at the new patch set (#2). libgtp: expand logging * print destination address on sendto error * print address length on conversion error * log listening address * log GTP version on PDP context errors * fix incorrect logging message for unknown GSN peer Change-Id: I0f8ad8687acb7f6f0eeeb962f007e87cca0c4c27 --- M gtp/gtp.c 1 file changed, 7 insertions(+), 10 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openggsn refs/changes/73/3573/2 diff --git a/gtp/gtp.c b/gtp/gtp.c index 012aa79..a3f6eb2 100644 --- a/gtp/gtp.c +++ b/gtp/gtp.c @@ -394,9 +394,8 @@ if (sendto(fd, packet, len, 0, (struct sockaddr *)&addr, sizeof(addr)) < 0) { gsn->err_sendto++; - LOGP(DLGTP, LOGL_ERROR, - "Sendto(fd=%d, msg=%lx, len=%d) failed: Error = %s\n", fd, - (unsigned long)&packet, len, strerror(errno)); + LOGP(DLGTP, LOGL_ERROR, "Sendto(fd=%d, msg=%lx, len=%d, dst=%s) failed: Error = %s\n", fd, + (unsigned long)&packet, len, inet_ntoa(addr.sin_addr), strerror(errno)); return -1; } @@ -697,7 +696,7 @@ { struct sockaddr_in addr; - LOGP(DLGTP, LOGL_NOTICE, "GTP: gtp_newgsn() started\n"); + LOGP(DLGTP, LOGL_NOTICE, "GTP: gtp_newgsn() started at %s\n", inet_ntoa(*listen)); *gsn = calloc(sizeof(struct gsn_t), 1); /* TODO */ @@ -2293,8 +2292,7 @@ if (gsna2in_addr(&addr, &pdp->gsnrc)) { gsn->err_address++; - LOGP(DLGTP, LOGL_ERROR, - "GSN address conversion failed\n"); + LOGP(DLGTP, LOGL_ERROR, "GSN address (len=%u) conversion failed\n", pdp->gsnrc.l); return EOF; } @@ -2642,7 +2640,7 @@ (&pdp, ntoh16(((union gtp_packet *)pack)->gtp0.h.flow))) { gsn->err_unknownpdp++; GTP_LOGPKG(LOGL_ERROR, peer, pack, - len, "Unknown PDP context\n"); + len, "Unknown PDP context, GTPv0\n"); return gtp_error_ind_resp(gsn, version, peer, fd, pack, len); } @@ -2652,7 +2650,7 @@ (&pdp, ntoh32(((union gtp_packet *)pack)->gtp1l.h.tei))) { gsn->err_unknownpdp++; GTP_LOGPKG(LOGL_ERROR, peer, pack, - len, "Unknown PDP context\n"); + len, "Unknown PDP context, GTPv1\n"); return gtp_error_ind_resp(gsn, version, peer, fd, pack, len); } @@ -2670,8 +2668,7 @@ /* If the GPDU was not from the peer GSN tell him to delete context */ if (memcmp(&peer->sin_addr, pdp->gsnru.v, pdp->gsnru.l)) { /* TODO Range? */ gsn->err_unknownpdp++; - GTP_LOGPKG(LOGL_ERROR, peer, pack, len, - "Unknown PDP context\n"); + GTP_LOGPKG(LOGL_ERROR, peer, pack, len, "Unknown GSN peer %s\n", inet_ntoa(peer->sin_addr)); return gtp_error_ind_resp(gsn, version, peer, fd, pack, len); } -- To view, visit https://gerrit.osmocom.org/3573 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I0f8ad8687acb7f6f0eeeb962f007e87cca0c4c27 Gerrit-PatchSet: 2 Gerrit-Project: openggsn Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Tue Aug 22 09:30:47 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Tue, 22 Aug 2017 09:30:47 +0000 Subject: [ABANDON] openggsn[master]: Print address length on conversion error In-Reply-To: References: Message-ID: Max has abandoned this change. Change subject: Print address length on conversion error ...................................................................... Abandoned -- To view, visit https://gerrit.osmocom.org/3574 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: abandon Gerrit-Change-Id: Id07d0a529c1b1222ab678814f3c2ffd737ce063a Gerrit-PatchSet: 1 Gerrit-Project: openggsn Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Tue Aug 22 09:39:23 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Tue, 22 Aug 2017 09:39:23 +0000 Subject: [PATCH] openbsc[master]: SGSN: log IMSI on PDP context creation Message-ID: Review at https://gerrit.osmocom.org/3575 SGSN: log IMSI on PDP context creation Change-Id: I5ada9f85af2098f9acc8a277b9026eed226b9ac2 --- M openbsc/src/gprs/sgsn_libgtp.c 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/75/3575/1 diff --git a/openbsc/src/gprs/sgsn_libgtp.c b/openbsc/src/gprs/sgsn_libgtp.c index e90b66d..6f4e6ab 100644 --- a/openbsc/src/gprs/sgsn_libgtp.c +++ b/openbsc/src/gprs/sgsn_libgtp.c @@ -145,7 +145,7 @@ const uint8_t *qos; int rc; - LOGP(DGPRS, LOGL_ERROR, "Create PDP Context\n"); + LOGP(DGPRS, LOGL_ERROR, "Create PDP Context for %s\n", mmctx->imsi); pctx = sgsn_pdp_ctx_alloc(mmctx, nsapi); if (!pctx) { LOGP(DGPRS, LOGL_ERROR, "Couldn't allocate PDP Ctx\n"); -- To view, visit https://gerrit.osmocom.org/3575 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I5ada9f85af2098f9acc8a277b9026eed226b9ac2 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Tue Aug 22 10:07:45 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Tue, 22 Aug 2017 10:07:45 +0000 Subject: [PATCH] openggsn[master]: libgtp: expand logging In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3573 to look at the new patch set (#3). libgtp: expand logging * print destination address on sendto error * print address length on conversion error * log listening address * log GTP version on PDP context errors * fix incorrect logging message for unknown GSN peer Related: SYS#3610 Change-Id: I0f8ad8687acb7f6f0eeeb962f007e87cca0c4c27 --- M gtp/gtp.c 1 file changed, 7 insertions(+), 10 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openggsn refs/changes/73/3573/3 diff --git a/gtp/gtp.c b/gtp/gtp.c index 012aa79..a3f6eb2 100644 --- a/gtp/gtp.c +++ b/gtp/gtp.c @@ -394,9 +394,8 @@ if (sendto(fd, packet, len, 0, (struct sockaddr *)&addr, sizeof(addr)) < 0) { gsn->err_sendto++; - LOGP(DLGTP, LOGL_ERROR, - "Sendto(fd=%d, msg=%lx, len=%d) failed: Error = %s\n", fd, - (unsigned long)&packet, len, strerror(errno)); + LOGP(DLGTP, LOGL_ERROR, "Sendto(fd=%d, msg=%lx, len=%d, dst=%s) failed: Error = %s\n", fd, + (unsigned long)&packet, len, inet_ntoa(addr.sin_addr), strerror(errno)); return -1; } @@ -697,7 +696,7 @@ { struct sockaddr_in addr; - LOGP(DLGTP, LOGL_NOTICE, "GTP: gtp_newgsn() started\n"); + LOGP(DLGTP, LOGL_NOTICE, "GTP: gtp_newgsn() started at %s\n", inet_ntoa(*listen)); *gsn = calloc(sizeof(struct gsn_t), 1); /* TODO */ @@ -2293,8 +2292,7 @@ if (gsna2in_addr(&addr, &pdp->gsnrc)) { gsn->err_address++; - LOGP(DLGTP, LOGL_ERROR, - "GSN address conversion failed\n"); + LOGP(DLGTP, LOGL_ERROR, "GSN address (len=%u) conversion failed\n", pdp->gsnrc.l); return EOF; } @@ -2642,7 +2640,7 @@ (&pdp, ntoh16(((union gtp_packet *)pack)->gtp0.h.flow))) { gsn->err_unknownpdp++; GTP_LOGPKG(LOGL_ERROR, peer, pack, - len, "Unknown PDP context\n"); + len, "Unknown PDP context, GTPv0\n"); return gtp_error_ind_resp(gsn, version, peer, fd, pack, len); } @@ -2652,7 +2650,7 @@ (&pdp, ntoh32(((union gtp_packet *)pack)->gtp1l.h.tei))) { gsn->err_unknownpdp++; GTP_LOGPKG(LOGL_ERROR, peer, pack, - len, "Unknown PDP context\n"); + len, "Unknown PDP context, GTPv1\n"); return gtp_error_ind_resp(gsn, version, peer, fd, pack, len); } @@ -2670,8 +2668,7 @@ /* If the GPDU was not from the peer GSN tell him to delete context */ if (memcmp(&peer->sin_addr, pdp->gsnru.v, pdp->gsnru.l)) { /* TODO Range? */ gsn->err_unknownpdp++; - GTP_LOGPKG(LOGL_ERROR, peer, pack, len, - "Unknown PDP context\n"); + GTP_LOGPKG(LOGL_ERROR, peer, pack, len, "Unknown GSN peer %s\n", inet_ntoa(peer->sin_addr)); return gtp_error_ind_resp(gsn, version, peer, fd, pack, len); } -- To view, visit https://gerrit.osmocom.org/3573 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I0f8ad8687acb7f6f0eeeb962f007e87cca0c4c27 Gerrit-PatchSet: 3 Gerrit-Project: openggsn Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: daniel From gerrit-no-reply at lists.osmocom.org Tue Aug 22 10:09:10 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Tue, 22 Aug 2017 10:09:10 +0000 Subject: [PATCH] openbsc[master]: SGSN: log IMSI on PDP context creation In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3575 to look at the new patch set (#2). SGSN: log IMSI on PDP context creation Related: SYS#3610 Change-Id: I5ada9f85af2098f9acc8a277b9026eed226b9ac2 --- M openbsc/src/gprs/sgsn_libgtp.c 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/75/3575/2 diff --git a/openbsc/src/gprs/sgsn_libgtp.c b/openbsc/src/gprs/sgsn_libgtp.c index e90b66d..6f4e6ab 100644 --- a/openbsc/src/gprs/sgsn_libgtp.c +++ b/openbsc/src/gprs/sgsn_libgtp.c @@ -145,7 +145,7 @@ const uint8_t *qos; int rc; - LOGP(DGPRS, LOGL_ERROR, "Create PDP Context\n"); + LOGP(DGPRS, LOGL_ERROR, "Create PDP Context for %s\n", mmctx->imsi); pctx = sgsn_pdp_ctx_alloc(mmctx, nsapi); if (!pctx) { LOGP(DGPRS, LOGL_ERROR, "Couldn't allocate PDP Ctx\n"); -- To view, visit https://gerrit.osmocom.org/3575 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I5ada9f85af2098f9acc8a277b9026eed226b9ac2 Gerrit-PatchSet: 2 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: daniel From gerrit-no-reply at lists.osmocom.org Tue Aug 22 10:33:15 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Tue, 22 Aug 2017 10:33:15 +0000 Subject: openggsn[master]: libgtp: expand logging In-Reply-To: References: Message-ID: Patch Set 3: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/3573 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I0f8ad8687acb7f6f0eeeb962f007e87cca0c4c27 Gerrit-PatchSet: 3 Gerrit-Project: openggsn Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: daniel Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Aug 22 10:37:37 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Tue, 22 Aug 2017 10:37:37 +0000 Subject: [PATCH] osmo-pcap[master]: Add gitreview config Message-ID: Review at https://gerrit.osmocom.org/3576 Add gitreview config Change-Id: I35b3aaa3f8af4127d8a1b00c77ab02ae6a182714 --- A .gitreview 1 file changed, 3 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcap refs/changes/76/3576/1 diff --git a/.gitreview b/.gitreview new file mode 100644 index 0000000..e218434 --- /dev/null +++ b/.gitreview @@ -0,0 +1,3 @@ +[gerrit] +host=gerrit.osmocom.org +project=osmo-pcap -- To view, visit https://gerrit.osmocom.org/3576 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I35b3aaa3f8af4127d8a1b00c77ab02ae6a182714 Gerrit-PatchSet: 1 Gerrit-Project: osmo-pcap Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Tue Aug 22 11:37:15 2017 From: gerrit-no-reply at lists.osmocom.org (lynxis lazus) Date: Tue, 22 Aug 2017 11:37:15 +0000 Subject: osmo-pcap[master]: Add gitreview config In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/3576 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I35b3aaa3f8af4127d8a1b00c77ab02ae6a182714 Gerrit-PatchSet: 1 Gerrit-Project: osmo-pcap Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: lynxis lazus Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Aug 22 12:31:57 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 22 Aug 2017 12:31:57 +0000 Subject: [MERGED] osmo-msc[master]: mscsplit: various preparations to separate MSC from BSC In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: mscsplit: various preparations to separate MSC from BSC ...................................................................... mscsplit: various preparations to separate MSC from BSC Disable large parts of the code that depend on BSC presence. The code sections disabled by #if BEFORE_MSCSPLIT shall be modified or dropped in the course of adding the A-interface. Don't set msg->lchan nor msg->dst. Don't use lchan in libmsc. Decouple lac from bts. Prepare entry/exit point for MSC -> BSC and MSC -> RNC communication: Add msc_ifaces.[hc], a_iface.c, with a general msc_tx_dtap() to redirect to different interfaces depending on the actual subscriber connection. While iu_tx() is going to be functional fairly soon, the a_tx() is going to be just a dummy for some time (see comment). Add Iu specific fields in gsm_subscriber_connection: the UE connection pointer and an indicator for the Integrity Protection status on Iu (to be fully implemented in later commits). Add lac member to gsm_subscriber_connection, to allow decoupling from bts->location_area_code. The conn->lac will actually be set in iu.c in an upcoming commit ("add iucs.[hc]"). move to libcommon-cs: gsm48_extract_mi(), gsm48_paging_extract_mi(). libmsc: duplicate gsm0808 / gsm48 functions (towards BSC). In osmo-nitb, libmsc would directly call the functions on the BSC level, not always via the bsc_api. When separating libmsc from libbsc, some functions are missing from the linkage. Hence duplicate these functions to libmsc, add an msc_ prefix for clarity, also add a _tx to gsm0808_cipher_mode(): * add msc_gsm0808_tx_cipher_mode() (dummy/stub) * add msc_gsm48_tx_mm_serv_ack() * add msc_gsm48_tx_mm_serv_rej() Call these from libmsc instead of * gsm0808_cipher_mode() * gsm48_tx_mm_serv_ack() * gsm48_tx_mm_serv_rej() Also add a comment related to msc_gsm0808_tx_cipher_mode() in two places. Remove internal RTP streaming code; OsmoNITB supported that, but for OsmoMSC, this will be done with an external MGCP gateway. Remove LCHAN_MODIFY from internal MNCC state machine. Temporarily disable all paging to be able to link libmsc without libbsc. Skip the paging part of channel_test because the paging is now disabled. Employ fake paging shims in order for msc_vlr_tests to still work. msc_compl_l3(): publish in .h, tweak return value. Use new libmsc enum values for return val, to avoid dependency on libbsc headers. Make callable from other scopes: publish in osmo_msc.h and remove 'static' in osmo_msc.c add gsm_encr to subscr_conn move subscr_request to gsm_subscriber.h subscr_request_channel() -> subscr_request_conn() move to libmsc: osmo_stats_vty_add_cmds() gsm_04_08: remove apply_codec_restrictions() gsm0408_test: use NULL for root ctx move to libbsc: gsm_bts_neighbor() move to libbsc: lchan_next_meas_rep() move vty config for t3212 to network level (periodic lu) remove unneccessary linking from some tests remove handle_abisip_signal() abis_rsl.c: don't use libvlr from libbsc gsm_subscriber_connection: put the LAC here, so that it is available without accessing conn->bts. In bsc_api.c, place this lac in conn for the sake of transition: Iu and A will use this new field to pass the LAC around, but in a completely separate OsmoBSC this is not actually needed. It can be removed again from osmo-bsc.git when the time has come. Siemens MRPCI: completely drop sending the MRPCI messages for now, they shall be added in osmo-bsc once the A-Interface code has settled. See OS#2389. Related: OS#1845 OS#2257 OS#2389 Change-Id: Id3705236350d5f69e447046b0a764bbabc3d493c --- M include/openbsc/Makefile.am M include/openbsc/gsm_04_08.h M include/openbsc/gsm_data.h M include/openbsc/gsm_subscriber.h M include/openbsc/mncc.h A include/openbsc/msc_ifaces.h M include/openbsc/osmo_msc.h M src/libbsc/abis_rsl.c M src/libbsc/bsc_api.c M src/libbsc/bsc_vty.c M src/libbsc/gsm_04_08_utils.c M src/libbsc/handover_decision.c M src/libcommon-cs/common_cs.c M src/libcommon-cs/common_cs_vty.c M src/libcommon/gsm_data.c M src/libcommon/talloc_ctx.c M src/libmsc/Makefile.am A src/libmsc/a_iface.c M src/libmsc/gsm_04_08.c M src/libmsc/gsm_04_11.c M src/libmsc/gsm_subscriber.c M src/libmsc/mncc_builtin.c M src/libmsc/mncc_sock.c A src/libmsc/msc_ifaces.c M src/libmsc/osmo_msc.c M src/libmsc/silent_call.c M src/libmsc/smpp_openbsc.c M src/libmsc/vty_interface_layer3.c M tests/bsc/Makefile.am M tests/channel/Makefile.am M tests/db/Makefile.am M tests/gsm0408/gsm0408_test.c M tests/msc_vlr/Makefile.am M tests/msc_vlr/msc_vlr_test_gsm_authen.err M tests/msc_vlr/msc_vlr_test_gsm_ciph.err M tests/msc_vlr/msc_vlr_test_no_authen.err M tests/msc_vlr/msc_vlr_test_reject_concurrency.err M tests/msc_vlr/msc_vlr_test_umts_authen.err M tests/msc_vlr/msc_vlr_tests.c 39 files changed, 470 insertions(+), 1,071 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/include/openbsc/Makefile.am b/include/openbsc/Makefile.am index 456a4a2..1dfe6c3 100644 --- a/include/openbsc/Makefile.am +++ b/include/openbsc/Makefile.am @@ -54,6 +54,7 @@ misdn.h \ mncc.h \ mncc_int.h \ + msc_ifaces.h \ nat_rewrite_trie.h \ network_listen.h \ oap_client.h \ diff --git a/include/openbsc/gsm_04_08.h b/include/openbsc/gsm_04_08.h index c40d96d..6d6ead1 100644 --- a/include/openbsc/gsm_04_08.h +++ b/include/openbsc/gsm_04_08.h @@ -65,8 +65,6 @@ int send_siemens_mrpci(struct gsm_lchan *lchan, uint8_t *classmark2_lv); int gsm48_extract_mi(uint8_t *classmark2, int length, char *mi_string, uint8_t *mi_type); int gsm48_paging_extract_mi(struct gsm48_pag_resp *pag, int length, char *mi_string, uint8_t *mi_type); -int gsm48_handle_paging_resp(struct gsm_subscriber_connection *conn, - struct msgb *msg, struct bsc_subscr *bsub); int gsm48_lchan_modify(struct gsm_lchan *lchan, uint8_t lchan_mode); int gsm48_rx_rr_modif_ack(struct msgb *msg); diff --git a/include/openbsc/gsm_data.h b/include/openbsc/gsm_data.h index fa2fed7..17b3d71 100644 --- a/include/openbsc/gsm_data.h +++ b/include/openbsc/gsm_data.h @@ -26,6 +26,7 @@ struct bsc_subscr; struct vlr_instance; struct vlr_subscr; +struct ue_conn_ctx; #define OBSC_LINKID_CB(__msgb) (__msgb)->cb[3] @@ -117,6 +118,12 @@ uint8_t classmark3[14]; /* if cm3 gets extended by spec, it will be truncated */ }; +enum integrity_protection_state { + INTEGRITY_PROTECTION_NONE = 0, + INTEGRITY_PROTECTION_IK = 1, + INTEGRITY_PROTECTION_IK_CK = 2, +}; + /* active radio connection of a mobile subscriber */ struct gsm_subscriber_connection { /* global linked list of subscriber_connections */ @@ -176,6 +183,15 @@ enum ran_type via_ran; struct gsm_classmark classmark; + + uint16_t lac; + struct gsm_encr encr; + + /* which Iu-CS connection, if any. */ + struct { + struct ue_conn_ctx *ue_ctx; + int integrity_protection; + } iu; }; @@ -311,6 +327,12 @@ }; struct gsm_network { + /* TODO MSCSPLIT the gsm_network struct is basically a kitchen sink for + * global settings and variables, "madly" mixing BSC and MSC stuff. Split + * this in e.g. struct osmo_bsc and struct osmo_msc, with the things + * these have in common, like country and network code, put in yet + * separate structs and placed as members in osmo_bsc and osmo_msc. */ + /* global parameters */ uint16_t country_code; uint16_t network_code; @@ -416,6 +438,9 @@ uint16_t gsup_server_port; struct vlr_instance *vlr; + + /* Periodic location update default value */ + uint8_t t3212; }; struct osmo_esme; @@ -470,10 +495,6 @@ extern void talloc_ctx_init(void *ctx_root); int gsm_set_bts_type(struct gsm_bts *bts, enum gsm_bts_type type); - -/* Get reference to a neighbor cell on a given BCCH ARFCN */ -struct gsm_bts *gsm_bts_neighbor(const struct gsm_bts *bts, - uint16_t arfcn, uint8_t bsic); enum gsm_bts_type parse_btstype(const char *arg); const char *btstype2str(enum gsm_bts_type type); @@ -557,7 +578,6 @@ int gsm48_ra_id_by_bts(uint8_t *buf, struct gsm_bts *bts); void gprs_ra_id_by_bts(struct gprs_ra_id *raid, struct gsm_bts *bts); -struct gsm_meas_rep *lchan_next_meas_rep(struct gsm_lchan *lchan); int gsm_btsmodel_set_feature(struct gsm_bts_model *model, enum gsm_bts_features feat); int gsm_bts_model_register(struct gsm_bts_model *model); diff --git a/include/openbsc/gsm_subscriber.h b/include/openbsc/gsm_subscriber.h index c65b8a3..60eb0cd 100644 --- a/include/openbsc/gsm_subscriber.h +++ b/include/openbsc/gsm_subscriber.h @@ -19,8 +19,6 @@ #define GSM_SUBSCRIBER_NO_EXPIRATION 0x0 -struct subscr_request; - enum gsm_subscriber_field { GSM_SUBSCRIBER_IMSI, GSM_SUBSCRIBER_TMSI, @@ -34,17 +32,35 @@ GSM_SUBSCRIBER_UPDATE_EQUIPMENT, }; -int subscr_update(struct vlr_subscr *vsub, struct gsm_bts *bts, int reason); +/* + * Struct for pending channel requests. This is managed in the + * llist_head requests of each subscriber. The reference counting + * should work in such a way that a subscriber with a pending request + * remains in memory. + */ +struct subscr_request { + struct llist_head entry; + + /* the callback data */ + gsm_cbfn *cbfn; + void *param; +}; + +int subscr_update(struct vlr_subscr *vsub, int reason); /* * Paging handling with authentication */ -struct subscr_request *subscr_request_channel(struct vlr_subscr *vsub, - int channel_type, - gsm_cbfn *cbfn, void *param); +struct subscr_request *subscr_request_conn(struct vlr_subscr *vsub, + int channel_type, + gsm_cbfn *cbfn, void *param); + void subscr_remove_request(struct subscr_request *req); int subscr_paging_dispatch(unsigned int hooknum, unsigned int event, struct msgb *msg, void *data, void *param); +int msc_fake_paging_request(struct vlr_subscr *vsub); +void msc_fake_paging_request_stop(struct vlr_subscr *vsub); + #endif /* _GSM_SUBSCR_H */ diff --git a/include/openbsc/mncc.h b/include/openbsc/mncc.h index 49f0c8b..881e041 100644 --- a/include/openbsc/mncc.h +++ b/include/openbsc/mncc.h @@ -155,9 +155,6 @@ int notify; /* 0..127 */ int emergency; char imsi[16]; - - unsigned char lchan_type; - unsigned char lchan_mode; }; struct gsm_data_frame { @@ -179,7 +176,6 @@ uint32_t called_offset; uint32_t signal_offset; uint32_t emergency_offset; - uint32_t lchan_type_offset; }; struct gsm_mncc_rtp { diff --git a/include/openbsc/msc_ifaces.h b/include/openbsc/msc_ifaces.h new file mode 100644 index 0000000..83aad92 --- /dev/null +++ b/include/openbsc/msc_ifaces.h @@ -0,0 +1,47 @@ +#pragma once + +#include +#include + +/* These are the interfaces of the MSC layer towards (from?) the BSC and RNC, + * i.e. in the direction towards the mobile device (MS aka UE). + * + * 2G will use the A-interface, + * 3G aka UMTS will use the Iu-interface (for the MSC, it's IuCS). + * + * To allow linking parts of the MSC code without having to include entire + * infrastructures of external libraries, the core transmitting and receiving + * functions are left unimplemented. For example, a unit test does not need to + * link against external ASN1 libraries if it is never going to encode actual + * outgoing messages. It is up to each building scope to implement real world + * functions or to plug mere dummy implementations. + * + * For example, msc_tx_dtap(conn, msg), depending on conn->via_iface, will call + * either iu_tx() or a_tx() [note: at time of writing, the A-interface is not + * yet implemented]. When you try to link against libmsc, you will find that + * the compiler complains about an undefined reference to iu_tx(). If you, + * however, link against libiu as well as the osmo-iuh libs (etc.), iu_tx() is + * available. A unit test may instead simply implement a dummy iu_tx() function + * and not link against osmo-iuh. + */ + +/* Each main linkage must implement this function (see comment above). */ +extern int iu_tx(struct msgb *msg, uint8_t sapi); + +/* So far this is a dummy implemented in libmsc/a_iface.c. When A-interface + * gets implemented, it should be in a separate lib (like libiu), this function + * should move there, and the following comment should remain here: " + * Each main linkage must implement this function (see comment above). + * " */ +extern int a_tx(struct msgb *msg); + +int msc_tx_dtap(struct gsm_subscriber_connection *conn, + struct msgb *msg); + +int msc_gsm48_tx_mm_serv_ack(struct gsm_subscriber_connection *conn); +int msc_gsm48_tx_mm_serv_rej(struct gsm_subscriber_connection *conn, + enum gsm48_reject_value value); + +/* TODO: specific to A interface, move this away */ +int msc_gsm0808_tx_cipher_mode(struct gsm_subscriber_connection *conn, int cipher, + const uint8_t *key, int len, int include_imeisv); diff --git a/include/openbsc/osmo_msc.h b/include/openbsc/osmo_msc.h index 0642c91..5a26b60 100644 --- a/include/openbsc/osmo_msc.h +++ b/include/openbsc/osmo_msc.h @@ -51,6 +51,11 @@ return get_value_string(subscr_conn_from_names, val); } +enum msc_compl_l3_rc { + MSC_CONN_ACCEPT = 0, + MSC_CONN_REJECT = 1, +}; + struct bsc_api *msc_bsc_api(); diff --git a/src/libbsc/abis_rsl.c b/src/libbsc/abis_rsl.c index 7ae3eeb..441b386 100644 --- a/src/libbsc/abis_rsl.c +++ b/src/libbsc/abis_rsl.c @@ -1423,6 +1423,19 @@ } } +static struct gsm_meas_rep *lchan_next_meas_rep(struct gsm_lchan *lchan) +{ + struct gsm_meas_rep *meas_rep; + + meas_rep = &lchan->meas_rep[lchan->meas_rep_idx]; + memset(meas_rep, 0, sizeof(*meas_rep)); + meas_rep->lchan = lchan; + lchan->meas_rep_idx = (lchan->meas_rep_idx + 1) + % ARRAY_SIZE(lchan->meas_rep); + + return meas_rep; +} + static int rsl_rx_meas_res(struct msgb *msg) { struct abis_rsl_dchan_hdr *dh = msgb_l2(msg); diff --git a/src/libbsc/bsc_api.c b/src/libbsc/bsc_api.c index 947644e..c2828e3 100644 --- a/src/libbsc/bsc_api.c +++ b/src/libbsc/bsc_api.c @@ -264,6 +264,7 @@ conn->lchan = lchan; conn->bts = lchan->ts->trx->bts; conn->via_ran = RAN_GERAN_A; + conn->lac = conn->bts->location_area_code; lchan->conn = conn; llist_add_tail(&conn->entry, &net->subscr_conns); return conn; diff --git a/src/libbsc/bsc_vty.c b/src/libbsc/bsc_vty.c index 3bd56ea..722753a 100644 --- a/src/libbsc/bsc_vty.c +++ b/src/libbsc/bsc_vty.c @@ -593,18 +593,12 @@ (sp->penalty_time*20)+20, VTY_NEWLINE); } - /* Is periodic LU enabled or disabled? */ - if (bts->si_common.chan_desc.t3212 == 0) - vty_out(vty, " no periodic location update%s", VTY_NEWLINE); - else - vty_out(vty, " periodic location update %u%s", - bts->si_common.chan_desc.t3212 * 6, VTY_NEWLINE); - if (gsm_bts_get_radio_link_timeout(bts) < 0) vty_out(vty, " radio-link-timeout infinite%s", VTY_NEWLINE); else vty_out(vty, " radio-link-timeout %d%s", gsm_bts_get_radio_link_timeout(bts), VTY_NEWLINE); + vty_out(vty, " channel allocator %s%s", bts->chan_alloc_reverse ? "descending" : "ascending", VTY_NEWLINE); @@ -841,6 +835,11 @@ vty_out(vty, " timezone %d %d%s", gsmnet->tz.hr, gsmnet->tz.mn, VTY_NEWLINE); } + if (gsmnet->t3212 == 0) + vty_out(vty, " no periodic location update%s", VTY_NEWLINE); + else + vty_out(vty, " periodic location update %u%s", + gsmnet->t3212 * 6, VTY_NEWLINE); return CMD_SUCCESS; } @@ -2262,34 +2261,6 @@ bts->si_common.cell_ro_sel_par.present = 1; bts->si_common.cell_ro_sel_par.penalty_time = 31; - - return CMD_SUCCESS; -} - -DEFUN(cfg_bts_per_loc_upd, cfg_bts_per_loc_upd_cmd, - "periodic location update <6-1530>", - "Periodic Location Updating Interval\n" - "Periodic Location Updating Interval\n" - "Periodic Location Updating Interval\n" - "Periodic Location Updating Interval in Minutes\n") -{ - struct gsm_bts *bts = vty->index; - - bts->si_common.chan_desc.t3212 = atoi(argv[0]) / 6; - - return CMD_SUCCESS; -} - -DEFUN(cfg_bts_no_per_loc_upd, cfg_bts_no_per_loc_upd_cmd, - "no periodic location update", - NO_STR - "Periodic Location Updating Interval\n" - "Periodic Location Updating Interval\n" - "Periodic Location Updating Interval\n") -{ - struct gsm_bts *bts = vty->index; - - bts->si_common.chan_desc.t3212 = 0; return CMD_SUCCESS; } @@ -4129,7 +4100,6 @@ install_element_ve(&show_paging_group_cmd); logging_vty_add_cmds(NULL); - osmo_stats_vty_add_cmds(); install_element(GSMNET_NODE, &cfg_net_neci_cmd); install_element(GSMNET_NODE, &cfg_net_handover_cmd); @@ -4189,8 +4159,6 @@ install_element(BTS_NODE, &cfg_bts_rach_ec_allowed_cmd); install_element(BTS_NODE, &cfg_bts_rach_ac_class_cmd); install_element(BTS_NODE, &cfg_bts_ms_max_power_cmd); - install_element(BTS_NODE, &cfg_bts_per_loc_upd_cmd); - install_element(BTS_NODE, &cfg_bts_no_per_loc_upd_cmd); install_element(BTS_NODE, &cfg_bts_cell_resel_hyst_cmd); install_element(BTS_NODE, &cfg_bts_rxlev_acc_min_cmd); install_element(BTS_NODE, &cfg_bts_cell_bar_qualify_cmd); diff --git a/src/libbsc/gsm_04_08_utils.c b/src/libbsc/gsm_04_08_utils.c index 3447d27..7c5e0e9 100644 --- a/src/libbsc/gsm_04_08_utils.c +++ b/src/libbsc/gsm_04_08_utils.c @@ -270,61 +270,6 @@ return rsl_siemens_mrpci(lchan, &mrpci); } -int gsm48_extract_mi(uint8_t *classmark2_lv, int length, char *mi_string, uint8_t *mi_type) -{ - /* Check the size for the classmark */ - if (length < 1 + *classmark2_lv) - return -1; - - uint8_t *mi_lv = classmark2_lv + *classmark2_lv + 1; - if (length < 2 + *classmark2_lv + mi_lv[0]) - return -2; - - *mi_type = mi_lv[1] & GSM_MI_TYPE_MASK; - return gsm48_mi_to_string(mi_string, GSM48_MI_SIZE, mi_lv+1, *mi_lv); -} - -int gsm48_paging_extract_mi(struct gsm48_pag_resp *resp, int length, - char *mi_string, uint8_t *mi_type) -{ - static const uint32_t classmark_offset = - offsetof(struct gsm48_pag_resp, classmark2); - uint8_t *classmark2_lv = (uint8_t *) &resp->classmark2; - return gsm48_extract_mi(classmark2_lv, length - classmark_offset, - mi_string, mi_type); -} - -int gsm48_handle_paging_resp(struct gsm_subscriber_connection *conn, - struct msgb *msg, struct bsc_subscr *bsub) -{ - struct gsm_bts *bts = msg->lchan->ts->trx->bts; - struct gsm48_hdr *gh = msgb_l3(msg); - uint8_t *classmark2_lv = gh->data + 1; - - if (is_siemens_bts(bts)) - send_siemens_mrpci(msg->lchan, classmark2_lv); - - if (!conn->bsub) { - conn->bsub = bsub; - } else if (conn->bsub != bsub) { - LOGP(DRR, LOGL_ERROR, - "<- Channel already owned by someone else?\n"); - bsc_subscr_put(bsub); - return -EINVAL; - } else { - DEBUGP(DRR, "<- Channel already owned by us\n"); - bsc_subscr_put(bsub); - bsub = conn->bsub; - } - - rate_ctr_inc(&bts->network->bsc_ctrs->ctr[BSC_CTR_PAGING_COMPLETED]); - - /* Stop paging on the bts we received the paging response */ - paging_request_stop(&bts->network->bts_list, conn->bts, bsub, conn, - msg); - return 0; -} - /* Chapter 9.1.9: Ciphering Mode Command */ int gsm48_send_rr_ciph_mode(struct gsm_lchan *lchan, int want_imeisv) { diff --git a/src/libbsc/handover_decision.c b/src/libbsc/handover_decision.c index 0f07bca..8d7e047 100644 --- a/src/libbsc/handover_decision.c +++ b/src/libbsc/handover_decision.c @@ -33,6 +33,27 @@ #include #include +/* Get reference to a neighbor cell on a given BCCH ARFCN */ +static struct gsm_bts *gsm_bts_neighbor(const struct gsm_bts *bts, + uint16_t arfcn, uint8_t bsic) +{ + struct gsm_bts *neigh; + /* FIXME: use some better heuristics here to determine which cell + * using this ARFCN really is closest to the target cell. For + * now we simply assume that each ARFCN will only be used by one + * cell */ + + llist_for_each_entry(neigh, &bts->network->bts_list, list) { + /* FIXME: this is probably returning the same bts again!? */ + if (neigh->c0->arfcn == arfcn && + neigh->bsic == bsic) + return neigh; + } + + return NULL; +} + + /* issue handover to a cell identified by ARFCN and BSIC */ static int handover_to_arfcn_bsic(struct gsm_lchan *lchan, uint16_t arfcn, uint8_t bsic) diff --git a/src/libcommon-cs/common_cs.c b/src/libcommon-cs/common_cs.c index fc9caaf..8e19bb2 100644 --- a/src/libcommon-cs/common_cs.c +++ b/src/libcommon-cs/common_cs.c @@ -56,6 +56,9 @@ net->country_code = country_code; net->network_code = network_code; + /* Use 30 min periodic update interval as sane default */ + net->t3212 = 5; + INIT_LLIST_HEAD(&net->trans_list); INIT_LLIST_HEAD(&net->upqueue); INIT_LLIST_HEAD(&net->subscr_conns); @@ -107,6 +110,30 @@ return msg; } +int gsm48_extract_mi(uint8_t *classmark2_lv, int length, char *mi_string, uint8_t *mi_type) +{ + /* Check the size for the classmark */ + if (length < 1 + *classmark2_lv) + return -1; + + uint8_t *mi_lv = classmark2_lv + *classmark2_lv + 1; + if (length < 2 + *classmark2_lv + mi_lv[0]) + return -2; + + *mi_type = mi_lv[1] & GSM_MI_TYPE_MASK; + return gsm48_mi_to_string(mi_string, GSM48_MI_SIZE, mi_lv+1, *mi_lv); +} + +int gsm48_paging_extract_mi(struct gsm48_pag_resp *resp, int length, + char *mi_string, uint8_t *mi_type) +{ + static const uint32_t classmark_offset = + offsetof(struct gsm48_pag_resp, classmark2); + uint8_t *classmark2_lv = (uint8_t *) &resp->classmark2; + return gsm48_extract_mi(classmark2_lv, length - classmark_offset, + mi_string, mi_type); +} + uint8_t sms_next_rp_msg_ref(uint8_t *next_rp_ref) { const uint8_t rp_msg_ref = *next_rp_ref; diff --git a/src/libcommon-cs/common_cs_vty.c b/src/libcommon-cs/common_cs_vty.c index 86b4c53..1791687 100644 --- a/src/libcommon-cs/common_cs_vty.c +++ b/src/libcommon-cs/common_cs_vty.c @@ -284,6 +284,34 @@ return CMD_SUCCESS; } +DEFUN(cfg_net_per_loc_upd, cfg_net_per_loc_upd_cmd, + "periodic location update <6-1530>", + "Periodic Location Updating Interval\n" + "Periodic Location Updating Interval\n" + "Periodic Location Updating Interval\n" + "Periodic Location Updating Interval in Minutes\n") +{ + struct gsm_network *net = vty->index; + + net->t3212 = atoi(argv[0]) / 6; + + return CMD_SUCCESS; +} + +DEFUN(cfg_net_no_per_loc_upd, cfg_net_no_per_loc_upd_cmd, + "no periodic location update", + NO_STR + "Periodic Location Updating Interval\n" + "Periodic Location Updating Interval\n" + "Periodic Location Updating Interval\n") +{ + struct gsm_network *net = vty->index; + + net->t3212 = 0; + + return CMD_SUCCESS; +} + static struct gsm_network *vty_global_gsm_network = NULL; /* initialize VTY elements used in both BSC and MSC */ @@ -292,6 +320,8 @@ { OSMO_ASSERT(vty_global_gsm_network == NULL); vty_global_gsm_network = network; + + osmo_stats_vty_add_cmds(); install_element(CONFIG_NODE, &cfg_net_cmd); install_node(&net_node, config_write_net); @@ -310,6 +340,8 @@ install_element(GSMNET_NODE, &cfg_net_timezone_cmd); install_element(GSMNET_NODE, &cfg_net_timezone_dst_cmd); install_element(GSMNET_NODE, &cfg_net_no_timezone_cmd); + install_element(GSMNET_NODE, &cfg_net_per_loc_upd_cmd); + install_element(GSMNET_NODE, &cfg_net_no_per_loc_upd_cmd); install_element(GSMNET_NODE, &cfg_net_dyn_ts_allow_tch_f_cmd); return CMD_SUCCESS; diff --git a/src/libcommon/gsm_data.c b/src/libcommon/gsm_data.c index 7c717a4..f6fde37 100644 --- a/src/libcommon/gsm_data.c +++ b/src/libcommon/gsm_data.c @@ -71,25 +71,6 @@ return 0; } -/* Get reference to a neighbor cell on a given BCCH ARFCN */ -struct gsm_bts *gsm_bts_neighbor(const struct gsm_bts *bts, - uint16_t arfcn, uint8_t bsic) -{ - struct gsm_bts *neigh; - /* FIXME: use some better heuristics here to determine which cell - * using this ARFCN really is closest to the target cell. For - * now we simply assume that each ARFCN will only be used by one - * cell */ - - llist_for_each_entry(neigh, &bts->network->bts_list, list) { - if (neigh->c0->arfcn == arfcn && - neigh->bsic == bsic) - return neigh; - } - - return NULL; -} - const struct value_string bts_type_descs[_NUM_GSM_BTS_TYPE+1] = { { GSM_BTS_TYPE_UNKNOWN, "Unknown BTS Type" }, { GSM_BTS_TYPE_BS11, "Siemens BTS (BS-11 or compatible)" }, @@ -210,19 +191,6 @@ return 1; } -struct gsm_meas_rep *lchan_next_meas_rep(struct gsm_lchan *lchan) -{ - struct gsm_meas_rep *meas_rep; - - meas_rep = &lchan->meas_rep[lchan->meas_rep_idx]; - memset(meas_rep, 0, sizeof(*meas_rep)); - meas_rep->lchan = lchan; - lchan->meas_rep_idx = (lchan->meas_rep_idx + 1) - % ARRAY_SIZE(lchan->meas_rep); - - return meas_rep; -} - int gsm_btsmodel_set_feature(struct gsm_bts_model *model, enum gsm_bts_features feat) { OSMO_ASSERT(_NUM_BTS_FEAT < MAX_BTS_FEATURES); @@ -322,7 +290,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 = 5; /* Use 30 min periodic update interval as sane default */ + bts->si_common.chan_desc.t3212 = net->t3212; /* Use network's current value */ gsm_bts_set_radio_link_timeout(bts, 32); /* Use RADIO LINK TIMEOUT of 32 */ llist_add_tail(&bts->list, &net->bts_list); diff --git a/src/libcommon/talloc_ctx.c b/src/libcommon/talloc_ctx.c index 5e3d9ae..c8e9cd3 100644 --- a/src/libcommon/talloc_ctx.c +++ b/src/libcommon/talloc_ctx.c @@ -44,7 +44,6 @@ tall_authciphop_ctx = talloc_named_const(ctx_root, 0, "auth_ciph_oper"); tall_gsms_ctx = talloc_named_const(ctx_root, 0, "sms"); tall_subscr_ctx = talloc_named_const(ctx_root, 0, "subscriber"); - tall_sub_req_ctx = talloc_named_const(ctx_root, 0, "subscr_request"); tall_call_ctx = talloc_named_const(ctx_root, 0, "gsm_call"); tall_paging_ctx = talloc_named_const(ctx_root, 0, "paging_request"); tall_sigh_ctx = talloc_named_const(ctx_root, 0, "signal_handler"); diff --git a/src/libmsc/Makefile.am b/src/libmsc/Makefile.am index bb2a4a1..3c06514 100644 --- a/src/libmsc/Makefile.am +++ b/src/libmsc/Makefile.am @@ -23,6 +23,7 @@ $(NULL) libmsc_a_SOURCES = \ + a_iface.c \ auth.c \ db.c \ gsm_04_08.c \ @@ -32,6 +33,7 @@ mncc.c \ mncc_builtin.c \ mncc_sock.c \ + msc_ifaces.c \ rrlp.c \ silent_call.c \ sms_queue.c \ diff --git a/src/libmsc/a_iface.c b/src/libmsc/a_iface.c new file mode 100644 index 0000000..1f471f9 --- /dev/null +++ b/src/libmsc/a_iface.c @@ -0,0 +1,45 @@ +/* A-interface implementation, from MSC to BSC */ + +/* (C) 2016 by sysmocom s.m.f.c GmbH + * + * All Rights Reserved + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + * + */ + +#include +#include + +#include + +#include +#include +#include + +int a_tx(struct msgb *msg) +{ + LOGP(DMSC, LOGL_ERROR, "message to be sent to BSC, but A-interface" + " not implemented.\n%s\n", osmo_hexdump(msg->data, msg->len)); + return -1; +} + +int msc_gsm0808_tx_cipher_mode(struct gsm_subscriber_connection *conn, int cipher, + const uint8_t *key, int len, int include_imeisv) +{ + /* TODO generalize for A- and Iu interfaces, don't name after 08.08 */ + LOGP(DMSC, LOGL_ERROR, "gsm0808_cipher_mode(): message to be sent to" + " BSC, but A interface not yet implemented.\n"); + return -1; +} diff --git a/src/libmsc/gsm_04_08.c b/src/libmsc/gsm_04_08.c index 6cea242..21ffaaa 100644 --- a/src/libmsc/gsm_04_08.c +++ b/src/libmsc/gsm_04_08.c @@ -59,6 +59,7 @@ #include #include #include +#include #include #include @@ -71,10 +72,9 @@ #include + void *tall_locop_ctx; void *tall_authciphop_ctx; - -static int tch_rtp_signal(struct gsm_lchan *lchan, int signal); static int gsm0408_loc_upd_acc(struct gsm_subscriber_connection *conn, uint32_t send_tmsi); @@ -86,29 +86,6 @@ uint16_t mnc; uint16_t lac; }; - -static int apply_codec_restrictions(struct gsm_bts *bts, - struct gsm_mncc_bearer_cap *bcap) -{ - int i, j; - - /* remove unsupported speech versions from list */ - for (i = 0, j = 0; bcap->speech_ver[i] >= 0; i++) { - if (bcap->speech_ver[i] == GSM48_BCAP_SV_FR) - bcap->speech_ver[j++] = GSM48_BCAP_SV_FR; - if (bcap->speech_ver[i] == GSM48_BCAP_SV_EFR && bts->codec.efr) - bcap->speech_ver[j++] = GSM48_BCAP_SV_EFR; - if (bcap->speech_ver[i] == GSM48_BCAP_SV_AMR_F && bts->codec.amr) - bcap->speech_ver[j++] = GSM48_BCAP_SV_AMR_F; - if (bcap->speech_ver[i] == GSM48_BCAP_SV_HR && bts->codec.hr) - bcap->speech_ver[j++] = GSM48_BCAP_SV_HR; - if (bcap->speech_ver[i] == GSM48_BCAP_SV_AMR_H && bts->codec.amr) - bcap->speech_ver[j++] = GSM48_BCAP_SV_AMR_H; - } - bcap->speech_ver[j] = -1; - - return 0; -} static uint32_t new_callref = 0x80000001; @@ -126,27 +103,6 @@ * work that the caller no longer has to do */ if (trans) { gh->proto_discr = trans->protocol | (trans->transaction_id << 4); - msg->lchan = trans->conn->lchan; - } - - if (msg->lchan) { - struct e1inp_sign_link *sign_link = - msg->lchan->ts->trx->rsl_link; - - msg->dst = sign_link; - if (gsm48_hdr_pdisc(gh) == GSM48_PDISC_CC) - DEBUGP(DCC, "(bts %d trx %d ts %d ti %02x) " - "Sending '%s' to MS.\n", - sign_link->trx->bts->nr, - sign_link->trx->nr, msg->lchan->ts->nr, - gh->proto_discr & 0xf0, - gsm48_cc_msg_name(gh->msg_type)); - else - DEBUGP(DCC, "(bts %d trx %d ts %d pd %02x) " - "Sending 0x%02x to MS.\n", - sign_link->trx->bts->nr, - sign_link->trx->nr, msg->lchan->ts->nr, - gh->proto_discr, gh->msg_type); } return gsm0808_submit_dtap(conn, msg, 0, 0); @@ -187,7 +143,6 @@ /* Chapter 9.2.14 : Send LOCATION UPDATING REJECT */ int gsm0408_loc_upd_rej(struct gsm_subscriber_connection *conn, uint8_t cause) { - struct gsm_bts *bts = conn->bts; struct msgb *msg; msg = gsm48_create_loc_upd_rej(cause); @@ -196,11 +151,8 @@ return -1; } - msg->lchan = conn->lchan; - - LOGP(DMM, LOGL_INFO, "Subscriber %s: LOCATION UPDATING REJECT " - "LAC=%u BTS=%u\n", vlr_subscr_name(conn->vsub), - bts->location_area_code, bts->nr); + LOGP(DMM, LOGL_INFO, "Subscriber %s: LOCATION UPDATING REJECT\n", + vlr_subscr_name(conn->vsub)); return gsm48_conn_sendmsg(msg, conn, NULL); } @@ -214,8 +166,6 @@ struct gsm48_loc_area_id *lai; uint8_t *mid; - msg->lchan = conn->lchan; - gh = (struct gsm48_hdr *) msgb_put(msg, sizeof(*gh)); gh->proto_discr = GSM48_PDISC_MM; gh->msg_type = GSM48_MT_MM_LOC_UPD_ACCEPT; @@ -223,7 +173,7 @@ lai = (struct gsm48_loc_area_id *) msgb_put(msg, sizeof(*lai)); gsm48_generate_lai(lai, conn->network->country_code, conn->network->network_code, - conn->bts->location_area_code); + conn->lac); if (send_tmsi == GSM_RESERVED_TMSI) { /* we did not allocate a TMSI to the MS, so we need to @@ -257,8 +207,6 @@ { struct msgb *msg = gsm48_msgb_alloc_name("GSM 04.08 ID REQ"); struct gsm48_hdr *gh; - - msg->lchan = conn->lchan; gh = (struct gsm48_hdr *) msgb_put(msg, sizeof(*gh) + 1); gh->proto_discr = GSM48_PDISC_MM; @@ -376,7 +324,7 @@ &old_lai.plmn.mnc, &old_lai.lac); new_lai.plmn.mcc = conn->network->country_code; new_lai.plmn.mnc = conn->network->network_code; - new_lai.lac = conn->bts->location_area_code; + new_lai.lac = conn->lac; DEBUGP(DMM, "LU/new-LAC: %u/%u\n", old_lai.lac, new_lai.lac); lu_fsm = vlr_loc_update(conn->conn_fsm, @@ -436,8 +384,6 @@ struct tm* local_time; int tzunits; int dst = 0; - - msg->lchan = conn->lchan; gh = (struct gsm48_hdr *) msgb_put(msg, sizeof(*gh)); gh->proto_discr = GSM48_PDISC_MM; @@ -588,7 +534,6 @@ if (autn) DEBUGP(DMM, " AUTH REQ (autn = %s)\n", osmo_hexdump_nospc(autn, 16)); - msg->lchan = conn->lchan; gh->proto_discr = GSM48_PDISC_MM; gh->msg_type = GSM48_MT_MM_AUTH_REQ; @@ -663,7 +608,7 @@ * b) Try to parse the TMSI. If we do not have one reject * c) Check that we know the subscriber with the TMSI otherwise reject * with a HLR cause - * d) Set the subscriber on the gsm_lchan and accept + * d) Set the subscriber on the conn and accept * * Keep this function non-static for direct invocation by unit tests. */ @@ -688,19 +633,19 @@ lai.plmn.mcc = conn->network->country_code; lai.plmn.mnc = conn->network->network_code; - lai.lac = conn->bts->location_area_code; + lai.lac = conn->lac; DEBUGP(DMM, "<- CM SERVICE REQUEST "); if (msg->data_len < sizeof(struct gsm48_service_request*)) { DEBUGPC(DMM, "wrong sized message\n"); - return gsm48_tx_mm_serv_rej(conn, - GSM48_REJECT_INCORRECT_MESSAGE); + return msc_gsm48_tx_mm_serv_rej(conn, + GSM48_REJECT_INCORRECT_MESSAGE); } if (msg->data_len < req->mi_len + 6) { DEBUGPC(DMM, "does not fit in packet\n"); - return gsm48_tx_mm_serv_rej(conn, - GSM48_REJECT_INCORRECT_MESSAGE); + return msc_gsm48_tx_mm_serv_rej(conn, + GSM48_REJECT_INCORRECT_MESSAGE); } gsm48_mi_to_string(mi_string, sizeof(mi_string), mi, mi_len); @@ -716,8 +661,8 @@ mi_string); } else { DEBUGPC(DMM, "mi_type is not expected: %d\n", mi_type); - return gsm48_tx_mm_serv_rej(conn, - GSM48_REJECT_INCORRECT_MESSAGE); + return msc_gsm48_tx_mm_serv_rej(conn, + GSM48_REJECT_INCORRECT_MESSAGE); } osmo_signal_dispatch(SS_SUBSCR, S_SUBSCR_IDENTITY, (classmark2 + classmark2_len)); @@ -739,9 +684,6 @@ /* logging already happened in msc_create_conn_fsm() */ return rc; } - - if (is_siemens_bts(conn->bts)) - send_siemens_mrpci(msg->lchan, classmark2-1); vlr_proc_acc_req(conn->conn_fsm, SUBSCR_CONN_E_ACCEPTED, @@ -792,7 +734,6 @@ gsm48_mi_type_name(mi_type), mi_string); break; } - /* TODO? We used to remember the subscriber's classmark1 here and * stored it in the old sqlite db, but now we store it in a conn that @@ -1100,7 +1041,7 @@ lai.plmn.mcc = conn->network->country_code; lai.plmn.mnc = conn->network->network_code; - lai.lac = conn->bts->location_area_code; /* (will be replaced by conn->lac soon) */ + lai.lac = conn->lac; resp = (struct gsm48_pag_resp *) &gh->data[0]; gsm48_paging_extract_mi(resp, msgb_l3len(msg) - sizeof(*gh), @@ -1185,8 +1126,6 @@ { struct msgb *msg = gsm48_msgb_alloc_name("GSM 04.08 APP INF"); struct gsm48_hdr *gh; - - msg->lchan = conn->lchan; DEBUGP(DRR, "TX APPLICATION INFO id=0x%02x, len=%u\n", apdu_id, apdu_len); @@ -1279,8 +1218,6 @@ struct msgb *msg = gsm48_msgb_alloc_name("GSM 04.08 TX SIMPLE"); struct gsm48_hdr *gh = (struct gsm48_hdr *) msgb_put(msg, sizeof(*gh)); - msg->lchan = conn->lchan; - gh->proto_discr = pdisc; gh->msg_type = msg_type; @@ -1302,6 +1239,9 @@ struct msgb *msg; unsigned char *data; +#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) " @@ -1319,6 +1259,9 @@ else DEBUGP(DCC, "(bts - trx - ts - ti -- sub -) " "Sending '%s' to MNCC.\n", get_mncc_name(msg_type)); +#else + DEBUGP(DCC, "Sending '%s' to MNCC.\n", get_mncc_name(msg_type)); +#endif mncc->msg_type = msg_type; @@ -1362,8 +1305,6 @@ } if (trans->cc.state != GSM_CSTATE_NULL) new_cc_state(trans, GSM_CSTATE_NULL); - if (trans->conn) - trau_mux_unmap(&trans->conn->lchan->ts->e1_link, trans->callref); } static int gsm48_cc_tx_setup(struct gsm_trans *trans, void *arg); @@ -1377,13 +1318,12 @@ OSMO_ASSERT(!transt->conn); - /* check all tranactions (without lchan) for subscriber */ switch (event) { case GSM_PAGING_SUCCEEDED: DEBUGP(DCC, "Paging subscr %s succeeded!\n", vlr_subscr_msisdn_or_name(transt->vsub)); OSMO_ASSERT(conn); - /* Assign lchan */ + /* Assign conn */ transt->conn = conn; /* send SETUP request to called party */ gsm48_cc_tx_setup(transt, &transt->cc.msg); @@ -1410,235 +1350,6 @@ return 0; } -static int tch_recv_mncc(struct gsm_network *net, uint32_t callref, int enable); - -/* handle audio path for handover */ -static int switch_for_handover(struct gsm_lchan *old_lchan, - struct gsm_lchan *new_lchan) -{ - struct rtp_socket *old_rs, *new_rs, *other_rs; - - /* Ask the new socket to send to the already known port. */ - if (new_lchan->conn->mncc_rtp_bridge) { - LOGP(DHO, LOGL_DEBUG, "Forwarding RTP\n"); - rsl_ipacc_mdcx(new_lchan, - old_lchan->abis_ip.connect_ip, - old_lchan->abis_ip.connect_port, 0); - return 0; - } - - if (ipacc_rtp_direct) { - LOGP(DHO, LOGL_ERROR, "unable to handover in direct RTP mode\n"); - return 0; - } - - /* RTP Proxy mode */ - new_rs = new_lchan->abis_ip.rtp_socket; - old_rs = old_lchan->abis_ip.rtp_socket; - - if (!new_rs) { - LOGP(DHO, LOGL_ERROR, "no RTP socket for new_lchan\n"); - return -EIO; - } - - rsl_ipacc_mdcx_to_rtpsock(new_lchan); - - if (!old_rs) { - LOGP(DHO, LOGL_ERROR, "no RTP socket for old_lchan\n"); - return -EIO; - } - - /* copy rx_action and reference to other sock */ - new_rs->rx_action = old_rs->rx_action; - new_rs->tx_action = old_rs->tx_action; - new_rs->transmit = old_rs->transmit; - - switch (old_lchan->abis_ip.rtp_socket->rx_action) { - case RTP_PROXY: - other_rs = old_rs->proxy.other_sock; - rtp_socket_proxy(new_rs, other_rs); - /* delete reference to other end socket to prevent - * rtp_socket_free() from removing the inverse reference */ - old_rs->proxy.other_sock = NULL; - break; - case RTP_RECV_UPSTREAM: - new_rs->receive = old_rs->receive; - break; - case RTP_NONE: - break; - } - - return 0; -} - -static void maybe_switch_for_handover(struct gsm_lchan *lchan) -{ - struct gsm_lchan *old_lchan; - old_lchan = bsc_handover_pending(lchan); - if (old_lchan) - switch_for_handover(old_lchan, lchan); -} - -/* some other part of the code sends us a signal */ -static int handle_abisip_signal(unsigned int subsys, unsigned int signal, - void *handler_data, void *signal_data) -{ - struct gsm_lchan *lchan = signal_data; - int rc; - struct gsm_network *net; - struct gsm_trans *trans; - - if (subsys != SS_ABISIP) - return 0; - - /* RTP bridge handling */ - if (lchan->conn && lchan->conn->mncc_rtp_bridge) - return tch_rtp_signal(lchan, signal); - - /* in case we use direct BTS-to-BTS RTP */ - if (ipacc_rtp_direct) - return 0; - - switch (signal) { - case S_ABISIP_CRCX_ACK: - /* in case we don't use direct BTS-to-BTS RTP */ - /* the BTS has successfully bound a TCH to a local ip/port, - * which means we can connect our UDP socket to it */ - if (lchan->abis_ip.rtp_socket) { - rtp_socket_free(lchan->abis_ip.rtp_socket); - lchan->abis_ip.rtp_socket = NULL; - } - - lchan->abis_ip.rtp_socket = rtp_socket_create(); - if (!lchan->abis_ip.rtp_socket) - return -EIO; - - rc = rtp_socket_connect(lchan->abis_ip.rtp_socket, - lchan->abis_ip.bound_ip, - lchan->abis_ip.bound_port); - if (rc < 0) - return -EIO; - - /* check if any transactions on this lchan still have - * a tch_recv_mncc request pending */ - net = lchan->ts->trx->bts->network; - llist_for_each_entry(trans, &net->trans_list, entry) { - if (trans->conn && trans->conn->lchan == lchan && trans->tch_recv) { - DEBUGP(DCC, "pending tch_recv_mncc request\n"); - tch_recv_mncc(net, trans->callref, 1); - } - } - - /* - * TODO: this appears to be too early? Why not until after - * the handover detect or the handover complete? - * - * Do we have a handover pending for this new lchan? In that - * case re-route the audio from the old channel to the new one. - */ - maybe_switch_for_handover(lchan); - break; - case S_ABISIP_DLCX_IND: - /* the BTS tells us a RTP stream has been disconnected */ - if (lchan->abis_ip.rtp_socket) { - rtp_socket_free(lchan->abis_ip.rtp_socket); - lchan->abis_ip.rtp_socket = NULL; - } - - break; - } - - return 0; -} - -/* map two ipaccess RTP streams onto each other */ -static int tch_map(struct gsm_lchan *lchan, struct gsm_lchan *remote_lchan) -{ - struct gsm_bts *bts = lchan->ts->trx->bts; - struct gsm_bts *remote_bts = remote_lchan->ts->trx->bts; - enum gsm_chan_t lt = lchan->type, rt = remote_lchan->type; - enum gsm48_chan_mode lm = lchan->tch_mode, rm = remote_lchan->tch_mode; - int rc; - - DEBUGP(DCC, "Setting up TCH map between (bts=%u,trx=%u,ts=%u,%s) and " - "(bts=%u,trx=%u,ts=%u,%s)\n", - bts->nr, lchan->ts->trx->nr, lchan->ts->nr, - get_value_string(gsm_chan_t_names, lt), - remote_bts->nr, remote_lchan->ts->trx->nr, remote_lchan->ts->nr, - get_value_string(gsm_chan_t_names, rt)); - - if (bts->type != remote_bts->type) { - LOGP(DCC, LOGL_ERROR, "Cannot switch calls between different BTS types yet\n"); - return -EINVAL; - } - - if (lt != rt) { - LOGP(DCC, LOGL_ERROR, "Cannot patch through call with different" - " channel types: local = %s, remote = %s\n", - get_value_string(gsm_chan_t_names, lt), - get_value_string(gsm_chan_t_names, rt)); - return -EBADSLT; - } - - if (lm != rm) { - LOGP(DCC, LOGL_ERROR, "Cannot patch through call with different" - " channel modes: local = %s, remote = %s\n", - get_value_string(gsm48_chan_mode_names, lm), - get_value_string(gsm48_chan_mode_names, rm)); - return -EMEDIUMTYPE; - } - - // todo: map between different bts types - switch (bts->type) { - case GSM_BTS_TYPE_NANOBTS: - case GSM_BTS_TYPE_OSMOBTS: - if (!ipacc_rtp_direct) { - if (!lchan->abis_ip.rtp_socket) { - LOGP(DHO, LOGL_ERROR, "no RTP socket for " - "lchan\n"); - return -EIO; - } - if (!remote_lchan->abis_ip.rtp_socket) { - LOGP(DHO, LOGL_ERROR, "no RTP socket for " - "remote_lchan\n"); - return -EIO; - } - - /* connect the TCH's to our RTP proxy */ - rc = rsl_ipacc_mdcx_to_rtpsock(lchan); - if (rc < 0) - return rc; - rc = rsl_ipacc_mdcx_to_rtpsock(remote_lchan); - if (rc < 0) - return rc; - /* connect them with each other */ - rtp_socket_proxy(lchan->abis_ip.rtp_socket, - remote_lchan->abis_ip.rtp_socket); - } else { - /* directly connect TCH RTP streams to each other */ - rc = rsl_ipacc_mdcx(lchan, remote_lchan->abis_ip.bound_ip, - remote_lchan->abis_ip.bound_port, - remote_lchan->abis_ip.rtp_payload2); - if (rc < 0) - return rc; - rc = rsl_ipacc_mdcx(remote_lchan, lchan->abis_ip.bound_ip, - lchan->abis_ip.bound_port, - lchan->abis_ip.rtp_payload2); - } - break; - case GSM_BTS_TYPE_BS11: - case GSM_BTS_TYPE_RBS2000: - case GSM_BTS_TYPE_NOKIA_SITE: - trau_mux_map_lchan(lchan, remote_lchan); - break; - default: - LOGP(DCC, LOGL_ERROR, "Unknown BTS type %u\n", bts->type); - return -EINVAL; - } - - return 0; -} - /* bridge channels of two transactions */ static int tch_bridge(struct gsm_network *net, struct gsm_mncc_bridge *bridge) { @@ -1654,81 +1365,8 @@ /* Which subscriber do we want to track trans1 or trans2? */ log_set_context(LOG_CTX_VLR_SUBSCR, trans1->vsub); - /* through-connect channel */ - return tch_map(trans1->conn->lchan, trans2->conn->lchan); -} - -/* enable receive of channels to MNCC upqueue */ -static int tch_recv_mncc(struct gsm_network *net, uint32_t callref, int enable) -{ - struct gsm_trans *trans; - struct gsm_lchan *lchan; - struct gsm_bts *bts; - int rc; - - /* Find callref */ - trans = trans_find_by_callref(net, callref); - if (!trans) - return -EIO; - if (!trans->conn) - return 0; - - log_set_context(LOG_CTX_VLR_SUBSCR, trans->vsub); - lchan = trans->conn->lchan; - bts = lchan->ts->trx->bts; - - /* store receive state */ - trans->tch_recv = enable; - - switch (bts->type) { - case GSM_BTS_TYPE_NANOBTS: - case GSM_BTS_TYPE_OSMOBTS: - if (ipacc_rtp_direct) { - LOGP(DCC, LOGL_ERROR, "Error: RTP proxy is disabled\n"); - return -EINVAL; - } - /* In case, we don't have a RTP socket to the BTS yet, the BTS - * will not be connected to our RTP proxy and the socket will - * not be assigned to the application interface. This method - * will be called again, once the audio socket is created and - * connected. */ - if (!lchan->abis_ip.rtp_socket) { - DEBUGP(DCC, "queue tch_recv_mncc request (%d)\n", enable); - return 0; - } - if (enable) { - /* connect the TCH's to our RTP proxy */ - rc = rsl_ipacc_mdcx_to_rtpsock(lchan); - if (rc < 0) - return rc; - /* assign socket to application interface */ - rtp_socket_upstream(lchan->abis_ip.rtp_socket, - net, callref); - } else - rtp_socket_upstream(lchan->abis_ip.rtp_socket, - net, 0); - break; - case GSM_BTS_TYPE_BS11: - case GSM_BTS_TYPE_RBS2000: - case GSM_BTS_TYPE_NOKIA_SITE: - /* In case we don't have a TCH with correct mode, the TRAU muxer - * will not be asigned to the application interface. This is - * performed by switch_trau_mux() after successful handover or - * assignment. */ - if (lchan->tch_mode == GSM48_CMODE_SIGN) { - DEBUGP(DCC, "queue tch_recv_mncc request (%d)\n", enable); - return 0; - } - if (enable) - return trau_recv_lchan(lchan, callref); - return trau_mux_unmap(NULL, callref); - break; - default: - LOGP(DCC, LOGL_ERROR, "Unknown BTS type %u\n", bts->type); - return -EINVAL; - } - - return 0; + /* future: msc_call_bridge(trans1, trans2); */ + return -1; } static int gsm48_cc_rx_status_enq(struct gsm_trans *trans, struct msgb *msg) @@ -1868,7 +1506,7 @@ memset(&setup, 0, sizeof(struct gsm_mncc)); setup.callref = trans->callref; - setup.lchan_type = trans->conn->lchan->type; + tlv_parse(&tp, &gsm48_att_tlvdef, gh->data, payload_len, 0, 0); /* emergency setup is identified by msg_type */ if (msg_type == GSM48_MT_CC_EMERG_SETUP) @@ -1884,7 +1522,6 @@ setup.fields |= MNCC_F_BEARER_CAP; gsm48_decode_bearer_cap(&setup.bearer_cap, TLVP_VAL(&tp, GSM48_IE_BEARER_CAP)-1); - apply_codec_restrictions(trans->conn->bts, &setup.bearer_cap); } /* facility */ if (TLVP_PRESENT(&tp, GSM48_IE_FACILITY)) { @@ -2024,7 +1661,7 @@ memset(&call_conf, 0, sizeof(struct gsm_mncc)); call_conf.callref = trans->callref; - call_conf.lchan_type = trans->conn->lchan->type; + tlv_parse(&tp, &gsm48_att_tlvdef, gh->data, payload_len, 0, 0); #if 0 /* repeat */ @@ -2038,7 +1675,6 @@ call_conf.fields |= MNCC_F_BEARER_CAP; gsm48_decode_bearer_cap(&call_conf.bearer_cap, TLVP_VAL(&tp, GSM48_IE_BEARER_CAP)-1); - apply_codec_restrictions(trans->conn->bts, &call_conf.bearer_cap); } /* cause */ if (TLVP_PRESENT(&tp, GSM48_IE_CAUSE)) { @@ -2728,7 +2364,6 @@ modify.fields |= MNCC_F_BEARER_CAP; gsm48_decode_bearer_cap(&modify.bearer_cap, TLVP_VAL(&tp, GSM48_IE_BEARER_CAP)-1); - apply_codec_restrictions(trans->conn->bts, &modify.bearer_cap); } new_cc_state(trans, GSM_CSTATE_MO_ORIG_MODIFY); @@ -2771,7 +2406,6 @@ modify.fields |= MNCC_F_BEARER_CAP; gsm48_decode_bearer_cap(&modify.bearer_cap, TLVP_VAL(&tp, GSM48_IE_BEARER_CAP)-1); - apply_codec_restrictions(trans->conn->bts, &modify.bearer_cap); } new_cc_state(trans, GSM_CSTATE_ACTIVE); @@ -2812,7 +2446,6 @@ modify.fields |= GSM48_IE_BEARER_CAP; gsm48_decode_bearer_cap(&modify.bearer_cap, TLVP_VAL(&tp, GSM48_IE_BEARER_CAP)-1); - apply_codec_restrictions(trans->conn->bts, &modify.bearer_cap); } /* cause */ if (TLVP_PRESENT(&tp, GSM48_IE_CAUSE)) { @@ -2915,229 +2548,6 @@ return mncc_recvmsg(trans->net, trans, MNCC_USERINFO_IND, &user); } -static int _gsm48_lchan_modify(struct gsm_trans *trans, void *arg) -{ - struct gsm_mncc *mode = arg; - struct gsm_lchan *lchan = trans->conn->lchan; - - /* - * We were forced to make an assignment a lot earlier and - * we should avoid sending another assignment that might - * even lead to a different kind of lchan (TCH/F vs. TCH/H). - * In case of rtp-bridge it is too late to change things - * here. - */ - if (trans->conn->mncc_rtp_bridge && lchan->tch_mode != GSM48_CMODE_SIGN) - return 0; - - return gsm0808_assign_req(trans->conn, mode->lchan_mode, - trans->conn->lchan->type != GSM_LCHAN_TCH_H); -} - -static void mncc_recv_rtp(struct gsm_network *net, uint32_t callref, - int cmd, uint32_t addr, uint16_t port, uint32_t payload_type, - uint32_t payload_msg_type) -{ - uint8_t data[sizeof(struct gsm_mncc)]; - struct gsm_mncc_rtp *rtp; - - memset(&data, 0, sizeof(data)); - rtp = (struct gsm_mncc_rtp *) &data[0]; - - rtp->callref = callref; - rtp->msg_type = cmd; - rtp->ip = addr; - rtp->port = port; - rtp->payload_type = payload_type; - rtp->payload_msg_type = payload_msg_type; - mncc_recvmsg(net, NULL, cmd, (struct gsm_mncc *)data); -} - -static void mncc_recv_rtp_sock(struct gsm_network *net, struct gsm_trans *trans, int cmd) -{ - struct gsm_lchan *lchan; - int msg_type; - - lchan = trans->conn->lchan; - switch (lchan->abis_ip.rtp_payload) { - case RTP_PT_GSM_FULL: - msg_type = GSM_TCHF_FRAME; - break; - case RTP_PT_GSM_EFR: - msg_type = GSM_TCHF_FRAME_EFR; - break; - case RTP_PT_GSM_HALF: - msg_type = GSM_TCHH_FRAME; - break; - case RTP_PT_AMR: - msg_type = GSM_TCH_FRAME_AMR; - break; - default: - LOGP(DMNCC, LOGL_ERROR, "%s unknown payload type %d\n", - gsm_lchan_name(lchan), lchan->abis_ip.rtp_payload); - msg_type = 0; - break; - } - - return mncc_recv_rtp(net, trans->callref, cmd, - lchan->abis_ip.bound_ip, - lchan->abis_ip.bound_port, - lchan->abis_ip.rtp_payload, - msg_type); -} - -static void mncc_recv_rtp_err(struct gsm_network *net, uint32_t callref, int cmd) -{ - return mncc_recv_rtp(net, callref, cmd, 0, 0, 0, 0); -} - -static int tch_rtp_create(struct gsm_network *net, uint32_t callref) -{ - struct gsm_bts *bts; - struct gsm_lchan *lchan; - struct gsm_trans *trans; - enum gsm48_chan_mode m; - - /* Find callref */ - trans = trans_find_by_callref(net, callref); - if (!trans) { - LOGP(DMNCC, LOGL_ERROR, "RTP create for non-existing trans\n"); - mncc_recv_rtp_err(net, callref, MNCC_RTP_CREATE); - return -EIO; - } - log_set_context(LOG_CTX_VLR_SUBSCR, trans->vsub); - if (!trans->conn) { - LOGP(DMNCC, LOGL_NOTICE, "RTP create for trans without conn\n"); - mncc_recv_rtp_err(net, callref, MNCC_RTP_CREATE); - return 0; - } - - lchan = trans->conn->lchan; - bts = lchan->ts->trx->bts; - if (!is_ipaccess_bts(bts)) { - /* - * I want this to be straight forward and have no audio flow - * through the nitb/osmo-mss system. This currently means that - * this will not work with BS11/Nokia type BTS. We would need - * to have a trau<->rtp bridge for these but still preferable - * in another process. - */ - LOGP(DMNCC, LOGL_ERROR, "RTP create only works with IP systems\n"); - mncc_recv_rtp_err(net, callref, MNCC_RTP_CREATE); - return -EINVAL; - } - - trans->conn->mncc_rtp_bridge = 1; - /* - * *sigh* we need to pick a codec now. Pick the most generic one - * right now and hope we could fix that later on. This is very - * similiar to the routine above. - * Fallback to the internal MNCC mode to select a route. - */ - if (lchan->tch_mode == GSM48_CMODE_SIGN) { - trans->conn->mncc_rtp_create_pending = 1; - m = mncc_codec_for_mode(lchan->type); - LOGP(DMNCC, LOGL_DEBUG, "RTP create: codec=%s, chan_type=%s\n", - get_value_string(gsm48_chan_mode_names, m), - get_value_string(gsm_chan_t_names, lchan->type)); - return gsm0808_assign_req(trans->conn, m, - lchan->type != GSM_LCHAN_TCH_H); - } - - mncc_recv_rtp_sock(trans->net, trans, MNCC_RTP_CREATE); - return 0; -} - -static int tch_rtp_connect(struct gsm_network *net, void *arg) -{ - struct gsm_lchan *lchan; - struct gsm_trans *trans; - struct gsm_mncc_rtp *rtp = arg; - - /* Find callref */ - trans = trans_find_by_callref(net, rtp->callref); - if (!trans) { - LOGP(DMNCC, LOGL_ERROR, "RTP connect for non-existing trans\n"); - mncc_recv_rtp_err(net, rtp->callref, MNCC_RTP_CONNECT); - return -EIO; - } - log_set_context(LOG_CTX_VLR_SUBSCR, trans->vsub); - if (!trans->conn) { - LOGP(DMNCC, LOGL_ERROR, "RTP connect for trans without conn\n"); - mncc_recv_rtp_err(net, rtp->callref, MNCC_RTP_CONNECT); - return 0; - } - - lchan = trans->conn->lchan; - LOGP(DMNCC, LOGL_DEBUG, "RTP connect: codec=%s, chan_type=%s\n", - get_value_string(gsm48_chan_mode_names, - mncc_codec_for_mode(lchan->type)), - get_value_string(gsm_chan_t_names, lchan->type)); - - /* TODO: Check if payload_msg_type is compatible with what we have */ - if (rtp->payload_type != lchan->abis_ip.rtp_payload) { - LOGP(DMNCC, LOGL_ERROR, "RTP connect with different RTP payload\n"); - mncc_recv_rtp_err(net, rtp->callref, MNCC_RTP_CONNECT); - } - - /* - * FIXME: payload2 can't be sent with MDCX as the osmo-bts code - * complains about both rtp and rtp payload2 being present in the - * same package! - */ - trans->conn->mncc_rtp_connect_pending = 1; - return rsl_ipacc_mdcx(lchan, rtp->ip, rtp->port, 0); -} - -static int tch_rtp_signal(struct gsm_lchan *lchan, int signal) -{ - struct gsm_network *net; - struct gsm_trans *tmp, *trans = NULL; - - net = lchan->ts->trx->bts->network; - llist_for_each_entry(tmp, &net->trans_list, entry) { - if (!tmp->conn) - continue; - if (tmp->conn->lchan != lchan && tmp->conn->ho_lchan != lchan) - continue; - trans = tmp; - break; - } - - if (!trans) { - LOGP(DMNCC, LOGL_ERROR, "%s IPA abis signal but no transaction.\n", - gsm_lchan_name(lchan)); - return 0; - } - - switch (signal) { - case S_ABISIP_CRCX_ACK: - if (lchan->conn->mncc_rtp_create_pending) { - lchan->conn->mncc_rtp_create_pending = 0; - LOGP(DMNCC, LOGL_NOTICE, "%s sending pending RTP create ind.\n", - gsm_lchan_name(lchan)); - mncc_recv_rtp_sock(net, trans, MNCC_RTP_CREATE); - } - /* - * TODO: this appears to be too early? Why not until after - * the handover detect or the handover complete? - */ - maybe_switch_for_handover(lchan); - break; - case S_ABISIP_MDCX_ACK: - if (lchan->conn->mncc_rtp_connect_pending) { - lchan->conn->mncc_rtp_connect_pending = 0; - LOGP(DMNCC, LOGL_NOTICE, "%s sending pending RTP connect ind.\n", - gsm_lchan_name(lchan)); - mncc_recv_rtp_sock(net, trans, MNCC_RTP_CONNECT); - } - break; - } - - return 0; -} - - static struct downstate { uint32_t states; int type; @@ -3191,9 +2601,6 @@ MNCC_DISC_REQ, gsm48_cc_tx_disconnect}, {ALL_STATES - SBIT(GSM_CSTATE_NULL) - SBIT(GSM_CSTATE_RELEASE_REQ), /* 5.4.3.2 */ MNCC_REL_REQ, gsm48_cc_tx_release}, - /* special */ - {ALL_STATES, - MNCC_LCHAN_MODIFY, _gsm48_lchan_modify}, }; #define DOWNSLLEN \ @@ -3205,7 +2612,6 @@ int i, rc = 0; struct gsm_trans *trans = NULL, *transt; struct gsm_subscriber_connection *conn = NULL; - struct gsm_bts *bts = NULL; struct gsm_mncc *data = arg, rel; DEBUGP(DMNCC, "receive message %s\n", get_mncc_name(msg_type)); @@ -3218,60 +2624,17 @@ disconnect_bridge(net, arg, -rc); return rc; case MNCC_FRAME_DROP: - return tch_recv_mncc(net, data->callref, 0); case MNCC_FRAME_RECV: - return tch_recv_mncc(net, data->callref, 1); case MNCC_RTP_CREATE: - return tch_rtp_create(net, data->callref); case MNCC_RTP_CONNECT: - return tch_rtp_connect(net, arg); case MNCC_RTP_FREE: - /* unused right now */ - return -EIO; case GSM_TCHF_FRAME: case GSM_TCHF_FRAME_EFR: case GSM_TCHH_FRAME: case GSM_TCH_FRAME_AMR: - /* Find callref */ - trans = trans_find_by_callref(net, data->callref); - if (!trans) { - LOGP(DMNCC, LOGL_ERROR, "TCH frame for non-existing trans\n"); - return -EIO; - } - log_set_context(LOG_CTX_VLR_SUBSCR, trans->vsub); - if (!trans->conn) { - LOGP(DMNCC, LOGL_NOTICE, "TCH frame for trans without conn\n"); - return 0; - } - if (!trans->conn->lchan) { - LOGP(DMNCC, LOGL_NOTICE, "TCH frame for trans without lchan\n"); - return 0; - } - if (trans->conn->lchan->type != GSM_LCHAN_TCH_F - && trans->conn->lchan->type != GSM_LCHAN_TCH_H) { - /* This should be LOGL_ERROR or NOTICE, but - * unfortuantely it happens for a couple of frames at - * the beginning of every RTP connection */ - LOGP(DMNCC, LOGL_DEBUG, "TCH frame for lchan != TCH_F/TCH_H\n"); - return 0; - } - bts = trans->conn->lchan->ts->trx->bts; - switch (bts->type) { - case GSM_BTS_TYPE_NANOBTS: - case GSM_BTS_TYPE_OSMOBTS: - if (!trans->conn->lchan->abis_ip.rtp_socket) { - DEBUGP(DMNCC, "TCH frame to lchan without RTP connection\n"); - return 0; - } - return rtp_send_frame(trans->conn->lchan->abis_ip.rtp_socket, arg); - case GSM_BTS_TYPE_BS11: - case GSM_BTS_TYPE_RBS2000: - case GSM_BTS_TYPE_NOKIA_SITE: - return trau_send_frame(trans->conn->lchan, arg); - default: - LOGP(DCC, LOGL_ERROR, "Unknown BTS type %u\n", bts->type); - } - return -EINVAL; + LOGP(DMNCC, LOGL_ERROR, "RTP streams must be handled externally; %s not supported.\n", + get_mncc_name(msg_type)); + return -ENOTSUP; } memset(&rel, 0, sizeof(struct gsm_mncc)); @@ -3347,14 +2710,15 @@ GSM48_CC_CAUSE_RESOURCE_UNAVAIL); return -ENOMEM; } - /* Find lchan */ + + /* Find conn */ conn = connection_for_subscr(vsub); - /* If subscriber has no lchan */ + /* If subscriber has no conn */ if (!conn) { /* find transaction with this subscriber already paging */ llist_for_each_entry(transt, &net->trans_list, entry) { - /* Transaction of our lchan? */ + /* Transaction of our conn? */ if (transt == trans || transt->vsub != vsub) continue; @@ -3372,7 +2736,7 @@ memcpy(&trans->cc.msg, data, sizeof(struct gsm_mncc)); /* Request a channel */ - trans->paging_request = subscr_request_channel( + trans->paging_request = subscr_request_conn( vsub, RSL_CHANNEED_TCH_F, setup_trig_pag_evt, @@ -3386,7 +2750,8 @@ vlr_subscr_put(vsub); return 0; } - /* Assign lchan */ + + /* Assign conn */ trans->conn = msc_subscr_conn_get(conn); vlr_subscr_put(vsub); } else { @@ -3399,7 +2764,7 @@ /* if paging did not respond yet */ if (!conn) { - DEBUGP(DCC, "(bts - trx - ts - ti -- sub %s) " + DEBUGP(DCC, "(sub %s) " "Received '%s' from MNCC in paging state\n", vlr_subscr_msisdn_or_name(trans->vsub), get_mncc_name(msg_type)); @@ -3414,9 +2779,8 @@ return rc; } - DEBUGP(DCC, "(bts %d trx %d ts %d ti %02x sub %s) " + DEBUGP(DCC, "(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, trans->transaction_id, vlr_subscr_msisdn_or_name(trans->conn->vsub), get_mncc_name(msg_type), trans->cc.state, @@ -3513,12 +2877,16 @@ /* 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) { @@ -3836,11 +3204,18 @@ net->gsup_server_port); } -/* - * This will be run by the linker when loading the DSO. We use it to - * do system initialization, e.g. registration of signal handlers. - */ -static __attribute__((constructor)) void on_dso_load_0408(void) +/* This is a temporary shim merely to ensure that the unit tests still work. It + * shall be removed as soon as Iu and A interface paging is implemented. */ +int msc_fake_paging_request(struct vlr_subscr *vsub) { - osmo_signal_register_handler(SS_ABISIP, handle_abisip_signal, NULL); + LOGP(DMM, LOGL_ERROR, "Paging currently not implemented in the MSC.\n"); + OSMO_ASSERT(false); +} + +/* This is a temporary shim merely to ensure that the unit tests still work. It + * shall be removed as soon as Iu and A interface paging is implemented. */ +void msc_fake_paging_request_stop(struct vlr_subscr *vsub) +{ + LOGP(DMM, LOGL_ERROR, "Paging currently not implemented in the MSC.\n"); + OSMO_ASSERT(false); } diff --git a/src/libmsc/gsm_04_11.c b/src/libmsc/gsm_04_11.c index 6ad944b..3255a3b 100644 --- a/src/libmsc/gsm_04_11.c +++ b/src/libmsc/gsm_04_11.c @@ -878,7 +878,7 @@ } /* Take a SMS in gsm_sms structure and send it through an already - * existing lchan. We also assume that the caller ensured this lchan already + * existing conn. We also assume that the caller ensured this conn already * has a SAPI3 RLL connection! */ int gsm411_send_sms(struct gsm_subscriber_connection *conn, struct gsm_sms *sms) { @@ -1004,7 +1004,7 @@ struct gsm_subscriber_connection *conn; void *res; - /* check if we already have an open lchan to the subscriber. + /* check if we already have an open conn to the subscriber. * if yes, send the SMS this way */ conn = connection_for_subscr(vsub); if (conn) { @@ -1016,8 +1016,8 @@ /* if not, we have to start paging */ LOGP(DLSMS, LOGL_DEBUG, "Sending SMS: no connection open, start paging %s\n", vlr_subscr_name(vsub)); - res = subscr_request_channel(vsub, RSL_CHANNEED_SDCCH, - paging_cb_send_sms, sms); + res = subscr_request_conn(vsub, RSL_CHANNEED_SDCCH, paging_cb_send_sms, + sms); if (!res) { send_signal(S_SMS_UNKNOWN_ERROR, NULL, sms, GSM_PAGING_BUSY); sms_free(sms); diff --git a/src/libmsc/gsm_subscriber.c b/src/libmsc/gsm_subscriber.c index e9b2e0e..69d79b0 100644 --- a/src/libmsc/gsm_subscriber.c +++ b/src/libmsc/gsm_subscriber.c @@ -41,43 +41,6 @@ #include #include -void *tall_sub_req_ctx; - -int gsm48_secure_channel(struct gsm_subscriber_connection *conn, int key_seq, - gsm_cbfn *cb, void *cb_data); - - -/* - * Struct for pending channel requests. This is managed in the - * llist_head requests of each subscriber. The reference counting - * should work in such a way that a subscriber with a pending request - * remains in memory. - */ -struct subscr_request { - struct llist_head entry; - - /* the callback data */ - gsm_cbfn *cbfn; - void *param; -}; - -static struct bsc_subscr *vlr_subscr_to_bsc_sub(struct llist_head *bsc_subscribers, - struct vlr_subscr *vsub) -{ - struct bsc_subscr *sub; - /* TODO MSC split -- creating a BSC subscriber directly from MSC data - * structures in RAM. At some point the MSC will send a message to the - * BSC instead. */ - sub = bsc_subscr_find_or_create_by_imsi(bsc_subscribers, vsub->imsi); - sub->tmsi = vsub->tmsi; - sub->lac = vsub->lac; - return sub; -} - -/* - * We got the channel assigned and can now hand this channel - * over to one of our callbacks. - */ int subscr_paging_dispatch(unsigned int hooknum, unsigned int event, struct msgb *msg, void *data, void *param) { @@ -85,22 +48,12 @@ struct gsm_subscriber_connection *conn = data; struct vlr_subscr *vsub = param; struct paging_signal_data sig_data; - struct bsc_subscr *bsub; - struct gsm_network *net; OSMO_ASSERT(vsub && vsub->cs.is_paging); - net = vsub->vlr->user_ctx; - /* - * Stop paging on all other BTS. E.g. if this is - * the first timeout on a BTS then the others will - * timeout soon as well. Let's just stop everything - * and forget we wanted to page. - */ - - bsub = vlr_subscr_to_bsc_sub(conn->network->bsc_subscribers, vsub); - paging_request_stop(&net->bts_list, NULL, bsub, NULL, NULL); - bsc_subscr_put(bsub); + /* FIXME: implement stop paging in libmsc; + * faking it for the unit tests to still work */ + msc_fake_paging_request_stop(vsub); /* Inform parts of the system we don't know */ sig_data.vsub = vsub; @@ -126,22 +79,21 @@ return 0; } -struct subscr_request *subscr_request_channel(struct vlr_subscr *vsub, - int channel_type, - gsm_cbfn *cbfn, void *param) +struct subscr_request *subscr_request_conn(struct vlr_subscr *vsub, int channel_type, gsm_cbfn *cbfn, + void *param) { int rc; struct subscr_request *request; - struct bsc_subscr *bsub; - struct gsm_network *net = vsub->vlr->user_ctx; /* Start paging.. we know it is async so we can do it before */ if (!vsub->cs.is_paging) { LOGP(DMM, LOGL_DEBUG, "Subscriber %s not paged yet.\n", vlr_subscr_name(vsub)); - bsub = vlr_subscr_to_bsc_sub(net->bsc_subscribers, vsub); - rc = paging_request(net, bsub, channel_type, NULL, NULL); - bsc_subscr_put(bsub); + + /* FIXME: implement paging in libmsc; + * faking it for the unit tests to still work */ + rc = msc_fake_paging_request(vsub); + if (rc <= 0) { LOGP(DMM, LOGL_ERROR, "Subscriber %s paging failed: %d\n", vlr_subscr_name(vsub), rc); diff --git a/src/libmsc/mncc_builtin.c b/src/libmsc/mncc_builtin.c index 067cc92..ac6e734 100644 --- a/src/libmsc/mncc_builtin.c +++ b/src/libmsc/mncc_builtin.c @@ -65,21 +65,6 @@ return NULL; } -uint8_t mncc_codec_for_mode(int lchan_type) -{ - /* FIXME: check codec capabilities of the phone */ - - if (lchan_type != GSM_LCHAN_TCH_H) - return mncc_int.def_codec[0]; - else - return mncc_int.def_codec[1]; -} - -static uint8_t determine_lchan_mode(struct gsm_mncc *setup) -{ - return mncc_codec_for_mode(setup->lchan_type); -} - /* on incoming call, look up database and send setup to remote subscr. */ static int mncc_setup_ind(struct gsm_call *call, int msg_type, struct gsm_mncc *setup) @@ -137,9 +122,7 @@ /* modify mode */ memset(&mncc, 0, sizeof(struct gsm_mncc)); mncc.callref = call->callref; - mncc.lchan_mode = determine_lchan_mode(setup); - DEBUGP(DMNCC, "(call %x) Modify channel mode: %s\n", call->callref, - get_value_string(gsm48_chan_mode_names, mncc.lchan_mode)); + DEBUGP(DMNCC, "(call %x) Modify channel mode\n", call->callref); mncc_tx_to_cc(call->net, MNCC_LCHAN_MODIFY, &mncc); /* send setup to remote */ @@ -206,10 +189,6 @@ bridge.callref[0] = call->callref; bridge.callref[1] = call->remote_ref; DEBUGP(DMNCC, "(call %x) Bridging with remote.\n", call->callref); - - /* in direct mode, we always have to bridge the channels */ - if (ipacc_rtp_direct) - return mncc_tx_to_cc(call->net, MNCC_BRIDGE, &bridge); /* proxy mode */ if (!net->handover.active) { @@ -279,28 +258,6 @@ return 0; } -/* receiving a (speech) traffic frame from the BSC code */ -static int mncc_rcv_data(struct gsm_call *call, int msg_type, - struct gsm_data_frame *dfr) -{ - struct gsm_trans *remote_trans; - - remote_trans = trans_find_by_callref(call->net, call->remote_ref); - - /* this shouldn't really happen */ - if (!remote_trans || !remote_trans->conn) { - LOGP(DMNCC, LOGL_ERROR, "No transaction or transaction without lchan?!?\n"); - return -EIO; - } - - /* RTP socket of remote end has meanwhile died */ - if (!remote_trans->conn->lchan->abis_ip.rtp_socket) - return -EIO; - - return rtp_send_frame(remote_trans->conn->lchan->abis_ip.rtp_socket, dfr); -} - - /* Internal MNCC handler input function (from CC -> MNCC -> here) */ int int_mncc_recv(struct gsm_network *net, struct msgb *msg) { @@ -346,7 +303,8 @@ } if (mncc_is_data_frame(msg_type)) { - rc = mncc_rcv_data(call, msg_type, arg); + LOGP(DMNCC, LOGL_ERROR, "(call %x) Received data frame, which is not supported.\n", + call->callref); goto out_free; } @@ -364,7 +322,6 @@ break; case MNCC_CALL_CONF_IND: /* we now need to MODIFY the channel */ - data->lchan_mode = determine_lchan_mode(data); mncc_tx_to_cc(call->net, MNCC_LCHAN_MODIFY, data); break; case MNCC_ALERT_IND: diff --git a/src/libmsc/mncc_sock.c b/src/libmsc/mncc_sock.c index 0efe3a1..0c696f2 100644 --- a/src/libmsc/mncc_sock.c +++ b/src/libmsc/mncc_sock.c @@ -224,7 +224,6 @@ hello->called_offset = offsetof(struct gsm_mncc, called); hello->signal_offset = offsetof(struct gsm_mncc, signal); hello->emergency_offset = offsetof(struct gsm_mncc, emergency); - hello->lchan_type_offset = offsetof(struct gsm_mncc, lchan_type); msgb_enqueue(&mncc->net->upqueue, msg); mncc->conn_bfd.when |= BSC_FD_WRITE; diff --git a/src/libmsc/msc_ifaces.c b/src/libmsc/msc_ifaces.c new file mode 100644 index 0000000..001fcba --- /dev/null +++ b/src/libmsc/msc_ifaces.c @@ -0,0 +1,84 @@ +/* Implementation for MSC decisions which interface to send messages out on. */ + +/* (C) 2016 by sysmocom s.m.f.c GmbH + * + * All Rights Reserved + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +#include + +#include +#include +#include + +static int msc_tx(struct gsm_subscriber_connection *conn, struct msgb *msg) +{ + switch (conn->via_ran) { + /* FUTURE + case RAN_GERAN_A: + msg->dst = conn; + return a_tx(msg); + + case RAN_UTRAN_IU: + msg->dst = conn->iu.ue_ctx; + return iu_tx(msg, 0); + */ + default: + LOGP(DMSC, LOGL_ERROR, + "msc_tx(): conn->via_ran invalid (%d)\n", + conn->via_ran); + return -1; + } +} + + +int msc_tx_dtap(struct gsm_subscriber_connection *conn, + struct msgb *msg) +{ + return msc_tx(conn, msg); +} + + +/* 9.2.5 CM service accept */ +int msc_gsm48_tx_mm_serv_ack(struct gsm_subscriber_connection *conn) +{ + struct msgb *msg = gsm48_msgb_alloc_name("GSM 04.08 SERV ACC"); + struct gsm48_hdr *gh = (struct gsm48_hdr *) msgb_put(msg, sizeof(*gh)); + + gh->proto_discr = GSM48_PDISC_MM; + gh->msg_type = GSM48_MT_MM_CM_SERV_ACC; + + DEBUGP(DMM, "-> CM SERVICE ACCEPT\n"); + + return msc_tx_dtap(conn, msg); +} + +/* 9.2.6 CM service reject */ +int msc_gsm48_tx_mm_serv_rej(struct gsm_subscriber_connection *conn, + enum gsm48_reject_value value) +{ + struct msgb *msg; + + msg = gsm48_create_mm_serv_rej(value); + if (!msg) { + LOGP(DMM, LOGL_ERROR, "Failed to allocate CM Service Reject.\n"); + return -1; + } + + DEBUGP(DMM, "-> CM SERVICE Reject cause: %d\n", value); + + return msc_tx_dtap(conn, msg); +} diff --git a/src/libmsc/osmo_msc.c b/src/libmsc/osmo_msc.c index 95e5818..c847b78 100644 --- a/src/libmsc/osmo_msc.c +++ b/src/libmsc/osmo_msc.c @@ -21,6 +21,7 @@ * */ +#include #include #include #include @@ -69,9 +70,10 @@ osmo_fsm_inst_dispatch(conn->conn_fsm, SUBSCR_CONN_E_BUMP, NULL); } -/* Receive a COMPLETE LAYER3 INFO from BSC */ -static int msc_compl_l3(struct gsm_subscriber_connection *conn, struct msgb *msg, - uint16_t chosen_channel) +/* receive a Level 3 Complete message and return MSC_CONN_ACCEPT or + * MSC_CONN_REJECT */ +static int msc_compl_l3(struct gsm_subscriber_connection *conn, + struct msgb *msg, uint16_t chosen_channel) { /* Ownership of the gsm_subscriber_connection is still a bit mucky * between libbsc and libmsc. In libmsc, we use ref counting, but not @@ -87,7 +89,7 @@ /* keep the use_count reserved, libbsc will discard. If we * released the ref count and discarded here, libbsc would * double-free. And we will not change bsc_api semantics. */ - return BSC_API_CONN_POL_REJECT; + return MSC_CONN_REJECT; } DEBUGP(DMM, "compl_l3: Keeping conn\n"); @@ -96,7 +98,7 @@ /* If this should be kept, the conn->conn_fsm has placed a use_count */ msc_subscr_conn_put(conn); - return BSC_API_CONN_POL_ACCEPT; + return MSC_CONN_ACCEPT; #if 0 /* @@ -105,14 +107,14 @@ * pending transaction or ongoing operation. */ if (conn->silent_call) - return BSC_API_CONN_POL_ACCEPT; - if (conn->sec_operation || conn->anch_operation) - return BSC_API_CONN_POL_ACCEPT; + return MSC_CONN_ACCEPT; + if (conn->loc_operation || conn->sec_operation || conn->anch_operation) + return MSC_CONN_ACCEPT; if (trans_has_conn(conn)) - return BSC_API_CONN_POL_ACCEPT; + return MSC_CONN_ACCEPT; LOGP(DRR, LOGL_INFO, "MSC Complete L3: Rejecting connection.\n"); - return BSC_API_CONN_POL_REJECT; + return MSC_CONN_REJECT; #endif } diff --git a/src/libmsc/silent_call.c b/src/libmsc/silent_call.c index 6f3fbf2..5fad4f4 100644 --- a/src/libmsc/silent_call.c +++ b/src/libmsc/silent_call.c @@ -52,8 +52,12 @@ switch (event) { case GSM_PAGING_SUCCEEDED: +#if BEFORE_MSCSPLIT + /* Re-enable this log output once we can obtain this information via + * A-interface, see OS#2391. */ DEBUGPC(DLSMS, "success, using Timeslot %u on ARFCN %u\n", conn->lchan->ts->nr, conn->lchan->ts->trx->arfcn); +#endif conn->silent_call = 1; msc_subscr_conn_get(conn); /* increment lchan reference count */ @@ -126,7 +130,10 @@ { struct subscr_request *req; - req = subscr_request_channel(vsub, type, paging_cb_silent, data); + /* FIXME the VTY command allows selecting a silent call channel type. + * This doesn't apply to the situation after MSCSPLIT with an + * A-interface. */ + req = subscr_request_conn(vsub, type, paging_cb_silent, data); return req != NULL; } @@ -143,8 +150,12 @@ if (!conn->silent_call) return -EINVAL; +#if BEFORE_MSCSPLIT + /* Re-enable this log output once we can obtain this information via + * A-interface, see OS#2391. */ DEBUGPC(DLSMS, "Stopping silent call using Timeslot %u on ARFCN %u\n", conn->lchan->ts->nr, conn->lchan->ts->trx->arfcn); +#endif conn->silent_call = 0; msc_subscr_conn_put(conn); diff --git a/src/libmsc/smpp_openbsc.c b/src/libmsc/smpp_openbsc.c index f06eb7d..24a4653 100644 --- a/src/libmsc/smpp_openbsc.c +++ b/src/libmsc/smpp_openbsc.c @@ -423,6 +423,8 @@ build_tlv(req_tlv, &tlv); } +#if BEFORE_MSCSPLIT +/* We currently have no lchan information. Re-add after A-interface, see OS#2390. */ /* Append the Osmocom vendor-specific additional TLVs to a SMPP msg */ static void append_osmo_tlvs(tlv_t **req_tlv, const struct gsm_lchan *lchan) { @@ -461,6 +463,7 @@ (uint8_t *)vsub->imei, imei_len+1); } } +#endif struct { uint32_t smpp_status_code; @@ -680,8 +683,11 @@ memcpy(deliver.short_message, sms->user_data, deliver.sm_length); } +#if BEFORE_MSCSPLIT + /* We currently have no lchan information. Re-add after A-interface, see OS#2390. */ if (esme->acl && esme->acl->osmocom_ext && conn->lchan) append_osmo_tlvs(&deliver.tlv, conn->lchan); +#endif ret = smpp_tx_deliver(esme, &deliver); if (ret < 0) diff --git a/src/libmsc/vty_interface_layer3.c b/src/libmsc/vty_interface_layer3.c index c393a8f..0106f91 100644 --- a/src/libmsc/vty_interface_layer3.c +++ b/src/libmsc/vty_interface_layer3.c @@ -553,57 +553,6 @@ return CMD_WARNING; } -DEFUN(ena_subscr_handover, - ena_subscr_handover_cmd, - "subscriber " SUBSCR_TYPES " ID handover BTS_NR", - SUBSCR_HELP "Handover the active connection\n" - "Number of the BTS to handover to\n") -{ - int ret; - struct gsm_subscriber_connection *conn; - struct gsm_bts *bts; - struct gsm_network *gsmnet = gsmnet_from_vty(vty); - struct vlr_subscr *vsub = - get_vsub_by_argv(gsmnet, argv[0], argv[1]); - - if (!vsub) { - vty_out(vty, "%% No subscriber found for %s %s.%s", - argv[0], argv[1], VTY_NEWLINE); - return CMD_WARNING; - } - - conn = connection_for_subscr(vsub); - if (!conn) { - vty_out(vty, "%% No active connection for subscriber %s %s.%s", - argv[0], argv[1], VTY_NEWLINE); - vlr_subscr_put(vsub); - return CMD_WARNING; - } - - bts = gsm_bts_num(gsmnet, atoi(argv[2])); - if (!bts) { - vty_out(vty, "%% BTS with number(%d) could not be found.%s", - atoi(argv[2]), VTY_NEWLINE); - vlr_subscr_put(vsub); - return CMD_WARNING; - } - - /* now start the handover */ - ret = bsc_handover_start(conn->lchan, bts); - if (ret != 0) { - vty_out(vty, "%% Handover failed with errno %d.%s", - ret, VTY_NEWLINE); - } else { - vty_out(vty, "%% Handover started from %s", - gsm_lchan_name(conn->lchan)); - vty_out(vty, " to %s.%s", gsm_lchan_name(conn->ho_lchan), - VTY_NEWLINE); - } - - vlr_subscr_put(vsub); - return CMD_SUCCESS; -} - #define A3A8_ALG_TYPES "(none|xor|comp128v1)" #define A3A8_ALG_HELP \ "Use No A3A8 algorithm\n" \ @@ -652,9 +601,7 @@ switch (signal) { case S_SCALL_SUCCESS: - vty_out(vty, "%% silent call on ARFCN %u timeslot %u%s", - sigdata->conn->lchan->ts->trx->arfcn, sigdata->conn->lchan->ts->nr, - VTY_NEWLINE); + vty_out(vty, "%% silent call success%s", VTY_NEWLINE); break; case S_SCALL_EXPIRED: vty_out(vty, "%% silent call expired paging%s", VTY_NEWLINE); @@ -670,7 +617,6 @@ { struct gsm_network *net = gsmnet_from_vty(vty); - openbsc_vty_print_statistics(vty, net); vty_out(vty, "Location Update : %lu attach, %lu normal, %lu periodic%s", net->msc_ctrs->ctr[MSC_CTR_LOC_UPDATE_TYPE_ATTACH].current, net->msc_ctrs->ctr[MSC_CTR_LOC_UPDATE_TYPE_NORMAL].current, @@ -1055,7 +1001,6 @@ install_element(ENABLE_NODE, &ena_subscr_extension_cmd); install_element(ENABLE_NODE, &ena_subscr_authorized_cmd); install_element(ENABLE_NODE, &ena_subscr_a3a8_cmd); - install_element(ENABLE_NODE, &ena_subscr_handover_cmd); install_element(ENABLE_NODE, &subscriber_purge_cmd); install_element(ENABLE_NODE, &smsqueue_trigger_cmd); install_element(ENABLE_NODE, &smsqueue_max_cmd); diff --git a/tests/bsc/Makefile.am b/tests/bsc/Makefile.am index 9de4145..904bdfc 100644 --- a/tests/bsc/Makefile.am +++ b/tests/bsc/Makefile.am @@ -32,7 +32,6 @@ bsc_test_LDADD = \ $(top_builddir)/src/libbsc/libbsc.a \ - $(top_builddir)/src/libmsc/libmsc.a \ $(top_builddir)/src/libcommon-cs/libcommon-cs.a \ $(top_builddir)/src/libmgcp/libmgcp.a \ $(top_builddir)/src/libtrau/libtrau.a \ diff --git a/tests/channel/Makefile.am b/tests/channel/Makefile.am index c7164b4..dd78bdc 100644 --- a/tests/channel/Makefile.am +++ b/tests/channel/Makefile.am @@ -24,7 +24,6 @@ $(NULL) channel_test_LDADD = \ - $(top_builddir)/src/libmsc/libmsc.a \ $(top_builddir)/src/libbsc/libbsc.a \ $(top_builddir)/src/libvlr/libvlr.a \ $(top_builddir)/src/libcommon-cs/libcommon-cs.a \ diff --git a/tests/db/Makefile.am b/tests/db/Makefile.am index 0eed5cd..df421d8 100644 --- a/tests/db/Makefile.am +++ b/tests/db/Makefile.am @@ -32,9 +32,7 @@ $(NULL) db_test_LDADD = \ - $(top_builddir)/src/libbsc/libbsc.a \ $(top_builddir)/src/libmsc/libmsc.a \ - $(top_builddir)/src/libbsc/libbsc.a \ $(top_builddir)/src/libcommon-cs/libcommon-cs.a \ $(top_builddir)/src/libtrau/libtrau.a \ $(top_builddir)/src/libcommon/libcommon.a \ diff --git a/tests/gsm0408/gsm0408_test.c b/tests/gsm0408/gsm0408_test.c index 5a8c6ca..1b326ee 100644 --- a/tests/gsm0408/gsm0408_test.c +++ b/tests/gsm0408/gsm0408_test.c @@ -182,7 +182,7 @@ static inline void test_si2q_u(void) { struct gsm_bts *bts; - struct gsm_network *network = bsc_network_init(tall_bsc_ctx, 1, 1, NULL); + struct gsm_network *network = bsc_network_init(NULL, 1, 1, NULL); printf("Testing SYSINFO_TYPE_2quater UARFCN generation:\n"); if (!network) @@ -210,7 +210,7 @@ static inline void test_si2q_e(void) { struct gsm_bts *bts; - struct gsm_network *network = bsc_network_init(tall_bsc_ctx, 1, 1, NULL); + struct gsm_network *network = bsc_network_init(NULL, 1, 1, NULL); printf("Testing SYSINFO_TYPE_2quater EARFCN generation:\n"); if (!network) diff --git a/tests/msc_vlr/Makefile.am b/tests/msc_vlr/Makefile.am index ebbfb5c..71450af 100644 --- a/tests/msc_vlr/Makefile.am +++ b/tests/msc_vlr/Makefile.am @@ -60,8 +60,8 @@ -Wl,--wrap=gsup_client_create \ -Wl,--wrap=gsup_client_send \ -Wl,--wrap=gsm0808_submit_dtap \ - -Wl,--wrap=paging_request \ - -Wl,--wrap=paging_request_stop \ + -Wl,--wrap=msc_fake_paging_request \ + -Wl,--wrap=msc_fake_paging_request_stop \ -Wl,--wrap=gsm340_gen_scts \ -Wl,--wrap=RAND_bytes \ $(NULL) diff --git a/tests/msc_vlr/msc_vlr_test_gsm_authen.err b/tests/msc_vlr/msc_vlr_test_gsm_authen.err index 09ff4ae..4ae4968 100644 --- a/tests/msc_vlr/msc_vlr_test_gsm_authen.err +++ b/tests/msc_vlr/msc_vlr_test_gsm_authen.err @@ -270,9 +270,8 @@ llist_count(&vsub->cs.requests) == 0 DREF VLR subscr MSISDN:46071 usage increases to: 3 DMM Subscriber MSISDN:46071 not paged yet. - BTS/BSC sends out paging request to IMSI:901700000004620 for channel type 1 - strcmp(paging_expecting_imsi, sub->imsi) == 0 -DREF BSC subscr IMSI:901700000004620 usage decreases to: 0 + BTS/BSC sends out paging request to MSISDN:46071 + strcmp(paging_expecting_imsi, vsub->imsi) == 0 DREF VLR subscr MSISDN:46071 usage increases to: 4 llist_count(&vsub->cs.requests) == 1 DREF VLR subscr MSISDN:46071 usage decreases to: 3 @@ -351,7 +350,6 @@ DVLR Subscr_Conn(901700000004620){SUBSCR_CONN_S_NEW}: Received Event SUBSCR_CONN_E_ACCEPTED DVLR Subscr_Conn(901700000004620){SUBSCR_CONN_S_NEW}: SUBSCR_CONN_FROM_PAGING_RESP DVLR Subscr_Conn(901700000004620){SUBSCR_CONN_S_NEW}: state_chg to SUBSCR_CONN_S_ACCEPTED -DREF BSC subscr IMSI:901700000004620 usage decreases to: 0 DREF VLR subscr MSISDN:46071 usage increases to: 5 DREF MSISDN:46071: MSC conn use + 1 == 3 - DTAP --> MS: 09015801000791447758100650004c0005806470f1000007101000000000445079da1e1ee7416937485e9ea7c965373d1d6683c270383b3d0ed3d36ff71c949e83c22072799e9687c5ec32a81d96afcbf4b4fb0c7ac3e9e9b7db05 @@ -734,9 +732,8 @@ llist_count(&vsub->cs.requests) == 0 DREF VLR subscr MSISDN:46071 usage increases to: 3 DMM Subscriber MSISDN:46071 not paged yet. - BTS/BSC sends out paging request to IMSI:901700000004620 for channel type 1 + BTS/BSC sends out paging request to MSISDN:46071 paging_expecting_tmsi == 0x03020100 -DREF BSC subscr IMSI:901700000004620 usage decreases to: 0 DREF VLR subscr MSISDN:46071 usage increases to: 4 llist_count(&vsub->cs.requests) == 1 DREF VLR subscr MSISDN:46071 usage decreases to: 3 @@ -815,7 +812,6 @@ DVLR Subscr_Conn(50462976){SUBSCR_CONN_S_NEW}: Received Event SUBSCR_CONN_E_ACCEPTED DVLR Subscr_Conn(50462976){SUBSCR_CONN_S_NEW}: SUBSCR_CONN_FROM_PAGING_RESP DVLR Subscr_Conn(50462976){SUBSCR_CONN_S_NEW}: state_chg to SUBSCR_CONN_S_ACCEPTED -DREF BSC subscr IMSI:901700000004620 usage decreases to: 0 DREF VLR subscr MSISDN:46071 usage increases to: 5 DREF MSISDN:46071: MSC conn use + 1 == 3 - DTAP --> MS: 09015801000791447758100650004c0005806470f1000007101000000000445079da1e1ee7416937485e9ea7c965373d1d6683c270383b3d0ed3d36ff71c949e83c22072799e9687c5ec32a81d96afcbf4b4fb0c7ac3e9e9b7db05 @@ -1762,9 +1758,8 @@ llist_count(&vsub->cs.requests) == 0 DREF VLR subscr MSISDN:42342 usage increases to: 3 DMM Subscriber MSISDN:42342 not paged yet. - BTS/BSC sends out paging request to IMSI:901700000010650 for channel type 1 - strcmp(paging_expecting_imsi, sub->imsi) == 0 -DREF BSC subscr IMSI:901700000010650 usage decreases to: 0 + BTS/BSC sends out paging request to MSISDN:42342 + strcmp(paging_expecting_imsi, vsub->imsi) == 0 DREF VLR subscr MSISDN:42342 usage increases to: 4 llist_count(&vsub->cs.requests) == 1 DREF VLR subscr MSISDN:42342 usage decreases to: 3 @@ -1843,7 +1838,6 @@ DVLR Subscr_Conn(901700000010650){SUBSCR_CONN_S_NEW}: Received Event SUBSCR_CONN_E_ACCEPTED DVLR Subscr_Conn(901700000010650){SUBSCR_CONN_S_NEW}: SUBSCR_CONN_FROM_PAGING_RESP DVLR Subscr_Conn(901700000010650){SUBSCR_CONN_S_NEW}: state_chg to SUBSCR_CONN_S_ACCEPTED -DREF BSC subscr IMSI:901700000010650 usage decreases to: 0 DREF VLR subscr MSISDN:42342 usage increases to: 5 DREF MSISDN:42342: MSC conn use + 1 == 3 - DTAP --> MS: 09015801000791447758100650004c0005802443f2000007101000000000445079da1e1ee7416937485e9ea7c965373d1d6683c270383b3d0ed3d36ff71c949e83c22072799e9687c5ec32a81d96afcbf4b4fb0c7ac3e9e9b7db05 diff --git a/tests/msc_vlr/msc_vlr_test_gsm_ciph.err b/tests/msc_vlr/msc_vlr_test_gsm_ciph.err index f43d6f1..1a9c39f 100644 --- a/tests/msc_vlr/msc_vlr_test_gsm_ciph.err +++ b/tests/msc_vlr/msc_vlr_test_gsm_ciph.err @@ -287,9 +287,8 @@ llist_count(&vsub->cs.requests) == 0 DREF VLR subscr MSISDN:46071 usage increases to: 3 DMM Subscriber MSISDN:46071 not paged yet. - BTS/BSC sends out paging request to IMSI:901700000004620 for channel type 1 - strcmp(paging_expecting_imsi, sub->imsi) == 0 -DREF BSC subscr IMSI:901700000004620 usage decreases to: 0 + BTS/BSC sends out paging request to MSISDN:46071 + strcmp(paging_expecting_imsi, vsub->imsi) == 0 DREF VLR subscr MSISDN:46071 usage increases to: 4 llist_count(&vsub->cs.requests) == 1 DREF VLR subscr MSISDN:46071 usage decreases to: 3 @@ -387,7 +386,6 @@ DVLR Subscr_Conn(901700000004620){SUBSCR_CONN_S_NEW}: Received Event SUBSCR_CONN_E_ACCEPTED DVLR Subscr_Conn(901700000004620){SUBSCR_CONN_S_NEW}: SUBSCR_CONN_FROM_PAGING_RESP DVLR Subscr_Conn(901700000004620){SUBSCR_CONN_S_NEW}: state_chg to SUBSCR_CONN_S_ACCEPTED -DREF BSC subscr IMSI:901700000004620 usage decreases to: 0 DREF VLR subscr MSISDN:46071 usage increases to: 5 DREF MSISDN:46071: MSC conn use + 1 == 2 - DTAP --> MS: 09015801000791447758100650004c0005806470f1000007101000000000445079da1e1ee7416937485e9ea7c965373d1d6683c270383b3d0ed3d36ff71c949e83c22072799e9687c5ec32a81d96afcbf4b4fb0c7ac3e9e9b7db05 @@ -786,9 +784,8 @@ llist_count(&vsub->cs.requests) == 0 DREF VLR subscr MSISDN:46071 usage increases to: 3 DMM Subscriber MSISDN:46071 not paged yet. - BTS/BSC sends out paging request to IMSI:901700000004620 for channel type 1 + BTS/BSC sends out paging request to MSISDN:46071 paging_expecting_tmsi == 0x03020100 -DREF BSC subscr IMSI:901700000004620 usage decreases to: 0 DREF VLR subscr MSISDN:46071 usage increases to: 4 llist_count(&vsub->cs.requests) == 1 DREF VLR subscr MSISDN:46071 usage decreases to: 3 @@ -886,7 +883,6 @@ DVLR Subscr_Conn(50462976){SUBSCR_CONN_S_NEW}: Received Event SUBSCR_CONN_E_ACCEPTED DVLR Subscr_Conn(50462976){SUBSCR_CONN_S_NEW}: SUBSCR_CONN_FROM_PAGING_RESP DVLR Subscr_Conn(50462976){SUBSCR_CONN_S_NEW}: state_chg to SUBSCR_CONN_S_ACCEPTED -DREF BSC subscr IMSI:901700000004620 usage decreases to: 0 DREF VLR subscr MSISDN:46071 usage increases to: 5 DREF MSISDN:46071: MSC conn use + 1 == 2 - DTAP --> MS: 09015801000791447758100650004c0005806470f1000007101000000000445079da1e1ee7416937485e9ea7c965373d1d6683c270383b3d0ed3d36ff71c949e83c22072799e9687c5ec32a81d96afcbf4b4fb0c7ac3e9e9b7db05 diff --git a/tests/msc_vlr/msc_vlr_test_no_authen.err b/tests/msc_vlr/msc_vlr_test_no_authen.err index 651ac29..ec1c4e2 100644 --- a/tests/msc_vlr/msc_vlr_test_no_authen.err +++ b/tests/msc_vlr/msc_vlr_test_no_authen.err @@ -186,9 +186,8 @@ llist_count(&vsub->cs.requests) == 0 DREF VLR subscr MSISDN:46071 usage increases to: 3 DMM Subscriber MSISDN:46071 not paged yet. - BTS/BSC sends out paging request to IMSI:901700000004620 for channel type 1 - strcmp(paging_expecting_imsi, sub->imsi) == 0 -DREF BSC subscr IMSI:901700000004620 usage decreases to: 0 + BTS/BSC sends out paging request to MSISDN:46071 + strcmp(paging_expecting_imsi, vsub->imsi) == 0 DREF VLR subscr MSISDN:46071 usage increases to: 4 llist_count(&vsub->cs.requests) == 1 DREF VLR subscr MSISDN:46071 usage decreases to: 3 @@ -227,7 +226,6 @@ DVLR Subscr_Conn(901700000004620){SUBSCR_CONN_S_NEW}: Received Event SUBSCR_CONN_E_ACCEPTED DVLR Subscr_Conn(901700000004620){SUBSCR_CONN_S_NEW}: SUBSCR_CONN_FROM_PAGING_RESP DVLR Subscr_Conn(901700000004620){SUBSCR_CONN_S_NEW}: state_chg to SUBSCR_CONN_S_ACCEPTED -DREF BSC subscr IMSI:901700000004620 usage decreases to: 0 DREF VLR subscr MSISDN:46071 usage increases to: 6 DREF MSISDN:46071: MSC conn use + 1 == 3 - DTAP --> MS: 09015801000791447758100650004c0005806470f1000007101000000000445079da1e1ee7416937485e9ea7c965373d1d6683c270383b3d0ed3d36ff71c949e83c22072799e9687c5ec32a81d96afcbf4b4fb0c7ac3e9e9b7db05 @@ -528,9 +526,8 @@ llist_count(&vsub->cs.requests) == 0 DREF VLR subscr MSISDN:46071 usage increases to: 3 DMM Subscriber MSISDN:46071 not paged yet. - BTS/BSC sends out paging request to IMSI:901700000004620 for channel type 1 + BTS/BSC sends out paging request to MSISDN:46071 paging_expecting_tmsi == 0x03020100 -DREF BSC subscr IMSI:901700000004620 usage decreases to: 0 DREF VLR subscr MSISDN:46071 usage increases to: 4 llist_count(&vsub->cs.requests) == 1 DREF VLR subscr MSISDN:46071 usage decreases to: 3 @@ -569,7 +566,6 @@ DVLR Subscr_Conn(50462976){SUBSCR_CONN_S_NEW}: Received Event SUBSCR_CONN_E_ACCEPTED DVLR Subscr_Conn(50462976){SUBSCR_CONN_S_NEW}: SUBSCR_CONN_FROM_PAGING_RESP DVLR Subscr_Conn(50462976){SUBSCR_CONN_S_NEW}: state_chg to SUBSCR_CONN_S_ACCEPTED -DREF BSC subscr IMSI:901700000004620 usage decreases to: 0 DREF VLR subscr MSISDN:46071 usage increases to: 6 DREF MSISDN:46071: MSC conn use + 1 == 3 - DTAP --> MS: 09015801000791447758100650004c0005806470f1000007101000000000445079da1e1ee7416937485e9ea7c965373d1d6683c270383b3d0ed3d36ff71c949e83c22072799e9687c5ec32a81d96afcbf4b4fb0c7ac3e9e9b7db05 diff --git a/tests/msc_vlr/msc_vlr_test_reject_concurrency.err b/tests/msc_vlr/msc_vlr_test_reject_concurrency.err index c51d08a..bebb16b 100644 --- a/tests/msc_vlr/msc_vlr_test_reject_concurrency.err +++ b/tests/msc_vlr/msc_vlr_test_reject_concurrency.err @@ -1188,9 +1188,8 @@ llist_count(&vsub->cs.requests) == 0 DREF VLR subscr MSISDN:46071 usage increases to: 3 DMM Subscriber MSISDN:46071 not paged yet. - BTS/BSC sends out paging request to IMSI:901700000004620 for channel type 1 - strcmp(paging_expecting_imsi, sub->imsi) == 0 -DREF BSC subscr IMSI:901700000004620 usage decreases to: 0 + BTS/BSC sends out paging request to MSISDN:46071 + strcmp(paging_expecting_imsi, vsub->imsi) == 0 DREF VLR subscr MSISDN:46071 usage increases to: 4 llist_count(&vsub->cs.requests) == 1 DREF VLR subscr MSISDN:46071 usage decreases to: 3 @@ -1225,7 +1224,6 @@ DVLR Subscr_Conn(901700000004620){SUBSCR_CONN_S_NEW}: Received Event SUBSCR_CONN_E_ACCEPTED DVLR Subscr_Conn(901700000004620){SUBSCR_CONN_S_NEW}: SUBSCR_CONN_FROM_PAGING_RESP DVLR Subscr_Conn(901700000004620){SUBSCR_CONN_S_NEW}: state_chg to SUBSCR_CONN_S_ACCEPTED -DREF BSC subscr IMSI:901700000004620 usage decreases to: 0 DREF VLR subscr MSISDN:46071 usage increases to: 6 DREF MSISDN:46071: MSC conn use + 1 == 3 - DTAP --> MS: 09015801000791447758100650004c0005806470f1000007101000000000445079da1e1ee7416937485e9ea7c965373d1d6683c270383b3d0ed3d36ff71c949e83c22072799e9687c5ec32a81d96afcbf4b4fb0c7ac3e9e9b7db05 @@ -1403,9 +1401,8 @@ llist_count(&vsub->cs.requests) == 0 DREF VLR subscr MSISDN:46071 usage increases to: 3 DMM Subscriber MSISDN:46071 not paged yet. - BTS/BSC sends out paging request to IMSI:901700000004620 for channel type 1 - strcmp(paging_expecting_imsi, sub->imsi) == 0 -DREF BSC subscr IMSI:901700000004620 usage decreases to: 0 + BTS/BSC sends out paging request to MSISDN:46071 + strcmp(paging_expecting_imsi, vsub->imsi) == 0 DREF VLR subscr MSISDN:46071 usage increases to: 4 llist_count(&vsub->cs.requests) == 1 DREF VLR subscr MSISDN:46071 usage decreases to: 3 @@ -1440,7 +1437,6 @@ DVLR Subscr_Conn(901700000004620){SUBSCR_CONN_S_NEW}: Received Event SUBSCR_CONN_E_ACCEPTED DVLR Subscr_Conn(901700000004620){SUBSCR_CONN_S_NEW}: SUBSCR_CONN_FROM_PAGING_RESP DVLR Subscr_Conn(901700000004620){SUBSCR_CONN_S_NEW}: state_chg to SUBSCR_CONN_S_ACCEPTED -DREF BSC subscr IMSI:901700000004620 usage decreases to: 0 DREF VLR subscr MSISDN:46071 usage increases to: 6 DREF MSISDN:46071: MSC conn use + 1 == 3 - DTAP --> MS: 09015801000791447758100650004c0005806470f1000007101000000000445079da1e1ee7416937485e9ea7c965373d1d6683c270383b3d0ed3d36ff71c949e83c22072799e9687c5ec32a81d96afcbf4b4fb0c7ac3e9e9b7db05 @@ -1635,9 +1631,8 @@ llist_count(&vsub->cs.requests) == 0 DREF VLR subscr MSISDN:46071 usage increases to: 3 DMM Subscriber MSISDN:46071 not paged yet. - BTS/BSC sends out paging request to IMSI:901700000004620 for channel type 1 - strcmp(paging_expecting_imsi, sub->imsi) == 0 -DREF BSC subscr IMSI:901700000004620 usage decreases to: 0 + BTS/BSC sends out paging request to MSISDN:46071 + strcmp(paging_expecting_imsi, vsub->imsi) == 0 DREF VLR subscr MSISDN:46071 usage increases to: 4 llist_count(&vsub->cs.requests) == 1 DREF VLR subscr MSISDN:46071 usage decreases to: 3 @@ -1672,7 +1667,6 @@ DVLR Subscr_Conn(901700000004620){SUBSCR_CONN_S_NEW}: Received Event SUBSCR_CONN_E_ACCEPTED DVLR Subscr_Conn(901700000004620){SUBSCR_CONN_S_NEW}: SUBSCR_CONN_FROM_PAGING_RESP DVLR Subscr_Conn(901700000004620){SUBSCR_CONN_S_NEW}: state_chg to SUBSCR_CONN_S_ACCEPTED -DREF BSC subscr IMSI:901700000004620 usage decreases to: 0 DREF VLR subscr MSISDN:46071 usage increases to: 6 DREF MSISDN:46071: MSC conn use + 1 == 3 - DTAP --> MS: 09015801000791447758100650004c0005806470f1000007101000000000445079da1e1ee7416937485e9ea7c965373d1d6683c270383b3d0ed3d36ff71c949e83c22072799e9687c5ec32a81d96afcbf4b4fb0c7ac3e9e9b7db05 diff --git a/tests/msc_vlr/msc_vlr_test_umts_authen.err b/tests/msc_vlr/msc_vlr_test_umts_authen.err index bfb4a8e..744004a 100644 --- a/tests/msc_vlr/msc_vlr_test_umts_authen.err +++ b/tests/msc_vlr/msc_vlr_test_umts_authen.err @@ -253,9 +253,8 @@ llist_count(&vsub->cs.requests) == 0 DREF VLR subscr MSISDN:42342 usage increases to: 3 DMM Subscriber MSISDN:42342 not paged yet. - BTS/BSC sends out paging request to IMSI:901700000010650 for channel type 1 - strcmp(paging_expecting_imsi, sub->imsi) == 0 -DREF BSC subscr IMSI:901700000010650 usage decreases to: 0 + BTS/BSC sends out paging request to MSISDN:42342 + strcmp(paging_expecting_imsi, vsub->imsi) == 0 DREF VLR subscr MSISDN:42342 usage increases to: 4 llist_count(&vsub->cs.requests) == 1 DREF VLR subscr MSISDN:42342 usage decreases to: 3 @@ -335,7 +334,6 @@ DVLR Subscr_Conn(901700000010650){SUBSCR_CONN_S_NEW}: Received Event SUBSCR_CONN_E_ACCEPTED DVLR Subscr_Conn(901700000010650){SUBSCR_CONN_S_NEW}: SUBSCR_CONN_FROM_PAGING_RESP DVLR Subscr_Conn(901700000010650){SUBSCR_CONN_S_NEW}: state_chg to SUBSCR_CONN_S_ACCEPTED -DREF BSC subscr IMSI:901700000010650 usage decreases to: 0 DREF VLR subscr MSISDN:42342 usage increases to: 5 DREF MSISDN:42342: MSC conn use + 1 == 3 - DTAP --> MS: 09015801000791447758100650004c0005802443f2000007101000000000445079da1e1ee7416937485e9ea7c965373d1d6683c270383b3d0ed3d36ff71c949e83c22072799e9687c5ec32a81d96afcbf4b4fb0c7ac3e9e9b7db05 @@ -665,9 +663,8 @@ llist_count(&vsub->cs.requests) == 0 DREF VLR subscr MSISDN:42342 usage increases to: 3 DMM Subscriber MSISDN:42342 not paged yet. - BTS/BSC sends out paging request to IMSI:901700000010650 for channel type 1 - strcmp(paging_expecting_imsi, sub->imsi) == 0 -DREF BSC subscr IMSI:901700000010650 usage decreases to: 0 + BTS/BSC sends out paging request to MSISDN:42342 + strcmp(paging_expecting_imsi, vsub->imsi) == 0 DREF VLR subscr MSISDN:42342 usage increases to: 4 llist_count(&vsub->cs.requests) == 1 DREF VLR subscr MSISDN:42342 usage decreases to: 3 @@ -747,7 +744,6 @@ DVLR Subscr_Conn(901700000010650){SUBSCR_CONN_S_NEW}: Received Event SUBSCR_CONN_E_ACCEPTED DVLR Subscr_Conn(901700000010650){SUBSCR_CONN_S_NEW}: SUBSCR_CONN_FROM_PAGING_RESP DVLR Subscr_Conn(901700000010650){SUBSCR_CONN_S_NEW}: state_chg to SUBSCR_CONN_S_ACCEPTED -DREF BSC subscr IMSI:901700000010650 usage decreases to: 0 DREF VLR subscr MSISDN:42342 usage increases to: 5 DREF MSISDN:42342: MSC conn use + 1 == 3 - DTAP --> MS: 09015801000791447758100650004c0005802443f2000007101000000000445079da1e1ee7416937485e9ea7c965373d1d6683c270383b3d0ed3d36ff71c949e83c22072799e9687c5ec32a81d96afcbf4b4fb0c7ac3e9e9b7db05 diff --git a/tests/msc_vlr/msc_vlr_tests.c b/tests/msc_vlr/msc_vlr_tests.c index a878be7..a40f1e5 100644 --- a/tests/msc_vlr/msc_vlr_tests.c +++ b/tests/msc_vlr/msc_vlr_tests.c @@ -252,33 +252,25 @@ paging_expecting_imsi = NULL; } -/* override, requires '-Wl,--wrap=paging_request' */ -int __real_paging_request(struct gsm_network *network, struct bsc_subscr *sub, - int type, gsm_cbfn *cbfn, void *data); -int __wrap_paging_request(struct gsm_network *network, struct bsc_subscr *sub, - int type, gsm_cbfn *cbfn, void *data) +/* override, requires '-Wl,--wrap=msc_fake_paging_request' */ +int __real_msc_fake_paging_request(struct vlr_subscr *vsub); +int __wrap_msc_fake_paging_request(struct vlr_subscr *vsub) { - log("BTS/BSC sends out paging request to %s for channel type %d", - bsc_subscr_name(sub), type); + log("BTS/BSC sends out paging request to %s", + vlr_subscr_name(vsub)); OSMO_ASSERT(paging_expecting_imsi || (paging_expecting_tmsi != GSM_RESERVED_TMSI)); if (paging_expecting_imsi) - VERBOSE_ASSERT(strcmp(paging_expecting_imsi, sub->imsi), == 0, "%d"); + VERBOSE_ASSERT(strcmp(paging_expecting_imsi, vsub->imsi), == 0, "%d"); if (paging_expecting_tmsi != GSM_RESERVED_TMSI) - VERBOSE_ASSERT(paging_expecting_tmsi, == sub->tmsi, "0x%08x"); + VERBOSE_ASSERT(paging_expecting_tmsi, == vsub->tmsi, "0x%08x"); paging_sent = true; paging_stopped = false; return 1; } -/* override, requires '-Wl,--wrap=paging_request_stop' */ -void __real_paging_request_stop(struct gsm_bts *_bts, - struct vlr_subscr *vsub, - struct gsm_subscriber_connection *conn, - struct msgb *msg); -void __wrap_paging_request_stop(struct gsm_bts *_bts, - struct vlr_subscr *vsub, - struct gsm_subscriber_connection *conn, - struct msgb *msg) +/* override, requires '-Wl,--wrap=msc_fake_paging_request_stop' */ +void __real_msc_fake_paging_request_stop(struct vlr_subscr *vsub); +void __wrap_msc_fake_paging_request_stop(struct vlr_subscr *vsub) { paging_stopped = true; } -- To view, visit https://gerrit.osmocom.org/3345 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Id3705236350d5f69e447046b0a764bbabc3d493c Gerrit-PatchSet: 4 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Tue Aug 22 12:32:34 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 22 Aug 2017 12:32:34 +0000 Subject: [MERGED] osmo-msc[master]: Implement IuCS (large refactoring and addition) In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: Implement IuCS (large refactoring and addition) ...................................................................... Implement IuCS (large refactoring and addition) osmo-nitb becomes osmo-msc add DIUCS debug log constant add iucs.[hc] add msc vty, remove nitb vty add libiudummy, to avoid linking Iu deps in tests Use new msc_tx_dtap() instead of gsm0808_submit_dtap() libmgcp: add mgcpgw client API bridge calls via mgcpgw Enable MSC specific CTRL commands, bsc_base_ctrl_cmds_install() still needs to be split up. Change-Id: I5b5b6a9678b458affa86800afb1ec726e66eed88 --- M .gitignore M configure.ac M doc/examples/osmo-bsc_mgcp/mgcp.cfg A doc/examples/osmo-msc/osmo-msc.cfg D doc/examples/osmo-nitb/bs11/openbsc-1bts-2trx-hopping.cfg D doc/examples/osmo-nitb/bs11/openbsc-1bts-2trx.cfg D doc/examples/osmo-nitb/bs11/openbsc-2bts-2trx.cfg D doc/examples/osmo-nitb/bs11/openbsc.cfg D doc/examples/osmo-nitb/nanobts/openbsc-multitrx.cfg D doc/examples/osmo-nitb/nanobts/openbsc.cfg D doc/examples/osmo-nitb/nokia/openbsc_nokia_3trx.cfg D doc/examples/osmo-nitb/rbs2308/openbsc.cfg D doc/examples/osmo-nitb/sysmobts/openbsc.cfg M include/openbsc/Makefile.am A include/openbsc/common.h M include/openbsc/debug.h M include/openbsc/gprs_gmm.h M include/openbsc/gsm_data.h M include/openbsc/gsm_subscriber.h M include/openbsc/iu.h A include/openbsc/iucs.h A include/openbsc/iucs_ranap.h M include/openbsc/mgcp.h M include/openbsc/mgcp_internal.h A include/openbsc/mgcpgw_client.h M include/openbsc/msc_ifaces.h M include/openbsc/osmo_msc.h M include/openbsc/sgsn.h M include/openbsc/transaction.h M include/openbsc/vlr.h M include/openbsc/vty.h M osmoappdesc.py M src/Makefile.am M src/gprs/gprs_gmm.c M src/gprs/gprs_sgsn.c M src/gprs/sgsn_libgtp.c M src/gprs/sgsn_main.c M src/gprs/sgsn_vty.c M src/libbsc/bsc_init.c M src/libbsc/paging.c M src/libcommon/debug.c M src/libcommon/gsm_data.c M src/libiu/iu.c M src/libiu/iu_vty.c M src/libmgcp/Makefile.am A src/libmgcp/mgcp_common.c M src/libmgcp/mgcp_network.c M src/libmgcp/mgcp_protocol.c A src/libmgcp/mgcpgw_client.c A src/libmgcp/mgcpgw_client_vty.c M src/libmsc/Makefile.am M src/libmsc/a_iface.c M src/libmsc/gsm_04_08.c M src/libmsc/gsm_04_11.c M src/libmsc/gsm_04_80.c M src/libmsc/gsm_subscriber.c A src/libmsc/iu_dummy.c A src/libmsc/iucs.c A src/libmsc/iucs_ranap.c M src/libmsc/msc_ifaces.c A src/libmsc/msc_vty.c M src/libmsc/osmo_msc.c M src/libmsc/silent_call.c M src/libmsc/subscr_conn.c M src/libmsc/transaction.c M src/libmsc/vty_interface_layer3.c M src/libvlr/vlr.c M src/libvlr/vlr_access_req_fsm.c M src/libvlr/vlr_lu_fsm.c M src/osmo-bsc/osmo_bsc_api.c R src/osmo-msc/Makefile.am A src/osmo-msc/msc_main.c D src/osmo-nitb/bsc_hack.c M tests/ctrl_test_runner.py M tests/db/Makefile.am M tests/db/db_test.c M tests/mgcp/Makefile.am A tests/mgcp/mgcpgw_client_test.c A tests/mgcp/mgcpgw_client_test.err A tests/mgcp/mgcpgw_client_test.ok M tests/msc_vlr/Makefile.am M tests/msc_vlr/msc_vlr_test_gsm_authen.err M tests/msc_vlr/msc_vlr_test_gsm_ciph.err M tests/msc_vlr/msc_vlr_test_hlr_reject.err M tests/msc_vlr/msc_vlr_test_hlr_timeout.err M tests/msc_vlr/msc_vlr_test_ms_timeout.err M tests/msc_vlr/msc_vlr_test_no_authen.c M tests/msc_vlr/msc_vlr_test_no_authen.err M tests/msc_vlr/msc_vlr_test_reject_concurrency.err M tests/msc_vlr/msc_vlr_test_rest.err M tests/msc_vlr/msc_vlr_test_umts_authen.c M tests/msc_vlr/msc_vlr_test_umts_authen.err M tests/msc_vlr/msc_vlr_tests.c M tests/msc_vlr/msc_vlr_tests.h M tests/smpp_test_runner.py M tests/sms_queue/Makefile.am M tests/testsuite.at M tests/vty_test_runner.py 98 files changed, 5,030 insertions(+), 3,347 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified -- To view, visit https://gerrit.osmocom.org/3347 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I5b5b6a9678b458affa86800afb1ec726e66eed88 Gerrit-PatchSet: 6 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Tue Aug 22 12:32:35 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 22 Aug 2017 12:32:35 +0000 Subject: [MERGED] osmo-msc[master]: sgsn init: pass sgsn_config pointer to sgsn_vty_init(), not ... In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: sgsn init: pass sgsn_config pointer to sgsn_vty_init(), not sgsn_parse_config ...................................................................... sgsn init: pass sgsn_config pointer to sgsn_vty_init(), not sgsn_parse_config In an upcoming commit, sgsn_vty_init() will require access to the global sgsn config struct to initialize a generic VTY command with the proper config destination address, see Change-Id I5b5b6a9678b458affa86800afb1ec726e66eed88. Change-Id: Ie6b6e5422987586531a898e0c5b867623dbecb0f --- M include/openbsc/sgsn.h M src/gprs/sgsn_main.c M src/gprs/sgsn_vty.c 3 files changed, 10 insertions(+), 7 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/include/openbsc/sgsn.h b/include/openbsc/sgsn.h index 1ede2c9..1ed1583 100644 --- a/include/openbsc/sgsn.h +++ b/include/openbsc/sgsn.h @@ -140,8 +140,8 @@ /* sgsn_vty.c */ -int sgsn_vty_init(void); -int sgsn_parse_config(const char *config_file, struct sgsn_config *cfg); +int sgsn_vty_init(struct sgsn_config *cfg); +int sgsn_parse_config(const char *config_file); /* sgsn.c */ diff --git a/src/gprs/sgsn_main.c b/src/gprs/sgsn_main.c index 41cebef..d871939 100644 --- a/src/gprs/sgsn_main.c +++ b/src/gprs/sgsn_main.c @@ -350,7 +350,7 @@ vty_init(&vty_info); logging_vty_add_cmds(NULL); osmo_stats_vty_add_cmds(&gprs_log_info); - sgsn_vty_init(); + sgsn_vty_init(&sgsn_inst.cfg); ctrl_vty_init(tall_bsc_ctx); #ifdef BUILD_IU iu_vty_init(&asn_debug); @@ -382,7 +382,7 @@ sgsn_cdr_init(&sgsn_inst); /* FIXME: register signal handler for SS_L_NS */ - rc = sgsn_parse_config(sgsn_inst.config_file, &sgsn_inst.cfg); + rc = sgsn_parse_config(sgsn_inst.config_file); if (rc < 0) { LOGP(DGPRS, LOGL_FATAL, "Error in config file\n"); exit(2); diff --git a/src/gprs/sgsn_vty.c b/src/gprs/sgsn_vty.c index e09a029..1cefe37 100644 --- a/src/gprs/sgsn_vty.c +++ b/src/gprs/sgsn_vty.c @@ -1222,8 +1222,10 @@ return CMD_SUCCESS; } -int sgsn_vty_init(void) +int sgsn_vty_init(struct sgsn_config *cfg) { + g_cfg = cfg; + install_element_ve(&show_sgsn_cmd); //install_element_ve(&show_mmctx_tlli_cmd); install_element_ve(&show_mmctx_imsi_cmd); @@ -1285,11 +1287,12 @@ return 0; } -int sgsn_parse_config(const char *config_file, struct sgsn_config *cfg) +int sgsn_parse_config(const char *config_file) { int rc; - g_cfg = cfg; + /* make sure sgsn_vty_init() was called before this */ + OSMO_ASSERT(g_cfg); g_cfg->timers.T3312 = GSM0408_T3312_SECS; g_cfg->timers.T3322 = GSM0408_T3322_SECS; -- To view, visit https://gerrit.osmocom.org/3346 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ie6b6e5422987586531a898e0c5b867623dbecb0f Gerrit-PatchSet: 4 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Tue Aug 22 12:32:37 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Tue, 22 Aug 2017 12:32:37 +0000 Subject: [PATCH] osmo-gsm-tester[master]: resources.conf: Remove empty line Message-ID: Review at https://gerrit.osmocom.org/3577 resources.conf: Remove empty line Change-Id: I821bff68ce3a4a81a9deb79e6302bd7c341a8255 --- M example/resources.conf 1 file changed, 0 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-tester refs/changes/77/3577/1 diff --git a/example/resources.conf b/example/resources.conf index 0b6da0a..0260815 100644 --- a/example/resources.conf +++ b/example/resources.conf @@ -31,7 +31,6 @@ band: GSM-1800 - arfcn: 520 band: GSM-1800 - - arfcn: 540 band: GSM-1900 - arfcn: 542 -- To view, visit https://gerrit.osmocom.org/3577 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I821bff68ce3a4a81a9deb79e6302bd7c341a8255 Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Tue Aug 22 12:32:37 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Tue, 22 Aug 2017 12:32:37 +0000 Subject: [PATCH] osmo-gsm-tester[master]: bts_omotrx: Support configuring bts addr, trx_remote_ip, and... Message-ID: Review at https://gerrit.osmocom.org/3578 bts_omotrx: Support configuring bts addr, trx_remote_ip, and launch_trx We may want to support running a device which runs its own TRX (osmo-trx or different implementation). Furthermore, this TRX may be available in some specific hwardare rather than on the main unit. This makes it easy to configure OsmoBtsTrx to launch it's own osmo-trx or not. In case it is launched, all IPs are configured correctly to ensure connection can be established. Before this commit, osmo-trx was binding to 127.0.0.1. Now we can support multiple osmo-trx being launched on the main unit. Change-Id: I825ed1fc0c3fe75d196db90c1508283fbd04acf8 --- M example/resources.conf M src/osmo_gsm_tester/bts_osmotrx.py M src/osmo_gsm_tester/config.py M src/osmo_gsm_tester/resource.py M src/osmo_gsm_tester/schema.py M src/osmo_gsm_tester/templates/osmo-bts-trx.cfg.tmpl M src/osmo_gsm_tester/util.py 7 files changed, 49 insertions(+), 11 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-tester refs/changes/78/3578/1 diff --git a/example/resources.conf b/example/resources.conf index 0260815..a09e80a 100644 --- a/example/resources.conf +++ b/example/resources.conf @@ -17,8 +17,16 @@ - label: Ettus B210 type: osmo-bts-trx ipa_unit_id: 6 - addr: 10.42.42.116 + addr: 10.42.42.50 band: GSM-1800 + launch_trx: true + +- label: sysmoCell 5000 + type: osmo-bts-trx + ipa_unit_id: 7 + addr: 10.42.42.51 + band: GSM-1800 + trx_remote_ip: 10.42.42.112 arfcn: - arfcn: 512 diff --git a/src/osmo_gsm_tester/bts_osmotrx.py b/src/osmo_gsm_tester/bts_osmotrx.py index 9795a58..b5262a2 100644 --- a/src/osmo_gsm_tester/bts_osmotrx.py +++ b/src/osmo_gsm_tester/bts_osmotrx.py @@ -41,8 +41,17 @@ self.env = {} def remote_addr(self): - # FIXME - return '127.0.0.1' + return self.conf.get('addr') + + def trx_remote_ip(self): + conf_ip = self.conf.get('trx_remote_ip', None) + if conf_ip is not None: + return conf_ip + # if 'trx_remote_ip' is not configured, use same IP as BTS + return self.remote_addr() + + def launch_trx_enabled(self): + return util.str2bool(self.conf.get('launch_trx')) def start(self): if self.bsc is None: @@ -53,10 +62,11 @@ self.run_dir = util.Dir(self.suite_run.get_test_run_dir().new_dir(self.name())) self.configure() - self.trx = OsmoTrx(self.suite_run) - self.trx.start() - self.log('Waiting for osmo-trx to start up...') - event_loop.wait(self, self.trx.trx_ready) + if self.launch_trx_enabled(): + self.trx = OsmoTrx(self.suite_run, self.trx_remote_ip(), self.remote_addr()) + self.trx.start() + self.log('Waiting for osmo-trx to start up...') + event_loop.wait(self, self.trx.trx_ready) self.inst = util.Dir(os.path.abspath(self.suite_run.trial.get_inst(OsmoBtsTrx.BIN_BTS_TRX))) lib = self.inst.child('lib') @@ -93,6 +103,8 @@ config.overlay(values, { 'osmo_bts_trx': { 'oml_remote_ip': self.bsc.addr(), + 'trx_local_ip': self.remote_addr(), + 'trx_remote_ip': self.trx_remote_ip(), 'pcu_socket_path': os.path.join(str(self.run_dir), 'pcu_bts') } }) @@ -124,17 +136,19 @@ BIN_TRX = 'osmo-trx' - def __init__(self, suite_run): + def __init__(self, suite_run, listen_ip, bts_ip): super().__init__(log.C_RUN, OsmoTrx.BIN_TRX) self.suite_run = suite_run self.env = {} + self.listen_ip = listen_ip + self.bts_ip = bts_ip def start(self): self.run_dir = util.Dir(self.suite_run.get_test_run_dir().new_dir(self.name())) self.inst = util.Dir(os.path.abspath(self.suite_run.trial.get_inst(OsmoTrx.BIN_TRX))) lib = self.inst.child('lib') self.env = { 'LD_LIBRARY_PATH': util.prepend_library_path(lib) } - self.proc_trx = self.launch_process(OsmoTrx.BIN_TRX, '-x') + self.proc_trx = self.launch_process(OsmoTrx.BIN_TRX, '-x', '-j', self.listen_ip, '-i', self.bts_ip) def launch_process(self, binary_name, *args): binary = os.path.abspath(self.inst.child('bin', binary_name)) diff --git a/src/osmo_gsm_tester/config.py b/src/osmo_gsm_tester/config.py index 20ae83e..f6e81ac 100644 --- a/src/osmo_gsm_tester/config.py +++ b/src/osmo_gsm_tester/config.py @@ -271,5 +271,4 @@ dest[i] = overlay(dest[i], src[i]) return dest return src - # vim: expandtab tabstop=4 shiftwidth=4 diff --git a/src/osmo_gsm_tester/resource.py b/src/osmo_gsm_tester/resource.py index 8eec71e..9470f48 100644 --- a/src/osmo_gsm_tester/resource.py +++ b/src/osmo_gsm_tester/resource.py @@ -54,6 +54,8 @@ 'bts[].ipa_unit_id': schema.INT, 'bts[].addr': schema.IPV4, 'bts[].band': schema.BAND, + 'bts[].trx_remote_ip': schema.IPV4, + 'bts[].launch_trx': schema.BOOL_STR, 'bts[].trx_list[].hw_addr': schema.HWADDR, 'bts[].trx_list[].net_device': schema.STR, 'arfcn[].arfcn': schema.INT, diff --git a/src/osmo_gsm_tester/schema.py b/src/osmo_gsm_tester/schema.py index d652aa7..4c9b9cd 100644 --- a/src/osmo_gsm_tester/schema.py +++ b/src/osmo_gsm_tester/schema.py @@ -20,7 +20,7 @@ import re from . import log -from .util import is_dict, is_list +from .util import is_dict, is_list, str2bool KEY_RE = re.compile('[a-zA-Z][a-zA-Z0-9_]*') IPV4_RE = re.compile('([0-9]{1,3}.){3}[0-9]{1,3}') @@ -63,21 +63,25 @@ INT = 'int' STR = 'str' +BOOL_STR = 'bool_str' BAND = 'band' IPV4 = 'ipv4' HWADDR = 'hwaddr' IMSI = 'imsi' KI = 'ki' MSISDN = 'msisdn' +TRX_REMOTE_IP = 'trx_remote_ip' SCHEMA_TYPES = { INT: int, STR: str, + BOOL_STR: str2bool, BAND: band, IPV4: ipv4, HWADDR: hwaddr, IMSI: imsi, KI: ki, MSISDN: msisdn, + TRX_REMOTE_IP: ipv4, } def validate(config, schema): diff --git a/src/osmo_gsm_tester/templates/osmo-bts-trx.cfg.tmpl b/src/osmo_gsm_tester/templates/osmo-bts-trx.cfg.tmpl index ddfd483..950c03e 100644 --- a/src/osmo_gsm_tester/templates/osmo-bts-trx.cfg.tmpl +++ b/src/osmo_gsm_tester/templates/osmo-bts-trx.cfg.tmpl @@ -17,6 +17,8 @@ instance 0 osmotrx rx-gain 25 osmotrx tx-attenuation oml + osmotrx ip local ${osmo_bts_trx.trx_local_ip} + osmotrx ip remote ${osmo_bts_trx.trx_remote_ip} bts 0 band ${osmo_bts_trx.band} ipa unit-id ${osmo_bts_trx.ipa_unit_id} 0 diff --git a/src/osmo_gsm_tester/util.py b/src/osmo_gsm_tester/util.py index 602ae45..f38683c 100644 --- a/src/osmo_gsm_tester/util.py +++ b/src/osmo_gsm_tester/util.py @@ -305,4 +305,13 @@ input_thread.join() return input_thread.result +def str2bool(val): + if val is None or not val: + return False + if val.upper() in ['FALSE', 'NO', 'OFF']: + return False + if val.upper() in ['TRUE','YES', 'ON']: + return True + raise ValueError('Invalid BOOL field: %r' % val) + # vim: expandtab tabstop=4 shiftwidth=4 -- To view, visit https://gerrit.osmocom.org/3578 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I825ed1fc0c3fe75d196db90c1508283fbd04acf8 Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Tue Aug 22 12:34:49 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Tue, 22 Aug 2017 12:34:49 +0000 Subject: osmo-gsm-tester[master]: bts_omotrx: Support configuring bts addr, trx_remote_ip, and... In-Reply-To: References: Message-ID: Patch Set 1: This patch depends on osmo-trx patch https://gerrit.osmocom.org/#/c/3539/ , which adds -j parameter to it to be able to bind to a specific IP. -- To view, visit https://gerrit.osmocom.org/3578 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I825ed1fc0c3fe75d196db90c1508283fbd04acf8 Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Aug 22 12:45:09 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Tue, 22 Aug 2017 12:45:09 +0000 Subject: [PATCH] openbsc[master]: SGSN: log IMSI on PDP context creation/deletion In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3575 to look at the new patch set (#3). SGSN: log IMSI on PDP context creation/deletion Related: SYS#3610 Change-Id: I5ada9f85af2098f9acc8a277b9026eed226b9ac2 --- M openbsc/src/gprs/sgsn_libgtp.c 1 file changed, 2 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/75/3575/3 diff --git a/openbsc/src/gprs/sgsn_libgtp.c b/openbsc/src/gprs/sgsn_libgtp.c index e90b66d..95dd6f0 100644 --- a/openbsc/src/gprs/sgsn_libgtp.c +++ b/openbsc/src/gprs/sgsn_libgtp.c @@ -145,7 +145,7 @@ const uint8_t *qos; int rc; - LOGP(DGPRS, LOGL_ERROR, "Create PDP Context\n"); + LOGP(DGPRS, LOGL_ERROR, "Create PDP Context for %s\n", mmctx->imsi); pctx = sgsn_pdp_ctx_alloc(mmctx, nsapi); if (!pctx) { LOGP(DGPRS, LOGL_ERROR, "Couldn't allocate PDP Ctx\n"); @@ -624,7 +624,7 @@ /* Called whenever a PDP context is deleted for any reason */ static int cb_delete_context(struct pdp_t *pdp) { - LOGP(DGPRS, LOGL_INFO, "PDP Context was deleted\n"); + LOGP(DGPRS, LOGL_INFO, "PDP Context for %lu was deleted\n", pdp ? pdp->imsi : 0); return 0; } -- To view, visit https://gerrit.osmocom.org/3575 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I5ada9f85af2098f9acc8a277b9026eed226b9ac2 Gerrit-PatchSet: 3 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: daniel From gerrit-no-reply at lists.osmocom.org Tue Aug 22 12:50:38 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 22 Aug 2017 12:50:38 +0000 Subject: [PATCH] libosmo-sccp[master]: vty: fix doc for 'xua rkm routing-key-allocation' Message-ID: Review at https://gerrit.osmocom.org/3579 vty: fix doc for 'xua rkm routing-key-allocation' A doc element is missing, which fails the VTY tests in osmo-msc at Change-Id I5ae4e05ee7c57cad341ea5e86af37c1f6b0ffa77. Change-Id: I16aa74244ed5332bdc1fddd538e17b86f62ec3b2 --- M src/osmo_ss7_vty.c 1 file changed, 2 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-sccp refs/changes/79/3579/1 diff --git a/src/osmo_ss7_vty.c b/src/osmo_ss7_vty.c index b58c3cb..8d2ec96 100644 --- a/src/osmo_ss7_vty.c +++ b/src/osmo_ss7_vty.c @@ -182,7 +182,8 @@ DEFUN(cs7_permit_dyn_rkm, cs7_permit_dyn_rkm_cmd, "xua rkm routing-key-allocation (static-only|dynamic-permitted)", - "SIGTRAN xxxUA related\n" "Routing Key Management Allocation Policy\n" + "SIGTRAN xxxUA related\n" "Routing Key Management\n" + "Routing Key Management Allocation Policy\n" "Only static (pre-confgured) Routing Keys permitted\n" "Dynamically allocate Routing Keys for what ASPs request\n") { -- To view, visit https://gerrit.osmocom.org/3579 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I16aa74244ed5332bdc1fddd538e17b86f62ec3b2 Gerrit-PatchSet: 1 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Tue Aug 22 13:00:58 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 22 Aug 2017 13:00:58 +0000 Subject: libosmo-sccp[master]: vty: fix doc for 'xua rkm routing-key-allocation' In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3579 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I16aa74244ed5332bdc1fddd538e17b86f62ec3b2 Gerrit-PatchSet: 1 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Aug 22 13:01:03 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 22 Aug 2017 13:01:03 +0000 Subject: [MERGED] libosmo-sccp[master]: vty: fix doc for 'xua rkm routing-key-allocation' In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: vty: fix doc for 'xua rkm routing-key-allocation' ...................................................................... vty: fix doc for 'xua rkm routing-key-allocation' A doc element is missing, which fails the VTY tests in osmo-msc at Change-Id I5ae4e05ee7c57cad341ea5e86af37c1f6b0ffa77. Change-Id: I16aa74244ed5332bdc1fddd538e17b86f62ec3b2 --- M src/osmo_ss7_vty.c 1 file changed, 2 insertions(+), 1 deletion(-) Approvals: Neels Hofmeyr: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/osmo_ss7_vty.c b/src/osmo_ss7_vty.c index b58c3cb..8d2ec96 100644 --- a/src/osmo_ss7_vty.c +++ b/src/osmo_ss7_vty.c @@ -182,7 +182,8 @@ DEFUN(cs7_permit_dyn_rkm, cs7_permit_dyn_rkm_cmd, "xua rkm routing-key-allocation (static-only|dynamic-permitted)", - "SIGTRAN xxxUA related\n" "Routing Key Management Allocation Policy\n" + "SIGTRAN xxxUA related\n" "Routing Key Management\n" + "Routing Key Management Allocation Policy\n" "Only static (pre-confgured) Routing Keys permitted\n" "Dynamically allocate Routing Keys for what ASPs request\n") { -- To view, visit https://gerrit.osmocom.org/3579 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I16aa74244ed5332bdc1fddd538e17b86f62ec3b2 Gerrit-PatchSet: 1 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Tue Aug 22 13:04:12 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Tue, 22 Aug 2017 13:04:12 +0000 Subject: openbsc[master]: SGSN: log IMSI on PDP context creation/deletion In-Reply-To: References: Message-ID: Patch Set 3: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/3575 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I5ada9f85af2098f9acc8a277b9026eed226b9ac2 Gerrit-PatchSet: 3 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: daniel Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Aug 22 13:08:48 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Tue, 22 Aug 2017 13:08:48 +0000 Subject: [PATCH] osmo-gsm-tester[master]: bts_osmotrx: Support configuring bts addr, trx_remote_ip, an... In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3578 to look at the new patch set (#2). bts_osmotrx: Support configuring bts addr, trx_remote_ip, and launch_trx We may want to support running a device which runs its own TRX (osmo-trx or different implementation). Furthermore, this TRX may be available in some specific hwardare rather than on the main unit. This makes it easy to configure OsmoBtsTrx to launch it's own osmo-trx or not. In case it is launched, all IPs are configured correctly to ensure connection can be established. Before this commit, osmo-trx was binding to 127.0.0.1. Now we can support multiple osmo-trx being launched on the main unit. Change-Id: I825ed1fc0c3fe75d196db90c1508283fbd04acf8 --- M example/resources.conf M src/osmo_gsm_tester/bts_osmotrx.py M src/osmo_gsm_tester/config.py M src/osmo_gsm_tester/resource.py M src/osmo_gsm_tester/schema.py M src/osmo_gsm_tester/templates/osmo-bts-trx.cfg.tmpl M src/osmo_gsm_tester/util.py 7 files changed, 49 insertions(+), 11 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-tester refs/changes/78/3578/2 diff --git a/example/resources.conf b/example/resources.conf index 0260815..a09e80a 100644 --- a/example/resources.conf +++ b/example/resources.conf @@ -17,8 +17,16 @@ - label: Ettus B210 type: osmo-bts-trx ipa_unit_id: 6 - addr: 10.42.42.116 + addr: 10.42.42.50 band: GSM-1800 + launch_trx: true + +- label: sysmoCell 5000 + type: osmo-bts-trx + ipa_unit_id: 7 + addr: 10.42.42.51 + band: GSM-1800 + trx_remote_ip: 10.42.42.112 arfcn: - arfcn: 512 diff --git a/src/osmo_gsm_tester/bts_osmotrx.py b/src/osmo_gsm_tester/bts_osmotrx.py index 9795a58..b5262a2 100644 --- a/src/osmo_gsm_tester/bts_osmotrx.py +++ b/src/osmo_gsm_tester/bts_osmotrx.py @@ -41,8 +41,17 @@ self.env = {} def remote_addr(self): - # FIXME - return '127.0.0.1' + return self.conf.get('addr') + + def trx_remote_ip(self): + conf_ip = self.conf.get('trx_remote_ip', None) + if conf_ip is not None: + return conf_ip + # if 'trx_remote_ip' is not configured, use same IP as BTS + return self.remote_addr() + + def launch_trx_enabled(self): + return util.str2bool(self.conf.get('launch_trx')) def start(self): if self.bsc is None: @@ -53,10 +62,11 @@ self.run_dir = util.Dir(self.suite_run.get_test_run_dir().new_dir(self.name())) self.configure() - self.trx = OsmoTrx(self.suite_run) - self.trx.start() - self.log('Waiting for osmo-trx to start up...') - event_loop.wait(self, self.trx.trx_ready) + if self.launch_trx_enabled(): + self.trx = OsmoTrx(self.suite_run, self.trx_remote_ip(), self.remote_addr()) + self.trx.start() + self.log('Waiting for osmo-trx to start up...') + event_loop.wait(self, self.trx.trx_ready) self.inst = util.Dir(os.path.abspath(self.suite_run.trial.get_inst(OsmoBtsTrx.BIN_BTS_TRX))) lib = self.inst.child('lib') @@ -93,6 +103,8 @@ config.overlay(values, { 'osmo_bts_trx': { 'oml_remote_ip': self.bsc.addr(), + 'trx_local_ip': self.remote_addr(), + 'trx_remote_ip': self.trx_remote_ip(), 'pcu_socket_path': os.path.join(str(self.run_dir), 'pcu_bts') } }) @@ -124,17 +136,19 @@ BIN_TRX = 'osmo-trx' - def __init__(self, suite_run): + def __init__(self, suite_run, listen_ip, bts_ip): super().__init__(log.C_RUN, OsmoTrx.BIN_TRX) self.suite_run = suite_run self.env = {} + self.listen_ip = listen_ip + self.bts_ip = bts_ip def start(self): self.run_dir = util.Dir(self.suite_run.get_test_run_dir().new_dir(self.name())) self.inst = util.Dir(os.path.abspath(self.suite_run.trial.get_inst(OsmoTrx.BIN_TRX))) lib = self.inst.child('lib') self.env = { 'LD_LIBRARY_PATH': util.prepend_library_path(lib) } - self.proc_trx = self.launch_process(OsmoTrx.BIN_TRX, '-x') + self.proc_trx = self.launch_process(OsmoTrx.BIN_TRX, '-x', '-j', self.listen_ip, '-i', self.bts_ip) def launch_process(self, binary_name, *args): binary = os.path.abspath(self.inst.child('bin', binary_name)) diff --git a/src/osmo_gsm_tester/config.py b/src/osmo_gsm_tester/config.py index 20ae83e..f6e81ac 100644 --- a/src/osmo_gsm_tester/config.py +++ b/src/osmo_gsm_tester/config.py @@ -271,5 +271,4 @@ dest[i] = overlay(dest[i], src[i]) return dest return src - # vim: expandtab tabstop=4 shiftwidth=4 diff --git a/src/osmo_gsm_tester/resource.py b/src/osmo_gsm_tester/resource.py index 8eec71e..9470f48 100644 --- a/src/osmo_gsm_tester/resource.py +++ b/src/osmo_gsm_tester/resource.py @@ -54,6 +54,8 @@ 'bts[].ipa_unit_id': schema.INT, 'bts[].addr': schema.IPV4, 'bts[].band': schema.BAND, + 'bts[].trx_remote_ip': schema.IPV4, + 'bts[].launch_trx': schema.BOOL_STR, 'bts[].trx_list[].hw_addr': schema.HWADDR, 'bts[].trx_list[].net_device': schema.STR, 'arfcn[].arfcn': schema.INT, diff --git a/src/osmo_gsm_tester/schema.py b/src/osmo_gsm_tester/schema.py index d652aa7..4c9b9cd 100644 --- a/src/osmo_gsm_tester/schema.py +++ b/src/osmo_gsm_tester/schema.py @@ -20,7 +20,7 @@ import re from . import log -from .util import is_dict, is_list +from .util import is_dict, is_list, str2bool KEY_RE = re.compile('[a-zA-Z][a-zA-Z0-9_]*') IPV4_RE = re.compile('([0-9]{1,3}.){3}[0-9]{1,3}') @@ -63,21 +63,25 @@ INT = 'int' STR = 'str' +BOOL_STR = 'bool_str' BAND = 'band' IPV4 = 'ipv4' HWADDR = 'hwaddr' IMSI = 'imsi' KI = 'ki' MSISDN = 'msisdn' +TRX_REMOTE_IP = 'trx_remote_ip' SCHEMA_TYPES = { INT: int, STR: str, + BOOL_STR: str2bool, BAND: band, IPV4: ipv4, HWADDR: hwaddr, IMSI: imsi, KI: ki, MSISDN: msisdn, + TRX_REMOTE_IP: ipv4, } def validate(config, schema): diff --git a/src/osmo_gsm_tester/templates/osmo-bts-trx.cfg.tmpl b/src/osmo_gsm_tester/templates/osmo-bts-trx.cfg.tmpl index ddfd483..950c03e 100644 --- a/src/osmo_gsm_tester/templates/osmo-bts-trx.cfg.tmpl +++ b/src/osmo_gsm_tester/templates/osmo-bts-trx.cfg.tmpl @@ -17,6 +17,8 @@ instance 0 osmotrx rx-gain 25 osmotrx tx-attenuation oml + osmotrx ip local ${osmo_bts_trx.trx_local_ip} + osmotrx ip remote ${osmo_bts_trx.trx_remote_ip} bts 0 band ${osmo_bts_trx.band} ipa unit-id ${osmo_bts_trx.ipa_unit_id} 0 diff --git a/src/osmo_gsm_tester/util.py b/src/osmo_gsm_tester/util.py index 602ae45..f38683c 100644 --- a/src/osmo_gsm_tester/util.py +++ b/src/osmo_gsm_tester/util.py @@ -305,4 +305,13 @@ input_thread.join() return input_thread.result +def str2bool(val): + if val is None or not val: + return False + if val.upper() in ['FALSE', 'NO', 'OFF']: + return False + if val.upper() in ['TRUE','YES', 'ON']: + return True + raise ValueError('Invalid BOOL field: %r' % val) + # vim: expandtab tabstop=4 shiftwidth=4 -- To view, visit https://gerrit.osmocom.org/3578 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I825ed1fc0c3fe75d196db90c1508283fbd04acf8 Gerrit-PatchSet: 2 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Tue Aug 22 13:36:55 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Tue, 22 Aug 2017 13:36:55 +0000 Subject: [PATCH] osmo-bts[master]: osmo-bts-trx: Relax validation to allow TRX data bursts with... Message-ID: Review at https://gerrit.osmocom.org/3580 osmo-bts-trx: Relax validation to allow TRX data bursts without padding Original OpenBTS transcievers add 2 bytes of padding to the end of data bursts, having in total 158 bytes. As those two extra bytes are being ignored after the initial validation, let's relax this validation a bit in order to accept transcievers that decide no to send these two extra bytes. Change-Id: I94c3cb160bfed0ba9c41ed7ef5f8d8a65b81ad07 --- M src/osmo-bts-trx/trx_if.c 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/80/3580/1 diff --git a/src/osmo-bts-trx/trx_if.c b/src/osmo-bts-trx/trx_if.c index 86a3b9b..d93d61c 100644 --- a/src/osmo-bts-trx/trx_if.c +++ b/src/osmo-bts-trx/trx_if.c @@ -443,7 +443,7 @@ return len; } else if (len == EGPRS_BURST_LEN + 10) { burst_len = EGPRS_BURST_LEN; - } else if (len != GSM_BURST_LEN + 10) { + } else if (len != GSM_BURST_LEN + 10 && len != GSM_BURST_LEN + 8) { LOGP(DTRX, LOGL_NOTICE, "Got data message with invalid lenght " "'%d'\n", len); return -EINVAL; -- To view, visit https://gerrit.osmocom.org/3580 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I94c3cb160bfed0ba9c41ed7ef5f8d8a65b81ad07 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Tue Aug 22 16:14:04 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 22 Aug 2017 16:14:04 +0000 Subject: [PATCH] osmo-msc[master]: fix msc_vlr tests after libosmocore uses localtime for SMS Message-ID: Review at https://gerrit.osmocom.org/3581 fix msc_vlr tests after libosmocore uses localtime for SMS libosmocore change-id I4efdb1eaae43aced33961b64d4f14b0040321c10 changes the gsm340_gen_scts() from gmtime to localtime, meaning that by feeding a mere zero as timestamp, we get different results depending on the local machine's timezone setting. Instead of calling gsm340_gen_scts() with zero, simply write a bunch of bytes as time so that the tests get identical SMS bytes every time. Change-Id: I8a50e8963dce80609749571b61fc6ffe1c54660c --- M tests/msc_vlr/msc_vlr_tests.c 1 file changed, 2 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/81/3581/1 diff --git a/tests/msc_vlr/msc_vlr_tests.c b/tests/msc_vlr/msc_vlr_tests.c index 28201d0..2049e9f 100644 --- a/tests/msc_vlr/msc_vlr_tests.c +++ b/tests/msc_vlr/msc_vlr_tests.c @@ -242,8 +242,8 @@ void __real_gsm340_gen_scts(uint8_t *scts, time_t time); void __wrap_gsm340_gen_scts(uint8_t *scts, time_t time) { - /* Remove the time to encode for deterministic test results */ - __real_gsm340_gen_scts(scts, 0); + /* Write fixed time bytes for deterministic test results */ + osmo_hexparse("07101000000000", scts, 7); } const char *paging_expecting_imsi = NULL; -- To view, visit https://gerrit.osmocom.org/3581 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I8a50e8963dce80609749571b61fc6ffe1c54660c Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Tue Aug 22 16:48:24 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 22 Aug 2017 16:48:24 +0000 Subject: osmo-msc[master]: fix msc_vlr tests after libosmocore uses localtime for SMS In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 fast tracking this... -- To view, visit https://gerrit.osmocom.org/3581 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I8a50e8963dce80609749571b61fc6ffe1c54660c Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Aug 22 16:48:28 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 22 Aug 2017 16:48:28 +0000 Subject: [MERGED] osmo-msc[master]: fix msc_vlr tests after libosmocore uses localtime for SMS In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: fix msc_vlr tests after libosmocore uses localtime for SMS ...................................................................... fix msc_vlr tests after libosmocore uses localtime for SMS libosmocore change-id I4efdb1eaae43aced33961b64d4f14b0040321c10 changes the gsm340_gen_scts() from gmtime to localtime, meaning that by feeding a mere zero as timestamp, we get different results depending on the local machine's timezone setting. Instead of calling gsm340_gen_scts() with zero, simply write a bunch of bytes as time so that the tests get identical SMS bytes every time. Change-Id: I8a50e8963dce80609749571b61fc6ffe1c54660c --- M tests/msc_vlr/msc_vlr_tests.c 1 file changed, 2 insertions(+), 2 deletions(-) Approvals: Neels Hofmeyr: Looks good to me, approved Jenkins Builder: Verified diff --git a/tests/msc_vlr/msc_vlr_tests.c b/tests/msc_vlr/msc_vlr_tests.c index 28201d0..2049e9f 100644 --- a/tests/msc_vlr/msc_vlr_tests.c +++ b/tests/msc_vlr/msc_vlr_tests.c @@ -242,8 +242,8 @@ void __real_gsm340_gen_scts(uint8_t *scts, time_t time); void __wrap_gsm340_gen_scts(uint8_t *scts, time_t time) { - /* Remove the time to encode for deterministic test results */ - __real_gsm340_gen_scts(scts, 0); + /* Write fixed time bytes for deterministic test results */ + osmo_hexparse("07101000000000", scts, 7); } const char *paging_expecting_imsi = NULL; -- To view, visit https://gerrit.osmocom.org/3581 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I8a50e8963dce80609749571b61fc6ffe1c54660c Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Tue Aug 22 17:10:57 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Tue, 22 Aug 2017 17:10:57 +0000 Subject: [PATCH] osmo-gsm-tester[master]: Allow tests to select network encryption Message-ID: Review at https://gerrit.osmocom.org/3582 Allow tests to select network encryption Change-Id: I273eee44c095690d0c2e3994befa97edc42496ac --- M src/osmo_gsm_tester/osmo_msc.py M src/osmo_gsm_tester/osmo_nitb.py 2 files changed, 18 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-tester refs/changes/82/3582/1 diff --git a/src/osmo_gsm_tester/osmo_msc.py b/src/osmo_gsm_tester/osmo_msc.py index 2c9b1e3..92a9d61 100644 --- a/src/osmo_gsm_tester/osmo_msc.py +++ b/src/osmo_gsm_tester/osmo_msc.py @@ -31,6 +31,7 @@ hlr = None config = None smsc = None + encryption = None def __init__(self, suite_run, hlr, mgcpgw, ip_address): super().__init__(log.C_RUN, 'osmo-msc_%s' % ip_address.get('addr')) @@ -76,6 +77,11 @@ config.overlay(values, self.mgcpgw.conf_for_msc()) config.overlay(values, self.hlr.conf_for_msc()) config.overlay(values, self.smsc.get_config()) + + # runtime parameters: + if self.encryption is not None: + config.overlay(values, dict(msc=dict(net=dict(encryption=self.encryption)))) + self.config = values self.dbg('MSC CONFIG:\n' + pprint.pformat(values)) @@ -88,6 +94,9 @@ def addr(self): return self.ip_address.get('addr') + def set_encryption(self, val): + self.encryption = val + def mcc(self): return self.config['msc']['net']['mcc'] diff --git a/src/osmo_gsm_tester/osmo_nitb.py b/src/osmo_gsm_tester/osmo_nitb.py index 3ef5276..9c15fe6 100644 --- a/src/osmo_gsm_tester/osmo_nitb.py +++ b/src/osmo_gsm_tester/osmo_nitb.py @@ -31,6 +31,7 @@ process = None bts = None smsc = None + encryption = None def __init__(self, suite_run, ip_address): super().__init__(log.C_RUN, 'osmo-nitb_%s' % ip_address.get('addr')) @@ -78,6 +79,11 @@ bts_list.append(bts.conf_for_bsc()) config.overlay(values, dict(nitb=dict(net=dict(bts_list=bts_list)))) config.overlay(values, self.smsc.get_config()) + + # runtime parameters: + if self.encryption is not None: + config.overlay(values, dict(nitb=dict(net=dict(encryption=self.encryption)))) + self.config = values self.dbg('NITB CONFIG:\n' + pprint.pformat(values)) @@ -94,6 +100,9 @@ self.bts.append(bts) bts.set_bsc(self) + def set_encryption(self, val): + self.encryption = val + def mcc(self): return self.config['nitb']['net']['mcc'] -- To view, visit https://gerrit.osmocom.org/3582 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I273eee44c095690d0c2e3994befa97edc42496ac Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Tue Aug 22 17:10:57 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Tue, 22 Aug 2017 17:10:57 +0000 Subject: [PATCH] osmo-gsm-tester[master]: modem: Allow tests to change KI Message-ID: Review at https://gerrit.osmocom.org/3583 modem: Allow tests to change KI This is useful for tests that wants to fake a bad KI to test if auth and encryption are working correctly. Change-Id: I40cfed6f6b9239eea2b97ffa010b98c78f0cb9cb --- M src/osmo_gsm_tester/ofono_client.py 1 file changed, 6 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-tester refs/changes/83/3583/1 diff --git a/src/osmo_gsm_tester/ofono_client.py b/src/osmo_gsm_tester/ofono_client.py index 60f98df..00cfd47 100644 --- a/src/osmo_gsm_tester/ofono_client.py +++ b/src/osmo_gsm_tester/ofono_client.py @@ -318,6 +318,7 @@ 'convenience for ofono Modem interaction' msisdn = None sms_received_list = None + _ki = None def __init__(self, conf): self.conf = conf @@ -394,7 +395,12 @@ raise log.Error('No IMSI') return imsi + def set_ki(self, ki): + self._ki = ki + def ki(self): + if self._ki is not None: + return self._ki return self.conf.get('ki') def _on_netreg_property_changed(self, name, value): -- To view, visit https://gerrit.osmocom.org/3583 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I40cfed6f6b9239eea2b97ffa010b98c78f0cb9cb Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Tue Aug 22 17:51:56 2017 From: gerrit-no-reply at lists.osmocom.org (Tom Tsou) Date: Tue, 22 Aug 2017 17:51:56 +0000 Subject: osmo-trx[master]: Add -j option to bind to specific address In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3539 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I9ba184a1251c823e413a9230943ed263e52142ec Gerrit-PatchSet: 1 Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Alexander Chemeris Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Tom Tsou Gerrit-Reviewer: ttsou Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Aug 22 17:52:26 2017 From: gerrit-no-reply at lists.osmocom.org (Tom Tsou) Date: Tue, 22 Aug 2017 17:52:26 +0000 Subject: [MERGED] osmo-trx[master]: Add -j option to bind to specific address In-Reply-To: References: Message-ID: Tom Tsou has submitted this change and it was merged. Change subject: Add -j option to bind to specific address ...................................................................... Add -j option to bind to specific address Before this patch, the binding of the listening sockets was hardcoded to a local IP. Change-Id: I9ba184a1251c823e413a9230943ed263e52142ec --- M CommonLibs/Sockets.cpp M CommonLibs/Sockets.h M CommonLibs/SocketsTest.cpp M Transceiver52M/Transceiver.cpp M Transceiver52M/Transceiver.h M Transceiver52M/osmo-trx.cpp 6 files changed, 40 insertions(+), 28 deletions(-) Approvals: Tom Tsou: Looks good to me, approved Alexander Chemeris: Looks good to me, but someone else must approve Harald Welte: Looks good to me, but someone else must approve Jenkins Builder: Verified diff --git a/CommonLibs/Sockets.cpp b/CommonLibs/Sockets.cpp index 9030a86..a65d62b 100644 --- a/CommonLibs/Sockets.cpp +++ b/CommonLibs/Sockets.cpp @@ -223,18 +223,18 @@ -UDPSocket::UDPSocket(unsigned short wSrcPort) +UDPSocket::UDPSocket(const char *wSrcIP, unsigned short wSrcPort) :DatagramSocket() { - open(wSrcPort); + open(wSrcPort, wSrcIP); } -UDPSocket::UDPSocket(unsigned short wSrcPort, - const char * wDestIP, unsigned short wDestPort ) +UDPSocket::UDPSocket(const char *wSrcIP, unsigned short wSrcPort, + const char *wDestIP, unsigned short wDestPort) :DatagramSocket() { - open(wSrcPort); + open(wSrcPort, wSrcIP); destination(wDestPort, wDestIP); } @@ -246,7 +246,7 @@ } -void UDPSocket::open(unsigned short localPort) +void UDPSocket::open(unsigned short localPort, const char *wlocalIP) { // create mSocketFD = socket(AF_INET,SOCK_DGRAM,0); @@ -265,7 +265,7 @@ size_t length = sizeof(address); bzero(&address,length); address.sin_family = AF_INET; - address.sin_addr.s_addr = htonl(INADDR_LOOPBACK); + address.sin_addr.s_addr = inet_addr(wlocalIP); address.sin_port = htons(localPort); if (bind(mSocketFD,(struct sockaddr*)&address,length)<0) { perror("bind() failed"); diff --git a/CommonLibs/Sockets.h b/CommonLibs/Sockets.h index 0a70269..8312843 100644 --- a/CommonLibs/Sockets.h +++ b/CommonLibs/Sockets.h @@ -144,11 +144,11 @@ public: /** Open a USP socket with an OS-assigned port and no default destination. */ - UDPSocket( unsigned short localPort=0); + UDPSocket(const char *localIP, unsigned short localPort); /** Given a full specification, open the socket and set the dest address. */ - UDPSocket( unsigned short localPort, - const char * remoteIP, unsigned short remotePort); + UDPSocket(const char *localIP, unsigned short localPort, + const char *remoteIP, unsigned short remotePort); /** Set the destination port. */ void destination( unsigned short wDestPort, const char * wDestIP ); @@ -157,7 +157,7 @@ unsigned short port() const; /** Open and bind the UDP socket to a local port. */ - void open(unsigned short localPort=0); + void open(unsigned short localPort=0, const char *wlocalIP="127.0.0.1"); /** Give the return address of the most recently received packet. */ const struct sockaddr_in* source() const { return (const struct sockaddr_in*)mSource; } diff --git a/CommonLibs/SocketsTest.cpp b/CommonLibs/SocketsTest.cpp index 1fa8bbd..c2849e0 100644 --- a/CommonLibs/SocketsTest.cpp +++ b/CommonLibs/SocketsTest.cpp @@ -37,7 +37,7 @@ void *testReaderIP(void *) { - UDPSocket readSocket(5934, "localhost", 5061); + UDPSocket readSocket("127.0.0.1", 5934, "localhost", 5061); readSocket.nonblocking(); int rc = 0; while (rc mDataSockets; ///< socket for writing to/reading from GSM core std::vector mCtrlSockets; ///< socket for writing/reading control commands from GSM core diff --git a/Transceiver52M/osmo-trx.cpp b/Transceiver52M/osmo-trx.cpp index 61b3098..3f72fb7 100644 --- a/Transceiver52M/osmo-trx.cpp +++ b/Transceiver52M/osmo-trx.cpp @@ -62,7 +62,8 @@ struct trx_config { std::string log_level; - std::string addr; + std::string local_addr; + std::string remote_addr; std::string dev_args; unsigned port; unsigned tx_sps; @@ -134,7 +135,8 @@ ost << " Log Level............... " << config->log_level << std::endl; ost << " Device args............. " << config->dev_args << std::endl; ost << " TRX Base Port........... " << config->port << std::endl; - ost << " TRX Address............. " << config->addr << std::endl; + ost << " TRX Address............. " << config->local_addr << std::endl; + ost << " GSM Core Address........." << config->remote_addr << std::endl; ost << " Channels................ " << config->chans << std::endl; ost << " Tx Samples-per-Symbol... " << config->tx_sps << std::endl; ost << " Rx Samples-per-Symbol... " << config->rx_sps << std::endl; @@ -200,9 +202,10 @@ Transceiver *trx; VectorFIFO *fifo; - trx = new Transceiver(config->port, config->addr.c_str(), - config->tx_sps, config->rx_sps, config->chans, - GSM::Time(3,0), radio, config->rssi_offset); + trx = new Transceiver(config->port, config->local_addr.c_str(), + config->remote_addr.c_str(), config->tx_sps, + config->rx_sps, config->chans, GSM::Time(3,0), + radio, config->rssi_offset); if (!trx->init(config->filler, config->rtsc, config->rach_delay, config->edge)) { LOG(ALERT) << "Failed to initialize transceiver"; @@ -248,6 +251,7 @@ " -a UHD device args\n" " -l Logging level (%s)\n" " -i IP address of GSM core\n" + " -j IP address of osmo-trx\n" " -p Base port number\n" " -e Enable EDGE receiver\n" " -m Enable multi-ARFCN transceiver (default=disabled)\n" @@ -271,7 +275,8 @@ int option; config->log_level = "NOTICE"; - config->addr = DEFAULT_TRX_IP; + config->local_addr = DEFAULT_TRX_IP; + config->remote_addr = DEFAULT_TRX_IP; config->port = DEFAULT_TRX_PORT; config->tx_sps = DEFAULT_TX_SPS; config->rx_sps = DEFAULT_RX_SPS; @@ -288,7 +293,7 @@ config->edge = false; config->sched_rr = -1; - while ((option = getopt(argc, argv, "ha:l:i:p:c:dmxgfo:s:b:r:A:R:Set:")) != -1) { + while ((option = getopt(argc, argv, "ha:l:i:j:p:c:dmxgfo:s:b:r:A:R:Set:")) != -1) { switch (option) { case 'h': print_help(); @@ -301,7 +306,10 @@ config->log_level = optarg; break; case 'i': - config->addr = optarg; + config->remote_addr = optarg; + break; + case 'j': + config->local_addr = optarg; break; case 'p': config->port = atoi(optarg); -- To view, visit https://gerrit.osmocom.org/3539 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I9ba184a1251c823e413a9230943ed263e52142ec Gerrit-PatchSet: 1 Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Alexander Chemeris Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Tom Tsou Gerrit-Reviewer: ttsou From gerrit-no-reply at lists.osmocom.org Tue Aug 22 18:05:12 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Tue, 22 Aug 2017 18:05:12 +0000 Subject: [PATCH] osmo-gsm-tester[master]: hlr: fill auc_2g table when registering a subscriber Message-ID: Review at https://gerrit.osmocom.org/3584 hlr: fill auc_2g table when registering a subscriber Change-Id: I491d093934c129a01baa1c5d7ada4acf370bf37d --- M src/osmo_gsm_tester/osmo_hlr.py 1 file changed, 11 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-tester refs/changes/84/3584/1 diff --git a/src/osmo_gsm_tester/osmo_hlr.py b/src/osmo_gsm_tester/osmo_hlr.py index 19241cc..fbcd43e 100644 --- a/src/osmo_gsm_tester/osmo_hlr.py +++ b/src/osmo_gsm_tester/osmo_hlr.py @@ -31,6 +31,10 @@ process = None next_subscriber_id = 1 + AUTH_ALGO_NONE = 0 + AUTH_ALGO_XOR = 1 + AUTH_ALGO_COMP128v1 = 2 + def __init__(self, suite_run, ip_address): super().__init__(log.C_RUN, 'osmo-hlr_%s' % ip_address.get('addr')) self.suite_run = suite_run @@ -113,16 +117,21 @@ f.write(sql) self.run_sql_file(name, sql_file) - def subscriber_add(self, modem, msisdn=None): + def subscriber_add(self, modem, msisdn=None, algo=None): if msisdn is None: msisdn = self.suite_run.resources_pool.next_msisdn(modem) modem.set_msisdn(msisdn) subscriber_id = self.next_subscriber_id self.next_subscriber_id += 1 - self.log('Add subscriber', msisdn=msisdn, imsi=modem.imsi(), subscriber_id=subscriber_id) + if not algo: + algo = self.AUTH_ALGO_COMP128v1 if modem.ki() else self.AUTH_ALGO_NONE + self.log('Add subscriber', msisdn=msisdn, imsi=modem.imsi(), subscriber_id=subscriber_id, algo=algo) self.run_sql('add_subscriber', 'insert into subscriber (id, imsi, msisdn) values (%r, %r, %r);' % (subscriber_id, modem.imsi(), modem.msisdn)) + self.run_sql('add_subscriber', + 'insert into auc_2g (subscriber_id, algo_id_2g, ki) values (%r, %r, %r);' + % (subscriber_id, algo, modem.ki())) return subscriber_id def conf_for_msc(self): -- To view, visit https://gerrit.osmocom.org/3584 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I491d093934c129a01baa1c5d7ada4acf370bf37d Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Wed Aug 23 01:28:04 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 23 Aug 2017 01:28:04 +0000 Subject: [PATCH] libosmo-sccp[master]: osmo_ss7_vty: fix 'as' / 'routing-key' command Message-ID: Review at https://gerrit.osmocom.org/3585 osmo_ss7_vty: fix 'as' / 'routing-key' command The VTY definition for this command is flawed and breaks osmo-msc VTY tests. The small problem is a stray '}' in the definition, the bigger problem is that square brackets indicating optional arguments must not enclose more than one argument. Split up the command in several separate definitions with si arg, with ssn arg, with both, and with neither. If si and/or ssn are not passed, set them to zero. See https://lists.osmocom.org/pipermail/openbsc/2017-August/011026.html "optional vty items are stricter than expected" Change-Id: Idc68bfae5457960a9eae5d9648586d6ce719ad68 --- M src/osmo_ss7_vty.c 1 file changed, 58 insertions(+), 31 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-sccp refs/changes/85/3585/1 diff --git a/src/osmo_ss7_vty.c b/src/osmo_ss7_vty.c index 8d2ec96..5731326 100644 --- a/src/osmo_ss7_vty.c +++ b/src/osmo_ss7_vty.c @@ -778,51 +778,75 @@ { 0, NULL } }; -DEFUN(as_rout_key, as_rout_key_cmd, - "routing-key RCONTEXT DPC [si (aal2|bicc|b-isup|h248|isup|sat-isup|sccp|tup)] [ssn SSN]}", - "Define a routing key\n" - "Routing context number\n" +#define ROUTING_KEY_CMD "routing-key RCONTEXT DPC" +#define ROUTING_KEY_CMD_STRS \ + "Define a routing key\n" \ + "Routing context number\n" \ "Destination Point Code\n" - "Optional Match on Service Indicator\n" - "ATM Adaption Layer 2\n" - "Bearer Independent Call Control\n" - "Broadband ISDN User Part\n" - "H.248\n" - "ISDN User Part\n" - "Sattelite ISDN User Part\n" - "Signalling Connection Control Part\n" +#define ROUTING_KEY_SI_ARG " si (aal2|bicc|b-isup|h248|isup|sat-isup|sccp|tup)" +#define ROUTING_KEY_SI_ARG_STRS \ + "Match on Service Indicator\n" \ + "ATM Adaption Layer 2\n" \ + "Bearer Independent Call Control\n" \ + "Broadband ISDN User Part\n" \ + "H.248\n" \ + "ISDN User Part\n" \ + "Sattelite ISDN User Part\n" \ + "Signalling Connection Control Part\n" \ "Telephony User Part\n" - "Optional Match on Sub-System Number\n" - "Sub-System Number to match on\n") +#define ROUTING_KEY_SSN_ARG " ssn SSN" +#define ROUTING_KEY_SSN_ARG_STRS \ + "Match on Sub-System Number\n" \ + "Sub-System Number to match on\n" + +static int _rout_key(struct vty *vty, + const char *rcontext, const char *dpc, + const char *si, const char *ssn) { struct osmo_ss7_as *as = vty->index; struct osmo_ss7_routing_key *rkey = &as->cfg.routing_key; - int argind; int pc; - pc = osmo_ss7_pointcode_parse(as->inst, argv[1]); + pc = osmo_ss7_pointcode_parse(as->inst, dpc); if (pc < 0) { - vty_out(vty, "Invalid point code (%s)%s", argv[1], VTY_NEWLINE); + vty_out(vty, "Invalid point code (%s)%s", dpc, VTY_NEWLINE); return CMD_WARNING; } - rkey->pc = pc; - rkey->context = atoi(argv[0]); - argind = 2; - if (argind < argc && !strcmp(argv[argind], "si")) { - const char *si_str; - argind++; - si_str = argv[argind++]; - /* parse numeric SI from string */ - rkey->si = get_string_value(mtp_si_vals, si_str); - } - if (argind < argc && !strcmp(argv[argind], "ssn")) { - argind++; - rkey->ssn = atoi(argv[argind]); - } + rkey->context = atoi(rcontext); /* FIXME: input validation */ + rkey->si = si ? get_string_value(mtp_si_vals, si) : 0; /* FIXME: input validation */ + rkey->ssn = ssn ? atoi(ssn) : 0; /* FIXME: input validation */ return CMD_SUCCESS; +} + +DEFUN(as_rout_key, as_rout_key_cmd, + ROUTING_KEY_CMD, + ROUTING_KEY_CMD_STRS) +{ + return _rout_key(vty, argv[0], argv[1], NULL, NULL); +} + +DEFUN(as_rout_key_si, as_rout_key_si_cmd, + ROUTING_KEY_CMD ROUTING_KEY_SI_ARG, + ROUTING_KEY_CMD_STRS ROUTING_KEY_SI_ARG_STRS) +{ + return _rout_key(vty, argv[0], argv[1], argv[2], NULL); +} + +DEFUN(as_rout_key_ssn, as_rout_key_ssn_cmd, + ROUTING_KEY_CMD ROUTING_KEY_SSN_ARG, + ROUTING_KEY_CMD_STRS ROUTING_KEY_SSN_ARG_STRS) +{ + return _rout_key(vty, argv[0], argv[1], NULL, argv[2]); +} + +DEFUN(as_rout_key_si_ssn, as_rout_key_si_ssn_cmd, + ROUTING_KEY_CMD ROUTING_KEY_SI_ARG ROUTING_KEY_SSN_ARG, + ROUTING_KEY_CMD_STRS ROUTING_KEY_SI_ARG_STRS ROUTING_KEY_SSN_ARG_STRS) +{ + return _rout_key(vty, argv[0], argv[1], argv[2], argv[3]); } DEFUN(as_pc_override, as_pc_override_cmd, @@ -1718,6 +1742,9 @@ install_element(L_CS7_AS_NODE, &as_recov_tout_cmd); install_element(L_CS7_AS_NODE, &as_qos_class_cmd); install_element(L_CS7_AS_NODE, &as_rout_key_cmd); + install_element(L_CS7_AS_NODE, &as_rout_key_si_cmd); + install_element(L_CS7_AS_NODE, &as_rout_key_ssn_cmd); + install_element(L_CS7_AS_NODE, &as_rout_key_si_ssn_cmd); install_element(L_CS7_AS_NODE, &as_pc_override_cmd); vty_init_addr(); -- To view, visit https://gerrit.osmocom.org/3585 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Idc68bfae5457960a9eae5d9648586d6ce719ad68 Gerrit-PatchSet: 1 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Wed Aug 23 08:49:20 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Wed, 23 Aug 2017 08:49:20 +0000 Subject: [PATCH] osmo-gsm-tester[master]: ctrl: Add dbg log to print received data Message-ID: Review at https://gerrit.osmocom.org/3586 ctrl: Add dbg log to print received data This is useful to see for instance the returned values from NITB when asked for active subscribers. Change-Id: I5c616646da360457930888b54d9019b76f05fe2f --- M src/osmo_gsm_tester/osmo_ctrl.py 1 file changed, 3 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-tester refs/changes/86/3586/1 diff --git a/src/osmo_gsm_tester/osmo_ctrl.py b/src/osmo_gsm_tester/osmo_ctrl.py index b5a947f..be27b75 100644 --- a/src/osmo_gsm_tester/osmo_ctrl.py +++ b/src/osmo_gsm_tester/osmo_ctrl.py @@ -67,7 +67,9 @@ self.sck.send(data) def receive(self, length = 1024): - return self.sck.recv(length) + data = self.sck.recv(length) + self.dbg('Receiving', data=data) + return data def do_set(self, var, value, id=0): setmsg = "SET %s %s %s" %(id, var, value) -- To view, visit https://gerrit.osmocom.org/3586 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I5c616646da360457930888b54d9019b76f05fe2f Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Wed Aug 23 08:49:44 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Wed, 23 Aug 2017 08:49:44 +0000 Subject: osmo-gsm-tester[master]: ctrl: Add dbg log to print received data In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3586 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I5c616646da360457930888b54d9019b76f05fe2f Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Aug 23 08:49:51 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Wed, 23 Aug 2017 08:49:51 +0000 Subject: [MERGED] osmo-gsm-tester[master]: ctrl: Add dbg log to print received data In-Reply-To: References: Message-ID: Pau Espin Pedrol has submitted this change and it was merged. Change subject: ctrl: Add dbg log to print received data ...................................................................... ctrl: Add dbg log to print received data This is useful to see for instance the returned values from NITB when asked for active subscribers. Change-Id: I5c616646da360457930888b54d9019b76f05fe2f --- M src/osmo_gsm_tester/osmo_ctrl.py 1 file changed, 3 insertions(+), 1 deletion(-) Approvals: Pau Espin Pedrol: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/osmo_gsm_tester/osmo_ctrl.py b/src/osmo_gsm_tester/osmo_ctrl.py index b5a947f..be27b75 100644 --- a/src/osmo_gsm_tester/osmo_ctrl.py +++ b/src/osmo_gsm_tester/osmo_ctrl.py @@ -67,7 +67,9 @@ self.sck.send(data) def receive(self, length = 1024): - return self.sck.recv(length) + data = self.sck.recv(length) + self.dbg('Receiving', data=data) + return data def do_set(self, var, value, id=0): setmsg = "SET %s %s %s" %(id, var, value) -- To view, visit https://gerrit.osmocom.org/3586 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I5c616646da360457930888b54d9019b76f05fe2f Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Wed Aug 23 12:39:29 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 23 Aug 2017 12:39:29 +0000 Subject: [PATCH] osmo-msc[master]: replace internal libmgcp with libosmo-legacy-mgcp In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3492 to look at the new patch set (#2). replace internal libmgcp with libosmo-legacy-mgcp Change-Id: Ic99d681759edce11564da62500c2aac5cf5fffe2 --- M configure.ac M include/openbsc/Makefile.am M include/openbsc/bsc_nat.h M include/openbsc/gsm_data.h D include/openbsc/mgcp.h D include/openbsc/mgcp_internal.h D include/openbsc/mgcp_transcode.h D include/openbsc/mgcpgw_client.h M src/Makefile.am M src/libfilter/bsc_msg_acc.c D src/libmgcp/Makefile.am D src/libmgcp/g711common.h D src/libmgcp/mgcp_common.c D src/libmgcp/mgcp_network.c D src/libmgcp/mgcp_osmux.c D src/libmgcp/mgcp_protocol.c D src/libmgcp/mgcp_sdp.c D src/libmgcp/mgcp_transcode.c D src/libmgcp/mgcp_vty.c D src/libmgcp/mgcpgw_client.c D src/libmgcp/mgcpgw_client_vty.c M src/libmsc/a_iface.c M src/libmsc/msc_ifaces.c M src/libmsc/msc_vty.c M src/osmo-bsc/osmo_bsc_bssap.c D src/osmo-bsc_mgcp/Makefile.am D src/osmo-bsc_mgcp/mgcp_main.c M src/osmo-bsc_nat/bsc_mgcp_utils.c M src/osmo-bsc_nat/bsc_nat_ctrl.c M src/osmo-bsc_nat/bsc_nat_vty.c M src/osmo-bsc_nat/bsc_ussd.c M src/osmo-msc/Makefile.am M src/osmo-msc/msc_main.c M tests/Makefile.am D tests/mgcp/Makefile.am D tests/mgcp/mgcp_test.c D tests/mgcp/mgcp_test.ok D tests/mgcp/mgcp_transcoding_test.c D tests/mgcp/mgcp_transcoding_test.ok D tests/mgcp/mgcpgw_client_test.c D tests/mgcp/mgcpgw_client_test.err D tests/mgcp/mgcpgw_client_test.ok M tests/msc_vlr/Makefile.am M tests/sms_queue/Makefile.am M tests/testsuite.at 45 files changed, 29 insertions(+), 11,357 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/92/3492/2 -- To view, visit https://gerrit.osmocom.org/3492 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ic99d681759edce11564da62500c2aac5cf5fffe2 Gerrit-PatchSet: 2 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Aug 23 12:39:29 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 23 Aug 2017 12:39:29 +0000 Subject: [PATCH] osmo-msc[master]: split off osmo-msc: remove files, apply build, rename In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3497 to look at the new patch set (#2). split off osmo-msc: remove files, apply build, rename Change-Id: Icf025e5ea8d180613b3114282951c9afa67af9a7 --- M configure.ac D debian/osmo-gtphub.default D debian/osmo-gtphub.examples D debian/osmo-gtphub.init D debian/osmo-gtphub.install D debian/osmocom-bs11-utils.install D debian/osmocom-bsc-nat.init D debian/osmocom-bsc-nat.install D debian/osmocom-bsc.examples D debian/osmocom-bsc.install D debian/osmocom-gbproxy.init D debian/osmocom-gbproxy.install D debian/osmocom-ipaccess-utils.install D debian/osmocom-sgsn.default D debian/osmocom-sgsn.examples D debian/osmocom-sgsn.init D debian/osmocom-sgsn.install D doc/BS11-OML.txt D doc/channel_release.txt D doc/examples/osmo-bsc/osmo-bsc.cfg D doc/examples/osmo-bsc_mgcp/mgcp.cfg D doc/examples/osmo-bsc_nat/black-list.cfg D doc/examples/osmo-bsc_nat/osmo-bsc_nat.cfg D doc/examples/osmo-gbproxy/osmo-gbproxy-legacy.cfg D doc/examples/osmo-gbproxy/osmo-gbproxy.cfg D doc/examples/osmo-gtphub/gtphub-example.txt D doc/examples/osmo-gtphub/osmo-gtphub-1iface.cfg D doc/examples/osmo-gtphub/osmo-gtphub.cfg D doc/examples/osmo-sgsn/osmo-sgsn.cfg D doc/oml-interface.txt M include/Makefile.am D include/compat_af_isdn.h D include/mISDNif.h M include/openbsc/Makefile.am D include/openbsc/bsc_nat.h D include/openbsc/bsc_nat_callstats.h D include/openbsc/bsc_nat_sccp.h D include/openbsc/bsc_subscriber.h D include/openbsc/gb_proxy.h D include/openbsc/gprs_gb_parse.h D include/openbsc/gprs_gmm.h D include/openbsc/gprs_llc.h D include/openbsc/gprs_llc_xid.h D include/openbsc/gprs_sgsn.h D include/openbsc/gprs_sndcp.h D include/openbsc/gprs_sndcp_comp.h D include/openbsc/gprs_sndcp_dcomp.h D include/openbsc/gprs_sndcp_pcomp.h D include/openbsc/gprs_sndcp_xid.h D include/openbsc/gprs_subscriber.h D include/openbsc/gprs_utils.h D include/openbsc/nat_rewrite_trie.h M include/openbsc/paging.h D include/openbsc/pcu_if.h D include/openbsc/pcuif_proto.h D include/openbsc/sgsn.h D include/openbsc/v42bis.h D include/openbsc/v42bis_private.h M osmoappdesc.py M src/Makefile.am D src/gprs/.gitignore D src/gprs/Makefile.am D src/gprs/crc24.c D src/gprs/gb_proxy.c D src/gprs/gb_proxy_main.c D src/gprs/gb_proxy_patch.c D src/gprs/gb_proxy_peer.c D src/gprs/gb_proxy_tlli.c D src/gprs/gb_proxy_vty.c D src/gprs/gprs_gb_parse.c D src/gprs/gprs_gmm.c D src/gprs/gprs_llc.c D src/gprs/gprs_llc_parse.c D src/gprs/gprs_llc_vty.c D src/gprs/gprs_llc_xid.c D src/gprs/gprs_sgsn.c D src/gprs/gprs_sndcp.c D src/gprs/gprs_sndcp_comp.c D src/gprs/gprs_sndcp_dcomp.c D src/gprs/gprs_sndcp_pcomp.c D src/gprs/gprs_sndcp_vty.c D src/gprs/gprs_sndcp_xid.c D src/gprs/gprs_subscriber.c D src/gprs/gprs_utils.c D src/gprs/gtphub.c D src/gprs/gtphub_ares.c D src/gprs/gtphub_main.c D src/gprs/gtphub_sock.c D src/gprs/gtphub_vty.c D src/gprs/osmo_sgsn.cfg D src/gprs/sgsn_ares.c D src/gprs/sgsn_auth.c D src/gprs/sgsn_cdr.c D src/gprs/sgsn_ctrl.c D src/gprs/sgsn_libgtp.c D src/gprs/sgsn_main.c D src/gprs/sgsn_vty.c D src/gprs/slhc.c D src/gprs/v42bis.c D src/ipaccess/Makefile.am D src/ipaccess/abisip-find.c D src/ipaccess/ipaccess-config.c D src/ipaccess/ipaccess-firmware.c D src/ipaccess/ipaccess-proxy.c D src/ipaccess/network_listen.c D src/libbsc/Makefile.am D src/libbsc/abis_nm.c D src/libbsc/abis_nm_ipaccess.c D src/libbsc/abis_nm_vty.c D src/libbsc/abis_om2000.c D src/libbsc/abis_om2000_vty.c D src/libbsc/abis_rsl.c D src/libbsc/arfcn_range_encode.c D src/libbsc/bsc_api.c D src/libbsc/bsc_ctrl_commands.c D src/libbsc/bsc_ctrl_lookup.c D src/libbsc/bsc_dyn_ts.c D src/libbsc/bsc_init.c D src/libbsc/bsc_msc.c D src/libbsc/bsc_rf_ctrl.c D src/libbsc/bsc_rll.c D src/libbsc/bsc_subscriber.c D src/libbsc/bsc_vty.c D src/libbsc/bts_ericsson_rbs2000.c D src/libbsc/bts_init.c D src/libbsc/bts_ipaccess_nanobts.c D src/libbsc/bts_ipaccess_nanobts_omlattr.c D src/libbsc/bts_nokia_site.c D src/libbsc/bts_siemens_bs11.c D src/libbsc/bts_sysmobts.c D src/libbsc/bts_unknown.c D src/libbsc/chan_alloc.c D src/libbsc/e1_config.c D src/libbsc/gsm_04_08_utils.c D src/libbsc/gsm_04_80_utils.c D src/libbsc/handover_decision.c D src/libbsc/handover_logic.c D src/libbsc/meas_proc.c D src/libbsc/meas_rep.c D src/libbsc/net_init.c D src/libbsc/paging.c D src/libbsc/pcu_sock.c D src/libbsc/rest_octets.c D src/libbsc/system_information.c M src/libcommon/common_vty.c D src/libfilter/Makefile.am D src/libfilter/bsc_msg_acc.c D src/libfilter/bsc_msg_filter.c D src/libfilter/bsc_msg_vty.c M src/libmsc/vty_interface_layer3.c D src/libtrau/Makefile.am D src/libtrau/rtp_proxy.c D src/libtrau/trau_mux.c D src/libtrau/trau_upqueue.c M src/libvlr/vlr.c D src/osmo-bsc/Makefile.am D src/osmo-bsc/osmo_bsc_api.c D src/osmo-bsc/osmo_bsc_audio.c D src/osmo-bsc/osmo_bsc_bssap.c D src/osmo-bsc/osmo_bsc_ctrl.c D src/osmo-bsc/osmo_bsc_filter.c D src/osmo-bsc/osmo_bsc_grace.c D src/osmo-bsc/osmo_bsc_main.c D src/osmo-bsc/osmo_bsc_msc.c D src/osmo-bsc/osmo_bsc_reset.c D src/osmo-bsc/osmo_bsc_sigtran.c D src/osmo-bsc/osmo_bsc_vty.c D src/osmo-bsc_nat/Makefile.am D src/osmo-bsc_nat/bsc_filter.c D src/osmo-bsc_nat/bsc_mgcp_utils.c D src/osmo-bsc_nat/bsc_nat.c D src/osmo-bsc_nat/bsc_nat_ctrl.c D src/osmo-bsc_nat/bsc_nat_filter.c D src/osmo-bsc_nat/bsc_nat_rewrite.c D src/osmo-bsc_nat/bsc_nat_rewrite_trie.c D src/osmo-bsc_nat/bsc_nat_utils.c D src/osmo-bsc_nat/bsc_nat_vty.c D src/osmo-bsc_nat/bsc_sccp.c D src/osmo-bsc_nat/bsc_ussd.c M src/osmo-msc/Makefile.am M src/utils/Makefile.am D src/utils/bs11_config.c D src/utils/isdnsync.c M tests/Makefile.am D tests/abis/Makefile.am D tests/abis/abis_test.c D tests/abis/abis_test.ok D tests/bsc-nat-trie/Makefile.am D tests/bsc-nat-trie/bsc_nat_trie_test.c D tests/bsc-nat-trie/bsc_nat_trie_test.ok D tests/bsc-nat-trie/prefixes.csv D tests/bsc-nat/Makefile.am D tests/bsc-nat/barr.cfg D tests/bsc-nat/barr_dup.cfg D tests/bsc-nat/bsc_data.c D tests/bsc-nat/bsc_nat_test.c D tests/bsc-nat/bsc_nat_test.ok D tests/bsc-nat/prefixes.csv D tests/bsc/Makefile.am D tests/bsc/bsc_test.c D tests/bsc/bsc_test.ok D tests/channel/Makefile.am D tests/channel/channel_test.c D tests/channel/channel_test.ok D tests/gbproxy/Makefile.am D tests/gbproxy/gbproxy_test.c D tests/gbproxy/gbproxy_test.ok D tests/gprs/Makefile.am D tests/gprs/gprs_test.c D tests/gprs/gprs_test.ok D tests/gsm0408/Makefile.am D tests/gsm0408/gsm0408_test.c D tests/gsm0408/gsm0408_test.ok D tests/gtphub/Makefile.am D tests/gtphub/gtphub_test.c D tests/gtphub/gtphub_test.ok M tests/msc_vlr/Makefile.am M tests/msc_vlr/msc_vlr_tests.c D tests/nanobts_omlattr/Makefile.am D tests/nanobts_omlattr/nanobts_omlattr_test.c D tests/nanobts_omlattr/nanobts_omlattr_test.ok D tests/oap/Makefile.am D tests/oap/oap_client_test.c D tests/oap/oap_client_test.err D tests/oap/oap_client_test.ok D tests/sgsn/Makefile.am D tests/sgsn/sgsn_test.c D tests/sgsn/sgsn_test.ok D tests/slhc/Makefile.am D tests/slhc/slhc_test.c D tests/slhc/slhc_test.ok M tests/sms_queue/Makefile.am D tests/sndcp_xid/Makefile.am D tests/sndcp_xid/sndcp_xid_test.c D tests/sndcp_xid/sndcp_xid_test.ok D tests/subscr/Makefile.am D tests/subscr/bsc_subscr_test.c D tests/subscr/bsc_subscr_test.err D tests/subscr/bsc_subscr_test.ok M tests/testsuite.at D tests/trau/Makefile.am D tests/trau/trau_test.c D tests/trau/trau_test.ok D tests/v42bis/Makefile.am D tests/v42bis/v42bis_test.c D tests/v42bis/v42bis_test.ok M tests/vty_test_runner.py D tests/xid/Makefile.am D tests/xid/xid_test.c D tests/xid/xid_test.ok D tools/hlrstat.pl 251 files changed, 17 insertions(+), 100,238 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/97/3497/2 -- To view, visit https://gerrit.osmocom.org/3497 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Icf025e5ea8d180613b3114282951c9afa67af9a7 Gerrit-PatchSet: 2 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Aug 23 12:39:29 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 23 Aug 2017 12:39:29 +0000 Subject: [PATCH] osmo-msc[master]: mgcp: hack RAB success from nano3G: patch first RTP payload 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/3349 to look at the new patch set (#7). mgcp: hack RAB success from nano3G: patch first RTP payload The ip.access nano3G needs the first RTP payload's first two bytes to read hex 'e400', or it will reject the RAB assignment. Add flag patched_first_rtp_payload to mgcp_rtp_state to detect the first RTP payload on a stream, and overwrite its first bytes with e400. This should probably be configurable, but seems to not harm other femto cells (as long as we patch only the first RTP payload in each stream). Only do this when sending to the BTS side. Related: OS#2459 Change-Id: I5eff04dcb0936e21690e427ae5e49228cd459bd4 --- M include/openbsc/mgcp_internal.h M src/libmgcp/mgcp_network.c 2 files changed, 14 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/49/3349/7 diff --git a/include/openbsc/mgcp_internal.h b/include/openbsc/mgcp_internal.h index b58eb9b..b2c2408 100644 --- a/include/openbsc/mgcp_internal.h +++ b/include/openbsc/mgcp_internal.h @@ -64,6 +64,7 @@ uint32_t stats_jitter; int32_t stats_transit; int stats_cycles; + bool patched_first_rtp_payload; /* FIXME: drop this, see OS#2459 */ }; struct mgcp_rtp_codec { diff --git a/src/libmgcp/mgcp_network.c b/src/libmgcp/mgcp_network.c index c9fe179..399dc8f 100644 --- a/src/libmgcp/mgcp_network.c +++ b/src/libmgcp/mgcp_network.c @@ -667,6 +667,19 @@ forward_data(rtp_end->rtp.fd, &endp->taps[tap_idx], buf, len); + /* FIXME: HACK HACK HACK. See OS#2459. + * The ip.access nano3G needs the first RTP payload's first two bytes to read hex + * 'e400', or it will reject the RAB assignment. It seems to not harm other femto + * cells (as long as we patch only the first RTP payload in each stream). + */ + if (tap_idx == MGCP_TAP_BTS_OUT + && !rtp_state->patched_first_rtp_payload) { + uint8_t *data = (uint8_t*)&buf[12]; + data[0] = 0xe4; + data[1] = 0x00; + rtp_state->patched_first_rtp_payload = true; + } + rc = mgcp_udp_send(rtp_end->rtp.fd, &rtp_end->addr, rtp_end->rtp_port, buf, len); -- To view, visit https://gerrit.osmocom.org/3349 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I5eff04dcb0936e21690e427ae5e49228cd459bd4 Gerrit-PatchSet: 7 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Aug 23 12:39:29 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 23 Aug 2017 12:39:29 +0000 Subject: [PATCH] osmo-msc[master]: examples: Change IP address of config files 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/3419 to look at the new patch set (#3). examples: Change IP address of config files This helps in providing 3G software packages for the sysmoNITB hardware, which uses 10.23.24.1 for SGSN and 10.23.24.2 for GGSN. However, in order to not break the python tests, the osmo-sgsn.cfg example still uses 127.0.0.1 as local address. Change the GGSN address to 127.0.0.2, because SGSN and GGSN cannot co-exist on the same address (the GTP port number is fixed by spec: no IE to communicate a differing port, so it has to be the standard GTP port for both). Change-Id: Ie3a25f6771ed6e620cb2b315638c622a9a24e530 --- M doc/examples/osmo-bsc_mgcp/mgcp.cfg M doc/examples/osmo-msc/osmo-msc.cfg M doc/examples/osmo-sgsn/osmo-sgsn.cfg 3 files changed, 5 insertions(+), 5 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/19/3419/3 diff --git a/doc/examples/osmo-bsc_mgcp/mgcp.cfg b/doc/examples/osmo-bsc_mgcp/mgcp.cfg index 2622d23..3c43f1f 100644 --- a/doc/examples/osmo-bsc_mgcp/mgcp.cfg +++ b/doc/examples/osmo-bsc_mgcp/mgcp.cfg @@ -7,9 +7,9 @@ no login ! mgcp - !local ip 192.168.0.132 - !bts ip 192.168.0.124 - !bind ip 192.168.0.132 + !local ip 10.23.24.2 + !bts ip 10.24.24.1 + !bind ip 10.23.24.1 bind port 2427 rtp base 4000 rtp force-ptime 20 diff --git a/doc/examples/osmo-msc/osmo-msc.cfg b/doc/examples/osmo-msc/osmo-msc.cfg index 6cb9e4e..1b1d192 100644 --- a/doc/examples/osmo-msc/osmo-msc.cfg +++ b/doc/examples/osmo-msc/osmo-msc.cfg @@ -15,5 +15,5 @@ rrlp mode none mm info 1 msc - mgcpgw remote-ip 192.168.0.132 + mgcpgw remote-ip 10.23.24.1 assign-tmsi diff --git a/doc/examples/osmo-sgsn/osmo-sgsn.cfg b/doc/examples/osmo-sgsn/osmo-sgsn.cfg index 4955983..3f39397 100644 --- a/doc/examples/osmo-sgsn/osmo-sgsn.cfg +++ b/doc/examples/osmo-sgsn/osmo-sgsn.cfg @@ -7,7 +7,7 @@ ! sgsn gtp local-ip 127.0.0.1 - ggsn 0 remote-ip 127.0.0.1 + ggsn 0 remote-ip 127.0.0.2 ggsn 0 gtp-version 1 ! ns -- To view, visit https://gerrit.osmocom.org/3419 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ie3a25f6771ed6e620cb2b315638c622a9a24e530 Gerrit-PatchSet: 3 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: daniel From gerrit-no-reply at lists.osmocom.org Wed Aug 23 12:39:29 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 23 Aug 2017 12:39:29 +0000 Subject: [PATCH] osmo-msc[master]: Implement AoIP, port to M3UA SIGTRAN (large addition and ref... In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3486 to look at the new patch set (#2). Implement AoIP, port to M3UA SIGTRAN (large addition and refactoring) This was originally a long series of commits converging to the final result seen in this patch. It does not make much sense to review the smaller steps' trial and error, we need to review this entire change as a whole. Implement AoIP in osmo-msc and osmo-bsc. Change over to the new libosmo-sigtran API with support for proper SCCP/M3UA/SCTP stacking, as mandated by 3GPP specifications for the IuCS and IuPS interfaces. >From here on, a separate osmo-stp process is required for SCCP routing between OsmoBSC / OsmoHNBGW <-> OsmoMSC / OsmoSGSN jenkins.sh: build from libosmo-sccp and osmo-iuh master branches now for new M3UA SIGTRAN. Patch-by: pmaier, nhofmeyr, laforge Change-Id: I5ae4e05ee7c57cad341ea5e86af37c1f6b0ffa77 --- M configure.ac M contrib/jenkins.sh M doc/examples/osmo-bsc/osmo-bsc.cfg M include/openbsc/Makefile.am A include/openbsc/a_iface.h A include/openbsc/a_iface_bssap.h A include/openbsc/a_reset.h M include/openbsc/bsc_msc.h M include/openbsc/bsc_msc_data.h M include/openbsc/debug.h M include/openbsc/gsm_04_08.h M include/openbsc/gsm_data.h M include/openbsc/gsm_data_shared.h M include/openbsc/iu.h M include/openbsc/mgcpgw_client.h M include/openbsc/msc_ifaces.h M include/openbsc/osmo_bsc.h A include/openbsc/osmo_bsc_reset.h A include/openbsc/osmo_bsc_sigtran.h M include/openbsc/osmo_msc.h M include/openbsc/transaction.h M src/gprs/Makefile.am M src/gprs/sgsn_main.c M src/libbsc/abis_rsl.c M src/libcommon-cs/Makefile.am A src/libcommon-cs/a_reset.c M src/libcommon-cs/common_cs.c M src/libcommon/common_vty.c M src/libcommon/debug.c M src/libiu/iu.c M src/libiu/iu_vty.c M src/libmgcp/mgcp_protocol.c M src/libmgcp/mgcpgw_client.c M src/libmgcp/mgcpgw_client_vty.c M src/libmsc/Makefile.am M src/libmsc/a_iface.c A src/libmsc/a_iface_bssap.c M src/libmsc/gsm_04_08.c M src/libmsc/gsm_subscriber.c M src/libmsc/iucs.c M src/libmsc/msc_ifaces.c M src/libmsc/msc_vty.c M src/libmsc/osmo_msc.c M src/libmsc/subscr_conn.c M src/osmo-bsc/Makefile.am M src/osmo-bsc/osmo_bsc_api.c M src/osmo-bsc/osmo_bsc_audio.c M src/osmo-bsc/osmo_bsc_bssap.c M src/osmo-bsc/osmo_bsc_main.c M src/osmo-bsc/osmo_bsc_msc.c A src/osmo-bsc/osmo_bsc_reset.c D src/osmo-bsc/osmo_bsc_sccp.c A src/osmo-bsc/osmo_bsc_sigtran.c M src/osmo-bsc/osmo_bsc_vty.c M src/osmo-bsc_mgcp/Makefile.am M src/osmo-bsc_nat/Makefile.am M src/osmo-msc/msc_main.c M tests/msc_vlr/Makefile.am M tests/msc_vlr/msc_vlr_test_gsm_authen.c M tests/msc_vlr/msc_vlr_test_gsm_authen.err M tests/msc_vlr/msc_vlr_test_gsm_ciph.c M tests/msc_vlr/msc_vlr_test_gsm_ciph.err M tests/msc_vlr/msc_vlr_test_hlr_reject.c M tests/msc_vlr/msc_vlr_test_hlr_reject.err M tests/msc_vlr/msc_vlr_test_hlr_timeout.c M tests/msc_vlr/msc_vlr_test_hlr_timeout.err M tests/msc_vlr/msc_vlr_test_ms_timeout.c M tests/msc_vlr/msc_vlr_test_ms_timeout.err M tests/msc_vlr/msc_vlr_test_no_authen.c M tests/msc_vlr/msc_vlr_test_no_authen.err M tests/msc_vlr/msc_vlr_test_reject_concurrency.c M tests/msc_vlr/msc_vlr_test_reject_concurrency.err M tests/msc_vlr/msc_vlr_test_rest.c M tests/msc_vlr/msc_vlr_test_rest.err M tests/msc_vlr/msc_vlr_test_umts_authen.c M tests/msc_vlr/msc_vlr_test_umts_authen.err M tests/msc_vlr/msc_vlr_tests.c M tests/msc_vlr/msc_vlr_tests.h 78 files changed, 4,387 insertions(+), 713 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/86/3486/2 -- To view, visit https://gerrit.osmocom.org/3486 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I5ae4e05ee7c57cad341ea5e86af37c1f6b0ffa77 Gerrit-PatchSet: 2 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: dexter From gerrit-no-reply at lists.osmocom.org Wed Aug 23 12:39:29 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 23 Aug 2017 12:39:29 +0000 Subject: [PATCH] osmo-msc[master]: mgcp: add VTY Option to force-realloc endpoints In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3487 to look at the new patch set (#2). mgcp: add VTY Option to force-realloc endpoints Currently the force_realloc feature is turnd on and of in a hardcoded way. This patch makes the option available via VTY. Change-Id: Ic8740512c5ea0766ff6ceb1c28b9c2b3fe46e75f --- M src/libmgcp/mgcp_vty.c M src/osmo-bsc_mgcp/mgcp_main.c M src/osmo-bsc_nat/bsc_mgcp_utils.c M src/osmo-bsc_nat/bsc_nat.c 4 files changed, 18 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/87/3487/2 diff --git a/src/libmgcp/mgcp_vty.c b/src/libmgcp/mgcp_vty.c index 7d4b2da..51889d9 100644 --- a/src/libmgcp/mgcp_vty.c +++ b/src/libmgcp/mgcp_vty.c @@ -591,6 +591,16 @@ return CMD_SUCCESS; } +DEFUN(cfg_mgcp_force_realloc, + cfg_mgcp_force_realloc_cmd, + "force-realloc (0|1)", + "Force endpoint reallocation when the endpoint is still seized\n" + "Don't force reallocation\n" "force reallocation\n") +{ + g_cfg->trunk.force_realloc = atoi(argv[0]); + return CMD_SUCCESS; +} + DEFUN(cfg_mgcp_number_endp, cfg_mgcp_number_endp_cmd, "number endpoints <0-65534>", @@ -803,9 +813,10 @@ trunk->keepalive_interval, VTY_NEWLINE); else vty_out(vty, " no rtp keep-alive%s", VTY_NEWLINE); - vty_out(vty, " loop %d%s", trunk->audio_loop, VTY_NEWLINE); + vty_out(vty, " force-realloc %d%s", + trunk->force_realloc, VTY_NEWLINE); if (trunk->omit_rtcp) vty_out(vty, " rtcp-omit%s", VTY_NEWLINE); else @@ -1379,6 +1390,7 @@ install_element(MGCP_NODE, &cfg_mgcp_sdp_payload_number_cmd_old); install_element(MGCP_NODE, &cfg_mgcp_sdp_payload_name_cmd_old); install_element(MGCP_NODE, &cfg_mgcp_loop_cmd); + install_element(MGCP_NODE, &cfg_mgcp_force_realloc_cmd); install_element(MGCP_NODE, &cfg_mgcp_number_endp_cmd); install_element(MGCP_NODE, &cfg_mgcp_omit_rtcp_cmd); install_element(MGCP_NODE, &cfg_mgcp_no_omit_rtcp_cmd); diff --git a/src/osmo-bsc_mgcp/mgcp_main.c b/src/osmo-bsc_mgcp/mgcp_main.c index 4ea0700..6cf9ab7 100644 --- a/src/osmo-bsc_mgcp/mgcp_main.c +++ b/src/osmo-bsc_mgcp/mgcp_main.c @@ -218,6 +218,8 @@ cfg->get_net_downlink_format_cb = &mgcp_transcoding_net_downlink_format; #endif + cfg->trunk.force_realloc = 1; + vty_info.copyright = openbsc_copyright; vty_init(&vty_info); logging_vty_add_cmds(NULL); diff --git a/src/osmo-bsc_nat/bsc_mgcp_utils.c b/src/osmo-bsc_nat/bsc_mgcp_utils.c index 4884786..7df362f 100644 --- a/src/osmo-bsc_nat/bsc_mgcp_utils.c +++ b/src/osmo-bsc_nat/bsc_mgcp_utils.c @@ -1101,7 +1101,6 @@ /* some more MGCP config handling */ cfg->data = nat; cfg->policy_cb = bsc_mgcp_policy_cb; - cfg->trunk.force_realloc = 1; if (cfg->bts_ip) talloc_free(cfg->bts_ip); diff --git a/src/osmo-bsc_nat/bsc_nat.c b/src/osmo-bsc_nat/bsc_nat.c index daa066d..401288d 100644 --- a/src/osmo-bsc_nat/bsc_nat.c +++ b/src/osmo-bsc_nat/bsc_nat.c @@ -1628,6 +1628,9 @@ rate_ctr_init(tall_bsc_ctx); osmo_stats_init(tall_bsc_ctx); + /* Ensure that forced enpoint allocation is turned on by default */ + nat->mgcp_cfg->trunk.force_realloc = 1; + /* init vty and parse */ if (mgcp_parse_config(config_file, nat->mgcp_cfg, MGCP_BSC_NAT) < 0) { fprintf(stderr, "Failed to parse the config file: '%s'\n", config_file); -- To view, visit https://gerrit.osmocom.org/3487 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ic8740512c5ea0766ff6ceb1c28b9c2b3fe46e75f Gerrit-PatchSet: 2 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: dexter From gerrit-no-reply at lists.osmocom.org Wed Aug 23 12:39:31 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 23 Aug 2017 12:39:31 +0000 Subject: [PATCH] osmo-msc[master]: build: check for -lgsm Message-ID: Review at https://gerrit.osmocom.org/3587 build: check for -lgsm If libosmo-legacy-mgcp is built with --enable-mgcp-transcoding, we need to link -lgsm here as well. This autodetects whether -lgsm is necessary. Todo: how about --with-g729? Todo: osmo-msc is only using the mgcp client and should not actually need transcoding nor -lgsm. Change-Id: Iab55a089ae36017b79e7cbc3cac45ef9fd85dd43 --- M configure.ac 1 file changed, 27 insertions(+), 11 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/87/3587/1 diff --git a/configure.ac b/configure.ac index a1d614c..7fccbde 100644 --- a/configure.ac +++ b/configure.ac @@ -60,17 +60,6 @@ [osmo_ac_mgcp_transcoding="$enableval"],[osmo_ac_mgcp_transcoding="no"]) AC_ARG_WITH([g729], [AS_HELP_STRING([--with-g729], [Enable G.729 encoding/decoding.])], [osmo_ac_with_g729="$withval"],[osmo_ac_with_g729="no"]) -if test "$osmo_ac_mgcp_transcoding" = "yes" ; then - AC_SEARCH_LIBS([gsm_create], [gsm], [LIBRARY_GSM="$LIBS";LIBS=""], [AC_MSG_ERROR([--enable-mgcp-transcoding: cannot find usable libgsm])]) - AC_SUBST(LIBRARY_GSM) - if test "$osmo_ac_with_g729" = "yes" ; then - PKG_CHECK_MODULES(LIBBCG729, libbcg729 >= 0.1, [AC_DEFINE([HAVE_BCG729], [1], [Use bgc729 decoder/encoder])]) - fi - AC_DEFINE(BUILD_MGCP_TRANSCODING, 1, [Define if we want to build the MGCP gateway with transcoding support]) -fi -AM_CONDITIONAL(BUILD_MGCP_TRANSCODING, test "x$osmo_ac_mgcp_transcoding" = "xyes") -AC_SUBST(osmo_ac_mgcp_transcoding) - # Enable/disable 3G aka IuPS + IuCS support? AC_ARG_ENABLE([iu], [AS_HELP_STRING([--enable-iu], [Build 3G support, aka IuPS and IuCS interfaces])], [osmo_ac_iu="$enableval"],[osmo_ac_iu="no"]) @@ -134,6 +123,33 @@ AC_SUBST([COVERAGE_LDFLAGS]) fi +AC_DEFUN([CHECK_LIBOSMO_LEGACY_MGCP_NEEDS_LIBGSM], [ + AC_CACHE_CHECK( + [whether libosmo-legacy-mgcp needs -lgsm], + libosmo_cv_legacy_mgcp_needs_libgsm, [ + SAVE_LDFLAGS="${LDFLAGS}" + LDFLAGS="${LIBOSMOLEGACYMGCP_LIBS} ${LIBOSMOVTY_LIBS}" + AC_LINK_IFELSE( + [AC_LANG_PROGRAM([ + #include + ], [ + mgcpgw_client_init(0, 0); + ])], + [libosmo_cv_legacy_mgcp_needs_libgsm=no], + [libosmo_cv_legacy_mgcp_needs_libgsm=yes]) + LDFLAGS="${SAVE_LDFLAGS}" + ]) + ]) +CHECK_LIBOSMO_LEGACY_MGCP_NEEDS_LIBGSM +if test "x$libosmo_cv_legacy_mgcp_needs_libgsm" = xyes; then + AC_SEARCH_LIBS([gsm_create], [gsm], [LIBRARY_GSM="$LIBS";LIBS=""], + [AC_MSG_ERROR([libosmo-legacy-mgcp is built with transcoding and needs -lgsm but cannot find usable libgsm])]) + AC_SUBST(LIBRARY_GSM) + if test "$osmo_ac_with_g729" = "yes" ; then + PKG_CHECK_MODULES(LIBBCG729, libbcg729 >= 0.1, [AC_DEFINE([HAVE_BCG729], [1], [Use bgc729 decoder/encoder])]) + fi +fi + AC_DEFUN([CHECK_TM_INCLUDES_TM_GMTOFF], [ AC_CACHE_CHECK( [whether struct tm has tm_gmtoff member], -- To view, visit https://gerrit.osmocom.org/3587 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Iab55a089ae36017b79e7cbc3cac45ef9fd85dd43 Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Wed Aug 23 12:54:25 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Wed, 23 Aug 2017 12:54:25 +0000 Subject: [PATCH] osmo-gsm-tester[master]: bts_osmotrx: Support configuring bts addr, trx_remote_ip and... In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3578 to look at the new patch set (#3). bts_osmotrx: Support configuring bts addr, trx_remote_ip and launch_trx We may want to support running a device which runs its own TRX (osmo-trx or different implementation). Furthermore, this TRX may be available in some specific hwardare rather than on the main unit. This makes it easy to configure OsmoBtsTrx to launch it's own osmo-trx or not. In case it is launched, all IPs are configured correctly to ensure connection can be established. Before this commit, osmo-trx was binding to 127.0.0.1. Now we can support multiple osmo-trx being launched on the main unit. Change-Id: I825ed1fc0c3fe75d196db90c1508283fbd04acf8 --- M example/resources.conf M src/osmo_gsm_tester/bts_osmotrx.py M src/osmo_gsm_tester/config.py M src/osmo_gsm_tester/resource.py M src/osmo_gsm_tester/schema.py M src/osmo_gsm_tester/templates/osmo-bts-trx.cfg.tmpl M src/osmo_gsm_tester/util.py 7 files changed, 49 insertions(+), 11 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-tester refs/changes/78/3578/3 diff --git a/example/resources.conf b/example/resources.conf index 0260815..a09e80a 100644 --- a/example/resources.conf +++ b/example/resources.conf @@ -17,8 +17,16 @@ - label: Ettus B210 type: osmo-bts-trx ipa_unit_id: 6 - addr: 10.42.42.116 + addr: 10.42.42.50 band: GSM-1800 + launch_trx: true + +- label: sysmoCell 5000 + type: osmo-bts-trx + ipa_unit_id: 7 + addr: 10.42.42.51 + band: GSM-1800 + trx_remote_ip: 10.42.42.112 arfcn: - arfcn: 512 diff --git a/src/osmo_gsm_tester/bts_osmotrx.py b/src/osmo_gsm_tester/bts_osmotrx.py index 9795a58..b5262a2 100644 --- a/src/osmo_gsm_tester/bts_osmotrx.py +++ b/src/osmo_gsm_tester/bts_osmotrx.py @@ -41,8 +41,17 @@ self.env = {} def remote_addr(self): - # FIXME - return '127.0.0.1' + return self.conf.get('addr') + + def trx_remote_ip(self): + conf_ip = self.conf.get('trx_remote_ip', None) + if conf_ip is not None: + return conf_ip + # if 'trx_remote_ip' is not configured, use same IP as BTS + return self.remote_addr() + + def launch_trx_enabled(self): + return util.str2bool(self.conf.get('launch_trx')) def start(self): if self.bsc is None: @@ -53,10 +62,11 @@ self.run_dir = util.Dir(self.suite_run.get_test_run_dir().new_dir(self.name())) self.configure() - self.trx = OsmoTrx(self.suite_run) - self.trx.start() - self.log('Waiting for osmo-trx to start up...') - event_loop.wait(self, self.trx.trx_ready) + if self.launch_trx_enabled(): + self.trx = OsmoTrx(self.suite_run, self.trx_remote_ip(), self.remote_addr()) + self.trx.start() + self.log('Waiting for osmo-trx to start up...') + event_loop.wait(self, self.trx.trx_ready) self.inst = util.Dir(os.path.abspath(self.suite_run.trial.get_inst(OsmoBtsTrx.BIN_BTS_TRX))) lib = self.inst.child('lib') @@ -93,6 +103,8 @@ config.overlay(values, { 'osmo_bts_trx': { 'oml_remote_ip': self.bsc.addr(), + 'trx_local_ip': self.remote_addr(), + 'trx_remote_ip': self.trx_remote_ip(), 'pcu_socket_path': os.path.join(str(self.run_dir), 'pcu_bts') } }) @@ -124,17 +136,19 @@ BIN_TRX = 'osmo-trx' - def __init__(self, suite_run): + def __init__(self, suite_run, listen_ip, bts_ip): super().__init__(log.C_RUN, OsmoTrx.BIN_TRX) self.suite_run = suite_run self.env = {} + self.listen_ip = listen_ip + self.bts_ip = bts_ip def start(self): self.run_dir = util.Dir(self.suite_run.get_test_run_dir().new_dir(self.name())) self.inst = util.Dir(os.path.abspath(self.suite_run.trial.get_inst(OsmoTrx.BIN_TRX))) lib = self.inst.child('lib') self.env = { 'LD_LIBRARY_PATH': util.prepend_library_path(lib) } - self.proc_trx = self.launch_process(OsmoTrx.BIN_TRX, '-x') + self.proc_trx = self.launch_process(OsmoTrx.BIN_TRX, '-x', '-j', self.listen_ip, '-i', self.bts_ip) def launch_process(self, binary_name, *args): binary = os.path.abspath(self.inst.child('bin', binary_name)) diff --git a/src/osmo_gsm_tester/config.py b/src/osmo_gsm_tester/config.py index 20ae83e..f6e81ac 100644 --- a/src/osmo_gsm_tester/config.py +++ b/src/osmo_gsm_tester/config.py @@ -271,5 +271,4 @@ dest[i] = overlay(dest[i], src[i]) return dest return src - # vim: expandtab tabstop=4 shiftwidth=4 diff --git a/src/osmo_gsm_tester/resource.py b/src/osmo_gsm_tester/resource.py index 8eec71e..9470f48 100644 --- a/src/osmo_gsm_tester/resource.py +++ b/src/osmo_gsm_tester/resource.py @@ -54,6 +54,8 @@ 'bts[].ipa_unit_id': schema.INT, 'bts[].addr': schema.IPV4, 'bts[].band': schema.BAND, + 'bts[].trx_remote_ip': schema.IPV4, + 'bts[].launch_trx': schema.BOOL_STR, 'bts[].trx_list[].hw_addr': schema.HWADDR, 'bts[].trx_list[].net_device': schema.STR, 'arfcn[].arfcn': schema.INT, diff --git a/src/osmo_gsm_tester/schema.py b/src/osmo_gsm_tester/schema.py index d652aa7..4c9b9cd 100644 --- a/src/osmo_gsm_tester/schema.py +++ b/src/osmo_gsm_tester/schema.py @@ -20,7 +20,7 @@ import re from . import log -from .util import is_dict, is_list +from .util import is_dict, is_list, str2bool KEY_RE = re.compile('[a-zA-Z][a-zA-Z0-9_]*') IPV4_RE = re.compile('([0-9]{1,3}.){3}[0-9]{1,3}') @@ -63,21 +63,25 @@ INT = 'int' STR = 'str' +BOOL_STR = 'bool_str' BAND = 'band' IPV4 = 'ipv4' HWADDR = 'hwaddr' IMSI = 'imsi' KI = 'ki' MSISDN = 'msisdn' +TRX_REMOTE_IP = 'trx_remote_ip' SCHEMA_TYPES = { INT: int, STR: str, + BOOL_STR: str2bool, BAND: band, IPV4: ipv4, HWADDR: hwaddr, IMSI: imsi, KI: ki, MSISDN: msisdn, + TRX_REMOTE_IP: ipv4, } def validate(config, schema): diff --git a/src/osmo_gsm_tester/templates/osmo-bts-trx.cfg.tmpl b/src/osmo_gsm_tester/templates/osmo-bts-trx.cfg.tmpl index ddfd483..950c03e 100644 --- a/src/osmo_gsm_tester/templates/osmo-bts-trx.cfg.tmpl +++ b/src/osmo_gsm_tester/templates/osmo-bts-trx.cfg.tmpl @@ -17,6 +17,8 @@ instance 0 osmotrx rx-gain 25 osmotrx tx-attenuation oml + osmotrx ip local ${osmo_bts_trx.trx_local_ip} + osmotrx ip remote ${osmo_bts_trx.trx_remote_ip} bts 0 band ${osmo_bts_trx.band} ipa unit-id ${osmo_bts_trx.ipa_unit_id} 0 diff --git a/src/osmo_gsm_tester/util.py b/src/osmo_gsm_tester/util.py index 602ae45..af6a2f0 100644 --- a/src/osmo_gsm_tester/util.py +++ b/src/osmo_gsm_tester/util.py @@ -305,4 +305,13 @@ input_thread.join() return input_thread.result +def str2bool(val): + if val is None or not val: + return False + if val.upper() in ['FALSE', 'NO', 'OFF']: + return False + if val.upper() in ['TRUE','YES', 'ON']: + return True + raise ValueError('Invalid BOOL field: %r' % val) + # vim: expandtab tabstop=4 shiftwidth=4 -- To view, visit https://gerrit.osmocom.org/3578 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I825ed1fc0c3fe75d196db90c1508283fbd04acf8 Gerrit-PatchSet: 3 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Wed Aug 23 12:54:26 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Wed, 23 Aug 2017 12:54:26 +0000 Subject: [PATCH] osmo-gsm-tester[master]: Add scenarios for each osmo-bts-trx type Message-ID: Review at https://gerrit.osmocom.org/3588 Add scenarios for each osmo-bts-trx type This way we can run tests with a specific instance of an osmo-bts-trx, for instance we may want to run some tests with an Ettus B200 and also with a sysmoCell 5000. Change-Id: I5fd78d79b8bfab8ccacc4666563b66b6da9f2bde --- M example/default-suites.conf M example/resources.conf A example/scenarios/trx-b200.conf A example/scenarios/trx-sysmocell5000.conf 4 files changed, 11 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-tester refs/changes/88/3588/1 diff --git a/example/default-suites.conf b/example/default-suites.conf index eba7dea..72a90db 100644 --- a/example/default-suites.conf +++ b/example/default-suites.conf @@ -1,6 +1,6 @@ - sms:sysmo - aoip_sms:sysmo -- sms:trx -- aoip_sms:trx +- sms:trx-b200 +- aoip_sms:trx-b200 - smpp - aoip_smpp diff --git a/example/resources.conf b/example/resources.conf index a09e80a..2f08c93 100644 --- a/example/resources.conf +++ b/example/resources.conf @@ -14,7 +14,7 @@ addr: 10.42.42.114 band: GSM-1800 -- label: Ettus B210 +- label: Ettus B200 type: osmo-bts-trx ipa_unit_id: 6 addr: 10.42.42.50 diff --git a/example/scenarios/trx-b200.conf b/example/scenarios/trx-b200.conf new file mode 100644 index 0000000..2bad7e8 --- /dev/null +++ b/example/scenarios/trx-b200.conf @@ -0,0 +1,4 @@ +resources: + bts: + - label: Ettus B200 + type: osmo-bts-trx diff --git a/example/scenarios/trx-sysmocell5000.conf b/example/scenarios/trx-sysmocell5000.conf new file mode 100644 index 0000000..62e9a3c --- /dev/null +++ b/example/scenarios/trx-sysmocell5000.conf @@ -0,0 +1,4 @@ +resources: + bts: + - label: sysmoCell 5000 + type: osmo-bts-trx -- To view, visit https://gerrit.osmocom.org/3588 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I5fd78d79b8bfab8ccacc4666563b66b6da9f2bde Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Wed Aug 23 12:55:29 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Wed, 23 Aug 2017 12:55:29 +0000 Subject: osmo-gsm-tester[master]: Allow tests to select network encryption In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3582 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I273eee44c095690d0c2e3994befa97edc42496ac Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Aug 23 12:55:30 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Wed, 23 Aug 2017 12:55:30 +0000 Subject: [MERGED] osmo-gsm-tester[master]: Allow tests to select network encryption In-Reply-To: References: Message-ID: Pau Espin Pedrol has submitted this change and it was merged. Change subject: Allow tests to select network encryption ...................................................................... Allow tests to select network encryption Change-Id: I273eee44c095690d0c2e3994befa97edc42496ac --- M src/osmo_gsm_tester/osmo_msc.py M src/osmo_gsm_tester/osmo_nitb.py 2 files changed, 18 insertions(+), 0 deletions(-) Approvals: Pau Espin Pedrol: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/osmo_gsm_tester/osmo_msc.py b/src/osmo_gsm_tester/osmo_msc.py index 2c9b1e3..92a9d61 100644 --- a/src/osmo_gsm_tester/osmo_msc.py +++ b/src/osmo_gsm_tester/osmo_msc.py @@ -31,6 +31,7 @@ hlr = None config = None smsc = None + encryption = None def __init__(self, suite_run, hlr, mgcpgw, ip_address): super().__init__(log.C_RUN, 'osmo-msc_%s' % ip_address.get('addr')) @@ -76,6 +77,11 @@ config.overlay(values, self.mgcpgw.conf_for_msc()) config.overlay(values, self.hlr.conf_for_msc()) config.overlay(values, self.smsc.get_config()) + + # runtime parameters: + if self.encryption is not None: + config.overlay(values, dict(msc=dict(net=dict(encryption=self.encryption)))) + self.config = values self.dbg('MSC CONFIG:\n' + pprint.pformat(values)) @@ -88,6 +94,9 @@ def addr(self): return self.ip_address.get('addr') + def set_encryption(self, val): + self.encryption = val + def mcc(self): return self.config['msc']['net']['mcc'] diff --git a/src/osmo_gsm_tester/osmo_nitb.py b/src/osmo_gsm_tester/osmo_nitb.py index 3ef5276..9c15fe6 100644 --- a/src/osmo_gsm_tester/osmo_nitb.py +++ b/src/osmo_gsm_tester/osmo_nitb.py @@ -31,6 +31,7 @@ process = None bts = None smsc = None + encryption = None def __init__(self, suite_run, ip_address): super().__init__(log.C_RUN, 'osmo-nitb_%s' % ip_address.get('addr')) @@ -78,6 +79,11 @@ bts_list.append(bts.conf_for_bsc()) config.overlay(values, dict(nitb=dict(net=dict(bts_list=bts_list)))) config.overlay(values, self.smsc.get_config()) + + # runtime parameters: + if self.encryption is not None: + config.overlay(values, dict(nitb=dict(net=dict(encryption=self.encryption)))) + self.config = values self.dbg('NITB CONFIG:\n' + pprint.pformat(values)) @@ -94,6 +100,9 @@ self.bts.append(bts) bts.set_bsc(self) + def set_encryption(self, val): + self.encryption = val + def mcc(self): return self.config['nitb']['net']['mcc'] -- To view, visit https://gerrit.osmocom.org/3582 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I273eee44c095690d0c2e3994befa97edc42496ac Gerrit-PatchSet: 2 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Wed Aug 23 12:55:40 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Wed, 23 Aug 2017 12:55:40 +0000 Subject: osmo-gsm-tester[master]: modem: Allow tests to change KI In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3583 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I40cfed6f6b9239eea2b97ffa010b98c78f0cb9cb Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Aug 23 12:55:43 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Wed, 23 Aug 2017 12:55:43 +0000 Subject: [MERGED] osmo-gsm-tester[master]: modem: Allow tests to change KI In-Reply-To: References: Message-ID: Pau Espin Pedrol has submitted this change and it was merged. Change subject: modem: Allow tests to change KI ...................................................................... modem: Allow tests to change KI This is useful for tests that wants to fake a bad KI to test if auth and encryption are working correctly. Change-Id: I40cfed6f6b9239eea2b97ffa010b98c78f0cb9cb --- M src/osmo_gsm_tester/ofono_client.py 1 file changed, 6 insertions(+), 0 deletions(-) Approvals: Pau Espin Pedrol: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/osmo_gsm_tester/ofono_client.py b/src/osmo_gsm_tester/ofono_client.py index 60f98df..00cfd47 100644 --- a/src/osmo_gsm_tester/ofono_client.py +++ b/src/osmo_gsm_tester/ofono_client.py @@ -318,6 +318,7 @@ 'convenience for ofono Modem interaction' msisdn = None sms_received_list = None + _ki = None def __init__(self, conf): self.conf = conf @@ -394,7 +395,12 @@ raise log.Error('No IMSI') return imsi + def set_ki(self, ki): + self._ki = ki + def ki(self): + if self._ki is not None: + return self._ki return self.conf.get('ki') def _on_netreg_property_changed(self, name, value): -- To view, visit https://gerrit.osmocom.org/3583 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I40cfed6f6b9239eea2b97ffa010b98c78f0cb9cb Gerrit-PatchSet: 2 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Wed Aug 23 12:56:06 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Wed, 23 Aug 2017 12:56:06 +0000 Subject: osmo-gsm-tester[master]: Add scenarios for each osmo-bts-trx type In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3588 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I5fd78d79b8bfab8ccacc4666563b66b6da9f2bde Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Aug 23 12:56:08 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 23 Aug 2017 12:56:08 +0000 Subject: [ABANDON] osmo-msc[master]: vlr: set require IMEI by default In-Reply-To: References: Message-ID: Neels Hofmeyr has abandoned this change. Change subject: vlr: set require IMEI by default ...................................................................... Abandoned OsmoNITB used to require the IMEI by default. The only reason though was that we wanted to see what phones and versions were present at a particular hacking event. Given that IMEI requirement is / should / will be configurable, there is no reason to set IMEI as required by default. -- To view, visit https://gerrit.osmocom.org/3495 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: abandon Gerrit-Change-Id: I91d8f3e79cdaa206f8cd32b42bd7c23933f9631a Gerrit-PatchSet: 2 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Aug 23 12:56:24 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Wed, 23 Aug 2017 12:56:24 +0000 Subject: osmo-gsm-tester[master]: bts_osmotrx: Support configuring bts addr, trx_remote_ip and... In-Reply-To: References: Message-ID: Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3578 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I825ed1fc0c3fe75d196db90c1508283fbd04acf8 Gerrit-PatchSet: 3 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Aug 23 12:56:35 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Wed, 23 Aug 2017 12:56:35 +0000 Subject: osmo-gsm-tester[master]: resources.conf: Remove empty line In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3577 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I821bff68ce3a4a81a9deb79e6302bd7c341a8255 Gerrit-PatchSet: 2 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Aug 23 12:56:40 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Wed, 23 Aug 2017 12:56:40 +0000 Subject: [MERGED] osmo-gsm-tester[master]: resources.conf: Remove empty line In-Reply-To: References: Message-ID: Pau Espin Pedrol has submitted this change and it was merged. Change subject: resources.conf: Remove empty line ...................................................................... resources.conf: Remove empty line Change-Id: I821bff68ce3a4a81a9deb79e6302bd7c341a8255 --- M example/resources.conf 1 file changed, 0 insertions(+), 1 deletion(-) Approvals: Pau Espin Pedrol: Looks good to me, approved Jenkins Builder: Verified diff --git a/example/resources.conf b/example/resources.conf index 0b6da0a..0260815 100644 --- a/example/resources.conf +++ b/example/resources.conf @@ -31,7 +31,6 @@ band: GSM-1800 - arfcn: 520 band: GSM-1800 - - arfcn: 540 band: GSM-1900 - arfcn: 542 -- To view, visit https://gerrit.osmocom.org/3577 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I821bff68ce3a4a81a9deb79e6302bd7c341a8255 Gerrit-PatchSet: 3 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Wed Aug 23 12:56:40 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Wed, 23 Aug 2017 12:56:40 +0000 Subject: [MERGED] osmo-gsm-tester[master]: bts_osmotrx: Support configuring bts addr, trx_remote_ip and... In-Reply-To: References: Message-ID: Pau Espin Pedrol has submitted this change and it was merged. Change subject: bts_osmotrx: Support configuring bts addr, trx_remote_ip and launch_trx ...................................................................... bts_osmotrx: Support configuring bts addr, trx_remote_ip and launch_trx We may want to support running a device which runs its own TRX (osmo-trx or different implementation). Furthermore, this TRX may be available in some specific hwardare rather than on the main unit. This makes it easy to configure OsmoBtsTrx to launch it's own osmo-trx or not. In case it is launched, all IPs are configured correctly to ensure connection can be established. Before this commit, osmo-trx was binding to 127.0.0.1. Now we can support multiple osmo-trx being launched on the main unit. Change-Id: I825ed1fc0c3fe75d196db90c1508283fbd04acf8 --- M example/resources.conf M src/osmo_gsm_tester/bts_osmotrx.py M src/osmo_gsm_tester/config.py M src/osmo_gsm_tester/resource.py M src/osmo_gsm_tester/schema.py M src/osmo_gsm_tester/templates/osmo-bts-trx.cfg.tmpl M src/osmo_gsm_tester/util.py 7 files changed, 49 insertions(+), 11 deletions(-) Approvals: Pau Espin Pedrol: Looks good to me, approved Jenkins Builder: Verified diff --git a/example/resources.conf b/example/resources.conf index 0260815..a09e80a 100644 --- a/example/resources.conf +++ b/example/resources.conf @@ -17,8 +17,16 @@ - label: Ettus B210 type: osmo-bts-trx ipa_unit_id: 6 - addr: 10.42.42.116 + addr: 10.42.42.50 band: GSM-1800 + launch_trx: true + +- label: sysmoCell 5000 + type: osmo-bts-trx + ipa_unit_id: 7 + addr: 10.42.42.51 + band: GSM-1800 + trx_remote_ip: 10.42.42.112 arfcn: - arfcn: 512 diff --git a/src/osmo_gsm_tester/bts_osmotrx.py b/src/osmo_gsm_tester/bts_osmotrx.py index 9795a58..b5262a2 100644 --- a/src/osmo_gsm_tester/bts_osmotrx.py +++ b/src/osmo_gsm_tester/bts_osmotrx.py @@ -41,8 +41,17 @@ self.env = {} def remote_addr(self): - # FIXME - return '127.0.0.1' + return self.conf.get('addr') + + def trx_remote_ip(self): + conf_ip = self.conf.get('trx_remote_ip', None) + if conf_ip is not None: + return conf_ip + # if 'trx_remote_ip' is not configured, use same IP as BTS + return self.remote_addr() + + def launch_trx_enabled(self): + return util.str2bool(self.conf.get('launch_trx')) def start(self): if self.bsc is None: @@ -53,10 +62,11 @@ self.run_dir = util.Dir(self.suite_run.get_test_run_dir().new_dir(self.name())) self.configure() - self.trx = OsmoTrx(self.suite_run) - self.trx.start() - self.log('Waiting for osmo-trx to start up...') - event_loop.wait(self, self.trx.trx_ready) + if self.launch_trx_enabled(): + self.trx = OsmoTrx(self.suite_run, self.trx_remote_ip(), self.remote_addr()) + self.trx.start() + self.log('Waiting for osmo-trx to start up...') + event_loop.wait(self, self.trx.trx_ready) self.inst = util.Dir(os.path.abspath(self.suite_run.trial.get_inst(OsmoBtsTrx.BIN_BTS_TRX))) lib = self.inst.child('lib') @@ -93,6 +103,8 @@ config.overlay(values, { 'osmo_bts_trx': { 'oml_remote_ip': self.bsc.addr(), + 'trx_local_ip': self.remote_addr(), + 'trx_remote_ip': self.trx_remote_ip(), 'pcu_socket_path': os.path.join(str(self.run_dir), 'pcu_bts') } }) @@ -124,17 +136,19 @@ BIN_TRX = 'osmo-trx' - def __init__(self, suite_run): + def __init__(self, suite_run, listen_ip, bts_ip): super().__init__(log.C_RUN, OsmoTrx.BIN_TRX) self.suite_run = suite_run self.env = {} + self.listen_ip = listen_ip + self.bts_ip = bts_ip def start(self): self.run_dir = util.Dir(self.suite_run.get_test_run_dir().new_dir(self.name())) self.inst = util.Dir(os.path.abspath(self.suite_run.trial.get_inst(OsmoTrx.BIN_TRX))) lib = self.inst.child('lib') self.env = { 'LD_LIBRARY_PATH': util.prepend_library_path(lib) } - self.proc_trx = self.launch_process(OsmoTrx.BIN_TRX, '-x') + self.proc_trx = self.launch_process(OsmoTrx.BIN_TRX, '-x', '-j', self.listen_ip, '-i', self.bts_ip) def launch_process(self, binary_name, *args): binary = os.path.abspath(self.inst.child('bin', binary_name)) diff --git a/src/osmo_gsm_tester/config.py b/src/osmo_gsm_tester/config.py index 20ae83e..f6e81ac 100644 --- a/src/osmo_gsm_tester/config.py +++ b/src/osmo_gsm_tester/config.py @@ -271,5 +271,4 @@ dest[i] = overlay(dest[i], src[i]) return dest return src - # vim: expandtab tabstop=4 shiftwidth=4 diff --git a/src/osmo_gsm_tester/resource.py b/src/osmo_gsm_tester/resource.py index 8eec71e..9470f48 100644 --- a/src/osmo_gsm_tester/resource.py +++ b/src/osmo_gsm_tester/resource.py @@ -54,6 +54,8 @@ 'bts[].ipa_unit_id': schema.INT, 'bts[].addr': schema.IPV4, 'bts[].band': schema.BAND, + 'bts[].trx_remote_ip': schema.IPV4, + 'bts[].launch_trx': schema.BOOL_STR, 'bts[].trx_list[].hw_addr': schema.HWADDR, 'bts[].trx_list[].net_device': schema.STR, 'arfcn[].arfcn': schema.INT, diff --git a/src/osmo_gsm_tester/schema.py b/src/osmo_gsm_tester/schema.py index d652aa7..4c9b9cd 100644 --- a/src/osmo_gsm_tester/schema.py +++ b/src/osmo_gsm_tester/schema.py @@ -20,7 +20,7 @@ import re from . import log -from .util import is_dict, is_list +from .util import is_dict, is_list, str2bool KEY_RE = re.compile('[a-zA-Z][a-zA-Z0-9_]*') IPV4_RE = re.compile('([0-9]{1,3}.){3}[0-9]{1,3}') @@ -63,21 +63,25 @@ INT = 'int' STR = 'str' +BOOL_STR = 'bool_str' BAND = 'band' IPV4 = 'ipv4' HWADDR = 'hwaddr' IMSI = 'imsi' KI = 'ki' MSISDN = 'msisdn' +TRX_REMOTE_IP = 'trx_remote_ip' SCHEMA_TYPES = { INT: int, STR: str, + BOOL_STR: str2bool, BAND: band, IPV4: ipv4, HWADDR: hwaddr, IMSI: imsi, KI: ki, MSISDN: msisdn, + TRX_REMOTE_IP: ipv4, } def validate(config, schema): diff --git a/src/osmo_gsm_tester/templates/osmo-bts-trx.cfg.tmpl b/src/osmo_gsm_tester/templates/osmo-bts-trx.cfg.tmpl index ddfd483..950c03e 100644 --- a/src/osmo_gsm_tester/templates/osmo-bts-trx.cfg.tmpl +++ b/src/osmo_gsm_tester/templates/osmo-bts-trx.cfg.tmpl @@ -17,6 +17,8 @@ instance 0 osmotrx rx-gain 25 osmotrx tx-attenuation oml + osmotrx ip local ${osmo_bts_trx.trx_local_ip} + osmotrx ip remote ${osmo_bts_trx.trx_remote_ip} bts 0 band ${osmo_bts_trx.band} ipa unit-id ${osmo_bts_trx.ipa_unit_id} 0 diff --git a/src/osmo_gsm_tester/util.py b/src/osmo_gsm_tester/util.py index 602ae45..af6a2f0 100644 --- a/src/osmo_gsm_tester/util.py +++ b/src/osmo_gsm_tester/util.py @@ -305,4 +305,13 @@ input_thread.join() return input_thread.result +def str2bool(val): + if val is None or not val: + return False + if val.upper() in ['FALSE', 'NO', 'OFF']: + return False + if val.upper() in ['TRUE','YES', 'ON']: + return True + raise ValueError('Invalid BOOL field: %r' % val) + # vim: expandtab tabstop=4 shiftwidth=4 -- To view, visit https://gerrit.osmocom.org/3578 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I825ed1fc0c3fe75d196db90c1508283fbd04acf8 Gerrit-PatchSet: 4 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Wed Aug 23 12:56:41 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Wed, 23 Aug 2017 12:56:41 +0000 Subject: [MERGED] osmo-gsm-tester[master]: Add scenarios for each osmo-bts-trx type In-Reply-To: References: Message-ID: Pau Espin Pedrol has submitted this change and it was merged. Change subject: Add scenarios for each osmo-bts-trx type ...................................................................... Add scenarios for each osmo-bts-trx type This way we can run tests with a specific instance of an osmo-bts-trx, for instance we may want to run some tests with an Ettus B200 and also with a sysmoCell 5000. Change-Id: I5fd78d79b8bfab8ccacc4666563b66b6da9f2bde --- M example/default-suites.conf M example/resources.conf A example/scenarios/trx-b200.conf A example/scenarios/trx-sysmocell5000.conf 4 files changed, 11 insertions(+), 3 deletions(-) Approvals: Pau Espin Pedrol: Looks good to me, approved Jenkins Builder: Verified diff --git a/example/default-suites.conf b/example/default-suites.conf index eba7dea..72a90db 100644 --- a/example/default-suites.conf +++ b/example/default-suites.conf @@ -1,6 +1,6 @@ - sms:sysmo - aoip_sms:sysmo -- sms:trx -- aoip_sms:trx +- sms:trx-b200 +- aoip_sms:trx-b200 - smpp - aoip_smpp diff --git a/example/resources.conf b/example/resources.conf index a09e80a..2f08c93 100644 --- a/example/resources.conf +++ b/example/resources.conf @@ -14,7 +14,7 @@ addr: 10.42.42.114 band: GSM-1800 -- label: Ettus B210 +- label: Ettus B200 type: osmo-bts-trx ipa_unit_id: 6 addr: 10.42.42.50 diff --git a/example/scenarios/trx-b200.conf b/example/scenarios/trx-b200.conf new file mode 100644 index 0000000..2bad7e8 --- /dev/null +++ b/example/scenarios/trx-b200.conf @@ -0,0 +1,4 @@ +resources: + bts: + - label: Ettus B200 + type: osmo-bts-trx diff --git a/example/scenarios/trx-sysmocell5000.conf b/example/scenarios/trx-sysmocell5000.conf new file mode 100644 index 0000000..62e9a3c --- /dev/null +++ b/example/scenarios/trx-sysmocell5000.conf @@ -0,0 +1,4 @@ +resources: + bts: + - label: sysmoCell 5000 + type: osmo-bts-trx -- To view, visit https://gerrit.osmocom.org/3588 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I5fd78d79b8bfab8ccacc4666563b66b6da9f2bde Gerrit-PatchSet: 2 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Wed Aug 23 12:58:18 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 23 Aug 2017 12:58:18 +0000 Subject: osmo-msc[master]: split off osmo-msc: remove files, apply build, rename In-Reply-To: References: Message-ID: Patch Set 2: > this could also have a more verbose description Agreed. I consider the state of this particular patch as incomplete, meaning that I have the feeling there are still numerous details that are missing / should be removed / renamed. -- To view, visit https://gerrit.osmocom.org/3497 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Icf025e5ea8d180613b3114282951c9afa67af9a7 Gerrit-PatchSet: 2 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Aug 23 13:03:37 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Wed, 23 Aug 2017 13:03:37 +0000 Subject: [PATCH] osmo-gsm-tester[master]: default-suites.conf: Add suites to explicitly test with sysm... Message-ID: Review at https://gerrit.osmocom.org/3589 default-suites.conf: Add suites to explicitly test with sysmoCell5000 Change-Id: I6ff08a281c0c32148ca2c59f731d6550bf7b1c90 --- M example/default-suites.conf 1 file changed, 2 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-tester refs/changes/89/3589/1 diff --git a/example/default-suites.conf b/example/default-suites.conf index 72a90db..0a46253 100644 --- a/example/default-suites.conf +++ b/example/default-suites.conf @@ -2,5 +2,7 @@ - aoip_sms:sysmo - sms:trx-b200 - aoip_sms:trx-b200 +- sms:trx-sysmocell5000 +- aoip_sms:trx-sysmocell5000 - smpp - aoip_smpp -- To view, visit https://gerrit.osmocom.org/3589 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I6ff08a281c0c32148ca2c59f731d6550bf7b1c90 Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Wed Aug 23 13:05:34 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Wed, 23 Aug 2017 13:05:34 +0000 Subject: osmo-gsm-tester[master]: default-suites.conf: Add suites to explicitly test with sysm... In-Reply-To: References: Message-ID: Patch Set 1: Depends on following patch for osmo-bts: https://gerrit.osmocom.org/#/c/3580/ Don't merge this patch before that one is merged. -- To view, visit https://gerrit.osmocom.org/3589 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I6ff08a281c0c32148ca2c59f731d6550bf7b1c90 Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Aug 23 16:10:16 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Wed, 23 Aug 2017 16:10:16 +0000 Subject: [PATCH] osmo-gsm-tester[master]: nitb: ctrl: Remove unused return statement in subscriber_add Message-ID: Review at https://gerrit.osmocom.org/3590 nitb: ctrl: Remove unused return statement in subscriber_add In case of failure an exception is raised. If everything goes well no need to return True. Change-Id: I5194eeb9208f973da12f2fa710f2b3e7acd78fb5 --- M src/osmo_gsm_tester/osmo_nitb.py 1 file changed, 0 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-tester refs/changes/90/3590/1 diff --git a/src/osmo_gsm_tester/osmo_nitb.py b/src/osmo_gsm_tester/osmo_nitb.py index 9c15fe6..3b396fa 100644 --- a/src/osmo_gsm_tester/osmo_nitb.py +++ b/src/osmo_gsm_tester/osmo_nitb.py @@ -166,7 +166,6 @@ if not res: raise RuntimeError('Cannot create subscriber %r (answer=%r)' % (imsi, answer_str)) self.dbg('Created subscriber', imsi=imsi, msisdn=msisdn) - return True def subscriber_list_active(self): aslist_str = "" -- To view, visit https://gerrit.osmocom.org/3590 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I5194eeb9208f973da12f2fa710f2b3e7acd78fb5 Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Wed Aug 23 16:10:16 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Wed, 23 Aug 2017 16:10:16 +0000 Subject: [PATCH] osmo-gsm-tester[master]: nitb: Introduce subscriber_delete API Message-ID: Review at https://gerrit.osmocom.org/3591 nitb: Introduce subscriber_delete API Change-Id: I62829ed243857681bcc40a4a1861c5c583907f4b --- M src/osmo_gsm_tester/osmo_nitb.py 1 file changed, 17 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-tester refs/changes/91/3591/1 diff --git a/src/osmo_gsm_tester/osmo_nitb.py b/src/osmo_gsm_tester/osmo_nitb.py index 3b396fa..be3b24b 100644 --- a/src/osmo_gsm_tester/osmo_nitb.py +++ b/src/osmo_gsm_tester/osmo_nitb.py @@ -119,6 +119,10 @@ self.log('Add subscriber', msisdn=msisdn, imsi=modem.imsi()) OsmoNitbCtrl(self).subscriber_add(modem.imsi(), msisdn, modem.ki()) + def subscriber_delete(self, modem): + self.log('Delete subscriber', imsi=modem.imsi()) + OsmoNitbCtrl(self).subscriber_delete(modem.imsi()) + def subscriber_attached(self, *modems): return self.imsi_attached(*[m.imsi() for m in modems]) @@ -138,6 +142,8 @@ PORT = 4249 SUBSCR_MODIFY_VAR = 'subscriber-modify-v1' SUBSCR_MODIFY_REPLY_RE = re.compile("SET_REPLY (\d+) %s OK" % SUBSCR_MODIFY_VAR) + SUBSCR_DELETE_VAR = 'subscriber-delete-v1' + SUBSCR_DELETE_REPLY_RE = re.compile("SET_REPLY (\d+) %s Removed" % SUBSCR_DELETE_VAR) SUBSCR_LIST_ACTIVE_VAR = 'subscriber-list-active-v1' def __init__(self, nitb): @@ -167,6 +173,17 @@ raise RuntimeError('Cannot create subscriber %r (answer=%r)' % (imsi, answer_str)) self.dbg('Created subscriber', imsi=imsi, msisdn=msisdn) + def subscriber_delete(self, imsi): + with self.ctrl() as ctrl: + ctrl.do_set(OsmoNitbCtrl.SUBSCR_DELETE_VAR, imsi) + data = ctrl.receive() + (answer, data) = ctrl.remove_ipa_ctrl_header(data) + answer_str = answer.decode('utf-8') + res = OsmoNitbCtrl.SUBSCR_DELETE_REPLY_RE.match(answer_str) + if not res: + raise RuntimeError('Cannot delete subscriber %r (answer=%r)' % (imsi, answer_str)) + self.dbg('Deleted subscriber', imsi=imsi) + def subscriber_list_active(self): aslist_str = "" with self.ctrl() as ctrl: -- To view, visit https://gerrit.osmocom.org/3591 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I62829ed243857681bcc40a4a1861c5c583907f4b Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Wed Aug 23 16:10:16 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Wed, 23 Aug 2017 16:10:16 +0000 Subject: [PATCH] osmo-gsm-tester[master]: hlr: Use python module instead of cmdline to modify sqlite db Message-ID: Review at https://gerrit.osmocom.org/3592 hlr: Use python module instead of cmdline to modify sqlite db Change-Id: I94a294c37f361a666064094455c9a1e1399fdfc7 --- M check_dependencies.py M src/osmo_gsm_tester/osmo_hlr.py 2 files changed, 12 insertions(+), 16 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-tester refs/changes/92/3592/1 diff --git a/check_dependencies.py b/check_dependencies.py index 2c9e5c3..d9b857c 100755 --- a/check_dependencies.py +++ b/check_dependencies.py @@ -23,5 +23,6 @@ import traceback import yaml import pydbus +import sqlite3 print('dependencies ok') diff --git a/src/osmo_gsm_tester/osmo_hlr.py b/src/osmo_gsm_tester/osmo_hlr.py index fbcd43e..16548ad 100644 --- a/src/osmo_gsm_tester/osmo_hlr.py +++ b/src/osmo_gsm_tester/osmo_hlr.py @@ -20,6 +20,7 @@ import os import re import pprint +import sqlite3 from . import log, util, config, template, process, osmo_ctrl, pcap_recorder @@ -107,16 +108,6 @@ log.ctx(proc) raise log.Error('Exited in error') - def run_sql_file(self, name, sql_file): - self.run_local(name, ('/bin/sh', '-c', 'sqlite3 %r < %r' % (self.db_file, sql_file))) - - def run_sql(self, name, sql): - self.dbg('SQL:', repr(sql)) - sql_file = self.run_dir.new_file(name + '.sql') - with open(sql_file, 'w') as f: - f.write(sql) - self.run_sql_file(name, sql_file) - def subscriber_add(self, modem, msisdn=None, algo=None): if msisdn is None: msisdn = self.suite_run.resources_pool.next_msisdn(modem) @@ -126,12 +117,16 @@ if not algo: algo = self.AUTH_ALGO_COMP128v1 if modem.ki() else self.AUTH_ALGO_NONE self.log('Add subscriber', msisdn=msisdn, imsi=modem.imsi(), subscriber_id=subscriber_id, algo=algo) - self.run_sql('add_subscriber', - 'insert into subscriber (id, imsi, msisdn) values (%r, %r, %r);' - % (subscriber_id, modem.imsi(), modem.msisdn)) - self.run_sql('add_subscriber', - 'insert into auc_2g (subscriber_id, algo_id_2g, ki) values (%r, %r, %r);' - % (subscriber_id, algo, modem.ki())) + conn = sqlite3.connect(self.db_file) + try: + c = conn.cursor() + c.execute('insert into subscriber (id, imsi, msisdn) values (?, ?, ?)', + (subscriber_id, modem.imsi(), modem.msisdn,)) + c.execute('insert into auc_2g (subscriber_id, algo_id_2g, ki) values (?, ?, ?)', + (subscriber_id, algo, modem.ki(),)) + conn.commit() + finally: + conn.close() return subscriber_id def conf_for_msc(self): -- To view, visit https://gerrit.osmocom.org/3592 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I94a294c37f361a666064094455c9a1e1399fdfc7 Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Wed Aug 23 16:10:16 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Wed, 23 Aug 2017 16:10:16 +0000 Subject: [PATCH] osmo-gsm-tester[master]: hlr: Implement subscriber_delete API Message-ID: Review at https://gerrit.osmocom.org/3593 hlr: Implement subscriber_delete API Change-Id: Iefb30ad552929386743d936bf629fe7a760a4713 --- M src/osmo_gsm_tester/osmo_hlr.py 1 file changed, 13 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-tester refs/changes/93/3593/1 diff --git a/src/osmo_gsm_tester/osmo_hlr.py b/src/osmo_gsm_tester/osmo_hlr.py index 16548ad..08de07c 100644 --- a/src/osmo_gsm_tester/osmo_hlr.py +++ b/src/osmo_gsm_tester/osmo_hlr.py @@ -129,6 +129,19 @@ conn.close() return subscriber_id + def subscriber_delete(self, modem): + self.log('Add subscriber', imsi=modem.imsi()) + conn = sqlite3.connect(self.db_file) + try: + c = conn.cursor() + c.execute('select id from subscriber where imsi = ?', (modem.imsi(),)) + subscriber_id = c.fetchone()[0] + c.execute('delete from subscriber where id = ?', (subscriber_id,)) + c.execute('delete from auc_2g where subscriber_id = ?', (subscriber_id,)) + conn.commit() + finally: + conn.close() + def conf_for_msc(self): return dict(hlr=dict(ip_address=self.ip_address)) -- To view, visit https://gerrit.osmocom.org/3593 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Iefb30ad552929386743d936bf629fe7a760a4713 Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Wed Aug 23 16:10:17 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Wed, 23 Aug 2017 16:10:17 +0000 Subject: [PATCH] osmo-gsm-tester[master]: Add support for authentication VTY param in msc and bsc Message-ID: Review at https://gerrit.osmocom.org/3594 Add support for authentication VTY param in msc and bsc Change-Id: Ie1eb76149d4b006631050f8a1e532fbdbdad6a7f --- M example/defaults.conf M src/osmo_gsm_tester/osmo_msc.py M src/osmo_gsm_tester/templates/osmo-bsc.cfg.tmpl M src/osmo_gsm_tester/templates/osmo-msc.cfg.tmpl 4 files changed, 14 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-tester refs/changes/94/3594/1 diff --git a/example/defaults.conf b/example/defaults.conf index 95bd172..082f159 100644 --- a/example/defaults.conf +++ b/example/defaults.conf @@ -15,6 +15,7 @@ long_name: osmo-gsm-tester-msc auth_policy: closed encryption: a5 0 + authentication: optional msc: net: @@ -24,6 +25,7 @@ long_name: osmo-gsm-tester-msc auth_policy: closed encryption: a5 0 + authentication: optional bsc_bts: location_area_code: 23 diff --git a/src/osmo_gsm_tester/osmo_msc.py b/src/osmo_gsm_tester/osmo_msc.py index 92a9d61..f023b29 100644 --- a/src/osmo_gsm_tester/osmo_msc.py +++ b/src/osmo_gsm_tester/osmo_msc.py @@ -32,6 +32,7 @@ config = None smsc = None encryption = None + authentication = None def __init__(self, suite_run, hlr, mgcpgw, ip_address): super().__init__(log.C_RUN, 'osmo-msc_%s' % ip_address.get('addr')) @@ -81,6 +82,9 @@ # runtime parameters: if self.encryption is not None: config.overlay(values, dict(msc=dict(net=dict(encryption=self.encryption)))) + if self.authentication is not None: + config.overlay(values, dict(msc=dict(net=dict(authentication=self.authentication)))) + self.config = values @@ -97,6 +101,12 @@ def set_encryption(self, val): self.encryption = val + def set_authentication(self, val): + if val is None: + self.authroziation = None + return + self.authentication = "required" if val else "optional" + def mcc(self): return self.config['msc']['net']['mcc'] diff --git a/src/osmo_gsm_tester/templates/osmo-bsc.cfg.tmpl b/src/osmo_gsm_tester/templates/osmo-bsc.cfg.tmpl index 0e2f759..57ab8a3 100644 --- a/src/osmo_gsm_tester/templates/osmo-bsc.cfg.tmpl +++ b/src/osmo_gsm_tester/templates/osmo-bsc.cfg.tmpl @@ -29,6 +29,7 @@ auth policy ${bsc.net.auth_policy} location updating reject cause 13 encryption ${bsc.net.encryption} + authentication ${bsc.net.authentication} neci 1 rrlp mode none mm info 1 diff --git a/src/osmo_gsm_tester/templates/osmo-msc.cfg.tmpl b/src/osmo_gsm_tester/templates/osmo-msc.cfg.tmpl index 1abaf20..6851ea9 100644 --- a/src/osmo_gsm_tester/templates/osmo-msc.cfg.tmpl +++ b/src/osmo_gsm_tester/templates/osmo-msc.cfg.tmpl @@ -16,6 +16,7 @@ auth policy ${msc.net.auth_policy} location updating reject cause 13 encryption ${msc.net.encryption} + authentication ${msc.net.authentication} cs7 instance 0 point-code 0.0.1 msc -- To view, visit https://gerrit.osmocom.org/3594 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ie1eb76149d4b006631050f8a1e532fbdbdad6a7f Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Thu Aug 24 10:34:18 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Thu, 24 Aug 2017 10:34:18 +0000 Subject: [PATCH] libosmo-abis[master]: Prepare for next release Message-ID: Review at https://gerrit.osmocom.org/3595 Prepare for next release * update docs on libversion with reference to libtool docs * bump 'current' component of libversion for both libosmoabis and libosmotrau due to API changes Change-Id: Ibefe53a7f5b06fb8a9294574af41dacac68bdbe9 Related: OS#1861 --- M src/Makefile.am 1 file changed, 4 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-abis refs/changes/95/3595/1 diff --git a/src/Makefile.am b/src/Makefile.am index 760c1f5..7395d17 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -1,7 +1,8 @@ # This is _NOT_ the library release version, it's an API version. -# Please read Chapter 6 "Library interface versions" of the libtool documentation before making any modification -ABIS_LIBVERSION=5:0:0 -TRAU_LIBVERSION=1:0:0 +# Please read chapter "Library interface versions" of the libtool documentation +# before making any modifications: https://www.gnu.org/software/libtool/manual/html_node/Versioning.html +ABIS_LIBVERSION=6:0:0 +TRAU_LIBVERSION=2:0:0 AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include -I$(top_builddir) AM_CFLAGS= -Wall $(LIBOSMOCORE_CFLAGS) $(LIBOSMOGSM_CFLAGS) $(LIBOSMOVTY_CFLAGS) $(COVERAGE_CFLAGS) -- To view, visit https://gerrit.osmocom.org/3595 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ibefe53a7f5b06fb8a9294574af41dacac68bdbe9 Gerrit-PatchSet: 1 Gerrit-Project: libosmo-abis Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Thu Aug 24 10:34:20 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Thu, 24 Aug 2017 10:34:20 +0000 Subject: =?UTF-8?Q?=5BPATCH=5D_libosmo-abis=5Bmaster=5D=3A_Bump_version=3A_0=2E3=2E2_=E2=86=92_0=2E4=2E0?= Message-ID: Review at https://gerrit.osmocom.org/3596 Bump version: 0.3.2 ? 0.4.0 Change-Id: I6f0ac8377adeccd4c56555cdc16768973c1f0876 --- M TODO-RELEASE M debian/changelog 2 files changed, 7 insertions(+), 6 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-abis refs/changes/96/3596/1 diff --git a/TODO-RELEASE b/TODO-RELEASE index 128778a..43b1e8e 100644 --- a/TODO-RELEASE +++ b/TODO-RELEASE @@ -1,4 +1 @@ #library what description / commit summary line -libosmo-abis API change major: add parameter to rx_cb() callack in osmo_ortp.h -libosmo-abis API change major: add parameter to struct input_signal_data -libosmo-abis API change major: add parameters to rx_cb() callack in osmo_ortp.h diff --git a/debian/changelog b/debian/changelog index b2cf0e9..2a6a55c 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,8 +1,12 @@ -libosmo-abis (0.3.3) UNRELEASED; urgency=medium +libosmo-abis (0.4.0) unstable; urgency=medium - * Move forward towards a new release. + * Use new releng helper + * libosmo-abis:API change:major: add parameter to struct + input_signal_data + * libosmo-abis:API change:major: add parameters to rx_cb() callack in + osmo_ortp.h - -- Holger Hans Peter Freyther Tue, 24 May 2016 23:02:47 +0200 + -- Max Suraev Thu, 24 Aug 2017 12:20:51 +0200 libosmo-abis (0.3.2) unstable; urgency=medium -- To view, visit https://gerrit.osmocom.org/3596 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I6f0ac8377adeccd4c56555cdc16768973c1f0876 Gerrit-PatchSet: 1 Gerrit-Project: libosmo-abis Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Thu Aug 24 10:40:01 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Thu, 24 Aug 2017 10:40:01 +0000 Subject: =?UTF-8?Q?libosmo-abis=5Bmaster=5D=3A_Bump_version=3A_0=2E3=2E2_=E2=86=92_0=2E4=2E0?= In-Reply-To: References: Message-ID: Patch Set 1: Is there a way to check if this commit has tag in the gerrit? -- To view, visit https://gerrit.osmocom.org/3596 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I6f0ac8377adeccd4c56555cdc16768973c1f0876 Gerrit-PatchSet: 1 Gerrit-Project: libosmo-abis Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Aug 24 11:26:22 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Thu, 24 Aug 2017 11:26:22 +0000 Subject: [PATCH] libosmocore[master]: Relax branch restriction while making release Message-ID: Review at https://gerrit.osmocom.org/3597 Relax branch restriction while making release Previously making release of non-library project from non-master branch would fail. Relax this check to facilitate submission to gerrit via topic branches. Change-Id: Ie89b79a45033bee422e4ff898069ea6ac2c2f524 Related: OS#1861 --- M osmo-release.mk 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/97/3597/1 diff --git a/osmo-release.mk b/osmo-release.mk index 4407c86..3fe6803 100644 --- a/osmo-release.mk +++ b/osmo-release.mk @@ -10,7 +10,7 @@ endif @echo "Releasing" $(VERSION) "->" $(NEW_VERSION)"..." ifeq ($(LIBVERS),) - @gbp dch --debian-tag='%(version)s' --auto --meta --git-author --multimaint-merge + @gbp dch --debian-tag='%(version)s' --auto --meta --git-author --multimaint-merge --ignore-branch else @echo "You should NOT be doing this unless you've read and understood following article:" @echo "https://www.gnu.org/software/libtool/manual/html_node/Updating-version-info.html#Updating-version-info" -- To view, visit https://gerrit.osmocom.org/3597 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ie89b79a45033bee422e4ff898069ea6ac2c2f524 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Thu Aug 24 11:38:53 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Thu, 24 Aug 2017 11:38:53 +0000 Subject: =?UTF-8?Q?=5BPATCH=5D_osmo-bts=5Bmaster=5D=3A_Bump_version=3A_0=2E5=2E0_=E2=86=92_0=2E6=2E0?= Message-ID: Review at https://gerrit.osmocom.org/3598 Bump version: 0.5.0 ? 0.6.0 Change-Id: I613d09ae0f9f0aa67be1dc6015da1fb9314110fd --- M debian/changelog 1 file changed, 8 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/98/3598/1 diff --git a/debian/changelog b/debian/changelog index 5c2d203..814bb06 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,11 @@ -osmo-bts (0.5.0) UNRELEASED; urgency=medium +osmo-bts (0.6.0) unstable; urgency=medium + + * Use osmo-release.mk helper + * New upstream version + + -- Max Thu, 24 Aug 2017 13:25:07 +0200 + +osmo-bts (0.5.0) unstable; urgency=medium * Initial release. -- To view, visit https://gerrit.osmocom.org/3598 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I613d09ae0f9f0aa67be1dc6015da1fb9314110fd Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Thu Aug 24 12:05:25 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Thu, 24 Aug 2017 12:05:25 +0000 Subject: [PATCH] osmo-pcu[master]: Facilitate future releases Message-ID: Review at https://gerrit.osmocom.org/3599 Facilitate future releases * use release helper from libosmocore * use semantic versioning Change-Id: Ie0a7f5977550bd0a1ba8b03bdb7e2d619a398e4e Related: OS#1861 --- M Makefile.am M configure.ac M debian/changelog 3 files changed, 7 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/99/3599/1 diff --git a/Makefile.am b/Makefile.am index 2ac1cd9..7a4e6c0 100644 --- a/Makefile.am +++ b/Makefile.am @@ -3,5 +3,7 @@ SUBDIRS = include src examples tests EXTRA_DIST = osmoappdesc.py README.md + at RELMAKE@ + pkgconfigdir = $(libdir)/pkgconfig pkgconfig_DATA = osmo-pcu.pc diff --git a/configure.ac b/configure.ac index 3b13469..0a3557d 100644 --- a/configure.ac +++ b/configure.ac @@ -12,6 +12,10 @@ 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]) + dnl checks for programs AC_PROG_MAKE_SET AC_PROG_CC diff --git a/debian/changelog b/debian/changelog index 7b7b4ad..6a534b4 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,4 @@ -osmo-pcu (0.3) UNRELEASED; urgency=medium +osmo-pcu (0.3.0) UNRELEASED; urgency=medium * Initial release. -- To view, visit https://gerrit.osmocom.org/3599 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ie0a7f5977550bd0a1ba8b03bdb7e2d619a398e4e Gerrit-PatchSet: 1 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Thu Aug 24 12:25:30 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Thu, 24 Aug 2017 12:25:30 +0000 Subject: [PATCH] osmo-pcu[master]: Use value string check from osmo-ci Message-ID: Review at https://gerrit.osmocom.org/3600 Use value string check from osmo-ci Change-Id: Ib9c595ef80cb6b0d126d4da8244f6435e0526095 --- M contrib/jenkins.sh 1 file changed, 2 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/00/3600/1 diff --git a/contrib/jenkins.sh b/contrib/jenkins.sh index 75f28f3..b815ddd 100755 --- a/contrib/jenkins.sh +++ b/contrib/jenkins.sh @@ -58,10 +58,10 @@ exit 1 fi +verify_value_string_arrays_are_terminated.py $(find . -name "*.[hc]") + # Build deps osmo-build-dep.sh libosmocore - -"$deps"/libosmocore/contrib/verify_value_string_arrays_are_terminated.py $(find . -name "*.[hc]") export PKG_CONFIG_PATH="$inst/lib/pkgconfig:$PKG_CONFIG_PATH" export LD_LIBRARY_PATH="$inst/lib" -- To view, visit https://gerrit.osmocom.org/3600 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ib9c595ef80cb6b0d126d4da8244f6435e0526095 Gerrit-PatchSet: 1 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Thu Aug 24 13:40:35 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Thu, 24 Aug 2017 13:40:35 +0000 Subject: [PATCH] osmo-bts[master]: osmo-bts-trx: remove global variables from loops Message-ID: Review at https://gerrit.osmocom.org/3601 osmo-bts-trx: remove global variables from loops * move TA related globals into phy_link * move power loop related globals into phy_link * prefix corresponding vty vars with osmotrx Change-Id: I01d7c1abad67e51b886a4ecf2de072929d67da27 Related: OS#1848 --- M include/osmo-bts/phy_link.h M src/osmo-bts-trx/loops.c M src/osmo-bts-trx/loops.h M src/osmo-bts-trx/main.c M src/osmo-bts-trx/trx_vty.c 5 files changed, 47 insertions(+), 42 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/01/3601/1 diff --git a/include/osmo-bts/phy_link.h b/include/osmo-bts/phy_link.h index 7011622..0ffc58e 100644 --- a/include/osmo-bts/phy_link.h +++ b/include/osmo-bts/phy_link.h @@ -44,7 +44,9 @@ uint16_t base_port_local; uint16_t base_port_remote; struct osmo_fd trx_ofd_clk; - + bool trx_ta_loop; + bool trx_ms_power_loop; + int8_t trx_target_rssi; uint32_t clock_advance; uint32_t rts_advance; bool use_legacy_setbsic; diff --git a/src/osmo-bts-trx/loops.c b/src/osmo-bts-trx/loops.c index 3da805c..6f87cd1 100644 --- a/src/osmo-bts-trx/loops.c +++ b/src/osmo-bts-trx/loops.c @@ -39,9 +39,6 @@ * MS Power loop */ -int trx_ms_power_loop = 0; -int8_t trx_target_rssi = -10; - static int ms_power_diff(struct gsm_lchan *lchan, uint8_t chan_nr, int8_t diff) { struct gsm_bts_trx *trx = lchan->ts->trx; @@ -118,6 +115,7 @@ uint8_t chan_nr, struct l1sched_chan_state *chan_state) { struct gsm_bts_trx *trx = lchan->ts->trx; + struct phy_instance *pinst = trx_phy_instance(trx); int rssi; int i; @@ -159,10 +157,10 @@ /* change RSSI */ LOGP(DLOOP, LOGL_DEBUG, "Lowest RSSI: %d Target RSSI: %d Current " "MS power: %d (%d dBm) of trx=%u chan_nr=0x%02x\n", rssi, - trx_target_rssi, lchan->ms_power_ctrl.current, + pinst->phy_link->u.osmotrx.trx_target_rssi, lchan->ms_power_ctrl.current, MS_PWR_DBM(trx->arfcn, lchan->ms_power_ctrl.current), trx->nr, chan_nr); - ms_power_diff(lchan, chan_nr, trx_target_rssi - rssi); + ms_power_diff(lchan, chan_nr, pinst->phy_link->u.osmotrx.trx_target_rssi - rssi); return 0; } @@ -171,8 +169,6 @@ /* * Timing Advance loop */ - -int trx_ta_loop = 1; int ta_val(struct gsm_lchan *lchan, uint8_t chan_nr, struct l1sched_chan_state *chan_state, float toa) @@ -220,11 +216,12 @@ { struct gsm_lchan *lchan = &l1t->trx->ts[L1SAP_CHAN2TS(chan_nr)] .lchan[l1sap_chan2ss(chan_nr)]; + struct phy_instance *pinst = trx_phy_instance(l1t->trx); - if (trx_ms_power_loop) + if (pinst->phy_link->u.osmotrx.trx_ms_power_loop) ms_power_val(chan_state, rssi); - if (trx_ta_loop) + if (pinst->phy_link->u.osmotrx.trx_ta_loop) ta_val(lchan, chan_nr, chan_state, toa); return 0; @@ -235,8 +232,9 @@ { struct gsm_lchan *lchan = &l1t->trx->ts[L1SAP_CHAN2TS(chan_nr)] .lchan[l1sap_chan2ss(chan_nr)]; + struct phy_instance *pinst = trx_phy_instance(l1t->trx); - if (trx_ms_power_loop) + if (pinst->phy_link->u.osmotrx.trx_ms_power_loop) ms_power_clock(lchan, chan_nr, chan_state); /* count the number of SACCH clocks */ diff --git a/src/osmo-bts-trx/loops.h b/src/osmo-bts-trx/loops.h index c0458c5..230cd4f 100644 --- a/src/osmo-bts-trx/loops.h +++ b/src/osmo-bts-trx/loops.h @@ -13,10 +13,6 @@ * loops api */ -extern int trx_ms_power_loop; -extern int8_t trx_target_rssi; -extern int trx_ta_loop; - int trx_loop_sacch_input(struct l1sched_trx *l1t, uint8_t chan_nr, struct l1sched_chan_state *chan_state, int8_t rssi, float toa); diff --git a/src/osmo-bts-trx/main.c b/src/osmo-bts-trx/main.c index 283e549..a1eb686 100644 --- a/src/osmo-bts-trx/main.c +++ b/src/osmo-bts-trx/main.c @@ -122,6 +122,9 @@ plink->u.osmotrx.base_port_remote = 5700; plink->u.osmotrx.clock_advance = 20; plink->u.osmotrx.rts_advance = 5; + plink->u.osmotrx.trx_ta_loop = true; + plink->u.osmotrx.trx_ms_power_loop = false; + plink->u.osmotrx.trx_target_rssi = -10; } void bts_model_phy_instance_set_defaults(struct phy_instance *pinst) diff --git a/src/osmo-bts-trx/trx_vty.c b/src/osmo-bts-trx/trx_vty.c index 482248c..2f485b3 100644 --- a/src/osmo-bts-trx/trx_vty.c +++ b/src/osmo-bts-trx/trx_vty.c @@ -160,39 +160,47 @@ return CMD_SUCCESS; } -DEFUN(cfg_bts_ms_power_loop, cfg_bts_ms_power_loop_cmd, - "ms-power-loop <-127-127>", +DEFUN(cfg_phy_ms_power_loop, cfg_phy_ms_power_loop_cmd, + "osmotrx ms-power-loop <-127-127>", OSMOTRX_STR "Enable MS power control loop\nTarget RSSI value (transceiver specific, " "should be 6dB or more above noise floor)\n") { - trx_ms_power_loop = 1; - trx_target_rssi = atoi(argv[0]); + struct phy_link *plink = vty->index; + + plink->u.osmotrx.trx_target_rssi = atoi(argv[0]); + plink->u.osmotrx.trx_ms_power_loop = true; return CMD_SUCCESS; } -DEFUN(cfg_bts_no_ms_power_loop, cfg_bts_no_ms_power_loop_cmd, - "no ms-power-loop", - NO_STR "Disable MS power control loop\n") +DEFUN(cfg_phy_no_ms_power_loop, cfg_phy_no_ms_power_loop_cmd, + "no osmotrx ms-power-loop", + NO_STR OSMOTRX_STR "Disable MS power control loop\n") { - trx_ms_power_loop = 0; + struct phy_link *plink = vty->index; + + plink->u.osmotrx.trx_ms_power_loop = false; return CMD_SUCCESS; } -DEFUN(cfg_bts_timing_advance_loop, cfg_bts_timing_advance_loop_cmd, - "timing-advance-loop", +DEFUN(cfg_phy_timing_advance_loop, cfg_phy_timing_advance_loop_cmd, + "osmotrx timing-advance-loop", OSMOTRX_STR "Enable timing advance control loop\n") { - trx_ta_loop = 1; + struct phy_link *plink = vty->index; + + plink->u.osmotrx.trx_ta_loop = true; return CMD_SUCCESS; } -DEFUN(cfg_bts_no_timing_advance_loop, cfg_bts_no_timing_advance_loop_cmd, - "no timing-advance-loop", - NO_STR "Disable timing advance control loop\n") +DEFUN(cfg_phy_no_timing_advance_loop, cfg_phy_no_timing_advance_loop_cmd, + "no osmotrx timing-advance-loop", + NO_STR OSMOTRX_STR "Disable timing advance control loop\n") { - trx_ta_loop = 0; + struct phy_link *plink = vty->index; + + plink->u.osmotrx.trx_ta_loop = false; return CMD_SUCCESS; } @@ -490,6 +498,12 @@ vty_out(vty, " osmotrx ip remote %s%s", plink->u.osmotrx.remote_ip, VTY_NEWLINE); + if (plink->u.osmotrx.trx_ms_power_loop) + vty_out(vty, " osmotrx ms-power-loop %d%s", plink->u.osmotrx.trx_target_rssi, VTY_NEWLINE); + else + vty_out(vty, " no osmotrx ms-power-loop%s", VTY_NEWLINE); + vty_out(vty, " %s osmotrx timing-advance-loop%s", (plink->u.osmotrx.trx_ta_loop) ? "" : "no", VTY_NEWLINE); + if (plink->u.osmotrx.base_port_local) vty_out(vty, " osmotrx base-port local %"PRIu16"%s", plink->u.osmotrx.base_port_local, VTY_NEWLINE); @@ -539,13 +553,6 @@ void bts_model_config_write_bts(struct vty *vty, struct gsm_bts *bts) { - if (trx_ms_power_loop) - vty_out(vty, " ms-power-loop %d%s", trx_target_rssi, - VTY_NEWLINE); - else - vty_out(vty, " no ms-power-loop%s", VTY_NEWLINE); - vty_out(vty, " %stiming-advance-loop%s", (trx_ta_loop) ? "":"no ", - VTY_NEWLINE); } void bts_model_config_write_trx(struct vty *vty, struct gsm_bts_trx *trx) @@ -559,11 +566,10 @@ install_element_ve(&show_transceiver_cmd); install_element_ve(&show_phy_cmd); - install_element(BTS_NODE, &cfg_bts_ms_power_loop_cmd); - install_element(BTS_NODE, &cfg_bts_no_ms_power_loop_cmd); - install_element(BTS_NODE, &cfg_bts_timing_advance_loop_cmd); - install_element(BTS_NODE, &cfg_bts_no_timing_advance_loop_cmd); - + install_element(PHY_NODE, &cfg_phy_ms_power_loop_cmd); + install_element(PHY_NODE, &cfg_phy_no_ms_power_loop_cmd); + install_element(PHY_NODE, &cfg_phy_timing_advance_loop_cmd); + install_element(PHY_NODE, &cfg_phy_no_timing_advance_loop_cmd); install_element(PHY_NODE, &cfg_phy_base_port_cmd); install_element(PHY_NODE, &cfg_phy_fn_advance_cmd); install_element(PHY_NODE, &cfg_phy_rts_advance_cmd); -- To view, visit https://gerrit.osmocom.org/3601 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I01d7c1abad67e51b886a4ecf2de072929d67da27 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Thu Aug 24 13:40:38 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Thu, 24 Aug 2017 13:40:38 +0000 Subject: [PATCH] osmo-bts[master]: osmo-bts-trx: fix type in 'osmotrx legacy-setbsic' Message-ID: Review at https://gerrit.osmocom.org/3602 osmo-bts-trx: fix type in 'osmotrx legacy-setbsic' Change-Id: Id42359dfbb8ad02f34dd2540db66f3ed69ad5181 --- M src/osmo-bts-trx/trx_vty.c 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/02/3602/1 diff --git a/src/osmo-bts-trx/trx_vty.c b/src/osmo-bts-trx/trx_vty.c index 2f485b3..4932222 100644 --- a/src/osmo-bts-trx/trx_vty.c +++ b/src/osmo-bts-trx/trx_vty.c @@ -517,7 +517,7 @@ plink->u.osmotrx.rts_advance, VTY_NEWLINE); if (plink->u.osmotrx.use_legacy_setbsic) - vty_out(vty, " osmotrx leyacy-setbsic%s", VTY_NEWLINE); + vty_out(vty, " osmotrx legacy-setbsic%s", VTY_NEWLINE); } void bts_model_config_write_phy_inst(struct vty *vty, struct phy_instance *pinst) -- To view, visit https://gerrit.osmocom.org/3602 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Id42359dfbb8ad02f34dd2540db66f3ed69ad5181 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Thu Aug 24 13:45:07 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Thu, 24 Aug 2017 13:45:07 +0000 Subject: [PATCH] osmo-bts[master]: osmo-bts-trx: fix typo in 'osmotrx legacy-setbsic' In-Reply-To: References: Message-ID: osmo-bts-trx: fix typo in 'osmotrx legacy-setbsic' It was introduced in fe6c75d24a1751341bcee91cb45c7ac7f5d07da3. Change-Id: Id42359dfbb8ad02f34dd2540db66f3ed69ad5181 --- M src/osmo-bts-trx/trx_vty.c 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/02/3602/2 diff --git a/src/osmo-bts-trx/trx_vty.c b/src/osmo-bts-trx/trx_vty.c index 2f485b3..4932222 100644 --- a/src/osmo-bts-trx/trx_vty.c +++ b/src/osmo-bts-trx/trx_vty.c @@ -517,7 +517,7 @@ plink->u.osmotrx.rts_advance, VTY_NEWLINE); if (plink->u.osmotrx.use_legacy_setbsic) - vty_out(vty, " osmotrx leyacy-setbsic%s", VTY_NEWLINE); + vty_out(vty, " osmotrx legacy-setbsic%s", VTY_NEWLINE); } void bts_model_config_write_phy_inst(struct vty *vty, struct phy_instance *pinst) -- To view, visit https://gerrit.osmocom.org/3602 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Id42359dfbb8ad02f34dd2540db66f3ed69ad5181 Gerrit-PatchSet: 2 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte From gerrit-no-reply at lists.osmocom.org Thu Aug 24 13:46:09 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Thu, 24 Aug 2017 13:46:09 +0000 Subject: osmo-bts[master]: osmo-bts-trx: remove global variables from loops In-Reply-To: References: Message-ID: Patch Set 1: Note: it was only compile-tested. -- To view, visit https://gerrit.osmocom.org/3601 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I01d7c1abad67e51b886a4ecf2de072929d67da27 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Aug 24 13:57:34 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Thu, 24 Aug 2017 13:57:34 +0000 Subject: [PATCH] osmo-bts[master]: osmo-bts-trx: fix 'osmotrx legacy-setbsic' In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3602 to look at the new patch set (#3). osmo-bts-trx: fix 'osmotrx legacy-setbsic' It was introduced in fe6c75d24a1751341bcee91cb45c7ac7f5d07da3: * fix typo in config write * add missing vty help string Change-Id: Id42359dfbb8ad02f34dd2540db66f3ed69ad5181 --- M src/osmo-bts-trx/trx_vty.c 1 file changed, 3 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/02/3602/3 diff --git a/src/osmo-bts-trx/trx_vty.c b/src/osmo-bts-trx/trx_vty.c index 482248c..36d75c1 100644 --- a/src/osmo-bts-trx/trx_vty.c +++ b/src/osmo-bts-trx/trx_vty.c @@ -458,7 +458,7 @@ } DEFUN(cfg_phy_setbsic, cfg_phy_setbsic_cmd, - "osmotrx legacy-setbsic", + "osmotrx legacy-setbsic", OSMOTRX_STR "Use SETBSIC to configure transceiver (use ONLY with OpenBTS Transceiver!)\n") { struct phy_link *plink = vty->index; @@ -473,7 +473,7 @@ DEFUN(cfg_phy_no_setbsic, cfg_phy_no_setbsic_cmd, "no osmotrx legacy-setbsic", - NO_STR "Disable Legacy SETBSIC to configure transceiver\n") + NO_STR OSMOTRX_STR "Disable Legacy SETBSIC to configure transceiver\n") { struct phy_link *plink = vty->index; plink->u.osmotrx.use_legacy_setbsic = false; @@ -503,7 +503,7 @@ plink->u.osmotrx.rts_advance, VTY_NEWLINE); if (plink->u.osmotrx.use_legacy_setbsic) - vty_out(vty, " osmotrx leyacy-setbsic%s", VTY_NEWLINE); + vty_out(vty, " osmotrx legacy-setbsic%s", VTY_NEWLINE); } void bts_model_config_write_phy_inst(struct vty *vty, struct phy_instance *pinst) -- To view, visit https://gerrit.osmocom.org/3602 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Id42359dfbb8ad02f34dd2540db66f3ed69ad5181 Gerrit-PatchSet: 3 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Thu Aug 24 14:06:39 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Thu, 24 Aug 2017 14:06:39 +0000 Subject: osmo-bts[master]: OML: use fom_hdr while handling attr. request In-Reply-To: References: Message-ID: Patch Set 4: The comment was addressed in the latest revision - please review. -- To view, visit https://gerrit.osmocom.org/3090 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I8b5a5ab8bd07daf2500b66dec428b89b7f8cd852 Gerrit-PatchSet: 4 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Aug 24 14:20:43 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 24 Aug 2017 14:20:43 +0000 Subject: [PATCH] libosmo-sccp[master]: sccp: again fix handling of default IP addresses in osmo_scc... Message-ID: Review at https://gerrit.osmocom.org/3603 sccp: again fix handling of default IP addresses in osmo_sccp_simple_client() The previous fix (I312caf9d54cedb02034e4ef88fdd2e6ad9ca1c34) caused the default addresses to be discarded. Actually talloc_strdup() the default addresses to use them if not NULL. Change-Id: Ic8563ab272d5256a1b8ceefd5fee37da61e1bd26 --- M src/sccp_user.c 1 file changed, 2 insertions(+), 4 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-sccp refs/changes/03/3603/1 diff --git a/src/sccp_user.c b/src/sccp_user.c index b0a807d..06a7174 100644 --- a/src/sccp_user.c +++ b/src/sccp_user.c @@ -426,10 +426,8 @@ goto out_rt; asp_created = true; - asp->cfg.local.host = - default_local_ip ? asp->cfg.local.host : NULL; - asp->cfg.remote.host = - default_remote_ip ? asp->cfg.remote.host : NULL; + asp->cfg.local.host = default_local_ip ? talloc_strdup(asp, default_local_ip) : NULL; + asp->cfg.remote.host = default_remote_ip ? talloc_strdup(asp, default_remote_ip) : NULL; osmo_ss7_as_add_asp(as, asp->cfg.name); } -- To view, visit https://gerrit.osmocom.org/3603 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ic8563ab272d5256a1b8ceefd5fee37da61e1bd26 Gerrit-PatchSet: 1 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: dexter From gerrit-no-reply at lists.osmocom.org Thu Aug 24 14:48:03 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 24 Aug 2017 14:48:03 +0000 Subject: [PATCH] osmo-msc[master]: move libiu to osmo-iuh/libosmo-ranap 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/3489 to look at the new patch set (#3). move libiu to osmo-iuh/libosmo-ranap Remove libiu here, use the functions from libosmo-ranap instead, by applying the ranap_ / RANAP_ prefix. Corresponding change-id in osmo-iuh.git is I6a3f7ad15be03fb94689b4af6ccfa828c25f45c0 To be able to run the msc_vlr tests for RAN_UTRAN_IU without Iu client headers available, add iu_dummy.h, containing mere function signatures that match iu_dummy.c. Change-Id: Ib8c4fcdb4766c5e575618b95ce16dce51063206b --- M configure.ac M include/openbsc/Makefile.am M include/openbsc/gprs_sgsn.h M include/openbsc/gsm_data.h D include/openbsc/iu.h A include/openbsc/iu_dummy.h M include/openbsc/iucs.h M include/openbsc/iucs_ranap.h M include/openbsc/sgsn.h M src/Makefile.am M src/gprs/Makefile.am M src/gprs/gprs_gmm.c M src/gprs/gprs_sgsn.c M src/gprs/sgsn_libgtp.c M src/gprs/sgsn_main.c M src/gprs/sgsn_vty.c D src/libiu/Makefile.am D src/libiu/iu.c D src/libiu/iu_vty.c M src/libmsc/Makefile.am M src/libmsc/a_iface_bssap.c M src/libmsc/gsm_04_08.c M src/libmsc/gsm_subscriber.c M src/libmsc/iu_dummy.c M src/libmsc/iucs.c M src/libmsc/iucs_ranap.c M src/libmsc/msc_ifaces.c M src/libmsc/msc_vty.c M src/libmsc/osmo_msc.c M src/libmsc/subscr_conn.c M src/osmo-msc/Makefile.am M src/osmo-msc/msc_main.c M tests/msc_vlr/Makefile.am M tests/msc_vlr/msc_vlr_tests.c M tests/sgsn/Makefile.am M tests/sms_queue/Makefile.am 36 files changed, 191 insertions(+), 1,147 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/89/3489/3 diff --git a/configure.ac b/configure.ac index 803f739..dc2a4ad 100644 --- a/configure.ac +++ b/configure.ac @@ -229,7 +229,6 @@ src/libmgcp/Makefile src/libcommon/Makefile src/libfilter/Makefile - src/libiu/Makefile src/libcommon-cs/Makefile src/osmo-msc/Makefile src/osmo-bsc/Makefile diff --git a/include/openbsc/Makefile.am b/include/openbsc/Makefile.am index e5377a0..9dfb506 100644 --- a/include/openbsc/Makefile.am +++ b/include/openbsc/Makefile.am @@ -48,9 +48,9 @@ handover.h \ handover_decision.h \ ipaccess.h \ - iu.h \ iucs.h \ iucs_ranap.h \ + iu_dummy.h \ meas_feed.h \ meas_rep.h \ mgcp.h \ diff --git a/include/openbsc/gprs_sgsn.h b/include/openbsc/gprs_sgsn.h index fd86174..52fba66 100644 --- a/include/openbsc/gprs_sgsn.h +++ b/include/openbsc/gprs_sgsn.h @@ -117,7 +117,7 @@ uint16_t pdp_status; }; -struct ue_conn_ctx; +struct ranap_ue_conn_ctx; /* According to TS 03.60, Table 5: SGSN MM and PDP Contexts */ /* Extended by 3GPP TS 23.060, Table 6: SGSN MM and PDP Contexts */ @@ -159,7 +159,7 @@ /* CSG Subscription Data */ /* LIPA Allowed */ /* Voice Support Match Indicator */ - struct ue_conn_ctx *ue_ctx; + struct ranap_ue_conn_ctx *ue_ctx; struct service_info service; } iu; /* VLR number */ diff --git a/include/openbsc/gsm_data.h b/include/openbsc/gsm_data.h index 34bc53b..de1bd88 100644 --- a/include/openbsc/gsm_data.h +++ b/include/openbsc/gsm_data.h @@ -30,7 +30,7 @@ struct bsc_subscr; struct vlr_instance; struct vlr_subscr; -struct ue_conn_ctx; +struct ranap_ue_conn_ctx; #define OBSC_LINKID_CB(__msgb) (__msgb)->cb[3] @@ -203,7 +203,7 @@ /* which Iu-CS connection, if any. */ struct { - struct ue_conn_ctx *ue_ctx; + struct ranap_ue_conn_ctx *ue_ctx; uint8_t rab_id; } iu; @@ -485,7 +485,7 @@ struct { /* CS7 instance id number (set via VTY) */ uint32_t cs7_instance; - enum nsap_addr_enc rab_assign_addr_enc; + int rab_assign_addr_enc; struct osmo_sccp_instance *sccp; } iu; diff --git a/include/openbsc/iu.h b/include/openbsc/iu.h deleted file mode 100644 index 08e4cd0..0000000 --- a/include/openbsc/iu.h +++ /dev/null @@ -1,77 +0,0 @@ -#pragma once - -#include -#include - -#include -#include -#include - -#include - -struct sgsn_pdp_ctx; -struct msgb; -struct gsm_auth_tuple; -struct osmo_sccp_addr; -struct osmo_ss7_instance; - -struct RANAP_RAB_SetupOrModifiedItemIEs_s; -struct RANAP_GlobalRNC_ID; -struct RANAP_Cause; - -/* Debugging switches from asn1c and osmo-iuh */ -extern int asn_debug; -extern int asn1_xer_print; - -struct ue_conn_ctx { - struct llist_head list; - /* TODO: It's not needed to store the full SCCP address for each - * UE. Rather than that, a pointer to the RNC should be far - * sufficient */ - struct osmo_sccp_addr sccp_addr; - uint32_t conn_id; - int integrity_active; - struct gprs_ra_id ra_id; - enum nsap_addr_enc rab_assign_addr_enc; -}; - -enum iu_event_type { - IU_EVENT_RAB_ASSIGN, - IU_EVENT_SECURITY_MODE_COMPLETE, - IU_EVENT_IU_RELEASE, /* An actual Iu Release message was received */ - IU_EVENT_LINK_INVALIDATED, /* A SUA link was lost or closed down */ -}; - -extern const struct value_string iu_event_type_names[]; -static inline const char *iu_event_type_str(enum iu_event_type e) -{ - return get_value_string(iu_event_type_names, e); -} - -/* Implementations of iu_recv_cb_t shall find the ue_conn_ctx in msg->dst. */ -typedef int (* iu_recv_cb_t )(struct msgb *msg, struct gprs_ra_id *ra_id, - uint16_t *sai); - -typedef int (* iu_event_cb_t )(struct ue_conn_ctx *ue_ctx, - enum iu_event_type type, void *data); - -typedef int (* iu_rab_ass_resp_cb_t )(struct ue_conn_ctx *ue_ctx, uint8_t rab_id, - struct RANAP_RAB_SetupOrModifiedItemIEs_s *setup_ies); - -int iu_init(void *ctx, struct osmo_sccp_instance *sccp, - iu_recv_cb_t iu_recv_cb, iu_event_cb_t iu_event_cb); - -int iu_tx(struct msgb *msg, uint8_t sapi); - -int iu_page_cs(const char *imsi, const uint32_t *tmsi, uint16_t lac); -int iu_page_ps(const char *imsi, const uint32_t *ptmsi, uint16_t lac, uint8_t rac); - -int iu_rab_act(struct ue_conn_ctx *ue_ctx, struct msgb *msg); -int iu_rab_deact(struct ue_conn_ctx *ue_ctx, uint8_t rab_id); -int iu_tx_sec_mode_cmd(struct ue_conn_ctx *uectx, struct gsm_auth_tuple *tp, - int send_ck, int new_key); -int iu_tx_common_id(struct ue_conn_ctx *ue_ctx, const char *imsi); -int iu_tx_release(struct ue_conn_ctx *ctx, const struct RANAP_Cause *cause); - -void iu_vty_init(int iu_parent_node, enum nsap_addr_enc *rab_assign_addr_enc); -int iu_vty_config_write(struct vty *vty, const char *indent); diff --git a/include/openbsc/iu_dummy.h b/include/openbsc/iu_dummy.h new file mode 100644 index 0000000..ccb2099 --- /dev/null +++ b/include/openbsc/iu_dummy.h @@ -0,0 +1,45 @@ +/* Trivial switch-off of external Iu dependencies, + * allowing to run full unit tests even when built without Iu support. */ + +/* + * (C) 2016,2017 by sysmocom s.f.m.c. GmbH + * + * Author: Neels Hofmeyr + * + * All Rights Reserved + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + * + */ + +#include +#include + +struct msgb; +struct ranap_ue_conn_ctx; +struct gsm_auth_tuple; +struct RANAP_Cause; +struct osmo_auth_vector; + +int ranap_iu_tx(struct msgb *msg, uint8_t sapi); +int ranap_iu_tx_sec_mode_cmd(struct ranap_ue_conn_ctx *uectx, struct osmo_auth_vector *vec, + int send_ck); +int ranap_iu_page_cs(const char *imsi, const uint32_t *tmsi, uint16_t lac); +int ranap_iu_page_ps(const char *imsi, const uint32_t *ptmsi, uint16_t lac, uint8_t rac); +struct msgb *ranap_new_msg_rab_assign_voice(uint8_t rab_id, uint32_t rtp_ip, + uint16_t rtp_port, + bool use_x213_nsap); +int ranap_iu_rab_act(struct ranap_ue_conn_ctx *ue_ctx, struct msgb *msg); +int ranap_iu_tx_common_id(struct ranap_ue_conn_ctx *uectx, const char *imsi); +int ranap_iu_tx_release(struct ranap_ue_conn_ctx *ctx, const struct RANAP_Cause *cause); diff --git a/include/openbsc/iucs.h b/include/openbsc/iucs.h index fb61a5c..b7d6064 100644 --- a/include/openbsc/iucs.h +++ b/include/openbsc/iucs.h @@ -4,4 +4,4 @@ uint16_t *lac); struct gsm_subscriber_connection *subscr_conn_lookup_iu(struct gsm_network *network, - struct ue_conn_ctx *ue); + struct ranap_ue_conn_ctx *ue); diff --git a/include/openbsc/iucs_ranap.h b/include/openbsc/iucs_ranap.h index 748de23..c2ff5f9 100644 --- a/include/openbsc/iucs_ranap.h +++ b/include/openbsc/iucs_ranap.h @@ -1,7 +1,7 @@ #pragma once struct gsm_network; -struct ue_conn_ctx; +struct ranap_ue_conn_ctx; int iucs_rx_ranap_event(struct gsm_network *network, - struct ue_conn_ctx *ue_ctx, int type, void *data); + struct ranap_ue_conn_ctx *ue_ctx, int type, void *data); diff --git a/include/openbsc/sgsn.h b/include/openbsc/sgsn.h index 57b2978..f371dc6 100644 --- a/include/openbsc/sgsn.h +++ b/include/openbsc/sgsn.h @@ -112,7 +112,7 @@ } dcomp_v42bis; struct { - enum nsap_addr_enc rab_assign_addr_enc; + int rab_assign_addr_enc; } iu; }; diff --git a/src/Makefile.am b/src/Makefile.am index 7e9e1dc..bd69738 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -31,13 +31,6 @@ libcommon-cs \ $(NULL) -# Conditional Libraries -if BUILD_IU -SUBDIRS += \ - libiu \ - $(NULL) -endif - # Programs SUBDIRS += \ osmo-msc \ diff --git a/src/gprs/Makefile.am b/src/gprs/Makefile.am index e05eb79..39a4c12 100644 --- a/src/gprs/Makefile.am +++ b/src/gprs/Makefile.am @@ -106,7 +106,6 @@ $(NULL) if BUILD_IU osmo_sgsn_LDADD += \ - $(top_builddir)/src/libiu/libiu.a \ $(LIBOSMOSIGTRAN_LIBS) \ $(LIBOSMORANAP_LIBS) \ $(LIBASN1C_LIBS) \ diff --git a/src/gprs/gprs_gmm.c b/src/gprs/gprs_gmm.c index 15e2fed..032137f 100644 --- a/src/gprs/gprs_gmm.c +++ b/src/gprs/gprs_gmm.c @@ -52,6 +52,7 @@ #ifdef BUILD_IU #include #include +#include #endif #include @@ -67,7 +68,6 @@ #include #include #include -#include #include #include @@ -174,7 +174,7 @@ #ifdef BUILD_IU int sgsn_ranap_rab_ass_resp(struct sgsn_mm_ctx *ctx, RANAP_RAB_SetupOrModifiedItemIEs_t *setup_ies); -int sgsn_ranap_iu_event(struct ue_conn_ctx *ctx, enum iu_event_type type, void *data) +int sgsn_ranap_iu_event(struct ranap_ue_conn_ctx *ctx, enum ranap_iu_event_type type, void *data) { struct sgsn_mm_ctx *mm; int rc = -1; @@ -188,14 +188,14 @@ } switch (type) { - case IU_EVENT_RAB_ASSIGN: + case RANAP_IU_EVENT_RAB_ASSIGN: REQUIRE_MM rc = sgsn_ranap_rab_ass_resp(mm, (RANAP_RAB_SetupOrModifiedItemIEs_t *)data); break; - case IU_EVENT_IU_RELEASE: + case RANAP_IU_EVENT_IU_RELEASE: /* fall thru */ - case IU_EVENT_LINK_INVALIDATED: - /* Clean up ue_conn_ctx here */ + case RANAP_IU_EVENT_LINK_INVALIDATED: + /* Clean up ranap_ue_conn_ctx here */ if (mm) LOGMMCTXP(LOGL_INFO, mm, "IU release for imsi %s\n", mm->imsi); else @@ -205,7 +205,7 @@ mmctx_set_pmm_state(mm, PMM_IDLE); rc = 0; break; - case IU_EVENT_SECURITY_MODE_COMPLETE: + case RANAP_IU_EVENT_SECURITY_MODE_COMPLETE: REQUIRE_MM /* Continue authentication here */ mm->iu.ue_ctx->integrity_active = 1; @@ -262,16 +262,16 @@ rate_ctr_inc(&mm->ctrg->ctr[GMM_CTR_PKTS_SIG_OUT]); #ifdef BUILD_IU if (mm->ran_type == MM_CTX_T_UTRAN_Iu) - return iu_tx(msg, GPRS_SAPI_GMM); + return ranap_iu_tx(msg, GPRS_SAPI_GMM); #endif } #ifdef BUILD_IU - /* In Iu mode, msg->dst contains the ue_conn_ctx pointer, in Gb mode + /* In Iu mode, msg->dst contains the ranap_ue_conn_ctx pointer, in Gb mode * dst is empty. */ /* FIXME: have a more explicit indicator for Iu messages */ if (msg->dst) - return iu_tx(msg, GPRS_SAPI_GMM); + return ranap_iu_tx(msg, GPRS_SAPI_GMM); #endif /* caller needs to provide TLLI, BVCI and NSEI */ @@ -296,9 +296,12 @@ /* In case a Iu connection is reconnected we need to update the ue ctx */ mm->iu.ue_ctx = msg->dst; if (mm->ran_type == MM_CTX_T_UTRAN_Iu - && mm->iu.ue_ctx) + && mm->iu.ue_ctx) { +#ifdef BUILD_IU mm->iu.ue_ctx->rab_assign_addr_enc = sgsn->cfg.iu.rab_assign_addr_enc; +#endif + } } /* Store BVCI/NSEI in MM context */ @@ -1048,7 +1051,7 @@ /* The MS is authorized */ #ifdef BUILD_IU if (ctx->ran_type == MM_CTX_T_UTRAN_Iu && !ctx->iu.ue_ctx->integrity_active) { - rc = iu_tx_sec_mode_cmd(ctx->iu.ue_ctx, &ctx->auth_triplet, 0, ctx->iu.new_key); + rc = ranap_iu_tx_sec_mode_cmd(ctx->iu.ue_ctx, &ctx->auth_triplet.vec, 0, ctx->iu.new_key); ctx->iu.new_key = 0; return rc; } @@ -1259,14 +1262,20 @@ * with a foreign TLLI (P-TMSI that was allocated to the MS before), * or with random TLLI. */ - /* In Iu mode, msg->dst contains the ue_conn_ctx pointer, in Gb mode + /* In Iu mode, msg->dst contains the ranap_ue_conn_ctx pointer, in Gb mode * dst is empty. */ /* FIXME: have a more explicit indicator for Iu messages */ if (!msg->dst) { /* Gb mode */ cid = bssgp_parse_cell_id(&ra_id, msgb_bcid(msg)); - } else - ra_id = ((struct ue_conn_ctx*)msg->dst)->ra_id; + } else { +#ifdef BUILD_IU + ra_id = ((struct ranap_ue_conn_ctx*)msg->dst)->ra_id; +#else + LOGMMCTXP(LOGL_ERROR, ctx, "Cannot handle Iu Attach Request, built without Iu support\n"); + return -ENOTSUP; +#endif + } /* MS network capability 10.5.5.12 */ msnc_len = *cur++; @@ -1627,7 +1636,7 @@ * is an optimization to avoid the RA reject (impl detached) * below, which will cause a new attach cycle. */ /* Look-up the MM context based on old RA-ID and TLLI */ - /* In Iu mode, msg->dst contains the ue_conn_ctx pointer, in Gb + /* In Iu mode, msg->dst contains the ranap_ue_conn_ctx pointer, in Gb * mode dst is empty. */ /* FIXME: have a more explicit indicator for Iu messages */ if (!msg->dst) { @@ -2905,12 +2914,12 @@ { struct msgb *msg; struct sgsn_mm_ctx *mm = pdp->mm; - struct ue_conn_ctx *uectx; + struct ranap_ue_conn_ctx *uectx; uint32_t ggsn_ip; bool use_x213_nsap; uectx = mm->iu.ue_ctx; - use_x213_nsap = (uectx->rab_assign_addr_enc == NSAP_ADDR_ENC_X213); + use_x213_nsap = (uectx->rab_assign_addr_enc == RANAP_NSAP_ADDR_ENC_X213); /* Get the IP address for ggsn user plane */ memcpy(&ggsn_ip, pdp->lib->gsnru.v, pdp->lib->gsnru.l); @@ -2923,6 +2932,6 @@ msg = ranap_new_msg_rab_assign_data(rab_id, ggsn_ip, pdp->lib->teid_gn, use_x213_nsap); msg->l2h = msg->data; - return iu_rab_act(uectx, msg); + return ranap_iu_rab_act(uectx, msg); } #endif diff --git a/src/gprs/gprs_sgsn.c b/src/gprs/gprs_sgsn.c index 18625ae..340fcb0 100644 --- a/src/gprs/gprs_sgsn.c +++ b/src/gprs/gprs_sgsn.c @@ -30,6 +30,7 @@ #include #include #include +#include #include #include @@ -39,7 +40,6 @@ #include #include #include "openbsc/gprs_llc.h" -#include #include diff --git a/src/gprs/sgsn_libgtp.c b/src/gprs/sgsn_libgtp.c index 7595bf8..1da31d2 100644 --- a/src/gprs/sgsn_libgtp.c +++ b/src/gprs/sgsn_libgtp.c @@ -52,7 +52,7 @@ #include #ifdef BUILD_IU -#include +#include #include #endif @@ -533,7 +533,7 @@ } else { #ifdef BUILD_IU /* Deactivate radio bearer */ - iu_rab_deact(pctx->mm->iu.ue_ctx, 1); + ranap_iu_rab_deact(pctx->mm->iu.ue_ctx, 1); #else return -ENOTSUP; #endif @@ -672,7 +672,7 @@ #ifdef BUILD_IU /* Ignore the packet for now and page the UE to get the RAB * reestablished */ - iu_page_ps(mm->imsi, &mm->p_tmsi, mm->ra.lac, mm->ra.rac); + ranap_iu_page_ps(mm->imsi, &mm->p_tmsi, mm->ra.lac, mm->ra.rac); return 0; #else diff --git a/src/gprs/sgsn_main.c b/src/gprs/sgsn_main.c index 95b81bf..ca21151 100644 --- a/src/gprs/sgsn_main.c +++ b/src/gprs/sgsn_main.c @@ -52,13 +52,14 @@ #include +#include + #include #include #include #include #include #include -#include #include #include @@ -321,7 +322,7 @@ .num_cat = ARRAY_SIZE(gprs_categories), }; -int sgsn_ranap_iu_event(struct ue_conn_ctx *ctx, enum iu_event_type type, void *data); +int sgsn_ranap_iu_event(struct ue_conn_ctx *ctx, enum ranap_iu_event_type type, void *data); int main(int argc, char **argv) { @@ -449,7 +450,7 @@ return 8; } - iu_init(tall_bsc_ctx, sccp, gsm0408_gprs_rcvmsg_iu, sgsn_ranap_iu_event); + ranap_iu_init(tall_bsc_ctx, DRANAP, "OsmoSGSN-IuPS", sccp, gsm0408_gprs_rcvmsg_iu, sgsn_ranap_iu_event); #endif if (daemonize) { diff --git a/src/gprs/sgsn_vty.c b/src/gprs/sgsn_vty.c index 888f53a..8469b01 100644 --- a/src/gprs/sgsn_vty.c +++ b/src/gprs/sgsn_vty.c @@ -47,7 +47,7 @@ #include "../../bscconfig.h" #ifdef BUILD_IU -#include +#include #endif static struct sgsn_config *g_cfg = NULL; @@ -304,7 +304,7 @@ vty_out(vty, " no compression v42bis%s", VTY_NEWLINE); #ifdef BUILD_IU - iu_vty_config_write(vty, " "); + ranap_iu_vty_config_write(vty, " "); #endif return CMD_SUCCESS; @@ -1296,7 +1296,7 @@ install_element(SGSN_NODE, &cfg_comp_v42bisp_cmd); #ifdef BUILD_IU - iu_vty_init(SGSN_NODE, &g_cfg->iu.rab_assign_addr_enc); + ranap_iu_vty_init(SGSN_NODE, &g_cfg->iu.rab_assign_addr_enc); #endif return 0; } diff --git a/src/libiu/Makefile.am b/src/libiu/Makefile.am deleted file mode 100644 index e5f9e27..0000000 --- a/src/libiu/Makefile.am +++ /dev/null @@ -1,28 +0,0 @@ -AM_CPPFLAGS = \ - $(all_includes) \ - -I$(top_srcdir)/include \ - -I$(top_builddir) \ - $(NULL) - -AM_CFLAGS = \ - -Wall \ - $(COVERAGE_CFLAGS) \ - $(LIBCRYPTO_CFLAGS) \ - $(LIBASN1C_CFLAGS) \ - $(LIBOSMOCORE_CFLAGS) \ - $(LIBOSMOVTY_CFLAGS) \ - $(LIBOSMOGSM_CFLAGS) \ - $(LIBOSMOABIS_CFLAGS) \ - $(LIBOSMOSIGTRAN_CFLAGS) \ - $(LIBOSMORANAP_CFLAGS) \ - $(NULL) - -noinst_LIBRARIES = \ - libiu.a \ - $(NULL) - -libiu_a_SOURCES = \ - iu.c \ - iu_vty.c \ - $(NULL) - diff --git a/src/libiu/iu.c b/src/libiu/iu.c deleted file mode 100644 index 7794977..0000000 --- a/src/libiu/iu.c +++ /dev/null @@ -1,771 +0,0 @@ -/* Common parts of IuCS and IuPS interfaces implementation */ - -/* (C) 2016 by sysmocom s.f.m.c. GmbH - * All Rights Reserved - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - * - */ - -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include - -#include -#include - -#include -#include -#include -#include - -#include -#include -#include - -#include - -#include -#include -#include -#include - -#include - -/* Parsed global RNC id. See also struct RANAP_GlobalRNC_ID, and note that the - * PLMN identity is a BCD representation of the MCC and MNC. - * See iu_grnc_id_parse(). */ -struct iu_grnc_id { - uint16_t mcc; - uint16_t mnc; - uint16_t rnc_id; -}; - -/* A remote RNC (Radio Network Controller, like BSC but for UMTS) that has - * called us and is currently reachable at the given osmo_sccp_addr. So, when we - * know a LAC for a subscriber, we can page it at the RNC matching that LAC or - * RAC. An HNB-GW typically presents itself as if it were a single RNC, even - * though it may have several RNCs in hNodeBs connected to it. Those will then - * share the same RNC id, which they actually receive and adopt from the HNB-GW - * in the HNBAP HNB REGISTER ACCEPT message. */ -struct iu_rnc { - struct llist_head entry; - - uint16_t rnc_id; - uint16_t lac; /* Location Area Code (used for CS and PS) */ - uint8_t rac; /* Routing Area Code (used for PS only) */ - struct osmo_sccp_addr sccp_addr; -}; - -void *talloc_iu_ctx; - -/* Implement the extern asn_debug from libasn1c to indicate whether to print - * asn.1 debug messages (see libasn1c). */ -int asn_debug = 0; - -/* Implement the extern asn1_xer_print to indicate whether the ASN.1 binary - * code decoded and encoded during Iu communication should be logged to stderr - * (see asn.1 generated code in osmo-iuh). */ -int asn1_xer_print = 0; - -void *talloc_asn1_ctx; - -iu_recv_cb_t global_iu_recv_cb = NULL; -iu_event_cb_t global_iu_event_cb = NULL; - -static LLIST_HEAD(ue_conn_ctx_list); -static LLIST_HEAD(rnc_list); - -static struct osmo_sccp_instance *g_sccp; -static struct osmo_sccp_user *g_scu; - -const struct value_string iu_event_type_names[] = { - OSMO_VALUE_STRING(IU_EVENT_RAB_ASSIGN), - OSMO_VALUE_STRING(IU_EVENT_SECURITY_MODE_COMPLETE), - OSMO_VALUE_STRING(IU_EVENT_IU_RELEASE), - OSMO_VALUE_STRING(IU_EVENT_LINK_INVALIDATED), - { 0, NULL } -}; - -struct ue_conn_ctx *ue_conn_ctx_alloc(struct osmo_sccp_addr *addr, uint32_t conn_id) -{ - struct ue_conn_ctx *ctx = talloc_zero(talloc_iu_ctx, struct ue_conn_ctx); - - ctx->sccp_addr = *addr; - ctx->conn_id = conn_id; - llist_add(&ctx->list, &ue_conn_ctx_list); - - return ctx; -} - -struct ue_conn_ctx *ue_conn_ctx_find(uint32_t conn_id) -{ - struct ue_conn_ctx *ctx; - - llist_for_each_entry(ctx, &ue_conn_ctx_list, list) { - if (ctx->conn_id == conn_id) - return ctx; - } - return NULL; -} - -static struct iu_rnc *iu_rnc_alloc(uint16_t rnc_id, uint16_t lac, uint8_t rac, - struct osmo_sccp_addr *addr) -{ - struct iu_rnc *rnc = talloc_zero(talloc_iu_ctx, struct iu_rnc); - - rnc->rnc_id = rnc_id; - rnc->lac = lac; - rnc->rac = rac; - rnc->sccp_addr = *addr; - llist_add(&rnc->entry, &rnc_list); - - LOGP(DRANAP, LOGL_NOTICE, "New RNC %d (LAC=%d RAC=%d)\n", - rnc->rnc_id, rnc->lac, rnc->rac); - - return rnc; -} - -static struct iu_rnc *iu_rnc_register(uint16_t rnc_id, uint16_t lac, - uint8_t rac, struct osmo_sccp_addr *addr) -{ - struct iu_rnc *rnc; - llist_for_each_entry(rnc, &rnc_list, entry) { - if (rnc->rnc_id != rnc_id) - continue; - - /* We have this RNC Id registered already. Make sure that the - * details match. */ - - /* TODO should a mismatch be an error? */ - if (rnc->lac != lac || rnc->rac != rac) - LOGP(DRANAP, LOGL_NOTICE, "RNC %d changes its details:" - " LAC=%d RAC=%d --> LAC=%d RAC=%d\n", - rnc->rnc_id, rnc->lac, rnc->rac, - lac, rac); - rnc->lac = lac; - rnc->rac = rac; - - if (addr && memcmp(&rnc->sccp_addr, addr, sizeof(*addr))) - LOGP(DRANAP, LOGL_NOTICE, "RNC %d on New SCCP Addr %s" - " (LAC=%d RAC=%d)\n", - rnc->rnc_id, osmo_sccp_addr_dump(addr), rnc->lac, rnc->rac); - rnc->sccp_addr = *addr; - return rnc; - } - - /* Not found, make a new one. */ - return iu_rnc_alloc(rnc_id, lac, rac, addr); -} - -/*********************************************************************** - * RANAP handling - ***********************************************************************/ - -int iu_rab_act(struct ue_conn_ctx *ue_ctx, struct msgb *msg) -{ - struct osmo_scu_prim *prim; - - /* wrap RANAP message in SCCP N-DATA.req */ - prim = (struct osmo_scu_prim *) msgb_push(msg, sizeof(*prim)); - prim->u.data.conn_id = ue_ctx->conn_id; - osmo_prim_init(&prim->oph, - SCCP_SAP_USER, - OSMO_SCU_PRIM_N_DATA, - PRIM_OP_REQUEST, - msg); - return osmo_sccp_user_sap_down(g_scu, &prim->oph); -} - -int iu_rab_deact(struct ue_conn_ctx *ue_ctx, uint8_t rab_id) -{ - /* FIXME */ - return -1; -} - -int iu_tx_sec_mode_cmd(struct ue_conn_ctx *uectx, struct gsm_auth_tuple *tp, - int send_ck, int new_key) -{ - struct osmo_scu_prim *prim; - struct msgb *msg; - - /* create RANAP message */ - msg = ranap_new_msg_sec_mod_cmd(tp->vec.ik, send_ck? tp->vec.ck : NULL, - new_key ? RANAP_KeyStatus_new : RANAP_KeyStatus_old); - msg->l2h = msg->data; - /* wrap RANAP message in SCCP N-DATA.req */ - prim = (struct osmo_scu_prim *) msgb_push(msg, sizeof(*prim)); - prim->u.data.conn_id = uectx->conn_id; - osmo_prim_init(&prim->oph, SCCP_SAP_USER, - OSMO_SCU_PRIM_N_DATA, - PRIM_OP_REQUEST, msg); - osmo_sccp_user_sap_down(g_scu, &prim->oph); - - return 0; -} - -int iu_tx_common_id(struct ue_conn_ctx *uectx, const char *imsi) -{ - struct msgb *msg; - struct osmo_scu_prim *prim; - - LOGP(DRANAP, LOGL_INFO, "Transmitting RANAP CommonID (SCCP conn_id %u)\n", - uectx->conn_id); - - msg = ranap_new_msg_common_id(imsi); - msg->l2h = msg->data; - prim = (struct osmo_scu_prim *) msgb_push(msg, sizeof(*prim)); - prim->u.data.conn_id = uectx->conn_id; - osmo_prim_init(&prim->oph, SCCP_SAP_USER, - OSMO_SCU_PRIM_N_DATA, - PRIM_OP_REQUEST, msg); - osmo_sccp_user_sap_down(g_scu, &prim->oph); - return 0; -} - -static int iu_grnc_id_parse(struct iu_grnc_id *dst, - struct RANAP_GlobalRNC_ID *src) -{ - /* The size is coming from arbitrary sender, check it gracefully */ - if (src->pLMNidentity.size != 3) { - LOGP(DRANAP, LOGL_ERROR, "Invalid PLMN Identity size:" - " should be 3, is %d\n", src->pLMNidentity.size); - return -1; - } - gsm48_mcc_mnc_from_bcd(&src->pLMNidentity.buf[0], - &dst->mcc, &dst->mnc); - dst->rnc_id = (uint16_t)src->rNC_ID; - return 0; -} - -#if 0 - -- not used at present -- -static int iu_grnc_id_compose(struct iu_grnc_id *src, - struct RANAP_GlobalRNC_ID *dst) -{ - /* The caller must ensure proper size */ - OSMO_ASSERT(dst->pLMNidentity.size == 3); - gsm48_mcc_mnc_to_bcd(&dst->pLMNidentity.buf[0], - src->mcc, src->mnc); - dst->rNC_ID = src->rnc_id; - return 0; -} -#endif - -static int ranap_handle_co_initial_ue(void *ctx, RANAP_InitialUE_MessageIEs_t *ies) -{ - struct ue_conn_ctx *ue_conn = ctx; - struct gprs_ra_id ra_id; - struct iu_grnc_id grnc_id; - uint16_t sai; - struct msgb *msg = msgb_alloc(256, "RANAP->NAS"); - - if (ranap_parse_lai(&ra_id, &ies->lai) != 0) { - LOGP(DRANAP, LOGL_ERROR, "Failed to parse RANAP LAI IE\n"); - return -1; - } - - if (ies->presenceMask & INITIALUE_MESSAGEIES_RANAP_RAC_PRESENT) { - ra_id.rac = asn1str_to_u8(&ies->rac); - } - - if (iu_grnc_id_parse(&grnc_id, &ies->globalRNC_ID) != 0) { - LOGP(DRANAP, LOGL_ERROR, - "Failed to parse RANAP Global-RNC-ID IE\n"); - return -1; - } - - sai = asn1str_to_u16(&ies->sai.sAC); - msgb_gmmh(msg) = msgb_put(msg, ies->nas_pdu.size); - memcpy(msgb_gmmh(msg), ies->nas_pdu.buf, ies->nas_pdu.size); - - /* Make sure we know the RNC Id and LAC+RAC coming in on this connection. */ - iu_rnc_register(grnc_id.rnc_id, ra_id.lac, ra_id.rac, &ue_conn->sccp_addr); - ue_conn->ra_id = ra_id; - - /* Feed into the MM layer */ - msg->dst = ctx; - global_iu_recv_cb(msg, &ra_id, &sai); - - msgb_free(msg); - - return 0; -} - -static int ranap_handle_co_dt(void *ctx, RANAP_DirectTransferIEs_t *ies) -{ - struct gprs_ra_id _ra_id, *ra_id = NULL; - uint16_t _sai, *sai = NULL; - struct msgb *msg = msgb_alloc(256, "RANAP->NAS"); - - if (ies->presenceMask & DIRECTTRANSFERIES_RANAP_LAI_PRESENT) { - if (ranap_parse_lai(&_ra_id, &ies->lai) != 0) { - LOGP(DRANAP, LOGL_ERROR, "Failed to parse RANAP LAI IE\n"); - return -1; - } - ra_id = &_ra_id; - if (ies->presenceMask & DIRECTTRANSFERIES_RANAP_RAC_PRESENT) { - _ra_id.rac = asn1str_to_u8(&ies->rac); - } - if (ies->presenceMask & DIRECTTRANSFERIES_RANAP_SAI_PRESENT) { - _sai = asn1str_to_u16(&ies->sai.sAC); - sai = &_sai; - } - } - - msgb_gmmh(msg) = msgb_put(msg, ies->nas_pdu.size); - memcpy(msgb_gmmh(msg), ies->nas_pdu.buf, ies->nas_pdu.size); - - /* Feed into the MM/CC/SMS-CP layer */ - msg->dst = ctx; - global_iu_recv_cb(msg, ra_id, sai); - - msgb_free(msg); - - return 0; -} - -static int ranap_handle_co_err_ind(void *ctx, RANAP_ErrorIndicationIEs_t *ies) -{ - if (ies->presenceMask & ERRORINDICATIONIES_RANAP_CAUSE_PRESENT) - LOGP(DRANAP, LOGL_ERROR, "Rx Error Indication (%s)\n", - ranap_cause_str(&ies->cause)); - else - LOGP(DRANAP, LOGL_ERROR, "Rx Error Indication\n"); - - return 0; -} - -int iu_tx(struct msgb *msg_nas, uint8_t sapi) -{ - struct ue_conn_ctx *uectx = msg_nas->dst; - struct msgb *msg; - struct osmo_scu_prim *prim; - - LOGP(DRANAP, LOGL_INFO, "Transmitting L3 Message as RANAP DT (SCCP conn_id %u)\n", - uectx->conn_id); - - msg = ranap_new_msg_dt(sapi, msg_nas->data, msgb_length(msg_nas)); - msgb_free(msg_nas); - msg->l2h = msg->data; - prim = (struct osmo_scu_prim *) msgb_push(msg, sizeof(*prim)); - prim->u.data.conn_id = uectx->conn_id; - osmo_prim_init(&prim->oph, SCCP_SAP_USER, - OSMO_SCU_PRIM_N_DATA, - PRIM_OP_REQUEST, msg); - osmo_sccp_user_sap_down(g_scu, &prim->oph); - return 0; -} - -/* Send Iu Release for the given UE connection. - * If cause is NULL, the standard "No remaining RAB" cause is sent, otherwise - * the provided cause. */ -int iu_tx_release(struct ue_conn_ctx *ctx, const struct RANAP_Cause *cause) -{ - struct msgb *msg; - struct osmo_scu_prim *prim; - static const struct RANAP_Cause default_cause = { - .present = RANAP_Cause_PR_radioNetwork, - .choice.radioNetwork = RANAP_CauseRadioNetwork_no_remaining_rab, - }; - - if (!cause) - cause = &default_cause; - - LOGP(DRANAP, LOGL_INFO, "Transmitting Iu Release (SCCP conn_id %u)\n", - ctx->conn_id); - - msg = ranap_new_msg_iu_rel_cmd(cause); - msg->l2h = msg->data; - prim = (struct osmo_scu_prim *) msgb_push(msg, sizeof(*prim)); - prim->u.data.conn_id = ctx->conn_id; - osmo_prim_init(&prim->oph, SCCP_SAP_USER, - OSMO_SCU_PRIM_N_DATA, - PRIM_OP_REQUEST, msg); - return osmo_sccp_user_sap_down(g_scu, &prim->oph); -} - -static int ranap_handle_co_iu_rel_req(struct ue_conn_ctx *ctx, RANAP_Iu_ReleaseRequestIEs_t *ies) -{ - LOGP(DRANAP, LOGL_INFO, "Received Iu Release Request, Sending Release Command\n"); - iu_tx_release(ctx, &ies->cause); - return 0; -} - -static int ranap_handle_co_rab_ass_resp(struct ue_conn_ctx *ctx, RANAP_RAB_AssignmentResponseIEs_t *ies) -{ - int rc = -1; - - LOGP(DRANAP, LOGL_INFO, - "Rx RAB Assignment Response for UE conn_id %u\n", ctx->conn_id); - if (ies->presenceMask & RAB_ASSIGNMENTRESPONSEIES_RANAP_RAB_SETUPORMODIFIEDLIST_PRESENT) { - /* TODO: Iterate over list of SetupOrModifiedList IEs and handle each one */ - RANAP_IE_t *ranap_ie = ies->raB_SetupOrModifiedList.raB_SetupOrModifiedList_ies.list.array[0]; - RANAP_RAB_SetupOrModifiedItemIEs_t setup_ies; - - rc = ranap_decode_rab_setupormodifieditemies_fromlist(&setup_ies, &ranap_ie->value); - if (rc) { - LOGP(DRANAP, LOGL_ERROR, "Error in ranap_decode_rab_setupormodifieditemies()\n"); - return rc; - } - - rc = global_iu_event_cb(ctx, IU_EVENT_RAB_ASSIGN, &setup_ies); - - ranap_free_rab_setupormodifieditemies(&setup_ies); - } - /* FIXME: handle RAB Ass failure? */ - - return rc; -} - -/* Entry point for connection-oriented RANAP message */ -static void cn_ranap_handle_co(void *ctx, ranap_message *message) -{ - int rc; - - LOGP(DRANAP, LOGL_NOTICE, "handle_co(dir=%u, proc=%u)\n", message->direction, message->procedureCode); - - switch (message->direction) { - case RANAP_RANAP_PDU_PR_initiatingMessage: - switch (message->procedureCode) { - case RANAP_ProcedureCode_id_InitialUE_Message: - rc = ranap_handle_co_initial_ue(ctx, &message->msg.initialUE_MessageIEs); - break; - case RANAP_ProcedureCode_id_DirectTransfer: - rc = ranap_handle_co_dt(ctx, &message->msg.directTransferIEs); - break; - case RANAP_ProcedureCode_id_ErrorIndication: - rc = ranap_handle_co_err_ind(ctx, &message->msg.errorIndicationIEs); - break; - case RANAP_ProcedureCode_id_Iu_ReleaseRequest: - /* Iu Release Request */ - rc = ranap_handle_co_iu_rel_req(ctx, &message->msg.iu_ReleaseRequestIEs); - break; - default: - LOGP(DRANAP, LOGL_ERROR, "Received Initiating Message: unknown Procedure Code %d\n", - message->procedureCode); - rc = -1; - break; - } - break; - case RANAP_RANAP_PDU_PR_successfulOutcome: - switch (message->procedureCode) { - case RANAP_ProcedureCode_id_SecurityModeControl: - /* Security Mode Complete */ - rc = global_iu_event_cb(ctx, IU_EVENT_SECURITY_MODE_COMPLETE, NULL); - break; - case RANAP_ProcedureCode_id_Iu_Release: - /* Iu Release Complete */ - rc = global_iu_event_cb(ctx, IU_EVENT_IU_RELEASE, NULL); - if (rc) { - LOGP(DRANAP, LOGL_ERROR, "Iu Release event: Iu Event callback returned %d\n", - rc); - } - break; - default: - LOGP(DRANAP, LOGL_ERROR, "Received Successful Outcome: unknown Procedure Code %d\n", - message->procedureCode); - rc = -1; - break; - } - break; - case RANAP_RANAP_PDU_PR_outcome: - switch (message->procedureCode) { - case RANAP_ProcedureCode_id_RAB_Assignment: - /* RAB Assignment Response */ - rc = ranap_handle_co_rab_ass_resp(ctx, &message->msg.raB_AssignmentResponseIEs); - break; - default: - LOGP(DRANAP, LOGL_ERROR, "Received Outcome: unknown Procedure Code %d\n", - message->procedureCode); - rc = -1; - break; - } - break; - case RANAP_RANAP_PDU_PR_unsuccessfulOutcome: - default: - LOGP(DRANAP, LOGL_ERROR, "Received Unsuccessful Outcome: Procedure Code %d\n", - message->procedureCode); - rc = -1; - break; - } - - if (rc) { - LOGP(DRANAP, LOGL_ERROR, "Error in cn_ranap_handle_co (%d)\n", - rc); - /* TODO handling of the error? */ - } -} - -static int ranap_handle_cl_reset_req(void *ctx, RANAP_ResetIEs_t *ies) -{ - /* FIXME: send reset response */ - return -1; -} - -static int ranap_handle_cl_err_ind(void *ctx, RANAP_ErrorIndicationIEs_t *ies) -{ - if (ies->presenceMask & ERRORINDICATIONIES_RANAP_CAUSE_PRESENT) - LOGP(DRANAP, LOGL_ERROR, "Rx Error Indication (%s)\n", - ranap_cause_str(&ies->cause)); - else - LOGP(DRANAP, LOGL_ERROR, "Rx Error Indication\n"); - - return 0; -} - -/* Entry point for connection-less RANAP message */ -static void cn_ranap_handle_cl(void *ctx, ranap_message *message) -{ - int rc; - - switch (message->direction) { - case RANAP_RANAP_PDU_PR_initiatingMessage: - switch (message->procedureCode) { - case RANAP_ProcedureCode_id_Reset: - /* received reset.req, send reset.resp */ - rc = ranap_handle_cl_reset_req(ctx, &message->msg.resetIEs); - break; - case RANAP_ProcedureCode_id_ErrorIndication: - rc = ranap_handle_cl_err_ind(ctx, &message->msg.errorIndicationIEs); - break; - default: - rc = -1; - break; - } - break; - case RANAP_RANAP_PDU_PR_successfulOutcome: - case RANAP_RANAP_PDU_PR_unsuccessfulOutcome: - case RANAP_RANAP_PDU_PR_outcome: - default: - rc = -1; - break; - } - - if (rc) { - LOGP(DRANAP, LOGL_ERROR, "Error in cn_ranap_handle_cl (%d)\n", - rc); - /* TODO handling of the error? */ - } -} - -/*********************************************************************** - * Paging - ***********************************************************************/ - -struct osmo_sccp_addr local_sccp_addr = { - .presence = OSMO_SCCP_ADDR_T_SSN | OSMO_SCCP_ADDR_T_PC, - .ri = OSMO_SCCP_RI_SSN_PC, - .ssn = OSMO_SCCP_SSN_RANAP, - .pc = 1, -}; - -/* Send a paging command down a given SCCP User. tmsi and paging_cause are - * optional and may be passed NULL and 0, respectively, to disable their use. - * See enum RANAP_PagingCause. - * - * If TMSI is given, the IMSI is not sent over the air interface. Nevertheless, - * the IMSI is still required for resolution in the HNB-GW and/or(?) RNC. */ -static int iu_tx_paging_cmd(struct osmo_sccp_addr *called_addr, - const char *imsi, const uint32_t *tmsi, - bool is_ps, uint32_t paging_cause) -{ - struct msgb *msg; - msg = ranap_new_msg_paging_cmd(imsi, tmsi, is_ps? 1 : 0, paging_cause); - msg->l2h = msg->data; - osmo_sccp_tx_unitdata_msg(g_scu, &local_sccp_addr, called_addr, msg); - return 0; -} - -static int iu_page(const char *imsi, const uint32_t *tmsi_or_ptimsi, - uint16_t lac, uint8_t rac, bool is_ps) -{ - struct iu_rnc *rnc; - int pagings_sent = 0; - - if (tmsi_or_ptimsi) { - LOGP(DRANAP, LOGL_DEBUG, "%s: Looking for RNCs to page for IMSI %s" - " (paging will use %s %x)\n", - is_ps? "IuPS" : "IuCS", - imsi, - is_ps? "PTMSI" : "TMSI", - *tmsi_or_ptimsi); - } else { - LOGP(DRANAP, LOGL_DEBUG, "%s: Looking for RNCs to page for IMSI %s" - " (paging will use IMSI)\n", - is_ps? "IuPS" : "IuCS", - imsi - ); - } - - llist_for_each_entry(rnc, &rnc_list, entry) { - if (rnc->lac != lac) - continue; - if (is_ps && rnc->rac != rac) - continue; - - /* Found a match! */ - if (iu_tx_paging_cmd(&rnc->sccp_addr, imsi, tmsi_or_ptimsi, is_ps, 0) - == 0) { - LOGP(DRANAP, LOGL_DEBUG, - "%s: Paged for IMSI %s on RNC %d, on SCCP addr %s\n", - is_ps? "IuPS" : "IuCS", - imsi, rnc->rnc_id, osmo_sccp_addr_dump(&rnc->sccp_addr)); - pagings_sent ++; - } - } - - /* Some logging... */ - if (pagings_sent > 0) { - LOGP(DRANAP, LOGL_DEBUG, - "%s: %d RNCs were paged for IMSI %s.\n", - is_ps? "IuPS" : "IuCS", - pagings_sent, imsi); - } - else { - if (is_ps) { - LOGP(DRANAP, LOGL_ERROR, "IuPS: Found no RNC to page for" - " LAC %d RAC %d (would have paged IMSI %s)\n", - lac, rac, imsi); - } - else { - LOGP(DRANAP, LOGL_ERROR, "IuCS: Found no RNC to page for" - " LAC %d (would have paged IMSI %s)\n", - lac, imsi); - } - } - - return pagings_sent; -} - -int iu_page_cs(const char *imsi, const uint32_t *tmsi, uint16_t lac) -{ - return iu_page(imsi, tmsi, lac, 0, false); -} - -int iu_page_ps(const char *imsi, const uint32_t *ptmsi, uint16_t lac, uint8_t rac) -{ - return iu_page(imsi, ptmsi, lac, rac, true); -} - - -/*********************************************************************** - * - ***********************************************************************/ - -int tx_unitdata(struct osmo_sccp_user *scu); -int tx_conn_req(struct osmo_sccp_user *scu, uint32_t conn_id); - -struct osmo_prim_hdr *make_conn_req(uint32_t conn_id); -struct osmo_prim_hdr *make_dt1_req(uint32_t conn_id, const uint8_t *data, unsigned int len); - -struct osmo_prim_hdr *make_conn_resp(struct osmo_scu_connect_param *param) -{ - struct msgb *msg = msgb_alloc(1024, "conn_resp"); - struct osmo_scu_prim *prim; - - prim = (struct osmo_scu_prim *) msgb_put(msg, sizeof(*prim)); - osmo_prim_init(&prim->oph, SCCP_SAP_USER, - OSMO_SCU_PRIM_N_CONNECT, - PRIM_OP_RESPONSE, msg); - memcpy(&prim->u.connect, param, sizeof(prim->u.connect)); - return &prim->oph; -} - -static int sccp_sap_up(struct osmo_prim_hdr *oph, void *_scu) -{ - struct osmo_sccp_user *scu = _scu; - struct osmo_scu_prim *prim = (struct osmo_scu_prim *) oph; - struct osmo_prim_hdr *resp = NULL; - int rc; - struct ue_conn_ctx *ue; - - DEBUGP(DRANAP, "sccp_sap_up(%s)\n", osmo_scu_prim_name(oph)); - - switch (OSMO_PRIM_HDR(oph)) { - case OSMO_PRIM(OSMO_SCU_PRIM_N_CONNECT, PRIM_OP_CONFIRM): - /* confirmation of outbound connection */ - rc = -1; - break; - case OSMO_PRIM(OSMO_SCU_PRIM_N_CONNECT, PRIM_OP_INDICATION): - /* indication of new inbound connection request*/ - DEBUGP(DRANAP, "N-CONNECT.ind(X->%u)\n", prim->u.connect.conn_id); - if (/* prim->u.connect.called_addr.ssn != OSMO_SCCP_SSN_RANAP || */ - !msgb_l2(oph->msg) || msgb_l2len(oph->msg) == 0) { - LOGP(DRANAP, LOGL_NOTICE, - "Received invalid N-CONNECT.ind\n"); - return 0; - } - ue = ue_conn_ctx_alloc(&prim->u.connect.calling_addr, prim->u.connect.conn_id); - /* first ensure the local SCCP socket is ACTIVE */ - resp = make_conn_resp(&prim->u.connect); - osmo_sccp_user_sap_down(scu, resp); - /* then handle the RANAP payload */ - rc = ranap_cn_rx_co(cn_ranap_handle_co, ue, msgb_l2(oph->msg), msgb_l2len(oph->msg)); - break; - case OSMO_PRIM(OSMO_SCU_PRIM_N_DISCONNECT, PRIM_OP_INDICATION): - /* indication of disconnect */ - DEBUGP(DRANAP, "N-DISCONNECT.ind(%u)\n", - prim->u.disconnect.conn_id); - ue = ue_conn_ctx_find(prim->u.disconnect.conn_id); - rc = ranap_cn_rx_co(cn_ranap_handle_co, ue, msgb_l2(oph->msg), msgb_l2len(oph->msg)); - break; - case OSMO_PRIM(OSMO_SCU_PRIM_N_DATA, PRIM_OP_INDICATION): - /* connection-oriented data received */ - DEBUGP(DRANAP, "N-DATA.ind(%u, %s)\n", prim->u.data.conn_id, - osmo_hexdump(msgb_l2(oph->msg), msgb_l2len(oph->msg))); - /* resolve UE context */ - ue = ue_conn_ctx_find(prim->u.data.conn_id); - rc = ranap_cn_rx_co(cn_ranap_handle_co, ue, msgb_l2(oph->msg), msgb_l2len(oph->msg)); - break; - case OSMO_PRIM(OSMO_SCU_PRIM_N_UNITDATA, PRIM_OP_INDICATION): - /* connection-less data received */ - DEBUGP(DRANAP, "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)); - break; - default: - rc = -1; - break; - } - - msgb_free(oph->msg); - return rc; -} - -int iu_init(void *ctx, struct osmo_sccp_instance *sccp, - iu_recv_cb_t iu_recv_cb, iu_event_cb_t iu_event_cb) -{ - talloc_iu_ctx = talloc_named_const(ctx, 1, "iu"); - talloc_asn1_ctx = talloc_named_const(talloc_iu_ctx, 1, "asn1"); - - global_iu_recv_cb = iu_recv_cb; - global_iu_event_cb = iu_event_cb; - g_sccp = sccp; - g_scu = osmo_sccp_user_bind(g_sccp, "OsmoMSC-Iu", sccp_sap_up, OSMO_SCCP_SSN_RANAP); - - return 0; -} - diff --git a/src/libiu/iu_vty.c b/src/libiu/iu_vty.c deleted file mode 100644 index 0b42e34..0000000 --- a/src/libiu/iu_vty.c +++ /dev/null @@ -1,130 +0,0 @@ -/* OpenBSC Iu related interface to quagga VTY */ -/* (C) 2016 by sysmocom s.m.f.c. GmbH - * All Rights Reserved - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - * - */ - -#include -#include - -#include -#include -#include -#include -#include - -#include - -static enum nsap_addr_enc *g_rab_assign_addr_enc = NULL; - -DEFUN(logging_asn_debug, - logging_asn_debug_cmd, - "logging asn1-debug (1|0)", - LOGGING_STR - "Log ASN.1 debug messages to stderr\n" - "Log ASN.1 debug messages to stderr\n" - "Do not log ASN.1 debug messages to stderr\n") -{ - asn_debug = atoi(argv[0]); - return CMD_SUCCESS; -} - -DEFUN(logging_asn_xer_print, - logging_asn_xer_print_cmd, - "logging asn1-xer-print (1|0)", - LOGGING_STR - "Log human readable representations of all ASN.1 messages to stderr\n" - "Log decoded ASN.1 messages to stderr\n" - "Do not log decoded ASN.1 messages to stderr\n") -{ - asn1_xer_print = atoi(argv[0]); - return CMD_SUCCESS; -} - -#define IU_STR "Iu interface protocol options\n" -DEFUN(cfg_iu_rab_assign_addr_enc, cfg_iu_rab_assign_addr_enc_cmd, - "iu rab-assign-addr-enc (x213|v4raw)", - IU_STR - "Choose RAB Assignment's Transport Layer Address encoding\n" - "ITU-T X.213 compliant address encoding (default)\n" - "32bit length raw IPv4 address (for ip.access nano3G)\n") -{ - if (!g_rab_assign_addr_enc) { - vty_out(vty, "%%RAB Assignment Transport Layer Address" - " encoding not available%s", VTY_NEWLINE); - return CMD_WARNING; - } - - if (strcmp(argv[0], "v4raw") == 0) - *g_rab_assign_addr_enc = NSAP_ADDR_ENC_V4RAW; - else - *g_rab_assign_addr_enc = NSAP_ADDR_ENC_X213; - return CMD_SUCCESS; -} - -extern struct osmo_sccp_addr local_sccp_addr; - -DEFUN(cfg_iu_local_addr_pc, cfg_iu_local_addr_pc_cmd, - "iu local-address point-code PC", - IU_STR "Local SCCP Address\n") -{ - local_sccp_addr.presence = OSMO_SCCP_ADDR_T_PC | OSMO_SCCP_ADDR_T_SSN; - local_sccp_addr.ri = OSMO_SCCP_RI_SSN_PC; - local_sccp_addr.pc = osmo_ss7_pointcode_parse(NULL, argv[0]); - - return CMD_SUCCESS; -} - -/* TODO: GT address configuration, in line with 4.5.1.1.1 of TS 25.410 */ - -int iu_vty_config_write(struct vty *vty, const char *indent) -{ - if (!g_rab_assign_addr_enc) { - vty_out(vty, "%%RAB Assignment Transport Layer Address" - " encoding not available%s", VTY_NEWLINE); - return CMD_WARNING; - } - - switch (*g_rab_assign_addr_enc) { - case NSAP_ADDR_ENC_V4RAW: - vty_out(vty, "%siu rab-assign-addr-enc v4raw%s", indent, - VTY_NEWLINE); - break; - case NSAP_ADDR_ENC_X213: - /* default value, no need to write anything */ - break; - default: - LOGP(0, LOGL_ERROR, "Invalid value for" - " net.iu.rab_assign_addr_enc: %d\n", - *g_rab_assign_addr_enc); - return CMD_WARNING; - } - - vty_out(vty, "%siu local-address point-code %s%s", indent, - osmo_ss7_pointcode_print(NULL, local_sccp_addr.pc), VTY_NEWLINE); - - return CMD_SUCCESS; -} - -void iu_vty_init(int iu_parent_node, enum nsap_addr_enc *rab_assign_addr_enc) -{ - g_rab_assign_addr_enc = rab_assign_addr_enc; - - install_element(CFG_LOG_NODE, &logging_asn_debug_cmd); - install_element(CFG_LOG_NODE, &logging_asn_xer_print_cmd); - install_element(iu_parent_node, &cfg_iu_rab_assign_addr_enc_cmd); - install_element(iu_parent_node, &cfg_iu_local_addr_pc_cmd); -} diff --git a/src/libmsc/Makefile.am b/src/libmsc/Makefile.am index 7669666..9083530 100644 --- a/src/libmsc/Makefile.am +++ b/src/libmsc/Makefile.am @@ -34,8 +34,6 @@ gsm_04_11.c \ gsm_04_80.c \ gsm_subscriber.c \ - iucs.c \ - iucs_ranap.c \ mncc.c \ mncc_builtin.c \ mncc_sock.c \ @@ -51,7 +49,12 @@ meas_feed.c \ subscr_conn.c \ $(NULL) -if !BUILD_IU +if BUILD_IU +libmsc_a_SOURCES += \ + iucs.c \ + iucs_ranap.c \ + $(NULL) +else libmsc_a_SOURCES += \ iu_dummy.c \ $(NULL) diff --git a/src/libmsc/a_iface_bssap.c b/src/libmsc/a_iface_bssap.c index 561ccde..e8a2293 100644 --- a/src/libmsc/a_iface_bssap.c +++ b/src/libmsc/a_iface_bssap.c @@ -29,7 +29,6 @@ #include #include #include -#include #include #include #include diff --git a/src/libmsc/gsm_04_08.c b/src/libmsc/gsm_04_08.c index 631bb98..be23c64 100644 --- a/src/libmsc/gsm_04_08.c +++ b/src/libmsc/gsm_04_08.c @@ -71,13 +71,11 @@ #include #include #include - -#include - #ifdef BUILD_IU -#include +#include #endif +#include #include #include @@ -3401,7 +3399,7 @@ #ifdef BUILD_IU DEBUGP(DMM, "-> SECURITY MODE CONTROL %s\n", vlr_subscr_name(conn->vsub)); - return iu_tx_sec_mode_cmd(conn->iu.ue_ctx, tuple, 0, 1); + return ranap_iu_tx_sec_mode_cmd(conn->iu.ue_ctx, &tuple->vec, 0, 1); #else LOGP(DMM, LOGL_ERROR, "Cannot send Security Mode Control over RAN_UTRAN_IU," " built without Iu support\n"); diff --git a/src/libmsc/gsm_subscriber.c b/src/libmsc/gsm_subscriber.c index 73361a1..09540c1 100644 --- a/src/libmsc/gsm_subscriber.c +++ b/src/libmsc/gsm_subscriber.c @@ -20,6 +20,8 @@ * */ +#include "../../bscconfig.h" + #include #include #include @@ -32,6 +34,12 @@ #include +#ifdef BUILD_IU +#include +#else +#include +#endif + #include #include #include @@ -40,7 +48,6 @@ #include #include #include -#include #include #include #include @@ -108,10 +115,10 @@ case RAN_GERAN_A: return a_iface_tx_paging(vsub->imsi, vsub->tmsi, vsub->lac); case RAN_UTRAN_IU: - return iu_page_cs(vsub->imsi, - vsub->tmsi == GSM_RESERVED_TMSI? - NULL : &vsub->tmsi, - vsub->lac); + return ranap_iu_page_cs(vsub->imsi, + vsub->tmsi == GSM_RESERVED_TMSI? + NULL : &vsub->tmsi, + vsub->lac); default: break; } diff --git a/src/libmsc/iu_dummy.c b/src/libmsc/iu_dummy.c index 1f5dffb..e9d335e 100644 --- a/src/libmsc/iu_dummy.c +++ b/src/libmsc/iu_dummy.c @@ -26,39 +26,39 @@ #include "../../bscconfig.h" #ifndef BUILD_IU -#include -#include +#include #include #include #include struct msgb; -struct ue_conn_ctx; +struct ranap_ue_conn_ctx; struct gsm_auth_tuple; struct RANAP_Cause; +struct osmo_auth_vector; -int iu_tx(struct msgb *msg, uint8_t sapi) +int ranap_iu_tx(struct msgb *msg, uint8_t sapi) { LOGP(DLGLOBAL, LOGL_INFO, "iu_tx() dummy called, NOT transmitting %d bytes: %s\n", msg->len, osmo_hexdump(msg->data, msg->len)); return 0; } -int iu_tx_sec_mode_cmd(struct ue_conn_ctx *uectx, struct gsm_auth_tuple *tp, - int send_ck) +int ranap_iu_tx_sec_mode_cmd(struct ranap_ue_conn_ctx *uectx, struct osmo_auth_vector *vec, + int send_ck) { LOGP(DLGLOBAL, LOGL_INFO, "iu_tx_sec_mode_cmd() dummy called, NOT transmitting Security Mode Command\n"); return 0; } -int iu_page_cs(const char *imsi, const uint32_t *tmsi, uint16_t lac) +int ranap_iu_page_cs(const char *imsi, const uint32_t *tmsi, uint16_t lac) { LOGP(DLGLOBAL, LOGL_INFO, "iu_page_cs() dummy called, NOT paging\n"); return 23; } -int iu_page_ps(const char *imsi, const uint32_t *ptmsi, uint16_t lac, uint8_t rac) +int ranap_iu_page_ps(const char *imsi, const uint32_t *ptmsi, uint16_t lac, uint8_t rac) { LOGP(DLGLOBAL, LOGL_INFO, "iu_page_ps() dummy called, NOT paging\n"); return 0; @@ -72,19 +72,19 @@ return NULL; } -int iu_rab_act(struct ue_conn_ctx *ue_ctx, struct msgb *msg) +int ranap_iu_rab_act(struct ranap_ue_conn_ctx *ue_ctx, struct msgb *msg) { LOGP(DLGLOBAL, LOGL_INFO, "iu_rab_act() dummy called, NOT activating RAB\n"); return 0; } -int iu_tx_common_id(struct ue_conn_ctx *uectx, const char *imsi) +int ranap_iu_tx_common_id(struct ranap_ue_conn_ctx *uectx, const char *imsi) { LOGP(DLGLOBAL, LOGL_INFO, "iu_tx_common_id() dummy called, NOT sending CommonID\n"); return 0; } -int iu_tx_release(struct ue_conn_ctx *ctx, const struct RANAP_Cause *cause) +int ranap_iu_tx_release(struct ranap_ue_conn_ctx *ctx, const struct RANAP_Cause *cause) { LOGP(DLGLOBAL, LOGL_INFO, "iu_tx_release() dummy called, NOT sending Release\n"); return 0; diff --git a/src/libmsc/iucs.c b/src/libmsc/iucs.c index be026c8..04b9ece 100644 --- a/src/libmsc/iucs.c +++ b/src/libmsc/iucs.c @@ -25,17 +25,17 @@ #include #include +#include #include #include -#include #include #include #include /* For A-interface see libbsc/bsc_api.c subscr_con_allocate() */ static struct gsm_subscriber_connection *subscr_conn_allocate_iu(struct gsm_network *network, - struct ue_conn_ctx *ue, + struct ranap_ue_conn_ctx *ue, uint16_t lac) { struct gsm_subscriber_connection *conn; @@ -57,7 +57,7 @@ return conn; } -static int same_ue_conn(struct ue_conn_ctx *a, struct ue_conn_ctx *b) +static int same_ue_conn(struct ranap_ue_conn_ctx *a, struct ranap_ue_conn_ctx *b) { if (a == b) return 1; @@ -103,7 +103,7 @@ * connection IDs, or return NULL if not found. */ struct gsm_subscriber_connection *subscr_conn_lookup_iu( struct gsm_network *network, - struct ue_conn_ctx *ue) + struct ranap_ue_conn_ctx *ue) { struct gsm_subscriber_connection *conn; @@ -126,7 +126,7 @@ } /* Receive MM/CC/... message from IuCS (SCCP user SAP). - * msg->dst must reference a struct ue_conn_ctx, which identifies the peer that + * msg->dst must reference a struct ranap_ue_conn_ctx, which identifies the peer that * sent the msg. * * For A-interface see libbsc/bsc_api.c gsm0408_rcvmsg(). */ @@ -134,10 +134,10 @@ uint16_t *lac) { int rc; - struct ue_conn_ctx *ue_ctx; + struct ranap_ue_conn_ctx *ue_ctx; struct gsm_subscriber_connection *conn; - ue_ctx = (struct ue_conn_ctx*)msg->dst; + ue_ctx = (struct ranap_ue_conn_ctx*)msg->dst; /* TODO: are there message types that could allow us to skip this * search? */ diff --git a/src/libmsc/iucs_ranap.c b/src/libmsc/iucs_ranap.c index c016474..45de1ca 100644 --- a/src/libmsc/iucs_ranap.c +++ b/src/libmsc/iucs_ranap.c @@ -27,11 +27,11 @@ #include #include +#include #include #include #include -#include #include #include #include @@ -67,7 +67,7 @@ } int iucs_rx_ranap_event(struct gsm_network *network, - struct ue_conn_ctx *ue_ctx, int type, void *data) + struct ranap_ue_conn_ctx *ue_ctx, int type, void *data) { struct gsm_subscriber_connection *conn; @@ -79,19 +79,19 @@ } switch (type) { - case IU_EVENT_IU_RELEASE: - case IU_EVENT_LINK_INVALIDATED: + case RANAP_IU_EVENT_IU_RELEASE: + case RANAP_IU_EVENT_LINK_INVALIDATED: LOGP(DIUCS, LOGL_INFO, "IuCS release for %s\n", vlr_subscr_name(conn->vsub)); msc_subscr_conn_close(conn, 0); return 0; - case IU_EVENT_SECURITY_MODE_COMPLETE: + case RANAP_IU_EVENT_SECURITY_MODE_COMPLETE: LOGP(DIUCS, LOGL_INFO, "IuCS security mode complete for %s\n", vlr_subscr_name(conn->vsub)); return iucs_rx_sec_mode_compl(conn, (RANAP_SecurityModeCompleteIEs_t*)data); - case IU_EVENT_RAB_ASSIGN: + case RANAP_IU_EVENT_RAB_ASSIGN: return iucs_rx_rab_assign(conn, (RANAP_RAB_SetupOrModifiedItemIEs_t*)data); default: diff --git a/src/libmsc/msc_ifaces.c b/src/libmsc/msc_ifaces.c index 7d2e898..262bf98 100644 --- a/src/libmsc/msc_ifaces.c +++ b/src/libmsc/msc_ifaces.c @@ -23,7 +23,6 @@ #include #include #include -#include #include #include #include @@ -34,10 +33,13 @@ #include "../../bscconfig.h" #ifdef BUILD_IU +#include extern struct msgb *ranap_new_msg_rab_assign_voice(uint8_t rab_id, uint32_t rtp_ip, uint16_t rtp_port, bool use_x213_nsap); +#else +#include #endif /* BUILD_IU */ static int msc_tx(struct gsm_subscriber_connection *conn, struct msgb *msg) @@ -57,7 +59,7 @@ case RAN_UTRAN_IU: msg->dst = conn->iu.ue_ctx; - return iu_tx(msg, 0); + return ranap_iu_tx(msg, 0); default: LOGP(DMSC, LOGL_ERROR, @@ -134,10 +136,10 @@ DEBUGP(DIUCS, "%s: tx CommonID %s\n", vlr_subscr_name(conn->vsub), conn->vsub->imsi); - return iu_tx_common_id(conn->iu.ue_ctx, conn->vsub->imsi); + return ranap_iu_tx_common_id(conn->iu.ue_ctx, conn->vsub->imsi); } -static int iu_rab_act_cs(struct ue_conn_ctx *uectx, uint8_t rab_id, +static int iu_rab_act_cs(struct ranap_ue_conn_ctx *uectx, uint8_t rab_id, uint32_t rtp_ip, uint16_t rtp_port) { #ifdef BUILD_IU @@ -145,7 +147,7 @@ bool use_x213_nsap; uint32_t conn_id = uectx->conn_id; - use_x213_nsap = (uectx->rab_assign_addr_enc == NSAP_ADDR_ENC_X213); + use_x213_nsap = (uectx->rab_assign_addr_enc == RANAP_NSAP_ADDR_ENC_X213); LOGP(DIUCS, LOGL_DEBUG, "Assigning RAB: conn_id=%u, rab_id=%d," " rtp=%x:%u, use_x213_nsap=%d\n", conn_id, rab_id, rtp_ip, @@ -155,7 +157,7 @@ use_x213_nsap); msg->l2h = msg->data; - if (iu_rab_act(uectx, msg)) + if (ranap_iu_rab_act(uectx, msg)) LOGP(DIUCS, LOGL_ERROR, "Failed to send RAB Assignment:" " conn_id=%d rab_id=%d rtp=%x:%u\n", conn_id, rab_id, rtp_ip, rtp_port); @@ -170,7 +172,6 @@ { struct gsm_trans *trans = priv; struct gsm_subscriber_connection *conn = trans->conn; - struct ue_conn_ctx *uectx = conn->iu.ue_ctx; uint32_t rtp_ip; int rc; @@ -195,7 +196,7 @@ if (trans->conn->via_ran == RAN_UTRAN_IU) { /* Assign a voice channel via RANAP on 3G */ - if (iu_rab_act_cs(uectx, conn->iu.rab_id, rtp_ip, conn->rtp.port_subscr)) + if (iu_rab_act_cs(conn->iu.ue_ctx, conn->iu.rab_id, rtp_ip, conn->rtp.port_subscr)) goto rab_act_cs_error; } else if (trans->conn->via_ran == RAN_GERAN_A) { /* Assign a voice channel via A on 2G */ @@ -234,7 +235,7 @@ mgcp = conn->network->mgcpgw.client; #ifdef BUILD_IU - /* FIXME: HACK. where to scope the RAB Id? At the conn / subscriber / ue_conn_ctx? */ + /* FIXME: HACK. where to scope the RAB Id? At the conn / subscriber / ranap_ue_conn_ctx? */ static uint8_t next_iu_rab_id = 1; if (conn->via_ran == RAN_UTRAN_IU) conn->iu.rab_id = next_iu_rab_id ++; diff --git a/src/libmsc/msc_vty.c b/src/libmsc/msc_vty.c index 01e7e82..6ae4529 100644 --- a/src/libmsc/msc_vty.c +++ b/src/libmsc/msc_vty.c @@ -23,15 +23,19 @@ /* NOTE: I would have liked to call this the MSC_NODE instead of the MSC_NODE, * but MSC_NODE already exists to configure a remote MSC for osmo-bsc. */ +#include "../../bscconfig.h" + #include #include +#ifdef BUILD_IU +#include +#endif #include #include #include #include -#include static struct cmd_node msc_node = { MSC_NODE, @@ -99,7 +103,7 @@ mgcpgw_client_config_write(vty, " "); #ifdef BUILD_IU - iu_vty_config_write(vty, " "); + ranap_iu_vty_config_write(vty, " "); #endif return CMD_SUCCESS; @@ -153,6 +157,6 @@ mgcpgw_client_vty_init(MSC_NODE, &msc_network->mgcpgw.conf); #ifdef BUILD_IU - iu_vty_init(MSC_NODE, &msc_network->iu.rab_assign_addr_enc); + ranap_iu_vty_init(MSC_NODE, &msc_network->iu.rab_assign_addr_enc); #endif } diff --git a/src/libmsc/osmo_msc.c b/src/libmsc/osmo_msc.c index 866cfbd..4d24f22 100644 --- a/src/libmsc/osmo_msc.c +++ b/src/libmsc/osmo_msc.c @@ -28,10 +28,16 @@ #include #include #include -#include #include #include + +#include "../../bscconfig.h" +#ifdef BUILD_IU +#include +#else +#include +#endif /* Receive a SAPI-N-REJECT from BSC */ void msc_sapi_n_reject(struct gsm_subscriber_connection *conn, int dlci) @@ -285,7 +291,7 @@ switch (conn->via_ran) { case RAN_UTRAN_IU: - iu_tx_release(conn->iu.ue_ctx, NULL); + ranap_iu_tx_release(conn->iu.ue_ctx, NULL); /* FIXME: keep the conn until the Iu Release Outcome is * received from the UE, or a timeout expires. For now, the log * says "unknown UE" for each release outcome. */ diff --git a/src/libmsc/subscr_conn.c b/src/libmsc/subscr_conn.c index cdeeae9..bcab8e4 100644 --- a/src/libmsc/subscr_conn.c +++ b/src/libmsc/subscr_conn.c @@ -30,9 +30,7 @@ #include #include #include -#include #include - #define SUBSCR_CONN_TIMEOUT 5 /* seconds */ diff --git a/src/osmo-msc/Makefile.am b/src/osmo-msc/Makefile.am index bd734d1..87b6133 100644 --- a/src/osmo-msc/Makefile.am +++ b/src/osmo-msc/Makefile.am @@ -50,7 +50,6 @@ $(NULL) if BUILD_IU osmo_msc_LDADD += \ - $(top_builddir)/src/libiu/libiu.a \ $(LIBOSMORANAP_LIBS) \ $(LIBASN1C_LIBS) \ $(NULL) diff --git a/src/osmo-msc/msc_main.c b/src/osmo-msc/msc_main.c index c65e446..688efb6 100644 --- a/src/osmo-msc/msc_main.c +++ b/src/osmo-msc/msc_main.c @@ -66,9 +66,11 @@ #include #include -#include +#ifdef BUILD_IU +#include +#endif -#include +#include #include #include #include @@ -313,6 +315,7 @@ .is_config_node = bsc_vty_is_config_node, }; +#ifdef BUILD_IU static int rcvmsg_iu_cs(struct msgb *msg, struct gprs_ra_id *ra_id, uint16_t *sai) { DEBUGP(DIUCS, "got IuCS message" @@ -327,14 +330,15 @@ return gsm0408_rcvmsg_iucs(msc_network, msg, ra_id? &ra_id->lac : NULL); } -static int rx_iu_event(struct ue_conn_ctx *ctx, enum iu_event_type type, +static int rx_iu_event(struct ranap_ue_conn_ctx *ctx, enum ranap_iu_event_type type, void *data) { DEBUGP(DIUCS, "got IuCS event %u: %s\n", type, - iu_event_type_str(type)); + ranap_iu_event_type_str(type)); return iucs_rx_ranap_event(msc_network, ctx, type, data); } +#endif #define DEFAULT_M3UA_REMOTE_IP "127.0.0.1" #define DEFAULT_PC_A "0.23.1" @@ -564,7 +568,7 @@ #ifdef BUILD_IU /* Set up IuCS */ - iu_init(tall_msc_ctx, msc_network->iu.sccp, rcvmsg_iu_cs, rx_iu_event); + ranap_iu_init(tall_msc_ctx, DRANAP, "OsmoMSC-IuCS", msc_network->iu.sccp, rcvmsg_iu_cs, rx_iu_event); #endif /* Set up A interface */ diff --git a/tests/msc_vlr/Makefile.am b/tests/msc_vlr/Makefile.am index 6d51d6e..3ae0c84 100644 --- a/tests/msc_vlr/Makefile.am +++ b/tests/msc_vlr/Makefile.am @@ -50,13 +50,6 @@ $(top_builddir)/src/libtrau/libtrau.a \ $(top_builddir)/src/libmgcp/libmgcp.a \ $(top_builddir)/src/libcommon/libcommon.a \ - $(NULL) -if BUILD_IU -COMMON_LDADD += \ - $(top_builddir)/src/libiu/libiu.a \ - $(NULL) -endif -COMMON_LDADD += \ $(LIBSMPP34_LIBS) \ $(LIBOSMOCORE_LIBS) \ $(LIBOSMOGSM_LIBS) \ @@ -76,10 +69,10 @@ -Wl,--wrap=a_iface_tx_dtap \ -Wl,--wrap=a_iface_tx_clear_cmd \ -Wl,--wrap=a_iface_tx_paging \ - -Wl,--wrap=iu_tx \ - -Wl,--wrap=iu_tx_release \ - -Wl,--wrap=iu_tx_common_id \ - -Wl,--wrap=iu_page_cs \ + -Wl,--wrap=ranap_iu_tx \ + -Wl,--wrap=ranap_iu_tx_release \ + -Wl,--wrap=ranap_iu_tx_common_id \ + -Wl,--wrap=ranap_iu_page_cs \ -Wl,--wrap=msc_stop_paging \ -Wl,--wrap=gsm340_gen_scts \ -Wl,--wrap=RAND_bytes \ diff --git a/tests/msc_vlr/msc_vlr_tests.c b/tests/msc_vlr/msc_vlr_tests.c index a45b10f..0454187 100644 --- a/tests/msc_vlr/msc_vlr_tests.c +++ b/tests/msc_vlr/msc_vlr_tests.c @@ -30,11 +30,11 @@ #include #include #include +#include #include #include #include #include -#include #include #include "msc_vlr_tests.h" @@ -152,8 +152,8 @@ conn->bts = the_bts; conn->via_ran = rx_from_ran; if (conn->via_ran == RAN_UTRAN_IU) { - struct ue_conn_ctx *ue_ctx = talloc_zero(conn, struct ue_conn_ctx); - *ue_ctx = (struct ue_conn_ctx){ + struct ranap_ue_conn_ctx *ue_ctx = talloc_zero(conn, struct ranap_ue_conn_ctx); + *ue_ctx = (struct ranap_ue_conn_ctx){ .conn_id = 42, }; conn->iu.ue_ctx = ue_ctx; @@ -295,9 +295,9 @@ return 1; } -/* override, requires '-Wl,--wrap=iu_page_cs' */ -int __real_iu_page_cs(const char *imsi, const uint32_t *tmsi, uint16_t lac); -int __wrap_iu_page_cs(const char *imsi, const uint32_t *tmsi, uint16_t lac) +/* override, requires '-Wl,--wrap=ranap_iu_page_cs' */ +int __real_ranap_iu_page_cs(const char *imsi, const uint32_t *tmsi, uint16_t lac); +int __wrap_ranap_iu_page_cs(const char *imsi, const uint32_t *tmsi, uint16_t lac) { return _paging_sent(RAN_UTRAN_IU, imsi, tmsi ? *tmsi : GSM_RESERVED_TMSI, lac); } @@ -472,16 +472,16 @@ return 0; } -/* override, requires '-Wl,--wrap=iu_tx' */ -int __real_iu_tx(struct msgb *msg, uint8_t sapi); -int __wrap_iu_tx(struct msgb *msg, uint8_t sapi) +/* override, requires '-Wl,--wrap=ranap_iu_tx' */ +int __real_ranap_iu_tx(struct msgb *msg, uint8_t sapi); +int __wrap_ranap_iu_tx(struct msgb *msg, uint8_t sapi) { return _validate_dtap(msg, RAN_UTRAN_IU); } -/* override, requires '-Wl,--wrap=iu_tx_release' */ -int __real_iu_tx_release(struct ue_conn_ctx *ctx, const struct RANAP_Cause *cause); -int __wrap_iu_tx_release(struct ue_conn_ctx *ctx, const struct RANAP_Cause *cause) +/* override, requires '-Wl,--wrap=ranap_iu_tx_release' */ +int __real_ranap_iu_tx_release(struct ranap_ue_conn_ctx *ctx, const struct RANAP_Cause *cause); +int __wrap_ranap_iu_tx_release(struct ranap_ue_conn_ctx *ctx, const struct RANAP_Cause *cause) { btw("Iu Release --%s--> MS", ran_type_name(RAN_UTRAN_IU)); OSMO_ASSERT(iu_release_expected); @@ -491,8 +491,8 @@ } /* override, requires '-Wl,--wrap=iu_tx_common_id' */ -int __real_iu_tx_common_id(struct ue_conn_ctx *ue_ctx, const char *imsi); -int __wrap_iu_tx_common_id(struct ue_conn_ctx *ue_ctx, const char *imsi) +int __real_ranap_iu_tx_common_id(struct ranap_ue_conn_ctx *ue_ctx, const char *imsi); +int __wrap_ranap_iu_tx_common_id(struct ranap_ue_conn_ctx *ue_ctx, const char *imsi) { btw("Iu Common ID --%s--> MS (IMSI=%s)", ran_type_name(RAN_UTRAN_IU), imsi); return 0; diff --git a/tests/sgsn/Makefile.am b/tests/sgsn/Makefile.am index f1606cb..ccb8f44 100644 --- a/tests/sgsn/Makefile.am +++ b/tests/sgsn/Makefile.am @@ -74,7 +74,6 @@ if BUILD_IU sgsn_test_LDADD += \ - $(top_builddir)/src/libiu/libiu.a \ $(LIBOSMORANAP_LIBS) \ $(LIBOSMOSIGTRAN_LIBS) \ $(LIBASN1C_LIBS) \ diff --git a/tests/sms_queue/Makefile.am b/tests/sms_queue/Makefile.am index d17f996..62c479b 100644 --- a/tests/sms_queue/Makefile.am +++ b/tests/sms_queue/Makefile.am @@ -37,13 +37,6 @@ $(top_builddir)/src/libmgcp/libmgcp.a \ $(top_builddir)/src/libcommon/libcommon.a \ $(top_builddir)/src/libcommon-cs/libcommon-cs.a \ - $(NULL) -if BUILD_IU -sms_queue_test_LDADD += \ - $(top_builddir)/src/libiu/libiu.a \ - $(NULL) -endif -sms_queue_test_LDADD += \ $(LIBSMPP34_LIBS) \ $(LIBOSMOCORE_LIBS) \ $(LIBOSMOGSM_LIBS) \ -- To view, visit https://gerrit.osmocom.org/3489 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ib8c4fcdb4766c5e575618b95ce16dce51063206b Gerrit-PatchSet: 3 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Thu Aug 24 14:48:03 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 24 Aug 2017 14:48:03 +0000 Subject: [PATCH] osmo-msc[master]: split off osmo-msc: remove files, apply build, rename In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3497 to look at the new patch set (#3). split off osmo-msc: remove files, apply build, rename Change-Id: Icf025e5ea8d180613b3114282951c9afa67af9a7 --- M configure.ac D debian/osmo-gtphub.default D debian/osmo-gtphub.examples D debian/osmo-gtphub.init D debian/osmo-gtphub.install D debian/osmocom-bs11-utils.install D debian/osmocom-bsc-nat.init D debian/osmocom-bsc-nat.install D debian/osmocom-bsc.examples D debian/osmocom-bsc.install D debian/osmocom-gbproxy.init D debian/osmocom-gbproxy.install D debian/osmocom-ipaccess-utils.install D debian/osmocom-sgsn.default D debian/osmocom-sgsn.examples D debian/osmocom-sgsn.init D debian/osmocom-sgsn.install D doc/BS11-OML.txt D doc/channel_release.txt D doc/examples/osmo-bsc/osmo-bsc.cfg D doc/examples/osmo-bsc_mgcp/mgcp.cfg D doc/examples/osmo-bsc_nat/black-list.cfg D doc/examples/osmo-bsc_nat/osmo-bsc_nat.cfg D doc/examples/osmo-gbproxy/osmo-gbproxy-legacy.cfg D doc/examples/osmo-gbproxy/osmo-gbproxy.cfg D doc/examples/osmo-gtphub/gtphub-example.txt D doc/examples/osmo-gtphub/osmo-gtphub-1iface.cfg D doc/examples/osmo-gtphub/osmo-gtphub.cfg D doc/examples/osmo-sgsn/osmo-sgsn.cfg D doc/oml-interface.txt M include/Makefile.am D include/compat_af_isdn.h D include/mISDNif.h M include/openbsc/Makefile.am D include/openbsc/bsc_nat.h D include/openbsc/bsc_nat_callstats.h D include/openbsc/bsc_nat_sccp.h D include/openbsc/bsc_subscriber.h D include/openbsc/gb_proxy.h D include/openbsc/gprs_gb_parse.h D include/openbsc/gprs_gmm.h D include/openbsc/gprs_llc.h D include/openbsc/gprs_llc_xid.h D include/openbsc/gprs_sgsn.h D include/openbsc/gprs_sndcp.h D include/openbsc/gprs_sndcp_comp.h D include/openbsc/gprs_sndcp_dcomp.h D include/openbsc/gprs_sndcp_pcomp.h D include/openbsc/gprs_sndcp_xid.h D include/openbsc/gprs_subscriber.h D include/openbsc/gprs_utils.h D include/openbsc/nat_rewrite_trie.h M include/openbsc/paging.h D include/openbsc/pcu_if.h D include/openbsc/pcuif_proto.h D include/openbsc/sgsn.h D include/openbsc/v42bis.h D include/openbsc/v42bis_private.h M osmoappdesc.py M src/Makefile.am D src/gprs/.gitignore D src/gprs/Makefile.am D src/gprs/crc24.c D src/gprs/gb_proxy.c D src/gprs/gb_proxy_main.c D src/gprs/gb_proxy_patch.c D src/gprs/gb_proxy_peer.c D src/gprs/gb_proxy_tlli.c D src/gprs/gb_proxy_vty.c D src/gprs/gprs_gb_parse.c D src/gprs/gprs_gmm.c D src/gprs/gprs_llc.c D src/gprs/gprs_llc_parse.c D src/gprs/gprs_llc_vty.c D src/gprs/gprs_llc_xid.c D src/gprs/gprs_sgsn.c D src/gprs/gprs_sndcp.c D src/gprs/gprs_sndcp_comp.c D src/gprs/gprs_sndcp_dcomp.c D src/gprs/gprs_sndcp_pcomp.c D src/gprs/gprs_sndcp_vty.c D src/gprs/gprs_sndcp_xid.c D src/gprs/gprs_subscriber.c D src/gprs/gprs_utils.c D src/gprs/gtphub.c D src/gprs/gtphub_ares.c D src/gprs/gtphub_main.c D src/gprs/gtphub_sock.c D src/gprs/gtphub_vty.c D src/gprs/osmo_sgsn.cfg D src/gprs/sgsn_ares.c D src/gprs/sgsn_auth.c D src/gprs/sgsn_cdr.c D src/gprs/sgsn_ctrl.c D src/gprs/sgsn_libgtp.c D src/gprs/sgsn_main.c D src/gprs/sgsn_vty.c D src/gprs/slhc.c D src/gprs/v42bis.c D src/ipaccess/Makefile.am D src/ipaccess/abisip-find.c D src/ipaccess/ipaccess-config.c D src/ipaccess/ipaccess-firmware.c D src/ipaccess/ipaccess-proxy.c D src/ipaccess/network_listen.c D src/libbsc/Makefile.am D src/libbsc/abis_nm.c D src/libbsc/abis_nm_ipaccess.c D src/libbsc/abis_nm_vty.c D src/libbsc/abis_om2000.c D src/libbsc/abis_om2000_vty.c D src/libbsc/abis_rsl.c D src/libbsc/arfcn_range_encode.c D src/libbsc/bsc_api.c D src/libbsc/bsc_ctrl_commands.c D src/libbsc/bsc_ctrl_lookup.c D src/libbsc/bsc_dyn_ts.c D src/libbsc/bsc_init.c D src/libbsc/bsc_msc.c D src/libbsc/bsc_rf_ctrl.c D src/libbsc/bsc_rll.c D src/libbsc/bsc_subscriber.c D src/libbsc/bsc_vty.c D src/libbsc/bts_ericsson_rbs2000.c D src/libbsc/bts_init.c D src/libbsc/bts_ipaccess_nanobts.c D src/libbsc/bts_ipaccess_nanobts_omlattr.c D src/libbsc/bts_nokia_site.c D src/libbsc/bts_siemens_bs11.c D src/libbsc/bts_sysmobts.c D src/libbsc/bts_unknown.c D src/libbsc/chan_alloc.c D src/libbsc/e1_config.c D src/libbsc/gsm_04_08_utils.c D src/libbsc/gsm_04_80_utils.c D src/libbsc/handover_decision.c D src/libbsc/handover_logic.c D src/libbsc/meas_proc.c D src/libbsc/meas_rep.c D src/libbsc/net_init.c D src/libbsc/paging.c D src/libbsc/pcu_sock.c D src/libbsc/rest_octets.c D src/libbsc/system_information.c M src/libcommon/common_vty.c D src/libfilter/Makefile.am D src/libfilter/bsc_msg_acc.c D src/libfilter/bsc_msg_filter.c D src/libfilter/bsc_msg_vty.c M src/libmsc/vty_interface_layer3.c D src/libtrau/Makefile.am D src/libtrau/rtp_proxy.c D src/libtrau/trau_mux.c D src/libtrau/trau_upqueue.c M src/libvlr/vlr.c D src/osmo-bsc/Makefile.am D src/osmo-bsc/osmo_bsc_api.c D src/osmo-bsc/osmo_bsc_audio.c D src/osmo-bsc/osmo_bsc_bssap.c D src/osmo-bsc/osmo_bsc_ctrl.c D src/osmo-bsc/osmo_bsc_filter.c D src/osmo-bsc/osmo_bsc_grace.c D src/osmo-bsc/osmo_bsc_main.c D src/osmo-bsc/osmo_bsc_msc.c D src/osmo-bsc/osmo_bsc_reset.c D src/osmo-bsc/osmo_bsc_sigtran.c D src/osmo-bsc/osmo_bsc_vty.c D src/osmo-bsc_nat/Makefile.am D src/osmo-bsc_nat/bsc_filter.c D src/osmo-bsc_nat/bsc_mgcp_utils.c D src/osmo-bsc_nat/bsc_nat.c D src/osmo-bsc_nat/bsc_nat_ctrl.c D src/osmo-bsc_nat/bsc_nat_filter.c D src/osmo-bsc_nat/bsc_nat_rewrite.c D src/osmo-bsc_nat/bsc_nat_rewrite_trie.c D src/osmo-bsc_nat/bsc_nat_utils.c D src/osmo-bsc_nat/bsc_nat_vty.c D src/osmo-bsc_nat/bsc_sccp.c D src/osmo-bsc_nat/bsc_ussd.c M src/osmo-msc/Makefile.am M src/utils/Makefile.am D src/utils/bs11_config.c D src/utils/isdnsync.c M tests/Makefile.am D tests/abis/Makefile.am D tests/abis/abis_test.c D tests/abis/abis_test.ok D tests/bsc-nat-trie/Makefile.am D tests/bsc-nat-trie/bsc_nat_trie_test.c D tests/bsc-nat-trie/bsc_nat_trie_test.ok D tests/bsc-nat-trie/prefixes.csv D tests/bsc-nat/Makefile.am D tests/bsc-nat/barr.cfg D tests/bsc-nat/barr_dup.cfg D tests/bsc-nat/bsc_data.c D tests/bsc-nat/bsc_nat_test.c D tests/bsc-nat/bsc_nat_test.ok D tests/bsc-nat/prefixes.csv D tests/bsc/Makefile.am D tests/bsc/bsc_test.c D tests/bsc/bsc_test.ok D tests/channel/Makefile.am D tests/channel/channel_test.c D tests/channel/channel_test.ok D tests/gbproxy/Makefile.am D tests/gbproxy/gbproxy_test.c D tests/gbproxy/gbproxy_test.ok D tests/gprs/Makefile.am D tests/gprs/gprs_test.c D tests/gprs/gprs_test.ok D tests/gsm0408/Makefile.am D tests/gsm0408/gsm0408_test.c D tests/gsm0408/gsm0408_test.ok D tests/gtphub/Makefile.am D tests/gtphub/gtphub_test.c D tests/gtphub/gtphub_test.ok M tests/msc_vlr/Makefile.am M tests/msc_vlr/msc_vlr_tests.c D tests/nanobts_omlattr/Makefile.am D tests/nanobts_omlattr/nanobts_omlattr_test.c D tests/nanobts_omlattr/nanobts_omlattr_test.ok D tests/oap/Makefile.am D tests/oap/oap_client_test.c D tests/oap/oap_client_test.err D tests/oap/oap_client_test.ok D tests/sgsn/Makefile.am D tests/sgsn/sgsn_test.c D tests/sgsn/sgsn_test.ok D tests/slhc/Makefile.am D tests/slhc/slhc_test.c D tests/slhc/slhc_test.ok M tests/sms_queue/Makefile.am D tests/sndcp_xid/Makefile.am D tests/sndcp_xid/sndcp_xid_test.c D tests/sndcp_xid/sndcp_xid_test.ok D tests/subscr/Makefile.am D tests/subscr/bsc_subscr_test.c D tests/subscr/bsc_subscr_test.err D tests/subscr/bsc_subscr_test.ok M tests/testsuite.at D tests/trau/Makefile.am D tests/trau/trau_test.c D tests/trau/trau_test.ok D tests/v42bis/Makefile.am D tests/v42bis/v42bis_test.c D tests/v42bis/v42bis_test.ok M tests/vty_test_runner.py D tests/xid/Makefile.am D tests/xid/xid_test.c D tests/xid/xid_test.ok D tools/hlrstat.pl 251 files changed, 17 insertions(+), 100,326 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/97/3497/3 -- To view, visit https://gerrit.osmocom.org/3497 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Icf025e5ea8d180613b3114282951c9afa67af9a7 Gerrit-PatchSet: 3 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Thu Aug 24 14:48:03 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 24 Aug 2017 14:48:03 +0000 Subject: [PATCH] osmo-msc[master]: examples/sgsn: Use osmo-hlr with auth-policy remote by default 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/3421 to look at the new patch set (#4). examples/sgsn: Use osmo-hlr with auth-policy remote by default For the vty tests, add osmo-sgsn-accept-all.cfg (that does not need an HLR) and use in vty_test_runner.py, otherwise the 'show sgsn' command will reply that it could not connect to the HLR, failing the vty test which expects empty. Change-Id: Ie3b2013198d3e2b780a4e31c36b89b58129dcacd --- A doc/examples/osmo-sgsn/osmo-sgsn-accept-all.cfg M doc/examples/osmo-sgsn/osmo-sgsn.cfg M tests/vty_test_runner.py 3 files changed, 31 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/21/3421/4 diff --git a/doc/examples/osmo-sgsn/osmo-sgsn-accept-all.cfg b/doc/examples/osmo-sgsn/osmo-sgsn-accept-all.cfg new file mode 100644 index 0000000..5e64342 --- /dev/null +++ b/doc/examples/osmo-sgsn/osmo-sgsn-accept-all.cfg @@ -0,0 +1,27 @@ +! +! Osmocom SGSN configuration +! +! +line vty + no login +! +sgsn + gtp local-ip 127.0.0.1 + ggsn 0 remote-ip 127.0.0.2 + ggsn 0 gtp-version 1 + auth-policy accept-all +! +ns + timer tns-block 3 + timer tns-block-retries 3 + timer tns-reset 3 + timer tns-reset-retries 3 + timer tns-test 30 + timer tns-alive 3 + timer tns-alive-retries 10 + encapsulation udp local-ip 127.0.0.1 + encapsulation udp local-port 23000 + encapsulation framerelay-gre enabled 0 +! +bssgp +! diff --git a/doc/examples/osmo-sgsn/osmo-sgsn.cfg b/doc/examples/osmo-sgsn/osmo-sgsn.cfg index 3f39397..9703c23 100644 --- a/doc/examples/osmo-sgsn/osmo-sgsn.cfg +++ b/doc/examples/osmo-sgsn/osmo-sgsn.cfg @@ -9,6 +9,9 @@ gtp local-ip 127.0.0.1 ggsn 0 remote-ip 127.0.0.2 ggsn 0 gtp-version 1 + auth-policy remote + gsup remote-ip 127.0.0.1 + gsup remote-port 2222 ! ns timer tns-block 3 diff --git a/tests/vty_test_runner.py b/tests/vty_test_runner.py index fe4d3f0..7d4e121 100644 --- a/tests/vty_test_runner.py +++ b/tests/vty_test_runner.py @@ -829,7 +829,7 @@ def vty_command(self): return ["./src/gprs/osmo-sgsn", "-c", - "doc/examples/osmo-sgsn/osmo-sgsn.cfg"] + "doc/examples/osmo-sgsn/osmo-sgsn-accept-all.cfg"] def vty_app(self): return (4245, "./src/gprs/osmo-sgsn", "OsmoSGSN", "sgsn") -- To view, visit https://gerrit.osmocom.org/3421 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ie3b2013198d3e2b780a4e31c36b89b58129dcacd Gerrit-PatchSet: 4 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: daniel From gerrit-no-reply at lists.osmocom.org Thu Aug 24 14:48:03 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 24 Aug 2017 14:48:03 +0000 Subject: [PATCH] osmo-msc[master]: Implement AoIP, port to M3UA SIGTRAN (large addition and ref... In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3486 to look at the new patch set (#3). Implement AoIP, port to M3UA SIGTRAN (large addition and refactoring) This was originally a long series of commits converging to the final result seen in this patch. It does not make much sense to review the smaller steps' trial and error, we need to review this entire change as a whole. Implement AoIP in osmo-msc and osmo-bsc. Change over to the new libosmo-sigtran API with support for proper SCCP/M3UA/SCTP stacking, as mandated by 3GPP specifications for the IuCS and IuPS interfaces. >From here on, a separate osmo-stp process is required for SCCP routing between OsmoBSC / OsmoHNBGW <-> OsmoMSC / OsmoSGSN jenkins.sh: build from libosmo-sccp and osmo-iuh master branches now for new M3UA SIGTRAN. Patch-by: pmaier, nhofmeyr, laforge Change-Id: I5ae4e05ee7c57cad341ea5e86af37c1f6b0ffa77 --- M configure.ac M contrib/jenkins.sh M doc/examples/osmo-bsc/osmo-bsc.cfg M include/openbsc/Makefile.am A include/openbsc/a_iface.h A include/openbsc/a_iface_bssap.h A include/openbsc/a_reset.h M include/openbsc/bsc_msc.h M include/openbsc/bsc_msc_data.h M include/openbsc/debug.h M include/openbsc/gsm_04_08.h M include/openbsc/gsm_data.h M include/openbsc/gsm_data_shared.h M include/openbsc/iu.h M include/openbsc/mgcpgw_client.h M include/openbsc/msc_ifaces.h M include/openbsc/osmo_bsc.h A include/openbsc/osmo_bsc_reset.h A include/openbsc/osmo_bsc_sigtran.h M include/openbsc/osmo_msc.h M include/openbsc/transaction.h M src/gprs/Makefile.am M src/gprs/sgsn_main.c M src/libbsc/abis_rsl.c M src/libbsc/bsc_vty.c M src/libbsc/handover_logic.c M src/libcommon-cs/Makefile.am A src/libcommon-cs/a_reset.c M src/libcommon-cs/common_cs.c M src/libcommon/common_vty.c M src/libcommon/debug.c M src/libiu/iu.c M src/libiu/iu_vty.c M src/libmgcp/mgcp_protocol.c M src/libmgcp/mgcpgw_client.c M src/libmgcp/mgcpgw_client_vty.c M src/libmsc/Makefile.am M src/libmsc/a_iface.c A src/libmsc/a_iface_bssap.c M src/libmsc/gsm_04_08.c M src/libmsc/gsm_subscriber.c M src/libmsc/iucs.c M src/libmsc/msc_ifaces.c M src/libmsc/msc_vty.c M src/libmsc/osmo_msc.c M src/libmsc/subscr_conn.c M src/osmo-bsc/Makefile.am M src/osmo-bsc/osmo_bsc_api.c M src/osmo-bsc/osmo_bsc_audio.c M src/osmo-bsc/osmo_bsc_bssap.c M src/osmo-bsc/osmo_bsc_main.c M src/osmo-bsc/osmo_bsc_msc.c A src/osmo-bsc/osmo_bsc_reset.c D src/osmo-bsc/osmo_bsc_sccp.c A src/osmo-bsc/osmo_bsc_sigtran.c M src/osmo-bsc/osmo_bsc_vty.c M src/osmo-bsc_mgcp/Makefile.am M src/osmo-bsc_nat/Makefile.am M src/osmo-msc/msc_main.c M tests/msc_vlr/Makefile.am M tests/msc_vlr/msc_vlr_test_gsm_authen.c M tests/msc_vlr/msc_vlr_test_gsm_authen.err M tests/msc_vlr/msc_vlr_test_gsm_ciph.c M tests/msc_vlr/msc_vlr_test_gsm_ciph.err M tests/msc_vlr/msc_vlr_test_hlr_reject.c M tests/msc_vlr/msc_vlr_test_hlr_reject.err M tests/msc_vlr/msc_vlr_test_hlr_timeout.c M tests/msc_vlr/msc_vlr_test_hlr_timeout.err M tests/msc_vlr/msc_vlr_test_ms_timeout.c M tests/msc_vlr/msc_vlr_test_ms_timeout.err M tests/msc_vlr/msc_vlr_test_no_authen.c M tests/msc_vlr/msc_vlr_test_no_authen.err M tests/msc_vlr/msc_vlr_test_reject_concurrency.c M tests/msc_vlr/msc_vlr_test_reject_concurrency.err M tests/msc_vlr/msc_vlr_test_rest.c M tests/msc_vlr/msc_vlr_test_rest.err M tests/msc_vlr/msc_vlr_test_umts_authen.c M tests/msc_vlr/msc_vlr_test_umts_authen.err M tests/msc_vlr/msc_vlr_tests.c M tests/msc_vlr/msc_vlr_tests.h 80 files changed, 4,483 insertions(+), 714 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/86/3486/3 -- To view, visit https://gerrit.osmocom.org/3486 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I5ae4e05ee7c57cad341ea5e86af37c1f6b0ffa77 Gerrit-PatchSet: 3 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: dexter From gerrit-no-reply at lists.osmocom.org Thu Aug 24 15:30:19 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 24 Aug 2017 15:30:19 +0000 Subject: [PATCH] osmo-gsm-tester[master]: bsc: Allow tests to select network encryption Message-ID: Review at https://gerrit.osmocom.org/3604 bsc: Allow tests to select network encryption Nowadays encryption parameter in bsc needs to be set to the same cipher as the one specified in msc, otherwise the cipher negotation will fail. See OS#2461 for more information on the matter. Change-Id: I857b3860fb771b36fb3d587d4e92b320f0685a19 --- M src/osmo_gsm_tester/osmo_bsc.py 1 file changed, 8 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-tester refs/changes/04/3604/1 diff --git a/src/osmo_gsm_tester/osmo_bsc.py b/src/osmo_gsm_tester/osmo_bsc.py index efbda1f..2eb23fb 100644 --- a/src/osmo_gsm_tester/osmo_bsc.py +++ b/src/osmo_gsm_tester/osmo_bsc.py @@ -29,6 +29,7 @@ config_file = None process = None bts = None + encryption = None def __init__(self, suite_run, msc, ip_address): super().__init__(log.C_RUN, 'osmo-bsc_%s' % ip_address.get('addr')) @@ -81,6 +82,10 @@ bts_list.append(bts.conf_for_bsc()) config.overlay(values, dict(bsc=dict(net=dict(bts_list=bts_list)))) + # runtime parameters: + if self.encryption is not None: + config.overlay(values, dict(bsc=dict(net=dict(encryption=self.encryption)))) + self.dbg('BSC CONFIG:\n' + pprint.pformat(values)) with open(self.config_file, 'w') as f: @@ -91,6 +96,9 @@ def addr(self): return self.ip_address.get('addr') + def set_encryption(self, val): + self.encryption = val + def bts_add(self, bts): self.bts.append(bts) bts.set_bsc(self) -- To view, visit https://gerrit.osmocom.org/3604 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I857b3860fb771b36fb3d587d4e92b320f0685a19 Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Thu Aug 24 15:30:20 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 24 Aug 2017 15:30:20 +0000 Subject: [PATCH] osmo-gsm-tester[master]: Introduce auth_algo modem config attribute Message-ID: Review at https://gerrit.osmocom.org/3605 Introduce auth_algo modem config attribute Algorithm to use to generate response for the challenge during authentication time is hardcoded in the sim card and cannot be easily changed. Thus specify in the config of each modem the algorithm used by the SIM Card. This attribute is used add subscriber_add() time, when the IMSI, KI and algorithm to use in the MSC to authenticate a given subscriber is stored in the database. This way we can easily set up a specific algorithm for each SimCard/Modem, in case different SimCards are configured with different algorithms. This can be used to specificially test different algorithms too. For instance, let's imagine we have 2 simcards, one configured to use comp128v1 and another one with xor, and we create a test which ckecks that XOR is algo is working fine. We don't want to accidentally select the modem with comp128v1 in this case. Thus we can use this attribute to create a scenario file matching 'auth_algo: xor' to ensure always the correct modem is picked. Change-Id: Ifdf74630afeb05452994bbc9eb62a745a1d745ce --- M example/resources.conf M src/osmo_gsm_tester/ofono_client.py M src/osmo_gsm_tester/osmo_hlr.py M src/osmo_gsm_tester/osmo_nitb.py M src/osmo_gsm_tester/resource.py M src/osmo_gsm_tester/schema.py 6 files changed, 40 insertions(+), 5 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-tester refs/changes/05/3605/1 diff --git a/example/resources.conf b/example/resources.conf index 2f08c93..f190c2f 100644 --- a/example/resources.conf +++ b/example/resources.conf @@ -55,18 +55,22 @@ path: '/sierra_1' imsi: '901700000009031' ki: '80A37E6FDEA931EAC92FFA5F671EFEAD' + auth_algo: 'xor' - label: sierra_2 path: '/sierra_2' imsi: '901700000009029' ki: '00969E283349D354A8239E877F2E0866' + auth_algo: 'xor' - label: gobi_0 path: '/gobi_0' imsi: '901700000009030' ki: 'BB70807226393CDBAC8DD3439FF54252' + auth_algo: 'xor' - label: gobi_3 path: '/gobi_3' imsi: '901700000009032' ki: '2F70DCA43C45ACB97E947FDD0C7CA30A' + auth_algo: 'xor' diff --git a/src/osmo_gsm_tester/ofono_client.py b/src/osmo_gsm_tester/ofono_client.py index 00cfd47..ed7e3e4 100644 --- a/src/osmo_gsm_tester/ofono_client.py +++ b/src/osmo_gsm_tester/ofono_client.py @@ -403,6 +403,9 @@ return self._ki return self.conf.get('ki') + def auth_algo(self): + return self.conf.get('auth_algo', None) + def _on_netreg_property_changed(self, name, value): self.dbg('%r.PropertyChanged() -> %s=%s' % (I_NETREG, name, value)) diff --git a/src/osmo_gsm_tester/osmo_hlr.py b/src/osmo_gsm_tester/osmo_hlr.py index 08de07c..0b763c7 100644 --- a/src/osmo_gsm_tester/osmo_hlr.py +++ b/src/osmo_gsm_tester/osmo_hlr.py @@ -114,8 +114,18 @@ modem.set_msisdn(msisdn) subscriber_id = self.next_subscriber_id self.next_subscriber_id += 1 + if not algo: - algo = self.AUTH_ALGO_COMP128v1 if modem.ki() else self.AUTH_ALGO_NONE + alg_str = modem.auth_algo() + if alg_str is None or alg_str == 'none': + algo = self.AUTH_ALGO_NONE + elif alg_str == 'comp128v1': + algo = self.AUTH_ALGO_COMP128v1 + elif alg_str == 'xor': + algo = self.AUTH_ALGO_XOR + if algo != self.AUTH_ALGO_NONE and not modem.ki(): + raise log.Error("Auth algo %r selected and no KI specified" % algo) + self.log('Add subscriber', msisdn=msisdn, imsi=modem.imsi(), subscriber_id=subscriber_id, algo=algo) conn = sqlite3.connect(self.db_file) try: diff --git a/src/osmo_gsm_tester/osmo_nitb.py b/src/osmo_gsm_tester/osmo_nitb.py index be3b24b..8f91bbd 100644 --- a/src/osmo_gsm_tester/osmo_nitb.py +++ b/src/osmo_gsm_tester/osmo_nitb.py @@ -112,12 +112,24 @@ def mcc_mnc(self): return (self.mcc(), self.mnc()) - def subscriber_add(self, modem, msisdn=None): + def subscriber_add(self, modem, msisdn=None, algo=None): if msisdn is None: msisdn = self.suite_run.resources_pool.next_msisdn(modem) modem.set_msisdn(msisdn) + + if not algo: + alg_str = modem.auth_algo() + if not alg_str or alg_str == 'none': + algo = None + elif alg_str == 'comp128v1': + algo = 'comp128v1' + elif alg_str == 'xor': + algo = 'xor' + if algo is not None and not modem.ki(): + raise log.Error("Auth algo %r selected and no KI specified" % algo) + self.log('Add subscriber', msisdn=msisdn, imsi=modem.imsi()) - OsmoNitbCtrl(self).subscriber_add(modem.imsi(), msisdn, modem.ki()) + OsmoNitbCtrl(self).subscriber_add(modem.imsi(), msisdn, modem.ki(), algo) def subscriber_delete(self, modem): self.log('Delete subscriber', imsi=modem.imsi()) @@ -155,8 +167,6 @@ def subscriber_add(self, imsi, msisdn, ki=None, algo=None): created = False - if ki and not algo: - algo = 'comp128v1' if algo: value = '%s,%s,%s,%s' % (imsi,msisdn,algo,ki) diff --git a/src/osmo_gsm_tester/resource.py b/src/osmo_gsm_tester/resource.py index 9470f48..c55140a 100644 --- a/src/osmo_gsm_tester/resource.py +++ b/src/osmo_gsm_tester/resource.py @@ -64,6 +64,7 @@ 'modem[].path': schema.STR, 'modem[].imsi': schema.IMSI, 'modem[].ki': schema.KI, + 'modem[].auth_algo': schema.AUTH_ALGO, } WANT_SCHEMA = util.dict_add( diff --git a/src/osmo_gsm_tester/schema.py b/src/osmo_gsm_tester/schema.py index 4c9b9cd..4df33f2 100644 --- a/src/osmo_gsm_tester/schema.py +++ b/src/osmo_gsm_tester/schema.py @@ -61,6 +61,11 @@ def msisdn(val): match_re('MSISDN', MSISDN_RE, val) +def auth_algo(val): + if val in ('none', 'xor', 'comp128v1'): + return + raise ValueError('Unknown Authentication Algorithm: %r' % val) + INT = 'int' STR = 'str' BOOL_STR = 'bool_str' @@ -71,6 +76,7 @@ KI = 'ki' MSISDN = 'msisdn' TRX_REMOTE_IP = 'trx_remote_ip' +AUTH_ALGO = 'auth_algo' SCHEMA_TYPES = { INT: int, STR: str, @@ -82,6 +88,7 @@ KI: ki, MSISDN: msisdn, TRX_REMOTE_IP: ipv4, + AUTH_ALGO: auth_algo, } def validate(config, schema): -- To view, visit https://gerrit.osmocom.org/3605 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ifdf74630afeb05452994bbc9eb62a745a1d745ce Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Thu Aug 24 15:30:20 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 24 Aug 2017 15:30:20 +0000 Subject: [PATCH] osmo-gsm-tester[master]: schema: Remove uneeded TRX_REMOTE_IP validate type Message-ID: Review at https://gerrit.osmocom.org/3606 schema: Remove uneeded TRX_REMOTE_IP validate type Attribute trx_remote_ip is actually using IPv4 validate type, thus this validate type is not needed. Change-Id: Ia8e154ac5fe33932935ba049f08eb5af15195d99 --- M src/osmo_gsm_tester/schema.py 1 file changed, 0 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-tester refs/changes/06/3606/1 diff --git a/src/osmo_gsm_tester/schema.py b/src/osmo_gsm_tester/schema.py index 4df33f2..2da80cd 100644 --- a/src/osmo_gsm_tester/schema.py +++ b/src/osmo_gsm_tester/schema.py @@ -75,7 +75,6 @@ IMSI = 'imsi' KI = 'ki' MSISDN = 'msisdn' -TRX_REMOTE_IP = 'trx_remote_ip' AUTH_ALGO = 'auth_algo' SCHEMA_TYPES = { INT: int, @@ -87,7 +86,6 @@ IMSI: imsi, KI: ki, MSISDN: msisdn, - TRX_REMOTE_IP: ipv4, AUTH_ALGO: auth_algo, } -- To view, visit https://gerrit.osmocom.org/3606 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ia8e154ac5fe33932935ba049f08eb5af15195d99 Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Thu Aug 24 15:30:20 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 24 Aug 2017 15:30:20 +0000 Subject: [PATCH] osmo-gsm-tester[master]: Introduce aoip_encryption suite Message-ID: Review at https://gerrit.osmocom.org/3607 Introduce aoip_encryption suite This suite aims testing different authentication and encryption setups. Change-Id: I5816ecc19a818e5b821fbc6272c9f37f9650ae10 --- M example/default-suites.conf A suites/aoip_encryption/register_a5_0_authopt.py A suites/aoip_encryption/register_a5_0_authreq.py A suites/aoip_encryption/register_a5_1_authreq.py A suites/aoip_encryption/suite.conf 5 files changed, 139 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-tester refs/changes/07/3607/1 diff --git a/example/default-suites.conf b/example/default-suites.conf index 72a90db..4904844 100644 --- a/example/default-suites.conf +++ b/example/default-suites.conf @@ -4,3 +4,4 @@ - aoip_sms:trx-b200 - smpp - aoip_smpp +- aoip_encryption diff --git a/suites/aoip_encryption/register_a5_0_authopt.py b/suites/aoip_encryption/register_a5_0_authopt.py new file mode 100755 index 0000000..a1eb9c7 --- /dev/null +++ b/suites/aoip_encryption/register_a5_0_authopt.py @@ -0,0 +1,34 @@ +#!/usr/bin/env python3 +from osmo_gsm_tester.test import * + +hlr = suite.hlr() +bts = suite.bts() +mgcpgw = suite.mgcpgw(bts_ip=bts.remote_addr()) +msc = suite.msc(hlr, mgcpgw) +bsc = suite.bsc(msc) +stp = suite.stp() +ms = suite.modem() + +print('start network...') +msc.set_authentication(False) +msc.set_encryption('a5 0') +bsc.set_encryption('a5 0') +hlr.start() +stp.start() +msc.start() +mgcpgw.start() +bsc.bts_add(bts) +bsc.start() +bts.start() + +ms.log_info() +good_ki = ms.ki() +bad_ki = str(int(good_ki.upper()[0]) ^ 0x01) + good_ki[1:].upper() + +print('KI changed: ' + good_ki + " => " + bad_ki) +ms.set_ki(bad_ki) +hlr.subscriber_add(ms) +print('Attempt connection with wrong KI, should work as it is not used...') +ms.connect(msc.mcc_mnc()) +wait(ms.is_connected, msc.mcc_mnc()) +wait(msc.subscriber_attached, ms) diff --git a/suites/aoip_encryption/register_a5_0_authreq.py b/suites/aoip_encryption/register_a5_0_authreq.py new file mode 100755 index 0000000..34b585b --- /dev/null +++ b/suites/aoip_encryption/register_a5_0_authreq.py @@ -0,0 +1,47 @@ +#!/usr/bin/env python3 +from osmo_gsm_tester.test import * + +hlr = suite.hlr() +bts = suite.bts() +mgcpgw = suite.mgcpgw(bts_ip=bts.remote_addr()) +msc = suite.msc(hlr, mgcpgw) +bsc = suite.bsc(msc) +stp = suite.stp() +ms = suite.modem() + +print('start network...') +msc.set_authentication(True) +msc.set_encryption('a5 0') +bsc.set_encryption('a5 0') +hlr.start() +stp.start() +msc.start() +mgcpgw.start() +bsc.bts_add(bts) +bsc.start() +bts.start() + +ms.log_info() +good_ki = ms.ki() +bad_ki = str(int(good_ki.upper()[0]) ^ 0x01) + good_ki[1:].upper() + +print('KI changed: ' + good_ki + " => " + bad_ki) +ms.set_ki(bad_ki) +hlr.subscriber_add(ms) +print('Attempt connection with wrong KI...') +ms.connect(msc.mcc_mnc()) + +sleep(30) # TODO: read pcap or CTRL interface and look for Rejected? (gsm_a.dtap.msg_mm_type == 0x04) +print('Asserting modem did not register') +# FIXME: this can fail because ofono qmi signals registered before being accepted by network. See OS#2458 +# assert not ms.is_connected(msc.mcc_mnc()) +assert not msc.subscriber_attached(ms) + +hlr.subscriber_delete(ms) +print('KI changed: ' + bad_ki + " => " + good_ki) +ms.set_ki(good_ki) +hlr.subscriber_add(ms, ms.msisdn) +print('Attempt connection with correct KI...') +ms.connect(msc.mcc_mnc()) +wait(ms.is_connected, msc.mcc_mnc()) +wait(msc.subscriber_attached, ms) diff --git a/suites/aoip_encryption/register_a5_1_authreq.py b/suites/aoip_encryption/register_a5_1_authreq.py new file mode 100755 index 0000000..0f55729 --- /dev/null +++ b/suites/aoip_encryption/register_a5_1_authreq.py @@ -0,0 +1,47 @@ +#!/usr/bin/env python3 +from osmo_gsm_tester.test import * + +hlr = suite.hlr() +bts = suite.bts() +mgcpgw = suite.mgcpgw(bts_ip=bts.remote_addr()) +msc = suite.msc(hlr, mgcpgw) +bsc = suite.bsc(msc) +stp = suite.stp() +ms = suite.modem() + +print('start network...') +msc.set_authentication(True) +msc.set_encryption('a5 1') +bsc.set_encryption('a5 1') +hlr.start() +stp.start() +msc.start() +mgcpgw.start() +bsc.bts_add(bts) +bsc.start() +bts.start() + +ms.log_info() +good_ki = ms.ki() +bad_ki = str(int(good_ki.upper()[0]) ^ 0x01) + good_ki[1:].upper() + +print('KI changed: ' + good_ki + " => " + bad_ki) +ms.set_ki(bad_ki) +hlr.subscriber_add(ms) +print('Attempt connection with wrong KI...') +ms.connect(msc.mcc_mnc()) + +sleep(30) # TODO: read pcap or CTRL interface and look for Rejected? (gsm_a.dtap.msg_mm_type == 0x04) +print('Asserting modem did not register') +# FIXME: this can fail because ofono qmi signals registered before being accepted by network. See OS#2458 +# assert not ms.is_connected(msc.mcc_mnc()) +assert not msc.subscriber_attached(ms) + +hlr.subscriber_delete(ms) +print('KI changed: ' + bad_ki + " => " + good_ki) +ms.set_ki(good_ki) +hlr.subscriber_add(ms, ms.msisdn) +print('Attempt connection with correct KI...') +ms.connect(msc.mcc_mnc()) +wait(ms.is_connected, msc.mcc_mnc()) +wait(msc.subscriber_attached, ms) diff --git a/suites/aoip_encryption/suite.conf b/suites/aoip_encryption/suite.conf new file mode 100644 index 0000000..3cdc525 --- /dev/null +++ b/suites/aoip_encryption/suite.conf @@ -0,0 +1,10 @@ +resources: + ip_address: + - times: 5 # msc, bsc, hlr, stp, mgw + bts: + - times: 1 + modem: + - times: 1 + +defaults: + timeout: 120s -- To view, visit https://gerrit.osmocom.org/3607 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I5816ecc19a818e5b821fbc6272c9f37f9650ae10 Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Thu Aug 24 16:23:30 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 24 Aug 2017 16:23:30 +0000 Subject: [PATCH] osmo-gsm-tester[master]: Introduce aoip_encryption suite In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3607 to look at the new patch set (#2). Introduce aoip_encryption suite This suite aims testing different authentication and encryption setups. Change-Id: I5816ecc19a818e5b821fbc6272c9f37f9650ae10 --- M example/default-suites.conf A suites/aoip_encryption/register_a5_0_authopt.py A suites/aoip_encryption/register_a5_0_authreq.py A suites/aoip_encryption/register_a5_1_authreq.py A suites/aoip_encryption/suite.conf 5 files changed, 139 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-tester refs/changes/07/3607/2 diff --git a/example/default-suites.conf b/example/default-suites.conf index 72a90db..4904844 100644 --- a/example/default-suites.conf +++ b/example/default-suites.conf @@ -4,3 +4,4 @@ - aoip_sms:trx-b200 - smpp - aoip_smpp +- aoip_encryption diff --git a/suites/aoip_encryption/register_a5_0_authopt.py b/suites/aoip_encryption/register_a5_0_authopt.py new file mode 100755 index 0000000..ff93cb8 --- /dev/null +++ b/suites/aoip_encryption/register_a5_0_authopt.py @@ -0,0 +1,34 @@ +#!/usr/bin/env python3 +from osmo_gsm_tester.test import * + +hlr = suite.hlr() +bts = suite.bts() +mgcpgw = suite.mgcpgw(bts_ip=bts.remote_addr()) +msc = suite.msc(hlr, mgcpgw) +bsc = suite.bsc(msc) +stp = suite.stp() +ms = suite.modem() + +print('start network...') +msc.set_authentication(False) +msc.set_encryption('a5 0') +bsc.set_encryption('a5 0') +hlr.start() +stp.start() +msc.start() +mgcpgw.start() +bsc.bts_add(bts) +bsc.start() +bts.start() + +ms.log_info() +good_ki = ms.ki() +bad_ki = ("%1X" % (int(good_ki[0], 16) ^ 0x01)) + good_ki[1:] + +print('KI changed: ' + good_ki + " => " + bad_ki) +ms.set_ki(bad_ki) +hlr.subscriber_add(ms) +print('Attempt connection with wrong KI, should work as it is not used...') +ms.connect(msc.mcc_mnc()) +wait(ms.is_connected, msc.mcc_mnc()) +wait(msc.subscriber_attached, ms) diff --git a/suites/aoip_encryption/register_a5_0_authreq.py b/suites/aoip_encryption/register_a5_0_authreq.py new file mode 100755 index 0000000..be8f8a1 --- /dev/null +++ b/suites/aoip_encryption/register_a5_0_authreq.py @@ -0,0 +1,47 @@ +#!/usr/bin/env python3 +from osmo_gsm_tester.test import * + +hlr = suite.hlr() +bts = suite.bts() +mgcpgw = suite.mgcpgw(bts_ip=bts.remote_addr()) +msc = suite.msc(hlr, mgcpgw) +bsc = suite.bsc(msc) +stp = suite.stp() +ms = suite.modem() + +print('start network...') +msc.set_authentication(True) +msc.set_encryption('a5 0') +bsc.set_encryption('a5 0') +hlr.start() +stp.start() +msc.start() +mgcpgw.start() +bsc.bts_add(bts) +bsc.start() +bts.start() + +ms.log_info() +good_ki = ms.ki() +bad_ki = ("%1X" % (int(good_ki[0], 16) ^ 0x01)) + good_ki[1:] + +print('KI changed: ' + good_ki + " => " + bad_ki) +ms.set_ki(bad_ki) +hlr.subscriber_add(ms) +print('Attempt connection with wrong KI...') +ms.connect(msc.mcc_mnc()) + +sleep(30) # TODO: read pcap or CTRL interface and look for Rejected? (gsm_a.dtap.msg_mm_type == 0x04) +print('Asserting modem did not register') +# FIXME: this can fail because ofono qmi signals registered before being accepted by network. See OS#2458 +# assert not ms.is_connected(msc.mcc_mnc()) +assert not msc.subscriber_attached(ms) + +hlr.subscriber_delete(ms) +print('KI changed: ' + bad_ki + " => " + good_ki) +ms.set_ki(good_ki) +hlr.subscriber_add(ms, ms.msisdn) +print('Attempt connection with correct KI...') +ms.connect(msc.mcc_mnc()) +wait(ms.is_connected, msc.mcc_mnc()) +wait(msc.subscriber_attached, ms) diff --git a/suites/aoip_encryption/register_a5_1_authreq.py b/suites/aoip_encryption/register_a5_1_authreq.py new file mode 100755 index 0000000..dd41348 --- /dev/null +++ b/suites/aoip_encryption/register_a5_1_authreq.py @@ -0,0 +1,47 @@ +#!/usr/bin/env python3 +from osmo_gsm_tester.test import * + +hlr = suite.hlr() +bts = suite.bts() +mgcpgw = suite.mgcpgw(bts_ip=bts.remote_addr()) +msc = suite.msc(hlr, mgcpgw) +bsc = suite.bsc(msc) +stp = suite.stp() +ms = suite.modem() + +print('start network...') +msc.set_authentication(True) +msc.set_encryption('a5 1') +bsc.set_encryption('a5 1') +hlr.start() +stp.start() +msc.start() +mgcpgw.start() +bsc.bts_add(bts) +bsc.start() +bts.start() + +ms.log_info() +good_ki = ms.ki() +bad_ki = ("%1X" % (int(good_ki[0], 16) ^ 0x01)) + good_ki[1:] + +print('KI changed: ' + good_ki + " => " + bad_ki) +ms.set_ki(bad_ki) +hlr.subscriber_add(ms) +print('Attempt connection with wrong KI...') +ms.connect(msc.mcc_mnc()) + +sleep(30) # TODO: read pcap or CTRL interface and look for Rejected? (gsm_a.dtap.msg_mm_type == 0x04) +print('Asserting modem did not register') +# FIXME: this can fail because ofono qmi signals registered before being accepted by network. See OS#2458 +# assert not ms.is_connected(msc.mcc_mnc()) +assert not msc.subscriber_attached(ms) + +hlr.subscriber_delete(ms) +print('KI changed: ' + bad_ki + " => " + good_ki) +ms.set_ki(good_ki) +hlr.subscriber_add(ms, ms.msisdn) +print('Attempt connection with correct KI...') +ms.connect(msc.mcc_mnc()) +wait(ms.is_connected, msc.mcc_mnc()) +wait(msc.subscriber_attached, ms) diff --git a/suites/aoip_encryption/suite.conf b/suites/aoip_encryption/suite.conf new file mode 100644 index 0000000..3cdc525 --- /dev/null +++ b/suites/aoip_encryption/suite.conf @@ -0,0 +1,10 @@ +resources: + ip_address: + - times: 5 # msc, bsc, hlr, stp, mgw + bts: + - times: 1 + modem: + - times: 1 + +defaults: + timeout: 120s -- To view, visit https://gerrit.osmocom.org/3607 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I5816ecc19a818e5b821fbc6272c9f37f9650ae10 Gerrit-PatchSet: 2 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Thu Aug 24 16:32:48 2017 From: gerrit-no-reply at lists.osmocom.org (Alexander Chemeris) Date: Thu, 24 Aug 2017 16:32:48 +0000 Subject: osmo-bts[master]: osmo-bts-trx: remove global variables from loops In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/3601 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I01d7c1abad67e51b886a4ecf2de072929d67da27 Gerrit-PatchSet: 2 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Alexander Chemeris Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Aug 24 16:38:41 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 24 Aug 2017 16:38:41 +0000 Subject: osmo-gsm-tester[master]: hlr: fill auc_2g table when registering a subscriber In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3584 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I491d093934c129a01baa1c5d7ada4acf370bf37d Gerrit-PatchSet: 2 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: neels Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Aug 24 16:38:44 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 24 Aug 2017 16:38:44 +0000 Subject: osmo-gsm-tester[master]: nitb: ctrl: Remove unused return statement in subscriber_add In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3590 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I5194eeb9208f973da12f2fa710f2b3e7acd78fb5 Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: neels Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Aug 24 16:38:47 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 24 Aug 2017 16:38:47 +0000 Subject: osmo-gsm-tester[master]: nitb: Introduce subscriber_delete API In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3591 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I62829ed243857681bcc40a4a1861c5c583907f4b Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: neels Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Aug 24 16:38:50 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 24 Aug 2017 16:38:50 +0000 Subject: osmo-gsm-tester[master]: hlr: Use python module instead of cmdline to modify sqlite db In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3592 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I94a294c37f361a666064094455c9a1e1399fdfc7 Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: neels Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Aug 24 16:38:53 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 24 Aug 2017 16:38:53 +0000 Subject: osmo-gsm-tester[master]: hlr: Implement subscriber_delete API In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3593 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Iefb30ad552929386743d936bf629fe7a760a4713 Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: neels Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Aug 24 16:38:55 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 24 Aug 2017 16:38:55 +0000 Subject: osmo-gsm-tester[master]: Add support for authentication VTY param in msc and bsc In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3594 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ie1eb76149d4b006631050f8a1e532fbdbdad6a7f Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: neels Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Aug 24 16:38:58 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 24 Aug 2017 16:38:58 +0000 Subject: osmo-gsm-tester[master]: bsc: Allow tests to select network encryption In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3604 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I857b3860fb771b36fb3d587d4e92b320f0685a19 Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Aug 24 16:39:04 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 24 Aug 2017 16:39:04 +0000 Subject: osmo-gsm-tester[master]: Introduce auth_algo modem config attribute In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3605 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ifdf74630afeb05452994bbc9eb62a745a1d745ce Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Aug 24 16:39:06 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 24 Aug 2017 16:39:06 +0000 Subject: osmo-gsm-tester[master]: schema: Remove uneeded TRX_REMOTE_IP validate type In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3606 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ia8e154ac5fe33932935ba049f08eb5af15195d99 Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Aug 24 16:39:09 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 24 Aug 2017 16:39:09 +0000 Subject: osmo-gsm-tester[master]: Introduce aoip_encryption suite In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3607 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I5816ecc19a818e5b821fbc6272c9f37f9650ae10 Gerrit-PatchSet: 2 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Aug 24 16:39:14 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 24 Aug 2017 16:39:14 +0000 Subject: [MERGED] osmo-gsm-tester[master]: Introduce aoip_encryption suite In-Reply-To: References: Message-ID: Pau Espin Pedrol has submitted this change and it was merged. Change subject: Introduce aoip_encryption suite ...................................................................... Introduce aoip_encryption suite This suite aims testing different authentication and encryption setups. Change-Id: I5816ecc19a818e5b821fbc6272c9f37f9650ae10 --- M example/default-suites.conf A suites/aoip_encryption/register_a5_0_authopt.py A suites/aoip_encryption/register_a5_0_authreq.py A suites/aoip_encryption/register_a5_1_authreq.py A suites/aoip_encryption/suite.conf 5 files changed, 139 insertions(+), 0 deletions(-) Approvals: Pau Espin Pedrol: Looks good to me, approved Jenkins Builder: Verified diff --git a/example/default-suites.conf b/example/default-suites.conf index 72a90db..4904844 100644 --- a/example/default-suites.conf +++ b/example/default-suites.conf @@ -4,3 +4,4 @@ - aoip_sms:trx-b200 - smpp - aoip_smpp +- aoip_encryption diff --git a/suites/aoip_encryption/register_a5_0_authopt.py b/suites/aoip_encryption/register_a5_0_authopt.py new file mode 100755 index 0000000..ff93cb8 --- /dev/null +++ b/suites/aoip_encryption/register_a5_0_authopt.py @@ -0,0 +1,34 @@ +#!/usr/bin/env python3 +from osmo_gsm_tester.test import * + +hlr = suite.hlr() +bts = suite.bts() +mgcpgw = suite.mgcpgw(bts_ip=bts.remote_addr()) +msc = suite.msc(hlr, mgcpgw) +bsc = suite.bsc(msc) +stp = suite.stp() +ms = suite.modem() + +print('start network...') +msc.set_authentication(False) +msc.set_encryption('a5 0') +bsc.set_encryption('a5 0') +hlr.start() +stp.start() +msc.start() +mgcpgw.start() +bsc.bts_add(bts) +bsc.start() +bts.start() + +ms.log_info() +good_ki = ms.ki() +bad_ki = ("%1X" % (int(good_ki[0], 16) ^ 0x01)) + good_ki[1:] + +print('KI changed: ' + good_ki + " => " + bad_ki) +ms.set_ki(bad_ki) +hlr.subscriber_add(ms) +print('Attempt connection with wrong KI, should work as it is not used...') +ms.connect(msc.mcc_mnc()) +wait(ms.is_connected, msc.mcc_mnc()) +wait(msc.subscriber_attached, ms) diff --git a/suites/aoip_encryption/register_a5_0_authreq.py b/suites/aoip_encryption/register_a5_0_authreq.py new file mode 100755 index 0000000..be8f8a1 --- /dev/null +++ b/suites/aoip_encryption/register_a5_0_authreq.py @@ -0,0 +1,47 @@ +#!/usr/bin/env python3 +from osmo_gsm_tester.test import * + +hlr = suite.hlr() +bts = suite.bts() +mgcpgw = suite.mgcpgw(bts_ip=bts.remote_addr()) +msc = suite.msc(hlr, mgcpgw) +bsc = suite.bsc(msc) +stp = suite.stp() +ms = suite.modem() + +print('start network...') +msc.set_authentication(True) +msc.set_encryption('a5 0') +bsc.set_encryption('a5 0') +hlr.start() +stp.start() +msc.start() +mgcpgw.start() +bsc.bts_add(bts) +bsc.start() +bts.start() + +ms.log_info() +good_ki = ms.ki() +bad_ki = ("%1X" % (int(good_ki[0], 16) ^ 0x01)) + good_ki[1:] + +print('KI changed: ' + good_ki + " => " + bad_ki) +ms.set_ki(bad_ki) +hlr.subscriber_add(ms) +print('Attempt connection with wrong KI...') +ms.connect(msc.mcc_mnc()) + +sleep(30) # TODO: read pcap or CTRL interface and look for Rejected? (gsm_a.dtap.msg_mm_type == 0x04) +print('Asserting modem did not register') +# FIXME: this can fail because ofono qmi signals registered before being accepted by network. See OS#2458 +# assert not ms.is_connected(msc.mcc_mnc()) +assert not msc.subscriber_attached(ms) + +hlr.subscriber_delete(ms) +print('KI changed: ' + bad_ki + " => " + good_ki) +ms.set_ki(good_ki) +hlr.subscriber_add(ms, ms.msisdn) +print('Attempt connection with correct KI...') +ms.connect(msc.mcc_mnc()) +wait(ms.is_connected, msc.mcc_mnc()) +wait(msc.subscriber_attached, ms) diff --git a/suites/aoip_encryption/register_a5_1_authreq.py b/suites/aoip_encryption/register_a5_1_authreq.py new file mode 100755 index 0000000..dd41348 --- /dev/null +++ b/suites/aoip_encryption/register_a5_1_authreq.py @@ -0,0 +1,47 @@ +#!/usr/bin/env python3 +from osmo_gsm_tester.test import * + +hlr = suite.hlr() +bts = suite.bts() +mgcpgw = suite.mgcpgw(bts_ip=bts.remote_addr()) +msc = suite.msc(hlr, mgcpgw) +bsc = suite.bsc(msc) +stp = suite.stp() +ms = suite.modem() + +print('start network...') +msc.set_authentication(True) +msc.set_encryption('a5 1') +bsc.set_encryption('a5 1') +hlr.start() +stp.start() +msc.start() +mgcpgw.start() +bsc.bts_add(bts) +bsc.start() +bts.start() + +ms.log_info() +good_ki = ms.ki() +bad_ki = ("%1X" % (int(good_ki[0], 16) ^ 0x01)) + good_ki[1:] + +print('KI changed: ' + good_ki + " => " + bad_ki) +ms.set_ki(bad_ki) +hlr.subscriber_add(ms) +print('Attempt connection with wrong KI...') +ms.connect(msc.mcc_mnc()) + +sleep(30) # TODO: read pcap or CTRL interface and look for Rejected? (gsm_a.dtap.msg_mm_type == 0x04) +print('Asserting modem did not register') +# FIXME: this can fail because ofono qmi signals registered before being accepted by network. See OS#2458 +# assert not ms.is_connected(msc.mcc_mnc()) +assert not msc.subscriber_attached(ms) + +hlr.subscriber_delete(ms) +print('KI changed: ' + bad_ki + " => " + good_ki) +ms.set_ki(good_ki) +hlr.subscriber_add(ms, ms.msisdn) +print('Attempt connection with correct KI...') +ms.connect(msc.mcc_mnc()) +wait(ms.is_connected, msc.mcc_mnc()) +wait(msc.subscriber_attached, ms) diff --git a/suites/aoip_encryption/suite.conf b/suites/aoip_encryption/suite.conf new file mode 100644 index 0000000..3cdc525 --- /dev/null +++ b/suites/aoip_encryption/suite.conf @@ -0,0 +1,10 @@ +resources: + ip_address: + - times: 5 # msc, bsc, hlr, stp, mgw + bts: + - times: 1 + modem: + - times: 1 + +defaults: + timeout: 120s -- To view, visit https://gerrit.osmocom.org/3607 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I5816ecc19a818e5b821fbc6272c9f37f9650ae10 Gerrit-PatchSet: 2 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Thu Aug 24 16:39:14 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 24 Aug 2017 16:39:14 +0000 Subject: [MERGED] osmo-gsm-tester[master]: schema: Remove uneeded TRX_REMOTE_IP validate type In-Reply-To: References: Message-ID: Pau Espin Pedrol has submitted this change and it was merged. Change subject: schema: Remove uneeded TRX_REMOTE_IP validate type ...................................................................... schema: Remove uneeded TRX_REMOTE_IP validate type Attribute trx_remote_ip is actually using IPv4 validate type, thus this validate type is not needed. Change-Id: Ia8e154ac5fe33932935ba049f08eb5af15195d99 --- M src/osmo_gsm_tester/schema.py 1 file changed, 0 insertions(+), 2 deletions(-) Approvals: Pau Espin Pedrol: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/osmo_gsm_tester/schema.py b/src/osmo_gsm_tester/schema.py index 4df33f2..2da80cd 100644 --- a/src/osmo_gsm_tester/schema.py +++ b/src/osmo_gsm_tester/schema.py @@ -75,7 +75,6 @@ IMSI = 'imsi' KI = 'ki' MSISDN = 'msisdn' -TRX_REMOTE_IP = 'trx_remote_ip' AUTH_ALGO = 'auth_algo' SCHEMA_TYPES = { INT: int, @@ -87,7 +86,6 @@ IMSI: imsi, KI: ki, MSISDN: msisdn, - TRX_REMOTE_IP: ipv4, AUTH_ALGO: auth_algo, } -- To view, visit https://gerrit.osmocom.org/3606 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ia8e154ac5fe33932935ba049f08eb5af15195d99 Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Thu Aug 24 16:39:14 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 24 Aug 2017 16:39:14 +0000 Subject: [MERGED] osmo-gsm-tester[master]: Introduce auth_algo modem config attribute In-Reply-To: References: Message-ID: Pau Espin Pedrol has submitted this change and it was merged. Change subject: Introduce auth_algo modem config attribute ...................................................................... Introduce auth_algo modem config attribute Algorithm to use to generate response for the challenge during authentication time is hardcoded in the sim card and cannot be easily changed. Thus specify in the config of each modem the algorithm used by the SIM Card. This attribute is used add subscriber_add() time, when the IMSI, KI and algorithm to use in the MSC to authenticate a given subscriber is stored in the database. This way we can easily set up a specific algorithm for each SimCard/Modem, in case different SimCards are configured with different algorithms. This can be used to specificially test different algorithms too. For instance, let's imagine we have 2 simcards, one configured to use comp128v1 and another one with xor, and we create a test which ckecks that XOR is algo is working fine. We don't want to accidentally select the modem with comp128v1 in this case. Thus we can use this attribute to create a scenario file matching 'auth_algo: xor' to ensure always the correct modem is picked. Change-Id: Ifdf74630afeb05452994bbc9eb62a745a1d745ce --- M example/resources.conf M src/osmo_gsm_tester/ofono_client.py M src/osmo_gsm_tester/osmo_hlr.py M src/osmo_gsm_tester/osmo_nitb.py M src/osmo_gsm_tester/resource.py M src/osmo_gsm_tester/schema.py 6 files changed, 40 insertions(+), 5 deletions(-) Approvals: Pau Espin Pedrol: Looks good to me, approved Jenkins Builder: Verified diff --git a/example/resources.conf b/example/resources.conf index 2f08c93..f190c2f 100644 --- a/example/resources.conf +++ b/example/resources.conf @@ -55,18 +55,22 @@ path: '/sierra_1' imsi: '901700000009031' ki: '80A37E6FDEA931EAC92FFA5F671EFEAD' + auth_algo: 'xor' - label: sierra_2 path: '/sierra_2' imsi: '901700000009029' ki: '00969E283349D354A8239E877F2E0866' + auth_algo: 'xor' - label: gobi_0 path: '/gobi_0' imsi: '901700000009030' ki: 'BB70807226393CDBAC8DD3439FF54252' + auth_algo: 'xor' - label: gobi_3 path: '/gobi_3' imsi: '901700000009032' ki: '2F70DCA43C45ACB97E947FDD0C7CA30A' + auth_algo: 'xor' diff --git a/src/osmo_gsm_tester/ofono_client.py b/src/osmo_gsm_tester/ofono_client.py index 00cfd47..ed7e3e4 100644 --- a/src/osmo_gsm_tester/ofono_client.py +++ b/src/osmo_gsm_tester/ofono_client.py @@ -403,6 +403,9 @@ return self._ki return self.conf.get('ki') + def auth_algo(self): + return self.conf.get('auth_algo', None) + def _on_netreg_property_changed(self, name, value): self.dbg('%r.PropertyChanged() -> %s=%s' % (I_NETREG, name, value)) diff --git a/src/osmo_gsm_tester/osmo_hlr.py b/src/osmo_gsm_tester/osmo_hlr.py index 08de07c..0b763c7 100644 --- a/src/osmo_gsm_tester/osmo_hlr.py +++ b/src/osmo_gsm_tester/osmo_hlr.py @@ -114,8 +114,18 @@ modem.set_msisdn(msisdn) subscriber_id = self.next_subscriber_id self.next_subscriber_id += 1 + if not algo: - algo = self.AUTH_ALGO_COMP128v1 if modem.ki() else self.AUTH_ALGO_NONE + alg_str = modem.auth_algo() + if alg_str is None or alg_str == 'none': + algo = self.AUTH_ALGO_NONE + elif alg_str == 'comp128v1': + algo = self.AUTH_ALGO_COMP128v1 + elif alg_str == 'xor': + algo = self.AUTH_ALGO_XOR + if algo != self.AUTH_ALGO_NONE and not modem.ki(): + raise log.Error("Auth algo %r selected and no KI specified" % algo) + self.log('Add subscriber', msisdn=msisdn, imsi=modem.imsi(), subscriber_id=subscriber_id, algo=algo) conn = sqlite3.connect(self.db_file) try: diff --git a/src/osmo_gsm_tester/osmo_nitb.py b/src/osmo_gsm_tester/osmo_nitb.py index be3b24b..8f91bbd 100644 --- a/src/osmo_gsm_tester/osmo_nitb.py +++ b/src/osmo_gsm_tester/osmo_nitb.py @@ -112,12 +112,24 @@ def mcc_mnc(self): return (self.mcc(), self.mnc()) - def subscriber_add(self, modem, msisdn=None): + def subscriber_add(self, modem, msisdn=None, algo=None): if msisdn is None: msisdn = self.suite_run.resources_pool.next_msisdn(modem) modem.set_msisdn(msisdn) + + if not algo: + alg_str = modem.auth_algo() + if not alg_str or alg_str == 'none': + algo = None + elif alg_str == 'comp128v1': + algo = 'comp128v1' + elif alg_str == 'xor': + algo = 'xor' + if algo is not None and not modem.ki(): + raise log.Error("Auth algo %r selected and no KI specified" % algo) + self.log('Add subscriber', msisdn=msisdn, imsi=modem.imsi()) - OsmoNitbCtrl(self).subscriber_add(modem.imsi(), msisdn, modem.ki()) + OsmoNitbCtrl(self).subscriber_add(modem.imsi(), msisdn, modem.ki(), algo) def subscriber_delete(self, modem): self.log('Delete subscriber', imsi=modem.imsi()) @@ -155,8 +167,6 @@ def subscriber_add(self, imsi, msisdn, ki=None, algo=None): created = False - if ki and not algo: - algo = 'comp128v1' if algo: value = '%s,%s,%s,%s' % (imsi,msisdn,algo,ki) diff --git a/src/osmo_gsm_tester/resource.py b/src/osmo_gsm_tester/resource.py index 9470f48..c55140a 100644 --- a/src/osmo_gsm_tester/resource.py +++ b/src/osmo_gsm_tester/resource.py @@ -64,6 +64,7 @@ 'modem[].path': schema.STR, 'modem[].imsi': schema.IMSI, 'modem[].ki': schema.KI, + 'modem[].auth_algo': schema.AUTH_ALGO, } WANT_SCHEMA = util.dict_add( diff --git a/src/osmo_gsm_tester/schema.py b/src/osmo_gsm_tester/schema.py index 4c9b9cd..4df33f2 100644 --- a/src/osmo_gsm_tester/schema.py +++ b/src/osmo_gsm_tester/schema.py @@ -61,6 +61,11 @@ def msisdn(val): match_re('MSISDN', MSISDN_RE, val) +def auth_algo(val): + if val in ('none', 'xor', 'comp128v1'): + return + raise ValueError('Unknown Authentication Algorithm: %r' % val) + INT = 'int' STR = 'str' BOOL_STR = 'bool_str' @@ -71,6 +76,7 @@ KI = 'ki' MSISDN = 'msisdn' TRX_REMOTE_IP = 'trx_remote_ip' +AUTH_ALGO = 'auth_algo' SCHEMA_TYPES = { INT: int, STR: str, @@ -82,6 +88,7 @@ KI: ki, MSISDN: msisdn, TRX_REMOTE_IP: ipv4, + AUTH_ALGO: auth_algo, } def validate(config, schema): -- To view, visit https://gerrit.osmocom.org/3605 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ifdf74630afeb05452994bbc9eb62a745a1d745ce Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Thu Aug 24 16:39:14 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 24 Aug 2017 16:39:14 +0000 Subject: [MERGED] osmo-gsm-tester[master]: bsc: Allow tests to select network encryption In-Reply-To: References: Message-ID: Pau Espin Pedrol has submitted this change and it was merged. Change subject: bsc: Allow tests to select network encryption ...................................................................... bsc: Allow tests to select network encryption Nowadays encryption parameter in bsc needs to be set to the same cipher as the one specified in msc, otherwise the cipher negotation will fail. See OS#2461 for more information on the matter. Change-Id: I857b3860fb771b36fb3d587d4e92b320f0685a19 --- M src/osmo_gsm_tester/osmo_bsc.py 1 file changed, 8 insertions(+), 0 deletions(-) Approvals: Pau Espin Pedrol: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/osmo_gsm_tester/osmo_bsc.py b/src/osmo_gsm_tester/osmo_bsc.py index efbda1f..2eb23fb 100644 --- a/src/osmo_gsm_tester/osmo_bsc.py +++ b/src/osmo_gsm_tester/osmo_bsc.py @@ -29,6 +29,7 @@ config_file = None process = None bts = None + encryption = None def __init__(self, suite_run, msc, ip_address): super().__init__(log.C_RUN, 'osmo-bsc_%s' % ip_address.get('addr')) @@ -81,6 +82,10 @@ bts_list.append(bts.conf_for_bsc()) config.overlay(values, dict(bsc=dict(net=dict(bts_list=bts_list)))) + # runtime parameters: + if self.encryption is not None: + config.overlay(values, dict(bsc=dict(net=dict(encryption=self.encryption)))) + self.dbg('BSC CONFIG:\n' + pprint.pformat(values)) with open(self.config_file, 'w') as f: @@ -91,6 +96,9 @@ def addr(self): return self.ip_address.get('addr') + def set_encryption(self, val): + self.encryption = val + def bts_add(self, bts): self.bts.append(bts) bts.set_bsc(self) -- To view, visit https://gerrit.osmocom.org/3604 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I857b3860fb771b36fb3d587d4e92b320f0685a19 Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Thu Aug 24 16:39:15 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 24 Aug 2017 16:39:15 +0000 Subject: [MERGED] osmo-gsm-tester[master]: Add support for authentication VTY param in msc and bsc In-Reply-To: References: Message-ID: Pau Espin Pedrol has submitted this change and it was merged. Change subject: Add support for authentication VTY param in msc and bsc ...................................................................... Add support for authentication VTY param in msc and bsc Change-Id: Ie1eb76149d4b006631050f8a1e532fbdbdad6a7f --- M example/defaults.conf M src/osmo_gsm_tester/osmo_msc.py M src/osmo_gsm_tester/templates/osmo-bsc.cfg.tmpl M src/osmo_gsm_tester/templates/osmo-msc.cfg.tmpl 4 files changed, 14 insertions(+), 0 deletions(-) Approvals: Pau Espin Pedrol: Looks good to me, approved Jenkins Builder: Verified diff --git a/example/defaults.conf b/example/defaults.conf index 95bd172..082f159 100644 --- a/example/defaults.conf +++ b/example/defaults.conf @@ -15,6 +15,7 @@ long_name: osmo-gsm-tester-msc auth_policy: closed encryption: a5 0 + authentication: optional msc: net: @@ -24,6 +25,7 @@ long_name: osmo-gsm-tester-msc auth_policy: closed encryption: a5 0 + authentication: optional bsc_bts: location_area_code: 23 diff --git a/src/osmo_gsm_tester/osmo_msc.py b/src/osmo_gsm_tester/osmo_msc.py index 92a9d61..f023b29 100644 --- a/src/osmo_gsm_tester/osmo_msc.py +++ b/src/osmo_gsm_tester/osmo_msc.py @@ -32,6 +32,7 @@ config = None smsc = None encryption = None + authentication = None def __init__(self, suite_run, hlr, mgcpgw, ip_address): super().__init__(log.C_RUN, 'osmo-msc_%s' % ip_address.get('addr')) @@ -81,6 +82,9 @@ # runtime parameters: if self.encryption is not None: config.overlay(values, dict(msc=dict(net=dict(encryption=self.encryption)))) + if self.authentication is not None: + config.overlay(values, dict(msc=dict(net=dict(authentication=self.authentication)))) + self.config = values @@ -97,6 +101,12 @@ def set_encryption(self, val): self.encryption = val + def set_authentication(self, val): + if val is None: + self.authroziation = None + return + self.authentication = "required" if val else "optional" + def mcc(self): return self.config['msc']['net']['mcc'] diff --git a/src/osmo_gsm_tester/templates/osmo-bsc.cfg.tmpl b/src/osmo_gsm_tester/templates/osmo-bsc.cfg.tmpl index 0e2f759..57ab8a3 100644 --- a/src/osmo_gsm_tester/templates/osmo-bsc.cfg.tmpl +++ b/src/osmo_gsm_tester/templates/osmo-bsc.cfg.tmpl @@ -29,6 +29,7 @@ auth policy ${bsc.net.auth_policy} location updating reject cause 13 encryption ${bsc.net.encryption} + authentication ${bsc.net.authentication} neci 1 rrlp mode none mm info 1 diff --git a/src/osmo_gsm_tester/templates/osmo-msc.cfg.tmpl b/src/osmo_gsm_tester/templates/osmo-msc.cfg.tmpl index 1abaf20..6851ea9 100644 --- a/src/osmo_gsm_tester/templates/osmo-msc.cfg.tmpl +++ b/src/osmo_gsm_tester/templates/osmo-msc.cfg.tmpl @@ -16,6 +16,7 @@ auth policy ${msc.net.auth_policy} location updating reject cause 13 encryption ${msc.net.encryption} + authentication ${msc.net.authentication} cs7 instance 0 point-code 0.0.1 msc -- To view, visit https://gerrit.osmocom.org/3594 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ie1eb76149d4b006631050f8a1e532fbdbdad6a7f Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: neels From gerrit-no-reply at lists.osmocom.org Thu Aug 24 16:39:15 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 24 Aug 2017 16:39:15 +0000 Subject: [MERGED] osmo-gsm-tester[master]: hlr: Implement subscriber_delete API In-Reply-To: References: Message-ID: Pau Espin Pedrol has submitted this change and it was merged. Change subject: hlr: Implement subscriber_delete API ...................................................................... hlr: Implement subscriber_delete API Change-Id: Iefb30ad552929386743d936bf629fe7a760a4713 --- M src/osmo_gsm_tester/osmo_hlr.py 1 file changed, 13 insertions(+), 0 deletions(-) Approvals: Pau Espin Pedrol: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/osmo_gsm_tester/osmo_hlr.py b/src/osmo_gsm_tester/osmo_hlr.py index 16548ad..08de07c 100644 --- a/src/osmo_gsm_tester/osmo_hlr.py +++ b/src/osmo_gsm_tester/osmo_hlr.py @@ -129,6 +129,19 @@ conn.close() return subscriber_id + def subscriber_delete(self, modem): + self.log('Add subscriber', imsi=modem.imsi()) + conn = sqlite3.connect(self.db_file) + try: + c = conn.cursor() + c.execute('select id from subscriber where imsi = ?', (modem.imsi(),)) + subscriber_id = c.fetchone()[0] + c.execute('delete from subscriber where id = ?', (subscriber_id,)) + c.execute('delete from auc_2g where subscriber_id = ?', (subscriber_id,)) + conn.commit() + finally: + conn.close() + def conf_for_msc(self): return dict(hlr=dict(ip_address=self.ip_address)) -- To view, visit https://gerrit.osmocom.org/3593 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Iefb30ad552929386743d936bf629fe7a760a4713 Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: neels From gerrit-no-reply at lists.osmocom.org Thu Aug 24 16:39:15 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 24 Aug 2017 16:39:15 +0000 Subject: [MERGED] osmo-gsm-tester[master]: hlr: Use python module instead of cmdline to modify sqlite db In-Reply-To: References: Message-ID: Pau Espin Pedrol has submitted this change and it was merged. Change subject: hlr: Use python module instead of cmdline to modify sqlite db ...................................................................... hlr: Use python module instead of cmdline to modify sqlite db Change-Id: I94a294c37f361a666064094455c9a1e1399fdfc7 --- M check_dependencies.py M src/osmo_gsm_tester/osmo_hlr.py 2 files changed, 12 insertions(+), 16 deletions(-) Approvals: Pau Espin Pedrol: Looks good to me, approved Jenkins Builder: Verified diff --git a/check_dependencies.py b/check_dependencies.py index 2c9e5c3..d9b857c 100755 --- a/check_dependencies.py +++ b/check_dependencies.py @@ -23,5 +23,6 @@ import traceback import yaml import pydbus +import sqlite3 print('dependencies ok') diff --git a/src/osmo_gsm_tester/osmo_hlr.py b/src/osmo_gsm_tester/osmo_hlr.py index fbcd43e..16548ad 100644 --- a/src/osmo_gsm_tester/osmo_hlr.py +++ b/src/osmo_gsm_tester/osmo_hlr.py @@ -20,6 +20,7 @@ import os import re import pprint +import sqlite3 from . import log, util, config, template, process, osmo_ctrl, pcap_recorder @@ -107,16 +108,6 @@ log.ctx(proc) raise log.Error('Exited in error') - def run_sql_file(self, name, sql_file): - self.run_local(name, ('/bin/sh', '-c', 'sqlite3 %r < %r' % (self.db_file, sql_file))) - - def run_sql(self, name, sql): - self.dbg('SQL:', repr(sql)) - sql_file = self.run_dir.new_file(name + '.sql') - with open(sql_file, 'w') as f: - f.write(sql) - self.run_sql_file(name, sql_file) - def subscriber_add(self, modem, msisdn=None, algo=None): if msisdn is None: msisdn = self.suite_run.resources_pool.next_msisdn(modem) @@ -126,12 +117,16 @@ if not algo: algo = self.AUTH_ALGO_COMP128v1 if modem.ki() else self.AUTH_ALGO_NONE self.log('Add subscriber', msisdn=msisdn, imsi=modem.imsi(), subscriber_id=subscriber_id, algo=algo) - self.run_sql('add_subscriber', - 'insert into subscriber (id, imsi, msisdn) values (%r, %r, %r);' - % (subscriber_id, modem.imsi(), modem.msisdn)) - self.run_sql('add_subscriber', - 'insert into auc_2g (subscriber_id, algo_id_2g, ki) values (%r, %r, %r);' - % (subscriber_id, algo, modem.ki())) + conn = sqlite3.connect(self.db_file) + try: + c = conn.cursor() + c.execute('insert into subscriber (id, imsi, msisdn) values (?, ?, ?)', + (subscriber_id, modem.imsi(), modem.msisdn,)) + c.execute('insert into auc_2g (subscriber_id, algo_id_2g, ki) values (?, ?, ?)', + (subscriber_id, algo, modem.ki(),)) + conn.commit() + finally: + conn.close() return subscriber_id def conf_for_msc(self): -- To view, visit https://gerrit.osmocom.org/3592 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I94a294c37f361a666064094455c9a1e1399fdfc7 Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: neels From gerrit-no-reply at lists.osmocom.org Thu Aug 24 16:39:15 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 24 Aug 2017 16:39:15 +0000 Subject: [MERGED] osmo-gsm-tester[master]: nitb: Introduce subscriber_delete API In-Reply-To: References: Message-ID: Pau Espin Pedrol has submitted this change and it was merged. Change subject: nitb: Introduce subscriber_delete API ...................................................................... nitb: Introduce subscriber_delete API Change-Id: I62829ed243857681bcc40a4a1861c5c583907f4b --- M src/osmo_gsm_tester/osmo_nitb.py 1 file changed, 17 insertions(+), 0 deletions(-) Approvals: Pau Espin Pedrol: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/osmo_gsm_tester/osmo_nitb.py b/src/osmo_gsm_tester/osmo_nitb.py index 3b396fa..be3b24b 100644 --- a/src/osmo_gsm_tester/osmo_nitb.py +++ b/src/osmo_gsm_tester/osmo_nitb.py @@ -119,6 +119,10 @@ self.log('Add subscriber', msisdn=msisdn, imsi=modem.imsi()) OsmoNitbCtrl(self).subscriber_add(modem.imsi(), msisdn, modem.ki()) + def subscriber_delete(self, modem): + self.log('Delete subscriber', imsi=modem.imsi()) + OsmoNitbCtrl(self).subscriber_delete(modem.imsi()) + def subscriber_attached(self, *modems): return self.imsi_attached(*[m.imsi() for m in modems]) @@ -138,6 +142,8 @@ PORT = 4249 SUBSCR_MODIFY_VAR = 'subscriber-modify-v1' SUBSCR_MODIFY_REPLY_RE = re.compile("SET_REPLY (\d+) %s OK" % SUBSCR_MODIFY_VAR) + SUBSCR_DELETE_VAR = 'subscriber-delete-v1' + SUBSCR_DELETE_REPLY_RE = re.compile("SET_REPLY (\d+) %s Removed" % SUBSCR_DELETE_VAR) SUBSCR_LIST_ACTIVE_VAR = 'subscriber-list-active-v1' def __init__(self, nitb): @@ -167,6 +173,17 @@ raise RuntimeError('Cannot create subscriber %r (answer=%r)' % (imsi, answer_str)) self.dbg('Created subscriber', imsi=imsi, msisdn=msisdn) + def subscriber_delete(self, imsi): + with self.ctrl() as ctrl: + ctrl.do_set(OsmoNitbCtrl.SUBSCR_DELETE_VAR, imsi) + data = ctrl.receive() + (answer, data) = ctrl.remove_ipa_ctrl_header(data) + answer_str = answer.decode('utf-8') + res = OsmoNitbCtrl.SUBSCR_DELETE_REPLY_RE.match(answer_str) + if not res: + raise RuntimeError('Cannot delete subscriber %r (answer=%r)' % (imsi, answer_str)) + self.dbg('Deleted subscriber', imsi=imsi) + def subscriber_list_active(self): aslist_str = "" with self.ctrl() as ctrl: -- To view, visit https://gerrit.osmocom.org/3591 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I62829ed243857681bcc40a4a1861c5c583907f4b Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: neels From gerrit-no-reply at lists.osmocom.org Thu Aug 24 16:39:16 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 24 Aug 2017 16:39:16 +0000 Subject: [MERGED] osmo-gsm-tester[master]: nitb: ctrl: Remove unused return statement in subscriber_add In-Reply-To: References: Message-ID: Pau Espin Pedrol has submitted this change and it was merged. Change subject: nitb: ctrl: Remove unused return statement in subscriber_add ...................................................................... nitb: ctrl: Remove unused return statement in subscriber_add In case of failure an exception is raised. If everything goes well no need to return True. Change-Id: I5194eeb9208f973da12f2fa710f2b3e7acd78fb5 --- M src/osmo_gsm_tester/osmo_nitb.py 1 file changed, 0 insertions(+), 1 deletion(-) Approvals: Pau Espin Pedrol: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/osmo_gsm_tester/osmo_nitb.py b/src/osmo_gsm_tester/osmo_nitb.py index 9c15fe6..3b396fa 100644 --- a/src/osmo_gsm_tester/osmo_nitb.py +++ b/src/osmo_gsm_tester/osmo_nitb.py @@ -166,7 +166,6 @@ if not res: raise RuntimeError('Cannot create subscriber %r (answer=%r)' % (imsi, answer_str)) self.dbg('Created subscriber', imsi=imsi, msisdn=msisdn) - return True def subscriber_list_active(self): aslist_str = "" -- To view, visit https://gerrit.osmocom.org/3590 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I5194eeb9208f973da12f2fa710f2b3e7acd78fb5 Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: neels From gerrit-no-reply at lists.osmocom.org Thu Aug 24 16:39:16 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 24 Aug 2017 16:39:16 +0000 Subject: [MERGED] osmo-gsm-tester[master]: hlr: fill auc_2g table when registering a subscriber In-Reply-To: References: Message-ID: Pau Espin Pedrol has submitted this change and it was merged. Change subject: hlr: fill auc_2g table when registering a subscriber ...................................................................... hlr: fill auc_2g table when registering a subscriber Change-Id: I491d093934c129a01baa1c5d7ada4acf370bf37d --- M src/osmo_gsm_tester/osmo_hlr.py 1 file changed, 11 insertions(+), 2 deletions(-) Approvals: Pau Espin Pedrol: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/osmo_gsm_tester/osmo_hlr.py b/src/osmo_gsm_tester/osmo_hlr.py index 19241cc..fbcd43e 100644 --- a/src/osmo_gsm_tester/osmo_hlr.py +++ b/src/osmo_gsm_tester/osmo_hlr.py @@ -31,6 +31,10 @@ process = None next_subscriber_id = 1 + AUTH_ALGO_NONE = 0 + AUTH_ALGO_XOR = 1 + AUTH_ALGO_COMP128v1 = 2 + def __init__(self, suite_run, ip_address): super().__init__(log.C_RUN, 'osmo-hlr_%s' % ip_address.get('addr')) self.suite_run = suite_run @@ -113,16 +117,21 @@ f.write(sql) self.run_sql_file(name, sql_file) - def subscriber_add(self, modem, msisdn=None): + def subscriber_add(self, modem, msisdn=None, algo=None): if msisdn is None: msisdn = self.suite_run.resources_pool.next_msisdn(modem) modem.set_msisdn(msisdn) subscriber_id = self.next_subscriber_id self.next_subscriber_id += 1 - self.log('Add subscriber', msisdn=msisdn, imsi=modem.imsi(), subscriber_id=subscriber_id) + if not algo: + algo = self.AUTH_ALGO_COMP128v1 if modem.ki() else self.AUTH_ALGO_NONE + self.log('Add subscriber', msisdn=msisdn, imsi=modem.imsi(), subscriber_id=subscriber_id, algo=algo) self.run_sql('add_subscriber', 'insert into subscriber (id, imsi, msisdn) values (%r, %r, %r);' % (subscriber_id, modem.imsi(), modem.msisdn)) + self.run_sql('add_subscriber', + 'insert into auc_2g (subscriber_id, algo_id_2g, ki) values (%r, %r, %r);' + % (subscriber_id, algo, modem.ki())) return subscriber_id def conf_for_msc(self): -- To view, visit https://gerrit.osmocom.org/3584 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I491d093934c129a01baa1c5d7ada4acf370bf37d Gerrit-PatchSet: 2 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: neels From gerrit-no-reply at lists.osmocom.org Thu Aug 24 17:08:55 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 24 Aug 2017 17:08:55 +0000 Subject: osmo-msc[master]: Implement AoIP, port to M3UA SIGTRAN (large addition and ref... In-Reply-To: References: Message-ID: Patch Set 3: depends: Idc68bfae5457960a9eae5d9648586d6ce719ad68 -- To view, visit https://gerrit.osmocom.org/3486 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I5ae4e05ee7c57cad341ea5e86af37c1f6b0ffa77 Gerrit-PatchSet: 3 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: dexter Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Aug 24 17:38:39 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 24 Aug 2017 17:38:39 +0000 Subject: [PATCH] sandbox[master]: add .gitreview Message-ID: Review at https://gerrit.osmocom.org/3608 add .gitreview A .gitreview file is required to use git review. More information about git review https://www.mediawiki.org/wiki/Gerrit/git-review Change-Id: Ie7cdf16232181d4b8093e61f2d8a3faed9010d4f --- A .gitreview 1 file changed, 3 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/sandbox refs/changes/08/3608/1 diff --git a/.gitreview b/.gitreview new file mode 100644 index 0000000..e7058f4 --- /dev/null +++ b/.gitreview @@ -0,0 +1,3 @@ +[gerrit] +host=gerrit.osmocom.org +project=sandbox -- To view, visit https://gerrit.osmocom.org/3608 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ie7cdf16232181d4b8093e61f2d8a3faed9010d4f Gerrit-PatchSet: 1 Gerrit-Project: sandbox Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Thu Aug 24 17:39:40 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 24 Aug 2017 17:39:40 +0000 Subject: sandbox[master]: add .gitreview In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 Verified+1 -- To view, visit https://gerrit.osmocom.org/3608 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ie7cdf16232181d4b8093e61f2d8a3faed9010d4f Gerrit-PatchSet: 1 Gerrit-Project: sandbox Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Aug 24 17:39:42 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 24 Aug 2017 17:39:42 +0000 Subject: [MERGED] sandbox[master]: add .gitreview In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: add .gitreview ...................................................................... add .gitreview A .gitreview file is required to use git review. More information about git review https://www.mediawiki.org/wiki/Gerrit/git-review Change-Id: Ie7cdf16232181d4b8093e61f2d8a3faed9010d4f --- A .gitreview 1 file changed, 3 insertions(+), 0 deletions(-) Approvals: Neels Hofmeyr: Looks good to me, approved; Verified diff --git a/.gitreview b/.gitreview new file mode 100644 index 0000000..e7058f4 --- /dev/null +++ b/.gitreview @@ -0,0 +1,3 @@ +[gerrit] +host=gerrit.osmocom.org +project=sandbox -- To view, visit https://gerrit.osmocom.org/3608 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ie7cdf16232181d4b8093e61f2d8a3faed9010d4f Gerrit-PatchSet: 1 Gerrit-Project: sandbox Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Thu Aug 24 17:40:55 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 24 Aug 2017 17:40:55 +0000 Subject: [PATCH] osmo-msc[master]: smpp_smsc.c: Log on sending deliver_sm message Message-ID: Review at https://gerrit.osmocom.org/3609 smpp_smsc.c: Log on sending deliver_sm message Change-Id: Ie16294df6d5bc0065f8d2b49320ead61f535f271 --- M src/libmsc/smpp_smsc.c 1 file changed, 3 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/09/3609/1 diff --git a/src/libmsc/smpp_smsc.c b/src/libmsc/smpp_smsc.c index 48a1192..4c2e4aa 100644 --- a/src/libmsc/smpp_smsc.c +++ b/src/libmsc/smpp_smsc.c @@ -654,6 +654,9 @@ { deliver->sequence_number = esme_inc_seq_nr(esme); + LOGP(DSMPP, LOGL_DEBUG, "[%s] Tx DELIVER-SM (from %s)\n", + esme->system_id, deliver->source_addr); + return PACK_AND_SEND(esme, deliver); } -- To view, visit https://gerrit.osmocom.org/3609 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ie16294df6d5bc0065f8d2b49320ead61f535f271 Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Thu Aug 24 17:40:56 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 24 Aug 2017 17:40:56 +0000 Subject: [PATCH] osmo-msc[master]: smpp: fix return cause Message-ID: Review at https://gerrit.osmocom.org/3610 smpp: fix return cause Return cause 38 when default SMPP route is unavailable. This is better than cause 1. Change-Id: If3241d50a78fa611981e55fef6ae4c72b0a2a167 --- M src/libmsc/gsm_04_11.c M src/libmsc/smpp_openbsc.c M src/libmsc/smpp_smsc.c M src/libmsc/smpp_smsc.h 4 files changed, 17 insertions(+), 12 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/10/3610/1 diff --git a/src/libmsc/gsm_04_11.c b/src/libmsc/gsm_04_11.c index bdf2ad7..6c6a1fb 100644 --- a/src/libmsc/gsm_04_11.c +++ b/src/libmsc/gsm_04_11.c @@ -296,6 +296,7 @@ if (smpp_first) { rc = smpp_try_deliver(gsms, conn, deferred); if (rc == GSM411_RP_CAUSE_MO_NUM_UNASSIGNED) + /* unknown subscriber, try local */ goto try_local; if (rc < 0) { LOGP(DLSMS, LOGL_ERROR, "%s: SMS delivery error: %d.", diff --git a/src/libmsc/smpp_openbsc.c b/src/libmsc/smpp_openbsc.c index 24a4653..b3f9bbb 100644 --- a/src/libmsc/smpp_openbsc.c +++ b/src/libmsc/smpp_openbsc.c @@ -709,17 +709,18 @@ { struct osmo_esme *esme; struct osmo_smpp_addr dst; + int rc; memset(&dst, 0, sizeof(dst)); dst.ton = sms->dst.ton; dst.npi = sms->dst.npi; memcpy(dst.addr, sms->dst.addr, sizeof(dst.addr)); - esme = smpp_route(g_smsc, &dst); - if (!esme) - return GSM411_RP_CAUSE_MO_NUM_UNASSIGNED; + rc = smpp_route(g_smsc, &dst, &esme); + if (!rc) + rc = deliver_to_esme(esme, sms, conn, deferred); - return deliver_to_esme(esme, sms, conn, deferred); + return rc; } struct smsc *smsc_from_vty(struct vty *v) diff --git a/src/libmsc/smpp_smsc.c b/src/libmsc/smpp_smsc.c index 4c2e4aa..04afc49 100644 --- a/src/libmsc/smpp_smsc.c +++ b/src/libmsc/smpp_smsc.c @@ -270,8 +270,7 @@ } /*! \brief try to find a SMPP route (ESME) for given destination */ -struct osmo_esme * -smpp_route(const struct smsc *smsc, const struct osmo_smpp_addr *dest) +int smpp_route(const struct smsc *smsc, const struct osmo_smpp_addr *dest, struct osmo_esme **pesme) { struct osmo_smpp_route *r; struct osmo_smpp_acl *acl = NULL; @@ -314,15 +313,20 @@ struct osmo_esme *esme; DEBUGP(DSMPP, "ACL even has ESME, we can route to it!\n"); esme = acl->esme; - if (esme->bind_flags & ESME_BIND_RX) - return esme; - else + if (esme->bind_flags & ESME_BIND_RX) { + *pesme = esme; + return 0; + } else LOGP(DSMPP, LOGL_NOTICE, "[%s] is matching route, " "but not bound for Rx, discarding MO SMS\n", esme->system_id); } - return NULL; + *pesme = NULL; + if (acl) + return GSM48_CC_CAUSE_NETWORK_OOO; + else + return GSM48_CC_CAUSE_UNASSIGNED_NR; } diff --git a/src/libmsc/smpp_smsc.h b/src/libmsc/smpp_smsc.h index 4bee59b..fded236 100644 --- a/src/libmsc/smpp_smsc.h +++ b/src/libmsc/smpp_smsc.h @@ -126,8 +126,7 @@ void smpp_esme_get(struct osmo_esme *esme); void smpp_esme_put(struct osmo_esme *esme); -struct osmo_esme * -smpp_route(const struct smsc *smsc, const struct osmo_smpp_addr *dest); +int smpp_route(const struct smsc *smsc, const struct osmo_smpp_addr *dest, struct osmo_esme **emse); struct osmo_smpp_acl *smpp_acl_alloc(struct smsc *smsc, const char *sys_id); struct osmo_smpp_acl *smpp_acl_by_system_id(struct smsc *smsc, -- To view, visit https://gerrit.osmocom.org/3610 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: If3241d50a78fa611981e55fef6ae4c72b0a2a167 Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Thu Aug 24 17:40:56 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 24 Aug 2017 17:40:56 +0000 Subject: [PATCH] osmo-msc[master]: jenkins.sh: Proper error message if local environment isn't ... Message-ID: Review at https://gerrit.osmocom.org/3611 jenkins.sh: Proper error message if local environment isn't set up Change-Id: I79c2302365824d9c8783dadfa378c8eaa07e2ee7 --- M contrib/jenkins.sh 1 file changed, 7 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/11/3611/1 diff --git a/contrib/jenkins.sh b/contrib/jenkins.sh index 5903429..30c86b4 100755 --- a/contrib/jenkins.sh +++ b/contrib/jenkins.sh @@ -1,4 +1,11 @@ #!/usr/bin/env bash +# jenkins build helper script for openbsc. This is how we build on jenkins.osmocom.org + +if ! [ -x "$(command -v osmo-build-dep.sh)" ]; then + echo "Error: We need to have scripts/osmo-deps.sh from http://git.osmocom.org/osmo-ci/ in PATH !" + exit 2 +fi + set -ex -- To view, visit https://gerrit.osmocom.org/3611 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I79c2302365824d9c8783dadfa378c8eaa07e2ee7 Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Thu Aug 24 17:40:56 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 24 Aug 2017 17:40:56 +0000 Subject: [PATCH] osmo-msc[master]: 04.08: find a portable way to obtain the timezone offset Message-ID: Review at https://gerrit.osmocom.org/3612 04.08: find a portable way to obtain the timezone offset Portable GMT offset calculation to display correct time on GSM. Change-Id: I673f17af2550c9708c4771e4ea4eafbbfafbb824 --- M src/libmsc/gsm_04_08.c 1 file changed, 10 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/12/3612/1 diff --git a/src/libmsc/gsm_04_08.c b/src/libmsc/gsm_04_08.c index 3f3f905..a4e16fb 100644 --- a/src/libmsc/gsm_04_08.c +++ b/src/libmsc/gsm_04_08.c @@ -496,12 +496,19 @@ else { /* Need to get GSM offset and convert into 15 min units */ /* This probably breaks if gmtoff returns a value not evenly divisible by 15? */ - local_time = localtime(&cur_t); #ifdef HAVE_TM_GMTOFF_IN_TM + local_time = localtime(&cur_t); tzunits = (local_time->tm_gmtoff/60)/15; #else -#warning find a portable way to obtain the timezone offset - tzunits = 0; + /* find timezone offset */ + time_t utc; + double offsetFromUTC; + utc = mktime(gmt_time); + local_time = localtime(&cur_t); + offsetFromUTC = difftime(cur_t, utc); + if (local_time->tm_isdst) + offsetFromUTC += 3600.0; + tzunits = ((int)offsetFromUTC) / 60 / 15; #endif if (tzunits < 0) { tzunits = tzunits/-1; -- To view, visit https://gerrit.osmocom.org/3612 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I673f17af2550c9708c4771e4ea4eafbbfafbb824 Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Thu Aug 24 17:40:56 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 24 Aug 2017 17:40:56 +0000 Subject: [PATCH] osmo-msc[master]: sgsn: Fill the cch_pdp with a value coming from the tlv stru... Message-ID: Review at https://gerrit.osmocom.org/3613 sgsn: Fill the cch_pdp with a value coming from the tlv structure For some GGSNs we need to insert the PDP Charging Characteristics that were returned. We receive these values from GSUP and will fill them into the tlv structure when finding the ggsn context. Change-Id: I1725bfd2403d29ce3550bfcd6fcc1498426ef906 --- M include/openbsc/gprs_sgsn.h M src/gprs/gprs_sgsn.c M src/gprs/gprs_subscriber.c M src/gprs/sgsn_libgtp.c 4 files changed, 42 insertions(+), 5 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/13/3613/1 diff --git a/include/openbsc/gprs_sgsn.h b/include/openbsc/gprs_sgsn.h index fd86174..4e49c08 100644 --- a/include/openbsc/gprs_sgsn.h +++ b/include/openbsc/gprs_sgsn.h @@ -393,6 +393,8 @@ char apn_str[GSM_APN_LENGTH]; uint8_t qos_subscribed[20]; size_t qos_subscribed_len; + uint8_t pdp_charg[2]; + bool has_pdp_charg; }; struct sgsn_subscriber_data { @@ -407,6 +409,9 @@ uint8_t hlr[9]; size_t hlr_len; + + uint8_t pdp_charg[2]; + bool has_pdp_charg; }; #define SGSN_ERROR_CAUSE_NONE (-1) diff --git a/src/gprs/gprs_sgsn.c b/src/gprs/gprs_sgsn.c index 18625ae..11225dd 100644 --- a/src/gprs/gprs_sgsn.c +++ b/src/gprs/gprs_sgsn.c @@ -699,10 +699,21 @@ sgsn_auth_update(mmctx); } -static void insert_qos(struct tlv_parsed *tp, struct sgsn_subscriber_pdp_data *pdp) +static void insert_extra(struct tlv_parsed *tp, + struct sgsn_subscriber_data *data, + struct sgsn_subscriber_pdp_data *pdp) { tp->lv[OSMO_IE_GSM_SUB_QOS].len = pdp->qos_subscribed_len; tp->lv[OSMO_IE_GSM_SUB_QOS].val = pdp->qos_subscribed; + + /* Prefer PDP charging characteristics of per subscriber one */ + if (pdp->has_pdp_charg) { + tp->lv[OSMO_IE_GSM_CHARG_CHAR].len = sizeof(pdp->pdp_charg); + tp->lv[OSMO_IE_GSM_CHARG_CHAR].val = &pdp->pdp_charg[0]; + } else if (data->has_pdp_charg) { + tp->lv[OSMO_IE_GSM_CHARG_CHAR].len = sizeof(data->pdp_charg); + tp->lv[OSMO_IE_GSM_CHARG_CHAR].val = &data->pdp_charg[0]; + } } /** @@ -751,7 +762,7 @@ { allow_any_apn = 1; selected_apn_str = ""; - insert_qos(tp, pdp); + insert_extra(tp, mmctx->subscr->sgsn_data, pdp); continue; } if (!llist_empty(&sgsn_apn_ctxts)) { @@ -760,7 +771,7 @@ if (apn_ctx == NULL) continue; } - insert_qos(tp, pdp); + insert_extra(tp, mmctx->subscr->sgsn_data, pdp); selected_apn_str = pdp->apn_str; break; } @@ -768,13 +779,13 @@ /* Check whether the given APN is granted */ llist_for_each_entry(pdp, &mmctx->subscr->sgsn_data->pdp_list, list) { if (strcmp(pdp->apn_str, "*") == 0) { - insert_qos(tp, pdp); + insert_extra(tp, mmctx->subscr->sgsn_data, pdp); selected_apn_str = req_apn_str; allow_any_apn = 1; continue; } if (strcasecmp(pdp->apn_str, req_apn_str) == 0) { - insert_qos(tp, pdp); + insert_extra(tp, mmctx->subscr->sgsn_data, pdp); selected_apn_str = req_apn_str; break; } diff --git a/src/gprs/gprs_subscriber.c b/src/gprs/gprs_subscriber.c index 176583b..aa03509 100644 --- a/src/gprs/gprs_subscriber.c +++ b/src/gprs/gprs_subscriber.c @@ -325,6 +325,13 @@ } } + if (gsup_msg->pdp_charg_enc && gsup_msg->pdp_charg_enc_len >= sizeof(sdata->pdp_charg)) { + memcpy(&sdata->pdp_charg, gsup_msg->pdp_charg_enc, sizeof(sdata->pdp_charg)); + sdata->has_pdp_charg = 1; + } else { + sdata->has_pdp_charg = 0; + } + if (gsup_msg->pdp_info_compl) { rc = gprs_subscr_pdp_data_clear(subscr); if (rc > 0) @@ -368,6 +375,13 @@ pdp_info->apn_enc, pdp_info->apn_enc_len); memcpy(pdp_data->qos_subscribed, pdp_info->qos_enc, pdp_info->qos_enc_len); pdp_data->qos_subscribed_len = pdp_info->qos_enc_len; + + if (pdp_info->pdp_charg_enc && pdp_info->pdp_charg_enc_len >= sizeof(pdp_data->pdp_charg)) { + memcpy(&pdp_data->pdp_charg, pdp_info->pdp_charg_enc, sizeof(pdp_data->pdp_charg)); + pdp_data->has_pdp_charg = 1; + } else { + pdp_data->has_pdp_charg = 0; + } } } diff --git a/src/gprs/sgsn_libgtp.c b/src/gprs/sgsn_libgtp.c index 7595bf8..0a0de08 100644 --- a/src/gprs/sgsn_libgtp.c +++ b/src/gprs/sgsn_libgtp.c @@ -234,6 +234,13 @@ memcpy(pdp->qos_req.v, qos, pdp->qos_req.l); } + /* charging characteristics if present */ + if (TLVP_LEN(tp, OSMO_IE_GSM_CHARG_CHAR) > 0) { + OSMO_ASSERT(TLVP_LEN(tp, OSMO_IE_GSM_CHARG_CHAR) <= sizeof(pdp->cch_pdp)); + memcpy(&pdp->cch_pdp, TLVP_VAL(tp, OSMO_IE_GSM_CHARG_CHAR), + TLVP_LEN(tp, OSMO_IE_GSM_CHARG_CHAR)); + } + /* SGSN address for control plane */ pdp->gsnlc.l = sizeof(sgsn->cfg.gtp_listenaddr.sin_addr); memcpy(pdp->gsnlc.v, &sgsn->cfg.gtp_listenaddr.sin_addr, -- To view, visit https://gerrit.osmocom.org/3613 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I1725bfd2403d29ce3550bfcd6fcc1498426ef906 Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Holger Freyther From gerrit-no-reply at lists.osmocom.org Thu Aug 24 17:40:57 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 24 Aug 2017 17:40:57 +0000 Subject: [PATCH] osmo-msc[master]: libmsc: Fix VTY output for handover counters. Message-ID: Review at https://gerrit.osmocom.org/3614 libmsc: Fix VTY output for handover counters. Handover countrs belong to BSC, but we mistakenly take values from MSC counters. Change-Id: I9512330f2e91d2f526751c5228e6e8e0fe17d579 --- M src/libmsc/vty_interface_layer3.c 1 file changed, 5 insertions(+), 5 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/14/3614/1 diff --git a/src/libmsc/vty_interface_layer3.c b/src/libmsc/vty_interface_layer3.c index d1bf6b3..1761ebc 100644 --- a/src/libmsc/vty_interface_layer3.c +++ b/src/libmsc/vty_interface_layer3.c @@ -570,11 +570,11 @@ VTY_NEWLINE); vty_out(vty, "Handover : %lu attempted, %lu no_channel, %lu timeout, " "%lu completed, %lu failed%s", - net->msc_ctrs->ctr[BSC_CTR_HANDOVER_ATTEMPTED].current, - net->msc_ctrs->ctr[BSC_CTR_HANDOVER_NO_CHANNEL].current, - net->msc_ctrs->ctr[BSC_CTR_HANDOVER_TIMEOUT].current, - net->msc_ctrs->ctr[BSC_CTR_HANDOVER_COMPLETED].current, - net->msc_ctrs->ctr[BSC_CTR_HANDOVER_FAILED].current, + net->bsc_ctrs->ctr[BSC_CTR_HANDOVER_ATTEMPTED].current, + net->bsc_ctrs->ctr[BSC_CTR_HANDOVER_NO_CHANNEL].current, + net->bsc_ctrs->ctr[BSC_CTR_HANDOVER_TIMEOUT].current, + net->bsc_ctrs->ctr[BSC_CTR_HANDOVER_COMPLETED].current, + net->bsc_ctrs->ctr[BSC_CTR_HANDOVER_FAILED].current, VTY_NEWLINE); vty_out(vty, "SMS MO : %lu submitted, %lu no receiver%s", net->msc_ctrs->ctr[MSC_CTR_SMS_SUBMITTED].current, -- To view, visit https://gerrit.osmocom.org/3614 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I9512330f2e91d2f526751c5228e6e8e0fe17d579 Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Alexander Chemeris From gerrit-no-reply at lists.osmocom.org Thu Aug 24 17:40:57 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 24 Aug 2017 17:40:57 +0000 Subject: [PATCH] osmo-msc[master]: Support for TS 04.14 conformance test commands Message-ID: Review at https://gerrit.osmocom.org/3615 Support for TS 04.14 conformance test commands Change-Id: Ib27edbfc8ccdedf00589ec715ced7bed435fa94c --- M include/openbsc/Makefile.am A include/openbsc/gsm_04_14.h M src/libmsc/Makefile.am M src/libmsc/gsm_04_08.c A src/libmsc/gsm_04_14.c 5 files changed, 154 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/15/3615/1 diff --git a/include/openbsc/Makefile.am b/include/openbsc/Makefile.am index 2558d7c..995f02d 100644 --- a/include/openbsc/Makefile.am +++ b/include/openbsc/Makefile.am @@ -37,6 +37,7 @@ gprs_utils.h \ gsm_04_08.h \ gsm_04_11.h \ + gsm_04_14.h \ gsm_04_80.h \ gsm_data.h \ gsm_data_shared.h \ diff --git a/include/openbsc/gsm_04_14.h b/include/openbsc/gsm_04_14.h new file mode 100644 index 0000000..3cdbe04 --- /dev/null +++ b/include/openbsc/gsm_04_14.h @@ -0,0 +1,15 @@ +#pragma once + +#include + +int gsm0414_tx_close_tch_loop_cmd(struct gsm_subscriber_connection *conn, + enum gsm414_tch_loop_mode loop_mode); +int gsm0414_tx_open_loop_cmd(struct gsm_subscriber_connection *conn); +int gsm0414_tx_act_emmi_cmd(struct gsm_subscriber_connection *conn); +int gsm0414_tx_test_interface(struct gsm_subscriber_connection *conn, + uint8_t tested_devs); +int gsm0414_tx_reset_ms_pos_store(struct gsm_subscriber_connection *conn, + uint8_t technology); + +int gsm0414_rcv_test(struct gsm_subscriber_connection *conn, + struct msgb *msg); diff --git a/src/libmsc/Makefile.am b/src/libmsc/Makefile.am index 16154ff..4726bbe 100644 --- a/src/libmsc/Makefile.am +++ b/src/libmsc/Makefile.am @@ -30,6 +30,7 @@ db.c \ gsm_04_08.c \ gsm_04_11.c \ + gsm_04_14.c \ gsm_04_80.c \ gsm_subscriber.c \ iucs.c \ diff --git a/src/libmsc/gsm_04_08.c b/src/libmsc/gsm_04_08.c index a4e16fb..07efb32 100644 --- a/src/libmsc/gsm_04_08.c +++ b/src/libmsc/gsm_04_08.c @@ -43,6 +43,7 @@ #include #include #include +#include #include #include #include @@ -3077,6 +3078,9 @@ case GSM48_PDISC_NC_SS: rc = handle_rcv_ussd(conn, msg); break; + case GSM48_PDISC_TEST: + rc = gsm0414_rcv_test(conn, msg); + break; default: LOGP(DRLL, LOGL_NOTICE, "Unknown " "GSM 04.08 discriminator 0x%02x\n", pdisc); diff --git a/src/libmsc/gsm_04_14.c b/src/libmsc/gsm_04_14.c new file mode 100644 index 0000000..b529f4c --- /dev/null +++ b/src/libmsc/gsm_04_14.c @@ -0,0 +1,133 @@ +/* GSM MS Testing Layer 3 messages + * 3GPP TS 44.014 / GSM TS 04.14 */ + +/* (C) 2017 by Harald Welte + * + * All Rights Reserved + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + * + */ + +#include +#include +#include + +#include "bscconfig.h" + +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include + +static struct msgb *create_gsm0414_msg(uint8_t msg_type) +{ + struct msgb *msg = gsm48_msgb_alloc_name("GSM 04.14"); + struct gsm48_hdr *gh; + + gh = (struct gsm48_hdr *) msgb_put(msg, sizeof(*gh) + 1); + gh->proto_discr = GSM48_PDISC_TEST; + gh->msg_type = msg_type; + return msg; +} + +static int gsm0414_conn_sendmsg(struct gsm_subscriber_connection *conn, struct msgb *msg) +{ + return msc_tx_dtap(conn, msg); +} + +static int gsm0414_tx_simple(struct gsm_subscriber_connection *conn, uint8_t msg_type) +{ + struct msgb *msg = create_gsm0414_msg(msg_type); + + return gsm0414_conn_sendmsg(conn, msg); +} + + +/* Send a CLOSE_TCH_LOOOP_CMD according to Section 8.1 */ +int gsm0414_tx_close_tch_loop_cmd(struct gsm_subscriber_connection *conn, + enum gsm414_tch_loop_mode loop_mode) +{ + struct msgb *msg = create_gsm0414_msg(GSM414_MT_CLOSE_TCH_LOOP_CMD); + uint8_t subch; + + subch = (loop_mode << 1); + msgb_put_u8(msg, subch); + + msg->lchan = conn->lchan; + return gsm0414_conn_sendmsg(conn, msg); +} + +/* Send a OPEN_LOOP_CMD according to Section 8.3 */ +int gsm0414_tx_open_loop_cmd(struct gsm_subscriber_connection *conn) +{ + return gsm0414_tx_simple(conn, GSM414_MT_OPEN_LOOP_CMD); +} + +/* Send a ACT_EMMI_CMD according to Section 8.8 */ +int gsm0414_tx_act_emmi_cmd(struct gsm_subscriber_connection *conn) +{ + return gsm0414_tx_simple(conn, GSM414_MT_ACT_EMMI_CMD); +} + +/* Send a DEACT_EMMI_CMD according to Section 8.10 */ +int gsm0414_tx_deact_emmi_cmd(struct gsm_subscriber_connection *conn) +{ + return gsm0414_tx_simple(conn, GSM414_MT_DEACT_EMMI_CMD); +} + +/* Send a TEST_INTERFACE according to Section 8.11 */ +int gsm0414_tx_test_interface(struct gsm_subscriber_connection *conn, + uint8_t tested_devs) +{ + struct msgb *msg = create_gsm0414_msg(GSM414_MT_TEST_INTERFACE); + msgb_put_u8(msg, tested_devs); + return gsm0414_conn_sendmsg(conn, msg); +} + +/* Send a RESET_MS_POSITION_STORED according to Section 8.11 */ +int gsm0414_tx_reset_ms_pos_store(struct gsm_subscriber_connection *conn, + uint8_t technology) +{ + struct msgb *msg = create_gsm0414_msg(GSM414_MT_RESET_MS_POS_STORED); + msgb_put_u8(msg, technology); + return gsm0414_conn_sendmsg(conn, msg); +} + + + +/* Entry point for incoming GSM48_PDISC_TEST received from MS */ +int gsm0414_rcv_test(struct gsm_subscriber_connection *conn, + struct msgb *msg) +{ + struct gsm48_hdr *gh = msgb_l3(msg); + + if (msgb_l3len(msg) < sizeof(*gh)) + return -1; + + LOGP(DMM, LOGL_NOTICE, "%s: Received TEST class message '%s'\n", "FIXME", + get_value_string(gsm414_msgt_names, gh->msg_type)); + + return 0; +} -- To view, visit https://gerrit.osmocom.org/3615 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ib27edbfc8ccdedf00589ec715ced7bed435fa94c Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Thu Aug 24 17:40:58 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 24 Aug 2017 17:40:58 +0000 Subject: [PATCH] osmo-msc[master]: Add VTY commands for experimentation with TS 04.14 commands Message-ID: Review at https://gerrit.osmocom.org/3616 Add VTY commands for experimentation with TS 04.14 commands TS 04.14 (TS 44.014) specifies a series of commands specific to conformance testing. Let's add some VTY commands to play (at least initially) with closing and opening voice loops in the MS. Change-Id: I38b1ee9dbf26f5689c38cb83b1b3c5e9eaad7678 --- M src/libmsc/vty_interface_layer3.c 1 file changed, 94 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/16/3616/1 diff --git a/src/libmsc/vty_interface_layer3.c b/src/libmsc/vty_interface_layer3.c index 1761ebc..864597d 100644 --- a/src/libmsc/vty_interface_layer3.c +++ b/src/libmsc/vty_interface_layer3.c @@ -46,6 +46,7 @@ #include #include #include +#include #include #include #include @@ -473,6 +474,97 @@ return CMD_SUCCESS; } +static int loop_by_char(uint8_t ch) +{ + switch (ch) { + case 'a': + return GSM414_LOOP_A; + case 'b': + return GSM414_LOOP_B; + case 'c': + return GSM414_LOOP_C; + case 'd': + return GSM414_LOOP_D; + case 'e': + return GSM414_LOOP_E; + case 'f': + return GSM414_LOOP_F; + case 'i': + return GSM414_LOOP_I; + } + return -1; +} + +DEFUN(subscriber_mstest_close, + subscriber_mstest_close_cmd, + "subscriber " SUBSCR_TYPES " ID ms-test close-loop (a|b|c|d|e|f|i)", + SUBSCR_HELP "Send a TS 04.14 MS Test Command to subscriber\n" + "Close a TCH Loop inside the MS\n" + "Loop Type A\n" + "Loop Type B\n" + "Loop Type C\n" + "Loop Type D\n" + "Loop Type E\n" + "Loop Type F\n" + "Loop Type I\n") +{ + struct gsm_subscriber_connection *conn; + struct gsm_network *gsmnet = gsmnet_from_vty(vty); + struct vlr_subscr *vsub = get_vsub_by_argv(gsmnet, argv[0], argv[1]); + const char *loop_str; + int loop_mode; + + if (!vsub) { + vty_out(vty, "%% No subscriber found for %s %s%s", + argv[0], argv[1], VTY_NEWLINE); + return CMD_WARNING; + } + + loop_str = argv[2]; + loop_mode = loop_by_char(loop_str[0]); + + conn = connection_for_subscr(vsub); + if (!conn) { + vty_out(vty, "%% An active connection is required for %s %s%s", + argv[0], argv[1], VTY_NEWLINE); + vlr_subscr_put(vsub); + return CMD_WARNING; + } + + gsm0414_tx_close_tch_loop_cmd(conn, loop_mode); + + return CMD_SUCCESS; +} + +DEFUN(subscriber_mstest_open, + subscriber_mstest_open_cmd, + "subscriber " SUBSCR_TYPES " ID ms-test open-loop", + SUBSCR_HELP "Send a TS 04.14 MS Test Command to subscriber\n" + "Open a TCH Loop inside the MS\n") +{ + struct gsm_subscriber_connection *conn; + struct gsm_network *gsmnet = gsmnet_from_vty(vty); + struct vlr_subscr *vsub = get_vsub_by_argv(gsmnet, argv[0], argv[1]); + + if (!vsub) { + vty_out(vty, "%% No subscriber found for %s %s%s", + argv[0], argv[1], VTY_NEWLINE); + return CMD_WARNING; + } + + conn = connection_for_subscr(vsub); + if (!conn) { + vty_out(vty, "%% An active connection is required for %s %s%s", + argv[0], argv[1], VTY_NEWLINE); + vlr_subscr_put(vsub); + return CMD_WARNING; + } + + gsm0414_tx_open_loop_cmd(conn); + + return CMD_SUCCESS; +} + DEFUN(ena_subscr_expire, ena_subscr_expire_cmd, "subscriber " SUBSCR_TYPES " ID expire", @@ -851,6 +943,8 @@ install_element_ve(&subscriber_silent_call_start_cmd); install_element_ve(&subscriber_silent_call_stop_cmd); install_element_ve(&subscriber_ussd_notify_cmd); + install_element_ve(&subscriber_mstest_close_cmd); + install_element_ve(&subscriber_mstest_open_cmd); install_element_ve(&subscriber_update_cmd); install_element_ve(&show_stats_cmd); install_element_ve(&show_smsqueue_cmd); -- To view, visit https://gerrit.osmocom.org/3616 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I38b1ee9dbf26f5689c38cb83b1b3c5e9eaad7678 Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Thu Aug 24 17:40:58 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 24 Aug 2017 17:40:58 +0000 Subject: [PATCH] osmo-msc[master]: Fix BTS attribute requests Message-ID: Review at https://gerrit.osmocom.org/3617 Fix BTS attribute requests * fix BTS numbers: use 0 to indicate given BTS and 0xFF to indicate all BTS' as it's explained in 3GPP TS 52.021 ?9.3. * only request attributes from supported (OsmoBTS) types Change-Id: I8f43055c38000248033a8ff9ddaf0910d68d794b Related: OS#2317 --- M src/libbsc/abis_nm.c M src/libbsc/bsc_init.c 2 files changed, 10 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/17/3617/1 diff --git a/src/libbsc/abis_nm.c b/src/libbsc/abis_nm.c index 019d039..cf20d7c 100644 --- a/src/libbsc/abis_nm.c +++ b/src/libbsc/abis_nm.c @@ -1590,10 +1590,17 @@ const uint8_t *attr, uint8_t attr_len) { struct abis_om_hdr *oh; - struct msgb *msg = nm_msgb_alloc(); + struct msgb *msg; + + if (bts->type != GSM_BTS_TYPE_OSMOBTS) { + LOGPC(DNM, LOGL_NOTICE, "Getting attributes from BTS%d type %s is not supported.\n", + bts->nr, btstype2str(bts->type)); + return -EINVAL; + } DEBUGP(DNM, "Get Attr (bts=%d)\n", bts->nr); + msg = nm_msgb_alloc(); oh = (struct abis_om_hdr *) msgb_put(msg, ABIS_OM_FOM_HDR_SIZE); fill_om_fom_hdr(oh, attr_len, NM_MT_GET_ATTR, obj_class, bts_nr, trx_nr, ts_nr); diff --git a/src/libbsc/bsc_init.c b/src/libbsc/bsc_init.c index 64dcd15..6f80958 100644 --- a/src/libbsc/bsc_init.c +++ b/src/libbsc/bsc_init.c @@ -350,12 +350,12 @@ generate_cell_chan_list(ca, trx->bts); /* Request generic BTS-level attributes */ - abis_nm_get_attr(trx->bts, NM_OC_BTS, trx->bts->nr, trx->nr, 0xFF, bts_attr, sizeof(bts_attr)); + abis_nm_get_attr(trx->bts, NM_OC_BTS, 0xFF, 0xFF, 0xFF, bts_attr, sizeof(bts_attr)); llist_for_each_entry(cur_trx, &trx->bts->trx_list, list) { int i; /* Request TRX-level attributes */ - abis_nm_get_attr(cur_trx->bts, NM_OC_BASEB_TRANSC, cur_trx->bts->nr, cur_trx->nr, 0xFF, + abis_nm_get_attr(cur_trx->bts, NM_OC_BASEB_TRANSC, 0, cur_trx->nr, 0xFF, trx_attr, sizeof(trx_attr)); for (i = 0; i < ARRAY_SIZE(cur_trx->ts); i++) generate_ma_for_ts(&cur_trx->ts[i]); -- To view, visit https://gerrit.osmocom.org/3617 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I8f43055c38000248033a8ff9ddaf0910d68d794b Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Max From gerrit-no-reply at lists.osmocom.org Thu Aug 24 17:40:58 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 24 Aug 2017 17:40:58 +0000 Subject: [PATCH] osmo-msc[master]: transaction: reject calls from unidentified subscribers Message-ID: Review at https://gerrit.osmocom.org/3618 transaction: reject calls from unidentified subscribers A valid subscriber is indespensible when allocating a new transaction. Return NULL if no subscriber is supplied. This will cause unidentified subscribers to be rejected. Note: Under normal conditions, the problem does not occour, but it is still possible that a misbehaving MS might trigger the problem by sending a SETUP command before authenticating the subscriber. (unencrypted networks) Change-Id: Ia8739b6e329ab02c0064270d02ad1d6ee245520d --- M src/libmsc/transaction.c 1 file changed, 7 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/18/3618/1 diff --git a/src/libmsc/transaction.c b/src/libmsc/transaction.c index 7289a8f..28e0914 100644 --- a/src/libmsc/transaction.c +++ b/src/libmsc/transaction.c @@ -88,6 +88,13 @@ DEBUGP(DCC, "subscr=%p, net=%p\n", vsub, net); + /* a valid subscriber is indispensable */ + if (vsub == NULL) { + LOGP(DCC, LOGL_NOTICE, + "unable to alloc transaction, invalid subscriber (NULL)\n"); + return NULL; + } + trans = talloc_zero(tall_trans_ctx, struct gsm_trans); if (!trans) return NULL; -- To view, visit https://gerrit.osmocom.org/3618 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ia8739b6e329ab02c0064270d02ad1d6ee245520d Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Thu Aug 24 17:40:58 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 24 Aug 2017 17:40:58 +0000 Subject: [PATCH] osmo-msc[master]: bsc_api: Fix copy+paste error in printing name of RR STATUS PDU Message-ID: Review at https://gerrit.osmocom.org/3619 bsc_api: Fix copy+paste error in printing name of RR STATUS PDU Change-Id: I0ef78ef046e4850346569f750693e12938b50ab5 --- M src/libbsc/bsc_api.c 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/19/3619/1 diff --git a/src/libbsc/bsc_api.c b/src/libbsc/bsc_api.c index c2828e3..c60f818 100644 --- a/src/libbsc/bsc_api.c +++ b/src/libbsc/bsc_api.c @@ -607,7 +607,7 @@ break; case GSM48_MT_RR_STATUS: LOGP(DRR, LOGL_NOTICE, "%s (cause: %s)\n", - gsm48_rr_msg_name(GSM48_MT_RR_GPRS_SUSP_REQ), + gsm48_rr_msg_name(GSM48_MT_RR_STATUS), rr_cause_name(gh->data[0])); break; case GSM48_MT_RR_MEAS_REP: -- To view, visit https://gerrit.osmocom.org/3619 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I0ef78ef046e4850346569f750693e12938b50ab5 Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Thu Aug 24 17:40:59 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 24 Aug 2017 17:40:59 +0000 Subject: [PATCH] osmo-msc[master]: libbsc: Add VTY command to re-send the SYSTEM INFORMATION to... Message-ID: Review at https://gerrit.osmocom.org/3620 libbsc: Add VTY command to re-send the SYSTEM INFORMATION to BTS This is useful if you are updating some configuration parameters which affect the content of the SYSTEM INFORMATION messages. Currently, we only send them at the time the RSL connection is established (i.e. when the BTS is initialized), so if you change something, you need to bring down and re-start the BTS. Using the newly-introduced "bts <0-255> resend-system-information" command, you can re-generate + re-send SYSTEM INFORMATION without bringing the BTS down, i.e. without any radio carrier downtime. Change-Id: I326df47de98f6d36c9a4d2d5475225d1e62bafb5 --- M src/libbsc/bsc_vty.c 1 file changed, 33 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/20/3620/1 diff --git a/src/libbsc/bsc_vty.c b/src/libbsc/bsc_vty.c index 722753a..09c443c 100644 --- a/src/libbsc/bsc_vty.c +++ b/src/libbsc/bsc_vty.c @@ -3801,6 +3801,38 @@ return CMD_SUCCESS; } +DEFUN(bts_resend, bts_resend_cmd, + "bts <0-255> resend-system-information", + "BTS Specific Commands\n" "BTS Number\n" + "Re-generate + re-send BCCH SYSTEM INFORMATION\n") +{ + struct gsm_network *gsmnet; + struct gsm_bts_trx *trx; + struct gsm_bts *bts; + unsigned int bts_nr; + + gsmnet = gsmnet_from_vty(vty); + + bts_nr = atoi(argv[0]); + if (bts_nr >= gsmnet->num_bts) { + vty_out(vty, "BTS number must be between 0 and %d. It was %d.%s", + gsmnet->num_bts, bts_nr, VTY_NEWLINE); + return CMD_WARNING; + } + + bts = gsm_bts_num(gsmnet, bts_nr); + if (!bts) { + vty_out(vty, "BTS Nr. %d could not be found.%s", bts_nr, VTY_NEWLINE); + return CMD_WARNING; + } + + llist_for_each_entry_reverse(trx, &bts->trx_list, list) + gsm_bts_trx_set_system_infos(trx); + + return CMD_SUCCESS; +} + + DEFUN(smscb_cmd, smscb_cmd_cmd, "bts <0-255> smscb-command <1-4> HEXSTRING", "BTS related commands\n" "BTS Number\n" @@ -4256,6 +4288,7 @@ install_element(ENABLE_NODE, &drop_bts_cmd); install_element(ENABLE_NODE, &restart_bts_cmd); + install_element(ENABLE_NODE, &bts_resend_cmd); install_element(ENABLE_NODE, &pdch_act_cmd); install_element(ENABLE_NODE, &lchan_act_cmd); install_element(ENABLE_NODE, &lchan_mdcx_cmd); -- To view, visit https://gerrit.osmocom.org/3620 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I326df47de98f6d36c9a4d2d5475225d1e62bafb5 Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Thu Aug 24 17:40:59 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 24 Aug 2017 17:40:59 +0000 Subject: [PATCH] osmo-msc[master]: check for missing result of rate_ctr_group_alloc() Message-ID: Review at https://gerrit.osmocom.org/3621 check for missing result of rate_ctr_group_alloc() In case the counter group allocation fails, we must handle this gracefully and fail the allocation of the parent object, too. RelateD: OS#2361 Change-Id: I7dad4a4d52fe05f6b990359841b4408df5990e21 --- M src/gprs/gb_proxy.c M src/gprs/gb_proxy_peer.c M src/gprs/gprs_sgsn.c M src/libbsc/net_init.c M src/libcommon-cs/common_cs.c 5 files changed, 32 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/21/3621/1 diff --git a/src/gprs/gb_proxy.c b/src/gprs/gb_proxy.c index d95139f..3603e14 100644 --- a/src/gprs/gb_proxy.c +++ b/src/gprs/gb_proxy.c @@ -1431,6 +1431,10 @@ INIT_LLIST_HEAD(&cfg->bts_peers); cfg->ctrg = rate_ctr_group_alloc(tall_bsc_ctx, &global_ctrg_desc, 0); + if (!cfg->ctrg) { + LOGP(DGPRS, LOGL_ERROR, "Cannot allocate global counter group!\n"); + return -1; + } clock_gettime(CLOCK_REALTIME, &tp); return 0; diff --git a/src/gprs/gb_proxy_peer.c b/src/gprs/gb_proxy_peer.c index 5365ff0..8909687 100644 --- a/src/gprs/gb_proxy_peer.c +++ b/src/gprs/gb_proxy_peer.c @@ -177,6 +177,10 @@ peer->bvci = bvci; peer->ctrg = rate_ctr_group_alloc(peer, &peer_ctrg_desc, bvci); + if (!peer->ctrg) { + talloc_free(peer); + return NULL; + } peer->cfg = cfg; llist_add(&peer->list, &cfg->bts_peers); diff --git a/src/gprs/gprs_sgsn.c b/src/gprs/gprs_sgsn.c index 11225dd..93b133f 100644 --- a/src/gprs/gprs_sgsn.c +++ b/src/gprs/gprs_sgsn.c @@ -129,6 +129,7 @@ void sgsn_rate_ctr_init() { sgsn->rate_ctrs = rate_ctr_group_alloc(tall_bsc_ctx, &sgsn_ctrg_desc, 0); + OSMO_ASSERT(sgsn->rate_ctrs); } /* look-up an SGSN MM context based on Iu UE context (struct ue_conn_ctx)*/ @@ -229,6 +230,11 @@ LOGMMCTXP(LOGL_DEBUG, ctx, "Allocated with %s cipher.\n", get_value_string(gprs_cipher_names, ctx->ciph_algo)); ctx->ctrg = rate_ctr_group_alloc(ctx, &mmctx_ctrg_desc, tlli); + if (!ctx->ctrg) { + LOGMMCTXP(LOGL_ERROR, ctx, "Cannot allocate counter group\n"); + talloc_free(ctx); + return NULL; + } INIT_LLIST_HEAD(&ctx->pdp_list); llist_add(&ctx->list, &sgsn_mm_ctxts); @@ -253,6 +259,11 @@ ctx->pmm_state = PMM_DETACHED; ctx->auth_triplet.key_seq = GSM_KEY_SEQ_INVAL; ctx->ctrg = rate_ctr_group_alloc(ctx, &mmctx_ctrg_desc, 0); + if (!ctx->ctrg) { + LOGMMCTXP(LOGL_ERROR, ctx, "Cannot allocate counter group\n"); + talloc_free(ctx); + return NULL; + } /* Need to get RAID from IU conn */ ctx->ra = ctx->iu.ue_ctx->ra_id; @@ -380,6 +391,11 @@ pdp->mm = mm; pdp->nsapi = nsapi; pdp->ctrg = rate_ctr_group_alloc(pdp, &pdpctx_ctrg_desc, nsapi); + if (!pdp->ctrg) { + LOGPDPCTXP(LOGL_ERROR, pdp, "Error allocation counter group\n"); + talloc_free(pdp); + return NULL; + } llist_add(&pdp->list, &mm->pdp_list); llist_add(&pdp->g_list, &sgsn_pdp_ctxts); diff --git a/src/libbsc/net_init.c b/src/libbsc/net_init.c index bc5ed35..4dfc258 100644 --- a/src/libbsc/net_init.c +++ b/src/libbsc/net_init.c @@ -61,6 +61,10 @@ /* init statistics */ net->bsc_ctrs = rate_ctr_group_alloc(net, &bsc_ctrg_desc, 0); + if (!net->bsc_ctrs) { + talloc_free(net); + return NULL; + } gsm_net_update_ctype(net); diff --git a/src/libcommon-cs/common_cs.c b/src/libcommon-cs/common_cs.c index 8e19bb2..99206c8 100644 --- a/src/libcommon-cs/common_cs.c +++ b/src/libcommon-cs/common_cs.c @@ -68,6 +68,10 @@ /* init statistics */ net->msc_ctrs = rate_ctr_group_alloc(net, &msc_ctrg_desc, 0); + if (!net->msc_ctrs) { + talloc_free(net); + return NULL; + } net->active_calls = osmo_counter_alloc("msc.active_calls"); net->mncc_recv = mncc_recv; -- To view, visit https://gerrit.osmocom.org/3621 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I7dad4a4d52fe05f6b990359841b4408df5990e21 Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Thu Aug 24 17:40:59 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 24 Aug 2017 17:40:59 +0000 Subject: [PATCH] osmo-msc[master]: Fix regression causing loss of static system-information mes... Message-ID: Review at https://gerrit.osmocom.org/3622 Fix regression causing loss of static system-information messages In commit 8b1a2f8cd7a81c6b8c7cdb0963dcf89de7c46100 we started to initialize bts->si_valid to 0. This means we are skipping the manually configured static system information. Instead, we have to initialize bts->si_valid to bts->si_mode_static, i.e. start with those that are static and not to be auto-generated. Found while developing http://git.osmocom.org/osmo-ttcn3-hacks/tree/sysinfo Change-Id: Iab9cc93cf6d54560a72cc393cc3721a8d10e04bf Closes: #2367 --- M src/libbsc/bsc_init.c 1 file changed, 2 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/22/3622/1 diff --git a/src/libbsc/bsc_init.c b/src/libbsc/bsc_init.c index 6f80958..5f41a27 100644 --- a/src/libbsc/bsc_init.c +++ b/src/libbsc/bsc_init.c @@ -139,8 +139,8 @@ ms_pwr_ctl_lvl(bts->band, bts->ms_max_power); bts->si_common.cell_sel_par.neci = bts->network->neci; - /* Zero, forget the state of the SIs */ - bts->si_valid = 0; + /* Zero/forget the state of the dynamically computed SIs, leeping the static ones */ + bts->si_valid = bts->si_mode_static; /* First, we determine which of the SI messages we actually need */ -- To view, visit https://gerrit.osmocom.org/3622 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Iab9cc93cf6d54560a72cc393cc3721a8d10e04bf Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Thu Aug 24 17:40:59 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 24 Aug 2017 17:40:59 +0000 Subject: [PATCH] osmo-msc[master]: RSL: Allow disabling of BCCH/SACCH filling for given SI type Message-ID: Review at https://gerrit.osmocom.org/3623 RSL: Allow disabling of BCCH/SACCH filling for given SI type If we want to instruct the BTS to stop sending a given SI, we must be able to send the respective BCCH INFO / SACCH FILLING with a header but without any L3 data IE. This patch enables the related functions to do this whenever their data argument points to NULL. Change-Id: I88b85614951a108574f05db3b706884afe7e87a9 --- M src/libbsc/abis_rsl.c 1 file changed, 8 insertions(+), 4 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/23/3623/1 diff --git a/src/libbsc/abis_rsl.c b/src/libbsc/abis_rsl.c index 441b386..9e36f79 100644 --- a/src/libbsc/abis_rsl.c +++ b/src/libbsc/abis_rsl.c @@ -245,12 +245,14 @@ && type == RSL_SYSTEM_INFO_13) { /* Ericsson proprietary encoding of SI13 */ msgb_tv_put(msg, RSL_IE_SYSINFO_TYPE, RSL_ERIC_SYSTEM_INFO_13); - msgb_tlv_put(msg, RSL_IE_FULL_BCCH_INFO, len, data); + if (data) + msgb_tlv_put(msg, RSL_IE_FULL_BCCH_INFO, len, data); msgb_tv_put(msg, RSL_IE_ERIC_BCCH_MAPPING, 0x00); } else { /* Normal encoding */ msgb_tv_put(msg, RSL_IE_SYSINFO_TYPE, type); - msgb_tlv_put(msg, RSL_IE_FULL_BCCH_INFO, len, data); + if (data) + msgb_tlv_put(msg, RSL_IE_FULL_BCCH_INFO, len, data); } msg->dst = trx->rsl_link; @@ -269,7 +271,8 @@ ch->msg_type = RSL_MT_SACCH_FILL; msgb_tv_put(msg, RSL_IE_SYSINFO_TYPE, type); - msgb_tl16v_put(msg, RSL_IE_L3_INFO, len, data); + if (data) + msgb_tl16v_put(msg, RSL_IE_L3_INFO, len, data); msg->dst = trx->rsl_link; @@ -288,7 +291,8 @@ dh->chan_nr = chan_nr; msgb_tv_put(msg, RSL_IE_SYSINFO_TYPE, type); - msgb_tl16v_put(msg, RSL_IE_L3_INFO, len, data); + if (data) + msgb_tl16v_put(msg, RSL_IE_L3_INFO, len, data); msg->dst = lchan->ts->trx->rsl_link; -- To view, visit https://gerrit.osmocom.org/3623 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I88b85614951a108574f05db3b706884afe7e87a9 Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Thu Aug 24 17:41:00 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 24 Aug 2017 17:41:00 +0000 Subject: [PATCH] osmo-msc[master]: gsm_bts_trx_set_system_infos(): Disable non-existing SI Message-ID: Review at https://gerrit.osmocom.org/3624 gsm_bts_trx_set_system_infos(): Disable non-existing SI If we previously had a given SI present/active, we must send a zero-length BCCH FILLING for that SI type to the BTS to stop it from further transmitting this SI. Change-Id: I33e356e2fa3a69efac9080813e3e9ef4e6438ed1 Closes: OS#2368 --- M src/libbsc/bsc_init.c 1 file changed, 17 insertions(+), 6 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/24/3624/1 diff --git a/src/libbsc/bsc_init.c b/src/libbsc/bsc_init.c index 5f41a27..78ca2ab 100644 --- a/src/libbsc/bsc_init.c +++ b/src/libbsc/bsc_init.c @@ -104,8 +104,11 @@ struct gsm_bts *bts = trx->bts; int rc, j; - DEBUGP(DRR, "SI%s: %s\n", get_value_string(osmo_sitype_strs, i), - osmo_hexdump(GSM_BTS_SI(bts, i), GSM_MACBLOCK_LEN)); + if (si_len) { + DEBUGP(DRR, "SI%s: %s\n", get_value_string(osmo_sitype_strs, i), + osmo_hexdump(GSM_BTS_SI(bts, i), GSM_MACBLOCK_LEN)); + } else + DEBUGP(DRR, "SI%s: OFF\n", get_value_string(osmo_sitype_strs, i)); switch (i) { case SYSINFO_TYPE_5: @@ -113,14 +116,18 @@ case SYSINFO_TYPE_5ter: case SYSINFO_TYPE_6: rc = rsl_sacch_filling(trx, osmo_sitype2rsl(i), - GSM_BTS_SI(bts, i), si_len); + si_len ? GSM_BTS_SI(bts, i) : NULL, si_len); break; case SYSINFO_TYPE_2quater: + if (si_len == 0) { + rc = rsl_bcch_info(trx, i, NULL, 0); + break; + } for (j = 0; j <= bts->si2q_count; j++) rc = rsl_bcch_info(trx, i, (const uint8_t *)GSM_BTS_SI2Q(bts, j), GSM_MACBLOCK_LEN); break; default: - rc = rsl_bcch_info(trx, i, GSM_BTS_SI(bts, i), si_len); + rc = rsl_bcch_info(trx, i, si_len ? GSM_BTS_SI(bts, i) : NULL, si_len); break; } @@ -193,9 +200,13 @@ for (n = 0; n < n_si; n++) { i = gen_si[n]; + /* if we don't currently have this SI, we send a zero-length + * RSL BCCH FILLING / SACCH FILLING * in order to deactivate + * the SI, in case it might have previously been active */ if (!GSM_BTS_HAS_SI(bts, i)) - continue; - rc = rsl_si(trx, i, si_len[i]); + rc = rsl_si(trx, i, 0); + else + rc = rsl_si(trx, i, si_len[i]); if (rc < 0) return rc; } -- To view, visit https://gerrit.osmocom.org/3624 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I33e356e2fa3a69efac9080813e3e9ef4e6438ed1 Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Thu Aug 24 17:41:00 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 24 Aug 2017 17:41:00 +0000 Subject: [PATCH] osmo-msc[master]: gtphob: check for missing result of rate_ctr_group_alloc() Message-ID: Review at https://gerrit.osmocom.org/3625 gtphob: check for missing result of rate_ctr_group_alloc() In case the counter group allocation fails, we must handle this gracefully and fail the allocation of the parent object, too. The recent change (Id I7dad4a4d52fe05f6b990359841b4408df5990e21) seems to have missed one instance, so let's follow-up. Change-Id: I1ee9e3d26dcc18e7f979fd9a786162cbcc50942c Related: OS#2361 --- M src/gprs/gtphub.c 1 file changed, 4 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/25/3625/1 diff --git a/src/gprs/gtphub.c b/src/gprs/gtphub.c index 211018b..5e7520e 100644 --- a/src/gprs/gtphub.c +++ b/src/gprs/gtphub.c @@ -2708,6 +2708,10 @@ pp->counters_io = rate_ctr_group_alloc(osmo_gtphub_ctx, >phub_ctrg_io_desc, 0); + if (!pp->counters_io) { + talloc_free(pp); + return NULL; + } llist_add(&pp->entry, &a->ports); -- To view, visit https://gerrit.osmocom.org/3625 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I1ee9e3d26dcc18e7f979fd9a786162cbcc50942c Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Thu Aug 24 17:41:00 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 24 Aug 2017 17:41:00 +0000 Subject: [PATCH] osmo-msc[master]: bsc_vty: Add VTY command to test CTRL TRAP feature Message-ID: Review at https://gerrit.osmocom.org/3626 bsc_vty: Add VTY command to test CTRL TRAP feature Using this new command (introduced in OsmoBSC + OsmoNITB), you can simulate the generation of TRAP events for testin purposes. start the control interface monitor as an example client program: ./openbsc/contrib/bsc_control.py -m -d localhost -p 4249 then start OsmoBSC or OsmoNITB, telnet to the VTY and enter 'enable' mode and issue the following (example) command: ctrl-interface generate-trap my.foo.var 2342 As a result, on the bsc_control.py you will see: Got message: TRAP 0 my.foo.var 2342 Change-Id: Ib1d2ec38290dc94797c1b365d9b733e5215ab7d1 --- M src/libbsc/bsc_vty.c 1 file changed, 16 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/26/3626/1 diff --git a/src/libbsc/bsc_vty.c b/src/libbsc/bsc_vty.c index 09c443c..f3ab35f 100644 --- a/src/libbsc/bsc_vty.c +++ b/src/libbsc/bsc_vty.c @@ -30,6 +30,7 @@ #include #include #include +#include #include @@ -4093,6 +4094,20 @@ rsl_ipacc_mdcx(lchan, ntohl(ia.s_addr), port, 0); return CMD_SUCCESS; } + +DEFUN(ctrl_trap, ctrl_trap_cmd, + "ctrl-interface generate-trap TRAP VALUE", + "Commands related to the CTRL Interface\n" + "Generate a TRAP for test purpose\n" + "Identity/Name of the TRAP variable\n" + "Value of the TRAP variable\n") +{ + struct gsm_network *net = gsmnet_from_vty(vty); + + ctrl_cmd_send_trap(net->ctrl, argv[0], (char *) argv[1]); + return CMD_SUCCESS; +} + extern int bsc_vty_init_extra(void); int bsc_vty_init(struct gsm_network *network) @@ -4293,6 +4308,7 @@ install_element(ENABLE_NODE, &lchan_act_cmd); install_element(ENABLE_NODE, &lchan_mdcx_cmd); install_element(ENABLE_NODE, &smscb_cmd_cmd); + install_element(ENABLE_NODE, &ctrl_trap_cmd); abis_nm_vty_init(); abis_om2k_vty_init(); -- To view, visit https://gerrit.osmocom.org/3626 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ib1d2ec38290dc94797c1b365d9b733e5215ab7d1 Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Thu Aug 24 17:41:00 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 24 Aug 2017 17:41:00 +0000 Subject: [PATCH] osmo-msc[master]: GSM timers: User reasonable defaults; don't save if equal de... Message-ID: Review at https://gerrit.osmocom.org/3627 GSM timers: User reasonable defaults; don't save if equal default A number of the GSM timers (including T3109) had no reasonable default values if not specified in the VTY / config file. Together with unconditional writing to the config file, this created config files with a persistent setting for important timers as '0'. To make things worse, many of our example cofig files suffered from the same problem. Let's avoid this from happening by * having reasonable defaults if nothing specified in the config file * conditionally savingg timers only if they differ from default * reject any timer values that state zero during start-up (see previous commit) Change-Id: Iaac0bfca423852b61d8b9eb1438157ef00d0d8c8 Closes: OS#2380 --- M doc/examples/osmo-bsc/osmo-bsc.cfg M include/openbsc/gsm_data.h M src/libbsc/bsc_vty.c M src/libbsc/net_init.c 4 files changed, 35 insertions(+), 27 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/27/3627/1 diff --git a/doc/examples/osmo-bsc/osmo-bsc.cfg b/doc/examples/osmo-bsc/osmo-bsc.cfg index b974b76..534605a 100644 --- a/doc/examples/osmo-bsc/osmo-bsc.cfg +++ b/doc/examples/osmo-bsc/osmo-bsc.cfg @@ -28,18 +28,6 @@ handover power budget interval 6 handover power budget hysteresis 3 handover maximum distance 9999 - timer t3101 10 - timer t3103 0 - timer t3105 0 - timer t3107 0 - timer t3109 0 - timer t3111 0 - timer t3113 60 - timer t3115 0 - timer t3117 0 - timer t3119 0 - timer t3122 0 - timer t3141 0 bts 0 type nanobts band DCS1800 diff --git a/include/openbsc/gsm_data.h b/include/openbsc/gsm_data.h index c307fee..02823c9 100644 --- a/include/openbsc/gsm_data.h +++ b/include/openbsc/gsm_data.h @@ -323,10 +323,18 @@ GSM_AUTH_POLICY_REGEXP, /* accept IMSIs matching given regexp */ }; -#define GSM_T3101_DEFAULT 10 -#define GSM_T3105_DEFAULT 40 +#define GSM_T3101_DEFAULT 10 /* s */ +#define GSM_T3103_DEFAULT 5 /* s */ +#define GSM_T3105_DEFAULT 100 /* ms */ +#define GSM_T3107_DEFAULT 5 /* s */ +#define GSM_T3109_DEFAULT 19 /* s, must be 2s + radio_link_timeout*0.48 */ +#define GSM_T3111_DEFAULT 2 /* s */ #define GSM_T3113_DEFAULT 60 +#define GSM_T3115_DEFAULT 10 +#define GSM_T3117_DEFAULT 10 +#define GSM_T3119_DEFAULT 10 #define GSM_T3122_DEFAULT 10 +#define GSM_T3141_DEFAULT 10 struct gsm_tz { int override; /* if 0, use system's time zone instead. */ diff --git a/src/libbsc/bsc_vty.c b/src/libbsc/bsc_vty.c index f3ab35f..1e78b08 100644 --- a/src/libbsc/bsc_vty.c +++ b/src/libbsc/bsc_vty.c @@ -777,6 +777,11 @@ return CMD_SUCCESS; } +/* small helper macro for conditional dumping of timer */ +#define VTY_OUT_TIMER(number) \ + if (gsmnet->T##number != GSM_T##number##_DEFAULT) \ + vty_out(vty, " timer t"#number" %u%s", gsmnet->T##number, VTY_NEWLINE) + static int config_write_net(struct vty *vty) { struct gsm_network *gsmnet = gsmnet_from_vty(vty); @@ -813,18 +818,18 @@ gsmnet->handover.pwr_hysteresis, VTY_NEWLINE); vty_out(vty, " handover maximum distance %u%s", gsmnet->handover.max_distance, VTY_NEWLINE); - vty_out(vty, " timer t3101 %u%s", gsmnet->T3101, VTY_NEWLINE); - vty_out(vty, " timer t3103 %u%s", gsmnet->T3103, VTY_NEWLINE); - vty_out(vty, " timer t3105 %u%s", gsmnet->T3105, VTY_NEWLINE); - vty_out(vty, " timer t3107 %u%s", gsmnet->T3107, VTY_NEWLINE); - vty_out(vty, " timer t3109 %u%s", gsmnet->T3109, VTY_NEWLINE); - vty_out(vty, " timer t3111 %u%s", gsmnet->T3111, VTY_NEWLINE); - vty_out(vty, " timer t3113 %u%s", gsmnet->T3113, VTY_NEWLINE); - vty_out(vty, " timer t3115 %u%s", gsmnet->T3115, VTY_NEWLINE); - vty_out(vty, " timer t3117 %u%s", gsmnet->T3117, VTY_NEWLINE); - vty_out(vty, " timer t3119 %u%s", gsmnet->T3119, VTY_NEWLINE); - vty_out(vty, " timer t3122 %u%s", gsmnet->T3122, VTY_NEWLINE); - vty_out(vty, " timer t3141 %u%s", gsmnet->T3141, VTY_NEWLINE); + VTY_OUT_TIMER(3101); + VTY_OUT_TIMER(3103); + VTY_OUT_TIMER(3105); + VTY_OUT_TIMER(3107); + VTY_OUT_TIMER(3109); + VTY_OUT_TIMER(3111); + VTY_OUT_TIMER(3113); + VTY_OUT_TIMER(3115); + VTY_OUT_TIMER(3117); + VTY_OUT_TIMER(3119); + VTY_OUT_TIMER(3122); + VTY_OUT_TIMER(3141); vty_out(vty, " dyn_ts_allow_tch_f %d%s", gsmnet->dyn_ts_allow_tch_f ? 1 : 0, VTY_NEWLINE); if (gsmnet->tz.override != 0) { diff --git a/src/libbsc/net_init.c b/src/libbsc/net_init.c index 4dfc258..9d54319 100644 --- a/src/libbsc/net_init.c +++ b/src/libbsc/net_init.c @@ -44,10 +44,17 @@ net->num_bts = 0; net->reject_cause = GSM48_REJECT_ROAMING_NOT_ALLOWED; net->T3101 = GSM_T3101_DEFAULT; + net->T3103 = GSM_T3103_DEFAULT; net->T3105 = GSM_T3105_DEFAULT; + net->T3107 = GSM_T3107_DEFAULT; + net->T3109 = GSM_T3109_DEFAULT; + net->T3111 = GSM_T3111_DEFAULT; net->T3113 = GSM_T3113_DEFAULT; + net->T3115 = GSM_T3115_DEFAULT; + net->T3117 = GSM_T3117_DEFAULT; + net->T3119 = GSM_T3119_DEFAULT; net->T3122 = GSM_T3122_DEFAULT; - /* FIXME: initialize all other timers! */ + net->T3141 = GSM_T3141_DEFAULT; /* default set of handover parameters */ net->handover.win_rxlev_avg = 10; -- To view, visit https://gerrit.osmocom.org/3627 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Iaac0bfca423852b61d8b9eb1438157ef00d0d8c8 Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Thu Aug 24 17:41:01 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 24 Aug 2017 17:41:01 +0000 Subject: [PATCH] osmo-msc[master]: bsc_vty: Don't allow timers of zero (0) Message-ID: Review at https://gerrit.osmocom.org/3628 bsc_vty: Don't allow timers of zero (0) It typically doesn't make sense to configure any of the GSM RR timer to 0 (Seconds). In fact, accidentially configuring any of the timers to zero might have severe side effects, such as "stuck channels" described in https://osmocom.org/issues/2380 Change-Id: I517828f2f0c80ec01cb63648db2626f17a67fe57 --- M src/libbsc/bsc_vty.c 1 file changed, 2 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/28/3628/1 diff --git a/src/libbsc/bsc_vty.c b/src/libbsc/bsc_vty.c index 1e78b08..bf7c3ca 100644 --- a/src/libbsc/bsc_vty.c +++ b/src/libbsc/bsc_vty.c @@ -1543,14 +1543,14 @@ #define DECLARE_TIMER(number, doc) \ DEFUN(cfg_net_T##number, \ cfg_net_T##number##_cmd, \ - "timer t" #number " <0-65535>", \ + "timer t" #number " <1-65535>", \ "Configure GSM Timers\n" \ doc "Timer Value in seconds\n") \ { \ struct gsm_network *gsmnet = gsmnet_from_vty(vty); \ int value = atoi(argv[0]); \ \ - if (value < 0 || value > 65535) { \ + if (value < 1 || value > 65535) { \ vty_out(vty, "Timer value %s out of range.%s", \ argv[0], VTY_NEWLINE); \ return CMD_WARNING; \ -- To view, visit https://gerrit.osmocom.org/3628 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I517828f2f0c80ec01cb63648db2626f17a67fe57 Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Thu Aug 24 17:41:01 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 24 Aug 2017 17:41:01 +0000 Subject: [PATCH] osmo-msc[master]: remove code disabling T3109 if configured to 0 Message-ID: Review at https://gerrit.osmocom.org/3629 remove code disabling T3109 if configured to 0 We no longer permit timers with a 0 value, so this case can never happen. Also, if it should happen, I'd rather have a timter expiring immediately (and breaking something) than not being started in the first place. Change-Id: Ibfcdd3ddc0155caee89c501498329bde247621a0 --- M src/libbsc/abis_rsl.c 1 file changed, 0 insertions(+), 4 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/29/3629/1 diff --git a/src/libbsc/abis_rsl.c b/src/libbsc/abis_rsl.c index 9e36f79..3337b90 100644 --- a/src/libbsc/abis_rsl.c +++ b/src/libbsc/abis_rsl.c @@ -2910,10 +2910,6 @@ { struct gsm_bts *bts = lchan->ts->trx->bts; - /* Disabled, mostly legacy code */ - if (bts->network->T3109 == 0) - return -1; - osmo_timer_setup(&lchan->T3109, t3109_expired, lchan); osmo_timer_schedule(&lchan->T3109, bts->network->T3109, 0); return 0; -- To view, visit https://gerrit.osmocom.org/3629 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ibfcdd3ddc0155caee89c501498329bde247621a0 Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Thu Aug 24 17:41:01 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 24 Aug 2017 17:41:01 +0000 Subject: [PATCH] osmo-msc[master]: sgsn: Convert cch_pdp to host order for libgtp Message-ID: Review at https://gerrit.osmocom.org/3630 sgsn: Convert cch_pdp to host order for libgtp libgtp is calling gtpie_tv2 which will convert this uint16_t from host to network order. So far libosmogsm and the sgsn treated the charging characteristics as opaque data. So when moving from byte array to the uint16_t do the swapping. Change-Id: I977aec2e2f8d57802e45f591754e5733562d5c2a --- M src/gprs/sgsn_libgtp.c 1 file changed, 2 insertions(+), 5 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/30/3630/1 diff --git a/src/gprs/sgsn_libgtp.c b/src/gprs/sgsn_libgtp.c index 0a0de08..bc2fcd1 100644 --- a/src/gprs/sgsn_libgtp.c +++ b/src/gprs/sgsn_libgtp.c @@ -235,11 +235,8 @@ } /* charging characteristics if present */ - if (TLVP_LEN(tp, OSMO_IE_GSM_CHARG_CHAR) > 0) { - OSMO_ASSERT(TLVP_LEN(tp, OSMO_IE_GSM_CHARG_CHAR) <= sizeof(pdp->cch_pdp)); - memcpy(&pdp->cch_pdp, TLVP_VAL(tp, OSMO_IE_GSM_CHARG_CHAR), - TLVP_LEN(tp, OSMO_IE_GSM_CHARG_CHAR)); - } + if (TLVP_LEN(tp, OSMO_IE_GSM_CHARG_CHAR) >= sizeof(pdp->cch_pdp)) + pdp->cch_pdp = tlvp_val16be(tp, OSMO_IE_GSM_CHARG_CHAR); /* SGSN address for control plane */ pdp->gsnlc.l = sizeof(sgsn->cfg.gtp_listenaddr.sin_addr); -- To view, visit https://gerrit.osmocom.org/3630 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I977aec2e2f8d57802e45f591754e5733562d5c2a Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Holger Freyther From gerrit-no-reply at lists.osmocom.org Thu Aug 24 17:41:01 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 24 Aug 2017 17:41:01 +0000 Subject: [PATCH] osmo-msc[master]: gsm_04_11: get rid of unused parameter in sms_route_mt_sms() Message-ID: Review at https://gerrit.osmocom.org/3631 gsm_04_11: get rid of unused parameter in sms_route_mt_sms() This parameter is unused, remove it. Change-Id: I797abce3f91447e8f397c7cf726db7425479fe0e --- M src/libmsc/gsm_04_11.c 1 file changed, 6 insertions(+), 5 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/31/3631/1 diff --git a/src/libmsc/gsm_04_11.c b/src/libmsc/gsm_04_11.c index 6c6a1fb..3153610 100644 --- a/src/libmsc/gsm_04_11.c +++ b/src/libmsc/gsm_04_11.c @@ -189,7 +189,7 @@ return gsm411_smc_send(&trans->sms.smc_inst, msg_type, msg); } -static int gsm340_rx_sms_submit(struct msgb *msg, struct gsm_sms *gsms) +static int gsm340_rx_sms_submit(struct gsm_sms *gsms) { if (db_sms_store(gsms) != 0) { LOGP(DLSMS, LOGL_ERROR, "Failed to store SMS in Database\n"); @@ -279,8 +279,9 @@ return msg->len - old_msg_len; } -int sms_route_mt_sms(struct gsm_subscriber_connection *conn, struct msgb *msg, - struct gsm_sms *gsms, uint8_t sms_mti, bool *deferred) +static int sms_route_mt_sms(struct gsm_subscriber_connection *conn, + struct gsm_sms *gsms, uint8_t sms_mti, + bool *deferred) { int rc; @@ -344,7 +345,7 @@ switch (sms_mti) { case GSM340_SMS_SUBMIT_MS2SC: /* MS is submitting a SMS */ - rc = gsm340_rx_sms_submit(msg, gsms); + rc = gsm340_rx_sms_submit(gsms); break; case GSM340_SMS_COMMAND_MS2SC: case GSM340_SMS_DELIVER_REP_MS2SC: @@ -488,7 +489,7 @@ /* FIXME: This looks very wrong */ send_signal(0, NULL, gsms, 0); - rc = sms_route_mt_sms(conn, msg, gsms, sms_mti, deferred); + rc = sms_route_mt_sms(conn, gsms, sms_mti, deferred); out: if (!deferred) sms_free(gsms); -- To view, visit https://gerrit.osmocom.org/3631 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I797abce3f91447e8f397c7cf726db7425479fe0e Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Pablo Neira Ayuso From gerrit-no-reply at lists.osmocom.org Thu Aug 24 17:41:02 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 24 Aug 2017 17:41:02 +0000 Subject: [PATCH] osmo-msc[master]: libmsc: do not leak pending SMPP command object on error path Message-ID: Review at https://gerrit.osmocom.org/3632 libmsc: do not leak pending SMPP command object on error path Make sure the SMPP command object is released on errors. Change-Id: I474584425d23fb379a9d71b33e29ac0e24f01e61 --- M src/libmsc/smpp_openbsc.c 1 file changed, 6 insertions(+), 5 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/32/3632/1 diff --git a/src/libmsc/smpp_openbsc.c b/src/libmsc/smpp_openbsc.c index b3f9bbb..394827b 100644 --- a/src/libmsc/smpp_openbsc.c +++ b/src/libmsc/smpp_openbsc.c @@ -521,7 +521,7 @@ conn = connection_for_subscr(cmd->vsub); if (!conn) { LOGP(DSMPP, LOGL_ERROR, "No connection to subscriber anymore\n"); - return; + goto out; } trans = trans_find_by_id(conn, GSM48_PDISC_SMS, @@ -529,10 +529,11 @@ if (!trans) { LOGP(DSMPP, LOGL_ERROR, "GSM transaction %u is gone\n", cmd->sms->gsm411.transaction_id); - return; + goto out; } gsm411_send_rp_ack(trans, cmd->sms->gsm411.msg_ref); +out: smpp_cmd_free(cmd); } @@ -545,7 +546,7 @@ conn = connection_for_subscr(cmd->vsub); if (!conn) { LOGP(DSMPP, LOGL_ERROR, "No connection to subscriber anymore\n"); - return; + goto out; } trans = trans_find_by_id(conn, GSM48_PDISC_SMS, @@ -553,14 +554,14 @@ if (!trans) { LOGP(DSMPP, LOGL_ERROR, "GSM transaction %u is gone\n", cmd->sms->gsm411.transaction_id); - return; + goto out; } if (smpp_to_gsm411_err(status, &gsm411_cause) < 0) gsm411_cause = GSM411_RP_CAUSE_MO_NET_OUT_OF_ORDER; gsm411_send_rp_error(trans, cmd->sms->gsm411.msg_ref, gsm411_cause); - +out: smpp_cmd_free(cmd); } -- To view, visit https://gerrit.osmocom.org/3632 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I474584425d23fb379a9d71b33e29ac0e24f01e61 Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Pablo Neira Ayuso From gerrit-no-reply at lists.osmocom.org Thu Aug 24 17:41:02 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 24 Aug 2017 17:41:02 +0000 Subject: [PATCH] osmo-msc[master]: libmsc: remove dead code in sms_route_mt_sms() Message-ID: Review at https://gerrit.osmocom.org/3633 libmsc: remove dead code in sms_route_mt_sms() The following branch: if (!rc && !gsms->receiver) rc = GSM411_RP_CAUSE_MO_NUM_UNASSIGNED; at the end of sms_route_mt_sms() always evaluates false. Just a bit before, in such function, we have this: if (!gsms->receiver) { ... #ifdef BUILD_SMPP ... #else ... #endif return rc; } So, if there is no receiver, we just stop running code and return the RP cause via the rc variable. Same applies to the smpp_first check under the BUILD_SMPP ifdef (that I have removed in this snippet to keep this commit message small). Change-Id: Ic3502b5b169bc7a73a67fd6ff53d8b6c0dc045c8 --- M src/libmsc/gsm_04_11.c 1 file changed, 0 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/33/3633/1 diff --git a/src/libmsc/gsm_04_11.c b/src/libmsc/gsm_04_11.c index 3153610..0cd1b65 100644 --- a/src/libmsc/gsm_04_11.c +++ b/src/libmsc/gsm_04_11.c @@ -358,9 +358,6 @@ break; } - if (!rc && !gsms->receiver) - rc = GSM411_RP_CAUSE_MO_NUM_UNASSIGNED; - return rc; } -- To view, visit https://gerrit.osmocom.org/3633 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ic3502b5b169bc7a73a67fd6ff53d8b6c0dc045c8 Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Pablo Neira Ayuso From gerrit-no-reply at lists.osmocom.org Thu Aug 24 17:41:02 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 24 Aug 2017 17:41:02 +0000 Subject: [PATCH] osmo-msc[master]: libmsc: remove duplicate lines in deliver_to_esme() Message-ID: Review at https://gerrit.osmocom.org/3634 libmsc: remove duplicate lines in deliver_to_esme() This code is accidentally doing the same thing twice, remove it. Change-Id: I68087a850399e22951d2407e4d8a09c671a775c9 --- M src/libmsc/smpp_openbsc.c 1 file changed, 0 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/34/3634/1 diff --git a/src/libmsc/smpp_openbsc.c b/src/libmsc/smpp_openbsc.c index 394827b..67e6638 100644 --- a/src/libmsc/smpp_openbsc.c +++ b/src/libmsc/smpp_openbsc.c @@ -680,8 +680,6 @@ } else { deliver.sm_length = sms->user_data_len; memcpy(deliver.short_message, sms->user_data, deliver.sm_length); - deliver.sm_length = sms->user_data_len; - memcpy(deliver.short_message, sms->user_data, deliver.sm_length); } #if BEFORE_MSCSPLIT -- To view, visit https://gerrit.osmocom.org/3634 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I68087a850399e22951d2407e4d8a09c671a775c9 Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Pablo Neira Ayuso From gerrit-no-reply at lists.osmocom.org Thu Aug 24 17:41:03 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 24 Aug 2017 17:41:03 +0000 Subject: [PATCH] osmo-msc[master]: libmsc: remove 'deferred' parameter in sms_route_mt_sms() Message-ID: Review at https://gerrit.osmocom.org/3635 libmsc: remove 'deferred' parameter in sms_route_mt_sms() No need to cache the sms object, just cache what we need into the smpp_cmd structure. This simplifies what that I introduced in 93ffbd0029d1 ("libmsc: send RP-ACK to MS after ESME sends SMPP DELIVER-SM-RESP"). Change-Id: Iba5f864f9bb963baff95969e306b1b7cff00c1e3 --- M src/libmsc/gsm_04_11.c M src/libmsc/smpp_openbsc.c M src/libmsc/smpp_smsc.h 3 files changed, 24 insertions(+), 30 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/35/3635/1 diff --git a/src/libmsc/gsm_04_11.c b/src/libmsc/gsm_04_11.c index 0cd1b65..88a6685 100644 --- a/src/libmsc/gsm_04_11.c +++ b/src/libmsc/gsm_04_11.c @@ -280,8 +280,7 @@ } static int sms_route_mt_sms(struct gsm_subscriber_connection *conn, - struct gsm_sms *gsms, uint8_t sms_mti, - bool *deferred) + struct gsm_sms *gsms, uint8_t sms_mti) { int rc; @@ -295,7 +294,7 @@ * delivery of the SMS. */ if (smpp_first) { - rc = smpp_try_deliver(gsms, conn, deferred); + rc = smpp_try_deliver(gsms, conn); if (rc == GSM411_RP_CAUSE_MO_NUM_UNASSIGNED) /* unknown subscriber, try local */ goto try_local; @@ -324,7 +323,7 @@ return GSM411_RP_CAUSE_MO_NUM_UNASSIGNED; } - rc = smpp_try_deliver(gsms, conn, deferred); + rc = smpp_try_deliver(gsms, conn); if (rc == GSM411_RP_CAUSE_MO_NUM_UNASSIGNED) { rate_ctr_inc(&conn->network->msc_ctrs->ctr[MSC_CTR_SMS_NO_RECEIVER]); } else if (rc < 0) { @@ -365,7 +364,7 @@ /* process an incoming TPDU (called from RP-DATA) * return value > 0: RP CAUSE for ERROR; < 0: silent error; 0 = success */ static int gsm340_rx_tpdu(struct gsm_trans *trans, struct msgb *msg, - uint32_t gsm411_msg_ref, bool *deferred) + uint32_t gsm411_msg_ref) { struct gsm_subscriber_connection *conn = trans->conn; uint8_t *smsp = msgb_sms(msg); @@ -486,10 +485,9 @@ /* FIXME: This looks very wrong */ send_signal(0, NULL, gsms, 0); - rc = sms_route_mt_sms(conn, gsms, sms_mti, deferred); + rc = sms_route_mt_sms(conn, gsms, sms_mti); out: - if (!deferred) - sms_free(gsms); + sms_free(gsms); return rc; } @@ -542,7 +540,6 @@ uint8_t dst_len, uint8_t *dst, uint8_t tpdu_len, uint8_t *tpdu) { - bool deferred = false; int rc = 0; if (src_len && src) @@ -559,8 +556,8 @@ DEBUGP(DLSMS, "DST(%u,%s)\n", dst_len, osmo_hexdump(dst, dst_len)); - rc = gsm340_rx_tpdu(trans, msg, rph->msg_ref, &deferred); - if (rc == 0 && !deferred) + rc = gsm340_rx_tpdu(trans, msg, rph->msg_ref); + if (rc == 0) return gsm411_send_rp_ack(trans, rph->msg_ref); else if (rc > 0) return gsm411_send_rp_error(trans, rph->msg_ref, rc); diff --git a/src/libmsc/smpp_openbsc.c b/src/libmsc/smpp_openbsc.c index 67e6638..bf63f6b 100644 --- a/src/libmsc/smpp_openbsc.c +++ b/src/libmsc/smpp_openbsc.c @@ -501,7 +501,6 @@ osmo_timer_del(&cmd->response_timer); llist_del(&cmd->list); vlr_subscr_put(cmd->vsub); - sms_free(cmd->sms); talloc_free(cmd); } @@ -524,15 +523,14 @@ goto out; } - trans = trans_find_by_id(conn, GSM48_PDISC_SMS, - cmd->sms->gsm411.transaction_id); + trans = trans_find_by_id(conn, GSM48_PDISC_SMS, cmd->gsm411_trans_id); if (!trans) { LOGP(DSMPP, LOGL_ERROR, "GSM transaction %u is gone\n", - cmd->sms->gsm411.transaction_id); + cmd->gsm411_trans_id); goto out; } - gsm411_send_rp_ack(trans, cmd->sms->gsm411.msg_ref); + gsm411_send_rp_ack(trans, cmd->gsm411_msg_ref); out: smpp_cmd_free(cmd); } @@ -549,18 +547,17 @@ goto out; } - trans = trans_find_by_id(conn, GSM48_PDISC_SMS, - cmd->sms->gsm411.transaction_id); + trans = trans_find_by_id(conn, GSM48_PDISC_SMS, cmd->gsm411_trans_id); if (!trans) { LOGP(DSMPP, LOGL_ERROR, "GSM transaction %u is gone\n", - cmd->sms->gsm411.transaction_id); + cmd->gsm411_trans_id); goto out; } if (smpp_to_gsm411_err(status, &gsm411_cause) < 0) gsm411_cause = GSM411_RP_CAUSE_MO_NET_OUT_OF_ORDER; - gsm411_send_rp_error(trans, cmd->sms->gsm411.msg_ref, gsm411_cause); + gsm411_send_rp_error(trans, cmd->gsm411_msg_ref, gsm411_cause); out: smpp_cmd_free(cmd); } @@ -572,7 +569,7 @@ static int smpp_cmd_enqueue(struct osmo_esme *esme, struct vlr_subscr *vsub, struct gsm_sms *sms, - uint32_t sequence_number, bool *deferred) + uint32_t sequence_number) { struct osmo_smpp_cmd *cmd; @@ -581,7 +578,8 @@ return -1; cmd->sequence_nr = sequence_number; - cmd->sms = sms; + cmd->gsm411_msg_ref = sms->gsm411.msg_ref; + cmd->gsm411_trans_id = sms->gsm411.transaction_id; cmd->vsub = vlr_subscr_get(vsub); /* FIXME: No predefined value for this response_timer as specified by @@ -592,7 +590,6 @@ osmo_timer_setup(&cmd->response_timer, smpp_deliver_sm_cb, cmd); osmo_timer_schedule(&cmd->response_timer, 5, 0); llist_add_tail(&cmd->list, &esme->smpp_cmd_list); - *deferred = true; return 0; } @@ -610,8 +607,7 @@ } static int deliver_to_esme(struct osmo_esme *esme, struct gsm_sms *sms, - struct gsm_subscriber_connection *conn, - bool *deferred) + struct gsm_subscriber_connection *conn) { struct deliver_sm_t deliver; int mode, ret; @@ -693,7 +689,7 @@ return ret; return smpp_cmd_enqueue(esme, conn->vsub, sms, - deliver.sequence_number, deferred); + deliver.sequence_number); } static struct smsc *g_smsc; @@ -704,7 +700,7 @@ } int smpp_try_deliver(struct gsm_sms *sms, - struct gsm_subscriber_connection *conn, bool *deferred) + struct gsm_subscriber_connection *conn) { struct osmo_esme *esme; struct osmo_smpp_addr dst; @@ -717,7 +713,7 @@ rc = smpp_route(g_smsc, &dst, &esme); if (!rc) - rc = deliver_to_esme(esme, sms, conn, deferred); + rc = deliver_to_esme(esme, sms, conn); return rc; } diff --git a/src/libmsc/smpp_smsc.h b/src/libmsc/smpp_smsc.h index fded236..0f1d35c 100644 --- a/src/libmsc/smpp_smsc.h +++ b/src/libmsc/smpp_smsc.h @@ -89,8 +89,9 @@ struct osmo_smpp_cmd { struct llist_head list; struct vlr_subscr *vsub; - struct gsm_sms *sms; uint32_t sequence_nr; + uint32_t gsm411_msg_ref; + uint8_t gsm411_trans_id; struct osmo_timer_list response_timer; }; @@ -161,5 +162,5 @@ int smpp_route_smpp_first(struct gsm_sms *sms, struct gsm_subscriber_connection *conn); int smpp_try_deliver(struct gsm_sms *sms, - struct gsm_subscriber_connection *conn, bool *deferred); + struct gsm_subscriber_connection *conn); #endif -- To view, visit https://gerrit.osmocom.org/3635 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Iba5f864f9bb963baff95969e306b1b7cff00c1e3 Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Pablo Neira Ayuso From gerrit-no-reply at lists.osmocom.org Thu Aug 24 17:41:03 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 24 Aug 2017 17:41:03 +0000 Subject: [PATCH] osmo-msc[master]: libmsc: move gsm340_rx_sms_submit() to sms_route_mt_sms() Message-ID: Review at https://gerrit.osmocom.org/3636 libmsc: move gsm340_rx_sms_submit() to sms_route_mt_sms() Move the sms message-type-identifier (mti) handling away from the routing logic. This patch allows us to reuse the sms_route_mt_sms() function in a follow up patch for sms reports send through SMPP DELIVER_SM with esm_class = Delivery Receipt whose Change-Id is Ic1a9023074bfa938099377980b6aff9b262fab2a. Change-Id: I3f3d30e0762b91e2099243b0be1a4b67cbb5e9c0 --- M src/libmsc/gsm_04_11.c 1 file changed, 22 insertions(+), 19 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/36/3636/1 diff --git a/src/libmsc/gsm_04_11.c b/src/libmsc/gsm_04_11.c index 88a6685..ef2635b 100644 --- a/src/libmsc/gsm_04_11.c +++ b/src/libmsc/gsm_04_11.c @@ -280,7 +280,7 @@ } static int sms_route_mt_sms(struct gsm_subscriber_connection *conn, - struct gsm_sms *gsms, uint8_t sms_mti) + struct gsm_sms *gsms) { int rc; @@ -338,23 +338,6 @@ rc = GSM411_RP_CAUSE_MO_NUM_UNASSIGNED; rate_ctr_inc(&conn->network->msc_ctrs->ctr[MSC_CTR_SMS_NO_RECEIVER]); #endif - return rc; - } - - switch (sms_mti) { - case GSM340_SMS_SUBMIT_MS2SC: - /* MS is submitting a SMS */ - rc = gsm340_rx_sms_submit(gsms); - break; - case GSM340_SMS_COMMAND_MS2SC: - case GSM340_SMS_DELIVER_REP_MS2SC: - LOGP(DLSMS, 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); - rc = GSM411_RP_CAUSE_IE_NOTEXIST; - break; } return rc; @@ -485,7 +468,27 @@ /* FIXME: This looks very wrong */ send_signal(0, NULL, gsms, 0); - rc = sms_route_mt_sms(conn, gsms, sms_mti); + rc = sms_route_mt_sms(conn, gsms); + + /* This SMS got routed through SMPP or no receiver exists. */ + if (!gsms->receiver) + return rc; + + switch (sms_mti) { + case GSM340_SMS_SUBMIT_MS2SC: + /* MS is submitting a SMS */ + rc = gsm340_rx_sms_submit(gsms); + break; + case GSM340_SMS_COMMAND_MS2SC: + case GSM340_SMS_DELIVER_REP_MS2SC: + LOGP(DLSMS, 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); + rc = GSM411_RP_CAUSE_IE_NOTEXIST; + break; + } out: sms_free(gsms); -- To view, visit https://gerrit.osmocom.org/3636 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I3f3d30e0762b91e2099243b0be1a4b67cbb5e9c0 Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Pablo Neira Ayuso From gerrit-no-reply at lists.osmocom.org Thu Aug 24 17:41:04 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 24 Aug 2017 17:41:04 +0000 Subject: [PATCH] osmo-msc[master]: cosmetic: vty for timers: remove obsolete range check Message-ID: Review at https://gerrit.osmocom.org/3637 cosmetic: vty for timers: remove obsolete range check The VTY parsing already ensures the parameter range being 1..65535, no need to check the range again. Change-Id: I1cffa5b01cd5c589f1e42998e32135f1da8c960b --- M src/libbsc/bsc_vty.c 1 file changed, 0 insertions(+), 6 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/37/3637/1 diff --git a/src/libbsc/bsc_vty.c b/src/libbsc/bsc_vty.c index bf7c3ca..da406e0 100644 --- a/src/libbsc/bsc_vty.c +++ b/src/libbsc/bsc_vty.c @@ -1550,12 +1550,6 @@ struct gsm_network *gsmnet = gsmnet_from_vty(vty); \ int value = atoi(argv[0]); \ \ - if (value < 1 || value > 65535) { \ - vty_out(vty, "Timer value %s out of range.%s", \ - argv[0], VTY_NEWLINE); \ - return CMD_WARNING; \ - } \ - \ gsmnet->T##number = value; \ return CMD_SUCCESS; \ } -- To view, visit https://gerrit.osmocom.org/3637 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I1cffa5b01cd5c589f1e42998e32135f1da8c960b Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Thu Aug 24 17:41:04 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 24 Aug 2017 17:41:04 +0000 Subject: [PATCH] osmo-msc[master]: vty: add 'default' keyword to timer config Message-ID: Review at https://gerrit.osmocom.org/3638 vty: add 'default' keyword to timer config Change-Id: I4e837e8bedfad7ac4fd50048ecb016ddb37c2397 --- M src/libbsc/bsc_vty.c 1 file changed, 14 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/38/3638/1 diff --git a/src/libbsc/bsc_vty.c b/src/libbsc/bsc_vty.c index da406e0..9991e58 100644 --- a/src/libbsc/bsc_vty.c +++ b/src/libbsc/bsc_vty.c @@ -1540,15 +1540,26 @@ return CMD_SUCCESS; } +#define DEFAULT_TIMER(number) GSM_T##number##_DEFAULT +/* Add another expansion so that DEFAULT_TIMER() becomes its value */ +#define EXPAND_AND_STRINGIFY(x) OSMO_STRINGIFY(x) + #define DECLARE_TIMER(number, doc) \ DEFUN(cfg_net_T##number, \ cfg_net_T##number##_cmd, \ - "timer t" #number " <1-65535>", \ + "timer t" #number " (default|<1-65535>)", \ "Configure GSM Timers\n" \ - doc "Timer Value in seconds\n") \ + doc \ + "Set to default timer value" \ + " (" EXPAND_AND_STRINGIFY(DEFAULT_TIMER(number)) " seconds)\n" \ + "Timer Value in seconds\n") \ { \ struct gsm_network *gsmnet = gsmnet_from_vty(vty); \ - int value = atoi(argv[0]); \ + int value; \ + if (strcmp(argv[0], "default") == 0) \ + value = DEFAULT_TIMER(number); \ + else \ + value = atoi(argv[0]); \ \ gsmnet->T##number = value; \ return CMD_SUCCESS; \ -- To view, visit https://gerrit.osmocom.org/3638 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I4e837e8bedfad7ac4fd50048ecb016ddb37c2397 Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Thu Aug 24 17:41:04 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 24 Aug 2017 17:41:04 +0000 Subject: [PATCH] osmo-msc[master]: timer vty: also print the default value in cmd doc Message-ID: Review at https://gerrit.osmocom.org/3639 timer vty: also print the default value in cmd doc Rationale: allows seeing all timer defaults at once by doing OsmoBSC(config-net)# timer ? Before, defaults are visible only by doing on each timer: OsmoBSC(config-net)# timer t1234 Change-Id: I8259234e5c62e058dde56d531071440bbab11462 --- M src/libbsc/bsc_vty.c 1 file changed, 13 insertions(+), 13 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/39/3639/1 diff --git a/src/libbsc/bsc_vty.c b/src/libbsc/bsc_vty.c index 9991e58..bd363ae 100644 --- a/src/libbsc/bsc_vty.c +++ b/src/libbsc/bsc_vty.c @@ -1549,7 +1549,7 @@ cfg_net_T##number##_cmd, \ "timer t" #number " (default|<1-65535>)", \ "Configure GSM Timers\n" \ - doc \ + doc " (default: " EXPAND_AND_STRINGIFY(DEFAULT_TIMER(number)) " seconds)\n" \ "Set to default timer value" \ " (" EXPAND_AND_STRINGIFY(DEFAULT_TIMER(number)) " seconds)\n" \ "Timer Value in seconds\n") \ @@ -1565,18 +1565,18 @@ return CMD_SUCCESS; \ } -DECLARE_TIMER(3101, "Set the timeout value for IMMEDIATE ASSIGNMENT.\n") -DECLARE_TIMER(3103, "Set the timeout value for HANDOVER.\n") -DECLARE_TIMER(3105, "Set the timer for repetition of PHYSICAL INFORMATION.\n") -DECLARE_TIMER(3107, "Currently not used.\n") -DECLARE_TIMER(3109, "Set the RSL SACCH deactivation timeout.\n") -DECLARE_TIMER(3111, "Set the RSL timeout to wait before releasing the RF Channel.\n") -DECLARE_TIMER(3113, "Set the time to try paging a subscriber.\n") -DECLARE_TIMER(3115, "Currently not used.\n") -DECLARE_TIMER(3117, "Currently not used.\n") -DECLARE_TIMER(3119, "Currently not used.\n") -DECLARE_TIMER(3122, "Waiting time (seconds) after IMM ASS REJECT\n") -DECLARE_TIMER(3141, "Currently not used.\n") +DECLARE_TIMER(3101, "Set the timeout value for IMMEDIATE ASSIGNMENT") +DECLARE_TIMER(3103, "Set the timeout value for HANDOVER") +DECLARE_TIMER(3105, "Set the timer for repetition of PHYSICAL INFORMATION") +DECLARE_TIMER(3107, "Currently not used") +DECLARE_TIMER(3109, "Set the RSL SACCH deactivation timeout") +DECLARE_TIMER(3111, "Set the RSL timeout to wait before releasing the RF Channel") +DECLARE_TIMER(3113, "Set the time to try paging a subscriber") +DECLARE_TIMER(3115, "Currently not used") +DECLARE_TIMER(3117, "Currently not used") +DECLARE_TIMER(3119, "Currently not used") +DECLARE_TIMER(3122, "Waiting time (seconds) after IMM ASS REJECT") +DECLARE_TIMER(3141, "Currently not used") DEFUN_DEPRECATED(cfg_net_dtx, cfg_net_dtx_cmd, -- To view, visit https://gerrit.osmocom.org/3639 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I8259234e5c62e058dde56d531071440bbab11462 Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Thu Aug 24 17:41:04 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 24 Aug 2017 17:41:04 +0000 Subject: [PATCH] osmo-msc[master]: libmsc: set registered_delivery field in SMPP 3.4 DELIVER_SM... Message-ID: Review at https://gerrit.osmocom.org/3640 libmsc: set registered_delivery field in SMPP 3.4 DELIVER_SM messages Propagate the status report request field to the SMPP message through the registered_delivery field, so the ESME knows that the mobile phone is asking for explicit delivery acknowledgment is required. See SMPP 3.4 specs section 5.2.17. Change-Id: I59af60fa89cd10ae973c5e122789e3e03e3728ee --- M src/libmsc/smpp_openbsc.c 1 file changed, 8 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/40/3640/1 diff --git a/src/libmsc/smpp_openbsc.c b/src/libmsc/smpp_openbsc.c index bf63f6b..8a1a7da 100644 --- a/src/libmsc/smpp_openbsc.c +++ b/src/libmsc/smpp_openbsc.c @@ -606,6 +606,10 @@ return NULL; } +/* See SMPP 3.4, Section 5.2.17. registered_delivery (1 byte field). */ +#define SMPP34_NO_DELIVERY_RECEIPT 0x0 +#define SMPP34_DELIVERY_RECEIPT_REQ 0x1 + static int deliver_to_esme(struct osmo_esme *esme, struct gsm_sms *sms, struct gsm_subscriber_connection *conn) { @@ -646,7 +650,10 @@ deliver.protocol_id = sms->protocol_id; deliver.priority_flag = 0; - deliver.registered_delivery = 0; + if (sms->status_rep_req) + deliver.registered_delivery = SMPP34_DELIVERY_RECEIPT_REQ; + else + deliver.registered_delivery = SMPP34_NO_DELIVERY_RECEIPT; /* Figure out SMPP DCS from TP-DCS */ dcs = sms->data_coding_scheme; -- To view, visit https://gerrit.osmocom.org/3640 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I59af60fa89cd10ae973c5e122789e3e03e3728ee Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Pablo Neira Ayuso From gerrit-no-reply at lists.osmocom.org Thu Aug 24 17:41:05 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 24 Aug 2017 17:41:05 +0000 Subject: [PATCH] osmo-msc[master]: libmsc: report status report request flag from SMPP SUBMIT_SM Message-ID: Review at https://gerrit.osmocom.org/3641 libmsc: report status report request flag from SMPP SUBMIT_SM Restore the sms status report request flag from SUBMIT_SM. Change-Id: Iac05252253f8933a3875b4904599b7a225191a4b --- M src/libmsc/smpp_openbsc.c 1 file changed, 1 insertion(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/41/3641/1 diff --git a/src/libmsc/smpp_openbsc.c b/src/libmsc/smpp_openbsc.c index 8a1a7da..5de1368 100644 --- a/src/libmsc/smpp_openbsc.c +++ b/src/libmsc/smpp_openbsc.c @@ -130,6 +130,7 @@ sms = sms_alloc(); sms->source = SMS_SOURCE_SMPP; sms->smpp.sequence_nr = submit->sequence_number; + sms->status_rep_req = submit->registered_delivery; /* fill in the destination address */ sms->receiver = dest; -- To view, visit https://gerrit.osmocom.org/3641 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Iac05252253f8933a3875b4904599b7a225191a4b Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Pablo Neira Ayuso From gerrit-no-reply at lists.osmocom.org Thu Aug 24 17:41:05 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 24 Aug 2017 17:41:05 +0000 Subject: [PATCH] osmo-msc[master]: libmsc: missing bit shift in status report flag when stored ... Message-ID: Review at https://gerrit.osmocom.org/3642 libmsc: missing bit shift in status report flag when stored in sms object So we just store 0 or 1 depending on what the mobile phone requests. Change-Id: Idb7d5594219c0e458ccb561383a59604bc1a4201 --- M src/libmsc/gsm_04_11.c 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/42/3642/1 diff --git a/src/libmsc/gsm_04_11.c b/src/libmsc/gsm_04_11.c index ef2635b..cd23883 100644 --- a/src/libmsc/gsm_04_11.c +++ b/src/libmsc/gsm_04_11.c @@ -368,7 +368,7 @@ /* invert those fields where 0 means active/present */ sms_mti = *smsp & 0x03; sms_vpf = (*smsp & 0x18) >> 3; - gsms->status_rep_req = (*smsp & 0x20); + gsms->status_rep_req = (*smsp & 0x20) >> 5; gsms->ud_hdr_ind = (*smsp & 0x40); /* * Not evaluating MMS (More Messages to Send) because the -- To view, visit https://gerrit.osmocom.org/3642 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Idb7d5594219c0e458ccb561383a59604bc1a4201 Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Pablo Neira Ayuso From gerrit-no-reply at lists.osmocom.org Thu Aug 24 17:41:05 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 24 Aug 2017 17:41:05 +0000 Subject: [PATCH] osmo-msc[master]: utils: smpp_mirror: set registered_delivery field in SMPP SU... Message-ID: Review at https://gerrit.osmocom.org/3643 utils: smpp_mirror: set registered_delivery field in SMPP SUBMIT_SM To test delivery reports using this utility. Change-Id: I0e477407531fdd4d906e53c9b5a48a79a239966f --- M src/utils/smpp_mirror.c 1 file changed, 1 insertion(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/43/3643/1 diff --git a/src/utils/smpp_mirror.c b/src/utils/smpp_mirror.c index 95df5f2..ec28f0a 100644 --- a/src/utils/smpp_mirror.c +++ b/src/utils/smpp_mirror.c @@ -130,6 +130,7 @@ sizeof(deliver.destination_addr))); submit.esm_class = deliver.esm_class; + submit.registered_delivery = deliver.registered_delivery; submit.protocol_id = deliver.protocol_id; submit.priority_flag = deliver.priority_flag; memcpy(submit.schedule_delivery_time, deliver.schedule_delivery_time, -- To view, visit https://gerrit.osmocom.org/3643 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I0e477407531fdd4d906e53c9b5a48a79a239966f Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Pablo Neira Ayuso From gerrit-no-reply at lists.osmocom.org Thu Aug 24 17:41:05 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 24 Aug 2017 17:41:05 +0000 Subject: [PATCH] osmo-msc[master]: utils: smpp_mirror: temporarily munch SMPP delivery receipts Message-ID: Review at https://gerrit.osmocom.org/3644 utils: smpp_mirror: temporarily munch SMPP delivery receipts Just munch and log SMPP delivery receipts by now, don't mirror this, it is going to break things in openbsc. Follow up patch removes this and mirrors this SMPP message as a SUBMIT_SM with esm_class = Delivery Acknowledgement. Change-Id: I78e93bc4034679e238c8642ccf6a0e844b1d6d8b --- M src/utils/smpp_mirror.c 1 file changed, 8 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/44/3644/1 diff --git a/src/utils/smpp_mirror.c b/src/utils/smpp_mirror.c index ec28f0a..edb40b5 100644 --- a/src/utils/smpp_mirror.c +++ b/src/utils/smpp_mirror.c @@ -112,6 +112,14 @@ PACK_AND_SEND(esme, &deliver_r); + /* This is a delivery receipt, temporarily munch it until we teach + * openbsc what to do with this. + */ + if (deliver.esm_class == 0x04) { + LOGP(DSMPP, LOGL_NOTICE, "%s\n", deliver.short_message); + return 0; + } + memset(&submit, 0, sizeof(submit)); submit.command_id = SUBMIT_SM; submit.command_status = ESME_ROK; -- To view, visit https://gerrit.osmocom.org/3644 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I78e93bc4034679e238c8642ccf6a0e844b1d6d8b Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Pablo Neira Ayuso From gerrit-no-reply at lists.osmocom.org Thu Aug 24 17:41:05 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 24 Aug 2017 17:41:05 +0000 Subject: [PATCH] osmo-msc[master]: utils: smpp_mirror: reflect message reference TLV Message-ID: Review at https://gerrit.osmocom.org/3645 utils: smpp_mirror: reflect message reference TLV Useful to test the delivery receipt support. This TLV contains the GSM03.40 message reference. Change-Id: I1b0abaa7e06ffe1bd2242c70813d8b70e9fa954f --- M src/utils/smpp_mirror.c 1 file changed, 23 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/45/3645/1 diff --git a/src/utils/smpp_mirror.c b/src/utils/smpp_mirror.c index edb40b5..88545de 100644 --- a/src/utils/smpp_mirror.c +++ b/src/utils/smpp_mirror.c @@ -95,12 +95,23 @@ } /* FIXME: merge with smpp_smsc.c */ +static struct tlv_t *find_tlv(struct tlv_t *head, uint16_t tag) +{ + struct tlv_t *t; + + for (t = head; t != NULL; t = t->next) { + if (t->tag == tag) + return t; + } + return NULL; +} static int smpp_handle_deliver(struct esme *esme, struct msgb *msg) { struct deliver_sm_t deliver; struct deliver_sm_resp_t deliver_r; struct submit_sm_t submit; + tlv_t *t; int rc; memset(&deliver, 0, sizeof(deliver)); @@ -155,7 +166,18 @@ memcpy(submit.short_message, deliver.short_message, OSMO_MIN(sizeof(submit.short_message), sizeof(deliver.short_message))); - /* FIXME: TLV? */ + + /* FIXME: More TLV? */ + t = find_tlv(deliver.tlv, TLVID_user_message_reference); + if (t) { + tlv_t tlv; + + memset(&tlv, 0, sizeof(tlv)); + tlv.tag = TLVID_user_message_reference; + tlv.length = 2; + tlv.value.val16 = t->value.val16; + build_tlv(&submit.tlv, &tlv); + } return PACK_AND_SEND(esme, &submit); } -- To view, visit https://gerrit.osmocom.org/3645 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I1b0abaa7e06ffe1bd2242c70813d8b70e9fa954f Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Pablo Neira Ayuso From gerrit-no-reply at lists.osmocom.org Thu Aug 24 17:41:06 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 24 Aug 2017 17:41:06 +0000 Subject: [PATCH] osmo-msc[master]: libmsc: add support for SMPP delivery receipts Message-ID: Review at https://gerrit.osmocom.org/3646 libmsc: add support for SMPP delivery receipts If the mobile phone requests a status report via SMS, send a DELIVER_SM with esm_class = Delivery Receipt to ESME to indicate that the SMS has been already delivered to its destination. MS GSM 03.40 SMSC SMPP 3.4 ESME | | | | SMS-DELIVER | | |<----------------------------| | | GSM 04.11 RP-ACK | | |---------------------------->| | | | DELIVER-SM | | | esm_class = Delivery Receipt | | |------------------------------->| | | DELIVER-SM-RESP | | |<-------------------------------| | | | This patch implements "Appendix B. Delivery Receipt Format" as specified in the SMPP 3.4 specs. This string is conveyed in the SMS message as data, and it is only meaningful to the ESME, for logging purposes. The "submit date" and "done date" are not yet set, and other fields are just sent with dummy values, so they are left to be finished as future work. The new SMPP TLV tag TLVID_user_message_reference is added to the SMPP messages inconditionally now since this information is required by delivery-reports to associate the status-report with the original SMS. Change-Id: Ic1a9023074bfa938099377980b6aff9b262fab2a --- M include/openbsc/gsm_data.h M src/libmsc/gsm_04_11.c M src/libmsc/smpp_openbsc.c M src/libmsc/smpp_smsc.h 4 files changed, 76 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/46/3646/1 diff --git a/include/openbsc/gsm_data.h b/include/openbsc/gsm_data.h index 02823c9..51cf6dc 100644 --- a/include/openbsc/gsm_data.h +++ b/include/openbsc/gsm_data.h @@ -511,6 +511,7 @@ } smpp; unsigned long validity_minutes; + bool is_report; uint8_t reply_path_req; uint8_t status_rep_req; uint8_t ud_hdr_ind; diff --git a/src/libmsc/gsm_04_11.c b/src/libmsc/gsm_04_11.c index cd23883..b4fa3df 100644 --- a/src/libmsc/gsm_04_11.c +++ b/src/libmsc/gsm_04_11.c @@ -594,6 +594,57 @@ rpud_len, rp_ud); } +static struct gsm_sms *sms_report_alloc(struct gsm_sms *sms) +{ + struct gsm_sms *sms_report; + int len; + + sms_report = sms_alloc(); + OSMO_ASSERT(sms_report); + + sms_report->msg_ref = sms->msg_ref; + sms_report->protocol_id = sms->protocol_id; + sms_report->data_coding_scheme = GSM338_DCS_1111_8BIT_DATA; + + /* Invert address to send status report back to origin. */ + sms_report->src = sms->dst; + sms_report->dst = sms->src; + + /* As specified by Appendix B. Delivery Receipt Format. + * TODO: Many fields in this string are just set with dummy values, + * revisit this. + */ + len = snprintf((char *)sms_report->user_data, + sizeof(sms_report->user_data), + "id:%.08llu sub:000 dlvrd:000 submit date:YYMMDDhhmm done date:YYMMDDhhmm stat:DELIVRD err:000 text:%.20s", + sms->id, sms->user_data); + sms_report->user_data_len = len; + LOGP(DLSMS, LOGL_NOTICE, "%s\n", sms_report->user_data); + + /* This represents a sms report. */ + sms_report->is_report = true; + + return sms_report; +} + +static void sms_status_report(struct gsm_sms *gsms, + struct gsm_subscriber_connection *conn) +{ + struct gsm_sms *sms_report; + int rc; + + sms_report = sms_report_alloc(gsms); + + rc = sms_route_mt_sms(conn, sms_report); + if (rc < 0) { + LOGP(DLSMS, LOGL_ERROR, + "Failed to send status report! err=%d\n", rc); + } + LOGP(DLSMS, LOGL_NOTICE, "Status report has been sent\n"); + + sms_free(sms_report); +} + /* Receive a 04.11 RP-ACK message (response to RP-DATA from us) */ static int gsm411_rx_rp_ack(struct msgb *msg, struct gsm_trans *trans, struct gsm411_rp_hdr *rph) @@ -615,6 +666,9 @@ send_signal(S_SMS_DELIVERED, trans, sms, 0); + if (sms->status_rep_req) + sms_status_report(sms, trans->conn); + sms_free(sms); trans->sms.sms = NULL; diff --git a/src/libmsc/smpp_openbsc.c b/src/libmsc/smpp_openbsc.c index 5de1368..03482be 100644 --- a/src/libmsc/smpp_openbsc.c +++ b/src/libmsc/smpp_openbsc.c @@ -201,6 +201,10 @@ sms->user_data_len = sms_msg_len; } + t = find_tlv(submit->tlv, TLVID_user_message_reference); + if (t) + sms->msg_ref = ntohs(t->value.val16); + *psms = sms; return ESME_ROK; } @@ -518,6 +522,9 @@ struct gsm_subscriber_connection *conn; struct gsm_trans *trans; + if (cmd->is_report) + goto out; + conn = connection_for_subscr(cmd->vsub); if (!conn) { LOGP(DSMPP, LOGL_ERROR, "No connection to subscriber anymore\n"); @@ -541,6 +548,9 @@ struct gsm_subscriber_connection *conn; struct gsm_trans *trans; int gsm411_cause; + + if (cmd->is_report) + goto out; conn = connection_for_subscr(cmd->vsub); if (!conn) { @@ -579,6 +589,7 @@ return -1; cmd->sequence_nr = sequence_number; + cmd->is_report = sms->is_report; cmd->gsm411_msg_ref = sms->gsm411.msg_ref; cmd->gsm411_trans_id = sms->gsm411.transaction_id; cmd->vsub = vlr_subscr_get(vsub); @@ -643,7 +654,12 @@ memcpy(deliver.destination_addr, sms->dst.addr, sizeof(deliver.destination_addr)); - deliver.esm_class = 1; /* datagram mode */ + /* Short message contains a delivery receipt? Sect. 5.2.12. */ + if (sms->is_report) + deliver.esm_class = 0x04; + else + deliver.esm_class = 1; /* datagram mode */ + if (sms->ud_hdr_ind) deliver.esm_class |= 0x40; if (sms->reply_path_req) @@ -692,6 +708,9 @@ append_osmo_tlvs(&deliver.tlv, conn->lchan); #endif + append_tlv_u16(&deliver.tlv, TLVID_user_message_reference, + sms->msg_ref); + ret = smpp_tx_deliver(esme, &deliver); if (ret < 0) return ret; diff --git a/src/libmsc/smpp_smsc.h b/src/libmsc/smpp_smsc.h index 0f1d35c..755e685 100644 --- a/src/libmsc/smpp_smsc.h +++ b/src/libmsc/smpp_smsc.h @@ -92,6 +92,7 @@ uint32_t sequence_nr; uint32_t gsm411_msg_ref; uint8_t gsm411_trans_id; + bool is_report; struct osmo_timer_list response_timer; }; -- To view, visit https://gerrit.osmocom.org/3646 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ic1a9023074bfa938099377980b6aff9b262fab2a Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Pablo Neira Ayuso From gerrit-no-reply at lists.osmocom.org Thu Aug 24 17:41:06 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 24 Aug 2017 17:41:06 +0000 Subject: [PATCH] osmo-msc[master]: libmsc: update database to accomodate SMS status-report fields Message-ID: Review at https://gerrit.osmocom.org/3647 libmsc: update database to accomodate SMS status-report fields SMPP DELIVER_SM messages with esm_class = Delivery Receipt need to send this message reference (that the mobile phone allocates) to the ESME. Thus, the ESME propagates it via SUBMIT_SM with esm_class = Delivery Acknoledgment so that the SMSC sends the GSM 03.40 status-report to the origin including this. Given this field is useful for status-reports, we need to store it in the HLR database. Moreover, we need a new field that specifies if the entry represents a SMS status-report, to do the right handling from the gsm411_send_sms() - such new handling comes in a follow up patch entitled "libmsc: handle delivery ack via SMPP SUBMIT SM / send GSM 03.40 status report". This patch includes the migration routines to the new database schema revision 5, it's quite a bit of dbi boilerplate code - copied-pasted and adapted. Change-Id: I7276d356d805a83ebeec72b02c8563b7135ea0b6 --- M src/libmsc/db.c M tests/db/db_test.err 2 files changed, 163 insertions(+), 6 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/47/3647/1 diff --git a/src/libmsc/db.c b/src/libmsc/db.c index 28e9782..78e022d 100644 --- a/src/libmsc/db.c +++ b/src/libmsc/db.c @@ -48,7 +48,7 @@ static char *db_dirname = NULL; static dbi_conn conn; -#define SCHEMA_REVISION "4" +#define SCHEMA_REVISION "5" enum { SCHEMA_META, @@ -122,6 +122,8 @@ "valid_until TIMESTAMP, " "reply_path_req INTEGER NOT NULL, " "status_rep_req INTEGER NOT NULL, " + "is_report INTEGER NOT NULL, " + "msg_ref INTEGER NOT NULL, " "protocol_id INTEGER NOT NULL, " "data_coding_scheme INTEGER NOT NULL, " "ud_hdr_ind INTEGER NOT NULL, " @@ -378,6 +380,152 @@ return -EINVAL; } +/* Just like v3, but there is a new message reference field for status reports, + * that is set to zero for existing entries since there is no way we can infer + * this. + */ +static struct gsm_sms *sms_from_result_v4(dbi_result result) +{ + struct gsm_sms *sms = sms_alloc(); + const unsigned char *user_data; + const char *text, *addr; + + if (!sms) + return NULL; + + sms->id = dbi_result_get_ulonglong(result, "id"); + + sms->reply_path_req = dbi_result_get_ulonglong(result, "reply_path_req"); + sms->status_rep_req = dbi_result_get_ulonglong(result, "status_rep_req"); + sms->ud_hdr_ind = dbi_result_get_ulonglong(result, "ud_hdr_ind"); + sms->protocol_id = dbi_result_get_ulonglong(result, "protocol_id"); + sms->data_coding_scheme = dbi_result_get_ulonglong(result, + "data_coding_scheme"); + + addr = dbi_result_get_string(result, "src_addr"); + osmo_strlcpy(sms->src.addr, addr, sizeof(sms->src.addr)); + sms->src.ton = dbi_result_get_ulonglong(result, "src_ton"); + sms->src.npi = dbi_result_get_ulonglong(result, "src_npi"); + + addr = dbi_result_get_string(result, "dest_addr"); + osmo_strlcpy(sms->dst.addr, addr, sizeof(sms->dst.addr)); + sms->dst.ton = dbi_result_get_ulonglong(result, "dest_ton"); + sms->dst.npi = dbi_result_get_ulonglong(result, "dest_npi"); + + sms->user_data_len = dbi_result_get_field_length(result, "user_data"); + user_data = dbi_result_get_binary(result, "user_data"); + if (sms->user_data_len > sizeof(sms->user_data)) + sms->user_data_len = (uint8_t) sizeof(sms->user_data); + memcpy(sms->user_data, user_data, sms->user_data_len); + + text = dbi_result_get_string(result, "text"); + if (text) + osmo_strlcpy(sms->text, text, sizeof(sms->text)); + return sms; +} + +static int update_db_revision_4(void) +{ + dbi_result result; + struct gsm_sms *sms; + + LOGP(DDB, LOGL_NOTICE, "Going to migrate from revision 4\n"); + + result = dbi_conn_query(conn, "BEGIN EXCLUSIVE TRANSACTION"); + if (!result) { + LOGP(DDB, LOGL_ERROR, + "Failed to begin transaction (upgrade from rev 4)\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_4"); + if (!result) { + LOGP(DDB, LOGL_ERROR, + "Failed to rename the old SMS table (upgrade from rev 4).\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 4).\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_4"); + if (!result) { + LOGP(DDB, LOGL_ERROR, + "Failed fetch messages from the old SMS table (upgrade from rev 4).\n"); + goto rollback; + } + while (dbi_result_next_row(result)) { + sms = sms_from_result_v4(result); + if (db_sms_store(sms) != 0) { + LOGP(DDB, LOGL_ERROR, "Failed to store message to the new SMS table(upgrade from rev 4).\n"); + sms_free(sms); + dbi_result_free(result); + goto rollback; + } + sms_free(sms); + } + dbi_result_free(result); + + /* Remove the temporary table */ + result = dbi_conn_query(conn, "DROP TABLE SMS_4"); + if (!result) { + LOGP(DDB, LOGL_ERROR, + "Failed to drop the old SMS table (upgrade from rev 4).\n"); + goto rollback; + } + dbi_result_free(result); + + /* We're done. Bump DB Meta revision to 4 */ + result = dbi_conn_query(conn, + "UPDATE Meta " + "SET value = '5' " + "WHERE key = 'revision'"); + if (!result) { + LOGP(DDB, LOGL_ERROR, + "Failed to update DB schema revision (upgrade from rev 4).\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 4)\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 4).\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 4).\n"); + else + dbi_result_free(result); + return -EINVAL; +} + static int check_db_revision(void) { dbi_result result; @@ -420,6 +568,9 @@ goto error; case 3: if (update_db_revision_3()) + goto error; + case 4: + if (update_db_revision_4()) goto error; /* The end of waterfall */ @@ -546,20 +697,23 @@ result = dbi_conn_queryf(conn, "INSERT INTO SMS " "(created, valid_until, " - "reply_path_req, status_rep_req, protocol_id, " - "data_coding_scheme, ud_hdr_ind, " + "reply_path_req, status_rep_req, is_report, " + "msg_ref, protocol_id, data_coding_scheme, " + "ud_hdr_ind, " "user_data, text, " "dest_addr, dest_ton, dest_npi, " "src_addr, src_ton, src_npi) VALUES " "(datetime('now'), %u, " "%u, %u, %u, " - "%u, %u, " + "%u, %u, %u, " + "%u, " "%s, %s, " "%s, %u, %u, " "%s, %u, %u)", validity_timestamp, - sms->reply_path_req, sms->status_rep_req, sms->protocol_id, - sms->data_coding_scheme, sms->ud_hdr_ind, + sms->reply_path_req, sms->status_rep_req, sms->is_report, + sms->msg_ref, sms->protocol_id, sms->data_coding_scheme, + sms->ud_hdr_ind, q_udata, q_text, q_daddr, sms->dst.ton, sms->dst.npi, q_saddr, sms->src.ton, sms->src.npi); @@ -590,6 +744,8 @@ /* FIXME: those should all be get_uchar, but sqlite3 is braindead */ sms->reply_path_req = dbi_result_get_ulonglong(result, "reply_path_req"); sms->status_rep_req = dbi_result_get_ulonglong(result, "status_rep_req"); + sms->is_report = dbi_result_get_ulonglong(result, "is_report"); + sms->msg_ref = dbi_result_get_ulonglong(result, "msg_ref"); sms->ud_hdr_ind = dbi_result_get_ulonglong(result, "ud_hdr_ind"); sms->protocol_id = dbi_result_get_ulonglong(result, "protocol_id"); sms->data_coding_scheme = dbi_result_get_ulonglong(result, diff --git a/tests/db/db_test.err b/tests/db/db_test.err index fa9a54c..27e5703 100644 --- a/tests/db/db_test.err +++ b/tests/db/db_test.err @@ -1,2 +1,3 @@ Going to migrate from revision 3 +Going to migrate from revision 4  \ No newline at end of file -- To view, visit https://gerrit.osmocom.org/3647 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I7276d356d805a83ebeec72b02c8563b7135ea0b6 Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Pablo Neira Ayuso From gerrit-no-reply at lists.osmocom.org Thu Aug 24 17:41:06 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 24 Aug 2017 17:41:06 +0000 Subject: [PATCH] osmo-msc[master]: utils: smpp_mirror: bounce Delivery Receipts as Delivery Ack... Message-ID: Review at https://gerrit.osmocom.org/3648 utils: smpp_mirror: bounce Delivery Receipts as Delivery Acknowledgments Simple patch to test the new status-report support code, remove previous code before Delivery Acknowledgement support was in place. Use LOGL_DEBUG for logging messages here as suggested by Neels and Harald. Change-Id: I877e228d8e174430f700631edbf9955972da7892 --- M src/utils/smpp_mirror.c 1 file changed, 8 insertions(+), 9 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/48/3648/1 diff --git a/src/utils/smpp_mirror.c b/src/utils/smpp_mirror.c index 88545de..c570505 100644 --- a/src/utils/smpp_mirror.c +++ b/src/utils/smpp_mirror.c @@ -123,14 +123,6 @@ PACK_AND_SEND(esme, &deliver_r); - /* This is a delivery receipt, temporarily munch it until we teach - * openbsc what to do with this. - */ - if (deliver.esm_class == 0x04) { - LOGP(DSMPP, LOGL_NOTICE, "%s\n", deliver.short_message); - return 0; - } - memset(&submit, 0, sizeof(submit)); submit.command_id = SUBMIT_SM; submit.command_status = ESME_ROK; @@ -148,7 +140,14 @@ OSMO_MIN(sizeof(submit.source_addr), sizeof(deliver.destination_addr))); - submit.esm_class = deliver.esm_class; + /* Mirror delivery receipts as a delivery acknowledgements. */ + if (deliver.esm_class == 0x04) { + LOGP(DSMPP, LOGL_DEBUG, "%s\n", deliver.short_message); + submit.esm_class = 0x08; + } else { + submit.esm_class = deliver.esm_class; + } + submit.registered_delivery = deliver.registered_delivery; submit.protocol_id = deliver.protocol_id; submit.priority_flag = deliver.priority_flag; -- To view, visit https://gerrit.osmocom.org/3648 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I877e228d8e174430f700631edbf9955972da7892 Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Pablo Neira Ayuso From gerrit-no-reply at lists.osmocom.org Thu Aug 24 17:41:06 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 24 Aug 2017 17:41:06 +0000 Subject: [PATCH] osmo-msc[master]: libmsc: handle delivery ack via SMPP SUBMIT SM / send GSM 03... Message-ID: Review at https://gerrit.osmocom.org/3649 libmsc: handle delivery ack via SMPP SUBMIT SM / send GSM 03.40 status report This patch adds gsm340_sms_send_status_report_tpdu() to build a status-report. Moreover, set sms->report field if we see a SMPP SUBMIT_SM with Delivery Acknowledgment esm_class, so this identifies that this is a delivery report. MS GSM 03.40 SMSC SMPP 3.4 ESME | | | | | SUBMIT-SM | | | esm_class = Delivery Ack | | |<-------------------------------| | | SUBMIT-SM-RESP | | |------------------------------->| | | | | SMS-STATUS-REPORT | | |<----------------------------| | | GSM 04.11 RP-ACK | | |---------------------------->| | | | | There is a FIXME message in this patch, that I just copied from gsm340_gen_sms_deliver_tpdu() since TP-MMS is not supported by OpenBSC. Change-Id: Ib70e534840308ed315f7add440351e649de3f907 --- M src/libmsc/gsm_04_11.c M src/libmsc/smpp_openbsc.c 2 files changed, 54 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/49/3649/1 diff --git a/src/libmsc/gsm_04_11.c b/src/libmsc/gsm_04_11.c index b4fa3df..0a1348d 100644 --- a/src/libmsc/gsm_04_11.c +++ b/src/libmsc/gsm_04_11.c @@ -279,6 +279,49 @@ return msg->len - old_msg_len; } +/* As defined by GSM 03.40, Section 9.2.2.3. */ +static int gsm340_gen_sms_status_report_tpdu(struct msgb *msg, + struct gsm_sms *sms) +{ + unsigned int old_msg_len = msg->len; + uint8_t oa_len = 0; + uint8_t oa[12]; /* max len per 03.40 */ + uint8_t *smsp; + + /* generate first octet with masked bits */ + smsp = msgb_put(msg, 1); + /* TP-MTI (message type indicator) */ + *smsp = GSM340_SMS_STATUS_REP_SC2MS; + /* TP-MMS (more messages to send) */ + if (0 /* FIXME */) + *smsp |= 0x04; + /* TP-MR (message reference) */ + smsp = msgb_put(msg, 1); + *smsp = sms->msg_ref; + /* generate recipient address */ + oa_len = gsm340_gen_oa_sub(oa, sizeof(oa), &sms->dst); + smsp = msgb_put(msg, oa_len); + memcpy(smsp, oa, oa_len); + + /* generate TP-SCTS (Service centre timestamp) */ + smsp = msgb_put(msg, 7); + gsm340_gen_scts(smsp, time(NULL)); + + /* generate TP-DT (Discharge time, in TP-SCTS format). */ + smsp = msgb_put(msg, 7); + gsm340_gen_scts(smsp, time(NULL)); + + /* TP-ST (status) */ + smsp = msgb_put(msg, 1); + /* 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); + + return msg->len - old_msg_len; +} + static int sms_route_mt_sms(struct gsm_subscriber_connection *conn, struct gsm_sms *gsms) { @@ -993,8 +1036,13 @@ /* obtain a pointer for the rp_ud_len, so we can fill it later */ rp_ud_len = (uint8_t *)msgb_put(msg, 1); - /* generate the 03.40 SMS-DELIVER TPDU */ - rc = gsm340_gen_sms_deliver_tpdu(msg, sms); + if (sms->is_report) { + /* generate the 03.40 SMS-STATUS-REPORT TPDU */ + rc = gsm340_gen_sms_status_report_tpdu(msg, sms); + } else { + /* generate the 03.40 SMS-DELIVER TPDU */ + rc = gsm340_gen_sms_deliver_tpdu(msg, sms); + } if (rc < 0) { send_signal(S_SMS_UNKNOWN_ERROR, trans, sms, 0); sms_free(sms); diff --git a/src/libmsc/smpp_openbsc.c b/src/libmsc/smpp_openbsc.c index 03482be..09012d0 100644 --- a/src/libmsc/smpp_openbsc.c +++ b/src/libmsc/smpp_openbsc.c @@ -144,6 +144,10 @@ osmo_strlcpy(sms->src.addr, (char *)submit->source_addr, sizeof(sms->src.addr)); + /* This is a Delivery Acknowledgment. */ + if (submit->esm_class == 0x08) + sms->is_report = true; + if (submit->esm_class & 0x40) sms->ud_hdr_ind = 1; -- To view, visit https://gerrit.osmocom.org/3649 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ib70e534840308ed315f7add440351e649de3f907 Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Pablo Neira Ayuso From gerrit-no-reply at lists.osmocom.org Thu Aug 24 17:41:07 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 24 Aug 2017 17:41:07 +0000 Subject: [PATCH] osmo-msc[master]: libmsc: support GSM 03.40 status report for nitb Message-ID: Review at https://gerrit.osmocom.org/3650 libmsc: support GSM 03.40 status report for nitb This patch adds support for GSM 03.40 in nitb mode. MS GSM 03.40 SMSC | | | SMS-SUBMIT | |--------------------------->| | GSM 04.11 RP-ACK | |<---------------------------| | SMS-DELIVER | |<---------------------------| | GSM 04.11 RP-ACK | |--------------------------->| | SMS-STATUS-REPORT | |<---------------------------| | GSM 04.11 RP-ACK | |--------------------------->| | | Change-Id: I5cc7bb4ebadde0940f44d10c3df34707b0615160 --- M src/libmsc/gsm_04_11.c 1 file changed, 5 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/50/3650/1 diff --git a/src/libmsc/gsm_04_11.c b/src/libmsc/gsm_04_11.c index 0a1348d..261e5cd 100644 --- a/src/libmsc/gsm_04_11.c +++ b/src/libmsc/gsm_04_11.c @@ -683,6 +683,11 @@ LOGP(DLSMS, LOGL_ERROR, "Failed to send status report! err=%d\n", rc); } + + /* No route via SMPP, send the GSM 03.40 status-report now. */ + if (gsms->receiver) + gsm340_rx_sms_submit(sms_report); + LOGP(DLSMS, LOGL_NOTICE, "Status report has been sent\n"); sms_free(sms_report); -- To view, visit https://gerrit.osmocom.org/3650 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I5cc7bb4ebadde0940f44d10c3df34707b0615160 Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Pablo Neira Ayuso From gerrit-no-reply at lists.osmocom.org Thu Aug 24 17:41:07 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 24 Aug 2017 17:41:07 +0000 Subject: [PATCH] osmo-msc[master]: libmsc: gsm340_gen_oa_sub() may return negative value Message-ID: Review at https://gerrit.osmocom.org/3651 libmsc: gsm340_gen_oa_sub() may return negative value gsm340_gen_oa() returns a negative value if the output buffer that the caller passes is too small, so we have to check the return value of this function. Fixes: CID 174178 Fixes: CID 174179 Change-Id: I47215d7d89771730a7f84efa8aeeb187a0911fdb --- M src/libmsc/gsm_04_11.c 1 file changed, 9 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/51/3651/1 diff --git a/src/libmsc/gsm_04_11.c b/src/libmsc/gsm_04_11.c index 261e5cd..eede74c 100644 --- a/src/libmsc/gsm_04_11.c +++ b/src/libmsc/gsm_04_11.c @@ -215,9 +215,9 @@ { uint8_t *smsp; uint8_t oa[12]; /* max len per 03.40 */ - uint8_t oa_len = 0; uint8_t octet_len; unsigned int old_msg_len = msg->len; + int oa_len; /* generate first octet with masked bits */ smsp = msgb_put(msg, 1); @@ -235,6 +235,9 @@ /* generate originator address */ oa_len = gsm340_gen_oa_sub(oa, sizeof(oa), &sms->src); + if (oa_len < 0) + return -ENOSPC; + smsp = msgb_put(msg, oa_len); memcpy(smsp, oa, oa_len); @@ -284,9 +287,9 @@ struct gsm_sms *sms) { unsigned int old_msg_len = msg->len; - uint8_t oa_len = 0; uint8_t oa[12]; /* max len per 03.40 */ uint8_t *smsp; + int oa_len; /* generate first octet with masked bits */ smsp = msgb_put(msg, 1); @@ -298,8 +301,12 @@ /* TP-MR (message reference) */ smsp = msgb_put(msg, 1); *smsp = sms->msg_ref; + /* generate recipient address */ oa_len = gsm340_gen_oa_sub(oa, sizeof(oa), &sms->dst); + if (oa_len < 0) + return -ENOSPC; + smsp = msgb_put(msg, oa_len); memcpy(smsp, oa, oa_len); -- To view, visit https://gerrit.osmocom.org/3651 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I47215d7d89771730a7f84efa8aeeb187a0911fdb Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Pablo Neira Ayuso From gerrit-no-reply at lists.osmocom.org Thu Aug 24 17:41:08 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 24 Aug 2017 17:41:08 +0000 Subject: [PATCH] osmo-msc[master]: libmsc: Remove comment not applying anymore Message-ID: Review at https://gerrit.osmocom.org/3652 libmsc: Remove comment not applying anymore The change-id I7276d356d805a83ebeec72b02c8563b7135ea0b6 added msg_ref to the databse but forgot to remove the comment stating it's not being stored. Change-Id: I204f098c8f2a480405446113e2181b2c53700cf3 --- M src/libmsc/db.c 1 file changed, 0 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/52/3652/1 diff --git a/src/libmsc/db.c b/src/libmsc/db.c index 78e022d..3495806 100644 --- a/src/libmsc/db.c +++ b/src/libmsc/db.c @@ -750,7 +750,6 @@ sms->protocol_id = dbi_result_get_ulonglong(result, "protocol_id"); sms->data_coding_scheme = dbi_result_get_ulonglong(result, "data_coding_scheme"); - /* sms->msg_ref is temporary and not stored in DB */ sms->dst.npi = dbi_result_get_ulonglong(result, "dest_npi"); sms->dst.ton = dbi_result_get_ulonglong(result, "dest_ton"); -- To view, visit https://gerrit.osmocom.org/3652 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I204f098c8f2a480405446113e2181b2c53700cf3 Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Thu Aug 24 17:41:08 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 24 Aug 2017 17:41:08 +0000 Subject: [PATCH] osmo-msc[master]: libmsc: use smpp34_tlv_for_each() to avoid suboptimal TLV ha... Message-ID: Review at https://gerrit.osmocom.org/3653 libmsc: use smpp34_tlv_for_each() to avoid suboptimal TLV handling submit_to_sms() now handles two TLVs, so find_tlv() is suboptiomal and it can be removed, since it would result in two passes on the TLV list. Use new smpp34_tlv_for_each() helper to iterate over the list of TLVs that is available since I446929feed049d0411e1629ca263e2bc41f714cc. Change-Id: I53a65164a6cc4abc6bf57d9a8dc275cf21c90222 --- M src/libmsc/smpp_openbsc.c 1 file changed, 41 insertions(+), 31 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/53/3653/1 diff --git a/src/libmsc/smpp_openbsc.c b/src/libmsc/smpp_openbsc.c index 09012d0..1ffb0cd 100644 --- a/src/libmsc/smpp_openbsc.c +++ b/src/libmsc/smpp_openbsc.c @@ -73,26 +73,31 @@ return vsub; } -/*! \brief find a TLV with given tag in list of libsmpp34 TLVs */ -static struct tlv_t *find_tlv(struct tlv_t *head, uint16_t tag) +static int smpp34_submit_tlv_msg_payload(const struct tlv_t *t, + const struct submit_sm_t *submit, + const uint8_t **sms_msg, + unsigned int *sms_msg_len) { - struct tlv_t *t; - - for (t = head; t != NULL; t = t->next) { - if (t->tag == tag) - return t; + if (submit->sm_length) { + LOGP(DLSMS, LOGL_ERROR, + "SMPP cannot have payload in TLV _and_ in the header\n"); + return -1; } - return NULL; + *sms_msg = t->value.octet; + *sms_msg_len = t->length; + + return 0; } /*! \brief convert from submit_sm_t to gsm_sms */ static int submit_to_sms(struct gsm_sms **psms, struct gsm_network *net, const struct submit_sm_t *submit) { + const uint8_t *sms_msg = NULL; struct vlr_subscr *dest; + uint16_t msg_ref = 0; struct gsm_sms *sms; struct tlv_t *t; - const uint8_t *sms_msg; unsigned int sms_msg_len; int mode; @@ -106,31 +111,40 @@ return ESME_RINVDSTADR; } - t = find_tlv(submit->tlv, TLVID_message_payload); - if (t) { - if (submit->sm_length) { - /* ERROR: we cannot have both! */ - LOGP(DLSMS, LOGL_ERROR, "SMPP Cannot have payload in " - "TLV _and_ in the header\n"); - vlr_subscr_put(dest); - return ESME_ROPTPARNOTALLWD; + smpp34_tlv_for_each(t, submit->tlv) { + switch (t->tag) { + case TLVID_message_payload: + if (smpp34_submit_tlv_msg_payload(t, submit, &sms_msg, + &sms_msg_len) < 0) { + vlr_subscr_put(dest); + return ESME_ROPTPARNOTALLWD; + } + break; + case TLVID_user_message_reference: + msg_ref = ntohs(t->value.val16); + break; + default: + break; } - sms_msg = t->value.octet; - sms_msg_len = t->length; - } else if (submit->sm_length > 0 && submit->sm_length < 255) { - sms_msg = submit->short_message; - sms_msg_len = submit->sm_length; - } else { - LOGP(DLSMS, LOGL_ERROR, - "SMPP neither message payload nor valid sm_length.\n"); - vlr_subscr_put(dest); - return ESME_RINVPARLEN; + } + + if (!sms_msg) { + if (submit->sm_length > 0 && submit->sm_length < 255) { + sms_msg = submit->short_message; + sms_msg_len = submit->sm_length; + } else { + LOGP(DLSMS, LOGL_ERROR, + "SMPP neither message payload nor valid sm_length.\n"); + vlr_subscr_put(dest); + return ESME_RINVPARLEN; + } } sms = sms_alloc(); sms->source = SMS_SOURCE_SMPP; sms->smpp.sequence_nr = submit->sequence_number; sms->status_rep_req = submit->registered_delivery; + sms->msg_ref = msg_ref; /* fill in the destination address */ sms->receiver = dest; @@ -204,10 +218,6 @@ memcpy(sms->user_data, sms_msg, sms_msg_len); sms->user_data_len = sms_msg_len; } - - t = find_tlv(submit->tlv, TLVID_user_message_reference); - if (t) - sms->msg_ref = ntohs(t->value.val16); *psms = sms; return ESME_ROK; -- To view, visit https://gerrit.osmocom.org/3653 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I53a65164a6cc4abc6bf57d9a8dc275cf21c90222 Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Pablo Neira Ayuso From gerrit-no-reply at lists.osmocom.org Thu Aug 24 17:41:08 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 24 Aug 2017 17:41:08 +0000 Subject: [PATCH] osmo-msc[master]: libmsc: use new smpp34 esm_class definitions Message-ID: Review at https://gerrit.osmocom.org/3654 libmsc: use new smpp34 esm_class definitions Replace magic numbers by esm_class definitions, which have been added to latest libsmpp34 in Change-Id I91afd8b462b8fd3b2c4c5b54f4eeb7ec5b730b65 Change-Id: I6c458690da60c8f3637680efbd718f6e8c6feb4c --- M src/libmsc/smpp_openbsc.c 1 file changed, 8 insertions(+), 10 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/54/3654/1 diff --git a/src/libmsc/smpp_openbsc.c b/src/libmsc/smpp_openbsc.c index 1ffb0cd..abf3b3c 100644 --- a/src/libmsc/smpp_openbsc.c +++ b/src/libmsc/smpp_openbsc.c @@ -158,14 +158,13 @@ osmo_strlcpy(sms->src.addr, (char *)submit->source_addr, sizeof(sms->src.addr)); - /* This is a Delivery Acknowledgment. */ - if (submit->esm_class == 0x08) + if (submit->esm_class == SMPP34_DELIVERY_ACK) sms->is_report = true; - if (submit->esm_class & 0x40) + if (submit->esm_class & SMPP34_UDHI_IND) sms->ud_hdr_ind = 1; - if (submit->esm_class & 0x80) { + if (submit->esm_class & SMPP34_REPLY_PATH) { sms->reply_path_req = 1; #warning Implement reply path } @@ -241,7 +240,7 @@ sms->smpp.esme = esme; sms->protocol_id = submit->protocol_id; - switch (submit->esm_class & 3) { + switch (submit->esm_class & SMPP34_MSG_MODE_MASK) { case 0: /* default */ case 1: /* datagram */ case 3: /* store-and-forward */ @@ -668,16 +667,15 @@ memcpy(deliver.destination_addr, sms->dst.addr, sizeof(deliver.destination_addr)); - /* Short message contains a delivery receipt? Sect. 5.2.12. */ if (sms->is_report) - deliver.esm_class = 0x04; + deliver.esm_class = SMPP34_DELIVERY_RECEIPT; else - deliver.esm_class = 1; /* datagram mode */ + deliver.esm_class = SMPP34_DATAGRAM_MODE; if (sms->ud_hdr_ind) - deliver.esm_class |= 0x40; + deliver.esm_class |= SMPP34_UDHI_IND; if (sms->reply_path_req) - deliver.esm_class |= 0x80; + deliver.esm_class |= SMPP34_REPLY_PATH; deliver.protocol_id = sms->protocol_id; deliver.priority_flag = 0; -- To view, visit https://gerrit.osmocom.org/3654 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I6c458690da60c8f3637680efbd718f6e8c6feb4c Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Pablo Neira Ayuso From gerrit-no-reply at lists.osmocom.org Thu Aug 24 17:41:08 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 24 Aug 2017 17:41:08 +0000 Subject: [PATCH] osmo-msc[master]: libcommon: Fix log output for bts>0. Message-ID: Review at https://gerrit.osmocom.org/3655 libcommon: Fix log output for bts>0. Fixes regression probably introduced in c696cc28. For bts>0 logging doesn't show bts number correctly when printing lchan identification string - it will always show it as "bts=0". The reason for this is that the identification string is cached before bts->nr value is set to a proper value. This patch sets bts->nr as part of the first step of the bts structure initialization, before caching happens thus making sure the cached identification string is cached with the correct values. Change-Id: I61c18a7f021fcb1ec00d34a745f4e3ab03416c2d --- M include/openbsc/gsm_data_shared.h M src/libcommon/gsm_data.c M src/libcommon/gsm_data_shared.c M tests/channel/channel_test.c M tests/channel/channel_test.ok M tests/gsm0408/gsm0408_test.c 6 files changed, 42 insertions(+), 9 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/55/3655/1 diff --git a/include/openbsc/gsm_data_shared.h b/include/openbsc/gsm_data_shared.h index 0790807..60da2e5 100644 --- a/include/openbsc/gsm_data_shared.h +++ b/include/openbsc/gsm_data_shared.h @@ -899,7 +899,7 @@ }; -struct gsm_bts *gsm_bts_alloc(void *talloc_ctx); +struct gsm_bts *gsm_bts_alloc(void *talloc_ctx, uint8_t bts_num); struct gsm_bts *gsm_bts_num(struct gsm_network *net, int num); struct gsm_bts_trx *gsm_bts_trx_alloc(struct gsm_bts *bts); diff --git a/src/libcommon/gsm_data.c b/src/libcommon/gsm_data.c index b5bf059..7be2240 100644 --- a/src/libcommon/gsm_data.c +++ b/src/libcommon/gsm_data.c @@ -254,12 +254,13 @@ if (!model && type != GSM_BTS_TYPE_UNKNOWN) return NULL; - bts = gsm_bts_alloc(net); + bts = gsm_bts_alloc(net, net->num_bts); if (!bts) return NULL; + net->num_bts++; + bts->network = net; - bts->nr = net->num_bts++; bts->type = type; bts->model = model; bts->bsic = bsic; diff --git a/src/libcommon/gsm_data_shared.c b/src/libcommon/gsm_data_shared.c index 8992636..d792f3b 100644 --- a/src/libcommon/gsm_data_shared.c +++ b/src/libcommon/gsm_data_shared.c @@ -312,7 +312,7 @@ .initial_mcs = 6, }; -struct gsm_bts *gsm_bts_alloc(void *ctx) +struct gsm_bts *gsm_bts_alloc(void *ctx, uint8_t bts_num) { struct gsm_bts *bts = talloc_zero(ctx, struct gsm_bts); int i; @@ -320,6 +320,7 @@ if (!bts) return NULL; + bts->nr = bts_num; bts->num_trx = 0; INIT_LLIST_HEAD(&bts->trx_list); bts->ms_max_power = 15; /* dBm */ diff --git a/tests/channel/channel_test.c b/tests/channel/channel_test.c index f686969..beae658 100644 --- a/tests/channel/channel_test.c +++ b/tests/channel/channel_test.c @@ -31,6 +31,35 @@ #include #include +void test_bts_debug_print(void) +{ + struct gsm_network *network; + struct gsm_bts *bts; + struct gsm_bts_trx *trx; + + printf("Testing the lchan printing:"); + + /* Create a dummy network */ + network = bsc_network_init(tall_bsc_ctx, 1, 1, NULL); + if (!network) + exit(1); + /* Add a BTS with some reasonanbly non-zero id */ + bts = gsm_bts_alloc(network, 45); + /* Add a second TRX to test on multiple TRXs */ + gsm_bts_trx_alloc(bts); + + llist_for_each_entry(trx, &bts->trx_list, list) { + char *name = gsm_lchan_name(&trx->ts[3].lchan[4]); + + if (name) + printf(" %s", name); + else + printf("NULL name"); + } + printf("\n"); +} + + void test_dyn_ts_subslots(void) { struct gsm_bts_trx_ts ts; @@ -66,6 +95,7 @@ osmo_init_logging(&log_info); test_dyn_ts_subslots(); + test_bts_debug_print(); return EXIT_SUCCESS; } diff --git a/tests/channel/channel_test.ok b/tests/channel/channel_test.ok index e4d625a..81d6569 100644 --- a/tests/channel/channel_test.ok +++ b/tests/channel/channel_test.ok @@ -1 +1,2 @@ Testing subslot numbers for pchan types +Testing the lchan printing: (bts=45,trx=0,ts=3,ss=4) (bts=45,trx=1,ts=3,ss=4) diff --git a/tests/gsm0408/gsm0408_test.c b/tests/gsm0408/gsm0408_test.c index 1b326ee..fcdc8f8 100644 --- a/tests/gsm0408/gsm0408_test.c +++ b/tests/gsm0408/gsm0408_test.c @@ -153,7 +153,7 @@ if (!network) exit(1); - bts = gsm_bts_alloc(network); + bts = gsm_bts_alloc(network, 0); _bts_uarfcn_add(bts, 10564, 319, 0); _bts_uarfcn_add(bts, 10612, 319, 0); @@ -168,7 +168,7 @@ if (!network) exit(1); - bts = gsm_bts_alloc(network); + bts = gsm_bts_alloc(network, 0); _bts_uarfcn_add(bts, 10564, 318, 0); _bts_uarfcn_add(bts, 10612, 319, 0); @@ -188,7 +188,7 @@ if (!network) exit(1); - bts = gsm_bts_alloc(network); + bts = gsm_bts_alloc(network, 0); /* first generate invalid SI as no UARFCN added */ gen(bts, __func__); @@ -216,7 +216,7 @@ if (!network) exit(1); - bts = gsm_bts_alloc(network); + bts = gsm_bts_alloc(network, 0); bts->si_common.si2quater_neigh_list.arfcn = bts->si_common.data.earfcn_list; bts->si_common.si2quater_neigh_list.meas_bw = bts->si_common.data.meas_bw_list; @@ -249,7 +249,7 @@ if (!network) exit(1); - bts = gsm_bts_alloc(network); + bts = gsm_bts_alloc(network, 0); bts->si_common.si2quater_neigh_list.arfcn = bts->si_common.data.earfcn_list; bts->si_common.si2quater_neigh_list.meas_bw = bts->si_common.data.meas_bw_list; -- To view, visit https://gerrit.osmocom.org/3655 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I61c18a7f021fcb1ec00d34a745f4e3ab03416c2d Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Alexander Chemeris From gerrit-no-reply at lists.osmocom.org Thu Aug 24 17:41:09 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 24 Aug 2017 17:41:09 +0000 Subject: [PATCH] osmo-msc[master]: mgcp_osmux: Remove unused parameter Message-ID: Review at https://gerrit.osmocom.org/3656 mgcp_osmux: Remove unused parameter Change-Id: Icb1e7cb15fe04642578f5292124ebc1eac9c9aa3 --- M include/openbsc/osmux.h M src/libmgcp/mgcp_osmux.c 2 files changed, 4 insertions(+), 8 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/56/3656/1 diff --git a/include/openbsc/osmux.h b/include/openbsc/osmux.h index 0b64a7f..f3ea72a 100644 --- a/include/openbsc/osmux.h +++ b/include/openbsc/osmux.h @@ -11,8 +11,7 @@ }; int osmux_init(int role, struct mgcp_config *cfg); -int osmux_enable_endpoint(struct mgcp_endpoint *endp, int role, - struct in_addr *addr, uint16_t port); +int osmux_enable_endpoint(struct mgcp_endpoint *endp, struct in_addr *addr, uint16_t port); void osmux_disable_endpoint(struct mgcp_endpoint *endp); void osmux_allocate_cid(struct mgcp_endpoint *endp); void osmux_release_cid(struct mgcp_endpoint *endp); diff --git a/src/libmgcp/mgcp_osmux.c b/src/libmgcp/mgcp_osmux.c index b46a80e..c52984b 100644 --- a/src/libmgcp/mgcp_osmux.c +++ b/src/libmgcp/mgcp_osmux.c @@ -340,8 +340,7 @@ if (endp->osmux.state == OSMUX_STATE_ENABLED) goto out; - if (osmux_enable_endpoint(endp, OSMUX_ROLE_BSC_NAT, - &addr->sin_addr, addr->sin_port) < 0 ){ + if (osmux_enable_endpoint(endp, &addr->sin_addr, addr->sin_port) < 0 ) { LOGP(DMGCP, LOGL_ERROR, "Could not enable osmux in endpoint %d\n", ENDPOINT_NUMBER(endp)); @@ -433,8 +432,7 @@ return 0; } -int osmux_enable_endpoint(struct mgcp_endpoint *endp, int role, - struct in_addr *addr, uint16_t port) +int osmux_enable_endpoint(struct mgcp_endpoint *endp, struct in_addr *addr, uint16_t port) { /* If osmux is enabled, initialize the output handler. This handler is * used to reconstruct the RTP flow from osmux. The RTP SSRC is @@ -522,8 +520,7 @@ return 0; if (endp->osmux.state == OSMUX_STATE_ACTIVATING) { - if (osmux_enable_endpoint(endp, OSMUX_ROLE_BSC, - &endp->net_end.addr, + if (osmux_enable_endpoint(endp, &endp->net_end.addr, htons(endp->cfg->osmux_port)) < 0) { LOGP(DMGCP, LOGL_ERROR, "Could not activate osmux in endpoint %d\n", -- To view, visit https://gerrit.osmocom.org/3656 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Icb1e7cb15fe04642578f5292124ebc1eac9c9aa3 Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Thu Aug 24 17:41:09 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 24 Aug 2017 17:41:09 +0000 Subject: [PATCH] osmo-msc[master]: handover_logic: set correct link to bts for subscriber_conne... Message-ID: Review at https://gerrit.osmocom.org/3657 handover_logic: set correct link to bts for subscriber_connection in case of moving this connection to another bts In case of successful completion of handover gsm_subscriber_connection could be moved from one bts to another, so connection link to bts should be replaced by link to bts, which owns new_lchan. This bug was detected, because conn->bts->nr is used in call control log messages and wrong number of bts was observed in these messages after handover. Change-Id: Idc7dd412b7580c451e716b73ef7549826c60b0d9 --- M src/libbsc/handover_logic.c 1 file changed, 1 insertion(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/57/3657/1 diff --git a/src/libbsc/handover_logic.c b/src/libbsc/handover_logic.c index c03563f..57d1dcd 100644 --- a/src/libbsc/handover_logic.c +++ b/src/libbsc/handover_logic.c @@ -282,6 +282,7 @@ new_lchan->conn->ho_lchan = NULL; new_lchan->conn->lchan = new_lchan; + new_lchan->conn->bts = new_lchan->ts->trx->bts; ho->old_lchan->conn = NULL; lchan_release(ho->old_lchan, 0, RSL_REL_LOCAL_END); -- To view, visit https://gerrit.osmocom.org/3657 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Idc7dd412b7580c451e716b73ef7549826c60b0d9 Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Ivan Kluchnikov From gerrit-no-reply at lists.osmocom.org Thu Aug 24 17:41:09 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 24 Aug 2017 17:41:09 +0000 Subject: [PATCH] osmo-msc[master]: mgcp: Fix uplink activation of Osmux stream Message-ID: Review at https://gerrit.osmocom.org/3658 mgcp: Fix uplink activation of Osmux stream Commit 575420637981828b64c1292ada015d7170b89390 introduced OSMUX_STATE_NEGOTIATING to fix a race condition present in osmo-bsc_nat. However, after this change osmo-bsc_mgcp cannot switch to OSMUX_STATE_ACTIVATING anymore, which means during osmux_send_dummy time it won't call osmux_enable_endpoint(), which in turn won't set endp type to MGCP_OSMUX_BSC. If MGCP_OSMUX_BSC is not set, uplink streams are sent using regular RTP instead of Osmux not matter it is enabled in config or not. Change-Id: Ibcb59aa1ca25408f82cc88c2d5b81177b5f276dc --- M src/libmgcp/mgcp_protocol.c 1 file changed, 4 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/58/3658/1 diff --git a/src/libmgcp/mgcp_protocol.c b/src/libmgcp/mgcp_protocol.c index 78e41f1..96542c5 100644 --- a/src/libmgcp/mgcp_protocol.c +++ b/src/libmgcp/mgcp_protocol.c @@ -277,10 +277,12 @@ if (!addr) addr = mgcp_net_src_addr(endp); - if (endp->osmux.state == OSMUX_STATE_NEGOTIATING) + if (endp->osmux.state == OSMUX_STATE_NEGOTIATING) { sprintf(osmux_extension, "\nX-Osmux: %u", endp->osmux.cid); - else + endp->osmux.state = OSMUX_STATE_ACTIVATING; + } else { osmux_extension[0] = '\0'; + } len = snprintf(sdp_record, sizeof(sdp_record), "I: %u%s\n\n", endp->ci, osmux_extension); -- To view, visit https://gerrit.osmocom.org/3658 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ibcb59aa1ca25408f82cc88c2d5b81177b5f276dc Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Thu Aug 24 17:41:09 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 24 Aug 2017 17:41:09 +0000 Subject: [PATCH] osmo-msc[master]: SGSN: Fix RAN information exposed on GTP during PDP CTX CREATE Message-ID: Review at https://gerrit.osmocom.org/3659 SGSN: Fix RAN information exposed on GTP during PDP CTX CREATE In the PDP Context Create from SGSN to GGSN, we include information about the RAN type (GERAN/UTRAN) and the Cell of the MS. This was all hard-coded to GERAN, and wasn't updated when we added UTRAN support to the SGSN. Change-Id: I6c79e42c5e08b28fe8182555302a5505fbbaa313 --- M src/gprs/sgsn_libgtp.c 1 file changed, 18 insertions(+), 7 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/59/3659/1 diff --git a/src/gprs/sgsn_libgtp.c b/src/gprs/sgsn_libgtp.c index bc2fcd1..7ff8ece 100644 --- a/src/gprs/sgsn_libgtp.c +++ b/src/gprs/sgsn_libgtp.c @@ -251,18 +251,28 @@ memcpy(pdp->gsnlu.v, &sgsn->cfg.gtp_listenaddr.sin_addr, sizeof(sgsn->cfg.gtp_listenaddr.sin_addr)); - /* Routing Area Identifier with LAC and RAC fixed values, as - * requested in 29.006 7.3.1 */ + /* Encode RAT Type according to TS 29.060 7.7.50 */ + pdp->rattype.l = 1; + if (mmctx->ran_type == MM_CTX_T_UTRAN_Iu) + pdp->rattype.v[0] = 1; + else + pdp->rattype.v[0] = 2; + pdp->rattype_given = 1; + + /* Include RAI and ULI all the time */ pdp->rai_given = 1; pdp->rai.l = 6; + + /* Routing Area Identifier with LAC and RAC fixed values, as + * requested in 29.006 7.3.1 */ raid = mmctx->ra; raid.lac = 0xFFFE; raid.rac = 0xFF; gsm48_construct_ra(pdp->rai.v, &raid); - pdp->rattype.l = 1; - pdp->rattype_given = 1; - + /* Encode User Location Information accordint to TS 29.060 7.7.51 */ + pdp->userloc_given = 1; + pdp->userloc.l = 8; switch (mmctx->ran_type) { case MM_CTX_T_GERAN_Gb: case MM_CTX_T_GERAN_Iu: @@ -274,8 +284,9 @@ bssgp_create_cell_id(&pdp->userloc.v[1], &mmctx->ra, mmctx->gb.cell_id); break; case MM_CTX_T_UTRAN_Iu: - pdp->rattype.v[0] = 1; - /* FIXME: Optional User Location Information with SAI */ + pdp->userloc.v[0] = 1; /* SAI for UTRAN */ + /* SAI is like CGI but with SAC instead of CID, so we can abuse this function */ + bssgp_create_cell_id(&pdp->userloc.v[1], &mmctx->ra, mmctx->iu.sac); break; } -- To view, visit https://gerrit.osmocom.org/3659 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I6c79e42c5e08b28fe8182555302a5505fbbaa313 Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Thu Aug 24 17:41:10 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 24 Aug 2017 17:41:10 +0000 Subject: [PATCH] osmo-msc[master]: Fix gsm_pchan2chan_nr() to use RSL_CHAN_OSMO_PDCH Message-ID: Review at https://gerrit.osmocom.org/3660 Fix gsm_pchan2chan_nr() to use RSL_CHAN_OSMO_PDCH When converting from GSM_PCHAN_PDCH, we should generate a RSL channel number IE with the osmocom extension RSL_CHAN_OSMO_PDCH rather than claiming it is a regular TCH/F channel. This is important as this function is used by osmo-bts, too - and it decides which channel number IE is put in the GSMTAP header for both GSMTAP tracing as well as the GSMTAP based osmo-bts-virtual. In order to avoid any unintended effect on libbsc, we make sure to modify rsl_ipacc_pdch_activate() to always use GSM_PCHAN_TCH_F in related RSL message. Change-Id: Ie34219e64a6d89da4a79f2db8ec73d1909fb8280 --- M src/libbsc/abis_rsl.c M src/libcommon/gsm_data_shared.c 2 files changed, 5 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/60/3660/1 diff --git a/src/libbsc/abis_rsl.c b/src/libbsc/abis_rsl.c index 3337b90..4f687a0 100644 --- a/src/libbsc/abis_rsl.c +++ b/src/libbsc/abis_rsl.c @@ -2450,7 +2450,7 @@ dh = (struct abis_rsl_dchan_hdr *) msgb_put(msg, sizeof(*dh)); init_dchan_hdr(dh, msg_type); dh->c.msg_discr = ABIS_RSL_MDISC_DED_CHAN; - dh->chan_nr = gsm_pchan2chan_nr(GSM_PCHAN_PDCH, ts->nr, 0); + dh->chan_nr = gsm_pchan2chan_nr(GSM_PCHAN_TCH_F, ts->nr, 0); DEBUGP(DRSL, "%s IPAC PDCH %sACT\n", gsm_ts_name(ts), act ? "" : "DE"); diff --git a/src/libcommon/gsm_data_shared.c b/src/libcommon/gsm_data_shared.c index d792f3b..2696273 100644 --- a/src/libcommon/gsm_data_shared.c +++ b/src/libcommon/gsm_data_shared.c @@ -644,11 +644,14 @@ switch (pchan) { case GSM_PCHAN_TCH_F: - case GSM_PCHAN_PDCH: case GSM_PCHAN_TCH_F_PDCH: OSMO_ASSERT(lchan_nr == 0); cbits = 0x01; break; + case GSM_PCHAN_PDCH: + OSMO_ASSERT(lchan_nr == 0); + cbits = RSL_CHAN_OSMO_PDCH >> 3; + break; case GSM_PCHAN_TCH_H: OSMO_ASSERT(lchan_nr < 2); cbits = 0x02; -- To view, visit https://gerrit.osmocom.org/3660 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ie34219e64a6d89da4a79f2db8ec73d1909fb8280 Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Thu Aug 24 17:41:10 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 24 Aug 2017 17:41:10 +0000 Subject: [PATCH] osmo-msc[master]: sgsn_vty: Don't assume pdp->lib is always valid Message-ID: Review at https://gerrit.osmocom.org/3661 sgsn_vty: Don't assume pdp->lib is always valid We can only print libgtp pdp information if a library context is attached to this pdp context. This is not always the case, particuarly during some teardown scenarios. Change-Id: Ia3184877f9709db65f5f93a98403f2ef5b04a8ca --- M src/gprs/sgsn_vty.c 1 file changed, 16 insertions(+), 14 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/61/3661/1 diff --git a/src/gprs/sgsn_vty.c b/src/gprs/sgsn_vty.c index 888f53a..cc8d6c3 100644 --- a/src/gprs/sgsn_vty.c +++ b/src/gprs/sgsn_vty.c @@ -468,20 +468,22 @@ const char *imsi = pdp->mm ? pdp->mm->imsi : "(detaching)"; vty_out(vty, "%sPDP Context IMSI: %s, SAPI: %u, NSAPI: %u, TI: %u%s", pfx, imsi, pdp->sapi, pdp->nsapi, pdp->ti, VTY_NEWLINE); - vty_out(vty, "%s APN: %s%s", pfx, - gprs_apn2str(pdp->lib->apn_use.v, pdp->lib->apn_use.l), - VTY_NEWLINE); - vty_out(vty, "%s PDP Address: %s%s", pfx, - gprs_pdpaddr2str(pdp->lib->eua.v, pdp->lib->eua.l), - VTY_NEWLINE); - vty_out(vty, "%s GTP Local Control(%s / TEIC: 0x%08x) ", pfx, - gtp_ntoa(&pdp->lib->gsnlc), pdp->lib->teic_own); - vty_out(vty, "Data(%s / TEID: 0x%08x)%s", - gtp_ntoa(&pdp->lib->gsnlu), pdp->lib->teid_own, VTY_NEWLINE); - vty_out(vty, "%s GTP Remote Control(%s / TEIC: 0x%08x) ", pfx, - gtp_ntoa(&pdp->lib->gsnrc), pdp->lib->teic_gn); - vty_out(vty, "Data(%s / TEID: 0x%08x)%s", - gtp_ntoa(&pdp->lib->gsnru), pdp->lib->teid_gn, VTY_NEWLINE); + if (pdp->lib) { + vty_out(vty, "%s APN: %s%s", pfx, + gprs_apn2str(pdp->lib->apn_use.v, pdp->lib->apn_use.l), + VTY_NEWLINE); + vty_out(vty, "%s PDP Address: %s%s", pfx, + gprs_pdpaddr2str(pdp->lib->eua.v, pdp->lib->eua.l), + VTY_NEWLINE); + vty_out(vty, "%s GTP Local Control(%s / TEIC: 0x%08x) ", pfx, + gtp_ntoa(&pdp->lib->gsnlc), pdp->lib->teic_own); + vty_out(vty, "Data(%s / TEID: 0x%08x)%s", + gtp_ntoa(&pdp->lib->gsnlu), pdp->lib->teid_own, VTY_NEWLINE); + vty_out(vty, "%s GTP Remote Control(%s / TEIC: 0x%08x) ", pfx, + gtp_ntoa(&pdp->lib->gsnrc), pdp->lib->teic_gn); + vty_out(vty, "Data(%s / TEID: 0x%08x)%s", + gtp_ntoa(&pdp->lib->gsnru), pdp->lib->teid_gn, VTY_NEWLINE); + } vty_out_rate_ctr_group(vty, " ", pdp->ctrg); } -- To view, visit https://gerrit.osmocom.org/3661 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ia3184877f9709db65f5f93a98403f2ef5b04a8ca Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Thu Aug 24 17:41:10 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 24 Aug 2017 17:41:10 +0000 Subject: [PATCH] osmo-msc[master]: Migrate from gprs_apn_to_str() to libosmocore osmo_apn_to_str() Message-ID: Review at https://gerrit.osmocom.org/3662 Migrate from gprs_apn_to_str() to libosmocore osmo_apn_to_str() In 2015, Jacob moved/copied related functions to libosmocore, but for some reason didn't remove the copies here. Let's follow-up on that and remove duplicated code. The libosmocore commit introducing osmo_apn_to_str() was 8114294bf29ac6e44822c0ae43d4b0819f11b022 Change-Id: I7315ffcbed8a54cca2056f313bb7783ad82d0ee9 --- M include/openbsc/gprs_utils.h M src/gprs/gb_proxy_patch.c M src/gprs/gb_proxy_vty.c M src/gprs/gprs_sgsn.c M src/gprs/gprs_subscriber.c M src/gprs/gprs_utils.c M src/gprs/gtphub.c M src/gprs/sgsn_cdr.c M src/gprs/sgsn_vty.c M tests/gprs/gprs_test.c M tests/gtphub/Makefile.am 11 files changed, 19 insertions(+), 148 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/62/3662/1 diff --git a/include/openbsc/gprs_utils.h b/include/openbsc/gprs_utils.h index 603605c..574f5c5 100644 --- a/include/openbsc/gprs_utils.h +++ b/include/openbsc/gprs_utils.h @@ -30,7 +30,6 @@ struct msgb *gprs_msgb_copy(const struct msgb *msg, const char *name); int gprs_msgb_resize_area(struct msgb *msg, uint8_t *area, size_t old_size, size_t new_size); -char *gprs_apn_to_str(char *out_str, const uint8_t *apn_enc, size_t rest_chars); int gprs_str_to_apn(uint8_t *apn_enc, size_t max_len, const char *str); /* GSM 04.08, 10.5.7.3 GPRS Timer */ diff --git a/src/gprs/gb_proxy_patch.c b/src/gprs/gb_proxy_patch.c index 7bddc44..210fb2b 100644 --- a/src/gprs/gb_proxy_patch.c +++ b/src/gprs/gb_proxy_patch.c @@ -28,6 +28,7 @@ #include #include +#include /* patch RA identifier in place */ static void gbproxy_patch_raid(uint8_t *raid_enc, struct gbproxy_peer *peer, @@ -101,7 +102,7 @@ LOGP(DGPRS, LOGL_DEBUG, "Patching %s to SGSN: Removing APN '%s'\n", log_text, - gprs_apn_to_str(str1, apn, apn_len)); + osmo_apn_to_str(str1, apn, apn_len)); *new_apn_ie_len = 0; gprs_msgb_resize_area(msg, apn_ie, apn_ie_len, 0); @@ -116,8 +117,8 @@ "Patching %s to SGSN: " "Replacing APN '%s' -> '%s'\n", log_text, - gprs_apn_to_str(str1, apn, apn_len), - gprs_apn_to_str(str2, peer->cfg->core_apn, + osmo_apn_to_str(str1, apn, apn_len), + osmo_apn_to_str(str2, peer->cfg->core_apn, peer->cfg->core_apn_size)); *new_apn_ie_len = peer->cfg->core_apn_size + 2; diff --git a/src/gprs/gb_proxy_vty.c b/src/gprs/gb_proxy_vty.c index 933b6b0..86d65a8 100644 --- a/src/gprs/gb_proxy_vty.c +++ b/src/gprs/gb_proxy_vty.c @@ -29,6 +29,7 @@ #include #include +#include #include #include @@ -107,7 +108,7 @@ if (g_cfg->core_apn_size > 0) { char str[500] = {0}; vty_out(vty, " core-access-point-name %s%s", - gprs_apn_to_str(str, g_cfg->core_apn, + osmo_apn_to_str(str, g_cfg->core_apn, g_cfg->core_apn_size), VTY_NEWLINE); } else { diff --git a/src/gprs/gprs_sgsn.c b/src/gprs/gprs_sgsn.c index 93b133f..43eeaaa 100644 --- a/src/gprs/gprs_sgsn.c +++ b/src/gprs/gprs_sgsn.c @@ -30,6 +30,7 @@ #include #include #include +#include #include #include @@ -758,7 +759,7 @@ return NULL; } - gprs_apn_to_str(req_apn_str, + osmo_apn_to_str(req_apn_str, TLVP_VAL(tp, GSM48_IE_GSM_APN), TLVP_LEN(tp, GSM48_IE_GSM_APN)); diff --git a/src/gprs/gprs_subscriber.c b/src/gprs/gprs_subscriber.c index aa03509..94297d0 100644 --- a/src/gprs/gprs_subscriber.c +++ b/src/gprs/gprs_subscriber.c @@ -22,6 +22,7 @@ #include #include +#include #include #include #include @@ -371,7 +372,7 @@ OSMO_ASSERT(pdp_data != NULL); pdp_data->pdp_type = pdp_info->pdp_type; - gprs_apn_to_str(pdp_data->apn_str, + osmo_apn_to_str(pdp_data->apn_str, pdp_info->apn_enc, pdp_info->apn_enc_len); memcpy(pdp_data->qos_subscribed, pdp_info->qos_enc, pdp_info->qos_enc_len); pdp_data->qos_subscribed_len = pdp_info->qos_enc_len; diff --git a/src/gprs/gprs_utils.c b/src/gprs/gprs_utils.c index 64ed978..91a09d2 100644 --- a/src/gprs/gprs_utils.c +++ b/src/gprs/gprs_utils.c @@ -114,34 +114,6 @@ return 0; } -/* TODO: Move these conversion functions to a utils file. */ -/* TODO: consolidate with gprs_apn2str(). */ -/** memmove apn_enc to out_str, replacing the length octets in apn_enc with '.' - * (omitting the first one) and terminating with a '\0'. - * out_str needs to have rest_chars amount of bytes or 1 whatever is bigger. - */ -char * gprs_apn_to_str(char *out_str, const uint8_t *apn_enc, size_t rest_chars) -{ - char *str = out_str; - - while (rest_chars > 0 && apn_enc[0]) { - size_t label_size = apn_enc[0]; - if (label_size + 1 > rest_chars) - return NULL; - - memmove(str, apn_enc + 1, label_size); - str += label_size; - rest_chars -= label_size + 1; - apn_enc += label_size + 1; - - if (rest_chars) - *(str++) = '.'; - } - str[0] = '\0'; - - return out_str; -} - int gprs_str_to_apn(uint8_t *apn_enc, size_t max_len, const char *str) { uint8_t *last_len_field; diff --git a/src/gprs/gtphub.c b/src/gprs/gtphub.c index 5e7520e..0a8e375 100644 --- a/src/gprs/gtphub.c +++ b/src/gprs/gtphub.c @@ -42,6 +42,8 @@ #include #include +#include + static const int GTPH_GC_TICK_SECONDS = 1; @@ -498,7 +500,7 @@ len = sizeof(apn_buf) - 1; apn_buf[len] = '\0'; - *apn_str = gprs_apn_to_str(apn_buf, (uint8_t*)apn_buf, len); + *apn_str = osmo_apn_to_str(apn_buf, (uint8_t*)apn_buf, len); if (!(*apn_str)) { LOG(LOGL_ERROR, "APN IE: present but cannot be decoded: %s\n", osmo_hexdump((uint8_t*)apn_buf, len)); diff --git a/src/gprs/sgsn_cdr.c b/src/gprs/sgsn_cdr.c index 0910896..16ea9d4 100644 --- a/src/gprs/sgsn_cdr.c +++ b/src/gprs/sgsn_cdr.c @@ -22,6 +22,7 @@ #include #include #include +#include #include @@ -145,7 +146,7 @@ if (pdp->lib) { - gprs_apn_to_str(apni, pdp->lib->apn_use.v, pdp->lib->apn_use.l); + osmo_apn_to_str(apni, pdp->lib->apn_use.v, pdp->lib->apn_use.l); inet_ntop(AF_INET, &pdp->lib->hisaddr0.s_addr, ggsn_addr, sizeof(ggsn_addr)); extract_eua(&pdp->lib->eua, eua_addr); } diff --git a/src/gprs/sgsn_vty.c b/src/gprs/sgsn_vty.c index cc8d6c3..cf44cc4 100644 --- a/src/gprs/sgsn_vty.c +++ b/src/gprs/sgsn_vty.c @@ -28,6 +28,7 @@ #include #include #include +#include #include #include @@ -116,7 +117,6 @@ #define GSM48_MAX_APN_LEN 102 /* 10.5.6.1 */ -/* TODO: consolidate with gprs_apn_to_str(). */ /** Copy apn to a static buffer, replacing the length octets in apn_enc with '.' * and terminating with a '\0'. Return the static buffer. * len: the length of the encoded APN (which has no terminating zero). @@ -124,23 +124,10 @@ static char *gprs_apn2str(uint8_t *apn, unsigned int len) { static char apnbuf[GSM48_MAX_APN_LEN+1]; - unsigned int i = 0; if (!apn) return ""; - - if (len > sizeof(apnbuf)-1) - len = sizeof(apnbuf)-1; - - memcpy(apnbuf, apn, len); - apnbuf[len] = '\0'; - - /* replace the domain name step sizes with dots */ - while (i < len) { - unsigned int step = apnbuf[i]; - apnbuf[i] = '.'; - i += step+1; - } + osmo_apn_to_str(apnbuf, apn, len); return apnbuf+1; } diff --git a/tests/gprs/gprs_test.c b/tests/gprs/gprs_test.c index ff77404..aac9bb8 100644 --- a/tests/gprs/gprs_test.c +++ b/tests/gprs/gprs_test.c @@ -48,101 +48,6 @@ ASSERT_FALSE(nu_is_retransmission(479, 511)); // wrapped } -static void apn_round_trip(const uint8_t *input, size_t len, const char *wanted_output) -{ - char output[len ? len : 1]; - uint8_t encoded[len + 50]; - char *out_str; - int enc_len; - - /* decode and verify we have what we want */ - out_str = gprs_apn_to_str(output, input, len); - OSMO_ASSERT(out_str); - OSMO_ASSERT(out_str == &output[0]); - OSMO_ASSERT(strlen(out_str) == strlen(wanted_output)); - OSMO_ASSERT(strcmp(out_str, wanted_output) == 0); - - /* encode and verify it */ - if (len != 0) { - enc_len = gprs_str_to_apn(encoded, ARRAY_SIZE(encoded), wanted_output); - OSMO_ASSERT(enc_len == len); - OSMO_ASSERT(memcmp(encoded, input, enc_len) == 0); - } else { - enc_len = gprs_str_to_apn(encoded, 0, wanted_output); - OSMO_ASSERT(enc_len == -1); - } -} - -static void test_gsm_03_03_apn(void) -{ - - { - /* test invalid writes */ - const uint8_t ref[10] = { 0xAB, 0xAC, 0xAD, 0xAE, 0xAF, 0xAB, 0xAC, 0xAD, 0xAE, 0xAF }; - uint8_t output[10]; - int enc_len; - - memcpy(output, ref, ARRAY_SIZE(output)); - enc_len = gprs_str_to_apn(output, 0, ""); - OSMO_ASSERT(enc_len == -1); - OSMO_ASSERT(memcmp(ref, output, ARRAY_SIZE(ref)) == 0); - - memcpy(output, ref, ARRAY_SIZE(output)); - enc_len = gprs_str_to_apn(output, 0, "foo"); - OSMO_ASSERT(enc_len == -1); - OSMO_ASSERT(memcmp(ref, output, ARRAY_SIZE(ref)) == 0); - - memcpy(output, ref, ARRAY_SIZE(output)); - enc_len = gprs_str_to_apn(output, 1, "foo"); - OSMO_ASSERT(enc_len == -1); - OSMO_ASSERT(memcmp(ref + 1, output + 1, ARRAY_SIZE(ref) - 1) == 0); - - memcpy(output, ref, ARRAY_SIZE(output)); - enc_len = gprs_str_to_apn(output, 2, "foo"); - OSMO_ASSERT(enc_len == -1); - OSMO_ASSERT(memcmp(ref + 2, output + 2, ARRAY_SIZE(ref) - 2) == 0); - - memcpy(output, ref, ARRAY_SIZE(output)); - enc_len = gprs_str_to_apn(output, 3, "foo"); - OSMO_ASSERT(enc_len == -1); - OSMO_ASSERT(memcmp(ref + 3, output + 3, ARRAY_SIZE(ref) - 3) == 0); - } - - { - /* single empty label */ - uint8_t input[] = { 0x0 }; - const char *output = ""; - apn_round_trip(input, ARRAY_SIZE(input), output); - } - - { - /* no label */ - uint8_t input[] = { }; - const char *output = ""; - apn_round_trip(input, ARRAY_SIZE(input), output); - } - - { - /* single label with A */ - uint8_t input[] = { 0x1, 65 }; - const char *output = "A"; - apn_round_trip(input, ARRAY_SIZE(input), output); - OSMO_ASSERT(gprs_apn_to_str(NULL, input, ARRAY_SIZE(input) - 1) == NULL); - } - - { - uint8_t input[] = { 0x3, 65, 66, 67, 0x2, 90, 122 }; - const char *output = "ABC.Zz"; - char tmp[strlen(output) + 1]; - apn_round_trip(input, ARRAY_SIZE(input), output); - OSMO_ASSERT(gprs_apn_to_str(tmp, input, ARRAY_SIZE(input) - 1) == NULL); - OSMO_ASSERT(gprs_apn_to_str(tmp, input, ARRAY_SIZE(input) - 2) == NULL); - OSMO_ASSERT(gprs_apn_to_str(tmp, input, ARRAY_SIZE(input) - 4) == NULL); - OSMO_ASSERT(gprs_apn_to_str(tmp, input, ARRAY_SIZE(input) - 5) == NULL); - OSMO_ASSERT(gprs_apn_to_str(tmp, input, ARRAY_SIZE(input) - 6) == NULL); - } -} - static void test_gprs_timer_enc_dec(void) { int i, u, secs, tmr; @@ -228,7 +133,6 @@ osmo_init_logging(&info); test_8_4_2(); - test_gsm_03_03_apn(); test_gprs_timer_enc_dec(); printf("Done.\n"); diff --git a/tests/gtphub/Makefile.am b/tests/gtphub/Makefile.am index 5c834b7..f2a6b88 100644 --- a/tests/gtphub/Makefile.am +++ b/tests/gtphub/Makefile.am @@ -8,6 +8,7 @@ -ggdb3 \ $(LIBOSMOCORE_CFLAGS) \ $(LIBOSMOABIS_CFLAGS) \ + $(LIBOSMOGSM_CFLAGS) \ $(LIBGTP_CFLAGS) \ $(NULL) @@ -37,6 +38,7 @@ $(top_builddir)/src/gprs/gtphub.o \ $(top_builddir)/src/gprs/gprs_utils.o \ $(LIBOSMOCORE_LIBS) \ + $(LIBOSMOGSM_LIBS) \ $(LIBGTP_LIBS) \ -lrt \ $(NULL) -- To view, visit https://gerrit.osmocom.org/3662 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I7315ffcbed8a54cca2056f313bb7783ad82d0ee9 Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Thu Aug 24 17:41:10 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 24 Aug 2017 17:41:10 +0000 Subject: [PATCH] osmo-msc[master]: increase libsmpp34 version requirement to 1.12 Message-ID: Review at https://gerrit.osmocom.org/3663 increase libsmpp34 version requirement to 1.12 Only 1.12 contains some of the #defines that we're using with recent commits. Change-Id: I3743b10a1a5d2f1d42a61204273c1d00dc22b600 --- M configure.ac 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/63/3663/1 diff --git a/configure.ac b/configure.ac index f184e78..871f7e5 100644 --- a/configure.ac +++ b/configure.ac @@ -66,7 +66,7 @@ AC_ARG_ENABLE([smpp], [AS_HELP_STRING([--enable-smpp], [Build the SMPP interface])], [osmo_ac_build_smpp="$enableval"],[osmo_ac_build_smpp="no"]) if test "$osmo_ac_build_smpp" = "yes" ; then - PKG_CHECK_MODULES(LIBSMPP34, libsmpp34 >= 1.10) + PKG_CHECK_MODULES(LIBSMPP34, libsmpp34 >= 1.12) AC_DEFINE(BUILD_SMPP, 1, [Define if we want to build SMPP]) fi AM_CONDITIONAL(BUILD_SMPP, test "x$osmo_ac_build_smpp" = "xyes") -- To view, visit https://gerrit.osmocom.org/3663 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I3743b10a1a5d2f1d42a61204273c1d00dc22b600 Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Thu Aug 24 17:41:11 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 24 Aug 2017 17:41:11 +0000 Subject: [PATCH] osmo-msc[master]: libmsc: use SMPP34_DELIVERY_RECEIPT_* in libsmpp34 Message-ID: Review at https://gerrit.osmocom.org/3664 libmsc: use SMPP34_DELIVERY_RECEIPT_* in libsmpp34 Use new definitions in libsmpp34 to set the registered_delivery field accordingly, as provided by I5b3afff1b3b77cccd949e0606914c7ac3ba6114c. Moreover, do not set this header field to zero if status reports are off, the deliver_t structure has been already zeroed so this not required. Change-Id: Ie78e17323796120f576b9c0e1bc5ccc32da8ee12 --- M src/libmsc/smpp_openbsc.c 1 file changed, 1 insertion(+), 7 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/64/3664/1 diff --git a/src/libmsc/smpp_openbsc.c b/src/libmsc/smpp_openbsc.c index abf3b3c..c2f2f3b 100644 --- a/src/libmsc/smpp_openbsc.c +++ b/src/libmsc/smpp_openbsc.c @@ -631,10 +631,6 @@ return NULL; } -/* See SMPP 3.4, Section 5.2.17. registered_delivery (1 byte field). */ -#define SMPP34_NO_DELIVERY_RECEIPT 0x0 -#define SMPP34_DELIVERY_RECEIPT_REQ 0x1 - static int deliver_to_esme(struct osmo_esme *esme, struct gsm_sms *sms, struct gsm_subscriber_connection *conn) { @@ -680,9 +676,7 @@ deliver.protocol_id = sms->protocol_id; deliver.priority_flag = 0; if (sms->status_rep_req) - deliver.registered_delivery = SMPP34_DELIVERY_RECEIPT_REQ; - else - deliver.registered_delivery = SMPP34_NO_DELIVERY_RECEIPT; + deliver.registered_delivery = SMPP34_DELIVERY_RECEIPT_ON; /* Figure out SMPP DCS from TP-DCS */ dcs = sms->data_coding_scheme; -- To view, visit https://gerrit.osmocom.org/3664 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ie78e17323796120f576b9c0e1bc5ccc32da8ee12 Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Pablo Neira Ayuso From gerrit-no-reply at lists.osmocom.org Thu Aug 24 17:41:11 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 24 Aug 2017 17:41:11 +0000 Subject: [PATCH] osmo-msc[master]: LIBMSC: Place correct dst address in status report Message-ID: Review at https://gerrit.osmocom.org/3665 LIBMSC: Place correct dst address in status report gsm_04_11.c: gsm340_gen_sms_status_report_tpdu() When we construct the status report PDU, use sms->src instead of sms->dst as the destination address This way we tell the MS that the message was delivered to the destination and not to itself. This is relevant for phones that display a textual representation of the delivery report. Change-Id: I2d4f87ac777465de9bfb5a775a789a2691755ee9 --- M src/libmsc/gsm_04_11.c 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/65/3665/1 diff --git a/src/libmsc/gsm_04_11.c b/src/libmsc/gsm_04_11.c index eede74c..f87acea 100644 --- a/src/libmsc/gsm_04_11.c +++ b/src/libmsc/gsm_04_11.c @@ -303,7 +303,7 @@ *smsp = sms->msg_ref; /* generate recipient address */ - oa_len = gsm340_gen_oa_sub(oa, sizeof(oa), &sms->dst); + oa_len = gsm340_gen_oa_sub(oa, sizeof(oa), &sms->src); if (oa_len < 0) return -ENOSPC; -- To view, visit https://gerrit.osmocom.org/3665 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I2d4f87ac777465de9bfb5a775a789a2691755ee9 Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Keith Whyte From gerrit-no-reply at lists.osmocom.org Thu Aug 24 17:41:11 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 24 Aug 2017 17:41:11 +0000 Subject: [PATCH] osmo-msc[master]: LIBMSC: Use sms->text, not sms->user_data to construct repor... Message-ID: Review at https://gerrit.osmocom.org/3666 LIBMSC: Use sms->text, not sms->user_data to construct report body gsm_04_11.c sms_report_alloc() Use the sms->text, not the sms->user_data to construct the report body. This also prevents the potential output of non printable characters to the log and or vty. Change-Id: Id51bc9483ad6f52d6da74135605cfd12434c7c96 --- M src/libmsc/gsm_04_11.c 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/66/3666/1 diff --git a/src/libmsc/gsm_04_11.c b/src/libmsc/gsm_04_11.c index f87acea..55642aa 100644 --- a/src/libmsc/gsm_04_11.c +++ b/src/libmsc/gsm_04_11.c @@ -667,7 +667,7 @@ len = snprintf((char *)sms_report->user_data, sizeof(sms_report->user_data), "id:%.08llu sub:000 dlvrd:000 submit date:YYMMDDhhmm done date:YYMMDDhhmm stat:DELIVRD err:000 text:%.20s", - sms->id, sms->user_data); + sms->id, sms->text); sms_report->user_data_len = len; LOGP(DLSMS, LOGL_NOTICE, "%s\n", sms_report->user_data); -- To view, visit https://gerrit.osmocom.org/3666 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Id51bc9483ad6f52d6da74135605cfd12434c7c96 Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Keith Whyte From gerrit-no-reply at lists.osmocom.org Thu Aug 24 17:41:11 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 24 Aug 2017 17:41:11 +0000 Subject: [PATCH] osmo-msc[master]: sgsn_test: Fix wrong definition of wrap func Message-ID: Review at https://gerrit.osmocom.org/3667 sgsn_test: Fix wrong definition of wrap func Commit 058cd573d8 added 2 new pointer parameters to gprs_subscr_request_auth_info, but forgot to update wraps of the function in sgsn_test. I catched this today because openbsc build test sgsn_test was failing. Closed look up to the logs showed: Assert failed (auts != NULL) == (auts_rand != NULL) openbsc/openbsc/src/gprs/gprs_subscriber.c:791 Change-Id: Ie9e4af6da0339536fb20ca0b7bbcf6f485bd522c --- M tests/sgsn/sgsn_test.c 1 file changed, 5 insertions(+), 5 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/67/3667/1 diff --git a/tests/sgsn/sgsn_test.c b/tests/sgsn/sgsn_test.c index 2f1513a..d66c5dd 100644 --- a/tests/sgsn/sgsn_test.c +++ b/tests/sgsn/sgsn_test.c @@ -139,12 +139,12 @@ }; /* override, requires '-Wl,--wrap=gprs_subscr_request_auth_info' */ -int __real_gprs_subscr_request_auth_info(struct sgsn_mm_ctx *mmctx); -int (*subscr_request_auth_info_cb)(struct sgsn_mm_ctx *mmctx) = +int __real_gprs_subscr_request_auth_info(struct sgsn_mm_ctx *mmctx, const uint8_t *auts, const uint8_t *auts_rand); +int (*subscr_request_auth_info_cb)(struct sgsn_mm_ctx *mmctx, const uint8_t *auts, const uint8_t *auts_rand) = &__real_gprs_subscr_request_auth_info; -int __wrap_gprs_subscr_request_auth_info(struct sgsn_mm_ctx *mmctx) { - return (*subscr_request_auth_info_cb)(mmctx); +int __wrap_gprs_subscr_request_auth_info(struct sgsn_mm_ctx *mmctx, const uint8_t *auts, const uint8_t *auts_rand) { + return (*subscr_request_auth_info_cb)(mmctx, auts, auts_rand); }; /* override, requires '-Wl,--wrap=gsup_client_send' */ @@ -1160,7 +1160,7 @@ cleanup_test(); } -int my_subscr_request_auth_info_real_auth(struct sgsn_mm_ctx *mmctx) +int my_subscr_request_auth_info_real_auth(struct sgsn_mm_ctx *mmctx, const uint8_t *auts, const uint8_t *auts_rand) { struct gsm_auth_tuple at = { .vec.sres = {0x51, 0xe5, 0x51, 0xe5}, -- To view, visit https://gerrit.osmocom.org/3667 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ie9e4af6da0339536fb20ca0b7bbcf6f485bd522c Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Thu Aug 24 17:41:12 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 24 Aug 2017 17:41:12 +0000 Subject: [PATCH] osmo-msc[master]: smpp: Fix compilation warning Message-ID: Review at https://gerrit.osmocom.org/3668 smpp: Fix compilation warning I already stumbled into 2 compilation environments which had Werror enabled for -Wmaybe-uninitialized and the build failed, so let's workaround this warning. | smpp_openbsc.c: In function 'handle_smpp_submit': | smpp_openbsc.c:216:9: error: 'sms_msg_len' may be used uninitialized in this function [-Werror=maybe-uninitialized] | memcpy(sms->user_data, sms_msg, sms_msg_len); | ^ | smpp_openbsc.c:100:15: note: 'sms_msg_len' was declared here | unsigned int sms_msg_len; | ^ | cc1: some warnings being treated as errors Change-Id: I0901ddadb5f72e1585cb1797ac22c8ab95e83146 --- M src/libmsc/smpp_openbsc.c 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/68/3668/1 diff --git a/src/libmsc/smpp_openbsc.c b/src/libmsc/smpp_openbsc.c index c2f2f3b..ec14898 100644 --- a/src/libmsc/smpp_openbsc.c +++ b/src/libmsc/smpp_openbsc.c @@ -94,11 +94,11 @@ const struct submit_sm_t *submit) { const uint8_t *sms_msg = NULL; + unsigned int sms_msg_len = 0; struct vlr_subscr *dest; uint16_t msg_ref = 0; struct gsm_sms *sms; struct tlv_t *t; - unsigned int sms_msg_len; int mode; dest = subscr_by_dst(net, submit->dest_addr_npi, -- To view, visit https://gerrit.osmocom.org/3668 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I0901ddadb5f72e1585cb1797ac22c8ab95e83146 Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Thu Aug 24 17:41:12 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 24 Aug 2017 17:41:12 +0000 Subject: [PATCH] osmo-msc[master]: libmsc: Fix wrong handling of user_message_reference parameter Message-ID: Review at https://gerrit.osmocom.org/3669 libmsc: Fix wrong handling of user_message_reference parameter libsmpp34 already converts received TLV integer values to native endianess in libsmpp34_(un)pack. Converting them again at receive time swaps the 2 bytes of user_message_reference, then using a wrong value. As GSM03.40 spec uses only 1 byte for the id, then only the high byte of the initial value is used and eventually sent back to the ESME. Again, at that time, htons() is not needed because libsmpp34 already handles that part. See OS-#2429 for more details. Change-Id: If748548a4a223e529a1110c89e483b599b406e8b --- M src/libmsc/smpp_openbsc.c 1 file changed, 2 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/69/3669/1 diff --git a/src/libmsc/smpp_openbsc.c b/src/libmsc/smpp_openbsc.c index ec14898..431cb4d 100644 --- a/src/libmsc/smpp_openbsc.c +++ b/src/libmsc/smpp_openbsc.c @@ -121,7 +121,7 @@ } break; case TLVID_user_message_reference: - msg_ref = ntohs(t->value.val16); + msg_ref = t->value.val16; break; default: break; @@ -437,7 +437,7 @@ memset(&tlv, 0, sizeof(tlv)); tlv.tag = tag; tlv.length = 2; - tlv.value.val16 = htons(val); + tlv.value.val16 = val; build_tlv(req_tlv, &tlv); } -- To view, visit https://gerrit.osmocom.org/3669 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: If748548a4a223e529a1110c89e483b599b406e8b Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Thu Aug 24 17:41:12 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 24 Aug 2017 17:41:12 +0000 Subject: [PATCH] osmo-msc[master]: gbproxy: log unhandled BSSGP PDU as text Message-ID: Review at https://gerrit.osmocom.org/3670 gbproxy: log unhandled BSSGP PDU as text Change-Id: Ibe3c8bd353b3a178e26b0936f25b2e1959f9990c --- M src/gprs/gb_proxy.c 1 file changed, 1 insertion(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/70/3670/1 diff --git a/src/gprs/gb_proxy.c b/src/gprs/gb_proxy.c index 3603e14..b98a9a5 100644 --- a/src/gprs/gb_proxy.c +++ b/src/gprs/gb_proxy.c @@ -1266,8 +1266,7 @@ rc = bssgp_tx_status(BSSGP_CAUSE_PDU_INCOMP_FEAT, NULL, orig_msg); break; default: - LOGP(DGPRS, LOGL_NOTICE, "BSSGP PDU type 0x%02x unknown\n", - pdu_type); + LOGP(DGPRS, LOGL_NOTICE, "BSSGP PDU type %s not supported\n", bssgp_pdu_str(pdu_type)); rate_ctr_inc(&cfg->ctrg-> ctr[GBPROX_GLOB_CTR_PROTO_ERR_SGSN]); rc = bssgp_tx_status(BSSGP_CAUSE_PROTO_ERR_UNSPEC, NULL, orig_msg); -- To view, visit https://gerrit.osmocom.org/3670 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ibe3c8bd353b3a178e26b0936f25b2e1959f9990c Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Max From gerrit-no-reply at lists.osmocom.org Thu Aug 24 17:41:13 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 24 Aug 2017 17:41:13 +0000 Subject: [PATCH] osmo-msc[master]: gbproxy: log signal value as text Message-ID: Review at https://gerrit.osmocom.org/3671 gbproxy: log signal value as text Change-Id: I6ed923f5c60a8d64305f4b8e90d1362d6510e1c5 --- M src/gprs/gb_proxy.c 1 file changed, 4 insertions(+), 6 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/71/3671/1 diff --git a/src/gprs/gb_proxy.c b/src/gprs/gb_proxy.c index b98a9a5..cd38d23 100644 --- a/src/gprs/gb_proxy.c +++ b/src/gprs/gb_proxy.c @@ -1369,9 +1369,8 @@ /* from BSS to SGSN */ peer = gbproxy_peer_by_nsei(cfg, nsvc->nsei); if (!peer) { - LOGP(DGPRS, LOGL_NOTICE, "signal %u for unknown peer " - "NSEI=%u/NSVCI=%u\n", signal, nsvc->nsei, - nsvc->nsvci); + LOGP(DGPRS, LOGL_NOTICE, "signal '%s' for unknown peer NSEI=%u/NSVCI=%u\n", + get_value_string(gprs_ns_signal_ns_names, signal), nsvc->nsei, nsvc->nsvci); return 0; } switch (signal) { @@ -1379,9 +1378,8 @@ case S_NS_BLOCK: if (!peer->blocked) break; - LOGP(DGPRS, LOGL_NOTICE, "Converting NS_RESET from " - "NSEI=%u/NSVCI=%u into BSSGP_BVC_BLOCK to SGSN\n", - nsvc->nsei, nsvc->nsvci); + LOGP(DGPRS, LOGL_NOTICE, "Converting '%s' from NSEI=%u/NSVCI=%u into BSSGP_BVC_BLOCK to SGSN\n", + get_value_string(gprs_ns_signal_ns_names, signal), nsvc->nsei, nsvc->nsvci); bssgp_tx_simple_bvci(BSSGP_PDUT_BVC_BLOCK, nsvc->nsei, peer->bvci, 0); break; -- To view, visit https://gerrit.osmocom.org/3671 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I6ed923f5c60a8d64305f4b8e90d1362d6510e1c5 Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Max From gerrit-no-reply at lists.osmocom.org Thu Aug 24 17:41:13 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 24 Aug 2017 17:41:13 +0000 Subject: [PATCH] osmo-msc[master]: libmsc: Use actual delivery time in delivery reports. Message-ID: Review at https://gerrit.osmocom.org/3672 libmsc: Use actual delivery time in delivery reports. Set the time on the status report to the time the message was delivered, as this may not be the same as the time when we are delivering the report to the originating MS. Change-Id: I9056429d40bf02731f004b7833f1de45a0d1add8 --- M include/openbsc/gsm_data.h M src/libmsc/db.c M src/libmsc/gsm_04_11.c 3 files changed, 4 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/72/3672/1 diff --git a/include/openbsc/gsm_data.h b/include/openbsc/gsm_data.h index 51cf6dc..f4de381 100644 --- a/include/openbsc/gsm_data.h +++ b/include/openbsc/gsm_data.h @@ -511,6 +511,7 @@ } smpp; unsigned long validity_minutes; + time_t created; bool is_report; uint8_t reply_path_req; uint8_t status_rep_req; diff --git a/src/libmsc/db.c b/src/libmsc/db.c index 3495806..ae7e287 100644 --- a/src/libmsc/db.c +++ b/src/libmsc/db.c @@ -742,6 +742,7 @@ /* FIXME: validity */ /* FIXME: those should all be get_uchar, but sqlite3 is braindead */ + sms->created = dbi_result_get_datetime(result, "created"); sms->reply_path_req = dbi_result_get_ulonglong(result, "reply_path_req"); sms->status_rep_req = dbi_result_get_ulonglong(result, "status_rep_req"); sms->is_report = dbi_result_get_ulonglong(result, "is_report"); diff --git a/src/libmsc/gsm_04_11.c b/src/libmsc/gsm_04_11.c index 55642aa..c5bcce7 100644 --- a/src/libmsc/gsm_04_11.c +++ b/src/libmsc/gsm_04_11.c @@ -312,11 +312,11 @@ /* generate TP-SCTS (Service centre timestamp) */ smsp = msgb_put(msg, 7); - gsm340_gen_scts(smsp, time(NULL)); + gsm340_gen_scts(smsp, sms->created); /* generate TP-DT (Discharge time, in TP-SCTS format). */ smsp = msgb_put(msg, 7); - gsm340_gen_scts(smsp, time(NULL)); + gsm340_gen_scts(smsp, sms->created); /* TP-ST (status) */ smsp = msgb_put(msg, 1); -- To view, visit https://gerrit.osmocom.org/3672 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I9056429d40bf02731f004b7833f1de45a0d1add8 Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Keith Whyte From gerrit-no-reply at lists.osmocom.org Thu Aug 24 17:41:13 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 24 Aug 2017 17:41:13 +0000 Subject: [PATCH] osmo-msc[master]: NITB: remove 'help' output about '-a' option that is removed... Message-ID: Review at https://gerrit.osmocom.org/3673 NITB: remove 'help' output about '-a' option that is removed for ages This option was present in very early versions of the NITB, but at least since 2011 it is no longer supported. It's still listed in --help output, which is wrong. Change-Id: I1d2cceb588ec5fb34ec5e2c05a7d8c93310bee88 --- M src/osmo-msc/msc_main.c 1 file changed, 0 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/73/3673/1 diff --git a/src/osmo-msc/msc_main.c b/src/osmo-msc/msc_main.c index 4166159..6c62db3 100644 --- a/src/osmo-msc/msc_main.c +++ b/src/osmo-msc/msc_main.c @@ -140,7 +140,6 @@ printf(" -c --config-file filename The config file to use.\n"); printf(" -s --disable-color\n"); printf(" -l --database db-name The database to use.\n"); - printf(" -a --authorize-everyone Authorize every new subscriber. Dangerous!\n"); printf(" -T --timestamp Prefix every log line with a timestamp.\n"); printf(" -V --version Print the version of OpenBSC.\n"); printf(" -P --rtp-proxy Enable the RTP Proxy code inside OpenBSC.\n"); @@ -163,7 +162,6 @@ {"config-file", 1, 0, 'c'}, {"disable-color", 0, 0, 's'}, {"database", 1, 0, 'l'}, - {"authorize-everyone", 0, 0, 'a'}, {"pcap", 1, 0, 'p'}, {"timestamp", 0, 0, 'T'}, {"version", 0, 0, 'V' }, -- To view, visit https://gerrit.osmocom.org/3673 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I1d2cceb588ec5fb34ec5e2c05a7d8c93310bee88 Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Thu Aug 24 17:41:13 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 24 Aug 2017 17:41:13 +0000 Subject: [PATCH] osmo-msc[master]: Treat SIGTERM just like SIGINT in our programs Message-ID: Review at https://gerrit.osmocom.org/3674 Treat SIGTERM just like SIGINT in our programs When somebody kills the process, it's best to handle the signal and to use the opportunity for some cleanup. We always did this in the NITB on SIGINT, but never on SIGTERM. Let's change it. Change-Id: Iea6804325a6575ceab5edfd28dd20249462f143b --- M src/gprs/gb_proxy_main.c M src/gprs/gtphub_main.c M src/gprs/sgsn_main.c M src/osmo-bsc/osmo_bsc_main.c M src/osmo-msc/msc_main.c 5 files changed, 10 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/74/3674/1 diff --git a/src/gprs/gb_proxy_main.c b/src/gprs/gb_proxy_main.c index 69a93b6..caff27f 100644 --- a/src/gprs/gb_proxy_main.c +++ b/src/gprs/gb_proxy_main.c @@ -98,6 +98,7 @@ switch (signal) { case SIGINT: + case SIGTERM: osmo_signal_dispatch(SS_L_GLOBAL, S_L_GLOBAL_SHUTDOWN, NULL); sleep(1); exit(0); @@ -232,6 +233,7 @@ msgb_talloc_ctx_init(tall_bsc_ctx, 0); signal(SIGINT, &signal_handler); + signal(SIGTERM, &signal_handler); signal(SIGABRT, &signal_handler); signal(SIGUSR1, &signal_handler); signal(SIGUSR2, &signal_handler); diff --git a/src/gprs/gtphub_main.c b/src/gprs/gtphub_main.c index 73a122c..2b87d19 100644 --- a/src/gprs/gtphub_main.c +++ b/src/gprs/gtphub_main.c @@ -96,6 +96,7 @@ switch (signal) { case SIGINT: + case SIGTERM: osmo_signal_dispatch(SS_L_GLOBAL, S_L_GLOBAL_SHUTDOWN, NULL); sleep(1); exit(0); @@ -302,6 +303,7 @@ msgb_talloc_ctx_init(osmo_gtphub_ctx, 0); signal(SIGINT, &signal_handler); + signal(SIGTERM, &signal_handler); signal(SIGABRT, &signal_handler); signal(SIGUSR1, &signal_handler); signal(SIGUSR2, &signal_handler); diff --git a/src/gprs/sgsn_main.c b/src/gprs/sgsn_main.c index 71cb18c..d5d43ad 100644 --- a/src/gprs/sgsn_main.c +++ b/src/gprs/sgsn_main.c @@ -145,6 +145,7 @@ switch (signal) { case SIGINT: + case SIGTERM: osmo_signal_dispatch(SS_L_GLOBAL, S_L_GLOBAL_SHUTDOWN, NULL); sleep(1); exit(0); @@ -332,6 +333,7 @@ msgb_talloc_ctx_init(tall_bsc_ctx, 0); signal(SIGINT, &signal_handler); + signal(SIGTERM, &signal_handler); signal(SIGABRT, &signal_handler); signal(SIGUSR1, &signal_handler); signal(SIGUSR2, &signal_handler); diff --git a/src/osmo-bsc/osmo_bsc_main.c b/src/osmo-bsc/osmo_bsc_main.c index ee094d6..90651b9 100644 --- a/src/osmo-bsc/osmo_bsc_main.c +++ b/src/osmo-bsc/osmo_bsc_main.c @@ -162,6 +162,7 @@ switch (signal) { case SIGINT: + case SIGTERM: bsc_shutdown_net(bsc_gsmnet); osmo_signal_dispatch(SS_L_GLOBAL, S_L_GLOBAL_SHUTDOWN, NULL); sleep(3); @@ -280,6 +281,7 @@ } signal(SIGINT, &signal_handler); + signal(SIGTERM, &signal_handler); signal(SIGABRT, &signal_handler); signal(SIGUSR1, &signal_handler); signal(SIGUSR2, &signal_handler); diff --git a/src/osmo-msc/msc_main.c b/src/osmo-msc/msc_main.c index 6c62db3..723c0e6 100644 --- a/src/osmo-msc/msc_main.c +++ b/src/osmo-msc/msc_main.c @@ -266,6 +266,7 @@ switch (signal) { case SIGINT: + case SIGTERM: msc_network_shutdown(msc_network); osmo_signal_dispatch(SS_L_GLOBAL, S_L_GLOBAL_SHUTDOWN, NULL); sleep(3); @@ -472,6 +473,7 @@ osmo_timer_schedule(&db_sync_timer, DB_SYNC_INTERVAL); signal(SIGINT, &signal_handler); + signal(SIGTERM, &signal_handler); signal(SIGABRT, &signal_handler); signal(SIGUSR1, &signal_handler); signal(SIGUSR2, &signal_handler); -- To view, visit https://gerrit.osmocom.org/3674 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Iea6804325a6575ceab5edfd28dd20249462f143b Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Thu Aug 24 18:52:04 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 24 Aug 2017 18:52:04 +0000 Subject: osmo-msc[master]: mgcp: hack RAB success from nano3G: patch first RTP payload In-Reply-To: References: Message-ID: Patch Set 7: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3349 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I5eff04dcb0936e21690e427ae5e49228cd459bd4 Gerrit-PatchSet: 7 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Aug 24 18:52:17 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 24 Aug 2017 18:52:17 +0000 Subject: osmo-msc[master]: examples: Change IP address of config files In-Reply-To: References: Message-ID: Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3419 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ie3a25f6771ed6e620cb2b315638c622a9a24e530 Gerrit-PatchSet: 3 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: daniel Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Aug 24 18:53:24 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 24 Aug 2017 18:53:24 +0000 Subject: osmo-msc[master]: examples/sgsn: Use osmo-hlr with auth-policy remote by default In-Reply-To: References: Message-ID: Patch Set 4: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3421 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ie3b2013198d3e2b780a4e31c36b89b58129dcacd Gerrit-PatchSet: 4 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: daniel Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Aug 24 18:53:32 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 24 Aug 2017 18:53:32 +0000 Subject: [MERGED] osmo-msc[master]: examples/sgsn: Use osmo-hlr with auth-policy remote by default In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: examples/sgsn: Use osmo-hlr with auth-policy remote by default ...................................................................... examples/sgsn: Use osmo-hlr with auth-policy remote by default For the vty tests, add osmo-sgsn-accept-all.cfg (that does not need an HLR) and use in vty_test_runner.py, otherwise the 'show sgsn' command will reply that it could not connect to the HLR, failing the vty test which expects empty. Change-Id: Ie3b2013198d3e2b780a4e31c36b89b58129dcacd --- A doc/examples/osmo-sgsn/osmo-sgsn-accept-all.cfg M doc/examples/osmo-sgsn/osmo-sgsn.cfg M tests/vty_test_runner.py 3 files changed, 31 insertions(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/doc/examples/osmo-sgsn/osmo-sgsn-accept-all.cfg b/doc/examples/osmo-sgsn/osmo-sgsn-accept-all.cfg new file mode 100644 index 0000000..5e64342 --- /dev/null +++ b/doc/examples/osmo-sgsn/osmo-sgsn-accept-all.cfg @@ -0,0 +1,27 @@ +! +! Osmocom SGSN configuration +! +! +line vty + no login +! +sgsn + gtp local-ip 127.0.0.1 + ggsn 0 remote-ip 127.0.0.2 + ggsn 0 gtp-version 1 + auth-policy accept-all +! +ns + timer tns-block 3 + timer tns-block-retries 3 + timer tns-reset 3 + timer tns-reset-retries 3 + timer tns-test 30 + timer tns-alive 3 + timer tns-alive-retries 10 + encapsulation udp local-ip 127.0.0.1 + encapsulation udp local-port 23000 + encapsulation framerelay-gre enabled 0 +! +bssgp +! diff --git a/doc/examples/osmo-sgsn/osmo-sgsn.cfg b/doc/examples/osmo-sgsn/osmo-sgsn.cfg index 3f39397..9703c23 100644 --- a/doc/examples/osmo-sgsn/osmo-sgsn.cfg +++ b/doc/examples/osmo-sgsn/osmo-sgsn.cfg @@ -9,6 +9,9 @@ gtp local-ip 127.0.0.1 ggsn 0 remote-ip 127.0.0.2 ggsn 0 gtp-version 1 + auth-policy remote + gsup remote-ip 127.0.0.1 + gsup remote-port 2222 ! ns timer tns-block 3 diff --git a/tests/vty_test_runner.py b/tests/vty_test_runner.py index fe4d3f0..7d4e121 100644 --- a/tests/vty_test_runner.py +++ b/tests/vty_test_runner.py @@ -829,7 +829,7 @@ def vty_command(self): return ["./src/gprs/osmo-sgsn", "-c", - "doc/examples/osmo-sgsn/osmo-sgsn.cfg"] + "doc/examples/osmo-sgsn/osmo-sgsn-accept-all.cfg"] def vty_app(self): return (4245, "./src/gprs/osmo-sgsn", "OsmoSGSN", "sgsn") -- To view, visit https://gerrit.osmocom.org/3421 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ie3b2013198d3e2b780a4e31c36b89b58129dcacd Gerrit-PatchSet: 4 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: daniel From gerrit-no-reply at lists.osmocom.org Thu Aug 24 18:53:33 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 24 Aug 2017 18:53:33 +0000 Subject: [MERGED] osmo-msc[master]: examples: Change IP address of config files In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: examples: Change IP address of config files ...................................................................... examples: Change IP address of config files This helps in providing 3G software packages for the sysmoNITB hardware, which uses 10.23.24.1 for SGSN and 10.23.24.2 for GGSN. However, in order to not break the python tests, the osmo-sgsn.cfg example still uses 127.0.0.1 as local address. Change the GGSN address to 127.0.0.2, because SGSN and GGSN cannot co-exist on the same address (the GTP port number is fixed by spec: no IE to communicate a differing port, so it has to be the standard GTP port for both). Change-Id: Ie3a25f6771ed6e620cb2b315638c622a9a24e530 --- M doc/examples/osmo-bsc_mgcp/mgcp.cfg M doc/examples/osmo-msc/osmo-msc.cfg M doc/examples/osmo-sgsn/osmo-sgsn.cfg 3 files changed, 5 insertions(+), 5 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/doc/examples/osmo-bsc_mgcp/mgcp.cfg b/doc/examples/osmo-bsc_mgcp/mgcp.cfg index 2622d23..3c43f1f 100644 --- a/doc/examples/osmo-bsc_mgcp/mgcp.cfg +++ b/doc/examples/osmo-bsc_mgcp/mgcp.cfg @@ -7,9 +7,9 @@ no login ! mgcp - !local ip 192.168.0.132 - !bts ip 192.168.0.124 - !bind ip 192.168.0.132 + !local ip 10.23.24.2 + !bts ip 10.24.24.1 + !bind ip 10.23.24.1 bind port 2427 rtp base 4000 rtp force-ptime 20 diff --git a/doc/examples/osmo-msc/osmo-msc.cfg b/doc/examples/osmo-msc/osmo-msc.cfg index 6cb9e4e..1b1d192 100644 --- a/doc/examples/osmo-msc/osmo-msc.cfg +++ b/doc/examples/osmo-msc/osmo-msc.cfg @@ -15,5 +15,5 @@ rrlp mode none mm info 1 msc - mgcpgw remote-ip 192.168.0.132 + mgcpgw remote-ip 10.23.24.1 assign-tmsi diff --git a/doc/examples/osmo-sgsn/osmo-sgsn.cfg b/doc/examples/osmo-sgsn/osmo-sgsn.cfg index 4955983..3f39397 100644 --- a/doc/examples/osmo-sgsn/osmo-sgsn.cfg +++ b/doc/examples/osmo-sgsn/osmo-sgsn.cfg @@ -7,7 +7,7 @@ ! sgsn gtp local-ip 127.0.0.1 - ggsn 0 remote-ip 127.0.0.1 + ggsn 0 remote-ip 127.0.0.2 ggsn 0 gtp-version 1 ! ns -- To view, visit https://gerrit.osmocom.org/3419 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ie3a25f6771ed6e620cb2b315638c622a9a24e530 Gerrit-PatchSet: 3 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: daniel From gerrit-no-reply at lists.osmocom.org Thu Aug 24 18:53:33 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 24 Aug 2017 18:53:33 +0000 Subject: [MERGED] osmo-msc[master]: mgcp: hack RAB success from nano3G: patch first RTP payload In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: mgcp: hack RAB success from nano3G: patch first RTP payload ...................................................................... mgcp: hack RAB success from nano3G: patch first RTP payload The ip.access nano3G needs the first RTP payload's first two bytes to read hex 'e400', or it will reject the RAB assignment. Add flag patched_first_rtp_payload to mgcp_rtp_state to detect the first RTP payload on a stream, and overwrite its first bytes with e400. This should probably be configurable, but seems to not harm other femto cells (as long as we patch only the first RTP payload in each stream). Only do this when sending to the BTS side. Related: OS#2459 Change-Id: I5eff04dcb0936e21690e427ae5e49228cd459bd4 --- M include/openbsc/mgcp_internal.h M src/libmgcp/mgcp_network.c 2 files changed, 14 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/include/openbsc/mgcp_internal.h b/include/openbsc/mgcp_internal.h index b58eb9b..b2c2408 100644 --- a/include/openbsc/mgcp_internal.h +++ b/include/openbsc/mgcp_internal.h @@ -64,6 +64,7 @@ uint32_t stats_jitter; int32_t stats_transit; int stats_cycles; + bool patched_first_rtp_payload; /* FIXME: drop this, see OS#2459 */ }; struct mgcp_rtp_codec { diff --git a/src/libmgcp/mgcp_network.c b/src/libmgcp/mgcp_network.c index c9fe179..399dc8f 100644 --- a/src/libmgcp/mgcp_network.c +++ b/src/libmgcp/mgcp_network.c @@ -667,6 +667,19 @@ forward_data(rtp_end->rtp.fd, &endp->taps[tap_idx], buf, len); + /* FIXME: HACK HACK HACK. See OS#2459. + * The ip.access nano3G needs the first RTP payload's first two bytes to read hex + * 'e400', or it will reject the RAB assignment. It seems to not harm other femto + * cells (as long as we patch only the first RTP payload in each stream). + */ + if (tap_idx == MGCP_TAP_BTS_OUT + && !rtp_state->patched_first_rtp_payload) { + uint8_t *data = (uint8_t*)&buf[12]; + data[0] = 0xe4; + data[1] = 0x00; + rtp_state->patched_first_rtp_payload = true; + } + rc = mgcp_udp_send(rtp_end->rtp.fd, &rtp_end->addr, rtp_end->rtp_port, buf, len); -- To view, visit https://gerrit.osmocom.org/3349 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I5eff04dcb0936e21690e427ae5e49228cd459bd4 Gerrit-PatchSet: 7 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Thu Aug 24 18:53:34 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 24 Aug 2017 18:53:34 +0000 Subject: [MERGED] osmo-msc[master]: contrib: Change systemd requirements so the services connect... In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: contrib: Change systemd requirements so the services connect properly ...................................................................... contrib: Change systemd requirements so the services connect properly Change-Id: Ib1b3c640ddd81927a60ee307c4b0cb90fd83eebe --- M contrib/systemd/osmo-msc.service M contrib/systemd/osmo-sgsn.service 2 files changed, 6 insertions(+), 2 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/contrib/systemd/osmo-msc.service b/contrib/systemd/osmo-msc.service index 2c81eba..7cebb14 100644 --- a/contrib/systemd/osmo-msc.service +++ b/contrib/systemd/osmo-msc.service @@ -1,7 +1,8 @@ [Unit] Description=Osmocom Mobile Switching Center (MSC) -Wants=osmo-hlr -After=osmo-hlr +Wants=osmo-hlr.service +After=osmo-hlr.service +After=osmo-hnbgw.service [Service] Type=simple diff --git a/contrib/systemd/osmo-sgsn.service b/contrib/systemd/osmo-sgsn.service index 674d786..bf6a8e0 100644 --- a/contrib/systemd/osmo-sgsn.service +++ b/contrib/systemd/osmo-sgsn.service @@ -1,5 +1,8 @@ [Unit] Description=OpenBSC SGSN +Wants=osmo-hlr.service +After=osmo-hlr.service +After=osmo-hnbgw.service [Service] Type=simple -- To view, visit https://gerrit.osmocom.org/3420 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ib1b3c640ddd81927a60ee307c4b0cb90fd83eebe Gerrit-PatchSet: 3 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: daniel From gerrit-no-reply at lists.osmocom.org Thu Aug 24 18:53:34 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 24 Aug 2017 18:53:34 +0000 Subject: [MERGED] osmo-msc[master]: 04.08: log protocol discriminators and message types by name In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: 04.08: log protocol discriminators and message types by name ...................................................................... 04.08: log protocol discriminators and message types by name On incoming 04.08 messages, we log only the protocol discriminator in decimal. Enhance: log pdisc and message type in hex, and also log the protocol and message type as human readable string. Also adjust the msc_vlr tests' log statements for wrapped rx/tx functions of dtap from/to the MS. Adjust the expected output of msc_vlr_tests. Change-Id: Ida205d217e304337d816b14fd15e2ee435e7397d Depends: libosmocore change-id I0fca8e95ed5c2148b1a7440eff3fc9c7583898df --- M src/libmsc/gsm_04_08.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_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_umts_authen.err M tests/msc_vlr/msc_vlr_tests.c 11 files changed, 923 insertions(+), 907 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified Pablo Neira Ayuso: Looks good to me, but someone else must approve diff --git a/src/libmsc/gsm_04_08.c b/src/libmsc/gsm_04_08.c index 3f3f905..d97bde2 100644 --- a/src/libmsc/gsm_04_08.c +++ b/src/libmsc/gsm_04_08.c @@ -3003,10 +3003,10 @@ uint8_t pdisc = gsm48_hdr_pdisc(gh); uint8_t msg_type = gsm48_hdr_msg_type(gh); - DEBUGP(DMM, "%s pdisc=%d msg_type=0x%02x:" + DEBUGP(DMM, "%s: rx msg %s:" " received_cm_service_request changes to false\n", vlr_subscr_name(conn->vsub), - pdisc, msg_type); + gsm48_pdisc_msgtype_name(pdisc, msg_type)); } conn->received_cm_service_request = false; } @@ -3022,14 +3022,16 @@ OSMO_ASSERT(conn); OSMO_ASSERT(msg); - LOGP(DRLL, LOGL_DEBUG, "Dispatching 04.08 message, pdisc=%d\n", pdisc); + LOGP(DRLL, LOGL_DEBUG, "Dispatching 04.08 message %s (0x%x:0x%x)\n", + gsm48_pdisc_msgtype_name(pdisc, gsm48_hdr_msg_type(gh)), + pdisc, gsm48_hdr_msg_type(gh)); if (!msc_subscr_conn_is_accepted(conn) && !msg_is_initially_permitted(gh)) { LOGP(DRLL, LOGL_ERROR, - "subscr %s: Message not permitted for initial conn:" - " pdisc=0x%02x msg_type=0x%02x\n", - vlr_subscr_name(conn->vsub), gh->proto_discr, gh->msg_type); + "subscr %s: Message not permitted for initial conn: %s\n", + vlr_subscr_name(conn->vsub), + gsm48_pdisc_msgtype_name(pdisc, gsm48_hdr_msg_type(gh))); return -EACCES; } diff --git a/tests/msc_vlr/msc_vlr_test_gsm_authen.err b/tests/msc_vlr/msc_vlr_test_gsm_authen.err index 65370be..b6b84ed 100644 --- a/tests/msc_vlr/msc_vlr_test_gsm_authen.err +++ b/tests/msc_vlr/msc_vlr_test_gsm_authen.err @@ -1,9 +1,9 @@ ===== test_gsm_authen - Location Update request causes a GSUP Send Auth Info request to HLR - rx from MS: pdisc=0x05 msg_type=0x08 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_LOC_UPD_REQUEST new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_LOC_UPD_REQUEST (0x5:0x8) DREF unknown: MSC conn use + 1 == 2 DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Allocated DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Received Event SUBSCR_CONN_E_START @@ -55,19 +55,19 @@ <-- GSUP rx OSMO_GSUP_MSGT_UPDATE_LOCATION_RESULT: vlr_gsupc_read_cb() returns 0 msc_subscr_conn_is_accepted() == false requests shall be thwarted -DRLL Dispatching 04.08 message, pdisc=3 -DRLL subscr IMSI:901700000004620: Message not permitted for initial conn: pdisc=0x03 msg_type=0x05 -DRLL Dispatching 04.08 message, pdisc=5 -DRLL subscr IMSI:901700000004620: Message not permitted for initial conn: pdisc=0x05 msg_type=0x33 -DRLL Dispatching 04.08 message, pdisc=6 -DRLL subscr IMSI:901700000004620: Message not permitted for initial conn: pdisc=0x06 msg_type=0x19 -DRLL Dispatching 04.08 message, pdisc=9 -DRLL subscr IMSI:901700000004620: Message not permitted for initial conn: pdisc=0x09 msg_type=0x01 +DRLL Dispatching 04.08 message GSM48_MT_CC_SETUP (0x3:0x5) +DRLL subscr IMSI:901700000004620: Message not permitted for initial conn: GSM48_MT_CC_SETUP +DRLL Dispatching 04.08 message unknown 0x33 (0x5:0x33) +DRLL subscr IMSI:901700000004620: Message not permitted for initial conn: unknown 0x33 +DRLL Dispatching 04.08 message GSM48_MT_RR_SYSINFO_1 (0x6:0x19) +DRLL subscr IMSI:901700000004620: Message not permitted for initial conn: GSM48_MT_RR_SYSINFO_1 +DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) +DRLL subscr IMSI:901700000004620: Message not permitted for initial conn: GSM48_PDISC_SMS:0x01 lu_result_sent == 0 - MS sends Authen Response, VLR accepts and sends GSUP LU Req to HLR - rx from MS: pdisc=0x05 msg_type=0x54 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_AUTH_RESP DREF IMSI:901700000004620: MSC conn use + 1 == 2 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_AUTH_RESP (0x5:0x14) DMM IMSI:901700000004620: MM GSM AUTHENTICATION RESPONSE (sres = 2d8b2c3e) DVLR VLR_Authenticate(901700000004620){VLR_SUB_AS_WAIT_RESP}: Received Event VLR_AUTH_E_MS_AUTH_RESP DVLR SUBSCR(IMSI:901700000004620) received res: 2d 8b 2c 3e @@ -162,10 +162,10 @@ llist_count(&net->subscr_conns) == 0 --- - after a while, a new conn sends a CM Service Request. VLR responds with Auth Req, 2nd auth vector - rx from MS: pdisc=0x05 msg_type=0x24 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_CM_SERV_REQ new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_CM_SERV_REQ (0x5:0x24) DMM <- CM SERVICE REQUEST serv_type=0x08 MI(IMSI)=901700000004620 DREF unknown: MSC conn use + 1 == 2 DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Allocated @@ -195,18 +195,18 @@ - needs auth, not yet accepted msc_subscr_conn_is_accepted() == false requests shall be thwarted -DRLL Dispatching 04.08 message, pdisc=3 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x03 msg_type=0x05 -DRLL Dispatching 04.08 message, pdisc=5 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x05 msg_type=0x33 -DRLL Dispatching 04.08 message, pdisc=6 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x06 msg_type=0x19 -DRLL Dispatching 04.08 message, pdisc=9 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x09 msg_type=0x01 +DRLL Dispatching 04.08 message GSM48_MT_CC_SETUP (0x3:0x5) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_MT_CC_SETUP +DRLL Dispatching 04.08 message unknown 0x33 (0x5:0x33) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: unknown 0x33 +DRLL Dispatching 04.08 message GSM48_MT_RR_SYSINFO_1 (0x6:0x19) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_MT_RR_SYSINFO_1 +DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_PDISC_SMS:0x01 - MS sends Authen Response, VLR accepts with a CM Service Accept - rx from MS: pdisc=0x05 msg_type=0x54 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_AUTH_RESP DREF MSISDN:46071: MSC conn use + 1 == 2 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_AUTH_RESP (0x5:0x14) DMM MSISDN:46071: MM GSM AUTHENTICATION RESPONSE (sres = 20bde240) DVLR VLR_Authenticate(901700000004620){VLR_SUB_AS_WAIT_RESP}: Received Event VLR_AUTH_E_MS_AUTH_RESP DVLR SUBSCR(MSISDN:46071) received res: 20 bd e2 40 @@ -242,16 +242,16 @@ - a USSD request is serviced expecting USSD: Your extension is 46071 - rx from MS: pdisc=0x0b msg_type=0x3b + MSC <--RAN_GERAN_A-- MS: GSM48_PDISC_NC_SS:0x3b DREF MSISDN:46071: MSC conn use + 1 == 2 -DRLL Dispatching 04.08 message, pdisc=11 -DMM MSISDN:46071 pdisc=11 msg_type=0x3b: received_cm_service_request changes to false +DRLL Dispatching 04.08 message GSM48_PDISC_NC_SS:0x3b (0xb:0x3b) +DMM MSISDN:46071: rx msg GSM48_PDISC_NC_SS:0x3b: received_cm_service_request changes to false DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_COMMUNICATING DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_ACCEPTED}: state_chg to SUBSCR_CONN_S_COMMUNICATING DMM USSD: Own number requested DMM MSISDN:46071: MSISDN = 46071 DMSC msc_tx 43 bytes to MSISDN:46071 via RAN_GERAN_A -- DTAP --RAN_GERAN_A--> MS: 8b2a1c27a225020100302002013b301b04010f0416d9775d0e2ae3e965f73cfd7683d27310cd06bbc51a0d +- DTAP --RAN_GERAN_A--> MS: GSM48_PDISC_NC_SS:0x2a: 8b2a1c27a225020100302002013b301b04010f0416d9775d0e2ae3e965f73cfd7683d27310cd06bbc51a0d - DTAP matches expected message DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_COMMUNICATING}: Received Event SUBSCR_CONN_E_BUMP DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_COMMUNICATING}: bump: releasing conn @@ -288,10 +288,10 @@ llist_count(&vsub->cs.requests) == 1 DREF VLR subscr MSISDN:46071 usage decreases to: 3 - MS replies with Paging Response, and VLR sends Auth Request with third key - rx from MS: pdisc=0x06 msg_type=0x27 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_RR_PAG_RESP new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=6 +DRLL Dispatching 04.08 message GSM48_MT_RR_PAG_RESP (0x6:0x27) DRR PAGING RESPONSE: MI(IMSI)=901700000004620 DREF unknown: MSC conn use + 1 == 2 DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Allocated @@ -320,18 +320,18 @@ - needs auth, not yet accepted msc_subscr_conn_is_accepted() == false requests shall be thwarted -DRLL Dispatching 04.08 message, pdisc=3 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x03 msg_type=0x05 -DRLL Dispatching 04.08 message, pdisc=5 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x05 msg_type=0x33 -DRLL Dispatching 04.08 message, pdisc=6 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x06 msg_type=0x19 -DRLL Dispatching 04.08 message, pdisc=9 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x09 msg_type=0x01 +DRLL Dispatching 04.08 message GSM48_MT_CC_SETUP (0x3:0x5) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_MT_CC_SETUP +DRLL Dispatching 04.08 message unknown 0x33 (0x5:0x33) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: unknown 0x33 +DRLL Dispatching 04.08 message GSM48_MT_RR_SYSINFO_1 (0x6:0x19) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_MT_RR_SYSINFO_1 +DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_PDISC_SMS:0x01 - MS sends Authen Response, VLR accepts and sends pending SMS - rx from MS: pdisc=0x05 msg_type=0x54 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_AUTH_RESP DREF MSISDN:46071: MSC conn use + 1 == 2 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_AUTH_RESP (0x5:0x14) DMM MSISDN:46071: MM GSM AUTHENTICATION RESPONSE (sres = a29514ae) DVLR VLR_Authenticate(901700000004620){VLR_SUB_AS_WAIT_RESP}: Received Event VLR_AUTH_E_MS_AUTH_RESP DVLR SUBSCR(MSISDN:46071) received res: a2 95 14 ae @@ -361,7 +361,7 @@ DREF VLR subscr MSISDN:46071 usage increases to: 5 DREF MSISDN:46071: MSC conn use + 1 == 3 DMSC msc_tx 91 bytes to MSISDN:46071 via RAN_GERAN_A -- DTAP --RAN_GERAN_A--> MS: 09015801000791447758100650004c0005806470f1000007101000000000445079da1e1ee7416937485e9ea7c965373d1d6683c270383b3d0ed3d36ff71c949e83c22072799e9687c5ec32a81d96afcbf4b4fb0c7ac3e9e9b7db05 +- DTAP --RAN_GERAN_A--> MS: GSM48_PDISC_SMS:0x01: 09015801000791447758100650004c0005806470f1000007101000000000445079da1e1ee7416937485e9ea7c965373d1d6683c270383b3d0ed3d36ff71c949e83c22072799e9687c5ec32a81d96afcbf4b4fb0c7ac3e9e9b7db05 - DTAP matches expected message DREF VLR subscr MSISDN:46071 usage decreases to: 4 DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_BUMP @@ -378,9 +378,9 @@ - conn is still open to wait for SMS ack dance llist_count(&net->subscr_conns) == 1 - MS replies with CP-ACK for received SMS - rx from MS: pdisc=0x89 msg_type=0x04 + MSC <--RAN_GERAN_A-- MS: GSM48_PDISC_SMS:0x04 DREF MSISDN:46071: MSC conn use + 1 == 3 -DRLL Dispatching 04.08 message, pdisc=9 +DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x04 (0x9:0x4) DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_COMMUNICATING DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_ACCEPTED}: state_chg to SUBSCR_CONN_S_COMMUNICATING DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_COMMUNICATING}: Received Event SUBSCR_CONN_E_BUMP @@ -388,12 +388,12 @@ DREF MSISDN:46071: MSC conn use - 1 == 2 llist_count(&net->subscr_conns) == 1 - MS also sends RP-ACK, MSC in turn sends CP-ACK for that - rx from MS: pdisc=0x89 msg_type=0x01 + MSC <--RAN_GERAN_A-- MS: GSM48_PDISC_SMS:0x01 DREF MSISDN:46071: MSC conn use + 1 == 3 -DRLL Dispatching 04.08 message, pdisc=9 +DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_COMMUNICATING}: Received Event SUBSCR_CONN_E_COMMUNICATING DMSC msc_tx 2 bytes to MSISDN:46071 via RAN_GERAN_A -- DTAP --RAN_GERAN_A--> MS: 0904 +- DTAP --RAN_GERAN_A--> MS: GSM48_PDISC_SMS:0x04: 0904 - DTAP matches expected message DREF VLR subscr MSISDN:46071 usage decreases to: 3 DREF VLR subscr MSISDN:46071 usage decreases to: 2 @@ -418,10 +418,10 @@ llist_count(&net->subscr_conns) == 0 --- - subscriber detaches - rx from MS: pdisc=0x05 msg_type=0x01 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_IMSI_DETACH_IND new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_IMSI_DETACH_IND (0x5:0x1) DMM IMSI DETACH INDICATION: MI(IMSI)=901700000004620 DREF VLR subscr MSISDN:46071 usage increases to: 2 DMM IMSI DETACH for MSISDN:46071 @@ -439,10 +439,10 @@ ===== test_gsm_authen_tmsi - Location Update request causes a GSUP Send Auth Info request to HLR - rx from MS: pdisc=0x05 msg_type=0x08 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_LOC_UPD_REQUEST new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_LOC_UPD_REQUEST (0x5:0x8) DREF unknown: MSC conn use + 1 == 2 DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Allocated DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Received Event SUBSCR_CONN_E_START @@ -494,19 +494,19 @@ <-- GSUP rx OSMO_GSUP_MSGT_UPDATE_LOCATION_RESULT: vlr_gsupc_read_cb() returns 0 msc_subscr_conn_is_accepted() == false requests shall be thwarted -DRLL Dispatching 04.08 message, pdisc=3 -DRLL subscr IMSI:901700000004620: Message not permitted for initial conn: pdisc=0x03 msg_type=0x05 -DRLL Dispatching 04.08 message, pdisc=5 -DRLL subscr IMSI:901700000004620: Message not permitted for initial conn: pdisc=0x05 msg_type=0x33 -DRLL Dispatching 04.08 message, pdisc=6 -DRLL subscr IMSI:901700000004620: Message not permitted for initial conn: pdisc=0x06 msg_type=0x19 -DRLL Dispatching 04.08 message, pdisc=9 -DRLL subscr IMSI:901700000004620: Message not permitted for initial conn: pdisc=0x09 msg_type=0x01 +DRLL Dispatching 04.08 message GSM48_MT_CC_SETUP (0x3:0x5) +DRLL subscr IMSI:901700000004620: Message not permitted for initial conn: GSM48_MT_CC_SETUP +DRLL Dispatching 04.08 message unknown 0x33 (0x5:0x33) +DRLL subscr IMSI:901700000004620: Message not permitted for initial conn: unknown 0x33 +DRLL Dispatching 04.08 message GSM48_MT_RR_SYSINFO_1 (0x6:0x19) +DRLL subscr IMSI:901700000004620: Message not permitted for initial conn: GSM48_MT_RR_SYSINFO_1 +DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) +DRLL subscr IMSI:901700000004620: Message not permitted for initial conn: GSM48_PDISC_SMS:0x01 lu_result_sent == 0 - MS sends Authen Response, VLR accepts and sends GSUP LU Req to HLR - rx from MS: pdisc=0x05 msg_type=0x54 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_AUTH_RESP DREF IMSI:901700000004620: MSC conn use + 1 == 2 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_AUTH_RESP (0x5:0x14) DMM IMSI:901700000004620: MM GSM AUTHENTICATION RESPONSE (sres = 2d8b2c3e) DVLR VLR_Authenticate(901700000004620){VLR_SUB_AS_WAIT_RESP}: Received Event VLR_AUTH_E_MS_AUTH_RESP DVLR SUBSCR(IMSI:901700000004620) received res: 2d 8b 2c 3e @@ -577,14 +577,14 @@ lu_result_sent == 1 msc_subscr_conn_is_accepted() == false requests shall be thwarted -DRLL Dispatching 04.08 message, pdisc=3 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x03 msg_type=0x05 -DRLL Dispatching 04.08 message, pdisc=5 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x05 msg_type=0x33 -DRLL Dispatching 04.08 message, pdisc=6 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x06 msg_type=0x19 -DRLL Dispatching 04.08 message, pdisc=9 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x09 msg_type=0x01 +DRLL Dispatching 04.08 message GSM48_MT_CC_SETUP (0x3:0x5) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_MT_CC_SETUP +DRLL Dispatching 04.08 message unknown 0x33 (0x5:0x33) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: unknown 0x33 +DRLL Dispatching 04.08 message GSM48_MT_RR_SYSINFO_1 (0x6:0x19) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_MT_RR_SYSINFO_1 +DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_PDISC_SMS:0x01 - even though the TMSI is not acked, we can already find the subscr with it DREF VLR subscr MSISDN:46071 usage increases to: 2 vsub != NULL == 1 @@ -593,9 +593,9 @@ vsub->tmsi == 0xffffffff DREF VLR subscr MSISDN:46071 usage decreases to: 1 - MS sends TMSI Realloc Complete - rx from MS: pdisc=0x05 msg_type=0x5b + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_TMSI_REALL_COMPL DREF MSISDN:46071: MSC conn use + 1 == 2 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_TMSI_REALL_COMPL (0x5:0x1b) DMM TMSI Reallocation Completed. Subscriber: MSISDN:46071 DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_WAIT_LU_COMPL}: Received Event VLR_ULA_E_NEW_TMSI_ACK DVLR lu_compl_vlr_fsm(901700000004620){LU_COMPL_VLR_S_WAIT_TMSI_CNF}: Received Event LU_COMPL_VLR_E_NEW_TMSI_ACK @@ -637,10 +637,10 @@ DREF VLR subscr MSISDN:46071 usage decreases to: 1 --- - after a while, a new conn sends a CM Service Request using above TMSI. VLR responds with Auth Req, 2nd auth vector - rx from MS: pdisc=0x05 msg_type=0x24 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_CM_SERV_REQ new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_CM_SERV_REQ (0x5:0x24) DMM <- CM SERVICE REQUEST serv_type=0x08 MI(TMSI)=50462976 DREF unknown: MSC conn use + 1 == 2 DMM Subscr_Conn(50462976){SUBSCR_CONN_S_INIT}: Allocated @@ -670,18 +670,18 @@ - needs auth, not yet accepted msc_subscr_conn_is_accepted() == false requests shall be thwarted -DRLL Dispatching 04.08 message, pdisc=3 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x03 msg_type=0x05 -DRLL Dispatching 04.08 message, pdisc=5 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x05 msg_type=0x33 -DRLL Dispatching 04.08 message, pdisc=6 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x06 msg_type=0x19 -DRLL Dispatching 04.08 message, pdisc=9 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x09 msg_type=0x01 +DRLL Dispatching 04.08 message GSM48_MT_CC_SETUP (0x3:0x5) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_MT_CC_SETUP +DRLL Dispatching 04.08 message unknown 0x33 (0x5:0x33) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: unknown 0x33 +DRLL Dispatching 04.08 message GSM48_MT_RR_SYSINFO_1 (0x6:0x19) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_MT_RR_SYSINFO_1 +DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_PDISC_SMS:0x01 - MS sends Authen Response, VLR accepts with a CM Service Accept - rx from MS: pdisc=0x05 msg_type=0x54 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_AUTH_RESP DREF MSISDN:46071: MSC conn use + 1 == 2 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_AUTH_RESP (0x5:0x14) DMM MSISDN:46071: MM GSM AUTHENTICATION RESPONSE (sres = 20bde240) DVLR VLR_Authenticate(50462976){VLR_SUB_AS_WAIT_RESP}: Received Event VLR_AUTH_E_MS_AUTH_RESP DVLR SUBSCR(MSISDN:46071) received res: 20 bd e2 40 @@ -717,16 +717,16 @@ - a USSD request is serviced expecting USSD: Your extension is 46071 - rx from MS: pdisc=0x0b msg_type=0x3b + MSC <--RAN_GERAN_A-- MS: GSM48_PDISC_NC_SS:0x3b DREF MSISDN:46071: MSC conn use + 1 == 2 -DRLL Dispatching 04.08 message, pdisc=11 -DMM MSISDN:46071 pdisc=11 msg_type=0x3b: received_cm_service_request changes to false +DRLL Dispatching 04.08 message GSM48_PDISC_NC_SS:0x3b (0xb:0x3b) +DMM MSISDN:46071: rx msg GSM48_PDISC_NC_SS:0x3b: received_cm_service_request changes to false DMM Subscr_Conn(50462976){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_COMMUNICATING DMM Subscr_Conn(50462976){SUBSCR_CONN_S_ACCEPTED}: state_chg to SUBSCR_CONN_S_COMMUNICATING DMM USSD: Own number requested DMM MSISDN:46071: MSISDN = 46071 DMSC msc_tx 43 bytes to MSISDN:46071 via RAN_GERAN_A -- DTAP --RAN_GERAN_A--> MS: 8b2a1c27a225020100302002013b301b04010f0416d9775d0e2ae3e965f73cfd7683d27310cd06bbc51a0d +- DTAP --RAN_GERAN_A--> MS: GSM48_PDISC_NC_SS:0x2a: 8b2a1c27a225020100302002013b301b04010f0416d9775d0e2ae3e965f73cfd7683d27310cd06bbc51a0d - DTAP matches expected message DMM Subscr_Conn(50462976){SUBSCR_CONN_S_COMMUNICATING}: Received Event SUBSCR_CONN_E_BUMP DMM Subscr_Conn(50462976){SUBSCR_CONN_S_COMMUNICATING}: bump: releasing conn @@ -763,10 +763,10 @@ llist_count(&vsub->cs.requests) == 1 DREF VLR subscr MSISDN:46071 usage decreases to: 3 - MS replies with Paging Response using TMSI, and VLR sends Auth Request with third key - rx from MS: pdisc=0x06 msg_type=0x27 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_RR_PAG_RESP new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=6 +DRLL Dispatching 04.08 message GSM48_MT_RR_PAG_RESP (0x6:0x27) DRR PAGING RESPONSE: MI(TMSI)=50462976 DREF unknown: MSC conn use + 1 == 2 DMM Subscr_Conn(50462976){SUBSCR_CONN_S_INIT}: Allocated @@ -795,18 +795,18 @@ - needs auth, not yet accepted msc_subscr_conn_is_accepted() == false requests shall be thwarted -DRLL Dispatching 04.08 message, pdisc=3 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x03 msg_type=0x05 -DRLL Dispatching 04.08 message, pdisc=5 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x05 msg_type=0x33 -DRLL Dispatching 04.08 message, pdisc=6 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x06 msg_type=0x19 -DRLL Dispatching 04.08 message, pdisc=9 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x09 msg_type=0x01 +DRLL Dispatching 04.08 message GSM48_MT_CC_SETUP (0x3:0x5) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_MT_CC_SETUP +DRLL Dispatching 04.08 message unknown 0x33 (0x5:0x33) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: unknown 0x33 +DRLL Dispatching 04.08 message GSM48_MT_RR_SYSINFO_1 (0x6:0x19) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_MT_RR_SYSINFO_1 +DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_PDISC_SMS:0x01 - MS sends Authen Response, VLR accepts and sends pending SMS - rx from MS: pdisc=0x05 msg_type=0x54 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_AUTH_RESP DREF MSISDN:46071: MSC conn use + 1 == 2 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_AUTH_RESP (0x5:0x14) DMM MSISDN:46071: MM GSM AUTHENTICATION RESPONSE (sres = a29514ae) DVLR VLR_Authenticate(50462976){VLR_SUB_AS_WAIT_RESP}: Received Event VLR_AUTH_E_MS_AUTH_RESP DVLR SUBSCR(MSISDN:46071) received res: a2 95 14 ae @@ -836,7 +836,7 @@ DREF VLR subscr MSISDN:46071 usage increases to: 5 DREF MSISDN:46071: MSC conn use + 1 == 3 DMSC msc_tx 91 bytes to MSISDN:46071 via RAN_GERAN_A -- DTAP --RAN_GERAN_A--> MS: 09015801000791447758100650004c0005806470f1000007101000000000445079da1e1ee7416937485e9ea7c965373d1d6683c270383b3d0ed3d36ff71c949e83c22072799e9687c5ec32a81d96afcbf4b4fb0c7ac3e9e9b7db05 +- DTAP --RAN_GERAN_A--> MS: GSM48_PDISC_SMS:0x01: 09015801000791447758100650004c0005806470f1000007101000000000445079da1e1ee7416937485e9ea7c965373d1d6683c270383b3d0ed3d36ff71c949e83c22072799e9687c5ec32a81d96afcbf4b4fb0c7ac3e9e9b7db05 - DTAP matches expected message DREF VLR subscr MSISDN:46071 usage decreases to: 4 DMM Subscr_Conn(50462976){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_BUMP @@ -853,9 +853,9 @@ - conn is still open to wait for SMS ack dance llist_count(&net->subscr_conns) == 1 - MS replies with CP-ACK for received SMS - rx from MS: pdisc=0x89 msg_type=0x04 + MSC <--RAN_GERAN_A-- MS: GSM48_PDISC_SMS:0x04 DREF MSISDN:46071: MSC conn use + 1 == 3 -DRLL Dispatching 04.08 message, pdisc=9 +DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x04 (0x9:0x4) DMM Subscr_Conn(50462976){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_COMMUNICATING DMM Subscr_Conn(50462976){SUBSCR_CONN_S_ACCEPTED}: state_chg to SUBSCR_CONN_S_COMMUNICATING DMM Subscr_Conn(50462976){SUBSCR_CONN_S_COMMUNICATING}: Received Event SUBSCR_CONN_E_BUMP @@ -863,12 +863,12 @@ DREF MSISDN:46071: MSC conn use - 1 == 2 llist_count(&net->subscr_conns) == 1 - MS also sends RP-ACK, MSC in turn sends CP-ACK for that - rx from MS: pdisc=0x89 msg_type=0x01 + MSC <--RAN_GERAN_A-- MS: GSM48_PDISC_SMS:0x01 DREF MSISDN:46071: MSC conn use + 1 == 3 -DRLL Dispatching 04.08 message, pdisc=9 +DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) DMM Subscr_Conn(50462976){SUBSCR_CONN_S_COMMUNICATING}: Received Event SUBSCR_CONN_E_COMMUNICATING DMSC msc_tx 2 bytes to MSISDN:46071 via RAN_GERAN_A -- DTAP --RAN_GERAN_A--> MS: 0904 +- DTAP --RAN_GERAN_A--> MS: GSM48_PDISC_SMS:0x04: 0904 - DTAP matches expected message DREF VLR subscr MSISDN:46071 usage decreases to: 3 DREF VLR subscr MSISDN:46071 usage decreases to: 2 @@ -894,10 +894,10 @@ --- - subscriber sends LU Request, this time with the TMSI - Location Update request causes an Auth Req to MS - rx from MS: pdisc=0x05 msg_type=0x08 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_LOC_UPD_REQUEST new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_LOC_UPD_REQUEST (0x5:0x8) DREF unknown: MSC conn use + 1 == 2 DMM Subscr_Conn(50462976){SUBSCR_CONN_S_INIT}: Allocated DMM Subscr_Conn(50462976){SUBSCR_CONN_S_INIT}: Received Event SUBSCR_CONN_E_START @@ -926,9 +926,9 @@ auth_request_sent == 1 lu_result_sent == 0 - MS sends Authen Response, VLR accepts and sends GSUP LU Req to HLR - rx from MS: pdisc=0x05 msg_type=0x54 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_AUTH_RESP DREF MSISDN:46071: MSC conn use + 1 == 2 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_AUTH_RESP (0x5:0x14) DMM MSISDN:46071: MM GSM AUTHENTICATION RESPONSE (sres = 5afc8d72) DVLR VLR_Authenticate(50462976){VLR_SUB_AS_WAIT_RESP}: Received Event VLR_AUTH_E_MS_AUTH_RESP DVLR SUBSCR(MSISDN:46071) received res: 5a fc 8d 72 @@ -999,14 +999,14 @@ lu_result_sent == 1 msc_subscr_conn_is_accepted() == false requests shall be thwarted -DRLL Dispatching 04.08 message, pdisc=3 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x03 msg_type=0x05 -DRLL Dispatching 04.08 message, pdisc=5 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x05 msg_type=0x33 -DRLL Dispatching 04.08 message, pdisc=6 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x06 msg_type=0x19 -DRLL Dispatching 04.08 message, pdisc=9 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x09 msg_type=0x01 +DRLL Dispatching 04.08 message GSM48_MT_CC_SETUP (0x3:0x5) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_MT_CC_SETUP +DRLL Dispatching 04.08 message unknown 0x33 (0x5:0x33) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: unknown 0x33 +DRLL Dispatching 04.08 message GSM48_MT_RR_SYSINFO_1 (0x6:0x19) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_MT_RR_SYSINFO_1 +DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_PDISC_SMS:0x01 - even though the TMSI is not acked, we can already find the subscr with it DREF VLR subscr MSISDN:46071 usage increases to: 3 vsub != NULL == 1 @@ -1015,9 +1015,9 @@ vsub->tmsi == 0x03020100 DREF VLR subscr MSISDN:46071 usage decreases to: 2 - MS sends TMSI Realloc Complete - rx from MS: pdisc=0x05 msg_type=0x5b + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_TMSI_REALL_COMPL DREF MSISDN:46071: MSC conn use + 1 == 2 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_TMSI_REALL_COMPL (0x5:0x1b) DMM TMSI Reallocation Completed. Subscriber: MSISDN:46071 DVLR vlr_lu_fsm(50462976){VLR_ULA_S_WAIT_LU_COMPL}: Received Event VLR_ULA_E_NEW_TMSI_ACK DVLR lu_compl_vlr_fsm(50462976){LU_COMPL_VLR_S_WAIT_TMSI_CNF}: Received Event LU_COMPL_VLR_E_NEW_TMSI_ACK @@ -1058,10 +1058,10 @@ DREF VLR subscr MSISDN:46071 usage decreases to: 1 --- - subscriber detaches, using new TMSI - rx from MS: pdisc=0x05 msg_type=0x01 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_IMSI_DETACH_IND new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_IMSI_DETACH_IND (0x5:0x1) DMM IMSI DETACH INDICATION: MI(TMSI)=117835012 DREF VLR subscr MSISDN:46071 usage increases to: 2 DMM IMSI DETACH for MSISDN:46071 @@ -1079,10 +1079,10 @@ ===== test_gsm_authen_imei - Location Update request causes a GSUP Send Auth Info request to HLR - rx from MS: pdisc=0x05 msg_type=0x08 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_LOC_UPD_REQUEST new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_LOC_UPD_REQUEST (0x5:0x8) DREF unknown: MSC conn use + 1 == 2 DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Allocated DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Received Event SUBSCR_CONN_E_START @@ -1134,19 +1134,19 @@ <-- GSUP rx OSMO_GSUP_MSGT_UPDATE_LOCATION_RESULT: vlr_gsupc_read_cb() returns 0 msc_subscr_conn_is_accepted() == false requests shall be thwarted -DRLL Dispatching 04.08 message, pdisc=3 -DRLL subscr IMSI:901700000004620: Message not permitted for initial conn: pdisc=0x03 msg_type=0x05 -DRLL Dispatching 04.08 message, pdisc=5 -DRLL subscr IMSI:901700000004620: Message not permitted for initial conn: pdisc=0x05 msg_type=0x33 -DRLL Dispatching 04.08 message, pdisc=6 -DRLL subscr IMSI:901700000004620: Message not permitted for initial conn: pdisc=0x06 msg_type=0x19 -DRLL Dispatching 04.08 message, pdisc=9 -DRLL subscr IMSI:901700000004620: Message not permitted for initial conn: pdisc=0x09 msg_type=0x01 +DRLL Dispatching 04.08 message GSM48_MT_CC_SETUP (0x3:0x5) +DRLL subscr IMSI:901700000004620: Message not permitted for initial conn: GSM48_MT_CC_SETUP +DRLL Dispatching 04.08 message unknown 0x33 (0x5:0x33) +DRLL subscr IMSI:901700000004620: Message not permitted for initial conn: unknown 0x33 +DRLL Dispatching 04.08 message GSM48_MT_RR_SYSINFO_1 (0x6:0x19) +DRLL subscr IMSI:901700000004620: Message not permitted for initial conn: GSM48_MT_RR_SYSINFO_1 +DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) +DRLL subscr IMSI:901700000004620: Message not permitted for initial conn: GSM48_PDISC_SMS:0x01 lu_result_sent == 0 - MS sends Authen Response, VLR accepts and sends GSUP LU Req to HLR - rx from MS: pdisc=0x05 msg_type=0x54 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_AUTH_RESP DREF IMSI:901700000004620: MSC conn use + 1 == 2 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_AUTH_RESP (0x5:0x14) DMM IMSI:901700000004620: MM GSM AUTHENTICATION RESPONSE (sres = 2d8b2c3e) DVLR VLR_Authenticate(901700000004620){VLR_SUB_AS_WAIT_RESP}: Received Event VLR_AUTH_E_MS_AUTH_RESP DVLR SUBSCR(IMSI:901700000004620) received res: 2d 8b 2c 3e @@ -1209,7 +1209,7 @@ DVLR lu_compl_vlr_fsm(901700000004620){LU_COMPL_VLR_S_WAIT_SUB_PRES}: Received Event LU_COMPL_VLR_E_SUB_PRES_COMPL DVLR lu_compl_vlr_fsm(901700000004620){LU_COMPL_VLR_S_WAIT_SUB_PRES}: state_chg to LU_COMPL_VLR_S_WAIT_IMEI DMSC msc_tx 3 bytes to MSISDN:46071 via RAN_GERAN_A -- DTAP --RAN_GERAN_A--> MS: 051802 +- DTAP --RAN_GERAN_A--> MS: GSM48_MT_MM_ID_REQ: 051802 - DTAP matches expected message DREF VLR subscr MSISDN:46071 usage decreases to: 1 <-- GSUP rx OSMO_GSUP_MSGT_UPDATE_LOCATION_RESULT: vlr_gsupc_read_cb() returns 0 @@ -1220,18 +1220,18 @@ DREF VLR subscr MSISDN:46071 usage decreases to: 1 msc_subscr_conn_is_accepted() == false requests shall be thwarted -DRLL Dispatching 04.08 message, pdisc=3 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x03 msg_type=0x05 -DRLL Dispatching 04.08 message, pdisc=5 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x05 msg_type=0x33 -DRLL Dispatching 04.08 message, pdisc=6 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x06 msg_type=0x19 -DRLL Dispatching 04.08 message, pdisc=9 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x09 msg_type=0x01 +DRLL Dispatching 04.08 message GSM48_MT_CC_SETUP (0x3:0x5) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_MT_CC_SETUP +DRLL Dispatching 04.08 message unknown 0x33 (0x5:0x33) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: unknown 0x33 +DRLL Dispatching 04.08 message GSM48_MT_RR_SYSINFO_1 (0x6:0x19) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_MT_RR_SYSINFO_1 +DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_PDISC_SMS:0x01 - MS replies with an Identity Response - rx from MS: pdisc=0x05 msg_type=0x59 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_ID_RESP DREF MSISDN:46071: MSC conn use + 1 == 2 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_ID_RESP (0x5:0x19) DMM IDENTITY RESPONSE: MI(IMEI)=423423423423423 DVLR set IMEI on subscriber; IMSI=901700000004620 IMEI=423423423423423 DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_WAIT_LU_COMPL}: Received Event VLR_ULA_E_ID_IMEI @@ -1273,10 +1273,10 @@ DREF VLR subscr MSISDN:46071 usage decreases to: 1 --- - subscriber detaches - rx from MS: pdisc=0x05 msg_type=0x01 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_IMSI_DETACH_IND new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_IMSI_DETACH_IND (0x5:0x1) DMM IMSI DETACH INDICATION: MI(IMSI)=901700000004620 DREF VLR subscr MSISDN:46071 usage increases to: 2 DMM IMSI DETACH for MSISDN:46071 @@ -1294,10 +1294,10 @@ ===== test_gsm_authen_tmsi_imei - Location Update request causes a GSUP Send Auth Info request to HLR - rx from MS: pdisc=0x05 msg_type=0x08 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_LOC_UPD_REQUEST new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_LOC_UPD_REQUEST (0x5:0x8) DREF unknown: MSC conn use + 1 == 2 DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Allocated DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Received Event SUBSCR_CONN_E_START @@ -1349,19 +1349,19 @@ <-- GSUP rx OSMO_GSUP_MSGT_UPDATE_LOCATION_RESULT: vlr_gsupc_read_cb() returns 0 msc_subscr_conn_is_accepted() == false requests shall be thwarted -DRLL Dispatching 04.08 message, pdisc=3 -DRLL subscr IMSI:901700000004620: Message not permitted for initial conn: pdisc=0x03 msg_type=0x05 -DRLL Dispatching 04.08 message, pdisc=5 -DRLL subscr IMSI:901700000004620: Message not permitted for initial conn: pdisc=0x05 msg_type=0x33 -DRLL Dispatching 04.08 message, pdisc=6 -DRLL subscr IMSI:901700000004620: Message not permitted for initial conn: pdisc=0x06 msg_type=0x19 -DRLL Dispatching 04.08 message, pdisc=9 -DRLL subscr IMSI:901700000004620: Message not permitted for initial conn: pdisc=0x09 msg_type=0x01 +DRLL Dispatching 04.08 message GSM48_MT_CC_SETUP (0x3:0x5) +DRLL subscr IMSI:901700000004620: Message not permitted for initial conn: GSM48_MT_CC_SETUP +DRLL Dispatching 04.08 message unknown 0x33 (0x5:0x33) +DRLL subscr IMSI:901700000004620: Message not permitted for initial conn: unknown 0x33 +DRLL Dispatching 04.08 message GSM48_MT_RR_SYSINFO_1 (0x6:0x19) +DRLL subscr IMSI:901700000004620: Message not permitted for initial conn: GSM48_MT_RR_SYSINFO_1 +DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) +DRLL subscr IMSI:901700000004620: Message not permitted for initial conn: GSM48_PDISC_SMS:0x01 lu_result_sent == 0 - MS sends Authen Response, VLR accepts and sends GSUP LU Req to HLR - rx from MS: pdisc=0x05 msg_type=0x54 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_AUTH_RESP DREF IMSI:901700000004620: MSC conn use + 1 == 2 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_AUTH_RESP (0x5:0x14) DMM IMSI:901700000004620: MM GSM AUTHENTICATION RESPONSE (sres = 2d8b2c3e) DVLR VLR_Authenticate(901700000004620){VLR_SUB_AS_WAIT_RESP}: Received Event VLR_AUTH_E_MS_AUTH_RESP DVLR SUBSCR(IMSI:901700000004620) received res: 2d 8b 2c 3e @@ -1424,7 +1424,7 @@ DVLR lu_compl_vlr_fsm(901700000004620){LU_COMPL_VLR_S_WAIT_SUB_PRES}: Received Event LU_COMPL_VLR_E_SUB_PRES_COMPL DVLR lu_compl_vlr_fsm(901700000004620){LU_COMPL_VLR_S_WAIT_SUB_PRES}: state_chg to LU_COMPL_VLR_S_WAIT_IMEI_TMSI DMSC msc_tx 3 bytes to MSISDN:46071 via RAN_GERAN_A -- DTAP --RAN_GERAN_A--> MS: 051802 +- DTAP --RAN_GERAN_A--> MS: GSM48_MT_MM_ID_REQ: 051802 - DTAP matches expected message DREF VLR subscr MSISDN:46071 usage decreases to: 1 <-- GSUP rx OSMO_GSUP_MSGT_UPDATE_LOCATION_RESULT: vlr_gsupc_read_cb() returns 0 @@ -1435,18 +1435,18 @@ DREF VLR subscr MSISDN:46071 usage decreases to: 1 msc_subscr_conn_is_accepted() == false requests shall be thwarted -DRLL Dispatching 04.08 message, pdisc=3 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x03 msg_type=0x05 -DRLL Dispatching 04.08 message, pdisc=5 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x05 msg_type=0x33 -DRLL Dispatching 04.08 message, pdisc=6 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x06 msg_type=0x19 -DRLL Dispatching 04.08 message, pdisc=9 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x09 msg_type=0x01 +DRLL Dispatching 04.08 message GSM48_MT_CC_SETUP (0x3:0x5) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_MT_CC_SETUP +DRLL Dispatching 04.08 message unknown 0x33 (0x5:0x33) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: unknown 0x33 +DRLL Dispatching 04.08 message GSM48_MT_RR_SYSINFO_1 (0x6:0x19) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_MT_RR_SYSINFO_1 +DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_PDISC_SMS:0x01 - MS replies with an Identity Response - rx from MS: pdisc=0x05 msg_type=0x59 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_ID_RESP DREF MSISDN:46071: MSC conn use + 1 == 2 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_ID_RESP (0x5:0x19) DMM IDENTITY RESPONSE: MI(IMEI)=423423423423423 DVLR set IMEI on subscriber; IMSI=901700000004620 IMEI=423423423423423 DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_WAIT_LU_COMPL}: Received Event VLR_ULA_E_ID_IMEI @@ -1461,14 +1461,14 @@ lu_result_sent == 1 msc_subscr_conn_is_accepted() == false requests shall be thwarted -DRLL Dispatching 04.08 message, pdisc=3 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x03 msg_type=0x05 -DRLL Dispatching 04.08 message, pdisc=5 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x05 msg_type=0x33 -DRLL Dispatching 04.08 message, pdisc=6 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x06 msg_type=0x19 -DRLL Dispatching 04.08 message, pdisc=9 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x09 msg_type=0x01 +DRLL Dispatching 04.08 message GSM48_MT_CC_SETUP (0x3:0x5) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_MT_CC_SETUP +DRLL Dispatching 04.08 message unknown 0x33 (0x5:0x33) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: unknown 0x33 +DRLL Dispatching 04.08 message GSM48_MT_RR_SYSINFO_1 (0x6:0x19) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_MT_RR_SYSINFO_1 +DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_PDISC_SMS:0x01 - even though the TMSI is not acked, we can already find the subscr with it DREF VLR subscr MSISDN:46071 usage increases to: 2 vsub != NULL == 1 @@ -1477,9 +1477,9 @@ vsub->tmsi == 0xffffffff DREF VLR subscr MSISDN:46071 usage decreases to: 1 - MS sends TMSI Realloc Complete - rx from MS: pdisc=0x05 msg_type=0x5b + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_TMSI_REALL_COMPL DREF MSISDN:46071: MSC conn use + 1 == 2 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_TMSI_REALL_COMPL (0x5:0x1b) DMM TMSI Reallocation Completed. Subscriber: MSISDN:46071 DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_WAIT_LU_COMPL}: Received Event VLR_ULA_E_NEW_TMSI_ACK DVLR lu_compl_vlr_fsm(901700000004620){LU_COMPL_VLR_S_WAIT_TMSI_CNF}: Received Event LU_COMPL_VLR_E_NEW_TMSI_ACK @@ -1519,10 +1519,10 @@ DREF VLR subscr MSISDN:46071 usage decreases to: 1 --- - subscriber detaches, using TMSI - rx from MS: pdisc=0x05 msg_type=0x01 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_IMSI_DETACH_IND new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_IMSI_DETACH_IND (0x5:0x1) DMM IMSI DETACH INDICATION: MI(TMSI)=50462976 DREF VLR subscr MSISDN:46071 usage increases to: 2 DMM IMSI DETACH for MSISDN:46071 @@ -1540,10 +1540,10 @@ ===== test_gsm_milenage_authen - Location Update request causes a GSUP Send Auth Info request to HLR - rx from MS: pdisc=0x05 msg_type=0x08 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_LOC_UPD_REQUEST new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_LOC_UPD_REQUEST (0x5:0x8) DREF unknown: MSC conn use + 1 == 2 DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_INIT}: Allocated DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_INIT}: Received Event SUBSCR_CONN_E_START @@ -1586,9 +1586,9 @@ auth_request_sent == 1 lu_result_sent == 0 - MS sends Authen Response, VLR accepts and sends GSUP LU Req to HLR - rx from MS: pdisc=0x05 msg_type=0x54 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_AUTH_RESP DREF IMSI:901700000010650: MSC conn use + 1 == 2 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_AUTH_RESP (0x5:0x14) DMM IMSI:901700000010650: MM GSM AUTHENTICATION RESPONSE (sres = 9b36efdf) DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_WAIT_RESP}: Received Event VLR_AUTH_E_MS_AUTH_RESP DVLR SUBSCR(IMSI:901700000010650) received res: 9b 36 ef df @@ -1683,10 +1683,10 @@ llist_count(&net->subscr_conns) == 0 --- - after a while, a new conn sends a CM Service Request. VLR responds with Auth Req, 2nd auth vector - rx from MS: pdisc=0x05 msg_type=0x24 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_CM_SERV_REQ new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_CM_SERV_REQ (0x5:0x24) DMM <- CM SERVICE REQUEST serv_type=0x08 MI(IMSI)=901700000010650 DREF unknown: MSC conn use + 1 == 2 DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_INIT}: Allocated @@ -1716,18 +1716,18 @@ - needs auth, not yet accepted msc_subscr_conn_is_accepted() == false requests shall be thwarted -DRLL Dispatching 04.08 message, pdisc=3 -DRLL subscr MSISDN:42342: Message not permitted for initial conn: pdisc=0x03 msg_type=0x05 -DRLL Dispatching 04.08 message, pdisc=5 -DRLL subscr MSISDN:42342: Message not permitted for initial conn: pdisc=0x05 msg_type=0x33 -DRLL Dispatching 04.08 message, pdisc=6 -DRLL subscr MSISDN:42342: Message not permitted for initial conn: pdisc=0x06 msg_type=0x19 -DRLL Dispatching 04.08 message, pdisc=9 -DRLL subscr MSISDN:42342: Message not permitted for initial conn: pdisc=0x09 msg_type=0x01 +DRLL Dispatching 04.08 message GSM48_MT_CC_SETUP (0x3:0x5) +DRLL subscr MSISDN:42342: Message not permitted for initial conn: GSM48_MT_CC_SETUP +DRLL Dispatching 04.08 message unknown 0x33 (0x5:0x33) +DRLL subscr MSISDN:42342: Message not permitted for initial conn: unknown 0x33 +DRLL Dispatching 04.08 message GSM48_MT_RR_SYSINFO_1 (0x6:0x19) +DRLL subscr MSISDN:42342: Message not permitted for initial conn: GSM48_MT_RR_SYSINFO_1 +DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) +DRLL subscr MSISDN:42342: Message not permitted for initial conn: GSM48_PDISC_SMS:0x01 - MS sends Authen Response, VLR accepts with a CM Service Accept - rx from MS: pdisc=0x05 msg_type=0x54 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_AUTH_RESP DREF MSISDN:42342: MSC conn use + 1 == 2 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_AUTH_RESP (0x5:0x14) DMM MSISDN:42342: MM GSM AUTHENTICATION RESPONSE (sres = 85aa3130) DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_WAIT_RESP}: Received Event VLR_AUTH_E_MS_AUTH_RESP DVLR SUBSCR(MSISDN:42342) received res: 85 aa 31 30 @@ -1763,16 +1763,16 @@ - a USSD request is serviced expecting USSD: Your extension is 42342 - rx from MS: pdisc=0x0b msg_type=0x3b + MSC <--RAN_GERAN_A-- MS: GSM48_PDISC_NC_SS:0x3b DREF MSISDN:42342: MSC conn use + 1 == 2 -DRLL Dispatching 04.08 message, pdisc=11 -DMM MSISDN:42342 pdisc=11 msg_type=0x3b: received_cm_service_request changes to false +DRLL Dispatching 04.08 message GSM48_PDISC_NC_SS:0x3b (0xb:0x3b) +DMM MSISDN:42342: rx msg GSM48_PDISC_NC_SS:0x3b: received_cm_service_request changes to false DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_COMMUNICATING DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_ACCEPTED}: state_chg to SUBSCR_CONN_S_COMMUNICATING DMM USSD: Own number requested DMM MSISDN:42342: MSISDN = 42342 DMSC msc_tx 43 bytes to MSISDN:42342 via RAN_GERAN_A -- DTAP --RAN_GERAN_A--> MS: 8b2a1c27a225020100302002013b301b04010f0416d9775d0e2ae3e965f73cfd7683d273104d36a3c91a0d +- DTAP --RAN_GERAN_A--> MS: GSM48_PDISC_NC_SS:0x2a: 8b2a1c27a225020100302002013b301b04010f0416d9775d0e2ae3e965f73cfd7683d273104d36a3c91a0d - DTAP matches expected message DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_COMMUNICATING}: Received Event SUBSCR_CONN_E_BUMP DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_COMMUNICATING}: bump: releasing conn @@ -1809,10 +1809,10 @@ llist_count(&vsub->cs.requests) == 1 DREF VLR subscr MSISDN:42342 usage decreases to: 3 - MS replies with Paging Response, and VLR sends Auth Request with third key - rx from MS: pdisc=0x06 msg_type=0x27 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_RR_PAG_RESP new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=6 +DRLL Dispatching 04.08 message GSM48_MT_RR_PAG_RESP (0x6:0x27) DRR PAGING RESPONSE: MI(IMSI)=901700000010650 DREF unknown: MSC conn use + 1 == 2 DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_INIT}: Allocated @@ -1841,18 +1841,18 @@ - needs auth, not yet accepted msc_subscr_conn_is_accepted() == false requests shall be thwarted -DRLL Dispatching 04.08 message, pdisc=3 -DRLL subscr MSISDN:42342: Message not permitted for initial conn: pdisc=0x03 msg_type=0x05 -DRLL Dispatching 04.08 message, pdisc=5 -DRLL subscr MSISDN:42342: Message not permitted for initial conn: pdisc=0x05 msg_type=0x33 -DRLL Dispatching 04.08 message, pdisc=6 -DRLL subscr MSISDN:42342: Message not permitted for initial conn: pdisc=0x06 msg_type=0x19 -DRLL Dispatching 04.08 message, pdisc=9 -DRLL subscr MSISDN:42342: Message not permitted for initial conn: pdisc=0x09 msg_type=0x01 +DRLL Dispatching 04.08 message GSM48_MT_CC_SETUP (0x3:0x5) +DRLL subscr MSISDN:42342: Message not permitted for initial conn: GSM48_MT_CC_SETUP +DRLL Dispatching 04.08 message unknown 0x33 (0x5:0x33) +DRLL subscr MSISDN:42342: Message not permitted for initial conn: unknown 0x33 +DRLL Dispatching 04.08 message GSM48_MT_RR_SYSINFO_1 (0x6:0x19) +DRLL subscr MSISDN:42342: Message not permitted for initial conn: GSM48_MT_RR_SYSINFO_1 +DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) +DRLL subscr MSISDN:42342: Message not permitted for initial conn: GSM48_PDISC_SMS:0x01 - MS sends Authen Response, VLR accepts and sends pending SMS - rx from MS: pdisc=0x05 msg_type=0x54 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_AUTH_RESP DREF MSISDN:42342: MSC conn use + 1 == 2 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_AUTH_RESP (0x5:0x14) DMM MSISDN:42342: MM GSM AUTHENTICATION RESPONSE (sres = 69d5f9fb) DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_WAIT_RESP}: Received Event VLR_AUTH_E_MS_AUTH_RESP DVLR SUBSCR(MSISDN:42342) received res: 69 d5 f9 fb @@ -1882,7 +1882,7 @@ DREF VLR subscr MSISDN:42342 usage increases to: 5 DREF MSISDN:42342: MSC conn use + 1 == 3 DMSC msc_tx 91 bytes to MSISDN:42342 via RAN_GERAN_A -- DTAP --RAN_GERAN_A--> MS: 09015801000791447758100650004c0005802443f2000007101000000000445079da1e1ee7416937485e9ea7c965373d1d6683c270383b3d0ed3d36ff71c949e83c22072799e9687c5ec32a81d96afcbf4b4fb0c7ac3e9e9b7db05 +- DTAP --RAN_GERAN_A--> MS: GSM48_PDISC_SMS:0x01: 09015801000791447758100650004c0005802443f2000007101000000000445079da1e1ee7416937485e9ea7c965373d1d6683c270383b3d0ed3d36ff71c949e83c22072799e9687c5ec32a81d96afcbf4b4fb0c7ac3e9e9b7db05 - DTAP matches expected message DREF VLR subscr MSISDN:42342 usage decreases to: 4 DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_BUMP @@ -1899,9 +1899,9 @@ - conn is still open to wait for SMS ack dance llist_count(&net->subscr_conns) == 1 - MS replies with CP-ACK for received SMS - rx from MS: pdisc=0x89 msg_type=0x04 + MSC <--RAN_GERAN_A-- MS: GSM48_PDISC_SMS:0x04 DREF MSISDN:42342: MSC conn use + 1 == 3 -DRLL Dispatching 04.08 message, pdisc=9 +DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x04 (0x9:0x4) DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_COMMUNICATING DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_ACCEPTED}: state_chg to SUBSCR_CONN_S_COMMUNICATING DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_COMMUNICATING}: Received Event SUBSCR_CONN_E_BUMP @@ -1909,12 +1909,12 @@ DREF MSISDN:42342: MSC conn use - 1 == 2 llist_count(&net->subscr_conns) == 1 - MS also sends RP-ACK, MSC in turn sends CP-ACK for that - rx from MS: pdisc=0x89 msg_type=0x01 + MSC <--RAN_GERAN_A-- MS: GSM48_PDISC_SMS:0x01 DREF MSISDN:42342: MSC conn use + 1 == 3 -DRLL Dispatching 04.08 message, pdisc=9 +DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_COMMUNICATING}: Received Event SUBSCR_CONN_E_COMMUNICATING DMSC msc_tx 2 bytes to MSISDN:42342 via RAN_GERAN_A -- DTAP --RAN_GERAN_A--> MS: 0904 +- DTAP --RAN_GERAN_A--> MS: GSM48_PDISC_SMS:0x04: 0904 - DTAP matches expected message DREF VLR subscr MSISDN:42342 usage decreases to: 3 DREF VLR subscr MSISDN:42342 usage decreases to: 2 @@ -1939,10 +1939,10 @@ llist_count(&net->subscr_conns) == 0 --- - subscriber detaches - rx from MS: pdisc=0x05 msg_type=0x01 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_IMSI_DETACH_IND new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_IMSI_DETACH_IND (0x5:0x1) DMM IMSI DETACH INDICATION: MI(IMSI)=901700000010650 DREF VLR subscr MSISDN:42342 usage increases to: 2 DMM IMSI DETACH for MSISDN:42342 diff --git a/tests/msc_vlr/msc_vlr_test_gsm_ciph.err b/tests/msc_vlr/msc_vlr_test_gsm_ciph.err index daa2c65..bd8d1b9 100644 --- a/tests/msc_vlr/msc_vlr_test_gsm_ciph.err +++ b/tests/msc_vlr/msc_vlr_test_gsm_ciph.err @@ -1,9 +1,9 @@ ===== test_ciph - Location Update request causes a GSUP Send Auth Info request to HLR - rx from MS: pdisc=0x05 msg_type=0x08 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_LOC_UPD_REQUEST new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_LOC_UPD_REQUEST (0x5:0x8) DREF unknown: MSC conn use + 1 == 2 DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Allocated DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Received Event SUBSCR_CONN_E_START @@ -46,9 +46,9 @@ lu_result_sent == 0 auth_request_sent == 1 - MS sends Authen Response, VLR accepts and sends Ciphering Mode Command to MS - rx from MS: pdisc=0x05 msg_type=0x54 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_AUTH_RESP DREF IMSI:901700000004620: MSC conn use + 1 == 2 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_AUTH_RESP (0x5:0x14) DMM IMSI:901700000004620: MM GSM AUTHENTICATION RESPONSE (sres = 2d8b2c3e) DVLR VLR_Authenticate(901700000004620){VLR_SUB_AS_WAIT_RESP}: Received Event VLR_AUTH_E_MS_AUTH_RESP DVLR SUBSCR(IMSI:901700000004620) received res: 2d 8b 2c 3e @@ -69,17 +69,17 @@ - needs ciph, not yet accepted msc_subscr_conn_is_accepted() == false requests shall be thwarted -DRLL Dispatching 04.08 message, pdisc=3 -DRLL subscr IMSI:901700000004620: Message not permitted for initial conn: pdisc=0x03 msg_type=0x05 -DRLL Dispatching 04.08 message, pdisc=5 -DRLL subscr IMSI:901700000004620: Message not permitted for initial conn: pdisc=0x05 msg_type=0x33 -DRLL Dispatching 04.08 message, pdisc=6 -DRLL subscr IMSI:901700000004620: Message not permitted for initial conn: pdisc=0x06 msg_type=0x19 -DRLL Dispatching 04.08 message, pdisc=9 -DRLL subscr IMSI:901700000004620: Message not permitted for initial conn: pdisc=0x09 msg_type=0x01 +DRLL Dispatching 04.08 message GSM48_MT_CC_SETUP (0x3:0x5) +DRLL subscr IMSI:901700000004620: Message not permitted for initial conn: GSM48_MT_CC_SETUP +DRLL Dispatching 04.08 message unknown 0x33 (0x5:0x33) +DRLL subscr IMSI:901700000004620: Message not permitted for initial conn: unknown 0x33 +DRLL Dispatching 04.08 message GSM48_MT_RR_SYSINFO_1 (0x6:0x19) +DRLL subscr IMSI:901700000004620: Message not permitted for initial conn: GSM48_MT_RR_SYSINFO_1 +DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) +DRLL subscr IMSI:901700000004620: Message not permitted for initial conn: GSM48_PDISC_SMS:0x01 lu_result_sent == 0 - MS sends Ciphering Mode Complete, VLR accepts and sends GSUP LU Req to HLR - rx from MS: pdisc=0x06 msg_type=0x32 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_RR_CIPH_M_COMPL DRR IMSI:901700000004620: CIPHERING MODE COMPLETE DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_WAIT_CIPH}: Received Event VLR_ULA_E_CIPH_RES DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_WAIT_CIPH}: vlr_loc_upd_post_ciph() @@ -162,10 +162,10 @@ llist_count(&net->subscr_conns) == 0 --- - after a while, a new conn sends a CM Service Request. VLR responds with Auth Req, 2nd auth vector - rx from MS: pdisc=0x05 msg_type=0x24 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_CM_SERV_REQ new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_CM_SERV_REQ (0x5:0x24) DMM <- CM SERVICE REQUEST serv_type=0x08 MI(IMSI)=901700000004620 DREF unknown: MSC conn use + 1 == 2 DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Allocated @@ -195,18 +195,18 @@ - needs auth, not yet accepted msc_subscr_conn_is_accepted() == false requests shall be thwarted -DRLL Dispatching 04.08 message, pdisc=3 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x03 msg_type=0x05 -DRLL Dispatching 04.08 message, pdisc=5 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x05 msg_type=0x33 -DRLL Dispatching 04.08 message, pdisc=6 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x06 msg_type=0x19 -DRLL Dispatching 04.08 message, pdisc=9 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x09 msg_type=0x01 +DRLL Dispatching 04.08 message GSM48_MT_CC_SETUP (0x3:0x5) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_MT_CC_SETUP +DRLL Dispatching 04.08 message unknown 0x33 (0x5:0x33) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: unknown 0x33 +DRLL Dispatching 04.08 message GSM48_MT_RR_SYSINFO_1 (0x6:0x19) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_MT_RR_SYSINFO_1 +DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_PDISC_SMS:0x01 - MS sends Authen Response, VLR accepts and requests Ciphering - rx from MS: pdisc=0x05 msg_type=0x54 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_AUTH_RESP DREF MSISDN:46071: MSC conn use + 1 == 2 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_AUTH_RESP (0x5:0x14) DMM MSISDN:46071: MM GSM AUTHENTICATION RESPONSE (sres = 20bde240) DVLR VLR_Authenticate(901700000004620){VLR_SUB_AS_WAIT_RESP}: Received Event VLR_AUTH_E_MS_AUTH_RESP DVLR SUBSCR(MSISDN:46071) received res: 20 bd e2 40 @@ -229,16 +229,16 @@ - needs ciph, not yet accepted msc_subscr_conn_is_accepted() == false requests shall be thwarted -DRLL Dispatching 04.08 message, pdisc=3 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x03 msg_type=0x05 -DRLL Dispatching 04.08 message, pdisc=5 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x05 msg_type=0x33 -DRLL Dispatching 04.08 message, pdisc=6 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x06 msg_type=0x19 -DRLL Dispatching 04.08 message, pdisc=9 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x09 msg_type=0x01 +DRLL Dispatching 04.08 message GSM48_MT_CC_SETUP (0x3:0x5) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_MT_CC_SETUP +DRLL Dispatching 04.08 message unknown 0x33 (0x5:0x33) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: unknown 0x33 +DRLL Dispatching 04.08 message GSM48_MT_RR_SYSINFO_1 (0x6:0x19) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_MT_RR_SYSINFO_1 +DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_PDISC_SMS:0x01 - MS sends Ciphering Mode Complete, VLR accepts; above Ciphering is an implicit CM Service Accept - rx from MS: pdisc=0x06 msg_type=0x32 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_RR_CIPH_M_COMPL DRR MSISDN:46071: CIPHERING MODE COMPLETE DVLR Process_Access_Request_VLR(901700000004620){PR_ARQ_S_WAIT_CIPH}: Received Event PR_ARQ_E_CIPH_RES DVLR Process_Access_Request_VLR(901700000004620){PR_ARQ_S_WAIT_CIPH}: _proc_arq_vlr_node2_post_ciph() @@ -259,16 +259,16 @@ - a USSD request is serviced expecting USSD: Your extension is 46071 - rx from MS: pdisc=0x0b msg_type=0x3b + MSC <--RAN_GERAN_A-- MS: GSM48_PDISC_NC_SS:0x3b DREF MSISDN:46071: MSC conn use + 1 == 2 -DRLL Dispatching 04.08 message, pdisc=11 -DMM MSISDN:46071 pdisc=11 msg_type=0x3b: received_cm_service_request changes to false +DRLL Dispatching 04.08 message GSM48_PDISC_NC_SS:0x3b (0xb:0x3b) +DMM MSISDN:46071: rx msg GSM48_PDISC_NC_SS:0x3b: received_cm_service_request changes to false DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_COMMUNICATING DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_ACCEPTED}: state_chg to SUBSCR_CONN_S_COMMUNICATING DMM USSD: Own number requested DMM MSISDN:46071: MSISDN = 46071 DMSC msc_tx 43 bytes to MSISDN:46071 via RAN_GERAN_A -- DTAP --RAN_GERAN_A--> MS: 8b2a1c27a225020100302002013b301b04010f0416d9775d0e2ae3e965f73cfd7683d27310cd06bbc51a0d +- DTAP --RAN_GERAN_A--> MS: GSM48_PDISC_NC_SS:0x2a: 8b2a1c27a225020100302002013b301b04010f0416d9775d0e2ae3e965f73cfd7683d27310cd06bbc51a0d - DTAP matches expected message DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_COMMUNICATING}: Received Event SUBSCR_CONN_E_BUMP DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_COMMUNICATING}: bump: releasing conn @@ -305,10 +305,10 @@ llist_count(&vsub->cs.requests) == 1 DREF VLR subscr MSISDN:46071 usage decreases to: 3 - MS replies with Paging Response, and VLR sends Auth Request with third key - rx from MS: pdisc=0x06 msg_type=0x27 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_RR_PAG_RESP new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=6 +DRLL Dispatching 04.08 message GSM48_MT_RR_PAG_RESP (0x6:0x27) DRR PAGING RESPONSE: MI(IMSI)=901700000004620 DREF unknown: MSC conn use + 1 == 2 DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Allocated @@ -337,18 +337,18 @@ - needs auth, not yet accepted msc_subscr_conn_is_accepted() == false requests shall be thwarted -DRLL Dispatching 04.08 message, pdisc=3 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x03 msg_type=0x05 -DRLL Dispatching 04.08 message, pdisc=5 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x05 msg_type=0x33 -DRLL Dispatching 04.08 message, pdisc=6 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x06 msg_type=0x19 -DRLL Dispatching 04.08 message, pdisc=9 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x09 msg_type=0x01 +DRLL Dispatching 04.08 message GSM48_MT_CC_SETUP (0x3:0x5) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_MT_CC_SETUP +DRLL Dispatching 04.08 message unknown 0x33 (0x5:0x33) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: unknown 0x33 +DRLL Dispatching 04.08 message GSM48_MT_RR_SYSINFO_1 (0x6:0x19) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_MT_RR_SYSINFO_1 +DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_PDISC_SMS:0x01 - MS sends Authen Response, VLR accepts and requests Ciphering - rx from MS: pdisc=0x05 msg_type=0x54 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_AUTH_RESP DREF MSISDN:46071: MSC conn use + 1 == 2 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_AUTH_RESP (0x5:0x14) DMM MSISDN:46071: MM GSM AUTHENTICATION RESPONSE (sres = a29514ae) DVLR VLR_Authenticate(901700000004620){VLR_SUB_AS_WAIT_RESP}: Received Event VLR_AUTH_E_MS_AUTH_RESP DVLR SUBSCR(MSISDN:46071) received res: a2 95 14 ae @@ -370,16 +370,16 @@ - needs ciph, not yet accepted msc_subscr_conn_is_accepted() == false requests shall be thwarted -DRLL Dispatching 04.08 message, pdisc=3 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x03 msg_type=0x05 -DRLL Dispatching 04.08 message, pdisc=5 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x05 msg_type=0x33 -DRLL Dispatching 04.08 message, pdisc=6 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x06 msg_type=0x19 -DRLL Dispatching 04.08 message, pdisc=9 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x09 msg_type=0x01 +DRLL Dispatching 04.08 message GSM48_MT_CC_SETUP (0x3:0x5) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_MT_CC_SETUP +DRLL Dispatching 04.08 message unknown 0x33 (0x5:0x33) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: unknown 0x33 +DRLL Dispatching 04.08 message GSM48_MT_RR_SYSINFO_1 (0x6:0x19) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_MT_RR_SYSINFO_1 +DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_PDISC_SMS:0x01 - MS sends Ciphering Mode Complete, VLR accepts and sends pending SMS - rx from MS: pdisc=0x06 msg_type=0x32 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_RR_CIPH_M_COMPL DRR MSISDN:46071: CIPHERING MODE COMPLETE DVLR Process_Access_Request_VLR(901700000004620){PR_ARQ_S_WAIT_CIPH}: Received Event PR_ARQ_E_CIPH_RES DVLR Process_Access_Request_VLR(901700000004620){PR_ARQ_S_WAIT_CIPH}: _proc_arq_vlr_node2_post_ciph() @@ -398,7 +398,7 @@ DREF VLR subscr MSISDN:46071 usage increases to: 5 DREF MSISDN:46071: MSC conn use + 1 == 2 DMSC msc_tx 91 bytes to MSISDN:46071 via RAN_GERAN_A -- DTAP --RAN_GERAN_A--> MS: 09015801000791447758100650004c0005806470f1000007101000000000445079da1e1ee7416937485e9ea7c965373d1d6683c270383b3d0ed3d36ff71c949e83c22072799e9687c5ec32a81d96afcbf4b4fb0c7ac3e9e9b7db05 +- DTAP --RAN_GERAN_A--> MS: GSM48_PDISC_SMS:0x01: 09015801000791447758100650004c0005806470f1000007101000000000445079da1e1ee7416937485e9ea7c965373d1d6683c270383b3d0ed3d36ff71c949e83c22072799e9687c5ec32a81d96afcbf4b4fb0c7ac3e9e9b7db05 - DTAP matches expected message DREF VLR subscr MSISDN:46071 usage decreases to: 4 DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_BUMP @@ -412,9 +412,9 @@ - conn is still open to wait for SMS ack dance llist_count(&net->subscr_conns) == 1 - MS replies with CP-ACK for received SMS - rx from MS: pdisc=0x89 msg_type=0x04 + MSC <--RAN_GERAN_A-- MS: GSM48_PDISC_SMS:0x04 DREF MSISDN:46071: MSC conn use + 1 == 3 -DRLL Dispatching 04.08 message, pdisc=9 +DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x04 (0x9:0x4) DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_COMMUNICATING DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_ACCEPTED}: state_chg to SUBSCR_CONN_S_COMMUNICATING DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_COMMUNICATING}: Received Event SUBSCR_CONN_E_BUMP @@ -422,12 +422,12 @@ DREF MSISDN:46071: MSC conn use - 1 == 2 llist_count(&net->subscr_conns) == 1 - MS also sends RP-ACK, MSC in turn sends CP-ACK for that - rx from MS: pdisc=0x89 msg_type=0x01 + MSC <--RAN_GERAN_A-- MS: GSM48_PDISC_SMS:0x01 DREF MSISDN:46071: MSC conn use + 1 == 3 -DRLL Dispatching 04.08 message, pdisc=9 +DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_COMMUNICATING}: Received Event SUBSCR_CONN_E_COMMUNICATING DMSC msc_tx 2 bytes to MSISDN:46071 via RAN_GERAN_A -- DTAP --RAN_GERAN_A--> MS: 0904 +- DTAP --RAN_GERAN_A--> MS: GSM48_PDISC_SMS:0x04: 0904 - DTAP matches expected message DREF VLR subscr MSISDN:46071 usage decreases to: 3 DREF VLR subscr MSISDN:46071 usage decreases to: 2 @@ -452,10 +452,10 @@ llist_count(&net->subscr_conns) == 0 --- - subscriber detaches - rx from MS: pdisc=0x05 msg_type=0x01 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_IMSI_DETACH_IND new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_IMSI_DETACH_IND (0x5:0x1) DMM IMSI DETACH INDICATION: MI(IMSI)=901700000004620 DREF VLR subscr MSISDN:46071 usage increases to: 2 DMM IMSI DETACH for MSISDN:46071 @@ -473,10 +473,10 @@ ===== test_ciph_tmsi - Location Update request causes a GSUP Send Auth Info request to HLR - rx from MS: pdisc=0x05 msg_type=0x08 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_LOC_UPD_REQUEST new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_LOC_UPD_REQUEST (0x5:0x8) DREF unknown: MSC conn use + 1 == 2 DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Allocated DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Received Event SUBSCR_CONN_E_START @@ -519,9 +519,9 @@ auth_request_sent == 1 lu_result_sent == 0 - MS sends Authen Response, VLR accepts and sends Ciphering Mode Command to MS - rx from MS: pdisc=0x05 msg_type=0x54 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_AUTH_RESP DREF IMSI:901700000004620: MSC conn use + 1 == 2 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_AUTH_RESP (0x5:0x14) DMM IMSI:901700000004620: MM GSM AUTHENTICATION RESPONSE (sres = 2d8b2c3e) DVLR VLR_Authenticate(901700000004620){VLR_SUB_AS_WAIT_RESP}: Received Event VLR_AUTH_E_MS_AUTH_RESP DVLR SUBSCR(IMSI:901700000004620) received res: 2d 8b 2c 3e @@ -543,17 +543,17 @@ - needs ciph, not yet accepted msc_subscr_conn_is_accepted() == false requests shall be thwarted -DRLL Dispatching 04.08 message, pdisc=3 -DRLL subscr IMSI:901700000004620: Message not permitted for initial conn: pdisc=0x03 msg_type=0x05 -DRLL Dispatching 04.08 message, pdisc=5 -DRLL subscr IMSI:901700000004620: Message not permitted for initial conn: pdisc=0x05 msg_type=0x33 -DRLL Dispatching 04.08 message, pdisc=6 -DRLL subscr IMSI:901700000004620: Message not permitted for initial conn: pdisc=0x06 msg_type=0x19 -DRLL Dispatching 04.08 message, pdisc=9 -DRLL subscr IMSI:901700000004620: Message not permitted for initial conn: pdisc=0x09 msg_type=0x01 +DRLL Dispatching 04.08 message GSM48_MT_CC_SETUP (0x3:0x5) +DRLL subscr IMSI:901700000004620: Message not permitted for initial conn: GSM48_MT_CC_SETUP +DRLL Dispatching 04.08 message unknown 0x33 (0x5:0x33) +DRLL subscr IMSI:901700000004620: Message not permitted for initial conn: unknown 0x33 +DRLL Dispatching 04.08 message GSM48_MT_RR_SYSINFO_1 (0x6:0x19) +DRLL subscr IMSI:901700000004620: Message not permitted for initial conn: GSM48_MT_RR_SYSINFO_1 +DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) +DRLL subscr IMSI:901700000004620: Message not permitted for initial conn: GSM48_PDISC_SMS:0x01 lu_result_sent == 0 - MS sends Ciphering Mode Complete, VLR accepts and sends GSUP LU Req to HLR - rx from MS: pdisc=0x06 msg_type=0x32 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_RR_CIPH_M_COMPL DRR IMSI:901700000004620: CIPHERING MODE COMPLETE DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_WAIT_CIPH}: Received Event VLR_ULA_E_CIPH_RES DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_WAIT_CIPH}: vlr_loc_upd_post_ciph() @@ -612,14 +612,14 @@ lu_result_sent == 1 msc_subscr_conn_is_accepted() == false requests shall be thwarted -DRLL Dispatching 04.08 message, pdisc=3 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x03 msg_type=0x05 -DRLL Dispatching 04.08 message, pdisc=5 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x05 msg_type=0x33 -DRLL Dispatching 04.08 message, pdisc=6 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x06 msg_type=0x19 -DRLL Dispatching 04.08 message, pdisc=9 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x09 msg_type=0x01 +DRLL Dispatching 04.08 message GSM48_MT_CC_SETUP (0x3:0x5) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_MT_CC_SETUP +DRLL Dispatching 04.08 message unknown 0x33 (0x5:0x33) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: unknown 0x33 +DRLL Dispatching 04.08 message GSM48_MT_RR_SYSINFO_1 (0x6:0x19) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_MT_RR_SYSINFO_1 +DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_PDISC_SMS:0x01 - even though the TMSI is not acked, we can already find the subscr with it DREF VLR subscr MSISDN:46071 usage increases to: 2 vsub != NULL == 1 @@ -628,9 +628,9 @@ vsub->tmsi == 0xffffffff DREF VLR subscr MSISDN:46071 usage decreases to: 1 - MS sends TMSI Realloc Complete - rx from MS: pdisc=0x05 msg_type=0x5b + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_TMSI_REALL_COMPL DREF MSISDN:46071: MSC conn use + 1 == 2 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_TMSI_REALL_COMPL (0x5:0x1b) DMM TMSI Reallocation Completed. Subscriber: MSISDN:46071 DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_WAIT_LU_COMPL}: Received Event VLR_ULA_E_NEW_TMSI_ACK DVLR lu_compl_vlr_fsm(901700000004620){LU_COMPL_VLR_S_WAIT_TMSI_CNF}: Received Event LU_COMPL_VLR_E_NEW_TMSI_ACK @@ -672,10 +672,10 @@ DREF VLR subscr MSISDN:46071 usage decreases to: 1 --- - after a while, a new conn sends a CM Service Request using above TMSI. VLR responds with Auth Req, 2nd auth vector - rx from MS: pdisc=0x05 msg_type=0x24 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_CM_SERV_REQ new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_CM_SERV_REQ (0x5:0x24) DMM <- CM SERVICE REQUEST serv_type=0x08 MI(TMSI)=50462976 DREF unknown: MSC conn use + 1 == 2 DMM Subscr_Conn(50462976){SUBSCR_CONN_S_INIT}: Allocated @@ -705,18 +705,18 @@ - needs auth, not yet accepted msc_subscr_conn_is_accepted() == false requests shall be thwarted -DRLL Dispatching 04.08 message, pdisc=3 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x03 msg_type=0x05 -DRLL Dispatching 04.08 message, pdisc=5 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x05 msg_type=0x33 -DRLL Dispatching 04.08 message, pdisc=6 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x06 msg_type=0x19 -DRLL Dispatching 04.08 message, pdisc=9 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x09 msg_type=0x01 +DRLL Dispatching 04.08 message GSM48_MT_CC_SETUP (0x3:0x5) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_MT_CC_SETUP +DRLL Dispatching 04.08 message unknown 0x33 (0x5:0x33) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: unknown 0x33 +DRLL Dispatching 04.08 message GSM48_MT_RR_SYSINFO_1 (0x6:0x19) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_MT_RR_SYSINFO_1 +DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_PDISC_SMS:0x01 - MS sends Authen Response, VLR accepts and requests Ciphering - rx from MS: pdisc=0x05 msg_type=0x54 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_AUTH_RESP DREF MSISDN:46071: MSC conn use + 1 == 2 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_AUTH_RESP (0x5:0x14) DMM MSISDN:46071: MM GSM AUTHENTICATION RESPONSE (sres = 20bde240) DVLR VLR_Authenticate(50462976){VLR_SUB_AS_WAIT_RESP}: Received Event VLR_AUTH_E_MS_AUTH_RESP DVLR SUBSCR(MSISDN:46071) received res: 20 bd e2 40 @@ -739,16 +739,16 @@ - needs ciph, not yet accepted msc_subscr_conn_is_accepted() == false requests shall be thwarted -DRLL Dispatching 04.08 message, pdisc=3 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x03 msg_type=0x05 -DRLL Dispatching 04.08 message, pdisc=5 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x05 msg_type=0x33 -DRLL Dispatching 04.08 message, pdisc=6 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x06 msg_type=0x19 -DRLL Dispatching 04.08 message, pdisc=9 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x09 msg_type=0x01 +DRLL Dispatching 04.08 message GSM48_MT_CC_SETUP (0x3:0x5) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_MT_CC_SETUP +DRLL Dispatching 04.08 message unknown 0x33 (0x5:0x33) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: unknown 0x33 +DRLL Dispatching 04.08 message GSM48_MT_RR_SYSINFO_1 (0x6:0x19) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_MT_RR_SYSINFO_1 +DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_PDISC_SMS:0x01 - MS sends Ciphering Mode Complete, VLR accepts; above Ciphering is an implicit CM Service Accept - rx from MS: pdisc=0x06 msg_type=0x32 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_RR_CIPH_M_COMPL DRR MSISDN:46071: CIPHERING MODE COMPLETE DVLR Process_Access_Request_VLR(50462976){PR_ARQ_S_WAIT_CIPH}: Received Event PR_ARQ_E_CIPH_RES DVLR Process_Access_Request_VLR(50462976){PR_ARQ_S_WAIT_CIPH}: _proc_arq_vlr_node2_post_ciph() @@ -769,16 +769,16 @@ - a USSD request is serviced expecting USSD: Your extension is 46071 - rx from MS: pdisc=0x0b msg_type=0x3b + MSC <--RAN_GERAN_A-- MS: GSM48_PDISC_NC_SS:0x3b DREF MSISDN:46071: MSC conn use + 1 == 2 -DRLL Dispatching 04.08 message, pdisc=11 -DMM MSISDN:46071 pdisc=11 msg_type=0x3b: received_cm_service_request changes to false +DRLL Dispatching 04.08 message GSM48_PDISC_NC_SS:0x3b (0xb:0x3b) +DMM MSISDN:46071: rx msg GSM48_PDISC_NC_SS:0x3b: received_cm_service_request changes to false DMM Subscr_Conn(50462976){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_COMMUNICATING DMM Subscr_Conn(50462976){SUBSCR_CONN_S_ACCEPTED}: state_chg to SUBSCR_CONN_S_COMMUNICATING DMM USSD: Own number requested DMM MSISDN:46071: MSISDN = 46071 DMSC msc_tx 43 bytes to MSISDN:46071 via RAN_GERAN_A -- DTAP --RAN_GERAN_A--> MS: 8b2a1c27a225020100302002013b301b04010f0416d9775d0e2ae3e965f73cfd7683d27310cd06bbc51a0d +- DTAP --RAN_GERAN_A--> MS: GSM48_PDISC_NC_SS:0x2a: 8b2a1c27a225020100302002013b301b04010f0416d9775d0e2ae3e965f73cfd7683d27310cd06bbc51a0d - DTAP matches expected message DMM Subscr_Conn(50462976){SUBSCR_CONN_S_COMMUNICATING}: Received Event SUBSCR_CONN_E_BUMP DMM Subscr_Conn(50462976){SUBSCR_CONN_S_COMMUNICATING}: bump: releasing conn @@ -815,10 +815,10 @@ llist_count(&vsub->cs.requests) == 1 DREF VLR subscr MSISDN:46071 usage decreases to: 3 - MS replies with Paging Response using TMSI, and VLR sends Auth Request with third key - rx from MS: pdisc=0x06 msg_type=0x27 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_RR_PAG_RESP new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=6 +DRLL Dispatching 04.08 message GSM48_MT_RR_PAG_RESP (0x6:0x27) DRR PAGING RESPONSE: MI(TMSI)=50462976 DREF unknown: MSC conn use + 1 == 2 DMM Subscr_Conn(50462976){SUBSCR_CONN_S_INIT}: Allocated @@ -847,18 +847,18 @@ - needs auth, not yet accepted msc_subscr_conn_is_accepted() == false requests shall be thwarted -DRLL Dispatching 04.08 message, pdisc=3 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x03 msg_type=0x05 -DRLL Dispatching 04.08 message, pdisc=5 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x05 msg_type=0x33 -DRLL Dispatching 04.08 message, pdisc=6 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x06 msg_type=0x19 -DRLL Dispatching 04.08 message, pdisc=9 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x09 msg_type=0x01 +DRLL Dispatching 04.08 message GSM48_MT_CC_SETUP (0x3:0x5) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_MT_CC_SETUP +DRLL Dispatching 04.08 message unknown 0x33 (0x5:0x33) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: unknown 0x33 +DRLL Dispatching 04.08 message GSM48_MT_RR_SYSINFO_1 (0x6:0x19) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_MT_RR_SYSINFO_1 +DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_PDISC_SMS:0x01 - MS sends Authen Response, VLR accepts and requests Ciphering - rx from MS: pdisc=0x05 msg_type=0x54 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_AUTH_RESP DREF MSISDN:46071: MSC conn use + 1 == 2 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_AUTH_RESP (0x5:0x14) DMM MSISDN:46071: MM GSM AUTHENTICATION RESPONSE (sres = a29514ae) DVLR VLR_Authenticate(50462976){VLR_SUB_AS_WAIT_RESP}: Received Event VLR_AUTH_E_MS_AUTH_RESP DVLR SUBSCR(MSISDN:46071) received res: a2 95 14 ae @@ -880,16 +880,16 @@ - needs ciph, not yet accepted msc_subscr_conn_is_accepted() == false requests shall be thwarted -DRLL Dispatching 04.08 message, pdisc=3 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x03 msg_type=0x05 -DRLL Dispatching 04.08 message, pdisc=5 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x05 msg_type=0x33 -DRLL Dispatching 04.08 message, pdisc=6 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x06 msg_type=0x19 -DRLL Dispatching 04.08 message, pdisc=9 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x09 msg_type=0x01 +DRLL Dispatching 04.08 message GSM48_MT_CC_SETUP (0x3:0x5) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_MT_CC_SETUP +DRLL Dispatching 04.08 message unknown 0x33 (0x5:0x33) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: unknown 0x33 +DRLL Dispatching 04.08 message GSM48_MT_RR_SYSINFO_1 (0x6:0x19) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_MT_RR_SYSINFO_1 +DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_PDISC_SMS:0x01 - MS sends Ciphering Mode Complete, VLR accepts and sends pending SMS - rx from MS: pdisc=0x06 msg_type=0x32 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_RR_CIPH_M_COMPL DRR MSISDN:46071: CIPHERING MODE COMPLETE DVLR Process_Access_Request_VLR(50462976){PR_ARQ_S_WAIT_CIPH}: Received Event PR_ARQ_E_CIPH_RES DVLR Process_Access_Request_VLR(50462976){PR_ARQ_S_WAIT_CIPH}: _proc_arq_vlr_node2_post_ciph() @@ -908,7 +908,7 @@ DREF VLR subscr MSISDN:46071 usage increases to: 5 DREF MSISDN:46071: MSC conn use + 1 == 2 DMSC msc_tx 91 bytes to MSISDN:46071 via RAN_GERAN_A -- DTAP --RAN_GERAN_A--> MS: 09015801000791447758100650004c0005806470f1000007101000000000445079da1e1ee7416937485e9ea7c965373d1d6683c270383b3d0ed3d36ff71c949e83c22072799e9687c5ec32a81d96afcbf4b4fb0c7ac3e9e9b7db05 +- DTAP --RAN_GERAN_A--> MS: GSM48_PDISC_SMS:0x01: 09015801000791447758100650004c0005806470f1000007101000000000445079da1e1ee7416937485e9ea7c965373d1d6683c270383b3d0ed3d36ff71c949e83c22072799e9687c5ec32a81d96afcbf4b4fb0c7ac3e9e9b7db05 - DTAP matches expected message DREF VLR subscr MSISDN:46071 usage decreases to: 4 DMM Subscr_Conn(50462976){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_BUMP @@ -922,9 +922,9 @@ - conn is still open to wait for SMS ack dance llist_count(&net->subscr_conns) == 1 - MS replies with CP-ACK for received SMS - rx from MS: pdisc=0x89 msg_type=0x04 + MSC <--RAN_GERAN_A-- MS: GSM48_PDISC_SMS:0x04 DREF MSISDN:46071: MSC conn use + 1 == 3 -DRLL Dispatching 04.08 message, pdisc=9 +DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x04 (0x9:0x4) DMM Subscr_Conn(50462976){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_COMMUNICATING DMM Subscr_Conn(50462976){SUBSCR_CONN_S_ACCEPTED}: state_chg to SUBSCR_CONN_S_COMMUNICATING DMM Subscr_Conn(50462976){SUBSCR_CONN_S_COMMUNICATING}: Received Event SUBSCR_CONN_E_BUMP @@ -932,12 +932,12 @@ DREF MSISDN:46071: MSC conn use - 1 == 2 llist_count(&net->subscr_conns) == 1 - MS also sends RP-ACK, MSC in turn sends CP-ACK for that - rx from MS: pdisc=0x89 msg_type=0x01 + MSC <--RAN_GERAN_A-- MS: GSM48_PDISC_SMS:0x01 DREF MSISDN:46071: MSC conn use + 1 == 3 -DRLL Dispatching 04.08 message, pdisc=9 +DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) DMM Subscr_Conn(50462976){SUBSCR_CONN_S_COMMUNICATING}: Received Event SUBSCR_CONN_E_COMMUNICATING DMSC msc_tx 2 bytes to MSISDN:46071 via RAN_GERAN_A -- DTAP --RAN_GERAN_A--> MS: 0904 +- DTAP --RAN_GERAN_A--> MS: GSM48_PDISC_SMS:0x04: 0904 - DTAP matches expected message DREF VLR subscr MSISDN:46071 usage decreases to: 3 DREF VLR subscr MSISDN:46071 usage decreases to: 2 @@ -962,10 +962,10 @@ llist_count(&net->subscr_conns) == 0 --- - subscriber detaches, using TMSI - rx from MS: pdisc=0x05 msg_type=0x01 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_IMSI_DETACH_IND new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_IMSI_DETACH_IND (0x5:0x1) DMM IMSI DETACH INDICATION: MI(TMSI)=50462976 DREF VLR subscr MSISDN:46071 usage increases to: 2 DMM IMSI DETACH for MSISDN:46071 @@ -983,10 +983,10 @@ ===== test_ciph_imei - Location Update request causes a GSUP Send Auth Info request to HLR - rx from MS: pdisc=0x05 msg_type=0x08 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_LOC_UPD_REQUEST new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_LOC_UPD_REQUEST (0x5:0x8) DREF unknown: MSC conn use + 1 == 2 DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Allocated DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Received Event SUBSCR_CONN_E_START @@ -1029,9 +1029,9 @@ auth_request_sent == 1 lu_result_sent == 0 - MS sends Authen Response, VLR accepts and sends Ciphering Mode Command to MS - rx from MS: pdisc=0x05 msg_type=0x54 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_AUTH_RESP DREF IMSI:901700000004620: MSC conn use + 1 == 2 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_AUTH_RESP (0x5:0x14) DMM IMSI:901700000004620: MM GSM AUTHENTICATION RESPONSE (sres = 2d8b2c3e) DVLR VLR_Authenticate(901700000004620){VLR_SUB_AS_WAIT_RESP}: Received Event VLR_AUTH_E_MS_AUTH_RESP DVLR SUBSCR(IMSI:901700000004620) received res: 2d 8b 2c 3e @@ -1052,17 +1052,17 @@ - needs ciph, not yet accepted msc_subscr_conn_is_accepted() == false requests shall be thwarted -DRLL Dispatching 04.08 message, pdisc=3 -DRLL subscr IMSI:901700000004620: Message not permitted for initial conn: pdisc=0x03 msg_type=0x05 -DRLL Dispatching 04.08 message, pdisc=5 -DRLL subscr IMSI:901700000004620: Message not permitted for initial conn: pdisc=0x05 msg_type=0x33 -DRLL Dispatching 04.08 message, pdisc=6 -DRLL subscr IMSI:901700000004620: Message not permitted for initial conn: pdisc=0x06 msg_type=0x19 -DRLL Dispatching 04.08 message, pdisc=9 -DRLL subscr IMSI:901700000004620: Message not permitted for initial conn: pdisc=0x09 msg_type=0x01 +DRLL Dispatching 04.08 message GSM48_MT_CC_SETUP (0x3:0x5) +DRLL subscr IMSI:901700000004620: Message not permitted for initial conn: GSM48_MT_CC_SETUP +DRLL Dispatching 04.08 message unknown 0x33 (0x5:0x33) +DRLL subscr IMSI:901700000004620: Message not permitted for initial conn: unknown 0x33 +DRLL Dispatching 04.08 message GSM48_MT_RR_SYSINFO_1 (0x6:0x19) +DRLL subscr IMSI:901700000004620: Message not permitted for initial conn: GSM48_MT_RR_SYSINFO_1 +DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) +DRLL subscr IMSI:901700000004620: Message not permitted for initial conn: GSM48_PDISC_SMS:0x01 lu_result_sent == 0 - MS sends Ciphering Mode Complete, VLR accepts and sends GSUP LU Req to HLR - rx from MS: pdisc=0x06 msg_type=0x32 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_RR_CIPH_M_COMPL DRR IMSI:901700000004620: CIPHERING MODE COMPLETE DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_WAIT_CIPH}: Received Event VLR_ULA_E_CIPH_RES DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_WAIT_CIPH}: vlr_loc_upd_post_ciph() @@ -1113,7 +1113,7 @@ DVLR lu_compl_vlr_fsm(901700000004620){LU_COMPL_VLR_S_WAIT_SUB_PRES}: Received Event LU_COMPL_VLR_E_SUB_PRES_COMPL DVLR lu_compl_vlr_fsm(901700000004620){LU_COMPL_VLR_S_WAIT_SUB_PRES}: state_chg to LU_COMPL_VLR_S_WAIT_IMEI DMSC msc_tx 3 bytes to MSISDN:46071 via RAN_GERAN_A -- DTAP --RAN_GERAN_A--> MS: 051802 +- DTAP --RAN_GERAN_A--> MS: GSM48_MT_MM_ID_REQ: 051802 - DTAP matches expected message DREF VLR subscr MSISDN:46071 usage decreases to: 1 <-- GSUP rx OSMO_GSUP_MSGT_UPDATE_LOCATION_RESULT: vlr_gsupc_read_cb() returns 0 @@ -1124,18 +1124,18 @@ DREF VLR subscr MSISDN:46071 usage decreases to: 1 msc_subscr_conn_is_accepted() == false requests shall be thwarted -DRLL Dispatching 04.08 message, pdisc=3 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x03 msg_type=0x05 -DRLL Dispatching 04.08 message, pdisc=5 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x05 msg_type=0x33 -DRLL Dispatching 04.08 message, pdisc=6 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x06 msg_type=0x19 -DRLL Dispatching 04.08 message, pdisc=9 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x09 msg_type=0x01 +DRLL Dispatching 04.08 message GSM48_MT_CC_SETUP (0x3:0x5) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_MT_CC_SETUP +DRLL Dispatching 04.08 message unknown 0x33 (0x5:0x33) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: unknown 0x33 +DRLL Dispatching 04.08 message GSM48_MT_RR_SYSINFO_1 (0x6:0x19) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_MT_RR_SYSINFO_1 +DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_PDISC_SMS:0x01 - MS replies with an Identity Response - rx from MS: pdisc=0x05 msg_type=0x59 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_ID_RESP DREF MSISDN:46071: MSC conn use + 1 == 2 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_ID_RESP (0x5:0x19) DMM IDENTITY RESPONSE: MI(IMEI)=423423423423423 DVLR set IMEI on subscriber; IMSI=901700000004620 IMEI=423423423423423 DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_WAIT_LU_COMPL}: Received Event VLR_ULA_E_ID_IMEI @@ -1177,10 +1177,10 @@ DREF VLR subscr MSISDN:46071 usage decreases to: 1 --- - subscriber detaches - rx from MS: pdisc=0x05 msg_type=0x01 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_IMSI_DETACH_IND new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_IMSI_DETACH_IND (0x5:0x1) DMM IMSI DETACH INDICATION: MI(IMSI)=901700000004620 DREF VLR subscr MSISDN:46071 usage increases to: 2 DMM IMSI DETACH for MSISDN:46071 @@ -1198,10 +1198,10 @@ ===== test_ciph_imeisv - Location Update request causes a GSUP Send Auth Info request to HLR - rx from MS: pdisc=0x05 msg_type=0x08 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_LOC_UPD_REQUEST new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_LOC_UPD_REQUEST (0x5:0x8) DREF unknown: MSC conn use + 1 == 2 DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Allocated DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Received Event SUBSCR_CONN_E_START @@ -1244,9 +1244,9 @@ auth_request_sent == 1 lu_result_sent == 0 - MS sends Authen Response, VLR accepts and sends Ciphering Mode Command to MS - rx from MS: pdisc=0x05 msg_type=0x54 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_AUTH_RESP DREF IMSI:901700000004620: MSC conn use + 1 == 2 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_AUTH_RESP (0x5:0x14) DMM IMSI:901700000004620: MM GSM AUTHENTICATION RESPONSE (sres = 2d8b2c3e) DVLR VLR_Authenticate(901700000004620){VLR_SUB_AS_WAIT_RESP}: Received Event VLR_AUTH_E_MS_AUTH_RESP DVLR SUBSCR(IMSI:901700000004620) received res: 2d 8b 2c 3e @@ -1269,20 +1269,20 @@ - needs ciph, not yet accepted msc_subscr_conn_is_accepted() == false requests shall be thwarted -DRLL Dispatching 04.08 message, pdisc=3 -DRLL subscr IMSI:901700000004620: Message not permitted for initial conn: pdisc=0x03 msg_type=0x05 -DRLL Dispatching 04.08 message, pdisc=5 -DRLL subscr IMSI:901700000004620: Message not permitted for initial conn: pdisc=0x05 msg_type=0x33 -DRLL Dispatching 04.08 message, pdisc=6 -DRLL subscr IMSI:901700000004620: Message not permitted for initial conn: pdisc=0x06 msg_type=0x19 -DRLL Dispatching 04.08 message, pdisc=9 -DRLL subscr IMSI:901700000004620: Message not permitted for initial conn: pdisc=0x09 msg_type=0x01 +DRLL Dispatching 04.08 message GSM48_MT_CC_SETUP (0x3:0x5) +DRLL subscr IMSI:901700000004620: Message not permitted for initial conn: GSM48_MT_CC_SETUP +DRLL Dispatching 04.08 message unknown 0x33 (0x5:0x33) +DRLL subscr IMSI:901700000004620: Message not permitted for initial conn: unknown 0x33 +DRLL Dispatching 04.08 message GSM48_MT_RR_SYSINFO_1 (0x6:0x19) +DRLL subscr IMSI:901700000004620: Message not permitted for initial conn: GSM48_MT_RR_SYSINFO_1 +DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) +DRLL subscr IMSI:901700000004620: Message not permitted for initial conn: GSM48_PDISC_SMS:0x01 lu_result_sent == 0 DREF VLR subscr IMSI:901700000004620 usage increases to: 2 vsub->imeisv[0] == 0 DREF VLR subscr IMSI:901700000004620 usage decreases to: 1 - MS sends Ciphering Mode Complete with IMEISV, VLR accepts and sends GSUP LU Req to HLR - rx from MS: pdisc=0x06 msg_type=0x32 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_RR_CIPH_M_COMPL DRR IMSI:901700000004620: CIPHERING MODE COMPLETE DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_WAIT_CIPH}: Received Event VLR_ULA_E_CIPH_RES DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_WAIT_CIPH}: got IMEISV: 4234234234234235F @@ -1303,18 +1303,18 @@ DREF VLR subscr IMSI:901700000004620 usage decreases to: 1 msc_subscr_conn_is_accepted() == false requests shall be thwarted -DRLL Dispatching 04.08 message, pdisc=3 -DRLL subscr IMSI:901700000004620: Message not permitted for initial conn: pdisc=0x03 msg_type=0x05 -DRLL Dispatching 04.08 message, pdisc=5 -DRLL subscr IMSI:901700000004620: Message not permitted for initial conn: pdisc=0x05 msg_type=0x33 -DRLL Dispatching 04.08 message, pdisc=6 -DRLL subscr IMSI:901700000004620: Message not permitted for initial conn: pdisc=0x06 msg_type=0x19 -DRLL Dispatching 04.08 message, pdisc=9 -DRLL subscr IMSI:901700000004620: Message not permitted for initial conn: pdisc=0x09 msg_type=0x01 +DRLL Dispatching 04.08 message GSM48_MT_CC_SETUP (0x3:0x5) +DRLL subscr IMSI:901700000004620: Message not permitted for initial conn: GSM48_MT_CC_SETUP +DRLL Dispatching 04.08 message unknown 0x33 (0x5:0x33) +DRLL subscr IMSI:901700000004620: Message not permitted for initial conn: unknown 0x33 +DRLL Dispatching 04.08 message GSM48_MT_RR_SYSINFO_1 (0x6:0x19) +DRLL subscr IMSI:901700000004620: Message not permitted for initial conn: GSM48_MT_RR_SYSINFO_1 +DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) +DRLL subscr IMSI:901700000004620: Message not permitted for initial conn: GSM48_PDISC_SMS:0x01 - MS replies with an Identity Response - rx from MS: pdisc=0x05 msg_type=0x59 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_ID_RESP DREF IMSI:901700000004620: MSC conn use + 1 == 2 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_ID_RESP (0x5:0x19) DMM IDENTITY RESPONSE: MI(IMEI)=423423423423423 DVLR set IMEI on subscriber; IMSI=901700000004620 IMEI=423423423423423 DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_WAIT_HLR_UPD}: Received Event VLR_ULA_E_ID_IMEI @@ -1391,10 +1391,10 @@ llist_count(&net->subscr_conns) == 0 --- - subscriber detaches - rx from MS: pdisc=0x05 msg_type=0x01 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_IMSI_DETACH_IND new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_IMSI_DETACH_IND (0x5:0x1) DMM IMSI DETACH INDICATION: MI(IMSI)=901700000004620 DREF VLR subscr MSISDN:46071 usage increases to: 2 DMM IMSI DETACH for MSISDN:46071 @@ -1412,10 +1412,10 @@ ===== test_ciph_tmsi_imei - Location Update request causes a GSUP Send Auth Info request to HLR - rx from MS: pdisc=0x05 msg_type=0x08 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_LOC_UPD_REQUEST new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_LOC_UPD_REQUEST (0x5:0x8) DREF unknown: MSC conn use + 1 == 2 DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Allocated DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Received Event SUBSCR_CONN_E_START @@ -1458,9 +1458,9 @@ auth_request_sent == 1 lu_result_sent == 0 - MS sends Authen Response, VLR accepts and sends Ciphering Mode Command to MS - rx from MS: pdisc=0x05 msg_type=0x54 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_AUTH_RESP DREF IMSI:901700000004620: MSC conn use + 1 == 2 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_AUTH_RESP (0x5:0x14) DMM IMSI:901700000004620: MM GSM AUTHENTICATION RESPONSE (sres = 2d8b2c3e) DVLR VLR_Authenticate(901700000004620){VLR_SUB_AS_WAIT_RESP}: Received Event VLR_AUTH_E_MS_AUTH_RESP DVLR SUBSCR(IMSI:901700000004620) received res: 2d 8b 2c 3e @@ -1481,17 +1481,17 @@ - needs ciph, not yet accepted msc_subscr_conn_is_accepted() == false requests shall be thwarted -DRLL Dispatching 04.08 message, pdisc=3 -DRLL subscr IMSI:901700000004620: Message not permitted for initial conn: pdisc=0x03 msg_type=0x05 -DRLL Dispatching 04.08 message, pdisc=5 -DRLL subscr IMSI:901700000004620: Message not permitted for initial conn: pdisc=0x05 msg_type=0x33 -DRLL Dispatching 04.08 message, pdisc=6 -DRLL subscr IMSI:901700000004620: Message not permitted for initial conn: pdisc=0x06 msg_type=0x19 -DRLL Dispatching 04.08 message, pdisc=9 -DRLL subscr IMSI:901700000004620: Message not permitted for initial conn: pdisc=0x09 msg_type=0x01 +DRLL Dispatching 04.08 message GSM48_MT_CC_SETUP (0x3:0x5) +DRLL subscr IMSI:901700000004620: Message not permitted for initial conn: GSM48_MT_CC_SETUP +DRLL Dispatching 04.08 message unknown 0x33 (0x5:0x33) +DRLL subscr IMSI:901700000004620: Message not permitted for initial conn: unknown 0x33 +DRLL Dispatching 04.08 message GSM48_MT_RR_SYSINFO_1 (0x6:0x19) +DRLL subscr IMSI:901700000004620: Message not permitted for initial conn: GSM48_MT_RR_SYSINFO_1 +DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) +DRLL subscr IMSI:901700000004620: Message not permitted for initial conn: GSM48_PDISC_SMS:0x01 lu_result_sent == 0 - MS sends Ciphering Mode Complete, VLR accepts and sends GSUP LU Req to HLR - rx from MS: pdisc=0x06 msg_type=0x32 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_RR_CIPH_M_COMPL DRR IMSI:901700000004620: CIPHERING MODE COMPLETE DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_WAIT_CIPH}: Received Event VLR_ULA_E_CIPH_RES DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_WAIT_CIPH}: vlr_loc_upd_post_ciph() @@ -1542,7 +1542,7 @@ DVLR lu_compl_vlr_fsm(901700000004620){LU_COMPL_VLR_S_WAIT_SUB_PRES}: Received Event LU_COMPL_VLR_E_SUB_PRES_COMPL DVLR lu_compl_vlr_fsm(901700000004620){LU_COMPL_VLR_S_WAIT_SUB_PRES}: state_chg to LU_COMPL_VLR_S_WAIT_IMEI_TMSI DMSC msc_tx 3 bytes to MSISDN:46071 via RAN_GERAN_A -- DTAP --RAN_GERAN_A--> MS: 051802 +- DTAP --RAN_GERAN_A--> MS: GSM48_MT_MM_ID_REQ: 051802 - DTAP matches expected message DREF VLR subscr MSISDN:46071 usage decreases to: 1 <-- GSUP rx OSMO_GSUP_MSGT_UPDATE_LOCATION_RESULT: vlr_gsupc_read_cb() returns 0 @@ -1553,18 +1553,18 @@ DREF VLR subscr MSISDN:46071 usage decreases to: 1 msc_subscr_conn_is_accepted() == false requests shall be thwarted -DRLL Dispatching 04.08 message, pdisc=3 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x03 msg_type=0x05 -DRLL Dispatching 04.08 message, pdisc=5 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x05 msg_type=0x33 -DRLL Dispatching 04.08 message, pdisc=6 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x06 msg_type=0x19 -DRLL Dispatching 04.08 message, pdisc=9 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x09 msg_type=0x01 +DRLL Dispatching 04.08 message GSM48_MT_CC_SETUP (0x3:0x5) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_MT_CC_SETUP +DRLL Dispatching 04.08 message unknown 0x33 (0x5:0x33) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: unknown 0x33 +DRLL Dispatching 04.08 message GSM48_MT_RR_SYSINFO_1 (0x6:0x19) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_MT_RR_SYSINFO_1 +DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_PDISC_SMS:0x01 - MS replies with an Identity Response - rx from MS: pdisc=0x05 msg_type=0x59 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_ID_RESP DREF MSISDN:46071: MSC conn use + 1 == 2 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_ID_RESP (0x5:0x19) DMM IDENTITY RESPONSE: MI(IMEI)=423423423423423 DVLR set IMEI on subscriber; IMSI=901700000004620 IMEI=423423423423423 DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_WAIT_LU_COMPL}: Received Event VLR_ULA_E_ID_IMEI @@ -1579,14 +1579,14 @@ lu_result_sent == 1 msc_subscr_conn_is_accepted() == false requests shall be thwarted -DRLL Dispatching 04.08 message, pdisc=3 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x03 msg_type=0x05 -DRLL Dispatching 04.08 message, pdisc=5 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x05 msg_type=0x33 -DRLL Dispatching 04.08 message, pdisc=6 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x06 msg_type=0x19 -DRLL Dispatching 04.08 message, pdisc=9 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x09 msg_type=0x01 +DRLL Dispatching 04.08 message GSM48_MT_CC_SETUP (0x3:0x5) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_MT_CC_SETUP +DRLL Dispatching 04.08 message unknown 0x33 (0x5:0x33) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: unknown 0x33 +DRLL Dispatching 04.08 message GSM48_MT_RR_SYSINFO_1 (0x6:0x19) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_MT_RR_SYSINFO_1 +DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_PDISC_SMS:0x01 - even though the TMSI is not acked, we can already find the subscr with it DREF VLR subscr MSISDN:46071 usage increases to: 2 vsub != NULL == 1 @@ -1595,9 +1595,9 @@ vsub->tmsi == 0xffffffff DREF VLR subscr MSISDN:46071 usage decreases to: 1 - MS sends TMSI Realloc Complete - rx from MS: pdisc=0x05 msg_type=0x5b + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_TMSI_REALL_COMPL DREF MSISDN:46071: MSC conn use + 1 == 2 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_TMSI_REALL_COMPL (0x5:0x1b) DMM TMSI Reallocation Completed. Subscriber: MSISDN:46071 DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_WAIT_LU_COMPL}: Received Event VLR_ULA_E_NEW_TMSI_ACK DVLR lu_compl_vlr_fsm(901700000004620){LU_COMPL_VLR_S_WAIT_TMSI_CNF}: Received Event LU_COMPL_VLR_E_NEW_TMSI_ACK @@ -1637,10 +1637,10 @@ DREF VLR subscr MSISDN:46071 usage decreases to: 1 --- - subscriber detaches, using TMSI - rx from MS: pdisc=0x05 msg_type=0x01 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_IMSI_DETACH_IND new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_IMSI_DETACH_IND (0x5:0x1) DMM IMSI DETACH INDICATION: MI(TMSI)=50462976 DREF VLR subscr MSISDN:46071 usage increases to: 2 DMM IMSI DETACH for MSISDN:46071 diff --git a/tests/msc_vlr/msc_vlr_test_hlr_reject.err b/tests/msc_vlr/msc_vlr_test_hlr_reject.err index 4c566d1..9650df9 100644 --- a/tests/msc_vlr/msc_vlr_test_hlr_reject.err +++ b/tests/msc_vlr/msc_vlr_test_hlr_reject.err @@ -1,9 +1,9 @@ ===== test_hlr_rej_auth_info_unknown_imsi - Location Update request causes a GSUP Send Auth Info request to HLR - rx from MS: pdisc=0x05 msg_type=0x08 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_LOC_UPD_REQUEST new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_LOC_UPD_REQUEST (0x5:0x8) DREF unknown: MSC conn use + 1 == 2 DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Allocated DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Received Event SUBSCR_CONN_E_START @@ -74,10 +74,10 @@ ===== test_hlr_rej_auth_info_net_fail - Location Update request causes a GSUP Send Auth Info request to HLR - rx from MS: pdisc=0x05 msg_type=0x08 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_LOC_UPD_REQUEST new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_LOC_UPD_REQUEST (0x5:0x8) DREF unknown: MSC conn use + 1 == 2 DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Allocated DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Received Event SUBSCR_CONN_E_START @@ -150,10 +150,10 @@ --- - Submit a used auth tuple in the VLR - Location Update request causes a GSUP Send Auth Info request to HLR - rx from MS: pdisc=0x05 msg_type=0x08 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_LOC_UPD_REQUEST new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_LOC_UPD_REQUEST (0x5:0x8) DREF unknown: MSC conn use + 1 == 2 DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Allocated DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Received Event SUBSCR_CONN_E_START @@ -196,9 +196,9 @@ auth_request_sent == 1 lu_result_sent == 0 - MS sends Authen Response, VLR accepts and sends GSUP LU Req to HLR - rx from MS: pdisc=0x05 msg_type=0x54 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_AUTH_RESP DREF IMSI:901700000004620: MSC conn use + 1 == 2 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_AUTH_RESP (0x5:0x14) DMM IMSI:901700000004620: MM GSM AUTHENTICATION RESPONSE (sres = 2d8b2c3e) DVLR VLR_Authenticate(901700000004620){VLR_SUB_AS_WAIT_RESP}: Received Event VLR_AUTH_E_MS_AUTH_RESP DVLR SUBSCR(IMSI:901700000004620) received res: 2d 8b 2c 3e @@ -299,10 +299,10 @@ --- - Another LU wants to get new tuples; even though HLR sends Network Failure, we are reusing the old tuples. - Location Update request causes a GSUP Send Auth Info request to HLR - rx from MS: pdisc=0x05 msg_type=0x08 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_LOC_UPD_REQUEST new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_LOC_UPD_REQUEST (0x5:0x8) DREF unknown: MSC conn use + 1 == 2 DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Allocated DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Received Event SUBSCR_CONN_E_START @@ -343,9 +343,9 @@ auth_request_sent == 1 lu_result_sent == 0 - MS sends Authen Response, VLR accepts and sends GSUP LU Req to HLR - rx from MS: pdisc=0x05 msg_type=0x54 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_AUTH_RESP DREF MSISDN:46071: MSC conn use + 1 == 2 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_AUTH_RESP (0x5:0x14) DMM MSISDN:46071: MM GSM AUTHENTICATION RESPONSE (sres = 2d8b2c3e) DVLR VLR_Authenticate(901700000004620){VLR_SUB_AS_WAIT_RESP}: Received Event VLR_AUTH_E_MS_AUTH_RESP DVLR SUBSCR(MSISDN:46071) received res: 2d 8b 2c 3e @@ -447,10 +447,10 @@ --- - Submit a used auth tuple in the VLR - Location Update request causes a GSUP Send Auth Info request to HLR - rx from MS: pdisc=0x05 msg_type=0x08 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_LOC_UPD_REQUEST new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_LOC_UPD_REQUEST (0x5:0x8) DREF unknown: MSC conn use + 1 == 2 DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Allocated DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Received Event SUBSCR_CONN_E_START @@ -493,9 +493,9 @@ auth_request_sent == 1 lu_result_sent == 0 - MS sends Authen Response, VLR accepts and sends GSUP LU Req to HLR - rx from MS: pdisc=0x05 msg_type=0x54 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_AUTH_RESP DREF IMSI:901700000004620: MSC conn use + 1 == 2 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_AUTH_RESP (0x5:0x14) DMM IMSI:901700000004620: MM GSM AUTHENTICATION RESPONSE (sres = 2d8b2c3e) DVLR VLR_Authenticate(901700000004620){VLR_SUB_AS_WAIT_RESP}: Received Event VLR_AUTH_E_MS_AUTH_RESP DVLR SUBSCR(IMSI:901700000004620) received res: 2d 8b 2c 3e @@ -596,10 +596,10 @@ --- - Another LU wants to get new tuples; HLR sends Network Failure, we reject. - Location Update request causes a GSUP Send Auth Info request to HLR - rx from MS: pdisc=0x05 msg_type=0x08 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_LOC_UPD_REQUEST new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_LOC_UPD_REQUEST (0x5:0x8) DREF unknown: MSC conn use + 1 == 2 DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Allocated DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Received Event SUBSCR_CONN_E_START @@ -670,10 +670,10 @@ --- - Submit a used auth tuple in the VLR - Location Update request causes a GSUP Send Auth Info request to HLR - rx from MS: pdisc=0x05 msg_type=0x08 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_LOC_UPD_REQUEST new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_LOC_UPD_REQUEST (0x5:0x8) DREF unknown: MSC conn use + 1 == 2 DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Allocated DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Received Event SUBSCR_CONN_E_START @@ -716,9 +716,9 @@ auth_request_sent == 1 lu_result_sent == 0 - MS sends Authen Response, VLR accepts and sends GSUP LU Req to HLR - rx from MS: pdisc=0x05 msg_type=0x54 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_AUTH_RESP DREF IMSI:901700000004620: MSC conn use + 1 == 2 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_AUTH_RESP (0x5:0x14) DMM IMSI:901700000004620: MM GSM AUTHENTICATION RESPONSE (sres = 2d8b2c3e) DVLR VLR_Authenticate(901700000004620){VLR_SUB_AS_WAIT_RESP}: Received Event VLR_AUTH_E_MS_AUTH_RESP DVLR SUBSCR(IMSI:901700000004620) received res: 2d 8b 2c 3e @@ -820,10 +820,10 @@ - Another LU wants to get new tuples; HLR sends IMSI Unknown. Even though we would re-use an old tuple, reject the unknown IMSI. net->vlr->cfg.auth_reuse_old_sets_on_error == 1 - Location Update request causes a GSUP Send Auth Info request to HLR - rx from MS: pdisc=0x05 msg_type=0x08 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_LOC_UPD_REQUEST new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_LOC_UPD_REQUEST (0x5:0x8) DREF unknown: MSC conn use + 1 == 2 DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Allocated DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Received Event SUBSCR_CONN_E_START @@ -892,10 +892,10 @@ ===== test_hlr_acc_but_no_auth_tuples - Location Update request causes a GSUP Send Auth Info request to HLR - rx from MS: pdisc=0x05 msg_type=0x08 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_LOC_UPD_REQUEST new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_LOC_UPD_REQUEST (0x5:0x8) DREF unknown: MSC conn use + 1 == 2 DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Allocated DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Received Event SUBSCR_CONN_E_START @@ -965,10 +965,10 @@ ===== test_hlr_rej_lu - Location Update request causes a GSUP LU request to HLR - rx from MS: pdisc=0x05 msg_type=0x08 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_LOC_UPD_REQUEST new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_LOC_UPD_REQUEST (0x5:0x8) DREF unknown: MSC conn use + 1 == 2 DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Allocated DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Received Event SUBSCR_CONN_E_START @@ -1041,10 +1041,10 @@ ===== test_hlr_no_insert_data - Location Update request causes a GSUP LU request to HLR - rx from MS: pdisc=0x05 msg_type=0x08 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_LOC_UPD_REQUEST new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_LOC_UPD_REQUEST (0x5:0x8) DREF unknown: MSC conn use + 1 == 2 DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Allocated DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Received Event SUBSCR_CONN_E_START diff --git a/tests/msc_vlr/msc_vlr_test_hlr_timeout.err b/tests/msc_vlr/msc_vlr_test_hlr_timeout.err index 7c04f46..f83cc29 100644 --- a/tests/msc_vlr/msc_vlr_test_hlr_timeout.err +++ b/tests/msc_vlr/msc_vlr_test_hlr_timeout.err @@ -1,10 +1,10 @@ ===== test_hlr_timeout_lu_auth_info - Total time passed: 0.000000 s - Location Update request causes a GSUP Send Auth Info request to HLR - rx from MS: pdisc=0x05 msg_type=0x08 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_LOC_UPD_REQUEST new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_LOC_UPD_REQUEST (0x5:0x8) DREF unknown: MSC conn use + 1 == 2 DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Allocated DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Received Event SUBSCR_CONN_E_START @@ -83,10 +83,10 @@ ===== test_hlr_timeout_lu_upd_loc_result - Total time passed: 0.000000 s - Location Update request causes a GSUP LU request to HLR - rx from MS: pdisc=0x05 msg_type=0x08 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_LOC_UPD_REQUEST new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_LOC_UPD_REQUEST (0x5:0x8) DREF unknown: MSC conn use + 1 == 2 DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Allocated DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Received Event SUBSCR_CONN_E_START diff --git a/tests/msc_vlr/msc_vlr_test_ms_timeout.err b/tests/msc_vlr/msc_vlr_test_ms_timeout.err index 046548c..1574ef9 100644 --- a/tests/msc_vlr/msc_vlr_test_ms_timeout.err +++ b/tests/msc_vlr/msc_vlr_test_ms_timeout.err @@ -1,10 +1,10 @@ ===== test_ms_timeout_lu_auth_resp - Total time passed: 0.000000 s - Location Update request causes a GSUP Send Auth Info request to HLR - rx from MS: pdisc=0x05 msg_type=0x08 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_LOC_UPD_REQUEST new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_LOC_UPD_REQUEST (0x5:0x8) DREF unknown: MSC conn use + 1 == 2 DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Allocated DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Received Event SUBSCR_CONN_E_START @@ -103,10 +103,10 @@ ===== test_ms_timeout_cm_auth_resp - Total time passed: 0.000000 s - Location Update request causes a GSUP Send Auth Info request to HLR - rx from MS: pdisc=0x05 msg_type=0x08 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_LOC_UPD_REQUEST new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_LOC_UPD_REQUEST (0x5:0x8) DREF unknown: MSC conn use + 1 == 2 DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Allocated DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Received Event SUBSCR_CONN_E_START @@ -149,9 +149,9 @@ auth_request_sent == 1 lu_result_sent == 0 - MS sends Authen Response, VLR accepts and sends GSUP LU Req to HLR - rx from MS: pdisc=0x05 msg_type=0x54 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_AUTH_RESP DREF IMSI:901700000004620: MSC conn use + 1 == 2 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_AUTH_RESP (0x5:0x14) DMM IMSI:901700000004620: MM GSM AUTHENTICATION RESPONSE (sres = 2d8b2c3e) DVLR VLR_Authenticate(901700000004620){VLR_SUB_AS_WAIT_RESP}: Received Event VLR_AUTH_E_MS_AUTH_RESP DVLR SUBSCR(IMSI:901700000004620) received res: 2d 8b 2c 3e @@ -246,10 +246,10 @@ llist_count(&net->subscr_conns) == 0 --- - after a while, a new conn sends a CM Service Request. VLR responds with Auth Req, 2nd auth vector - rx from MS: pdisc=0x05 msg_type=0x24 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_CM_SERV_REQ new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_CM_SERV_REQ (0x5:0x24) DMM <- CM SERVICE REQUEST serv_type=0x08 MI(IMSI)=901700000004620 DREF unknown: MSC conn use + 1 == 2 DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Allocated diff --git a/tests/msc_vlr/msc_vlr_test_no_authen.err b/tests/msc_vlr/msc_vlr_test_no_authen.err index 99454fc..015e55b 100644 --- a/tests/msc_vlr/msc_vlr_test_no_authen.err +++ b/tests/msc_vlr/msc_vlr_test_no_authen.err @@ -1,9 +1,9 @@ ===== test_no_authen - Location Update request causes a GSUP LU request to HLR - rx from MS: pdisc=0x05 msg_type=0x08 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_LOC_UPD_REQUEST new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_LOC_UPD_REQUEST (0x5:0x8) DREF unknown: MSC conn use + 1 == 2 DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Allocated DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Received Event SUBSCR_CONN_E_START @@ -46,14 +46,14 @@ - having received subscriber data does not mean acceptance msc_subscr_conn_is_accepted() == false requests shall be thwarted -DRLL Dispatching 04.08 message, pdisc=3 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x03 msg_type=0x05 -DRLL Dispatching 04.08 message, pdisc=5 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x05 msg_type=0x33 -DRLL Dispatching 04.08 message, pdisc=6 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x06 msg_type=0x19 -DRLL Dispatching 04.08 message, pdisc=9 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x09 msg_type=0x01 +DRLL Dispatching 04.08 message GSM48_MT_CC_SETUP (0x3:0x5) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_MT_CC_SETUP +DRLL Dispatching 04.08 message unknown 0x33 (0x5:0x33) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: unknown 0x33 +DRLL Dispatching 04.08 message GSM48_MT_RR_SYSINFO_1 (0x6:0x19) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_MT_RR_SYSINFO_1 +DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_PDISC_SMS:0x01 lu_result_sent == 0 - HLR also sends GSUP _UPDATE_LOCATION_RESULT <-- GSUP rx OSMO_GSUP_MSGT_UPDATE_LOCATION_RESULT: 06010809710000004026f0 @@ -115,10 +115,10 @@ llist_count(&net->subscr_conns) == 0 --- - after a while, a new conn sends a CM Service Request - rx from MS: pdisc=0x05 msg_type=0x24 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_CM_SERV_REQ new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_CM_SERV_REQ (0x5:0x24) DMM <- CM SERVICE REQUEST serv_type=0x08 MI(IMSI)=901700000004620 DREF unknown: MSC conn use + 1 == 2 DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Allocated @@ -156,16 +156,16 @@ - a USSD request is serviced expecting USSD: Your extension is 46071 - rx from MS: pdisc=0x0b msg_type=0x3b + MSC <--RAN_GERAN_A-- MS: GSM48_PDISC_NC_SS:0x3b DREF MSISDN:46071: MSC conn use + 1 == 2 -DRLL Dispatching 04.08 message, pdisc=11 -DMM MSISDN:46071 pdisc=11 msg_type=0x3b: received_cm_service_request changes to false +DRLL Dispatching 04.08 message GSM48_PDISC_NC_SS:0x3b (0xb:0x3b) +DMM MSISDN:46071: rx msg GSM48_PDISC_NC_SS:0x3b: received_cm_service_request changes to false DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_COMMUNICATING DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_ACCEPTED}: state_chg to SUBSCR_CONN_S_COMMUNICATING DMM USSD: Own number requested DMM MSISDN:46071: MSISDN = 46071 DMSC msc_tx 43 bytes to MSISDN:46071 via RAN_GERAN_A -- DTAP --RAN_GERAN_A--> MS: 8b2a1c27a225020100302002013b301b04010f0416d9775d0e2ae3e965f73cfd7683d27310cd06bbc51a0d +- DTAP --RAN_GERAN_A--> MS: GSM48_PDISC_NC_SS:0x2a: 8b2a1c27a225020100302002013b301b04010f0416d9775d0e2ae3e965f73cfd7683d27310cd06bbc51a0d - DTAP matches expected message DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_COMMUNICATING}: Received Event SUBSCR_CONN_E_BUMP DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_COMMUNICATING}: bump: releasing conn @@ -203,10 +203,10 @@ llist_count(&vsub->cs.requests) == 1 DREF VLR subscr MSISDN:46071 usage decreases to: 3 - MS replies with Paging Response, we deliver the SMS - rx from MS: pdisc=0x06 msg_type=0x27 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_RR_PAG_RESP new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=6 +DRLL Dispatching 04.08 message GSM48_MT_RR_PAG_RESP (0x6:0x27) DRR PAGING RESPONSE: MI(IMSI)=901700000004620 DREF unknown: MSC conn use + 1 == 2 DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Allocated @@ -236,7 +236,7 @@ DREF VLR subscr MSISDN:46071 usage increases to: 6 DREF MSISDN:46071: MSC conn use + 1 == 3 DMSC msc_tx 91 bytes to MSISDN:46071 via RAN_GERAN_A -- DTAP --RAN_GERAN_A--> MS: 09015801000791447758100650004c0005806470f1000007101000000000445079da1e1ee7416937485e9ea7c965373d1d6683c270383b3d0ed3d36ff71c949e83c22072799e9687c5ec32a81d96afcbf4b4fb0c7ac3e9e9b7db05 +- DTAP --RAN_GERAN_A--> MS: GSM48_PDISC_SMS:0x01: 09015801000791447758100650004c0005806470f1000007101000000000445079da1e1ee7416937485e9ea7c965373d1d6683c270383b3d0ed3d36ff71c949e83c22072799e9687c5ec32a81d96afcbf4b4fb0c7ac3e9e9b7db05 - DTAP matches expected message DREF VLR subscr MSISDN:46071 usage decreases to: 5 DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_BUMP @@ -254,9 +254,9 @@ - conn is still open to wait for SMS ack dance llist_count(&net->subscr_conns) == 1 - MS replies with CP-ACK for received SMS - rx from MS: pdisc=0x89 msg_type=0x04 + MSC <--RAN_GERAN_A-- MS: GSM48_PDISC_SMS:0x04 DREF MSISDN:46071: MSC conn use + 1 == 3 -DRLL Dispatching 04.08 message, pdisc=9 +DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x04 (0x9:0x4) DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_COMMUNICATING DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_ACCEPTED}: state_chg to SUBSCR_CONN_S_COMMUNICATING DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_COMMUNICATING}: Received Event SUBSCR_CONN_E_BUMP @@ -264,12 +264,12 @@ DREF MSISDN:46071: MSC conn use - 1 == 2 llist_count(&net->subscr_conns) == 1 - MS also sends RP-ACK, MSC in turn sends CP-ACK for that - rx from MS: pdisc=0x89 msg_type=0x01 + MSC <--RAN_GERAN_A-- MS: GSM48_PDISC_SMS:0x01 DREF MSISDN:46071: MSC conn use + 1 == 3 -DRLL Dispatching 04.08 message, pdisc=9 +DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_COMMUNICATING}: Received Event SUBSCR_CONN_E_COMMUNICATING DMSC msc_tx 2 bytes to MSISDN:46071 via RAN_GERAN_A -- DTAP --RAN_GERAN_A--> MS: 0904 +- DTAP --RAN_GERAN_A--> MS: GSM48_PDISC_SMS:0x04: 0904 - DTAP matches expected message DREF VLR subscr MSISDN:46071 usage decreases to: 3 DREF VLR subscr MSISDN:46071 usage decreases to: 2 @@ -294,10 +294,10 @@ llist_count(&net->subscr_conns) == 0 --- - subscriber detaches - rx from MS: pdisc=0x05 msg_type=0x01 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_IMSI_DETACH_IND new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_IMSI_DETACH_IND (0x5:0x1) DMM IMSI DETACH INDICATION: MI(IMSI)=901700000004620 DREF VLR subscr MSISDN:46071 usage increases to: 2 DMM IMSI DETACH for MSISDN:46071 @@ -315,10 +315,10 @@ ===== test_no_authen_tmsi - Location Update request causes a GSUP LU request to HLR - rx from MS: pdisc=0x05 msg_type=0x08 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_LOC_UPD_REQUEST new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_LOC_UPD_REQUEST (0x5:0x8) DREF unknown: MSC conn use + 1 == 2 DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Allocated DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Received Event SUBSCR_CONN_E_START @@ -361,14 +361,14 @@ - having received subscriber data does not mean acceptance msc_subscr_conn_is_accepted() == false requests shall be thwarted -DRLL Dispatching 04.08 message, pdisc=3 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x03 msg_type=0x05 -DRLL Dispatching 04.08 message, pdisc=5 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x05 msg_type=0x33 -DRLL Dispatching 04.08 message, pdisc=6 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x06 msg_type=0x19 -DRLL Dispatching 04.08 message, pdisc=9 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x09 msg_type=0x01 +DRLL Dispatching 04.08 message GSM48_MT_CC_SETUP (0x3:0x5) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_MT_CC_SETUP +DRLL Dispatching 04.08 message unknown 0x33 (0x5:0x33) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: unknown 0x33 +DRLL Dispatching 04.08 message GSM48_MT_RR_SYSINFO_1 (0x6:0x19) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_MT_RR_SYSINFO_1 +DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_PDISC_SMS:0x01 lu_result_sent == 0 - HLR also sends GSUP _UPDATE_LOCATION_RESULT <-- GSUP rx OSMO_GSUP_MSGT_UPDATE_LOCATION_RESULT: 06010809710000004026f0 @@ -406,14 +406,14 @@ lu_result_sent == 1 msc_subscr_conn_is_accepted() == false requests shall be thwarted -DRLL Dispatching 04.08 message, pdisc=3 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x03 msg_type=0x05 -DRLL Dispatching 04.08 message, pdisc=5 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x05 msg_type=0x33 -DRLL Dispatching 04.08 message, pdisc=6 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x06 msg_type=0x19 -DRLL Dispatching 04.08 message, pdisc=9 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x09 msg_type=0x01 +DRLL Dispatching 04.08 message GSM48_MT_CC_SETUP (0x3:0x5) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_MT_CC_SETUP +DRLL Dispatching 04.08 message unknown 0x33 (0x5:0x33) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: unknown 0x33 +DRLL Dispatching 04.08 message GSM48_MT_RR_SYSINFO_1 (0x6:0x19) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_MT_RR_SYSINFO_1 +DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_PDISC_SMS:0x01 - even though the TMSI is not acked, we can already find the subscr with it DREF VLR subscr MSISDN:46071 usage increases to: 2 vsub != NULL == 1 @@ -422,9 +422,9 @@ vsub->tmsi == 0xffffffff DREF VLR subscr MSISDN:46071 usage decreases to: 1 - MS sends TMSI Realloc Complete - rx from MS: pdisc=0x05 msg_type=0x5b + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_TMSI_REALL_COMPL DREF MSISDN:46071: MSC conn use + 1 == 2 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_TMSI_REALL_COMPL (0x5:0x1b) DMM TMSI Reallocation Completed. Subscriber: MSISDN:46071 DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_WAIT_LU_COMPL}: Received Event VLR_ULA_E_NEW_TMSI_ACK DVLR lu_compl_vlr_fsm(901700000004620){LU_COMPL_VLR_S_WAIT_TMSI_CNF}: Received Event LU_COMPL_VLR_E_NEW_TMSI_ACK @@ -466,10 +466,10 @@ DREF VLR subscr MSISDN:46071 usage decreases to: 1 --- - after a while, a new conn sends a CM Service Request using above TMSI - rx from MS: pdisc=0x05 msg_type=0x24 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_CM_SERV_REQ new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_CM_SERV_REQ (0x5:0x24) DMM <- CM SERVICE REQUEST serv_type=0x08 MI(TMSI)=50462976 DREF unknown: MSC conn use + 1 == 2 DMM Subscr_Conn(50462976){SUBSCR_CONN_S_INIT}: Allocated @@ -507,16 +507,16 @@ - a USSD request is serviced expecting USSD: Your extension is 46071 - rx from MS: pdisc=0x0b msg_type=0x3b + MSC <--RAN_GERAN_A-- MS: GSM48_PDISC_NC_SS:0x3b DREF MSISDN:46071: MSC conn use + 1 == 2 -DRLL Dispatching 04.08 message, pdisc=11 -DMM MSISDN:46071 pdisc=11 msg_type=0x3b: received_cm_service_request changes to false +DRLL Dispatching 04.08 message GSM48_PDISC_NC_SS:0x3b (0xb:0x3b) +DMM MSISDN:46071: rx msg GSM48_PDISC_NC_SS:0x3b: received_cm_service_request changes to false DMM Subscr_Conn(50462976){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_COMMUNICATING DMM Subscr_Conn(50462976){SUBSCR_CONN_S_ACCEPTED}: state_chg to SUBSCR_CONN_S_COMMUNICATING DMM USSD: Own number requested DMM MSISDN:46071: MSISDN = 46071 DMSC msc_tx 43 bytes to MSISDN:46071 via RAN_GERAN_A -- DTAP --RAN_GERAN_A--> MS: 8b2a1c27a225020100302002013b301b04010f0416d9775d0e2ae3e965f73cfd7683d27310cd06bbc51a0d +- DTAP --RAN_GERAN_A--> MS: GSM48_PDISC_NC_SS:0x2a: 8b2a1c27a225020100302002013b301b04010f0416d9775d0e2ae3e965f73cfd7683d27310cd06bbc51a0d - DTAP matches expected message DMM Subscr_Conn(50462976){SUBSCR_CONN_S_COMMUNICATING}: Received Event SUBSCR_CONN_E_BUMP DMM Subscr_Conn(50462976){SUBSCR_CONN_S_COMMUNICATING}: bump: releasing conn @@ -553,10 +553,10 @@ llist_count(&vsub->cs.requests) == 1 DREF VLR subscr MSISDN:46071 usage decreases to: 3 - MS replies with Paging Response using TMSI, we deliver the SMS - rx from MS: pdisc=0x06 msg_type=0x27 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_RR_PAG_RESP new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=6 +DRLL Dispatching 04.08 message GSM48_MT_RR_PAG_RESP (0x6:0x27) DRR PAGING RESPONSE: MI(TMSI)=50462976 DREF unknown: MSC conn use + 1 == 2 DMM Subscr_Conn(50462976){SUBSCR_CONN_S_INIT}: Allocated @@ -586,7 +586,7 @@ DREF VLR subscr MSISDN:46071 usage increases to: 6 DREF MSISDN:46071: MSC conn use + 1 == 3 DMSC msc_tx 91 bytes to MSISDN:46071 via RAN_GERAN_A -- DTAP --RAN_GERAN_A--> MS: 09015801000791447758100650004c0005806470f1000007101000000000445079da1e1ee7416937485e9ea7c965373d1d6683c270383b3d0ed3d36ff71c949e83c22072799e9687c5ec32a81d96afcbf4b4fb0c7ac3e9e9b7db05 +- DTAP --RAN_GERAN_A--> MS: GSM48_PDISC_SMS:0x01: 09015801000791447758100650004c0005806470f1000007101000000000445079da1e1ee7416937485e9ea7c965373d1d6683c270383b3d0ed3d36ff71c949e83c22072799e9687c5ec32a81d96afcbf4b4fb0c7ac3e9e9b7db05 - DTAP matches expected message DREF VLR subscr MSISDN:46071 usage decreases to: 5 DMM Subscr_Conn(50462976){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_BUMP @@ -604,9 +604,9 @@ - conn is still open to wait for SMS ack dance llist_count(&net->subscr_conns) == 1 - MS replies with CP-ACK for received SMS - rx from MS: pdisc=0x89 msg_type=0x04 + MSC <--RAN_GERAN_A-- MS: GSM48_PDISC_SMS:0x04 DREF MSISDN:46071: MSC conn use + 1 == 3 -DRLL Dispatching 04.08 message, pdisc=9 +DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x04 (0x9:0x4) DMM Subscr_Conn(50462976){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_COMMUNICATING DMM Subscr_Conn(50462976){SUBSCR_CONN_S_ACCEPTED}: state_chg to SUBSCR_CONN_S_COMMUNICATING DMM Subscr_Conn(50462976){SUBSCR_CONN_S_COMMUNICATING}: Received Event SUBSCR_CONN_E_BUMP @@ -614,12 +614,12 @@ DREF MSISDN:46071: MSC conn use - 1 == 2 llist_count(&net->subscr_conns) == 1 - MS also sends RP-ACK, MSC in turn sends CP-ACK for that - rx from MS: pdisc=0x89 msg_type=0x01 + MSC <--RAN_GERAN_A-- MS: GSM48_PDISC_SMS:0x01 DREF MSISDN:46071: MSC conn use + 1 == 3 -DRLL Dispatching 04.08 message, pdisc=9 +DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) DMM Subscr_Conn(50462976){SUBSCR_CONN_S_COMMUNICATING}: Received Event SUBSCR_CONN_E_COMMUNICATING DMSC msc_tx 2 bytes to MSISDN:46071 via RAN_GERAN_A -- DTAP --RAN_GERAN_A--> MS: 0904 +- DTAP --RAN_GERAN_A--> MS: GSM48_PDISC_SMS:0x04: 0904 - DTAP matches expected message DREF VLR subscr MSISDN:46071 usage decreases to: 3 DREF VLR subscr MSISDN:46071 usage decreases to: 2 @@ -645,10 +645,10 @@ --- - subscriber sends LU Request, this time with the TMSI - Location Update request causes a GSUP LU request to HLR - rx from MS: pdisc=0x05 msg_type=0x08 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_LOC_UPD_REQUEST new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_LOC_UPD_REQUEST (0x5:0x8) DREF unknown: MSC conn use + 1 == 2 DMM Subscr_Conn(50462976){SUBSCR_CONN_S_INIT}: Allocated DMM Subscr_Conn(50462976){SUBSCR_CONN_S_INIT}: Received Event SUBSCR_CONN_E_START @@ -689,14 +689,14 @@ - having received subscriber data does not mean acceptance msc_subscr_conn_is_accepted() == false requests shall be thwarted -DRLL Dispatching 04.08 message, pdisc=3 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x03 msg_type=0x05 -DRLL Dispatching 04.08 message, pdisc=5 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x05 msg_type=0x33 -DRLL Dispatching 04.08 message, pdisc=6 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x06 msg_type=0x19 -DRLL Dispatching 04.08 message, pdisc=9 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x09 msg_type=0x01 +DRLL Dispatching 04.08 message GSM48_MT_CC_SETUP (0x3:0x5) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_MT_CC_SETUP +DRLL Dispatching 04.08 message unknown 0x33 (0x5:0x33) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: unknown 0x33 +DRLL Dispatching 04.08 message GSM48_MT_RR_SYSINFO_1 (0x6:0x19) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_MT_RR_SYSINFO_1 +DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_PDISC_SMS:0x01 lu_result_sent == 0 - HLR also sends GSUP _UPDATE_LOCATION_RESULT <-- GSUP rx OSMO_GSUP_MSGT_UPDATE_LOCATION_RESULT: 06010809710000004026f0 @@ -734,14 +734,14 @@ lu_result_sent == 1 msc_subscr_conn_is_accepted() == false requests shall be thwarted -DRLL Dispatching 04.08 message, pdisc=3 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x03 msg_type=0x05 -DRLL Dispatching 04.08 message, pdisc=5 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x05 msg_type=0x33 -DRLL Dispatching 04.08 message, pdisc=6 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x06 msg_type=0x19 -DRLL Dispatching 04.08 message, pdisc=9 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x09 msg_type=0x01 +DRLL Dispatching 04.08 message GSM48_MT_CC_SETUP (0x3:0x5) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_MT_CC_SETUP +DRLL Dispatching 04.08 message unknown 0x33 (0x5:0x33) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: unknown 0x33 +DRLL Dispatching 04.08 message GSM48_MT_RR_SYSINFO_1 (0x6:0x19) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_MT_RR_SYSINFO_1 +DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_PDISC_SMS:0x01 - even though the TMSI is not acked, we can already find the subscr with it DREF VLR subscr MSISDN:46071 usage increases to: 3 vsub != NULL == 1 @@ -750,9 +750,9 @@ vsub->tmsi == 0x03020100 DREF VLR subscr MSISDN:46071 usage decreases to: 2 - MS sends TMSI Realloc Complete - rx from MS: pdisc=0x05 msg_type=0x5b + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_TMSI_REALL_COMPL DREF MSISDN:46071: MSC conn use + 1 == 2 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_TMSI_REALL_COMPL (0x5:0x1b) DMM TMSI Reallocation Completed. Subscriber: MSISDN:46071 DVLR vlr_lu_fsm(50462976){VLR_ULA_S_WAIT_LU_COMPL}: Received Event VLR_ULA_E_NEW_TMSI_ACK DVLR lu_compl_vlr_fsm(50462976){LU_COMPL_VLR_S_WAIT_TMSI_CNF}: Received Event LU_COMPL_VLR_E_NEW_TMSI_ACK @@ -793,10 +793,10 @@ DREF VLR subscr MSISDN:46071 usage decreases to: 1 --- - subscriber detaches, using new TMSI - rx from MS: pdisc=0x05 msg_type=0x01 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_IMSI_DETACH_IND new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_IMSI_DETACH_IND (0x5:0x1) DMM IMSI DETACH INDICATION: MI(TMSI)=117835012 DREF VLR subscr MSISDN:46071 usage increases to: 2 DMM IMSI DETACH for MSISDN:46071 @@ -814,10 +814,10 @@ ===== test_no_authen_imei - Location Update request causes a GSUP LU request to HLR - rx from MS: pdisc=0x05 msg_type=0x08 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_LOC_UPD_REQUEST new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_LOC_UPD_REQUEST (0x5:0x8) DREF unknown: MSC conn use + 1 == 2 DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Allocated DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Received Event SUBSCR_CONN_E_START @@ -860,14 +860,14 @@ - having received subscriber data does not mean acceptance msc_subscr_conn_is_accepted() == false requests shall be thwarted -DRLL Dispatching 04.08 message, pdisc=3 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x03 msg_type=0x05 -DRLL Dispatching 04.08 message, pdisc=5 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x05 msg_type=0x33 -DRLL Dispatching 04.08 message, pdisc=6 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x06 msg_type=0x19 -DRLL Dispatching 04.08 message, pdisc=9 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x09 msg_type=0x01 +DRLL Dispatching 04.08 message GSM48_MT_CC_SETUP (0x3:0x5) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_MT_CC_SETUP +DRLL Dispatching 04.08 message unknown 0x33 (0x5:0x33) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: unknown 0x33 +DRLL Dispatching 04.08 message GSM48_MT_RR_SYSINFO_1 (0x6:0x19) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_MT_RR_SYSINFO_1 +DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_PDISC_SMS:0x01 lu_result_sent == 0 - HLR also sends GSUP _UPDATE_LOCATION_RESULT, and we send an ID Request for the IMEI to the MS <-- GSUP rx OSMO_GSUP_MSGT_UPDATE_LOCATION_RESULT: 06010809710000004026f0 @@ -897,7 +897,7 @@ DVLR lu_compl_vlr_fsm(901700000004620){LU_COMPL_VLR_S_WAIT_SUB_PRES}: Received Event LU_COMPL_VLR_E_SUB_PRES_COMPL DVLR lu_compl_vlr_fsm(901700000004620){LU_COMPL_VLR_S_WAIT_SUB_PRES}: state_chg to LU_COMPL_VLR_S_WAIT_IMEI DMSC msc_tx 3 bytes to MSISDN:46071 via RAN_GERAN_A -- DTAP --RAN_GERAN_A--> MS: 051802 +- DTAP --RAN_GERAN_A--> MS: GSM48_MT_MM_ID_REQ: 051802 - DTAP matches expected message DREF VLR subscr MSISDN:46071 usage decreases to: 1 <-- GSUP rx OSMO_GSUP_MSGT_UPDATE_LOCATION_RESULT: vlr_gsupc_read_cb() returns 0 @@ -908,18 +908,18 @@ DREF VLR subscr MSISDN:46071 usage decreases to: 1 msc_subscr_conn_is_accepted() == false requests shall be thwarted -DRLL Dispatching 04.08 message, pdisc=3 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x03 msg_type=0x05 -DRLL Dispatching 04.08 message, pdisc=5 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x05 msg_type=0x33 -DRLL Dispatching 04.08 message, pdisc=6 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x06 msg_type=0x19 -DRLL Dispatching 04.08 message, pdisc=9 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x09 msg_type=0x01 +DRLL Dispatching 04.08 message GSM48_MT_CC_SETUP (0x3:0x5) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_MT_CC_SETUP +DRLL Dispatching 04.08 message unknown 0x33 (0x5:0x33) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: unknown 0x33 +DRLL Dispatching 04.08 message GSM48_MT_RR_SYSINFO_1 (0x6:0x19) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_MT_RR_SYSINFO_1 +DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_PDISC_SMS:0x01 - MS replies with an Identity Response - rx from MS: pdisc=0x05 msg_type=0x59 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_ID_RESP DREF MSISDN:46071: MSC conn use + 1 == 2 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_ID_RESP (0x5:0x19) DMM IDENTITY RESPONSE: MI(IMEI)=423423423423423 DVLR set IMEI on subscriber; IMSI=901700000004620 IMEI=423423423423423 DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_WAIT_LU_COMPL}: Received Event VLR_ULA_E_ID_IMEI @@ -961,10 +961,10 @@ DREF VLR subscr MSISDN:46071 usage decreases to: 1 --- - subscriber detaches - rx from MS: pdisc=0x05 msg_type=0x01 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_IMSI_DETACH_IND new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_IMSI_DETACH_IND (0x5:0x1) DMM IMSI DETACH INDICATION: MI(IMSI)=901700000004620 DREF VLR subscr MSISDN:46071 usage increases to: 2 DMM IMSI DETACH for MSISDN:46071 @@ -982,10 +982,10 @@ ===== test_no_authen_tmsi_imei - Location Update request causes a GSUP LU request to HLR - rx from MS: pdisc=0x05 msg_type=0x08 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_LOC_UPD_REQUEST new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_LOC_UPD_REQUEST (0x5:0x8) DREF unknown: MSC conn use + 1 == 2 DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Allocated DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Received Event SUBSCR_CONN_E_START @@ -1028,14 +1028,14 @@ - having received subscriber data does not mean acceptance msc_subscr_conn_is_accepted() == false requests shall be thwarted -DRLL Dispatching 04.08 message, pdisc=3 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x03 msg_type=0x05 -DRLL Dispatching 04.08 message, pdisc=5 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x05 msg_type=0x33 -DRLL Dispatching 04.08 message, pdisc=6 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x06 msg_type=0x19 -DRLL Dispatching 04.08 message, pdisc=9 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x09 msg_type=0x01 +DRLL Dispatching 04.08 message GSM48_MT_CC_SETUP (0x3:0x5) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_MT_CC_SETUP +DRLL Dispatching 04.08 message unknown 0x33 (0x5:0x33) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: unknown 0x33 +DRLL Dispatching 04.08 message GSM48_MT_RR_SYSINFO_1 (0x6:0x19) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_MT_RR_SYSINFO_1 +DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_PDISC_SMS:0x01 lu_result_sent == 0 - HLR also sends GSUP _UPDATE_LOCATION_RESULT, and we send an ID Request for the IMEI to the MS <-- GSUP rx OSMO_GSUP_MSGT_UPDATE_LOCATION_RESULT: 06010809710000004026f0 @@ -1065,7 +1065,7 @@ DVLR lu_compl_vlr_fsm(901700000004620){LU_COMPL_VLR_S_WAIT_SUB_PRES}: Received Event LU_COMPL_VLR_E_SUB_PRES_COMPL DVLR lu_compl_vlr_fsm(901700000004620){LU_COMPL_VLR_S_WAIT_SUB_PRES}: state_chg to LU_COMPL_VLR_S_WAIT_IMEI_TMSI DMSC msc_tx 3 bytes to MSISDN:46071 via RAN_GERAN_A -- DTAP --RAN_GERAN_A--> MS: 051802 +- DTAP --RAN_GERAN_A--> MS: GSM48_MT_MM_ID_REQ: 051802 - DTAP matches expected message DREF VLR subscr MSISDN:46071 usage decreases to: 1 <-- GSUP rx OSMO_GSUP_MSGT_UPDATE_LOCATION_RESULT: vlr_gsupc_read_cb() returns 0 @@ -1076,18 +1076,18 @@ DREF VLR subscr MSISDN:46071 usage decreases to: 1 msc_subscr_conn_is_accepted() == false requests shall be thwarted -DRLL Dispatching 04.08 message, pdisc=3 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x03 msg_type=0x05 -DRLL Dispatching 04.08 message, pdisc=5 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x05 msg_type=0x33 -DRLL Dispatching 04.08 message, pdisc=6 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x06 msg_type=0x19 -DRLL Dispatching 04.08 message, pdisc=9 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x09 msg_type=0x01 +DRLL Dispatching 04.08 message GSM48_MT_CC_SETUP (0x3:0x5) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_MT_CC_SETUP +DRLL Dispatching 04.08 message unknown 0x33 (0x5:0x33) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: unknown 0x33 +DRLL Dispatching 04.08 message GSM48_MT_RR_SYSINFO_1 (0x6:0x19) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_MT_RR_SYSINFO_1 +DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_PDISC_SMS:0x01 - MS replies with an Identity Response - rx from MS: pdisc=0x05 msg_type=0x59 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_ID_RESP DREF MSISDN:46071: MSC conn use + 1 == 2 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_ID_RESP (0x5:0x19) DMM IDENTITY RESPONSE: MI(IMEI)=423423423423423 DVLR set IMEI on subscriber; IMSI=901700000004620 IMEI=423423423423423 DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_WAIT_LU_COMPL}: Received Event VLR_ULA_E_ID_IMEI @@ -1102,18 +1102,18 @@ lu_result_sent == 1 msc_subscr_conn_is_accepted() == false requests shall be thwarted -DRLL Dispatching 04.08 message, pdisc=3 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x03 msg_type=0x05 -DRLL Dispatching 04.08 message, pdisc=5 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x05 msg_type=0x33 -DRLL Dispatching 04.08 message, pdisc=6 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x06 msg_type=0x19 -DRLL Dispatching 04.08 message, pdisc=9 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x09 msg_type=0x01 +DRLL Dispatching 04.08 message GSM48_MT_CC_SETUP (0x3:0x5) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_MT_CC_SETUP +DRLL Dispatching 04.08 message unknown 0x33 (0x5:0x33) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: unknown 0x33 +DRLL Dispatching 04.08 message GSM48_MT_RR_SYSINFO_1 (0x6:0x19) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_MT_RR_SYSINFO_1 +DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_PDISC_SMS:0x01 - MS sends TMSI Realloc Complete - rx from MS: pdisc=0x05 msg_type=0x5b + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_TMSI_REALL_COMPL DREF MSISDN:46071: MSC conn use + 1 == 2 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_TMSI_REALL_COMPL (0x5:0x1b) DMM TMSI Reallocation Completed. Subscriber: MSISDN:46071 DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_WAIT_LU_COMPL}: Received Event VLR_ULA_E_NEW_TMSI_ACK DVLR lu_compl_vlr_fsm(901700000004620){LU_COMPL_VLR_S_WAIT_TMSI_CNF}: Received Event LU_COMPL_VLR_E_NEW_TMSI_ACK @@ -1154,10 +1154,10 @@ DREF VLR subscr MSISDN:46071 usage decreases to: 1 --- - subscriber detaches - rx from MS: pdisc=0x05 msg_type=0x01 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_IMSI_DETACH_IND new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_IMSI_DETACH_IND (0x5:0x1) DMM IMSI DETACH INDICATION: MI(IMSI)=901700000004620 DREF VLR subscr MSISDN:46071 usage increases to: 2 DMM IMSI DETACH for MSISDN:46071 diff --git a/tests/msc_vlr/msc_vlr_test_reject_concurrency.err b/tests/msc_vlr/msc_vlr_test_reject_concurrency.err index 267b131..7b0954f 100644 --- a/tests/msc_vlr/msc_vlr_test_reject_concurrency.err +++ b/tests/msc_vlr/msc_vlr_test_reject_concurrency.err @@ -1,9 +1,9 @@ ===== test_reject_2nd_conn - Location Update Request on one connection - rx from MS: pdisc=0x05 msg_type=0x08 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_LOC_UPD_REQUEST new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_LOC_UPD_REQUEST (0x5:0x8) DREF unknown: MSC conn use + 1 == 2 DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Allocated DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Received Event SUBSCR_CONN_E_START @@ -35,10 +35,10 @@ lu_result_sent == 0 llist_count(&net->subscr_conns) == 1 - Another Location Update Request from the same subscriber on another connection is rejected - rx from MS: pdisc=0x05 msg_type=0x08 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_LOC_UPD_REQUEST new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_LOC_UPD_REQUEST (0x5:0x8) DREF unknown: MSC conn use + 1 == 2 DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Allocated DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Received Event SUBSCR_CONN_E_START @@ -151,10 +151,10 @@ ===== test_reject_lu_during_lu - Location Update Request - rx from MS: pdisc=0x05 msg_type=0x08 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_LOC_UPD_REQUEST new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_LOC_UPD_REQUEST (0x5:0x8) DREF unknown: MSC conn use + 1 == 2 DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Allocated DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Received Event SUBSCR_CONN_E_START @@ -187,9 +187,9 @@ llist_count(&net->subscr_conns) == 1 --- - Another Location Update Request from the same subscriber on the same conn is dropped silently - rx from MS: pdisc=0x05 msg_type=0x08 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_LOC_UPD_REQUEST DREF IMSI:901700000004620: MSC conn use + 1 == 2 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_LOC_UPD_REQUEST (0x5:0x8) DMM 901700000004620: Error: connection already in use DMM IMSI:901700000004620: bump: conn still being established (SUBSCR_CONN_S_NEW) DREF IMSI:901700000004620: MSC conn use - 1 == 1 @@ -273,10 +273,10 @@ ===== test_reject_cm_during_lu - Location Update Request - rx from MS: pdisc=0x05 msg_type=0x08 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_LOC_UPD_REQUEST new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_LOC_UPD_REQUEST (0x5:0x8) DREF unknown: MSC conn use + 1 == 2 DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Allocated DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Received Event SUBSCR_CONN_E_START @@ -309,14 +309,14 @@ llist_count(&net->subscr_conns) == 1 --- - A CM Service Request in the middle of a LU is rejected - rx from MS: pdisc=0x05 msg_type=0x24 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_CM_SERV_REQ DREF IMSI:901700000004620: MSC conn use + 1 == 2 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_CM_SERV_REQ (0x5:0x24) DMM <- CM SERVICE REQUEST serv_type=0x08 MI(IMSI)=901700000004620 DMM IMSI:901700000004620: connection already in use DMM -> CM SERVICE Reject cause: 17 DMSC msc_tx 3 bytes to IMSI:901700000004620 via RAN_GERAN_A -- DTAP --RAN_GERAN_A--> MS: 052211 +- DTAP --RAN_GERAN_A--> MS: GSM48_MT_MM_CM_SERV_REJ: 052211 - DTAP matches expected message DMM IMSI:901700000004620: bump: conn still being established (SUBSCR_CONN_S_NEW) DREF IMSI:901700000004620: MSC conn use - 1 == 1 @@ -401,10 +401,10 @@ ===== test_reject_paging_resp_during_lu - Location Update Request - rx from MS: pdisc=0x05 msg_type=0x08 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_LOC_UPD_REQUEST new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_LOC_UPD_REQUEST (0x5:0x8) DREF unknown: MSC conn use + 1 == 2 DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Allocated DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Received Event SUBSCR_CONN_E_START @@ -437,9 +437,9 @@ llist_count(&net->subscr_conns) == 1 --- - An erratic Paging Response is dropped silently - rx from MS: pdisc=0x06 msg_type=0x27 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_RR_PAG_RESP DREF IMSI:901700000004620: MSC conn use + 1 == 2 -DRLL Dispatching 04.08 message, pdisc=6 +DRLL Dispatching 04.08 message GSM48_MT_RR_PAG_RESP (0x6:0x27) DRR PAGING RESPONSE: MI(IMSI)=901700000004620 DMM 901700000004620: Error: connection already in use DMM IMSI:901700000004620: bump: conn still being established (SUBSCR_CONN_S_NEW) @@ -526,10 +526,10 @@ --- - Subscriber does a normal LU - Location Update Request - rx from MS: pdisc=0x05 msg_type=0x08 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_LOC_UPD_REQUEST new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_LOC_UPD_REQUEST (0x5:0x8) DREF unknown: MSC conn use + 1 == 2 DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Allocated DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Received Event SUBSCR_CONN_E_START @@ -630,10 +630,10 @@ llist_count(&net->subscr_conns) == 0 --- - Subscriber does a normal CM Service Request - rx from MS: pdisc=0x05 msg_type=0x24 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_CM_SERV_REQ new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_CM_SERV_REQ (0x5:0x24) DMM <- CM SERVICE REQUEST serv_type=0x08 MI(IMSI)=901700000004620 DREF unknown: MSC conn use + 1 == 2 DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Allocated @@ -669,9 +669,9 @@ cm_service_result_sent == 1 msc_subscr_conn_is_accepted() == true - A LU request on an open conn is dropped silently - rx from MS: pdisc=0x05 msg_type=0x08 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_LOC_UPD_REQUEST DREF MSISDN:46071: MSC conn use + 1 == 2 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_LOC_UPD_REQUEST (0x5:0x8) DMM 901700000004620: Error: connection already in use DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_BUMP DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_ACCEPTED}: bump: still awaiting first request after a CM Service Request @@ -680,9 +680,9 @@ llist_count(&net->subscr_conns) == 1 --- - subscriber detaches - rx from MS: pdisc=0x05 msg_type=0x01 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_IMSI_DETACH_IND DREF MSISDN:46071: MSC conn use + 1 == 2 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_IMSI_DETACH_IND (0x5:0x1) DMM IMSI DETACH INDICATION: MI(IMSI)=901700000004620 DREF VLR subscr MSISDN:46071 usage increases to: 3 DMM IMSI DETACH for MSISDN:46071 @@ -714,10 +714,10 @@ --- - Subscriber does a normal LU - Location Update Request - rx from MS: pdisc=0x05 msg_type=0x08 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_LOC_UPD_REQUEST new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_LOC_UPD_REQUEST (0x5:0x8) DREF unknown: MSC conn use + 1 == 2 DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Allocated DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Received Event SUBSCR_CONN_E_START @@ -818,10 +818,10 @@ llist_count(&net->subscr_conns) == 0 --- - Subscriber does a normal CM Service Request - rx from MS: pdisc=0x05 msg_type=0x24 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_CM_SERV_REQ new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_CM_SERV_REQ (0x5:0x24) DMM <- CM SERVICE REQUEST serv_type=0x08 MI(IMSI)=901700000004620 DREF unknown: MSC conn use + 1 == 2 DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Allocated @@ -857,9 +857,9 @@ cm_service_result_sent == 1 msc_subscr_conn_is_accepted() == true - A second CM Service Request on the same conn is accepted without another auth dance - rx from MS: pdisc=0x05 msg_type=0x24 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_CM_SERV_REQ DREF MSISDN:46071: MSC conn use + 1 == 2 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_CM_SERV_REQ (0x5:0x24) DMM <- CM SERVICE REQUEST serv_type=0x08 MI(IMSI)=901700000004620 DMM MSISDN:46071: re-using already accepted connection - sending CM Service Accept for MSISDN:46071 @@ -870,9 +870,9 @@ llist_count(&net->subscr_conns) == 1 --- - subscriber detaches - rx from MS: pdisc=0x05 msg_type=0x01 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_IMSI_DETACH_IND DREF MSISDN:46071: MSC conn use + 1 == 2 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_IMSI_DETACH_IND (0x5:0x1) DMM IMSI DETACH INDICATION: MI(IMSI)=901700000004620 DREF VLR subscr MSISDN:46071 usage increases to: 3 DMM IMSI DETACH for MSISDN:46071 @@ -904,10 +904,10 @@ --- - Subscriber does a normal LU - Location Update Request - rx from MS: pdisc=0x05 msg_type=0x08 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_LOC_UPD_REQUEST new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_LOC_UPD_REQUEST (0x5:0x8) DREF unknown: MSC conn use + 1 == 2 DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Allocated DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Received Event SUBSCR_CONN_E_START @@ -1008,10 +1008,10 @@ llist_count(&net->subscr_conns) == 0 --- - Subscriber does a normal CM Service Request - rx from MS: pdisc=0x05 msg_type=0x24 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_CM_SERV_REQ new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_CM_SERV_REQ (0x5:0x24) DMM <- CM SERVICE REQUEST serv_type=0x08 MI(IMSI)=901700000004620 DREF unknown: MSC conn use + 1 == 2 DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Allocated @@ -1048,9 +1048,9 @@ msc_subscr_conn_is_accepted() == true --- - An erratic Paging Response on the same conn is dropped silently - rx from MS: pdisc=0x06 msg_type=0x27 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_RR_PAG_RESP DREF MSISDN:46071: MSC conn use + 1 == 2 -DRLL Dispatching 04.08 message, pdisc=6 +DRLL Dispatching 04.08 message GSM48_MT_RR_PAG_RESP (0x6:0x27) DRR PAGING RESPONSE: MI(IMSI)=901700000004620 DMM 901700000004620: Error: connection already in use DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_BUMP @@ -1062,16 +1062,16 @@ - a USSD request is serviced expecting USSD: Your extension is 46071 - rx from MS: pdisc=0x0b msg_type=0x3b + MSC <--RAN_GERAN_A-- MS: GSM48_PDISC_NC_SS:0x3b DREF MSISDN:46071: MSC conn use + 1 == 2 -DRLL Dispatching 04.08 message, pdisc=11 -DMM MSISDN:46071 pdisc=11 msg_type=0x3b: received_cm_service_request changes to false +DRLL Dispatching 04.08 message GSM48_PDISC_NC_SS:0x3b (0xb:0x3b) +DMM MSISDN:46071: rx msg GSM48_PDISC_NC_SS:0x3b: received_cm_service_request changes to false DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_COMMUNICATING DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_ACCEPTED}: state_chg to SUBSCR_CONN_S_COMMUNICATING DMM USSD: Own number requested DMM MSISDN:46071: MSISDN = 46071 DMSC msc_tx 43 bytes to MSISDN:46071 via RAN_GERAN_A -- DTAP --RAN_GERAN_A--> MS: 8b2a1c27a225020100302002013b301b04010f0416d9775d0e2ae3e965f73cfd7683d27310cd06bbc51a0d +- DTAP --RAN_GERAN_A--> MS: GSM48_PDISC_NC_SS:0x2a: 8b2a1c27a225020100302002013b301b04010f0416d9775d0e2ae3e965f73cfd7683d27310cd06bbc51a0d - DTAP matches expected message DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_COMMUNICATING}: Received Event SUBSCR_CONN_E_BUMP DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_COMMUNICATING}: bump: releasing conn @@ -1100,10 +1100,10 @@ --- - Subscriber does a normal LU - Location Update Request - rx from MS: pdisc=0x05 msg_type=0x08 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_LOC_UPD_REQUEST new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_LOC_UPD_REQUEST (0x5:0x8) DREF unknown: MSC conn use + 1 == 2 DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Allocated DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Received Event SUBSCR_CONN_E_START @@ -1216,10 +1216,10 @@ paging_sent == 1 paging_stopped == 0 - MS replies with Paging Response, we deliver the SMS - rx from MS: pdisc=0x06 msg_type=0x27 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_RR_PAG_RESP new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=6 +DRLL Dispatching 04.08 message GSM48_MT_RR_PAG_RESP (0x6:0x27) DRR PAGING RESPONSE: MI(IMSI)=901700000004620 DREF unknown: MSC conn use + 1 == 2 DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Allocated @@ -1249,7 +1249,7 @@ DREF VLR subscr MSISDN:46071 usage increases to: 6 DREF MSISDN:46071: MSC conn use + 1 == 3 DMSC msc_tx 91 bytes to MSISDN:46071 via RAN_GERAN_A -- DTAP --RAN_GERAN_A--> MS: 09015801000791447758100650004c0005806470f1000007101000000000445079da1e1ee7416937485e9ea7c965373d1d6683c270383b3d0ed3d36ff71c949e83c22072799e9687c5ec32a81d96afcbf4b4fb0c7ac3e9e9b7db05 +- DTAP --RAN_GERAN_A--> MS: GSM48_PDISC_SMS:0x01: 09015801000791447758100650004c0005806470f1000007101000000000445079da1e1ee7416937485e9ea7c965373d1d6683c270383b3d0ed3d36ff71c949e83c22072799e9687c5ec32a81d96afcbf4b4fb0c7ac3e9e9b7db05 - DTAP matches expected message DREF VLR subscr MSISDN:46071 usage decreases to: 5 DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_BUMP @@ -1264,9 +1264,9 @@ llist_count(&net->subscr_conns) == 1 --- - MS sends erratic LU Request, which is dropped silently - rx from MS: pdisc=0x05 msg_type=0x08 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_LOC_UPD_REQUEST DREF MSISDN:46071: MSC conn use + 1 == 3 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_LOC_UPD_REQUEST (0x5:0x8) DMM 901700000004620: Error: connection already in use DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_BUMP DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_ACCEPTED}: bump: connection still has active transaction: GSM48_PDISC_SMS @@ -1274,9 +1274,9 @@ lu_result_sent == 0 llist_count(&net->subscr_conns) == 1 - MS replies with CP-ACK for received SMS - rx from MS: pdisc=0x89 msg_type=0x04 + MSC <--RAN_GERAN_A-- MS: GSM48_PDISC_SMS:0x04 DREF MSISDN:46071: MSC conn use + 1 == 3 -DRLL Dispatching 04.08 message, pdisc=9 +DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x04 (0x9:0x4) DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_COMMUNICATING DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_ACCEPTED}: state_chg to SUBSCR_CONN_S_COMMUNICATING DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_COMMUNICATING}: Received Event SUBSCR_CONN_E_BUMP @@ -1284,12 +1284,12 @@ DREF MSISDN:46071: MSC conn use - 1 == 2 llist_count(&net->subscr_conns) == 1 - MS also sends RP-ACK, MSC in turn sends CP-ACK for that - rx from MS: pdisc=0x89 msg_type=0x01 + MSC <--RAN_GERAN_A-- MS: GSM48_PDISC_SMS:0x01 DREF MSISDN:46071: MSC conn use + 1 == 3 -DRLL Dispatching 04.08 message, pdisc=9 +DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_COMMUNICATING}: Received Event SUBSCR_CONN_E_COMMUNICATING DMSC msc_tx 2 bytes to MSISDN:46071 via RAN_GERAN_A -- DTAP --RAN_GERAN_A--> MS: 0904 +- DTAP --RAN_GERAN_A--> MS: GSM48_PDISC_SMS:0x04: 0904 - DTAP matches expected message DREF VLR subscr MSISDN:46071 usage decreases to: 3 DREF VLR subscr MSISDN:46071 usage decreases to: 2 @@ -1322,10 +1322,10 @@ --- - Subscriber does a normal LU - Location Update Request - rx from MS: pdisc=0x05 msg_type=0x08 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_LOC_UPD_REQUEST new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_LOC_UPD_REQUEST (0x5:0x8) DREF unknown: MSC conn use + 1 == 2 DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Allocated DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Received Event SUBSCR_CONN_E_START @@ -1438,10 +1438,10 @@ paging_sent == 1 paging_stopped == 0 - MS replies with Paging Response, we deliver the SMS - rx from MS: pdisc=0x06 msg_type=0x27 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_RR_PAG_RESP new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=6 +DRLL Dispatching 04.08 message GSM48_MT_RR_PAG_RESP (0x6:0x27) DRR PAGING RESPONSE: MI(IMSI)=901700000004620 DREF unknown: MSC conn use + 1 == 2 DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Allocated @@ -1471,7 +1471,7 @@ DREF VLR subscr MSISDN:46071 usage increases to: 6 DREF MSISDN:46071: MSC conn use + 1 == 3 DMSC msc_tx 91 bytes to MSISDN:46071 via RAN_GERAN_A -- DTAP --RAN_GERAN_A--> MS: 09015801000791447758100650004c0005806470f1000007101000000000445079da1e1ee7416937485e9ea7c965373d1d6683c270383b3d0ed3d36ff71c949e83c22072799e9687c5ec32a81d96afcbf4b4fb0c7ac3e9e9b7db05 +- DTAP --RAN_GERAN_A--> MS: GSM48_PDISC_SMS:0x01: 09015801000791447758100650004c0005806470f1000007101000000000445079da1e1ee7416937485e9ea7c965373d1d6683c270383b3d0ed3d36ff71c949e83c22072799e9687c5ec32a81d96afcbf4b4fb0c7ac3e9e9b7db05 - DTAP matches expected message DREF VLR subscr MSISDN:46071 usage decreases to: 5 DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_BUMP @@ -1486,9 +1486,9 @@ llist_count(&net->subscr_conns) == 1 --- - CM Service Request during open connection is accepted - rx from MS: pdisc=0x05 msg_type=0x24 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_CM_SERV_REQ DREF MSISDN:46071: MSC conn use + 1 == 3 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_CM_SERV_REQ (0x5:0x24) DMM <- CM SERVICE REQUEST serv_type=0x08 MI(IMSI)=901700000004620 DMM MSISDN:46071: re-using already accepted connection - sending CM Service Accept for MSISDN:46071 @@ -1499,9 +1499,9 @@ llist_count(&net->subscr_conns) == 1 g_conn->received_cm_service_request == 1 - MS replies with CP-ACK for received SMS - rx from MS: pdisc=0x89 msg_type=0x04 + MSC <--RAN_GERAN_A-- MS: GSM48_PDISC_SMS:0x04 DREF MSISDN:46071: MSC conn use + 1 == 3 -DRLL Dispatching 04.08 message, pdisc=9 +DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x04 (0x9:0x4) DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_COMMUNICATING DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_ACCEPTED}: state_chg to SUBSCR_CONN_S_COMMUNICATING DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_COMMUNICATING}: Received Event SUBSCR_CONN_E_BUMP @@ -1509,12 +1509,12 @@ DREF MSISDN:46071: MSC conn use - 1 == 2 llist_count(&net->subscr_conns) == 1 - MS also sends RP-ACK, MSC in turn sends CP-ACK for that - rx from MS: pdisc=0x89 msg_type=0x01 + MSC <--RAN_GERAN_A-- MS: GSM48_PDISC_SMS:0x01 DREF MSISDN:46071: MSC conn use + 1 == 3 -DRLL Dispatching 04.08 message, pdisc=9 +DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_COMMUNICATING}: Received Event SUBSCR_CONN_E_COMMUNICATING DMSC msc_tx 2 bytes to MSISDN:46071 via RAN_GERAN_A -- DTAP --RAN_GERAN_A--> MS: 0904 +- DTAP --RAN_GERAN_A--> MS: GSM48_PDISC_SMS:0x04: 0904 - DTAP matches expected message DREF VLR subscr MSISDN:46071 usage decreases to: 3 DREF VLR subscr MSISDN:46071 usage decreases to: 2 @@ -1527,9 +1527,9 @@ llist_count(&net->subscr_conns) == 1 --- - subscriber detaches - rx from MS: pdisc=0x05 msg_type=0x01 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_IMSI_DETACH_IND DREF MSISDN:46071: MSC conn use + 1 == 2 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_IMSI_DETACH_IND (0x5:0x1) DMM IMSI DETACH INDICATION: MI(IMSI)=901700000004620 DREF VLR subscr MSISDN:46071 usage increases to: 3 DMM IMSI DETACH for MSISDN:46071 @@ -1561,10 +1561,10 @@ --- - Subscriber does a normal LU - Location Update Request - rx from MS: pdisc=0x05 msg_type=0x08 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_LOC_UPD_REQUEST new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_LOC_UPD_REQUEST (0x5:0x8) DREF unknown: MSC conn use + 1 == 2 DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Allocated DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Received Event SUBSCR_CONN_E_START @@ -1677,10 +1677,10 @@ paging_sent == 1 paging_stopped == 0 - MS replies with Paging Response, we deliver the SMS - rx from MS: pdisc=0x06 msg_type=0x27 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_RR_PAG_RESP new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=6 +DRLL Dispatching 04.08 message GSM48_MT_RR_PAG_RESP (0x6:0x27) DRR PAGING RESPONSE: MI(IMSI)=901700000004620 DREF unknown: MSC conn use + 1 == 2 DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Allocated @@ -1710,7 +1710,7 @@ DREF VLR subscr MSISDN:46071 usage increases to: 6 DREF MSISDN:46071: MSC conn use + 1 == 3 DMSC msc_tx 91 bytes to MSISDN:46071 via RAN_GERAN_A -- DTAP --RAN_GERAN_A--> MS: 09015801000791447758100650004c0005806470f1000007101000000000445079da1e1ee7416937485e9ea7c965373d1d6683c270383b3d0ed3d36ff71c949e83c22072799e9687c5ec32a81d96afcbf4b4fb0c7ac3e9e9b7db05 +- DTAP --RAN_GERAN_A--> MS: GSM48_PDISC_SMS:0x01: 09015801000791447758100650004c0005806470f1000007101000000000445079da1e1ee7416937485e9ea7c965373d1d6683c270383b3d0ed3d36ff71c949e83c22072799e9687c5ec32a81d96afcbf4b4fb0c7ac3e9e9b7db05 - DTAP matches expected message DREF VLR subscr MSISDN:46071 usage decreases to: 5 DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_BUMP @@ -1725,18 +1725,18 @@ llist_count(&net->subscr_conns) == 1 --- - MS sends another erratic Paging Response which is dropped silently - rx from MS: pdisc=0x06 msg_type=0x27 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_RR_PAG_RESP DREF MSISDN:46071: MSC conn use + 1 == 3 -DRLL Dispatching 04.08 message, pdisc=6 +DRLL Dispatching 04.08 message GSM48_MT_RR_PAG_RESP (0x6:0x27) DRR PAGING RESPONSE: MI(IMSI)=901700000004620 DMM 901700000004620: Error: connection already in use DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_BUMP DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_ACCEPTED}: bump: connection still has active transaction: GSM48_PDISC_SMS DREF MSISDN:46071: MSC conn use - 1 == 2 - MS replies with CP-ACK for received SMS - rx from MS: pdisc=0x89 msg_type=0x04 + MSC <--RAN_GERAN_A-- MS: GSM48_PDISC_SMS:0x04 DREF MSISDN:46071: MSC conn use + 1 == 3 -DRLL Dispatching 04.08 message, pdisc=9 +DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x04 (0x9:0x4) DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_COMMUNICATING DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_ACCEPTED}: state_chg to SUBSCR_CONN_S_COMMUNICATING DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_COMMUNICATING}: Received Event SUBSCR_CONN_E_BUMP @@ -1744,12 +1744,12 @@ DREF MSISDN:46071: MSC conn use - 1 == 2 llist_count(&net->subscr_conns) == 1 - MS also sends RP-ACK, MSC in turn sends CP-ACK for that - rx from MS: pdisc=0x89 msg_type=0x01 + MSC <--RAN_GERAN_A-- MS: GSM48_PDISC_SMS:0x01 DREF MSISDN:46071: MSC conn use + 1 == 3 -DRLL Dispatching 04.08 message, pdisc=9 +DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_COMMUNICATING}: Received Event SUBSCR_CONN_E_COMMUNICATING DMSC msc_tx 2 bytes to MSISDN:46071 via RAN_GERAN_A -- DTAP --RAN_GERAN_A--> MS: 0904 +- DTAP --RAN_GERAN_A--> MS: GSM48_PDISC_SMS:0x04: 0904 - DTAP matches expected message DREF VLR subscr MSISDN:46071 usage decreases to: 3 DREF VLR subscr MSISDN:46071 usage decreases to: 2 diff --git a/tests/msc_vlr/msc_vlr_test_rest.err b/tests/msc_vlr/msc_vlr_test_rest.err index 6066eac..6122040 100644 --- a/tests/msc_vlr/msc_vlr_test_rest.err +++ b/tests/msc_vlr/msc_vlr_test_rest.err @@ -10,14 +10,14 @@ DMM Subscr_Conn(test){SUBSCR_CONN_S_INIT}: state_chg to SUBSCR_CONN_S_NEW msc_subscr_conn_is_accepted() == false requests shall be thwarted -DRLL Dispatching 04.08 message, pdisc=3 -DRLL subscr unknown: Message not permitted for initial conn: pdisc=0x03 msg_type=0x05 -DRLL Dispatching 04.08 message, pdisc=5 -DRLL subscr unknown: Message not permitted for initial conn: pdisc=0x05 msg_type=0x33 -DRLL Dispatching 04.08 message, pdisc=6 -DRLL subscr unknown: Message not permitted for initial conn: pdisc=0x06 msg_type=0x19 -DRLL Dispatching 04.08 message, pdisc=9 -DRLL subscr unknown: Message not permitted for initial conn: pdisc=0x09 msg_type=0x01 +DRLL Dispatching 04.08 message GSM48_MT_CC_SETUP (0x3:0x5) +DRLL subscr unknown: Message not permitted for initial conn: GSM48_MT_CC_SETUP +DRLL Dispatching 04.08 message unknown 0x33 (0x5:0x33) +DRLL subscr unknown: Message not permitted for initial conn: unknown 0x33 +DRLL Dispatching 04.08 message GSM48_MT_RR_SYSINFO_1 (0x6:0x19) +DRLL subscr unknown: Message not permitted for initial conn: GSM48_MT_RR_SYSINFO_1 +DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) +DRLL subscr unknown: Message not permitted for initial conn: GSM48_PDISC_SMS:0x01 - fake: acceptance DREF VLR subscr unknown usage increases to: 1 DMM Subscr_Conn(test){SUBSCR_CONN_S_NEW}: state_chg to SUBSCR_CONN_S_ACCEPTED @@ -43,10 +43,10 @@ ===== test_cm_service_without_lu - CM Service Request without a prior Location Updating - rx from MS: pdisc=0x05 msg_type=0x24 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_CM_SERV_REQ new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_CM_SERV_REQ (0x5:0x24) DMM <- CM SERVICE REQUEST serv_type=0x08 MI(IMSI)=901700000004620 DREF unknown: MSC conn use + 1 == 2 DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Allocated @@ -84,10 +84,10 @@ ===== test_two_lu - Location Update request causes a GSUP LU request to HLR - rx from MS: pdisc=0x05 msg_type=0x08 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_LOC_UPD_REQUEST new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_LOC_UPD_REQUEST (0x5:0x8) DREF unknown: MSC conn use + 1 == 2 DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Allocated DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Received Event SUBSCR_CONN_E_START @@ -130,14 +130,14 @@ - having received subscriber data does not mean acceptance msc_subscr_conn_is_accepted() == false requests shall be thwarted -DRLL Dispatching 04.08 message, pdisc=3 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x03 msg_type=0x05 -DRLL Dispatching 04.08 message, pdisc=5 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x05 msg_type=0x33 -DRLL Dispatching 04.08 message, pdisc=6 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x06 msg_type=0x19 -DRLL Dispatching 04.08 message, pdisc=9 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x09 msg_type=0x01 +DRLL Dispatching 04.08 message GSM48_MT_CC_SETUP (0x3:0x5) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_MT_CC_SETUP +DRLL Dispatching 04.08 message unknown 0x33 (0x5:0x33) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: unknown 0x33 +DRLL Dispatching 04.08 message GSM48_MT_RR_SYSINFO_1 (0x6:0x19) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_MT_RR_SYSINFO_1 +DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_PDISC_SMS:0x01 lu_result_sent == 0 - HLR also sends GSUP _UPDATE_LOCATION_RESULT <-- GSUP rx OSMO_GSUP_MSGT_UPDATE_LOCATION_RESULT: 06010809710000004026f0 @@ -200,10 +200,10 @@ --- - verify that the MS can send another LU request - Location Update request causes a GSUP LU request to HLR - rx from MS: pdisc=0x05 msg_type=0x08 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_LOC_UPD_REQUEST new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_LOC_UPD_REQUEST (0x5:0x8) DREF unknown: MSC conn use + 1 == 2 DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Allocated DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Received Event SUBSCR_CONN_E_START @@ -244,14 +244,14 @@ - having received subscriber data does not mean acceptance msc_subscr_conn_is_accepted() == false requests shall be thwarted -DRLL Dispatching 04.08 message, pdisc=3 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x03 msg_type=0x05 -DRLL Dispatching 04.08 message, pdisc=5 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x05 msg_type=0x33 -DRLL Dispatching 04.08 message, pdisc=6 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x06 msg_type=0x19 -DRLL Dispatching 04.08 message, pdisc=9 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x09 msg_type=0x01 +DRLL Dispatching 04.08 message GSM48_MT_CC_SETUP (0x3:0x5) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_MT_CC_SETUP +DRLL Dispatching 04.08 message unknown 0x33 (0x5:0x33) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: unknown 0x33 +DRLL Dispatching 04.08 message GSM48_MT_RR_SYSINFO_1 (0x6:0x19) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_MT_RR_SYSINFO_1 +DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_PDISC_SMS:0x01 lu_result_sent == 0 - HLR also sends GSUP _UPDATE_LOCATION_RESULT <-- GSUP rx OSMO_GSUP_MSGT_UPDATE_LOCATION_RESULT: 06010809710000004026f0 @@ -312,10 +312,10 @@ llist_count(&net->subscr_conns) == 0 --- - subscriber detaches - rx from MS: pdisc=0x05 msg_type=0x01 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_IMSI_DETACH_IND new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_IMSI_DETACH_IND (0x5:0x1) DMM IMSI DETACH INDICATION: MI(IMSI)=901700000004620 DREF VLR subscr MSISDN:46071 usage increases to: 2 DMM IMSI DETACH for MSISDN:46071 @@ -333,10 +333,10 @@ ===== test_lu_unknown_tmsi - Location Update request with unknown TMSI sends ID Request for IMSI - rx from MS: pdisc=0x05 msg_type=0x08 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_LOC_UPD_REQUEST new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_LOC_UPD_REQUEST (0x5:0x8) DREF unknown: MSC conn use + 1 == 2 DMM Subscr_Conn(591536962){SUBSCR_CONN_S_INIT}: Allocated DMM Subscr_Conn(591536962){SUBSCR_CONN_S_INIT}: Received Event SUBSCR_CONN_E_START @@ -354,25 +354,25 @@ DVLR vlr_lu_fsm(591536962){VLR_ULA_S_IDLE}: vlr_loc_upd_want_imsi() DVLR vlr_lu_fsm(591536962){VLR_ULA_S_IDLE}: state_chg to VLR_ULA_S_WAIT_IMSI DMSC msc_tx 3 bytes to TMSI:0x23422342 via RAN_GERAN_A -- DTAP --RAN_GERAN_A--> MS: 051801 +- DTAP --RAN_GERAN_A--> MS: GSM48_MT_MM_ID_REQ: 051801 - DTAP matches expected message DMM TMSI:0x23422342: bump: conn still being established (SUBSCR_CONN_S_NEW) DREF TMSI:0x23422342: MSC conn use - 1 == 1 lu_result_sent == 0 msc_subscr_conn_is_accepted() == false requests shall be thwarted -DRLL Dispatching 04.08 message, pdisc=3 -DRLL subscr TMSI:0x23422342: Message not permitted for initial conn: pdisc=0x03 msg_type=0x05 -DRLL Dispatching 04.08 message, pdisc=5 -DRLL subscr TMSI:0x23422342: Message not permitted for initial conn: pdisc=0x05 msg_type=0x33 -DRLL Dispatching 04.08 message, pdisc=6 -DRLL subscr TMSI:0x23422342: Message not permitted for initial conn: pdisc=0x06 msg_type=0x19 -DRLL Dispatching 04.08 message, pdisc=9 -DRLL subscr TMSI:0x23422342: Message not permitted for initial conn: pdisc=0x09 msg_type=0x01 +DRLL Dispatching 04.08 message GSM48_MT_CC_SETUP (0x3:0x5) +DRLL subscr TMSI:0x23422342: Message not permitted for initial conn: GSM48_MT_CC_SETUP +DRLL Dispatching 04.08 message unknown 0x33 (0x5:0x33) +DRLL subscr TMSI:0x23422342: Message not permitted for initial conn: unknown 0x33 +DRLL Dispatching 04.08 message GSM48_MT_RR_SYSINFO_1 (0x6:0x19) +DRLL subscr TMSI:0x23422342: Message not permitted for initial conn: GSM48_MT_RR_SYSINFO_1 +DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) +DRLL subscr TMSI:0x23422342: Message not permitted for initial conn: GSM48_PDISC_SMS:0x01 - MS tells us the IMSI, causes a GSUP LU request to HLR - rx from MS: pdisc=0x05 msg_type=0x59 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_ID_RESP DREF TMSI:0x23422342: MSC conn use + 1 == 2 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_ID_RESP (0x5:0x19) DMM IDENTITY RESPONSE: MI(IMSI)=901700000004620 DVLR set IMSI on subscriber; IMSI=901700000004620 id=901700000004620 DVLR vlr_lu_fsm(591536962){VLR_ULA_S_WAIT_IMSI}: Received Event VLR_ULA_E_ID_IMSI @@ -404,14 +404,14 @@ - having received subscriber data does not mean acceptance msc_subscr_conn_is_accepted() == false requests shall be thwarted -DRLL Dispatching 04.08 message, pdisc=3 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x03 msg_type=0x05 -DRLL Dispatching 04.08 message, pdisc=5 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x05 msg_type=0x33 -DRLL Dispatching 04.08 message, pdisc=6 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x06 msg_type=0x19 -DRLL Dispatching 04.08 message, pdisc=9 -DRLL subscr MSISDN:46071: Message not permitted for initial conn: pdisc=0x09 msg_type=0x01 +DRLL Dispatching 04.08 message GSM48_MT_CC_SETUP (0x3:0x5) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_MT_CC_SETUP +DRLL Dispatching 04.08 message unknown 0x33 (0x5:0x33) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: unknown 0x33 +DRLL Dispatching 04.08 message GSM48_MT_RR_SYSINFO_1 (0x6:0x19) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_MT_RR_SYSINFO_1 +DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_PDISC_SMS:0x01 lu_result_sent == 0 - HLR also sends GSUP _UPDATE_LOCATION_RESULT <-- GSUP rx OSMO_GSUP_MSGT_UPDATE_LOCATION_RESULT: 06010809710000004026f0 diff --git a/tests/msc_vlr/msc_vlr_test_umts_authen.err b/tests/msc_vlr/msc_vlr_test_umts_authen.err index bcb6e31..f59612c 100644 --- a/tests/msc_vlr/msc_vlr_test_umts_authen.err +++ b/tests/msc_vlr/msc_vlr_test_umts_authen.err @@ -1,9 +1,9 @@ ===== test_umts_authen_geran - Location Update request causes a GSUP Send Auth Info request to HLR - rx from MS: pdisc=0x05 msg_type=0x08 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_LOC_UPD_REQUEST new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_LOC_UPD_REQUEST (0x5:0x8) DREF unknown: MSC conn use + 1 == 2 DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_INIT}: Allocated DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_INIT}: Received Event SUBSCR_CONN_E_START @@ -47,9 +47,9 @@ auth_request_sent == 1 lu_result_sent == 0 - MS sends Authen Response, VLR accepts and sends GSUP LU Req to HLR - rx from MS: pdisc=0x05 msg_type=0x54 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_AUTH_RESP DREF IMSI:901700000010650: MSC conn use + 1 == 2 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_AUTH_RESP (0x5:0x14) DMM IMSI:901700000010650: MM R99 AUTHENTICATION RESPONSE (res = e229c19e791f2e41) DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_WAIT_RESP}: Received Event VLR_AUTH_E_MS_AUTH_RESP DVLR SUBSCR(IMSI:901700000010650) received res: e2 29 c1 9e 79 1f 2e 41 @@ -121,14 +121,14 @@ llist_count(&net->subscr_conns) == 1 msc_subscr_conn_is_accepted() == false requests shall be thwarted -DRLL Dispatching 04.08 message, pdisc=3 -DRLL subscr MSISDN:42342: Message not permitted for initial conn: pdisc=0x03 msg_type=0x05 -DRLL Dispatching 04.08 message, pdisc=5 -DRLL subscr MSISDN:42342: Message not permitted for initial conn: pdisc=0x05 msg_type=0x33 -DRLL Dispatching 04.08 message, pdisc=6 -DRLL subscr MSISDN:42342: Message not permitted for initial conn: pdisc=0x06 msg_type=0x19 -DRLL Dispatching 04.08 message, pdisc=9 -DRLL subscr MSISDN:42342: Message not permitted for initial conn: pdisc=0x09 msg_type=0x01 +DRLL Dispatching 04.08 message GSM48_MT_CC_SETUP (0x3:0x5) +DRLL subscr MSISDN:42342: Message not permitted for initial conn: GSM48_MT_CC_SETUP +DRLL Dispatching 04.08 message unknown 0x33 (0x5:0x33) +DRLL subscr MSISDN:42342: Message not permitted for initial conn: unknown 0x33 +DRLL Dispatching 04.08 message GSM48_MT_RR_SYSINFO_1 (0x6:0x19) +DRLL subscr MSISDN:42342: Message not permitted for initial conn: GSM48_MT_RR_SYSINFO_1 +DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) +DRLL subscr MSISDN:42342: Message not permitted for initial conn: GSM48_PDISC_SMS:0x01 - even though the TMSI is not acked, we can already find the subscr with it DREF VLR subscr MSISDN:42342 usage increases to: 2 vsub != NULL == 1 @@ -137,9 +137,9 @@ vsub->tmsi == 0xffffffff DREF VLR subscr MSISDN:42342 usage decreases to: 1 - MS sends TMSI Realloc Complete - rx from MS: pdisc=0x05 msg_type=0x5b + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_TMSI_REALL_COMPL DREF MSISDN:42342: MSC conn use + 1 == 2 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_TMSI_REALL_COMPL (0x5:0x1b) DMM TMSI Reallocation Completed. Subscriber: MSISDN:42342 DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_WAIT_LU_COMPL}: Received Event VLR_ULA_E_NEW_TMSI_ACK DVLR lu_compl_vlr_fsm(901700000010650){LU_COMPL_VLR_S_WAIT_TMSI_CNF}: Received Event LU_COMPL_VLR_E_NEW_TMSI_ACK @@ -174,10 +174,10 @@ llist_count(&net->subscr_conns) == 0 --- - after a while, a new conn sends a CM Service Request. VLR responds with Auth Req, 2nd auth vector - rx from MS: pdisc=0x05 msg_type=0x24 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_CM_SERV_REQ new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_CM_SERV_REQ (0x5:0x24) DMM <- CM SERVICE REQUEST serv_type=0x08 MI(IMSI)=901700000010650 DREF unknown: MSC conn use + 1 == 2 DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_INIT}: Allocated @@ -208,18 +208,18 @@ - needs auth, not yet accepted msc_subscr_conn_is_accepted() == false requests shall be thwarted -DRLL Dispatching 04.08 message, pdisc=3 -DRLL subscr MSISDN:42342: Message not permitted for initial conn: pdisc=0x03 msg_type=0x05 -DRLL Dispatching 04.08 message, pdisc=5 -DRLL subscr MSISDN:42342: Message not permitted for initial conn: pdisc=0x05 msg_type=0x33 -DRLL Dispatching 04.08 message, pdisc=6 -DRLL subscr MSISDN:42342: Message not permitted for initial conn: pdisc=0x06 msg_type=0x19 -DRLL Dispatching 04.08 message, pdisc=9 -DRLL subscr MSISDN:42342: Message not permitted for initial conn: pdisc=0x09 msg_type=0x01 +DRLL Dispatching 04.08 message GSM48_MT_CC_SETUP (0x3:0x5) +DRLL subscr MSISDN:42342: Message not permitted for initial conn: GSM48_MT_CC_SETUP +DRLL Dispatching 04.08 message unknown 0x33 (0x5:0x33) +DRLL subscr MSISDN:42342: Message not permitted for initial conn: unknown 0x33 +DRLL Dispatching 04.08 message GSM48_MT_RR_SYSINFO_1 (0x6:0x19) +DRLL subscr MSISDN:42342: Message not permitted for initial conn: GSM48_MT_RR_SYSINFO_1 +DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) +DRLL subscr MSISDN:42342: Message not permitted for initial conn: GSM48_PDISC_SMS:0x01 - MS sends Authen Response, VLR accepts with a CM Service Accept - rx from MS: pdisc=0x05 msg_type=0x54 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_AUTH_RESP DREF MSISDN:42342: MSC conn use + 1 == 2 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_AUTH_RESP (0x5:0x14) DMM MSISDN:42342: MM R99 AUTHENTICATION RESPONSE (res = 7db47cf7f81e4dc7) DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_WAIT_RESP}: Received Event VLR_AUTH_E_MS_AUTH_RESP DVLR SUBSCR(MSISDN:42342) received res: 7d b4 7c f7 f8 1e 4d c7 @@ -255,16 +255,16 @@ - a USSD request is serviced expecting USSD: Your extension is 42342 - rx from MS: pdisc=0x0b msg_type=0x3b + MSC <--RAN_GERAN_A-- MS: GSM48_PDISC_NC_SS:0x3b DREF MSISDN:42342: MSC conn use + 1 == 2 -DRLL Dispatching 04.08 message, pdisc=11 -DMM MSISDN:42342 pdisc=11 msg_type=0x3b: received_cm_service_request changes to false +DRLL Dispatching 04.08 message GSM48_PDISC_NC_SS:0x3b (0xb:0x3b) +DMM MSISDN:42342: rx msg GSM48_PDISC_NC_SS:0x3b: received_cm_service_request changes to false DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_COMMUNICATING DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_ACCEPTED}: state_chg to SUBSCR_CONN_S_COMMUNICATING DMM USSD: Own number requested DMM MSISDN:42342: MSISDN = 42342 DMSC msc_tx 43 bytes to MSISDN:42342 via RAN_GERAN_A -- DTAP --RAN_GERAN_A--> MS: 8b2a1c27a225020100302002013b301b04010f0416d9775d0e2ae3e965f73cfd7683d273104d36a3c91a0d +- DTAP --RAN_GERAN_A--> MS: GSM48_PDISC_NC_SS:0x2a: 8b2a1c27a225020100302002013b301b04010f0416d9775d0e2ae3e965f73cfd7683d273104d36a3c91a0d - DTAP matches expected message DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_COMMUNICATING}: Received Event SUBSCR_CONN_E_BUMP DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_COMMUNICATING}: bump: releasing conn @@ -301,10 +301,10 @@ llist_count(&vsub->cs.requests) == 1 DREF VLR subscr MSISDN:42342 usage decreases to: 3 - MS replies with Paging Response, and VLR sends Auth Request with third key - rx from MS: pdisc=0x06 msg_type=0x27 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_RR_PAG_RESP new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=6 +DRLL Dispatching 04.08 message GSM48_MT_RR_PAG_RESP (0x6:0x27) DRR PAGING RESPONSE: MI(IMSI)=901700000010650 DREF unknown: MSC conn use + 1 == 2 DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_INIT}: Allocated @@ -334,18 +334,18 @@ - needs auth, not yet accepted msc_subscr_conn_is_accepted() == false requests shall be thwarted -DRLL Dispatching 04.08 message, pdisc=3 -DRLL subscr MSISDN:42342: Message not permitted for initial conn: pdisc=0x03 msg_type=0x05 -DRLL Dispatching 04.08 message, pdisc=5 -DRLL subscr MSISDN:42342: Message not permitted for initial conn: pdisc=0x05 msg_type=0x33 -DRLL Dispatching 04.08 message, pdisc=6 -DRLL subscr MSISDN:42342: Message not permitted for initial conn: pdisc=0x06 msg_type=0x19 -DRLL Dispatching 04.08 message, pdisc=9 -DRLL subscr MSISDN:42342: Message not permitted for initial conn: pdisc=0x09 msg_type=0x01 +DRLL Dispatching 04.08 message GSM48_MT_CC_SETUP (0x3:0x5) +DRLL subscr MSISDN:42342: Message not permitted for initial conn: GSM48_MT_CC_SETUP +DRLL Dispatching 04.08 message unknown 0x33 (0x5:0x33) +DRLL subscr MSISDN:42342: Message not permitted for initial conn: unknown 0x33 +DRLL Dispatching 04.08 message GSM48_MT_RR_SYSINFO_1 (0x6:0x19) +DRLL subscr MSISDN:42342: Message not permitted for initial conn: GSM48_MT_RR_SYSINFO_1 +DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) +DRLL subscr MSISDN:42342: Message not permitted for initial conn: GSM48_PDISC_SMS:0x01 - MS sends Authen Response, VLR accepts and sends pending SMS - rx from MS: pdisc=0x05 msg_type=0x54 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_AUTH_RESP DREF MSISDN:42342: MSC conn use + 1 == 2 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_AUTH_RESP (0x5:0x14) DMM MSISDN:42342: MM R99 AUTHENTICATION RESPONSE (res = 706f996719ba609c) DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_WAIT_RESP}: Received Event VLR_AUTH_E_MS_AUTH_RESP DVLR SUBSCR(MSISDN:42342) received res: 70 6f 99 67 19 ba 60 9c @@ -375,7 +375,7 @@ DREF VLR subscr MSISDN:42342 usage increases to: 5 DREF MSISDN:42342: MSC conn use + 1 == 3 DMSC msc_tx 91 bytes to MSISDN:42342 via RAN_GERAN_A -- DTAP --RAN_GERAN_A--> MS: 09015801000791447758100650004c0005802443f2000007101000000000445079da1e1ee7416937485e9ea7c965373d1d6683c270383b3d0ed3d36ff71c949e83c22072799e9687c5ec32a81d96afcbf4b4fb0c7ac3e9e9b7db05 +- DTAP --RAN_GERAN_A--> MS: GSM48_PDISC_SMS:0x01: 09015801000791447758100650004c0005802443f2000007101000000000445079da1e1ee7416937485e9ea7c965373d1d6683c270383b3d0ed3d36ff71c949e83c22072799e9687c5ec32a81d96afcbf4b4fb0c7ac3e9e9b7db05 - DTAP matches expected message DREF VLR subscr MSISDN:42342 usage decreases to: 4 DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_BUMP @@ -392,9 +392,9 @@ - conn is still open to wait for SMS ack dance llist_count(&net->subscr_conns) == 1 - MS replies with CP-ACK for received SMS - rx from MS: pdisc=0x89 msg_type=0x04 + MSC <--RAN_GERAN_A-- MS: GSM48_PDISC_SMS:0x04 DREF MSISDN:42342: MSC conn use + 1 == 3 -DRLL Dispatching 04.08 message, pdisc=9 +DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x04 (0x9:0x4) DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_COMMUNICATING DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_ACCEPTED}: state_chg to SUBSCR_CONN_S_COMMUNICATING DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_COMMUNICATING}: Received Event SUBSCR_CONN_E_BUMP @@ -402,12 +402,12 @@ DREF MSISDN:42342: MSC conn use - 1 == 2 llist_count(&net->subscr_conns) == 1 - MS also sends RP-ACK, MSC in turn sends CP-ACK for that - rx from MS: pdisc=0x89 msg_type=0x01 + MSC <--RAN_GERAN_A-- MS: GSM48_PDISC_SMS:0x01 DREF MSISDN:42342: MSC conn use + 1 == 3 -DRLL Dispatching 04.08 message, pdisc=9 +DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_COMMUNICATING}: Received Event SUBSCR_CONN_E_COMMUNICATING DMSC msc_tx 2 bytes to MSISDN:42342 via RAN_GERAN_A -- DTAP --RAN_GERAN_A--> MS: 0904 +- DTAP --RAN_GERAN_A--> MS: GSM48_PDISC_SMS:0x04: 0904 - DTAP matches expected message DREF VLR subscr MSISDN:42342 usage decreases to: 3 DREF VLR subscr MSISDN:42342 usage decreases to: 2 @@ -432,10 +432,10 @@ llist_count(&net->subscr_conns) == 0 --- - subscriber detaches - rx from MS: pdisc=0x05 msg_type=0x01 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_IMSI_DETACH_IND new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_IMSI_DETACH_IND (0x5:0x1) DMM IMSI DETACH INDICATION: MI(IMSI)=901700000010650 DREF VLR subscr MSISDN:42342 usage increases to: 2 DMM IMSI DETACH for MSISDN:42342 @@ -453,10 +453,10 @@ ===== test_umts_authen_utran - Location Update request causes a GSUP Send Auth Info request to HLR - rx from MS: pdisc=0x05 msg_type=0x08 + MSC <--RAN_UTRAN_IU-- MS: GSM48_MT_MM_LOC_UPD_REQUEST new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_LOC_UPD_REQUEST (0x5:0x8) DREF unknown: MSC conn use + 1 == 2 DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_INIT}: Allocated DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_INIT}: Received Event SUBSCR_CONN_E_START @@ -500,9 +500,9 @@ auth_request_sent == 1 lu_result_sent == 0 - MS sends Authen Response, VLR accepts and sends SecurityModeControl - rx from MS: pdisc=0x05 msg_type=0x54 + MSC <--RAN_UTRAN_IU-- MS: GSM48_MT_MM_AUTH_RESP DREF IMSI:901700000010650: MSC conn use + 1 == 2 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_AUTH_RESP (0x5:0x14) DMM IMSI:901700000010650: MM R99 AUTHENTICATION RESPONSE (res = e229c19e791f2e41) DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_WAIT_RESP}: Received Event VLR_AUTH_E_MS_AUTH_RESP DVLR SUBSCR(IMSI:901700000010650) received res: e2 29 c1 9e 79 1f 2e 41 @@ -583,14 +583,14 @@ llist_count(&net->subscr_conns) == 1 msc_subscr_conn_is_accepted() == false requests shall be thwarted -DRLL Dispatching 04.08 message, pdisc=3 -DRLL subscr MSISDN:42342: Message not permitted for initial conn: pdisc=0x03 msg_type=0x05 -DRLL Dispatching 04.08 message, pdisc=5 -DRLL subscr MSISDN:42342: Message not permitted for initial conn: pdisc=0x05 msg_type=0x33 -DRLL Dispatching 04.08 message, pdisc=6 -DRLL subscr MSISDN:42342: Message not permitted for initial conn: pdisc=0x06 msg_type=0x19 -DRLL Dispatching 04.08 message, pdisc=9 -DRLL subscr MSISDN:42342: Message not permitted for initial conn: pdisc=0x09 msg_type=0x01 +DRLL Dispatching 04.08 message GSM48_MT_CC_SETUP (0x3:0x5) +DRLL subscr MSISDN:42342: Message not permitted for initial conn: GSM48_MT_CC_SETUP +DRLL Dispatching 04.08 message unknown 0x33 (0x5:0x33) +DRLL subscr MSISDN:42342: Message not permitted for initial conn: unknown 0x33 +DRLL Dispatching 04.08 message GSM48_MT_RR_SYSINFO_1 (0x6:0x19) +DRLL subscr MSISDN:42342: Message not permitted for initial conn: GSM48_MT_RR_SYSINFO_1 +DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) +DRLL subscr MSISDN:42342: Message not permitted for initial conn: GSM48_PDISC_SMS:0x01 - even though the TMSI is not acked, we can already find the subscr with it DREF VLR subscr MSISDN:42342 usage increases to: 2 vsub != NULL == 1 @@ -599,9 +599,9 @@ vsub->tmsi == 0xffffffff DREF VLR subscr MSISDN:42342 usage decreases to: 1 - MS sends TMSI Realloc Complete - rx from MS: pdisc=0x05 msg_type=0x5b + MSC <--RAN_UTRAN_IU-- MS: GSM48_MT_MM_TMSI_REALL_COMPL DREF MSISDN:42342: MSC conn use + 1 == 2 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_TMSI_REALL_COMPL (0x5:0x1b) DMM TMSI Reallocation Completed. Subscriber: MSISDN:42342 DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_WAIT_LU_COMPL}: Received Event VLR_ULA_E_NEW_TMSI_ACK DVLR lu_compl_vlr_fsm(901700000010650){LU_COMPL_VLR_S_WAIT_TMSI_CNF}: Received Event LU_COMPL_VLR_E_NEW_TMSI_ACK @@ -637,10 +637,10 @@ llist_count(&net->subscr_conns) == 0 --- - after a while, a new conn sends a CM Service Request. VLR responds with Auth Req, 2nd auth vector - rx from MS: pdisc=0x05 msg_type=0x24 + MSC <--RAN_UTRAN_IU-- MS: GSM48_MT_MM_CM_SERV_REQ new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_CM_SERV_REQ (0x5:0x24) DMM <- CM SERVICE REQUEST serv_type=0x08 MI(IMSI)=901700000010650 DREF unknown: MSC conn use + 1 == 2 DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_INIT}: Allocated @@ -671,18 +671,18 @@ - needs auth, not yet accepted msc_subscr_conn_is_accepted() == false requests shall be thwarted -DRLL Dispatching 04.08 message, pdisc=3 -DRLL subscr MSISDN:42342: Message not permitted for initial conn: pdisc=0x03 msg_type=0x05 -DRLL Dispatching 04.08 message, pdisc=5 -DRLL subscr MSISDN:42342: Message not permitted for initial conn: pdisc=0x05 msg_type=0x33 -DRLL Dispatching 04.08 message, pdisc=6 -DRLL subscr MSISDN:42342: Message not permitted for initial conn: pdisc=0x06 msg_type=0x19 -DRLL Dispatching 04.08 message, pdisc=9 -DRLL subscr MSISDN:42342: Message not permitted for initial conn: pdisc=0x09 msg_type=0x01 +DRLL Dispatching 04.08 message GSM48_MT_CC_SETUP (0x3:0x5) +DRLL subscr MSISDN:42342: Message not permitted for initial conn: GSM48_MT_CC_SETUP +DRLL Dispatching 04.08 message unknown 0x33 (0x5:0x33) +DRLL subscr MSISDN:42342: Message not permitted for initial conn: unknown 0x33 +DRLL Dispatching 04.08 message GSM48_MT_RR_SYSINFO_1 (0x6:0x19) +DRLL subscr MSISDN:42342: Message not permitted for initial conn: GSM48_MT_RR_SYSINFO_1 +DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) +DRLL subscr MSISDN:42342: Message not permitted for initial conn: GSM48_PDISC_SMS:0x01 - MS sends Authen Response, VLR accepts and sends SecurityModeControl - rx from MS: pdisc=0x05 msg_type=0x54 + MSC <--RAN_UTRAN_IU-- MS: GSM48_MT_MM_AUTH_RESP DREF MSISDN:42342: MSC conn use + 1 == 2 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_AUTH_RESP (0x5:0x14) DMM MSISDN:42342: MM R99 AUTHENTICATION RESPONSE (res = 7db47cf7f81e4dc7) DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_WAIT_RESP}: Received Event VLR_AUTH_E_MS_AUTH_RESP DVLR SUBSCR(MSISDN:42342) received res: 7d b4 7c f7 f8 1e 4d c7 @@ -725,16 +725,16 @@ - a USSD request is serviced expecting USSD: Your extension is 42342 - rx from MS: pdisc=0x0b msg_type=0x3b + MSC <--RAN_UTRAN_IU-- MS: GSM48_PDISC_NC_SS:0x3b DREF MSISDN:42342: MSC conn use + 1 == 2 -DRLL Dispatching 04.08 message, pdisc=11 -DMM MSISDN:42342 pdisc=11 msg_type=0x3b: received_cm_service_request changes to false +DRLL Dispatching 04.08 message GSM48_PDISC_NC_SS:0x3b (0xb:0x3b) +DMM MSISDN:42342: rx msg GSM48_PDISC_NC_SS:0x3b: received_cm_service_request changes to false DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_COMMUNICATING DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_ACCEPTED}: state_chg to SUBSCR_CONN_S_COMMUNICATING DMM USSD: Own number requested DMM MSISDN:42342: MSISDN = 42342 DMSC msc_tx 43 bytes to MSISDN:42342 via RAN_UTRAN_IU -- DTAP --RAN_UTRAN_IU--> MS: 8b2a1c27a225020100302002013b301b04010f0416d9775d0e2ae3e965f73cfd7683d273104d36a3c91a0d +- DTAP --RAN_UTRAN_IU--> MS: GSM48_PDISC_NC_SS:0x2a: 8b2a1c27a225020100302002013b301b04010f0416d9775d0e2ae3e965f73cfd7683d273104d36a3c91a0d - DTAP matches expected message DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_COMMUNICATING}: Received Event SUBSCR_CONN_E_BUMP DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_COMMUNICATING}: bump: releasing conn @@ -772,10 +772,10 @@ llist_count(&vsub->cs.requests) == 1 DREF VLR subscr MSISDN:42342 usage decreases to: 3 - MS replies with Paging Response, and VLR sends Auth Request with third key - rx from MS: pdisc=0x06 msg_type=0x27 + MSC <--RAN_UTRAN_IU-- MS: GSM48_MT_RR_PAG_RESP new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=6 +DRLL Dispatching 04.08 message GSM48_MT_RR_PAG_RESP (0x6:0x27) DRR PAGING RESPONSE: MI(IMSI)=901700000010650 DREF unknown: MSC conn use + 1 == 2 DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_INIT}: Allocated @@ -805,18 +805,18 @@ - needs auth, not yet accepted msc_subscr_conn_is_accepted() == false requests shall be thwarted -DRLL Dispatching 04.08 message, pdisc=3 -DRLL subscr MSISDN:42342: Message not permitted for initial conn: pdisc=0x03 msg_type=0x05 -DRLL Dispatching 04.08 message, pdisc=5 -DRLL subscr MSISDN:42342: Message not permitted for initial conn: pdisc=0x05 msg_type=0x33 -DRLL Dispatching 04.08 message, pdisc=6 -DRLL subscr MSISDN:42342: Message not permitted for initial conn: pdisc=0x06 msg_type=0x19 -DRLL Dispatching 04.08 message, pdisc=9 -DRLL subscr MSISDN:42342: Message not permitted for initial conn: pdisc=0x09 msg_type=0x01 +DRLL Dispatching 04.08 message GSM48_MT_CC_SETUP (0x3:0x5) +DRLL subscr MSISDN:42342: Message not permitted for initial conn: GSM48_MT_CC_SETUP +DRLL Dispatching 04.08 message unknown 0x33 (0x5:0x33) +DRLL subscr MSISDN:42342: Message not permitted for initial conn: unknown 0x33 +DRLL Dispatching 04.08 message GSM48_MT_RR_SYSINFO_1 (0x6:0x19) +DRLL subscr MSISDN:42342: Message not permitted for initial conn: GSM48_MT_RR_SYSINFO_1 +DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) +DRLL subscr MSISDN:42342: Message not permitted for initial conn: GSM48_PDISC_SMS:0x01 - MS sends Authen Response, VLR accepts and sends SecurityModeControl - rx from MS: pdisc=0x05 msg_type=0x54 + MSC <--RAN_UTRAN_IU-- MS: GSM48_MT_MM_AUTH_RESP DREF MSISDN:42342: MSC conn use + 1 == 2 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_AUTH_RESP (0x5:0x14) DMM MSISDN:42342: MM R99 AUTHENTICATION RESPONSE (res = 706f996719ba609c) DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_WAIT_RESP}: Received Event VLR_AUTH_E_MS_AUTH_RESP DVLR SUBSCR(MSISDN:42342) received res: 70 6f 99 67 19 ba 60 9c @@ -857,7 +857,7 @@ DREF VLR subscr MSISDN:42342 usage increases to: 5 DREF MSISDN:42342: MSC conn use + 1 == 2 DMSC msc_tx 91 bytes to MSISDN:42342 via RAN_UTRAN_IU -- DTAP --RAN_UTRAN_IU--> MS: 09015801000791447758100650004c0005802443f2000007101000000000445079da1e1ee7416937485e9ea7c965373d1d6683c270383b3d0ed3d36ff71c949e83c22072799e9687c5ec32a81d96afcbf4b4fb0c7ac3e9e9b7db05 +- DTAP --RAN_UTRAN_IU--> MS: GSM48_PDISC_SMS:0x01: 09015801000791447758100650004c0005802443f2000007101000000000445079da1e1ee7416937485e9ea7c965373d1d6683c270383b3d0ed3d36ff71c949e83c22072799e9687c5ec32a81d96afcbf4b4fb0c7ac3e9e9b7db05 - DTAP matches expected message DREF VLR subscr MSISDN:42342 usage decreases to: 4 DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_BUMP @@ -870,9 +870,9 @@ - conn is still open to wait for SMS ack dance llist_count(&net->subscr_conns) == 1 - MS replies with CP-ACK for received SMS - rx from MS: pdisc=0x89 msg_type=0x04 + MSC <--RAN_UTRAN_IU-- MS: GSM48_PDISC_SMS:0x04 DREF MSISDN:42342: MSC conn use + 1 == 3 -DRLL Dispatching 04.08 message, pdisc=9 +DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x04 (0x9:0x4) DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_COMMUNICATING DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_ACCEPTED}: state_chg to SUBSCR_CONN_S_COMMUNICATING DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_COMMUNICATING}: Received Event SUBSCR_CONN_E_BUMP @@ -880,12 +880,12 @@ DREF MSISDN:42342: MSC conn use - 1 == 2 llist_count(&net->subscr_conns) == 1 - MS also sends RP-ACK, MSC in turn sends CP-ACK for that - rx from MS: pdisc=0x89 msg_type=0x01 + MSC <--RAN_UTRAN_IU-- MS: GSM48_PDISC_SMS:0x01 DREF MSISDN:42342: MSC conn use + 1 == 3 -DRLL Dispatching 04.08 message, pdisc=9 +DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_COMMUNICATING}: Received Event SUBSCR_CONN_E_COMMUNICATING DMSC msc_tx 2 bytes to MSISDN:42342 via RAN_UTRAN_IU -- DTAP --RAN_UTRAN_IU--> MS: 0904 +- DTAP --RAN_UTRAN_IU--> MS: GSM48_PDISC_SMS:0x04: 0904 - DTAP matches expected message DREF VLR subscr MSISDN:42342 usage decreases to: 3 DREF VLR subscr MSISDN:42342 usage decreases to: 2 @@ -911,10 +911,10 @@ llist_count(&net->subscr_conns) == 0 --- - subscriber detaches - rx from MS: pdisc=0x05 msg_type=0x01 + MSC <--RAN_UTRAN_IU-- MS: GSM48_MT_MM_IMSI_DETACH_IND new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_IMSI_DETACH_IND (0x5:0x1) DMM IMSI DETACH INDICATION: MI(IMSI)=901700000010650 DREF VLR subscr MSISDN:42342 usage increases to: 2 DMM IMSI DETACH for MSISDN:42342 @@ -933,10 +933,10 @@ ===== test_umts_authen_resync_geran - Location Update request causes a GSUP Send Auth Info request to HLR - rx from MS: pdisc=0x05 msg_type=0x08 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_LOC_UPD_REQUEST new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_LOC_UPD_REQUEST (0x5:0x8) DREF unknown: MSC conn use + 1 == 2 DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_INIT}: Allocated DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_INIT}: Received Event SUBSCR_CONN_E_START @@ -980,9 +980,9 @@ auth_request_sent == 1 lu_result_sent == 0 - MS sends Authen Failure with Resync cause, VLR sends GSUP to HLR to resync - rx from MS: pdisc=0x05 msg_type=0x1c + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_AUTH_FAIL DREF IMSI:901700000010650: MSC conn use + 1 == 2 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_AUTH_FAIL (0x5:0x1c) DMM IMSI:901700000010650: MM R99 AUTHENTICATION SYNCH (AUTS = 979498b1f72d3e28c59fa2e72f9c) DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_WAIT_RESP}: Received Event VLR_AUTH_E_MS_AUTH_FAIL DVLR GSUP tx: 08010809710000000156f0260e979498b1f72d3e28c59fa2e72f9c201039fa2f4e3d523d8619a73b4f65c3e14d @@ -1010,9 +1010,9 @@ auth_request_sent == 1 lu_result_sent == 0 - MS sends Authen Response, VLR accepts and sends GSUP LU Req to HLR - rx from MS: pdisc=0x05 msg_type=0x54 + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_AUTH_RESP DREF IMSI:901700000010650: MSC conn use + 1 == 2 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_AUTH_RESP (0x5:0x14) DMM IMSI:901700000010650: MM R99 AUTHENTICATION RESPONSE (res = 1df5f0b4f22b696e) DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_WAIT_RESP_RESYNC}: Received Event VLR_AUTH_E_MS_AUTH_RESP DVLR SUBSCR(IMSI:901700000010650) received res: 1d f5 f0 b4 f2 2b 69 6e @@ -1084,14 +1084,14 @@ llist_count(&net->subscr_conns) == 1 msc_subscr_conn_is_accepted() == false requests shall be thwarted -DRLL Dispatching 04.08 message, pdisc=3 -DRLL subscr MSISDN:42342: Message not permitted for initial conn: pdisc=0x03 msg_type=0x05 -DRLL Dispatching 04.08 message, pdisc=5 -DRLL subscr MSISDN:42342: Message not permitted for initial conn: pdisc=0x05 msg_type=0x33 -DRLL Dispatching 04.08 message, pdisc=6 -DRLL subscr MSISDN:42342: Message not permitted for initial conn: pdisc=0x06 msg_type=0x19 -DRLL Dispatching 04.08 message, pdisc=9 -DRLL subscr MSISDN:42342: Message not permitted for initial conn: pdisc=0x09 msg_type=0x01 +DRLL Dispatching 04.08 message GSM48_MT_CC_SETUP (0x3:0x5) +DRLL subscr MSISDN:42342: Message not permitted for initial conn: GSM48_MT_CC_SETUP +DRLL Dispatching 04.08 message unknown 0x33 (0x5:0x33) +DRLL subscr MSISDN:42342: Message not permitted for initial conn: unknown 0x33 +DRLL Dispatching 04.08 message GSM48_MT_RR_SYSINFO_1 (0x6:0x19) +DRLL subscr MSISDN:42342: Message not permitted for initial conn: GSM48_MT_RR_SYSINFO_1 +DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) +DRLL subscr MSISDN:42342: Message not permitted for initial conn: GSM48_PDISC_SMS:0x01 - even though the TMSI is not acked, we can already find the subscr with it DREF VLR subscr MSISDN:42342 usage increases to: 2 vsub != NULL == 1 @@ -1100,9 +1100,9 @@ vsub->tmsi == 0xffffffff DREF VLR subscr MSISDN:42342 usage decreases to: 1 - MS sends TMSI Realloc Complete - rx from MS: pdisc=0x05 msg_type=0x5b + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_TMSI_REALL_COMPL DREF MSISDN:42342: MSC conn use + 1 == 2 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_TMSI_REALL_COMPL (0x5:0x1b) DMM TMSI Reallocation Completed. Subscriber: MSISDN:42342 DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_WAIT_LU_COMPL}: Received Event VLR_ULA_E_NEW_TMSI_ACK DVLR lu_compl_vlr_fsm(901700000010650){LU_COMPL_VLR_S_WAIT_TMSI_CNF}: Received Event LU_COMPL_VLR_E_NEW_TMSI_ACK @@ -1143,10 +1143,10 @@ ===== test_umts_authen_resync_utran - Location Update request causes a GSUP Send Auth Info request to HLR - rx from MS: pdisc=0x05 msg_type=0x08 + MSC <--RAN_UTRAN_IU-- MS: GSM48_MT_MM_LOC_UPD_REQUEST new conn DREF unknown: MSC conn use + 1 == 1 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_LOC_UPD_REQUEST (0x5:0x8) DREF unknown: MSC conn use + 1 == 2 DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_INIT}: Allocated DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_INIT}: Received Event SUBSCR_CONN_E_START @@ -1190,9 +1190,9 @@ auth_request_sent == 1 lu_result_sent == 0 - MS sends Authen Failure with Resync cause, VLR sends GSUP to HLR to resync - rx from MS: pdisc=0x05 msg_type=0x1c + MSC <--RAN_UTRAN_IU-- MS: GSM48_MT_MM_AUTH_FAIL DREF IMSI:901700000010650: MSC conn use + 1 == 2 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_AUTH_FAIL (0x5:0x1c) DMM IMSI:901700000010650: MM R99 AUTHENTICATION SYNCH (AUTS = 979498b1f72d3e28c59fa2e72f9c) DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_WAIT_RESP}: Received Event VLR_AUTH_E_MS_AUTH_FAIL DVLR GSUP tx: 08010809710000000156f0260e979498b1f72d3e28c59fa2e72f9c201039fa2f4e3d523d8619a73b4f65c3e14d @@ -1220,9 +1220,9 @@ auth_request_sent == 1 lu_result_sent == 0 - MS sends Authen Response, VLR accepts and sends SecurityModeControl - rx from MS: pdisc=0x05 msg_type=0x54 + MSC <--RAN_UTRAN_IU-- MS: GSM48_MT_MM_AUTH_RESP DREF IMSI:901700000010650: MSC conn use + 1 == 2 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_AUTH_RESP (0x5:0x14) DMM IMSI:901700000010650: MM R99 AUTHENTICATION RESPONSE (res = 1df5f0b4f22b696e) DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_WAIT_RESP_RESYNC}: Received Event VLR_AUTH_E_MS_AUTH_RESP DVLR SUBSCR(IMSI:901700000010650) received res: 1d f5 f0 b4 f2 2b 69 6e @@ -1303,14 +1303,14 @@ llist_count(&net->subscr_conns) == 1 msc_subscr_conn_is_accepted() == false requests shall be thwarted -DRLL Dispatching 04.08 message, pdisc=3 -DRLL subscr MSISDN:42342: Message not permitted for initial conn: pdisc=0x03 msg_type=0x05 -DRLL Dispatching 04.08 message, pdisc=5 -DRLL subscr MSISDN:42342: Message not permitted for initial conn: pdisc=0x05 msg_type=0x33 -DRLL Dispatching 04.08 message, pdisc=6 -DRLL subscr MSISDN:42342: Message not permitted for initial conn: pdisc=0x06 msg_type=0x19 -DRLL Dispatching 04.08 message, pdisc=9 -DRLL subscr MSISDN:42342: Message not permitted for initial conn: pdisc=0x09 msg_type=0x01 +DRLL Dispatching 04.08 message GSM48_MT_CC_SETUP (0x3:0x5) +DRLL subscr MSISDN:42342: Message not permitted for initial conn: GSM48_MT_CC_SETUP +DRLL Dispatching 04.08 message unknown 0x33 (0x5:0x33) +DRLL subscr MSISDN:42342: Message not permitted for initial conn: unknown 0x33 +DRLL Dispatching 04.08 message GSM48_MT_RR_SYSINFO_1 (0x6:0x19) +DRLL subscr MSISDN:42342: Message not permitted for initial conn: GSM48_MT_RR_SYSINFO_1 +DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) +DRLL subscr MSISDN:42342: Message not permitted for initial conn: GSM48_PDISC_SMS:0x01 - even though the TMSI is not acked, we can already find the subscr with it DREF VLR subscr MSISDN:42342 usage increases to: 2 vsub != NULL == 1 @@ -1319,9 +1319,9 @@ vsub->tmsi == 0xffffffff DREF VLR subscr MSISDN:42342 usage decreases to: 1 - MS sends TMSI Realloc Complete - rx from MS: pdisc=0x05 msg_type=0x5b + MSC <--RAN_UTRAN_IU-- MS: GSM48_MT_MM_TMSI_REALL_COMPL DREF MSISDN:42342: MSC conn use + 1 == 2 -DRLL Dispatching 04.08 message, pdisc=5 +DRLL Dispatching 04.08 message GSM48_MT_MM_TMSI_REALL_COMPL (0x5:0x1b) DMM TMSI Reallocation Completed. Subscriber: MSISDN:42342 DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_WAIT_LU_COMPL}: Received Event VLR_ULA_E_NEW_TMSI_ACK DVLR lu_compl_vlr_fsm(901700000010650){LU_COMPL_VLR_S_WAIT_TMSI_CNF}: Received Event LU_COMPL_VLR_E_NEW_TMSI_ACK diff --git a/tests/msc_vlr/msc_vlr_tests.c b/tests/msc_vlr/msc_vlr_tests.c index 2049e9f..6da34ae 100644 --- a/tests/msc_vlr/msc_vlr_tests.c +++ b/tests/msc_vlr/msc_vlr_tests.c @@ -69,6 +69,17 @@ return msg; } +const char *gh_type_name(struct gsm48_hdr *gh) +{ + return gsm48_pdisc_msgtype_name(gsm48_hdr_pdisc(gh), + gsm48_hdr_msg_type(gh)); +} + +const char *msg_type_name(struct msgb *msg) +{ + return gh_type_name((void*)msg->data); +} + void dtap_expect_tx(const char *hex) { /* Has the previously expected dtap been received? */ @@ -153,8 +164,10 @@ int rc; struct gsm48_hdr *gh = msgb_l3(msg); - log("rx from MS: pdisc=0x%02x msg_type=0x%02x", - gh->proto_discr, gh->msg_type); + + log("MSC <--%s-- MS: %s", + ran_type_name(rx_from_ran), + gh_type_name(gh)); if (g_conn && !conn_exists(g_conn)) g_conn = NULL; @@ -427,8 +440,9 @@ int _validate_dtap(struct msgb *msg, enum ran_type to_ran) { - btw("DTAP --%s--> MS: %s", - ran_type_name(to_ran), + struct gsm48_hdr *gh = (void*)msg->data; + btw("DTAP --%s--> MS: %s: %s", + ran_type_name(to_ran), msg_type_name(msg), osmo_hexdump_nospc(msg->data, msg->len)); OSMO_ASSERT(dtap_tx_expected); -- To view, visit https://gerrit.osmocom.org/3350 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ida205d217e304337d816b14fd15e2ee435e7397d Gerrit-PatchSet: 8 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pablo Neira Ayuso From gerrit-no-reply at lists.osmocom.org Thu Aug 24 18:53:34 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 24 Aug 2017 18:53:34 +0000 Subject: [MERGED] osmo-msc[master]: contrib: Add osmo-msc service file In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: contrib: Add osmo-msc service file ...................................................................... contrib: Add osmo-msc service file Change-Id: Ifdaf4107167c84af8a616f4ee792d5a34495564b --- A contrib/systemd/osmo-msc.service 1 file changed, 13 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/contrib/systemd/osmo-msc.service b/contrib/systemd/osmo-msc.service new file mode 100644 index 0000000..2c81eba --- /dev/null +++ b/contrib/systemd/osmo-msc.service @@ -0,0 +1,13 @@ +[Unit] +Description=Osmocom Mobile Switching Center (MSC) +Wants=osmo-hlr +After=osmo-hlr + +[Service] +Type=simple +Restart=always +ExecStart=/usr/bin/osmo-msc -c /etc/osmocom/osmo-msc.cfg +RestartSec=2 + +[Install] +WantedBy=multi-user.target -- To view, visit https://gerrit.osmocom.org/3418 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ifdaf4107167c84af8a616f4ee792d5a34495564b Gerrit-PatchSet: 3 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: daniel From gerrit-no-reply at lists.osmocom.org Thu Aug 24 18:54:18 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 24 Aug 2017 18:54:18 +0000 Subject: libosmo-sccp[master]: osmo_ss7_vty: fix 'as' / 'routing-key' command In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3585 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Idc68bfae5457960a9eae5d9648586d6ce719ad68 Gerrit-PatchSet: 1 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Aug 24 18:54:25 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 24 Aug 2017 18:54:25 +0000 Subject: [MERGED] libosmo-sccp[master]: osmo_ss7_vty: fix 'as' / 'routing-key' command In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: osmo_ss7_vty: fix 'as' / 'routing-key' command ...................................................................... osmo_ss7_vty: fix 'as' / 'routing-key' command The VTY definition for this command is flawed and breaks osmo-msc VTY tests. The small problem is a stray '}' in the definition, the bigger problem is that square brackets indicating optional arguments must not enclose more than one argument. Split up the command in several separate definitions with si arg, with ssn arg, with both, and with neither. If si and/or ssn are not passed, set them to zero. See https://lists.osmocom.org/pipermail/openbsc/2017-August/011026.html "optional vty items are stricter than expected" Change-Id: Idc68bfae5457960a9eae5d9648586d6ce719ad68 --- M src/osmo_ss7_vty.c 1 file changed, 58 insertions(+), 31 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/osmo_ss7_vty.c b/src/osmo_ss7_vty.c index 8d2ec96..5731326 100644 --- a/src/osmo_ss7_vty.c +++ b/src/osmo_ss7_vty.c @@ -778,51 +778,75 @@ { 0, NULL } }; -DEFUN(as_rout_key, as_rout_key_cmd, - "routing-key RCONTEXT DPC [si (aal2|bicc|b-isup|h248|isup|sat-isup|sccp|tup)] [ssn SSN]}", - "Define a routing key\n" - "Routing context number\n" +#define ROUTING_KEY_CMD "routing-key RCONTEXT DPC" +#define ROUTING_KEY_CMD_STRS \ + "Define a routing key\n" \ + "Routing context number\n" \ "Destination Point Code\n" - "Optional Match on Service Indicator\n" - "ATM Adaption Layer 2\n" - "Bearer Independent Call Control\n" - "Broadband ISDN User Part\n" - "H.248\n" - "ISDN User Part\n" - "Sattelite ISDN User Part\n" - "Signalling Connection Control Part\n" +#define ROUTING_KEY_SI_ARG " si (aal2|bicc|b-isup|h248|isup|sat-isup|sccp|tup)" +#define ROUTING_KEY_SI_ARG_STRS \ + "Match on Service Indicator\n" \ + "ATM Adaption Layer 2\n" \ + "Bearer Independent Call Control\n" \ + "Broadband ISDN User Part\n" \ + "H.248\n" \ + "ISDN User Part\n" \ + "Sattelite ISDN User Part\n" \ + "Signalling Connection Control Part\n" \ "Telephony User Part\n" - "Optional Match on Sub-System Number\n" - "Sub-System Number to match on\n") +#define ROUTING_KEY_SSN_ARG " ssn SSN" +#define ROUTING_KEY_SSN_ARG_STRS \ + "Match on Sub-System Number\n" \ + "Sub-System Number to match on\n" + +static int _rout_key(struct vty *vty, + const char *rcontext, const char *dpc, + const char *si, const char *ssn) { struct osmo_ss7_as *as = vty->index; struct osmo_ss7_routing_key *rkey = &as->cfg.routing_key; - int argind; int pc; - pc = osmo_ss7_pointcode_parse(as->inst, argv[1]); + pc = osmo_ss7_pointcode_parse(as->inst, dpc); if (pc < 0) { - vty_out(vty, "Invalid point code (%s)%s", argv[1], VTY_NEWLINE); + vty_out(vty, "Invalid point code (%s)%s", dpc, VTY_NEWLINE); return CMD_WARNING; } - rkey->pc = pc; - rkey->context = atoi(argv[0]); - argind = 2; - if (argind < argc && !strcmp(argv[argind], "si")) { - const char *si_str; - argind++; - si_str = argv[argind++]; - /* parse numeric SI from string */ - rkey->si = get_string_value(mtp_si_vals, si_str); - } - if (argind < argc && !strcmp(argv[argind], "ssn")) { - argind++; - rkey->ssn = atoi(argv[argind]); - } + rkey->context = atoi(rcontext); /* FIXME: input validation */ + rkey->si = si ? get_string_value(mtp_si_vals, si) : 0; /* FIXME: input validation */ + rkey->ssn = ssn ? atoi(ssn) : 0; /* FIXME: input validation */ return CMD_SUCCESS; +} + +DEFUN(as_rout_key, as_rout_key_cmd, + ROUTING_KEY_CMD, + ROUTING_KEY_CMD_STRS) +{ + return _rout_key(vty, argv[0], argv[1], NULL, NULL); +} + +DEFUN(as_rout_key_si, as_rout_key_si_cmd, + ROUTING_KEY_CMD ROUTING_KEY_SI_ARG, + ROUTING_KEY_CMD_STRS ROUTING_KEY_SI_ARG_STRS) +{ + return _rout_key(vty, argv[0], argv[1], argv[2], NULL); +} + +DEFUN(as_rout_key_ssn, as_rout_key_ssn_cmd, + ROUTING_KEY_CMD ROUTING_KEY_SSN_ARG, + ROUTING_KEY_CMD_STRS ROUTING_KEY_SSN_ARG_STRS) +{ + return _rout_key(vty, argv[0], argv[1], NULL, argv[2]); +} + +DEFUN(as_rout_key_si_ssn, as_rout_key_si_ssn_cmd, + ROUTING_KEY_CMD ROUTING_KEY_SI_ARG ROUTING_KEY_SSN_ARG, + ROUTING_KEY_CMD_STRS ROUTING_KEY_SI_ARG_STRS ROUTING_KEY_SSN_ARG_STRS) +{ + return _rout_key(vty, argv[0], argv[1], argv[2], argv[3]); } DEFUN(as_pc_override, as_pc_override_cmd, @@ -1718,6 +1742,9 @@ install_element(L_CS7_AS_NODE, &as_recov_tout_cmd); install_element(L_CS7_AS_NODE, &as_qos_class_cmd); install_element(L_CS7_AS_NODE, &as_rout_key_cmd); + install_element(L_CS7_AS_NODE, &as_rout_key_si_cmd); + install_element(L_CS7_AS_NODE, &as_rout_key_ssn_cmd); + install_element(L_CS7_AS_NODE, &as_rout_key_si_ssn_cmd); install_element(L_CS7_AS_NODE, &as_pc_override_cmd); vty_init_addr(); -- To view, visit https://gerrit.osmocom.org/3585 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Idc68bfae5457960a9eae5d9648586d6ce719ad68 Gerrit-PatchSet: 1 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Thu Aug 24 18:54:40 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 24 Aug 2017 18:54:40 +0000 Subject: osmo-gsm-tester[master]: default-suites.conf: Add suites to explicitly test with sysm... In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3589 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I6ff08a281c0c32148ca2c59f731d6550bf7b1c90 Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Aug 24 18:55:41 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 24 Aug 2017 18:55:41 +0000 Subject: libosmo-abis[master]: Prepare for next release In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 (1 comment) https://gerrit.osmocom.org/#/c/3595/1//COMMIT_MSG Commit Message: Line 11: libosmotrau due to API changes would be good to indicate roguhtly which API changes (commit[s]) and also remove the related part from TODO-RELEASE ? -- To view, visit https://gerrit.osmocom.org/3595 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ibefe53a7f5b06fb8a9294574af41dacac68bdbe9 Gerrit-PatchSet: 1 Gerrit-Project: libosmo-abis Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Thu Aug 24 18:56:30 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 24 Aug 2017 18:56:30 +0000 Subject: =?UTF-8?Q?libosmo-abis=5Bmaster=5D=3A_Bump_version=3A_0=2E3=2E2_=E2=86=92_0=2E4=2E0?= In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 (1 comment) https://gerrit.osmocom.org/#/c/3596/1/TODO-RELEASE File TODO-RELEASE: Line 4 maybe simply squash the two commits? Why have one commit to introduce the LIBVERSION change and another that removes the lines from todo-release? -- To view, visit https://gerrit.osmocom.org/3596 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I6f0ac8377adeccd4c56555cdc16768973c1f0876 Gerrit-PatchSet: 1 Gerrit-Project: libosmo-abis Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: neels Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Thu Aug 24 18:57:14 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 24 Aug 2017 18:57:14 +0000 Subject: osmo-ci[master]: osmocom-nightly-nitb-split.yml: schedule the job to be run a... In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 Verified+1 -- To view, visit https://gerrit.osmocom.org/3558 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I0d80e7d260f9092f44d4d80471a4dd67b7acc839 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Owner: lynxis lazus Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Max Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Aug 24 18:57:33 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 24 Aug 2017 18:57:33 +0000 Subject: osmo-ci[master]: scripts: add requirements.txt to list jenkins-job-builder In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 Verified+1 setting "verified" as we simply have no process to verify such changes for now. -- To view, visit https://gerrit.osmocom.org/3559 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: If25ce84593bbf6a393928a8f4e1670f320c48ca4 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Owner: lynxis lazus Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Max Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Aug 24 18:58:40 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 24 Aug 2017 18:58:40 +0000 Subject: openggsn[master]: libgtp: expand logging In-Reply-To: References: Message-ID: Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3573 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I0f8ad8687acb7f6f0eeeb962f007e87cca0c4c27 Gerrit-PatchSet: 3 Gerrit-Project: openggsn Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: daniel Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Aug 24 18:58:43 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 24 Aug 2017 18:58:43 +0000 Subject: [MERGED] openggsn[master]: libgtp: expand logging In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: libgtp: expand logging ...................................................................... libgtp: expand logging * print destination address on sendto error * print address length on conversion error * log listening address * log GTP version on PDP context errors * fix incorrect logging message for unknown GSN peer Related: SYS#3610 Change-Id: I0f8ad8687acb7f6f0eeeb962f007e87cca0c4c27 --- M gtp/gtp.c 1 file changed, 7 insertions(+), 10 deletions(-) Approvals: Pau Espin Pedrol: Looks good to me, but someone else must approve Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/gtp/gtp.c b/gtp/gtp.c index 012aa79..a3f6eb2 100644 --- a/gtp/gtp.c +++ b/gtp/gtp.c @@ -394,9 +394,8 @@ if (sendto(fd, packet, len, 0, (struct sockaddr *)&addr, sizeof(addr)) < 0) { gsn->err_sendto++; - LOGP(DLGTP, LOGL_ERROR, - "Sendto(fd=%d, msg=%lx, len=%d) failed: Error = %s\n", fd, - (unsigned long)&packet, len, strerror(errno)); + LOGP(DLGTP, LOGL_ERROR, "Sendto(fd=%d, msg=%lx, len=%d, dst=%s) failed: Error = %s\n", fd, + (unsigned long)&packet, len, inet_ntoa(addr.sin_addr), strerror(errno)); return -1; } @@ -697,7 +696,7 @@ { struct sockaddr_in addr; - LOGP(DLGTP, LOGL_NOTICE, "GTP: gtp_newgsn() started\n"); + LOGP(DLGTP, LOGL_NOTICE, "GTP: gtp_newgsn() started at %s\n", inet_ntoa(*listen)); *gsn = calloc(sizeof(struct gsn_t), 1); /* TODO */ @@ -2293,8 +2292,7 @@ if (gsna2in_addr(&addr, &pdp->gsnrc)) { gsn->err_address++; - LOGP(DLGTP, LOGL_ERROR, - "GSN address conversion failed\n"); + LOGP(DLGTP, LOGL_ERROR, "GSN address (len=%u) conversion failed\n", pdp->gsnrc.l); return EOF; } @@ -2642,7 +2640,7 @@ (&pdp, ntoh16(((union gtp_packet *)pack)->gtp0.h.flow))) { gsn->err_unknownpdp++; GTP_LOGPKG(LOGL_ERROR, peer, pack, - len, "Unknown PDP context\n"); + len, "Unknown PDP context, GTPv0\n"); return gtp_error_ind_resp(gsn, version, peer, fd, pack, len); } @@ -2652,7 +2650,7 @@ (&pdp, ntoh32(((union gtp_packet *)pack)->gtp1l.h.tei))) { gsn->err_unknownpdp++; GTP_LOGPKG(LOGL_ERROR, peer, pack, - len, "Unknown PDP context\n"); + len, "Unknown PDP context, GTPv1\n"); return gtp_error_ind_resp(gsn, version, peer, fd, pack, len); } @@ -2670,8 +2668,7 @@ /* If the GPDU was not from the peer GSN tell him to delete context */ if (memcmp(&peer->sin_addr, pdp->gsnru.v, pdp->gsnru.l)) { /* TODO Range? */ gsn->err_unknownpdp++; - GTP_LOGPKG(LOGL_ERROR, peer, pack, len, - "Unknown PDP context\n"); + GTP_LOGPKG(LOGL_ERROR, peer, pack, len, "Unknown GSN peer %s\n", inet_ntoa(peer->sin_addr)); return gtp_error_ind_resp(gsn, version, peer, fd, pack, len); } -- To view, visit https://gerrit.osmocom.org/3573 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I0f8ad8687acb7f6f0eeeb962f007e87cca0c4c27 Gerrit-PatchSet: 3 Gerrit-Project: openggsn Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: daniel From gerrit-no-reply at lists.osmocom.org Thu Aug 24 18:59:37 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 24 Aug 2017 18:59:37 +0000 Subject: openbsc[master]: Revert "factor out & introduce struct gsm_encr, in common_cs.h" In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 I agree with max' comments but I think this is a simple "revert" of an existing commit. So the issues should be resolved separately, and not in the same commit as the revert, right? -- To view, visit https://gerrit.osmocom.org/3570 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I15d60441c6c6f053486c0482258a8759bdd92df1 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Aug 24 19:00:27 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 24 Aug 2017 19:00:27 +0000 Subject: osmo-bts[master]: osmo-bts-trx: Relax validation to allow TRX data bursts with... In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 I think a one-line comment in the code would make sense in addition to the commit log message. Nobody will understand the code otherwise. -- To view, visit https://gerrit.osmocom.org/3580 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I94c3cb160bfed0ba9c41ed7ef5f8d8a65b81ad07 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Aug 24 19:00:46 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 24 Aug 2017 19:00:46 +0000 Subject: osmo-pcap[master]: Add gitreview config In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3576 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I35b3aaa3f8af4127d8a1b00c77ab02ae6a182714 Gerrit-PatchSet: 1 Gerrit-Project: osmo-pcap Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: lynxis lazus Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Aug 24 19:00:48 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 24 Aug 2017 19:00:48 +0000 Subject: [MERGED] osmo-pcap[master]: Add gitreview config In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Add gitreview config ...................................................................... Add gitreview config Change-Id: I35b3aaa3f8af4127d8a1b00c77ab02ae6a182714 --- A .gitreview 1 file changed, 3 insertions(+), 0 deletions(-) Approvals: lynxis lazus: Looks good to me, but someone else must approve Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/.gitreview b/.gitreview new file mode 100644 index 0000000..e218434 --- /dev/null +++ b/.gitreview @@ -0,0 +1,3 @@ +[gerrit] +host=gerrit.osmocom.org +project=osmo-pcap -- To view, visit https://gerrit.osmocom.org/3576 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I35b3aaa3f8af4127d8a1b00c77ab02ae6a182714 Gerrit-PatchSet: 1 Gerrit-Project: osmo-pcap Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: lynxis lazus From gerrit-no-reply at lists.osmocom.org Thu Aug 24 19:02:26 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 24 Aug 2017 19:02:26 +0000 Subject: openbsc[master]: SGSN: log IMSI on PDP context creation/deletion In-Reply-To: References: Message-ID: Patch Set 3: Code-Review+1 (1 comment) https://gerrit.osmocom.org/#/c/3575/3/openbsc/src/gprs/sgsn_libgtp.c File openbsc/src/gprs/sgsn_libgtp.c: Line 148: LOGP(DGPRS, LOGL_ERROR, "Create PDP Context for %s\n", mmctx->imsi); I think if you want to do this, it would make sense to also print the NSAPI, as only the tuple of IMSI:NSAPI uniquely identifies a PDP context. Same for the deletion callback below. I've introduced recent changes in OpenGGSN by having some logging wrapper macros like LOGPPDP() or the like. Could make sense here, too -- To view, visit https://gerrit.osmocom.org/3575 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I5ada9f85af2098f9acc8a277b9026eed226b9ac2 Gerrit-PatchSet: 3 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: daniel Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Thu Aug 24 19:02:44 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 24 Aug 2017 19:02:44 +0000 Subject: libosmocore[master]: Relax branch restriction while making release In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3597 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ie89b79a45033bee422e4ff898069ea6ac2c2f524 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Aug 24 19:02:46 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 24 Aug 2017 19:02:46 +0000 Subject: [MERGED] libosmocore[master]: Relax branch restriction while making release In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Relax branch restriction while making release ...................................................................... Relax branch restriction while making release Previously making release of non-library project from non-master branch would fail. Relax this check to facilitate submission to gerrit via topic branches. Change-Id: Ie89b79a45033bee422e4ff898069ea6ac2c2f524 Related: OS#1861 --- M osmo-release.mk 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/osmo-release.mk b/osmo-release.mk index 4407c86..3fe6803 100644 --- a/osmo-release.mk +++ b/osmo-release.mk @@ -10,7 +10,7 @@ endif @echo "Releasing" $(VERSION) "->" $(NEW_VERSION)"..." ifeq ($(LIBVERS),) - @gbp dch --debian-tag='%(version)s' --auto --meta --git-author --multimaint-merge + @gbp dch --debian-tag='%(version)s' --auto --meta --git-author --multimaint-merge --ignore-branch else @echo "You should NOT be doing this unless you've read and understood following article:" @echo "https://www.gnu.org/software/libtool/manual/html_node/Updating-version-info.html#Updating-version-info" -- To view, visit https://gerrit.osmocom.org/3597 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ie89b79a45033bee422e4ff898069ea6ac2c2f524 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Thu Aug 24 19:03:34 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 24 Aug 2017 19:03:34 +0000 Subject: =?UTF-8?Q?osmo-bts=5Bmaster=5D=3A_Bump_version=3A_0=2E5=2E0_=E2=86=92_0=2E6=2E0?= In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 (1 comment) https://gerrit.osmocom.org/#/c/3598/1/debian/changelog File debian/changelog: Line 4: * New upstream version I think this should be more verbose, suhc as the addition of osmo-bts-virtual or other major changes since April 2016? -- To view, visit https://gerrit.osmocom.org/3598 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I613d09ae0f9f0aa67be1dc6015da1fb9314110fd Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Thu Aug 24 19:03:54 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 24 Aug 2017 19:03:54 +0000 Subject: osmo-pcu[master]: Facilitate future releases In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3599 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ie0a7f5977550bd0a1ba8b03bdb7e2d619a398e4e Gerrit-PatchSet: 1 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Aug 24 19:03:57 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 24 Aug 2017 19:03:57 +0000 Subject: [MERGED] osmo-pcu[master]: Facilitate future releases In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Facilitate future releases ...................................................................... Facilitate future releases * use release helper from libosmocore * use semantic versioning Change-Id: Ie0a7f5977550bd0a1ba8b03bdb7e2d619a398e4e Related: OS#1861 --- M Makefile.am M configure.ac M debian/changelog 3 files changed, 7 insertions(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/Makefile.am b/Makefile.am index 2ac1cd9..7a4e6c0 100644 --- a/Makefile.am +++ b/Makefile.am @@ -3,5 +3,7 @@ SUBDIRS = include src examples tests EXTRA_DIST = osmoappdesc.py README.md + at RELMAKE@ + pkgconfigdir = $(libdir)/pkgconfig pkgconfig_DATA = osmo-pcu.pc diff --git a/configure.ac b/configure.ac index 3b13469..0a3557d 100644 --- a/configure.ac +++ b/configure.ac @@ -12,6 +12,10 @@ 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]) + dnl checks for programs AC_PROG_MAKE_SET AC_PROG_CC diff --git a/debian/changelog b/debian/changelog index 7b7b4ad..6a534b4 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,4 @@ -osmo-pcu (0.3) UNRELEASED; urgency=medium +osmo-pcu (0.3.0) UNRELEASED; urgency=medium * Initial release. -- To view, visit https://gerrit.osmocom.org/3599 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ie0a7f5977550bd0a1ba8b03bdb7e2d619a398e4e Gerrit-PatchSet: 1 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Thu Aug 24 19:04:43 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 24 Aug 2017 19:04:43 +0000 Subject: osmo-pcu[master]: Use value string check from osmo-ci In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3600 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ib9c595ef80cb6b0d126d4da8244f6435e0526095 Gerrit-PatchSet: 1 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Aug 24 19:04:44 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 24 Aug 2017 19:04:44 +0000 Subject: [MERGED] osmo-pcu[master]: Use value string check from osmo-ci In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Use value string check from osmo-ci ...................................................................... Use value string check from osmo-ci Change-Id: Ib9c595ef80cb6b0d126d4da8244f6435e0526095 --- M contrib/jenkins.sh 1 file changed, 2 insertions(+), 2 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/contrib/jenkins.sh b/contrib/jenkins.sh index 75f28f3..b815ddd 100755 --- a/contrib/jenkins.sh +++ b/contrib/jenkins.sh @@ -58,10 +58,10 @@ exit 1 fi +verify_value_string_arrays_are_terminated.py $(find . -name "*.[hc]") + # Build deps osmo-build-dep.sh libosmocore - -"$deps"/libosmocore/contrib/verify_value_string_arrays_are_terminated.py $(find . -name "*.[hc]") export PKG_CONFIG_PATH="$inst/lib/pkgconfig:$PKG_CONFIG_PATH" export LD_LIBRARY_PATH="$inst/lib" -- To view, visit https://gerrit.osmocom.org/3600 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ib9c595ef80cb6b0d126d4da8244f6435e0526095 Gerrit-PatchSet: 2 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Thu Aug 24 19:05:50 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 24 Aug 2017 19:05:50 +0000 Subject: osmo-bts[master]: OML: use fom_hdr while handling attr. request In-Reply-To: References: Message-ID: Patch Set 4: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3090 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I8b5a5ab8bd07daf2500b66dec428b89b7f8cd852 Gerrit-PatchSet: 4 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Aug 24 19:05:51 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 24 Aug 2017 19:05:51 +0000 Subject: [MERGED] osmo-bts[master]: OML: use fom_hdr while handling attr. request In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: OML: use fom_hdr while handling attr. request ...................................................................... OML: use fom_hdr while handling attr. request Use Obj. Class and TRX# from abis_om_fom_hdr of incoming request instead of BTS' MO to properly distinguish between BTS-level and TRX-level attributes. Change-Id: I8b5a5ab8bd07daf2500b66dec428b89b7f8cd852 Related: OS#2317 --- M src/common/oml.c 1 file changed, 9 insertions(+), 7 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/common/oml.c b/src/common/oml.c index 8f23f82..20f45e5 100644 --- a/src/common/oml.c +++ b/src/common/oml.c @@ -257,27 +257,29 @@ } /* send 3GPP TS 52.021 ?8.11.2 Get Attribute Response */ -static int oml_tx_attr_resp(const struct gsm_bts *bts, struct gsm_abis_mo *mo, const uint8_t *attr, uint16_t attr_len) +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(); 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", gsm_abis_mo_name(mo)); + LOGP(DOML, LOGL_INFO, "%s Tx Get Attribute Response\n", + get_value_string(abis_nm_obj_class_names, foh->obj_class)); if (!nmsg) return -ENOMEM; - switch (mo->obj_class) { + switch (foh->obj_class) { case NM_OC_BTS: len = handle_attrs_bts(resp, bts, attr, attr_len); break; case NM_OC_BASEB_TRANSC: - len = handle_attrs_trx(resp, gsm_bts_trx_num(bts, mo->obj_inst.trx_nr), attr, attr_len); + len = handle_attrs_trx(resp, gsm_bts_trx_num(bts, foh->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)); + get_value_string(abis_nm_obj_class_names, foh->obj_class)); len = -EINVAL; } @@ -290,7 +292,7 @@ /* ?9.4.64 Get Attribute Response Info */ msgb_tl16v_put(nmsg, NM_ATT_GET_ARI, len, resp); - return oml_mo_send_msg(mo, nmsg, NM_MT_GET_ATTR_RESP); + return oml_mo_send_msg(&bts->mo, nmsg, NM_MT_GET_ATTR_RESP); } /* 8.8.1 sending State Changed Event Report */ @@ -540,7 +542,7 @@ return oml_fom_ack_nack(msg, NM_NACK_INCORR_STRUCT); } - rc = oml_tx_attr_resp(bts, &bts->mo, TLVP_VAL(&tp, NM_ATT_LIST_REQ_ATTR), TLVP_LEN(&tp, NM_ATT_LIST_REQ_ATTR)); + rc = oml_tx_attr_resp(bts, foh, TLVP_VAL(&tp, NM_ATT_LIST_REQ_ATTR), TLVP_LEN(&tp, NM_ATT_LIST_REQ_ATTR)); if (rc < 0) { LOGP(DOML, LOGL_ERROR, "Failed to respond to O&M Get Attributes message: %s\n", strerror(-rc)); switch (-rc) { -- To view, visit https://gerrit.osmocom.org/3090 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I8b5a5ab8bd07daf2500b66dec428b89b7f8cd852 Gerrit-PatchSet: 4 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max From gerrit-no-reply at lists.osmocom.org Thu Aug 24 19:06:05 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 24 Aug 2017 19:06:05 +0000 Subject: osmo-bts[master]: osmo-bts-trx: fix 'osmotrx legacy-setbsic' In-Reply-To: References: Message-ID: Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3602 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Id42359dfbb8ad02f34dd2540db66f3ed69ad5181 Gerrit-PatchSet: 3 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Aug 24 19:06:47 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 24 Aug 2017 19:06:47 +0000 Subject: osmo-bts[master]: osmo-bts-trx: remove global variables from loops In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3601 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I01d7c1abad67e51b886a4ecf2de072929d67da27 Gerrit-PatchSet: 2 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Alexander Chemeris Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Aug 24 19:06:48 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 24 Aug 2017 19:06:48 +0000 Subject: [MERGED] osmo-bts[master]: osmo-bts-trx: remove global variables from loops In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: osmo-bts-trx: remove global variables from loops ...................................................................... osmo-bts-trx: remove global variables from loops * move TA related globals into phy_link * move power loop related globals into phy_link * prefix corresponding vty vars with osmotrx Change-Id: I01d7c1abad67e51b886a4ecf2de072929d67da27 Related: OS#1848 --- M include/osmo-bts/phy_link.h M src/osmo-bts-trx/loops.c M src/osmo-bts-trx/loops.h M src/osmo-bts-trx/main.c M src/osmo-bts-trx/trx_vty.c 5 files changed, 47 insertions(+), 42 deletions(-) Approvals: Alexander Chemeris: Looks good to me, but someone else must approve Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/include/osmo-bts/phy_link.h b/include/osmo-bts/phy_link.h index 7011622..0ffc58e 100644 --- a/include/osmo-bts/phy_link.h +++ b/include/osmo-bts/phy_link.h @@ -44,7 +44,9 @@ uint16_t base_port_local; uint16_t base_port_remote; struct osmo_fd trx_ofd_clk; - + bool trx_ta_loop; + bool trx_ms_power_loop; + int8_t trx_target_rssi; uint32_t clock_advance; uint32_t rts_advance; bool use_legacy_setbsic; diff --git a/src/osmo-bts-trx/loops.c b/src/osmo-bts-trx/loops.c index 3da805c..6f87cd1 100644 --- a/src/osmo-bts-trx/loops.c +++ b/src/osmo-bts-trx/loops.c @@ -39,9 +39,6 @@ * MS Power loop */ -int trx_ms_power_loop = 0; -int8_t trx_target_rssi = -10; - static int ms_power_diff(struct gsm_lchan *lchan, uint8_t chan_nr, int8_t diff) { struct gsm_bts_trx *trx = lchan->ts->trx; @@ -118,6 +115,7 @@ uint8_t chan_nr, struct l1sched_chan_state *chan_state) { struct gsm_bts_trx *trx = lchan->ts->trx; + struct phy_instance *pinst = trx_phy_instance(trx); int rssi; int i; @@ -159,10 +157,10 @@ /* change RSSI */ LOGP(DLOOP, LOGL_DEBUG, "Lowest RSSI: %d Target RSSI: %d Current " "MS power: %d (%d dBm) of trx=%u chan_nr=0x%02x\n", rssi, - trx_target_rssi, lchan->ms_power_ctrl.current, + pinst->phy_link->u.osmotrx.trx_target_rssi, lchan->ms_power_ctrl.current, MS_PWR_DBM(trx->arfcn, lchan->ms_power_ctrl.current), trx->nr, chan_nr); - ms_power_diff(lchan, chan_nr, trx_target_rssi - rssi); + ms_power_diff(lchan, chan_nr, pinst->phy_link->u.osmotrx.trx_target_rssi - rssi); return 0; } @@ -171,8 +169,6 @@ /* * Timing Advance loop */ - -int trx_ta_loop = 1; int ta_val(struct gsm_lchan *lchan, uint8_t chan_nr, struct l1sched_chan_state *chan_state, float toa) @@ -220,11 +216,12 @@ { struct gsm_lchan *lchan = &l1t->trx->ts[L1SAP_CHAN2TS(chan_nr)] .lchan[l1sap_chan2ss(chan_nr)]; + struct phy_instance *pinst = trx_phy_instance(l1t->trx); - if (trx_ms_power_loop) + if (pinst->phy_link->u.osmotrx.trx_ms_power_loop) ms_power_val(chan_state, rssi); - if (trx_ta_loop) + if (pinst->phy_link->u.osmotrx.trx_ta_loop) ta_val(lchan, chan_nr, chan_state, toa); return 0; @@ -235,8 +232,9 @@ { struct gsm_lchan *lchan = &l1t->trx->ts[L1SAP_CHAN2TS(chan_nr)] .lchan[l1sap_chan2ss(chan_nr)]; + struct phy_instance *pinst = trx_phy_instance(l1t->trx); - if (trx_ms_power_loop) + if (pinst->phy_link->u.osmotrx.trx_ms_power_loop) ms_power_clock(lchan, chan_nr, chan_state); /* count the number of SACCH clocks */ diff --git a/src/osmo-bts-trx/loops.h b/src/osmo-bts-trx/loops.h index c0458c5..230cd4f 100644 --- a/src/osmo-bts-trx/loops.h +++ b/src/osmo-bts-trx/loops.h @@ -13,10 +13,6 @@ * loops api */ -extern int trx_ms_power_loop; -extern int8_t trx_target_rssi; -extern int trx_ta_loop; - int trx_loop_sacch_input(struct l1sched_trx *l1t, uint8_t chan_nr, struct l1sched_chan_state *chan_state, int8_t rssi, float toa); diff --git a/src/osmo-bts-trx/main.c b/src/osmo-bts-trx/main.c index 283e549..a1eb686 100644 --- a/src/osmo-bts-trx/main.c +++ b/src/osmo-bts-trx/main.c @@ -122,6 +122,9 @@ plink->u.osmotrx.base_port_remote = 5700; plink->u.osmotrx.clock_advance = 20; plink->u.osmotrx.rts_advance = 5; + plink->u.osmotrx.trx_ta_loop = true; + plink->u.osmotrx.trx_ms_power_loop = false; + plink->u.osmotrx.trx_target_rssi = -10; } void bts_model_phy_instance_set_defaults(struct phy_instance *pinst) diff --git a/src/osmo-bts-trx/trx_vty.c b/src/osmo-bts-trx/trx_vty.c index 36d75c1..a7a433b 100644 --- a/src/osmo-bts-trx/trx_vty.c +++ b/src/osmo-bts-trx/trx_vty.c @@ -160,39 +160,47 @@ return CMD_SUCCESS; } -DEFUN(cfg_bts_ms_power_loop, cfg_bts_ms_power_loop_cmd, - "ms-power-loop <-127-127>", +DEFUN(cfg_phy_ms_power_loop, cfg_phy_ms_power_loop_cmd, + "osmotrx ms-power-loop <-127-127>", OSMOTRX_STR "Enable MS power control loop\nTarget RSSI value (transceiver specific, " "should be 6dB or more above noise floor)\n") { - trx_ms_power_loop = 1; - trx_target_rssi = atoi(argv[0]); + struct phy_link *plink = vty->index; + + plink->u.osmotrx.trx_target_rssi = atoi(argv[0]); + plink->u.osmotrx.trx_ms_power_loop = true; return CMD_SUCCESS; } -DEFUN(cfg_bts_no_ms_power_loop, cfg_bts_no_ms_power_loop_cmd, - "no ms-power-loop", - NO_STR "Disable MS power control loop\n") +DEFUN(cfg_phy_no_ms_power_loop, cfg_phy_no_ms_power_loop_cmd, + "no osmotrx ms-power-loop", + NO_STR OSMOTRX_STR "Disable MS power control loop\n") { - trx_ms_power_loop = 0; + struct phy_link *plink = vty->index; + + plink->u.osmotrx.trx_ms_power_loop = false; return CMD_SUCCESS; } -DEFUN(cfg_bts_timing_advance_loop, cfg_bts_timing_advance_loop_cmd, - "timing-advance-loop", +DEFUN(cfg_phy_timing_advance_loop, cfg_phy_timing_advance_loop_cmd, + "osmotrx timing-advance-loop", OSMOTRX_STR "Enable timing advance control loop\n") { - trx_ta_loop = 1; + struct phy_link *plink = vty->index; + + plink->u.osmotrx.trx_ta_loop = true; return CMD_SUCCESS; } -DEFUN(cfg_bts_no_timing_advance_loop, cfg_bts_no_timing_advance_loop_cmd, - "no timing-advance-loop", - NO_STR "Disable timing advance control loop\n") +DEFUN(cfg_phy_no_timing_advance_loop, cfg_phy_no_timing_advance_loop_cmd, + "no osmotrx timing-advance-loop", + NO_STR OSMOTRX_STR "Disable timing advance control loop\n") { - trx_ta_loop = 0; + struct phy_link *plink = vty->index; + + plink->u.osmotrx.trx_ta_loop = false; return CMD_SUCCESS; } @@ -490,6 +498,12 @@ vty_out(vty, " osmotrx ip remote %s%s", plink->u.osmotrx.remote_ip, VTY_NEWLINE); + if (plink->u.osmotrx.trx_ms_power_loop) + vty_out(vty, " osmotrx ms-power-loop %d%s", plink->u.osmotrx.trx_target_rssi, VTY_NEWLINE); + else + vty_out(vty, " no osmotrx ms-power-loop%s", VTY_NEWLINE); + vty_out(vty, " %s osmotrx timing-advance-loop%s", (plink->u.osmotrx.trx_ta_loop) ? "" : "no", VTY_NEWLINE); + if (plink->u.osmotrx.base_port_local) vty_out(vty, " osmotrx base-port local %"PRIu16"%s", plink->u.osmotrx.base_port_local, VTY_NEWLINE); @@ -539,13 +553,6 @@ void bts_model_config_write_bts(struct vty *vty, struct gsm_bts *bts) { - if (trx_ms_power_loop) - vty_out(vty, " ms-power-loop %d%s", trx_target_rssi, - VTY_NEWLINE); - else - vty_out(vty, " no ms-power-loop%s", VTY_NEWLINE); - vty_out(vty, " %stiming-advance-loop%s", (trx_ta_loop) ? "":"no ", - VTY_NEWLINE); } void bts_model_config_write_trx(struct vty *vty, struct gsm_bts_trx *trx) @@ -559,11 +566,10 @@ install_element_ve(&show_transceiver_cmd); install_element_ve(&show_phy_cmd); - install_element(BTS_NODE, &cfg_bts_ms_power_loop_cmd); - install_element(BTS_NODE, &cfg_bts_no_ms_power_loop_cmd); - install_element(BTS_NODE, &cfg_bts_timing_advance_loop_cmd); - install_element(BTS_NODE, &cfg_bts_no_timing_advance_loop_cmd); - + install_element(PHY_NODE, &cfg_phy_ms_power_loop_cmd); + install_element(PHY_NODE, &cfg_phy_no_ms_power_loop_cmd); + install_element(PHY_NODE, &cfg_phy_timing_advance_loop_cmd); + install_element(PHY_NODE, &cfg_phy_no_timing_advance_loop_cmd); install_element(PHY_NODE, &cfg_phy_base_port_cmd); install_element(PHY_NODE, &cfg_phy_fn_advance_cmd); install_element(PHY_NODE, &cfg_phy_rts_advance_cmd); -- To view, visit https://gerrit.osmocom.org/3601 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I01d7c1abad67e51b886a4ecf2de072929d67da27 Gerrit-PatchSet: 3 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Alexander Chemeris Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max From gerrit-no-reply at lists.osmocom.org Thu Aug 24 19:06:49 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 24 Aug 2017 19:06:49 +0000 Subject: [MERGED] osmo-bts[master]: osmo-bts-trx: fix 'osmotrx legacy-setbsic' In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: osmo-bts-trx: fix 'osmotrx legacy-setbsic' ...................................................................... osmo-bts-trx: fix 'osmotrx legacy-setbsic' It was introduced in fe6c75d24a1751341bcee91cb45c7ac7f5d07da3: * fix typo in config write * add missing vty help string Change-Id: Id42359dfbb8ad02f34dd2540db66f3ed69ad5181 --- M src/osmo-bts-trx/trx_vty.c 1 file changed, 3 insertions(+), 3 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/osmo-bts-trx/trx_vty.c b/src/osmo-bts-trx/trx_vty.c index 482248c..36d75c1 100644 --- a/src/osmo-bts-trx/trx_vty.c +++ b/src/osmo-bts-trx/trx_vty.c @@ -458,7 +458,7 @@ } DEFUN(cfg_phy_setbsic, cfg_phy_setbsic_cmd, - "osmotrx legacy-setbsic", + "osmotrx legacy-setbsic", OSMOTRX_STR "Use SETBSIC to configure transceiver (use ONLY with OpenBTS Transceiver!)\n") { struct phy_link *plink = vty->index; @@ -473,7 +473,7 @@ DEFUN(cfg_phy_no_setbsic, cfg_phy_no_setbsic_cmd, "no osmotrx legacy-setbsic", - NO_STR "Disable Legacy SETBSIC to configure transceiver\n") + NO_STR OSMOTRX_STR "Disable Legacy SETBSIC to configure transceiver\n") { struct phy_link *plink = vty->index; plink->u.osmotrx.use_legacy_setbsic = false; @@ -503,7 +503,7 @@ plink->u.osmotrx.rts_advance, VTY_NEWLINE); if (plink->u.osmotrx.use_legacy_setbsic) - vty_out(vty, " osmotrx leyacy-setbsic%s", VTY_NEWLINE); + vty_out(vty, " osmotrx legacy-setbsic%s", VTY_NEWLINE); } void bts_model_config_write_phy_inst(struct vty *vty, struct phy_instance *pinst) -- To view, visit https://gerrit.osmocom.org/3602 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Id42359dfbb8ad02f34dd2540db66f3ed69ad5181 Gerrit-PatchSet: 4 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Thu Aug 24 19:07:25 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 24 Aug 2017 19:07:25 +0000 Subject: libosmo-sccp[master]: sccp: again fix handling of default IP addresses in osmo_scc... In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3603 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ic8563ab272d5256a1b8ceefd5fee37da61e1bd26 Gerrit-PatchSet: 1 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: dexter Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Aug 24 19:07:27 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 24 Aug 2017 19:07:27 +0000 Subject: [MERGED] libosmo-sccp[master]: sccp: again fix handling of default IP addresses in osmo_scc... In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: sccp: again fix handling of default IP addresses in osmo_sccp_simple_client() ...................................................................... sccp: again fix handling of default IP addresses in osmo_sccp_simple_client() The previous fix (I312caf9d54cedb02034e4ef88fdd2e6ad9ca1c34) caused the default addresses to be discarded. Actually talloc_strdup() the default addresses to use them if not NULL. Change-Id: Ic8563ab272d5256a1b8ceefd5fee37da61e1bd26 --- M src/sccp_user.c 1 file changed, 2 insertions(+), 4 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/sccp_user.c b/src/sccp_user.c index b0a807d..06a7174 100644 --- a/src/sccp_user.c +++ b/src/sccp_user.c @@ -426,10 +426,8 @@ goto out_rt; asp_created = true; - asp->cfg.local.host = - default_local_ip ? asp->cfg.local.host : NULL; - asp->cfg.remote.host = - default_remote_ip ? asp->cfg.remote.host : NULL; + asp->cfg.local.host = default_local_ip ? talloc_strdup(asp, default_local_ip) : NULL; + asp->cfg.remote.host = default_remote_ip ? talloc_strdup(asp, default_remote_ip) : NULL; osmo_ss7_as_add_asp(as, asp->cfg.name); } -- To view, visit https://gerrit.osmocom.org/3603 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ic8563ab272d5256a1b8ceefd5fee37da61e1bd26 Gerrit-PatchSet: 2 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: dexter From gerrit-no-reply at lists.osmocom.org Thu Aug 24 19:20:51 2017 From: gerrit-no-reply at lists.osmocom.org (Alexander Chemeris) Date: Thu, 24 Aug 2017 19:20:51 +0000 Subject: osmo-msc[master]: libmsc: Fix VTY output for handover counters. In-Reply-To: References: Message-ID: Patch Set 1: I've received a ping about this patch, but I don't think I need to do anything here. Please let me know if you need anything -- To view, visit https://gerrit.osmocom.org/3614 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I9512330f2e91d2f526751c5228e6e8e0fe17d579 Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Alexander Chemeris Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Aug 25 09:19:51 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Fri, 25 Aug 2017 09:19:51 +0000 Subject: [PATCH] osmo-bts[master]: osmo-bts-trx: Relax validation to allow TRX data bursts with... 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/3580 to look at the new patch set (#2). osmo-bts-trx: Relax validation to allow TRX data bursts without padding Original OpenBTS transcievers add 2 bytes of padding to the end of data bursts, having in total 158 bytes. As those two extra bytes are being ignored after the initial validation, let's relax this validation a bit in order to accept transcievers that decide no to send these two extra bytes. Change-Id: I94c3cb160bfed0ba9c41ed7ef5f8d8a65b81ad07 --- M src/osmo-bts-trx/trx_if.c 1 file changed, 2 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/80/3580/2 diff --git a/src/osmo-bts-trx/trx_if.c b/src/osmo-bts-trx/trx_if.c index 86a3b9b..a41cf2c 100644 --- a/src/osmo-bts-trx/trx_if.c +++ b/src/osmo-bts-trx/trx_if.c @@ -443,7 +443,8 @@ return len; } else if (len == EGPRS_BURST_LEN + 10) { burst_len = EGPRS_BURST_LEN; - } else if (len != GSM_BURST_LEN + 10) { + /* Accept bursts ending with 2 bytes of padding (OpenBTS compatible trx) or without them: */ + } else if (len != GSM_BURST_LEN + 10 && len != GSM_BURST_LEN + 8) { LOGP(DTRX, LOGL_NOTICE, "Got data message with invalid lenght " "'%d'\n", len); return -EINVAL; -- To view, visit https://gerrit.osmocom.org/3580 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I94c3cb160bfed0ba9c41ed7ef5f8d8a65b81ad07 Gerrit-PatchSet: 2 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Fri Aug 25 09:40:01 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 25 Aug 2017 09:40:01 +0000 Subject: osmo-bts[master]: osmo-bts-trx: Relax validation to allow TRX data bursts with... In-Reply-To: References: Message-ID: Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3580 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I94c3cb160bfed0ba9c41ed7ef5f8d8a65b81ad07 Gerrit-PatchSet: 3 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Aug 25 09:40:03 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 25 Aug 2017 09:40:03 +0000 Subject: [MERGED] osmo-bts[master]: osmo-bts-trx: Relax validation to allow TRX data bursts with... In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: osmo-bts-trx: Relax validation to allow TRX data bursts without padding ...................................................................... osmo-bts-trx: Relax validation to allow TRX data bursts without padding Original OpenBTS transcievers add 2 bytes of padding to the end of data bursts, having in total 158 bytes. As those two extra bytes are being ignored after the initial validation, let's relax this validation a bit in order to accept transcievers that decide no to send these two extra bytes. Change-Id: I94c3cb160bfed0ba9c41ed7ef5f8d8a65b81ad07 --- M src/osmo-bts-trx/trx_if.c 1 file changed, 2 insertions(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/osmo-bts-trx/trx_if.c b/src/osmo-bts-trx/trx_if.c index 86a3b9b..a41cf2c 100644 --- a/src/osmo-bts-trx/trx_if.c +++ b/src/osmo-bts-trx/trx_if.c @@ -443,7 +443,8 @@ return len; } else if (len == EGPRS_BURST_LEN + 10) { burst_len = EGPRS_BURST_LEN; - } else if (len != GSM_BURST_LEN + 10) { + /* Accept bursts ending with 2 bytes of padding (OpenBTS compatible trx) or without them: */ + } else if (len != GSM_BURST_LEN + 10 && len != GSM_BURST_LEN + 8) { LOGP(DTRX, LOGL_NOTICE, "Got data message with invalid lenght " "'%d'\n", len); return -EINVAL; -- To view, visit https://gerrit.osmocom.org/3580 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I94c3cb160bfed0ba9c41ed7ef5f8d8a65b81ad07 Gerrit-PatchSet: 3 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Fri Aug 25 10:24:05 2017 From: gerrit-no-reply at lists.osmocom.org (Holger Freyther) Date: Fri, 25 Aug 2017 10:24:05 +0000 Subject: [PATCH] osmo-ci[master]: jenkins: Copy Dockerfile and script from buildhost Message-ID: Review at https://gerrit.osmocom.org/3675 jenkins: Copy Dockerfile and script from buildhost We are not using the Docker registry due difficult GPL compliance but build the image on the build node itself. After prototyping if containers can be used for building these files remained forked on the node. These days it seems to be easier to complain than to say thank you that this new approach has its merits. Copy the files from the build slave to the directory they should have been in. Change-Id: Icb0406f96b0c18e77be51ad8317c2668fb23a45e --- A docker/Dockerfile_osmocom_jenkins.amd64 A docker/rebuild_osmocom_jenkins_image.sh 2 files changed, 71 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ci refs/changes/75/3675/1 diff --git a/docker/Dockerfile_osmocom_jenkins.amd64 b/docker/Dockerfile_osmocom_jenkins.amd64 new file mode 100644 index 0000000..8f33233 --- /dev/null +++ b/docker/Dockerfile_osmocom_jenkins.amd64 @@ -0,0 +1,69 @@ +FROM debian:jessie + +RUN dpkg --add-architecture i386 && \ + DEBIAN_FRONTEND=noninteractive apt-get update && \ + DEBIAN_FRONTEND=noninteractive apt-get upgrade -y && \ + DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends wget make + +RUN DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends gcc g++ make git +RUN DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends sudo +RUN DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends unzip bzip2 python + +# match the outside user +RUN useradd --uid=1000 build +#RUN echo "build ALL=(ALL) NOPASSWD:ALL" > /etc/sudoers.d/build + +RUN mkdir /build +RUN chown build:build /build + +# still generic +RUN DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends doxygen git asciidoc rsync coccinelle + +# for GNU smalltalk +RUN DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends flex bison libsigsegv-dev libffi-dev texinfo + +# libosmo-sccp/abis/etc +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 + +# building +RUN DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends libtool pkg-config automake autoconf + +# Linux kernel +RUN DEBIAN_FRONTEND=noninteractive apt-get install -y bc + +# and all +RUN DEBIAN_FRONTEND=noninteractive apt-get install -y doxygen g++ libtalloc-dev libpcsclite-dev make gcc pkgconf libtool autoconf autoconf-archive automake libortp-dev asciidoc mscgen git libsctp-dev libpcap-dev osc libc-ares-dev libgps-dev libsofia-sip-ua-glib-dev libssl-dev libsqlite3-dev libusb-dev libffi-dev libfftw3-dev flex bison libdbi-dev libsnmp-dev libncurses5-dev libgsm1-dev python-minimal python3 libdbd-sqlite3 cppcheck htop libgmp-dev gawk texinfo flex bison bc libsigsegv-dev libffi-dev libusb-1.0-0-dev libreadline-dev debhelper devscripts gcc-arm-none-eabi git-buildpackage dh-systemd dh-autoreconf bc openssh-client + +RUN git clone git://git.osmocom.org/python/osmo-python-tests && cd osmo-python-tests && python2 ./setup.py install # 2017-03-06 + + +RUN echo "#!/bin/sh \n\ + \n\ +if ! test -d \$1; \n\ +then \n\ + git clone git://git.osmocom.org/\$1 \$1 \n\ +fi \n\ +\n\ +cd \$1 \n\ +git fetch origin \n\ +git reset --hard origin/master" > /usr/local/bin/osmo-deps.sh +RUN chmod +x /usr/local/bin/osmo-deps.sh + + +RUN git clone http://git.savannah.gnu.org/r/smalltalk.git +RUN DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends flex libsigsegv-dev bison libgmp-dev texinfo zip libltdl-dev +RUN cd smalltalk && autoreconf --install --force && ./configure && make install +RUN rm -rf smalltalk +RUN git clone https://github.com/zecke/petitparser.git && cd petitparser && gst-package package.xml +RUN git clone https://github.com/zecke/petitparser-tests.git && cd petitparser-tests && gst-package package.xml +RUN git clone git://git.osmocom.org/smalltalk/osmo-st-logging && cd osmo-st-logging && gst-package package.xml +RUN git clone git://git.osmocom.org/smalltalk/osmo-st-core && cd osmo-st-core && gst-package package.xml +RUN git clone git://git.osmocom.org/smalltalk/osmo-st-network && cd osmo-st-network && gst-package package.xml +RUN git clone git://git.osmocom.org/smalltalk/osmo-st-gsm && cd osmo-st-gsm && gst-package --test package.xml +RUN git clone git://git.osmocom.org/smalltalk/osmo-st-openbsc-test && cd osmo-st-openbsc-test/fakebts && gst-package --test package.xml +RUN rm -rf petitparser petitparser-tests osmo-st-logging ost-st-core osmo-st-network osmo-st-gsm osmo-st-openbsc-test +RUN DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends python-pip +RUN pip install timeout_decorator diff --git a/docker/rebuild_osmocom_jenkins_image.sh b/docker/rebuild_osmocom_jenkins_image.sh new file mode 100755 index 0000000..4b2d359 --- /dev/null +++ b/docker/rebuild_osmocom_jenkins_image.sh @@ -0,0 +1,2 @@ +#!/bin/sh +docker build -t osmocom:amd64 - < Dockerfile_osmocom_jenkins.amd64 -- To view, visit https://gerrit.osmocom.org/3675 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Icb0406f96b0c18e77be51ad8317c2668fb23a45e Gerrit-PatchSet: 1 Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Owner: Holger Freyther From gerrit-no-reply at lists.osmocom.org Fri Aug 25 10:33:20 2017 From: gerrit-no-reply at lists.osmocom.org (Holger Freyther) Date: Fri, 25 Aug 2017 10:33:20 +0000 Subject: [PATCH] osmo-ci[master]: jenkins: Follow the convention and create a jenkins.sh as well Message-ID: Review at https://gerrit.osmocom.org/3676 jenkins: Follow the convention and create a jenkins.sh as well Instead of modifying the job on Jenkins, let's do it like in our other projects. Create the diretcory if it doesn't exist and use git pull origin for the Debian9 system. Change-Id: I0ecdc02e3271fe09980f370167277370c599fcfa --- A contrib/jenkins.sh 1 file changed, 10 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ci refs/changes/76/3676/1 diff --git a/contrib/jenkins.sh b/contrib/jenkins.sh new file mode 100755 index 0000000..88f509e --- /dev/null +++ b/contrib/jenkins.sh @@ -0,0 +1,10 @@ +#!/bin/sh + +cd ~/osmo-ci || (cd ~/ && git clone git://git.osmocom.org/osmo-ci) +git rev-parse HEAD +git status + +git pull origin + +git rev-parse HEAD +git status -- To view, visit https://gerrit.osmocom.org/3676 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I0ecdc02e3271fe09980f370167277370c599fcfa Gerrit-PatchSet: 1 Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Owner: Holger Freyther From gerrit-no-reply at lists.osmocom.org Fri Aug 25 11:03:20 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Fri, 25 Aug 2017 11:03:20 +0000 Subject: [PATCH] osmo-gsm-tester[master]: modem: Attempt fixing crash from Register() dbus method Message-ID: Review at https://gerrit.osmocom.org/3677 modem: Attempt fixing crash from Register() dbus method Register() method returned today this error which is expected acording to ofono documentation API. In this case it probably happens because the modem internally starts registering at some point between the time Scan() is finished and we call Register(). In this case it is fine for us and we should just ignore the error. A helper method is added to check for this as so far it seems tricky to check error information coming from pydbus. I could not reproduce this issue locally so I could not test that the helper function is going to handle it correctly when it is triggered. That's why I added extra debug information to be able to fix it next time it is triggered. File "/home/jenkins/workspace/osmo-gsm-tester_run/osmo-gsm-tester/src/osmo_gsm_tester/ofono_client.py", line 489, in scan_cb_register dbus_op.Register() File "/usr/local/lib/python3.4/dist-packages/pydbus/proxy_method.py", line 75, in __call__ 0, timeout_to_glib(timeout), None).unpack() GLib.Error: g-io-error-quark: GDBus.Error:org.ofono.Error.InProgress: Operation already in progress (36) Change-Id: I58dda09416ee7328812431220fd3d239c5c2980a --- M src/osmo_gsm_tester/ofono_client.py 1 file changed, 13 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-tester refs/changes/77/3677/1 diff --git a/src/osmo_gsm_tester/ofono_client.py b/src/osmo_gsm_tester/ofono_client.py index ed7e3e4..3768719 100644 --- a/src/osmo_gsm_tester/ofono_client.py +++ b/src/osmo_gsm_tester/ofono_client.py @@ -139,6 +139,16 @@ 0, timeout, cancellable, _async_result_handler, user_data) +def dbus_call_dismiss_error(log, err_str, method): + try: + log.log("calling method") + method() + except Exception as e: + if isinstance(e, GLib.Error) and err_str in e.domain: + log.log('Dismissed Dbus method error: %r' % e) + return + raise log.logError('dbus_call_dismiss_error raised error %r' % e) + class ModemDbusInteraction(log.Origin): '''Work around inconveniences specific to pydbus and ofono. ofono adds and removes DBus interfaces and notifies about them. @@ -463,7 +473,8 @@ return self.log('Registering with the default network') netreg = self.dbus.interface(I_NETREG) - netreg.Register() + dbus_call_dismiss_error(self, 'org.ofono.Error.InProgress', netreg.Register) + def scan_cb_register(self, scanned_operators, mcc_mnc): self.dbg('scanned operators: ', scanned_operators); @@ -486,7 +497,7 @@ return dbus_op = systembus_get(matching_op_path) self.log('Registering with operator', matching_op_path, mcc_mnc) - dbus_op.Register() + dbus_call_dismiss_error(self, 'org.ofono.Error.InProgress', dbus_op.Register) def power_cycle(self): 'Power the modem and put it online, power cycle it if it was already on' -- To view, visit https://gerrit.osmocom.org/3677 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I58dda09416ee7328812431220fd3d239c5c2980a Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Fri Aug 25 11:09:03 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Fri, 25 Aug 2017 11:09:03 +0000 Subject: [PATCH] osmo-gsm-tester[master]: modem: Attempt fixing crash from Register() dbus method In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3677 to look at the new patch set (#2). modem: Attempt fixing crash from Register() dbus method Register() method returned today this error which is expected acording to ofono documentation API. In this case it probably happens because the modem internally starts registering at some point between the time Scan() is finished and we call Register(). In this case it is fine for us and we should just ignore the error. A helper method is added to check for this as so far it seems tricky to check error information coming from pydbus. I could not reproduce this issue locally so I could not test that the helper function is going to handle it correctly when it is triggered. That's why I added extra debug information to be able to fix it next time it is triggered. File "/home/jenkins/workspace/osmo-gsm-tester_run/osmo-gsm-tester/src/osmo_gsm_tester/ofono_client.py", line 489, in scan_cb_register dbus_op.Register() File "/usr/local/lib/python3.4/dist-packages/pydbus/proxy_method.py", line 75, in __call__ 0, timeout_to_glib(timeout), None).unpack() GLib.Error: g-io-error-quark: GDBus.Error:org.ofono.Error.InProgress: Operation already in progress (36) Change-Id: I58dda09416ee7328812431220fd3d239c5c2980a --- M src/osmo_gsm_tester/ofono_client.py 1 file changed, 12 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-tester refs/changes/77/3677/2 diff --git a/src/osmo_gsm_tester/ofono_client.py b/src/osmo_gsm_tester/ofono_client.py index ed7e3e4..43aa091 100644 --- a/src/osmo_gsm_tester/ofono_client.py +++ b/src/osmo_gsm_tester/ofono_client.py @@ -139,6 +139,15 @@ 0, timeout, cancellable, _async_result_handler, user_data) +def dbus_call_dismiss_error(log_obj, err_str, method): + try: + method() + except Exception as e: + if isinstance(e, GLib.Error) and err_str in e.domain: + log_obj.log('Dismissed Dbus method error: %r' % e) + return + raise log.Error('dbus_call_dismiss_error raised error %r' % e) + class ModemDbusInteraction(log.Origin): '''Work around inconveniences specific to pydbus and ofono. ofono adds and removes DBus interfaces and notifies about them. @@ -463,7 +472,8 @@ return self.log('Registering with the default network') netreg = self.dbus.interface(I_NETREG) - netreg.Register() + dbus_call_dismiss_error(self, 'org.ofono.Error.InProgress', netreg.Register) + def scan_cb_register(self, scanned_operators, mcc_mnc): self.dbg('scanned operators: ', scanned_operators); @@ -486,7 +496,7 @@ return dbus_op = systembus_get(matching_op_path) self.log('Registering with operator', matching_op_path, mcc_mnc) - dbus_op.Register() + dbus_call_dismiss_error(self, 'org.ofono.Error.InProgress', dbus_op.Register) def power_cycle(self): 'Power the modem and put it online, power cycle it if it was already on' -- To view, visit https://gerrit.osmocom.org/3677 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I58dda09416ee7328812431220fd3d239c5c2980a Gerrit-PatchSet: 2 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Fri Aug 25 12:16:30 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Fri, 25 Aug 2017 12:16:30 +0000 Subject: osmo-gsm-tester[master]: modem: Attempt fixing crash from Register() dbus method In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3677 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I58dda09416ee7328812431220fd3d239c5c2980a Gerrit-PatchSet: 2 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Aug 25 12:16:33 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Fri, 25 Aug 2017 12:16:33 +0000 Subject: [MERGED] osmo-gsm-tester[master]: modem: Attempt fixing crash from Register() dbus method In-Reply-To: References: Message-ID: Pau Espin Pedrol has submitted this change and it was merged. Change subject: modem: Attempt fixing crash from Register() dbus method ...................................................................... modem: Attempt fixing crash from Register() dbus method Register() method returned today this error which is expected acording to ofono documentation API. In this case it probably happens because the modem internally starts registering at some point between the time Scan() is finished and we call Register(). In this case it is fine for us and we should just ignore the error. A helper method is added to check for this as so far it seems tricky to check error information coming from pydbus. I could not reproduce this issue locally so I could not test that the helper function is going to handle it correctly when it is triggered. That's why I added extra debug information to be able to fix it next time it is triggered. File "/home/jenkins/workspace/osmo-gsm-tester_run/osmo-gsm-tester/src/osmo_gsm_tester/ofono_client.py", line 489, in scan_cb_register dbus_op.Register() File "/usr/local/lib/python3.4/dist-packages/pydbus/proxy_method.py", line 75, in __call__ 0, timeout_to_glib(timeout), None).unpack() GLib.Error: g-io-error-quark: GDBus.Error:org.ofono.Error.InProgress: Operation already in progress (36) Change-Id: I58dda09416ee7328812431220fd3d239c5c2980a --- M src/osmo_gsm_tester/ofono_client.py 1 file changed, 12 insertions(+), 2 deletions(-) Approvals: Pau Espin Pedrol: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/osmo_gsm_tester/ofono_client.py b/src/osmo_gsm_tester/ofono_client.py index ed7e3e4..43aa091 100644 --- a/src/osmo_gsm_tester/ofono_client.py +++ b/src/osmo_gsm_tester/ofono_client.py @@ -139,6 +139,15 @@ 0, timeout, cancellable, _async_result_handler, user_data) +def dbus_call_dismiss_error(log_obj, err_str, method): + try: + method() + except Exception as e: + if isinstance(e, GLib.Error) and err_str in e.domain: + log_obj.log('Dismissed Dbus method error: %r' % e) + return + raise log.Error('dbus_call_dismiss_error raised error %r' % e) + class ModemDbusInteraction(log.Origin): '''Work around inconveniences specific to pydbus and ofono. ofono adds and removes DBus interfaces and notifies about them. @@ -463,7 +472,8 @@ return self.log('Registering with the default network') netreg = self.dbus.interface(I_NETREG) - netreg.Register() + dbus_call_dismiss_error(self, 'org.ofono.Error.InProgress', netreg.Register) + def scan_cb_register(self, scanned_operators, mcc_mnc): self.dbg('scanned operators: ', scanned_operators); @@ -486,7 +496,7 @@ return dbus_op = systembus_get(matching_op_path) self.log('Registering with operator', matching_op_path, mcc_mnc) - dbus_op.Register() + dbus_call_dismiss_error(self, 'org.ofono.Error.InProgress', dbus_op.Register) def power_cycle(self): 'Power the modem and put it online, power cycle it if it was already on' -- To view, visit https://gerrit.osmocom.org/3677 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I58dda09416ee7328812431220fd3d239c5c2980a Gerrit-PatchSet: 2 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Fri Aug 25 13:56:02 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Fri, 25 Aug 2017 13:56:02 +0000 Subject: osmo-msc[master]: libmsc: Fix wrong handling of user_message_reference parameter In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/3669 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: If748548a4a223e529a1110c89e483b599b406e8b Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Aug 25 13:56:41 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Fri, 25 Aug 2017 13:56:41 +0000 Subject: osmo-msc[master]: smpp: Fix compilation warning In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/3668 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I0901ddadb5f72e1585cb1797ac22c8ab95e83146 Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Aug 25 14:00:14 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Fri, 25 Aug 2017 14:00:14 +0000 Subject: =?UTF-8?Q?=5BPATCH=5D_osmo-bts=5Bmaster=5D=3A_Bump_version=3A_0=2E5=2E0_=E2=86=92_0=2E6=2E0?= 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/3598 to look at the new patch set (#2). Bump version: 0.5.0 ? 0.6.0 Change-Id: I613d09ae0f9f0aa67be1dc6015da1fb9314110fd --- M debian/changelog 1 file changed, 482 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/98/3598/2 diff --git a/debian/changelog b/debian/changelog index 5c2d203..61c46c6 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,485 @@ -osmo-bts (0.5.0) UNRELEASED; urgency=medium +osmo-bts (0.6.0) unstable; urgency=medium + + [ Holger Hans Peter Freyther ] + * Initial release. + * misc: Ignore files generated by a debian packaging build + * jenkins: Add the build script from jenkins here + * jenkins: Add the build script from jenkins here + * sysmobts: Add the barebox boot state reservation + * sysmobts: Fix eeprom padding before gpg key + * ci/spatch: Remove the "static" analysis handling + * oct: Attempt to enable the Octphy for the osmo-bts-oct build + * debian: Use the header files installed by openbsc-dev + * build: Do not require more headers from OpenBSC + * sysmobts: Make reservation for mode/netmask/ip and suc + * sysmobts: Store a simple network config in the EEPROM as well + + [ Max ] + * Ensure TRX invariant + * Use libosmocore function for uplink measurements + * Fix debug output + * Fix RTP timestamps in case of DTX + * Add DTXd support for sysmoBTS and LC15 + * Use libosmocodec for AMR RTP + * octphy: Use the app. info. defaults as base + * Fix debug output + * DTXd: store/repeat last SID + * DTXd: store/repeat last SID + * DTXu: mark beginning of speech burst in RTP + * Fix OML activation + * TRX: Add vty command to power on/off transceiver + * TRX: add configuration example + * Add .gitreview + * DTX: add support for AMR/HR + * Move copy-pasted code into common part + * Use libosmocodec functions for AMR + * Use error values instead of number for RSL error + * Clarify logging message + * Make get_lchan_by_chan_nr globally available + * DTXu: move copy-pasted code to common part + * Remove duplicated nibble shift code + * TRX: add Uplink DTX support for FR/HR + * Mark array as static const + * sysmobts: dump PRACH and PTCCH parameters + * Activate PTCCH UL + * Fix dsp tracing at phy config + * octphy: fix build + * Fill measurements data for L1SAP + * sysmo: ts_connect: log channel combination name instead of number + * DTX: fix last SID saving + * DTX: fix SID repeat scheduling + * DTX: fix SID logic + * lc15, sysmo: Use SID_FIRST_P1 to initiate DTX + * DTX: check Marker bit to send ONSET to L1 + * DTX: remove misleading comment + * LC15: Clarify msgb ownership / fix memory leaks + * DTX: move scheduling check inside repeat_last_sid + * DTX: further AMR SID cache fixes (lc15, sysmo) + * DTX: move ONSET detection into separate function + * DTX: send AMR voice alongside with ONSET + * DTX: fix conversion from fn to ms + * Move copy-pasted array into shared header + * DTX DL: use FSM for AMR + * TRX: fix building with latest DTX changes + * DTX: fix array size calculation + * DTX AMR - fix buffer length check + * Replace magic number with define + * Fix lc15 build + * Extend RTP RX callback parameters + * DTX HR - fix array size calculation + * Fix DTX DL AMR SIDscheduling logic + * Add tools to check DTX operation + * DTX DL: split ONSET state handling + * Remove obsolete define + * DTX DL: add AMR HR support to scheduling check + * DTX fix ONSET handling + * dtx_check.gawk: Fix false-positives in DTX check + * Fix tests linking with libosmocodec + * DTX DL: tighten check for enabled operation + * DTX: wrap FSM signal dispatching + * Add libosmocodec for octphy build + * dtx_check.gawk: add check for repetitive SID FIRST + * Remove duplicated code + * Replace link_id constant with define + * DTX DL AMR: rewrite FSM recursion + * Remove duplicated code + * Fix AGCH/PCH proportional allocation + * TRX: prevent segfault upon phy init + * DTX: add explicit check if DTX enabled + * Save RTP metadata in Control Buffer + * osmo-bts-trx: fix lchan deactivation + * DTX: fix TS adjustment for ONSET + * Optionally use adaptive RTP jitter buffering + * Integrate Debian packaging changes + * DTX AMR HR: fix inhibition + * Add copyright for .deb packages + * Move code to libosmocore + * Log socket path on error + * Add Abis OML failure event reporting + * Alarm on various errors + * Remove obsolete define TLVP_PRES_LEN + * scheduler: log lchan on which prim error occured + * deb: use gsm_data_shared.* from openbsc-dev + * OML: internalize failure reporting + * Add ctrl command to send OML alert + * Fix typo in TCH/H interleaving table + * Use oml-alert CTRL command for temp report + * Remove code duplication + * Handle ctrl cmd allocation failures + * Check for suitable lchan type when detecting HO + * osmo-bts-trx: fix scheduling of broken frames + * Sync protocol with OsmoPCU + * vty: reduce code duplication + * Handle TXT indication from OsmoPCU + * Add MS TO to RSL measurements + * Signal to BSC when PCU disconnects + * Prepare for extended SI2quater support + * Set BTS variant while initializing BTS model + * Prepare for BTS attribute reporting via OML + * osmo-bts-trx: use libosmocoding + * Remove redundant test + * Implement basic Get Attribute responder + * Add version to phy_instance + * OML: fix Coverity-reported issues + * Re-add version to phy_instance + * Use systemd template specifiers + * Place *-mgr config examples according to BTS model + * lc15: add example systemd service file + * Extend Get Attribute responder + * Set and report BTS features + * Cleanup SI scheduling + * RSL: receive and send multiple SI2q messages + * RSL: check for abnormal SI2q values + * lc15bts-mgr: use extended config file example + * Move parameter file opening into separate function + * Move common steps into common jenkins helper + * lc15: add jenkins helper + * Use generic L1 headers helper + * Copy sysmobts.service to osmo-bts-sysmo + * OML: move BTS number check into separate function + * lc15: make jenkins helper executable + * lc15: fix jenkins build + * Add missing include for abis.h header file + * RSL: receive and send multiple SI2q messages + * Use release helper from libosmocore + * si2q: do not consider count update as error + * Cleanup example config files + * Fix .deb build + * Unify *.service files + * lc15: cleanup board parameters reading + * lc15-mgr: update parameter read/write + * lc15: fix BTS revision and hw options + * lc15: make default config usable + * lc15: port lc15bts-mgr changes + * lc15bts-mgr: separate service file + * lc15: port lc15bts-mgr dependency changes + * Simplify jenkins build scripts + * OML: use fom_hdr while handling attr. request + * osmo-bts-trx: fix 'osmotrx legacy-setbsic' + * osmo-bts-trx: remove global variables from loops + + [ Daniel Laszlo Sitzer ] + * octphy: Update outdated config param name in error message. + + [ Jason DSouza ] + * Close TRX session before opening new one + + [ Minh-Quang Nguyen ] + * l1sap.h: fix wrong L1SAP_FN2PTCCHBLOCK calculation according to TS 45.002 Table 6 + * common/abis.c: fix 100% CPU usage after disconnecting OML/RSL link (Bug #1703) + * LC15: Bring back DSP trace argument + * LC15: Hardware changes + * LC15: TRX nominal TX power can be used from EEPROM or from BTS configuration + * rsl: Fix dropping of LAPDm UA message. + * LC15: properly handle BS-AG-BLKS-RES as received from BSC + + [ Neels Hofmeyr ] + * sysmo: add L3 handle to l1prim messages + * pcu_sock: add pcu_connected() to query PCU availability + * tests/stubs.c: remove unused stubs + * fix typo in error message ('at lEast') + * oml, Set Chan Attr: treat unknown PCHAN types as error + * dyn PDCH: rsl rx dchan: also log ip.access message names + * doc: add ladder diagram on dynamic PDCH, add msc-README + * add missing DSUM entry to bts_log_info_cat + * fix compiler warning: printf format for sizeof() + * fix compiler warning: add missing case (PHY_LINK_CONNECTING) + * fix two compiler warnings: add two opaque struct declarations + * dyn PDCH: add bts_model_ts_connect() and _disconnect() stubs + * dyn PDCH: conf_lchans_for_pchan(): handle TCH/F_PDCH + * dyn PDCH: pcu_tx_info_ind(): handle TCH/F_PDCH in PDCH mode + * dyn PDCH: chan_nr_by_sapi(): handle TCH/F_PDCH according to ts->flags + * dyn PDCH: implement main dyn PDCH logic in common/ + * dyn PDCH: sysmo-bts/oml.c: add ts_connect_as(), absorbing ts_connect() guts + * dyn PDCH: sysmo: handle TCH/F_PDCH init like TCH/F + * dyn PDCH: complete for sysmo-bts: implement bts_model_ts_*() + * error log: two minor clarifications + * debug log: log lchan state transitions + * debug log: log TS pchan type on connect + * fix lc15 build: put src/common/libbts.a left of -losmogsm + * lc15: add L3 handle to l1prim messages + * dyn PDCH: lc15: chan_nr_by_sapi(): handle TCH/F_PDCH according to ts->flags + * dyn PDCH: lc15: add ts_connect_as(), absorbing ts_connect() guts + * dyn PDCH: lc15: handle TCH/F_PDCH init like TCH/F + * dyn PDCH: lc15: complete for litecell15-bts: implement bts_model_ts_*() + * dyn PDCH: safeguard: exit if nothing pending in dyn_pdch_ts_disconnected() + * vty: install orphaned trx nominal power command + * fix compiler warnings: include bts_model.h in phy_link.c + * fix compiler warning: remove useless 'static' storage class for struct decl + * fix compiler warning: remove unused variable 'i' in calib_verify() + * log: osmo-bts-trx: change access burst logs to DEBUG level + * log: osmo-bts-trx: change PDTCH block logs to DEBUG level + * osmo-bts-trx: init OML only once by sending AVSTATE_OK with OPSTATE_ENABLED + * doc: move dyn_pdch.msc to osmo-gsm-manuals.git + * error log: rsl.c: typo x2 + * info log: l1sap.c: add '0x' to hex output + * fix compiler warning: msg_utils.c: fn_chk() constify arg + * fix compiler warning: msg_utils.c: fn_chk() constify arg + * info log: l1sap.c: add '0x' to hex output + * error log: rsl.c: typo x2 + * dyn PDCH: code dup: use conf_lchans_as_pchan() + * prepare dyn TS: split/replace conf_lchans_for_pchan() + * code dup: join [rsl_]lchan_lookup() from libbsc and osmo-bts + * dyn TS: common TCH/F_TCH/H_PDCH implementation + * sysmo/oml.c: rename ts_connect() to ts_opstart() + * dyn TS: implement SysmoBTS specifics + * lc15/oml.c: rename ts_connect() to ts_opstart() + * dyn TS: implement litecell15 specifics + * comment typo: common/l1sap.c + * log typo: trx_sched_set_pchan() + * dyn TS: sysmo,lc15: chan_nr_by_sapi(): add missing assertion + * fix comment in common/l1sap.c, function name changed + * dyn TS, dyn PDCH: common/l1sap.c: properly notice PDCH + * dyn PDCH: trx l1_if.c: factor out trx_set_ts_as_pchan() from trx_set_ts() + * dyn PDCH: complete for trx: implement bts_model_ts_[dis]connect() + * dyn PDCH: trx l1_if.c: drop fixme, add comment + * dyn TS: complete for TRX + * dyn TS: measurement.c: replace fixme with comment + * sysmo,lc15: ts_connect_as(): log error also for pchan_as == TCH/F_PDCH + * sysmo: fix dyn TS: Revert "Activate PTCCH UL" [in sysmobts] + * log: l1sap: add 0x to hex output of chan_nr, 5 times + * dyn TS: measurement: use correct nr of subslots, rm code dup + * dyn TS: sysmo,lc15: ph_data_req: fix PDCH mode detection + * Fix ip.access style dyn PDCH, broken in 37af36e85eca546595081246aec010fa7f6fd0be + * common/rsl: move decision whether to chan act ack/nack to common function + * octphy: fix build: Revert "octphy: fix for multiple trx with more than 1 dsp" + * octphy: fix build: Revert "octphy: add support for multiple trx ids" + * octphy: fix build with OCTSDR-OPENBSC-02.07.00-B708: name changed + * dyn TS: if PCU is not connected, allow operation as TCH + * log: sysmo,lc15: tweak log about sapi_cmds queue + * log causing rx event for lchan_lookup errors + * heed VTY 'line vty'/'bind' command + * sysmobts_mgr, lc15bts_mgr: fix tall context for telnet vty + * build: be robust against install-sh files above the root dir + * configure: check for pkg-config presence + * jenkins.sh: use osmo-build-dep.sh, log test failures + * msgb ctx: use new msgb_talloc_ctx_init() in various main()s + * jenkins-oct.sh: fix build: typo in deps path + * fix 'osmo-bts-* --version' segfault + * osmo-bts-trx: remove obsolete include of netif/rtp.h + * add jenkins_bts_trx.sh + * add jenkins_oct_and_bts_trx.sh + * jenkins: add jenkins_bts_model.sh + * bursts test: test_pdtch: pre-init result mem + * fix: dyn ts: uplink measurement report + * fix missing ~ in bit logic for lchan->si.valid in rsl_rx_sacch_inf_mod() + * SACCH: fix sending of SI with an enum value > 7 + * SACCH SI: assert that SI enum vals fit in bit mask + * all models: fix vty write: bts_model_config_write_phy + * jenkins: add value_string termination check + * Revert "Add version to phy_instance" + * Revert "RSL: check for abnormal SI2q values" + * Revert "RSL: receive and send multiple SI2q messages" + + [ Harald Welte ] + * sysmobts: screnrc/systemd-service: Use osmo-bts-sysmo instead of sysmobts + * Add .mailmap for mapping mail addresses in shortlog + * vty: Ensure to not use negative (error) sapi value + * sysmobts: Add correct nominal transmit power for sysmoBTS 1020 + * sysmobts_eeprom.h: Fix/extend model number definitions + * Revert "sysmobts: Add correct nominal transmit power for sysmoBTS 1020" + * tx_power: Change PA calibration tables to use delta vales + * Add new unit-test for transmit power computation code + * sysmobts: fully support trx_power_params + * README: Add general project information and convert to markdown + * README: update some of the limitations + * sysmobts: Don't start with 0dBm TRX output power before ramping + * Remove unusued left-over gsm0503_conv.c + * scheduler_trx.c: Avoid code duplication for BER10k computation + * scheduler_trx: Avoid copy+pasting determining CMR from FN + * rx_tchh_fn(): Avoid copy+pasting formula to determine odd-ness of fn + * Consistently check for minimum attribute/TLV length in RSL and OML + * l1sap.c: Add spec reference to link timeout implementation + * osmo-bts-trx: Remove duplicate parsing of NM_ATT_CONN_FAIL_CRIT + * vty: Remove command for manual channel activation/deactivation + * l1_if: Add inline functions to check dsp/fgpa version at runtime + * sysmobts: Re-order the bit-endianness of every HR codec parameter + * OML Add osmocom-specific way to deactivate radio link timeout + * measurement: Remove dead code + * l1sap.c: Factor out function to limit message queue + * osmo-bts-sysmo/l1_if.c: PH-DATA.ind belongs to L1P, not L1C + * l1sap: if lchan is in loopback, don't accept incoming RTP + * TRX: Use timerfd and CLOCK_MONOTONIC for GSM frame timer (Closes: #2325) + * Add loopback support for PDTCH + * TRX: trx_if: Improve code description / comments + * trx_if: Improve error handling + * TRX: Rename trx_if_data() -> trx_if_send_burst() + * TRX: merge/simplify l1_if and trx_if code + * TRX: don't free l1h in trx_phy_inst_close() + * l1sap: Don't enqueue PTCCH blocks for loopback + * TRX: permit transmission of all-zero loopback frames + * jenkins helpers: some minimal documentation/comments + print errors + * VIRT-PHY: Initial check-in of a new virtual BTS + * VIRT-PHY: Fix handling of default values for vty configuration + * VIRT-PHY: Use IPv4 multicast groups for private / local scope + * VIRT-PHY: cause BTS to terminate in case of recv()/send() on udp socket returns 0 + * Ensure we don't send dummy UI frames on BCCH for TC=5 + * virt: Don't print NOTICE log message if ARFCN doesn't match + * VIRT-PHY: Report virtual RACH bursts with plausible burst type + * scheduler: Fix wrong log subsystem: L1C is L1 *control* not user data + * VIRT-PHY: Print NOTICE log message from unimplemented stubs + * TRX / VIRT-PHY: Make check for BCCH/CCCH more specific + * L1SAP: Print chan_nr and link_id always as hex + * VIRT-BTS: Support for GPRS + * L1SAP: Use RSL_CHAN_OSMO_PDCH across L1SAP + * GSMTAP: Don't log fill frames via GSMTAP + * TRX: Remove bogus extern global variable declarations + * l1sap/osmo-bts-sysmo: Improve logging + * TRX: Remove global variables, move SETBSIC/SETTSC handling into phy_link + * Fix build after recent gsm_bts_alloc() change + * Treat SIGTERM just like SIGINT in our programs + + [ Tom Tsou ] + * trx: Add EGPRS tables, sequences, and mappings + * trx: Add EGPRS coding and decoding procedures + * trx: Enable EGPRS handling through burst lengths + * trx: Fix coverity BER calculation NULL dereference + + [ Vadim Yanitskiy ] + * pcu_sock: use osmo_sock_unix_init() from libosmocore + * osmo-bts-trx/l1_if.c: use channel combination III for TCH/H + * scheduler_trx.c: strip unused variable + + [ Mike McTernan ] + * osmo-bts-trx: Fix PCS1900 operation + * osmo-bts-trx: log decoder bit errors as DEBUG, not NOTICE + + [ bhargava ] + * Change interface in osmo-bts for 11 bit RACH + * Update parameters in osmo-bts-sysmo for 11bit RACH + * 11bit RACH support for osmo-bts-litecell15 + * Initialize parameters in osmo-trx for 11bit RACH + + [ Philipp ] + * octphy: Fixing missing payload type in ph. chan. activation + * octphy: Fixing band selection for ARFCN 0 + * octphy: reintroducing multi-trx support + * octopy: fixing renamed constant + * octphy: prevent mismatch between dsp-firmware and octphy headers + * rsl: improving the log output + * octphy: multi-trx support: fix AC_CHECK order + * RSL: drop obsolete NULL check + * RSL: add assertions to check args of public API + * OML: fix possible segfault: add NULL check in oml_ipa_set_attr() + * CTRL: make the CTRL-Interface IP address configurable + * l1sap: Fix expired rach slot counting + * l1sap: fix missing 'else's causing wrong rach frame expiry counts + * octphy: set tx attenuation via VTY + * octphy: Improve OML ADM state handling + + [ Yves Godin ] + * DTX: fix 1st RTP packet drop + + [ Alexander Chemeris ] + * l1sap: Fix use-after-free in loopback mode. + * vty: Add commands to manually activate/deactivate a channel. + * trx: Add "maxdlynb" VTY command to control max TA for Normal Bursts. + * rsl: Output RTP stats before closing the socket. + * osmo-bts-trx: Fix MS power control loop. + * osmo-bts-trx: Remove an unused variable. Resolves a compiler warning. + * osmo-bts-trx: Increase a maximum allowed MS power reduction step from 2dB to 4dB. + * Fix static build of osmo-bts-trx and osmo-bts-virtual. + + [ Jean-Francois Dionne ] + * DTX: don't always perform AMR HR specific check + * DTX: fix SID-FIRST detection + * lc15,sysmobts l1_if: fix memleak in handle_mph_time_ind() + * sysmo,lc15: fix memory leak at each call placed + * DTX: fix "unexpected burst" error + * Fix AMR HR DTX FSM logic. + * Fix SACCH channel release indication not sent to BSC after location update. + * Fix RTP duration adjustment not done when speech resumes in DTX mode. + + [ Ruben Undheim ] + * Fix some spelling errors + + [ Holger Freyther ] + * Revert "deb: use gsm_data_shared.* from openbsc-dev" + + [ Philipp Maier ] + * octphy VTY: fix vty write output for octphy's phy section + * octphy: Fix VTY commands + * l1sap: fix rach reason (ra) parsing + * l1sap: fix PTCCH detection + * octphy: fix usage of wrong define constant + * octphy: add CBCH support + * l1sap: improve log output + * octphy: print log message for multi-trx support + * octphy: display hint in case of wrongly configured transceiver number + * octphy: add conditional compilation to support latest octasic header release + * octphy: set tx/rx antenne IDs via VTY + * bts: revert trx shutdown order + * octphy: activate CBCH after all physical channels are activated + * octphy: align frame number for new firmware versions + * octphy: ensure that 11 bit rach flag is not set + * measurement: fix measurement reporting period + * measurement: make lchan_meas_check_compute() available to l1sap.c + * measurement: Compute measurement results on measurement idication + * measurement: exclude idle channels from uplink measurement + * octphy: integrate channel measurement handling + * octphy: remove old event control code + * osmo-bts-sysmo: Include frame number in MEAS IND + * measurement: fix measurement computation + * octphy: fix segfault + * Revert "measurement: exclude idle channels from uplink measurement" + * sysmobts: normalize frame number in measurement indication + * measurement: Improve log output + * measurement: improve log output + * octphy: improve log output + * octphy: initalize l1msg and only when needed + * octphy: initalize nmsg only when needed + * octphy: remove log output + * Revert "sysmobts: normalize frame number in measurement indication" + * osmo-bts-trx: fix missing frame number in MEAS IND + * osmo-bts-litecell15: Fix missing frame number in MEAS IND + * Revert "osmo-bts-sysmo: Include frame number in MEAS IND" + * octphy: complete value strings (octphy_cid_vals) + * octphy: do not send empty frames to phy + * osmo-bts-sysmo: Include frame number in MEAS IND + * measurement: fix measurment report + * octphy: remap frame number in MEAS_IND + * octphy: implement support for dynamic timeslots + + [ Ivan Klyuchnikov ] + * osmo-trx-bts: Fix incorrect setting of RXGAIN and POWER parameters on second channel (TRX1) of osmo-trx + * osmo-trx-bts: Fix osmo-bts-trx crash on startup during reading phy instance parameters from config file + * osmo-trx-bts: Fix incorrect bts shutdown procedure in case of abis connection closure + * osmo-trx-bts: Fix incorrect bts shutdown procedure in case of clock loss from osmo-trx + + [ Ivan Kluchnikov ] + * oml: Fix incorrect usage of const variable abis_nm_att_tlvdef_ipa + + [ Pau Espin Pedrol ] + * phy_link: Fix typo in state being printed + * trx: Allow BTS and TRX to be on different IPs + * trx: Save osmotrx base-port vty properties + * sysmo/tch.c: Clean up use of empty buffer + * litecell15/tch.c: Clean up use of empty buffer + * Use L1P instead of L1C for TCH logging and allocation + * Fix annoying trailing whitespace + * sysmo, litecell15: Make sure all TCH events are triggered + * sysmo: Remove non longer valid -p option from help + * Allow passing low link quality buffers to upper layers + * l1sap.c: Avoid sending RTP frame with empty payload + * l1sap.c: fn_ms_adj: Add err logging and always return GSM_RTP_DURATION + * Move dump_gsmtime to libosmocore as osmo_dump_gsmtime + * Use osmo_dump_gsmtime to log fn across different layers + * lc15bts-mgr.cfg: Set default vswr to a value inside valid range + * litecell15: Register in vty limits for paX_pwr + * lc15: Tweak led colors used in service file + * lc-15, sysmo: l1_if: print name on PH-DATA.ind unknwon sapi + * lc15bts-mgr.service: Prepare dirs and sysctls for the process + * osmo-bts-trx: Enable osmotrx tx-attenuation oml by default + * osmo-bts-trx: Relax validation to allow TRX data bursts without padding + + [ Sebastian Stumpf ] + * VIRT-PHY: Added example configurations for openbsc and osmobts. + * VIRT-PHY: Fixed timeslot in gsmtap-msg on downlink which was always 0. + * VIRT-PHY: Added test option for fast hyperframe repeat. + + -- Max Fri, 25 Aug 2017 15:16:56 +0200 + +osmo-bts (0.5.0) unstable; urgency=medium * Initial release. -- To view, visit https://gerrit.osmocom.org/3598 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I613d09ae0f9f0aa67be1dc6015da1fb9314110fd Gerrit-PatchSet: 2 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Fri Aug 25 14:00:15 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Fri, 25 Aug 2017 14:00:15 +0000 Subject: [PATCH] osmo-bts[master]: Add git-version-gen snippet Message-ID: Review at https://gerrit.osmocom.org/3678 Add git-version-gen snippet Change-Id: Id1732921ecb768b3c3c4872b82b74ccc3d26cf77 Related: OS#1861 --- M Makefile.am 1 file changed, 8 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/78/3678/1 diff --git a/Makefile.am b/Makefile.am index 5c1add6..4832c84 100644 --- a/Makefile.am +++ b/Makefile.am @@ -15,6 +15,14 @@ doc/examples/sysmo/sysmobts-mgr.cfg \ doc/examples/virtual/openbsc-virtual.cfg \ doc/examples/virtual/osmobts-virtual.cfg \ + git-version-gen .version \ README.md @RELMAKE@ + +BUILT_SOURCES = $(top_srcdir)/.version + +$(top_srcdir)/.version: + echo $(VERSION) > $@-t && mv $@-t $@ +dist-hook: + echo $(VERSION) > $(distdir)/.tarball-version -- To view, visit https://gerrit.osmocom.org/3678 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Id1732921ecb768b3c3c4872b82b74ccc3d26cf77 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Fri Aug 25 14:00:16 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Fri, 25 Aug 2017 14:00:16 +0000 Subject: [PATCH] osmo-bts[master]: Use git-version-gen from gnulib Message-ID: Review at https://gerrit.osmocom.org/3679 Use git-version-gen from gnulib Depend on gnulib package and use upstream's git-version-gen instead of local copy. Change-Id: I290acecbbb91f5ee713a035d07e23e7d5c0cf03c Related: OS#1861 --- M Makefile.am M configure.ac M debian/control D git-version-gen 4 files changed, 3 insertions(+), 153 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/79/3679/1 diff --git a/Makefile.am b/Makefile.am index 4832c84..0cd5373 100644 --- a/Makefile.am +++ b/Makefile.am @@ -15,7 +15,7 @@ doc/examples/sysmo/sysmobts-mgr.cfg \ doc/examples/virtual/openbsc-virtual.cfg \ doc/examples/virtual/osmobts-virtual.cfg \ - git-version-gen .version \ + .version \ README.md @RELMAKE@ diff --git a/configure.ac b/configure.ac index bc36456..d741d2e 100644 --- a/configure.ac +++ b/configure.ac @@ -1,6 +1,6 @@ dnl Process this file with autoconf to produce a configure script AC_INIT([osmo-bts], - m4_esyscmd([./git-version-gen .tarball-version]), + m4_esyscmd([/usr/share/gnulib/build-aux/git-version-gen .tarball-version]), [openbsc-devel at lists.openbsc.org]) dnl *This* is the root dir, even if an install-sh exists in ../ or ../../ diff --git a/debian/control b/debian/control index e1a58b2..c7c34d8 100644 --- a/debian/control +++ b/debian/control @@ -4,6 +4,7 @@ Priority: optional Build-Depends: debhelper (>= 9), pkg-config, + gnulib, dh-autoreconf, dh-systemd (>= 1.5), autotools-dev, diff --git a/git-version-gen b/git-version-gen deleted file mode 100755 index 42cf3d2..0000000 --- a/git-version-gen +++ /dev/null @@ -1,151 +0,0 @@ -#!/bin/sh -# Print a version string. -scriptversion=2010-01-28.01 - -# Copyright (C) 2007-2010 Free Software Foundation, Inc. -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 3 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . - -# This script is derived from GIT-VERSION-GEN from GIT: http://git.or.cz/. -# It may be run two ways: -# - from a git repository in which the "git describe" command below -# produces useful output (thus requiring at least one signed tag) -# - from a non-git-repo directory containing a .tarball-version file, which -# presumes this script is invoked like "./git-version-gen .tarball-version". - -# In order to use intra-version strings in your project, you will need two -# separate generated version string files: -# -# .tarball-version - present only in a distribution tarball, and not in -# a checked-out repository. Created with contents that were learned at -# the last time autoconf was run, and used by git-version-gen. Must not -# be present in either $(srcdir) or $(builddir) for git-version-gen to -# give accurate answers during normal development with a checked out tree, -# but must be present in a tarball when there is no version control system. -# Therefore, it cannot be used in any dependencies. GNUmakefile has -# hooks to force a reconfigure at distribution time to get the value -# correct, without penalizing normal development with extra reconfigures. -# -# .version - present in a checked-out repository and in a distribution -# tarball. Usable in dependencies, particularly for files that don't -# want to depend on config.h but do want to track version changes. -# Delete this file prior to any autoconf run where you want to rebuild -# files to pick up a version string change; and leave it stale to -# minimize rebuild time after unrelated changes to configure sources. -# -# It is probably wise to add these two files to .gitignore, so that you -# don't accidentally commit either generated file. -# -# Use the following line in your configure.ac, so that $(VERSION) will -# automatically be up-to-date each time configure is run (and note that -# since configure.ac no longer includes a version string, Makefile rules -# should not depend on configure.ac for version updates). -# -# AC_INIT([GNU project], -# m4_esyscmd([build-aux/git-version-gen .tarball-version]), -# [bug-project at example]) -# -# Then use the following lines in your Makefile.am, so that .version -# will be present for dependencies, and so that .tarball-version will -# exist in distribution tarballs. -# -# BUILT_SOURCES = $(top_srcdir)/.version -# $(top_srcdir)/.version: -# echo $(VERSION) > $@-t && mv $@-t $@ -# dist-hook: -# echo $(VERSION) > $(distdir)/.tarball-version - -case $# in - 1) ;; - *) echo 1>&2 "Usage: $0 \$srcdir/.tarball-version"; exit 1;; -esac - -tarball_version_file=$1 -nl=' -' - -# First see if there is a tarball-only version file. -# then try "git describe", then default. -if test -f $tarball_version_file -then - v=`cat $tarball_version_file` || exit 1 - case $v in - *$nl*) v= ;; # reject multi-line output - [0-9]*) ;; - *) v= ;; - esac - test -z "$v" \ - && echo "$0: WARNING: $tarball_version_file seems to be damaged" 1>&2 -fi - -if test -n "$v" -then - : # use $v -elif - v=`git describe --abbrev=4 --match='v*' HEAD 2>/dev/null \ - || git describe --abbrev=4 HEAD 2>/dev/null` \ - && case $v in - [0-9]*) ;; - v[0-9]*) ;; - *) (exit 1) ;; - esac -then - # Is this a new git that lists number of commits since the last - # tag or the previous older version that did not? - # Newer: v6.10-77-g0f8faeb - # Older: v6.10-g0f8faeb - case $v in - *-*-*) : git describe is okay three part flavor ;; - *-*) - : git describe is older two part flavor - # Recreate the number of commits and rewrite such that the - # result is the same as if we were using the newer version - # of git describe. - vtag=`echo "$v" | sed 's/-.*//'` - numcommits=`git rev-list "$vtag"..HEAD | wc -l` - v=`echo "$v" | sed "s/\(.*\)-\(.*\)/\1-$numcommits-\2/"`; - ;; - esac - - # Change the first '-' to a '.', so version-comparing tools work properly. - # Remove the "g" in git describe's output string, to save a byte. - v=`echo "$v" | sed 's/-/./;s/\(.*\)-g/\1-/'`; -else - v=UNKNOWN -fi - -v=`echo "$v" |sed 's/^v//'` - -# Don't declare a version "dirty" merely because a time stamp has changed. -git status > /dev/null 2>&1 - -dirty=`sh -c 'git diff-index --name-only HEAD' 2>/dev/null` || dirty= -case "$dirty" in - '') ;; - *) # Append the suffix only if there isn't one already. - case $v in - *-dirty) ;; - *) v="$v-dirty" ;; - esac ;; -esac - -# Omit the trailing newline, so that m4_esyscmd can use the result directly. -echo "$v" | tr -d '\012' - -# Local variables: -# eval: (add-hook 'write-file-hooks 'time-stamp) -# time-stamp-start: "scriptversion=" -# time-stamp-format: "%:y-%02m-%02d.%02H" -# time-stamp-end: "$" -# End: -- To view, visit https://gerrit.osmocom.org/3679 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I290acecbbb91f5ee713a035d07e23e7d5c0cf03c Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Fri Aug 25 14:01:46 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Fri, 25 Aug 2017 14:01:46 +0000 Subject: [PATCH] libosmocore[master]: Update release helper Message-ID: Review at https://gerrit.osmocom.org/3680 Update release helper * add reference to semver spec * use 'patch' release by default * unify debian/changelog distro update for library and non-library projects * abort library release for non-empty TODO-RELEASE if libversion is not modified Change-Id: I413f99cbfa6e6dcc753e3be9fc3c8d682e6a41f3 Related: OS#1861 --- M osmo-release.mk 1 file changed, 26 insertions(+), 15 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/80/3680/1 diff --git a/osmo-release.mk b/osmo-release.mk index 3fe6803..03eb3cb 100644 --- a/osmo-release.mk +++ b/osmo-release.mk @@ -1,28 +1,39 @@ -ifdef REL -NEW_VERSION := $(shell bumpversion --list --current-version $(VERSION) $(REL) --allow-dirty | awk -F '=' '{ print $$2 }') -LIBVERS := $(shell git grep -n LIBVERSION | grep '=' | grep am | grep -v LDFLAGS) -ISODATE := $(shell date -I) +ifndef REL + REL := patch endif +NEW_VER := $(shell bumpversion --list --current-version $(VERSION) $(REL) --allow-dirty | awk -F '=' '{ print $$2 }') +LIBVERS := $(shell git grep -n LIBVERSION | grep '=' | grep am | grep -v LDFLAGS) +MAKEMOD := $(shell git diff -GLIBVERSION --stat | grep Makefile.am) +ISODATE := $(shell date -I) + release: -ifeq ($(NEW_VERSION),) - @$(error Failed to determine NEW_VERSION - please fix versioning (current is $(VERSION)) before proceeding with the release) + +ifeq ($(NEW_VER),) + @$(error Please fix versioning to match http://semver.org/ spec (current is $(VERSION)) before proceeding.) endif - @echo "Releasing" $(VERSION) "->" $(NEW_VERSION)"..." + +ifeq ($(origin REL), file) + @echo "No REL value specified, defaulting to 'patch' release" +endif + + @echo "Releasing" $(VERSION) "->" $(NEW_VER)"..." + ifeq ($(LIBVERS),) @gbp dch --debian-tag='%(version)s' --auto --meta --git-author --multimaint-merge --ignore-branch else @echo "You should NOT be doing this unless you've read and understood following article:" @echo "https://www.gnu.org/software/libtool/manual/html_node/Updating-version-info.html#Updating-version-info" - @grep -v '#' TODO-RELEASE | sed 's/\t\+/:/g' | xargs -d'\n' -I entry dch -m -v $(NEW_VERSION) "entry" - @dch -r -m --distribution "unstable" "" + @grep -v '#' TODO-RELEASE | sed 's/\t\+/: /g' > TODO-RELEASE.entries @grep '#' TODO-RELEASE > TODO-RELEASE.clean @mv TODO-RELEASE.clean TODO-RELEASE - @echo "Do NOT push the release commit if you have not adjusted LIBVERSION in preceeding commit!!!" - @echo "Are you sure the following versions are correct?" - @echo $(LIBVERS) +ifeq ($(MAKEMOD),) + @$(if $(shell git status -s -uno TODO-RELEASE),,$(error Before releasing, please modify some of the libversions: $(LIBVERS))) endif + @xargs -a TODO-RELEASE.entries -r -d'\n' -I entry dch -m -v $(NEW_VER) "entry" +endif + @dch -r -m --distribution "unstable" "" @git add -u - @bumpversion --current-version $(VERSION) $(REL) --tag --commit --tag-name $(NEW_VERSION) --allow-dirty - @git tag -s $(NEW_VERSION) -f -m "Release v$(NEW_VERSION) on $(ISODATE)." - @echo "Release" $(NEW_VERSION) "prepared, tagged and signed." + @bumpversion --current-version $(VERSION) $(REL) --tag --commit --tag-name $(NEW_VER) --allow-dirty + @git tag -s $(NEW_VER) -f -m "Release v$(NEW_VER) on $(ISODATE)." + @echo "Release" $(NEW_VER) "prepared, tagged and signed." -- To view, visit https://gerrit.osmocom.org/3680 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I413f99cbfa6e6dcc753e3be9fc3c8d682e6a41f3 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Fri Aug 25 14:13:12 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Fri, 25 Aug 2017 14:13:12 +0000 Subject: =?UTF-8?Q?=5BPATCH=5D_libosmo-abis=5Bmaster=5D=3A_Bump_version=3A_0=2E3=2E2_=E2=86=92_0=2E4=2E0?= 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/3595 to look at the new patch set (#2). Bump version: 0.3.2 ? 0.4.0 Change-Id: Ibefe53a7f5b06fb8a9294574af41dacac68bdbe9 --- M TODO-RELEASE M debian/changelog M src/Makefile.am 3 files changed, 18 insertions(+), 8 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-abis refs/changes/95/3595/2 diff --git a/TODO-RELEASE b/TODO-RELEASE index 128778a..d0852fc 100644 --- a/TODO-RELEASE +++ b/TODO-RELEASE @@ -1,4 +1,9 @@ +# When cleaning up this file: bump API version in corresponding Makefile.am and rename corresponding debian/lib*.install +# according to https://www.gnu.org/software/libtool/manual/html_node/Updating-version-info.html#Updating-version-info +# In short: +# LIBVERSION=c:r:a +# If the library source code has changed at all since the last update, then increment revision: c:r + 1:a. +# If any interfaces have been added, removed, or changed since the last update: c + 1:0:0. +# If any interfaces have been added since the last public release: c:r:a + 1. +# If any interfaces have been removed or changed since the last public release: c:r:0. #library what description / commit summary line -libosmo-abis API change major: add parameter to rx_cb() callack in osmo_ortp.h -libosmo-abis API change major: add parameter to struct input_signal_data -libosmo-abis API change major: add parameters to rx_cb() callack in osmo_ortp.h diff --git a/debian/changelog b/debian/changelog index b2cf0e9..13c0996 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,8 +1,12 @@ -libosmo-abis (0.3.3) UNRELEASED; urgency=medium +libosmo-abis (0.4.0) unstable; urgency=medium * Move forward towards a new release. + * libosmo-abis API change major: add parameter to struct + input_signal_data + * libosmo-trau API change major: add parameters to rx_cb() + callack in osmo_ortp.h - -- Holger Hans Peter Freyther Tue, 24 May 2016 23:02:47 +0200 + -- Holger Hans Peter Freyther Fri, 25 Aug 2017 16:09:46 +0200 libosmo-abis (0.3.2) unstable; urgency=medium diff --git a/src/Makefile.am b/src/Makefile.am index 760c1f5..7395d17 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -1,7 +1,8 @@ # This is _NOT_ the library release version, it's an API version. -# Please read Chapter 6 "Library interface versions" of the libtool documentation before making any modification -ABIS_LIBVERSION=5:0:0 -TRAU_LIBVERSION=1:0:0 +# Please read chapter "Library interface versions" of the libtool documentation +# before making any modifications: https://www.gnu.org/software/libtool/manual/html_node/Versioning.html +ABIS_LIBVERSION=6:0:0 +TRAU_LIBVERSION=2:0:0 AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include -I$(top_builddir) AM_CFLAGS= -Wall $(LIBOSMOCORE_CFLAGS) $(LIBOSMOGSM_CFLAGS) $(LIBOSMOVTY_CFLAGS) $(COVERAGE_CFLAGS) -- To view, visit https://gerrit.osmocom.org/3595 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ibefe53a7f5b06fb8a9294574af41dacac68bdbe9 Gerrit-PatchSet: 2 Gerrit-Project: libosmo-abis Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Fri Aug 25 14:13:41 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Fri, 25 Aug 2017 14:13:41 +0000 Subject: =?UTF-8?Q?=5BABANDON=5D_libosmo-abis=5Bmaster=5D=3A_Bump_version=3A_0=2E3=2E2_=E2=86=92_0=2E4=2E0?= In-Reply-To: References: Message-ID: Max has abandoned this change. Change subject: Bump version: 0.3.2 ? 0.4.0 ...................................................................... Abandoned -- To view, visit https://gerrit.osmocom.org/3596 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: abandon Gerrit-Change-Id: I6f0ac8377adeccd4c56555cdc16768973c1f0876 Gerrit-PatchSet: 1 Gerrit-Project: libosmo-abis Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: neels From gerrit-no-reply at lists.osmocom.org Fri Aug 25 14:42:55 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Fri, 25 Aug 2017 14:42:55 +0000 Subject: libosmo-netif[master]: osmux: Re-write osmux_snprintf In-Reply-To: References: Message-ID: Patch Set 1: > @Pau: You're not the only one getting confused with it, snprintf() > is a mess, it's hard to deal with it, hence this macro that retains > semantics that aims to simplify things... if you find any better, > let me know I'd be happy to reuse it in my code moving forward :-). > > @Holger: Either way, I don't mind if you don't need the snprintf > semantics, this is a _snprintf() function after all, just explaning > here. So the intention at least that I can remember was to keep in > sync with how snprintf() works. Anyway, feel free to simplify this. > Even if the intention was to follow snprintf, as far as I can tell it doesn't seem to be actually working correctly. Implementation previous to this patch returns offset in all functions. offset var is always calculated using this part of the macro: if (ret > len) \ ret = len; \ offset += ret; \ Which means offset is never going to be bigger than the "size" originally passed as parameter. That's correct as offset marks internally next position to write in the buffer, but should not be the var being returned as it's always <= size even if size of buffer is smaller than required size. In exchange, size (from the variable) should be initialized to 0 at the start of each function after assigning len = size, then return size in each function. This could be called "count" instead of "size" to avoid confusion with "size in parameter. Actually, I don't really understand what's the usage of the "size" variable as used currently, which starts having size of the buffer (used or not) and keeps growing. On top of that, I have the feeling the previous implementation doesn't handle the case where snprintf returns negative value (error). So even after all those modifications, we still need to add extra logic to handle that. In nftables code it seems to be handled by calling abort(), which doesn't seem like a perfect approach in any case. It's not nice having libraries calling abort(). > Anyway, I just wanted to make sure this patch was really fixing up > the real issue. I understand you observe a crash, but not clear to > me why the patch is fixing it. > > Cheers. I try to fix all this corner cases explained above in this patch. I started looking again today at following a more conservative approach, like fixing step by step the current code, but as far as I can tell doesn't make sense, as there's a lot of stuff which needs changes. So, if there's no more objections to this patch, during following days I'll push a new version with the description fixes as advised by Holger, and we can then merge it. -- To view, visit https://gerrit.osmocom.org/3537 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I695771d099833842db37a415b636035d17f1bba7 Gerrit-PatchSet: 1 Gerrit-Project: libosmo-netif Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pablo Neira Ayuso Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Aug 25 14:47:46 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Fri, 25 Aug 2017 14:47:46 +0000 Subject: [MERGED] osmo-gsm-tester[master]: default-suites.conf: Add suites to explicitly test with sysm... In-Reply-To: References: Message-ID: Pau Espin Pedrol has submitted this change and it was merged. Change subject: default-suites.conf: Add suites to explicitly test with sysmoCell5000 ...................................................................... default-suites.conf: Add suites to explicitly test with sysmoCell5000 Change-Id: I6ff08a281c0c32148ca2c59f731d6550bf7b1c90 --- M example/default-suites.conf 1 file changed, 2 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/example/default-suites.conf b/example/default-suites.conf index 4904844..0198486 100644 --- a/example/default-suites.conf +++ b/example/default-suites.conf @@ -2,6 +2,8 @@ - aoip_sms:sysmo - sms:trx-b200 - aoip_sms:trx-b200 +- sms:trx-sysmocell5000 +- aoip_sms:trx-sysmocell5000 - smpp - aoip_smpp - aoip_encryption -- To view, visit https://gerrit.osmocom.org/3589 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I6ff08a281c0c32148ca2c59f731d6550bf7b1c90 Gerrit-PatchSet: 2 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Fri Aug 25 15:21:10 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Fri, 25 Aug 2017 15:21:10 +0000 Subject: [PATCH] osmo-bts[master]: Use value string check from osmo-ci Message-ID: Review at https://gerrit.osmocom.org/3681 Use value string check from osmo-ci Change-Id: I5bce234a5b8133c81b3ea8757e05de56d3aa15d8 --- M contrib/jenkins_common.sh 1 file changed, 2 insertions(+), 8 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/81/3681/1 diff --git a/contrib/jenkins_common.sh b/contrib/jenkins_common.sh index 78ca0af..c1891b2 100644 --- a/contrib/jenkins_common.sh +++ b/contrib/jenkins_common.sh @@ -20,14 +20,7 @@ mkdir -p "$deps" rm -rf "$inst" -cd "$deps" - -# Get libosmocore for verify_value_string_arrays_are_terminated.py -osmo-deps.sh libosmocore - -cd "$base" - -"$deps"/libosmocore/contrib/verify_value_string_arrays_are_terminated.py $(find . -name "*.[hc]") +verify_value_string_arrays_are_terminated.py $(find . -name "*.[hc]") # generic project build function, usage: # build "PROJECT-NAME" "CONFIGURE OPTIONS" @@ -41,6 +34,7 @@ set -x cd $deps + osmo-deps.sh libosmocore osmo-deps.sh openbsc conf_flags="--with-openbsc=$deps/openbsc/openbsc/include" cd $base -- To view, visit https://gerrit.osmocom.org/3681 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I5bce234a5b8133c81b3ea8757e05de56d3aa15d8 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Fri Aug 25 15:23:18 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Fri, 25 Aug 2017 15:23:18 +0000 Subject: [PATCH] libosmo-abis[master]: Use value string check from osmo-ci Message-ID: Review at https://gerrit.osmocom.org/3682 Use value string check from osmo-ci Change-Id: I60d480ce6fb761ac8e15318dbe2c591359a51c3c --- M contrib/jenkins.sh 1 file changed, 2 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-abis refs/changes/82/3682/1 diff --git a/contrib/jenkins.sh b/contrib/jenkins.sh index 769d5a7..6ff44ee 100755 --- a/contrib/jenkins.sh +++ b/contrib/jenkins.sh @@ -16,9 +16,9 @@ mkdir "$deps" || true rm -rf "$inst" -osmo-build-dep.sh libosmocore +verify_value_string_arrays_are_terminated.py $(find . -name "*.[hc]") -"$deps"/libosmocore/contrib/verify_value_string_arrays_are_terminated.py $(find . -name "*.[hc]") +osmo-build-dep.sh libosmocore export PKG_CONFIG_PATH="$inst/lib/pkgconfig:$PKG_CONFIG_PATH" export LD_LIBRARY_PATH="$inst/lib" -- To view, visit https://gerrit.osmocom.org/3682 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I60d480ce6fb761ac8e15318dbe2c591359a51c3c Gerrit-PatchSet: 1 Gerrit-Project: libosmo-abis Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Fri Aug 25 15:25:01 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Fri, 25 Aug 2017 15:25:01 +0000 Subject: [PATCH] libosmo-netif[master]: Use value string check from osmo-ci Message-ID: Review at https://gerrit.osmocom.org/3683 Use value string check from osmo-ci Change-Id: Id6048a69c9e0cc15010de643330aeb2a7271b2a6 --- M contrib/jenkins.sh 1 file changed, 2 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-netif refs/changes/83/3683/1 diff --git a/contrib/jenkins.sh b/contrib/jenkins.sh index 2231efc..999d2ce 100755 --- a/contrib/jenkins.sh +++ b/contrib/jenkins.sh @@ -17,9 +17,9 @@ mkdir "$deps" || true rm -rf "$inst" -osmo-build-dep.sh libosmocore +verify_value_string_arrays_are_terminated.py $(find . -name "*.[hc]") -"$deps"/libosmocore/contrib/verify_value_string_arrays_are_terminated.py $(find . -name "*.[hc]") +osmo-build-dep.sh libosmocore export PKG_CONFIG_PATH="$inst/lib/pkgconfig:$PKG_CONFIG_PATH" export LD_LIBRARY_PATH="$inst/lib" -- To view, visit https://gerrit.osmocom.org/3683 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Id6048a69c9e0cc15010de643330aeb2a7271b2a6 Gerrit-PatchSet: 1 Gerrit-Project: libosmo-netif Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Fri Aug 25 15:27:25 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Fri, 25 Aug 2017 15:27:25 +0000 Subject: [PATCH] libosmo-sccp[master]: Use value string check from osmo-ci Message-ID: Review at https://gerrit.osmocom.org/3684 Use value string check from osmo-ci Change-Id: I1a2223b1a059fbb832948decf11f9237fad389f2 --- M contrib/jenkins.sh 1 file changed, 2 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-sccp refs/changes/84/3684/1 diff --git a/contrib/jenkins.sh b/contrib/jenkins.sh index 38c1134..747243e 100755 --- a/contrib/jenkins.sh +++ b/contrib/jenkins.sh @@ -17,13 +17,12 @@ mkdir "$deps" || true rm -rf "$inst" -osmo-build-dep.sh libosmocore - -"$deps"/libosmocore/contrib/verify_value_string_arrays_are_terminated.py $(find . -name "*.[hc]") +verify_value_string_arrays_are_terminated.py $(find . -name "*.[hc]") export PKG_CONFIG_PATH="$inst/lib/pkgconfig:$PKG_CONFIG_PATH" export LD_LIBRARY_PATH="$inst/lib" +osmo-build-dep.sh libosmocore osmo-build-dep.sh libosmo-abis osmo-build-dep.sh libosmo-netif -- To view, visit https://gerrit.osmocom.org/3684 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I1a2223b1a059fbb832948decf11f9237fad389f2 Gerrit-PatchSet: 1 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Fri Aug 25 15:34:46 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Fri, 25 Aug 2017 15:34:46 +0000 Subject: [PATCH] libosmocore[master]: Use value string check from osmo-ci Message-ID: Review at https://gerrit.osmocom.org/3685 Use value string check from osmo-ci Change-Id: I513835be2d931d0a931cdfc996f361a451bc1a15 --- M contrib/jenkins.sh 1 file changed, 3 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/85/3685/1 diff --git a/contrib/jenkins.sh b/contrib/jenkins.sh index 6a72840..4a26776 100755 --- a/contrib/jenkins.sh +++ b/contrib/jenkins.sh @@ -1,8 +1,9 @@ -#!/usr/bin/env bash +#!/bin/sh +# jenkins build helper script for libosmo-sccp. This is how we build on jenkins.osmocom.org set -ex -./contrib/verify_value_string_arrays_are_terminated.py $(find . -name "*.[hc]") +verify_value_string_arrays_are_terminated.py $(find . -name "*.[hc]") if [ "x$label" = "xFreeBSD_amd64" ]; then ENABLE_SANITIZE="" -- To view, visit https://gerrit.osmocom.org/3685 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I513835be2d931d0a931cdfc996f361a451bc1a15 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Fri Aug 25 15:37:55 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Fri, 25 Aug 2017 15:37:55 +0000 Subject: [PATCH] openggsn[master]: Use value string check from osmo-ci Message-ID: Review at https://gerrit.osmocom.org/3686 Use value string check from osmo-ci Change-Id: I036ed452826b9a6848d22d45bdcc95e20a110b8b --- M contrib/jenkins.sh 1 file changed, 3 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openggsn refs/changes/86/3686/1 diff --git a/contrib/jenkins.sh b/contrib/jenkins.sh index 30416b2..71ba909 100755 --- a/contrib/jenkins.sh +++ b/contrib/jenkins.sh @@ -1,6 +1,8 @@ -#!/usr/bin/env bash +#!/bin/sh set -ex + +verify_value_string_arrays_are_terminated.py $(find . -name "*.[hc]") mkdir deps || true cd deps @@ -12,8 +14,6 @@ $MAKE $PARALLEL_MAKE install cd ../../ - -deps/libosmocore/contrib/verify_value_string_arrays_are_terminated.py $(find . -name "*.[hc]") autoreconf --install --force PKG_CONFIG_PATH=$PWD/deps/install/lib/pkgconfig:$PKG_CONFIG_PATH ./configure -- To view, visit https://gerrit.osmocom.org/3686 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I036ed452826b9a6848d22d45bdcc95e20a110b8b Gerrit-PatchSet: 1 Gerrit-Project: openggsn Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Fri Aug 25 15:42:01 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Fri, 25 Aug 2017 15:42:01 +0000 Subject: [PATCH] libosmo-netif[master]: Use value string check from osmo-ci In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3683 to look at the new patch set (#2). Use value string check from osmo-ci Change-Id: Id6048a69c9e0cc15010de643330aeb2a7271b2a6 --- M contrib/jenkins.sh 1 file changed, 3 insertions(+), 4 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-netif refs/changes/83/3683/2 diff --git a/contrib/jenkins.sh b/contrib/jenkins.sh index 2231efc..3e35a46 100755 --- a/contrib/jenkins.sh +++ b/contrib/jenkins.sh @@ -1,4 +1,4 @@ -#!/usr/bin/env bash +#!/bin/sh # jenkins build helper script for libosmo-netif. This is how we build on jenkins.osmocom.org if ! [ -x "$(command -v osmo-build-dep.sh)" ]; then @@ -17,13 +17,12 @@ mkdir "$deps" || true rm -rf "$inst" -osmo-build-dep.sh libosmocore - -"$deps"/libosmocore/contrib/verify_value_string_arrays_are_terminated.py $(find . -name "*.[hc]") +verify_value_string_arrays_are_terminated.py $(find . -name "*.[hc]") export PKG_CONFIG_PATH="$inst/lib/pkgconfig:$PKG_CONFIG_PATH" export LD_LIBRARY_PATH="$inst/lib" +osmo-build-dep.sh libosmocore osmo-build-dep.sh libosmo-abis set +x -- To view, visit https://gerrit.osmocom.org/3683 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Id6048a69c9e0cc15010de643330aeb2a7271b2a6 Gerrit-PatchSet: 2 Gerrit-Project: libosmo-netif Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Fri Aug 25 15:43:17 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Fri, 25 Aug 2017 15:43:17 +0000 Subject: [PATCH] libosmo-sccp[master]: Use value string check from osmo-ci In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3684 to look at the new patch set (#2). Use value string check from osmo-ci Change-Id: I1a2223b1a059fbb832948decf11f9237fad389f2 --- M contrib/jenkins.sh 1 file changed, 3 insertions(+), 4 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-sccp refs/changes/84/3684/2 diff --git a/contrib/jenkins.sh b/contrib/jenkins.sh index 38c1134..ae850ed 100755 --- a/contrib/jenkins.sh +++ b/contrib/jenkins.sh @@ -1,4 +1,4 @@ -#!/usr/bin/env bash +#!/bin/sh # jenkins build helper script for libosmo-sccp. This is how we build on jenkins.osmocom.org if ! [ -x "$(command -v osmo-build-dep.sh)" ]; then @@ -17,13 +17,12 @@ mkdir "$deps" || true rm -rf "$inst" -osmo-build-dep.sh libosmocore - -"$deps"/libosmocore/contrib/verify_value_string_arrays_are_terminated.py $(find . -name "*.[hc]") +verify_value_string_arrays_are_terminated.py $(find . -name "*.[hc]") export PKG_CONFIG_PATH="$inst/lib/pkgconfig:$PKG_CONFIG_PATH" export LD_LIBRARY_PATH="$inst/lib" +osmo-build-dep.sh libosmocore osmo-build-dep.sh libosmo-abis osmo-build-dep.sh libosmo-netif -- To view, visit https://gerrit.osmocom.org/3684 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I1a2223b1a059fbb832948decf11f9237fad389f2 Gerrit-PatchSet: 2 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Fri Aug 25 15:45:34 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Fri, 25 Aug 2017 15:45:34 +0000 Subject: [PATCH] libosmocore[master]: Use value string check from osmo-ci In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3685 to look at the new patch set (#2). Use value string check from osmo-ci Change-Id: I513835be2d931d0a931cdfc996f361a451bc1a15 --- M contrib/jenkins-arm.sh M contrib/jenkins.sh 2 files changed, 4 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/85/3685/2 diff --git a/contrib/jenkins-arm.sh b/contrib/jenkins-arm.sh index 510b0e9..ad992af 100755 --- a/contrib/jenkins-arm.sh +++ b/contrib/jenkins-arm.sh @@ -2,7 +2,7 @@ set -ex -./contrib/verify_value_string_arrays_are_terminated.py $(find . -name "*.[hc]") +verify_value_string_arrays_are_terminated.py $(find . -name "*.[hc]") autoreconf --install --force ./configure --enable-static \ diff --git a/contrib/jenkins.sh b/contrib/jenkins.sh index 6a72840..4a26776 100755 --- a/contrib/jenkins.sh +++ b/contrib/jenkins.sh @@ -1,8 +1,9 @@ -#!/usr/bin/env bash +#!/bin/sh +# jenkins build helper script for libosmo-sccp. This is how we build on jenkins.osmocom.org set -ex -./contrib/verify_value_string_arrays_are_terminated.py $(find . -name "*.[hc]") +verify_value_string_arrays_are_terminated.py $(find . -name "*.[hc]") if [ "x$label" = "xFreeBSD_amd64" ]; then ENABLE_SANITIZE="" -- To view, visit https://gerrit.osmocom.org/3685 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I513835be2d931d0a931cdfc996f361a451bc1a15 Gerrit-PatchSet: 2 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Fri Aug 25 15:49:02 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Fri, 25 Aug 2017 15:49:02 +0000 Subject: [PATCH] osmo-hlr[master]: Use value string check from osmo-ci Message-ID: Review at https://gerrit.osmocom.org/3687 Use value string check from osmo-ci Change-Id: I56ea5be60d2a3cf8442f58e1121b13074e2e6a08 --- M contrib/jenkins.sh 1 file changed, 2 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-hlr refs/changes/87/3687/1 diff --git a/contrib/jenkins.sh b/contrib/jenkins.sh index 12b2be9..e2abb60 100755 --- a/contrib/jenkins.sh +++ b/contrib/jenkins.sh @@ -17,13 +17,12 @@ mkdir "$deps" || true rm -rf "$inst" +verify_value_string_arrays_are_terminated.py $(find . -name "*.[hc]") + export PKG_CONFIG_PATH="$inst/lib/pkgconfig:$PKG_CONFIG_PATH" export LD_LIBRARY_PATH="$inst/lib" osmo-build-dep.sh libosmocore "" ac_cv_path_DOXYGEN=false - -"$deps"/libosmocore/contrib/verify_value_string_arrays_are_terminated.py $(find . -name "*.[hc]") - osmo-build-dep.sh libosmo-abis set +x -- To view, visit https://gerrit.osmocom.org/3687 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I56ea5be60d2a3cf8442f58e1121b13074e2e6a08 Gerrit-PatchSet: 1 Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Fri Aug 25 15:53:21 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Fri, 25 Aug 2017 15:53:21 +0000 Subject: [PATCH] osmo-iuh[master]: Use value string check from osmo-ci Message-ID: Review at https://gerrit.osmocom.org/3688 Use value string check from osmo-ci Change-Id: I9fc4a0ce4ca29f8b76e189d040097f3e63298ba5 --- M contrib/jenkins.sh 1 file changed, 3 insertions(+), 4 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-iuh refs/changes/88/3688/1 diff --git a/contrib/jenkins.sh b/contrib/jenkins.sh index b500e1c..cda0e2c 100755 --- a/contrib/jenkins.sh +++ b/contrib/jenkins.sh @@ -1,4 +1,4 @@ -#!/usr/bin/env bash +#!/bin/sh set -ex @@ -10,13 +10,12 @@ mkdir "$deps" || true rm -rf "$inst" -osmo-build-dep.sh libosmocore - -"$deps"/libosmocore/contrib/verify_value_string_arrays_are_terminated.py $(find . -name "*.[hc]") +verify_value_string_arrays_are_terminated.py $(find . -name "*.[hc]") export PKG_CONFIG_PATH="$inst/lib/pkgconfig:$PKG_CONFIG_PATH" export LD_LIBRARY_PATH="$inst/lib" +osmo-build-dep.sh libosmocore osmo-build-dep.sh libosmo-abis osmo-build-dep.sh libosmo-netif osmo-build-dep.sh libosmo-sccp -- To view, visit https://gerrit.osmocom.org/3688 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I9fc4a0ce4ca29f8b76e189d040097f3e63298ba5 Gerrit-PatchSet: 1 Gerrit-Project: osmo-iuh Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Fri Aug 25 15:56:32 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Fri, 25 Aug 2017 15:56:32 +0000 Subject: [PATCH] libosmocore[master]: Use value string check from osmo-ci In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3685 to look at the new patch set (#3). Use value string check from osmo-ci Change-Id: I513835be2d931d0a931cdfc996f361a451bc1a15 --- M contrib/jenkins-arm.sh M contrib/jenkins.sh D contrib/verify_value_string_arrays_are_terminated.py 3 files changed, 4 insertions(+), 36 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/85/3685/3 diff --git a/contrib/jenkins-arm.sh b/contrib/jenkins-arm.sh index 510b0e9..ad992af 100755 --- a/contrib/jenkins-arm.sh +++ b/contrib/jenkins-arm.sh @@ -2,7 +2,7 @@ set -ex -./contrib/verify_value_string_arrays_are_terminated.py $(find . -name "*.[hc]") +verify_value_string_arrays_are_terminated.py $(find . -name "*.[hc]") autoreconf --install --force ./configure --enable-static \ diff --git a/contrib/jenkins.sh b/contrib/jenkins.sh index 6a72840..4a26776 100755 --- a/contrib/jenkins.sh +++ b/contrib/jenkins.sh @@ -1,8 +1,9 @@ -#!/usr/bin/env bash +#!/bin/sh +# jenkins build helper script for libosmo-sccp. This is how we build on jenkins.osmocom.org set -ex -./contrib/verify_value_string_arrays_are_terminated.py $(find . -name "*.[hc]") +verify_value_string_arrays_are_terminated.py $(find . -name "*.[hc]") if [ "x$label" = "xFreeBSD_amd64" ]; then ENABLE_SANITIZE="" diff --git a/contrib/verify_value_string_arrays_are_terminated.py b/contrib/verify_value_string_arrays_are_terminated.py deleted file mode 100755 index 020bb4d..0000000 --- a/contrib/verify_value_string_arrays_are_terminated.py +++ /dev/null @@ -1,33 +0,0 @@ -#!/usr/bin/env python3 -# vim: expandtab tabstop=2 shiftwidth=2 nocin - -''' -Usage: - verify_value_string_arrays_are_terminated.py PATH [PATH [...]] - -e.g. -libosmocore/contrib/verify_value_string_arrays_are_terminated.py $(find . -name "*.[hc]") -''' - -import re -import sys -import codecs - -value_string_array_re = re.compile( - r'((\bstruct\s+value_string\b[^{;]*?)\s*=[^{;]*{[^;]*}\s*;)', - re.MULTILINE | re.DOTALL) - -members = r'(\.(value|str)\s*=\s*)?' -terminator_re = re.compile('{\s*' + members + '(0|NULL)\s*,' - '\s*' + members + '(0|NULL)\s*}') -errors_found = 0 - -for f in sys.argv[1:]: - arrays = value_string_array_re.findall(codecs.open(f, "r", "utf-8").read()) - for array_def, name in arrays: - if not terminator_re.search(array_def): - print('ERROR: file contains unterminated value_string %r: %r' - % (name, f)) - errors_found += 1 - -sys.exit(errors_found) -- To view, visit https://gerrit.osmocom.org/3685 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I513835be2d931d0a931cdfc996f361a451bc1a15 Gerrit-PatchSet: 3 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Fri Aug 25 15:58:20 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Fri, 25 Aug 2017 15:58:20 +0000 Subject: libosmocore[master]: Use value string check from osmo-ci In-Reply-To: References: Message-ID: Patch Set 3: N. B: this should be merged last, after all the repos converted to check script from osmo-ci. -- To view, visit https://gerrit.osmocom.org/3685 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I513835be2d931d0a931cdfc996f361a451bc1a15 Gerrit-PatchSet: 3 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Aug 25 16:28:12 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Fri, 25 Aug 2017 16:28:12 +0000 Subject: [PATCH] osmo-hlr[master]: Use release helper from libosmocore Message-ID: Review at https://gerrit.osmocom.org/3689 Use release helper from libosmocore Change-Id: I06b9ceff1e1ecfccc1b1a52ffe6b9d3f6dcaa34d Related: OS#1861 --- M Makefile.am M configure.ac 2 files changed, 6 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-hlr refs/changes/89/3689/1 diff --git a/Makefile.am b/Makefile.am index 0d60cee..392d80d 100644 --- a/Makefile.am +++ b/Makefile.am @@ -10,6 +10,8 @@ .version \ $(NULL) + at RELMAKE@ + BUILT_SOURCES = $(top_srcdir)/.version $(top_srcdir)/.version: echo $(VERSION) > $@-t && mv $@-t $@ diff --git a/configure.ac b/configure.ac index 958b48b..6532940 100644 --- a/configure.ac +++ b/configure.ac @@ -15,6 +15,10 @@ 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]) + dnl checks for programs AC_PROG_MAKE_SET AC_PROG_MKDIR_P -- To view, visit https://gerrit.osmocom.org/3689 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I06b9ceff1e1ecfccc1b1a52ffe6b9d3f6dcaa34d Gerrit-PatchSet: 1 Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Fri Aug 25 16:38:37 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Fri, 25 Aug 2017 16:38:37 +0000 Subject: [PATCH] osmo-sip-connector[master]: Add git review config Message-ID: Review at https://gerrit.osmocom.org/3690 Add git review config Change-Id: I60f6b29998954b0698e523efaa766f8bb895cdf7 --- A .gitreview 1 file changed, 4 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-sip-connector refs/changes/90/3690/1 diff --git a/.gitreview b/.gitreview new file mode 100644 index 0000000..19c01e0 --- /dev/null +++ b/.gitreview @@ -0,0 +1,4 @@ +[gerrit] +host=gerrit.osmocom.org +project=osmo-sip-connector + -- To view, visit https://gerrit.osmocom.org/3690 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I60f6b29998954b0698e523efaa766f8bb895cdf7 Gerrit-PatchSet: 1 Gerrit-Project: osmo-sip-connector Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Fri Aug 25 16:39:22 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Fri, 25 Aug 2017 16:39:22 +0000 Subject: [PATCH] osmo-sip-connector[master]: Use release helper from libosmocore Message-ID: Review at https://gerrit.osmocom.org/3691 Use release helper from libosmocore Change-Id: I1a65695d6191aa7647b9872e58da4a00bbad59e2 Related: OS#1861 --- M .gitignore M Makefile.am M configure.ac 3 files changed, 9 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-sip-connector refs/changes/91/3691/1 diff --git a/.gitignore b/.gitignore index f8fa410..87bed96 100644 --- a/.gitignore +++ b/.gitignore @@ -20,3 +20,5 @@ stamp-h1 osmo-sip-connector +.tarball-version +.version diff --git a/Makefile.am b/Makefile.am index abb1d66..5a2c4a9 100644 --- a/Makefile.am +++ b/Makefile.am @@ -4,6 +4,9 @@ BUILT_SOURCES = $(top_srcdir)/.version EXTRA_DIST = git-version-gen osmoappdesc.py .version + + at RELMAKE@ + $(top_srcdir)/.version: echo $(VERSION) > $@-t && mv $@-t $@ dist-hook: diff --git a/configure.ac b/configure.ac index 1fa6157..35a75b9 100644 --- a/configure.ac +++ b/configure.ac @@ -14,6 +14,10 @@ fi PKG_PROG_PKG_CONFIG([0.20]) +dnl include release helper +RELMAKE='-include osmo-release.mk' +AC_SUBST([RELMAKE]) + dnl kernel style compile messages m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) AC_PROG_CC -- To view, visit https://gerrit.osmocom.org/3691 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I1a65695d6191aa7647b9872e58da4a00bbad59e2 Gerrit-PatchSet: 1 Gerrit-Project: osmo-sip-connector Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Fri Aug 25 17:09:40 2017 From: gerrit-no-reply at lists.osmocom.org (lynxis lazus) Date: Fri, 25 Aug 2017 17:09:40 +0000 Subject: osmo-sip-connector[master]: Add git review config In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/3690 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I60f6b29998954b0698e523efaa766f8bb895cdf7 Gerrit-PatchSet: 1 Gerrit-Project: osmo-sip-connector Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: lynxis lazus Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sat Aug 26 05:52:30 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 26 Aug 2017 05:52:30 +0000 Subject: =?UTF-8?Q?libosmo-abis=5Bmaster=5D=3A_Bump_version=3A_0=2E3=2E2_=E2=86=92_0=2E4=2E0?= In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3595 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ibefe53a7f5b06fb8a9294574af41dacac68bdbe9 Gerrit-PatchSet: 2 Gerrit-Project: libosmo-abis Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sat Aug 26 05:52:36 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 26 Aug 2017 05:52:36 +0000 Subject: =?UTF-8?Q?=5BMERGED=5D_libosmo-abis=5Bmaster=5D=3A_Bump_version=3A_0=2E3=2E2_=E2=86=92_0=2E4=2E0?= In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Bump version: 0.3.2 ? 0.4.0 ...................................................................... Bump version: 0.3.2 ? 0.4.0 Change-Id: Ibefe53a7f5b06fb8a9294574af41dacac68bdbe9 --- M TODO-RELEASE M debian/changelog M src/Makefile.am 3 files changed, 18 insertions(+), 8 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/TODO-RELEASE b/TODO-RELEASE index 128778a..d0852fc 100644 --- a/TODO-RELEASE +++ b/TODO-RELEASE @@ -1,4 +1,9 @@ +# When cleaning up this file: bump API version in corresponding Makefile.am and rename corresponding debian/lib*.install +# according to https://www.gnu.org/software/libtool/manual/html_node/Updating-version-info.html#Updating-version-info +# In short: +# LIBVERSION=c:r:a +# If the library source code has changed at all since the last update, then increment revision: c:r + 1:a. +# If any interfaces have been added, removed, or changed since the last update: c + 1:0:0. +# If any interfaces have been added since the last public release: c:r:a + 1. +# If any interfaces have been removed or changed since the last public release: c:r:0. #library what description / commit summary line -libosmo-abis API change major: add parameter to rx_cb() callack in osmo_ortp.h -libosmo-abis API change major: add parameter to struct input_signal_data -libosmo-abis API change major: add parameters to rx_cb() callack in osmo_ortp.h diff --git a/debian/changelog b/debian/changelog index b2cf0e9..13c0996 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,8 +1,12 @@ -libosmo-abis (0.3.3) UNRELEASED; urgency=medium +libosmo-abis (0.4.0) unstable; urgency=medium * Move forward towards a new release. + * libosmo-abis API change major: add parameter to struct + input_signal_data + * libosmo-trau API change major: add parameters to rx_cb() + callack in osmo_ortp.h - -- Holger Hans Peter Freyther Tue, 24 May 2016 23:02:47 +0200 + -- Holger Hans Peter Freyther Fri, 25 Aug 2017 16:09:46 +0200 libosmo-abis (0.3.2) unstable; urgency=medium diff --git a/src/Makefile.am b/src/Makefile.am index 760c1f5..7395d17 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -1,7 +1,8 @@ # This is _NOT_ the library release version, it's an API version. -# Please read Chapter 6 "Library interface versions" of the libtool documentation before making any modification -ABIS_LIBVERSION=5:0:0 -TRAU_LIBVERSION=1:0:0 +# Please read chapter "Library interface versions" of the libtool documentation +# before making any modifications: https://www.gnu.org/software/libtool/manual/html_node/Versioning.html +ABIS_LIBVERSION=6:0:0 +TRAU_LIBVERSION=2:0:0 AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include -I$(top_builddir) AM_CFLAGS= -Wall $(LIBOSMOCORE_CFLAGS) $(LIBOSMOGSM_CFLAGS) $(LIBOSMOVTY_CFLAGS) $(COVERAGE_CFLAGS) -- To view, visit https://gerrit.osmocom.org/3595 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ibefe53a7f5b06fb8a9294574af41dacac68bdbe9 Gerrit-PatchSet: 2 Gerrit-Project: libosmo-abis Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sat Aug 26 05:52:54 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 26 Aug 2017 05:52:54 +0000 Subject: osmo-bts[master]: Add git-version-gen snippet In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3678 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Id1732921ecb768b3c3c4872b82b74ccc3d26cf77 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sat Aug 26 05:53:54 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 26 Aug 2017 05:53:54 +0000 Subject: osmo-bts[master]: Use git-version-gen from gnulib In-Reply-To: References: Message-ID: Patch Set 1: Code-Review-1 we don't do this in any of the osmocom project so far. If you'd like to change that, I think we'd have to discuss it first, and any commit should give a lengthy statement of why we introduce the change. -- To view, visit https://gerrit.osmocom.org/3679 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I290acecbbb91f5ee713a035d07e23e7d5c0cf03c Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sat Aug 26 05:54:11 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 26 Aug 2017 05:54:11 +0000 Subject: =?UTF-8?Q?osmo-bts=5Bmaster=5D=3A_Bump_version=3A_0=2E5=2E0_=E2=86=92_0=2E6=2E0?= In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3598 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I613d09ae0f9f0aa67be1dc6015da1fb9314110fd Gerrit-PatchSet: 2 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sat Aug 26 05:54:29 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 26 Aug 2017 05:54:29 +0000 Subject: =?UTF-8?Q?=5BMERGED=5D_osmo-bts=5Bmaster=5D=3A_Bump_version=3A_0=2E5=2E0_=E2=86=92_0=2E6=2E0?= In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Bump version: 0.5.0 ? 0.6.0 ...................................................................... Bump version: 0.5.0 ? 0.6.0 Change-Id: I613d09ae0f9f0aa67be1dc6015da1fb9314110fd --- M debian/changelog 1 file changed, 482 insertions(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/debian/changelog b/debian/changelog index 5c2d203..61c46c6 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,485 @@ -osmo-bts (0.5.0) UNRELEASED; urgency=medium +osmo-bts (0.6.0) unstable; urgency=medium + + [ Holger Hans Peter Freyther ] + * Initial release. + * misc: Ignore files generated by a debian packaging build + * jenkins: Add the build script from jenkins here + * jenkins: Add the build script from jenkins here + * sysmobts: Add the barebox boot state reservation + * sysmobts: Fix eeprom padding before gpg key + * ci/spatch: Remove the "static" analysis handling + * oct: Attempt to enable the Octphy for the osmo-bts-oct build + * debian: Use the header files installed by openbsc-dev + * build: Do not require more headers from OpenBSC + * sysmobts: Make reservation for mode/netmask/ip and suc + * sysmobts: Store a simple network config in the EEPROM as well + + [ Max ] + * Ensure TRX invariant + * Use libosmocore function for uplink measurements + * Fix debug output + * Fix RTP timestamps in case of DTX + * Add DTXd support for sysmoBTS and LC15 + * Use libosmocodec for AMR RTP + * octphy: Use the app. info. defaults as base + * Fix debug output + * DTXd: store/repeat last SID + * DTXd: store/repeat last SID + * DTXu: mark beginning of speech burst in RTP + * Fix OML activation + * TRX: Add vty command to power on/off transceiver + * TRX: add configuration example + * Add .gitreview + * DTX: add support for AMR/HR + * Move copy-pasted code into common part + * Use libosmocodec functions for AMR + * Use error values instead of number for RSL error + * Clarify logging message + * Make get_lchan_by_chan_nr globally available + * DTXu: move copy-pasted code to common part + * Remove duplicated nibble shift code + * TRX: add Uplink DTX support for FR/HR + * Mark array as static const + * sysmobts: dump PRACH and PTCCH parameters + * Activate PTCCH UL + * Fix dsp tracing at phy config + * octphy: fix build + * Fill measurements data for L1SAP + * sysmo: ts_connect: log channel combination name instead of number + * DTX: fix last SID saving + * DTX: fix SID repeat scheduling + * DTX: fix SID logic + * lc15, sysmo: Use SID_FIRST_P1 to initiate DTX + * DTX: check Marker bit to send ONSET to L1 + * DTX: remove misleading comment + * LC15: Clarify msgb ownership / fix memory leaks + * DTX: move scheduling check inside repeat_last_sid + * DTX: further AMR SID cache fixes (lc15, sysmo) + * DTX: move ONSET detection into separate function + * DTX: send AMR voice alongside with ONSET + * DTX: fix conversion from fn to ms + * Move copy-pasted array into shared header + * DTX DL: use FSM for AMR + * TRX: fix building with latest DTX changes + * DTX: fix array size calculation + * DTX AMR - fix buffer length check + * Replace magic number with define + * Fix lc15 build + * Extend RTP RX callback parameters + * DTX HR - fix array size calculation + * Fix DTX DL AMR SIDscheduling logic + * Add tools to check DTX operation + * DTX DL: split ONSET state handling + * Remove obsolete define + * DTX DL: add AMR HR support to scheduling check + * DTX fix ONSET handling + * dtx_check.gawk: Fix false-positives in DTX check + * Fix tests linking with libosmocodec + * DTX DL: tighten check for enabled operation + * DTX: wrap FSM signal dispatching + * Add libosmocodec for octphy build + * dtx_check.gawk: add check for repetitive SID FIRST + * Remove duplicated code + * Replace link_id constant with define + * DTX DL AMR: rewrite FSM recursion + * Remove duplicated code + * Fix AGCH/PCH proportional allocation + * TRX: prevent segfault upon phy init + * DTX: add explicit check if DTX enabled + * Save RTP metadata in Control Buffer + * osmo-bts-trx: fix lchan deactivation + * DTX: fix TS adjustment for ONSET + * Optionally use adaptive RTP jitter buffering + * Integrate Debian packaging changes + * DTX AMR HR: fix inhibition + * Add copyright for .deb packages + * Move code to libosmocore + * Log socket path on error + * Add Abis OML failure event reporting + * Alarm on various errors + * Remove obsolete define TLVP_PRES_LEN + * scheduler: log lchan on which prim error occured + * deb: use gsm_data_shared.* from openbsc-dev + * OML: internalize failure reporting + * Add ctrl command to send OML alert + * Fix typo in TCH/H interleaving table + * Use oml-alert CTRL command for temp report + * Remove code duplication + * Handle ctrl cmd allocation failures + * Check for suitable lchan type when detecting HO + * osmo-bts-trx: fix scheduling of broken frames + * Sync protocol with OsmoPCU + * vty: reduce code duplication + * Handle TXT indication from OsmoPCU + * Add MS TO to RSL measurements + * Signal to BSC when PCU disconnects + * Prepare for extended SI2quater support + * Set BTS variant while initializing BTS model + * Prepare for BTS attribute reporting via OML + * osmo-bts-trx: use libosmocoding + * Remove redundant test + * Implement basic Get Attribute responder + * Add version to phy_instance + * OML: fix Coverity-reported issues + * Re-add version to phy_instance + * Use systemd template specifiers + * Place *-mgr config examples according to BTS model + * lc15: add example systemd service file + * Extend Get Attribute responder + * Set and report BTS features + * Cleanup SI scheduling + * RSL: receive and send multiple SI2q messages + * RSL: check for abnormal SI2q values + * lc15bts-mgr: use extended config file example + * Move parameter file opening into separate function + * Move common steps into common jenkins helper + * lc15: add jenkins helper + * Use generic L1 headers helper + * Copy sysmobts.service to osmo-bts-sysmo + * OML: move BTS number check into separate function + * lc15: make jenkins helper executable + * lc15: fix jenkins build + * Add missing include for abis.h header file + * RSL: receive and send multiple SI2q messages + * Use release helper from libosmocore + * si2q: do not consider count update as error + * Cleanup example config files + * Fix .deb build + * Unify *.service files + * lc15: cleanup board parameters reading + * lc15-mgr: update parameter read/write + * lc15: fix BTS revision and hw options + * lc15: make default config usable + * lc15: port lc15bts-mgr changes + * lc15bts-mgr: separate service file + * lc15: port lc15bts-mgr dependency changes + * Simplify jenkins build scripts + * OML: use fom_hdr while handling attr. request + * osmo-bts-trx: fix 'osmotrx legacy-setbsic' + * osmo-bts-trx: remove global variables from loops + + [ Daniel Laszlo Sitzer ] + * octphy: Update outdated config param name in error message. + + [ Jason DSouza ] + * Close TRX session before opening new one + + [ Minh-Quang Nguyen ] + * l1sap.h: fix wrong L1SAP_FN2PTCCHBLOCK calculation according to TS 45.002 Table 6 + * common/abis.c: fix 100% CPU usage after disconnecting OML/RSL link (Bug #1703) + * LC15: Bring back DSP trace argument + * LC15: Hardware changes + * LC15: TRX nominal TX power can be used from EEPROM or from BTS configuration + * rsl: Fix dropping of LAPDm UA message. + * LC15: properly handle BS-AG-BLKS-RES as received from BSC + + [ Neels Hofmeyr ] + * sysmo: add L3 handle to l1prim messages + * pcu_sock: add pcu_connected() to query PCU availability + * tests/stubs.c: remove unused stubs + * fix typo in error message ('at lEast') + * oml, Set Chan Attr: treat unknown PCHAN types as error + * dyn PDCH: rsl rx dchan: also log ip.access message names + * doc: add ladder diagram on dynamic PDCH, add msc-README + * add missing DSUM entry to bts_log_info_cat + * fix compiler warning: printf format for sizeof() + * fix compiler warning: add missing case (PHY_LINK_CONNECTING) + * fix two compiler warnings: add two opaque struct declarations + * dyn PDCH: add bts_model_ts_connect() and _disconnect() stubs + * dyn PDCH: conf_lchans_for_pchan(): handle TCH/F_PDCH + * dyn PDCH: pcu_tx_info_ind(): handle TCH/F_PDCH in PDCH mode + * dyn PDCH: chan_nr_by_sapi(): handle TCH/F_PDCH according to ts->flags + * dyn PDCH: implement main dyn PDCH logic in common/ + * dyn PDCH: sysmo-bts/oml.c: add ts_connect_as(), absorbing ts_connect() guts + * dyn PDCH: sysmo: handle TCH/F_PDCH init like TCH/F + * dyn PDCH: complete for sysmo-bts: implement bts_model_ts_*() + * error log: two minor clarifications + * debug log: log lchan state transitions + * debug log: log TS pchan type on connect + * fix lc15 build: put src/common/libbts.a left of -losmogsm + * lc15: add L3 handle to l1prim messages + * dyn PDCH: lc15: chan_nr_by_sapi(): handle TCH/F_PDCH according to ts->flags + * dyn PDCH: lc15: add ts_connect_as(), absorbing ts_connect() guts + * dyn PDCH: lc15: handle TCH/F_PDCH init like TCH/F + * dyn PDCH: lc15: complete for litecell15-bts: implement bts_model_ts_*() + * dyn PDCH: safeguard: exit if nothing pending in dyn_pdch_ts_disconnected() + * vty: install orphaned trx nominal power command + * fix compiler warnings: include bts_model.h in phy_link.c + * fix compiler warning: remove useless 'static' storage class for struct decl + * fix compiler warning: remove unused variable 'i' in calib_verify() + * log: osmo-bts-trx: change access burst logs to DEBUG level + * log: osmo-bts-trx: change PDTCH block logs to DEBUG level + * osmo-bts-trx: init OML only once by sending AVSTATE_OK with OPSTATE_ENABLED + * doc: move dyn_pdch.msc to osmo-gsm-manuals.git + * error log: rsl.c: typo x2 + * info log: l1sap.c: add '0x' to hex output + * fix compiler warning: msg_utils.c: fn_chk() constify arg + * fix compiler warning: msg_utils.c: fn_chk() constify arg + * info log: l1sap.c: add '0x' to hex output + * error log: rsl.c: typo x2 + * dyn PDCH: code dup: use conf_lchans_as_pchan() + * prepare dyn TS: split/replace conf_lchans_for_pchan() + * code dup: join [rsl_]lchan_lookup() from libbsc and osmo-bts + * dyn TS: common TCH/F_TCH/H_PDCH implementation + * sysmo/oml.c: rename ts_connect() to ts_opstart() + * dyn TS: implement SysmoBTS specifics + * lc15/oml.c: rename ts_connect() to ts_opstart() + * dyn TS: implement litecell15 specifics + * comment typo: common/l1sap.c + * log typo: trx_sched_set_pchan() + * dyn TS: sysmo,lc15: chan_nr_by_sapi(): add missing assertion + * fix comment in common/l1sap.c, function name changed + * dyn TS, dyn PDCH: common/l1sap.c: properly notice PDCH + * dyn PDCH: trx l1_if.c: factor out trx_set_ts_as_pchan() from trx_set_ts() + * dyn PDCH: complete for trx: implement bts_model_ts_[dis]connect() + * dyn PDCH: trx l1_if.c: drop fixme, add comment + * dyn TS: complete for TRX + * dyn TS: measurement.c: replace fixme with comment + * sysmo,lc15: ts_connect_as(): log error also for pchan_as == TCH/F_PDCH + * sysmo: fix dyn TS: Revert "Activate PTCCH UL" [in sysmobts] + * log: l1sap: add 0x to hex output of chan_nr, 5 times + * dyn TS: measurement: use correct nr of subslots, rm code dup + * dyn TS: sysmo,lc15: ph_data_req: fix PDCH mode detection + * Fix ip.access style dyn PDCH, broken in 37af36e85eca546595081246aec010fa7f6fd0be + * common/rsl: move decision whether to chan act ack/nack to common function + * octphy: fix build: Revert "octphy: fix for multiple trx with more than 1 dsp" + * octphy: fix build: Revert "octphy: add support for multiple trx ids" + * octphy: fix build with OCTSDR-OPENBSC-02.07.00-B708: name changed + * dyn TS: if PCU is not connected, allow operation as TCH + * log: sysmo,lc15: tweak log about sapi_cmds queue + * log causing rx event for lchan_lookup errors + * heed VTY 'line vty'/'bind' command + * sysmobts_mgr, lc15bts_mgr: fix tall context for telnet vty + * build: be robust against install-sh files above the root dir + * configure: check for pkg-config presence + * jenkins.sh: use osmo-build-dep.sh, log test failures + * msgb ctx: use new msgb_talloc_ctx_init() in various main()s + * jenkins-oct.sh: fix build: typo in deps path + * fix 'osmo-bts-* --version' segfault + * osmo-bts-trx: remove obsolete include of netif/rtp.h + * add jenkins_bts_trx.sh + * add jenkins_oct_and_bts_trx.sh + * jenkins: add jenkins_bts_model.sh + * bursts test: test_pdtch: pre-init result mem + * fix: dyn ts: uplink measurement report + * fix missing ~ in bit logic for lchan->si.valid in rsl_rx_sacch_inf_mod() + * SACCH: fix sending of SI with an enum value > 7 + * SACCH SI: assert that SI enum vals fit in bit mask + * all models: fix vty write: bts_model_config_write_phy + * jenkins: add value_string termination check + * Revert "Add version to phy_instance" + * Revert "RSL: check for abnormal SI2q values" + * Revert "RSL: receive and send multiple SI2q messages" + + [ Harald Welte ] + * sysmobts: screnrc/systemd-service: Use osmo-bts-sysmo instead of sysmobts + * Add .mailmap for mapping mail addresses in shortlog + * vty: Ensure to not use negative (error) sapi value + * sysmobts: Add correct nominal transmit power for sysmoBTS 1020 + * sysmobts_eeprom.h: Fix/extend model number definitions + * Revert "sysmobts: Add correct nominal transmit power for sysmoBTS 1020" + * tx_power: Change PA calibration tables to use delta vales + * Add new unit-test for transmit power computation code + * sysmobts: fully support trx_power_params + * README: Add general project information and convert to markdown + * README: update some of the limitations + * sysmobts: Don't start with 0dBm TRX output power before ramping + * Remove unusued left-over gsm0503_conv.c + * scheduler_trx.c: Avoid code duplication for BER10k computation + * scheduler_trx: Avoid copy+pasting determining CMR from FN + * rx_tchh_fn(): Avoid copy+pasting formula to determine odd-ness of fn + * Consistently check for minimum attribute/TLV length in RSL and OML + * l1sap.c: Add spec reference to link timeout implementation + * osmo-bts-trx: Remove duplicate parsing of NM_ATT_CONN_FAIL_CRIT + * vty: Remove command for manual channel activation/deactivation + * l1_if: Add inline functions to check dsp/fgpa version at runtime + * sysmobts: Re-order the bit-endianness of every HR codec parameter + * OML Add osmocom-specific way to deactivate radio link timeout + * measurement: Remove dead code + * l1sap.c: Factor out function to limit message queue + * osmo-bts-sysmo/l1_if.c: PH-DATA.ind belongs to L1P, not L1C + * l1sap: if lchan is in loopback, don't accept incoming RTP + * TRX: Use timerfd and CLOCK_MONOTONIC for GSM frame timer (Closes: #2325) + * Add loopback support for PDTCH + * TRX: trx_if: Improve code description / comments + * trx_if: Improve error handling + * TRX: Rename trx_if_data() -> trx_if_send_burst() + * TRX: merge/simplify l1_if and trx_if code + * TRX: don't free l1h in trx_phy_inst_close() + * l1sap: Don't enqueue PTCCH blocks for loopback + * TRX: permit transmission of all-zero loopback frames + * jenkins helpers: some minimal documentation/comments + print errors + * VIRT-PHY: Initial check-in of a new virtual BTS + * VIRT-PHY: Fix handling of default values for vty configuration + * VIRT-PHY: Use IPv4 multicast groups for private / local scope + * VIRT-PHY: cause BTS to terminate in case of recv()/send() on udp socket returns 0 + * Ensure we don't send dummy UI frames on BCCH for TC=5 + * virt: Don't print NOTICE log message if ARFCN doesn't match + * VIRT-PHY: Report virtual RACH bursts with plausible burst type + * scheduler: Fix wrong log subsystem: L1C is L1 *control* not user data + * VIRT-PHY: Print NOTICE log message from unimplemented stubs + * TRX / VIRT-PHY: Make check for BCCH/CCCH more specific + * L1SAP: Print chan_nr and link_id always as hex + * VIRT-BTS: Support for GPRS + * L1SAP: Use RSL_CHAN_OSMO_PDCH across L1SAP + * GSMTAP: Don't log fill frames via GSMTAP + * TRX: Remove bogus extern global variable declarations + * l1sap/osmo-bts-sysmo: Improve logging + * TRX: Remove global variables, move SETBSIC/SETTSC handling into phy_link + * Fix build after recent gsm_bts_alloc() change + * Treat SIGTERM just like SIGINT in our programs + + [ Tom Tsou ] + * trx: Add EGPRS tables, sequences, and mappings + * trx: Add EGPRS coding and decoding procedures + * trx: Enable EGPRS handling through burst lengths + * trx: Fix coverity BER calculation NULL dereference + + [ Vadim Yanitskiy ] + * pcu_sock: use osmo_sock_unix_init() from libosmocore + * osmo-bts-trx/l1_if.c: use channel combination III for TCH/H + * scheduler_trx.c: strip unused variable + + [ Mike McTernan ] + * osmo-bts-trx: Fix PCS1900 operation + * osmo-bts-trx: log decoder bit errors as DEBUG, not NOTICE + + [ bhargava ] + * Change interface in osmo-bts for 11 bit RACH + * Update parameters in osmo-bts-sysmo for 11bit RACH + * 11bit RACH support for osmo-bts-litecell15 + * Initialize parameters in osmo-trx for 11bit RACH + + [ Philipp ] + * octphy: Fixing missing payload type in ph. chan. activation + * octphy: Fixing band selection for ARFCN 0 + * octphy: reintroducing multi-trx support + * octopy: fixing renamed constant + * octphy: prevent mismatch between dsp-firmware and octphy headers + * rsl: improving the log output + * octphy: multi-trx support: fix AC_CHECK order + * RSL: drop obsolete NULL check + * RSL: add assertions to check args of public API + * OML: fix possible segfault: add NULL check in oml_ipa_set_attr() + * CTRL: make the CTRL-Interface IP address configurable + * l1sap: Fix expired rach slot counting + * l1sap: fix missing 'else's causing wrong rach frame expiry counts + * octphy: set tx attenuation via VTY + * octphy: Improve OML ADM state handling + + [ Yves Godin ] + * DTX: fix 1st RTP packet drop + + [ Alexander Chemeris ] + * l1sap: Fix use-after-free in loopback mode. + * vty: Add commands to manually activate/deactivate a channel. + * trx: Add "maxdlynb" VTY command to control max TA for Normal Bursts. + * rsl: Output RTP stats before closing the socket. + * osmo-bts-trx: Fix MS power control loop. + * osmo-bts-trx: Remove an unused variable. Resolves a compiler warning. + * osmo-bts-trx: Increase a maximum allowed MS power reduction step from 2dB to 4dB. + * Fix static build of osmo-bts-trx and osmo-bts-virtual. + + [ Jean-Francois Dionne ] + * DTX: don't always perform AMR HR specific check + * DTX: fix SID-FIRST detection + * lc15,sysmobts l1_if: fix memleak in handle_mph_time_ind() + * sysmo,lc15: fix memory leak at each call placed + * DTX: fix "unexpected burst" error + * Fix AMR HR DTX FSM logic. + * Fix SACCH channel release indication not sent to BSC after location update. + * Fix RTP duration adjustment not done when speech resumes in DTX mode. + + [ Ruben Undheim ] + * Fix some spelling errors + + [ Holger Freyther ] + * Revert "deb: use gsm_data_shared.* from openbsc-dev" + + [ Philipp Maier ] + * octphy VTY: fix vty write output for octphy's phy section + * octphy: Fix VTY commands + * l1sap: fix rach reason (ra) parsing + * l1sap: fix PTCCH detection + * octphy: fix usage of wrong define constant + * octphy: add CBCH support + * l1sap: improve log output + * octphy: print log message for multi-trx support + * octphy: display hint in case of wrongly configured transceiver number + * octphy: add conditional compilation to support latest octasic header release + * octphy: set tx/rx antenne IDs via VTY + * bts: revert trx shutdown order + * octphy: activate CBCH after all physical channels are activated + * octphy: align frame number for new firmware versions + * octphy: ensure that 11 bit rach flag is not set + * measurement: fix measurement reporting period + * measurement: make lchan_meas_check_compute() available to l1sap.c + * measurement: Compute measurement results on measurement idication + * measurement: exclude idle channels from uplink measurement + * octphy: integrate channel measurement handling + * octphy: remove old event control code + * osmo-bts-sysmo: Include frame number in MEAS IND + * measurement: fix measurement computation + * octphy: fix segfault + * Revert "measurement: exclude idle channels from uplink measurement" + * sysmobts: normalize frame number in measurement indication + * measurement: Improve log output + * measurement: improve log output + * octphy: improve log output + * octphy: initalize l1msg and only when needed + * octphy: initalize nmsg only when needed + * octphy: remove log output + * Revert "sysmobts: normalize frame number in measurement indication" + * osmo-bts-trx: fix missing frame number in MEAS IND + * osmo-bts-litecell15: Fix missing frame number in MEAS IND + * Revert "osmo-bts-sysmo: Include frame number in MEAS IND" + * octphy: complete value strings (octphy_cid_vals) + * octphy: do not send empty frames to phy + * osmo-bts-sysmo: Include frame number in MEAS IND + * measurement: fix measurment report + * octphy: remap frame number in MEAS_IND + * octphy: implement support for dynamic timeslots + + [ Ivan Klyuchnikov ] + * osmo-trx-bts: Fix incorrect setting of RXGAIN and POWER parameters on second channel (TRX1) of osmo-trx + * osmo-trx-bts: Fix osmo-bts-trx crash on startup during reading phy instance parameters from config file + * osmo-trx-bts: Fix incorrect bts shutdown procedure in case of abis connection closure + * osmo-trx-bts: Fix incorrect bts shutdown procedure in case of clock loss from osmo-trx + + [ Ivan Kluchnikov ] + * oml: Fix incorrect usage of const variable abis_nm_att_tlvdef_ipa + + [ Pau Espin Pedrol ] + * phy_link: Fix typo in state being printed + * trx: Allow BTS and TRX to be on different IPs + * trx: Save osmotrx base-port vty properties + * sysmo/tch.c: Clean up use of empty buffer + * litecell15/tch.c: Clean up use of empty buffer + * Use L1P instead of L1C for TCH logging and allocation + * Fix annoying trailing whitespace + * sysmo, litecell15: Make sure all TCH events are triggered + * sysmo: Remove non longer valid -p option from help + * Allow passing low link quality buffers to upper layers + * l1sap.c: Avoid sending RTP frame with empty payload + * l1sap.c: fn_ms_adj: Add err logging and always return GSM_RTP_DURATION + * Move dump_gsmtime to libosmocore as osmo_dump_gsmtime + * Use osmo_dump_gsmtime to log fn across different layers + * lc15bts-mgr.cfg: Set default vswr to a value inside valid range + * litecell15: Register in vty limits for paX_pwr + * lc15: Tweak led colors used in service file + * lc-15, sysmo: l1_if: print name on PH-DATA.ind unknwon sapi + * lc15bts-mgr.service: Prepare dirs and sysctls for the process + * osmo-bts-trx: Enable osmotrx tx-attenuation oml by default + * osmo-bts-trx: Relax validation to allow TRX data bursts without padding + + [ Sebastian Stumpf ] + * VIRT-PHY: Added example configurations for openbsc and osmobts. + * VIRT-PHY: Fixed timeslot in gsmtap-msg on downlink which was always 0. + * VIRT-PHY: Added test option for fast hyperframe repeat. + + -- Max Fri, 25 Aug 2017 15:16:56 +0200 + +osmo-bts (0.5.0) unstable; urgency=medium * Initial release. -- To view, visit https://gerrit.osmocom.org/3598 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I613d09ae0f9f0aa67be1dc6015da1fb9314110fd Gerrit-PatchSet: 2 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sat Aug 26 05:54:31 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 26 Aug 2017 05:54:31 +0000 Subject: [MERGED] osmo-bts[master]: Add git-version-gen snippet In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Add git-version-gen snippet ...................................................................... Add git-version-gen snippet Change-Id: Id1732921ecb768b3c3c4872b82b74ccc3d26cf77 Related: OS#1861 --- M Makefile.am 1 file changed, 8 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/Makefile.am b/Makefile.am index 5c1add6..4832c84 100644 --- a/Makefile.am +++ b/Makefile.am @@ -15,6 +15,14 @@ doc/examples/sysmo/sysmobts-mgr.cfg \ doc/examples/virtual/openbsc-virtual.cfg \ doc/examples/virtual/osmobts-virtual.cfg \ + git-version-gen .version \ README.md @RELMAKE@ + +BUILT_SOURCES = $(top_srcdir)/.version + +$(top_srcdir)/.version: + echo $(VERSION) > $@-t && mv $@-t $@ +dist-hook: + echo $(VERSION) > $(distdir)/.tarball-version -- To view, visit https://gerrit.osmocom.org/3678 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Id1732921ecb768b3c3c4872b82b74ccc3d26cf77 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sat Aug 26 05:55:00 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 26 Aug 2017 05:55:00 +0000 Subject: osmo-ci[master]: jenkins: Copy Dockerfile and script from buildhost In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 Verified+1 -- To view, visit https://gerrit.osmocom.org/3675 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Icb0406f96b0c18e77be51ad8317c2668fb23a45e Gerrit-PatchSet: 1 Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Owner: Holger Freyther Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: neels Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sat Aug 26 05:55:03 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 26 Aug 2017 05:55:03 +0000 Subject: [MERGED] osmo-ci[master]: jenkins: Copy Dockerfile and script from buildhost In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: jenkins: Copy Dockerfile and script from buildhost ...................................................................... jenkins: Copy Dockerfile and script from buildhost We are not using the Docker registry due difficult GPL compliance but build the image on the build node itself. After prototyping if containers can be used for building these files remained forked on the node. These days it seems to be easier to complain than to say thank you that this new approach has its merits. Copy the files from the build slave to the directory they should have been in. Change-Id: Icb0406f96b0c18e77be51ad8317c2668fb23a45e --- A docker/Dockerfile_osmocom_jenkins.amd64 A docker/rebuild_osmocom_jenkins_image.sh 2 files changed, 71 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved; Verified diff --git a/docker/Dockerfile_osmocom_jenkins.amd64 b/docker/Dockerfile_osmocom_jenkins.amd64 new file mode 100644 index 0000000..8f33233 --- /dev/null +++ b/docker/Dockerfile_osmocom_jenkins.amd64 @@ -0,0 +1,69 @@ +FROM debian:jessie + +RUN dpkg --add-architecture i386 && \ + DEBIAN_FRONTEND=noninteractive apt-get update && \ + DEBIAN_FRONTEND=noninteractive apt-get upgrade -y && \ + DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends wget make + +RUN DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends gcc g++ make git +RUN DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends sudo +RUN DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends unzip bzip2 python + +# match the outside user +RUN useradd --uid=1000 build +#RUN echo "build ALL=(ALL) NOPASSWD:ALL" > /etc/sudoers.d/build + +RUN mkdir /build +RUN chown build:build /build + +# still generic +RUN DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends doxygen git asciidoc rsync coccinelle + +# for GNU smalltalk +RUN DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends flex bison libsigsegv-dev libffi-dev texinfo + +# libosmo-sccp/abis/etc +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 + +# building +RUN DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends libtool pkg-config automake autoconf + +# Linux kernel +RUN DEBIAN_FRONTEND=noninteractive apt-get install -y bc + +# and all +RUN DEBIAN_FRONTEND=noninteractive apt-get install -y doxygen g++ libtalloc-dev libpcsclite-dev make gcc pkgconf libtool autoconf autoconf-archive automake libortp-dev asciidoc mscgen git libsctp-dev libpcap-dev osc libc-ares-dev libgps-dev libsofia-sip-ua-glib-dev libssl-dev libsqlite3-dev libusb-dev libffi-dev libfftw3-dev flex bison libdbi-dev libsnmp-dev libncurses5-dev libgsm1-dev python-minimal python3 libdbd-sqlite3 cppcheck htop libgmp-dev gawk texinfo flex bison bc libsigsegv-dev libffi-dev libusb-1.0-0-dev libreadline-dev debhelper devscripts gcc-arm-none-eabi git-buildpackage dh-systemd dh-autoreconf bc openssh-client + +RUN git clone git://git.osmocom.org/python/osmo-python-tests && cd osmo-python-tests && python2 ./setup.py install # 2017-03-06 + + +RUN echo "#!/bin/sh \n\ + \n\ +if ! test -d \$1; \n\ +then \n\ + git clone git://git.osmocom.org/\$1 \$1 \n\ +fi \n\ +\n\ +cd \$1 \n\ +git fetch origin \n\ +git reset --hard origin/master" > /usr/local/bin/osmo-deps.sh +RUN chmod +x /usr/local/bin/osmo-deps.sh + + +RUN git clone http://git.savannah.gnu.org/r/smalltalk.git +RUN DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends flex libsigsegv-dev bison libgmp-dev texinfo zip libltdl-dev +RUN cd smalltalk && autoreconf --install --force && ./configure && make install +RUN rm -rf smalltalk +RUN git clone https://github.com/zecke/petitparser.git && cd petitparser && gst-package package.xml +RUN git clone https://github.com/zecke/petitparser-tests.git && cd petitparser-tests && gst-package package.xml +RUN git clone git://git.osmocom.org/smalltalk/osmo-st-logging && cd osmo-st-logging && gst-package package.xml +RUN git clone git://git.osmocom.org/smalltalk/osmo-st-core && cd osmo-st-core && gst-package package.xml +RUN git clone git://git.osmocom.org/smalltalk/osmo-st-network && cd osmo-st-network && gst-package package.xml +RUN git clone git://git.osmocom.org/smalltalk/osmo-st-gsm && cd osmo-st-gsm && gst-package --test package.xml +RUN git clone git://git.osmocom.org/smalltalk/osmo-st-openbsc-test && cd osmo-st-openbsc-test/fakebts && gst-package --test package.xml +RUN rm -rf petitparser petitparser-tests osmo-st-logging ost-st-core osmo-st-network osmo-st-gsm osmo-st-openbsc-test +RUN DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends python-pip +RUN pip install timeout_decorator diff --git a/docker/rebuild_osmocom_jenkins_image.sh b/docker/rebuild_osmocom_jenkins_image.sh new file mode 100755 index 0000000..4b2d359 --- /dev/null +++ b/docker/rebuild_osmocom_jenkins_image.sh @@ -0,0 +1,2 @@ +#!/bin/sh +docker build -t osmocom:amd64 - < Dockerfile_osmocom_jenkins.amd64 -- To view, visit https://gerrit.osmocom.org/3675 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Icb0406f96b0c18e77be51ad8317c2668fb23a45e Gerrit-PatchSet: 1 Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Owner: Holger Freyther Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: neels From gerrit-no-reply at lists.osmocom.org Sat Aug 26 05:55:32 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 26 Aug 2017 05:55:32 +0000 Subject: [MERGED] osmo-ci[master]: scripts: add requirements.txt to list jenkins-job-builder In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: scripts: add requirements.txt to list jenkins-job-builder ...................................................................... scripts: add requirements.txt to list jenkins-job-builder Change-Id: If25ce84593bbf6a393928a8f4e1670f320c48ca4 --- A scripts/requirements.txt 1 file changed, 1 insertion(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved; Verified diff --git a/scripts/requirements.txt b/scripts/requirements.txt new file mode 100644 index 0000000..6b700dc --- /dev/null +++ b/scripts/requirements.txt @@ -0,0 +1 @@ +jenkins-job-builder -- To view, visit https://gerrit.osmocom.org/3559 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: If25ce84593bbf6a393928a8f4e1670f320c48ca4 Gerrit-PatchSet: 2 Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Owner: lynxis lazus Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Max From gerrit-no-reply at lists.osmocom.org Sat Aug 26 05:55:32 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 26 Aug 2017 05:55:32 +0000 Subject: [MERGED] osmo-ci[master]: osmocom-nightly-nitb-split.yml: schedule the job to be run a... In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: osmocom-nightly-nitb-split.yml: schedule the job to be run at midnight ...................................................................... osmocom-nightly-nitb-split.yml: schedule the job to be run at midnight Change-Id: I0d80e7d260f9092f44d4d80471a4dd67b7acc839 --- M scripts/osmocom-nightly-nitb-split.yml 1 file changed, 3 insertions(+), 1 deletion(-) Approvals: Max: Looks good to me, but someone else must approve Harald Welte: Looks good to me, approved; Verified diff --git a/scripts/osmocom-nightly-nitb-split.yml b/scripts/osmocom-nightly-nitb-split.yml index 6c264fd..7dbf46f 100644 --- a/scripts/osmocom-nightly-nitb-split.yml +++ b/scripts/osmocom-nightly-nitb-split.yml @@ -17,4 +17,6 @@ - git: url: git://git.osmocom.org/osmo-ci git-config-name: 'Jenkins Builder' - git-config-email: 'jenkins at osmocom.org + git-config-email: 'jenkins at osmocom.org' + triggers: + - timed: "@midnight" -- To view, visit https://gerrit.osmocom.org/3558 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I0d80e7d260f9092f44d4d80471a4dd67b7acc839 Gerrit-PatchSet: 2 Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Owner: lynxis lazus Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Max From gerrit-no-reply at lists.osmocom.org Sat Aug 26 05:56:08 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 26 Aug 2017 05:56:08 +0000 Subject: osmo-sip-connector[master]: Add git review config In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3690 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I60f6b29998954b0698e523efaa766f8bb895cdf7 Gerrit-PatchSet: 1 Gerrit-Project: osmo-sip-connector Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: lynxis lazus Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sat Aug 26 05:56:11 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 26 Aug 2017 05:56:11 +0000 Subject: [MERGED] osmo-sip-connector[master]: Add git review config In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Add git review config ...................................................................... Add git review config Change-Id: I60f6b29998954b0698e523efaa766f8bb895cdf7 --- A .gitreview 1 file changed, 4 insertions(+), 0 deletions(-) Approvals: lynxis lazus: Looks good to me, but someone else must approve Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/.gitreview b/.gitreview new file mode 100644 index 0000000..19c01e0 --- /dev/null +++ b/.gitreview @@ -0,0 +1,4 @@ +[gerrit] +host=gerrit.osmocom.org +project=osmo-sip-connector + -- To view, visit https://gerrit.osmocom.org/3690 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I60f6b29998954b0698e523efaa766f8bb895cdf7 Gerrit-PatchSet: 1 Gerrit-Project: osmo-sip-connector Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: lynxis lazus From gerrit-no-reply at lists.osmocom.org Sat Aug 26 05:56:38 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 26 Aug 2017 05:56:38 +0000 Subject: osmo-sip-connector[master]: Use release helper from libosmocore In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3691 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I1a65695d6191aa7647b9872e58da4a00bbad59e2 Gerrit-PatchSet: 1 Gerrit-Project: osmo-sip-connector Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sat Aug 26 05:56:55 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 26 Aug 2017 05:56:55 +0000 Subject: [MERGED] osmo-sip-connector[master]: Use release helper from libosmocore In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Use release helper from libosmocore ...................................................................... Use release helper from libosmocore Change-Id: I1a65695d6191aa7647b9872e58da4a00bbad59e2 Related: OS#1861 --- M .gitignore M Makefile.am M configure.ac 3 files changed, 9 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/.gitignore b/.gitignore index f8fa410..87bed96 100644 --- a/.gitignore +++ b/.gitignore @@ -20,3 +20,5 @@ stamp-h1 osmo-sip-connector +.tarball-version +.version diff --git a/Makefile.am b/Makefile.am index abb1d66..5a2c4a9 100644 --- a/Makefile.am +++ b/Makefile.am @@ -4,6 +4,9 @@ BUILT_SOURCES = $(top_srcdir)/.version EXTRA_DIST = git-version-gen osmoappdesc.py .version + + at RELMAKE@ + $(top_srcdir)/.version: echo $(VERSION) > $@-t && mv $@-t $@ dist-hook: diff --git a/configure.ac b/configure.ac index 1fa6157..35a75b9 100644 --- a/configure.ac +++ b/configure.ac @@ -14,6 +14,10 @@ fi PKG_PROG_PKG_CONFIG([0.20]) +dnl include release helper +RELMAKE='-include osmo-release.mk' +AC_SUBST([RELMAKE]) + dnl kernel style compile messages m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) AC_PROG_CC -- To view, visit https://gerrit.osmocom.org/3691 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I1a65695d6191aa7647b9872e58da4a00bbad59e2 Gerrit-PatchSet: 2 Gerrit-Project: osmo-sip-connector Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sat Aug 26 05:57:10 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 26 Aug 2017 05:57:10 +0000 Subject: osmo-hlr[master]: Use release helper from libosmocore In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3689 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I06b9ceff1e1ecfccc1b1a52ffe6b9d3f6dcaa34d Gerrit-PatchSet: 1 Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sat Aug 26 05:57:13 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 26 Aug 2017 05:57:13 +0000 Subject: [MERGED] osmo-hlr[master]: Use release helper from libosmocore In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Use release helper from libosmocore ...................................................................... Use release helper from libosmocore Change-Id: I06b9ceff1e1ecfccc1b1a52ffe6b9d3f6dcaa34d Related: OS#1861 --- M Makefile.am M configure.ac 2 files changed, 6 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/Makefile.am b/Makefile.am index 0d60cee..392d80d 100644 --- a/Makefile.am +++ b/Makefile.am @@ -10,6 +10,8 @@ .version \ $(NULL) + at RELMAKE@ + BUILT_SOURCES = $(top_srcdir)/.version $(top_srcdir)/.version: echo $(VERSION) > $@-t && mv $@-t $@ diff --git a/configure.ac b/configure.ac index 958b48b..6532940 100644 --- a/configure.ac +++ b/configure.ac @@ -15,6 +15,10 @@ 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]) + dnl checks for programs AC_PROG_MAKE_SET AC_PROG_MKDIR_P -- To view, visit https://gerrit.osmocom.org/3689 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I06b9ceff1e1ecfccc1b1a52ffe6b9d3f6dcaa34d Gerrit-PatchSet: 1 Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sat Aug 26 05:58:13 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 26 Aug 2017 05:58:13 +0000 Subject: libosmocore[master]: Update release helper In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3680 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I413f99cbfa6e6dcc753e3be9fc3c8d682e6a41f3 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sat Aug 26 05:58:30 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 26 Aug 2017 05:58:30 +0000 Subject: libosmocore[master]: Use value string check from osmo-ci In-Reply-To: References: Message-ID: Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3685 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I513835be2d931d0a931cdfc996f361a451bc1a15 Gerrit-PatchSet: 3 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sat Aug 26 05:58:48 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 26 Aug 2017 05:58:48 +0000 Subject: [MERGED] libosmocore[master]: Use value string check from osmo-ci In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Use value string check from osmo-ci ...................................................................... Use value string check from osmo-ci Change-Id: I513835be2d931d0a931cdfc996f361a451bc1a15 --- M contrib/jenkins-arm.sh M contrib/jenkins.sh D contrib/verify_value_string_arrays_are_terminated.py 3 files changed, 4 insertions(+), 36 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/contrib/jenkins-arm.sh b/contrib/jenkins-arm.sh index 510b0e9..ad992af 100755 --- a/contrib/jenkins-arm.sh +++ b/contrib/jenkins-arm.sh @@ -2,7 +2,7 @@ set -ex -./contrib/verify_value_string_arrays_are_terminated.py $(find . -name "*.[hc]") +verify_value_string_arrays_are_terminated.py $(find . -name "*.[hc]") autoreconf --install --force ./configure --enable-static \ diff --git a/contrib/jenkins.sh b/contrib/jenkins.sh index 6a72840..4a26776 100755 --- a/contrib/jenkins.sh +++ b/contrib/jenkins.sh @@ -1,8 +1,9 @@ -#!/usr/bin/env bash +#!/bin/sh +# jenkins build helper script for libosmo-sccp. This is how we build on jenkins.osmocom.org set -ex -./contrib/verify_value_string_arrays_are_terminated.py $(find . -name "*.[hc]") +verify_value_string_arrays_are_terminated.py $(find . -name "*.[hc]") if [ "x$label" = "xFreeBSD_amd64" ]; then ENABLE_SANITIZE="" diff --git a/contrib/verify_value_string_arrays_are_terminated.py b/contrib/verify_value_string_arrays_are_terminated.py deleted file mode 100755 index 020bb4d..0000000 --- a/contrib/verify_value_string_arrays_are_terminated.py +++ /dev/null @@ -1,33 +0,0 @@ -#!/usr/bin/env python3 -# vim: expandtab tabstop=2 shiftwidth=2 nocin - -''' -Usage: - verify_value_string_arrays_are_terminated.py PATH [PATH [...]] - -e.g. -libosmocore/contrib/verify_value_string_arrays_are_terminated.py $(find . -name "*.[hc]") -''' - -import re -import sys -import codecs - -value_string_array_re = re.compile( - r'((\bstruct\s+value_string\b[^{;]*?)\s*=[^{;]*{[^;]*}\s*;)', - re.MULTILINE | re.DOTALL) - -members = r'(\.(value|str)\s*=\s*)?' -terminator_re = re.compile('{\s*' + members + '(0|NULL)\s*,' - '\s*' + members + '(0|NULL)\s*}') -errors_found = 0 - -for f in sys.argv[1:]: - arrays = value_string_array_re.findall(codecs.open(f, "r", "utf-8").read()) - for array_def, name in arrays: - if not terminator_re.search(array_def): - print('ERROR: file contains unterminated value_string %r: %r' - % (name, f)) - errors_found += 1 - -sys.exit(errors_found) -- To view, visit https://gerrit.osmocom.org/3685 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I513835be2d931d0a931cdfc996f361a451bc1a15 Gerrit-PatchSet: 3 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Sat Aug 26 06:00:43 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 26 Aug 2017 06:00:43 +0000 Subject: osmo-bts[master]: Use value string check from osmo-ci In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3681 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I5bce234a5b8133c81b3ea8757e05de56d3aa15d8 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sat Aug 26 06:00:49 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 26 Aug 2017 06:00:49 +0000 Subject: osmo-hlr[master]: Use value string check from osmo-ci In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3687 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I56ea5be60d2a3cf8442f58e1121b13074e2e6a08 Gerrit-PatchSet: 1 Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sat Aug 26 06:00:53 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 26 Aug 2017 06:00:53 +0000 Subject: libosmo-sccp[master]: Use value string check from osmo-ci In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3684 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I1a2223b1a059fbb832948decf11f9237fad389f2 Gerrit-PatchSet: 2 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sat Aug 26 06:00:57 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 26 Aug 2017 06:00:57 +0000 Subject: libosmo-netif[master]: Use value string check from osmo-ci In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3683 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Id6048a69c9e0cc15010de643330aeb2a7271b2a6 Gerrit-PatchSet: 2 Gerrit-Project: libosmo-netif Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sat Aug 26 06:01:00 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 26 Aug 2017 06:01:00 +0000 Subject: openggsn[master]: Use value string check from osmo-ci In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3686 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I036ed452826b9a6848d22d45bdcc95e20a110b8b Gerrit-PatchSet: 1 Gerrit-Project: openggsn Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sat Aug 26 06:01:03 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 26 Aug 2017 06:01:03 +0000 Subject: libosmo-abis[master]: Use value string check from osmo-ci In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3682 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I60d480ce6fb761ac8e15318dbe2c591359a51c3c Gerrit-PatchSet: 1 Gerrit-Project: libosmo-abis Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sat Aug 26 06:10:13 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 26 Aug 2017 06:10:13 +0000 Subject: [MERGED] libosmo-abis[master]: Use value string check from osmo-ci In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Use value string check from osmo-ci ...................................................................... Use value string check from osmo-ci Change-Id: I60d480ce6fb761ac8e15318dbe2c591359a51c3c --- M contrib/jenkins.sh 1 file changed, 2 insertions(+), 2 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/contrib/jenkins.sh b/contrib/jenkins.sh index 769d5a7..6ff44ee 100755 --- a/contrib/jenkins.sh +++ b/contrib/jenkins.sh @@ -16,9 +16,9 @@ mkdir "$deps" || true rm -rf "$inst" -osmo-build-dep.sh libosmocore +verify_value_string_arrays_are_terminated.py $(find . -name "*.[hc]") -"$deps"/libosmocore/contrib/verify_value_string_arrays_are_terminated.py $(find . -name "*.[hc]") +osmo-build-dep.sh libosmocore export PKG_CONFIG_PATH="$inst/lib/pkgconfig:$PKG_CONFIG_PATH" export LD_LIBRARY_PATH="$inst/lib" -- To view, visit https://gerrit.osmocom.org/3682 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I60d480ce6fb761ac8e15318dbe2c591359a51c3c Gerrit-PatchSet: 2 Gerrit-Project: libosmo-abis Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Sat Aug 26 06:10:18 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 26 Aug 2017 06:10:18 +0000 Subject: [MERGED] openggsn[master]: Use value string check from osmo-ci In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Use value string check from osmo-ci ...................................................................... Use value string check from osmo-ci Change-Id: I036ed452826b9a6848d22d45bdcc95e20a110b8b --- M contrib/jenkins.sh 1 file changed, 3 insertions(+), 3 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/contrib/jenkins.sh b/contrib/jenkins.sh index 30416b2..71ba909 100755 --- a/contrib/jenkins.sh +++ b/contrib/jenkins.sh @@ -1,6 +1,8 @@ -#!/usr/bin/env bash +#!/bin/sh set -ex + +verify_value_string_arrays_are_terminated.py $(find . -name "*.[hc]") mkdir deps || true cd deps @@ -12,8 +14,6 @@ $MAKE $PARALLEL_MAKE install cd ../../ - -deps/libosmocore/contrib/verify_value_string_arrays_are_terminated.py $(find . -name "*.[hc]") autoreconf --install --force PKG_CONFIG_PATH=$PWD/deps/install/lib/pkgconfig:$PKG_CONFIG_PATH ./configure -- To view, visit https://gerrit.osmocom.org/3686 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I036ed452826b9a6848d22d45bdcc95e20a110b8b Gerrit-PatchSet: 2 Gerrit-Project: openggsn Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Sat Aug 26 06:10:23 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 26 Aug 2017 06:10:23 +0000 Subject: [MERGED] libosmo-netif[master]: Use value string check from osmo-ci In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Use value string check from osmo-ci ...................................................................... Use value string check from osmo-ci Change-Id: Id6048a69c9e0cc15010de643330aeb2a7271b2a6 --- M contrib/jenkins.sh 1 file changed, 3 insertions(+), 4 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/contrib/jenkins.sh b/contrib/jenkins.sh index 2231efc..3e35a46 100755 --- a/contrib/jenkins.sh +++ b/contrib/jenkins.sh @@ -1,4 +1,4 @@ -#!/usr/bin/env bash +#!/bin/sh # jenkins build helper script for libosmo-netif. This is how we build on jenkins.osmocom.org if ! [ -x "$(command -v osmo-build-dep.sh)" ]; then @@ -17,13 +17,12 @@ mkdir "$deps" || true rm -rf "$inst" -osmo-build-dep.sh libosmocore - -"$deps"/libosmocore/contrib/verify_value_string_arrays_are_terminated.py $(find . -name "*.[hc]") +verify_value_string_arrays_are_terminated.py $(find . -name "*.[hc]") export PKG_CONFIG_PATH="$inst/lib/pkgconfig:$PKG_CONFIG_PATH" export LD_LIBRARY_PATH="$inst/lib" +osmo-build-dep.sh libosmocore osmo-build-dep.sh libosmo-abis set +x -- To view, visit https://gerrit.osmocom.org/3683 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Id6048a69c9e0cc15010de643330aeb2a7271b2a6 Gerrit-PatchSet: 3 Gerrit-Project: libosmo-netif Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Sat Aug 26 06:10:29 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 26 Aug 2017 06:10:29 +0000 Subject: [MERGED] libosmo-sccp[master]: Use value string check from osmo-ci In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Use value string check from osmo-ci ...................................................................... Use value string check from osmo-ci Change-Id: I1a2223b1a059fbb832948decf11f9237fad389f2 --- M contrib/jenkins.sh 1 file changed, 3 insertions(+), 4 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/contrib/jenkins.sh b/contrib/jenkins.sh index 38c1134..ae850ed 100755 --- a/contrib/jenkins.sh +++ b/contrib/jenkins.sh @@ -1,4 +1,4 @@ -#!/usr/bin/env bash +#!/bin/sh # jenkins build helper script for libosmo-sccp. This is how we build on jenkins.osmocom.org if ! [ -x "$(command -v osmo-build-dep.sh)" ]; then @@ -17,13 +17,12 @@ mkdir "$deps" || true rm -rf "$inst" -osmo-build-dep.sh libosmocore - -"$deps"/libosmocore/contrib/verify_value_string_arrays_are_terminated.py $(find . -name "*.[hc]") +verify_value_string_arrays_are_terminated.py $(find . -name "*.[hc]") export PKG_CONFIG_PATH="$inst/lib/pkgconfig:$PKG_CONFIG_PATH" export LD_LIBRARY_PATH="$inst/lib" +osmo-build-dep.sh libosmocore osmo-build-dep.sh libosmo-abis osmo-build-dep.sh libosmo-netif -- To view, visit https://gerrit.osmocom.org/3684 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I1a2223b1a059fbb832948decf11f9237fad389f2 Gerrit-PatchSet: 3 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Sat Aug 26 06:10:32 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 26 Aug 2017 06:10:32 +0000 Subject: [MERGED] osmo-hlr[master]: Use value string check from osmo-ci In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Use value string check from osmo-ci ...................................................................... Use value string check from osmo-ci Change-Id: I56ea5be60d2a3cf8442f58e1121b13074e2e6a08 --- M contrib/jenkins.sh 1 file changed, 2 insertions(+), 3 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/contrib/jenkins.sh b/contrib/jenkins.sh index 12b2be9..e2abb60 100755 --- a/contrib/jenkins.sh +++ b/contrib/jenkins.sh @@ -17,13 +17,12 @@ mkdir "$deps" || true rm -rf "$inst" +verify_value_string_arrays_are_terminated.py $(find . -name "*.[hc]") + export PKG_CONFIG_PATH="$inst/lib/pkgconfig:$PKG_CONFIG_PATH" export LD_LIBRARY_PATH="$inst/lib" osmo-build-dep.sh libosmocore "" ac_cv_path_DOXYGEN=false - -"$deps"/libosmocore/contrib/verify_value_string_arrays_are_terminated.py $(find . -name "*.[hc]") - osmo-build-dep.sh libosmo-abis set +x -- To view, visit https://gerrit.osmocom.org/3687 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I56ea5be60d2a3cf8442f58e1121b13074e2e6a08 Gerrit-PatchSet: 2 Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Sat Aug 26 06:10:36 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 26 Aug 2017 06:10:36 +0000 Subject: [MERGED] osmo-bts[master]: Use value string check from osmo-ci In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Use value string check from osmo-ci ...................................................................... Use value string check from osmo-ci Change-Id: I5bce234a5b8133c81b3ea8757e05de56d3aa15d8 --- M contrib/jenkins_common.sh 1 file changed, 2 insertions(+), 8 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/contrib/jenkins_common.sh b/contrib/jenkins_common.sh index 78ca0af..c1891b2 100644 --- a/contrib/jenkins_common.sh +++ b/contrib/jenkins_common.sh @@ -20,14 +20,7 @@ mkdir -p "$deps" rm -rf "$inst" -cd "$deps" - -# Get libosmocore for verify_value_string_arrays_are_terminated.py -osmo-deps.sh libosmocore - -cd "$base" - -"$deps"/libosmocore/contrib/verify_value_string_arrays_are_terminated.py $(find . -name "*.[hc]") +verify_value_string_arrays_are_terminated.py $(find . -name "*.[hc]") # generic project build function, usage: # build "PROJECT-NAME" "CONFIGURE OPTIONS" @@ -41,6 +34,7 @@ set -x cd $deps + osmo-deps.sh libosmocore osmo-deps.sh openbsc conf_flags="--with-openbsc=$deps/openbsc/openbsc/include" cd $base -- To view, visit https://gerrit.osmocom.org/3681 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I5bce234a5b8133c81b3ea8757e05de56d3aa15d8 Gerrit-PatchSet: 2 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Sat Aug 26 06:10:43 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 26 Aug 2017 06:10:43 +0000 Subject: osmo-iuh[master]: Use value string check from osmo-ci In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3688 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I9fc4a0ce4ca29f8b76e189d040097f3e63298ba5 Gerrit-PatchSet: 1 Gerrit-Project: osmo-iuh Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sat Aug 26 07:27:37 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 26 Aug 2017 07:27:37 +0000 Subject: [PATCH] openbsc[master]: Use verify_value_string_arrays_are_terminated from osmo-ci Message-ID: Review at https://gerrit.osmocom.org/3692 Use verify_value_string_arrays_are_terminated from osmo-ci verify_value_string_arrays_are_terminated has recently been moved from libosmocore.git to osmo-ci.git and the person doing this seems to have forgotten to update openbsc.git Change-Id: Ibe4a7f71d2557dfee94803e909dabb00d2ce10af --- M contrib/jenkins.sh 1 file changed, 1 insertion(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/92/3692/1 diff --git a/contrib/jenkins.sh b/contrib/jenkins.sh index 7e7ccf0..f6524bf 100755 --- a/contrib/jenkins.sh +++ b/contrib/jenkins.sh @@ -17,9 +17,7 @@ mkdir "$deps" || true rm -rf "$inst" -osmo-build-dep.sh libosmocore "" ac_cv_path_DOXYGEN=false - -"$deps"/libosmocore/contrib/verify_value_string_arrays_are_terminated.py $(find . -name "*.[hc]") +verify_value_string_arrays_are_terminated.py $(find . -name "*.[hc]") export PKG_CONFIG_PATH="$inst/lib/pkgconfig:$PKG_CONFIG_PATH" export LD_LIBRARY_PATH="$inst/lib" -- To view, visit https://gerrit.osmocom.org/3692 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ibe4a7f71d2557dfee94803e909dabb00d2ce10af Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Sat Aug 26 18:34:17 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 26 Aug 2017 18:34:17 +0000 Subject: [PATCH] openbsc[master]: Use verify_value_string_arrays_are_terminated from osmo-ci In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3692 to look at the new patch set (#4). Use verify_value_string_arrays_are_terminated from osmo-ci verify_value_string_arrays_are_terminated has recently been moved from libosmocore.git to osmo-ci.git and the person doing this seems to have forgotten to update openbsc.git Change-Id: Ibe4a7f71d2557dfee94803e909dabb00d2ce10af --- M contrib/jenkins.sh 1 file changed, 2 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/92/3692/4 diff --git a/contrib/jenkins.sh b/contrib/jenkins.sh index 7e7ccf0..892d721 100755 --- a/contrib/jenkins.sh +++ b/contrib/jenkins.sh @@ -17,9 +17,7 @@ mkdir "$deps" || true rm -rf "$inst" -osmo-build-dep.sh libosmocore "" ac_cv_path_DOXYGEN=false - -"$deps"/libosmocore/contrib/verify_value_string_arrays_are_terminated.py $(find . -name "*.[hc]") +verify_value_string_arrays_are_terminated.py $(find . -name "*.[hc]") export PKG_CONFIG_PATH="$inst/lib/pkgconfig:$PKG_CONFIG_PATH" export LD_LIBRARY_PATH="$inst/lib" @@ -29,6 +27,7 @@ osmo_iuh_branch="old_sua" fi +osmo-build-dep.sh libosmocore osmo-build-dep.sh libosmo-abis osmo-build-dep.sh libosmo-netif osmo-build-dep.sh libosmo-sccp $sccp_branch -- To view, visit https://gerrit.osmocom.org/3692 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ibe4a7f71d2557dfee94803e909dabb00d2ce10af Gerrit-PatchSet: 4 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sat Aug 26 18:35:06 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 26 Aug 2017 18:35:06 +0000 Subject: [MERGED] libosmocore[master]: Update release helper In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Update release helper ...................................................................... Update release helper * add reference to semver spec * use 'patch' release by default * unify debian/changelog distro update for library and non-library projects * abort library release for non-empty TODO-RELEASE if libversion is not modified Change-Id: I413f99cbfa6e6dcc753e3be9fc3c8d682e6a41f3 Related: OS#1861 --- M osmo-release.mk 1 file changed, 26 insertions(+), 15 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/osmo-release.mk b/osmo-release.mk index 3fe6803..03eb3cb 100644 --- a/osmo-release.mk +++ b/osmo-release.mk @@ -1,28 +1,39 @@ -ifdef REL -NEW_VERSION := $(shell bumpversion --list --current-version $(VERSION) $(REL) --allow-dirty | awk -F '=' '{ print $$2 }') -LIBVERS := $(shell git grep -n LIBVERSION | grep '=' | grep am | grep -v LDFLAGS) -ISODATE := $(shell date -I) +ifndef REL + REL := patch endif +NEW_VER := $(shell bumpversion --list --current-version $(VERSION) $(REL) --allow-dirty | awk -F '=' '{ print $$2 }') +LIBVERS := $(shell git grep -n LIBVERSION | grep '=' | grep am | grep -v LDFLAGS) +MAKEMOD := $(shell git diff -GLIBVERSION --stat | grep Makefile.am) +ISODATE := $(shell date -I) + release: -ifeq ($(NEW_VERSION),) - @$(error Failed to determine NEW_VERSION - please fix versioning (current is $(VERSION)) before proceeding with the release) + +ifeq ($(NEW_VER),) + @$(error Please fix versioning to match http://semver.org/ spec (current is $(VERSION)) before proceeding.) endif - @echo "Releasing" $(VERSION) "->" $(NEW_VERSION)"..." + +ifeq ($(origin REL), file) + @echo "No REL value specified, defaulting to 'patch' release" +endif + + @echo "Releasing" $(VERSION) "->" $(NEW_VER)"..." + ifeq ($(LIBVERS),) @gbp dch --debian-tag='%(version)s' --auto --meta --git-author --multimaint-merge --ignore-branch else @echo "You should NOT be doing this unless you've read and understood following article:" @echo "https://www.gnu.org/software/libtool/manual/html_node/Updating-version-info.html#Updating-version-info" - @grep -v '#' TODO-RELEASE | sed 's/\t\+/:/g' | xargs -d'\n' -I entry dch -m -v $(NEW_VERSION) "entry" - @dch -r -m --distribution "unstable" "" + @grep -v '#' TODO-RELEASE | sed 's/\t\+/: /g' > TODO-RELEASE.entries @grep '#' TODO-RELEASE > TODO-RELEASE.clean @mv TODO-RELEASE.clean TODO-RELEASE - @echo "Do NOT push the release commit if you have not adjusted LIBVERSION in preceeding commit!!!" - @echo "Are you sure the following versions are correct?" - @echo $(LIBVERS) +ifeq ($(MAKEMOD),) + @$(if $(shell git status -s -uno TODO-RELEASE),,$(error Before releasing, please modify some of the libversions: $(LIBVERS))) endif + @xargs -a TODO-RELEASE.entries -r -d'\n' -I entry dch -m -v $(NEW_VER) "entry" +endif + @dch -r -m --distribution "unstable" "" @git add -u - @bumpversion --current-version $(VERSION) $(REL) --tag --commit --tag-name $(NEW_VERSION) --allow-dirty - @git tag -s $(NEW_VERSION) -f -m "Release v$(NEW_VERSION) on $(ISODATE)." - @echo "Release" $(NEW_VERSION) "prepared, tagged and signed." + @bumpversion --current-version $(VERSION) $(REL) --tag --commit --tag-name $(NEW_VER) --allow-dirty + @git tag -s $(NEW_VER) -f -m "Release v$(NEW_VER) on $(ISODATE)." + @echo "Release" $(NEW_VER) "prepared, tagged and signed." -- To view, visit https://gerrit.osmocom.org/3680 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I413f99cbfa6e6dcc753e3be9fc3c8d682e6a41f3 Gerrit-PatchSet: 2 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sat Aug 26 19:20:09 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sat, 26 Aug 2017 19:20:09 +0000 Subject: [PATCH] osmo-msc[master]: Use value string check from osmo-ci Message-ID: Review at https://gerrit.osmocom.org/3693 Use value string check from osmo-ci Change-Id: I02d7e1c0151c687fd9341d21a09ca15cbf5a1938 --- M contrib/jenkins.sh 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/93/3693/1 diff --git a/contrib/jenkins.sh b/contrib/jenkins.sh index 5903429..b4074e4 100755 --- a/contrib/jenkins.sh +++ b/contrib/jenkins.sh @@ -12,7 +12,7 @@ osmo-build-dep.sh libosmocore "" ac_cv_path_DOXYGEN=false -"$deps"/libosmocore/contrib/verify_value_string_arrays_are_terminated.py $(find . -name "*.[hc]") +verify_value_string_arrays_are_terminated.py $(find . -name "*.[hc]") export PKG_CONFIG_PATH="$inst/lib/pkgconfig:$PKG_CONFIG_PATH" export LD_LIBRARY_PATH="$inst/lib" -- To view, visit https://gerrit.osmocom.org/3693 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I02d7e1c0151c687fd9341d21a09ca15cbf5a1938 Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Sat Aug 26 19:20:33 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sat, 26 Aug 2017 19:20:33 +0000 Subject: osmo-msc[master]: Use value string check from osmo-ci In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3693 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I02d7e1c0151c687fd9341d21a09ca15cbf5a1938 Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sat Aug 26 19:22:28 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sat, 26 Aug 2017 19:22:28 +0000 Subject: [PATCH] osmo-msc[master]: Use value string check from osmo-ci In-Reply-To: References: Message-ID: Use value string check from osmo-ci Necessary since libosmocore I513835be2d931d0a931cdfc996f361a451bc1a15 removes the script from libosmocore/contrib. Change-Id: I02d7e1c0151c687fd9341d21a09ca15cbf5a1938 --- M contrib/jenkins.sh 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/93/3693/2 diff --git a/contrib/jenkins.sh b/contrib/jenkins.sh index 5903429..b4074e4 100755 --- a/contrib/jenkins.sh +++ b/contrib/jenkins.sh @@ -12,7 +12,7 @@ osmo-build-dep.sh libosmocore "" ac_cv_path_DOXYGEN=false -"$deps"/libosmocore/contrib/verify_value_string_arrays_are_terminated.py $(find . -name "*.[hc]") +verify_value_string_arrays_are_terminated.py $(find . -name "*.[hc]") export PKG_CONFIG_PATH="$inst/lib/pkgconfig:$PKG_CONFIG_PATH" export LD_LIBRARY_PATH="$inst/lib" -- To view, visit https://gerrit.osmocom.org/3693 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I02d7e1c0151c687fd9341d21a09ca15cbf5a1938 Gerrit-PatchSet: 2 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Sat Aug 26 19:22:35 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sat, 26 Aug 2017 19:22:35 +0000 Subject: osmo-msc[master]: Use value string check from osmo-ci In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3693 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I02d7e1c0151c687fd9341d21a09ca15cbf5a1938 Gerrit-PatchSet: 2 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sat Aug 26 19:27:25 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sat, 26 Aug 2017 19:27:25 +0000 Subject: [PATCH] osmo-msc[master]: NOT FOR MERGE combined changes from openbsc.git for gerrit c... Message-ID: Review at https://gerrit.osmocom.org/3695 NOT FOR MERGE combined changes from openbsc.git for gerrit checking Change-Id: Id072aa07793aceca66bd74950bc40dd504982a55 --- M configure.ac M contrib/jenkins.sh M doc/examples/osmo-bsc/osmo-bsc.cfg M include/openbsc/Makefile.am M include/openbsc/gprs_sgsn.h M include/openbsc/gprs_utils.h A include/openbsc/gsm_04_14.h M include/openbsc/gsm_data.h M include/openbsc/gsm_data_shared.h M include/openbsc/osmux.h M src/gprs/gb_proxy.c M src/gprs/gb_proxy_main.c M src/gprs/gb_proxy_patch.c M src/gprs/gb_proxy_peer.c M src/gprs/gb_proxy_vty.c M src/gprs/gprs_sgsn.c M src/gprs/gprs_subscriber.c M src/gprs/gprs_utils.c M src/gprs/gtphub.c M src/gprs/gtphub_main.c M src/gprs/sgsn_cdr.c M src/gprs/sgsn_libgtp.c M src/gprs/sgsn_main.c M src/gprs/sgsn_vty.c M src/libbsc/abis_nm.c M src/libbsc/abis_rsl.c M src/libbsc/bsc_api.c M src/libbsc/bsc_init.c M src/libbsc/bsc_vty.c M src/libbsc/handover_logic.c M src/libbsc/net_init.c M src/libcommon-cs/common_cs.c M src/libcommon/gsm_data.c M src/libcommon/gsm_data_shared.c M src/libmgcp/mgcp_osmux.c M src/libmgcp/mgcp_protocol.c M src/libmsc/Makefile.am M src/libmsc/db.c M src/libmsc/gsm_04_08.c M src/libmsc/gsm_04_11.c A src/libmsc/gsm_04_14.c M src/libmsc/smpp_openbsc.c M src/libmsc/smpp_smsc.c M src/libmsc/smpp_smsc.h M src/libmsc/transaction.c M src/libmsc/vty_interface_layer3.c M src/osmo-bsc/osmo_bsc_main.c M src/osmo-msc/msc_main.c M src/utils/smpp_mirror.c M tests/channel/channel_test.c M tests/channel/channel_test.ok M tests/db/db_test.err M tests/gprs/gprs_test.c M tests/gsm0408/gsm0408_test.c M tests/gtphub/Makefile.am M tests/sgsn/sgsn_test.c 56 files changed, 1,087 insertions(+), 405 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/95/3695/1 diff --git a/configure.ac b/configure.ac index f184e78..871f7e5 100644 --- a/configure.ac +++ b/configure.ac @@ -66,7 +66,7 @@ AC_ARG_ENABLE([smpp], [AS_HELP_STRING([--enable-smpp], [Build the SMPP interface])], [osmo_ac_build_smpp="$enableval"],[osmo_ac_build_smpp="no"]) if test "$osmo_ac_build_smpp" = "yes" ; then - PKG_CHECK_MODULES(LIBSMPP34, libsmpp34 >= 1.10) + PKG_CHECK_MODULES(LIBSMPP34, libsmpp34 >= 1.12) AC_DEFINE(BUILD_SMPP, 1, [Define if we want to build SMPP]) fi AM_CONDITIONAL(BUILD_SMPP, test "x$osmo_ac_build_smpp" = "xyes") diff --git a/contrib/jenkins.sh b/contrib/jenkins.sh index b4074e4..7734965 100755 --- a/contrib/jenkins.sh +++ b/contrib/jenkins.sh @@ -1,4 +1,11 @@ #!/usr/bin/env bash +# jenkins build helper script for openbsc. This is how we build on jenkins.osmocom.org + +if ! [ -x "$(command -v osmo-build-dep.sh)" ]; then + echo "Error: We need to have scripts/osmo-deps.sh from http://git.osmocom.org/osmo-ci/ in PATH !" + exit 2 +fi + set -ex diff --git a/doc/examples/osmo-bsc/osmo-bsc.cfg b/doc/examples/osmo-bsc/osmo-bsc.cfg index b974b76..534605a 100644 --- a/doc/examples/osmo-bsc/osmo-bsc.cfg +++ b/doc/examples/osmo-bsc/osmo-bsc.cfg @@ -28,18 +28,6 @@ handover power budget interval 6 handover power budget hysteresis 3 handover maximum distance 9999 - timer t3101 10 - timer t3103 0 - timer t3105 0 - timer t3107 0 - timer t3109 0 - timer t3111 0 - timer t3113 60 - timer t3115 0 - timer t3117 0 - timer t3119 0 - timer t3122 0 - timer t3141 0 bts 0 type nanobts band DCS1800 diff --git a/include/openbsc/Makefile.am b/include/openbsc/Makefile.am index 2558d7c..995f02d 100644 --- a/include/openbsc/Makefile.am +++ b/include/openbsc/Makefile.am @@ -37,6 +37,7 @@ gprs_utils.h \ gsm_04_08.h \ gsm_04_11.h \ + gsm_04_14.h \ gsm_04_80.h \ gsm_data.h \ gsm_data_shared.h \ diff --git a/include/openbsc/gprs_sgsn.h b/include/openbsc/gprs_sgsn.h index fd86174..4e49c08 100644 --- a/include/openbsc/gprs_sgsn.h +++ b/include/openbsc/gprs_sgsn.h @@ -393,6 +393,8 @@ char apn_str[GSM_APN_LENGTH]; uint8_t qos_subscribed[20]; size_t qos_subscribed_len; + uint8_t pdp_charg[2]; + bool has_pdp_charg; }; struct sgsn_subscriber_data { @@ -407,6 +409,9 @@ uint8_t hlr[9]; size_t hlr_len; + + uint8_t pdp_charg[2]; + bool has_pdp_charg; }; #define SGSN_ERROR_CAUSE_NONE (-1) diff --git a/include/openbsc/gprs_utils.h b/include/openbsc/gprs_utils.h index 603605c..574f5c5 100644 --- a/include/openbsc/gprs_utils.h +++ b/include/openbsc/gprs_utils.h @@ -30,7 +30,6 @@ struct msgb *gprs_msgb_copy(const struct msgb *msg, const char *name); int gprs_msgb_resize_area(struct msgb *msg, uint8_t *area, size_t old_size, size_t new_size); -char *gprs_apn_to_str(char *out_str, const uint8_t *apn_enc, size_t rest_chars); int gprs_str_to_apn(uint8_t *apn_enc, size_t max_len, const char *str); /* GSM 04.08, 10.5.7.3 GPRS Timer */ diff --git a/include/openbsc/gsm_04_14.h b/include/openbsc/gsm_04_14.h new file mode 100644 index 0000000..3cdbe04 --- /dev/null +++ b/include/openbsc/gsm_04_14.h @@ -0,0 +1,15 @@ +#pragma once + +#include + +int gsm0414_tx_close_tch_loop_cmd(struct gsm_subscriber_connection *conn, + enum gsm414_tch_loop_mode loop_mode); +int gsm0414_tx_open_loop_cmd(struct gsm_subscriber_connection *conn); +int gsm0414_tx_act_emmi_cmd(struct gsm_subscriber_connection *conn); +int gsm0414_tx_test_interface(struct gsm_subscriber_connection *conn, + uint8_t tested_devs); +int gsm0414_tx_reset_ms_pos_store(struct gsm_subscriber_connection *conn, + uint8_t technology); + +int gsm0414_rcv_test(struct gsm_subscriber_connection *conn, + struct msgb *msg); diff --git a/include/openbsc/gsm_data.h b/include/openbsc/gsm_data.h index c307fee..f4de381 100644 --- a/include/openbsc/gsm_data.h +++ b/include/openbsc/gsm_data.h @@ -323,10 +323,18 @@ GSM_AUTH_POLICY_REGEXP, /* accept IMSIs matching given regexp */ }; -#define GSM_T3101_DEFAULT 10 -#define GSM_T3105_DEFAULT 40 +#define GSM_T3101_DEFAULT 10 /* s */ +#define GSM_T3103_DEFAULT 5 /* s */ +#define GSM_T3105_DEFAULT 100 /* ms */ +#define GSM_T3107_DEFAULT 5 /* s */ +#define GSM_T3109_DEFAULT 19 /* s, must be 2s + radio_link_timeout*0.48 */ +#define GSM_T3111_DEFAULT 2 /* s */ #define GSM_T3113_DEFAULT 60 +#define GSM_T3115_DEFAULT 10 +#define GSM_T3117_DEFAULT 10 +#define GSM_T3119_DEFAULT 10 #define GSM_T3122_DEFAULT 10 +#define GSM_T3141_DEFAULT 10 struct gsm_tz { int override; /* if 0, use system's time zone instead. */ @@ -503,6 +511,8 @@ } smpp; unsigned long validity_minutes; + time_t created; + bool is_report; uint8_t reply_path_req; uint8_t status_rep_req; uint8_t ud_hdr_ind; diff --git a/include/openbsc/gsm_data_shared.h b/include/openbsc/gsm_data_shared.h index 0790807..60da2e5 100644 --- a/include/openbsc/gsm_data_shared.h +++ b/include/openbsc/gsm_data_shared.h @@ -899,7 +899,7 @@ }; -struct gsm_bts *gsm_bts_alloc(void *talloc_ctx); +struct gsm_bts *gsm_bts_alloc(void *talloc_ctx, uint8_t bts_num); struct gsm_bts *gsm_bts_num(struct gsm_network *net, int num); struct gsm_bts_trx *gsm_bts_trx_alloc(struct gsm_bts *bts); diff --git a/include/openbsc/osmux.h b/include/openbsc/osmux.h index 0b64a7f..f3ea72a 100644 --- a/include/openbsc/osmux.h +++ b/include/openbsc/osmux.h @@ -11,8 +11,7 @@ }; int osmux_init(int role, struct mgcp_config *cfg); -int osmux_enable_endpoint(struct mgcp_endpoint *endp, int role, - struct in_addr *addr, uint16_t port); +int osmux_enable_endpoint(struct mgcp_endpoint *endp, struct in_addr *addr, uint16_t port); void osmux_disable_endpoint(struct mgcp_endpoint *endp); void osmux_allocate_cid(struct mgcp_endpoint *endp); void osmux_release_cid(struct mgcp_endpoint *endp); diff --git a/src/gprs/gb_proxy.c b/src/gprs/gb_proxy.c index d95139f..cd38d23 100644 --- a/src/gprs/gb_proxy.c +++ b/src/gprs/gb_proxy.c @@ -1266,8 +1266,7 @@ rc = bssgp_tx_status(BSSGP_CAUSE_PDU_INCOMP_FEAT, NULL, orig_msg); break; default: - LOGP(DGPRS, LOGL_NOTICE, "BSSGP PDU type 0x%02x unknown\n", - pdu_type); + LOGP(DGPRS, LOGL_NOTICE, "BSSGP PDU type %s not supported\n", bssgp_pdu_str(pdu_type)); rate_ctr_inc(&cfg->ctrg-> ctr[GBPROX_GLOB_CTR_PROTO_ERR_SGSN]); rc = bssgp_tx_status(BSSGP_CAUSE_PROTO_ERR_UNSPEC, NULL, orig_msg); @@ -1370,9 +1369,8 @@ /* from BSS to SGSN */ peer = gbproxy_peer_by_nsei(cfg, nsvc->nsei); if (!peer) { - LOGP(DGPRS, LOGL_NOTICE, "signal %u for unknown peer " - "NSEI=%u/NSVCI=%u\n", signal, nsvc->nsei, - nsvc->nsvci); + LOGP(DGPRS, LOGL_NOTICE, "signal '%s' for unknown peer NSEI=%u/NSVCI=%u\n", + get_value_string(gprs_ns_signal_ns_names, signal), nsvc->nsei, nsvc->nsvci); return 0; } switch (signal) { @@ -1380,9 +1378,8 @@ case S_NS_BLOCK: if (!peer->blocked) break; - LOGP(DGPRS, LOGL_NOTICE, "Converting NS_RESET from " - "NSEI=%u/NSVCI=%u into BSSGP_BVC_BLOCK to SGSN\n", - nsvc->nsei, nsvc->nsvci); + LOGP(DGPRS, LOGL_NOTICE, "Converting '%s' from NSEI=%u/NSVCI=%u into BSSGP_BVC_BLOCK to SGSN\n", + get_value_string(gprs_ns_signal_ns_names, signal), nsvc->nsei, nsvc->nsvci); bssgp_tx_simple_bvci(BSSGP_PDUT_BVC_BLOCK, nsvc->nsei, peer->bvci, 0); break; @@ -1431,6 +1428,10 @@ INIT_LLIST_HEAD(&cfg->bts_peers); cfg->ctrg = rate_ctr_group_alloc(tall_bsc_ctx, &global_ctrg_desc, 0); + if (!cfg->ctrg) { + LOGP(DGPRS, LOGL_ERROR, "Cannot allocate global counter group!\n"); + return -1; + } clock_gettime(CLOCK_REALTIME, &tp); return 0; diff --git a/src/gprs/gb_proxy_main.c b/src/gprs/gb_proxy_main.c index 69a93b6..caff27f 100644 --- a/src/gprs/gb_proxy_main.c +++ b/src/gprs/gb_proxy_main.c @@ -98,6 +98,7 @@ switch (signal) { case SIGINT: + case SIGTERM: osmo_signal_dispatch(SS_L_GLOBAL, S_L_GLOBAL_SHUTDOWN, NULL); sleep(1); exit(0); @@ -232,6 +233,7 @@ msgb_talloc_ctx_init(tall_bsc_ctx, 0); signal(SIGINT, &signal_handler); + signal(SIGTERM, &signal_handler); signal(SIGABRT, &signal_handler); signal(SIGUSR1, &signal_handler); signal(SIGUSR2, &signal_handler); diff --git a/src/gprs/gb_proxy_patch.c b/src/gprs/gb_proxy_patch.c index 7bddc44..210fb2b 100644 --- a/src/gprs/gb_proxy_patch.c +++ b/src/gprs/gb_proxy_patch.c @@ -28,6 +28,7 @@ #include #include +#include /* patch RA identifier in place */ static void gbproxy_patch_raid(uint8_t *raid_enc, struct gbproxy_peer *peer, @@ -101,7 +102,7 @@ LOGP(DGPRS, LOGL_DEBUG, "Patching %s to SGSN: Removing APN '%s'\n", log_text, - gprs_apn_to_str(str1, apn, apn_len)); + osmo_apn_to_str(str1, apn, apn_len)); *new_apn_ie_len = 0; gprs_msgb_resize_area(msg, apn_ie, apn_ie_len, 0); @@ -116,8 +117,8 @@ "Patching %s to SGSN: " "Replacing APN '%s' -> '%s'\n", log_text, - gprs_apn_to_str(str1, apn, apn_len), - gprs_apn_to_str(str2, peer->cfg->core_apn, + osmo_apn_to_str(str1, apn, apn_len), + osmo_apn_to_str(str2, peer->cfg->core_apn, peer->cfg->core_apn_size)); *new_apn_ie_len = peer->cfg->core_apn_size + 2; diff --git a/src/gprs/gb_proxy_peer.c b/src/gprs/gb_proxy_peer.c index 5365ff0..8909687 100644 --- a/src/gprs/gb_proxy_peer.c +++ b/src/gprs/gb_proxy_peer.c @@ -177,6 +177,10 @@ peer->bvci = bvci; peer->ctrg = rate_ctr_group_alloc(peer, &peer_ctrg_desc, bvci); + if (!peer->ctrg) { + talloc_free(peer); + return NULL; + } peer->cfg = cfg; llist_add(&peer->list, &cfg->bts_peers); diff --git a/src/gprs/gb_proxy_vty.c b/src/gprs/gb_proxy_vty.c index 933b6b0..86d65a8 100644 --- a/src/gprs/gb_proxy_vty.c +++ b/src/gprs/gb_proxy_vty.c @@ -29,6 +29,7 @@ #include #include +#include #include #include @@ -107,7 +108,7 @@ if (g_cfg->core_apn_size > 0) { char str[500] = {0}; vty_out(vty, " core-access-point-name %s%s", - gprs_apn_to_str(str, g_cfg->core_apn, + osmo_apn_to_str(str, g_cfg->core_apn, g_cfg->core_apn_size), VTY_NEWLINE); } else { diff --git a/src/gprs/gprs_sgsn.c b/src/gprs/gprs_sgsn.c index 18625ae..43eeaaa 100644 --- a/src/gprs/gprs_sgsn.c +++ b/src/gprs/gprs_sgsn.c @@ -30,6 +30,7 @@ #include #include #include +#include #include #include @@ -129,6 +130,7 @@ void sgsn_rate_ctr_init() { sgsn->rate_ctrs = rate_ctr_group_alloc(tall_bsc_ctx, &sgsn_ctrg_desc, 0); + OSMO_ASSERT(sgsn->rate_ctrs); } /* look-up an SGSN MM context based on Iu UE context (struct ue_conn_ctx)*/ @@ -229,6 +231,11 @@ LOGMMCTXP(LOGL_DEBUG, ctx, "Allocated with %s cipher.\n", get_value_string(gprs_cipher_names, ctx->ciph_algo)); ctx->ctrg = rate_ctr_group_alloc(ctx, &mmctx_ctrg_desc, tlli); + if (!ctx->ctrg) { + LOGMMCTXP(LOGL_ERROR, ctx, "Cannot allocate counter group\n"); + talloc_free(ctx); + return NULL; + } INIT_LLIST_HEAD(&ctx->pdp_list); llist_add(&ctx->list, &sgsn_mm_ctxts); @@ -253,6 +260,11 @@ ctx->pmm_state = PMM_DETACHED; ctx->auth_triplet.key_seq = GSM_KEY_SEQ_INVAL; ctx->ctrg = rate_ctr_group_alloc(ctx, &mmctx_ctrg_desc, 0); + if (!ctx->ctrg) { + LOGMMCTXP(LOGL_ERROR, ctx, "Cannot allocate counter group\n"); + talloc_free(ctx); + return NULL; + } /* Need to get RAID from IU conn */ ctx->ra = ctx->iu.ue_ctx->ra_id; @@ -380,6 +392,11 @@ pdp->mm = mm; pdp->nsapi = nsapi; pdp->ctrg = rate_ctr_group_alloc(pdp, &pdpctx_ctrg_desc, nsapi); + if (!pdp->ctrg) { + LOGPDPCTXP(LOGL_ERROR, pdp, "Error allocation counter group\n"); + talloc_free(pdp); + return NULL; + } llist_add(&pdp->list, &mm->pdp_list); llist_add(&pdp->g_list, &sgsn_pdp_ctxts); @@ -699,10 +716,21 @@ sgsn_auth_update(mmctx); } -static void insert_qos(struct tlv_parsed *tp, struct sgsn_subscriber_pdp_data *pdp) +static void insert_extra(struct tlv_parsed *tp, + struct sgsn_subscriber_data *data, + struct sgsn_subscriber_pdp_data *pdp) { tp->lv[OSMO_IE_GSM_SUB_QOS].len = pdp->qos_subscribed_len; tp->lv[OSMO_IE_GSM_SUB_QOS].val = pdp->qos_subscribed; + + /* Prefer PDP charging characteristics of per subscriber one */ + if (pdp->has_pdp_charg) { + tp->lv[OSMO_IE_GSM_CHARG_CHAR].len = sizeof(pdp->pdp_charg); + tp->lv[OSMO_IE_GSM_CHARG_CHAR].val = &pdp->pdp_charg[0]; + } else if (data->has_pdp_charg) { + tp->lv[OSMO_IE_GSM_CHARG_CHAR].len = sizeof(data->pdp_charg); + tp->lv[OSMO_IE_GSM_CHARG_CHAR].val = &data->pdp_charg[0]; + } } /** @@ -731,7 +759,7 @@ return NULL; } - gprs_apn_to_str(req_apn_str, + osmo_apn_to_str(req_apn_str, TLVP_VAL(tp, GSM48_IE_GSM_APN), TLVP_LEN(tp, GSM48_IE_GSM_APN)); @@ -751,7 +779,7 @@ { allow_any_apn = 1; selected_apn_str = ""; - insert_qos(tp, pdp); + insert_extra(tp, mmctx->subscr->sgsn_data, pdp); continue; } if (!llist_empty(&sgsn_apn_ctxts)) { @@ -760,7 +788,7 @@ if (apn_ctx == NULL) continue; } - insert_qos(tp, pdp); + insert_extra(tp, mmctx->subscr->sgsn_data, pdp); selected_apn_str = pdp->apn_str; break; } @@ -768,13 +796,13 @@ /* Check whether the given APN is granted */ llist_for_each_entry(pdp, &mmctx->subscr->sgsn_data->pdp_list, list) { if (strcmp(pdp->apn_str, "*") == 0) { - insert_qos(tp, pdp); + insert_extra(tp, mmctx->subscr->sgsn_data, pdp); selected_apn_str = req_apn_str; allow_any_apn = 1; continue; } if (strcasecmp(pdp->apn_str, req_apn_str) == 0) { - insert_qos(tp, pdp); + insert_extra(tp, mmctx->subscr->sgsn_data, pdp); selected_apn_str = req_apn_str; break; } diff --git a/src/gprs/gprs_subscriber.c b/src/gprs/gprs_subscriber.c index 176583b..94297d0 100644 --- a/src/gprs/gprs_subscriber.c +++ b/src/gprs/gprs_subscriber.c @@ -22,6 +22,7 @@ #include #include +#include #include #include #include @@ -325,6 +326,13 @@ } } + if (gsup_msg->pdp_charg_enc && gsup_msg->pdp_charg_enc_len >= sizeof(sdata->pdp_charg)) { + memcpy(&sdata->pdp_charg, gsup_msg->pdp_charg_enc, sizeof(sdata->pdp_charg)); + sdata->has_pdp_charg = 1; + } else { + sdata->has_pdp_charg = 0; + } + if (gsup_msg->pdp_info_compl) { rc = gprs_subscr_pdp_data_clear(subscr); if (rc > 0) @@ -364,10 +372,17 @@ OSMO_ASSERT(pdp_data != NULL); pdp_data->pdp_type = pdp_info->pdp_type; - gprs_apn_to_str(pdp_data->apn_str, + osmo_apn_to_str(pdp_data->apn_str, pdp_info->apn_enc, pdp_info->apn_enc_len); memcpy(pdp_data->qos_subscribed, pdp_info->qos_enc, pdp_info->qos_enc_len); pdp_data->qos_subscribed_len = pdp_info->qos_enc_len; + + if (pdp_info->pdp_charg_enc && pdp_info->pdp_charg_enc_len >= sizeof(pdp_data->pdp_charg)) { + memcpy(&pdp_data->pdp_charg, pdp_info->pdp_charg_enc, sizeof(pdp_data->pdp_charg)); + pdp_data->has_pdp_charg = 1; + } else { + pdp_data->has_pdp_charg = 0; + } } } diff --git a/src/gprs/gprs_utils.c b/src/gprs/gprs_utils.c index 64ed978..91a09d2 100644 --- a/src/gprs/gprs_utils.c +++ b/src/gprs/gprs_utils.c @@ -114,34 +114,6 @@ return 0; } -/* TODO: Move these conversion functions to a utils file. */ -/* TODO: consolidate with gprs_apn2str(). */ -/** memmove apn_enc to out_str, replacing the length octets in apn_enc with '.' - * (omitting the first one) and terminating with a '\0'. - * out_str needs to have rest_chars amount of bytes or 1 whatever is bigger. - */ -char * gprs_apn_to_str(char *out_str, const uint8_t *apn_enc, size_t rest_chars) -{ - char *str = out_str; - - while (rest_chars > 0 && apn_enc[0]) { - size_t label_size = apn_enc[0]; - if (label_size + 1 > rest_chars) - return NULL; - - memmove(str, apn_enc + 1, label_size); - str += label_size; - rest_chars -= label_size + 1; - apn_enc += label_size + 1; - - if (rest_chars) - *(str++) = '.'; - } - str[0] = '\0'; - - return out_str; -} - int gprs_str_to_apn(uint8_t *apn_enc, size_t max_len, const char *str) { uint8_t *last_len_field; diff --git a/src/gprs/gtphub.c b/src/gprs/gtphub.c index 211018b..0a8e375 100644 --- a/src/gprs/gtphub.c +++ b/src/gprs/gtphub.c @@ -42,6 +42,8 @@ #include #include +#include + static const int GTPH_GC_TICK_SECONDS = 1; @@ -498,7 +500,7 @@ len = sizeof(apn_buf) - 1; apn_buf[len] = '\0'; - *apn_str = gprs_apn_to_str(apn_buf, (uint8_t*)apn_buf, len); + *apn_str = osmo_apn_to_str(apn_buf, (uint8_t*)apn_buf, len); if (!(*apn_str)) { LOG(LOGL_ERROR, "APN IE: present but cannot be decoded: %s\n", osmo_hexdump((uint8_t*)apn_buf, len)); @@ -2708,6 +2710,10 @@ pp->counters_io = rate_ctr_group_alloc(osmo_gtphub_ctx, >phub_ctrg_io_desc, 0); + if (!pp->counters_io) { + talloc_free(pp); + return NULL; + } llist_add(&pp->entry, &a->ports); diff --git a/src/gprs/gtphub_main.c b/src/gprs/gtphub_main.c index 73a122c..2b87d19 100644 --- a/src/gprs/gtphub_main.c +++ b/src/gprs/gtphub_main.c @@ -96,6 +96,7 @@ switch (signal) { case SIGINT: + case SIGTERM: osmo_signal_dispatch(SS_L_GLOBAL, S_L_GLOBAL_SHUTDOWN, NULL); sleep(1); exit(0); @@ -302,6 +303,7 @@ msgb_talloc_ctx_init(osmo_gtphub_ctx, 0); signal(SIGINT, &signal_handler); + signal(SIGTERM, &signal_handler); signal(SIGABRT, &signal_handler); signal(SIGUSR1, &signal_handler); signal(SIGUSR2, &signal_handler); diff --git a/src/gprs/sgsn_cdr.c b/src/gprs/sgsn_cdr.c index 0910896..16ea9d4 100644 --- a/src/gprs/sgsn_cdr.c +++ b/src/gprs/sgsn_cdr.c @@ -22,6 +22,7 @@ #include #include #include +#include #include @@ -145,7 +146,7 @@ if (pdp->lib) { - gprs_apn_to_str(apni, pdp->lib->apn_use.v, pdp->lib->apn_use.l); + osmo_apn_to_str(apni, pdp->lib->apn_use.v, pdp->lib->apn_use.l); inet_ntop(AF_INET, &pdp->lib->hisaddr0.s_addr, ggsn_addr, sizeof(ggsn_addr)); extract_eua(&pdp->lib->eua, eua_addr); } diff --git a/src/gprs/sgsn_libgtp.c b/src/gprs/sgsn_libgtp.c index 7595bf8..7ff8ece 100644 --- a/src/gprs/sgsn_libgtp.c +++ b/src/gprs/sgsn_libgtp.c @@ -234,6 +234,10 @@ memcpy(pdp->qos_req.v, qos, pdp->qos_req.l); } + /* charging characteristics if present */ + if (TLVP_LEN(tp, OSMO_IE_GSM_CHARG_CHAR) >= sizeof(pdp->cch_pdp)) + pdp->cch_pdp = tlvp_val16be(tp, OSMO_IE_GSM_CHARG_CHAR); + /* SGSN address for control plane */ pdp->gsnlc.l = sizeof(sgsn->cfg.gtp_listenaddr.sin_addr); memcpy(pdp->gsnlc.v, &sgsn->cfg.gtp_listenaddr.sin_addr, @@ -247,18 +251,28 @@ memcpy(pdp->gsnlu.v, &sgsn->cfg.gtp_listenaddr.sin_addr, sizeof(sgsn->cfg.gtp_listenaddr.sin_addr)); - /* Routing Area Identifier with LAC and RAC fixed values, as - * requested in 29.006 7.3.1 */ + /* Encode RAT Type according to TS 29.060 7.7.50 */ + pdp->rattype.l = 1; + if (mmctx->ran_type == MM_CTX_T_UTRAN_Iu) + pdp->rattype.v[0] = 1; + else + pdp->rattype.v[0] = 2; + pdp->rattype_given = 1; + + /* Include RAI and ULI all the time */ pdp->rai_given = 1; pdp->rai.l = 6; + + /* Routing Area Identifier with LAC and RAC fixed values, as + * requested in 29.006 7.3.1 */ raid = mmctx->ra; raid.lac = 0xFFFE; raid.rac = 0xFF; gsm48_construct_ra(pdp->rai.v, &raid); - pdp->rattype.l = 1; - pdp->rattype_given = 1; - + /* Encode User Location Information accordint to TS 29.060 7.7.51 */ + pdp->userloc_given = 1; + pdp->userloc.l = 8; switch (mmctx->ran_type) { case MM_CTX_T_GERAN_Gb: case MM_CTX_T_GERAN_Iu: @@ -270,8 +284,9 @@ bssgp_create_cell_id(&pdp->userloc.v[1], &mmctx->ra, mmctx->gb.cell_id); break; case MM_CTX_T_UTRAN_Iu: - pdp->rattype.v[0] = 1; - /* FIXME: Optional User Location Information with SAI */ + pdp->userloc.v[0] = 1; /* SAI for UTRAN */ + /* SAI is like CGI but with SAC instead of CID, so we can abuse this function */ + bssgp_create_cell_id(&pdp->userloc.v[1], &mmctx->ra, mmctx->iu.sac); break; } diff --git a/src/gprs/sgsn_main.c b/src/gprs/sgsn_main.c index 71cb18c..d5d43ad 100644 --- a/src/gprs/sgsn_main.c +++ b/src/gprs/sgsn_main.c @@ -145,6 +145,7 @@ switch (signal) { case SIGINT: + case SIGTERM: osmo_signal_dispatch(SS_L_GLOBAL, S_L_GLOBAL_SHUTDOWN, NULL); sleep(1); exit(0); @@ -332,6 +333,7 @@ msgb_talloc_ctx_init(tall_bsc_ctx, 0); signal(SIGINT, &signal_handler); + signal(SIGTERM, &signal_handler); signal(SIGABRT, &signal_handler); signal(SIGUSR1, &signal_handler); signal(SIGUSR2, &signal_handler); diff --git a/src/gprs/sgsn_vty.c b/src/gprs/sgsn_vty.c index 888f53a..cf44cc4 100644 --- a/src/gprs/sgsn_vty.c +++ b/src/gprs/sgsn_vty.c @@ -28,6 +28,7 @@ #include #include #include +#include #include #include @@ -116,7 +117,6 @@ #define GSM48_MAX_APN_LEN 102 /* 10.5.6.1 */ -/* TODO: consolidate with gprs_apn_to_str(). */ /** Copy apn to a static buffer, replacing the length octets in apn_enc with '.' * and terminating with a '\0'. Return the static buffer. * len: the length of the encoded APN (which has no terminating zero). @@ -124,23 +124,10 @@ static char *gprs_apn2str(uint8_t *apn, unsigned int len) { static char apnbuf[GSM48_MAX_APN_LEN+1]; - unsigned int i = 0; if (!apn) return ""; - - if (len > sizeof(apnbuf)-1) - len = sizeof(apnbuf)-1; - - memcpy(apnbuf, apn, len); - apnbuf[len] = '\0'; - - /* replace the domain name step sizes with dots */ - while (i < len) { - unsigned int step = apnbuf[i]; - apnbuf[i] = '.'; - i += step+1; - } + osmo_apn_to_str(apnbuf, apn, len); return apnbuf+1; } @@ -468,20 +455,22 @@ const char *imsi = pdp->mm ? pdp->mm->imsi : "(detaching)"; vty_out(vty, "%sPDP Context IMSI: %s, SAPI: %u, NSAPI: %u, TI: %u%s", pfx, imsi, pdp->sapi, pdp->nsapi, pdp->ti, VTY_NEWLINE); - vty_out(vty, "%s APN: %s%s", pfx, - gprs_apn2str(pdp->lib->apn_use.v, pdp->lib->apn_use.l), - VTY_NEWLINE); - vty_out(vty, "%s PDP Address: %s%s", pfx, - gprs_pdpaddr2str(pdp->lib->eua.v, pdp->lib->eua.l), - VTY_NEWLINE); - vty_out(vty, "%s GTP Local Control(%s / TEIC: 0x%08x) ", pfx, - gtp_ntoa(&pdp->lib->gsnlc), pdp->lib->teic_own); - vty_out(vty, "Data(%s / TEID: 0x%08x)%s", - gtp_ntoa(&pdp->lib->gsnlu), pdp->lib->teid_own, VTY_NEWLINE); - vty_out(vty, "%s GTP Remote Control(%s / TEIC: 0x%08x) ", pfx, - gtp_ntoa(&pdp->lib->gsnrc), pdp->lib->teic_gn); - vty_out(vty, "Data(%s / TEID: 0x%08x)%s", - gtp_ntoa(&pdp->lib->gsnru), pdp->lib->teid_gn, VTY_NEWLINE); + if (pdp->lib) { + vty_out(vty, "%s APN: %s%s", pfx, + gprs_apn2str(pdp->lib->apn_use.v, pdp->lib->apn_use.l), + VTY_NEWLINE); + vty_out(vty, "%s PDP Address: %s%s", pfx, + gprs_pdpaddr2str(pdp->lib->eua.v, pdp->lib->eua.l), + VTY_NEWLINE); + vty_out(vty, "%s GTP Local Control(%s / TEIC: 0x%08x) ", pfx, + gtp_ntoa(&pdp->lib->gsnlc), pdp->lib->teic_own); + vty_out(vty, "Data(%s / TEID: 0x%08x)%s", + gtp_ntoa(&pdp->lib->gsnlu), pdp->lib->teid_own, VTY_NEWLINE); + vty_out(vty, "%s GTP Remote Control(%s / TEIC: 0x%08x) ", pfx, + gtp_ntoa(&pdp->lib->gsnrc), pdp->lib->teic_gn); + vty_out(vty, "Data(%s / TEID: 0x%08x)%s", + gtp_ntoa(&pdp->lib->gsnru), pdp->lib->teid_gn, VTY_NEWLINE); + } vty_out_rate_ctr_group(vty, " ", pdp->ctrg); } diff --git a/src/libbsc/abis_nm.c b/src/libbsc/abis_nm.c index 019d039..cf20d7c 100644 --- a/src/libbsc/abis_nm.c +++ b/src/libbsc/abis_nm.c @@ -1590,10 +1590,17 @@ const uint8_t *attr, uint8_t attr_len) { struct abis_om_hdr *oh; - struct msgb *msg = nm_msgb_alloc(); + struct msgb *msg; + + if (bts->type != GSM_BTS_TYPE_OSMOBTS) { + LOGPC(DNM, LOGL_NOTICE, "Getting attributes from BTS%d type %s is not supported.\n", + bts->nr, btstype2str(bts->type)); + return -EINVAL; + } DEBUGP(DNM, "Get Attr (bts=%d)\n", bts->nr); + msg = nm_msgb_alloc(); oh = (struct abis_om_hdr *) msgb_put(msg, ABIS_OM_FOM_HDR_SIZE); fill_om_fom_hdr(oh, attr_len, NM_MT_GET_ATTR, obj_class, bts_nr, trx_nr, ts_nr); diff --git a/src/libbsc/abis_rsl.c b/src/libbsc/abis_rsl.c index 441b386..4f687a0 100644 --- a/src/libbsc/abis_rsl.c +++ b/src/libbsc/abis_rsl.c @@ -245,12 +245,14 @@ && type == RSL_SYSTEM_INFO_13) { /* Ericsson proprietary encoding of SI13 */ msgb_tv_put(msg, RSL_IE_SYSINFO_TYPE, RSL_ERIC_SYSTEM_INFO_13); - msgb_tlv_put(msg, RSL_IE_FULL_BCCH_INFO, len, data); + if (data) + msgb_tlv_put(msg, RSL_IE_FULL_BCCH_INFO, len, data); msgb_tv_put(msg, RSL_IE_ERIC_BCCH_MAPPING, 0x00); } else { /* Normal encoding */ msgb_tv_put(msg, RSL_IE_SYSINFO_TYPE, type); - msgb_tlv_put(msg, RSL_IE_FULL_BCCH_INFO, len, data); + if (data) + msgb_tlv_put(msg, RSL_IE_FULL_BCCH_INFO, len, data); } msg->dst = trx->rsl_link; @@ -269,7 +271,8 @@ ch->msg_type = RSL_MT_SACCH_FILL; msgb_tv_put(msg, RSL_IE_SYSINFO_TYPE, type); - msgb_tl16v_put(msg, RSL_IE_L3_INFO, len, data); + if (data) + msgb_tl16v_put(msg, RSL_IE_L3_INFO, len, data); msg->dst = trx->rsl_link; @@ -288,7 +291,8 @@ dh->chan_nr = chan_nr; msgb_tv_put(msg, RSL_IE_SYSINFO_TYPE, type); - msgb_tl16v_put(msg, RSL_IE_L3_INFO, len, data); + if (data) + msgb_tl16v_put(msg, RSL_IE_L3_INFO, len, data); msg->dst = lchan->ts->trx->rsl_link; @@ -2446,7 +2450,7 @@ dh = (struct abis_rsl_dchan_hdr *) msgb_put(msg, sizeof(*dh)); init_dchan_hdr(dh, msg_type); dh->c.msg_discr = ABIS_RSL_MDISC_DED_CHAN; - dh->chan_nr = gsm_pchan2chan_nr(GSM_PCHAN_PDCH, ts->nr, 0); + dh->chan_nr = gsm_pchan2chan_nr(GSM_PCHAN_TCH_F, ts->nr, 0); DEBUGP(DRSL, "%s IPAC PDCH %sACT\n", gsm_ts_name(ts), act ? "" : "DE"); @@ -2905,10 +2909,6 @@ int rsl_start_t3109(struct gsm_lchan *lchan) { struct gsm_bts *bts = lchan->ts->trx->bts; - - /* Disabled, mostly legacy code */ - if (bts->network->T3109 == 0) - return -1; osmo_timer_setup(&lchan->T3109, t3109_expired, lchan); osmo_timer_schedule(&lchan->T3109, bts->network->T3109, 0); diff --git a/src/libbsc/bsc_api.c b/src/libbsc/bsc_api.c index c2828e3..c60f818 100644 --- a/src/libbsc/bsc_api.c +++ b/src/libbsc/bsc_api.c @@ -607,7 +607,7 @@ break; case GSM48_MT_RR_STATUS: LOGP(DRR, LOGL_NOTICE, "%s (cause: %s)\n", - gsm48_rr_msg_name(GSM48_MT_RR_GPRS_SUSP_REQ), + gsm48_rr_msg_name(GSM48_MT_RR_STATUS), rr_cause_name(gh->data[0])); break; case GSM48_MT_RR_MEAS_REP: diff --git a/src/libbsc/bsc_init.c b/src/libbsc/bsc_init.c index 64dcd15..78ca2ab 100644 --- a/src/libbsc/bsc_init.c +++ b/src/libbsc/bsc_init.c @@ -104,8 +104,11 @@ struct gsm_bts *bts = trx->bts; int rc, j; - DEBUGP(DRR, "SI%s: %s\n", get_value_string(osmo_sitype_strs, i), - osmo_hexdump(GSM_BTS_SI(bts, i), GSM_MACBLOCK_LEN)); + if (si_len) { + DEBUGP(DRR, "SI%s: %s\n", get_value_string(osmo_sitype_strs, i), + osmo_hexdump(GSM_BTS_SI(bts, i), GSM_MACBLOCK_LEN)); + } else + DEBUGP(DRR, "SI%s: OFF\n", get_value_string(osmo_sitype_strs, i)); switch (i) { case SYSINFO_TYPE_5: @@ -113,14 +116,18 @@ case SYSINFO_TYPE_5ter: case SYSINFO_TYPE_6: rc = rsl_sacch_filling(trx, osmo_sitype2rsl(i), - GSM_BTS_SI(bts, i), si_len); + si_len ? GSM_BTS_SI(bts, i) : NULL, si_len); break; case SYSINFO_TYPE_2quater: + if (si_len == 0) { + rc = rsl_bcch_info(trx, i, NULL, 0); + break; + } for (j = 0; j <= bts->si2q_count; j++) rc = rsl_bcch_info(trx, i, (const uint8_t *)GSM_BTS_SI2Q(bts, j), GSM_MACBLOCK_LEN); break; default: - rc = rsl_bcch_info(trx, i, GSM_BTS_SI(bts, i), si_len); + rc = rsl_bcch_info(trx, i, si_len ? GSM_BTS_SI(bts, i) : NULL, si_len); break; } @@ -139,8 +146,8 @@ ms_pwr_ctl_lvl(bts->band, bts->ms_max_power); bts->si_common.cell_sel_par.neci = bts->network->neci; - /* Zero, forget the state of the SIs */ - bts->si_valid = 0; + /* Zero/forget the state of the dynamically computed SIs, leeping the static ones */ + bts->si_valid = bts->si_mode_static; /* First, we determine which of the SI messages we actually need */ @@ -193,9 +200,13 @@ for (n = 0; n < n_si; n++) { i = gen_si[n]; + /* if we don't currently have this SI, we send a zero-length + * RSL BCCH FILLING / SACCH FILLING * in order to deactivate + * the SI, in case it might have previously been active */ if (!GSM_BTS_HAS_SI(bts, i)) - continue; - rc = rsl_si(trx, i, si_len[i]); + rc = rsl_si(trx, i, 0); + else + rc = rsl_si(trx, i, si_len[i]); if (rc < 0) return rc; } @@ -350,12 +361,12 @@ generate_cell_chan_list(ca, trx->bts); /* Request generic BTS-level attributes */ - abis_nm_get_attr(trx->bts, NM_OC_BTS, trx->bts->nr, trx->nr, 0xFF, bts_attr, sizeof(bts_attr)); + abis_nm_get_attr(trx->bts, NM_OC_BTS, 0xFF, 0xFF, 0xFF, bts_attr, sizeof(bts_attr)); llist_for_each_entry(cur_trx, &trx->bts->trx_list, list) { int i; /* Request TRX-level attributes */ - abis_nm_get_attr(cur_trx->bts, NM_OC_BASEB_TRANSC, cur_trx->bts->nr, cur_trx->nr, 0xFF, + abis_nm_get_attr(cur_trx->bts, NM_OC_BASEB_TRANSC, 0, cur_trx->nr, 0xFF, trx_attr, sizeof(trx_attr)); for (i = 0; i < ARRAY_SIZE(cur_trx->ts); i++) generate_ma_for_ts(&cur_trx->ts[i]); diff --git a/src/libbsc/bsc_vty.c b/src/libbsc/bsc_vty.c index 722753a..bd363ae 100644 --- a/src/libbsc/bsc_vty.c +++ b/src/libbsc/bsc_vty.c @@ -30,6 +30,7 @@ #include #include #include +#include #include @@ -776,6 +777,11 @@ return CMD_SUCCESS; } +/* small helper macro for conditional dumping of timer */ +#define VTY_OUT_TIMER(number) \ + if (gsmnet->T##number != GSM_T##number##_DEFAULT) \ + vty_out(vty, " timer t"#number" %u%s", gsmnet->T##number, VTY_NEWLINE) + static int config_write_net(struct vty *vty) { struct gsm_network *gsmnet = gsmnet_from_vty(vty); @@ -812,18 +818,18 @@ gsmnet->handover.pwr_hysteresis, VTY_NEWLINE); vty_out(vty, " handover maximum distance %u%s", gsmnet->handover.max_distance, VTY_NEWLINE); - vty_out(vty, " timer t3101 %u%s", gsmnet->T3101, VTY_NEWLINE); - vty_out(vty, " timer t3103 %u%s", gsmnet->T3103, VTY_NEWLINE); - vty_out(vty, " timer t3105 %u%s", gsmnet->T3105, VTY_NEWLINE); - vty_out(vty, " timer t3107 %u%s", gsmnet->T3107, VTY_NEWLINE); - vty_out(vty, " timer t3109 %u%s", gsmnet->T3109, VTY_NEWLINE); - vty_out(vty, " timer t3111 %u%s", gsmnet->T3111, VTY_NEWLINE); - vty_out(vty, " timer t3113 %u%s", gsmnet->T3113, VTY_NEWLINE); - vty_out(vty, " timer t3115 %u%s", gsmnet->T3115, VTY_NEWLINE); - vty_out(vty, " timer t3117 %u%s", gsmnet->T3117, VTY_NEWLINE); - vty_out(vty, " timer t3119 %u%s", gsmnet->T3119, VTY_NEWLINE); - vty_out(vty, " timer t3122 %u%s", gsmnet->T3122, VTY_NEWLINE); - vty_out(vty, " timer t3141 %u%s", gsmnet->T3141, VTY_NEWLINE); + VTY_OUT_TIMER(3101); + VTY_OUT_TIMER(3103); + VTY_OUT_TIMER(3105); + VTY_OUT_TIMER(3107); + VTY_OUT_TIMER(3109); + VTY_OUT_TIMER(3111); + VTY_OUT_TIMER(3113); + VTY_OUT_TIMER(3115); + VTY_OUT_TIMER(3117); + VTY_OUT_TIMER(3119); + VTY_OUT_TIMER(3122); + VTY_OUT_TIMER(3141); vty_out(vty, " dyn_ts_allow_tch_f %d%s", gsmnet->dyn_ts_allow_tch_f ? 1 : 0, VTY_NEWLINE); if (gsmnet->tz.override != 0) { @@ -1534,38 +1540,43 @@ return CMD_SUCCESS; } +#define DEFAULT_TIMER(number) GSM_T##number##_DEFAULT +/* Add another expansion so that DEFAULT_TIMER() becomes its value */ +#define EXPAND_AND_STRINGIFY(x) OSMO_STRINGIFY(x) + #define DECLARE_TIMER(number, doc) \ DEFUN(cfg_net_T##number, \ cfg_net_T##number##_cmd, \ - "timer t" #number " <0-65535>", \ + "timer t" #number " (default|<1-65535>)", \ "Configure GSM Timers\n" \ - doc "Timer Value in seconds\n") \ + doc " (default: " EXPAND_AND_STRINGIFY(DEFAULT_TIMER(number)) " seconds)\n" \ + "Set to default timer value" \ + " (" EXPAND_AND_STRINGIFY(DEFAULT_TIMER(number)) " seconds)\n" \ + "Timer Value in seconds\n") \ { \ struct gsm_network *gsmnet = gsmnet_from_vty(vty); \ - int value = atoi(argv[0]); \ - \ - if (value < 0 || value > 65535) { \ - vty_out(vty, "Timer value %s out of range.%s", \ - argv[0], VTY_NEWLINE); \ - return CMD_WARNING; \ - } \ + int value; \ + if (strcmp(argv[0], "default") == 0) \ + value = DEFAULT_TIMER(number); \ + else \ + value = atoi(argv[0]); \ \ gsmnet->T##number = value; \ return CMD_SUCCESS; \ } -DECLARE_TIMER(3101, "Set the timeout value for IMMEDIATE ASSIGNMENT.\n") -DECLARE_TIMER(3103, "Set the timeout value for HANDOVER.\n") -DECLARE_TIMER(3105, "Set the timer for repetition of PHYSICAL INFORMATION.\n") -DECLARE_TIMER(3107, "Currently not used.\n") -DECLARE_TIMER(3109, "Set the RSL SACCH deactivation timeout.\n") -DECLARE_TIMER(3111, "Set the RSL timeout to wait before releasing the RF Channel.\n") -DECLARE_TIMER(3113, "Set the time to try paging a subscriber.\n") -DECLARE_TIMER(3115, "Currently not used.\n") -DECLARE_TIMER(3117, "Currently not used.\n") -DECLARE_TIMER(3119, "Currently not used.\n") -DECLARE_TIMER(3122, "Waiting time (seconds) after IMM ASS REJECT\n") -DECLARE_TIMER(3141, "Currently not used.\n") +DECLARE_TIMER(3101, "Set the timeout value for IMMEDIATE ASSIGNMENT") +DECLARE_TIMER(3103, "Set the timeout value for HANDOVER") +DECLARE_TIMER(3105, "Set the timer for repetition of PHYSICAL INFORMATION") +DECLARE_TIMER(3107, "Currently not used") +DECLARE_TIMER(3109, "Set the RSL SACCH deactivation timeout") +DECLARE_TIMER(3111, "Set the RSL timeout to wait before releasing the RF Channel") +DECLARE_TIMER(3113, "Set the time to try paging a subscriber") +DECLARE_TIMER(3115, "Currently not used") +DECLARE_TIMER(3117, "Currently not used") +DECLARE_TIMER(3119, "Currently not used") +DECLARE_TIMER(3122, "Waiting time (seconds) after IMM ASS REJECT") +DECLARE_TIMER(3141, "Currently not used") DEFUN_DEPRECATED(cfg_net_dtx, cfg_net_dtx_cmd, @@ -3801,6 +3812,38 @@ return CMD_SUCCESS; } +DEFUN(bts_resend, bts_resend_cmd, + "bts <0-255> resend-system-information", + "BTS Specific Commands\n" "BTS Number\n" + "Re-generate + re-send BCCH SYSTEM INFORMATION\n") +{ + struct gsm_network *gsmnet; + struct gsm_bts_trx *trx; + struct gsm_bts *bts; + unsigned int bts_nr; + + gsmnet = gsmnet_from_vty(vty); + + bts_nr = atoi(argv[0]); + if (bts_nr >= gsmnet->num_bts) { + vty_out(vty, "BTS number must be between 0 and %d. It was %d.%s", + gsmnet->num_bts, bts_nr, VTY_NEWLINE); + return CMD_WARNING; + } + + bts = gsm_bts_num(gsmnet, bts_nr); + if (!bts) { + vty_out(vty, "BTS Nr. %d could not be found.%s", bts_nr, VTY_NEWLINE); + return CMD_WARNING; + } + + llist_for_each_entry_reverse(trx, &bts->trx_list, list) + gsm_bts_trx_set_system_infos(trx); + + return CMD_SUCCESS; +} + + DEFUN(smscb_cmd, smscb_cmd_cmd, "bts <0-255> smscb-command <1-4> HEXSTRING", "BTS related commands\n" "BTS Number\n" @@ -4061,6 +4104,20 @@ rsl_ipacc_mdcx(lchan, ntohl(ia.s_addr), port, 0); return CMD_SUCCESS; } + +DEFUN(ctrl_trap, ctrl_trap_cmd, + "ctrl-interface generate-trap TRAP VALUE", + "Commands related to the CTRL Interface\n" + "Generate a TRAP for test purpose\n" + "Identity/Name of the TRAP variable\n" + "Value of the TRAP variable\n") +{ + struct gsm_network *net = gsmnet_from_vty(vty); + + ctrl_cmd_send_trap(net->ctrl, argv[0], (char *) argv[1]); + return CMD_SUCCESS; +} + extern int bsc_vty_init_extra(void); int bsc_vty_init(struct gsm_network *network) @@ -4256,10 +4313,12 @@ install_element(ENABLE_NODE, &drop_bts_cmd); install_element(ENABLE_NODE, &restart_bts_cmd); + install_element(ENABLE_NODE, &bts_resend_cmd); install_element(ENABLE_NODE, &pdch_act_cmd); install_element(ENABLE_NODE, &lchan_act_cmd); install_element(ENABLE_NODE, &lchan_mdcx_cmd); install_element(ENABLE_NODE, &smscb_cmd_cmd); + install_element(ENABLE_NODE, &ctrl_trap_cmd); abis_nm_vty_init(); abis_om2k_vty_init(); diff --git a/src/libbsc/handover_logic.c b/src/libbsc/handover_logic.c index c03563f..57d1dcd 100644 --- a/src/libbsc/handover_logic.c +++ b/src/libbsc/handover_logic.c @@ -282,6 +282,7 @@ new_lchan->conn->ho_lchan = NULL; new_lchan->conn->lchan = new_lchan; + new_lchan->conn->bts = new_lchan->ts->trx->bts; ho->old_lchan->conn = NULL; lchan_release(ho->old_lchan, 0, RSL_REL_LOCAL_END); diff --git a/src/libbsc/net_init.c b/src/libbsc/net_init.c index bc5ed35..9d54319 100644 --- a/src/libbsc/net_init.c +++ b/src/libbsc/net_init.c @@ -44,10 +44,17 @@ net->num_bts = 0; net->reject_cause = GSM48_REJECT_ROAMING_NOT_ALLOWED; net->T3101 = GSM_T3101_DEFAULT; + net->T3103 = GSM_T3103_DEFAULT; net->T3105 = GSM_T3105_DEFAULT; + net->T3107 = GSM_T3107_DEFAULT; + net->T3109 = GSM_T3109_DEFAULT; + net->T3111 = GSM_T3111_DEFAULT; net->T3113 = GSM_T3113_DEFAULT; + net->T3115 = GSM_T3115_DEFAULT; + net->T3117 = GSM_T3117_DEFAULT; + net->T3119 = GSM_T3119_DEFAULT; net->T3122 = GSM_T3122_DEFAULT; - /* FIXME: initialize all other timers! */ + net->T3141 = GSM_T3141_DEFAULT; /* default set of handover parameters */ net->handover.win_rxlev_avg = 10; @@ -61,6 +68,10 @@ /* init statistics */ net->bsc_ctrs = rate_ctr_group_alloc(net, &bsc_ctrg_desc, 0); + if (!net->bsc_ctrs) { + talloc_free(net); + return NULL; + } gsm_net_update_ctype(net); diff --git a/src/libcommon-cs/common_cs.c b/src/libcommon-cs/common_cs.c index 8e19bb2..99206c8 100644 --- a/src/libcommon-cs/common_cs.c +++ b/src/libcommon-cs/common_cs.c @@ -68,6 +68,10 @@ /* init statistics */ net->msc_ctrs = rate_ctr_group_alloc(net, &msc_ctrg_desc, 0); + if (!net->msc_ctrs) { + talloc_free(net); + return NULL; + } net->active_calls = osmo_counter_alloc("msc.active_calls"); net->mncc_recv = mncc_recv; diff --git a/src/libcommon/gsm_data.c b/src/libcommon/gsm_data.c index b5bf059..7be2240 100644 --- a/src/libcommon/gsm_data.c +++ b/src/libcommon/gsm_data.c @@ -254,12 +254,13 @@ if (!model && type != GSM_BTS_TYPE_UNKNOWN) return NULL; - bts = gsm_bts_alloc(net); + bts = gsm_bts_alloc(net, net->num_bts); if (!bts) return NULL; + net->num_bts++; + bts->network = net; - bts->nr = net->num_bts++; bts->type = type; bts->model = model; bts->bsic = bsic; diff --git a/src/libcommon/gsm_data_shared.c b/src/libcommon/gsm_data_shared.c index 8992636..2696273 100644 --- a/src/libcommon/gsm_data_shared.c +++ b/src/libcommon/gsm_data_shared.c @@ -312,7 +312,7 @@ .initial_mcs = 6, }; -struct gsm_bts *gsm_bts_alloc(void *ctx) +struct gsm_bts *gsm_bts_alloc(void *ctx, uint8_t bts_num) { struct gsm_bts *bts = talloc_zero(ctx, struct gsm_bts); int i; @@ -320,6 +320,7 @@ if (!bts) return NULL; + bts->nr = bts_num; bts->num_trx = 0; INIT_LLIST_HEAD(&bts->trx_list); bts->ms_max_power = 15; /* dBm */ @@ -643,11 +644,14 @@ switch (pchan) { case GSM_PCHAN_TCH_F: - case GSM_PCHAN_PDCH: case GSM_PCHAN_TCH_F_PDCH: OSMO_ASSERT(lchan_nr == 0); cbits = 0x01; break; + case GSM_PCHAN_PDCH: + OSMO_ASSERT(lchan_nr == 0); + cbits = RSL_CHAN_OSMO_PDCH >> 3; + break; case GSM_PCHAN_TCH_H: OSMO_ASSERT(lchan_nr < 2); cbits = 0x02; diff --git a/src/libmgcp/mgcp_osmux.c b/src/libmgcp/mgcp_osmux.c index b46a80e..c52984b 100644 --- a/src/libmgcp/mgcp_osmux.c +++ b/src/libmgcp/mgcp_osmux.c @@ -340,8 +340,7 @@ if (endp->osmux.state == OSMUX_STATE_ENABLED) goto out; - if (osmux_enable_endpoint(endp, OSMUX_ROLE_BSC_NAT, - &addr->sin_addr, addr->sin_port) < 0 ){ + if (osmux_enable_endpoint(endp, &addr->sin_addr, addr->sin_port) < 0 ) { LOGP(DMGCP, LOGL_ERROR, "Could not enable osmux in endpoint %d\n", ENDPOINT_NUMBER(endp)); @@ -433,8 +432,7 @@ return 0; } -int osmux_enable_endpoint(struct mgcp_endpoint *endp, int role, - struct in_addr *addr, uint16_t port) +int osmux_enable_endpoint(struct mgcp_endpoint *endp, struct in_addr *addr, uint16_t port) { /* If osmux is enabled, initialize the output handler. This handler is * used to reconstruct the RTP flow from osmux. The RTP SSRC is @@ -522,8 +520,7 @@ return 0; if (endp->osmux.state == OSMUX_STATE_ACTIVATING) { - if (osmux_enable_endpoint(endp, OSMUX_ROLE_BSC, - &endp->net_end.addr, + if (osmux_enable_endpoint(endp, &endp->net_end.addr, htons(endp->cfg->osmux_port)) < 0) { LOGP(DMGCP, LOGL_ERROR, "Could not activate osmux in endpoint %d\n", diff --git a/src/libmgcp/mgcp_protocol.c b/src/libmgcp/mgcp_protocol.c index 78e41f1..96542c5 100644 --- a/src/libmgcp/mgcp_protocol.c +++ b/src/libmgcp/mgcp_protocol.c @@ -277,10 +277,12 @@ if (!addr) addr = mgcp_net_src_addr(endp); - if (endp->osmux.state == OSMUX_STATE_NEGOTIATING) + if (endp->osmux.state == OSMUX_STATE_NEGOTIATING) { sprintf(osmux_extension, "\nX-Osmux: %u", endp->osmux.cid); - else + endp->osmux.state = OSMUX_STATE_ACTIVATING; + } else { osmux_extension[0] = '\0'; + } len = snprintf(sdp_record, sizeof(sdp_record), "I: %u%s\n\n", endp->ci, osmux_extension); diff --git a/src/libmsc/Makefile.am b/src/libmsc/Makefile.am index 16154ff..4726bbe 100644 --- a/src/libmsc/Makefile.am +++ b/src/libmsc/Makefile.am @@ -30,6 +30,7 @@ db.c \ gsm_04_08.c \ gsm_04_11.c \ + gsm_04_14.c \ gsm_04_80.c \ gsm_subscriber.c \ iucs.c \ diff --git a/src/libmsc/db.c b/src/libmsc/db.c index 28e9782..ae7e287 100644 --- a/src/libmsc/db.c +++ b/src/libmsc/db.c @@ -48,7 +48,7 @@ static char *db_dirname = NULL; static dbi_conn conn; -#define SCHEMA_REVISION "4" +#define SCHEMA_REVISION "5" enum { SCHEMA_META, @@ -122,6 +122,8 @@ "valid_until TIMESTAMP, " "reply_path_req INTEGER NOT NULL, " "status_rep_req INTEGER NOT NULL, " + "is_report INTEGER NOT NULL, " + "msg_ref INTEGER NOT NULL, " "protocol_id INTEGER NOT NULL, " "data_coding_scheme INTEGER NOT NULL, " "ud_hdr_ind INTEGER NOT NULL, " @@ -378,6 +380,152 @@ return -EINVAL; } +/* Just like v3, but there is a new message reference field for status reports, + * that is set to zero for existing entries since there is no way we can infer + * this. + */ +static struct gsm_sms *sms_from_result_v4(dbi_result result) +{ + struct gsm_sms *sms = sms_alloc(); + const unsigned char *user_data; + const char *text, *addr; + + if (!sms) + return NULL; + + sms->id = dbi_result_get_ulonglong(result, "id"); + + sms->reply_path_req = dbi_result_get_ulonglong(result, "reply_path_req"); + sms->status_rep_req = dbi_result_get_ulonglong(result, "status_rep_req"); + sms->ud_hdr_ind = dbi_result_get_ulonglong(result, "ud_hdr_ind"); + sms->protocol_id = dbi_result_get_ulonglong(result, "protocol_id"); + sms->data_coding_scheme = dbi_result_get_ulonglong(result, + "data_coding_scheme"); + + addr = dbi_result_get_string(result, "src_addr"); + osmo_strlcpy(sms->src.addr, addr, sizeof(sms->src.addr)); + sms->src.ton = dbi_result_get_ulonglong(result, "src_ton"); + sms->src.npi = dbi_result_get_ulonglong(result, "src_npi"); + + addr = dbi_result_get_string(result, "dest_addr"); + osmo_strlcpy(sms->dst.addr, addr, sizeof(sms->dst.addr)); + sms->dst.ton = dbi_result_get_ulonglong(result, "dest_ton"); + sms->dst.npi = dbi_result_get_ulonglong(result, "dest_npi"); + + sms->user_data_len = dbi_result_get_field_length(result, "user_data"); + user_data = dbi_result_get_binary(result, "user_data"); + if (sms->user_data_len > sizeof(sms->user_data)) + sms->user_data_len = (uint8_t) sizeof(sms->user_data); + memcpy(sms->user_data, user_data, sms->user_data_len); + + text = dbi_result_get_string(result, "text"); + if (text) + osmo_strlcpy(sms->text, text, sizeof(sms->text)); + return sms; +} + +static int update_db_revision_4(void) +{ + dbi_result result; + struct gsm_sms *sms; + + LOGP(DDB, LOGL_NOTICE, "Going to migrate from revision 4\n"); + + result = dbi_conn_query(conn, "BEGIN EXCLUSIVE TRANSACTION"); + if (!result) { + LOGP(DDB, LOGL_ERROR, + "Failed to begin transaction (upgrade from rev 4)\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_4"); + if (!result) { + LOGP(DDB, LOGL_ERROR, + "Failed to rename the old SMS table (upgrade from rev 4).\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 4).\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_4"); + if (!result) { + LOGP(DDB, LOGL_ERROR, + "Failed fetch messages from the old SMS table (upgrade from rev 4).\n"); + goto rollback; + } + while (dbi_result_next_row(result)) { + sms = sms_from_result_v4(result); + if (db_sms_store(sms) != 0) { + LOGP(DDB, LOGL_ERROR, "Failed to store message to the new SMS table(upgrade from rev 4).\n"); + sms_free(sms); + dbi_result_free(result); + goto rollback; + } + sms_free(sms); + } + dbi_result_free(result); + + /* Remove the temporary table */ + result = dbi_conn_query(conn, "DROP TABLE SMS_4"); + if (!result) { + LOGP(DDB, LOGL_ERROR, + "Failed to drop the old SMS table (upgrade from rev 4).\n"); + goto rollback; + } + dbi_result_free(result); + + /* We're done. Bump DB Meta revision to 4 */ + result = dbi_conn_query(conn, + "UPDATE Meta " + "SET value = '5' " + "WHERE key = 'revision'"); + if (!result) { + LOGP(DDB, LOGL_ERROR, + "Failed to update DB schema revision (upgrade from rev 4).\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 4)\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 4).\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 4).\n"); + else + dbi_result_free(result); + return -EINVAL; +} + static int check_db_revision(void) { dbi_result result; @@ -420,6 +568,9 @@ goto error; case 3: if (update_db_revision_3()) + goto error; + case 4: + if (update_db_revision_4()) goto error; /* The end of waterfall */ @@ -546,20 +697,23 @@ result = dbi_conn_queryf(conn, "INSERT INTO SMS " "(created, valid_until, " - "reply_path_req, status_rep_req, protocol_id, " - "data_coding_scheme, ud_hdr_ind, " + "reply_path_req, status_rep_req, is_report, " + "msg_ref, protocol_id, data_coding_scheme, " + "ud_hdr_ind, " "user_data, text, " "dest_addr, dest_ton, dest_npi, " "src_addr, src_ton, src_npi) VALUES " "(datetime('now'), %u, " "%u, %u, %u, " - "%u, %u, " + "%u, %u, %u, " + "%u, " "%s, %s, " "%s, %u, %u, " "%s, %u, %u)", validity_timestamp, - sms->reply_path_req, sms->status_rep_req, sms->protocol_id, - sms->data_coding_scheme, sms->ud_hdr_ind, + sms->reply_path_req, sms->status_rep_req, sms->is_report, + sms->msg_ref, sms->protocol_id, sms->data_coding_scheme, + sms->ud_hdr_ind, q_udata, q_text, q_daddr, sms->dst.ton, sms->dst.npi, q_saddr, sms->src.ton, sms->src.npi); @@ -588,13 +742,15 @@ /* FIXME: validity */ /* FIXME: those should all be get_uchar, but sqlite3 is braindead */ + sms->created = dbi_result_get_datetime(result, "created"); sms->reply_path_req = dbi_result_get_ulonglong(result, "reply_path_req"); sms->status_rep_req = dbi_result_get_ulonglong(result, "status_rep_req"); + sms->is_report = dbi_result_get_ulonglong(result, "is_report"); + sms->msg_ref = dbi_result_get_ulonglong(result, "msg_ref"); sms->ud_hdr_ind = dbi_result_get_ulonglong(result, "ud_hdr_ind"); sms->protocol_id = dbi_result_get_ulonglong(result, "protocol_id"); sms->data_coding_scheme = dbi_result_get_ulonglong(result, "data_coding_scheme"); - /* sms->msg_ref is temporary and not stored in DB */ sms->dst.npi = dbi_result_get_ulonglong(result, "dest_npi"); sms->dst.ton = dbi_result_get_ulonglong(result, "dest_ton"); diff --git a/src/libmsc/gsm_04_08.c b/src/libmsc/gsm_04_08.c index d97bde2..28cba5b 100644 --- a/src/libmsc/gsm_04_08.c +++ b/src/libmsc/gsm_04_08.c @@ -43,6 +43,7 @@ #include #include #include +#include #include #include #include @@ -496,12 +497,19 @@ else { /* Need to get GSM offset and convert into 15 min units */ /* This probably breaks if gmtoff returns a value not evenly divisible by 15? */ - local_time = localtime(&cur_t); #ifdef HAVE_TM_GMTOFF_IN_TM + local_time = localtime(&cur_t); tzunits = (local_time->tm_gmtoff/60)/15; #else -#warning find a portable way to obtain the timezone offset - tzunits = 0; + /* find timezone offset */ + time_t utc; + double offsetFromUTC; + utc = mktime(gmt_time); + local_time = localtime(&cur_t); + offsetFromUTC = difftime(cur_t, utc); + if (local_time->tm_isdst) + offsetFromUTC += 3600.0; + tzunits = ((int)offsetFromUTC) / 60 / 15; #endif if (tzunits < 0) { tzunits = tzunits/-1; @@ -3072,6 +3080,9 @@ case GSM48_PDISC_NC_SS: rc = handle_rcv_ussd(conn, msg); break; + case GSM48_PDISC_TEST: + rc = gsm0414_rcv_test(conn, msg); + break; default: LOGP(DRLL, LOGL_NOTICE, "Unknown " "GSM 04.08 discriminator 0x%02x\n", pdisc); diff --git a/src/libmsc/gsm_04_11.c b/src/libmsc/gsm_04_11.c index bdf2ad7..c5bcce7 100644 --- a/src/libmsc/gsm_04_11.c +++ b/src/libmsc/gsm_04_11.c @@ -189,7 +189,7 @@ return gsm411_smc_send(&trans->sms.smc_inst, msg_type, msg); } -static int gsm340_rx_sms_submit(struct msgb *msg, struct gsm_sms *gsms) +static int gsm340_rx_sms_submit(struct gsm_sms *gsms) { if (db_sms_store(gsms) != 0) { LOGP(DLSMS, LOGL_ERROR, "Failed to store SMS in Database\n"); @@ -215,9 +215,9 @@ { uint8_t *smsp; uint8_t oa[12]; /* max len per 03.40 */ - uint8_t oa_len = 0; uint8_t octet_len; unsigned int old_msg_len = msg->len; + int oa_len; /* generate first octet with masked bits */ smsp = msgb_put(msg, 1); @@ -235,6 +235,9 @@ /* generate originator address */ oa_len = gsm340_gen_oa_sub(oa, sizeof(oa), &sms->src); + if (oa_len < 0) + return -ENOSPC; + smsp = msgb_put(msg, oa_len); memcpy(smsp, oa, oa_len); @@ -279,8 +282,55 @@ return msg->len - old_msg_len; } -int sms_route_mt_sms(struct gsm_subscriber_connection *conn, struct msgb *msg, - struct gsm_sms *gsms, uint8_t sms_mti, bool *deferred) +/* As defined by GSM 03.40, Section 9.2.2.3. */ +static int gsm340_gen_sms_status_report_tpdu(struct msgb *msg, + struct gsm_sms *sms) +{ + unsigned int old_msg_len = msg->len; + uint8_t oa[12]; /* max len per 03.40 */ + uint8_t *smsp; + int oa_len; + + /* generate first octet with masked bits */ + smsp = msgb_put(msg, 1); + /* TP-MTI (message type indicator) */ + *smsp = GSM340_SMS_STATUS_REP_SC2MS; + /* TP-MMS (more messages to send) */ + if (0 /* FIXME */) + *smsp |= 0x04; + /* TP-MR (message reference) */ + smsp = msgb_put(msg, 1); + *smsp = sms->msg_ref; + + /* generate recipient address */ + oa_len = gsm340_gen_oa_sub(oa, sizeof(oa), &sms->src); + if (oa_len < 0) + return -ENOSPC; + + smsp = msgb_put(msg, oa_len); + memcpy(smsp, oa, oa_len); + + /* generate TP-SCTS (Service centre timestamp) */ + smsp = msgb_put(msg, 7); + gsm340_gen_scts(smsp, sms->created); + + /* generate TP-DT (Discharge time, in TP-SCTS format). */ + smsp = msgb_put(msg, 7); + gsm340_gen_scts(smsp, sms->created); + + /* TP-ST (status) */ + smsp = msgb_put(msg, 1); + /* 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); + + return msg->len - old_msg_len; +} + +static int sms_route_mt_sms(struct gsm_subscriber_connection *conn, + struct gsm_sms *gsms) { int rc; @@ -294,8 +344,9 @@ * delivery of the SMS. */ if (smpp_first) { - rc = smpp_try_deliver(gsms, conn, deferred); + rc = smpp_try_deliver(gsms, conn); if (rc == GSM411_RP_CAUSE_MO_NUM_UNASSIGNED) + /* unknown subscriber, try local */ goto try_local; if (rc < 0) { LOGP(DLSMS, LOGL_ERROR, "%s: SMS delivery error: %d.", @@ -322,7 +373,7 @@ return GSM411_RP_CAUSE_MO_NUM_UNASSIGNED; } - rc = smpp_try_deliver(gsms, conn, deferred); + rc = smpp_try_deliver(gsms, conn); if (rc == GSM411_RP_CAUSE_MO_NUM_UNASSIGNED) { rate_ctr_inc(&conn->network->msc_ctrs->ctr[MSC_CTR_SMS_NO_RECEIVER]); } else if (rc < 0) { @@ -337,27 +388,7 @@ rc = GSM411_RP_CAUSE_MO_NUM_UNASSIGNED; rate_ctr_inc(&conn->network->msc_ctrs->ctr[MSC_CTR_SMS_NO_RECEIVER]); #endif - return rc; } - - switch (sms_mti) { - case GSM340_SMS_SUBMIT_MS2SC: - /* MS is submitting a SMS */ - rc = gsm340_rx_sms_submit(msg, gsms); - break; - case GSM340_SMS_COMMAND_MS2SC: - case GSM340_SMS_DELIVER_REP_MS2SC: - LOGP(DLSMS, 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); - rc = GSM411_RP_CAUSE_IE_NOTEXIST; - break; - } - - if (!rc && !gsms->receiver) - rc = GSM411_RP_CAUSE_MO_NUM_UNASSIGNED; return rc; } @@ -366,7 +397,7 @@ /* process an incoming TPDU (called from RP-DATA) * return value > 0: RP CAUSE for ERROR; < 0: silent error; 0 = success */ static int gsm340_rx_tpdu(struct gsm_trans *trans, struct msgb *msg, - uint32_t gsm411_msg_ref, bool *deferred) + uint32_t gsm411_msg_ref) { struct gsm_subscriber_connection *conn = trans->conn; uint8_t *smsp = msgb_sms(msg); @@ -387,7 +418,7 @@ /* invert those fields where 0 means active/present */ sms_mti = *smsp & 0x03; sms_vpf = (*smsp & 0x18) >> 3; - gsms->status_rep_req = (*smsp & 0x20); + gsms->status_rep_req = (*smsp & 0x20) >> 5; gsms->ud_hdr_ind = (*smsp & 0x40); /* * Not evaluating MMS (More Messages to Send) because the @@ -487,10 +518,29 @@ /* FIXME: This looks very wrong */ send_signal(0, NULL, gsms, 0); - rc = sms_route_mt_sms(conn, msg, gsms, sms_mti, deferred); + rc = sms_route_mt_sms(conn, gsms); + + /* This SMS got routed through SMPP or no receiver exists. */ + if (!gsms->receiver) + return rc; + + switch (sms_mti) { + case GSM340_SMS_SUBMIT_MS2SC: + /* MS is submitting a SMS */ + rc = gsm340_rx_sms_submit(gsms); + break; + case GSM340_SMS_COMMAND_MS2SC: + case GSM340_SMS_DELIVER_REP_MS2SC: + LOGP(DLSMS, 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); + rc = GSM411_RP_CAUSE_IE_NOTEXIST; + break; + } out: - if (!deferred) - sms_free(gsms); + sms_free(gsms); return rc; } @@ -543,7 +593,6 @@ uint8_t dst_len, uint8_t *dst, uint8_t tpdu_len, uint8_t *tpdu) { - bool deferred = false; int rc = 0; if (src_len && src) @@ -560,8 +609,8 @@ DEBUGP(DLSMS, "DST(%u,%s)\n", dst_len, osmo_hexdump(dst, dst_len)); - rc = gsm340_rx_tpdu(trans, msg, rph->msg_ref, &deferred); - if (rc == 0 && !deferred) + rc = gsm340_rx_tpdu(trans, msg, rph->msg_ref); + if (rc == 0) return gsm411_send_rp_ack(trans, rph->msg_ref); else if (rc > 0) return gsm411_send_rp_error(trans, rph->msg_ref, rc); @@ -595,6 +644,62 @@ rpud_len, rp_ud); } +static struct gsm_sms *sms_report_alloc(struct gsm_sms *sms) +{ + struct gsm_sms *sms_report; + int len; + + sms_report = sms_alloc(); + OSMO_ASSERT(sms_report); + + sms_report->msg_ref = sms->msg_ref; + sms_report->protocol_id = sms->protocol_id; + sms_report->data_coding_scheme = GSM338_DCS_1111_8BIT_DATA; + + /* Invert address to send status report back to origin. */ + sms_report->src = sms->dst; + sms_report->dst = sms->src; + + /* As specified by Appendix B. Delivery Receipt Format. + * TODO: Many fields in this string are just set with dummy values, + * revisit this. + */ + len = snprintf((char *)sms_report->user_data, + sizeof(sms_report->user_data), + "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); + + /* This represents a sms report. */ + sms_report->is_report = true; + + return sms_report; +} + +static void sms_status_report(struct gsm_sms *gsms, + struct gsm_subscriber_connection *conn) +{ + struct gsm_sms *sms_report; + int rc; + + sms_report = sms_report_alloc(gsms); + + rc = sms_route_mt_sms(conn, sms_report); + if (rc < 0) { + LOGP(DLSMS, LOGL_ERROR, + "Failed to send status report! err=%d\n", rc); + } + + /* No route via SMPP, send the GSM 03.40 status-report now. */ + if (gsms->receiver) + gsm340_rx_sms_submit(sms_report); + + LOGP(DLSMS, LOGL_NOTICE, "Status report has been sent\n"); + + sms_free(sms_report); +} + /* Receive a 04.11 RP-ACK message (response to RP-DATA from us) */ static int gsm411_rx_rp_ack(struct msgb *msg, struct gsm_trans *trans, struct gsm411_rp_hdr *rph) @@ -615,6 +720,9 @@ db_sms_mark_delivered(sms); send_signal(S_SMS_DELIVERED, trans, sms, 0); + + if (sms->status_rep_req) + sms_status_report(sms, trans->conn); sms_free(sms); trans->sms.sms = NULL; @@ -940,8 +1048,13 @@ /* obtain a pointer for the rp_ud_len, so we can fill it later */ rp_ud_len = (uint8_t *)msgb_put(msg, 1); - /* generate the 03.40 SMS-DELIVER TPDU */ - rc = gsm340_gen_sms_deliver_tpdu(msg, sms); + if (sms->is_report) { + /* generate the 03.40 SMS-STATUS-REPORT TPDU */ + rc = gsm340_gen_sms_status_report_tpdu(msg, sms); + } else { + /* generate the 03.40 SMS-DELIVER TPDU */ + rc = gsm340_gen_sms_deliver_tpdu(msg, sms); + } if (rc < 0) { send_signal(S_SMS_UNKNOWN_ERROR, trans, sms, 0); sms_free(sms); diff --git a/src/libmsc/gsm_04_14.c b/src/libmsc/gsm_04_14.c new file mode 100644 index 0000000..b529f4c --- /dev/null +++ b/src/libmsc/gsm_04_14.c @@ -0,0 +1,133 @@ +/* GSM MS Testing Layer 3 messages + * 3GPP TS 44.014 / GSM TS 04.14 */ + +/* (C) 2017 by Harald Welte + * + * All Rights Reserved + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + * + */ + +#include +#include +#include + +#include "bscconfig.h" + +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include + +static struct msgb *create_gsm0414_msg(uint8_t msg_type) +{ + struct msgb *msg = gsm48_msgb_alloc_name("GSM 04.14"); + struct gsm48_hdr *gh; + + gh = (struct gsm48_hdr *) msgb_put(msg, sizeof(*gh) + 1); + gh->proto_discr = GSM48_PDISC_TEST; + gh->msg_type = msg_type; + return msg; +} + +static int gsm0414_conn_sendmsg(struct gsm_subscriber_connection *conn, struct msgb *msg) +{ + return msc_tx_dtap(conn, msg); +} + +static int gsm0414_tx_simple(struct gsm_subscriber_connection *conn, uint8_t msg_type) +{ + struct msgb *msg = create_gsm0414_msg(msg_type); + + return gsm0414_conn_sendmsg(conn, msg); +} + + +/* Send a CLOSE_TCH_LOOOP_CMD according to Section 8.1 */ +int gsm0414_tx_close_tch_loop_cmd(struct gsm_subscriber_connection *conn, + enum gsm414_tch_loop_mode loop_mode) +{ + struct msgb *msg = create_gsm0414_msg(GSM414_MT_CLOSE_TCH_LOOP_CMD); + uint8_t subch; + + subch = (loop_mode << 1); + msgb_put_u8(msg, subch); + + msg->lchan = conn->lchan; + return gsm0414_conn_sendmsg(conn, msg); +} + +/* Send a OPEN_LOOP_CMD according to Section 8.3 */ +int gsm0414_tx_open_loop_cmd(struct gsm_subscriber_connection *conn) +{ + return gsm0414_tx_simple(conn, GSM414_MT_OPEN_LOOP_CMD); +} + +/* Send a ACT_EMMI_CMD according to Section 8.8 */ +int gsm0414_tx_act_emmi_cmd(struct gsm_subscriber_connection *conn) +{ + return gsm0414_tx_simple(conn, GSM414_MT_ACT_EMMI_CMD); +} + +/* Send a DEACT_EMMI_CMD according to Section 8.10 */ +int gsm0414_tx_deact_emmi_cmd(struct gsm_subscriber_connection *conn) +{ + return gsm0414_tx_simple(conn, GSM414_MT_DEACT_EMMI_CMD); +} + +/* Send a TEST_INTERFACE according to Section 8.11 */ +int gsm0414_tx_test_interface(struct gsm_subscriber_connection *conn, + uint8_t tested_devs) +{ + struct msgb *msg = create_gsm0414_msg(GSM414_MT_TEST_INTERFACE); + msgb_put_u8(msg, tested_devs); + return gsm0414_conn_sendmsg(conn, msg); +} + +/* Send a RESET_MS_POSITION_STORED according to Section 8.11 */ +int gsm0414_tx_reset_ms_pos_store(struct gsm_subscriber_connection *conn, + uint8_t technology) +{ + struct msgb *msg = create_gsm0414_msg(GSM414_MT_RESET_MS_POS_STORED); + msgb_put_u8(msg, technology); + return gsm0414_conn_sendmsg(conn, msg); +} + + + +/* Entry point for incoming GSM48_PDISC_TEST received from MS */ +int gsm0414_rcv_test(struct gsm_subscriber_connection *conn, + struct msgb *msg) +{ + struct gsm48_hdr *gh = msgb_l3(msg); + + if (msgb_l3len(msg) < sizeof(*gh)) + return -1; + + LOGP(DMM, LOGL_NOTICE, "%s: Received TEST class message '%s'\n", "FIXME", + get_value_string(gsm414_msgt_names, gh->msg_type)); + + return 0; +} diff --git a/src/libmsc/smpp_openbsc.c b/src/libmsc/smpp_openbsc.c index 24a4653..431cb4d 100644 --- a/src/libmsc/smpp_openbsc.c +++ b/src/libmsc/smpp_openbsc.c @@ -73,27 +73,32 @@ return vsub; } -/*! \brief find a TLV with given tag in list of libsmpp34 TLVs */ -static struct tlv_t *find_tlv(struct tlv_t *head, uint16_t tag) +static int smpp34_submit_tlv_msg_payload(const struct tlv_t *t, + const struct submit_sm_t *submit, + const uint8_t **sms_msg, + unsigned int *sms_msg_len) { - struct tlv_t *t; - - for (t = head; t != NULL; t = t->next) { - if (t->tag == tag) - return t; + if (submit->sm_length) { + LOGP(DLSMS, LOGL_ERROR, + "SMPP cannot have payload in TLV _and_ in the header\n"); + return -1; } - return NULL; + *sms_msg = t->value.octet; + *sms_msg_len = t->length; + + return 0; } /*! \brief convert from submit_sm_t to gsm_sms */ static int submit_to_sms(struct gsm_sms **psms, struct gsm_network *net, const struct submit_sm_t *submit) { + const uint8_t *sms_msg = NULL; + unsigned int sms_msg_len = 0; struct vlr_subscr *dest; + uint16_t msg_ref = 0; struct gsm_sms *sms; struct tlv_t *t; - const uint8_t *sms_msg; - unsigned int sms_msg_len; int mode; dest = subscr_by_dst(net, submit->dest_addr_npi, @@ -106,30 +111,40 @@ return ESME_RINVDSTADR; } - t = find_tlv(submit->tlv, TLVID_message_payload); - if (t) { - if (submit->sm_length) { - /* ERROR: we cannot have both! */ - LOGP(DLSMS, LOGL_ERROR, "SMPP Cannot have payload in " - "TLV _and_ in the header\n"); - vlr_subscr_put(dest); - return ESME_ROPTPARNOTALLWD; + smpp34_tlv_for_each(t, submit->tlv) { + switch (t->tag) { + case TLVID_message_payload: + if (smpp34_submit_tlv_msg_payload(t, submit, &sms_msg, + &sms_msg_len) < 0) { + vlr_subscr_put(dest); + return ESME_ROPTPARNOTALLWD; + } + break; + case TLVID_user_message_reference: + msg_ref = t->value.val16; + break; + default: + break; } - sms_msg = t->value.octet; - sms_msg_len = t->length; - } else if (submit->sm_length > 0 && submit->sm_length < 255) { - sms_msg = submit->short_message; - sms_msg_len = submit->sm_length; - } else { - LOGP(DLSMS, LOGL_ERROR, - "SMPP neither message payload nor valid sm_length.\n"); - vlr_subscr_put(dest); - return ESME_RINVPARLEN; + } + + if (!sms_msg) { + if (submit->sm_length > 0 && submit->sm_length < 255) { + sms_msg = submit->short_message; + sms_msg_len = submit->sm_length; + } else { + LOGP(DLSMS, LOGL_ERROR, + "SMPP neither message payload nor valid sm_length.\n"); + vlr_subscr_put(dest); + return ESME_RINVPARLEN; + } } sms = sms_alloc(); sms->source = SMS_SOURCE_SMPP; sms->smpp.sequence_nr = submit->sequence_number; + sms->status_rep_req = submit->registered_delivery; + sms->msg_ref = msg_ref; /* fill in the destination address */ sms->receiver = dest; @@ -143,10 +158,13 @@ osmo_strlcpy(sms->src.addr, (char *)submit->source_addr, sizeof(sms->src.addr)); - if (submit->esm_class & 0x40) + if (submit->esm_class == SMPP34_DELIVERY_ACK) + sms->is_report = true; + + if (submit->esm_class & SMPP34_UDHI_IND) sms->ud_hdr_ind = 1; - if (submit->esm_class & 0x80) { + if (submit->esm_class & SMPP34_REPLY_PATH) { sms->reply_path_req = 1; #warning Implement reply path } @@ -222,7 +240,7 @@ sms->smpp.esme = esme; sms->protocol_id = submit->protocol_id; - switch (submit->esm_class & 3) { + switch (submit->esm_class & SMPP34_MSG_MODE_MASK) { case 0: /* default */ case 1: /* datagram */ case 3: /* store-and-forward */ @@ -419,7 +437,7 @@ memset(&tlv, 0, sizeof(tlv)); tlv.tag = tag; tlv.length = 2; - tlv.value.val16 = htons(val); + tlv.value.val16 = val; build_tlv(req_tlv, &tlv); } @@ -501,7 +519,6 @@ osmo_timer_del(&cmd->response_timer); llist_del(&cmd->list); vlr_subscr_put(cmd->vsub); - sms_free(cmd->sms); talloc_free(cmd); } @@ -518,21 +535,24 @@ struct gsm_subscriber_connection *conn; struct gsm_trans *trans; + if (cmd->is_report) + goto out; + conn = connection_for_subscr(cmd->vsub); if (!conn) { LOGP(DSMPP, LOGL_ERROR, "No connection to subscriber anymore\n"); - return; + goto out; } - trans = trans_find_by_id(conn, GSM48_PDISC_SMS, - cmd->sms->gsm411.transaction_id); + trans = trans_find_by_id(conn, GSM48_PDISC_SMS, cmd->gsm411_trans_id); if (!trans) { LOGP(DSMPP, LOGL_ERROR, "GSM transaction %u is gone\n", - cmd->sms->gsm411.transaction_id); - return; + cmd->gsm411_trans_id); + goto out; } - gsm411_send_rp_ack(trans, cmd->sms->gsm411.msg_ref); + gsm411_send_rp_ack(trans, cmd->gsm411_msg_ref); +out: smpp_cmd_free(cmd); } @@ -542,25 +562,27 @@ struct gsm_trans *trans; int gsm411_cause; + if (cmd->is_report) + goto out; + conn = connection_for_subscr(cmd->vsub); if (!conn) { LOGP(DSMPP, LOGL_ERROR, "No connection to subscriber anymore\n"); - return; + goto out; } - trans = trans_find_by_id(conn, GSM48_PDISC_SMS, - cmd->sms->gsm411.transaction_id); + trans = trans_find_by_id(conn, GSM48_PDISC_SMS, cmd->gsm411_trans_id); if (!trans) { LOGP(DSMPP, LOGL_ERROR, "GSM transaction %u is gone\n", - cmd->sms->gsm411.transaction_id); - return; + cmd->gsm411_trans_id); + goto out; } if (smpp_to_gsm411_err(status, &gsm411_cause) < 0) gsm411_cause = GSM411_RP_CAUSE_MO_NET_OUT_OF_ORDER; - gsm411_send_rp_error(trans, cmd->sms->gsm411.msg_ref, gsm411_cause); - + gsm411_send_rp_error(trans, cmd->gsm411_msg_ref, gsm411_cause); +out: smpp_cmd_free(cmd); } @@ -571,7 +593,7 @@ static int smpp_cmd_enqueue(struct osmo_esme *esme, struct vlr_subscr *vsub, struct gsm_sms *sms, - uint32_t sequence_number, bool *deferred) + uint32_t sequence_number) { struct osmo_smpp_cmd *cmd; @@ -580,7 +602,9 @@ return -1; cmd->sequence_nr = sequence_number; - cmd->sms = sms; + cmd->is_report = sms->is_report; + cmd->gsm411_msg_ref = sms->gsm411.msg_ref; + cmd->gsm411_trans_id = sms->gsm411.transaction_id; cmd->vsub = vlr_subscr_get(vsub); /* FIXME: No predefined value for this response_timer as specified by @@ -591,7 +615,6 @@ osmo_timer_setup(&cmd->response_timer, smpp_deliver_sm_cb, cmd); osmo_timer_schedule(&cmd->response_timer, 5, 0); llist_add_tail(&cmd->list, &esme->smpp_cmd_list); - *deferred = true; return 0; } @@ -609,8 +632,7 @@ } static int deliver_to_esme(struct osmo_esme *esme, struct gsm_sms *sms, - struct gsm_subscriber_connection *conn, - bool *deferred) + struct gsm_subscriber_connection *conn) { struct deliver_sm_t deliver; int mode, ret; @@ -641,15 +663,20 @@ memcpy(deliver.destination_addr, sms->dst.addr, sizeof(deliver.destination_addr)); - deliver.esm_class = 1; /* datagram mode */ + if (sms->is_report) + deliver.esm_class = SMPP34_DELIVERY_RECEIPT; + else + deliver.esm_class = SMPP34_DATAGRAM_MODE; + if (sms->ud_hdr_ind) - deliver.esm_class |= 0x40; + deliver.esm_class |= SMPP34_UDHI_IND; if (sms->reply_path_req) - deliver.esm_class |= 0x80; + deliver.esm_class |= SMPP34_REPLY_PATH; deliver.protocol_id = sms->protocol_id; deliver.priority_flag = 0; - deliver.registered_delivery = 0; + if (sms->status_rep_req) + deliver.registered_delivery = SMPP34_DELIVERY_RECEIPT_ON; /* Figure out SMPP DCS from TP-DCS */ dcs = sms->data_coding_scheme; @@ -679,8 +706,6 @@ } else { deliver.sm_length = sms->user_data_len; memcpy(deliver.short_message, sms->user_data, deliver.sm_length); - deliver.sm_length = sms->user_data_len; - memcpy(deliver.short_message, sms->user_data, deliver.sm_length); } #if BEFORE_MSCSPLIT @@ -689,12 +714,15 @@ append_osmo_tlvs(&deliver.tlv, conn->lchan); #endif + append_tlv_u16(&deliver.tlv, TLVID_user_message_reference, + sms->msg_ref); + ret = smpp_tx_deliver(esme, &deliver); if (ret < 0) return ret; return smpp_cmd_enqueue(esme, conn->vsub, sms, - deliver.sequence_number, deferred); + deliver.sequence_number); } static struct smsc *g_smsc; @@ -705,21 +733,22 @@ } int smpp_try_deliver(struct gsm_sms *sms, - struct gsm_subscriber_connection *conn, bool *deferred) + struct gsm_subscriber_connection *conn) { struct osmo_esme *esme; struct osmo_smpp_addr dst; + int rc; memset(&dst, 0, sizeof(dst)); dst.ton = sms->dst.ton; dst.npi = sms->dst.npi; memcpy(dst.addr, sms->dst.addr, sizeof(dst.addr)); - esme = smpp_route(g_smsc, &dst); - if (!esme) - return GSM411_RP_CAUSE_MO_NUM_UNASSIGNED; + rc = smpp_route(g_smsc, &dst, &esme); + if (!rc) + rc = deliver_to_esme(esme, sms, conn); - return deliver_to_esme(esme, sms, conn, deferred); + return rc; } struct smsc *smsc_from_vty(struct vty *v) diff --git a/src/libmsc/smpp_smsc.c b/src/libmsc/smpp_smsc.c index 48a1192..04afc49 100644 --- a/src/libmsc/smpp_smsc.c +++ b/src/libmsc/smpp_smsc.c @@ -270,8 +270,7 @@ } /*! \brief try to find a SMPP route (ESME) for given destination */ -struct osmo_esme * -smpp_route(const struct smsc *smsc, const struct osmo_smpp_addr *dest) +int smpp_route(const struct smsc *smsc, const struct osmo_smpp_addr *dest, struct osmo_esme **pesme) { struct osmo_smpp_route *r; struct osmo_smpp_acl *acl = NULL; @@ -314,15 +313,20 @@ struct osmo_esme *esme; DEBUGP(DSMPP, "ACL even has ESME, we can route to it!\n"); esme = acl->esme; - if (esme->bind_flags & ESME_BIND_RX) - return esme; - else + if (esme->bind_flags & ESME_BIND_RX) { + *pesme = esme; + return 0; + } else LOGP(DSMPP, LOGL_NOTICE, "[%s] is matching route, " "but not bound for Rx, discarding MO SMS\n", esme->system_id); } - return NULL; + *pesme = NULL; + if (acl) + return GSM48_CC_CAUSE_NETWORK_OOO; + else + return GSM48_CC_CAUSE_UNASSIGNED_NR; } @@ -654,6 +658,9 @@ { deliver->sequence_number = esme_inc_seq_nr(esme); + LOGP(DSMPP, LOGL_DEBUG, "[%s] Tx DELIVER-SM (from %s)\n", + esme->system_id, deliver->source_addr); + return PACK_AND_SEND(esme, deliver); } diff --git a/src/libmsc/smpp_smsc.h b/src/libmsc/smpp_smsc.h index 4bee59b..755e685 100644 --- a/src/libmsc/smpp_smsc.h +++ b/src/libmsc/smpp_smsc.h @@ -89,8 +89,10 @@ struct osmo_smpp_cmd { struct llist_head list; struct vlr_subscr *vsub; - struct gsm_sms *sms; uint32_t sequence_nr; + uint32_t gsm411_msg_ref; + uint8_t gsm411_trans_id; + bool is_report; struct osmo_timer_list response_timer; }; @@ -126,8 +128,7 @@ void smpp_esme_get(struct osmo_esme *esme); void smpp_esme_put(struct osmo_esme *esme); -struct osmo_esme * -smpp_route(const struct smsc *smsc, const struct osmo_smpp_addr *dest); +int smpp_route(const struct smsc *smsc, const struct osmo_smpp_addr *dest, struct osmo_esme **emse); struct osmo_smpp_acl *smpp_acl_alloc(struct smsc *smsc, const char *sys_id); struct osmo_smpp_acl *smpp_acl_by_system_id(struct smsc *smsc, @@ -162,5 +163,5 @@ int smpp_route_smpp_first(struct gsm_sms *sms, struct gsm_subscriber_connection *conn); int smpp_try_deliver(struct gsm_sms *sms, - struct gsm_subscriber_connection *conn, bool *deferred); + struct gsm_subscriber_connection *conn); #endif diff --git a/src/libmsc/transaction.c b/src/libmsc/transaction.c index 7289a8f..28e0914 100644 --- a/src/libmsc/transaction.c +++ b/src/libmsc/transaction.c @@ -88,6 +88,13 @@ DEBUGP(DCC, "subscr=%p, net=%p\n", vsub, net); + /* a valid subscriber is indispensable */ + if (vsub == NULL) { + LOGP(DCC, LOGL_NOTICE, + "unable to alloc transaction, invalid subscriber (NULL)\n"); + return NULL; + } + trans = talloc_zero(tall_trans_ctx, struct gsm_trans); if (!trans) return NULL; diff --git a/src/libmsc/vty_interface_layer3.c b/src/libmsc/vty_interface_layer3.c index d1bf6b3..864597d 100644 --- a/src/libmsc/vty_interface_layer3.c +++ b/src/libmsc/vty_interface_layer3.c @@ -46,6 +46,7 @@ #include #include #include +#include #include #include #include @@ -473,6 +474,97 @@ return CMD_SUCCESS; } +static int loop_by_char(uint8_t ch) +{ + switch (ch) { + case 'a': + return GSM414_LOOP_A; + case 'b': + return GSM414_LOOP_B; + case 'c': + return GSM414_LOOP_C; + case 'd': + return GSM414_LOOP_D; + case 'e': + return GSM414_LOOP_E; + case 'f': + return GSM414_LOOP_F; + case 'i': + return GSM414_LOOP_I; + } + return -1; +} + +DEFUN(subscriber_mstest_close, + subscriber_mstest_close_cmd, + "subscriber " SUBSCR_TYPES " ID ms-test close-loop (a|b|c|d|e|f|i)", + SUBSCR_HELP "Send a TS 04.14 MS Test Command to subscriber\n" + "Close a TCH Loop inside the MS\n" + "Loop Type A\n" + "Loop Type B\n" + "Loop Type C\n" + "Loop Type D\n" + "Loop Type E\n" + "Loop Type F\n" + "Loop Type I\n") +{ + struct gsm_subscriber_connection *conn; + struct gsm_network *gsmnet = gsmnet_from_vty(vty); + struct vlr_subscr *vsub = get_vsub_by_argv(gsmnet, argv[0], argv[1]); + const char *loop_str; + int loop_mode; + + if (!vsub) { + vty_out(vty, "%% No subscriber found for %s %s%s", + argv[0], argv[1], VTY_NEWLINE); + return CMD_WARNING; + } + + loop_str = argv[2]; + loop_mode = loop_by_char(loop_str[0]); + + conn = connection_for_subscr(vsub); + if (!conn) { + vty_out(vty, "%% An active connection is required for %s %s%s", + argv[0], argv[1], VTY_NEWLINE); + vlr_subscr_put(vsub); + return CMD_WARNING; + } + + gsm0414_tx_close_tch_loop_cmd(conn, loop_mode); + + return CMD_SUCCESS; +} + +DEFUN(subscriber_mstest_open, + subscriber_mstest_open_cmd, + "subscriber " SUBSCR_TYPES " ID ms-test open-loop", + SUBSCR_HELP "Send a TS 04.14 MS Test Command to subscriber\n" + "Open a TCH Loop inside the MS\n") +{ + struct gsm_subscriber_connection *conn; + struct gsm_network *gsmnet = gsmnet_from_vty(vty); + struct vlr_subscr *vsub = get_vsub_by_argv(gsmnet, argv[0], argv[1]); + + if (!vsub) { + vty_out(vty, "%% No subscriber found for %s %s%s", + argv[0], argv[1], VTY_NEWLINE); + return CMD_WARNING; + } + + conn = connection_for_subscr(vsub); + if (!conn) { + vty_out(vty, "%% An active connection is required for %s %s%s", + argv[0], argv[1], VTY_NEWLINE); + vlr_subscr_put(vsub); + return CMD_WARNING; + } + + gsm0414_tx_open_loop_cmd(conn); + + return CMD_SUCCESS; +} + DEFUN(ena_subscr_expire, ena_subscr_expire_cmd, "subscriber " SUBSCR_TYPES " ID expire", @@ -570,11 +662,11 @@ VTY_NEWLINE); vty_out(vty, "Handover : %lu attempted, %lu no_channel, %lu timeout, " "%lu completed, %lu failed%s", - net->msc_ctrs->ctr[BSC_CTR_HANDOVER_ATTEMPTED].current, - net->msc_ctrs->ctr[BSC_CTR_HANDOVER_NO_CHANNEL].current, - net->msc_ctrs->ctr[BSC_CTR_HANDOVER_TIMEOUT].current, - net->msc_ctrs->ctr[BSC_CTR_HANDOVER_COMPLETED].current, - net->msc_ctrs->ctr[BSC_CTR_HANDOVER_FAILED].current, + net->bsc_ctrs->ctr[BSC_CTR_HANDOVER_ATTEMPTED].current, + net->bsc_ctrs->ctr[BSC_CTR_HANDOVER_NO_CHANNEL].current, + net->bsc_ctrs->ctr[BSC_CTR_HANDOVER_TIMEOUT].current, + net->bsc_ctrs->ctr[BSC_CTR_HANDOVER_COMPLETED].current, + net->bsc_ctrs->ctr[BSC_CTR_HANDOVER_FAILED].current, VTY_NEWLINE); vty_out(vty, "SMS MO : %lu submitted, %lu no receiver%s", net->msc_ctrs->ctr[MSC_CTR_SMS_SUBMITTED].current, @@ -851,6 +943,8 @@ install_element_ve(&subscriber_silent_call_start_cmd); install_element_ve(&subscriber_silent_call_stop_cmd); install_element_ve(&subscriber_ussd_notify_cmd); + install_element_ve(&subscriber_mstest_close_cmd); + install_element_ve(&subscriber_mstest_open_cmd); install_element_ve(&subscriber_update_cmd); install_element_ve(&show_stats_cmd); install_element_ve(&show_smsqueue_cmd); diff --git a/src/osmo-bsc/osmo_bsc_main.c b/src/osmo-bsc/osmo_bsc_main.c index ee094d6..90651b9 100644 --- a/src/osmo-bsc/osmo_bsc_main.c +++ b/src/osmo-bsc/osmo_bsc_main.c @@ -162,6 +162,7 @@ switch (signal) { case SIGINT: + case SIGTERM: bsc_shutdown_net(bsc_gsmnet); osmo_signal_dispatch(SS_L_GLOBAL, S_L_GLOBAL_SHUTDOWN, NULL); sleep(3); @@ -280,6 +281,7 @@ } signal(SIGINT, &signal_handler); + signal(SIGTERM, &signal_handler); signal(SIGABRT, &signal_handler); signal(SIGUSR1, &signal_handler); signal(SIGUSR2, &signal_handler); diff --git a/src/osmo-msc/msc_main.c b/src/osmo-msc/msc_main.c index 4166159..723c0e6 100644 --- a/src/osmo-msc/msc_main.c +++ b/src/osmo-msc/msc_main.c @@ -140,7 +140,6 @@ printf(" -c --config-file filename The config file to use.\n"); printf(" -s --disable-color\n"); printf(" -l --database db-name The database to use.\n"); - printf(" -a --authorize-everyone Authorize every new subscriber. Dangerous!\n"); printf(" -T --timestamp Prefix every log line with a timestamp.\n"); printf(" -V --version Print the version of OpenBSC.\n"); printf(" -P --rtp-proxy Enable the RTP Proxy code inside OpenBSC.\n"); @@ -163,7 +162,6 @@ {"config-file", 1, 0, 'c'}, {"disable-color", 0, 0, 's'}, {"database", 1, 0, 'l'}, - {"authorize-everyone", 0, 0, 'a'}, {"pcap", 1, 0, 'p'}, {"timestamp", 0, 0, 'T'}, {"version", 0, 0, 'V' }, @@ -268,6 +266,7 @@ switch (signal) { case SIGINT: + case SIGTERM: msc_network_shutdown(msc_network); osmo_signal_dispatch(SS_L_GLOBAL, S_L_GLOBAL_SHUTDOWN, NULL); sleep(3); @@ -474,6 +473,7 @@ osmo_timer_schedule(&db_sync_timer, DB_SYNC_INTERVAL); signal(SIGINT, &signal_handler); + signal(SIGTERM, &signal_handler); signal(SIGABRT, &signal_handler); signal(SIGUSR1, &signal_handler); signal(SIGUSR2, &signal_handler); diff --git a/src/utils/smpp_mirror.c b/src/utils/smpp_mirror.c index 95df5f2..c570505 100644 --- a/src/utils/smpp_mirror.c +++ b/src/utils/smpp_mirror.c @@ -95,12 +95,23 @@ } /* FIXME: merge with smpp_smsc.c */ +static struct tlv_t *find_tlv(struct tlv_t *head, uint16_t tag) +{ + struct tlv_t *t; + + for (t = head; t != NULL; t = t->next) { + if (t->tag == tag) + return t; + } + return NULL; +} static int smpp_handle_deliver(struct esme *esme, struct msgb *msg) { struct deliver_sm_t deliver; struct deliver_sm_resp_t deliver_r; struct submit_sm_t submit; + tlv_t *t; int rc; memset(&deliver, 0, sizeof(deliver)); @@ -129,7 +140,15 @@ OSMO_MIN(sizeof(submit.source_addr), sizeof(deliver.destination_addr))); - submit.esm_class = deliver.esm_class; + /* Mirror delivery receipts as a delivery acknowledgements. */ + if (deliver.esm_class == 0x04) { + LOGP(DSMPP, LOGL_DEBUG, "%s\n", deliver.short_message); + submit.esm_class = 0x08; + } else { + submit.esm_class = deliver.esm_class; + } + + submit.registered_delivery = deliver.registered_delivery; submit.protocol_id = deliver.protocol_id; submit.priority_flag = deliver.priority_flag; memcpy(submit.schedule_delivery_time, deliver.schedule_delivery_time, @@ -146,7 +165,18 @@ memcpy(submit.short_message, deliver.short_message, OSMO_MIN(sizeof(submit.short_message), sizeof(deliver.short_message))); - /* FIXME: TLV? */ + + /* FIXME: More TLV? */ + t = find_tlv(deliver.tlv, TLVID_user_message_reference); + if (t) { + tlv_t tlv; + + memset(&tlv, 0, sizeof(tlv)); + tlv.tag = TLVID_user_message_reference; + tlv.length = 2; + tlv.value.val16 = t->value.val16; + build_tlv(&submit.tlv, &tlv); + } return PACK_AND_SEND(esme, &submit); } diff --git a/tests/channel/channel_test.c b/tests/channel/channel_test.c index f686969..beae658 100644 --- a/tests/channel/channel_test.c +++ b/tests/channel/channel_test.c @@ -31,6 +31,35 @@ #include #include +void test_bts_debug_print(void) +{ + struct gsm_network *network; + struct gsm_bts *bts; + struct gsm_bts_trx *trx; + + printf("Testing the lchan printing:"); + + /* Create a dummy network */ + network = bsc_network_init(tall_bsc_ctx, 1, 1, NULL); + if (!network) + exit(1); + /* Add a BTS with some reasonanbly non-zero id */ + bts = gsm_bts_alloc(network, 45); + /* Add a second TRX to test on multiple TRXs */ + gsm_bts_trx_alloc(bts); + + llist_for_each_entry(trx, &bts->trx_list, list) { + char *name = gsm_lchan_name(&trx->ts[3].lchan[4]); + + if (name) + printf(" %s", name); + else + printf("NULL name"); + } + printf("\n"); +} + + void test_dyn_ts_subslots(void) { struct gsm_bts_trx_ts ts; @@ -66,6 +95,7 @@ osmo_init_logging(&log_info); test_dyn_ts_subslots(); + test_bts_debug_print(); return EXIT_SUCCESS; } diff --git a/tests/channel/channel_test.ok b/tests/channel/channel_test.ok index e4d625a..81d6569 100644 --- a/tests/channel/channel_test.ok +++ b/tests/channel/channel_test.ok @@ -1 +1,2 @@ Testing subslot numbers for pchan types +Testing the lchan printing: (bts=45,trx=0,ts=3,ss=4) (bts=45,trx=1,ts=3,ss=4) diff --git a/tests/db/db_test.err b/tests/db/db_test.err index fa9a54c..27e5703 100644 --- a/tests/db/db_test.err +++ b/tests/db/db_test.err @@ -1,2 +1,3 @@ Going to migrate from revision 3 +Going to migrate from revision 4  \ No newline at end of file diff --git a/tests/gprs/gprs_test.c b/tests/gprs/gprs_test.c index ff77404..aac9bb8 100644 --- a/tests/gprs/gprs_test.c +++ b/tests/gprs/gprs_test.c @@ -48,101 +48,6 @@ ASSERT_FALSE(nu_is_retransmission(479, 511)); // wrapped } -static void apn_round_trip(const uint8_t *input, size_t len, const char *wanted_output) -{ - char output[len ? len : 1]; - uint8_t encoded[len + 50]; - char *out_str; - int enc_len; - - /* decode and verify we have what we want */ - out_str = gprs_apn_to_str(output, input, len); - OSMO_ASSERT(out_str); - OSMO_ASSERT(out_str == &output[0]); - OSMO_ASSERT(strlen(out_str) == strlen(wanted_output)); - OSMO_ASSERT(strcmp(out_str, wanted_output) == 0); - - /* encode and verify it */ - if (len != 0) { - enc_len = gprs_str_to_apn(encoded, ARRAY_SIZE(encoded), wanted_output); - OSMO_ASSERT(enc_len == len); - OSMO_ASSERT(memcmp(encoded, input, enc_len) == 0); - } else { - enc_len = gprs_str_to_apn(encoded, 0, wanted_output); - OSMO_ASSERT(enc_len == -1); - } -} - -static void test_gsm_03_03_apn(void) -{ - - { - /* test invalid writes */ - const uint8_t ref[10] = { 0xAB, 0xAC, 0xAD, 0xAE, 0xAF, 0xAB, 0xAC, 0xAD, 0xAE, 0xAF }; - uint8_t output[10]; - int enc_len; - - memcpy(output, ref, ARRAY_SIZE(output)); - enc_len = gprs_str_to_apn(output, 0, ""); - OSMO_ASSERT(enc_len == -1); - OSMO_ASSERT(memcmp(ref, output, ARRAY_SIZE(ref)) == 0); - - memcpy(output, ref, ARRAY_SIZE(output)); - enc_len = gprs_str_to_apn(output, 0, "foo"); - OSMO_ASSERT(enc_len == -1); - OSMO_ASSERT(memcmp(ref, output, ARRAY_SIZE(ref)) == 0); - - memcpy(output, ref, ARRAY_SIZE(output)); - enc_len = gprs_str_to_apn(output, 1, "foo"); - OSMO_ASSERT(enc_len == -1); - OSMO_ASSERT(memcmp(ref + 1, output + 1, ARRAY_SIZE(ref) - 1) == 0); - - memcpy(output, ref, ARRAY_SIZE(output)); - enc_len = gprs_str_to_apn(output, 2, "foo"); - OSMO_ASSERT(enc_len == -1); - OSMO_ASSERT(memcmp(ref + 2, output + 2, ARRAY_SIZE(ref) - 2) == 0); - - memcpy(output, ref, ARRAY_SIZE(output)); - enc_len = gprs_str_to_apn(output, 3, "foo"); - OSMO_ASSERT(enc_len == -1); - OSMO_ASSERT(memcmp(ref + 3, output + 3, ARRAY_SIZE(ref) - 3) == 0); - } - - { - /* single empty label */ - uint8_t input[] = { 0x0 }; - const char *output = ""; - apn_round_trip(input, ARRAY_SIZE(input), output); - } - - { - /* no label */ - uint8_t input[] = { }; - const char *output = ""; - apn_round_trip(input, ARRAY_SIZE(input), output); - } - - { - /* single label with A */ - uint8_t input[] = { 0x1, 65 }; - const char *output = "A"; - apn_round_trip(input, ARRAY_SIZE(input), output); - OSMO_ASSERT(gprs_apn_to_str(NULL, input, ARRAY_SIZE(input) - 1) == NULL); - } - - { - uint8_t input[] = { 0x3, 65, 66, 67, 0x2, 90, 122 }; - const char *output = "ABC.Zz"; - char tmp[strlen(output) + 1]; - apn_round_trip(input, ARRAY_SIZE(input), output); - OSMO_ASSERT(gprs_apn_to_str(tmp, input, ARRAY_SIZE(input) - 1) == NULL); - OSMO_ASSERT(gprs_apn_to_str(tmp, input, ARRAY_SIZE(input) - 2) == NULL); - OSMO_ASSERT(gprs_apn_to_str(tmp, input, ARRAY_SIZE(input) - 4) == NULL); - OSMO_ASSERT(gprs_apn_to_str(tmp, input, ARRAY_SIZE(input) - 5) == NULL); - OSMO_ASSERT(gprs_apn_to_str(tmp, input, ARRAY_SIZE(input) - 6) == NULL); - } -} - static void test_gprs_timer_enc_dec(void) { int i, u, secs, tmr; @@ -228,7 +133,6 @@ osmo_init_logging(&info); test_8_4_2(); - test_gsm_03_03_apn(); test_gprs_timer_enc_dec(); printf("Done.\n"); diff --git a/tests/gsm0408/gsm0408_test.c b/tests/gsm0408/gsm0408_test.c index 1b326ee..fcdc8f8 100644 --- a/tests/gsm0408/gsm0408_test.c +++ b/tests/gsm0408/gsm0408_test.c @@ -153,7 +153,7 @@ if (!network) exit(1); - bts = gsm_bts_alloc(network); + bts = gsm_bts_alloc(network, 0); _bts_uarfcn_add(bts, 10564, 319, 0); _bts_uarfcn_add(bts, 10612, 319, 0); @@ -168,7 +168,7 @@ if (!network) exit(1); - bts = gsm_bts_alloc(network); + bts = gsm_bts_alloc(network, 0); _bts_uarfcn_add(bts, 10564, 318, 0); _bts_uarfcn_add(bts, 10612, 319, 0); @@ -188,7 +188,7 @@ if (!network) exit(1); - bts = gsm_bts_alloc(network); + bts = gsm_bts_alloc(network, 0); /* first generate invalid SI as no UARFCN added */ gen(bts, __func__); @@ -216,7 +216,7 @@ if (!network) exit(1); - bts = gsm_bts_alloc(network); + bts = gsm_bts_alloc(network, 0); bts->si_common.si2quater_neigh_list.arfcn = bts->si_common.data.earfcn_list; bts->si_common.si2quater_neigh_list.meas_bw = bts->si_common.data.meas_bw_list; @@ -249,7 +249,7 @@ if (!network) exit(1); - bts = gsm_bts_alloc(network); + bts = gsm_bts_alloc(network, 0); bts->si_common.si2quater_neigh_list.arfcn = bts->si_common.data.earfcn_list; bts->si_common.si2quater_neigh_list.meas_bw = bts->si_common.data.meas_bw_list; diff --git a/tests/gtphub/Makefile.am b/tests/gtphub/Makefile.am index 5c834b7..f2a6b88 100644 --- a/tests/gtphub/Makefile.am +++ b/tests/gtphub/Makefile.am @@ -8,6 +8,7 @@ -ggdb3 \ $(LIBOSMOCORE_CFLAGS) \ $(LIBOSMOABIS_CFLAGS) \ + $(LIBOSMOGSM_CFLAGS) \ $(LIBGTP_CFLAGS) \ $(NULL) @@ -37,6 +38,7 @@ $(top_builddir)/src/gprs/gtphub.o \ $(top_builddir)/src/gprs/gprs_utils.o \ $(LIBOSMOCORE_LIBS) \ + $(LIBOSMOGSM_LIBS) \ $(LIBGTP_LIBS) \ -lrt \ $(NULL) diff --git a/tests/sgsn/sgsn_test.c b/tests/sgsn/sgsn_test.c index 2f1513a..d66c5dd 100644 --- a/tests/sgsn/sgsn_test.c +++ b/tests/sgsn/sgsn_test.c @@ -139,12 +139,12 @@ }; /* override, requires '-Wl,--wrap=gprs_subscr_request_auth_info' */ -int __real_gprs_subscr_request_auth_info(struct sgsn_mm_ctx *mmctx); -int (*subscr_request_auth_info_cb)(struct sgsn_mm_ctx *mmctx) = +int __real_gprs_subscr_request_auth_info(struct sgsn_mm_ctx *mmctx, const uint8_t *auts, const uint8_t *auts_rand); +int (*subscr_request_auth_info_cb)(struct sgsn_mm_ctx *mmctx, const uint8_t *auts, const uint8_t *auts_rand) = &__real_gprs_subscr_request_auth_info; -int __wrap_gprs_subscr_request_auth_info(struct sgsn_mm_ctx *mmctx) { - return (*subscr_request_auth_info_cb)(mmctx); +int __wrap_gprs_subscr_request_auth_info(struct sgsn_mm_ctx *mmctx, const uint8_t *auts, const uint8_t *auts_rand) { + return (*subscr_request_auth_info_cb)(mmctx, auts, auts_rand); }; /* override, requires '-Wl,--wrap=gsup_client_send' */ @@ -1160,7 +1160,7 @@ cleanup_test(); } -int my_subscr_request_auth_info_real_auth(struct sgsn_mm_ctx *mmctx) +int my_subscr_request_auth_info_real_auth(struct sgsn_mm_ctx *mmctx, const uint8_t *auts, const uint8_t *auts_rand) { struct gsm_auth_tuple at = { .vec.sres = {0x51, 0xe5, 0x51, 0xe5}, -- To view, visit https://gerrit.osmocom.org/3695 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Id072aa07793aceca66bd74950bc40dd504982a55 Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Sat Aug 26 21:33:03 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sat, 26 Aug 2017 21:33:03 +0000 Subject: [PATCH] libosmocore[master]: cosmetic: test for osmo-auc-gen: print error for missing binary Message-ID: Review at https://gerrit.osmocom.org/3696 cosmetic: test for osmo-auc-gen: print error for missing binary Change-Id: I98c23ae6378a16cf3b76c90d4ea0dfcf61ff3033 --- M tests/osmo-auc-gen/osmo-auc-gen_test.sh 1 file changed, 6 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/96/3696/1 diff --git a/tests/osmo-auc-gen/osmo-auc-gen_test.sh b/tests/osmo-auc-gen/osmo-auc-gen_test.sh index 7842638..132d9c3 100755 --- a/tests/osmo-auc-gen/osmo-auc-gen_test.sh +++ b/tests/osmo-auc-gen/osmo-auc-gen_test.sh @@ -1,6 +1,12 @@ #!/bin/sh osmo_auc_gen="$1" +if [ -z "$osmo_auc_gen" ]; then + echo 'Error: pass a path to the osmo-auc-gen binary as argument:' + echo ' ./osmo-auc-gen_test.sh /path/to/osmo-auc-gen' + exit 1 +fi + set -e # run the osmo-auc-gen binary verbosely without showing its absolute path -- To view, visit https://gerrit.osmocom.org/3696 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I98c23ae6378a16cf3b76c90d4ea0dfcf61ff3033 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Sat Aug 26 21:33:10 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sat, 26 Aug 2017 21:33:10 +0000 Subject: [PATCH] libosmocore[master]: osmo-auc-gen: umts: remove erratic SQN.MS printout Message-ID: Review at https://gerrit.osmocom.org/3697 osmo-auc-gen: umts: remove erratic SQN.MS printout osmo-auc-gen tries to be helpful by deriving the SQN.MS from the SQN that resulted from AUTS + milenage_gen_vec(), but there is actually no way to derive the actual AUTS SQN.MS from the resulting SQN. Completely drop the printout to prevent confusion. Adjust test suite expectations. Related: OS#2464 Change-Id: Ie2432c6d6a23818f7b3a29b1295dcbb505e2be53 --- M tests/osmo-auc-gen/osmo-auc-gen_test.ok M utils/osmo-auc-gen.c 2 files changed, 0 insertions(+), 7 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/97/3697/1 diff --git a/tests/osmo-auc-gen/osmo-auc-gen_test.ok b/tests/osmo-auc-gen/osmo-auc-gen_test.ok index fb7998f..6a78886 100644 --- a/tests/osmo-auc-gen/osmo-auc-gen_test.ok +++ b/tests/osmo-auc-gen/osmo-auc-gen_test.ok @@ -96,4 +96,3 @@ SRES: 9b36efdf Kc: 059a4f668f6fbe39 SQN: 24 -AUTS success: SQN.MS = 23 diff --git a/utils/osmo-auc-gen.c b/utils/osmo-auc-gen.c index 76c4927..fade6ec 100644 --- a/utils/osmo-auc-gen.c +++ b/utils/osmo-auc-gen.c @@ -266,11 +266,5 @@ printf("SQN:\t%" PRIu64 "\n", test_aud.u.umts.sqn); } - /* After recovering SQN.MS from AUTS, milenage_gen_vec_auts() does - * aud->u.umts.sqn++, so to show SQN.MS we need to -1 */ - if (auts_is_set) - printf("AUTS success: SQN.MS = %" PRIu64 "\n", - test_aud.u.umts.sqn - 1); - exit(0); } -- To view, visit https://gerrit.osmocom.org/3697 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ie2432c6d6a23818f7b3a29b1295dcbb505e2be53 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Sat Aug 26 21:33:10 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sat, 26 Aug 2017 21:33:10 +0000 Subject: [PATCH] libosmocore[master]: osmo-auc-gen: umts: properly request --sqn Message-ID: Review at https://gerrit.osmocom.org/3698 osmo-auc-gen: umts: properly request --sqn The user supplied an --sqn to generate a vector for, but milenage_gen_vec() performs a nontrivial SQN increment before generating the vector. To end up with the user supplied SQN, we need to reverse this increment beforehand. Do this after all cmdline args have been parsed, in case one of them modifies the IND-bitlen parameter, which affects the SQN calculations. Related: OS#2464 OS#2465 Change-Id: Ic51a8f6333fee9c02b4073ca360991d0aa69c74f --- M utils/osmo-auc-gen.c 1 file changed, 17 insertions(+), 5 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/98/3698/1 diff --git a/utils/osmo-auc-gen.c b/utils/osmo-auc-gen.c index fade6ec..87960ae 100644 --- a/utils/osmo-auc-gen.c +++ b/utils/osmo-auc-gen.c @@ -95,9 +95,11 @@ struct osmo_auth_vector _vec; struct osmo_auth_vector *vec = &_vec; uint8_t _rand[16], _auts[14]; + uint64_t sqn; int rc, option_index; int rand_is_set = 0; int auts_is_set = 0; + int sqn_is_set = 0; int fmt_triplets_dat = 0; printf("osmo-auc-gen (C) 2011-2012 by Harald Welte\n"); @@ -196,11 +198,8 @@ fprintf(stderr, "Only UMTS has SQN\n"); exit(2); } - test_aud.u.umts.sqn = strtoull(optarg, 0, 10); - /* Before calculating the UMTS auth vector, - * osmo_auth_gen_vec() increments the SQN. SQN-1 here - * to end up with the SQN the user requested. */ - test_aud.u.umts.sqn--; + sqn = strtoull(optarg, 0, 10); + sqn_is_set = 1; break; case 'r': rc = osmo_hexparse(optarg, _rand, sizeof(_rand)); @@ -246,6 +245,19 @@ memset(vec, 0, sizeof(*vec)); + if (test_aud.type == OSMO_AUTH_TYPE_UMTS) { + uint64_t seq_1 = 1LL << test_aud.u.umts.ind_bitlen; + uint64_t ind_mask = seq_1 - 1; + + if (sqn_is_set) { + /* Before calculating the UMTS auth vector, osmo_auth_gen_vec() increments SEQ. + * To end up with the SQN passed in by the user, we need to pass in SEQ-1, and + * indicate which IND slot to target. */ + test_aud.u.umts.sqn = sqn - seq_1; + test_aud.u.umts.ind = sqn & ind_mask; + } + } + if (!auts_is_set) rc = osmo_auth_gen_vec(vec, &test_aud, _rand); else -- To view, visit https://gerrit.osmocom.org/3698 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ic51a8f6333fee9c02b4073ca360991d0aa69c74f Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Sat Aug 26 21:33:10 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sat, 26 Aug 2017 21:33:10 +0000 Subject: [PATCH] libosmocore[master]: osmo-auc-gen: umts: use default of ind_bitlen = 5 instead of 0 Message-ID: Review at https://gerrit.osmocom.org/3699 osmo-auc-gen: umts: use default of ind_bitlen = 5 instead of 0 Most USIM out there seem to use IND-length = 5 bits, so do sysmousim-sjs1. Currently from initialization we are using an IND length of zero in osmo-auc-gen, which produces confusing SQN results after AUTS: Where want SQN to be incremented to the next IND array, usually +32, an IND-len of 0 makes for only +1. As result, the osmo-auc-gen_test.sh produces SQN 32 instead of 24 after receiving SQN.MS = 23 from AUTS: adjust test expectations. Related: OS#2465 Change-Id: I9fcc11fa2b5816302dcc6b72249b1ee40d5a61f5 --- M tests/osmo-auc-gen/osmo-auc-gen_test.ok M utils/osmo-auc-gen.c 2 files changed, 3 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/99/3699/1 diff --git a/tests/osmo-auc-gen/osmo-auc-gen_test.ok b/tests/osmo-auc-gen/osmo-auc-gen_test.ok index 6a78886..a1d06f0 100644 --- a/tests/osmo-auc-gen/osmo-auc-gen_test.ok +++ b/tests/osmo-auc-gen/osmo-auc-gen_test.ok @@ -89,10 +89,10 @@ This is FREE SOFTWARE with ABSOLUTELY NO WARRANTY RAND: 39fa2f4e3d523d8619a73b4f65c3e14d -AUTN: 8704f5ba55eb0000d7fc4f7f19cfc180 +AUTN: 8704f5ba55d30000541dde77ea5b1d8c IK: 27497388b6cb044648f396aa155b95ef CK: f64735036e5871319c679f4742a75ea1 RES: e229c19e791f2e41 SRES: 9b36efdf Kc: 059a4f668f6fbe39 -SQN: 24 +SQN: 32 diff --git a/utils/osmo-auc-gen.c b/utils/osmo-auc-gen.c index 87960ae..4e07fa7 100644 --- a/utils/osmo-auc-gen.c +++ b/utils/osmo-auc-gen.c @@ -138,6 +138,7 @@ break; case '3': test_aud.type = OSMO_AUTH_TYPE_UMTS; + test_aud.u.umts.ind_bitlen = 5; break; case 'a': rc = osmo_auth_alg_parse(optarg); -- To view, visit https://gerrit.osmocom.org/3699 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I9fcc11fa2b5816302dcc6b72249b1ee40d5a61f5 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Sat Aug 26 21:33:11 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sat, 26 Aug 2017 21:33:11 +0000 Subject: [PATCH] libosmocore[master]: osmo-auc-gen: umts: add --ind arg Message-ID: Review at https://gerrit.osmocom.org/3700 osmo-auc-gen: umts: add --ind arg During UMTS AKA, the caller typically indicates which IND slot the next used SQN should belong to. Without this option, osmo-auc-gen will always produce SQN from IND-slot 0. Add --ind option. Enhance the osmo-auc-gen_test.sh to expect errors with useful printouts on stderr, and add tests that verify valid --ind ranges. Related: OS#2465 Change-Id: Ib60eec80d58ca9a0a01e7fbd2bcbbd4339b1a6d8 --- M tests/osmo-auc-gen/osmo-auc-gen_test.err M tests/osmo-auc-gen/osmo-auc-gen_test.ok M tests/osmo-auc-gen/osmo-auc-gen_test.sh M utils/osmo-auc-gen.c 4 files changed, 120 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/00/3700/1 diff --git a/tests/osmo-auc-gen/osmo-auc-gen_test.err b/tests/osmo-auc-gen/osmo-auc-gen_test.err index e69de29..46ecf2e 100644 --- a/tests/osmo-auc-gen/osmo-auc-gen_test.err +++ b/tests/osmo-auc-gen/osmo-auc-gen_test.err @@ -0,0 +1,9 @@ +expecting error: +> osmo-auc-gen -3 -a milenage -r 39fa2f4e3d523d8619a73b4f65c3e14d -k EB215756028D60E3275E613320AEC880 -o FB2A3D1B360F599ABAB99DB8669F8308 -A 979498b1f72d3e28c59fa2e72f9c --ind -1 +Requested --ind 4294967295 is too large for IND bitlen of 5 +expecting error: +> osmo-auc-gen -3 -a milenage -r 39fa2f4e3d523d8619a73b4f65c3e14d -k EB215756028D60E3275E613320AEC880 -o FB2A3D1B360F599ABAB99DB8669F8308 -A 979498b1f72d3e28c59fa2e72f9c --ind 32 +Requested --ind 32 is too large for IND bitlen of 5 +expecting error: +> osmo-auc-gen -3 -a milenage -r 39fa2f4e3d523d8619a73b4f65c3e14d -k EB215756028D60E3275E613320AEC880 -o FB2A3D1B360F599ABAB99DB8669F8308 -A 979498b1f72d3e28c59fa2e72f9c --ind 42 +Requested --ind 42 is too large for IND bitlen of 5 diff --git a/tests/osmo-auc-gen/osmo-auc-gen_test.ok b/tests/osmo-auc-gen/osmo-auc-gen_test.ok index a1d06f0..278c88f 100644 --- a/tests/osmo-auc-gen/osmo-auc-gen_test.ok +++ b/tests/osmo-auc-gen/osmo-auc-gen_test.ok @@ -96,3 +96,66 @@ SRES: 9b36efdf Kc: 059a4f668f6fbe39 SQN: 32 + + +> osmo-auc-gen -3 -a milenage -r 39fa2f4e3d523d8619a73b4f65c3e14d -k EB215756028D60E3275E613320AEC880 -o FB2A3D1B360F599ABAB99DB8669F8308 -A 979498b1f72d3e28c59fa2e72f9c --ind 5 +osmo-auc-gen (C) 2011-2012 by Harald Welte +This is FREE SOFTWARE with ABSOLUTELY NO WARRANTY + +RAND: 39fa2f4e3d523d8619a73b4f65c3e14d +AUTN: 8704f5ba55d6000079267a4b347ad890 +IK: 27497388b6cb044648f396aa155b95ef +CK: f64735036e5871319c679f4742a75ea1 +RES: e229c19e791f2e41 +SRES: 9b36efdf +Kc: 059a4f668f6fbe39 +SQN: 37 + + +> osmo-auc-gen -3 -a milenage -r 39fa2f4e3d523d8619a73b4f65c3e14d -k EB215756028D60E3275E613320AEC880 -o FB2A3D1B360F599ABAB99DB8669F8308 -A 979498b1f72d3e28c59fa2e72f9c --ind 23 +osmo-auc-gen (C) 2011-2012 by Harald Welte +This is FREE SOFTWARE with ABSOLUTELY NO WARRANTY + +RAND: 39fa2f4e3d523d8619a73b4f65c3e14d +AUTN: 8704f5ba55c40000129ddaa4f5016e25 +IK: 27497388b6cb044648f396aa155b95ef +CK: f64735036e5871319c679f4742a75ea1 +RES: e229c19e791f2e41 +SRES: 9b36efdf +Kc: 059a4f668f6fbe39 +SQN: 55 + + +> osmo-auc-gen -3 -a milenage -r 39fa2f4e3d523d8619a73b4f65c3e14d -k EB215756028D60E3275E613320AEC880 -o FB2A3D1B360F599ABAB99DB8669F8308 -A 979498b1f72d3e28c59fa2e72f9c --ind 31 +osmo-auc-gen (C) 2011-2012 by Harald Welte +This is FREE SOFTWARE with ABSOLUTELY NO WARRANTY + +RAND: 39fa2f4e3d523d8619a73b4f65c3e14d +AUTN: 8704f5ba55cc00009d169f5ff89f6087 +IK: 27497388b6cb044648f396aa155b95ef +CK: f64735036e5871319c679f4742a75ea1 +RES: e229c19e791f2e41 +SRES: 9b36efdf +Kc: 059a4f668f6fbe39 +SQN: 63 + + +expecting error: +> osmo-auc-gen -3 -a milenage -r 39fa2f4e3d523d8619a73b4f65c3e14d -k EB215756028D60E3275E613320AEC880 -o FB2A3D1B360F599ABAB99DB8669F8308 -A 979498b1f72d3e28c59fa2e72f9c --ind -1 +osmo-auc-gen (C) 2011-2012 by Harald Welte +This is FREE SOFTWARE with ABSOLUTELY NO WARRANTY + + + +expecting error: +> osmo-auc-gen -3 -a milenage -r 39fa2f4e3d523d8619a73b4f65c3e14d -k EB215756028D60E3275E613320AEC880 -o FB2A3D1B360F599ABAB99DB8669F8308 -A 979498b1f72d3e28c59fa2e72f9c --ind 32 +osmo-auc-gen (C) 2011-2012 by Harald Welte +This is FREE SOFTWARE with ABSOLUTELY NO WARRANTY + + + +expecting error: +> osmo-auc-gen -3 -a milenage -r 39fa2f4e3d523d8619a73b4f65c3e14d -k EB215756028D60E3275E613320AEC880 -o FB2A3D1B360F599ABAB99DB8669F8308 -A 979498b1f72d3e28c59fa2e72f9c --ind 42 +osmo-auc-gen (C) 2011-2012 by Harald Welte +This is FREE SOFTWARE with ABSOLUTELY NO WARRANTY + diff --git a/tests/osmo-auc-gen/osmo-auc-gen_test.sh b/tests/osmo-auc-gen/osmo-auc-gen_test.sh index 132d9c3..f7fc87d 100755 --- a/tests/osmo-auc-gen/osmo-auc-gen_test.sh +++ b/tests/osmo-auc-gen/osmo-auc-gen_test.sh @@ -18,6 +18,16 @@ $osmo_auc_gen $@ } +invoke_err() { + echo + echo + echo expecting error: + echo '>' osmo-auc-gen $@ + echo expecting error: >&2 + echo '>' osmo-auc-gen $@ >&2 + $osmo_auc_gen $@ && exit 1 || true +} + bytes1="6a61050765caa32c90371370e5d6dc2d" bytes2="1dc4f974325cce611e54f516dc1fec56" bytes3="2a48162ff3edca4adf0b7b5e527d6c16" @@ -32,5 +42,13 @@ k="EB215756028D60E3275E613320AEC880" opc="FB2A3D1B360F599ABAB99DB8669F8308" rand="39fa2f4e3d523d8619a73b4f65c3e14d" -auts="979498b1f72d3e28c59fa2e72f9c" +auts="979498b1f72d3e28c59fa2e72f9c" # --> SQN.MS = 23 invoke -3 -a milenage -r $rand -k $k -o $opc -A $auts +invoke -3 -a milenage -r $rand -k $k -o $opc -A $auts --ind 5 +invoke -3 -a milenage -r $rand -k $k -o $opc -A $auts --ind 23 +invoke -3 -a milenage -r $rand -k $k -o $opc -A $auts --ind 31 + +# expect error: IND is too large for IND-bitlen of 5 (max 31) +invoke_err -3 -a milenage -r $rand -k $k -o $opc -A $auts --ind -1 +invoke_err -3 -a milenage -r $rand -k $k -o $opc -A $auts --ind 32 +invoke_err -3 -a milenage -r $rand -k $k -o $opc -A $auts --ind 42 diff --git a/utils/osmo-auc-gen.c b/utils/osmo-auc-gen.c index 4e07fa7..4f36dee 100644 --- a/utils/osmo-auc-gen.c +++ b/utils/osmo-auc-gen.c @@ -80,6 +80,7 @@ "-O --op\tSpecify OP (only for 3G)\n" "-f --amf\tSpecify AMF (only for 3G)\n" "-s --sqn\tSpecify SQN (only for 3G)\n" + "-i --ind\tSpecify IND slot for new SQN after AUTS (only for 3G)\n" "-A --auts\tSpecify AUTS (only for 3G)\n" "-r --rand\tSpecify random value\n" "-I --ipsec\tOutput in triplets.dat format for strongswan\n"); @@ -96,10 +97,12 @@ struct osmo_auth_vector *vec = &_vec; uint8_t _rand[16], _auts[14]; uint64_t sqn; + unsigned int ind; int rc, option_index; int rand_is_set = 0; int auts_is_set = 0; int sqn_is_set = 0; + int ind_is_set = 0; int fmt_triplets_dat = 0; printf("osmo-auc-gen (C) 2011-2012 by Harald Welte\n"); @@ -118,6 +121,7 @@ { "op", 1, 0, 'O' }, { "amf", 1, 0, 'f' }, { "sqn", 1, 0, 's' }, + { "ind", 1, 0, 'i' }, { "rand", 1, 0, 'r' }, { "auts", 1, 0, 'A' }, { "help", 0, 0, 'h' }, @@ -126,7 +130,7 @@ rc = 0; - c = getopt_long(argc, argv, "23a:k:o:f:s:r:hO:A:I", long_options, + c = getopt_long(argc, argv, "23a:k:o:f:s:i:r:hO:A:I", long_options, &option_index); if (c == -1) @@ -202,6 +206,14 @@ sqn = strtoull(optarg, 0, 10); sqn_is_set = 1; break; + case 'i': + if (test_aud.type != OSMO_AUTH_TYPE_UMTS) { + fprintf(stderr, "Only UMTS has IND\n"); + exit(2); + } + ind = atoi(optarg); + ind_is_set = 1; + break; case 'r': rc = osmo_hexparse(optarg, _rand, sizeof(_rand)); rand_is_set = 1; @@ -257,6 +269,22 @@ test_aud.u.umts.sqn = sqn - seq_1; test_aud.u.umts.ind = sqn & ind_mask; } + + if (sqn_is_set && ind_is_set) { + fprintf(stderr, "Requesting --sqn %"PRIu64" implies IND=%u," + " so no further --ind argument is allowed.\n", + sqn, test_aud.u.umts.ind); + exit(2); + } + + if (ind_is_set) { + if (ind >= (1 << test_aud.u.umts.ind_bitlen)) { + fprintf(stderr, "Requested --ind %u is too large for IND bitlen of %u\n", + ind, test_aud.u.umts.ind_bitlen); + exit(2); + } + test_aud.u.umts.ind = ind; + } } if (!auts_is_set) -- To view, visit https://gerrit.osmocom.org/3700 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ib60eec80d58ca9a0a01e7fbd2bcbbd4339b1a6d8 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Sat Aug 26 21:33:11 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sat, 26 Aug 2017 21:33:11 +0000 Subject: [PATCH] libosmocore[master]: osmo-auc-gen: umts: add --ind-len arg Message-ID: Review at https://gerrit.osmocom.org/3701 osmo-auc-gen: umts: add --ind-len arg osmo-auc-gen so far does not allow indicating the IND bit length of SQN. A default of 5 serves most practical cases, nevertheless we should allow passing arbitrary IND lengths. Enhance the test suite to test --ind-len. Related: OS#2465 Change-Id: Ia1d8b6a823ffc92290b3e39e4e4665aeff80ccc0 --- M tests/osmo-auc-gen/osmo-auc-gen_test.err M tests/osmo-auc-gen/osmo-auc-gen_test.ok M tests/osmo-auc-gen/osmo-auc-gen_test.sh M utils/osmo-auc-gen.c 4 files changed, 98 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/01/3701/1 diff --git a/tests/osmo-auc-gen/osmo-auc-gen_test.err b/tests/osmo-auc-gen/osmo-auc-gen_test.err index 46ecf2e..d9b5485 100644 --- a/tests/osmo-auc-gen/osmo-auc-gen_test.err +++ b/tests/osmo-auc-gen/osmo-auc-gen_test.err @@ -7,3 +7,6 @@ expecting error: > osmo-auc-gen -3 -a milenage -r 39fa2f4e3d523d8619a73b4f65c3e14d -k EB215756028D60E3275E613320AEC880 -o FB2A3D1B360F599ABAB99DB8669F8308 -A 979498b1f72d3e28c59fa2e72f9c --ind 42 Requested --ind 42 is too large for IND bitlen of 5 +expecting error: +> osmo-auc-gen -3 -a milenage -r 39fa2f4e3d523d8619a73b4f65c3e14d -k EB215756028D60E3275E613320AEC880 -o FB2A3D1B360F599ABAB99DB8669F8308 -A 979498b1f72d3e28c59fa2e72f9c --ind-len 0 --ind 1 +Requested --ind 1 is too large for IND bitlen of 0 diff --git a/tests/osmo-auc-gen/osmo-auc-gen_test.ok b/tests/osmo-auc-gen/osmo-auc-gen_test.ok index 278c88f..f833760 100644 --- a/tests/osmo-auc-gen/osmo-auc-gen_test.ok +++ b/tests/osmo-auc-gen/osmo-auc-gen_test.ok @@ -140,6 +140,76 @@ SQN: 63 +> osmo-auc-gen -3 -a milenage -r 39fa2f4e3d523d8619a73b4f65c3e14d -k EB215756028D60E3275E613320AEC880 -o FB2A3D1B360F599ABAB99DB8669F8308 -A 979498b1f72d3e28c59fa2e72f9c --ind-len 0 +osmo-auc-gen (C) 2011-2012 by Harald Welte +This is FREE SOFTWARE with ABSOLUTELY NO WARRANTY + +RAND: 39fa2f4e3d523d8619a73b4f65c3e14d +AUTN: 8704f5ba55eb0000d7fc4f7f19cfc180 +IK: 27497388b6cb044648f396aa155b95ef +CK: f64735036e5871319c679f4742a75ea1 +RES: e229c19e791f2e41 +SRES: 9b36efdf +Kc: 059a4f668f6fbe39 +SQN: 24 + + +> osmo-auc-gen -3 -a milenage -r 39fa2f4e3d523d8619a73b4f65c3e14d -k EB215756028D60E3275E613320AEC880 -o FB2A3D1B360F599ABAB99DB8669F8308 -A 979498b1f72d3e28c59fa2e72f9c --ind-len 1 +osmo-auc-gen (C) 2011-2012 by Harald Welte +This is FREE SOFTWARE with ABSOLUTELY NO WARRANTY + +RAND: 39fa2f4e3d523d8619a73b4f65c3e14d +AUTN: 8704f5ba55eb0000d7fc4f7f19cfc180 +IK: 27497388b6cb044648f396aa155b95ef +CK: f64735036e5871319c679f4742a75ea1 +RES: e229c19e791f2e41 +SRES: 9b36efdf +Kc: 059a4f668f6fbe39 +SQN: 24 + + +> osmo-auc-gen -3 -a milenage -r 39fa2f4e3d523d8619a73b4f65c3e14d -k EB215756028D60E3275E613320AEC880 -o FB2A3D1B360F599ABAB99DB8669F8308 -A 979498b1f72d3e28c59fa2e72f9c --ind-len 1 --ind 1 +osmo-auc-gen (C) 2011-2012 by Harald Welte +This is FREE SOFTWARE with ABSOLUTELY NO WARRANTY + +RAND: 39fa2f4e3d523d8619a73b4f65c3e14d +AUTN: 8704f5ba55ea0000aab06de3fd6c01af +IK: 27497388b6cb044648f396aa155b95ef +CK: f64735036e5871319c679f4742a75ea1 +RES: e229c19e791f2e41 +SRES: 9b36efdf +Kc: 059a4f668f6fbe39 +SQN: 25 + + +> osmo-auc-gen -3 -a milenage -r 39fa2f4e3d523d8619a73b4f65c3e14d -k EB215756028D60E3275E613320AEC880 -o FB2A3D1B360F599ABAB99DB8669F8308 -A 979498b1f72d3e28c59fa2e72f9c --ind-len 8 +osmo-auc-gen (C) 2011-2012 by Harald Welte +This is FREE SOFTWARE with ABSOLUTELY NO WARRANTY + +RAND: 39fa2f4e3d523d8619a73b4f65c3e14d +AUTN: 8704f5ba54f30000cbba2fbba3c5e242 +IK: 27497388b6cb044648f396aa155b95ef +CK: f64735036e5871319c679f4742a75ea1 +RES: e229c19e791f2e41 +SRES: 9b36efdf +Kc: 059a4f668f6fbe39 +SQN: 256 + + +> osmo-auc-gen -3 -a milenage -r 39fa2f4e3d523d8619a73b4f65c3e14d -k EB215756028D60E3275E613320AEC880 -o FB2A3D1B360F599ABAB99DB8669F8308 -A 979498b1f72d3e28c59fa2e72f9c --ind-len 8 --ind 1 +osmo-auc-gen (C) 2011-2012 by Harald Welte +This is FREE SOFTWARE with ABSOLUTELY NO WARRANTY + +RAND: 39fa2f4e3d523d8619a73b4f65c3e14d +AUTN: 8704f5ba54f200008f8e14579da5ecbb +IK: 27497388b6cb044648f396aa155b95ef +CK: f64735036e5871319c679f4742a75ea1 +RES: e229c19e791f2e41 +SRES: 9b36efdf +Kc: 059a4f668f6fbe39 +SQN: 257 + + expecting error: > osmo-auc-gen -3 -a milenage -r 39fa2f4e3d523d8619a73b4f65c3e14d -k EB215756028D60E3275E613320AEC880 -o FB2A3D1B360F599ABAB99DB8669F8308 -A 979498b1f72d3e28c59fa2e72f9c --ind -1 osmo-auc-gen (C) 2011-2012 by Harald Welte @@ -159,3 +229,10 @@ osmo-auc-gen (C) 2011-2012 by Harald Welte This is FREE SOFTWARE with ABSOLUTELY NO WARRANTY + + +expecting error: +> osmo-auc-gen -3 -a milenage -r 39fa2f4e3d523d8619a73b4f65c3e14d -k EB215756028D60E3275E613320AEC880 -o FB2A3D1B360F599ABAB99DB8669F8308 -A 979498b1f72d3e28c59fa2e72f9c --ind-len 0 --ind 1 +osmo-auc-gen (C) 2011-2012 by Harald Welte +This is FREE SOFTWARE with ABSOLUTELY NO WARRANTY + diff --git a/tests/osmo-auc-gen/osmo-auc-gen_test.sh b/tests/osmo-auc-gen/osmo-auc-gen_test.sh index f7fc87d..55b0757 100755 --- a/tests/osmo-auc-gen/osmo-auc-gen_test.sh +++ b/tests/osmo-auc-gen/osmo-auc-gen_test.sh @@ -48,7 +48,15 @@ invoke -3 -a milenage -r $rand -k $k -o $opc -A $auts --ind 23 invoke -3 -a milenage -r $rand -k $k -o $opc -A $auts --ind 31 +invoke -3 -a milenage -r $rand -k $k -o $opc -A $auts --ind-len 0 +invoke -3 -a milenage -r $rand -k $k -o $opc -A $auts --ind-len 1 +invoke -3 -a milenage -r $rand -k $k -o $opc -A $auts --ind-len 1 --ind 1 +invoke -3 -a milenage -r $rand -k $k -o $opc -A $auts --ind-len 8 +invoke -3 -a milenage -r $rand -k $k -o $opc -A $auts --ind-len 8 --ind 1 + # expect error: IND is too large for IND-bitlen of 5 (max 31) invoke_err -3 -a milenage -r $rand -k $k -o $opc -A $auts --ind -1 invoke_err -3 -a milenage -r $rand -k $k -o $opc -A $auts --ind 32 invoke_err -3 -a milenage -r $rand -k $k -o $opc -A $auts --ind 42 + +invoke_err -3 -a milenage -r $rand -k $k -o $opc -A $auts --ind-len 0 --ind 1 diff --git a/utils/osmo-auc-gen.c b/utils/osmo-auc-gen.c index 4f36dee..6e38b52 100644 --- a/utils/osmo-auc-gen.c +++ b/utils/osmo-auc-gen.c @@ -81,6 +81,7 @@ "-f --amf\tSpecify AMF (only for 3G)\n" "-s --sqn\tSpecify SQN (only for 3G)\n" "-i --ind\tSpecify IND slot for new SQN after AUTS (only for 3G)\n" + "-l --ind-len\tSpecify IND bit length (default=5) (only for 3G)\n" "-A --auts\tSpecify AUTS (only for 3G)\n" "-r --rand\tSpecify random value\n" "-I --ipsec\tOutput in triplets.dat format for strongswan\n"); @@ -122,6 +123,7 @@ { "amf", 1, 0, 'f' }, { "sqn", 1, 0, 's' }, { "ind", 1, 0, 'i' }, + { "ind-len", 1, 0, 'l' }, { "rand", 1, 0, 'r' }, { "auts", 1, 0, 'A' }, { "help", 0, 0, 'h' }, @@ -130,7 +132,7 @@ rc = 0; - c = getopt_long(argc, argv, "23a:k:o:f:s:i:r:hO:A:I", long_options, + c = getopt_long(argc, argv, "23a:k:o:f:s:i:l:r:hO:A:I", long_options, &option_index); if (c == -1) @@ -214,6 +216,13 @@ ind = atoi(optarg); ind_is_set = 1; break; + case 'l': + if (test_aud.type != OSMO_AUTH_TYPE_UMTS) { + fprintf(stderr, "Only UMTS has IND bitlen\n"); + exit(2); + } + test_aud.u.umts.ind_bitlen = atoi(optarg); + break; case 'r': rc = osmo_hexparse(optarg, _rand, sizeof(_rand)); rand_is_set = 1; -- To view, visit https://gerrit.osmocom.org/3701 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ia1d8b6a823ffc92290b3e39e4e4665aeff80ccc0 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Sat Aug 26 21:33:11 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sat, 26 Aug 2017 21:33:11 +0000 Subject: [PATCH] libosmocore[master]: osmo-auc-gen: umts: print out the IND of the SQN used Message-ID: Review at https://gerrit.osmocom.org/3702 osmo-auc-gen: umts: print out the IND of the SQN used Make ind_mask available in the main(){} scope, in order to print out IND = SQN & ind_mask. Adjust test suite expectations. Related: OS#2465 Change-Id: I91eac53c4af66a58b9372d9baf5781fc9f29b1fc --- M tests/osmo-auc-gen/osmo-auc-gen_test.ok M utils/osmo-auc-gen.c 2 files changed, 22 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/02/3702/1 diff --git a/tests/osmo-auc-gen/osmo-auc-gen_test.ok b/tests/osmo-auc-gen/osmo-auc-gen_test.ok index f833760..82923f1 100644 --- a/tests/osmo-auc-gen/osmo-auc-gen_test.ok +++ b/tests/osmo-auc-gen/osmo-auc-gen_test.ok @@ -12,6 +12,7 @@ SRES: 057fb997 Kc: 60524000cc5e5407 SQN: 0 +IND: 0 > osmo-auc-gen -3 -a milenage -r 6a61050765caa32c90371370e5d6dc2d -k 1dc4f974325cce611e54f516dc1fec56 -o 2a48162ff3edca4adf0b7b5e527d6c16 -s 1 @@ -26,6 +27,7 @@ SRES: 057fb997 Kc: 60524000cc5e5407 SQN: 1 +IND: 1 > osmo-auc-gen -3 -a milenage -r 6a61050765caa32c90371370e5d6dc2d -k 1dc4f974325cce611e54f516dc1fec56 -o 2a48162ff3edca4adf0b7b5e527d6c16 -s 23 @@ -40,6 +42,7 @@ SRES: 057fb997 Kc: 60524000cc5e5407 SQN: 23 +IND: 23 > osmo-auc-gen -3 -a milenage -r 1dc4f974325cce611e54f516dc1fec56 -k 2a48162ff3edca4adf0b7b5e527d6c16 -o 6a61050765caa32c90371370e5d6dc2d -s 42 @@ -54,6 +57,7 @@ SRES: 4c57defe Kc: 169d78081b24c007 SQN: 42 +IND: 10 > osmo-auc-gen -3 -a milenage -r 2a48162ff3edca4adf0b7b5e527d6c16 -k 6a61050765caa32c90371370e5d6dc2d -o 1dc4f974325cce611e54f516dc1fec56 -s 99 @@ -68,6 +72,7 @@ SRES: 1f89e7e9 Kc: d2d5361395b9b74a SQN: 99 +IND: 3 > osmo-auc-gen -3 -a milenage -r 6a61050765caa32c90371370e5d6dc2d -k 2a48162ff3edca4adf0b7b5e527d6c16 -o 1dc4f974325cce611e54f516dc1fec56 -s 281474976710655 @@ -82,6 +87,7 @@ SRES: 1b9297a7 Kc: 10687b71e4eb94c5 SQN: 281474976710655 +IND: 31 > osmo-auc-gen -3 -a milenage -r 39fa2f4e3d523d8619a73b4f65c3e14d -k EB215756028D60E3275E613320AEC880 -o FB2A3D1B360F599ABAB99DB8669F8308 -A 979498b1f72d3e28c59fa2e72f9c @@ -96,6 +102,7 @@ SRES: 9b36efdf Kc: 059a4f668f6fbe39 SQN: 32 +IND: 0 > osmo-auc-gen -3 -a milenage -r 39fa2f4e3d523d8619a73b4f65c3e14d -k EB215756028D60E3275E613320AEC880 -o FB2A3D1B360F599ABAB99DB8669F8308 -A 979498b1f72d3e28c59fa2e72f9c --ind 5 @@ -110,6 +117,7 @@ SRES: 9b36efdf Kc: 059a4f668f6fbe39 SQN: 37 +IND: 5 > osmo-auc-gen -3 -a milenage -r 39fa2f4e3d523d8619a73b4f65c3e14d -k EB215756028D60E3275E613320AEC880 -o FB2A3D1B360F599ABAB99DB8669F8308 -A 979498b1f72d3e28c59fa2e72f9c --ind 23 @@ -124,6 +132,7 @@ SRES: 9b36efdf Kc: 059a4f668f6fbe39 SQN: 55 +IND: 23 > osmo-auc-gen -3 -a milenage -r 39fa2f4e3d523d8619a73b4f65c3e14d -k EB215756028D60E3275E613320AEC880 -o FB2A3D1B360F599ABAB99DB8669F8308 -A 979498b1f72d3e28c59fa2e72f9c --ind 31 @@ -138,6 +147,7 @@ SRES: 9b36efdf Kc: 059a4f668f6fbe39 SQN: 63 +IND: 31 > osmo-auc-gen -3 -a milenage -r 39fa2f4e3d523d8619a73b4f65c3e14d -k EB215756028D60E3275E613320AEC880 -o FB2A3D1B360F599ABAB99DB8669F8308 -A 979498b1f72d3e28c59fa2e72f9c --ind-len 0 @@ -152,6 +162,7 @@ SRES: 9b36efdf Kc: 059a4f668f6fbe39 SQN: 24 +IND: 0 > osmo-auc-gen -3 -a milenage -r 39fa2f4e3d523d8619a73b4f65c3e14d -k EB215756028D60E3275E613320AEC880 -o FB2A3D1B360F599ABAB99DB8669F8308 -A 979498b1f72d3e28c59fa2e72f9c --ind-len 1 @@ -166,6 +177,7 @@ SRES: 9b36efdf Kc: 059a4f668f6fbe39 SQN: 24 +IND: 0 > osmo-auc-gen -3 -a milenage -r 39fa2f4e3d523d8619a73b4f65c3e14d -k EB215756028D60E3275E613320AEC880 -o FB2A3D1B360F599ABAB99DB8669F8308 -A 979498b1f72d3e28c59fa2e72f9c --ind-len 1 --ind 1 @@ -180,6 +192,7 @@ SRES: 9b36efdf Kc: 059a4f668f6fbe39 SQN: 25 +IND: 1 > osmo-auc-gen -3 -a milenage -r 39fa2f4e3d523d8619a73b4f65c3e14d -k EB215756028D60E3275E613320AEC880 -o FB2A3D1B360F599ABAB99DB8669F8308 -A 979498b1f72d3e28c59fa2e72f9c --ind-len 8 @@ -194,6 +207,7 @@ SRES: 9b36efdf Kc: 059a4f668f6fbe39 SQN: 256 +IND: 0 > osmo-auc-gen -3 -a milenage -r 39fa2f4e3d523d8619a73b4f65c3e14d -k EB215756028D60E3275E613320AEC880 -o FB2A3D1B360F599ABAB99DB8669F8308 -A 979498b1f72d3e28c59fa2e72f9c --ind-len 8 --ind 1 @@ -208,6 +222,7 @@ SRES: 9b36efdf Kc: 059a4f668f6fbe39 SQN: 257 +IND: 1 expecting error: diff --git a/utils/osmo-auc-gen.c b/utils/osmo-auc-gen.c index 6e38b52..d4ae1b9 100644 --- a/utils/osmo-auc-gen.c +++ b/utils/osmo-auc-gen.c @@ -105,6 +105,8 @@ int sqn_is_set = 0; int ind_is_set = 0; int fmt_triplets_dat = 0; + uint64_t seq_1; + uint64_t ind_mask; printf("osmo-auc-gen (C) 2011-2012 by Harald Welte\n"); printf("This is FREE SOFTWARE with ABSOLUTELY NO WARRANTY\n\n"); @@ -268,8 +270,8 @@ memset(vec, 0, sizeof(*vec)); if (test_aud.type == OSMO_AUTH_TYPE_UMTS) { - uint64_t seq_1 = 1LL << test_aud.u.umts.ind_bitlen; - uint64_t ind_mask = seq_1 - 1; + seq_1 = 1LL << test_aud.u.umts.ind_bitlen; + ind_mask = seq_1 - 1; if (sqn_is_set) { /* Before calculating the UMTS auth vector, osmo_auth_gen_vec() increments SEQ. @@ -312,8 +314,10 @@ dump_triplets_dat(vec); else { dump_auth_vec(vec); - if (test_aud.type == OSMO_AUTH_TYPE_UMTS) + if (test_aud.type == OSMO_AUTH_TYPE_UMTS) { printf("SQN:\t%" PRIu64 "\n", test_aud.u.umts.sqn); + printf("IND:\t%u\n", (unsigned int)(test_aud.u.umts.sqn & ind_mask)); + } } exit(0); -- To view, visit https://gerrit.osmocom.org/3702 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I91eac53c4af66a58b9372d9baf5781fc9f29b1fc Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Sat Aug 26 21:33:11 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sat, 26 Aug 2017 21:33:11 +0000 Subject: [PATCH] libosmocore[master]: cosmetic: umts aka: tweak comments for sqn and ind Message-ID: Review at https://gerrit.osmocom.org/3703 cosmetic: umts aka: tweak comments for sqn and ind Clearly indicate that 'sqn' is an in *and* out-parameter. Clarify the effect of 'ind'. Change-Id: Ia40cd4ddf35f4fbe895b45b8ea59378f5ce9eb1f --- M include/osmocom/crypt/auth.h 1 file changed, 2 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/03/3703/1 diff --git a/include/osmocom/crypt/auth.h b/include/osmocom/crypt/auth.h index 2f88a3a..059e734 100644 --- a/include/osmocom/crypt/auth.h +++ b/include/osmocom/crypt/auth.h @@ -35,10 +35,10 @@ uint8_t opc[16]; /*!< operator invariant value */ uint8_t k[16]; /*!< secret key of the subscriber */ uint8_t amf[2]; - uint64_t sqn; /*!< sequence number */ + uint64_t sqn; /*!< sequence number (in: prev sqn; out: used sqn) */ int opc_is_op; /*!< is the OPC field OPC (0) or OP (1) ? */ unsigned int ind_bitlen; /*!< nr of bits not in SEQ, only SQN */ - unsigned int ind; /*!< SQN slot, i.e. (SEQ << ind_bitlen) + ind */ + unsigned int ind; /*!< which IND slot to use an SQN from */ } umts; struct { uint8_t ki[16]; /*!< secret key */ -- To view, visit https://gerrit.osmocom.org/3703 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ia40cd4ddf35f4fbe895b45b8ea59378f5ce9eb1f Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Sat Aug 26 21:33:12 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sat, 26 Aug 2017 21:33:12 +0000 Subject: [PATCH] libosmocore[master]: umts aka: add sqn_ms out-param, print SQN.MS in osmo-auc-gen Message-ID: Review at https://gerrit.osmocom.org/3704 umts aka: add sqn_ms out-param, print SQN.MS in osmo-auc-gen When doing UMTS AKA with AUTS, it can be interesting to know the SQN.MS that was encoded in the AUTS. The only way to know this is to provide it as a separate out-parameter from milenage_gen_vec_auts(), because the SQN.MS from AUTS stored in umts.sqn is immediately modified non-trivially by milenage_gen_vec(). Add sqn_ms to struct osmo_sub_auth_data to retain SQN.MS even after a vector was generated. Use this to print out SQN.MS for 'osmo-auc-gen -3 -A'. Adjust test suite expectations. Related: OS#2464 Change-Id: I9fc05bbf169d06716f40b995154fd42a3f91bef3 --- M include/osmocom/crypt/auth.h M src/gsm/auth_milenage.c M tests/osmo-auc-gen/osmo-auc-gen_test.ok M utils/osmo-auc-gen.c 4 files changed, 14 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/04/3704/1 diff --git a/include/osmocom/crypt/auth.h b/include/osmocom/crypt/auth.h index 059e734..6d2c783 100644 --- a/include/osmocom/crypt/auth.h +++ b/include/osmocom/crypt/auth.h @@ -39,6 +39,7 @@ int opc_is_op; /*!< is the OPC field OPC (0) or OP (1) ? */ unsigned int ind_bitlen; /*!< nr of bits not in SEQ, only SQN */ unsigned int ind; /*!< which IND slot to use an SQN from */ + uint64_t sqn_ms; /*!< sqn from AUTS (output value only) */ } umts; struct { uint8_t ki[16]; /*!< secret key */ diff --git a/src/gsm/auth_milenage.c b/src/gsm/auth_milenage.c index 6dd4f45..e1a1dfb 100644 --- a/src/gsm/auth_milenage.c +++ b/src/gsm/auth_milenage.c @@ -158,9 +158,10 @@ if (rc < 0) return rc; + aud->u.umts.sqn_ms = osmo_load64be_ext(sqn_out, 6) >> 16; /* Update our "largest used SQN" from the USIM -- milenage_gen_vec() * below will increment SQN. */ - aud->u.umts.sqn = osmo_load64be_ext(sqn_out, 6) >> 16; + aud->u.umts.sqn = aud->u.umts.sqn_ms; return milenage_gen_vec(vec, aud, _rand); } diff --git a/tests/osmo-auc-gen/osmo-auc-gen_test.ok b/tests/osmo-auc-gen/osmo-auc-gen_test.ok index 82923f1..2840783 100644 --- a/tests/osmo-auc-gen/osmo-auc-gen_test.ok +++ b/tests/osmo-auc-gen/osmo-auc-gen_test.ok @@ -103,6 +103,7 @@ Kc: 059a4f668f6fbe39 SQN: 32 IND: 0 +SQN.MS: 23 > osmo-auc-gen -3 -a milenage -r 39fa2f4e3d523d8619a73b4f65c3e14d -k EB215756028D60E3275E613320AEC880 -o FB2A3D1B360F599ABAB99DB8669F8308 -A 979498b1f72d3e28c59fa2e72f9c --ind 5 @@ -118,6 +119,7 @@ Kc: 059a4f668f6fbe39 SQN: 37 IND: 5 +SQN.MS: 23 > osmo-auc-gen -3 -a milenage -r 39fa2f4e3d523d8619a73b4f65c3e14d -k EB215756028D60E3275E613320AEC880 -o FB2A3D1B360F599ABAB99DB8669F8308 -A 979498b1f72d3e28c59fa2e72f9c --ind 23 @@ -133,6 +135,7 @@ Kc: 059a4f668f6fbe39 SQN: 55 IND: 23 +SQN.MS: 23 > osmo-auc-gen -3 -a milenage -r 39fa2f4e3d523d8619a73b4f65c3e14d -k EB215756028D60E3275E613320AEC880 -o FB2A3D1B360F599ABAB99DB8669F8308 -A 979498b1f72d3e28c59fa2e72f9c --ind 31 @@ -148,6 +151,7 @@ Kc: 059a4f668f6fbe39 SQN: 63 IND: 31 +SQN.MS: 23 > osmo-auc-gen -3 -a milenage -r 39fa2f4e3d523d8619a73b4f65c3e14d -k EB215756028D60E3275E613320AEC880 -o FB2A3D1B360F599ABAB99DB8669F8308 -A 979498b1f72d3e28c59fa2e72f9c --ind-len 0 @@ -163,6 +167,7 @@ Kc: 059a4f668f6fbe39 SQN: 24 IND: 0 +SQN.MS: 23 > osmo-auc-gen -3 -a milenage -r 39fa2f4e3d523d8619a73b4f65c3e14d -k EB215756028D60E3275E613320AEC880 -o FB2A3D1B360F599ABAB99DB8669F8308 -A 979498b1f72d3e28c59fa2e72f9c --ind-len 1 @@ -178,6 +183,7 @@ Kc: 059a4f668f6fbe39 SQN: 24 IND: 0 +SQN.MS: 23 > osmo-auc-gen -3 -a milenage -r 39fa2f4e3d523d8619a73b4f65c3e14d -k EB215756028D60E3275E613320AEC880 -o FB2A3D1B360F599ABAB99DB8669F8308 -A 979498b1f72d3e28c59fa2e72f9c --ind-len 1 --ind 1 @@ -193,6 +199,7 @@ Kc: 059a4f668f6fbe39 SQN: 25 IND: 1 +SQN.MS: 23 > osmo-auc-gen -3 -a milenage -r 39fa2f4e3d523d8619a73b4f65c3e14d -k EB215756028D60E3275E613320AEC880 -o FB2A3D1B360F599ABAB99DB8669F8308 -A 979498b1f72d3e28c59fa2e72f9c --ind-len 8 @@ -208,6 +215,7 @@ Kc: 059a4f668f6fbe39 SQN: 256 IND: 0 +SQN.MS: 23 > osmo-auc-gen -3 -a milenage -r 39fa2f4e3d523d8619a73b4f65c3e14d -k EB215756028D60E3275E613320AEC880 -o FB2A3D1B360F599ABAB99DB8669F8308 -A 979498b1f72d3e28c59fa2e72f9c --ind-len 8 --ind 1 @@ -223,6 +231,7 @@ Kc: 059a4f668f6fbe39 SQN: 257 IND: 1 +SQN.MS: 23 expecting error: diff --git a/utils/osmo-auc-gen.c b/utils/osmo-auc-gen.c index d4ae1b9..fee9767 100644 --- a/utils/osmo-auc-gen.c +++ b/utils/osmo-auc-gen.c @@ -317,6 +317,8 @@ if (test_aud.type == OSMO_AUTH_TYPE_UMTS) { printf("SQN:\t%" PRIu64 "\n", test_aud.u.umts.sqn); printf("IND:\t%u\n", (unsigned int)(test_aud.u.umts.sqn & ind_mask)); + if (auts_is_set) + printf("SQN.MS:\t%" PRIu64 "\n", test_aud.u.umts.sqn_ms); } } -- To view, visit https://gerrit.osmocom.org/3704 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I9fc05bbf169d06716f40b995154fd42a3f91bef3 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Sun Aug 27 00:32:10 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sun, 27 Aug 2017 00:32:10 +0000 Subject: [MERGED] osmo-msc[master]: Use value string check from osmo-ci In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: Use value string check from osmo-ci ...................................................................... Use value string check from osmo-ci Necessary since libosmocore I513835be2d931d0a931cdfc996f361a451bc1a15 removes the script from libosmocore/contrib. Change-Id: I02d7e1c0151c687fd9341d21a09ca15cbf5a1938 --- M contrib/jenkins.sh 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Neels Hofmeyr: Looks good to me, approved Jenkins Builder: Verified diff --git a/contrib/jenkins.sh b/contrib/jenkins.sh index 5903429..b4074e4 100755 --- a/contrib/jenkins.sh +++ b/contrib/jenkins.sh @@ -12,7 +12,7 @@ osmo-build-dep.sh libosmocore "" ac_cv_path_DOXYGEN=false -"$deps"/libosmocore/contrib/verify_value_string_arrays_are_terminated.py $(find . -name "*.[hc]") +verify_value_string_arrays_are_terminated.py $(find . -name "*.[hc]") export PKG_CONFIG_PATH="$inst/lib/pkgconfig:$PKG_CONFIG_PATH" export LD_LIBRARY_PATH="$inst/lib" -- To view, visit https://gerrit.osmocom.org/3693 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I02d7e1c0151c687fd9341d21a09ca15cbf5a1938 Gerrit-PatchSet: 2 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Sun Aug 27 00:33:23 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sun, 27 Aug 2017 00:33:23 +0000 Subject: [ABANDON] osmo-msc[master]: NOT FOR MERGE combined changes from openbsc.git for gerrit c... In-Reply-To: References: Message-ID: Neels Hofmeyr has abandoned this change. Change subject: NOT FOR MERGE combined changes from openbsc.git for gerrit checking ...................................................................... Abandoned -- To view, visit https://gerrit.osmocom.org/3695 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: abandon Gerrit-Change-Id: Id072aa07793aceca66bd74950bc40dd504982a55 Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Sun Aug 27 00:34:44 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sun, 27 Aug 2017 00:34:44 +0000 Subject: [MERGED] osmo-msc[master]: Treat SIGTERM just like SIGINT in our programs In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: Treat SIGTERM just like SIGINT in our programs ...................................................................... Treat SIGTERM just like SIGINT in our programs When somebody kills the process, it's best to handle the signal and to use the opportunity for some cleanup. We always did this in the NITB on SIGINT, but never on SIGTERM. Let's change it. Change-Id: Iea6804325a6575ceab5edfd28dd20249462f143b --- M src/gprs/gb_proxy_main.c M src/gprs/gtphub_main.c M src/gprs/sgsn_main.c M src/osmo-bsc/osmo_bsc_main.c M src/osmo-msc/msc_main.c 5 files changed, 10 insertions(+), 0 deletions(-) Approvals: Neels Hofmeyr: Looks good to me, approved diff --git a/src/gprs/gb_proxy_main.c b/src/gprs/gb_proxy_main.c index 69a93b6..caff27f 100644 --- a/src/gprs/gb_proxy_main.c +++ b/src/gprs/gb_proxy_main.c @@ -98,6 +98,7 @@ switch (signal) { case SIGINT: + case SIGTERM: osmo_signal_dispatch(SS_L_GLOBAL, S_L_GLOBAL_SHUTDOWN, NULL); sleep(1); exit(0); @@ -232,6 +233,7 @@ msgb_talloc_ctx_init(tall_bsc_ctx, 0); signal(SIGINT, &signal_handler); + signal(SIGTERM, &signal_handler); signal(SIGABRT, &signal_handler); signal(SIGUSR1, &signal_handler); signal(SIGUSR2, &signal_handler); diff --git a/src/gprs/gtphub_main.c b/src/gprs/gtphub_main.c index 73a122c..2b87d19 100644 --- a/src/gprs/gtphub_main.c +++ b/src/gprs/gtphub_main.c @@ -96,6 +96,7 @@ switch (signal) { case SIGINT: + case SIGTERM: osmo_signal_dispatch(SS_L_GLOBAL, S_L_GLOBAL_SHUTDOWN, NULL); sleep(1); exit(0); @@ -302,6 +303,7 @@ msgb_talloc_ctx_init(osmo_gtphub_ctx, 0); signal(SIGINT, &signal_handler); + signal(SIGTERM, &signal_handler); signal(SIGABRT, &signal_handler); signal(SIGUSR1, &signal_handler); signal(SIGUSR2, &signal_handler); diff --git a/src/gprs/sgsn_main.c b/src/gprs/sgsn_main.c index 71cb18c..d5d43ad 100644 --- a/src/gprs/sgsn_main.c +++ b/src/gprs/sgsn_main.c @@ -145,6 +145,7 @@ switch (signal) { case SIGINT: + case SIGTERM: osmo_signal_dispatch(SS_L_GLOBAL, S_L_GLOBAL_SHUTDOWN, NULL); sleep(1); exit(0); @@ -332,6 +333,7 @@ msgb_talloc_ctx_init(tall_bsc_ctx, 0); signal(SIGINT, &signal_handler); + signal(SIGTERM, &signal_handler); signal(SIGABRT, &signal_handler); signal(SIGUSR1, &signal_handler); signal(SIGUSR2, &signal_handler); diff --git a/src/osmo-bsc/osmo_bsc_main.c b/src/osmo-bsc/osmo_bsc_main.c index ee094d6..90651b9 100644 --- a/src/osmo-bsc/osmo_bsc_main.c +++ b/src/osmo-bsc/osmo_bsc_main.c @@ -162,6 +162,7 @@ switch (signal) { case SIGINT: + case SIGTERM: bsc_shutdown_net(bsc_gsmnet); osmo_signal_dispatch(SS_L_GLOBAL, S_L_GLOBAL_SHUTDOWN, NULL); sleep(3); @@ -280,6 +281,7 @@ } signal(SIGINT, &signal_handler); + signal(SIGTERM, &signal_handler); signal(SIGABRT, &signal_handler); signal(SIGUSR1, &signal_handler); signal(SIGUSR2, &signal_handler); diff --git a/src/osmo-msc/msc_main.c b/src/osmo-msc/msc_main.c index 6c62db3..723c0e6 100644 --- a/src/osmo-msc/msc_main.c +++ b/src/osmo-msc/msc_main.c @@ -266,6 +266,7 @@ switch (signal) { case SIGINT: + case SIGTERM: msc_network_shutdown(msc_network); osmo_signal_dispatch(SS_L_GLOBAL, S_L_GLOBAL_SHUTDOWN, NULL); sleep(3); @@ -472,6 +473,7 @@ osmo_timer_schedule(&db_sync_timer, DB_SYNC_INTERVAL); signal(SIGINT, &signal_handler); + signal(SIGTERM, &signal_handler); signal(SIGABRT, &signal_handler); signal(SIGUSR1, &signal_handler); signal(SIGUSR2, &signal_handler); -- To view, visit https://gerrit.osmocom.org/3674 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Iea6804325a6575ceab5edfd28dd20249462f143b Gerrit-PatchSet: 2 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Sun Aug 27 00:34:44 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sun, 27 Aug 2017 00:34:44 +0000 Subject: [MERGED] osmo-msc[master]: NITB: remove 'help' output about '-a' option that is removed... In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: NITB: remove 'help' output about '-a' option that is removed for ages ...................................................................... NITB: remove 'help' output about '-a' option that is removed for ages This option was present in very early versions of the NITB, but at least since 2011 it is no longer supported. It's still listed in --help output, which is wrong. Change-Id: I1d2cceb588ec5fb34ec5e2c05a7d8c93310bee88 --- M src/osmo-msc/msc_main.c 1 file changed, 0 insertions(+), 2 deletions(-) Approvals: Neels Hofmeyr: Looks good to me, approved diff --git a/src/osmo-msc/msc_main.c b/src/osmo-msc/msc_main.c index 4166159..6c62db3 100644 --- a/src/osmo-msc/msc_main.c +++ b/src/osmo-msc/msc_main.c @@ -140,7 +140,6 @@ printf(" -c --config-file filename The config file to use.\n"); printf(" -s --disable-color\n"); printf(" -l --database db-name The database to use.\n"); - printf(" -a --authorize-everyone Authorize every new subscriber. Dangerous!\n"); printf(" -T --timestamp Prefix every log line with a timestamp.\n"); printf(" -V --version Print the version of OpenBSC.\n"); printf(" -P --rtp-proxy Enable the RTP Proxy code inside OpenBSC.\n"); @@ -163,7 +162,6 @@ {"config-file", 1, 0, 'c'}, {"disable-color", 0, 0, 's'}, {"database", 1, 0, 'l'}, - {"authorize-everyone", 0, 0, 'a'}, {"pcap", 1, 0, 'p'}, {"timestamp", 0, 0, 'T'}, {"version", 0, 0, 'V' }, -- To view, visit https://gerrit.osmocom.org/3673 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I1d2cceb588ec5fb34ec5e2c05a7d8c93310bee88 Gerrit-PatchSet: 2 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Sun Aug 27 00:34:44 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sun, 27 Aug 2017 00:34:44 +0000 Subject: [MERGED] osmo-msc[master]: libmsc: Use actual delivery time in delivery reports. In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: libmsc: Use actual delivery time in delivery reports. ...................................................................... libmsc: Use actual delivery time in delivery reports. Set the time on the status report to the time the message was delivered, as this may not be the same as the time when we are delivering the report to the originating MS. Change-Id: I9056429d40bf02731f004b7833f1de45a0d1add8 --- M include/openbsc/gsm_data.h M src/libmsc/db.c M src/libmsc/gsm_04_11.c 3 files changed, 4 insertions(+), 2 deletions(-) Approvals: Neels Hofmeyr: Looks good to me, approved diff --git a/include/openbsc/gsm_data.h b/include/openbsc/gsm_data.h index 51cf6dc..f4de381 100644 --- a/include/openbsc/gsm_data.h +++ b/include/openbsc/gsm_data.h @@ -511,6 +511,7 @@ } smpp; unsigned long validity_minutes; + time_t created; bool is_report; uint8_t reply_path_req; uint8_t status_rep_req; diff --git a/src/libmsc/db.c b/src/libmsc/db.c index 3495806..ae7e287 100644 --- a/src/libmsc/db.c +++ b/src/libmsc/db.c @@ -742,6 +742,7 @@ /* FIXME: validity */ /* FIXME: those should all be get_uchar, but sqlite3 is braindead */ + sms->created = dbi_result_get_datetime(result, "created"); sms->reply_path_req = dbi_result_get_ulonglong(result, "reply_path_req"); sms->status_rep_req = dbi_result_get_ulonglong(result, "status_rep_req"); sms->is_report = dbi_result_get_ulonglong(result, "is_report"); diff --git a/src/libmsc/gsm_04_11.c b/src/libmsc/gsm_04_11.c index 55642aa..c5bcce7 100644 --- a/src/libmsc/gsm_04_11.c +++ b/src/libmsc/gsm_04_11.c @@ -312,11 +312,11 @@ /* generate TP-SCTS (Service centre timestamp) */ smsp = msgb_put(msg, 7); - gsm340_gen_scts(smsp, time(NULL)); + gsm340_gen_scts(smsp, sms->created); /* generate TP-DT (Discharge time, in TP-SCTS format). */ smsp = msgb_put(msg, 7); - gsm340_gen_scts(smsp, time(NULL)); + gsm340_gen_scts(smsp, sms->created); /* TP-ST (status) */ smsp = msgb_put(msg, 1); -- To view, visit https://gerrit.osmocom.org/3672 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I9056429d40bf02731f004b7833f1de45a0d1add8 Gerrit-PatchSet: 2 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Keith Whyte Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Sun Aug 27 00:34:46 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sun, 27 Aug 2017 00:34:46 +0000 Subject: [MERGED] osmo-msc[master]: gbproxy: log signal value as text In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: gbproxy: log signal value as text ...................................................................... gbproxy: log signal value as text Change-Id: I6ed923f5c60a8d64305f4b8e90d1362d6510e1c5 --- M src/gprs/gb_proxy.c 1 file changed, 4 insertions(+), 6 deletions(-) Approvals: Neels Hofmeyr: Looks good to me, approved diff --git a/src/gprs/gb_proxy.c b/src/gprs/gb_proxy.c index b98a9a5..cd38d23 100644 --- a/src/gprs/gb_proxy.c +++ b/src/gprs/gb_proxy.c @@ -1369,9 +1369,8 @@ /* from BSS to SGSN */ peer = gbproxy_peer_by_nsei(cfg, nsvc->nsei); if (!peer) { - LOGP(DGPRS, LOGL_NOTICE, "signal %u for unknown peer " - "NSEI=%u/NSVCI=%u\n", signal, nsvc->nsei, - nsvc->nsvci); + LOGP(DGPRS, LOGL_NOTICE, "signal '%s' for unknown peer NSEI=%u/NSVCI=%u\n", + get_value_string(gprs_ns_signal_ns_names, signal), nsvc->nsei, nsvc->nsvci); return 0; } switch (signal) { @@ -1379,9 +1378,8 @@ case S_NS_BLOCK: if (!peer->blocked) break; - LOGP(DGPRS, LOGL_NOTICE, "Converting NS_RESET from " - "NSEI=%u/NSVCI=%u into BSSGP_BVC_BLOCK to SGSN\n", - nsvc->nsei, nsvc->nsvci); + LOGP(DGPRS, LOGL_NOTICE, "Converting '%s' from NSEI=%u/NSVCI=%u into BSSGP_BVC_BLOCK to SGSN\n", + get_value_string(gprs_ns_signal_ns_names, signal), nsvc->nsei, nsvc->nsvci); bssgp_tx_simple_bvci(BSSGP_PDUT_BVC_BLOCK, nsvc->nsei, peer->bvci, 0); break; -- To view, visit https://gerrit.osmocom.org/3671 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I6ed923f5c60a8d64305f4b8e90d1362d6510e1c5 Gerrit-PatchSet: 2 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Sun Aug 27 00:34:46 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sun, 27 Aug 2017 00:34:46 +0000 Subject: [MERGED] osmo-msc[master]: gbproxy: log unhandled BSSGP PDU as text In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: gbproxy: log unhandled BSSGP PDU as text ...................................................................... gbproxy: log unhandled BSSGP PDU as text Change-Id: Ibe3c8bd353b3a178e26b0936f25b2e1959f9990c --- M src/gprs/gb_proxy.c 1 file changed, 1 insertion(+), 2 deletions(-) Approvals: Neels Hofmeyr: Looks good to me, approved diff --git a/src/gprs/gb_proxy.c b/src/gprs/gb_proxy.c index 3603e14..b98a9a5 100644 --- a/src/gprs/gb_proxy.c +++ b/src/gprs/gb_proxy.c @@ -1266,8 +1266,7 @@ rc = bssgp_tx_status(BSSGP_CAUSE_PDU_INCOMP_FEAT, NULL, orig_msg); break; default: - LOGP(DGPRS, LOGL_NOTICE, "BSSGP PDU type 0x%02x unknown\n", - pdu_type); + LOGP(DGPRS, LOGL_NOTICE, "BSSGP PDU type %s not supported\n", bssgp_pdu_str(pdu_type)); rate_ctr_inc(&cfg->ctrg-> ctr[GBPROX_GLOB_CTR_PROTO_ERR_SGSN]); rc = bssgp_tx_status(BSSGP_CAUSE_PROTO_ERR_UNSPEC, NULL, orig_msg); -- To view, visit https://gerrit.osmocom.org/3670 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ibe3c8bd353b3a178e26b0936f25b2e1959f9990c Gerrit-PatchSet: 2 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Sun Aug 27 00:34:47 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sun, 27 Aug 2017 00:34:47 +0000 Subject: [MERGED] osmo-msc[master]: libmsc: Fix wrong handling of user_message_reference parameter In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: libmsc: Fix wrong handling of user_message_reference parameter ...................................................................... libmsc: Fix wrong handling of user_message_reference parameter libsmpp34 already converts received TLV integer values to native endianess in libsmpp34_(un)pack. Converting them again at receive time swaps the 2 bytes of user_message_reference, then using a wrong value. As GSM03.40 spec uses only 1 byte for the id, then only the high byte of the initial value is used and eventually sent back to the ESME. Again, at that time, htons() is not needed because libsmpp34 already handles that part. See OS-#2429 for more details. Change-Id: If748548a4a223e529a1110c89e483b599b406e8b --- M src/libmsc/smpp_openbsc.c 1 file changed, 2 insertions(+), 2 deletions(-) Approvals: Pau Espin Pedrol: Looks good to me, but someone else must approve Neels Hofmeyr: Looks good to me, approved diff --git a/src/libmsc/smpp_openbsc.c b/src/libmsc/smpp_openbsc.c index ec14898..431cb4d 100644 --- a/src/libmsc/smpp_openbsc.c +++ b/src/libmsc/smpp_openbsc.c @@ -121,7 +121,7 @@ } break; case TLVID_user_message_reference: - msg_ref = ntohs(t->value.val16); + msg_ref = t->value.val16; break; default: break; @@ -437,7 +437,7 @@ memset(&tlv, 0, sizeof(tlv)); tlv.tag = tag; tlv.length = 2; - tlv.value.val16 = htons(val); + tlv.value.val16 = val; build_tlv(req_tlv, &tlv); } -- To view, visit https://gerrit.osmocom.org/3669 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: If748548a4a223e529a1110c89e483b599b406e8b Gerrit-PatchSet: 2 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Sun Aug 27 00:34:47 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sun, 27 Aug 2017 00:34:47 +0000 Subject: [MERGED] osmo-msc[master]: smpp: Fix compilation warning In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: smpp: Fix compilation warning ...................................................................... smpp: Fix compilation warning I already stumbled into 2 compilation environments which had Werror enabled for -Wmaybe-uninitialized and the build failed, so let's workaround this warning. | smpp_openbsc.c: In function 'handle_smpp_submit': | smpp_openbsc.c:216:9: error: 'sms_msg_len' may be used uninitialized in this function [-Werror=maybe-uninitialized] | memcpy(sms->user_data, sms_msg, sms_msg_len); | ^ | smpp_openbsc.c:100:15: note: 'sms_msg_len' was declared here | unsigned int sms_msg_len; | ^ | cc1: some warnings being treated as errors Change-Id: I0901ddadb5f72e1585cb1797ac22c8ab95e83146 --- M src/libmsc/smpp_openbsc.c 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Pau Espin Pedrol: Looks good to me, but someone else must approve Neels Hofmeyr: Looks good to me, approved diff --git a/src/libmsc/smpp_openbsc.c b/src/libmsc/smpp_openbsc.c index c2f2f3b..ec14898 100644 --- a/src/libmsc/smpp_openbsc.c +++ b/src/libmsc/smpp_openbsc.c @@ -94,11 +94,11 @@ const struct submit_sm_t *submit) { const uint8_t *sms_msg = NULL; + unsigned int sms_msg_len = 0; struct vlr_subscr *dest; uint16_t msg_ref = 0; struct gsm_sms *sms; struct tlv_t *t; - unsigned int sms_msg_len; int mode; dest = subscr_by_dst(net, submit->dest_addr_npi, -- To view, visit https://gerrit.osmocom.org/3668 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I0901ddadb5f72e1585cb1797ac22c8ab95e83146 Gerrit-PatchSet: 2 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Sun Aug 27 00:34:47 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sun, 27 Aug 2017 00:34:47 +0000 Subject: [MERGED] osmo-msc[master]: sgsn_test: Fix wrong definition of wrap func In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: sgsn_test: Fix wrong definition of wrap func ...................................................................... sgsn_test: Fix wrong definition of wrap func Commit 058cd573d8 added 2 new pointer parameters to gprs_subscr_request_auth_info, but forgot to update wraps of the function in sgsn_test. I catched this today because openbsc build test sgsn_test was failing. Closed look up to the logs showed: Assert failed (auts != NULL) == (auts_rand != NULL) openbsc/openbsc/src/gprs/gprs_subscriber.c:791 Change-Id: Ie9e4af6da0339536fb20ca0b7bbcf6f485bd522c --- M tests/sgsn/sgsn_test.c 1 file changed, 5 insertions(+), 5 deletions(-) Approvals: Neels Hofmeyr: Looks good to me, approved diff --git a/tests/sgsn/sgsn_test.c b/tests/sgsn/sgsn_test.c index 2f1513a..d66c5dd 100644 --- a/tests/sgsn/sgsn_test.c +++ b/tests/sgsn/sgsn_test.c @@ -139,12 +139,12 @@ }; /* override, requires '-Wl,--wrap=gprs_subscr_request_auth_info' */ -int __real_gprs_subscr_request_auth_info(struct sgsn_mm_ctx *mmctx); -int (*subscr_request_auth_info_cb)(struct sgsn_mm_ctx *mmctx) = +int __real_gprs_subscr_request_auth_info(struct sgsn_mm_ctx *mmctx, const uint8_t *auts, const uint8_t *auts_rand); +int (*subscr_request_auth_info_cb)(struct sgsn_mm_ctx *mmctx, const uint8_t *auts, const uint8_t *auts_rand) = &__real_gprs_subscr_request_auth_info; -int __wrap_gprs_subscr_request_auth_info(struct sgsn_mm_ctx *mmctx) { - return (*subscr_request_auth_info_cb)(mmctx); +int __wrap_gprs_subscr_request_auth_info(struct sgsn_mm_ctx *mmctx, const uint8_t *auts, const uint8_t *auts_rand) { + return (*subscr_request_auth_info_cb)(mmctx, auts, auts_rand); }; /* override, requires '-Wl,--wrap=gsup_client_send' */ @@ -1160,7 +1160,7 @@ cleanup_test(); } -int my_subscr_request_auth_info_real_auth(struct sgsn_mm_ctx *mmctx) +int my_subscr_request_auth_info_real_auth(struct sgsn_mm_ctx *mmctx, const uint8_t *auts, const uint8_t *auts_rand) { struct gsm_auth_tuple at = { .vec.sres = {0x51, 0xe5, 0x51, 0xe5}, -- To view, visit https://gerrit.osmocom.org/3667 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ie9e4af6da0339536fb20ca0b7bbcf6f485bd522c Gerrit-PatchSet: 2 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Sun Aug 27 00:34:47 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sun, 27 Aug 2017 00:34:47 +0000 Subject: [MERGED] osmo-msc[master]: LIBMSC: Use sms->text, not sms->user_data to construct repor... In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: LIBMSC: Use sms->text, not sms->user_data to construct report body ...................................................................... LIBMSC: Use sms->text, not sms->user_data to construct report body gsm_04_11.c sms_report_alloc() Use the sms->text, not the sms->user_data to construct the report body. This also prevents the potential output of non printable characters to the log and or vty. Change-Id: Id51bc9483ad6f52d6da74135605cfd12434c7c96 --- M src/libmsc/gsm_04_11.c 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Neels Hofmeyr: Looks good to me, approved diff --git a/src/libmsc/gsm_04_11.c b/src/libmsc/gsm_04_11.c index f87acea..55642aa 100644 --- a/src/libmsc/gsm_04_11.c +++ b/src/libmsc/gsm_04_11.c @@ -667,7 +667,7 @@ len = snprintf((char *)sms_report->user_data, sizeof(sms_report->user_data), "id:%.08llu sub:000 dlvrd:000 submit date:YYMMDDhhmm done date:YYMMDDhhmm stat:DELIVRD err:000 text:%.20s", - sms->id, sms->user_data); + sms->id, sms->text); sms_report->user_data_len = len; LOGP(DLSMS, LOGL_NOTICE, "%s\n", sms_report->user_data); -- To view, visit https://gerrit.osmocom.org/3666 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Id51bc9483ad6f52d6da74135605cfd12434c7c96 Gerrit-PatchSet: 2 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Keith Whyte Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Sun Aug 27 00:34:48 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sun, 27 Aug 2017 00:34:48 +0000 Subject: [MERGED] osmo-msc[master]: LIBMSC: Place correct dst address in status report In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: LIBMSC: Place correct dst address in status report ...................................................................... LIBMSC: Place correct dst address in status report gsm_04_11.c: gsm340_gen_sms_status_report_tpdu() When we construct the status report PDU, use sms->src instead of sms->dst as the destination address This way we tell the MS that the message was delivered to the destination and not to itself. This is relevant for phones that display a textual representation of the delivery report. Change-Id: I2d4f87ac777465de9bfb5a775a789a2691755ee9 --- M src/libmsc/gsm_04_11.c 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Neels Hofmeyr: Looks good to me, approved diff --git a/src/libmsc/gsm_04_11.c b/src/libmsc/gsm_04_11.c index eede74c..f87acea 100644 --- a/src/libmsc/gsm_04_11.c +++ b/src/libmsc/gsm_04_11.c @@ -303,7 +303,7 @@ *smsp = sms->msg_ref; /* generate recipient address */ - oa_len = gsm340_gen_oa_sub(oa, sizeof(oa), &sms->dst); + oa_len = gsm340_gen_oa_sub(oa, sizeof(oa), &sms->src); if (oa_len < 0) return -ENOSPC; -- To view, visit https://gerrit.osmocom.org/3665 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I2d4f87ac777465de9bfb5a775a789a2691755ee9 Gerrit-PatchSet: 2 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Keith Whyte Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Sun Aug 27 00:34:48 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sun, 27 Aug 2017 00:34:48 +0000 Subject: [MERGED] osmo-msc[master]: libmsc: use SMPP34_DELIVERY_RECEIPT_* in libsmpp34 In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: libmsc: use SMPP34_DELIVERY_RECEIPT_* in libsmpp34 ...................................................................... libmsc: use SMPP34_DELIVERY_RECEIPT_* in libsmpp34 Use new definitions in libsmpp34 to set the registered_delivery field accordingly, as provided by I5b3afff1b3b77cccd949e0606914c7ac3ba6114c. Moreover, do not set this header field to zero if status reports are off, the deliver_t structure has been already zeroed so this not required. Change-Id: Ie78e17323796120f576b9c0e1bc5ccc32da8ee12 --- M src/libmsc/smpp_openbsc.c 1 file changed, 1 insertion(+), 7 deletions(-) Approvals: Neels Hofmeyr: Looks good to me, approved diff --git a/src/libmsc/smpp_openbsc.c b/src/libmsc/smpp_openbsc.c index abf3b3c..c2f2f3b 100644 --- a/src/libmsc/smpp_openbsc.c +++ b/src/libmsc/smpp_openbsc.c @@ -631,10 +631,6 @@ return NULL; } -/* See SMPP 3.4, Section 5.2.17. registered_delivery (1 byte field). */ -#define SMPP34_NO_DELIVERY_RECEIPT 0x0 -#define SMPP34_DELIVERY_RECEIPT_REQ 0x1 - static int deliver_to_esme(struct osmo_esme *esme, struct gsm_sms *sms, struct gsm_subscriber_connection *conn) { @@ -680,9 +676,7 @@ deliver.protocol_id = sms->protocol_id; deliver.priority_flag = 0; if (sms->status_rep_req) - deliver.registered_delivery = SMPP34_DELIVERY_RECEIPT_REQ; - else - deliver.registered_delivery = SMPP34_NO_DELIVERY_RECEIPT; + deliver.registered_delivery = SMPP34_DELIVERY_RECEIPT_ON; /* Figure out SMPP DCS from TP-DCS */ dcs = sms->data_coding_scheme; -- To view, visit https://gerrit.osmocom.org/3664 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ie78e17323796120f576b9c0e1bc5ccc32da8ee12 Gerrit-PatchSet: 2 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pablo Neira Ayuso From gerrit-no-reply at lists.osmocom.org Sun Aug 27 00:34:48 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sun, 27 Aug 2017 00:34:48 +0000 Subject: [MERGED] osmo-msc[master]: increase libsmpp34 version requirement to 1.12 In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: increase libsmpp34 version requirement to 1.12 ...................................................................... increase libsmpp34 version requirement to 1.12 Only 1.12 contains some of the #defines that we're using with recent commits. Change-Id: I3743b10a1a5d2f1d42a61204273c1d00dc22b600 --- M configure.ac 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Neels Hofmeyr: Looks good to me, approved diff --git a/configure.ac b/configure.ac index f184e78..871f7e5 100644 --- a/configure.ac +++ b/configure.ac @@ -66,7 +66,7 @@ AC_ARG_ENABLE([smpp], [AS_HELP_STRING([--enable-smpp], [Build the SMPP interface])], [osmo_ac_build_smpp="$enableval"],[osmo_ac_build_smpp="no"]) if test "$osmo_ac_build_smpp" = "yes" ; then - PKG_CHECK_MODULES(LIBSMPP34, libsmpp34 >= 1.10) + PKG_CHECK_MODULES(LIBSMPP34, libsmpp34 >= 1.12) AC_DEFINE(BUILD_SMPP, 1, [Define if we want to build SMPP]) fi AM_CONDITIONAL(BUILD_SMPP, test "x$osmo_ac_build_smpp" = "xyes") -- To view, visit https://gerrit.osmocom.org/3663 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I3743b10a1a5d2f1d42a61204273c1d00dc22b600 Gerrit-PatchSet: 2 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Sun Aug 27 00:34:48 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sun, 27 Aug 2017 00:34:48 +0000 Subject: [MERGED] osmo-msc[master]: Migrate from gprs_apn_to_str() to libosmocore osmo_apn_to_str() In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: Migrate from gprs_apn_to_str() to libosmocore osmo_apn_to_str() ...................................................................... Migrate from gprs_apn_to_str() to libosmocore osmo_apn_to_str() In 2015, Jacob moved/copied related functions to libosmocore, but for some reason didn't remove the copies here. Let's follow-up on that and remove duplicated code. The libosmocore commit introducing osmo_apn_to_str() was 8114294bf29ac6e44822c0ae43d4b0819f11b022 Change-Id: I7315ffcbed8a54cca2056f313bb7783ad82d0ee9 --- M include/openbsc/gprs_utils.h M src/gprs/gb_proxy_patch.c M src/gprs/gb_proxy_vty.c M src/gprs/gprs_sgsn.c M src/gprs/gprs_subscriber.c M src/gprs/gprs_utils.c M src/gprs/gtphub.c M src/gprs/sgsn_cdr.c M src/gprs/sgsn_vty.c M tests/gprs/gprs_test.c M tests/gtphub/Makefile.am 11 files changed, 19 insertions(+), 148 deletions(-) Approvals: Neels Hofmeyr: Looks good to me, approved diff --git a/include/openbsc/gprs_utils.h b/include/openbsc/gprs_utils.h index 603605c..574f5c5 100644 --- a/include/openbsc/gprs_utils.h +++ b/include/openbsc/gprs_utils.h @@ -30,7 +30,6 @@ struct msgb *gprs_msgb_copy(const struct msgb *msg, const char *name); int gprs_msgb_resize_area(struct msgb *msg, uint8_t *area, size_t old_size, size_t new_size); -char *gprs_apn_to_str(char *out_str, const uint8_t *apn_enc, size_t rest_chars); int gprs_str_to_apn(uint8_t *apn_enc, size_t max_len, const char *str); /* GSM 04.08, 10.5.7.3 GPRS Timer */ diff --git a/src/gprs/gb_proxy_patch.c b/src/gprs/gb_proxy_patch.c index 7bddc44..210fb2b 100644 --- a/src/gprs/gb_proxy_patch.c +++ b/src/gprs/gb_proxy_patch.c @@ -28,6 +28,7 @@ #include #include +#include /* patch RA identifier in place */ static void gbproxy_patch_raid(uint8_t *raid_enc, struct gbproxy_peer *peer, @@ -101,7 +102,7 @@ LOGP(DGPRS, LOGL_DEBUG, "Patching %s to SGSN: Removing APN '%s'\n", log_text, - gprs_apn_to_str(str1, apn, apn_len)); + osmo_apn_to_str(str1, apn, apn_len)); *new_apn_ie_len = 0; gprs_msgb_resize_area(msg, apn_ie, apn_ie_len, 0); @@ -116,8 +117,8 @@ "Patching %s to SGSN: " "Replacing APN '%s' -> '%s'\n", log_text, - gprs_apn_to_str(str1, apn, apn_len), - gprs_apn_to_str(str2, peer->cfg->core_apn, + osmo_apn_to_str(str1, apn, apn_len), + osmo_apn_to_str(str2, peer->cfg->core_apn, peer->cfg->core_apn_size)); *new_apn_ie_len = peer->cfg->core_apn_size + 2; diff --git a/src/gprs/gb_proxy_vty.c b/src/gprs/gb_proxy_vty.c index 933b6b0..86d65a8 100644 --- a/src/gprs/gb_proxy_vty.c +++ b/src/gprs/gb_proxy_vty.c @@ -29,6 +29,7 @@ #include #include +#include #include #include @@ -107,7 +108,7 @@ if (g_cfg->core_apn_size > 0) { char str[500] = {0}; vty_out(vty, " core-access-point-name %s%s", - gprs_apn_to_str(str, g_cfg->core_apn, + osmo_apn_to_str(str, g_cfg->core_apn, g_cfg->core_apn_size), VTY_NEWLINE); } else { diff --git a/src/gprs/gprs_sgsn.c b/src/gprs/gprs_sgsn.c index 93b133f..43eeaaa 100644 --- a/src/gprs/gprs_sgsn.c +++ b/src/gprs/gprs_sgsn.c @@ -30,6 +30,7 @@ #include #include #include +#include #include #include @@ -758,7 +759,7 @@ return NULL; } - gprs_apn_to_str(req_apn_str, + osmo_apn_to_str(req_apn_str, TLVP_VAL(tp, GSM48_IE_GSM_APN), TLVP_LEN(tp, GSM48_IE_GSM_APN)); diff --git a/src/gprs/gprs_subscriber.c b/src/gprs/gprs_subscriber.c index aa03509..94297d0 100644 --- a/src/gprs/gprs_subscriber.c +++ b/src/gprs/gprs_subscriber.c @@ -22,6 +22,7 @@ #include #include +#include #include #include #include @@ -371,7 +372,7 @@ OSMO_ASSERT(pdp_data != NULL); pdp_data->pdp_type = pdp_info->pdp_type; - gprs_apn_to_str(pdp_data->apn_str, + osmo_apn_to_str(pdp_data->apn_str, pdp_info->apn_enc, pdp_info->apn_enc_len); memcpy(pdp_data->qos_subscribed, pdp_info->qos_enc, pdp_info->qos_enc_len); pdp_data->qos_subscribed_len = pdp_info->qos_enc_len; diff --git a/src/gprs/gprs_utils.c b/src/gprs/gprs_utils.c index 64ed978..91a09d2 100644 --- a/src/gprs/gprs_utils.c +++ b/src/gprs/gprs_utils.c @@ -114,34 +114,6 @@ return 0; } -/* TODO: Move these conversion functions to a utils file. */ -/* TODO: consolidate with gprs_apn2str(). */ -/** memmove apn_enc to out_str, replacing the length octets in apn_enc with '.' - * (omitting the first one) and terminating with a '\0'. - * out_str needs to have rest_chars amount of bytes or 1 whatever is bigger. - */ -char * gprs_apn_to_str(char *out_str, const uint8_t *apn_enc, size_t rest_chars) -{ - char *str = out_str; - - while (rest_chars > 0 && apn_enc[0]) { - size_t label_size = apn_enc[0]; - if (label_size + 1 > rest_chars) - return NULL; - - memmove(str, apn_enc + 1, label_size); - str += label_size; - rest_chars -= label_size + 1; - apn_enc += label_size + 1; - - if (rest_chars) - *(str++) = '.'; - } - str[0] = '\0'; - - return out_str; -} - int gprs_str_to_apn(uint8_t *apn_enc, size_t max_len, const char *str) { uint8_t *last_len_field; diff --git a/src/gprs/gtphub.c b/src/gprs/gtphub.c index 5e7520e..0a8e375 100644 --- a/src/gprs/gtphub.c +++ b/src/gprs/gtphub.c @@ -42,6 +42,8 @@ #include #include +#include + static const int GTPH_GC_TICK_SECONDS = 1; @@ -498,7 +500,7 @@ len = sizeof(apn_buf) - 1; apn_buf[len] = '\0'; - *apn_str = gprs_apn_to_str(apn_buf, (uint8_t*)apn_buf, len); + *apn_str = osmo_apn_to_str(apn_buf, (uint8_t*)apn_buf, len); if (!(*apn_str)) { LOG(LOGL_ERROR, "APN IE: present but cannot be decoded: %s\n", osmo_hexdump((uint8_t*)apn_buf, len)); diff --git a/src/gprs/sgsn_cdr.c b/src/gprs/sgsn_cdr.c index 0910896..16ea9d4 100644 --- a/src/gprs/sgsn_cdr.c +++ b/src/gprs/sgsn_cdr.c @@ -22,6 +22,7 @@ #include #include #include +#include #include @@ -145,7 +146,7 @@ if (pdp->lib) { - gprs_apn_to_str(apni, pdp->lib->apn_use.v, pdp->lib->apn_use.l); + osmo_apn_to_str(apni, pdp->lib->apn_use.v, pdp->lib->apn_use.l); inet_ntop(AF_INET, &pdp->lib->hisaddr0.s_addr, ggsn_addr, sizeof(ggsn_addr)); extract_eua(&pdp->lib->eua, eua_addr); } diff --git a/src/gprs/sgsn_vty.c b/src/gprs/sgsn_vty.c index cc8d6c3..cf44cc4 100644 --- a/src/gprs/sgsn_vty.c +++ b/src/gprs/sgsn_vty.c @@ -28,6 +28,7 @@ #include #include #include +#include #include #include @@ -116,7 +117,6 @@ #define GSM48_MAX_APN_LEN 102 /* 10.5.6.1 */ -/* TODO: consolidate with gprs_apn_to_str(). */ /** Copy apn to a static buffer, replacing the length octets in apn_enc with '.' * and terminating with a '\0'. Return the static buffer. * len: the length of the encoded APN (which has no terminating zero). @@ -124,23 +124,10 @@ static char *gprs_apn2str(uint8_t *apn, unsigned int len) { static char apnbuf[GSM48_MAX_APN_LEN+1]; - unsigned int i = 0; if (!apn) return ""; - - if (len > sizeof(apnbuf)-1) - len = sizeof(apnbuf)-1; - - memcpy(apnbuf, apn, len); - apnbuf[len] = '\0'; - - /* replace the domain name step sizes with dots */ - while (i < len) { - unsigned int step = apnbuf[i]; - apnbuf[i] = '.'; - i += step+1; - } + osmo_apn_to_str(apnbuf, apn, len); return apnbuf+1; } diff --git a/tests/gprs/gprs_test.c b/tests/gprs/gprs_test.c index ff77404..aac9bb8 100644 --- a/tests/gprs/gprs_test.c +++ b/tests/gprs/gprs_test.c @@ -48,101 +48,6 @@ ASSERT_FALSE(nu_is_retransmission(479, 511)); // wrapped } -static void apn_round_trip(const uint8_t *input, size_t len, const char *wanted_output) -{ - char output[len ? len : 1]; - uint8_t encoded[len + 50]; - char *out_str; - int enc_len; - - /* decode and verify we have what we want */ - out_str = gprs_apn_to_str(output, input, len); - OSMO_ASSERT(out_str); - OSMO_ASSERT(out_str == &output[0]); - OSMO_ASSERT(strlen(out_str) == strlen(wanted_output)); - OSMO_ASSERT(strcmp(out_str, wanted_output) == 0); - - /* encode and verify it */ - if (len != 0) { - enc_len = gprs_str_to_apn(encoded, ARRAY_SIZE(encoded), wanted_output); - OSMO_ASSERT(enc_len == len); - OSMO_ASSERT(memcmp(encoded, input, enc_len) == 0); - } else { - enc_len = gprs_str_to_apn(encoded, 0, wanted_output); - OSMO_ASSERT(enc_len == -1); - } -} - -static void test_gsm_03_03_apn(void) -{ - - { - /* test invalid writes */ - const uint8_t ref[10] = { 0xAB, 0xAC, 0xAD, 0xAE, 0xAF, 0xAB, 0xAC, 0xAD, 0xAE, 0xAF }; - uint8_t output[10]; - int enc_len; - - memcpy(output, ref, ARRAY_SIZE(output)); - enc_len = gprs_str_to_apn(output, 0, ""); - OSMO_ASSERT(enc_len == -1); - OSMO_ASSERT(memcmp(ref, output, ARRAY_SIZE(ref)) == 0); - - memcpy(output, ref, ARRAY_SIZE(output)); - enc_len = gprs_str_to_apn(output, 0, "foo"); - OSMO_ASSERT(enc_len == -1); - OSMO_ASSERT(memcmp(ref, output, ARRAY_SIZE(ref)) == 0); - - memcpy(output, ref, ARRAY_SIZE(output)); - enc_len = gprs_str_to_apn(output, 1, "foo"); - OSMO_ASSERT(enc_len == -1); - OSMO_ASSERT(memcmp(ref + 1, output + 1, ARRAY_SIZE(ref) - 1) == 0); - - memcpy(output, ref, ARRAY_SIZE(output)); - enc_len = gprs_str_to_apn(output, 2, "foo"); - OSMO_ASSERT(enc_len == -1); - OSMO_ASSERT(memcmp(ref + 2, output + 2, ARRAY_SIZE(ref) - 2) == 0); - - memcpy(output, ref, ARRAY_SIZE(output)); - enc_len = gprs_str_to_apn(output, 3, "foo"); - OSMO_ASSERT(enc_len == -1); - OSMO_ASSERT(memcmp(ref + 3, output + 3, ARRAY_SIZE(ref) - 3) == 0); - } - - { - /* single empty label */ - uint8_t input[] = { 0x0 }; - const char *output = ""; - apn_round_trip(input, ARRAY_SIZE(input), output); - } - - { - /* no label */ - uint8_t input[] = { }; - const char *output = ""; - apn_round_trip(input, ARRAY_SIZE(input), output); - } - - { - /* single label with A */ - uint8_t input[] = { 0x1, 65 }; - const char *output = "A"; - apn_round_trip(input, ARRAY_SIZE(input), output); - OSMO_ASSERT(gprs_apn_to_str(NULL, input, ARRAY_SIZE(input) - 1) == NULL); - } - - { - uint8_t input[] = { 0x3, 65, 66, 67, 0x2, 90, 122 }; - const char *output = "ABC.Zz"; - char tmp[strlen(output) + 1]; - apn_round_trip(input, ARRAY_SIZE(input), output); - OSMO_ASSERT(gprs_apn_to_str(tmp, input, ARRAY_SIZE(input) - 1) == NULL); - OSMO_ASSERT(gprs_apn_to_str(tmp, input, ARRAY_SIZE(input) - 2) == NULL); - OSMO_ASSERT(gprs_apn_to_str(tmp, input, ARRAY_SIZE(input) - 4) == NULL); - OSMO_ASSERT(gprs_apn_to_str(tmp, input, ARRAY_SIZE(input) - 5) == NULL); - OSMO_ASSERT(gprs_apn_to_str(tmp, input, ARRAY_SIZE(input) - 6) == NULL); - } -} - static void test_gprs_timer_enc_dec(void) { int i, u, secs, tmr; @@ -228,7 +133,6 @@ osmo_init_logging(&info); test_8_4_2(); - test_gsm_03_03_apn(); test_gprs_timer_enc_dec(); printf("Done.\n"); diff --git a/tests/gtphub/Makefile.am b/tests/gtphub/Makefile.am index 5c834b7..f2a6b88 100644 --- a/tests/gtphub/Makefile.am +++ b/tests/gtphub/Makefile.am @@ -8,6 +8,7 @@ -ggdb3 \ $(LIBOSMOCORE_CFLAGS) \ $(LIBOSMOABIS_CFLAGS) \ + $(LIBOSMOGSM_CFLAGS) \ $(LIBGTP_CFLAGS) \ $(NULL) @@ -37,6 +38,7 @@ $(top_builddir)/src/gprs/gtphub.o \ $(top_builddir)/src/gprs/gprs_utils.o \ $(LIBOSMOCORE_LIBS) \ + $(LIBOSMOGSM_LIBS) \ $(LIBGTP_LIBS) \ -lrt \ $(NULL) -- To view, visit https://gerrit.osmocom.org/3662 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I7315ffcbed8a54cca2056f313bb7783ad82d0ee9 Gerrit-PatchSet: 2 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Sun Aug 27 00:34:49 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sun, 27 Aug 2017 00:34:49 +0000 Subject: [MERGED] osmo-msc[master]: sgsn_vty: Don't assume pdp->lib is always valid In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: sgsn_vty: Don't assume pdp->lib is always valid ...................................................................... sgsn_vty: Don't assume pdp->lib is always valid We can only print libgtp pdp information if a library context is attached to this pdp context. This is not always the case, particuarly during some teardown scenarios. Change-Id: Ia3184877f9709db65f5f93a98403f2ef5b04a8ca --- M src/gprs/sgsn_vty.c 1 file changed, 16 insertions(+), 14 deletions(-) Approvals: Neels Hofmeyr: Looks good to me, approved diff --git a/src/gprs/sgsn_vty.c b/src/gprs/sgsn_vty.c index 888f53a..cc8d6c3 100644 --- a/src/gprs/sgsn_vty.c +++ b/src/gprs/sgsn_vty.c @@ -468,20 +468,22 @@ const char *imsi = pdp->mm ? pdp->mm->imsi : "(detaching)"; vty_out(vty, "%sPDP Context IMSI: %s, SAPI: %u, NSAPI: %u, TI: %u%s", pfx, imsi, pdp->sapi, pdp->nsapi, pdp->ti, VTY_NEWLINE); - vty_out(vty, "%s APN: %s%s", pfx, - gprs_apn2str(pdp->lib->apn_use.v, pdp->lib->apn_use.l), - VTY_NEWLINE); - vty_out(vty, "%s PDP Address: %s%s", pfx, - gprs_pdpaddr2str(pdp->lib->eua.v, pdp->lib->eua.l), - VTY_NEWLINE); - vty_out(vty, "%s GTP Local Control(%s / TEIC: 0x%08x) ", pfx, - gtp_ntoa(&pdp->lib->gsnlc), pdp->lib->teic_own); - vty_out(vty, "Data(%s / TEID: 0x%08x)%s", - gtp_ntoa(&pdp->lib->gsnlu), pdp->lib->teid_own, VTY_NEWLINE); - vty_out(vty, "%s GTP Remote Control(%s / TEIC: 0x%08x) ", pfx, - gtp_ntoa(&pdp->lib->gsnrc), pdp->lib->teic_gn); - vty_out(vty, "Data(%s / TEID: 0x%08x)%s", - gtp_ntoa(&pdp->lib->gsnru), pdp->lib->teid_gn, VTY_NEWLINE); + if (pdp->lib) { + vty_out(vty, "%s APN: %s%s", pfx, + gprs_apn2str(pdp->lib->apn_use.v, pdp->lib->apn_use.l), + VTY_NEWLINE); + vty_out(vty, "%s PDP Address: %s%s", pfx, + gprs_pdpaddr2str(pdp->lib->eua.v, pdp->lib->eua.l), + VTY_NEWLINE); + vty_out(vty, "%s GTP Local Control(%s / TEIC: 0x%08x) ", pfx, + gtp_ntoa(&pdp->lib->gsnlc), pdp->lib->teic_own); + vty_out(vty, "Data(%s / TEID: 0x%08x)%s", + gtp_ntoa(&pdp->lib->gsnlu), pdp->lib->teid_own, VTY_NEWLINE); + vty_out(vty, "%s GTP Remote Control(%s / TEIC: 0x%08x) ", pfx, + gtp_ntoa(&pdp->lib->gsnrc), pdp->lib->teic_gn); + vty_out(vty, "Data(%s / TEID: 0x%08x)%s", + gtp_ntoa(&pdp->lib->gsnru), pdp->lib->teid_gn, VTY_NEWLINE); + } vty_out_rate_ctr_group(vty, " ", pdp->ctrg); } -- To view, visit https://gerrit.osmocom.org/3661 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ia3184877f9709db65f5f93a98403f2ef5b04a8ca Gerrit-PatchSet: 2 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Sun Aug 27 00:34:49 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sun, 27 Aug 2017 00:34:49 +0000 Subject: [MERGED] osmo-msc[master]: Fix gsm_pchan2chan_nr() to use RSL_CHAN_OSMO_PDCH In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: Fix gsm_pchan2chan_nr() to use RSL_CHAN_OSMO_PDCH ...................................................................... Fix gsm_pchan2chan_nr() to use RSL_CHAN_OSMO_PDCH When converting from GSM_PCHAN_PDCH, we should generate a RSL channel number IE with the osmocom extension RSL_CHAN_OSMO_PDCH rather than claiming it is a regular TCH/F channel. This is important as this function is used by osmo-bts, too - and it decides which channel number IE is put in the GSMTAP header for both GSMTAP tracing as well as the GSMTAP based osmo-bts-virtual. In order to avoid any unintended effect on libbsc, we make sure to modify rsl_ipacc_pdch_activate() to always use GSM_PCHAN_TCH_F in related RSL message. Change-Id: Ie34219e64a6d89da4a79f2db8ec73d1909fb8280 --- M src/libbsc/abis_rsl.c M src/libcommon/gsm_data_shared.c 2 files changed, 5 insertions(+), 2 deletions(-) Approvals: Neels Hofmeyr: Looks good to me, approved diff --git a/src/libbsc/abis_rsl.c b/src/libbsc/abis_rsl.c index 3337b90..4f687a0 100644 --- a/src/libbsc/abis_rsl.c +++ b/src/libbsc/abis_rsl.c @@ -2450,7 +2450,7 @@ dh = (struct abis_rsl_dchan_hdr *) msgb_put(msg, sizeof(*dh)); init_dchan_hdr(dh, msg_type); dh->c.msg_discr = ABIS_RSL_MDISC_DED_CHAN; - dh->chan_nr = gsm_pchan2chan_nr(GSM_PCHAN_PDCH, ts->nr, 0); + dh->chan_nr = gsm_pchan2chan_nr(GSM_PCHAN_TCH_F, ts->nr, 0); DEBUGP(DRSL, "%s IPAC PDCH %sACT\n", gsm_ts_name(ts), act ? "" : "DE"); diff --git a/src/libcommon/gsm_data_shared.c b/src/libcommon/gsm_data_shared.c index d792f3b..2696273 100644 --- a/src/libcommon/gsm_data_shared.c +++ b/src/libcommon/gsm_data_shared.c @@ -644,11 +644,14 @@ switch (pchan) { case GSM_PCHAN_TCH_F: - case GSM_PCHAN_PDCH: case GSM_PCHAN_TCH_F_PDCH: OSMO_ASSERT(lchan_nr == 0); cbits = 0x01; break; + case GSM_PCHAN_PDCH: + OSMO_ASSERT(lchan_nr == 0); + cbits = RSL_CHAN_OSMO_PDCH >> 3; + break; case GSM_PCHAN_TCH_H: OSMO_ASSERT(lchan_nr < 2); cbits = 0x02; -- To view, visit https://gerrit.osmocom.org/3660 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ie34219e64a6d89da4a79f2db8ec73d1909fb8280 Gerrit-PatchSet: 2 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Sun Aug 27 00:34:49 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sun, 27 Aug 2017 00:34:49 +0000 Subject: [MERGED] osmo-msc[master]: SGSN: Fix RAN information exposed on GTP during PDP CTX CREATE In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: SGSN: Fix RAN information exposed on GTP during PDP CTX CREATE ...................................................................... SGSN: Fix RAN information exposed on GTP during PDP CTX CREATE In the PDP Context Create from SGSN to GGSN, we include information about the RAN type (GERAN/UTRAN) and the Cell of the MS. This was all hard-coded to GERAN, and wasn't updated when we added UTRAN support to the SGSN. Change-Id: I6c79e42c5e08b28fe8182555302a5505fbbaa313 --- M src/gprs/sgsn_libgtp.c 1 file changed, 18 insertions(+), 7 deletions(-) Approvals: Neels Hofmeyr: Looks good to me, approved diff --git a/src/gprs/sgsn_libgtp.c b/src/gprs/sgsn_libgtp.c index bc2fcd1..7ff8ece 100644 --- a/src/gprs/sgsn_libgtp.c +++ b/src/gprs/sgsn_libgtp.c @@ -251,18 +251,28 @@ memcpy(pdp->gsnlu.v, &sgsn->cfg.gtp_listenaddr.sin_addr, sizeof(sgsn->cfg.gtp_listenaddr.sin_addr)); - /* Routing Area Identifier with LAC and RAC fixed values, as - * requested in 29.006 7.3.1 */ + /* Encode RAT Type according to TS 29.060 7.7.50 */ + pdp->rattype.l = 1; + if (mmctx->ran_type == MM_CTX_T_UTRAN_Iu) + pdp->rattype.v[0] = 1; + else + pdp->rattype.v[0] = 2; + pdp->rattype_given = 1; + + /* Include RAI and ULI all the time */ pdp->rai_given = 1; pdp->rai.l = 6; + + /* Routing Area Identifier with LAC and RAC fixed values, as + * requested in 29.006 7.3.1 */ raid = mmctx->ra; raid.lac = 0xFFFE; raid.rac = 0xFF; gsm48_construct_ra(pdp->rai.v, &raid); - pdp->rattype.l = 1; - pdp->rattype_given = 1; - + /* Encode User Location Information accordint to TS 29.060 7.7.51 */ + pdp->userloc_given = 1; + pdp->userloc.l = 8; switch (mmctx->ran_type) { case MM_CTX_T_GERAN_Gb: case MM_CTX_T_GERAN_Iu: @@ -274,8 +284,9 @@ bssgp_create_cell_id(&pdp->userloc.v[1], &mmctx->ra, mmctx->gb.cell_id); break; case MM_CTX_T_UTRAN_Iu: - pdp->rattype.v[0] = 1; - /* FIXME: Optional User Location Information with SAI */ + pdp->userloc.v[0] = 1; /* SAI for UTRAN */ + /* SAI is like CGI but with SAC instead of CID, so we can abuse this function */ + bssgp_create_cell_id(&pdp->userloc.v[1], &mmctx->ra, mmctx->iu.sac); break; } -- To view, visit https://gerrit.osmocom.org/3659 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I6c79e42c5e08b28fe8182555302a5505fbbaa313 Gerrit-PatchSet: 2 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Sun Aug 27 00:34:49 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sun, 27 Aug 2017 00:34:49 +0000 Subject: [MERGED] osmo-msc[master]: mgcp: Fix uplink activation of Osmux stream In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: mgcp: Fix uplink activation of Osmux stream ...................................................................... mgcp: Fix uplink activation of Osmux stream Commit 575420637981828b64c1292ada015d7170b89390 introduced OSMUX_STATE_NEGOTIATING to fix a race condition present in osmo-bsc_nat. However, after this change osmo-bsc_mgcp cannot switch to OSMUX_STATE_ACTIVATING anymore, which means during osmux_send_dummy time it won't call osmux_enable_endpoint(), which in turn won't set endp type to MGCP_OSMUX_BSC. If MGCP_OSMUX_BSC is not set, uplink streams are sent using regular RTP instead of Osmux not matter it is enabled in config or not. Change-Id: Ibcb59aa1ca25408f82cc88c2d5b81177b5f276dc --- M src/libmgcp/mgcp_protocol.c 1 file changed, 4 insertions(+), 2 deletions(-) Approvals: Neels Hofmeyr: Looks good to me, approved diff --git a/src/libmgcp/mgcp_protocol.c b/src/libmgcp/mgcp_protocol.c index 78e41f1..96542c5 100644 --- a/src/libmgcp/mgcp_protocol.c +++ b/src/libmgcp/mgcp_protocol.c @@ -277,10 +277,12 @@ if (!addr) addr = mgcp_net_src_addr(endp); - if (endp->osmux.state == OSMUX_STATE_NEGOTIATING) + if (endp->osmux.state == OSMUX_STATE_NEGOTIATING) { sprintf(osmux_extension, "\nX-Osmux: %u", endp->osmux.cid); - else + endp->osmux.state = OSMUX_STATE_ACTIVATING; + } else { osmux_extension[0] = '\0'; + } len = snprintf(sdp_record, sizeof(sdp_record), "I: %u%s\n\n", endp->ci, osmux_extension); -- To view, visit https://gerrit.osmocom.org/3658 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ibcb59aa1ca25408f82cc88c2d5b81177b5f276dc Gerrit-PatchSet: 2 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Sun Aug 27 00:34:50 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sun, 27 Aug 2017 00:34:50 +0000 Subject: [MERGED] osmo-msc[master]: handover_logic: set correct link to bts for subscriber_conne... In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: handover_logic: set correct link to bts for subscriber_connection in case of moving this connection to another bts ...................................................................... handover_logic: set correct link to bts for subscriber_connection in case of moving this connection to another bts In case of successful completion of handover gsm_subscriber_connection could be moved from one bts to another, so connection link to bts should be replaced by link to bts, which owns new_lchan. This bug was detected, because conn->bts->nr is used in call control log messages and wrong number of bts was observed in these messages after handover. Change-Id: Idc7dd412b7580c451e716b73ef7549826c60b0d9 --- M src/libbsc/handover_logic.c 1 file changed, 1 insertion(+), 0 deletions(-) Approvals: Neels Hofmeyr: Looks good to me, approved diff --git a/src/libbsc/handover_logic.c b/src/libbsc/handover_logic.c index c03563f..57d1dcd 100644 --- a/src/libbsc/handover_logic.c +++ b/src/libbsc/handover_logic.c @@ -282,6 +282,7 @@ new_lchan->conn->ho_lchan = NULL; new_lchan->conn->lchan = new_lchan; + new_lchan->conn->bts = new_lchan->ts->trx->bts; ho->old_lchan->conn = NULL; lchan_release(ho->old_lchan, 0, RSL_REL_LOCAL_END); -- To view, visit https://gerrit.osmocom.org/3657 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Idc7dd412b7580c451e716b73ef7549826c60b0d9 Gerrit-PatchSet: 2 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Ivan Kluchnikov Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Sun Aug 27 00:34:50 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sun, 27 Aug 2017 00:34:50 +0000 Subject: [MERGED] osmo-msc[master]: mgcp_osmux: Remove unused parameter In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: mgcp_osmux: Remove unused parameter ...................................................................... mgcp_osmux: Remove unused parameter Change-Id: Icb1e7cb15fe04642578f5292124ebc1eac9c9aa3 --- M include/openbsc/osmux.h M src/libmgcp/mgcp_osmux.c 2 files changed, 4 insertions(+), 8 deletions(-) Approvals: Neels Hofmeyr: Looks good to me, approved diff --git a/include/openbsc/osmux.h b/include/openbsc/osmux.h index 0b64a7f..f3ea72a 100644 --- a/include/openbsc/osmux.h +++ b/include/openbsc/osmux.h @@ -11,8 +11,7 @@ }; int osmux_init(int role, struct mgcp_config *cfg); -int osmux_enable_endpoint(struct mgcp_endpoint *endp, int role, - struct in_addr *addr, uint16_t port); +int osmux_enable_endpoint(struct mgcp_endpoint *endp, struct in_addr *addr, uint16_t port); void osmux_disable_endpoint(struct mgcp_endpoint *endp); void osmux_allocate_cid(struct mgcp_endpoint *endp); void osmux_release_cid(struct mgcp_endpoint *endp); diff --git a/src/libmgcp/mgcp_osmux.c b/src/libmgcp/mgcp_osmux.c index b46a80e..c52984b 100644 --- a/src/libmgcp/mgcp_osmux.c +++ b/src/libmgcp/mgcp_osmux.c @@ -340,8 +340,7 @@ if (endp->osmux.state == OSMUX_STATE_ENABLED) goto out; - if (osmux_enable_endpoint(endp, OSMUX_ROLE_BSC_NAT, - &addr->sin_addr, addr->sin_port) < 0 ){ + if (osmux_enable_endpoint(endp, &addr->sin_addr, addr->sin_port) < 0 ) { LOGP(DMGCP, LOGL_ERROR, "Could not enable osmux in endpoint %d\n", ENDPOINT_NUMBER(endp)); @@ -433,8 +432,7 @@ return 0; } -int osmux_enable_endpoint(struct mgcp_endpoint *endp, int role, - struct in_addr *addr, uint16_t port) +int osmux_enable_endpoint(struct mgcp_endpoint *endp, struct in_addr *addr, uint16_t port) { /* If osmux is enabled, initialize the output handler. This handler is * used to reconstruct the RTP flow from osmux. The RTP SSRC is @@ -522,8 +520,7 @@ return 0; if (endp->osmux.state == OSMUX_STATE_ACTIVATING) { - if (osmux_enable_endpoint(endp, OSMUX_ROLE_BSC, - &endp->net_end.addr, + if (osmux_enable_endpoint(endp, &endp->net_end.addr, htons(endp->cfg->osmux_port)) < 0) { LOGP(DMGCP, LOGL_ERROR, "Could not activate osmux in endpoint %d\n", -- To view, visit https://gerrit.osmocom.org/3656 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Icb1e7cb15fe04642578f5292124ebc1eac9c9aa3 Gerrit-PatchSet: 2 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Sun Aug 27 00:34:50 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sun, 27 Aug 2017 00:34:50 +0000 Subject: [MERGED] osmo-msc[master]: libcommon: Fix log output for bts>0. In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: libcommon: Fix log output for bts>0. ...................................................................... libcommon: Fix log output for bts>0. Fixes regression probably introduced in c696cc28. For bts>0 logging doesn't show bts number correctly when printing lchan identification string - it will always show it as "bts=0". The reason for this is that the identification string is cached before bts->nr value is set to a proper value. This patch sets bts->nr as part of the first step of the bts structure initialization, before caching happens thus making sure the cached identification string is cached with the correct values. Change-Id: I61c18a7f021fcb1ec00d34a745f4e3ab03416c2d --- M include/openbsc/gsm_data_shared.h M src/libcommon/gsm_data.c M src/libcommon/gsm_data_shared.c M tests/channel/channel_test.c M tests/channel/channel_test.ok M tests/gsm0408/gsm0408_test.c 6 files changed, 42 insertions(+), 9 deletions(-) Approvals: Neels Hofmeyr: Looks good to me, approved diff --git a/include/openbsc/gsm_data_shared.h b/include/openbsc/gsm_data_shared.h index 0790807..60da2e5 100644 --- a/include/openbsc/gsm_data_shared.h +++ b/include/openbsc/gsm_data_shared.h @@ -899,7 +899,7 @@ }; -struct gsm_bts *gsm_bts_alloc(void *talloc_ctx); +struct gsm_bts *gsm_bts_alloc(void *talloc_ctx, uint8_t bts_num); struct gsm_bts *gsm_bts_num(struct gsm_network *net, int num); struct gsm_bts_trx *gsm_bts_trx_alloc(struct gsm_bts *bts); diff --git a/src/libcommon/gsm_data.c b/src/libcommon/gsm_data.c index b5bf059..7be2240 100644 --- a/src/libcommon/gsm_data.c +++ b/src/libcommon/gsm_data.c @@ -254,12 +254,13 @@ if (!model && type != GSM_BTS_TYPE_UNKNOWN) return NULL; - bts = gsm_bts_alloc(net); + bts = gsm_bts_alloc(net, net->num_bts); if (!bts) return NULL; + net->num_bts++; + bts->network = net; - bts->nr = net->num_bts++; bts->type = type; bts->model = model; bts->bsic = bsic; diff --git a/src/libcommon/gsm_data_shared.c b/src/libcommon/gsm_data_shared.c index 8992636..d792f3b 100644 --- a/src/libcommon/gsm_data_shared.c +++ b/src/libcommon/gsm_data_shared.c @@ -312,7 +312,7 @@ .initial_mcs = 6, }; -struct gsm_bts *gsm_bts_alloc(void *ctx) +struct gsm_bts *gsm_bts_alloc(void *ctx, uint8_t bts_num) { struct gsm_bts *bts = talloc_zero(ctx, struct gsm_bts); int i; @@ -320,6 +320,7 @@ if (!bts) return NULL; + bts->nr = bts_num; bts->num_trx = 0; INIT_LLIST_HEAD(&bts->trx_list); bts->ms_max_power = 15; /* dBm */ diff --git a/tests/channel/channel_test.c b/tests/channel/channel_test.c index f686969..beae658 100644 --- a/tests/channel/channel_test.c +++ b/tests/channel/channel_test.c @@ -31,6 +31,35 @@ #include #include +void test_bts_debug_print(void) +{ + struct gsm_network *network; + struct gsm_bts *bts; + struct gsm_bts_trx *trx; + + printf("Testing the lchan printing:"); + + /* Create a dummy network */ + network = bsc_network_init(tall_bsc_ctx, 1, 1, NULL); + if (!network) + exit(1); + /* Add a BTS with some reasonanbly non-zero id */ + bts = gsm_bts_alloc(network, 45); + /* Add a second TRX to test on multiple TRXs */ + gsm_bts_trx_alloc(bts); + + llist_for_each_entry(trx, &bts->trx_list, list) { + char *name = gsm_lchan_name(&trx->ts[3].lchan[4]); + + if (name) + printf(" %s", name); + else + printf("NULL name"); + } + printf("\n"); +} + + void test_dyn_ts_subslots(void) { struct gsm_bts_trx_ts ts; @@ -66,6 +95,7 @@ osmo_init_logging(&log_info); test_dyn_ts_subslots(); + test_bts_debug_print(); return EXIT_SUCCESS; } diff --git a/tests/channel/channel_test.ok b/tests/channel/channel_test.ok index e4d625a..81d6569 100644 --- a/tests/channel/channel_test.ok +++ b/tests/channel/channel_test.ok @@ -1 +1,2 @@ Testing subslot numbers for pchan types +Testing the lchan printing: (bts=45,trx=0,ts=3,ss=4) (bts=45,trx=1,ts=3,ss=4) diff --git a/tests/gsm0408/gsm0408_test.c b/tests/gsm0408/gsm0408_test.c index 1b326ee..fcdc8f8 100644 --- a/tests/gsm0408/gsm0408_test.c +++ b/tests/gsm0408/gsm0408_test.c @@ -153,7 +153,7 @@ if (!network) exit(1); - bts = gsm_bts_alloc(network); + bts = gsm_bts_alloc(network, 0); _bts_uarfcn_add(bts, 10564, 319, 0); _bts_uarfcn_add(bts, 10612, 319, 0); @@ -168,7 +168,7 @@ if (!network) exit(1); - bts = gsm_bts_alloc(network); + bts = gsm_bts_alloc(network, 0); _bts_uarfcn_add(bts, 10564, 318, 0); _bts_uarfcn_add(bts, 10612, 319, 0); @@ -188,7 +188,7 @@ if (!network) exit(1); - bts = gsm_bts_alloc(network); + bts = gsm_bts_alloc(network, 0); /* first generate invalid SI as no UARFCN added */ gen(bts, __func__); @@ -216,7 +216,7 @@ if (!network) exit(1); - bts = gsm_bts_alloc(network); + bts = gsm_bts_alloc(network, 0); bts->si_common.si2quater_neigh_list.arfcn = bts->si_common.data.earfcn_list; bts->si_common.si2quater_neigh_list.meas_bw = bts->si_common.data.meas_bw_list; @@ -249,7 +249,7 @@ if (!network) exit(1); - bts = gsm_bts_alloc(network); + bts = gsm_bts_alloc(network, 0); bts->si_common.si2quater_neigh_list.arfcn = bts->si_common.data.earfcn_list; bts->si_common.si2quater_neigh_list.meas_bw = bts->si_common.data.meas_bw_list; -- To view, visit https://gerrit.osmocom.org/3655 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I61c18a7f021fcb1ec00d34a745f4e3ab03416c2d Gerrit-PatchSet: 2 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Alexander Chemeris Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Sun Aug 27 00:34:51 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sun, 27 Aug 2017 00:34:51 +0000 Subject: [MERGED] osmo-msc[master]: libmsc: use new smpp34 esm_class definitions In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: libmsc: use new smpp34 esm_class definitions ...................................................................... libmsc: use new smpp34 esm_class definitions Replace magic numbers by esm_class definitions, which have been added to latest libsmpp34 in Change-Id I91afd8b462b8fd3b2c4c5b54f4eeb7ec5b730b65 Change-Id: I6c458690da60c8f3637680efbd718f6e8c6feb4c --- M src/libmsc/smpp_openbsc.c 1 file changed, 8 insertions(+), 10 deletions(-) Approvals: Neels Hofmeyr: Looks good to me, approved diff --git a/src/libmsc/smpp_openbsc.c b/src/libmsc/smpp_openbsc.c index 1ffb0cd..abf3b3c 100644 --- a/src/libmsc/smpp_openbsc.c +++ b/src/libmsc/smpp_openbsc.c @@ -158,14 +158,13 @@ osmo_strlcpy(sms->src.addr, (char *)submit->source_addr, sizeof(sms->src.addr)); - /* This is a Delivery Acknowledgment. */ - if (submit->esm_class == 0x08) + if (submit->esm_class == SMPP34_DELIVERY_ACK) sms->is_report = true; - if (submit->esm_class & 0x40) + if (submit->esm_class & SMPP34_UDHI_IND) sms->ud_hdr_ind = 1; - if (submit->esm_class & 0x80) { + if (submit->esm_class & SMPP34_REPLY_PATH) { sms->reply_path_req = 1; #warning Implement reply path } @@ -241,7 +240,7 @@ sms->smpp.esme = esme; sms->protocol_id = submit->protocol_id; - switch (submit->esm_class & 3) { + switch (submit->esm_class & SMPP34_MSG_MODE_MASK) { case 0: /* default */ case 1: /* datagram */ case 3: /* store-and-forward */ @@ -668,16 +667,15 @@ memcpy(deliver.destination_addr, sms->dst.addr, sizeof(deliver.destination_addr)); - /* Short message contains a delivery receipt? Sect. 5.2.12. */ if (sms->is_report) - deliver.esm_class = 0x04; + deliver.esm_class = SMPP34_DELIVERY_RECEIPT; else - deliver.esm_class = 1; /* datagram mode */ + deliver.esm_class = SMPP34_DATAGRAM_MODE; if (sms->ud_hdr_ind) - deliver.esm_class |= 0x40; + deliver.esm_class |= SMPP34_UDHI_IND; if (sms->reply_path_req) - deliver.esm_class |= 0x80; + deliver.esm_class |= SMPP34_REPLY_PATH; deliver.protocol_id = sms->protocol_id; deliver.priority_flag = 0; -- To view, visit https://gerrit.osmocom.org/3654 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I6c458690da60c8f3637680efbd718f6e8c6feb4c Gerrit-PatchSet: 2 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pablo Neira Ayuso From gerrit-no-reply at lists.osmocom.org Sun Aug 27 00:34:51 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sun, 27 Aug 2017 00:34:51 +0000 Subject: [MERGED] osmo-msc[master]: libmsc: use smpp34_tlv_for_each() to avoid suboptimal TLV ha... In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: libmsc: use smpp34_tlv_for_each() to avoid suboptimal TLV handling ...................................................................... libmsc: use smpp34_tlv_for_each() to avoid suboptimal TLV handling submit_to_sms() now handles two TLVs, so find_tlv() is suboptiomal and it can be removed, since it would result in two passes on the TLV list. Use new smpp34_tlv_for_each() helper to iterate over the list of TLVs that is available since I446929feed049d0411e1629ca263e2bc41f714cc. Change-Id: I53a65164a6cc4abc6bf57d9a8dc275cf21c90222 --- M src/libmsc/smpp_openbsc.c 1 file changed, 41 insertions(+), 31 deletions(-) Approvals: Neels Hofmeyr: Looks good to me, approved diff --git a/src/libmsc/smpp_openbsc.c b/src/libmsc/smpp_openbsc.c index 09012d0..1ffb0cd 100644 --- a/src/libmsc/smpp_openbsc.c +++ b/src/libmsc/smpp_openbsc.c @@ -73,26 +73,31 @@ return vsub; } -/*! \brief find a TLV with given tag in list of libsmpp34 TLVs */ -static struct tlv_t *find_tlv(struct tlv_t *head, uint16_t tag) +static int smpp34_submit_tlv_msg_payload(const struct tlv_t *t, + const struct submit_sm_t *submit, + const uint8_t **sms_msg, + unsigned int *sms_msg_len) { - struct tlv_t *t; - - for (t = head; t != NULL; t = t->next) { - if (t->tag == tag) - return t; + if (submit->sm_length) { + LOGP(DLSMS, LOGL_ERROR, + "SMPP cannot have payload in TLV _and_ in the header\n"); + return -1; } - return NULL; + *sms_msg = t->value.octet; + *sms_msg_len = t->length; + + return 0; } /*! \brief convert from submit_sm_t to gsm_sms */ static int submit_to_sms(struct gsm_sms **psms, struct gsm_network *net, const struct submit_sm_t *submit) { + const uint8_t *sms_msg = NULL; struct vlr_subscr *dest; + uint16_t msg_ref = 0; struct gsm_sms *sms; struct tlv_t *t; - const uint8_t *sms_msg; unsigned int sms_msg_len; int mode; @@ -106,31 +111,40 @@ return ESME_RINVDSTADR; } - t = find_tlv(submit->tlv, TLVID_message_payload); - if (t) { - if (submit->sm_length) { - /* ERROR: we cannot have both! */ - LOGP(DLSMS, LOGL_ERROR, "SMPP Cannot have payload in " - "TLV _and_ in the header\n"); - vlr_subscr_put(dest); - return ESME_ROPTPARNOTALLWD; + smpp34_tlv_for_each(t, submit->tlv) { + switch (t->tag) { + case TLVID_message_payload: + if (smpp34_submit_tlv_msg_payload(t, submit, &sms_msg, + &sms_msg_len) < 0) { + vlr_subscr_put(dest); + return ESME_ROPTPARNOTALLWD; + } + break; + case TLVID_user_message_reference: + msg_ref = ntohs(t->value.val16); + break; + default: + break; } - sms_msg = t->value.octet; - sms_msg_len = t->length; - } else if (submit->sm_length > 0 && submit->sm_length < 255) { - sms_msg = submit->short_message; - sms_msg_len = submit->sm_length; - } else { - LOGP(DLSMS, LOGL_ERROR, - "SMPP neither message payload nor valid sm_length.\n"); - vlr_subscr_put(dest); - return ESME_RINVPARLEN; + } + + if (!sms_msg) { + if (submit->sm_length > 0 && submit->sm_length < 255) { + sms_msg = submit->short_message; + sms_msg_len = submit->sm_length; + } else { + LOGP(DLSMS, LOGL_ERROR, + "SMPP neither message payload nor valid sm_length.\n"); + vlr_subscr_put(dest); + return ESME_RINVPARLEN; + } } sms = sms_alloc(); sms->source = SMS_SOURCE_SMPP; sms->smpp.sequence_nr = submit->sequence_number; sms->status_rep_req = submit->registered_delivery; + sms->msg_ref = msg_ref; /* fill in the destination address */ sms->receiver = dest; @@ -204,10 +218,6 @@ memcpy(sms->user_data, sms_msg, sms_msg_len); sms->user_data_len = sms_msg_len; } - - t = find_tlv(submit->tlv, TLVID_user_message_reference); - if (t) - sms->msg_ref = ntohs(t->value.val16); *psms = sms; return ESME_ROK; -- To view, visit https://gerrit.osmocom.org/3653 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I53a65164a6cc4abc6bf57d9a8dc275cf21c90222 Gerrit-PatchSet: 2 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pablo Neira Ayuso From gerrit-no-reply at lists.osmocom.org Sun Aug 27 00:34:52 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sun, 27 Aug 2017 00:34:52 +0000 Subject: [MERGED] osmo-msc[master]: libmsc: Remove comment not applying anymore In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: libmsc: Remove comment not applying anymore ...................................................................... libmsc: Remove comment not applying anymore The change-id I7276d356d805a83ebeec72b02c8563b7135ea0b6 added msg_ref to the databse but forgot to remove the comment stating it's not being stored. Change-Id: I204f098c8f2a480405446113e2181b2c53700cf3 --- M src/libmsc/db.c 1 file changed, 0 insertions(+), 1 deletion(-) Approvals: Neels Hofmeyr: Looks good to me, approved diff --git a/src/libmsc/db.c b/src/libmsc/db.c index 78e022d..3495806 100644 --- a/src/libmsc/db.c +++ b/src/libmsc/db.c @@ -750,7 +750,6 @@ sms->protocol_id = dbi_result_get_ulonglong(result, "protocol_id"); sms->data_coding_scheme = dbi_result_get_ulonglong(result, "data_coding_scheme"); - /* sms->msg_ref is temporary and not stored in DB */ sms->dst.npi = dbi_result_get_ulonglong(result, "dest_npi"); sms->dst.ton = dbi_result_get_ulonglong(result, "dest_ton"); -- To view, visit https://gerrit.osmocom.org/3652 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I204f098c8f2a480405446113e2181b2c53700cf3 Gerrit-PatchSet: 2 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Sun Aug 27 00:34:52 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sun, 27 Aug 2017 00:34:52 +0000 Subject: [MERGED] osmo-msc[master]: libmsc: gsm340_gen_oa_sub() may return negative value In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: libmsc: gsm340_gen_oa_sub() may return negative value ...................................................................... libmsc: gsm340_gen_oa_sub() may return negative value gsm340_gen_oa() returns a negative value if the output buffer that the caller passes is too small, so we have to check the return value of this function. Fixes: CID 174178 Fixes: CID 174179 Change-Id: I47215d7d89771730a7f84efa8aeeb187a0911fdb --- M src/libmsc/gsm_04_11.c 1 file changed, 9 insertions(+), 2 deletions(-) Approvals: Neels Hofmeyr: Looks good to me, approved diff --git a/src/libmsc/gsm_04_11.c b/src/libmsc/gsm_04_11.c index 261e5cd..eede74c 100644 --- a/src/libmsc/gsm_04_11.c +++ b/src/libmsc/gsm_04_11.c @@ -215,9 +215,9 @@ { uint8_t *smsp; uint8_t oa[12]; /* max len per 03.40 */ - uint8_t oa_len = 0; uint8_t octet_len; unsigned int old_msg_len = msg->len; + int oa_len; /* generate first octet with masked bits */ smsp = msgb_put(msg, 1); @@ -235,6 +235,9 @@ /* generate originator address */ oa_len = gsm340_gen_oa_sub(oa, sizeof(oa), &sms->src); + if (oa_len < 0) + return -ENOSPC; + smsp = msgb_put(msg, oa_len); memcpy(smsp, oa, oa_len); @@ -284,9 +287,9 @@ struct gsm_sms *sms) { unsigned int old_msg_len = msg->len; - uint8_t oa_len = 0; uint8_t oa[12]; /* max len per 03.40 */ uint8_t *smsp; + int oa_len; /* generate first octet with masked bits */ smsp = msgb_put(msg, 1); @@ -298,8 +301,12 @@ /* TP-MR (message reference) */ smsp = msgb_put(msg, 1); *smsp = sms->msg_ref; + /* generate recipient address */ oa_len = gsm340_gen_oa_sub(oa, sizeof(oa), &sms->dst); + if (oa_len < 0) + return -ENOSPC; + smsp = msgb_put(msg, oa_len); memcpy(smsp, oa, oa_len); -- To view, visit https://gerrit.osmocom.org/3651 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I47215d7d89771730a7f84efa8aeeb187a0911fdb Gerrit-PatchSet: 2 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pablo Neira Ayuso From gerrit-no-reply at lists.osmocom.org Sun Aug 27 00:34:52 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sun, 27 Aug 2017 00:34:52 +0000 Subject: [MERGED] osmo-msc[master]: libmsc: support GSM 03.40 status report for nitb In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: libmsc: support GSM 03.40 status report for nitb ...................................................................... libmsc: support GSM 03.40 status report for nitb This patch adds support for GSM 03.40 in nitb mode. MS GSM 03.40 SMSC | | | SMS-SUBMIT | |--------------------------->| | GSM 04.11 RP-ACK | |<---------------------------| | SMS-DELIVER | |<---------------------------| | GSM 04.11 RP-ACK | |--------------------------->| | SMS-STATUS-REPORT | |<---------------------------| | GSM 04.11 RP-ACK | |--------------------------->| | | Change-Id: I5cc7bb4ebadde0940f44d10c3df34707b0615160 --- M src/libmsc/gsm_04_11.c 1 file changed, 5 insertions(+), 0 deletions(-) Approvals: Neels Hofmeyr: Looks good to me, approved diff --git a/src/libmsc/gsm_04_11.c b/src/libmsc/gsm_04_11.c index 0a1348d..261e5cd 100644 --- a/src/libmsc/gsm_04_11.c +++ b/src/libmsc/gsm_04_11.c @@ -683,6 +683,11 @@ LOGP(DLSMS, LOGL_ERROR, "Failed to send status report! err=%d\n", rc); } + + /* No route via SMPP, send the GSM 03.40 status-report now. */ + if (gsms->receiver) + gsm340_rx_sms_submit(sms_report); + LOGP(DLSMS, LOGL_NOTICE, "Status report has been sent\n"); sms_free(sms_report); -- To view, visit https://gerrit.osmocom.org/3650 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I5cc7bb4ebadde0940f44d10c3df34707b0615160 Gerrit-PatchSet: 2 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pablo Neira Ayuso From gerrit-no-reply at lists.osmocom.org Sun Aug 27 00:34:52 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sun, 27 Aug 2017 00:34:52 +0000 Subject: [MERGED] osmo-msc[master]: libmsc: handle delivery ack via SMPP SUBMIT SM / send GSM 03... In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: libmsc: handle delivery ack via SMPP SUBMIT SM / send GSM 03.40 status report ...................................................................... libmsc: handle delivery ack via SMPP SUBMIT SM / send GSM 03.40 status report This patch adds gsm340_sms_send_status_report_tpdu() to build a status-report. Moreover, set sms->report field if we see a SMPP SUBMIT_SM with Delivery Acknowledgment esm_class, so this identifies that this is a delivery report. MS GSM 03.40 SMSC SMPP 3.4 ESME | | | | | SUBMIT-SM | | | esm_class = Delivery Ack | | |<-------------------------------| | | SUBMIT-SM-RESP | | |------------------------------->| | | | | SMS-STATUS-REPORT | | |<----------------------------| | | GSM 04.11 RP-ACK | | |---------------------------->| | | | | There is a FIXME message in this patch, that I just copied from gsm340_gen_sms_deliver_tpdu() since TP-MMS is not supported by OpenBSC. Change-Id: Ib70e534840308ed315f7add440351e649de3f907 --- M src/libmsc/gsm_04_11.c M src/libmsc/smpp_openbsc.c 2 files changed, 54 insertions(+), 2 deletions(-) Approvals: Neels Hofmeyr: Looks good to me, approved diff --git a/src/libmsc/gsm_04_11.c b/src/libmsc/gsm_04_11.c index b4fa3df..0a1348d 100644 --- a/src/libmsc/gsm_04_11.c +++ b/src/libmsc/gsm_04_11.c @@ -279,6 +279,49 @@ return msg->len - old_msg_len; } +/* As defined by GSM 03.40, Section 9.2.2.3. */ +static int gsm340_gen_sms_status_report_tpdu(struct msgb *msg, + struct gsm_sms *sms) +{ + unsigned int old_msg_len = msg->len; + uint8_t oa_len = 0; + uint8_t oa[12]; /* max len per 03.40 */ + uint8_t *smsp; + + /* generate first octet with masked bits */ + smsp = msgb_put(msg, 1); + /* TP-MTI (message type indicator) */ + *smsp = GSM340_SMS_STATUS_REP_SC2MS; + /* TP-MMS (more messages to send) */ + if (0 /* FIXME */) + *smsp |= 0x04; + /* TP-MR (message reference) */ + smsp = msgb_put(msg, 1); + *smsp = sms->msg_ref; + /* generate recipient address */ + oa_len = gsm340_gen_oa_sub(oa, sizeof(oa), &sms->dst); + smsp = msgb_put(msg, oa_len); + memcpy(smsp, oa, oa_len); + + /* generate TP-SCTS (Service centre timestamp) */ + smsp = msgb_put(msg, 7); + gsm340_gen_scts(smsp, time(NULL)); + + /* generate TP-DT (Discharge time, in TP-SCTS format). */ + smsp = msgb_put(msg, 7); + gsm340_gen_scts(smsp, time(NULL)); + + /* TP-ST (status) */ + smsp = msgb_put(msg, 1); + /* 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); + + return msg->len - old_msg_len; +} + static int sms_route_mt_sms(struct gsm_subscriber_connection *conn, struct gsm_sms *gsms) { @@ -993,8 +1036,13 @@ /* obtain a pointer for the rp_ud_len, so we can fill it later */ rp_ud_len = (uint8_t *)msgb_put(msg, 1); - /* generate the 03.40 SMS-DELIVER TPDU */ - rc = gsm340_gen_sms_deliver_tpdu(msg, sms); + if (sms->is_report) { + /* generate the 03.40 SMS-STATUS-REPORT TPDU */ + rc = gsm340_gen_sms_status_report_tpdu(msg, sms); + } else { + /* generate the 03.40 SMS-DELIVER TPDU */ + rc = gsm340_gen_sms_deliver_tpdu(msg, sms); + } if (rc < 0) { send_signal(S_SMS_UNKNOWN_ERROR, trans, sms, 0); sms_free(sms); diff --git a/src/libmsc/smpp_openbsc.c b/src/libmsc/smpp_openbsc.c index 03482be..09012d0 100644 --- a/src/libmsc/smpp_openbsc.c +++ b/src/libmsc/smpp_openbsc.c @@ -144,6 +144,10 @@ osmo_strlcpy(sms->src.addr, (char *)submit->source_addr, sizeof(sms->src.addr)); + /* This is a Delivery Acknowledgment. */ + if (submit->esm_class == 0x08) + sms->is_report = true; + if (submit->esm_class & 0x40) sms->ud_hdr_ind = 1; -- To view, visit https://gerrit.osmocom.org/3649 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ib70e534840308ed315f7add440351e649de3f907 Gerrit-PatchSet: 2 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pablo Neira Ayuso From gerrit-no-reply at lists.osmocom.org Sun Aug 27 00:34:53 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sun, 27 Aug 2017 00:34:53 +0000 Subject: [MERGED] osmo-msc[master]: utils: smpp_mirror: bounce Delivery Receipts as Delivery Ack... In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: utils: smpp_mirror: bounce Delivery Receipts as Delivery Acknowledgments ...................................................................... utils: smpp_mirror: bounce Delivery Receipts as Delivery Acknowledgments Simple patch to test the new status-report support code, remove previous code before Delivery Acknowledgement support was in place. Use LOGL_DEBUG for logging messages here as suggested by Neels and Harald. Change-Id: I877e228d8e174430f700631edbf9955972da7892 --- M src/utils/smpp_mirror.c 1 file changed, 8 insertions(+), 9 deletions(-) Approvals: Neels Hofmeyr: Looks good to me, approved diff --git a/src/utils/smpp_mirror.c b/src/utils/smpp_mirror.c index 88545de..c570505 100644 --- a/src/utils/smpp_mirror.c +++ b/src/utils/smpp_mirror.c @@ -123,14 +123,6 @@ PACK_AND_SEND(esme, &deliver_r); - /* This is a delivery receipt, temporarily munch it until we teach - * openbsc what to do with this. - */ - if (deliver.esm_class == 0x04) { - LOGP(DSMPP, LOGL_NOTICE, "%s\n", deliver.short_message); - return 0; - } - memset(&submit, 0, sizeof(submit)); submit.command_id = SUBMIT_SM; submit.command_status = ESME_ROK; @@ -148,7 +140,14 @@ OSMO_MIN(sizeof(submit.source_addr), sizeof(deliver.destination_addr))); - submit.esm_class = deliver.esm_class; + /* Mirror delivery receipts as a delivery acknowledgements. */ + if (deliver.esm_class == 0x04) { + LOGP(DSMPP, LOGL_DEBUG, "%s\n", deliver.short_message); + submit.esm_class = 0x08; + } else { + submit.esm_class = deliver.esm_class; + } + submit.registered_delivery = deliver.registered_delivery; submit.protocol_id = deliver.protocol_id; submit.priority_flag = deliver.priority_flag; -- To view, visit https://gerrit.osmocom.org/3648 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I877e228d8e174430f700631edbf9955972da7892 Gerrit-PatchSet: 2 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pablo Neira Ayuso From gerrit-no-reply at lists.osmocom.org Sun Aug 27 00:34:53 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sun, 27 Aug 2017 00:34:53 +0000 Subject: [MERGED] osmo-msc[master]: libmsc: update database to accomodate SMS status-report fields In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: libmsc: update database to accomodate SMS status-report fields ...................................................................... libmsc: update database to accomodate SMS status-report fields SMPP DELIVER_SM messages with esm_class = Delivery Receipt need to send this message reference (that the mobile phone allocates) to the ESME. Thus, the ESME propagates it via SUBMIT_SM with esm_class = Delivery Acknoledgment so that the SMSC sends the GSM 03.40 status-report to the origin including this. Given this field is useful for status-reports, we need to store it in the HLR database. Moreover, we need a new field that specifies if the entry represents a SMS status-report, to do the right handling from the gsm411_send_sms() - such new handling comes in a follow up patch entitled "libmsc: handle delivery ack via SMPP SUBMIT SM / send GSM 03.40 status report". This patch includes the migration routines to the new database schema revision 5, it's quite a bit of dbi boilerplate code - copied-pasted and adapted. Change-Id: I7276d356d805a83ebeec72b02c8563b7135ea0b6 --- M src/libmsc/db.c M tests/db/db_test.err 2 files changed, 163 insertions(+), 6 deletions(-) Approvals: Neels Hofmeyr: Looks good to me, approved diff --git a/src/libmsc/db.c b/src/libmsc/db.c index 28e9782..78e022d 100644 --- a/src/libmsc/db.c +++ b/src/libmsc/db.c @@ -48,7 +48,7 @@ static char *db_dirname = NULL; static dbi_conn conn; -#define SCHEMA_REVISION "4" +#define SCHEMA_REVISION "5" enum { SCHEMA_META, @@ -122,6 +122,8 @@ "valid_until TIMESTAMP, " "reply_path_req INTEGER NOT NULL, " "status_rep_req INTEGER NOT NULL, " + "is_report INTEGER NOT NULL, " + "msg_ref INTEGER NOT NULL, " "protocol_id INTEGER NOT NULL, " "data_coding_scheme INTEGER NOT NULL, " "ud_hdr_ind INTEGER NOT NULL, " @@ -378,6 +380,152 @@ return -EINVAL; } +/* Just like v3, but there is a new message reference field for status reports, + * that is set to zero for existing entries since there is no way we can infer + * this. + */ +static struct gsm_sms *sms_from_result_v4(dbi_result result) +{ + struct gsm_sms *sms = sms_alloc(); + const unsigned char *user_data; + const char *text, *addr; + + if (!sms) + return NULL; + + sms->id = dbi_result_get_ulonglong(result, "id"); + + sms->reply_path_req = dbi_result_get_ulonglong(result, "reply_path_req"); + sms->status_rep_req = dbi_result_get_ulonglong(result, "status_rep_req"); + sms->ud_hdr_ind = dbi_result_get_ulonglong(result, "ud_hdr_ind"); + sms->protocol_id = dbi_result_get_ulonglong(result, "protocol_id"); + sms->data_coding_scheme = dbi_result_get_ulonglong(result, + "data_coding_scheme"); + + addr = dbi_result_get_string(result, "src_addr"); + osmo_strlcpy(sms->src.addr, addr, sizeof(sms->src.addr)); + sms->src.ton = dbi_result_get_ulonglong(result, "src_ton"); + sms->src.npi = dbi_result_get_ulonglong(result, "src_npi"); + + addr = dbi_result_get_string(result, "dest_addr"); + osmo_strlcpy(sms->dst.addr, addr, sizeof(sms->dst.addr)); + sms->dst.ton = dbi_result_get_ulonglong(result, "dest_ton"); + sms->dst.npi = dbi_result_get_ulonglong(result, "dest_npi"); + + sms->user_data_len = dbi_result_get_field_length(result, "user_data"); + user_data = dbi_result_get_binary(result, "user_data"); + if (sms->user_data_len > sizeof(sms->user_data)) + sms->user_data_len = (uint8_t) sizeof(sms->user_data); + memcpy(sms->user_data, user_data, sms->user_data_len); + + text = dbi_result_get_string(result, "text"); + if (text) + osmo_strlcpy(sms->text, text, sizeof(sms->text)); + return sms; +} + +static int update_db_revision_4(void) +{ + dbi_result result; + struct gsm_sms *sms; + + LOGP(DDB, LOGL_NOTICE, "Going to migrate from revision 4\n"); + + result = dbi_conn_query(conn, "BEGIN EXCLUSIVE TRANSACTION"); + if (!result) { + LOGP(DDB, LOGL_ERROR, + "Failed to begin transaction (upgrade from rev 4)\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_4"); + if (!result) { + LOGP(DDB, LOGL_ERROR, + "Failed to rename the old SMS table (upgrade from rev 4).\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 4).\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_4"); + if (!result) { + LOGP(DDB, LOGL_ERROR, + "Failed fetch messages from the old SMS table (upgrade from rev 4).\n"); + goto rollback; + } + while (dbi_result_next_row(result)) { + sms = sms_from_result_v4(result); + if (db_sms_store(sms) != 0) { + LOGP(DDB, LOGL_ERROR, "Failed to store message to the new SMS table(upgrade from rev 4).\n"); + sms_free(sms); + dbi_result_free(result); + goto rollback; + } + sms_free(sms); + } + dbi_result_free(result); + + /* Remove the temporary table */ + result = dbi_conn_query(conn, "DROP TABLE SMS_4"); + if (!result) { + LOGP(DDB, LOGL_ERROR, + "Failed to drop the old SMS table (upgrade from rev 4).\n"); + goto rollback; + } + dbi_result_free(result); + + /* We're done. Bump DB Meta revision to 4 */ + result = dbi_conn_query(conn, + "UPDATE Meta " + "SET value = '5' " + "WHERE key = 'revision'"); + if (!result) { + LOGP(DDB, LOGL_ERROR, + "Failed to update DB schema revision (upgrade from rev 4).\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 4)\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 4).\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 4).\n"); + else + dbi_result_free(result); + return -EINVAL; +} + static int check_db_revision(void) { dbi_result result; @@ -420,6 +568,9 @@ goto error; case 3: if (update_db_revision_3()) + goto error; + case 4: + if (update_db_revision_4()) goto error; /* The end of waterfall */ @@ -546,20 +697,23 @@ result = dbi_conn_queryf(conn, "INSERT INTO SMS " "(created, valid_until, " - "reply_path_req, status_rep_req, protocol_id, " - "data_coding_scheme, ud_hdr_ind, " + "reply_path_req, status_rep_req, is_report, " + "msg_ref, protocol_id, data_coding_scheme, " + "ud_hdr_ind, " "user_data, text, " "dest_addr, dest_ton, dest_npi, " "src_addr, src_ton, src_npi) VALUES " "(datetime('now'), %u, " "%u, %u, %u, " - "%u, %u, " + "%u, %u, %u, " + "%u, " "%s, %s, " "%s, %u, %u, " "%s, %u, %u)", validity_timestamp, - sms->reply_path_req, sms->status_rep_req, sms->protocol_id, - sms->data_coding_scheme, sms->ud_hdr_ind, + sms->reply_path_req, sms->status_rep_req, sms->is_report, + sms->msg_ref, sms->protocol_id, sms->data_coding_scheme, + sms->ud_hdr_ind, q_udata, q_text, q_daddr, sms->dst.ton, sms->dst.npi, q_saddr, sms->src.ton, sms->src.npi); @@ -590,6 +744,8 @@ /* FIXME: those should all be get_uchar, but sqlite3 is braindead */ sms->reply_path_req = dbi_result_get_ulonglong(result, "reply_path_req"); sms->status_rep_req = dbi_result_get_ulonglong(result, "status_rep_req"); + sms->is_report = dbi_result_get_ulonglong(result, "is_report"); + sms->msg_ref = dbi_result_get_ulonglong(result, "msg_ref"); sms->ud_hdr_ind = dbi_result_get_ulonglong(result, "ud_hdr_ind"); sms->protocol_id = dbi_result_get_ulonglong(result, "protocol_id"); sms->data_coding_scheme = dbi_result_get_ulonglong(result, diff --git a/tests/db/db_test.err b/tests/db/db_test.err index fa9a54c..27e5703 100644 --- a/tests/db/db_test.err +++ b/tests/db/db_test.err @@ -1,2 +1,3 @@ Going to migrate from revision 3 +Going to migrate from revision 4  \ No newline at end of file -- To view, visit https://gerrit.osmocom.org/3647 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I7276d356d805a83ebeec72b02c8563b7135ea0b6 Gerrit-PatchSet: 2 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pablo Neira Ayuso From gerrit-no-reply at lists.osmocom.org Sun Aug 27 00:34:53 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sun, 27 Aug 2017 00:34:53 +0000 Subject: [MERGED] osmo-msc[master]: libmsc: add support for SMPP delivery receipts In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: libmsc: add support for SMPP delivery receipts ...................................................................... libmsc: add support for SMPP delivery receipts If the mobile phone requests a status report via SMS, send a DELIVER_SM with esm_class = Delivery Receipt to ESME to indicate that the SMS has been already delivered to its destination. MS GSM 03.40 SMSC SMPP 3.4 ESME | | | | SMS-DELIVER | | |<----------------------------| | | GSM 04.11 RP-ACK | | |---------------------------->| | | | DELIVER-SM | | | esm_class = Delivery Receipt | | |------------------------------->| | | DELIVER-SM-RESP | | |<-------------------------------| | | | This patch implements "Appendix B. Delivery Receipt Format" as specified in the SMPP 3.4 specs. This string is conveyed in the SMS message as data, and it is only meaningful to the ESME, for logging purposes. The "submit date" and "done date" are not yet set, and other fields are just sent with dummy values, so they are left to be finished as future work. The new SMPP TLV tag TLVID_user_message_reference is added to the SMPP messages inconditionally now since this information is required by delivery-reports to associate the status-report with the original SMS. Change-Id: Ic1a9023074bfa938099377980b6aff9b262fab2a --- M include/openbsc/gsm_data.h M src/libmsc/gsm_04_11.c M src/libmsc/smpp_openbsc.c M src/libmsc/smpp_smsc.h 4 files changed, 76 insertions(+), 1 deletion(-) Approvals: Neels Hofmeyr: Looks good to me, approved diff --git a/include/openbsc/gsm_data.h b/include/openbsc/gsm_data.h index 02823c9..51cf6dc 100644 --- a/include/openbsc/gsm_data.h +++ b/include/openbsc/gsm_data.h @@ -511,6 +511,7 @@ } smpp; unsigned long validity_minutes; + bool is_report; uint8_t reply_path_req; uint8_t status_rep_req; uint8_t ud_hdr_ind; diff --git a/src/libmsc/gsm_04_11.c b/src/libmsc/gsm_04_11.c index cd23883..b4fa3df 100644 --- a/src/libmsc/gsm_04_11.c +++ b/src/libmsc/gsm_04_11.c @@ -594,6 +594,57 @@ rpud_len, rp_ud); } +static struct gsm_sms *sms_report_alloc(struct gsm_sms *sms) +{ + struct gsm_sms *sms_report; + int len; + + sms_report = sms_alloc(); + OSMO_ASSERT(sms_report); + + sms_report->msg_ref = sms->msg_ref; + sms_report->protocol_id = sms->protocol_id; + sms_report->data_coding_scheme = GSM338_DCS_1111_8BIT_DATA; + + /* Invert address to send status report back to origin. */ + sms_report->src = sms->dst; + sms_report->dst = sms->src; + + /* As specified by Appendix B. Delivery Receipt Format. + * TODO: Many fields in this string are just set with dummy values, + * revisit this. + */ + len = snprintf((char *)sms_report->user_data, + sizeof(sms_report->user_data), + "id:%.08llu sub:000 dlvrd:000 submit date:YYMMDDhhmm done date:YYMMDDhhmm stat:DELIVRD err:000 text:%.20s", + sms->id, sms->user_data); + sms_report->user_data_len = len; + LOGP(DLSMS, LOGL_NOTICE, "%s\n", sms_report->user_data); + + /* This represents a sms report. */ + sms_report->is_report = true; + + return sms_report; +} + +static void sms_status_report(struct gsm_sms *gsms, + struct gsm_subscriber_connection *conn) +{ + struct gsm_sms *sms_report; + int rc; + + sms_report = sms_report_alloc(gsms); + + rc = sms_route_mt_sms(conn, sms_report); + if (rc < 0) { + LOGP(DLSMS, LOGL_ERROR, + "Failed to send status report! err=%d\n", rc); + } + LOGP(DLSMS, LOGL_NOTICE, "Status report has been sent\n"); + + sms_free(sms_report); +} + /* Receive a 04.11 RP-ACK message (response to RP-DATA from us) */ static int gsm411_rx_rp_ack(struct msgb *msg, struct gsm_trans *trans, struct gsm411_rp_hdr *rph) @@ -615,6 +666,9 @@ send_signal(S_SMS_DELIVERED, trans, sms, 0); + if (sms->status_rep_req) + sms_status_report(sms, trans->conn); + sms_free(sms); trans->sms.sms = NULL; diff --git a/src/libmsc/smpp_openbsc.c b/src/libmsc/smpp_openbsc.c index 5de1368..03482be 100644 --- a/src/libmsc/smpp_openbsc.c +++ b/src/libmsc/smpp_openbsc.c @@ -201,6 +201,10 @@ sms->user_data_len = sms_msg_len; } + t = find_tlv(submit->tlv, TLVID_user_message_reference); + if (t) + sms->msg_ref = ntohs(t->value.val16); + *psms = sms; return ESME_ROK; } @@ -518,6 +522,9 @@ struct gsm_subscriber_connection *conn; struct gsm_trans *trans; + if (cmd->is_report) + goto out; + conn = connection_for_subscr(cmd->vsub); if (!conn) { LOGP(DSMPP, LOGL_ERROR, "No connection to subscriber anymore\n"); @@ -541,6 +548,9 @@ struct gsm_subscriber_connection *conn; struct gsm_trans *trans; int gsm411_cause; + + if (cmd->is_report) + goto out; conn = connection_for_subscr(cmd->vsub); if (!conn) { @@ -579,6 +589,7 @@ return -1; cmd->sequence_nr = sequence_number; + cmd->is_report = sms->is_report; cmd->gsm411_msg_ref = sms->gsm411.msg_ref; cmd->gsm411_trans_id = sms->gsm411.transaction_id; cmd->vsub = vlr_subscr_get(vsub); @@ -643,7 +654,12 @@ memcpy(deliver.destination_addr, sms->dst.addr, sizeof(deliver.destination_addr)); - deliver.esm_class = 1; /* datagram mode */ + /* Short message contains a delivery receipt? Sect. 5.2.12. */ + if (sms->is_report) + deliver.esm_class = 0x04; + else + deliver.esm_class = 1; /* datagram mode */ + if (sms->ud_hdr_ind) deliver.esm_class |= 0x40; if (sms->reply_path_req) @@ -692,6 +708,9 @@ append_osmo_tlvs(&deliver.tlv, conn->lchan); #endif + append_tlv_u16(&deliver.tlv, TLVID_user_message_reference, + sms->msg_ref); + ret = smpp_tx_deliver(esme, &deliver); if (ret < 0) return ret; diff --git a/src/libmsc/smpp_smsc.h b/src/libmsc/smpp_smsc.h index 0f1d35c..755e685 100644 --- a/src/libmsc/smpp_smsc.h +++ b/src/libmsc/smpp_smsc.h @@ -92,6 +92,7 @@ uint32_t sequence_nr; uint32_t gsm411_msg_ref; uint8_t gsm411_trans_id; + bool is_report; struct osmo_timer_list response_timer; }; -- To view, visit https://gerrit.osmocom.org/3646 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ic1a9023074bfa938099377980b6aff9b262fab2a Gerrit-PatchSet: 2 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pablo Neira Ayuso From gerrit-no-reply at lists.osmocom.org Sun Aug 27 00:34:53 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sun, 27 Aug 2017 00:34:53 +0000 Subject: [MERGED] osmo-msc[master]: utils: smpp_mirror: reflect message reference TLV In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: utils: smpp_mirror: reflect message reference TLV ...................................................................... utils: smpp_mirror: reflect message reference TLV Useful to test the delivery receipt support. This TLV contains the GSM03.40 message reference. Change-Id: I1b0abaa7e06ffe1bd2242c70813d8b70e9fa954f --- M src/utils/smpp_mirror.c 1 file changed, 23 insertions(+), 1 deletion(-) Approvals: Neels Hofmeyr: Looks good to me, approved diff --git a/src/utils/smpp_mirror.c b/src/utils/smpp_mirror.c index edb40b5..88545de 100644 --- a/src/utils/smpp_mirror.c +++ b/src/utils/smpp_mirror.c @@ -95,12 +95,23 @@ } /* FIXME: merge with smpp_smsc.c */ +static struct tlv_t *find_tlv(struct tlv_t *head, uint16_t tag) +{ + struct tlv_t *t; + + for (t = head; t != NULL; t = t->next) { + if (t->tag == tag) + return t; + } + return NULL; +} static int smpp_handle_deliver(struct esme *esme, struct msgb *msg) { struct deliver_sm_t deliver; struct deliver_sm_resp_t deliver_r; struct submit_sm_t submit; + tlv_t *t; int rc; memset(&deliver, 0, sizeof(deliver)); @@ -155,7 +166,18 @@ memcpy(submit.short_message, deliver.short_message, OSMO_MIN(sizeof(submit.short_message), sizeof(deliver.short_message))); - /* FIXME: TLV? */ + + /* FIXME: More TLV? */ + t = find_tlv(deliver.tlv, TLVID_user_message_reference); + if (t) { + tlv_t tlv; + + memset(&tlv, 0, sizeof(tlv)); + tlv.tag = TLVID_user_message_reference; + tlv.length = 2; + tlv.value.val16 = t->value.val16; + build_tlv(&submit.tlv, &tlv); + } return PACK_AND_SEND(esme, &submit); } -- To view, visit https://gerrit.osmocom.org/3645 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I1b0abaa7e06ffe1bd2242c70813d8b70e9fa954f Gerrit-PatchSet: 2 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pablo Neira Ayuso From gerrit-no-reply at lists.osmocom.org Sun Aug 27 00:34:54 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sun, 27 Aug 2017 00:34:54 +0000 Subject: [MERGED] osmo-msc[master]: utils: smpp_mirror: temporarily munch SMPP delivery receipts In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: utils: smpp_mirror: temporarily munch SMPP delivery receipts ...................................................................... utils: smpp_mirror: temporarily munch SMPP delivery receipts Just munch and log SMPP delivery receipts by now, don't mirror this, it is going to break things in openbsc. Follow up patch removes this and mirrors this SMPP message as a SUBMIT_SM with esm_class = Delivery Acknowledgement. Change-Id: I78e93bc4034679e238c8642ccf6a0e844b1d6d8b --- M src/utils/smpp_mirror.c 1 file changed, 8 insertions(+), 0 deletions(-) Approvals: Neels Hofmeyr: Looks good to me, approved diff --git a/src/utils/smpp_mirror.c b/src/utils/smpp_mirror.c index ec28f0a..edb40b5 100644 --- a/src/utils/smpp_mirror.c +++ b/src/utils/smpp_mirror.c @@ -112,6 +112,14 @@ PACK_AND_SEND(esme, &deliver_r); + /* This is a delivery receipt, temporarily munch it until we teach + * openbsc what to do with this. + */ + if (deliver.esm_class == 0x04) { + LOGP(DSMPP, LOGL_NOTICE, "%s\n", deliver.short_message); + return 0; + } + memset(&submit, 0, sizeof(submit)); submit.command_id = SUBMIT_SM; submit.command_status = ESME_ROK; -- To view, visit https://gerrit.osmocom.org/3644 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I78e93bc4034679e238c8642ccf6a0e844b1d6d8b Gerrit-PatchSet: 2 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pablo Neira Ayuso From gerrit-no-reply at lists.osmocom.org Sun Aug 27 00:34:54 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sun, 27 Aug 2017 00:34:54 +0000 Subject: [MERGED] osmo-msc[master]: utils: smpp_mirror: set registered_delivery field in SMPP SU... In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: utils: smpp_mirror: set registered_delivery field in SMPP SUBMIT_SM ...................................................................... utils: smpp_mirror: set registered_delivery field in SMPP SUBMIT_SM To test delivery reports using this utility. Change-Id: I0e477407531fdd4d906e53c9b5a48a79a239966f --- M src/utils/smpp_mirror.c 1 file changed, 1 insertion(+), 0 deletions(-) Approvals: Neels Hofmeyr: Looks good to me, approved diff --git a/src/utils/smpp_mirror.c b/src/utils/smpp_mirror.c index 95df5f2..ec28f0a 100644 --- a/src/utils/smpp_mirror.c +++ b/src/utils/smpp_mirror.c @@ -130,6 +130,7 @@ sizeof(deliver.destination_addr))); submit.esm_class = deliver.esm_class; + submit.registered_delivery = deliver.registered_delivery; submit.protocol_id = deliver.protocol_id; submit.priority_flag = deliver.priority_flag; memcpy(submit.schedule_delivery_time, deliver.schedule_delivery_time, -- To view, visit https://gerrit.osmocom.org/3643 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I0e477407531fdd4d906e53c9b5a48a79a239966f Gerrit-PatchSet: 2 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pablo Neira Ayuso From gerrit-no-reply at lists.osmocom.org Sun Aug 27 00:34:54 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sun, 27 Aug 2017 00:34:54 +0000 Subject: [MERGED] osmo-msc[master]: libmsc: missing bit shift in status report flag when stored ... In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: libmsc: missing bit shift in status report flag when stored in sms object ...................................................................... libmsc: missing bit shift in status report flag when stored in sms object So we just store 0 or 1 depending on what the mobile phone requests. Change-Id: Idb7d5594219c0e458ccb561383a59604bc1a4201 --- M src/libmsc/gsm_04_11.c 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Neels Hofmeyr: Looks good to me, approved diff --git a/src/libmsc/gsm_04_11.c b/src/libmsc/gsm_04_11.c index ef2635b..cd23883 100644 --- a/src/libmsc/gsm_04_11.c +++ b/src/libmsc/gsm_04_11.c @@ -368,7 +368,7 @@ /* invert those fields where 0 means active/present */ sms_mti = *smsp & 0x03; sms_vpf = (*smsp & 0x18) >> 3; - gsms->status_rep_req = (*smsp & 0x20); + gsms->status_rep_req = (*smsp & 0x20) >> 5; gsms->ud_hdr_ind = (*smsp & 0x40); /* * Not evaluating MMS (More Messages to Send) because the -- To view, visit https://gerrit.osmocom.org/3642 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Idb7d5594219c0e458ccb561383a59604bc1a4201 Gerrit-PatchSet: 2 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pablo Neira Ayuso From gerrit-no-reply at lists.osmocom.org Sun Aug 27 00:34:54 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sun, 27 Aug 2017 00:34:54 +0000 Subject: [MERGED] osmo-msc[master]: libmsc: report status report request flag from SMPP SUBMIT_SM In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: libmsc: report status report request flag from SMPP SUBMIT_SM ...................................................................... libmsc: report status report request flag from SMPP SUBMIT_SM Restore the sms status report request flag from SUBMIT_SM. Change-Id: Iac05252253f8933a3875b4904599b7a225191a4b --- M src/libmsc/smpp_openbsc.c 1 file changed, 1 insertion(+), 0 deletions(-) Approvals: Neels Hofmeyr: Looks good to me, approved diff --git a/src/libmsc/smpp_openbsc.c b/src/libmsc/smpp_openbsc.c index 8a1a7da..5de1368 100644 --- a/src/libmsc/smpp_openbsc.c +++ b/src/libmsc/smpp_openbsc.c @@ -130,6 +130,7 @@ sms = sms_alloc(); sms->source = SMS_SOURCE_SMPP; sms->smpp.sequence_nr = submit->sequence_number; + sms->status_rep_req = submit->registered_delivery; /* fill in the destination address */ sms->receiver = dest; -- To view, visit https://gerrit.osmocom.org/3641 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Iac05252253f8933a3875b4904599b7a225191a4b Gerrit-PatchSet: 2 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pablo Neira Ayuso From gerrit-no-reply at lists.osmocom.org Sun Aug 27 00:34:55 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sun, 27 Aug 2017 00:34:55 +0000 Subject: [MERGED] osmo-msc[master]: libmsc: set registered_delivery field in SMPP 3.4 DELIVER_SM... In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: libmsc: set registered_delivery field in SMPP 3.4 DELIVER_SM messages ...................................................................... libmsc: set registered_delivery field in SMPP 3.4 DELIVER_SM messages Propagate the status report request field to the SMPP message through the registered_delivery field, so the ESME knows that the mobile phone is asking for explicit delivery acknowledgment is required. See SMPP 3.4 specs section 5.2.17. Change-Id: I59af60fa89cd10ae973c5e122789e3e03e3728ee --- M src/libmsc/smpp_openbsc.c 1 file changed, 8 insertions(+), 1 deletion(-) Approvals: Neels Hofmeyr: Looks good to me, approved diff --git a/src/libmsc/smpp_openbsc.c b/src/libmsc/smpp_openbsc.c index bf63f6b..8a1a7da 100644 --- a/src/libmsc/smpp_openbsc.c +++ b/src/libmsc/smpp_openbsc.c @@ -606,6 +606,10 @@ return NULL; } +/* See SMPP 3.4, Section 5.2.17. registered_delivery (1 byte field). */ +#define SMPP34_NO_DELIVERY_RECEIPT 0x0 +#define SMPP34_DELIVERY_RECEIPT_REQ 0x1 + static int deliver_to_esme(struct osmo_esme *esme, struct gsm_sms *sms, struct gsm_subscriber_connection *conn) { @@ -646,7 +650,10 @@ deliver.protocol_id = sms->protocol_id; deliver.priority_flag = 0; - deliver.registered_delivery = 0; + if (sms->status_rep_req) + deliver.registered_delivery = SMPP34_DELIVERY_RECEIPT_REQ; + else + deliver.registered_delivery = SMPP34_NO_DELIVERY_RECEIPT; /* Figure out SMPP DCS from TP-DCS */ dcs = sms->data_coding_scheme; -- To view, visit https://gerrit.osmocom.org/3640 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I59af60fa89cd10ae973c5e122789e3e03e3728ee Gerrit-PatchSet: 2 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pablo Neira Ayuso From gerrit-no-reply at lists.osmocom.org Sun Aug 27 00:34:55 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sun, 27 Aug 2017 00:34:55 +0000 Subject: [MERGED] osmo-msc[master]: timer vty: also print the default value in cmd doc In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: timer vty: also print the default value in cmd doc ...................................................................... timer vty: also print the default value in cmd doc Rationale: allows seeing all timer defaults at once by doing OsmoBSC(config-net)# timer ? Before, defaults are visible only by doing on each timer: OsmoBSC(config-net)# timer t1234 Change-Id: I8259234e5c62e058dde56d531071440bbab11462 --- M src/libbsc/bsc_vty.c 1 file changed, 13 insertions(+), 13 deletions(-) Approvals: Neels Hofmeyr: Looks good to me, approved diff --git a/src/libbsc/bsc_vty.c b/src/libbsc/bsc_vty.c index 9991e58..bd363ae 100644 --- a/src/libbsc/bsc_vty.c +++ b/src/libbsc/bsc_vty.c @@ -1549,7 +1549,7 @@ cfg_net_T##number##_cmd, \ "timer t" #number " (default|<1-65535>)", \ "Configure GSM Timers\n" \ - doc \ + doc " (default: " EXPAND_AND_STRINGIFY(DEFAULT_TIMER(number)) " seconds)\n" \ "Set to default timer value" \ " (" EXPAND_AND_STRINGIFY(DEFAULT_TIMER(number)) " seconds)\n" \ "Timer Value in seconds\n") \ @@ -1565,18 +1565,18 @@ return CMD_SUCCESS; \ } -DECLARE_TIMER(3101, "Set the timeout value for IMMEDIATE ASSIGNMENT.\n") -DECLARE_TIMER(3103, "Set the timeout value for HANDOVER.\n") -DECLARE_TIMER(3105, "Set the timer for repetition of PHYSICAL INFORMATION.\n") -DECLARE_TIMER(3107, "Currently not used.\n") -DECLARE_TIMER(3109, "Set the RSL SACCH deactivation timeout.\n") -DECLARE_TIMER(3111, "Set the RSL timeout to wait before releasing the RF Channel.\n") -DECLARE_TIMER(3113, "Set the time to try paging a subscriber.\n") -DECLARE_TIMER(3115, "Currently not used.\n") -DECLARE_TIMER(3117, "Currently not used.\n") -DECLARE_TIMER(3119, "Currently not used.\n") -DECLARE_TIMER(3122, "Waiting time (seconds) after IMM ASS REJECT\n") -DECLARE_TIMER(3141, "Currently not used.\n") +DECLARE_TIMER(3101, "Set the timeout value for IMMEDIATE ASSIGNMENT") +DECLARE_TIMER(3103, "Set the timeout value for HANDOVER") +DECLARE_TIMER(3105, "Set the timer for repetition of PHYSICAL INFORMATION") +DECLARE_TIMER(3107, "Currently not used") +DECLARE_TIMER(3109, "Set the RSL SACCH deactivation timeout") +DECLARE_TIMER(3111, "Set the RSL timeout to wait before releasing the RF Channel") +DECLARE_TIMER(3113, "Set the time to try paging a subscriber") +DECLARE_TIMER(3115, "Currently not used") +DECLARE_TIMER(3117, "Currently not used") +DECLARE_TIMER(3119, "Currently not used") +DECLARE_TIMER(3122, "Waiting time (seconds) after IMM ASS REJECT") +DECLARE_TIMER(3141, "Currently not used") DEFUN_DEPRECATED(cfg_net_dtx, cfg_net_dtx_cmd, -- To view, visit https://gerrit.osmocom.org/3639 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I8259234e5c62e058dde56d531071440bbab11462 Gerrit-PatchSet: 2 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Sun Aug 27 00:34:55 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sun, 27 Aug 2017 00:34:55 +0000 Subject: [MERGED] osmo-msc[master]: vty: add 'default' keyword to timer config In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: vty: add 'default' keyword to timer config ...................................................................... vty: add 'default' keyword to timer config Change-Id: I4e837e8bedfad7ac4fd50048ecb016ddb37c2397 --- M src/libbsc/bsc_vty.c 1 file changed, 14 insertions(+), 3 deletions(-) Approvals: Neels Hofmeyr: Looks good to me, approved diff --git a/src/libbsc/bsc_vty.c b/src/libbsc/bsc_vty.c index da406e0..9991e58 100644 --- a/src/libbsc/bsc_vty.c +++ b/src/libbsc/bsc_vty.c @@ -1540,15 +1540,26 @@ return CMD_SUCCESS; } +#define DEFAULT_TIMER(number) GSM_T##number##_DEFAULT +/* Add another expansion so that DEFAULT_TIMER() becomes its value */ +#define EXPAND_AND_STRINGIFY(x) OSMO_STRINGIFY(x) + #define DECLARE_TIMER(number, doc) \ DEFUN(cfg_net_T##number, \ cfg_net_T##number##_cmd, \ - "timer t" #number " <1-65535>", \ + "timer t" #number " (default|<1-65535>)", \ "Configure GSM Timers\n" \ - doc "Timer Value in seconds\n") \ + doc \ + "Set to default timer value" \ + " (" EXPAND_AND_STRINGIFY(DEFAULT_TIMER(number)) " seconds)\n" \ + "Timer Value in seconds\n") \ { \ struct gsm_network *gsmnet = gsmnet_from_vty(vty); \ - int value = atoi(argv[0]); \ + int value; \ + if (strcmp(argv[0], "default") == 0) \ + value = DEFAULT_TIMER(number); \ + else \ + value = atoi(argv[0]); \ \ gsmnet->T##number = value; \ return CMD_SUCCESS; \ -- To view, visit https://gerrit.osmocom.org/3638 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I4e837e8bedfad7ac4fd50048ecb016ddb37c2397 Gerrit-PatchSet: 2 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Sun Aug 27 00:34:56 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sun, 27 Aug 2017 00:34:56 +0000 Subject: [MERGED] osmo-msc[master]: cosmetic: vty for timers: remove obsolete range check In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: cosmetic: vty for timers: remove obsolete range check ...................................................................... cosmetic: vty for timers: remove obsolete range check The VTY parsing already ensures the parameter range being 1..65535, no need to check the range again. Change-Id: I1cffa5b01cd5c589f1e42998e32135f1da8c960b --- M src/libbsc/bsc_vty.c 1 file changed, 0 insertions(+), 6 deletions(-) Approvals: Neels Hofmeyr: Looks good to me, approved diff --git a/src/libbsc/bsc_vty.c b/src/libbsc/bsc_vty.c index bf7c3ca..da406e0 100644 --- a/src/libbsc/bsc_vty.c +++ b/src/libbsc/bsc_vty.c @@ -1550,12 +1550,6 @@ struct gsm_network *gsmnet = gsmnet_from_vty(vty); \ int value = atoi(argv[0]); \ \ - if (value < 1 || value > 65535) { \ - vty_out(vty, "Timer value %s out of range.%s", \ - argv[0], VTY_NEWLINE); \ - return CMD_WARNING; \ - } \ - \ gsmnet->T##number = value; \ return CMD_SUCCESS; \ } -- To view, visit https://gerrit.osmocom.org/3637 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I1cffa5b01cd5c589f1e42998e32135f1da8c960b Gerrit-PatchSet: 2 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Sun Aug 27 00:34:56 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sun, 27 Aug 2017 00:34:56 +0000 Subject: [MERGED] osmo-msc[master]: libmsc: move gsm340_rx_sms_submit() to sms_route_mt_sms() In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: libmsc: move gsm340_rx_sms_submit() to sms_route_mt_sms() ...................................................................... libmsc: move gsm340_rx_sms_submit() to sms_route_mt_sms() Move the sms message-type-identifier (mti) handling away from the routing logic. This patch allows us to reuse the sms_route_mt_sms() function in a follow up patch for sms reports send through SMPP DELIVER_SM with esm_class = Delivery Receipt whose Change-Id is Ic1a9023074bfa938099377980b6aff9b262fab2a. Change-Id: I3f3d30e0762b91e2099243b0be1a4b67cbb5e9c0 --- M src/libmsc/gsm_04_11.c 1 file changed, 22 insertions(+), 19 deletions(-) Approvals: Neels Hofmeyr: Looks good to me, approved diff --git a/src/libmsc/gsm_04_11.c b/src/libmsc/gsm_04_11.c index 88a6685..ef2635b 100644 --- a/src/libmsc/gsm_04_11.c +++ b/src/libmsc/gsm_04_11.c @@ -280,7 +280,7 @@ } static int sms_route_mt_sms(struct gsm_subscriber_connection *conn, - struct gsm_sms *gsms, uint8_t sms_mti) + struct gsm_sms *gsms) { int rc; @@ -338,23 +338,6 @@ rc = GSM411_RP_CAUSE_MO_NUM_UNASSIGNED; rate_ctr_inc(&conn->network->msc_ctrs->ctr[MSC_CTR_SMS_NO_RECEIVER]); #endif - return rc; - } - - switch (sms_mti) { - case GSM340_SMS_SUBMIT_MS2SC: - /* MS is submitting a SMS */ - rc = gsm340_rx_sms_submit(gsms); - break; - case GSM340_SMS_COMMAND_MS2SC: - case GSM340_SMS_DELIVER_REP_MS2SC: - LOGP(DLSMS, 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); - rc = GSM411_RP_CAUSE_IE_NOTEXIST; - break; } return rc; @@ -485,7 +468,27 @@ /* FIXME: This looks very wrong */ send_signal(0, NULL, gsms, 0); - rc = sms_route_mt_sms(conn, gsms, sms_mti); + rc = sms_route_mt_sms(conn, gsms); + + /* This SMS got routed through SMPP or no receiver exists. */ + if (!gsms->receiver) + return rc; + + switch (sms_mti) { + case GSM340_SMS_SUBMIT_MS2SC: + /* MS is submitting a SMS */ + rc = gsm340_rx_sms_submit(gsms); + break; + case GSM340_SMS_COMMAND_MS2SC: + case GSM340_SMS_DELIVER_REP_MS2SC: + LOGP(DLSMS, 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); + rc = GSM411_RP_CAUSE_IE_NOTEXIST; + break; + } out: sms_free(gsms); -- To view, visit https://gerrit.osmocom.org/3636 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I3f3d30e0762b91e2099243b0be1a4b67cbb5e9c0 Gerrit-PatchSet: 2 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pablo Neira Ayuso From gerrit-no-reply at lists.osmocom.org Sun Aug 27 00:34:57 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sun, 27 Aug 2017 00:34:57 +0000 Subject: [MERGED] osmo-msc[master]: libmsc: remove 'deferred' parameter in sms_route_mt_sms() In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: libmsc: remove 'deferred' parameter in sms_route_mt_sms() ...................................................................... libmsc: remove 'deferred' parameter in sms_route_mt_sms() No need to cache the sms object, just cache what we need into the smpp_cmd structure. This simplifies what that I introduced in 93ffbd0029d1 ("libmsc: send RP-ACK to MS after ESME sends SMPP DELIVER-SM-RESP"). Change-Id: Iba5f864f9bb963baff95969e306b1b7cff00c1e3 --- M src/libmsc/gsm_04_11.c M src/libmsc/smpp_openbsc.c M src/libmsc/smpp_smsc.h 3 files changed, 24 insertions(+), 30 deletions(-) Approvals: Neels Hofmeyr: Looks good to me, approved diff --git a/src/libmsc/gsm_04_11.c b/src/libmsc/gsm_04_11.c index 0cd1b65..88a6685 100644 --- a/src/libmsc/gsm_04_11.c +++ b/src/libmsc/gsm_04_11.c @@ -280,8 +280,7 @@ } static int sms_route_mt_sms(struct gsm_subscriber_connection *conn, - struct gsm_sms *gsms, uint8_t sms_mti, - bool *deferred) + struct gsm_sms *gsms, uint8_t sms_mti) { int rc; @@ -295,7 +294,7 @@ * delivery of the SMS. */ if (smpp_first) { - rc = smpp_try_deliver(gsms, conn, deferred); + rc = smpp_try_deliver(gsms, conn); if (rc == GSM411_RP_CAUSE_MO_NUM_UNASSIGNED) /* unknown subscriber, try local */ goto try_local; @@ -324,7 +323,7 @@ return GSM411_RP_CAUSE_MO_NUM_UNASSIGNED; } - rc = smpp_try_deliver(gsms, conn, deferred); + rc = smpp_try_deliver(gsms, conn); if (rc == GSM411_RP_CAUSE_MO_NUM_UNASSIGNED) { rate_ctr_inc(&conn->network->msc_ctrs->ctr[MSC_CTR_SMS_NO_RECEIVER]); } else if (rc < 0) { @@ -365,7 +364,7 @@ /* process an incoming TPDU (called from RP-DATA) * return value > 0: RP CAUSE for ERROR; < 0: silent error; 0 = success */ static int gsm340_rx_tpdu(struct gsm_trans *trans, struct msgb *msg, - uint32_t gsm411_msg_ref, bool *deferred) + uint32_t gsm411_msg_ref) { struct gsm_subscriber_connection *conn = trans->conn; uint8_t *smsp = msgb_sms(msg); @@ -486,10 +485,9 @@ /* FIXME: This looks very wrong */ send_signal(0, NULL, gsms, 0); - rc = sms_route_mt_sms(conn, gsms, sms_mti, deferred); + rc = sms_route_mt_sms(conn, gsms, sms_mti); out: - if (!deferred) - sms_free(gsms); + sms_free(gsms); return rc; } @@ -542,7 +540,6 @@ uint8_t dst_len, uint8_t *dst, uint8_t tpdu_len, uint8_t *tpdu) { - bool deferred = false; int rc = 0; if (src_len && src) @@ -559,8 +556,8 @@ DEBUGP(DLSMS, "DST(%u,%s)\n", dst_len, osmo_hexdump(dst, dst_len)); - rc = gsm340_rx_tpdu(trans, msg, rph->msg_ref, &deferred); - if (rc == 0 && !deferred) + rc = gsm340_rx_tpdu(trans, msg, rph->msg_ref); + if (rc == 0) return gsm411_send_rp_ack(trans, rph->msg_ref); else if (rc > 0) return gsm411_send_rp_error(trans, rph->msg_ref, rc); diff --git a/src/libmsc/smpp_openbsc.c b/src/libmsc/smpp_openbsc.c index 67e6638..bf63f6b 100644 --- a/src/libmsc/smpp_openbsc.c +++ b/src/libmsc/smpp_openbsc.c @@ -501,7 +501,6 @@ osmo_timer_del(&cmd->response_timer); llist_del(&cmd->list); vlr_subscr_put(cmd->vsub); - sms_free(cmd->sms); talloc_free(cmd); } @@ -524,15 +523,14 @@ goto out; } - trans = trans_find_by_id(conn, GSM48_PDISC_SMS, - cmd->sms->gsm411.transaction_id); + trans = trans_find_by_id(conn, GSM48_PDISC_SMS, cmd->gsm411_trans_id); if (!trans) { LOGP(DSMPP, LOGL_ERROR, "GSM transaction %u is gone\n", - cmd->sms->gsm411.transaction_id); + cmd->gsm411_trans_id); goto out; } - gsm411_send_rp_ack(trans, cmd->sms->gsm411.msg_ref); + gsm411_send_rp_ack(trans, cmd->gsm411_msg_ref); out: smpp_cmd_free(cmd); } @@ -549,18 +547,17 @@ goto out; } - trans = trans_find_by_id(conn, GSM48_PDISC_SMS, - cmd->sms->gsm411.transaction_id); + trans = trans_find_by_id(conn, GSM48_PDISC_SMS, cmd->gsm411_trans_id); if (!trans) { LOGP(DSMPP, LOGL_ERROR, "GSM transaction %u is gone\n", - cmd->sms->gsm411.transaction_id); + cmd->gsm411_trans_id); goto out; } if (smpp_to_gsm411_err(status, &gsm411_cause) < 0) gsm411_cause = GSM411_RP_CAUSE_MO_NET_OUT_OF_ORDER; - gsm411_send_rp_error(trans, cmd->sms->gsm411.msg_ref, gsm411_cause); + gsm411_send_rp_error(trans, cmd->gsm411_msg_ref, gsm411_cause); out: smpp_cmd_free(cmd); } @@ -572,7 +569,7 @@ static int smpp_cmd_enqueue(struct osmo_esme *esme, struct vlr_subscr *vsub, struct gsm_sms *sms, - uint32_t sequence_number, bool *deferred) + uint32_t sequence_number) { struct osmo_smpp_cmd *cmd; @@ -581,7 +578,8 @@ return -1; cmd->sequence_nr = sequence_number; - cmd->sms = sms; + cmd->gsm411_msg_ref = sms->gsm411.msg_ref; + cmd->gsm411_trans_id = sms->gsm411.transaction_id; cmd->vsub = vlr_subscr_get(vsub); /* FIXME: No predefined value for this response_timer as specified by @@ -592,7 +590,6 @@ osmo_timer_setup(&cmd->response_timer, smpp_deliver_sm_cb, cmd); osmo_timer_schedule(&cmd->response_timer, 5, 0); llist_add_tail(&cmd->list, &esme->smpp_cmd_list); - *deferred = true; return 0; } @@ -610,8 +607,7 @@ } static int deliver_to_esme(struct osmo_esme *esme, struct gsm_sms *sms, - struct gsm_subscriber_connection *conn, - bool *deferred) + struct gsm_subscriber_connection *conn) { struct deliver_sm_t deliver; int mode, ret; @@ -693,7 +689,7 @@ return ret; return smpp_cmd_enqueue(esme, conn->vsub, sms, - deliver.sequence_number, deferred); + deliver.sequence_number); } static struct smsc *g_smsc; @@ -704,7 +700,7 @@ } int smpp_try_deliver(struct gsm_sms *sms, - struct gsm_subscriber_connection *conn, bool *deferred) + struct gsm_subscriber_connection *conn) { struct osmo_esme *esme; struct osmo_smpp_addr dst; @@ -717,7 +713,7 @@ rc = smpp_route(g_smsc, &dst, &esme); if (!rc) - rc = deliver_to_esme(esme, sms, conn, deferred); + rc = deliver_to_esme(esme, sms, conn); return rc; } diff --git a/src/libmsc/smpp_smsc.h b/src/libmsc/smpp_smsc.h index fded236..0f1d35c 100644 --- a/src/libmsc/smpp_smsc.h +++ b/src/libmsc/smpp_smsc.h @@ -89,8 +89,9 @@ struct osmo_smpp_cmd { struct llist_head list; struct vlr_subscr *vsub; - struct gsm_sms *sms; uint32_t sequence_nr; + uint32_t gsm411_msg_ref; + uint8_t gsm411_trans_id; struct osmo_timer_list response_timer; }; @@ -161,5 +162,5 @@ int smpp_route_smpp_first(struct gsm_sms *sms, struct gsm_subscriber_connection *conn); int smpp_try_deliver(struct gsm_sms *sms, - struct gsm_subscriber_connection *conn, bool *deferred); + struct gsm_subscriber_connection *conn); #endif -- To view, visit https://gerrit.osmocom.org/3635 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Iba5f864f9bb963baff95969e306b1b7cff00c1e3 Gerrit-PatchSet: 2 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pablo Neira Ayuso From gerrit-no-reply at lists.osmocom.org Sun Aug 27 00:34:57 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sun, 27 Aug 2017 00:34:57 +0000 Subject: [MERGED] osmo-msc[master]: libmsc: remove duplicate lines in deliver_to_esme() In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: libmsc: remove duplicate lines in deliver_to_esme() ...................................................................... libmsc: remove duplicate lines in deliver_to_esme() This code is accidentally doing the same thing twice, remove it. Change-Id: I68087a850399e22951d2407e4d8a09c671a775c9 --- M src/libmsc/smpp_openbsc.c 1 file changed, 0 insertions(+), 2 deletions(-) Approvals: Neels Hofmeyr: Looks good to me, approved diff --git a/src/libmsc/smpp_openbsc.c b/src/libmsc/smpp_openbsc.c index 394827b..67e6638 100644 --- a/src/libmsc/smpp_openbsc.c +++ b/src/libmsc/smpp_openbsc.c @@ -680,8 +680,6 @@ } else { deliver.sm_length = sms->user_data_len; memcpy(deliver.short_message, sms->user_data, deliver.sm_length); - deliver.sm_length = sms->user_data_len; - memcpy(deliver.short_message, sms->user_data, deliver.sm_length); } #if BEFORE_MSCSPLIT -- To view, visit https://gerrit.osmocom.org/3634 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I68087a850399e22951d2407e4d8a09c671a775c9 Gerrit-PatchSet: 2 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pablo Neira Ayuso From gerrit-no-reply at lists.osmocom.org Sun Aug 27 00:34:57 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sun, 27 Aug 2017 00:34:57 +0000 Subject: [MERGED] osmo-msc[master]: libmsc: remove dead code in sms_route_mt_sms() In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: libmsc: remove dead code in sms_route_mt_sms() ...................................................................... libmsc: remove dead code in sms_route_mt_sms() The following branch: if (!rc && !gsms->receiver) rc = GSM411_RP_CAUSE_MO_NUM_UNASSIGNED; at the end of sms_route_mt_sms() always evaluates false. Just a bit before, in such function, we have this: if (!gsms->receiver) { ... #ifdef BUILD_SMPP ... #else ... #endif return rc; } So, if there is no receiver, we just stop running code and return the RP cause via the rc variable. Same applies to the smpp_first check under the BUILD_SMPP ifdef (that I have removed in this snippet to keep this commit message small). Change-Id: Ic3502b5b169bc7a73a67fd6ff53d8b6c0dc045c8 --- M src/libmsc/gsm_04_11.c 1 file changed, 0 insertions(+), 3 deletions(-) Approvals: Neels Hofmeyr: Looks good to me, approved diff --git a/src/libmsc/gsm_04_11.c b/src/libmsc/gsm_04_11.c index 3153610..0cd1b65 100644 --- a/src/libmsc/gsm_04_11.c +++ b/src/libmsc/gsm_04_11.c @@ -358,9 +358,6 @@ break; } - if (!rc && !gsms->receiver) - rc = GSM411_RP_CAUSE_MO_NUM_UNASSIGNED; - return rc; } -- To view, visit https://gerrit.osmocom.org/3633 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ic3502b5b169bc7a73a67fd6ff53d8b6c0dc045c8 Gerrit-PatchSet: 2 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pablo Neira Ayuso From gerrit-no-reply at lists.osmocom.org Sun Aug 27 00:34:57 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sun, 27 Aug 2017 00:34:57 +0000 Subject: [MERGED] osmo-msc[master]: libmsc: do not leak pending SMPP command object on error path In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: libmsc: do not leak pending SMPP command object on error path ...................................................................... libmsc: do not leak pending SMPP command object on error path Make sure the SMPP command object is released on errors. Change-Id: I474584425d23fb379a9d71b33e29ac0e24f01e61 --- M src/libmsc/smpp_openbsc.c 1 file changed, 6 insertions(+), 5 deletions(-) Approvals: Neels Hofmeyr: Looks good to me, approved diff --git a/src/libmsc/smpp_openbsc.c b/src/libmsc/smpp_openbsc.c index b3f9bbb..394827b 100644 --- a/src/libmsc/smpp_openbsc.c +++ b/src/libmsc/smpp_openbsc.c @@ -521,7 +521,7 @@ conn = connection_for_subscr(cmd->vsub); if (!conn) { LOGP(DSMPP, LOGL_ERROR, "No connection to subscriber anymore\n"); - return; + goto out; } trans = trans_find_by_id(conn, GSM48_PDISC_SMS, @@ -529,10 +529,11 @@ if (!trans) { LOGP(DSMPP, LOGL_ERROR, "GSM transaction %u is gone\n", cmd->sms->gsm411.transaction_id); - return; + goto out; } gsm411_send_rp_ack(trans, cmd->sms->gsm411.msg_ref); +out: smpp_cmd_free(cmd); } @@ -545,7 +546,7 @@ conn = connection_for_subscr(cmd->vsub); if (!conn) { LOGP(DSMPP, LOGL_ERROR, "No connection to subscriber anymore\n"); - return; + goto out; } trans = trans_find_by_id(conn, GSM48_PDISC_SMS, @@ -553,14 +554,14 @@ if (!trans) { LOGP(DSMPP, LOGL_ERROR, "GSM transaction %u is gone\n", cmd->sms->gsm411.transaction_id); - return; + goto out; } if (smpp_to_gsm411_err(status, &gsm411_cause) < 0) gsm411_cause = GSM411_RP_CAUSE_MO_NET_OUT_OF_ORDER; gsm411_send_rp_error(trans, cmd->sms->gsm411.msg_ref, gsm411_cause); - +out: smpp_cmd_free(cmd); } -- To view, visit https://gerrit.osmocom.org/3632 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I474584425d23fb379a9d71b33e29ac0e24f01e61 Gerrit-PatchSet: 2 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pablo Neira Ayuso From gerrit-no-reply at lists.osmocom.org Sun Aug 27 00:34:58 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sun, 27 Aug 2017 00:34:58 +0000 Subject: [MERGED] osmo-msc[master]: gsm_04_11: get rid of unused parameter in sms_route_mt_sms() In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: gsm_04_11: get rid of unused parameter in sms_route_mt_sms() ...................................................................... gsm_04_11: get rid of unused parameter in sms_route_mt_sms() This parameter is unused, remove it. Change-Id: I797abce3f91447e8f397c7cf726db7425479fe0e --- M src/libmsc/gsm_04_11.c 1 file changed, 6 insertions(+), 5 deletions(-) Approvals: Neels Hofmeyr: Looks good to me, approved diff --git a/src/libmsc/gsm_04_11.c b/src/libmsc/gsm_04_11.c index 6c6a1fb..3153610 100644 --- a/src/libmsc/gsm_04_11.c +++ b/src/libmsc/gsm_04_11.c @@ -189,7 +189,7 @@ return gsm411_smc_send(&trans->sms.smc_inst, msg_type, msg); } -static int gsm340_rx_sms_submit(struct msgb *msg, struct gsm_sms *gsms) +static int gsm340_rx_sms_submit(struct gsm_sms *gsms) { if (db_sms_store(gsms) != 0) { LOGP(DLSMS, LOGL_ERROR, "Failed to store SMS in Database\n"); @@ -279,8 +279,9 @@ return msg->len - old_msg_len; } -int sms_route_mt_sms(struct gsm_subscriber_connection *conn, struct msgb *msg, - struct gsm_sms *gsms, uint8_t sms_mti, bool *deferred) +static int sms_route_mt_sms(struct gsm_subscriber_connection *conn, + struct gsm_sms *gsms, uint8_t sms_mti, + bool *deferred) { int rc; @@ -344,7 +345,7 @@ switch (sms_mti) { case GSM340_SMS_SUBMIT_MS2SC: /* MS is submitting a SMS */ - rc = gsm340_rx_sms_submit(msg, gsms); + rc = gsm340_rx_sms_submit(gsms); break; case GSM340_SMS_COMMAND_MS2SC: case GSM340_SMS_DELIVER_REP_MS2SC: @@ -488,7 +489,7 @@ /* FIXME: This looks very wrong */ send_signal(0, NULL, gsms, 0); - rc = sms_route_mt_sms(conn, msg, gsms, sms_mti, deferred); + rc = sms_route_mt_sms(conn, gsms, sms_mti, deferred); out: if (!deferred) sms_free(gsms); -- To view, visit https://gerrit.osmocom.org/3631 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I797abce3f91447e8f397c7cf726db7425479fe0e Gerrit-PatchSet: 2 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pablo Neira Ayuso From gerrit-no-reply at lists.osmocom.org Sun Aug 27 00:34:58 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sun, 27 Aug 2017 00:34:58 +0000 Subject: [MERGED] osmo-msc[master]: sgsn: Convert cch_pdp to host order for libgtp In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: sgsn: Convert cch_pdp to host order for libgtp ...................................................................... sgsn: Convert cch_pdp to host order for libgtp libgtp is calling gtpie_tv2 which will convert this uint16_t from host to network order. So far libosmogsm and the sgsn treated the charging characteristics as opaque data. So when moving from byte array to the uint16_t do the swapping. Change-Id: I977aec2e2f8d57802e45f591754e5733562d5c2a --- M src/gprs/sgsn_libgtp.c 1 file changed, 2 insertions(+), 5 deletions(-) Approvals: Neels Hofmeyr: Looks good to me, approved diff --git a/src/gprs/sgsn_libgtp.c b/src/gprs/sgsn_libgtp.c index 0a0de08..bc2fcd1 100644 --- a/src/gprs/sgsn_libgtp.c +++ b/src/gprs/sgsn_libgtp.c @@ -235,11 +235,8 @@ } /* charging characteristics if present */ - if (TLVP_LEN(tp, OSMO_IE_GSM_CHARG_CHAR) > 0) { - OSMO_ASSERT(TLVP_LEN(tp, OSMO_IE_GSM_CHARG_CHAR) <= sizeof(pdp->cch_pdp)); - memcpy(&pdp->cch_pdp, TLVP_VAL(tp, OSMO_IE_GSM_CHARG_CHAR), - TLVP_LEN(tp, OSMO_IE_GSM_CHARG_CHAR)); - } + if (TLVP_LEN(tp, OSMO_IE_GSM_CHARG_CHAR) >= sizeof(pdp->cch_pdp)) + pdp->cch_pdp = tlvp_val16be(tp, OSMO_IE_GSM_CHARG_CHAR); /* SGSN address for control plane */ pdp->gsnlc.l = sizeof(sgsn->cfg.gtp_listenaddr.sin_addr); -- To view, visit https://gerrit.osmocom.org/3630 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I977aec2e2f8d57802e45f591754e5733562d5c2a Gerrit-PatchSet: 2 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Sun Aug 27 00:34:58 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sun, 27 Aug 2017 00:34:58 +0000 Subject: [MERGED] osmo-msc[master]: remove code disabling T3109 if configured to 0 In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: remove code disabling T3109 if configured to 0 ...................................................................... remove code disabling T3109 if configured to 0 We no longer permit timers with a 0 value, so this case can never happen. Also, if it should happen, I'd rather have a timter expiring immediately (and breaking something) than not being started in the first place. Change-Id: Ibfcdd3ddc0155caee89c501498329bde247621a0 --- M src/libbsc/abis_rsl.c 1 file changed, 0 insertions(+), 4 deletions(-) Approvals: Neels Hofmeyr: Looks good to me, approved diff --git a/src/libbsc/abis_rsl.c b/src/libbsc/abis_rsl.c index 9e36f79..3337b90 100644 --- a/src/libbsc/abis_rsl.c +++ b/src/libbsc/abis_rsl.c @@ -2910,10 +2910,6 @@ { struct gsm_bts *bts = lchan->ts->trx->bts; - /* Disabled, mostly legacy code */ - if (bts->network->T3109 == 0) - return -1; - osmo_timer_setup(&lchan->T3109, t3109_expired, lchan); osmo_timer_schedule(&lchan->T3109, bts->network->T3109, 0); return 0; -- To view, visit https://gerrit.osmocom.org/3629 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ibfcdd3ddc0155caee89c501498329bde247621a0 Gerrit-PatchSet: 2 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Sun Aug 27 00:34:58 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sun, 27 Aug 2017 00:34:58 +0000 Subject: [MERGED] osmo-msc[master]: bsc_vty: Don't allow timers of zero (0) In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: bsc_vty: Don't allow timers of zero (0) ...................................................................... bsc_vty: Don't allow timers of zero (0) It typically doesn't make sense to configure any of the GSM RR timer to 0 (Seconds). In fact, accidentially configuring any of the timers to zero might have severe side effects, such as "stuck channels" described in https://osmocom.org/issues/2380 Change-Id: I517828f2f0c80ec01cb63648db2626f17a67fe57 --- M src/libbsc/bsc_vty.c 1 file changed, 2 insertions(+), 2 deletions(-) Approvals: Neels Hofmeyr: Looks good to me, approved diff --git a/src/libbsc/bsc_vty.c b/src/libbsc/bsc_vty.c index 1e78b08..bf7c3ca 100644 --- a/src/libbsc/bsc_vty.c +++ b/src/libbsc/bsc_vty.c @@ -1543,14 +1543,14 @@ #define DECLARE_TIMER(number, doc) \ DEFUN(cfg_net_T##number, \ cfg_net_T##number##_cmd, \ - "timer t" #number " <0-65535>", \ + "timer t" #number " <1-65535>", \ "Configure GSM Timers\n" \ doc "Timer Value in seconds\n") \ { \ struct gsm_network *gsmnet = gsmnet_from_vty(vty); \ int value = atoi(argv[0]); \ \ - if (value < 0 || value > 65535) { \ + if (value < 1 || value > 65535) { \ vty_out(vty, "Timer value %s out of range.%s", \ argv[0], VTY_NEWLINE); \ return CMD_WARNING; \ -- To view, visit https://gerrit.osmocom.org/3628 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I517828f2f0c80ec01cb63648db2626f17a67fe57 Gerrit-PatchSet: 2 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Sun Aug 27 00:34:59 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sun, 27 Aug 2017 00:34:59 +0000 Subject: [MERGED] osmo-msc[master]: GSM timers: User reasonable defaults; don't save if equal de... In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: GSM timers: User reasonable defaults; don't save if equal default ...................................................................... GSM timers: User reasonable defaults; don't save if equal default A number of the GSM timers (including T3109) had no reasonable default values if not specified in the VTY / config file. Together with unconditional writing to the config file, this created config files with a persistent setting for important timers as '0'. To make things worse, many of our example cofig files suffered from the same problem. Let's avoid this from happening by * having reasonable defaults if nothing specified in the config file * conditionally savingg timers only if they differ from default * reject any timer values that state zero during start-up (see previous commit) Change-Id: Iaac0bfca423852b61d8b9eb1438157ef00d0d8c8 Closes: OS#2380 --- M doc/examples/osmo-bsc/osmo-bsc.cfg M include/openbsc/gsm_data.h M src/libbsc/bsc_vty.c M src/libbsc/net_init.c 4 files changed, 35 insertions(+), 27 deletions(-) Approvals: Neels Hofmeyr: Looks good to me, approved diff --git a/doc/examples/osmo-bsc/osmo-bsc.cfg b/doc/examples/osmo-bsc/osmo-bsc.cfg index b974b76..534605a 100644 --- a/doc/examples/osmo-bsc/osmo-bsc.cfg +++ b/doc/examples/osmo-bsc/osmo-bsc.cfg @@ -28,18 +28,6 @@ handover power budget interval 6 handover power budget hysteresis 3 handover maximum distance 9999 - timer t3101 10 - timer t3103 0 - timer t3105 0 - timer t3107 0 - timer t3109 0 - timer t3111 0 - timer t3113 60 - timer t3115 0 - timer t3117 0 - timer t3119 0 - timer t3122 0 - timer t3141 0 bts 0 type nanobts band DCS1800 diff --git a/include/openbsc/gsm_data.h b/include/openbsc/gsm_data.h index c307fee..02823c9 100644 --- a/include/openbsc/gsm_data.h +++ b/include/openbsc/gsm_data.h @@ -323,10 +323,18 @@ GSM_AUTH_POLICY_REGEXP, /* accept IMSIs matching given regexp */ }; -#define GSM_T3101_DEFAULT 10 -#define GSM_T3105_DEFAULT 40 +#define GSM_T3101_DEFAULT 10 /* s */ +#define GSM_T3103_DEFAULT 5 /* s */ +#define GSM_T3105_DEFAULT 100 /* ms */ +#define GSM_T3107_DEFAULT 5 /* s */ +#define GSM_T3109_DEFAULT 19 /* s, must be 2s + radio_link_timeout*0.48 */ +#define GSM_T3111_DEFAULT 2 /* s */ #define GSM_T3113_DEFAULT 60 +#define GSM_T3115_DEFAULT 10 +#define GSM_T3117_DEFAULT 10 +#define GSM_T3119_DEFAULT 10 #define GSM_T3122_DEFAULT 10 +#define GSM_T3141_DEFAULT 10 struct gsm_tz { int override; /* if 0, use system's time zone instead. */ diff --git a/src/libbsc/bsc_vty.c b/src/libbsc/bsc_vty.c index f3ab35f..1e78b08 100644 --- a/src/libbsc/bsc_vty.c +++ b/src/libbsc/bsc_vty.c @@ -777,6 +777,11 @@ return CMD_SUCCESS; } +/* small helper macro for conditional dumping of timer */ +#define VTY_OUT_TIMER(number) \ + if (gsmnet->T##number != GSM_T##number##_DEFAULT) \ + vty_out(vty, " timer t"#number" %u%s", gsmnet->T##number, VTY_NEWLINE) + static int config_write_net(struct vty *vty) { struct gsm_network *gsmnet = gsmnet_from_vty(vty); @@ -813,18 +818,18 @@ gsmnet->handover.pwr_hysteresis, VTY_NEWLINE); vty_out(vty, " handover maximum distance %u%s", gsmnet->handover.max_distance, VTY_NEWLINE); - vty_out(vty, " timer t3101 %u%s", gsmnet->T3101, VTY_NEWLINE); - vty_out(vty, " timer t3103 %u%s", gsmnet->T3103, VTY_NEWLINE); - vty_out(vty, " timer t3105 %u%s", gsmnet->T3105, VTY_NEWLINE); - vty_out(vty, " timer t3107 %u%s", gsmnet->T3107, VTY_NEWLINE); - vty_out(vty, " timer t3109 %u%s", gsmnet->T3109, VTY_NEWLINE); - vty_out(vty, " timer t3111 %u%s", gsmnet->T3111, VTY_NEWLINE); - vty_out(vty, " timer t3113 %u%s", gsmnet->T3113, VTY_NEWLINE); - vty_out(vty, " timer t3115 %u%s", gsmnet->T3115, VTY_NEWLINE); - vty_out(vty, " timer t3117 %u%s", gsmnet->T3117, VTY_NEWLINE); - vty_out(vty, " timer t3119 %u%s", gsmnet->T3119, VTY_NEWLINE); - vty_out(vty, " timer t3122 %u%s", gsmnet->T3122, VTY_NEWLINE); - vty_out(vty, " timer t3141 %u%s", gsmnet->T3141, VTY_NEWLINE); + VTY_OUT_TIMER(3101); + VTY_OUT_TIMER(3103); + VTY_OUT_TIMER(3105); + VTY_OUT_TIMER(3107); + VTY_OUT_TIMER(3109); + VTY_OUT_TIMER(3111); + VTY_OUT_TIMER(3113); + VTY_OUT_TIMER(3115); + VTY_OUT_TIMER(3117); + VTY_OUT_TIMER(3119); + VTY_OUT_TIMER(3122); + VTY_OUT_TIMER(3141); vty_out(vty, " dyn_ts_allow_tch_f %d%s", gsmnet->dyn_ts_allow_tch_f ? 1 : 0, VTY_NEWLINE); if (gsmnet->tz.override != 0) { diff --git a/src/libbsc/net_init.c b/src/libbsc/net_init.c index 4dfc258..9d54319 100644 --- a/src/libbsc/net_init.c +++ b/src/libbsc/net_init.c @@ -44,10 +44,17 @@ net->num_bts = 0; net->reject_cause = GSM48_REJECT_ROAMING_NOT_ALLOWED; net->T3101 = GSM_T3101_DEFAULT; + net->T3103 = GSM_T3103_DEFAULT; net->T3105 = GSM_T3105_DEFAULT; + net->T3107 = GSM_T3107_DEFAULT; + net->T3109 = GSM_T3109_DEFAULT; + net->T3111 = GSM_T3111_DEFAULT; net->T3113 = GSM_T3113_DEFAULT; + net->T3115 = GSM_T3115_DEFAULT; + net->T3117 = GSM_T3117_DEFAULT; + net->T3119 = GSM_T3119_DEFAULT; net->T3122 = GSM_T3122_DEFAULT; - /* FIXME: initialize all other timers! */ + net->T3141 = GSM_T3141_DEFAULT; /* default set of handover parameters */ net->handover.win_rxlev_avg = 10; -- To view, visit https://gerrit.osmocom.org/3627 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Iaac0bfca423852b61d8b9eb1438157ef00d0d8c8 Gerrit-PatchSet: 2 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Sun Aug 27 00:34:59 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sun, 27 Aug 2017 00:34:59 +0000 Subject: [MERGED] osmo-msc[master]: bsc_vty: Add VTY command to test CTRL TRAP feature In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: bsc_vty: Add VTY command to test CTRL TRAP feature ...................................................................... bsc_vty: Add VTY command to test CTRL TRAP feature Using this new command (introduced in OsmoBSC + OsmoNITB), you can simulate the generation of TRAP events for testin purposes. start the control interface monitor as an example client program: ./openbsc/contrib/bsc_control.py -m -d localhost -p 4249 then start OsmoBSC or OsmoNITB, telnet to the VTY and enter 'enable' mode and issue the following (example) command: ctrl-interface generate-trap my.foo.var 2342 As a result, on the bsc_control.py you will see: Got message: TRAP 0 my.foo.var 2342 Change-Id: Ib1d2ec38290dc94797c1b365d9b733e5215ab7d1 --- M src/libbsc/bsc_vty.c 1 file changed, 16 insertions(+), 0 deletions(-) Approvals: Neels Hofmeyr: Looks good to me, approved diff --git a/src/libbsc/bsc_vty.c b/src/libbsc/bsc_vty.c index 09c443c..f3ab35f 100644 --- a/src/libbsc/bsc_vty.c +++ b/src/libbsc/bsc_vty.c @@ -30,6 +30,7 @@ #include #include #include +#include #include @@ -4093,6 +4094,20 @@ rsl_ipacc_mdcx(lchan, ntohl(ia.s_addr), port, 0); return CMD_SUCCESS; } + +DEFUN(ctrl_trap, ctrl_trap_cmd, + "ctrl-interface generate-trap TRAP VALUE", + "Commands related to the CTRL Interface\n" + "Generate a TRAP for test purpose\n" + "Identity/Name of the TRAP variable\n" + "Value of the TRAP variable\n") +{ + struct gsm_network *net = gsmnet_from_vty(vty); + + ctrl_cmd_send_trap(net->ctrl, argv[0], (char *) argv[1]); + return CMD_SUCCESS; +} + extern int bsc_vty_init_extra(void); int bsc_vty_init(struct gsm_network *network) @@ -4293,6 +4308,7 @@ install_element(ENABLE_NODE, &lchan_act_cmd); install_element(ENABLE_NODE, &lchan_mdcx_cmd); install_element(ENABLE_NODE, &smscb_cmd_cmd); + install_element(ENABLE_NODE, &ctrl_trap_cmd); abis_nm_vty_init(); abis_om2k_vty_init(); -- To view, visit https://gerrit.osmocom.org/3626 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ib1d2ec38290dc94797c1b365d9b733e5215ab7d1 Gerrit-PatchSet: 2 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Sun Aug 27 00:34:59 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sun, 27 Aug 2017 00:34:59 +0000 Subject: [MERGED] osmo-msc[master]: gtphob: check for missing result of rate_ctr_group_alloc() In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: gtphob: check for missing result of rate_ctr_group_alloc() ...................................................................... gtphob: check for missing result of rate_ctr_group_alloc() In case the counter group allocation fails, we must handle this gracefully and fail the allocation of the parent object, too. The recent change (Id I7dad4a4d52fe05f6b990359841b4408df5990e21) seems to have missed one instance, so let's follow-up. Change-Id: I1ee9e3d26dcc18e7f979fd9a786162cbcc50942c Related: OS#2361 --- M src/gprs/gtphub.c 1 file changed, 4 insertions(+), 0 deletions(-) Approvals: Neels Hofmeyr: Looks good to me, approved diff --git a/src/gprs/gtphub.c b/src/gprs/gtphub.c index 211018b..5e7520e 100644 --- a/src/gprs/gtphub.c +++ b/src/gprs/gtphub.c @@ -2708,6 +2708,10 @@ pp->counters_io = rate_ctr_group_alloc(osmo_gtphub_ctx, >phub_ctrg_io_desc, 0); + if (!pp->counters_io) { + talloc_free(pp); + return NULL; + } llist_add(&pp->entry, &a->ports); -- To view, visit https://gerrit.osmocom.org/3625 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I1ee9e3d26dcc18e7f979fd9a786162cbcc50942c Gerrit-PatchSet: 2 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Sun Aug 27 00:34:59 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sun, 27 Aug 2017 00:34:59 +0000 Subject: [MERGED] osmo-msc[master]: gsm_bts_trx_set_system_infos(): Disable non-existing SI In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: gsm_bts_trx_set_system_infos(): Disable non-existing SI ...................................................................... gsm_bts_trx_set_system_infos(): Disable non-existing SI If we previously had a given SI present/active, we must send a zero-length BCCH FILLING for that SI type to the BTS to stop it from further transmitting this SI. Change-Id: I33e356e2fa3a69efac9080813e3e9ef4e6438ed1 Closes: OS#2368 --- M src/libbsc/bsc_init.c 1 file changed, 17 insertions(+), 6 deletions(-) Approvals: Neels Hofmeyr: Looks good to me, approved diff --git a/src/libbsc/bsc_init.c b/src/libbsc/bsc_init.c index 5f41a27..78ca2ab 100644 --- a/src/libbsc/bsc_init.c +++ b/src/libbsc/bsc_init.c @@ -104,8 +104,11 @@ struct gsm_bts *bts = trx->bts; int rc, j; - DEBUGP(DRR, "SI%s: %s\n", get_value_string(osmo_sitype_strs, i), - osmo_hexdump(GSM_BTS_SI(bts, i), GSM_MACBLOCK_LEN)); + if (si_len) { + DEBUGP(DRR, "SI%s: %s\n", get_value_string(osmo_sitype_strs, i), + osmo_hexdump(GSM_BTS_SI(bts, i), GSM_MACBLOCK_LEN)); + } else + DEBUGP(DRR, "SI%s: OFF\n", get_value_string(osmo_sitype_strs, i)); switch (i) { case SYSINFO_TYPE_5: @@ -113,14 +116,18 @@ case SYSINFO_TYPE_5ter: case SYSINFO_TYPE_6: rc = rsl_sacch_filling(trx, osmo_sitype2rsl(i), - GSM_BTS_SI(bts, i), si_len); + si_len ? GSM_BTS_SI(bts, i) : NULL, si_len); break; case SYSINFO_TYPE_2quater: + if (si_len == 0) { + rc = rsl_bcch_info(trx, i, NULL, 0); + break; + } for (j = 0; j <= bts->si2q_count; j++) rc = rsl_bcch_info(trx, i, (const uint8_t *)GSM_BTS_SI2Q(bts, j), GSM_MACBLOCK_LEN); break; default: - rc = rsl_bcch_info(trx, i, GSM_BTS_SI(bts, i), si_len); + rc = rsl_bcch_info(trx, i, si_len ? GSM_BTS_SI(bts, i) : NULL, si_len); break; } @@ -193,9 +200,13 @@ for (n = 0; n < n_si; n++) { i = gen_si[n]; + /* if we don't currently have this SI, we send a zero-length + * RSL BCCH FILLING / SACCH FILLING * in order to deactivate + * the SI, in case it might have previously been active */ if (!GSM_BTS_HAS_SI(bts, i)) - continue; - rc = rsl_si(trx, i, si_len[i]); + rc = rsl_si(trx, i, 0); + else + rc = rsl_si(trx, i, si_len[i]); if (rc < 0) return rc; } -- To view, visit https://gerrit.osmocom.org/3624 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I33e356e2fa3a69efac9080813e3e9ef4e6438ed1 Gerrit-PatchSet: 2 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Sun Aug 27 00:35:00 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sun, 27 Aug 2017 00:35:00 +0000 Subject: [MERGED] osmo-msc[master]: RSL: Allow disabling of BCCH/SACCH filling for given SI type In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: RSL: Allow disabling of BCCH/SACCH filling for given SI type ...................................................................... RSL: Allow disabling of BCCH/SACCH filling for given SI type If we want to instruct the BTS to stop sending a given SI, we must be able to send the respective BCCH INFO / SACCH FILLING with a header but without any L3 data IE. This patch enables the related functions to do this whenever their data argument points to NULL. Change-Id: I88b85614951a108574f05db3b706884afe7e87a9 --- M src/libbsc/abis_rsl.c 1 file changed, 8 insertions(+), 4 deletions(-) Approvals: Neels Hofmeyr: Looks good to me, approved diff --git a/src/libbsc/abis_rsl.c b/src/libbsc/abis_rsl.c index 441b386..9e36f79 100644 --- a/src/libbsc/abis_rsl.c +++ b/src/libbsc/abis_rsl.c @@ -245,12 +245,14 @@ && type == RSL_SYSTEM_INFO_13) { /* Ericsson proprietary encoding of SI13 */ msgb_tv_put(msg, RSL_IE_SYSINFO_TYPE, RSL_ERIC_SYSTEM_INFO_13); - msgb_tlv_put(msg, RSL_IE_FULL_BCCH_INFO, len, data); + if (data) + msgb_tlv_put(msg, RSL_IE_FULL_BCCH_INFO, len, data); msgb_tv_put(msg, RSL_IE_ERIC_BCCH_MAPPING, 0x00); } else { /* Normal encoding */ msgb_tv_put(msg, RSL_IE_SYSINFO_TYPE, type); - msgb_tlv_put(msg, RSL_IE_FULL_BCCH_INFO, len, data); + if (data) + msgb_tlv_put(msg, RSL_IE_FULL_BCCH_INFO, len, data); } msg->dst = trx->rsl_link; @@ -269,7 +271,8 @@ ch->msg_type = RSL_MT_SACCH_FILL; msgb_tv_put(msg, RSL_IE_SYSINFO_TYPE, type); - msgb_tl16v_put(msg, RSL_IE_L3_INFO, len, data); + if (data) + msgb_tl16v_put(msg, RSL_IE_L3_INFO, len, data); msg->dst = trx->rsl_link; @@ -288,7 +291,8 @@ dh->chan_nr = chan_nr; msgb_tv_put(msg, RSL_IE_SYSINFO_TYPE, type); - msgb_tl16v_put(msg, RSL_IE_L3_INFO, len, data); + if (data) + msgb_tl16v_put(msg, RSL_IE_L3_INFO, len, data); msg->dst = lchan->ts->trx->rsl_link; -- To view, visit https://gerrit.osmocom.org/3623 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I88b85614951a108574f05db3b706884afe7e87a9 Gerrit-PatchSet: 2 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Sun Aug 27 00:35:00 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sun, 27 Aug 2017 00:35:00 +0000 Subject: [MERGED] osmo-msc[master]: Fix regression causing loss of static system-information mes... In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: Fix regression causing loss of static system-information messages ...................................................................... Fix regression causing loss of static system-information messages In commit 8b1a2f8cd7a81c6b8c7cdb0963dcf89de7c46100 we started to initialize bts->si_valid to 0. This means we are skipping the manually configured static system information. Instead, we have to initialize bts->si_valid to bts->si_mode_static, i.e. start with those that are static and not to be auto-generated. Found while developing http://git.osmocom.org/osmo-ttcn3-hacks/tree/sysinfo Change-Id: Iab9cc93cf6d54560a72cc393cc3721a8d10e04bf Closes: #2367 --- M src/libbsc/bsc_init.c 1 file changed, 2 insertions(+), 2 deletions(-) Approvals: Neels Hofmeyr: Looks good to me, approved diff --git a/src/libbsc/bsc_init.c b/src/libbsc/bsc_init.c index 6f80958..5f41a27 100644 --- a/src/libbsc/bsc_init.c +++ b/src/libbsc/bsc_init.c @@ -139,8 +139,8 @@ ms_pwr_ctl_lvl(bts->band, bts->ms_max_power); bts->si_common.cell_sel_par.neci = bts->network->neci; - /* Zero, forget the state of the SIs */ - bts->si_valid = 0; + /* Zero/forget the state of the dynamically computed SIs, leeping the static ones */ + bts->si_valid = bts->si_mode_static; /* First, we determine which of the SI messages we actually need */ -- To view, visit https://gerrit.osmocom.org/3622 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Iab9cc93cf6d54560a72cc393cc3721a8d10e04bf Gerrit-PatchSet: 2 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Sun Aug 27 00:35:00 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sun, 27 Aug 2017 00:35:00 +0000 Subject: [MERGED] osmo-msc[master]: check for missing result of rate_ctr_group_alloc() In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: check for missing result of rate_ctr_group_alloc() ...................................................................... check for missing result of rate_ctr_group_alloc() In case the counter group allocation fails, we must handle this gracefully and fail the allocation of the parent object, too. RelateD: OS#2361 Change-Id: I7dad4a4d52fe05f6b990359841b4408df5990e21 --- M src/gprs/gb_proxy.c M src/gprs/gb_proxy_peer.c M src/gprs/gprs_sgsn.c M src/libbsc/net_init.c M src/libcommon-cs/common_cs.c 5 files changed, 32 insertions(+), 0 deletions(-) Approvals: Neels Hofmeyr: Looks good to me, approved diff --git a/src/gprs/gb_proxy.c b/src/gprs/gb_proxy.c index d95139f..3603e14 100644 --- a/src/gprs/gb_proxy.c +++ b/src/gprs/gb_proxy.c @@ -1431,6 +1431,10 @@ INIT_LLIST_HEAD(&cfg->bts_peers); cfg->ctrg = rate_ctr_group_alloc(tall_bsc_ctx, &global_ctrg_desc, 0); + if (!cfg->ctrg) { + LOGP(DGPRS, LOGL_ERROR, "Cannot allocate global counter group!\n"); + return -1; + } clock_gettime(CLOCK_REALTIME, &tp); return 0; diff --git a/src/gprs/gb_proxy_peer.c b/src/gprs/gb_proxy_peer.c index 5365ff0..8909687 100644 --- a/src/gprs/gb_proxy_peer.c +++ b/src/gprs/gb_proxy_peer.c @@ -177,6 +177,10 @@ peer->bvci = bvci; peer->ctrg = rate_ctr_group_alloc(peer, &peer_ctrg_desc, bvci); + if (!peer->ctrg) { + talloc_free(peer); + return NULL; + } peer->cfg = cfg; llist_add(&peer->list, &cfg->bts_peers); diff --git a/src/gprs/gprs_sgsn.c b/src/gprs/gprs_sgsn.c index 11225dd..93b133f 100644 --- a/src/gprs/gprs_sgsn.c +++ b/src/gprs/gprs_sgsn.c @@ -129,6 +129,7 @@ void sgsn_rate_ctr_init() { sgsn->rate_ctrs = rate_ctr_group_alloc(tall_bsc_ctx, &sgsn_ctrg_desc, 0); + OSMO_ASSERT(sgsn->rate_ctrs); } /* look-up an SGSN MM context based on Iu UE context (struct ue_conn_ctx)*/ @@ -229,6 +230,11 @@ LOGMMCTXP(LOGL_DEBUG, ctx, "Allocated with %s cipher.\n", get_value_string(gprs_cipher_names, ctx->ciph_algo)); ctx->ctrg = rate_ctr_group_alloc(ctx, &mmctx_ctrg_desc, tlli); + if (!ctx->ctrg) { + LOGMMCTXP(LOGL_ERROR, ctx, "Cannot allocate counter group\n"); + talloc_free(ctx); + return NULL; + } INIT_LLIST_HEAD(&ctx->pdp_list); llist_add(&ctx->list, &sgsn_mm_ctxts); @@ -253,6 +259,11 @@ ctx->pmm_state = PMM_DETACHED; ctx->auth_triplet.key_seq = GSM_KEY_SEQ_INVAL; ctx->ctrg = rate_ctr_group_alloc(ctx, &mmctx_ctrg_desc, 0); + if (!ctx->ctrg) { + LOGMMCTXP(LOGL_ERROR, ctx, "Cannot allocate counter group\n"); + talloc_free(ctx); + return NULL; + } /* Need to get RAID from IU conn */ ctx->ra = ctx->iu.ue_ctx->ra_id; @@ -380,6 +391,11 @@ pdp->mm = mm; pdp->nsapi = nsapi; pdp->ctrg = rate_ctr_group_alloc(pdp, &pdpctx_ctrg_desc, nsapi); + if (!pdp->ctrg) { + LOGPDPCTXP(LOGL_ERROR, pdp, "Error allocation counter group\n"); + talloc_free(pdp); + return NULL; + } llist_add(&pdp->list, &mm->pdp_list); llist_add(&pdp->g_list, &sgsn_pdp_ctxts); diff --git a/src/libbsc/net_init.c b/src/libbsc/net_init.c index bc5ed35..4dfc258 100644 --- a/src/libbsc/net_init.c +++ b/src/libbsc/net_init.c @@ -61,6 +61,10 @@ /* init statistics */ net->bsc_ctrs = rate_ctr_group_alloc(net, &bsc_ctrg_desc, 0); + if (!net->bsc_ctrs) { + talloc_free(net); + return NULL; + } gsm_net_update_ctype(net); diff --git a/src/libcommon-cs/common_cs.c b/src/libcommon-cs/common_cs.c index 8e19bb2..99206c8 100644 --- a/src/libcommon-cs/common_cs.c +++ b/src/libcommon-cs/common_cs.c @@ -68,6 +68,10 @@ /* init statistics */ net->msc_ctrs = rate_ctr_group_alloc(net, &msc_ctrg_desc, 0); + if (!net->msc_ctrs) { + talloc_free(net); + return NULL; + } net->active_calls = osmo_counter_alloc("msc.active_calls"); net->mncc_recv = mncc_recv; -- To view, visit https://gerrit.osmocom.org/3621 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I7dad4a4d52fe05f6b990359841b4408df5990e21 Gerrit-PatchSet: 2 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Sun Aug 27 00:35:00 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sun, 27 Aug 2017 00:35:00 +0000 Subject: [MERGED] osmo-msc[master]: libbsc: Add VTY command to re-send the SYSTEM INFORMATION to... In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: libbsc: Add VTY command to re-send the SYSTEM INFORMATION to BTS ...................................................................... libbsc: Add VTY command to re-send the SYSTEM INFORMATION to BTS This is useful if you are updating some configuration parameters which affect the content of the SYSTEM INFORMATION messages. Currently, we only send them at the time the RSL connection is established (i.e. when the BTS is initialized), so if you change something, you need to bring down and re-start the BTS. Using the newly-introduced "bts <0-255> resend-system-information" command, you can re-generate + re-send SYSTEM INFORMATION without bringing the BTS down, i.e. without any radio carrier downtime. Change-Id: I326df47de98f6d36c9a4d2d5475225d1e62bafb5 --- M src/libbsc/bsc_vty.c 1 file changed, 33 insertions(+), 0 deletions(-) Approvals: Neels Hofmeyr: Looks good to me, approved diff --git a/src/libbsc/bsc_vty.c b/src/libbsc/bsc_vty.c index 722753a..09c443c 100644 --- a/src/libbsc/bsc_vty.c +++ b/src/libbsc/bsc_vty.c @@ -3801,6 +3801,38 @@ return CMD_SUCCESS; } +DEFUN(bts_resend, bts_resend_cmd, + "bts <0-255> resend-system-information", + "BTS Specific Commands\n" "BTS Number\n" + "Re-generate + re-send BCCH SYSTEM INFORMATION\n") +{ + struct gsm_network *gsmnet; + struct gsm_bts_trx *trx; + struct gsm_bts *bts; + unsigned int bts_nr; + + gsmnet = gsmnet_from_vty(vty); + + bts_nr = atoi(argv[0]); + if (bts_nr >= gsmnet->num_bts) { + vty_out(vty, "BTS number must be between 0 and %d. It was %d.%s", + gsmnet->num_bts, bts_nr, VTY_NEWLINE); + return CMD_WARNING; + } + + bts = gsm_bts_num(gsmnet, bts_nr); + if (!bts) { + vty_out(vty, "BTS Nr. %d could not be found.%s", bts_nr, VTY_NEWLINE); + return CMD_WARNING; + } + + llist_for_each_entry_reverse(trx, &bts->trx_list, list) + gsm_bts_trx_set_system_infos(trx); + + return CMD_SUCCESS; +} + + DEFUN(smscb_cmd, smscb_cmd_cmd, "bts <0-255> smscb-command <1-4> HEXSTRING", "BTS related commands\n" "BTS Number\n" @@ -4256,6 +4288,7 @@ install_element(ENABLE_NODE, &drop_bts_cmd); install_element(ENABLE_NODE, &restart_bts_cmd); + install_element(ENABLE_NODE, &bts_resend_cmd); install_element(ENABLE_NODE, &pdch_act_cmd); install_element(ENABLE_NODE, &lchan_act_cmd); install_element(ENABLE_NODE, &lchan_mdcx_cmd); -- To view, visit https://gerrit.osmocom.org/3620 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I326df47de98f6d36c9a4d2d5475225d1e62bafb5 Gerrit-PatchSet: 2 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Sun Aug 27 00:35:01 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sun, 27 Aug 2017 00:35:01 +0000 Subject: [MERGED] osmo-msc[master]: bsc_api: Fix copy+paste error in printing name of RR STATUS PDU In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: bsc_api: Fix copy+paste error in printing name of RR STATUS PDU ...................................................................... bsc_api: Fix copy+paste error in printing name of RR STATUS PDU Change-Id: I0ef78ef046e4850346569f750693e12938b50ab5 --- M src/libbsc/bsc_api.c 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Neels Hofmeyr: Looks good to me, approved diff --git a/src/libbsc/bsc_api.c b/src/libbsc/bsc_api.c index c2828e3..c60f818 100644 --- a/src/libbsc/bsc_api.c +++ b/src/libbsc/bsc_api.c @@ -607,7 +607,7 @@ break; case GSM48_MT_RR_STATUS: LOGP(DRR, LOGL_NOTICE, "%s (cause: %s)\n", - gsm48_rr_msg_name(GSM48_MT_RR_GPRS_SUSP_REQ), + gsm48_rr_msg_name(GSM48_MT_RR_STATUS), rr_cause_name(gh->data[0])); break; case GSM48_MT_RR_MEAS_REP: -- To view, visit https://gerrit.osmocom.org/3619 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I0ef78ef046e4850346569f750693e12938b50ab5 Gerrit-PatchSet: 2 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Sun Aug 27 00:35:01 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sun, 27 Aug 2017 00:35:01 +0000 Subject: [MERGED] osmo-msc[master]: transaction: reject calls from unidentified subscribers In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: transaction: reject calls from unidentified subscribers ...................................................................... transaction: reject calls from unidentified subscribers A valid subscriber is indespensible when allocating a new transaction. Return NULL if no subscriber is supplied. This will cause unidentified subscribers to be rejected. Note: Under normal conditions, the problem does not occour, but it is still possible that a misbehaving MS might trigger the problem by sending a SETUP command before authenticating the subscriber. (unencrypted networks) Change-Id: Ia8739b6e329ab02c0064270d02ad1d6ee245520d --- M src/libmsc/transaction.c 1 file changed, 7 insertions(+), 0 deletions(-) Approvals: Neels Hofmeyr: Looks good to me, approved diff --git a/src/libmsc/transaction.c b/src/libmsc/transaction.c index 7289a8f..28e0914 100644 --- a/src/libmsc/transaction.c +++ b/src/libmsc/transaction.c @@ -88,6 +88,13 @@ DEBUGP(DCC, "subscr=%p, net=%p\n", vsub, net); + /* a valid subscriber is indispensable */ + if (vsub == NULL) { + LOGP(DCC, LOGL_NOTICE, + "unable to alloc transaction, invalid subscriber (NULL)\n"); + return NULL; + } + trans = talloc_zero(tall_trans_ctx, struct gsm_trans); if (!trans) return NULL; -- To view, visit https://gerrit.osmocom.org/3618 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ia8739b6e329ab02c0064270d02ad1d6ee245520d Gerrit-PatchSet: 3 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Sun Aug 27 00:35:01 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sun, 27 Aug 2017 00:35:01 +0000 Subject: [MERGED] osmo-msc[master]: Fix BTS attribute requests In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: Fix BTS attribute requests ...................................................................... Fix BTS attribute requests * fix BTS numbers: use 0 to indicate given BTS and 0xFF to indicate all BTS' as it's explained in 3GPP TS 52.021 ?9.3. * only request attributes from supported (OsmoBTS) types Change-Id: I8f43055c38000248033a8ff9ddaf0910d68d794b Related: OS#2317 --- M src/libbsc/abis_nm.c M src/libbsc/bsc_init.c 2 files changed, 10 insertions(+), 3 deletions(-) Approvals: Neels Hofmeyr: Looks good to me, approved diff --git a/src/libbsc/abis_nm.c b/src/libbsc/abis_nm.c index 019d039..cf20d7c 100644 --- a/src/libbsc/abis_nm.c +++ b/src/libbsc/abis_nm.c @@ -1590,10 +1590,17 @@ const uint8_t *attr, uint8_t attr_len) { struct abis_om_hdr *oh; - struct msgb *msg = nm_msgb_alloc(); + struct msgb *msg; + + if (bts->type != GSM_BTS_TYPE_OSMOBTS) { + LOGPC(DNM, LOGL_NOTICE, "Getting attributes from BTS%d type %s is not supported.\n", + bts->nr, btstype2str(bts->type)); + return -EINVAL; + } DEBUGP(DNM, "Get Attr (bts=%d)\n", bts->nr); + msg = nm_msgb_alloc(); oh = (struct abis_om_hdr *) msgb_put(msg, ABIS_OM_FOM_HDR_SIZE); fill_om_fom_hdr(oh, attr_len, NM_MT_GET_ATTR, obj_class, bts_nr, trx_nr, ts_nr); diff --git a/src/libbsc/bsc_init.c b/src/libbsc/bsc_init.c index 64dcd15..6f80958 100644 --- a/src/libbsc/bsc_init.c +++ b/src/libbsc/bsc_init.c @@ -350,12 +350,12 @@ generate_cell_chan_list(ca, trx->bts); /* Request generic BTS-level attributes */ - abis_nm_get_attr(trx->bts, NM_OC_BTS, trx->bts->nr, trx->nr, 0xFF, bts_attr, sizeof(bts_attr)); + abis_nm_get_attr(trx->bts, NM_OC_BTS, 0xFF, 0xFF, 0xFF, bts_attr, sizeof(bts_attr)); llist_for_each_entry(cur_trx, &trx->bts->trx_list, list) { int i; /* Request TRX-level attributes */ - abis_nm_get_attr(cur_trx->bts, NM_OC_BASEB_TRANSC, cur_trx->bts->nr, cur_trx->nr, 0xFF, + abis_nm_get_attr(cur_trx->bts, NM_OC_BASEB_TRANSC, 0, cur_trx->nr, 0xFF, trx_attr, sizeof(trx_attr)); for (i = 0; i < ARRAY_SIZE(cur_trx->ts); i++) generate_ma_for_ts(&cur_trx->ts[i]); -- To view, visit https://gerrit.osmocom.org/3617 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I8f43055c38000248033a8ff9ddaf0910d68d794b Gerrit-PatchSet: 2 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Sun Aug 27 00:35:01 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sun, 27 Aug 2017 00:35:01 +0000 Subject: [MERGED] osmo-msc[master]: Add VTY commands for experimentation with TS 04.14 commands In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: Add VTY commands for experimentation with TS 04.14 commands ...................................................................... Add VTY commands for experimentation with TS 04.14 commands TS 04.14 (TS 44.014) specifies a series of commands specific to conformance testing. Let's add some VTY commands to play (at least initially) with closing and opening voice loops in the MS. Change-Id: I38b1ee9dbf26f5689c38cb83b1b3c5e9eaad7678 --- M src/libmsc/vty_interface_layer3.c 1 file changed, 94 insertions(+), 0 deletions(-) Approvals: Neels Hofmeyr: Looks good to me, approved diff --git a/src/libmsc/vty_interface_layer3.c b/src/libmsc/vty_interface_layer3.c index 1761ebc..864597d 100644 --- a/src/libmsc/vty_interface_layer3.c +++ b/src/libmsc/vty_interface_layer3.c @@ -46,6 +46,7 @@ #include #include #include +#include #include #include #include @@ -473,6 +474,97 @@ return CMD_SUCCESS; } +static int loop_by_char(uint8_t ch) +{ + switch (ch) { + case 'a': + return GSM414_LOOP_A; + case 'b': + return GSM414_LOOP_B; + case 'c': + return GSM414_LOOP_C; + case 'd': + return GSM414_LOOP_D; + case 'e': + return GSM414_LOOP_E; + case 'f': + return GSM414_LOOP_F; + case 'i': + return GSM414_LOOP_I; + } + return -1; +} + +DEFUN(subscriber_mstest_close, + subscriber_mstest_close_cmd, + "subscriber " SUBSCR_TYPES " ID ms-test close-loop (a|b|c|d|e|f|i)", + SUBSCR_HELP "Send a TS 04.14 MS Test Command to subscriber\n" + "Close a TCH Loop inside the MS\n" + "Loop Type A\n" + "Loop Type B\n" + "Loop Type C\n" + "Loop Type D\n" + "Loop Type E\n" + "Loop Type F\n" + "Loop Type I\n") +{ + struct gsm_subscriber_connection *conn; + struct gsm_network *gsmnet = gsmnet_from_vty(vty); + struct vlr_subscr *vsub = get_vsub_by_argv(gsmnet, argv[0], argv[1]); + const char *loop_str; + int loop_mode; + + if (!vsub) { + vty_out(vty, "%% No subscriber found for %s %s%s", + argv[0], argv[1], VTY_NEWLINE); + return CMD_WARNING; + } + + loop_str = argv[2]; + loop_mode = loop_by_char(loop_str[0]); + + conn = connection_for_subscr(vsub); + if (!conn) { + vty_out(vty, "%% An active connection is required for %s %s%s", + argv[0], argv[1], VTY_NEWLINE); + vlr_subscr_put(vsub); + return CMD_WARNING; + } + + gsm0414_tx_close_tch_loop_cmd(conn, loop_mode); + + return CMD_SUCCESS; +} + +DEFUN(subscriber_mstest_open, + subscriber_mstest_open_cmd, + "subscriber " SUBSCR_TYPES " ID ms-test open-loop", + SUBSCR_HELP "Send a TS 04.14 MS Test Command to subscriber\n" + "Open a TCH Loop inside the MS\n") +{ + struct gsm_subscriber_connection *conn; + struct gsm_network *gsmnet = gsmnet_from_vty(vty); + struct vlr_subscr *vsub = get_vsub_by_argv(gsmnet, argv[0], argv[1]); + + if (!vsub) { + vty_out(vty, "%% No subscriber found for %s %s%s", + argv[0], argv[1], VTY_NEWLINE); + return CMD_WARNING; + } + + conn = connection_for_subscr(vsub); + if (!conn) { + vty_out(vty, "%% An active connection is required for %s %s%s", + argv[0], argv[1], VTY_NEWLINE); + vlr_subscr_put(vsub); + return CMD_WARNING; + } + + gsm0414_tx_open_loop_cmd(conn); + + return CMD_SUCCESS; +} + DEFUN(ena_subscr_expire, ena_subscr_expire_cmd, "subscriber " SUBSCR_TYPES " ID expire", @@ -851,6 +943,8 @@ install_element_ve(&subscriber_silent_call_start_cmd); install_element_ve(&subscriber_silent_call_stop_cmd); install_element_ve(&subscriber_ussd_notify_cmd); + install_element_ve(&subscriber_mstest_close_cmd); + install_element_ve(&subscriber_mstest_open_cmd); install_element_ve(&subscriber_update_cmd); install_element_ve(&show_stats_cmd); install_element_ve(&show_smsqueue_cmd); -- To view, visit https://gerrit.osmocom.org/3616 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I38b1ee9dbf26f5689c38cb83b1b3c5e9eaad7678 Gerrit-PatchSet: 2 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Sun Aug 27 00:35:02 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sun, 27 Aug 2017 00:35:02 +0000 Subject: [MERGED] osmo-msc[master]: Support for TS 04.14 conformance test commands In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: Support for TS 04.14 conformance test commands ...................................................................... Support for TS 04.14 conformance test commands Change-Id: Ib27edbfc8ccdedf00589ec715ced7bed435fa94c --- M include/openbsc/Makefile.am A include/openbsc/gsm_04_14.h M src/libmsc/Makefile.am M src/libmsc/gsm_04_08.c A src/libmsc/gsm_04_14.c 5 files changed, 154 insertions(+), 0 deletions(-) Approvals: Neels Hofmeyr: Looks good to me, approved diff --git a/include/openbsc/Makefile.am b/include/openbsc/Makefile.am index 2558d7c..995f02d 100644 --- a/include/openbsc/Makefile.am +++ b/include/openbsc/Makefile.am @@ -37,6 +37,7 @@ gprs_utils.h \ gsm_04_08.h \ gsm_04_11.h \ + gsm_04_14.h \ gsm_04_80.h \ gsm_data.h \ gsm_data_shared.h \ diff --git a/include/openbsc/gsm_04_14.h b/include/openbsc/gsm_04_14.h new file mode 100644 index 0000000..3cdbe04 --- /dev/null +++ b/include/openbsc/gsm_04_14.h @@ -0,0 +1,15 @@ +#pragma once + +#include + +int gsm0414_tx_close_tch_loop_cmd(struct gsm_subscriber_connection *conn, + enum gsm414_tch_loop_mode loop_mode); +int gsm0414_tx_open_loop_cmd(struct gsm_subscriber_connection *conn); +int gsm0414_tx_act_emmi_cmd(struct gsm_subscriber_connection *conn); +int gsm0414_tx_test_interface(struct gsm_subscriber_connection *conn, + uint8_t tested_devs); +int gsm0414_tx_reset_ms_pos_store(struct gsm_subscriber_connection *conn, + uint8_t technology); + +int gsm0414_rcv_test(struct gsm_subscriber_connection *conn, + struct msgb *msg); diff --git a/src/libmsc/Makefile.am b/src/libmsc/Makefile.am index 16154ff..4726bbe 100644 --- a/src/libmsc/Makefile.am +++ b/src/libmsc/Makefile.am @@ -30,6 +30,7 @@ db.c \ gsm_04_08.c \ gsm_04_11.c \ + gsm_04_14.c \ gsm_04_80.c \ gsm_subscriber.c \ iucs.c \ diff --git a/src/libmsc/gsm_04_08.c b/src/libmsc/gsm_04_08.c index 58c5610..28cba5b 100644 --- a/src/libmsc/gsm_04_08.c +++ b/src/libmsc/gsm_04_08.c @@ -43,6 +43,7 @@ #include #include #include +#include #include #include #include @@ -3079,6 +3080,9 @@ case GSM48_PDISC_NC_SS: rc = handle_rcv_ussd(conn, msg); break; + case GSM48_PDISC_TEST: + rc = gsm0414_rcv_test(conn, msg); + break; default: LOGP(DRLL, LOGL_NOTICE, "Unknown " "GSM 04.08 discriminator 0x%02x\n", pdisc); diff --git a/src/libmsc/gsm_04_14.c b/src/libmsc/gsm_04_14.c new file mode 100644 index 0000000..b529f4c --- /dev/null +++ b/src/libmsc/gsm_04_14.c @@ -0,0 +1,133 @@ +/* GSM MS Testing Layer 3 messages + * 3GPP TS 44.014 / GSM TS 04.14 */ + +/* (C) 2017 by Harald Welte + * + * All Rights Reserved + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + * + */ + +#include +#include +#include + +#include "bscconfig.h" + +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include + +static struct msgb *create_gsm0414_msg(uint8_t msg_type) +{ + struct msgb *msg = gsm48_msgb_alloc_name("GSM 04.14"); + struct gsm48_hdr *gh; + + gh = (struct gsm48_hdr *) msgb_put(msg, sizeof(*gh) + 1); + gh->proto_discr = GSM48_PDISC_TEST; + gh->msg_type = msg_type; + return msg; +} + +static int gsm0414_conn_sendmsg(struct gsm_subscriber_connection *conn, struct msgb *msg) +{ + return msc_tx_dtap(conn, msg); +} + +static int gsm0414_tx_simple(struct gsm_subscriber_connection *conn, uint8_t msg_type) +{ + struct msgb *msg = create_gsm0414_msg(msg_type); + + return gsm0414_conn_sendmsg(conn, msg); +} + + +/* Send a CLOSE_TCH_LOOOP_CMD according to Section 8.1 */ +int gsm0414_tx_close_tch_loop_cmd(struct gsm_subscriber_connection *conn, + enum gsm414_tch_loop_mode loop_mode) +{ + struct msgb *msg = create_gsm0414_msg(GSM414_MT_CLOSE_TCH_LOOP_CMD); + uint8_t subch; + + subch = (loop_mode << 1); + msgb_put_u8(msg, subch); + + msg->lchan = conn->lchan; + return gsm0414_conn_sendmsg(conn, msg); +} + +/* Send a OPEN_LOOP_CMD according to Section 8.3 */ +int gsm0414_tx_open_loop_cmd(struct gsm_subscriber_connection *conn) +{ + return gsm0414_tx_simple(conn, GSM414_MT_OPEN_LOOP_CMD); +} + +/* Send a ACT_EMMI_CMD according to Section 8.8 */ +int gsm0414_tx_act_emmi_cmd(struct gsm_subscriber_connection *conn) +{ + return gsm0414_tx_simple(conn, GSM414_MT_ACT_EMMI_CMD); +} + +/* Send a DEACT_EMMI_CMD according to Section 8.10 */ +int gsm0414_tx_deact_emmi_cmd(struct gsm_subscriber_connection *conn) +{ + return gsm0414_tx_simple(conn, GSM414_MT_DEACT_EMMI_CMD); +} + +/* Send a TEST_INTERFACE according to Section 8.11 */ +int gsm0414_tx_test_interface(struct gsm_subscriber_connection *conn, + uint8_t tested_devs) +{ + struct msgb *msg = create_gsm0414_msg(GSM414_MT_TEST_INTERFACE); + msgb_put_u8(msg, tested_devs); + return gsm0414_conn_sendmsg(conn, msg); +} + +/* Send a RESET_MS_POSITION_STORED according to Section 8.11 */ +int gsm0414_tx_reset_ms_pos_store(struct gsm_subscriber_connection *conn, + uint8_t technology) +{ + struct msgb *msg = create_gsm0414_msg(GSM414_MT_RESET_MS_POS_STORED); + msgb_put_u8(msg, technology); + return gsm0414_conn_sendmsg(conn, msg); +} + + + +/* Entry point for incoming GSM48_PDISC_TEST received from MS */ +int gsm0414_rcv_test(struct gsm_subscriber_connection *conn, + struct msgb *msg) +{ + struct gsm48_hdr *gh = msgb_l3(msg); + + if (msgb_l3len(msg) < sizeof(*gh)) + return -1; + + LOGP(DMM, LOGL_NOTICE, "%s: Received TEST class message '%s'\n", "FIXME", + get_value_string(gsm414_msgt_names, gh->msg_type)); + + return 0; +} -- To view, visit https://gerrit.osmocom.org/3615 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ib27edbfc8ccdedf00589ec715ced7bed435fa94c Gerrit-PatchSet: 3 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Sun Aug 27 00:35:02 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sun, 27 Aug 2017 00:35:02 +0000 Subject: [MERGED] osmo-msc[master]: libmsc: Fix VTY output for handover counters. In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: libmsc: Fix VTY output for handover counters. ...................................................................... libmsc: Fix VTY output for handover counters. Handover countrs belong to BSC, but we mistakenly take values from MSC counters. Change-Id: I9512330f2e91d2f526751c5228e6e8e0fe17d579 --- M src/libmsc/vty_interface_layer3.c 1 file changed, 5 insertions(+), 5 deletions(-) Approvals: Neels Hofmeyr: Looks good to me, approved diff --git a/src/libmsc/vty_interface_layer3.c b/src/libmsc/vty_interface_layer3.c index d1bf6b3..1761ebc 100644 --- a/src/libmsc/vty_interface_layer3.c +++ b/src/libmsc/vty_interface_layer3.c @@ -570,11 +570,11 @@ VTY_NEWLINE); vty_out(vty, "Handover : %lu attempted, %lu no_channel, %lu timeout, " "%lu completed, %lu failed%s", - net->msc_ctrs->ctr[BSC_CTR_HANDOVER_ATTEMPTED].current, - net->msc_ctrs->ctr[BSC_CTR_HANDOVER_NO_CHANNEL].current, - net->msc_ctrs->ctr[BSC_CTR_HANDOVER_TIMEOUT].current, - net->msc_ctrs->ctr[BSC_CTR_HANDOVER_COMPLETED].current, - net->msc_ctrs->ctr[BSC_CTR_HANDOVER_FAILED].current, + net->bsc_ctrs->ctr[BSC_CTR_HANDOVER_ATTEMPTED].current, + net->bsc_ctrs->ctr[BSC_CTR_HANDOVER_NO_CHANNEL].current, + net->bsc_ctrs->ctr[BSC_CTR_HANDOVER_TIMEOUT].current, + net->bsc_ctrs->ctr[BSC_CTR_HANDOVER_COMPLETED].current, + net->bsc_ctrs->ctr[BSC_CTR_HANDOVER_FAILED].current, VTY_NEWLINE); vty_out(vty, "SMS MO : %lu submitted, %lu no receiver%s", net->msc_ctrs->ctr[MSC_CTR_SMS_SUBMITTED].current, -- To view, visit https://gerrit.osmocom.org/3614 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I9512330f2e91d2f526751c5228e6e8e0fe17d579 Gerrit-PatchSet: 2 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Alexander Chemeris Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Sun Aug 27 00:35:02 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sun, 27 Aug 2017 00:35:02 +0000 Subject: [MERGED] osmo-msc[master]: sgsn: Fill the cch_pdp with a value coming from the tlv stru... In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: sgsn: Fill the cch_pdp with a value coming from the tlv structure ...................................................................... sgsn: Fill the cch_pdp with a value coming from the tlv structure For some GGSNs we need to insert the PDP Charging Characteristics that were returned. We receive these values from GSUP and will fill them into the tlv structure when finding the ggsn context. Change-Id: I1725bfd2403d29ce3550bfcd6fcc1498426ef906 --- M include/openbsc/gprs_sgsn.h M src/gprs/gprs_sgsn.c M src/gprs/gprs_subscriber.c M src/gprs/sgsn_libgtp.c 4 files changed, 42 insertions(+), 5 deletions(-) Approvals: Neels Hofmeyr: Looks good to me, approved diff --git a/include/openbsc/gprs_sgsn.h b/include/openbsc/gprs_sgsn.h index fd86174..4e49c08 100644 --- a/include/openbsc/gprs_sgsn.h +++ b/include/openbsc/gprs_sgsn.h @@ -393,6 +393,8 @@ char apn_str[GSM_APN_LENGTH]; uint8_t qos_subscribed[20]; size_t qos_subscribed_len; + uint8_t pdp_charg[2]; + bool has_pdp_charg; }; struct sgsn_subscriber_data { @@ -407,6 +409,9 @@ uint8_t hlr[9]; size_t hlr_len; + + uint8_t pdp_charg[2]; + bool has_pdp_charg; }; #define SGSN_ERROR_CAUSE_NONE (-1) diff --git a/src/gprs/gprs_sgsn.c b/src/gprs/gprs_sgsn.c index 18625ae..11225dd 100644 --- a/src/gprs/gprs_sgsn.c +++ b/src/gprs/gprs_sgsn.c @@ -699,10 +699,21 @@ sgsn_auth_update(mmctx); } -static void insert_qos(struct tlv_parsed *tp, struct sgsn_subscriber_pdp_data *pdp) +static void insert_extra(struct tlv_parsed *tp, + struct sgsn_subscriber_data *data, + struct sgsn_subscriber_pdp_data *pdp) { tp->lv[OSMO_IE_GSM_SUB_QOS].len = pdp->qos_subscribed_len; tp->lv[OSMO_IE_GSM_SUB_QOS].val = pdp->qos_subscribed; + + /* Prefer PDP charging characteristics of per subscriber one */ + if (pdp->has_pdp_charg) { + tp->lv[OSMO_IE_GSM_CHARG_CHAR].len = sizeof(pdp->pdp_charg); + tp->lv[OSMO_IE_GSM_CHARG_CHAR].val = &pdp->pdp_charg[0]; + } else if (data->has_pdp_charg) { + tp->lv[OSMO_IE_GSM_CHARG_CHAR].len = sizeof(data->pdp_charg); + tp->lv[OSMO_IE_GSM_CHARG_CHAR].val = &data->pdp_charg[0]; + } } /** @@ -751,7 +762,7 @@ { allow_any_apn = 1; selected_apn_str = ""; - insert_qos(tp, pdp); + insert_extra(tp, mmctx->subscr->sgsn_data, pdp); continue; } if (!llist_empty(&sgsn_apn_ctxts)) { @@ -760,7 +771,7 @@ if (apn_ctx == NULL) continue; } - insert_qos(tp, pdp); + insert_extra(tp, mmctx->subscr->sgsn_data, pdp); selected_apn_str = pdp->apn_str; break; } @@ -768,13 +779,13 @@ /* Check whether the given APN is granted */ llist_for_each_entry(pdp, &mmctx->subscr->sgsn_data->pdp_list, list) { if (strcmp(pdp->apn_str, "*") == 0) { - insert_qos(tp, pdp); + insert_extra(tp, mmctx->subscr->sgsn_data, pdp); selected_apn_str = req_apn_str; allow_any_apn = 1; continue; } if (strcasecmp(pdp->apn_str, req_apn_str) == 0) { - insert_qos(tp, pdp); + insert_extra(tp, mmctx->subscr->sgsn_data, pdp); selected_apn_str = req_apn_str; break; } diff --git a/src/gprs/gprs_subscriber.c b/src/gprs/gprs_subscriber.c index 176583b..aa03509 100644 --- a/src/gprs/gprs_subscriber.c +++ b/src/gprs/gprs_subscriber.c @@ -325,6 +325,13 @@ } } + if (gsup_msg->pdp_charg_enc && gsup_msg->pdp_charg_enc_len >= sizeof(sdata->pdp_charg)) { + memcpy(&sdata->pdp_charg, gsup_msg->pdp_charg_enc, sizeof(sdata->pdp_charg)); + sdata->has_pdp_charg = 1; + } else { + sdata->has_pdp_charg = 0; + } + if (gsup_msg->pdp_info_compl) { rc = gprs_subscr_pdp_data_clear(subscr); if (rc > 0) @@ -368,6 +375,13 @@ pdp_info->apn_enc, pdp_info->apn_enc_len); memcpy(pdp_data->qos_subscribed, pdp_info->qos_enc, pdp_info->qos_enc_len); pdp_data->qos_subscribed_len = pdp_info->qos_enc_len; + + if (pdp_info->pdp_charg_enc && pdp_info->pdp_charg_enc_len >= sizeof(pdp_data->pdp_charg)) { + memcpy(&pdp_data->pdp_charg, pdp_info->pdp_charg_enc, sizeof(pdp_data->pdp_charg)); + pdp_data->has_pdp_charg = 1; + } else { + pdp_data->has_pdp_charg = 0; + } } } diff --git a/src/gprs/sgsn_libgtp.c b/src/gprs/sgsn_libgtp.c index 7595bf8..0a0de08 100644 --- a/src/gprs/sgsn_libgtp.c +++ b/src/gprs/sgsn_libgtp.c @@ -234,6 +234,13 @@ memcpy(pdp->qos_req.v, qos, pdp->qos_req.l); } + /* charging characteristics if present */ + if (TLVP_LEN(tp, OSMO_IE_GSM_CHARG_CHAR) > 0) { + OSMO_ASSERT(TLVP_LEN(tp, OSMO_IE_GSM_CHARG_CHAR) <= sizeof(pdp->cch_pdp)); + memcpy(&pdp->cch_pdp, TLVP_VAL(tp, OSMO_IE_GSM_CHARG_CHAR), + TLVP_LEN(tp, OSMO_IE_GSM_CHARG_CHAR)); + } + /* SGSN address for control plane */ pdp->gsnlc.l = sizeof(sgsn->cfg.gtp_listenaddr.sin_addr); memcpy(pdp->gsnlc.v, &sgsn->cfg.gtp_listenaddr.sin_addr, -- To view, visit https://gerrit.osmocom.org/3613 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I1725bfd2403d29ce3550bfcd6fcc1498426ef906 Gerrit-PatchSet: 2 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Sun Aug 27 00:35:02 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sun, 27 Aug 2017 00:35:02 +0000 Subject: [MERGED] osmo-msc[master]: 04.08: find a portable way to obtain the timezone offset In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: 04.08: find a portable way to obtain the timezone offset ...................................................................... 04.08: find a portable way to obtain the timezone offset Portable GMT offset calculation to display correct time on GSM. Change-Id: I673f17af2550c9708c4771e4ea4eafbbfafbb824 --- M src/libmsc/gsm_04_08.c 1 file changed, 10 insertions(+), 3 deletions(-) Approvals: Neels Hofmeyr: Looks good to me, approved diff --git a/src/libmsc/gsm_04_08.c b/src/libmsc/gsm_04_08.c index d97bde2..58c5610 100644 --- a/src/libmsc/gsm_04_08.c +++ b/src/libmsc/gsm_04_08.c @@ -496,12 +496,19 @@ else { /* Need to get GSM offset and convert into 15 min units */ /* This probably breaks if gmtoff returns a value not evenly divisible by 15? */ - local_time = localtime(&cur_t); #ifdef HAVE_TM_GMTOFF_IN_TM + local_time = localtime(&cur_t); tzunits = (local_time->tm_gmtoff/60)/15; #else -#warning find a portable way to obtain the timezone offset - tzunits = 0; + /* find timezone offset */ + time_t utc; + double offsetFromUTC; + utc = mktime(gmt_time); + local_time = localtime(&cur_t); + offsetFromUTC = difftime(cur_t, utc); + if (local_time->tm_isdst) + offsetFromUTC += 3600.0; + tzunits = ((int)offsetFromUTC) / 60 / 15; #endif if (tzunits < 0) { tzunits = tzunits/-1; -- To view, visit https://gerrit.osmocom.org/3612 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I673f17af2550c9708c4771e4ea4eafbbfafbb824 Gerrit-PatchSet: 2 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Sun Aug 27 00:35:03 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sun, 27 Aug 2017 00:35:03 +0000 Subject: [MERGED] osmo-msc[master]: jenkins.sh: Proper error message if local environment isn't ... In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: jenkins.sh: Proper error message if local environment isn't set up ...................................................................... jenkins.sh: Proper error message if local environment isn't set up Change-Id: I79c2302365824d9c8783dadfa378c8eaa07e2ee7 --- M contrib/jenkins.sh 1 file changed, 7 insertions(+), 0 deletions(-) Approvals: Neels Hofmeyr: Looks good to me, approved diff --git a/contrib/jenkins.sh b/contrib/jenkins.sh index b4074e4..7734965 100755 --- a/contrib/jenkins.sh +++ b/contrib/jenkins.sh @@ -1,4 +1,11 @@ #!/usr/bin/env bash +# jenkins build helper script for openbsc. This is how we build on jenkins.osmocom.org + +if ! [ -x "$(command -v osmo-build-dep.sh)" ]; then + echo "Error: We need to have scripts/osmo-deps.sh from http://git.osmocom.org/osmo-ci/ in PATH !" + exit 2 +fi + set -ex -- To view, visit https://gerrit.osmocom.org/3611 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I79c2302365824d9c8783dadfa378c8eaa07e2ee7 Gerrit-PatchSet: 2 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Sun Aug 27 00:35:03 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sun, 27 Aug 2017 00:35:03 +0000 Subject: [MERGED] osmo-msc[master]: smpp: fix return cause In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: smpp: fix return cause ...................................................................... smpp: fix return cause Return cause 38 when default SMPP route is unavailable. This is better than cause 1. Change-Id: If3241d50a78fa611981e55fef6ae4c72b0a2a167 --- M src/libmsc/gsm_04_11.c M src/libmsc/smpp_openbsc.c M src/libmsc/smpp_smsc.c M src/libmsc/smpp_smsc.h 4 files changed, 17 insertions(+), 12 deletions(-) Approvals: Neels Hofmeyr: Looks good to me, approved diff --git a/src/libmsc/gsm_04_11.c b/src/libmsc/gsm_04_11.c index bdf2ad7..6c6a1fb 100644 --- a/src/libmsc/gsm_04_11.c +++ b/src/libmsc/gsm_04_11.c @@ -296,6 +296,7 @@ if (smpp_first) { rc = smpp_try_deliver(gsms, conn, deferred); if (rc == GSM411_RP_CAUSE_MO_NUM_UNASSIGNED) + /* unknown subscriber, try local */ goto try_local; if (rc < 0) { LOGP(DLSMS, LOGL_ERROR, "%s: SMS delivery error: %d.", diff --git a/src/libmsc/smpp_openbsc.c b/src/libmsc/smpp_openbsc.c index 24a4653..b3f9bbb 100644 --- a/src/libmsc/smpp_openbsc.c +++ b/src/libmsc/smpp_openbsc.c @@ -709,17 +709,18 @@ { struct osmo_esme *esme; struct osmo_smpp_addr dst; + int rc; memset(&dst, 0, sizeof(dst)); dst.ton = sms->dst.ton; dst.npi = sms->dst.npi; memcpy(dst.addr, sms->dst.addr, sizeof(dst.addr)); - esme = smpp_route(g_smsc, &dst); - if (!esme) - return GSM411_RP_CAUSE_MO_NUM_UNASSIGNED; + rc = smpp_route(g_smsc, &dst, &esme); + if (!rc) + rc = deliver_to_esme(esme, sms, conn, deferred); - return deliver_to_esme(esme, sms, conn, deferred); + return rc; } struct smsc *smsc_from_vty(struct vty *v) diff --git a/src/libmsc/smpp_smsc.c b/src/libmsc/smpp_smsc.c index 4c2e4aa..04afc49 100644 --- a/src/libmsc/smpp_smsc.c +++ b/src/libmsc/smpp_smsc.c @@ -270,8 +270,7 @@ } /*! \brief try to find a SMPP route (ESME) for given destination */ -struct osmo_esme * -smpp_route(const struct smsc *smsc, const struct osmo_smpp_addr *dest) +int smpp_route(const struct smsc *smsc, const struct osmo_smpp_addr *dest, struct osmo_esme **pesme) { struct osmo_smpp_route *r; struct osmo_smpp_acl *acl = NULL; @@ -314,15 +313,20 @@ struct osmo_esme *esme; DEBUGP(DSMPP, "ACL even has ESME, we can route to it!\n"); esme = acl->esme; - if (esme->bind_flags & ESME_BIND_RX) - return esme; - else + if (esme->bind_flags & ESME_BIND_RX) { + *pesme = esme; + return 0; + } else LOGP(DSMPP, LOGL_NOTICE, "[%s] is matching route, " "but not bound for Rx, discarding MO SMS\n", esme->system_id); } - return NULL; + *pesme = NULL; + if (acl) + return GSM48_CC_CAUSE_NETWORK_OOO; + else + return GSM48_CC_CAUSE_UNASSIGNED_NR; } diff --git a/src/libmsc/smpp_smsc.h b/src/libmsc/smpp_smsc.h index 4bee59b..fded236 100644 --- a/src/libmsc/smpp_smsc.h +++ b/src/libmsc/smpp_smsc.h @@ -126,8 +126,7 @@ void smpp_esme_get(struct osmo_esme *esme); void smpp_esme_put(struct osmo_esme *esme); -struct osmo_esme * -smpp_route(const struct smsc *smsc, const struct osmo_smpp_addr *dest); +int smpp_route(const struct smsc *smsc, const struct osmo_smpp_addr *dest, struct osmo_esme **emse); struct osmo_smpp_acl *smpp_acl_alloc(struct smsc *smsc, const char *sys_id); struct osmo_smpp_acl *smpp_acl_by_system_id(struct smsc *smsc, -- To view, visit https://gerrit.osmocom.org/3610 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: If3241d50a78fa611981e55fef6ae4c72b0a2a167 Gerrit-PatchSet: 2 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Sun Aug 27 00:35:03 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sun, 27 Aug 2017 00:35:03 +0000 Subject: [MERGED] osmo-msc[master]: smpp_smsc.c: Log on sending deliver_sm message In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: smpp_smsc.c: Log on sending deliver_sm message ...................................................................... smpp_smsc.c: Log on sending deliver_sm message Change-Id: Ie16294df6d5bc0065f8d2b49320ead61f535f271 --- M src/libmsc/smpp_smsc.c 1 file changed, 3 insertions(+), 0 deletions(-) Approvals: Neels Hofmeyr: Looks good to me, approved diff --git a/src/libmsc/smpp_smsc.c b/src/libmsc/smpp_smsc.c index 48a1192..4c2e4aa 100644 --- a/src/libmsc/smpp_smsc.c +++ b/src/libmsc/smpp_smsc.c @@ -654,6 +654,9 @@ { deliver->sequence_number = esme_inc_seq_nr(esme); + LOGP(DSMPP, LOGL_DEBUG, "[%s] Tx DELIVER-SM (from %s)\n", + esme->system_id, deliver->source_addr); + return PACK_AND_SEND(esme, deliver); } -- To view, visit https://gerrit.osmocom.org/3609 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ie16294df6d5bc0065f8d2b49320ead61f535f271 Gerrit-PatchSet: 2 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Sun Aug 27 01:06:17 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sun, 27 Aug 2017 01:06:17 +0000 Subject: [PATCH] osmo-msc[master]: Implement AoIP, port to M3UA SIGTRAN (large addition and ref... In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3486 to look at the new patch set (#5). Implement AoIP, port to M3UA SIGTRAN (large addition and refactoring) This was originally a long series of commits converging to the final result seen in this patch. It does not make much sense to review the smaller steps' trial and error, we need to review this entire change as a whole. Implement AoIP in osmo-msc and osmo-bsc. Change over to the new libosmo-sigtran API with support for proper SCCP/M3UA/SCTP stacking, as mandated by 3GPP specifications for the IuCS and IuPS interfaces. >From here on, a separate osmo-stp process is required for SCCP routing between OsmoBSC / OsmoHNBGW <-> OsmoMSC / OsmoSGSN jenkins.sh: build from libosmo-sccp and osmo-iuh master branches now for new M3UA SIGTRAN. Patch-by: pmaier, nhofmeyr, laforge Change-Id: I5ae4e05ee7c57cad341ea5e86af37c1f6b0ffa77 --- M configure.ac M contrib/jenkins.sh M doc/examples/osmo-bsc/osmo-bsc.cfg M include/openbsc/Makefile.am A include/openbsc/a_iface.h A include/openbsc/a_iface_bssap.h A include/openbsc/a_reset.h M include/openbsc/bsc_msc.h M include/openbsc/bsc_msc_data.h M include/openbsc/debug.h M include/openbsc/gsm_04_08.h M include/openbsc/gsm_data.h M include/openbsc/gsm_data_shared.h M include/openbsc/iu.h M include/openbsc/mgcpgw_client.h M include/openbsc/msc_ifaces.h M include/openbsc/osmo_bsc.h A include/openbsc/osmo_bsc_reset.h A include/openbsc/osmo_bsc_sigtran.h M include/openbsc/osmo_msc.h M include/openbsc/transaction.h M src/gprs/Makefile.am M src/gprs/sgsn_main.c M src/libbsc/abis_rsl.c M src/libbsc/bsc_vty.c M src/libbsc/handover_logic.c M src/libcommon-cs/Makefile.am A src/libcommon-cs/a_reset.c M src/libcommon-cs/common_cs.c M src/libcommon/common_vty.c M src/libcommon/debug.c M src/libiu/iu.c M src/libiu/iu_vty.c M src/libmgcp/mgcp_protocol.c M src/libmgcp/mgcpgw_client.c M src/libmgcp/mgcpgw_client_vty.c M src/libmsc/Makefile.am M src/libmsc/a_iface.c A src/libmsc/a_iface_bssap.c M src/libmsc/gsm_04_08.c M src/libmsc/gsm_subscriber.c M src/libmsc/iucs.c M src/libmsc/msc_ifaces.c M src/libmsc/msc_vty.c M src/libmsc/osmo_msc.c M src/libmsc/subscr_conn.c M src/osmo-bsc/Makefile.am M src/osmo-bsc/osmo_bsc_api.c M src/osmo-bsc/osmo_bsc_audio.c M src/osmo-bsc/osmo_bsc_bssap.c M src/osmo-bsc/osmo_bsc_main.c M src/osmo-bsc/osmo_bsc_msc.c A src/osmo-bsc/osmo_bsc_reset.c D src/osmo-bsc/osmo_bsc_sccp.c A src/osmo-bsc/osmo_bsc_sigtran.c M src/osmo-bsc/osmo_bsc_vty.c M src/osmo-bsc_mgcp/Makefile.am M src/osmo-bsc_nat/Makefile.am M src/osmo-msc/msc_main.c M tests/msc_vlr/Makefile.am M tests/msc_vlr/msc_vlr_test_gsm_authen.c M tests/msc_vlr/msc_vlr_test_gsm_authen.err M tests/msc_vlr/msc_vlr_test_gsm_ciph.c M tests/msc_vlr/msc_vlr_test_gsm_ciph.err M tests/msc_vlr/msc_vlr_test_hlr_reject.c M tests/msc_vlr/msc_vlr_test_hlr_reject.err M tests/msc_vlr/msc_vlr_test_hlr_timeout.c M tests/msc_vlr/msc_vlr_test_hlr_timeout.err M tests/msc_vlr/msc_vlr_test_ms_timeout.c M tests/msc_vlr/msc_vlr_test_ms_timeout.err M tests/msc_vlr/msc_vlr_test_no_authen.c M tests/msc_vlr/msc_vlr_test_no_authen.err M tests/msc_vlr/msc_vlr_test_reject_concurrency.c M tests/msc_vlr/msc_vlr_test_reject_concurrency.err M tests/msc_vlr/msc_vlr_test_rest.c M tests/msc_vlr/msc_vlr_test_rest.err M tests/msc_vlr/msc_vlr_test_umts_authen.c M tests/msc_vlr/msc_vlr_test_umts_authen.err M tests/msc_vlr/msc_vlr_tests.c M tests/msc_vlr/msc_vlr_tests.h 80 files changed, 4,486 insertions(+), 714 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/86/3486/5 -- To view, visit https://gerrit.osmocom.org/3486 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I5ae4e05ee7c57cad341ea5e86af37c1f6b0ffa77 Gerrit-PatchSet: 5 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: dexter From gerrit-no-reply at lists.osmocom.org Sun Aug 27 01:26:53 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sun, 27 Aug 2017 01:26:53 +0000 Subject: [PATCH] osmo-msc[master]: move libiu to osmo-iuh/libosmo-ranap 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/3489 to look at the new patch set (#4). move libiu to osmo-iuh/libosmo-ranap Remove libiu here, use the functions from libosmo-ranap instead, by applying the ranap_ / RANAP_ prefix. Corresponding change-id in osmo-iuh.git is I6a3f7ad15be03fb94689b4af6ccfa828c25f45c0 To be able to run the msc_vlr tests for RAN_UTRAN_IU without Iu client headers available, add iu_dummy.h, containing mere function signatures that match iu_dummy.c. Change-Id: Ib8c4fcdb4766c5e575618b95ce16dce51063206b --- M configure.ac M include/openbsc/Makefile.am M include/openbsc/gprs_sgsn.h M include/openbsc/gsm_data.h D include/openbsc/iu.h A include/openbsc/iu_dummy.h M include/openbsc/iucs.h M include/openbsc/iucs_ranap.h M include/openbsc/sgsn.h M src/Makefile.am M src/gprs/Makefile.am M src/gprs/gprs_gmm.c M src/gprs/gprs_sgsn.c M src/gprs/sgsn_libgtp.c M src/gprs/sgsn_main.c M src/gprs/sgsn_vty.c D src/libiu/Makefile.am D src/libiu/iu.c D src/libiu/iu_vty.c M src/libmsc/Makefile.am M src/libmsc/a_iface_bssap.c M src/libmsc/gsm_04_08.c M src/libmsc/gsm_subscriber.c M src/libmsc/iu_dummy.c M src/libmsc/iucs.c M src/libmsc/iucs_ranap.c M src/libmsc/msc_ifaces.c M src/libmsc/msc_vty.c M src/libmsc/osmo_msc.c M src/libmsc/subscr_conn.c M src/osmo-msc/Makefile.am M src/osmo-msc/msc_main.c M tests/msc_vlr/Makefile.am M tests/msc_vlr/msc_vlr_tests.c M tests/sgsn/Makefile.am M tests/sms_queue/Makefile.am 36 files changed, 191 insertions(+), 1,150 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/89/3489/4 diff --git a/configure.ac b/configure.ac index 87800fc..7045132 100644 --- a/configure.ac +++ b/configure.ac @@ -229,7 +229,6 @@ src/libmgcp/Makefile src/libcommon/Makefile src/libfilter/Makefile - src/libiu/Makefile src/libcommon-cs/Makefile src/osmo-msc/Makefile src/osmo-bsc/Makefile diff --git a/include/openbsc/Makefile.am b/include/openbsc/Makefile.am index 25709f1..89e0338 100644 --- a/include/openbsc/Makefile.am +++ b/include/openbsc/Makefile.am @@ -49,9 +49,9 @@ handover.h \ handover_decision.h \ ipaccess.h \ - iu.h \ iucs.h \ iucs_ranap.h \ + iu_dummy.h \ meas_feed.h \ meas_rep.h \ mgcp.h \ diff --git a/include/openbsc/gprs_sgsn.h b/include/openbsc/gprs_sgsn.h index 4e49c08..57995e0 100644 --- a/include/openbsc/gprs_sgsn.h +++ b/include/openbsc/gprs_sgsn.h @@ -117,7 +117,7 @@ uint16_t pdp_status; }; -struct ue_conn_ctx; +struct ranap_ue_conn_ctx; /* According to TS 03.60, Table 5: SGSN MM and PDP Contexts */ /* Extended by 3GPP TS 23.060, Table 6: SGSN MM and PDP Contexts */ @@ -159,7 +159,7 @@ /* CSG Subscription Data */ /* LIPA Allowed */ /* Voice Support Match Indicator */ - struct ue_conn_ctx *ue_ctx; + struct ranap_ue_conn_ctx *ue_ctx; struct service_info service; } iu; /* VLR number */ diff --git a/include/openbsc/gsm_data.h b/include/openbsc/gsm_data.h index 43fc6d3..6079900 100644 --- a/include/openbsc/gsm_data.h +++ b/include/openbsc/gsm_data.h @@ -30,7 +30,7 @@ struct bsc_subscr; struct vlr_instance; struct vlr_subscr; -struct ue_conn_ctx; +struct ranap_ue_conn_ctx; #define OBSC_LINKID_CB(__msgb) (__msgb)->cb[3] @@ -203,7 +203,7 @@ /* which Iu-CS connection, if any. */ struct { - struct ue_conn_ctx *ue_ctx; + struct ranap_ue_conn_ctx *ue_ctx; uint8_t rab_id; } iu; @@ -493,7 +493,7 @@ struct { /* CS7 instance id number (set via VTY) */ uint32_t cs7_instance; - enum nsap_addr_enc rab_assign_addr_enc; + int rab_assign_addr_enc; struct osmo_sccp_instance *sccp; } iu; diff --git a/include/openbsc/iu.h b/include/openbsc/iu.h deleted file mode 100644 index 08e4cd0..0000000 --- a/include/openbsc/iu.h +++ /dev/null @@ -1,77 +0,0 @@ -#pragma once - -#include -#include - -#include -#include -#include - -#include - -struct sgsn_pdp_ctx; -struct msgb; -struct gsm_auth_tuple; -struct osmo_sccp_addr; -struct osmo_ss7_instance; - -struct RANAP_RAB_SetupOrModifiedItemIEs_s; -struct RANAP_GlobalRNC_ID; -struct RANAP_Cause; - -/* Debugging switches from asn1c and osmo-iuh */ -extern int asn_debug; -extern int asn1_xer_print; - -struct ue_conn_ctx { - struct llist_head list; - /* TODO: It's not needed to store the full SCCP address for each - * UE. Rather than that, a pointer to the RNC should be far - * sufficient */ - struct osmo_sccp_addr sccp_addr; - uint32_t conn_id; - int integrity_active; - struct gprs_ra_id ra_id; - enum nsap_addr_enc rab_assign_addr_enc; -}; - -enum iu_event_type { - IU_EVENT_RAB_ASSIGN, - IU_EVENT_SECURITY_MODE_COMPLETE, - IU_EVENT_IU_RELEASE, /* An actual Iu Release message was received */ - IU_EVENT_LINK_INVALIDATED, /* A SUA link was lost or closed down */ -}; - -extern const struct value_string iu_event_type_names[]; -static inline const char *iu_event_type_str(enum iu_event_type e) -{ - return get_value_string(iu_event_type_names, e); -} - -/* Implementations of iu_recv_cb_t shall find the ue_conn_ctx in msg->dst. */ -typedef int (* iu_recv_cb_t )(struct msgb *msg, struct gprs_ra_id *ra_id, - uint16_t *sai); - -typedef int (* iu_event_cb_t )(struct ue_conn_ctx *ue_ctx, - enum iu_event_type type, void *data); - -typedef int (* iu_rab_ass_resp_cb_t )(struct ue_conn_ctx *ue_ctx, uint8_t rab_id, - struct RANAP_RAB_SetupOrModifiedItemIEs_s *setup_ies); - -int iu_init(void *ctx, struct osmo_sccp_instance *sccp, - iu_recv_cb_t iu_recv_cb, iu_event_cb_t iu_event_cb); - -int iu_tx(struct msgb *msg, uint8_t sapi); - -int iu_page_cs(const char *imsi, const uint32_t *tmsi, uint16_t lac); -int iu_page_ps(const char *imsi, const uint32_t *ptmsi, uint16_t lac, uint8_t rac); - -int iu_rab_act(struct ue_conn_ctx *ue_ctx, struct msgb *msg); -int iu_rab_deact(struct ue_conn_ctx *ue_ctx, uint8_t rab_id); -int iu_tx_sec_mode_cmd(struct ue_conn_ctx *uectx, struct gsm_auth_tuple *tp, - int send_ck, int new_key); -int iu_tx_common_id(struct ue_conn_ctx *ue_ctx, const char *imsi); -int iu_tx_release(struct ue_conn_ctx *ctx, const struct RANAP_Cause *cause); - -void iu_vty_init(int iu_parent_node, enum nsap_addr_enc *rab_assign_addr_enc); -int iu_vty_config_write(struct vty *vty, const char *indent); diff --git a/include/openbsc/iu_dummy.h b/include/openbsc/iu_dummy.h new file mode 100644 index 0000000..ccb2099 --- /dev/null +++ b/include/openbsc/iu_dummy.h @@ -0,0 +1,45 @@ +/* Trivial switch-off of external Iu dependencies, + * allowing to run full unit tests even when built without Iu support. */ + +/* + * (C) 2016,2017 by sysmocom s.f.m.c. GmbH + * + * Author: Neels Hofmeyr + * + * All Rights Reserved + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + * + */ + +#include +#include + +struct msgb; +struct ranap_ue_conn_ctx; +struct gsm_auth_tuple; +struct RANAP_Cause; +struct osmo_auth_vector; + +int ranap_iu_tx(struct msgb *msg, uint8_t sapi); +int ranap_iu_tx_sec_mode_cmd(struct ranap_ue_conn_ctx *uectx, struct osmo_auth_vector *vec, + int send_ck); +int ranap_iu_page_cs(const char *imsi, const uint32_t *tmsi, uint16_t lac); +int ranap_iu_page_ps(const char *imsi, const uint32_t *ptmsi, uint16_t lac, uint8_t rac); +struct msgb *ranap_new_msg_rab_assign_voice(uint8_t rab_id, uint32_t rtp_ip, + uint16_t rtp_port, + bool use_x213_nsap); +int ranap_iu_rab_act(struct ranap_ue_conn_ctx *ue_ctx, struct msgb *msg); +int ranap_iu_tx_common_id(struct ranap_ue_conn_ctx *uectx, const char *imsi); +int ranap_iu_tx_release(struct ranap_ue_conn_ctx *ctx, const struct RANAP_Cause *cause); diff --git a/include/openbsc/iucs.h b/include/openbsc/iucs.h index fb61a5c..b7d6064 100644 --- a/include/openbsc/iucs.h +++ b/include/openbsc/iucs.h @@ -4,4 +4,4 @@ uint16_t *lac); struct gsm_subscriber_connection *subscr_conn_lookup_iu(struct gsm_network *network, - struct ue_conn_ctx *ue); + struct ranap_ue_conn_ctx *ue); diff --git a/include/openbsc/iucs_ranap.h b/include/openbsc/iucs_ranap.h index 748de23..c2ff5f9 100644 --- a/include/openbsc/iucs_ranap.h +++ b/include/openbsc/iucs_ranap.h @@ -1,7 +1,7 @@ #pragma once struct gsm_network; -struct ue_conn_ctx; +struct ranap_ue_conn_ctx; int iucs_rx_ranap_event(struct gsm_network *network, - struct ue_conn_ctx *ue_ctx, int type, void *data); + struct ranap_ue_conn_ctx *ue_ctx, int type, void *data); diff --git a/include/openbsc/sgsn.h b/include/openbsc/sgsn.h index 57b2978..f371dc6 100644 --- a/include/openbsc/sgsn.h +++ b/include/openbsc/sgsn.h @@ -112,7 +112,7 @@ } dcomp_v42bis; struct { - enum nsap_addr_enc rab_assign_addr_enc; + int rab_assign_addr_enc; } iu; }; diff --git a/src/Makefile.am b/src/Makefile.am index 7e9e1dc..bd69738 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -31,13 +31,6 @@ libcommon-cs \ $(NULL) -# Conditional Libraries -if BUILD_IU -SUBDIRS += \ - libiu \ - $(NULL) -endif - # Programs SUBDIRS += \ osmo-msc \ diff --git a/src/gprs/Makefile.am b/src/gprs/Makefile.am index e05eb79..39a4c12 100644 --- a/src/gprs/Makefile.am +++ b/src/gprs/Makefile.am @@ -106,7 +106,6 @@ $(NULL) if BUILD_IU osmo_sgsn_LDADD += \ - $(top_builddir)/src/libiu/libiu.a \ $(LIBOSMOSIGTRAN_LIBS) \ $(LIBOSMORANAP_LIBS) \ $(LIBASN1C_LIBS) \ diff --git a/src/gprs/gprs_gmm.c b/src/gprs/gprs_gmm.c index 15e2fed..032137f 100644 --- a/src/gprs/gprs_gmm.c +++ b/src/gprs/gprs_gmm.c @@ -52,6 +52,7 @@ #ifdef BUILD_IU #include #include +#include #endif #include @@ -67,7 +68,6 @@ #include #include #include -#include #include #include @@ -174,7 +174,7 @@ #ifdef BUILD_IU int sgsn_ranap_rab_ass_resp(struct sgsn_mm_ctx *ctx, RANAP_RAB_SetupOrModifiedItemIEs_t *setup_ies); -int sgsn_ranap_iu_event(struct ue_conn_ctx *ctx, enum iu_event_type type, void *data) +int sgsn_ranap_iu_event(struct ranap_ue_conn_ctx *ctx, enum ranap_iu_event_type type, void *data) { struct sgsn_mm_ctx *mm; int rc = -1; @@ -188,14 +188,14 @@ } switch (type) { - case IU_EVENT_RAB_ASSIGN: + case RANAP_IU_EVENT_RAB_ASSIGN: REQUIRE_MM rc = sgsn_ranap_rab_ass_resp(mm, (RANAP_RAB_SetupOrModifiedItemIEs_t *)data); break; - case IU_EVENT_IU_RELEASE: + case RANAP_IU_EVENT_IU_RELEASE: /* fall thru */ - case IU_EVENT_LINK_INVALIDATED: - /* Clean up ue_conn_ctx here */ + case RANAP_IU_EVENT_LINK_INVALIDATED: + /* Clean up ranap_ue_conn_ctx here */ if (mm) LOGMMCTXP(LOGL_INFO, mm, "IU release for imsi %s\n", mm->imsi); else @@ -205,7 +205,7 @@ mmctx_set_pmm_state(mm, PMM_IDLE); rc = 0; break; - case IU_EVENT_SECURITY_MODE_COMPLETE: + case RANAP_IU_EVENT_SECURITY_MODE_COMPLETE: REQUIRE_MM /* Continue authentication here */ mm->iu.ue_ctx->integrity_active = 1; @@ -262,16 +262,16 @@ rate_ctr_inc(&mm->ctrg->ctr[GMM_CTR_PKTS_SIG_OUT]); #ifdef BUILD_IU if (mm->ran_type == MM_CTX_T_UTRAN_Iu) - return iu_tx(msg, GPRS_SAPI_GMM); + return ranap_iu_tx(msg, GPRS_SAPI_GMM); #endif } #ifdef BUILD_IU - /* In Iu mode, msg->dst contains the ue_conn_ctx pointer, in Gb mode + /* In Iu mode, msg->dst contains the ranap_ue_conn_ctx pointer, in Gb mode * dst is empty. */ /* FIXME: have a more explicit indicator for Iu messages */ if (msg->dst) - return iu_tx(msg, GPRS_SAPI_GMM); + return ranap_iu_tx(msg, GPRS_SAPI_GMM); #endif /* caller needs to provide TLLI, BVCI and NSEI */ @@ -296,9 +296,12 @@ /* In case a Iu connection is reconnected we need to update the ue ctx */ mm->iu.ue_ctx = msg->dst; if (mm->ran_type == MM_CTX_T_UTRAN_Iu - && mm->iu.ue_ctx) + && mm->iu.ue_ctx) { +#ifdef BUILD_IU mm->iu.ue_ctx->rab_assign_addr_enc = sgsn->cfg.iu.rab_assign_addr_enc; +#endif + } } /* Store BVCI/NSEI in MM context */ @@ -1048,7 +1051,7 @@ /* The MS is authorized */ #ifdef BUILD_IU if (ctx->ran_type == MM_CTX_T_UTRAN_Iu && !ctx->iu.ue_ctx->integrity_active) { - rc = iu_tx_sec_mode_cmd(ctx->iu.ue_ctx, &ctx->auth_triplet, 0, ctx->iu.new_key); + rc = ranap_iu_tx_sec_mode_cmd(ctx->iu.ue_ctx, &ctx->auth_triplet.vec, 0, ctx->iu.new_key); ctx->iu.new_key = 0; return rc; } @@ -1259,14 +1262,20 @@ * with a foreign TLLI (P-TMSI that was allocated to the MS before), * or with random TLLI. */ - /* In Iu mode, msg->dst contains the ue_conn_ctx pointer, in Gb mode + /* In Iu mode, msg->dst contains the ranap_ue_conn_ctx pointer, in Gb mode * dst is empty. */ /* FIXME: have a more explicit indicator for Iu messages */ if (!msg->dst) { /* Gb mode */ cid = bssgp_parse_cell_id(&ra_id, msgb_bcid(msg)); - } else - ra_id = ((struct ue_conn_ctx*)msg->dst)->ra_id; + } else { +#ifdef BUILD_IU + ra_id = ((struct ranap_ue_conn_ctx*)msg->dst)->ra_id; +#else + LOGMMCTXP(LOGL_ERROR, ctx, "Cannot handle Iu Attach Request, built without Iu support\n"); + return -ENOTSUP; +#endif + } /* MS network capability 10.5.5.12 */ msnc_len = *cur++; @@ -1627,7 +1636,7 @@ * is an optimization to avoid the RA reject (impl detached) * below, which will cause a new attach cycle. */ /* Look-up the MM context based on old RA-ID and TLLI */ - /* In Iu mode, msg->dst contains the ue_conn_ctx pointer, in Gb + /* In Iu mode, msg->dst contains the ranap_ue_conn_ctx pointer, in Gb * mode dst is empty. */ /* FIXME: have a more explicit indicator for Iu messages */ if (!msg->dst) { @@ -2905,12 +2914,12 @@ { struct msgb *msg; struct sgsn_mm_ctx *mm = pdp->mm; - struct ue_conn_ctx *uectx; + struct ranap_ue_conn_ctx *uectx; uint32_t ggsn_ip; bool use_x213_nsap; uectx = mm->iu.ue_ctx; - use_x213_nsap = (uectx->rab_assign_addr_enc == NSAP_ADDR_ENC_X213); + use_x213_nsap = (uectx->rab_assign_addr_enc == RANAP_NSAP_ADDR_ENC_X213); /* Get the IP address for ggsn user plane */ memcpy(&ggsn_ip, pdp->lib->gsnru.v, pdp->lib->gsnru.l); @@ -2923,6 +2932,6 @@ msg = ranap_new_msg_rab_assign_data(rab_id, ggsn_ip, pdp->lib->teid_gn, use_x213_nsap); msg->l2h = msg->data; - return iu_rab_act(uectx, msg); + return ranap_iu_rab_act(uectx, msg); } #endif diff --git a/src/gprs/gprs_sgsn.c b/src/gprs/gprs_sgsn.c index 43eeaaa..e893a5c 100644 --- a/src/gprs/gprs_sgsn.c +++ b/src/gprs/gprs_sgsn.c @@ -31,6 +31,7 @@ #include #include #include +#include #include #include @@ -40,7 +41,6 @@ #include #include #include "openbsc/gprs_llc.h" -#include #include diff --git a/src/gprs/sgsn_libgtp.c b/src/gprs/sgsn_libgtp.c index 7ff8ece..90b4d16 100644 --- a/src/gprs/sgsn_libgtp.c +++ b/src/gprs/sgsn_libgtp.c @@ -52,7 +52,7 @@ #include #ifdef BUILD_IU -#include +#include #include #endif @@ -548,7 +548,7 @@ } else { #ifdef BUILD_IU /* Deactivate radio bearer */ - iu_rab_deact(pctx->mm->iu.ue_ctx, 1); + ranap_iu_rab_deact(pctx->mm->iu.ue_ctx, 1); #else return -ENOTSUP; #endif @@ -687,7 +687,7 @@ #ifdef BUILD_IU /* Ignore the packet for now and page the UE to get the RAB * reestablished */ - iu_page_ps(mm->imsi, &mm->p_tmsi, mm->ra.lac, mm->ra.rac); + ranap_iu_page_ps(mm->imsi, &mm->p_tmsi, mm->ra.lac, mm->ra.rac); return 0; #else diff --git a/src/gprs/sgsn_main.c b/src/gprs/sgsn_main.c index d56af0e..f07642d 100644 --- a/src/gprs/sgsn_main.c +++ b/src/gprs/sgsn_main.c @@ -52,13 +52,14 @@ #include +#include + #include #include #include #include #include #include -#include #include #include @@ -322,7 +323,7 @@ .num_cat = ARRAY_SIZE(gprs_categories), }; -int sgsn_ranap_iu_event(struct ue_conn_ctx *ctx, enum iu_event_type type, void *data); +int sgsn_ranap_iu_event(struct ue_conn_ctx *ctx, enum ranap_iu_event_type type, void *data); int main(int argc, char **argv) { @@ -451,7 +452,7 @@ return 8; } - iu_init(tall_bsc_ctx, sccp, gsm0408_gprs_rcvmsg_iu, sgsn_ranap_iu_event); + ranap_iu_init(tall_bsc_ctx, DRANAP, "OsmoSGSN-IuPS", sccp, gsm0408_gprs_rcvmsg_iu, sgsn_ranap_iu_event); #endif if (daemonize) { diff --git a/src/gprs/sgsn_vty.c b/src/gprs/sgsn_vty.c index cf44cc4..3a5b2ca 100644 --- a/src/gprs/sgsn_vty.c +++ b/src/gprs/sgsn_vty.c @@ -48,7 +48,7 @@ #include "../../bscconfig.h" #ifdef BUILD_IU -#include +#include #endif static struct sgsn_config *g_cfg = NULL; @@ -291,7 +291,7 @@ vty_out(vty, " no compression v42bis%s", VTY_NEWLINE); #ifdef BUILD_IU - iu_vty_config_write(vty, " "); + ranap_iu_vty_config_write(vty, " "); #endif return CMD_SUCCESS; @@ -1285,7 +1285,7 @@ install_element(SGSN_NODE, &cfg_comp_v42bisp_cmd); #ifdef BUILD_IU - iu_vty_init(SGSN_NODE, &g_cfg->iu.rab_assign_addr_enc); + ranap_iu_vty_init(SGSN_NODE, &g_cfg->iu.rab_assign_addr_enc); #endif return 0; } diff --git a/src/libiu/Makefile.am b/src/libiu/Makefile.am deleted file mode 100644 index e5f9e27..0000000 --- a/src/libiu/Makefile.am +++ /dev/null @@ -1,28 +0,0 @@ -AM_CPPFLAGS = \ - $(all_includes) \ - -I$(top_srcdir)/include \ - -I$(top_builddir) \ - $(NULL) - -AM_CFLAGS = \ - -Wall \ - $(COVERAGE_CFLAGS) \ - $(LIBCRYPTO_CFLAGS) \ - $(LIBASN1C_CFLAGS) \ - $(LIBOSMOCORE_CFLAGS) \ - $(LIBOSMOVTY_CFLAGS) \ - $(LIBOSMOGSM_CFLAGS) \ - $(LIBOSMOABIS_CFLAGS) \ - $(LIBOSMOSIGTRAN_CFLAGS) \ - $(LIBOSMORANAP_CFLAGS) \ - $(NULL) - -noinst_LIBRARIES = \ - libiu.a \ - $(NULL) - -libiu_a_SOURCES = \ - iu.c \ - iu_vty.c \ - $(NULL) - diff --git a/src/libiu/iu.c b/src/libiu/iu.c deleted file mode 100644 index 7794977..0000000 --- a/src/libiu/iu.c +++ /dev/null @@ -1,771 +0,0 @@ -/* Common parts of IuCS and IuPS interfaces implementation */ - -/* (C) 2016 by sysmocom s.f.m.c. GmbH - * All Rights Reserved - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - * - */ - -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include - -#include -#include - -#include -#include -#include -#include - -#include -#include -#include - -#include - -#include -#include -#include -#include - -#include - -/* Parsed global RNC id. See also struct RANAP_GlobalRNC_ID, and note that the - * PLMN identity is a BCD representation of the MCC and MNC. - * See iu_grnc_id_parse(). */ -struct iu_grnc_id { - uint16_t mcc; - uint16_t mnc; - uint16_t rnc_id; -}; - -/* A remote RNC (Radio Network Controller, like BSC but for UMTS) that has - * called us and is currently reachable at the given osmo_sccp_addr. So, when we - * know a LAC for a subscriber, we can page it at the RNC matching that LAC or - * RAC. An HNB-GW typically presents itself as if it were a single RNC, even - * though it may have several RNCs in hNodeBs connected to it. Those will then - * share the same RNC id, which they actually receive and adopt from the HNB-GW - * in the HNBAP HNB REGISTER ACCEPT message. */ -struct iu_rnc { - struct llist_head entry; - - uint16_t rnc_id; - uint16_t lac; /* Location Area Code (used for CS and PS) */ - uint8_t rac; /* Routing Area Code (used for PS only) */ - struct osmo_sccp_addr sccp_addr; -}; - -void *talloc_iu_ctx; - -/* Implement the extern asn_debug from libasn1c to indicate whether to print - * asn.1 debug messages (see libasn1c). */ -int asn_debug = 0; - -/* Implement the extern asn1_xer_print to indicate whether the ASN.1 binary - * code decoded and encoded during Iu communication should be logged to stderr - * (see asn.1 generated code in osmo-iuh). */ -int asn1_xer_print = 0; - -void *talloc_asn1_ctx; - -iu_recv_cb_t global_iu_recv_cb = NULL; -iu_event_cb_t global_iu_event_cb = NULL; - -static LLIST_HEAD(ue_conn_ctx_list); -static LLIST_HEAD(rnc_list); - -static struct osmo_sccp_instance *g_sccp; -static struct osmo_sccp_user *g_scu; - -const struct value_string iu_event_type_names[] = { - OSMO_VALUE_STRING(IU_EVENT_RAB_ASSIGN), - OSMO_VALUE_STRING(IU_EVENT_SECURITY_MODE_COMPLETE), - OSMO_VALUE_STRING(IU_EVENT_IU_RELEASE), - OSMO_VALUE_STRING(IU_EVENT_LINK_INVALIDATED), - { 0, NULL } -}; - -struct ue_conn_ctx *ue_conn_ctx_alloc(struct osmo_sccp_addr *addr, uint32_t conn_id) -{ - struct ue_conn_ctx *ctx = talloc_zero(talloc_iu_ctx, struct ue_conn_ctx); - - ctx->sccp_addr = *addr; - ctx->conn_id = conn_id; - llist_add(&ctx->list, &ue_conn_ctx_list); - - return ctx; -} - -struct ue_conn_ctx *ue_conn_ctx_find(uint32_t conn_id) -{ - struct ue_conn_ctx *ctx; - - llist_for_each_entry(ctx, &ue_conn_ctx_list, list) { - if (ctx->conn_id == conn_id) - return ctx; - } - return NULL; -} - -static struct iu_rnc *iu_rnc_alloc(uint16_t rnc_id, uint16_t lac, uint8_t rac, - struct osmo_sccp_addr *addr) -{ - struct iu_rnc *rnc = talloc_zero(talloc_iu_ctx, struct iu_rnc); - - rnc->rnc_id = rnc_id; - rnc->lac = lac; - rnc->rac = rac; - rnc->sccp_addr = *addr; - llist_add(&rnc->entry, &rnc_list); - - LOGP(DRANAP, LOGL_NOTICE, "New RNC %d (LAC=%d RAC=%d)\n", - rnc->rnc_id, rnc->lac, rnc->rac); - - return rnc; -} - -static struct iu_rnc *iu_rnc_register(uint16_t rnc_id, uint16_t lac, - uint8_t rac, struct osmo_sccp_addr *addr) -{ - struct iu_rnc *rnc; - llist_for_each_entry(rnc, &rnc_list, entry) { - if (rnc->rnc_id != rnc_id) - continue; - - /* We have this RNC Id registered already. Make sure that the - * details match. */ - - /* TODO should a mismatch be an error? */ - if (rnc->lac != lac || rnc->rac != rac) - LOGP(DRANAP, LOGL_NOTICE, "RNC %d changes its details:" - " LAC=%d RAC=%d --> LAC=%d RAC=%d\n", - rnc->rnc_id, rnc->lac, rnc->rac, - lac, rac); - rnc->lac = lac; - rnc->rac = rac; - - if (addr && memcmp(&rnc->sccp_addr, addr, sizeof(*addr))) - LOGP(DRANAP, LOGL_NOTICE, "RNC %d on New SCCP Addr %s" - " (LAC=%d RAC=%d)\n", - rnc->rnc_id, osmo_sccp_addr_dump(addr), rnc->lac, rnc->rac); - rnc->sccp_addr = *addr; - return rnc; - } - - /* Not found, make a new one. */ - return iu_rnc_alloc(rnc_id, lac, rac, addr); -} - -/*********************************************************************** - * RANAP handling - ***********************************************************************/ - -int iu_rab_act(struct ue_conn_ctx *ue_ctx, struct msgb *msg) -{ - struct osmo_scu_prim *prim; - - /* wrap RANAP message in SCCP N-DATA.req */ - prim = (struct osmo_scu_prim *) msgb_push(msg, sizeof(*prim)); - prim->u.data.conn_id = ue_ctx->conn_id; - osmo_prim_init(&prim->oph, - SCCP_SAP_USER, - OSMO_SCU_PRIM_N_DATA, - PRIM_OP_REQUEST, - msg); - return osmo_sccp_user_sap_down(g_scu, &prim->oph); -} - -int iu_rab_deact(struct ue_conn_ctx *ue_ctx, uint8_t rab_id) -{ - /* FIXME */ - return -1; -} - -int iu_tx_sec_mode_cmd(struct ue_conn_ctx *uectx, struct gsm_auth_tuple *tp, - int send_ck, int new_key) -{ - struct osmo_scu_prim *prim; - struct msgb *msg; - - /* create RANAP message */ - msg = ranap_new_msg_sec_mod_cmd(tp->vec.ik, send_ck? tp->vec.ck : NULL, - new_key ? RANAP_KeyStatus_new : RANAP_KeyStatus_old); - msg->l2h = msg->data; - /* wrap RANAP message in SCCP N-DATA.req */ - prim = (struct osmo_scu_prim *) msgb_push(msg, sizeof(*prim)); - prim->u.data.conn_id = uectx->conn_id; - osmo_prim_init(&prim->oph, SCCP_SAP_USER, - OSMO_SCU_PRIM_N_DATA, - PRIM_OP_REQUEST, msg); - osmo_sccp_user_sap_down(g_scu, &prim->oph); - - return 0; -} - -int iu_tx_common_id(struct ue_conn_ctx *uectx, const char *imsi) -{ - struct msgb *msg; - struct osmo_scu_prim *prim; - - LOGP(DRANAP, LOGL_INFO, "Transmitting RANAP CommonID (SCCP conn_id %u)\n", - uectx->conn_id); - - msg = ranap_new_msg_common_id(imsi); - msg->l2h = msg->data; - prim = (struct osmo_scu_prim *) msgb_push(msg, sizeof(*prim)); - prim->u.data.conn_id = uectx->conn_id; - osmo_prim_init(&prim->oph, SCCP_SAP_USER, - OSMO_SCU_PRIM_N_DATA, - PRIM_OP_REQUEST, msg); - osmo_sccp_user_sap_down(g_scu, &prim->oph); - return 0; -} - -static int iu_grnc_id_parse(struct iu_grnc_id *dst, - struct RANAP_GlobalRNC_ID *src) -{ - /* The size is coming from arbitrary sender, check it gracefully */ - if (src->pLMNidentity.size != 3) { - LOGP(DRANAP, LOGL_ERROR, "Invalid PLMN Identity size:" - " should be 3, is %d\n", src->pLMNidentity.size); - return -1; - } - gsm48_mcc_mnc_from_bcd(&src->pLMNidentity.buf[0], - &dst->mcc, &dst->mnc); - dst->rnc_id = (uint16_t)src->rNC_ID; - return 0; -} - -#if 0 - -- not used at present -- -static int iu_grnc_id_compose(struct iu_grnc_id *src, - struct RANAP_GlobalRNC_ID *dst) -{ - /* The caller must ensure proper size */ - OSMO_ASSERT(dst->pLMNidentity.size == 3); - gsm48_mcc_mnc_to_bcd(&dst->pLMNidentity.buf[0], - src->mcc, src->mnc); - dst->rNC_ID = src->rnc_id; - return 0; -} -#endif - -static int ranap_handle_co_initial_ue(void *ctx, RANAP_InitialUE_MessageIEs_t *ies) -{ - struct ue_conn_ctx *ue_conn = ctx; - struct gprs_ra_id ra_id; - struct iu_grnc_id grnc_id; - uint16_t sai; - struct msgb *msg = msgb_alloc(256, "RANAP->NAS"); - - if (ranap_parse_lai(&ra_id, &ies->lai) != 0) { - LOGP(DRANAP, LOGL_ERROR, "Failed to parse RANAP LAI IE\n"); - return -1; - } - - if (ies->presenceMask & INITIALUE_MESSAGEIES_RANAP_RAC_PRESENT) { - ra_id.rac = asn1str_to_u8(&ies->rac); - } - - if (iu_grnc_id_parse(&grnc_id, &ies->globalRNC_ID) != 0) { - LOGP(DRANAP, LOGL_ERROR, - "Failed to parse RANAP Global-RNC-ID IE\n"); - return -1; - } - - sai = asn1str_to_u16(&ies->sai.sAC); - msgb_gmmh(msg) = msgb_put(msg, ies->nas_pdu.size); - memcpy(msgb_gmmh(msg), ies->nas_pdu.buf, ies->nas_pdu.size); - - /* Make sure we know the RNC Id and LAC+RAC coming in on this connection. */ - iu_rnc_register(grnc_id.rnc_id, ra_id.lac, ra_id.rac, &ue_conn->sccp_addr); - ue_conn->ra_id = ra_id; - - /* Feed into the MM layer */ - msg->dst = ctx; - global_iu_recv_cb(msg, &ra_id, &sai); - - msgb_free(msg); - - return 0; -} - -static int ranap_handle_co_dt(void *ctx, RANAP_DirectTransferIEs_t *ies) -{ - struct gprs_ra_id _ra_id, *ra_id = NULL; - uint16_t _sai, *sai = NULL; - struct msgb *msg = msgb_alloc(256, "RANAP->NAS"); - - if (ies->presenceMask & DIRECTTRANSFERIES_RANAP_LAI_PRESENT) { - if (ranap_parse_lai(&_ra_id, &ies->lai) != 0) { - LOGP(DRANAP, LOGL_ERROR, "Failed to parse RANAP LAI IE\n"); - return -1; - } - ra_id = &_ra_id; - if (ies->presenceMask & DIRECTTRANSFERIES_RANAP_RAC_PRESENT) { - _ra_id.rac = asn1str_to_u8(&ies->rac); - } - if (ies->presenceMask & DIRECTTRANSFERIES_RANAP_SAI_PRESENT) { - _sai = asn1str_to_u16(&ies->sai.sAC); - sai = &_sai; - } - } - - msgb_gmmh(msg) = msgb_put(msg, ies->nas_pdu.size); - memcpy(msgb_gmmh(msg), ies->nas_pdu.buf, ies->nas_pdu.size); - - /* Feed into the MM/CC/SMS-CP layer */ - msg->dst = ctx; - global_iu_recv_cb(msg, ra_id, sai); - - msgb_free(msg); - - return 0; -} - -static int ranap_handle_co_err_ind(void *ctx, RANAP_ErrorIndicationIEs_t *ies) -{ - if (ies->presenceMask & ERRORINDICATIONIES_RANAP_CAUSE_PRESENT) - LOGP(DRANAP, LOGL_ERROR, "Rx Error Indication (%s)\n", - ranap_cause_str(&ies->cause)); - else - LOGP(DRANAP, LOGL_ERROR, "Rx Error Indication\n"); - - return 0; -} - -int iu_tx(struct msgb *msg_nas, uint8_t sapi) -{ - struct ue_conn_ctx *uectx = msg_nas->dst; - struct msgb *msg; - struct osmo_scu_prim *prim; - - LOGP(DRANAP, LOGL_INFO, "Transmitting L3 Message as RANAP DT (SCCP conn_id %u)\n", - uectx->conn_id); - - msg = ranap_new_msg_dt(sapi, msg_nas->data, msgb_length(msg_nas)); - msgb_free(msg_nas); - msg->l2h = msg->data; - prim = (struct osmo_scu_prim *) msgb_push(msg, sizeof(*prim)); - prim->u.data.conn_id = uectx->conn_id; - osmo_prim_init(&prim->oph, SCCP_SAP_USER, - OSMO_SCU_PRIM_N_DATA, - PRIM_OP_REQUEST, msg); - osmo_sccp_user_sap_down(g_scu, &prim->oph); - return 0; -} - -/* Send Iu Release for the given UE connection. - * If cause is NULL, the standard "No remaining RAB" cause is sent, otherwise - * the provided cause. */ -int iu_tx_release(struct ue_conn_ctx *ctx, const struct RANAP_Cause *cause) -{ - struct msgb *msg; - struct osmo_scu_prim *prim; - static const struct RANAP_Cause default_cause = { - .present = RANAP_Cause_PR_radioNetwork, - .choice.radioNetwork = RANAP_CauseRadioNetwork_no_remaining_rab, - }; - - if (!cause) - cause = &default_cause; - - LOGP(DRANAP, LOGL_INFO, "Transmitting Iu Release (SCCP conn_id %u)\n", - ctx->conn_id); - - msg = ranap_new_msg_iu_rel_cmd(cause); - msg->l2h = msg->data; - prim = (struct osmo_scu_prim *) msgb_push(msg, sizeof(*prim)); - prim->u.data.conn_id = ctx->conn_id; - osmo_prim_init(&prim->oph, SCCP_SAP_USER, - OSMO_SCU_PRIM_N_DATA, - PRIM_OP_REQUEST, msg); - return osmo_sccp_user_sap_down(g_scu, &prim->oph); -} - -static int ranap_handle_co_iu_rel_req(struct ue_conn_ctx *ctx, RANAP_Iu_ReleaseRequestIEs_t *ies) -{ - LOGP(DRANAP, LOGL_INFO, "Received Iu Release Request, Sending Release Command\n"); - iu_tx_release(ctx, &ies->cause); - return 0; -} - -static int ranap_handle_co_rab_ass_resp(struct ue_conn_ctx *ctx, RANAP_RAB_AssignmentResponseIEs_t *ies) -{ - int rc = -1; - - LOGP(DRANAP, LOGL_INFO, - "Rx RAB Assignment Response for UE conn_id %u\n", ctx->conn_id); - if (ies->presenceMask & RAB_ASSIGNMENTRESPONSEIES_RANAP_RAB_SETUPORMODIFIEDLIST_PRESENT) { - /* TODO: Iterate over list of SetupOrModifiedList IEs and handle each one */ - RANAP_IE_t *ranap_ie = ies->raB_SetupOrModifiedList.raB_SetupOrModifiedList_ies.list.array[0]; - RANAP_RAB_SetupOrModifiedItemIEs_t setup_ies; - - rc = ranap_decode_rab_setupormodifieditemies_fromlist(&setup_ies, &ranap_ie->value); - if (rc) { - LOGP(DRANAP, LOGL_ERROR, "Error in ranap_decode_rab_setupormodifieditemies()\n"); - return rc; - } - - rc = global_iu_event_cb(ctx, IU_EVENT_RAB_ASSIGN, &setup_ies); - - ranap_free_rab_setupormodifieditemies(&setup_ies); - } - /* FIXME: handle RAB Ass failure? */ - - return rc; -} - -/* Entry point for connection-oriented RANAP message */ -static void cn_ranap_handle_co(void *ctx, ranap_message *message) -{ - int rc; - - LOGP(DRANAP, LOGL_NOTICE, "handle_co(dir=%u, proc=%u)\n", message->direction, message->procedureCode); - - switch (message->direction) { - case RANAP_RANAP_PDU_PR_initiatingMessage: - switch (message->procedureCode) { - case RANAP_ProcedureCode_id_InitialUE_Message: - rc = ranap_handle_co_initial_ue(ctx, &message->msg.initialUE_MessageIEs); - break; - case RANAP_ProcedureCode_id_DirectTransfer: - rc = ranap_handle_co_dt(ctx, &message->msg.directTransferIEs); - break; - case RANAP_ProcedureCode_id_ErrorIndication: - rc = ranap_handle_co_err_ind(ctx, &message->msg.errorIndicationIEs); - break; - case RANAP_ProcedureCode_id_Iu_ReleaseRequest: - /* Iu Release Request */ - rc = ranap_handle_co_iu_rel_req(ctx, &message->msg.iu_ReleaseRequestIEs); - break; - default: - LOGP(DRANAP, LOGL_ERROR, "Received Initiating Message: unknown Procedure Code %d\n", - message->procedureCode); - rc = -1; - break; - } - break; - case RANAP_RANAP_PDU_PR_successfulOutcome: - switch (message->procedureCode) { - case RANAP_ProcedureCode_id_SecurityModeControl: - /* Security Mode Complete */ - rc = global_iu_event_cb(ctx, IU_EVENT_SECURITY_MODE_COMPLETE, NULL); - break; - case RANAP_ProcedureCode_id_Iu_Release: - /* Iu Release Complete */ - rc = global_iu_event_cb(ctx, IU_EVENT_IU_RELEASE, NULL); - if (rc) { - LOGP(DRANAP, LOGL_ERROR, "Iu Release event: Iu Event callback returned %d\n", - rc); - } - break; - default: - LOGP(DRANAP, LOGL_ERROR, "Received Successful Outcome: unknown Procedure Code %d\n", - message->procedureCode); - rc = -1; - break; - } - break; - case RANAP_RANAP_PDU_PR_outcome: - switch (message->procedureCode) { - case RANAP_ProcedureCode_id_RAB_Assignment: - /* RAB Assignment Response */ - rc = ranap_handle_co_rab_ass_resp(ctx, &message->msg.raB_AssignmentResponseIEs); - break; - default: - LOGP(DRANAP, LOGL_ERROR, "Received Outcome: unknown Procedure Code %d\n", - message->procedureCode); - rc = -1; - break; - } - break; - case RANAP_RANAP_PDU_PR_unsuccessfulOutcome: - default: - LOGP(DRANAP, LOGL_ERROR, "Received Unsuccessful Outcome: Procedure Code %d\n", - message->procedureCode); - rc = -1; - break; - } - - if (rc) { - LOGP(DRANAP, LOGL_ERROR, "Error in cn_ranap_handle_co (%d)\n", - rc); - /* TODO handling of the error? */ - } -} - -static int ranap_handle_cl_reset_req(void *ctx, RANAP_ResetIEs_t *ies) -{ - /* FIXME: send reset response */ - return -1; -} - -static int ranap_handle_cl_err_ind(void *ctx, RANAP_ErrorIndicationIEs_t *ies) -{ - if (ies->presenceMask & ERRORINDICATIONIES_RANAP_CAUSE_PRESENT) - LOGP(DRANAP, LOGL_ERROR, "Rx Error Indication (%s)\n", - ranap_cause_str(&ies->cause)); - else - LOGP(DRANAP, LOGL_ERROR, "Rx Error Indication\n"); - - return 0; -} - -/* Entry point for connection-less RANAP message */ -static void cn_ranap_handle_cl(void *ctx, ranap_message *message) -{ - int rc; - - switch (message->direction) { - case RANAP_RANAP_PDU_PR_initiatingMessage: - switch (message->procedureCode) { - case RANAP_ProcedureCode_id_Reset: - /* received reset.req, send reset.resp */ - rc = ranap_handle_cl_reset_req(ctx, &message->msg.resetIEs); - break; - case RANAP_ProcedureCode_id_ErrorIndication: - rc = ranap_handle_cl_err_ind(ctx, &message->msg.errorIndicationIEs); - break; - default: - rc = -1; - break; - } - break; - case RANAP_RANAP_PDU_PR_successfulOutcome: - case RANAP_RANAP_PDU_PR_unsuccessfulOutcome: - case RANAP_RANAP_PDU_PR_outcome: - default: - rc = -1; - break; - } - - if (rc) { - LOGP(DRANAP, LOGL_ERROR, "Error in cn_ranap_handle_cl (%d)\n", - rc); - /* TODO handling of the error? */ - } -} - -/*********************************************************************** - * Paging - ***********************************************************************/ - -struct osmo_sccp_addr local_sccp_addr = { - .presence = OSMO_SCCP_ADDR_T_SSN | OSMO_SCCP_ADDR_T_PC, - .ri = OSMO_SCCP_RI_SSN_PC, - .ssn = OSMO_SCCP_SSN_RANAP, - .pc = 1, -}; - -/* Send a paging command down a given SCCP User. tmsi and paging_cause are - * optional and may be passed NULL and 0, respectively, to disable their use. - * See enum RANAP_PagingCause. - * - * If TMSI is given, the IMSI is not sent over the air interface. Nevertheless, - * the IMSI is still required for resolution in the HNB-GW and/or(?) RNC. */ -static int iu_tx_paging_cmd(struct osmo_sccp_addr *called_addr, - const char *imsi, const uint32_t *tmsi, - bool is_ps, uint32_t paging_cause) -{ - struct msgb *msg; - msg = ranap_new_msg_paging_cmd(imsi, tmsi, is_ps? 1 : 0, paging_cause); - msg->l2h = msg->data; - osmo_sccp_tx_unitdata_msg(g_scu, &local_sccp_addr, called_addr, msg); - return 0; -} - -static int iu_page(const char *imsi, const uint32_t *tmsi_or_ptimsi, - uint16_t lac, uint8_t rac, bool is_ps) -{ - struct iu_rnc *rnc; - int pagings_sent = 0; - - if (tmsi_or_ptimsi) { - LOGP(DRANAP, LOGL_DEBUG, "%s: Looking for RNCs to page for IMSI %s" - " (paging will use %s %x)\n", - is_ps? "IuPS" : "IuCS", - imsi, - is_ps? "PTMSI" : "TMSI", - *tmsi_or_ptimsi); - } else { - LOGP(DRANAP, LOGL_DEBUG, "%s: Looking for RNCs to page for IMSI %s" - " (paging will use IMSI)\n", - is_ps? "IuPS" : "IuCS", - imsi - ); - } - - llist_for_each_entry(rnc, &rnc_list, entry) { - if (rnc->lac != lac) - continue; - if (is_ps && rnc->rac != rac) - continue; - - /* Found a match! */ - if (iu_tx_paging_cmd(&rnc->sccp_addr, imsi, tmsi_or_ptimsi, is_ps, 0) - == 0) { - LOGP(DRANAP, LOGL_DEBUG, - "%s: Paged for IMSI %s on RNC %d, on SCCP addr %s\n", - is_ps? "IuPS" : "IuCS", - imsi, rnc->rnc_id, osmo_sccp_addr_dump(&rnc->sccp_addr)); - pagings_sent ++; - } - } - - /* Some logging... */ - if (pagings_sent > 0) { - LOGP(DRANAP, LOGL_DEBUG, - "%s: %d RNCs were paged for IMSI %s.\n", - is_ps? "IuPS" : "IuCS", - pagings_sent, imsi); - } - else { - if (is_ps) { - LOGP(DRANAP, LOGL_ERROR, "IuPS: Found no RNC to page for" - " LAC %d RAC %d (would have paged IMSI %s)\n", - lac, rac, imsi); - } - else { - LOGP(DRANAP, LOGL_ERROR, "IuCS: Found no RNC to page for" - " LAC %d (would have paged IMSI %s)\n", - lac, imsi); - } - } - - return pagings_sent; -} - -int iu_page_cs(const char *imsi, const uint32_t *tmsi, uint16_t lac) -{ - return iu_page(imsi, tmsi, lac, 0, false); -} - -int iu_page_ps(const char *imsi, const uint32_t *ptmsi, uint16_t lac, uint8_t rac) -{ - return iu_page(imsi, ptmsi, lac, rac, true); -} - - -/*********************************************************************** - * - ***********************************************************************/ - -int tx_unitdata(struct osmo_sccp_user *scu); -int tx_conn_req(struct osmo_sccp_user *scu, uint32_t conn_id); - -struct osmo_prim_hdr *make_conn_req(uint32_t conn_id); -struct osmo_prim_hdr *make_dt1_req(uint32_t conn_id, const uint8_t *data, unsigned int len); - -struct osmo_prim_hdr *make_conn_resp(struct osmo_scu_connect_param *param) -{ - struct msgb *msg = msgb_alloc(1024, "conn_resp"); - struct osmo_scu_prim *prim; - - prim = (struct osmo_scu_prim *) msgb_put(msg, sizeof(*prim)); - osmo_prim_init(&prim->oph, SCCP_SAP_USER, - OSMO_SCU_PRIM_N_CONNECT, - PRIM_OP_RESPONSE, msg); - memcpy(&prim->u.connect, param, sizeof(prim->u.connect)); - return &prim->oph; -} - -static int sccp_sap_up(struct osmo_prim_hdr *oph, void *_scu) -{ - struct osmo_sccp_user *scu = _scu; - struct osmo_scu_prim *prim = (struct osmo_scu_prim *) oph; - struct osmo_prim_hdr *resp = NULL; - int rc; - struct ue_conn_ctx *ue; - - DEBUGP(DRANAP, "sccp_sap_up(%s)\n", osmo_scu_prim_name(oph)); - - switch (OSMO_PRIM_HDR(oph)) { - case OSMO_PRIM(OSMO_SCU_PRIM_N_CONNECT, PRIM_OP_CONFIRM): - /* confirmation of outbound connection */ - rc = -1; - break; - case OSMO_PRIM(OSMO_SCU_PRIM_N_CONNECT, PRIM_OP_INDICATION): - /* indication of new inbound connection request*/ - DEBUGP(DRANAP, "N-CONNECT.ind(X->%u)\n", prim->u.connect.conn_id); - if (/* prim->u.connect.called_addr.ssn != OSMO_SCCP_SSN_RANAP || */ - !msgb_l2(oph->msg) || msgb_l2len(oph->msg) == 0) { - LOGP(DRANAP, LOGL_NOTICE, - "Received invalid N-CONNECT.ind\n"); - return 0; - } - ue = ue_conn_ctx_alloc(&prim->u.connect.calling_addr, prim->u.connect.conn_id); - /* first ensure the local SCCP socket is ACTIVE */ - resp = make_conn_resp(&prim->u.connect); - osmo_sccp_user_sap_down(scu, resp); - /* then handle the RANAP payload */ - rc = ranap_cn_rx_co(cn_ranap_handle_co, ue, msgb_l2(oph->msg), msgb_l2len(oph->msg)); - break; - case OSMO_PRIM(OSMO_SCU_PRIM_N_DISCONNECT, PRIM_OP_INDICATION): - /* indication of disconnect */ - DEBUGP(DRANAP, "N-DISCONNECT.ind(%u)\n", - prim->u.disconnect.conn_id); - ue = ue_conn_ctx_find(prim->u.disconnect.conn_id); - rc = ranap_cn_rx_co(cn_ranap_handle_co, ue, msgb_l2(oph->msg), msgb_l2len(oph->msg)); - break; - case OSMO_PRIM(OSMO_SCU_PRIM_N_DATA, PRIM_OP_INDICATION): - /* connection-oriented data received */ - DEBUGP(DRANAP, "N-DATA.ind(%u, %s)\n", prim->u.data.conn_id, - osmo_hexdump(msgb_l2(oph->msg), msgb_l2len(oph->msg))); - /* resolve UE context */ - ue = ue_conn_ctx_find(prim->u.data.conn_id); - rc = ranap_cn_rx_co(cn_ranap_handle_co, ue, msgb_l2(oph->msg), msgb_l2len(oph->msg)); - break; - case OSMO_PRIM(OSMO_SCU_PRIM_N_UNITDATA, PRIM_OP_INDICATION): - /* connection-less data received */ - DEBUGP(DRANAP, "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)); - break; - default: - rc = -1; - break; - } - - msgb_free(oph->msg); - return rc; -} - -int iu_init(void *ctx, struct osmo_sccp_instance *sccp, - iu_recv_cb_t iu_recv_cb, iu_event_cb_t iu_event_cb) -{ - talloc_iu_ctx = talloc_named_const(ctx, 1, "iu"); - talloc_asn1_ctx = talloc_named_const(talloc_iu_ctx, 1, "asn1"); - - global_iu_recv_cb = iu_recv_cb; - global_iu_event_cb = iu_event_cb; - g_sccp = sccp; - g_scu = osmo_sccp_user_bind(g_sccp, "OsmoMSC-Iu", sccp_sap_up, OSMO_SCCP_SSN_RANAP); - - return 0; -} - diff --git a/src/libiu/iu_vty.c b/src/libiu/iu_vty.c deleted file mode 100644 index 3fd3cd1..0000000 --- a/src/libiu/iu_vty.c +++ /dev/null @@ -1,133 +0,0 @@ -/* OpenBSC Iu related interface to quagga VTY */ -/* (C) 2016 by sysmocom s.m.f.c. GmbH - * All Rights Reserved - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - * - */ - -#include -#include - -#include -#include -#include -#include -#include - -#include - -static enum nsap_addr_enc *g_rab_assign_addr_enc = NULL; - -DEFUN(logging_asn_debug, - logging_asn_debug_cmd, - "logging asn1-debug (1|0)", - LOGGING_STR - "Log ASN.1 debug messages to stderr\n" - "Log ASN.1 debug messages to stderr\n" - "Do not log ASN.1 debug messages to stderr\n") -{ - asn_debug = atoi(argv[0]); - return CMD_SUCCESS; -} - -DEFUN(logging_asn_xer_print, - logging_asn_xer_print_cmd, - "logging asn1-xer-print (1|0)", - LOGGING_STR - "Log human readable representations of all ASN.1 messages to stderr\n" - "Log decoded ASN.1 messages to stderr\n" - "Do not log decoded ASN.1 messages to stderr\n") -{ - asn1_xer_print = atoi(argv[0]); - return CMD_SUCCESS; -} - -#define IU_STR "Iu interface protocol options\n" -DEFUN(cfg_iu_rab_assign_addr_enc, cfg_iu_rab_assign_addr_enc_cmd, - "iu rab-assign-addr-enc (x213|v4raw)", - IU_STR - "Choose RAB Assignment's Transport Layer Address encoding\n" - "ITU-T X.213 compliant address encoding (default)\n" - "32bit length raw IPv4 address (for ip.access nano3G)\n") -{ - if (!g_rab_assign_addr_enc) { - vty_out(vty, "%%RAB Assignment Transport Layer Address" - " encoding not available%s", VTY_NEWLINE); - return CMD_WARNING; - } - - if (strcmp(argv[0], "v4raw") == 0) - *g_rab_assign_addr_enc = NSAP_ADDR_ENC_V4RAW; - else - *g_rab_assign_addr_enc = NSAP_ADDR_ENC_X213; - return CMD_SUCCESS; -} - -extern struct osmo_sccp_addr local_sccp_addr; - -/* Note from the future: change-id Ib8c4fcdb4766c5e575618b95ce16dce51063206b will move this file to - * osmo-iuh, and there, change-id I3bb7fc1cd5261d214c6ba0cccfe95f637e6db087 will drop this vty command - * and use the point code defined via libosmo-sccp vty commands instead. */ -DEFUN(cfg_iu_local_addr_pc, cfg_iu_local_addr_pc_cmd, - "iu local-address point-code PC", - IU_STR "Local SCCP Address\n" "Set local point code\n" "point code\n") -{ - local_sccp_addr.presence = OSMO_SCCP_ADDR_T_PC | OSMO_SCCP_ADDR_T_SSN; - local_sccp_addr.ri = OSMO_SCCP_RI_SSN_PC; - local_sccp_addr.pc = osmo_ss7_pointcode_parse(NULL, argv[0]); - - return CMD_SUCCESS; -} - -/* TODO: GT address configuration, in line with 4.5.1.1.1 of TS 25.410 */ - -int iu_vty_config_write(struct vty *vty, const char *indent) -{ - if (!g_rab_assign_addr_enc) { - vty_out(vty, "%%RAB Assignment Transport Layer Address" - " encoding not available%s", VTY_NEWLINE); - return CMD_WARNING; - } - - switch (*g_rab_assign_addr_enc) { - case NSAP_ADDR_ENC_V4RAW: - vty_out(vty, "%siu rab-assign-addr-enc v4raw%s", indent, - VTY_NEWLINE); - break; - case NSAP_ADDR_ENC_X213: - /* default value, no need to write anything */ - break; - default: - LOGP(0, LOGL_ERROR, "Invalid value for" - " net.iu.rab_assign_addr_enc: %d\n", - *g_rab_assign_addr_enc); - return CMD_WARNING; - } - - vty_out(vty, "%siu local-address point-code %s%s", indent, - osmo_ss7_pointcode_print(NULL, local_sccp_addr.pc), VTY_NEWLINE); - - return CMD_SUCCESS; -} - -void iu_vty_init(int iu_parent_node, enum nsap_addr_enc *rab_assign_addr_enc) -{ - g_rab_assign_addr_enc = rab_assign_addr_enc; - - install_element(CFG_LOG_NODE, &logging_asn_debug_cmd); - install_element(CFG_LOG_NODE, &logging_asn_xer_print_cmd); - install_element(iu_parent_node, &cfg_iu_rab_assign_addr_enc_cmd); - install_element(iu_parent_node, &cfg_iu_local_addr_pc_cmd); -} diff --git a/src/libmsc/Makefile.am b/src/libmsc/Makefile.am index 9f246b3..c9b8bb4 100644 --- a/src/libmsc/Makefile.am +++ b/src/libmsc/Makefile.am @@ -35,8 +35,6 @@ gsm_04_14.c \ gsm_04_80.c \ gsm_subscriber.c \ - iucs.c \ - iucs_ranap.c \ mncc.c \ mncc_builtin.c \ mncc_sock.c \ @@ -52,7 +50,12 @@ meas_feed.c \ subscr_conn.c \ $(NULL) -if !BUILD_IU +if BUILD_IU +libmsc_a_SOURCES += \ + iucs.c \ + iucs_ranap.c \ + $(NULL) +else libmsc_a_SOURCES += \ iu_dummy.c \ $(NULL) diff --git a/src/libmsc/a_iface_bssap.c b/src/libmsc/a_iface_bssap.c index 561ccde..e8a2293 100644 --- a/src/libmsc/a_iface_bssap.c +++ b/src/libmsc/a_iface_bssap.c @@ -29,7 +29,6 @@ #include #include #include -#include #include #include #include diff --git a/src/libmsc/gsm_04_08.c b/src/libmsc/gsm_04_08.c index b6746a5..21bc2b8 100644 --- a/src/libmsc/gsm_04_08.c +++ b/src/libmsc/gsm_04_08.c @@ -72,13 +72,11 @@ #include #include #include - -#include - #ifdef BUILD_IU -#include +#include #endif +#include #include #include @@ -3412,7 +3410,7 @@ #ifdef BUILD_IU DEBUGP(DMM, "-> SECURITY MODE CONTROL %s\n", vlr_subscr_name(conn->vsub)); - return iu_tx_sec_mode_cmd(conn->iu.ue_ctx, tuple, 0, 1); + return ranap_iu_tx_sec_mode_cmd(conn->iu.ue_ctx, &tuple->vec, 0, 1); #else LOGP(DMM, LOGL_ERROR, "Cannot send Security Mode Control over RAN_UTRAN_IU," " built without Iu support\n"); diff --git a/src/libmsc/gsm_subscriber.c b/src/libmsc/gsm_subscriber.c index 73361a1..09540c1 100644 --- a/src/libmsc/gsm_subscriber.c +++ b/src/libmsc/gsm_subscriber.c @@ -20,6 +20,8 @@ * */ +#include "../../bscconfig.h" + #include #include #include @@ -32,6 +34,12 @@ #include +#ifdef BUILD_IU +#include +#else +#include +#endif + #include #include #include @@ -40,7 +48,6 @@ #include #include #include -#include #include #include #include @@ -108,10 +115,10 @@ case RAN_GERAN_A: return a_iface_tx_paging(vsub->imsi, vsub->tmsi, vsub->lac); case RAN_UTRAN_IU: - return iu_page_cs(vsub->imsi, - vsub->tmsi == GSM_RESERVED_TMSI? - NULL : &vsub->tmsi, - vsub->lac); + return ranap_iu_page_cs(vsub->imsi, + vsub->tmsi == GSM_RESERVED_TMSI? + NULL : &vsub->tmsi, + vsub->lac); default: break; } diff --git a/src/libmsc/iu_dummy.c b/src/libmsc/iu_dummy.c index 1f5dffb..e9d335e 100644 --- a/src/libmsc/iu_dummy.c +++ b/src/libmsc/iu_dummy.c @@ -26,39 +26,39 @@ #include "../../bscconfig.h" #ifndef BUILD_IU -#include -#include +#include #include #include #include struct msgb; -struct ue_conn_ctx; +struct ranap_ue_conn_ctx; struct gsm_auth_tuple; struct RANAP_Cause; +struct osmo_auth_vector; -int iu_tx(struct msgb *msg, uint8_t sapi) +int ranap_iu_tx(struct msgb *msg, uint8_t sapi) { LOGP(DLGLOBAL, LOGL_INFO, "iu_tx() dummy called, NOT transmitting %d bytes: %s\n", msg->len, osmo_hexdump(msg->data, msg->len)); return 0; } -int iu_tx_sec_mode_cmd(struct ue_conn_ctx *uectx, struct gsm_auth_tuple *tp, - int send_ck) +int ranap_iu_tx_sec_mode_cmd(struct ranap_ue_conn_ctx *uectx, struct osmo_auth_vector *vec, + int send_ck) { LOGP(DLGLOBAL, LOGL_INFO, "iu_tx_sec_mode_cmd() dummy called, NOT transmitting Security Mode Command\n"); return 0; } -int iu_page_cs(const char *imsi, const uint32_t *tmsi, uint16_t lac) +int ranap_iu_page_cs(const char *imsi, const uint32_t *tmsi, uint16_t lac) { LOGP(DLGLOBAL, LOGL_INFO, "iu_page_cs() dummy called, NOT paging\n"); return 23; } -int iu_page_ps(const char *imsi, const uint32_t *ptmsi, uint16_t lac, uint8_t rac) +int ranap_iu_page_ps(const char *imsi, const uint32_t *ptmsi, uint16_t lac, uint8_t rac) { LOGP(DLGLOBAL, LOGL_INFO, "iu_page_ps() dummy called, NOT paging\n"); return 0; @@ -72,19 +72,19 @@ return NULL; } -int iu_rab_act(struct ue_conn_ctx *ue_ctx, struct msgb *msg) +int ranap_iu_rab_act(struct ranap_ue_conn_ctx *ue_ctx, struct msgb *msg) { LOGP(DLGLOBAL, LOGL_INFO, "iu_rab_act() dummy called, NOT activating RAB\n"); return 0; } -int iu_tx_common_id(struct ue_conn_ctx *uectx, const char *imsi) +int ranap_iu_tx_common_id(struct ranap_ue_conn_ctx *uectx, const char *imsi) { LOGP(DLGLOBAL, LOGL_INFO, "iu_tx_common_id() dummy called, NOT sending CommonID\n"); return 0; } -int iu_tx_release(struct ue_conn_ctx *ctx, const struct RANAP_Cause *cause) +int ranap_iu_tx_release(struct ranap_ue_conn_ctx *ctx, const struct RANAP_Cause *cause) { LOGP(DLGLOBAL, LOGL_INFO, "iu_tx_release() dummy called, NOT sending Release\n"); return 0; diff --git a/src/libmsc/iucs.c b/src/libmsc/iucs.c index be026c8..04b9ece 100644 --- a/src/libmsc/iucs.c +++ b/src/libmsc/iucs.c @@ -25,17 +25,17 @@ #include #include +#include #include #include -#include #include #include #include /* For A-interface see libbsc/bsc_api.c subscr_con_allocate() */ static struct gsm_subscriber_connection *subscr_conn_allocate_iu(struct gsm_network *network, - struct ue_conn_ctx *ue, + struct ranap_ue_conn_ctx *ue, uint16_t lac) { struct gsm_subscriber_connection *conn; @@ -57,7 +57,7 @@ return conn; } -static int same_ue_conn(struct ue_conn_ctx *a, struct ue_conn_ctx *b) +static int same_ue_conn(struct ranap_ue_conn_ctx *a, struct ranap_ue_conn_ctx *b) { if (a == b) return 1; @@ -103,7 +103,7 @@ * connection IDs, or return NULL if not found. */ struct gsm_subscriber_connection *subscr_conn_lookup_iu( struct gsm_network *network, - struct ue_conn_ctx *ue) + struct ranap_ue_conn_ctx *ue) { struct gsm_subscriber_connection *conn; @@ -126,7 +126,7 @@ } /* Receive MM/CC/... message from IuCS (SCCP user SAP). - * msg->dst must reference a struct ue_conn_ctx, which identifies the peer that + * msg->dst must reference a struct ranap_ue_conn_ctx, which identifies the peer that * sent the msg. * * For A-interface see libbsc/bsc_api.c gsm0408_rcvmsg(). */ @@ -134,10 +134,10 @@ uint16_t *lac) { int rc; - struct ue_conn_ctx *ue_ctx; + struct ranap_ue_conn_ctx *ue_ctx; struct gsm_subscriber_connection *conn; - ue_ctx = (struct ue_conn_ctx*)msg->dst; + ue_ctx = (struct ranap_ue_conn_ctx*)msg->dst; /* TODO: are there message types that could allow us to skip this * search? */ diff --git a/src/libmsc/iucs_ranap.c b/src/libmsc/iucs_ranap.c index c016474..45de1ca 100644 --- a/src/libmsc/iucs_ranap.c +++ b/src/libmsc/iucs_ranap.c @@ -27,11 +27,11 @@ #include #include +#include #include #include #include -#include #include #include #include @@ -67,7 +67,7 @@ } int iucs_rx_ranap_event(struct gsm_network *network, - struct ue_conn_ctx *ue_ctx, int type, void *data) + struct ranap_ue_conn_ctx *ue_ctx, int type, void *data) { struct gsm_subscriber_connection *conn; @@ -79,19 +79,19 @@ } switch (type) { - case IU_EVENT_IU_RELEASE: - case IU_EVENT_LINK_INVALIDATED: + case RANAP_IU_EVENT_IU_RELEASE: + case RANAP_IU_EVENT_LINK_INVALIDATED: LOGP(DIUCS, LOGL_INFO, "IuCS release for %s\n", vlr_subscr_name(conn->vsub)); msc_subscr_conn_close(conn, 0); return 0; - case IU_EVENT_SECURITY_MODE_COMPLETE: + case RANAP_IU_EVENT_SECURITY_MODE_COMPLETE: LOGP(DIUCS, LOGL_INFO, "IuCS security mode complete for %s\n", vlr_subscr_name(conn->vsub)); return iucs_rx_sec_mode_compl(conn, (RANAP_SecurityModeCompleteIEs_t*)data); - case IU_EVENT_RAB_ASSIGN: + case RANAP_IU_EVENT_RAB_ASSIGN: return iucs_rx_rab_assign(conn, (RANAP_RAB_SetupOrModifiedItemIEs_t*)data); default: diff --git a/src/libmsc/msc_ifaces.c b/src/libmsc/msc_ifaces.c index 7d2e898..262bf98 100644 --- a/src/libmsc/msc_ifaces.c +++ b/src/libmsc/msc_ifaces.c @@ -23,7 +23,6 @@ #include #include #include -#include #include #include #include @@ -34,10 +33,13 @@ #include "../../bscconfig.h" #ifdef BUILD_IU +#include extern struct msgb *ranap_new_msg_rab_assign_voice(uint8_t rab_id, uint32_t rtp_ip, uint16_t rtp_port, bool use_x213_nsap); +#else +#include #endif /* BUILD_IU */ static int msc_tx(struct gsm_subscriber_connection *conn, struct msgb *msg) @@ -57,7 +59,7 @@ case RAN_UTRAN_IU: msg->dst = conn->iu.ue_ctx; - return iu_tx(msg, 0); + return ranap_iu_tx(msg, 0); default: LOGP(DMSC, LOGL_ERROR, @@ -134,10 +136,10 @@ DEBUGP(DIUCS, "%s: tx CommonID %s\n", vlr_subscr_name(conn->vsub), conn->vsub->imsi); - return iu_tx_common_id(conn->iu.ue_ctx, conn->vsub->imsi); + return ranap_iu_tx_common_id(conn->iu.ue_ctx, conn->vsub->imsi); } -static int iu_rab_act_cs(struct ue_conn_ctx *uectx, uint8_t rab_id, +static int iu_rab_act_cs(struct ranap_ue_conn_ctx *uectx, uint8_t rab_id, uint32_t rtp_ip, uint16_t rtp_port) { #ifdef BUILD_IU @@ -145,7 +147,7 @@ bool use_x213_nsap; uint32_t conn_id = uectx->conn_id; - use_x213_nsap = (uectx->rab_assign_addr_enc == NSAP_ADDR_ENC_X213); + use_x213_nsap = (uectx->rab_assign_addr_enc == RANAP_NSAP_ADDR_ENC_X213); LOGP(DIUCS, LOGL_DEBUG, "Assigning RAB: conn_id=%u, rab_id=%d," " rtp=%x:%u, use_x213_nsap=%d\n", conn_id, rab_id, rtp_ip, @@ -155,7 +157,7 @@ use_x213_nsap); msg->l2h = msg->data; - if (iu_rab_act(uectx, msg)) + if (ranap_iu_rab_act(uectx, msg)) LOGP(DIUCS, LOGL_ERROR, "Failed to send RAB Assignment:" " conn_id=%d rab_id=%d rtp=%x:%u\n", conn_id, rab_id, rtp_ip, rtp_port); @@ -170,7 +172,6 @@ { struct gsm_trans *trans = priv; struct gsm_subscriber_connection *conn = trans->conn; - struct ue_conn_ctx *uectx = conn->iu.ue_ctx; uint32_t rtp_ip; int rc; @@ -195,7 +196,7 @@ if (trans->conn->via_ran == RAN_UTRAN_IU) { /* Assign a voice channel via RANAP on 3G */ - if (iu_rab_act_cs(uectx, conn->iu.rab_id, rtp_ip, conn->rtp.port_subscr)) + if (iu_rab_act_cs(conn->iu.ue_ctx, conn->iu.rab_id, rtp_ip, conn->rtp.port_subscr)) goto rab_act_cs_error; } else if (trans->conn->via_ran == RAN_GERAN_A) { /* Assign a voice channel via A on 2G */ @@ -234,7 +235,7 @@ mgcp = conn->network->mgcpgw.client; #ifdef BUILD_IU - /* FIXME: HACK. where to scope the RAB Id? At the conn / subscriber / ue_conn_ctx? */ + /* FIXME: HACK. where to scope the RAB Id? At the conn / subscriber / ranap_ue_conn_ctx? */ static uint8_t next_iu_rab_id = 1; if (conn->via_ran == RAN_UTRAN_IU) conn->iu.rab_id = next_iu_rab_id ++; diff --git a/src/libmsc/msc_vty.c b/src/libmsc/msc_vty.c index 01e7e82..6ae4529 100644 --- a/src/libmsc/msc_vty.c +++ b/src/libmsc/msc_vty.c @@ -23,15 +23,19 @@ /* NOTE: I would have liked to call this the MSC_NODE instead of the MSC_NODE, * but MSC_NODE already exists to configure a remote MSC for osmo-bsc. */ +#include "../../bscconfig.h" + #include #include +#ifdef BUILD_IU +#include +#endif #include #include #include #include -#include static struct cmd_node msc_node = { MSC_NODE, @@ -99,7 +103,7 @@ mgcpgw_client_config_write(vty, " "); #ifdef BUILD_IU - iu_vty_config_write(vty, " "); + ranap_iu_vty_config_write(vty, " "); #endif return CMD_SUCCESS; @@ -153,6 +157,6 @@ mgcpgw_client_vty_init(MSC_NODE, &msc_network->mgcpgw.conf); #ifdef BUILD_IU - iu_vty_init(MSC_NODE, &msc_network->iu.rab_assign_addr_enc); + ranap_iu_vty_init(MSC_NODE, &msc_network->iu.rab_assign_addr_enc); #endif } diff --git a/src/libmsc/osmo_msc.c b/src/libmsc/osmo_msc.c index 866cfbd..4d24f22 100644 --- a/src/libmsc/osmo_msc.c +++ b/src/libmsc/osmo_msc.c @@ -28,10 +28,16 @@ #include #include #include -#include #include #include + +#include "../../bscconfig.h" +#ifdef BUILD_IU +#include +#else +#include +#endif /* Receive a SAPI-N-REJECT from BSC */ void msc_sapi_n_reject(struct gsm_subscriber_connection *conn, int dlci) @@ -285,7 +291,7 @@ switch (conn->via_ran) { case RAN_UTRAN_IU: - iu_tx_release(conn->iu.ue_ctx, NULL); + ranap_iu_tx_release(conn->iu.ue_ctx, NULL); /* FIXME: keep the conn until the Iu Release Outcome is * received from the UE, or a timeout expires. For now, the log * says "unknown UE" for each release outcome. */ diff --git a/src/libmsc/subscr_conn.c b/src/libmsc/subscr_conn.c index cdeeae9..bcab8e4 100644 --- a/src/libmsc/subscr_conn.c +++ b/src/libmsc/subscr_conn.c @@ -30,9 +30,7 @@ #include #include #include -#include #include - #define SUBSCR_CONN_TIMEOUT 5 /* seconds */ diff --git a/src/osmo-msc/Makefile.am b/src/osmo-msc/Makefile.am index bd734d1..87b6133 100644 --- a/src/osmo-msc/Makefile.am +++ b/src/osmo-msc/Makefile.am @@ -50,7 +50,6 @@ $(NULL) if BUILD_IU osmo_msc_LDADD += \ - $(top_builddir)/src/libiu/libiu.a \ $(LIBOSMORANAP_LIBS) \ $(LIBASN1C_LIBS) \ $(NULL) diff --git a/src/osmo-msc/msc_main.c b/src/osmo-msc/msc_main.c index cd713ee..de6af5d 100644 --- a/src/osmo-msc/msc_main.c +++ b/src/osmo-msc/msc_main.c @@ -66,9 +66,11 @@ #include #include -#include +#ifdef BUILD_IU +#include +#endif -#include +#include #include #include #include @@ -312,6 +314,7 @@ .is_config_node = bsc_vty_is_config_node, }; +#ifdef BUILD_IU static int rcvmsg_iu_cs(struct msgb *msg, struct gprs_ra_id *ra_id, uint16_t *sai) { DEBUGP(DIUCS, "got IuCS message" @@ -326,14 +329,15 @@ return gsm0408_rcvmsg_iucs(msc_network, msg, ra_id? &ra_id->lac : NULL); } -static int rx_iu_event(struct ue_conn_ctx *ctx, enum iu_event_type type, +static int rx_iu_event(struct ranap_ue_conn_ctx *ctx, enum ranap_iu_event_type type, void *data) { DEBUGP(DIUCS, "got IuCS event %u: %s\n", type, - iu_event_type_str(type)); + ranap_iu_event_type_str(type)); return iucs_rx_ranap_event(msc_network, ctx, type, data); } +#endif #define DEFAULT_M3UA_REMOTE_IP "127.0.0.1" #define DEFAULT_PC_A "0.23.1" @@ -564,7 +568,7 @@ #ifdef BUILD_IU /* Set up IuCS */ - iu_init(tall_msc_ctx, msc_network->iu.sccp, rcvmsg_iu_cs, rx_iu_event); + ranap_iu_init(tall_msc_ctx, DRANAP, "OsmoMSC-IuCS", msc_network->iu.sccp, rcvmsg_iu_cs, rx_iu_event); #endif /* Set up A interface */ diff --git a/tests/msc_vlr/Makefile.am b/tests/msc_vlr/Makefile.am index 6d51d6e..3ae0c84 100644 --- a/tests/msc_vlr/Makefile.am +++ b/tests/msc_vlr/Makefile.am @@ -50,13 +50,6 @@ $(top_builddir)/src/libtrau/libtrau.a \ $(top_builddir)/src/libmgcp/libmgcp.a \ $(top_builddir)/src/libcommon/libcommon.a \ - $(NULL) -if BUILD_IU -COMMON_LDADD += \ - $(top_builddir)/src/libiu/libiu.a \ - $(NULL) -endif -COMMON_LDADD += \ $(LIBSMPP34_LIBS) \ $(LIBOSMOCORE_LIBS) \ $(LIBOSMOGSM_LIBS) \ @@ -76,10 +69,10 @@ -Wl,--wrap=a_iface_tx_dtap \ -Wl,--wrap=a_iface_tx_clear_cmd \ -Wl,--wrap=a_iface_tx_paging \ - -Wl,--wrap=iu_tx \ - -Wl,--wrap=iu_tx_release \ - -Wl,--wrap=iu_tx_common_id \ - -Wl,--wrap=iu_page_cs \ + -Wl,--wrap=ranap_iu_tx \ + -Wl,--wrap=ranap_iu_tx_release \ + -Wl,--wrap=ranap_iu_tx_common_id \ + -Wl,--wrap=ranap_iu_page_cs \ -Wl,--wrap=msc_stop_paging \ -Wl,--wrap=gsm340_gen_scts \ -Wl,--wrap=RAND_bytes \ diff --git a/tests/msc_vlr/msc_vlr_tests.c b/tests/msc_vlr/msc_vlr_tests.c index a45b10f..0454187 100644 --- a/tests/msc_vlr/msc_vlr_tests.c +++ b/tests/msc_vlr/msc_vlr_tests.c @@ -30,11 +30,11 @@ #include #include #include +#include #include #include #include #include -#include #include #include "msc_vlr_tests.h" @@ -152,8 +152,8 @@ conn->bts = the_bts; conn->via_ran = rx_from_ran; if (conn->via_ran == RAN_UTRAN_IU) { - struct ue_conn_ctx *ue_ctx = talloc_zero(conn, struct ue_conn_ctx); - *ue_ctx = (struct ue_conn_ctx){ + struct ranap_ue_conn_ctx *ue_ctx = talloc_zero(conn, struct ranap_ue_conn_ctx); + *ue_ctx = (struct ranap_ue_conn_ctx){ .conn_id = 42, }; conn->iu.ue_ctx = ue_ctx; @@ -295,9 +295,9 @@ return 1; } -/* override, requires '-Wl,--wrap=iu_page_cs' */ -int __real_iu_page_cs(const char *imsi, const uint32_t *tmsi, uint16_t lac); -int __wrap_iu_page_cs(const char *imsi, const uint32_t *tmsi, uint16_t lac) +/* override, requires '-Wl,--wrap=ranap_iu_page_cs' */ +int __real_ranap_iu_page_cs(const char *imsi, const uint32_t *tmsi, uint16_t lac); +int __wrap_ranap_iu_page_cs(const char *imsi, const uint32_t *tmsi, uint16_t lac) { return _paging_sent(RAN_UTRAN_IU, imsi, tmsi ? *tmsi : GSM_RESERVED_TMSI, lac); } @@ -472,16 +472,16 @@ return 0; } -/* override, requires '-Wl,--wrap=iu_tx' */ -int __real_iu_tx(struct msgb *msg, uint8_t sapi); -int __wrap_iu_tx(struct msgb *msg, uint8_t sapi) +/* override, requires '-Wl,--wrap=ranap_iu_tx' */ +int __real_ranap_iu_tx(struct msgb *msg, uint8_t sapi); +int __wrap_ranap_iu_tx(struct msgb *msg, uint8_t sapi) { return _validate_dtap(msg, RAN_UTRAN_IU); } -/* override, requires '-Wl,--wrap=iu_tx_release' */ -int __real_iu_tx_release(struct ue_conn_ctx *ctx, const struct RANAP_Cause *cause); -int __wrap_iu_tx_release(struct ue_conn_ctx *ctx, const struct RANAP_Cause *cause) +/* override, requires '-Wl,--wrap=ranap_iu_tx_release' */ +int __real_ranap_iu_tx_release(struct ranap_ue_conn_ctx *ctx, const struct RANAP_Cause *cause); +int __wrap_ranap_iu_tx_release(struct ranap_ue_conn_ctx *ctx, const struct RANAP_Cause *cause) { btw("Iu Release --%s--> MS", ran_type_name(RAN_UTRAN_IU)); OSMO_ASSERT(iu_release_expected); @@ -491,8 +491,8 @@ } /* override, requires '-Wl,--wrap=iu_tx_common_id' */ -int __real_iu_tx_common_id(struct ue_conn_ctx *ue_ctx, const char *imsi); -int __wrap_iu_tx_common_id(struct ue_conn_ctx *ue_ctx, const char *imsi) +int __real_ranap_iu_tx_common_id(struct ranap_ue_conn_ctx *ue_ctx, const char *imsi); +int __wrap_ranap_iu_tx_common_id(struct ranap_ue_conn_ctx *ue_ctx, const char *imsi) { btw("Iu Common ID --%s--> MS (IMSI=%s)", ran_type_name(RAN_UTRAN_IU), imsi); return 0; diff --git a/tests/sgsn/Makefile.am b/tests/sgsn/Makefile.am index f1606cb..ccb8f44 100644 --- a/tests/sgsn/Makefile.am +++ b/tests/sgsn/Makefile.am @@ -74,7 +74,6 @@ if BUILD_IU sgsn_test_LDADD += \ - $(top_builddir)/src/libiu/libiu.a \ $(LIBOSMORANAP_LIBS) \ $(LIBOSMOSIGTRAN_LIBS) \ $(LIBASN1C_LIBS) \ diff --git a/tests/sms_queue/Makefile.am b/tests/sms_queue/Makefile.am index d17f996..62c479b 100644 --- a/tests/sms_queue/Makefile.am +++ b/tests/sms_queue/Makefile.am @@ -37,13 +37,6 @@ $(top_builddir)/src/libmgcp/libmgcp.a \ $(top_builddir)/src/libcommon/libcommon.a \ $(top_builddir)/src/libcommon-cs/libcommon-cs.a \ - $(NULL) -if BUILD_IU -sms_queue_test_LDADD += \ - $(top_builddir)/src/libiu/libiu.a \ - $(NULL) -endif -sms_queue_test_LDADD += \ $(LIBSMPP34_LIBS) \ $(LIBOSMOCORE_LIBS) \ $(LIBOSMOGSM_LIBS) \ -- To view, visit https://gerrit.osmocom.org/3489 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ib8c4fcdb4766c5e575618b95ce16dce51063206b Gerrit-PatchSet: 4 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sun Aug 27 01:26:53 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sun, 27 Aug 2017 01:26:53 +0000 Subject: [PATCH] osmo-msc[master]: replace internal libmgcp with libosmo-legacy-mgcp In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3492 to look at the new patch set (#4). replace internal libmgcp with libosmo-legacy-mgcp Change-Id: Ic99d681759edce11564da62500c2aac5cf5fffe2 --- M configure.ac M include/openbsc/Makefile.am M include/openbsc/bsc_nat.h M include/openbsc/gsm_data.h D include/openbsc/mgcp.h D include/openbsc/mgcp_internal.h D include/openbsc/mgcp_transcode.h D include/openbsc/mgcpgw_client.h M src/Makefile.am M src/libfilter/bsc_msg_acc.c D src/libmgcp/Makefile.am D src/libmgcp/g711common.h D src/libmgcp/mgcp_common.c D src/libmgcp/mgcp_network.c D src/libmgcp/mgcp_osmux.c D src/libmgcp/mgcp_protocol.c D src/libmgcp/mgcp_sdp.c D src/libmgcp/mgcp_transcode.c D src/libmgcp/mgcp_vty.c D src/libmgcp/mgcpgw_client.c D src/libmgcp/mgcpgw_client_vty.c M src/libmsc/a_iface.c M src/libmsc/msc_ifaces.c M src/libmsc/msc_vty.c M src/osmo-bsc/osmo_bsc_bssap.c D src/osmo-bsc_mgcp/Makefile.am D src/osmo-bsc_mgcp/mgcp_main.c M src/osmo-bsc_nat/bsc_mgcp_utils.c M src/osmo-bsc_nat/bsc_nat_ctrl.c M src/osmo-bsc_nat/bsc_nat_vty.c M src/osmo-bsc_nat/bsc_ussd.c M src/osmo-msc/Makefile.am M src/osmo-msc/msc_main.c M tests/Makefile.am D tests/mgcp/Makefile.am D tests/mgcp/mgcp_test.c D tests/mgcp/mgcp_test.ok D tests/mgcp/mgcp_transcoding_test.c D tests/mgcp/mgcp_transcoding_test.ok D tests/mgcp/mgcpgw_client_test.c D tests/mgcp/mgcpgw_client_test.err D tests/mgcp/mgcpgw_client_test.ok M tests/msc_vlr/Makefile.am M tests/sms_queue/Makefile.am M tests/testsuite.at 45 files changed, 29 insertions(+), 11,356 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/92/3492/4 -- To view, visit https://gerrit.osmocom.org/3492 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ic99d681759edce11564da62500c2aac5cf5fffe2 Gerrit-PatchSet: 4 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sun Aug 27 01:26:53 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sun, 27 Aug 2017 01:26:53 +0000 Subject: [PATCH] osmo-msc[master]: split off osmo-msc: remove files, apply build, rename In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3497 to look at the new patch set (#4). split off osmo-msc: remove files, apply build, rename Change-Id: Icf025e5ea8d180613b3114282951c9afa67af9a7 --- M configure.ac D debian/osmo-gtphub.default D debian/osmo-gtphub.examples D debian/osmo-gtphub.init D debian/osmo-gtphub.install D debian/osmocom-bs11-utils.install D debian/osmocom-bsc-nat.init D debian/osmocom-bsc-nat.install D debian/osmocom-bsc.examples D debian/osmocom-bsc.install D debian/osmocom-gbproxy.init D debian/osmocom-gbproxy.install D debian/osmocom-ipaccess-utils.install D debian/osmocom-sgsn.default D debian/osmocom-sgsn.examples D debian/osmocom-sgsn.init D debian/osmocom-sgsn.install D doc/BS11-OML.txt D doc/channel_release.txt D doc/examples/osmo-bsc/osmo-bsc.cfg D doc/examples/osmo-bsc_mgcp/mgcp.cfg D doc/examples/osmo-bsc_nat/black-list.cfg D doc/examples/osmo-bsc_nat/osmo-bsc_nat.cfg D doc/examples/osmo-gbproxy/osmo-gbproxy-legacy.cfg D doc/examples/osmo-gbproxy/osmo-gbproxy.cfg D doc/examples/osmo-gtphub/gtphub-example.txt D doc/examples/osmo-gtphub/osmo-gtphub-1iface.cfg D doc/examples/osmo-gtphub/osmo-gtphub.cfg D doc/examples/osmo-sgsn/osmo-sgsn.cfg D doc/oml-interface.txt M include/Makefile.am D include/compat_af_isdn.h D include/mISDNif.h M include/openbsc/Makefile.am D include/openbsc/bsc_nat.h D include/openbsc/bsc_nat_callstats.h D include/openbsc/bsc_nat_sccp.h D include/openbsc/bsc_subscriber.h D include/openbsc/gb_proxy.h D include/openbsc/gprs_gb_parse.h D include/openbsc/gprs_gmm.h D include/openbsc/gprs_llc.h D include/openbsc/gprs_llc_xid.h D include/openbsc/gprs_sgsn.h D include/openbsc/gprs_sndcp.h D include/openbsc/gprs_sndcp_comp.h D include/openbsc/gprs_sndcp_dcomp.h D include/openbsc/gprs_sndcp_pcomp.h D include/openbsc/gprs_sndcp_xid.h D include/openbsc/gprs_subscriber.h D include/openbsc/gprs_utils.h D include/openbsc/nat_rewrite_trie.h M include/openbsc/paging.h D include/openbsc/pcu_if.h D include/openbsc/pcuif_proto.h D include/openbsc/sgsn.h D include/openbsc/v42bis.h D include/openbsc/v42bis_private.h M osmoappdesc.py M src/Makefile.am D src/gprs/.gitignore D src/gprs/Makefile.am D src/gprs/crc24.c D src/gprs/gb_proxy.c D src/gprs/gb_proxy_main.c D src/gprs/gb_proxy_patch.c D src/gprs/gb_proxy_peer.c D src/gprs/gb_proxy_tlli.c D src/gprs/gb_proxy_vty.c D src/gprs/gprs_gb_parse.c D src/gprs/gprs_gmm.c D src/gprs/gprs_llc.c D src/gprs/gprs_llc_parse.c D src/gprs/gprs_llc_vty.c D src/gprs/gprs_llc_xid.c D src/gprs/gprs_sgsn.c D src/gprs/gprs_sndcp.c D src/gprs/gprs_sndcp_comp.c D src/gprs/gprs_sndcp_dcomp.c D src/gprs/gprs_sndcp_pcomp.c D src/gprs/gprs_sndcp_vty.c D src/gprs/gprs_sndcp_xid.c D src/gprs/gprs_subscriber.c D src/gprs/gprs_utils.c D src/gprs/gtphub.c D src/gprs/gtphub_ares.c D src/gprs/gtphub_main.c D src/gprs/gtphub_sock.c D src/gprs/gtphub_vty.c D src/gprs/osmo_sgsn.cfg D src/gprs/sgsn_ares.c D src/gprs/sgsn_auth.c D src/gprs/sgsn_cdr.c D src/gprs/sgsn_ctrl.c D src/gprs/sgsn_libgtp.c D src/gprs/sgsn_main.c D src/gprs/sgsn_vty.c D src/gprs/slhc.c D src/gprs/v42bis.c D src/ipaccess/Makefile.am D src/ipaccess/abisip-find.c D src/ipaccess/ipaccess-config.c D src/ipaccess/ipaccess-firmware.c D src/ipaccess/ipaccess-proxy.c D src/ipaccess/network_listen.c D src/libbsc/Makefile.am D src/libbsc/abis_nm.c D src/libbsc/abis_nm_ipaccess.c D src/libbsc/abis_nm_vty.c D src/libbsc/abis_om2000.c D src/libbsc/abis_om2000_vty.c D src/libbsc/abis_rsl.c D src/libbsc/arfcn_range_encode.c D src/libbsc/bsc_api.c D src/libbsc/bsc_ctrl_commands.c D src/libbsc/bsc_ctrl_lookup.c D src/libbsc/bsc_dyn_ts.c D src/libbsc/bsc_init.c D src/libbsc/bsc_msc.c D src/libbsc/bsc_rf_ctrl.c D src/libbsc/bsc_rll.c D src/libbsc/bsc_subscriber.c D src/libbsc/bsc_vty.c D src/libbsc/bts_ericsson_rbs2000.c D src/libbsc/bts_init.c D src/libbsc/bts_ipaccess_nanobts.c D src/libbsc/bts_ipaccess_nanobts_omlattr.c D src/libbsc/bts_nokia_site.c D src/libbsc/bts_siemens_bs11.c D src/libbsc/bts_sysmobts.c D src/libbsc/bts_unknown.c D src/libbsc/chan_alloc.c D src/libbsc/e1_config.c D src/libbsc/gsm_04_08_utils.c D src/libbsc/gsm_04_80_utils.c D src/libbsc/handover_decision.c D src/libbsc/handover_logic.c D src/libbsc/meas_proc.c D src/libbsc/meas_rep.c D src/libbsc/net_init.c D src/libbsc/paging.c D src/libbsc/pcu_sock.c D src/libbsc/rest_octets.c D src/libbsc/system_information.c M src/libcommon/common_vty.c D src/libfilter/Makefile.am D src/libfilter/bsc_msg_acc.c D src/libfilter/bsc_msg_filter.c D src/libfilter/bsc_msg_vty.c M src/libmsc/vty_interface_layer3.c D src/libtrau/Makefile.am D src/libtrau/rtp_proxy.c D src/libtrau/trau_mux.c D src/libtrau/trau_upqueue.c M src/libvlr/vlr.c D src/osmo-bsc/Makefile.am D src/osmo-bsc/osmo_bsc_api.c D src/osmo-bsc/osmo_bsc_audio.c D src/osmo-bsc/osmo_bsc_bssap.c D src/osmo-bsc/osmo_bsc_ctrl.c D src/osmo-bsc/osmo_bsc_filter.c D src/osmo-bsc/osmo_bsc_grace.c D src/osmo-bsc/osmo_bsc_main.c D src/osmo-bsc/osmo_bsc_msc.c D src/osmo-bsc/osmo_bsc_reset.c D src/osmo-bsc/osmo_bsc_sigtran.c D src/osmo-bsc/osmo_bsc_vty.c D src/osmo-bsc_nat/Makefile.am D src/osmo-bsc_nat/bsc_filter.c D src/osmo-bsc_nat/bsc_mgcp_utils.c D src/osmo-bsc_nat/bsc_nat.c D src/osmo-bsc_nat/bsc_nat_ctrl.c D src/osmo-bsc_nat/bsc_nat_filter.c D src/osmo-bsc_nat/bsc_nat_rewrite.c D src/osmo-bsc_nat/bsc_nat_rewrite_trie.c D src/osmo-bsc_nat/bsc_nat_utils.c D src/osmo-bsc_nat/bsc_nat_vty.c D src/osmo-bsc_nat/bsc_sccp.c D src/osmo-bsc_nat/bsc_ussd.c M src/osmo-msc/Makefile.am M src/utils/Makefile.am D src/utils/bs11_config.c D src/utils/isdnsync.c M tests/Makefile.am D tests/abis/Makefile.am D tests/abis/abis_test.c D tests/abis/abis_test.ok D tests/bsc-nat-trie/Makefile.am D tests/bsc-nat-trie/bsc_nat_trie_test.c D tests/bsc-nat-trie/bsc_nat_trie_test.ok D tests/bsc-nat-trie/prefixes.csv D tests/bsc-nat/Makefile.am D tests/bsc-nat/barr.cfg D tests/bsc-nat/barr_dup.cfg D tests/bsc-nat/bsc_data.c D tests/bsc-nat/bsc_nat_test.c D tests/bsc-nat/bsc_nat_test.ok D tests/bsc-nat/prefixes.csv D tests/bsc/Makefile.am D tests/bsc/bsc_test.c D tests/bsc/bsc_test.ok D tests/channel/Makefile.am D tests/channel/channel_test.c D tests/channel/channel_test.ok D tests/gbproxy/Makefile.am D tests/gbproxy/gbproxy_test.c D tests/gbproxy/gbproxy_test.ok D tests/gprs/Makefile.am D tests/gprs/gprs_test.c D tests/gprs/gprs_test.ok D tests/gsm0408/Makefile.am D tests/gsm0408/gsm0408_test.c D tests/gsm0408/gsm0408_test.ok D tests/gtphub/Makefile.am D tests/gtphub/gtphub_test.c D tests/gtphub/gtphub_test.ok M tests/msc_vlr/Makefile.am M tests/msc_vlr/msc_vlr_tests.c D tests/nanobts_omlattr/Makefile.am D tests/nanobts_omlattr/nanobts_omlattr_test.c D tests/nanobts_omlattr/nanobts_omlattr_test.ok D tests/oap/Makefile.am D tests/oap/oap_client_test.c D tests/oap/oap_client_test.err D tests/oap/oap_client_test.ok D tests/sgsn/Makefile.am D tests/sgsn/sgsn_test.c D tests/sgsn/sgsn_test.ok D tests/slhc/Makefile.am D tests/slhc/slhc_test.c D tests/slhc/slhc_test.ok M tests/sms_queue/Makefile.am D tests/sndcp_xid/Makefile.am D tests/sndcp_xid/sndcp_xid_test.c D tests/sndcp_xid/sndcp_xid_test.ok D tests/subscr/Makefile.am D tests/subscr/bsc_subscr_test.c D tests/subscr/bsc_subscr_test.err D tests/subscr/bsc_subscr_test.ok M tests/testsuite.at D tests/trau/Makefile.am D tests/trau/trau_test.c D tests/trau/trau_test.ok D tests/v42bis/Makefile.am D tests/v42bis/v42bis_test.c D tests/v42bis/v42bis_test.ok M tests/vty_test_runner.py D tests/xid/Makefile.am D tests/xid/xid_test.c D tests/xid/xid_test.ok D tools/hlrstat.pl 251 files changed, 17 insertions(+), 100,385 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/97/3497/4 -- To view, visit https://gerrit.osmocom.org/3497 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Icf025e5ea8d180613b3114282951c9afa67af9a7 Gerrit-PatchSet: 4 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Sun Aug 27 02:23:38 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sun, 27 Aug 2017 02:23:38 +0000 Subject: [PATCH] osmo-msc[master]: move libiu to osmo-iuh/libosmo-ranap 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/3489 to look at the new patch set (#5). move libiu to osmo-iuh/libosmo-ranap Remove libiu here, use the functions from libosmo-ranap instead, by applying the ranap_ / RANAP_ prefix. Corresponding change-id in osmo-iuh.git is I6a3f7ad15be03fb94689b4af6ccfa828c25f45c0 To be able to run the msc_vlr tests for RAN_UTRAN_IU without Iu client headers available, add iu_dummy.h, containing mere function signatures that match iu_dummy.c and a mostly empty struct ranap_ue_conn_ctx. Make sure we can build with and without --enable-iu: include osmo-iuh headers only with --enable-iu. Change-Id: Ib8c4fcdb4766c5e575618b95ce16dce51063206b --- M configure.ac M include/openbsc/Makefile.am M include/openbsc/gprs_sgsn.h M include/openbsc/gsm_data.h D include/openbsc/iu.h A include/openbsc/iu_dummy.h M include/openbsc/iucs.h M include/openbsc/iucs_ranap.h M include/openbsc/sgsn.h M src/Makefile.am M src/gprs/Makefile.am M src/gprs/gprs_gmm.c M src/gprs/gprs_sgsn.c M src/gprs/sgsn_libgtp.c M src/gprs/sgsn_main.c M src/gprs/sgsn_vty.c D src/libiu/Makefile.am D src/libiu/iu.c D src/libiu/iu_vty.c M src/libmsc/Makefile.am M src/libmsc/a_iface_bssap.c M src/libmsc/gsm_04_08.c M src/libmsc/gsm_subscriber.c M src/libmsc/iu_dummy.c M src/libmsc/iucs.c M src/libmsc/iucs_ranap.c M src/libmsc/msc_ifaces.c M src/libmsc/msc_vty.c M src/libmsc/osmo_msc.c M src/libmsc/subscr_conn.c M src/osmo-msc/Makefile.am M src/osmo-msc/msc_main.c M tests/msc_vlr/Makefile.am M tests/msc_vlr/msc_vlr_tests.c M tests/sgsn/Makefile.am M tests/sms_queue/Makefile.am 36 files changed, 209 insertions(+), 1,150 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/89/3489/5 diff --git a/configure.ac b/configure.ac index 87800fc..7045132 100644 --- a/configure.ac +++ b/configure.ac @@ -229,7 +229,6 @@ src/libmgcp/Makefile src/libcommon/Makefile src/libfilter/Makefile - src/libiu/Makefile src/libcommon-cs/Makefile src/osmo-msc/Makefile src/osmo-bsc/Makefile diff --git a/include/openbsc/Makefile.am b/include/openbsc/Makefile.am index 25709f1..89e0338 100644 --- a/include/openbsc/Makefile.am +++ b/include/openbsc/Makefile.am @@ -49,9 +49,9 @@ handover.h \ handover_decision.h \ ipaccess.h \ - iu.h \ iucs.h \ iucs_ranap.h \ + iu_dummy.h \ meas_feed.h \ meas_rep.h \ mgcp.h \ diff --git a/include/openbsc/gprs_sgsn.h b/include/openbsc/gprs_sgsn.h index 4e49c08..57995e0 100644 --- a/include/openbsc/gprs_sgsn.h +++ b/include/openbsc/gprs_sgsn.h @@ -117,7 +117,7 @@ uint16_t pdp_status; }; -struct ue_conn_ctx; +struct ranap_ue_conn_ctx; /* According to TS 03.60, Table 5: SGSN MM and PDP Contexts */ /* Extended by 3GPP TS 23.060, Table 6: SGSN MM and PDP Contexts */ @@ -159,7 +159,7 @@ /* CSG Subscription Data */ /* LIPA Allowed */ /* Voice Support Match Indicator */ - struct ue_conn_ctx *ue_ctx; + struct ranap_ue_conn_ctx *ue_ctx; struct service_info service; } iu; /* VLR number */ diff --git a/include/openbsc/gsm_data.h b/include/openbsc/gsm_data.h index 43fc6d3..6079900 100644 --- a/include/openbsc/gsm_data.h +++ b/include/openbsc/gsm_data.h @@ -30,7 +30,7 @@ struct bsc_subscr; struct vlr_instance; struct vlr_subscr; -struct ue_conn_ctx; +struct ranap_ue_conn_ctx; #define OBSC_LINKID_CB(__msgb) (__msgb)->cb[3] @@ -203,7 +203,7 @@ /* which Iu-CS connection, if any. */ struct { - struct ue_conn_ctx *ue_ctx; + struct ranap_ue_conn_ctx *ue_ctx; uint8_t rab_id; } iu; @@ -493,7 +493,7 @@ struct { /* CS7 instance id number (set via VTY) */ uint32_t cs7_instance; - enum nsap_addr_enc rab_assign_addr_enc; + int rab_assign_addr_enc; struct osmo_sccp_instance *sccp; } iu; diff --git a/include/openbsc/iu.h b/include/openbsc/iu.h deleted file mode 100644 index 08e4cd0..0000000 --- a/include/openbsc/iu.h +++ /dev/null @@ -1,77 +0,0 @@ -#pragma once - -#include -#include - -#include -#include -#include - -#include - -struct sgsn_pdp_ctx; -struct msgb; -struct gsm_auth_tuple; -struct osmo_sccp_addr; -struct osmo_ss7_instance; - -struct RANAP_RAB_SetupOrModifiedItemIEs_s; -struct RANAP_GlobalRNC_ID; -struct RANAP_Cause; - -/* Debugging switches from asn1c and osmo-iuh */ -extern int asn_debug; -extern int asn1_xer_print; - -struct ue_conn_ctx { - struct llist_head list; - /* TODO: It's not needed to store the full SCCP address for each - * UE. Rather than that, a pointer to the RNC should be far - * sufficient */ - struct osmo_sccp_addr sccp_addr; - uint32_t conn_id; - int integrity_active; - struct gprs_ra_id ra_id; - enum nsap_addr_enc rab_assign_addr_enc; -}; - -enum iu_event_type { - IU_EVENT_RAB_ASSIGN, - IU_EVENT_SECURITY_MODE_COMPLETE, - IU_EVENT_IU_RELEASE, /* An actual Iu Release message was received */ - IU_EVENT_LINK_INVALIDATED, /* A SUA link was lost or closed down */ -}; - -extern const struct value_string iu_event_type_names[]; -static inline const char *iu_event_type_str(enum iu_event_type e) -{ - return get_value_string(iu_event_type_names, e); -} - -/* Implementations of iu_recv_cb_t shall find the ue_conn_ctx in msg->dst. */ -typedef int (* iu_recv_cb_t )(struct msgb *msg, struct gprs_ra_id *ra_id, - uint16_t *sai); - -typedef int (* iu_event_cb_t )(struct ue_conn_ctx *ue_ctx, - enum iu_event_type type, void *data); - -typedef int (* iu_rab_ass_resp_cb_t )(struct ue_conn_ctx *ue_ctx, uint8_t rab_id, - struct RANAP_RAB_SetupOrModifiedItemIEs_s *setup_ies); - -int iu_init(void *ctx, struct osmo_sccp_instance *sccp, - iu_recv_cb_t iu_recv_cb, iu_event_cb_t iu_event_cb); - -int iu_tx(struct msgb *msg, uint8_t sapi); - -int iu_page_cs(const char *imsi, const uint32_t *tmsi, uint16_t lac); -int iu_page_ps(const char *imsi, const uint32_t *ptmsi, uint16_t lac, uint8_t rac); - -int iu_rab_act(struct ue_conn_ctx *ue_ctx, struct msgb *msg); -int iu_rab_deact(struct ue_conn_ctx *ue_ctx, uint8_t rab_id); -int iu_tx_sec_mode_cmd(struct ue_conn_ctx *uectx, struct gsm_auth_tuple *tp, - int send_ck, int new_key); -int iu_tx_common_id(struct ue_conn_ctx *ue_ctx, const char *imsi); -int iu_tx_release(struct ue_conn_ctx *ctx, const struct RANAP_Cause *cause); - -void iu_vty_init(int iu_parent_node, enum nsap_addr_enc *rab_assign_addr_enc); -int iu_vty_config_write(struct vty *vty, const char *indent); diff --git a/include/openbsc/iu_dummy.h b/include/openbsc/iu_dummy.h new file mode 100644 index 0000000..d5e1428 --- /dev/null +++ b/include/openbsc/iu_dummy.h @@ -0,0 +1,51 @@ +/* Trivial switch-off of external Iu dependencies, + * allowing to run full unit tests even when built without Iu support. */ + +/* + * (C) 2016,2017 by sysmocom s.f.m.c. GmbH + * + * Author: Neels Hofmeyr + * + * All Rights Reserved + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + * + */ + +#include +#include + +#include + +struct msgb; +struct gsm_auth_tuple; +struct RANAP_Cause; +struct osmo_auth_vector; + +struct ranap_ue_conn_ctx { + struct llist_head list; + uint32_t conn_id; +}; + +int ranap_iu_tx(struct msgb *msg, uint8_t sapi); +int ranap_iu_tx_sec_mode_cmd(struct ranap_ue_conn_ctx *uectx, struct osmo_auth_vector *vec, + int send_ck); +int ranap_iu_page_cs(const char *imsi, const uint32_t *tmsi, uint16_t lac); +int ranap_iu_page_ps(const char *imsi, const uint32_t *ptmsi, uint16_t lac, uint8_t rac); +struct msgb *ranap_new_msg_rab_assign_voice(uint8_t rab_id, uint32_t rtp_ip, + uint16_t rtp_port, + bool use_x213_nsap); +int ranap_iu_rab_act(struct ranap_ue_conn_ctx *ue_ctx, struct msgb *msg); +int ranap_iu_tx_common_id(struct ranap_ue_conn_ctx *uectx, const char *imsi); +int ranap_iu_tx_release(struct ranap_ue_conn_ctx *ctx, const struct RANAP_Cause *cause); diff --git a/include/openbsc/iucs.h b/include/openbsc/iucs.h index fb61a5c..b7d6064 100644 --- a/include/openbsc/iucs.h +++ b/include/openbsc/iucs.h @@ -4,4 +4,4 @@ uint16_t *lac); struct gsm_subscriber_connection *subscr_conn_lookup_iu(struct gsm_network *network, - struct ue_conn_ctx *ue); + struct ranap_ue_conn_ctx *ue); diff --git a/include/openbsc/iucs_ranap.h b/include/openbsc/iucs_ranap.h index 748de23..c2ff5f9 100644 --- a/include/openbsc/iucs_ranap.h +++ b/include/openbsc/iucs_ranap.h @@ -1,7 +1,7 @@ #pragma once struct gsm_network; -struct ue_conn_ctx; +struct ranap_ue_conn_ctx; int iucs_rx_ranap_event(struct gsm_network *network, - struct ue_conn_ctx *ue_ctx, int type, void *data); + struct ranap_ue_conn_ctx *ue_ctx, int type, void *data); diff --git a/include/openbsc/sgsn.h b/include/openbsc/sgsn.h index 57b2978..f371dc6 100644 --- a/include/openbsc/sgsn.h +++ b/include/openbsc/sgsn.h @@ -112,7 +112,7 @@ } dcomp_v42bis; struct { - enum nsap_addr_enc rab_assign_addr_enc; + int rab_assign_addr_enc; } iu; }; diff --git a/src/Makefile.am b/src/Makefile.am index 7e9e1dc..bd69738 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -31,13 +31,6 @@ libcommon-cs \ $(NULL) -# Conditional Libraries -if BUILD_IU -SUBDIRS += \ - libiu \ - $(NULL) -endif - # Programs SUBDIRS += \ osmo-msc \ diff --git a/src/gprs/Makefile.am b/src/gprs/Makefile.am index e05eb79..39a4c12 100644 --- a/src/gprs/Makefile.am +++ b/src/gprs/Makefile.am @@ -106,7 +106,6 @@ $(NULL) if BUILD_IU osmo_sgsn_LDADD += \ - $(top_builddir)/src/libiu/libiu.a \ $(LIBOSMOSIGTRAN_LIBS) \ $(LIBOSMORANAP_LIBS) \ $(LIBASN1C_LIBS) \ diff --git a/src/gprs/gprs_gmm.c b/src/gprs/gprs_gmm.c index 15e2fed..032137f 100644 --- a/src/gprs/gprs_gmm.c +++ b/src/gprs/gprs_gmm.c @@ -52,6 +52,7 @@ #ifdef BUILD_IU #include #include +#include #endif #include @@ -67,7 +68,6 @@ #include #include #include -#include #include #include @@ -174,7 +174,7 @@ #ifdef BUILD_IU int sgsn_ranap_rab_ass_resp(struct sgsn_mm_ctx *ctx, RANAP_RAB_SetupOrModifiedItemIEs_t *setup_ies); -int sgsn_ranap_iu_event(struct ue_conn_ctx *ctx, enum iu_event_type type, void *data) +int sgsn_ranap_iu_event(struct ranap_ue_conn_ctx *ctx, enum ranap_iu_event_type type, void *data) { struct sgsn_mm_ctx *mm; int rc = -1; @@ -188,14 +188,14 @@ } switch (type) { - case IU_EVENT_RAB_ASSIGN: + case RANAP_IU_EVENT_RAB_ASSIGN: REQUIRE_MM rc = sgsn_ranap_rab_ass_resp(mm, (RANAP_RAB_SetupOrModifiedItemIEs_t *)data); break; - case IU_EVENT_IU_RELEASE: + case RANAP_IU_EVENT_IU_RELEASE: /* fall thru */ - case IU_EVENT_LINK_INVALIDATED: - /* Clean up ue_conn_ctx here */ + case RANAP_IU_EVENT_LINK_INVALIDATED: + /* Clean up ranap_ue_conn_ctx here */ if (mm) LOGMMCTXP(LOGL_INFO, mm, "IU release for imsi %s\n", mm->imsi); else @@ -205,7 +205,7 @@ mmctx_set_pmm_state(mm, PMM_IDLE); rc = 0; break; - case IU_EVENT_SECURITY_MODE_COMPLETE: + case RANAP_IU_EVENT_SECURITY_MODE_COMPLETE: REQUIRE_MM /* Continue authentication here */ mm->iu.ue_ctx->integrity_active = 1; @@ -262,16 +262,16 @@ rate_ctr_inc(&mm->ctrg->ctr[GMM_CTR_PKTS_SIG_OUT]); #ifdef BUILD_IU if (mm->ran_type == MM_CTX_T_UTRAN_Iu) - return iu_tx(msg, GPRS_SAPI_GMM); + return ranap_iu_tx(msg, GPRS_SAPI_GMM); #endif } #ifdef BUILD_IU - /* In Iu mode, msg->dst contains the ue_conn_ctx pointer, in Gb mode + /* In Iu mode, msg->dst contains the ranap_ue_conn_ctx pointer, in Gb mode * dst is empty. */ /* FIXME: have a more explicit indicator for Iu messages */ if (msg->dst) - return iu_tx(msg, GPRS_SAPI_GMM); + return ranap_iu_tx(msg, GPRS_SAPI_GMM); #endif /* caller needs to provide TLLI, BVCI and NSEI */ @@ -296,9 +296,12 @@ /* In case a Iu connection is reconnected we need to update the ue ctx */ mm->iu.ue_ctx = msg->dst; if (mm->ran_type == MM_CTX_T_UTRAN_Iu - && mm->iu.ue_ctx) + && mm->iu.ue_ctx) { +#ifdef BUILD_IU mm->iu.ue_ctx->rab_assign_addr_enc = sgsn->cfg.iu.rab_assign_addr_enc; +#endif + } } /* Store BVCI/NSEI in MM context */ @@ -1048,7 +1051,7 @@ /* The MS is authorized */ #ifdef BUILD_IU if (ctx->ran_type == MM_CTX_T_UTRAN_Iu && !ctx->iu.ue_ctx->integrity_active) { - rc = iu_tx_sec_mode_cmd(ctx->iu.ue_ctx, &ctx->auth_triplet, 0, ctx->iu.new_key); + rc = ranap_iu_tx_sec_mode_cmd(ctx->iu.ue_ctx, &ctx->auth_triplet.vec, 0, ctx->iu.new_key); ctx->iu.new_key = 0; return rc; } @@ -1259,14 +1262,20 @@ * with a foreign TLLI (P-TMSI that was allocated to the MS before), * or with random TLLI. */ - /* In Iu mode, msg->dst contains the ue_conn_ctx pointer, in Gb mode + /* In Iu mode, msg->dst contains the ranap_ue_conn_ctx pointer, in Gb mode * dst is empty. */ /* FIXME: have a more explicit indicator for Iu messages */ if (!msg->dst) { /* Gb mode */ cid = bssgp_parse_cell_id(&ra_id, msgb_bcid(msg)); - } else - ra_id = ((struct ue_conn_ctx*)msg->dst)->ra_id; + } else { +#ifdef BUILD_IU + ra_id = ((struct ranap_ue_conn_ctx*)msg->dst)->ra_id; +#else + LOGMMCTXP(LOGL_ERROR, ctx, "Cannot handle Iu Attach Request, built without Iu support\n"); + return -ENOTSUP; +#endif + } /* MS network capability 10.5.5.12 */ msnc_len = *cur++; @@ -1627,7 +1636,7 @@ * is an optimization to avoid the RA reject (impl detached) * below, which will cause a new attach cycle. */ /* Look-up the MM context based on old RA-ID and TLLI */ - /* In Iu mode, msg->dst contains the ue_conn_ctx pointer, in Gb + /* In Iu mode, msg->dst contains the ranap_ue_conn_ctx pointer, in Gb * mode dst is empty. */ /* FIXME: have a more explicit indicator for Iu messages */ if (!msg->dst) { @@ -2905,12 +2914,12 @@ { struct msgb *msg; struct sgsn_mm_ctx *mm = pdp->mm; - struct ue_conn_ctx *uectx; + struct ranap_ue_conn_ctx *uectx; uint32_t ggsn_ip; bool use_x213_nsap; uectx = mm->iu.ue_ctx; - use_x213_nsap = (uectx->rab_assign_addr_enc == NSAP_ADDR_ENC_X213); + use_x213_nsap = (uectx->rab_assign_addr_enc == RANAP_NSAP_ADDR_ENC_X213); /* Get the IP address for ggsn user plane */ memcpy(&ggsn_ip, pdp->lib->gsnru.v, pdp->lib->gsnru.l); @@ -2923,6 +2932,6 @@ msg = ranap_new_msg_rab_assign_data(rab_id, ggsn_ip, pdp->lib->teid_gn, use_x213_nsap); msg->l2h = msg->data; - return iu_rab_act(uectx, msg); + return ranap_iu_rab_act(uectx, msg); } #endif diff --git a/src/gprs/gprs_sgsn.c b/src/gprs/gprs_sgsn.c index 43eeaaa..5021840 100644 --- a/src/gprs/gprs_sgsn.c +++ b/src/gprs/gprs_sgsn.c @@ -40,13 +40,14 @@ #include #include #include "openbsc/gprs_llc.h" -#include #include #include #include + +#include "../../bscconfig.h" #define GPRS_LLME_CHECK_TICK 30 @@ -246,6 +247,7 @@ /* Allocate a new SGSN MM context */ struct sgsn_mm_ctx *sgsn_mm_ctx_alloc_iu(void *uectx) { +#if BUILD_IU struct sgsn_mm_ctx *ctx; ctx = talloc_zero(tall_bsc_ctx, struct sgsn_mm_ctx); @@ -274,6 +276,9 @@ llist_add(&ctx->list, &sgsn_mm_ctxts); return ctx; +#else + return NULL; +#endif } diff --git a/src/gprs/sgsn_libgtp.c b/src/gprs/sgsn_libgtp.c index 7ff8ece..90b4d16 100644 --- a/src/gprs/sgsn_libgtp.c +++ b/src/gprs/sgsn_libgtp.c @@ -52,7 +52,7 @@ #include #ifdef BUILD_IU -#include +#include #include #endif @@ -548,7 +548,7 @@ } else { #ifdef BUILD_IU /* Deactivate radio bearer */ - iu_rab_deact(pctx->mm->iu.ue_ctx, 1); + ranap_iu_rab_deact(pctx->mm->iu.ue_ctx, 1); #else return -ENOTSUP; #endif @@ -687,7 +687,7 @@ #ifdef BUILD_IU /* Ignore the packet for now and page the UE to get the RAB * reestablished */ - iu_page_ps(mm->imsi, &mm->p_tmsi, mm->ra.lac, mm->ra.rac); + ranap_iu_page_ps(mm->imsi, &mm->p_tmsi, mm->ra.lac, mm->ra.rac); return 0; #else diff --git a/src/gprs/sgsn_main.c b/src/gprs/sgsn_main.c index d56af0e..25ee632 100644 --- a/src/gprs/sgsn_main.c +++ b/src/gprs/sgsn_main.c @@ -58,7 +58,6 @@ #include #include #include -#include #include #include @@ -68,6 +67,10 @@ #include #include "../../bscconfig.h" + +#if BUILD_IU +#include +#endif #define _GNU_SOURCE #include @@ -322,7 +325,7 @@ .num_cat = ARRAY_SIZE(gprs_categories), }; -int sgsn_ranap_iu_event(struct ue_conn_ctx *ctx, enum iu_event_type type, void *data); +int sgsn_ranap_iu_event(struct ue_conn_ctx *ctx, enum ranap_iu_event_type type, void *data); int main(int argc, char **argv) { @@ -451,7 +454,7 @@ return 8; } - iu_init(tall_bsc_ctx, sccp, gsm0408_gprs_rcvmsg_iu, sgsn_ranap_iu_event); + ranap_iu_init(tall_bsc_ctx, DRANAP, "OsmoSGSN-IuPS", sccp, gsm0408_gprs_rcvmsg_iu, sgsn_ranap_iu_event); #endif if (daemonize) { diff --git a/src/gprs/sgsn_vty.c b/src/gprs/sgsn_vty.c index cf44cc4..3a5b2ca 100644 --- a/src/gprs/sgsn_vty.c +++ b/src/gprs/sgsn_vty.c @@ -48,7 +48,7 @@ #include "../../bscconfig.h" #ifdef BUILD_IU -#include +#include #endif static struct sgsn_config *g_cfg = NULL; @@ -291,7 +291,7 @@ vty_out(vty, " no compression v42bis%s", VTY_NEWLINE); #ifdef BUILD_IU - iu_vty_config_write(vty, " "); + ranap_iu_vty_config_write(vty, " "); #endif return CMD_SUCCESS; @@ -1285,7 +1285,7 @@ install_element(SGSN_NODE, &cfg_comp_v42bisp_cmd); #ifdef BUILD_IU - iu_vty_init(SGSN_NODE, &g_cfg->iu.rab_assign_addr_enc); + ranap_iu_vty_init(SGSN_NODE, &g_cfg->iu.rab_assign_addr_enc); #endif return 0; } diff --git a/src/libiu/Makefile.am b/src/libiu/Makefile.am deleted file mode 100644 index e5f9e27..0000000 --- a/src/libiu/Makefile.am +++ /dev/null @@ -1,28 +0,0 @@ -AM_CPPFLAGS = \ - $(all_includes) \ - -I$(top_srcdir)/include \ - -I$(top_builddir) \ - $(NULL) - -AM_CFLAGS = \ - -Wall \ - $(COVERAGE_CFLAGS) \ - $(LIBCRYPTO_CFLAGS) \ - $(LIBASN1C_CFLAGS) \ - $(LIBOSMOCORE_CFLAGS) \ - $(LIBOSMOVTY_CFLAGS) \ - $(LIBOSMOGSM_CFLAGS) \ - $(LIBOSMOABIS_CFLAGS) \ - $(LIBOSMOSIGTRAN_CFLAGS) \ - $(LIBOSMORANAP_CFLAGS) \ - $(NULL) - -noinst_LIBRARIES = \ - libiu.a \ - $(NULL) - -libiu_a_SOURCES = \ - iu.c \ - iu_vty.c \ - $(NULL) - diff --git a/src/libiu/iu.c b/src/libiu/iu.c deleted file mode 100644 index 7794977..0000000 --- a/src/libiu/iu.c +++ /dev/null @@ -1,771 +0,0 @@ -/* Common parts of IuCS and IuPS interfaces implementation */ - -/* (C) 2016 by sysmocom s.f.m.c. GmbH - * All Rights Reserved - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - * - */ - -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include - -#include -#include - -#include -#include -#include -#include - -#include -#include -#include - -#include - -#include -#include -#include -#include - -#include - -/* Parsed global RNC id. See also struct RANAP_GlobalRNC_ID, and note that the - * PLMN identity is a BCD representation of the MCC and MNC. - * See iu_grnc_id_parse(). */ -struct iu_grnc_id { - uint16_t mcc; - uint16_t mnc; - uint16_t rnc_id; -}; - -/* A remote RNC (Radio Network Controller, like BSC but for UMTS) that has - * called us and is currently reachable at the given osmo_sccp_addr. So, when we - * know a LAC for a subscriber, we can page it at the RNC matching that LAC or - * RAC. An HNB-GW typically presents itself as if it were a single RNC, even - * though it may have several RNCs in hNodeBs connected to it. Those will then - * share the same RNC id, which they actually receive and adopt from the HNB-GW - * in the HNBAP HNB REGISTER ACCEPT message. */ -struct iu_rnc { - struct llist_head entry; - - uint16_t rnc_id; - uint16_t lac; /* Location Area Code (used for CS and PS) */ - uint8_t rac; /* Routing Area Code (used for PS only) */ - struct osmo_sccp_addr sccp_addr; -}; - -void *talloc_iu_ctx; - -/* Implement the extern asn_debug from libasn1c to indicate whether to print - * asn.1 debug messages (see libasn1c). */ -int asn_debug = 0; - -/* Implement the extern asn1_xer_print to indicate whether the ASN.1 binary - * code decoded and encoded during Iu communication should be logged to stderr - * (see asn.1 generated code in osmo-iuh). */ -int asn1_xer_print = 0; - -void *talloc_asn1_ctx; - -iu_recv_cb_t global_iu_recv_cb = NULL; -iu_event_cb_t global_iu_event_cb = NULL; - -static LLIST_HEAD(ue_conn_ctx_list); -static LLIST_HEAD(rnc_list); - -static struct osmo_sccp_instance *g_sccp; -static struct osmo_sccp_user *g_scu; - -const struct value_string iu_event_type_names[] = { - OSMO_VALUE_STRING(IU_EVENT_RAB_ASSIGN), - OSMO_VALUE_STRING(IU_EVENT_SECURITY_MODE_COMPLETE), - OSMO_VALUE_STRING(IU_EVENT_IU_RELEASE), - OSMO_VALUE_STRING(IU_EVENT_LINK_INVALIDATED), - { 0, NULL } -}; - -struct ue_conn_ctx *ue_conn_ctx_alloc(struct osmo_sccp_addr *addr, uint32_t conn_id) -{ - struct ue_conn_ctx *ctx = talloc_zero(talloc_iu_ctx, struct ue_conn_ctx); - - ctx->sccp_addr = *addr; - ctx->conn_id = conn_id; - llist_add(&ctx->list, &ue_conn_ctx_list); - - return ctx; -} - -struct ue_conn_ctx *ue_conn_ctx_find(uint32_t conn_id) -{ - struct ue_conn_ctx *ctx; - - llist_for_each_entry(ctx, &ue_conn_ctx_list, list) { - if (ctx->conn_id == conn_id) - return ctx; - } - return NULL; -} - -static struct iu_rnc *iu_rnc_alloc(uint16_t rnc_id, uint16_t lac, uint8_t rac, - struct osmo_sccp_addr *addr) -{ - struct iu_rnc *rnc = talloc_zero(talloc_iu_ctx, struct iu_rnc); - - rnc->rnc_id = rnc_id; - rnc->lac = lac; - rnc->rac = rac; - rnc->sccp_addr = *addr; - llist_add(&rnc->entry, &rnc_list); - - LOGP(DRANAP, LOGL_NOTICE, "New RNC %d (LAC=%d RAC=%d)\n", - rnc->rnc_id, rnc->lac, rnc->rac); - - return rnc; -} - -static struct iu_rnc *iu_rnc_register(uint16_t rnc_id, uint16_t lac, - uint8_t rac, struct osmo_sccp_addr *addr) -{ - struct iu_rnc *rnc; - llist_for_each_entry(rnc, &rnc_list, entry) { - if (rnc->rnc_id != rnc_id) - continue; - - /* We have this RNC Id registered already. Make sure that the - * details match. */ - - /* TODO should a mismatch be an error? */ - if (rnc->lac != lac || rnc->rac != rac) - LOGP(DRANAP, LOGL_NOTICE, "RNC %d changes its details:" - " LAC=%d RAC=%d --> LAC=%d RAC=%d\n", - rnc->rnc_id, rnc->lac, rnc->rac, - lac, rac); - rnc->lac = lac; - rnc->rac = rac; - - if (addr && memcmp(&rnc->sccp_addr, addr, sizeof(*addr))) - LOGP(DRANAP, LOGL_NOTICE, "RNC %d on New SCCP Addr %s" - " (LAC=%d RAC=%d)\n", - rnc->rnc_id, osmo_sccp_addr_dump(addr), rnc->lac, rnc->rac); - rnc->sccp_addr = *addr; - return rnc; - } - - /* Not found, make a new one. */ - return iu_rnc_alloc(rnc_id, lac, rac, addr); -} - -/*********************************************************************** - * RANAP handling - ***********************************************************************/ - -int iu_rab_act(struct ue_conn_ctx *ue_ctx, struct msgb *msg) -{ - struct osmo_scu_prim *prim; - - /* wrap RANAP message in SCCP N-DATA.req */ - prim = (struct osmo_scu_prim *) msgb_push(msg, sizeof(*prim)); - prim->u.data.conn_id = ue_ctx->conn_id; - osmo_prim_init(&prim->oph, - SCCP_SAP_USER, - OSMO_SCU_PRIM_N_DATA, - PRIM_OP_REQUEST, - msg); - return osmo_sccp_user_sap_down(g_scu, &prim->oph); -} - -int iu_rab_deact(struct ue_conn_ctx *ue_ctx, uint8_t rab_id) -{ - /* FIXME */ - return -1; -} - -int iu_tx_sec_mode_cmd(struct ue_conn_ctx *uectx, struct gsm_auth_tuple *tp, - int send_ck, int new_key) -{ - struct osmo_scu_prim *prim; - struct msgb *msg; - - /* create RANAP message */ - msg = ranap_new_msg_sec_mod_cmd(tp->vec.ik, send_ck? tp->vec.ck : NULL, - new_key ? RANAP_KeyStatus_new : RANAP_KeyStatus_old); - msg->l2h = msg->data; - /* wrap RANAP message in SCCP N-DATA.req */ - prim = (struct osmo_scu_prim *) msgb_push(msg, sizeof(*prim)); - prim->u.data.conn_id = uectx->conn_id; - osmo_prim_init(&prim->oph, SCCP_SAP_USER, - OSMO_SCU_PRIM_N_DATA, - PRIM_OP_REQUEST, msg); - osmo_sccp_user_sap_down(g_scu, &prim->oph); - - return 0; -} - -int iu_tx_common_id(struct ue_conn_ctx *uectx, const char *imsi) -{ - struct msgb *msg; - struct osmo_scu_prim *prim; - - LOGP(DRANAP, LOGL_INFO, "Transmitting RANAP CommonID (SCCP conn_id %u)\n", - uectx->conn_id); - - msg = ranap_new_msg_common_id(imsi); - msg->l2h = msg->data; - prim = (struct osmo_scu_prim *) msgb_push(msg, sizeof(*prim)); - prim->u.data.conn_id = uectx->conn_id; - osmo_prim_init(&prim->oph, SCCP_SAP_USER, - OSMO_SCU_PRIM_N_DATA, - PRIM_OP_REQUEST, msg); - osmo_sccp_user_sap_down(g_scu, &prim->oph); - return 0; -} - -static int iu_grnc_id_parse(struct iu_grnc_id *dst, - struct RANAP_GlobalRNC_ID *src) -{ - /* The size is coming from arbitrary sender, check it gracefully */ - if (src->pLMNidentity.size != 3) { - LOGP(DRANAP, LOGL_ERROR, "Invalid PLMN Identity size:" - " should be 3, is %d\n", src->pLMNidentity.size); - return -1; - } - gsm48_mcc_mnc_from_bcd(&src->pLMNidentity.buf[0], - &dst->mcc, &dst->mnc); - dst->rnc_id = (uint16_t)src->rNC_ID; - return 0; -} - -#if 0 - -- not used at present -- -static int iu_grnc_id_compose(struct iu_grnc_id *src, - struct RANAP_GlobalRNC_ID *dst) -{ - /* The caller must ensure proper size */ - OSMO_ASSERT(dst->pLMNidentity.size == 3); - gsm48_mcc_mnc_to_bcd(&dst->pLMNidentity.buf[0], - src->mcc, src->mnc); - dst->rNC_ID = src->rnc_id; - return 0; -} -#endif - -static int ranap_handle_co_initial_ue(void *ctx, RANAP_InitialUE_MessageIEs_t *ies) -{ - struct ue_conn_ctx *ue_conn = ctx; - struct gprs_ra_id ra_id; - struct iu_grnc_id grnc_id; - uint16_t sai; - struct msgb *msg = msgb_alloc(256, "RANAP->NAS"); - - if (ranap_parse_lai(&ra_id, &ies->lai) != 0) { - LOGP(DRANAP, LOGL_ERROR, "Failed to parse RANAP LAI IE\n"); - return -1; - } - - if (ies->presenceMask & INITIALUE_MESSAGEIES_RANAP_RAC_PRESENT) { - ra_id.rac = asn1str_to_u8(&ies->rac); - } - - if (iu_grnc_id_parse(&grnc_id, &ies->globalRNC_ID) != 0) { - LOGP(DRANAP, LOGL_ERROR, - "Failed to parse RANAP Global-RNC-ID IE\n"); - return -1; - } - - sai = asn1str_to_u16(&ies->sai.sAC); - msgb_gmmh(msg) = msgb_put(msg, ies->nas_pdu.size); - memcpy(msgb_gmmh(msg), ies->nas_pdu.buf, ies->nas_pdu.size); - - /* Make sure we know the RNC Id and LAC+RAC coming in on this connection. */ - iu_rnc_register(grnc_id.rnc_id, ra_id.lac, ra_id.rac, &ue_conn->sccp_addr); - ue_conn->ra_id = ra_id; - - /* Feed into the MM layer */ - msg->dst = ctx; - global_iu_recv_cb(msg, &ra_id, &sai); - - msgb_free(msg); - - return 0; -} - -static int ranap_handle_co_dt(void *ctx, RANAP_DirectTransferIEs_t *ies) -{ - struct gprs_ra_id _ra_id, *ra_id = NULL; - uint16_t _sai, *sai = NULL; - struct msgb *msg = msgb_alloc(256, "RANAP->NAS"); - - if (ies->presenceMask & DIRECTTRANSFERIES_RANAP_LAI_PRESENT) { - if (ranap_parse_lai(&_ra_id, &ies->lai) != 0) { - LOGP(DRANAP, LOGL_ERROR, "Failed to parse RANAP LAI IE\n"); - return -1; - } - ra_id = &_ra_id; - if (ies->presenceMask & DIRECTTRANSFERIES_RANAP_RAC_PRESENT) { - _ra_id.rac = asn1str_to_u8(&ies->rac); - } - if (ies->presenceMask & DIRECTTRANSFERIES_RANAP_SAI_PRESENT) { - _sai = asn1str_to_u16(&ies->sai.sAC); - sai = &_sai; - } - } - - msgb_gmmh(msg) = msgb_put(msg, ies->nas_pdu.size); - memcpy(msgb_gmmh(msg), ies->nas_pdu.buf, ies->nas_pdu.size); - - /* Feed into the MM/CC/SMS-CP layer */ - msg->dst = ctx; - global_iu_recv_cb(msg, ra_id, sai); - - msgb_free(msg); - - return 0; -} - -static int ranap_handle_co_err_ind(void *ctx, RANAP_ErrorIndicationIEs_t *ies) -{ - if (ies->presenceMask & ERRORINDICATIONIES_RANAP_CAUSE_PRESENT) - LOGP(DRANAP, LOGL_ERROR, "Rx Error Indication (%s)\n", - ranap_cause_str(&ies->cause)); - else - LOGP(DRANAP, LOGL_ERROR, "Rx Error Indication\n"); - - return 0; -} - -int iu_tx(struct msgb *msg_nas, uint8_t sapi) -{ - struct ue_conn_ctx *uectx = msg_nas->dst; - struct msgb *msg; - struct osmo_scu_prim *prim; - - LOGP(DRANAP, LOGL_INFO, "Transmitting L3 Message as RANAP DT (SCCP conn_id %u)\n", - uectx->conn_id); - - msg = ranap_new_msg_dt(sapi, msg_nas->data, msgb_length(msg_nas)); - msgb_free(msg_nas); - msg->l2h = msg->data; - prim = (struct osmo_scu_prim *) msgb_push(msg, sizeof(*prim)); - prim->u.data.conn_id = uectx->conn_id; - osmo_prim_init(&prim->oph, SCCP_SAP_USER, - OSMO_SCU_PRIM_N_DATA, - PRIM_OP_REQUEST, msg); - osmo_sccp_user_sap_down(g_scu, &prim->oph); - return 0; -} - -/* Send Iu Release for the given UE connection. - * If cause is NULL, the standard "No remaining RAB" cause is sent, otherwise - * the provided cause. */ -int iu_tx_release(struct ue_conn_ctx *ctx, const struct RANAP_Cause *cause) -{ - struct msgb *msg; - struct osmo_scu_prim *prim; - static const struct RANAP_Cause default_cause = { - .present = RANAP_Cause_PR_radioNetwork, - .choice.radioNetwork = RANAP_CauseRadioNetwork_no_remaining_rab, - }; - - if (!cause) - cause = &default_cause; - - LOGP(DRANAP, LOGL_INFO, "Transmitting Iu Release (SCCP conn_id %u)\n", - ctx->conn_id); - - msg = ranap_new_msg_iu_rel_cmd(cause); - msg->l2h = msg->data; - prim = (struct osmo_scu_prim *) msgb_push(msg, sizeof(*prim)); - prim->u.data.conn_id = ctx->conn_id; - osmo_prim_init(&prim->oph, SCCP_SAP_USER, - OSMO_SCU_PRIM_N_DATA, - PRIM_OP_REQUEST, msg); - return osmo_sccp_user_sap_down(g_scu, &prim->oph); -} - -static int ranap_handle_co_iu_rel_req(struct ue_conn_ctx *ctx, RANAP_Iu_ReleaseRequestIEs_t *ies) -{ - LOGP(DRANAP, LOGL_INFO, "Received Iu Release Request, Sending Release Command\n"); - iu_tx_release(ctx, &ies->cause); - return 0; -} - -static int ranap_handle_co_rab_ass_resp(struct ue_conn_ctx *ctx, RANAP_RAB_AssignmentResponseIEs_t *ies) -{ - int rc = -1; - - LOGP(DRANAP, LOGL_INFO, - "Rx RAB Assignment Response for UE conn_id %u\n", ctx->conn_id); - if (ies->presenceMask & RAB_ASSIGNMENTRESPONSEIES_RANAP_RAB_SETUPORMODIFIEDLIST_PRESENT) { - /* TODO: Iterate over list of SetupOrModifiedList IEs and handle each one */ - RANAP_IE_t *ranap_ie = ies->raB_SetupOrModifiedList.raB_SetupOrModifiedList_ies.list.array[0]; - RANAP_RAB_SetupOrModifiedItemIEs_t setup_ies; - - rc = ranap_decode_rab_setupormodifieditemies_fromlist(&setup_ies, &ranap_ie->value); - if (rc) { - LOGP(DRANAP, LOGL_ERROR, "Error in ranap_decode_rab_setupormodifieditemies()\n"); - return rc; - } - - rc = global_iu_event_cb(ctx, IU_EVENT_RAB_ASSIGN, &setup_ies); - - ranap_free_rab_setupormodifieditemies(&setup_ies); - } - /* FIXME: handle RAB Ass failure? */ - - return rc; -} - -/* Entry point for connection-oriented RANAP message */ -static void cn_ranap_handle_co(void *ctx, ranap_message *message) -{ - int rc; - - LOGP(DRANAP, LOGL_NOTICE, "handle_co(dir=%u, proc=%u)\n", message->direction, message->procedureCode); - - switch (message->direction) { - case RANAP_RANAP_PDU_PR_initiatingMessage: - switch (message->procedureCode) { - case RANAP_ProcedureCode_id_InitialUE_Message: - rc = ranap_handle_co_initial_ue(ctx, &message->msg.initialUE_MessageIEs); - break; - case RANAP_ProcedureCode_id_DirectTransfer: - rc = ranap_handle_co_dt(ctx, &message->msg.directTransferIEs); - break; - case RANAP_ProcedureCode_id_ErrorIndication: - rc = ranap_handle_co_err_ind(ctx, &message->msg.errorIndicationIEs); - break; - case RANAP_ProcedureCode_id_Iu_ReleaseRequest: - /* Iu Release Request */ - rc = ranap_handle_co_iu_rel_req(ctx, &message->msg.iu_ReleaseRequestIEs); - break; - default: - LOGP(DRANAP, LOGL_ERROR, "Received Initiating Message: unknown Procedure Code %d\n", - message->procedureCode); - rc = -1; - break; - } - break; - case RANAP_RANAP_PDU_PR_successfulOutcome: - switch (message->procedureCode) { - case RANAP_ProcedureCode_id_SecurityModeControl: - /* Security Mode Complete */ - rc = global_iu_event_cb(ctx, IU_EVENT_SECURITY_MODE_COMPLETE, NULL); - break; - case RANAP_ProcedureCode_id_Iu_Release: - /* Iu Release Complete */ - rc = global_iu_event_cb(ctx, IU_EVENT_IU_RELEASE, NULL); - if (rc) { - LOGP(DRANAP, LOGL_ERROR, "Iu Release event: Iu Event callback returned %d\n", - rc); - } - break; - default: - LOGP(DRANAP, LOGL_ERROR, "Received Successful Outcome: unknown Procedure Code %d\n", - message->procedureCode); - rc = -1; - break; - } - break; - case RANAP_RANAP_PDU_PR_outcome: - switch (message->procedureCode) { - case RANAP_ProcedureCode_id_RAB_Assignment: - /* RAB Assignment Response */ - rc = ranap_handle_co_rab_ass_resp(ctx, &message->msg.raB_AssignmentResponseIEs); - break; - default: - LOGP(DRANAP, LOGL_ERROR, "Received Outcome: unknown Procedure Code %d\n", - message->procedureCode); - rc = -1; - break; - } - break; - case RANAP_RANAP_PDU_PR_unsuccessfulOutcome: - default: - LOGP(DRANAP, LOGL_ERROR, "Received Unsuccessful Outcome: Procedure Code %d\n", - message->procedureCode); - rc = -1; - break; - } - - if (rc) { - LOGP(DRANAP, LOGL_ERROR, "Error in cn_ranap_handle_co (%d)\n", - rc); - /* TODO handling of the error? */ - } -} - -static int ranap_handle_cl_reset_req(void *ctx, RANAP_ResetIEs_t *ies) -{ - /* FIXME: send reset response */ - return -1; -} - -static int ranap_handle_cl_err_ind(void *ctx, RANAP_ErrorIndicationIEs_t *ies) -{ - if (ies->presenceMask & ERRORINDICATIONIES_RANAP_CAUSE_PRESENT) - LOGP(DRANAP, LOGL_ERROR, "Rx Error Indication (%s)\n", - ranap_cause_str(&ies->cause)); - else - LOGP(DRANAP, LOGL_ERROR, "Rx Error Indication\n"); - - return 0; -} - -/* Entry point for connection-less RANAP message */ -static void cn_ranap_handle_cl(void *ctx, ranap_message *message) -{ - int rc; - - switch (message->direction) { - case RANAP_RANAP_PDU_PR_initiatingMessage: - switch (message->procedureCode) { - case RANAP_ProcedureCode_id_Reset: - /* received reset.req, send reset.resp */ - rc = ranap_handle_cl_reset_req(ctx, &message->msg.resetIEs); - break; - case RANAP_ProcedureCode_id_ErrorIndication: - rc = ranap_handle_cl_err_ind(ctx, &message->msg.errorIndicationIEs); - break; - default: - rc = -1; - break; - } - break; - case RANAP_RANAP_PDU_PR_successfulOutcome: - case RANAP_RANAP_PDU_PR_unsuccessfulOutcome: - case RANAP_RANAP_PDU_PR_outcome: - default: - rc = -1; - break; - } - - if (rc) { - LOGP(DRANAP, LOGL_ERROR, "Error in cn_ranap_handle_cl (%d)\n", - rc); - /* TODO handling of the error? */ - } -} - -/*********************************************************************** - * Paging - ***********************************************************************/ - -struct osmo_sccp_addr local_sccp_addr = { - .presence = OSMO_SCCP_ADDR_T_SSN | OSMO_SCCP_ADDR_T_PC, - .ri = OSMO_SCCP_RI_SSN_PC, - .ssn = OSMO_SCCP_SSN_RANAP, - .pc = 1, -}; - -/* Send a paging command down a given SCCP User. tmsi and paging_cause are - * optional and may be passed NULL and 0, respectively, to disable their use. - * See enum RANAP_PagingCause. - * - * If TMSI is given, the IMSI is not sent over the air interface. Nevertheless, - * the IMSI is still required for resolution in the HNB-GW and/or(?) RNC. */ -static int iu_tx_paging_cmd(struct osmo_sccp_addr *called_addr, - const char *imsi, const uint32_t *tmsi, - bool is_ps, uint32_t paging_cause) -{ - struct msgb *msg; - msg = ranap_new_msg_paging_cmd(imsi, tmsi, is_ps? 1 : 0, paging_cause); - msg->l2h = msg->data; - osmo_sccp_tx_unitdata_msg(g_scu, &local_sccp_addr, called_addr, msg); - return 0; -} - -static int iu_page(const char *imsi, const uint32_t *tmsi_or_ptimsi, - uint16_t lac, uint8_t rac, bool is_ps) -{ - struct iu_rnc *rnc; - int pagings_sent = 0; - - if (tmsi_or_ptimsi) { - LOGP(DRANAP, LOGL_DEBUG, "%s: Looking for RNCs to page for IMSI %s" - " (paging will use %s %x)\n", - is_ps? "IuPS" : "IuCS", - imsi, - is_ps? "PTMSI" : "TMSI", - *tmsi_or_ptimsi); - } else { - LOGP(DRANAP, LOGL_DEBUG, "%s: Looking for RNCs to page for IMSI %s" - " (paging will use IMSI)\n", - is_ps? "IuPS" : "IuCS", - imsi - ); - } - - llist_for_each_entry(rnc, &rnc_list, entry) { - if (rnc->lac != lac) - continue; - if (is_ps && rnc->rac != rac) - continue; - - /* Found a match! */ - if (iu_tx_paging_cmd(&rnc->sccp_addr, imsi, tmsi_or_ptimsi, is_ps, 0) - == 0) { - LOGP(DRANAP, LOGL_DEBUG, - "%s: Paged for IMSI %s on RNC %d, on SCCP addr %s\n", - is_ps? "IuPS" : "IuCS", - imsi, rnc->rnc_id, osmo_sccp_addr_dump(&rnc->sccp_addr)); - pagings_sent ++; - } - } - - /* Some logging... */ - if (pagings_sent > 0) { - LOGP(DRANAP, LOGL_DEBUG, - "%s: %d RNCs were paged for IMSI %s.\n", - is_ps? "IuPS" : "IuCS", - pagings_sent, imsi); - } - else { - if (is_ps) { - LOGP(DRANAP, LOGL_ERROR, "IuPS: Found no RNC to page for" - " LAC %d RAC %d (would have paged IMSI %s)\n", - lac, rac, imsi); - } - else { - LOGP(DRANAP, LOGL_ERROR, "IuCS: Found no RNC to page for" - " LAC %d (would have paged IMSI %s)\n", - lac, imsi); - } - } - - return pagings_sent; -} - -int iu_page_cs(const char *imsi, const uint32_t *tmsi, uint16_t lac) -{ - return iu_page(imsi, tmsi, lac, 0, false); -} - -int iu_page_ps(const char *imsi, const uint32_t *ptmsi, uint16_t lac, uint8_t rac) -{ - return iu_page(imsi, ptmsi, lac, rac, true); -} - - -/*********************************************************************** - * - ***********************************************************************/ - -int tx_unitdata(struct osmo_sccp_user *scu); -int tx_conn_req(struct osmo_sccp_user *scu, uint32_t conn_id); - -struct osmo_prim_hdr *make_conn_req(uint32_t conn_id); -struct osmo_prim_hdr *make_dt1_req(uint32_t conn_id, const uint8_t *data, unsigned int len); - -struct osmo_prim_hdr *make_conn_resp(struct osmo_scu_connect_param *param) -{ - struct msgb *msg = msgb_alloc(1024, "conn_resp"); - struct osmo_scu_prim *prim; - - prim = (struct osmo_scu_prim *) msgb_put(msg, sizeof(*prim)); - osmo_prim_init(&prim->oph, SCCP_SAP_USER, - OSMO_SCU_PRIM_N_CONNECT, - PRIM_OP_RESPONSE, msg); - memcpy(&prim->u.connect, param, sizeof(prim->u.connect)); - return &prim->oph; -} - -static int sccp_sap_up(struct osmo_prim_hdr *oph, void *_scu) -{ - struct osmo_sccp_user *scu = _scu; - struct osmo_scu_prim *prim = (struct osmo_scu_prim *) oph; - struct osmo_prim_hdr *resp = NULL; - int rc; - struct ue_conn_ctx *ue; - - DEBUGP(DRANAP, "sccp_sap_up(%s)\n", osmo_scu_prim_name(oph)); - - switch (OSMO_PRIM_HDR(oph)) { - case OSMO_PRIM(OSMO_SCU_PRIM_N_CONNECT, PRIM_OP_CONFIRM): - /* confirmation of outbound connection */ - rc = -1; - break; - case OSMO_PRIM(OSMO_SCU_PRIM_N_CONNECT, PRIM_OP_INDICATION): - /* indication of new inbound connection request*/ - DEBUGP(DRANAP, "N-CONNECT.ind(X->%u)\n", prim->u.connect.conn_id); - if (/* prim->u.connect.called_addr.ssn != OSMO_SCCP_SSN_RANAP || */ - !msgb_l2(oph->msg) || msgb_l2len(oph->msg) == 0) { - LOGP(DRANAP, LOGL_NOTICE, - "Received invalid N-CONNECT.ind\n"); - return 0; - } - ue = ue_conn_ctx_alloc(&prim->u.connect.calling_addr, prim->u.connect.conn_id); - /* first ensure the local SCCP socket is ACTIVE */ - resp = make_conn_resp(&prim->u.connect); - osmo_sccp_user_sap_down(scu, resp); - /* then handle the RANAP payload */ - rc = ranap_cn_rx_co(cn_ranap_handle_co, ue, msgb_l2(oph->msg), msgb_l2len(oph->msg)); - break; - case OSMO_PRIM(OSMO_SCU_PRIM_N_DISCONNECT, PRIM_OP_INDICATION): - /* indication of disconnect */ - DEBUGP(DRANAP, "N-DISCONNECT.ind(%u)\n", - prim->u.disconnect.conn_id); - ue = ue_conn_ctx_find(prim->u.disconnect.conn_id); - rc = ranap_cn_rx_co(cn_ranap_handle_co, ue, msgb_l2(oph->msg), msgb_l2len(oph->msg)); - break; - case OSMO_PRIM(OSMO_SCU_PRIM_N_DATA, PRIM_OP_INDICATION): - /* connection-oriented data received */ - DEBUGP(DRANAP, "N-DATA.ind(%u, %s)\n", prim->u.data.conn_id, - osmo_hexdump(msgb_l2(oph->msg), msgb_l2len(oph->msg))); - /* resolve UE context */ - ue = ue_conn_ctx_find(prim->u.data.conn_id); - rc = ranap_cn_rx_co(cn_ranap_handle_co, ue, msgb_l2(oph->msg), msgb_l2len(oph->msg)); - break; - case OSMO_PRIM(OSMO_SCU_PRIM_N_UNITDATA, PRIM_OP_INDICATION): - /* connection-less data received */ - DEBUGP(DRANAP, "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)); - break; - default: - rc = -1; - break; - } - - msgb_free(oph->msg); - return rc; -} - -int iu_init(void *ctx, struct osmo_sccp_instance *sccp, - iu_recv_cb_t iu_recv_cb, iu_event_cb_t iu_event_cb) -{ - talloc_iu_ctx = talloc_named_const(ctx, 1, "iu"); - talloc_asn1_ctx = talloc_named_const(talloc_iu_ctx, 1, "asn1"); - - global_iu_recv_cb = iu_recv_cb; - global_iu_event_cb = iu_event_cb; - g_sccp = sccp; - g_scu = osmo_sccp_user_bind(g_sccp, "OsmoMSC-Iu", sccp_sap_up, OSMO_SCCP_SSN_RANAP); - - return 0; -} - diff --git a/src/libiu/iu_vty.c b/src/libiu/iu_vty.c deleted file mode 100644 index 3fd3cd1..0000000 --- a/src/libiu/iu_vty.c +++ /dev/null @@ -1,133 +0,0 @@ -/* OpenBSC Iu related interface to quagga VTY */ -/* (C) 2016 by sysmocom s.m.f.c. GmbH - * All Rights Reserved - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - * - */ - -#include -#include - -#include -#include -#include -#include -#include - -#include - -static enum nsap_addr_enc *g_rab_assign_addr_enc = NULL; - -DEFUN(logging_asn_debug, - logging_asn_debug_cmd, - "logging asn1-debug (1|0)", - LOGGING_STR - "Log ASN.1 debug messages to stderr\n" - "Log ASN.1 debug messages to stderr\n" - "Do not log ASN.1 debug messages to stderr\n") -{ - asn_debug = atoi(argv[0]); - return CMD_SUCCESS; -} - -DEFUN(logging_asn_xer_print, - logging_asn_xer_print_cmd, - "logging asn1-xer-print (1|0)", - LOGGING_STR - "Log human readable representations of all ASN.1 messages to stderr\n" - "Log decoded ASN.1 messages to stderr\n" - "Do not log decoded ASN.1 messages to stderr\n") -{ - asn1_xer_print = atoi(argv[0]); - return CMD_SUCCESS; -} - -#define IU_STR "Iu interface protocol options\n" -DEFUN(cfg_iu_rab_assign_addr_enc, cfg_iu_rab_assign_addr_enc_cmd, - "iu rab-assign-addr-enc (x213|v4raw)", - IU_STR - "Choose RAB Assignment's Transport Layer Address encoding\n" - "ITU-T X.213 compliant address encoding (default)\n" - "32bit length raw IPv4 address (for ip.access nano3G)\n") -{ - if (!g_rab_assign_addr_enc) { - vty_out(vty, "%%RAB Assignment Transport Layer Address" - " encoding not available%s", VTY_NEWLINE); - return CMD_WARNING; - } - - if (strcmp(argv[0], "v4raw") == 0) - *g_rab_assign_addr_enc = NSAP_ADDR_ENC_V4RAW; - else - *g_rab_assign_addr_enc = NSAP_ADDR_ENC_X213; - return CMD_SUCCESS; -} - -extern struct osmo_sccp_addr local_sccp_addr; - -/* Note from the future: change-id Ib8c4fcdb4766c5e575618b95ce16dce51063206b will move this file to - * osmo-iuh, and there, change-id I3bb7fc1cd5261d214c6ba0cccfe95f637e6db087 will drop this vty command - * and use the point code defined via libosmo-sccp vty commands instead. */ -DEFUN(cfg_iu_local_addr_pc, cfg_iu_local_addr_pc_cmd, - "iu local-address point-code PC", - IU_STR "Local SCCP Address\n" "Set local point code\n" "point code\n") -{ - local_sccp_addr.presence = OSMO_SCCP_ADDR_T_PC | OSMO_SCCP_ADDR_T_SSN; - local_sccp_addr.ri = OSMO_SCCP_RI_SSN_PC; - local_sccp_addr.pc = osmo_ss7_pointcode_parse(NULL, argv[0]); - - return CMD_SUCCESS; -} - -/* TODO: GT address configuration, in line with 4.5.1.1.1 of TS 25.410 */ - -int iu_vty_config_write(struct vty *vty, const char *indent) -{ - if (!g_rab_assign_addr_enc) { - vty_out(vty, "%%RAB Assignment Transport Layer Address" - " encoding not available%s", VTY_NEWLINE); - return CMD_WARNING; - } - - switch (*g_rab_assign_addr_enc) { - case NSAP_ADDR_ENC_V4RAW: - vty_out(vty, "%siu rab-assign-addr-enc v4raw%s", indent, - VTY_NEWLINE); - break; - case NSAP_ADDR_ENC_X213: - /* default value, no need to write anything */ - break; - default: - LOGP(0, LOGL_ERROR, "Invalid value for" - " net.iu.rab_assign_addr_enc: %d\n", - *g_rab_assign_addr_enc); - return CMD_WARNING; - } - - vty_out(vty, "%siu local-address point-code %s%s", indent, - osmo_ss7_pointcode_print(NULL, local_sccp_addr.pc), VTY_NEWLINE); - - return CMD_SUCCESS; -} - -void iu_vty_init(int iu_parent_node, enum nsap_addr_enc *rab_assign_addr_enc) -{ - g_rab_assign_addr_enc = rab_assign_addr_enc; - - install_element(CFG_LOG_NODE, &logging_asn_debug_cmd); - install_element(CFG_LOG_NODE, &logging_asn_xer_print_cmd); - install_element(iu_parent_node, &cfg_iu_rab_assign_addr_enc_cmd); - install_element(iu_parent_node, &cfg_iu_local_addr_pc_cmd); -} diff --git a/src/libmsc/Makefile.am b/src/libmsc/Makefile.am index 9f246b3..c9b8bb4 100644 --- a/src/libmsc/Makefile.am +++ b/src/libmsc/Makefile.am @@ -35,8 +35,6 @@ gsm_04_14.c \ gsm_04_80.c \ gsm_subscriber.c \ - iucs.c \ - iucs_ranap.c \ mncc.c \ mncc_builtin.c \ mncc_sock.c \ @@ -52,7 +50,12 @@ meas_feed.c \ subscr_conn.c \ $(NULL) -if !BUILD_IU +if BUILD_IU +libmsc_a_SOURCES += \ + iucs.c \ + iucs_ranap.c \ + $(NULL) +else libmsc_a_SOURCES += \ iu_dummy.c \ $(NULL) diff --git a/src/libmsc/a_iface_bssap.c b/src/libmsc/a_iface_bssap.c index 561ccde..e8a2293 100644 --- a/src/libmsc/a_iface_bssap.c +++ b/src/libmsc/a_iface_bssap.c @@ -29,7 +29,6 @@ #include #include #include -#include #include #include #include diff --git a/src/libmsc/gsm_04_08.c b/src/libmsc/gsm_04_08.c index b6746a5..21bc2b8 100644 --- a/src/libmsc/gsm_04_08.c +++ b/src/libmsc/gsm_04_08.c @@ -72,13 +72,11 @@ #include #include #include - -#include - #ifdef BUILD_IU -#include +#include #endif +#include #include #include @@ -3412,7 +3410,7 @@ #ifdef BUILD_IU DEBUGP(DMM, "-> SECURITY MODE CONTROL %s\n", vlr_subscr_name(conn->vsub)); - return iu_tx_sec_mode_cmd(conn->iu.ue_ctx, tuple, 0, 1); + return ranap_iu_tx_sec_mode_cmd(conn->iu.ue_ctx, &tuple->vec, 0, 1); #else LOGP(DMM, LOGL_ERROR, "Cannot send Security Mode Control over RAN_UTRAN_IU," " built without Iu support\n"); diff --git a/src/libmsc/gsm_subscriber.c b/src/libmsc/gsm_subscriber.c index 73361a1..09540c1 100644 --- a/src/libmsc/gsm_subscriber.c +++ b/src/libmsc/gsm_subscriber.c @@ -20,6 +20,8 @@ * */ +#include "../../bscconfig.h" + #include #include #include @@ -32,6 +34,12 @@ #include +#ifdef BUILD_IU +#include +#else +#include +#endif + #include #include #include @@ -40,7 +48,6 @@ #include #include #include -#include #include #include #include @@ -108,10 +115,10 @@ case RAN_GERAN_A: return a_iface_tx_paging(vsub->imsi, vsub->tmsi, vsub->lac); case RAN_UTRAN_IU: - return iu_page_cs(vsub->imsi, - vsub->tmsi == GSM_RESERVED_TMSI? - NULL : &vsub->tmsi, - vsub->lac); + return ranap_iu_page_cs(vsub->imsi, + vsub->tmsi == GSM_RESERVED_TMSI? + NULL : &vsub->tmsi, + vsub->lac); default: break; } diff --git a/src/libmsc/iu_dummy.c b/src/libmsc/iu_dummy.c index 1f5dffb..e9d335e 100644 --- a/src/libmsc/iu_dummy.c +++ b/src/libmsc/iu_dummy.c @@ -26,39 +26,39 @@ #include "../../bscconfig.h" #ifndef BUILD_IU -#include -#include +#include #include #include #include struct msgb; -struct ue_conn_ctx; +struct ranap_ue_conn_ctx; struct gsm_auth_tuple; struct RANAP_Cause; +struct osmo_auth_vector; -int iu_tx(struct msgb *msg, uint8_t sapi) +int ranap_iu_tx(struct msgb *msg, uint8_t sapi) { LOGP(DLGLOBAL, LOGL_INFO, "iu_tx() dummy called, NOT transmitting %d bytes: %s\n", msg->len, osmo_hexdump(msg->data, msg->len)); return 0; } -int iu_tx_sec_mode_cmd(struct ue_conn_ctx *uectx, struct gsm_auth_tuple *tp, - int send_ck) +int ranap_iu_tx_sec_mode_cmd(struct ranap_ue_conn_ctx *uectx, struct osmo_auth_vector *vec, + int send_ck) { LOGP(DLGLOBAL, LOGL_INFO, "iu_tx_sec_mode_cmd() dummy called, NOT transmitting Security Mode Command\n"); return 0; } -int iu_page_cs(const char *imsi, const uint32_t *tmsi, uint16_t lac) +int ranap_iu_page_cs(const char *imsi, const uint32_t *tmsi, uint16_t lac) { LOGP(DLGLOBAL, LOGL_INFO, "iu_page_cs() dummy called, NOT paging\n"); return 23; } -int iu_page_ps(const char *imsi, const uint32_t *ptmsi, uint16_t lac, uint8_t rac) +int ranap_iu_page_ps(const char *imsi, const uint32_t *ptmsi, uint16_t lac, uint8_t rac) { LOGP(DLGLOBAL, LOGL_INFO, "iu_page_ps() dummy called, NOT paging\n"); return 0; @@ -72,19 +72,19 @@ return NULL; } -int iu_rab_act(struct ue_conn_ctx *ue_ctx, struct msgb *msg) +int ranap_iu_rab_act(struct ranap_ue_conn_ctx *ue_ctx, struct msgb *msg) { LOGP(DLGLOBAL, LOGL_INFO, "iu_rab_act() dummy called, NOT activating RAB\n"); return 0; } -int iu_tx_common_id(struct ue_conn_ctx *uectx, const char *imsi) +int ranap_iu_tx_common_id(struct ranap_ue_conn_ctx *uectx, const char *imsi) { LOGP(DLGLOBAL, LOGL_INFO, "iu_tx_common_id() dummy called, NOT sending CommonID\n"); return 0; } -int iu_tx_release(struct ue_conn_ctx *ctx, const struct RANAP_Cause *cause) +int ranap_iu_tx_release(struct ranap_ue_conn_ctx *ctx, const struct RANAP_Cause *cause) { LOGP(DLGLOBAL, LOGL_INFO, "iu_tx_release() dummy called, NOT sending Release\n"); return 0; diff --git a/src/libmsc/iucs.c b/src/libmsc/iucs.c index be026c8..04b9ece 100644 --- a/src/libmsc/iucs.c +++ b/src/libmsc/iucs.c @@ -25,17 +25,17 @@ #include #include +#include #include #include -#include #include #include #include /* For A-interface see libbsc/bsc_api.c subscr_con_allocate() */ static struct gsm_subscriber_connection *subscr_conn_allocate_iu(struct gsm_network *network, - struct ue_conn_ctx *ue, + struct ranap_ue_conn_ctx *ue, uint16_t lac) { struct gsm_subscriber_connection *conn; @@ -57,7 +57,7 @@ return conn; } -static int same_ue_conn(struct ue_conn_ctx *a, struct ue_conn_ctx *b) +static int same_ue_conn(struct ranap_ue_conn_ctx *a, struct ranap_ue_conn_ctx *b) { if (a == b) return 1; @@ -103,7 +103,7 @@ * connection IDs, or return NULL if not found. */ struct gsm_subscriber_connection *subscr_conn_lookup_iu( struct gsm_network *network, - struct ue_conn_ctx *ue) + struct ranap_ue_conn_ctx *ue) { struct gsm_subscriber_connection *conn; @@ -126,7 +126,7 @@ } /* Receive MM/CC/... message from IuCS (SCCP user SAP). - * msg->dst must reference a struct ue_conn_ctx, which identifies the peer that + * msg->dst must reference a struct ranap_ue_conn_ctx, which identifies the peer that * sent the msg. * * For A-interface see libbsc/bsc_api.c gsm0408_rcvmsg(). */ @@ -134,10 +134,10 @@ uint16_t *lac) { int rc; - struct ue_conn_ctx *ue_ctx; + struct ranap_ue_conn_ctx *ue_ctx; struct gsm_subscriber_connection *conn; - ue_ctx = (struct ue_conn_ctx*)msg->dst; + ue_ctx = (struct ranap_ue_conn_ctx*)msg->dst; /* TODO: are there message types that could allow us to skip this * search? */ diff --git a/src/libmsc/iucs_ranap.c b/src/libmsc/iucs_ranap.c index c016474..45de1ca 100644 --- a/src/libmsc/iucs_ranap.c +++ b/src/libmsc/iucs_ranap.c @@ -27,11 +27,11 @@ #include #include +#include #include #include #include -#include #include #include #include @@ -67,7 +67,7 @@ } int iucs_rx_ranap_event(struct gsm_network *network, - struct ue_conn_ctx *ue_ctx, int type, void *data) + struct ranap_ue_conn_ctx *ue_ctx, int type, void *data) { struct gsm_subscriber_connection *conn; @@ -79,19 +79,19 @@ } switch (type) { - case IU_EVENT_IU_RELEASE: - case IU_EVENT_LINK_INVALIDATED: + case RANAP_IU_EVENT_IU_RELEASE: + case RANAP_IU_EVENT_LINK_INVALIDATED: LOGP(DIUCS, LOGL_INFO, "IuCS release for %s\n", vlr_subscr_name(conn->vsub)); msc_subscr_conn_close(conn, 0); return 0; - case IU_EVENT_SECURITY_MODE_COMPLETE: + case RANAP_IU_EVENT_SECURITY_MODE_COMPLETE: LOGP(DIUCS, LOGL_INFO, "IuCS security mode complete for %s\n", vlr_subscr_name(conn->vsub)); return iucs_rx_sec_mode_compl(conn, (RANAP_SecurityModeCompleteIEs_t*)data); - case IU_EVENT_RAB_ASSIGN: + case RANAP_IU_EVENT_RAB_ASSIGN: return iucs_rx_rab_assign(conn, (RANAP_RAB_SetupOrModifiedItemIEs_t*)data); default: diff --git a/src/libmsc/msc_ifaces.c b/src/libmsc/msc_ifaces.c index 7d2e898..262bf98 100644 --- a/src/libmsc/msc_ifaces.c +++ b/src/libmsc/msc_ifaces.c @@ -23,7 +23,6 @@ #include #include #include -#include #include #include #include @@ -34,10 +33,13 @@ #include "../../bscconfig.h" #ifdef BUILD_IU +#include extern struct msgb *ranap_new_msg_rab_assign_voice(uint8_t rab_id, uint32_t rtp_ip, uint16_t rtp_port, bool use_x213_nsap); +#else +#include #endif /* BUILD_IU */ static int msc_tx(struct gsm_subscriber_connection *conn, struct msgb *msg) @@ -57,7 +59,7 @@ case RAN_UTRAN_IU: msg->dst = conn->iu.ue_ctx; - return iu_tx(msg, 0); + return ranap_iu_tx(msg, 0); default: LOGP(DMSC, LOGL_ERROR, @@ -134,10 +136,10 @@ DEBUGP(DIUCS, "%s: tx CommonID %s\n", vlr_subscr_name(conn->vsub), conn->vsub->imsi); - return iu_tx_common_id(conn->iu.ue_ctx, conn->vsub->imsi); + return ranap_iu_tx_common_id(conn->iu.ue_ctx, conn->vsub->imsi); } -static int iu_rab_act_cs(struct ue_conn_ctx *uectx, uint8_t rab_id, +static int iu_rab_act_cs(struct ranap_ue_conn_ctx *uectx, uint8_t rab_id, uint32_t rtp_ip, uint16_t rtp_port) { #ifdef BUILD_IU @@ -145,7 +147,7 @@ bool use_x213_nsap; uint32_t conn_id = uectx->conn_id; - use_x213_nsap = (uectx->rab_assign_addr_enc == NSAP_ADDR_ENC_X213); + use_x213_nsap = (uectx->rab_assign_addr_enc == RANAP_NSAP_ADDR_ENC_X213); LOGP(DIUCS, LOGL_DEBUG, "Assigning RAB: conn_id=%u, rab_id=%d," " rtp=%x:%u, use_x213_nsap=%d\n", conn_id, rab_id, rtp_ip, @@ -155,7 +157,7 @@ use_x213_nsap); msg->l2h = msg->data; - if (iu_rab_act(uectx, msg)) + if (ranap_iu_rab_act(uectx, msg)) LOGP(DIUCS, LOGL_ERROR, "Failed to send RAB Assignment:" " conn_id=%d rab_id=%d rtp=%x:%u\n", conn_id, rab_id, rtp_ip, rtp_port); @@ -170,7 +172,6 @@ { struct gsm_trans *trans = priv; struct gsm_subscriber_connection *conn = trans->conn; - struct ue_conn_ctx *uectx = conn->iu.ue_ctx; uint32_t rtp_ip; int rc; @@ -195,7 +196,7 @@ if (trans->conn->via_ran == RAN_UTRAN_IU) { /* Assign a voice channel via RANAP on 3G */ - if (iu_rab_act_cs(uectx, conn->iu.rab_id, rtp_ip, conn->rtp.port_subscr)) + if (iu_rab_act_cs(conn->iu.ue_ctx, conn->iu.rab_id, rtp_ip, conn->rtp.port_subscr)) goto rab_act_cs_error; } else if (trans->conn->via_ran == RAN_GERAN_A) { /* Assign a voice channel via A on 2G */ @@ -234,7 +235,7 @@ mgcp = conn->network->mgcpgw.client; #ifdef BUILD_IU - /* FIXME: HACK. where to scope the RAB Id? At the conn / subscriber / ue_conn_ctx? */ + /* FIXME: HACK. where to scope the RAB Id? At the conn / subscriber / ranap_ue_conn_ctx? */ static uint8_t next_iu_rab_id = 1; if (conn->via_ran == RAN_UTRAN_IU) conn->iu.rab_id = next_iu_rab_id ++; diff --git a/src/libmsc/msc_vty.c b/src/libmsc/msc_vty.c index 01e7e82..6ae4529 100644 --- a/src/libmsc/msc_vty.c +++ b/src/libmsc/msc_vty.c @@ -23,15 +23,19 @@ /* NOTE: I would have liked to call this the MSC_NODE instead of the MSC_NODE, * but MSC_NODE already exists to configure a remote MSC for osmo-bsc. */ +#include "../../bscconfig.h" + #include #include +#ifdef BUILD_IU +#include +#endif #include #include #include #include -#include static struct cmd_node msc_node = { MSC_NODE, @@ -99,7 +103,7 @@ mgcpgw_client_config_write(vty, " "); #ifdef BUILD_IU - iu_vty_config_write(vty, " "); + ranap_iu_vty_config_write(vty, " "); #endif return CMD_SUCCESS; @@ -153,6 +157,6 @@ mgcpgw_client_vty_init(MSC_NODE, &msc_network->mgcpgw.conf); #ifdef BUILD_IU - iu_vty_init(MSC_NODE, &msc_network->iu.rab_assign_addr_enc); + ranap_iu_vty_init(MSC_NODE, &msc_network->iu.rab_assign_addr_enc); #endif } diff --git a/src/libmsc/osmo_msc.c b/src/libmsc/osmo_msc.c index 866cfbd..4d24f22 100644 --- a/src/libmsc/osmo_msc.c +++ b/src/libmsc/osmo_msc.c @@ -28,10 +28,16 @@ #include #include #include -#include #include #include + +#include "../../bscconfig.h" +#ifdef BUILD_IU +#include +#else +#include +#endif /* Receive a SAPI-N-REJECT from BSC */ void msc_sapi_n_reject(struct gsm_subscriber_connection *conn, int dlci) @@ -285,7 +291,7 @@ switch (conn->via_ran) { case RAN_UTRAN_IU: - iu_tx_release(conn->iu.ue_ctx, NULL); + ranap_iu_tx_release(conn->iu.ue_ctx, NULL); /* FIXME: keep the conn until the Iu Release Outcome is * received from the UE, or a timeout expires. For now, the log * says "unknown UE" for each release outcome. */ diff --git a/src/libmsc/subscr_conn.c b/src/libmsc/subscr_conn.c index cdeeae9..bcab8e4 100644 --- a/src/libmsc/subscr_conn.c +++ b/src/libmsc/subscr_conn.c @@ -30,9 +30,7 @@ #include #include #include -#include #include - #define SUBSCR_CONN_TIMEOUT 5 /* seconds */ diff --git a/src/osmo-msc/Makefile.am b/src/osmo-msc/Makefile.am index bd734d1..87b6133 100644 --- a/src/osmo-msc/Makefile.am +++ b/src/osmo-msc/Makefile.am @@ -50,7 +50,6 @@ $(NULL) if BUILD_IU osmo_msc_LDADD += \ - $(top_builddir)/src/libiu/libiu.a \ $(LIBOSMORANAP_LIBS) \ $(LIBASN1C_LIBS) \ $(NULL) diff --git a/src/osmo-msc/msc_main.c b/src/osmo-msc/msc_main.c index cd713ee..de6af5d 100644 --- a/src/osmo-msc/msc_main.c +++ b/src/osmo-msc/msc_main.c @@ -66,9 +66,11 @@ #include #include -#include +#ifdef BUILD_IU +#include +#endif -#include +#include #include #include #include @@ -312,6 +314,7 @@ .is_config_node = bsc_vty_is_config_node, }; +#ifdef BUILD_IU static int rcvmsg_iu_cs(struct msgb *msg, struct gprs_ra_id *ra_id, uint16_t *sai) { DEBUGP(DIUCS, "got IuCS message" @@ -326,14 +329,15 @@ return gsm0408_rcvmsg_iucs(msc_network, msg, ra_id? &ra_id->lac : NULL); } -static int rx_iu_event(struct ue_conn_ctx *ctx, enum iu_event_type type, +static int rx_iu_event(struct ranap_ue_conn_ctx *ctx, enum ranap_iu_event_type type, void *data) { DEBUGP(DIUCS, "got IuCS event %u: %s\n", type, - iu_event_type_str(type)); + ranap_iu_event_type_str(type)); return iucs_rx_ranap_event(msc_network, ctx, type, data); } +#endif #define DEFAULT_M3UA_REMOTE_IP "127.0.0.1" #define DEFAULT_PC_A "0.23.1" @@ -564,7 +568,7 @@ #ifdef BUILD_IU /* Set up IuCS */ - iu_init(tall_msc_ctx, msc_network->iu.sccp, rcvmsg_iu_cs, rx_iu_event); + ranap_iu_init(tall_msc_ctx, DRANAP, "OsmoMSC-IuCS", msc_network->iu.sccp, rcvmsg_iu_cs, rx_iu_event); #endif /* Set up A interface */ diff --git a/tests/msc_vlr/Makefile.am b/tests/msc_vlr/Makefile.am index 6d51d6e..3ae0c84 100644 --- a/tests/msc_vlr/Makefile.am +++ b/tests/msc_vlr/Makefile.am @@ -50,13 +50,6 @@ $(top_builddir)/src/libtrau/libtrau.a \ $(top_builddir)/src/libmgcp/libmgcp.a \ $(top_builddir)/src/libcommon/libcommon.a \ - $(NULL) -if BUILD_IU -COMMON_LDADD += \ - $(top_builddir)/src/libiu/libiu.a \ - $(NULL) -endif -COMMON_LDADD += \ $(LIBSMPP34_LIBS) \ $(LIBOSMOCORE_LIBS) \ $(LIBOSMOGSM_LIBS) \ @@ -76,10 +69,10 @@ -Wl,--wrap=a_iface_tx_dtap \ -Wl,--wrap=a_iface_tx_clear_cmd \ -Wl,--wrap=a_iface_tx_paging \ - -Wl,--wrap=iu_tx \ - -Wl,--wrap=iu_tx_release \ - -Wl,--wrap=iu_tx_common_id \ - -Wl,--wrap=iu_page_cs \ + -Wl,--wrap=ranap_iu_tx \ + -Wl,--wrap=ranap_iu_tx_release \ + -Wl,--wrap=ranap_iu_tx_common_id \ + -Wl,--wrap=ranap_iu_page_cs \ -Wl,--wrap=msc_stop_paging \ -Wl,--wrap=gsm340_gen_scts \ -Wl,--wrap=RAND_bytes \ diff --git a/tests/msc_vlr/msc_vlr_tests.c b/tests/msc_vlr/msc_vlr_tests.c index a45b10f..3966aac 100644 --- a/tests/msc_vlr/msc_vlr_tests.c +++ b/tests/msc_vlr/msc_vlr_tests.c @@ -34,8 +34,13 @@ #include #include #include -#include + +#if BUILD_IU #include +#include +#else +#include +#endif #include "msc_vlr_tests.h" @@ -152,8 +157,8 @@ conn->bts = the_bts; conn->via_ran = rx_from_ran; if (conn->via_ran == RAN_UTRAN_IU) { - struct ue_conn_ctx *ue_ctx = talloc_zero(conn, struct ue_conn_ctx); - *ue_ctx = (struct ue_conn_ctx){ + struct ranap_ue_conn_ctx *ue_ctx = talloc_zero(conn, struct ranap_ue_conn_ctx); + *ue_ctx = (struct ranap_ue_conn_ctx){ .conn_id = 42, }; conn->iu.ue_ctx = ue_ctx; @@ -295,9 +300,9 @@ return 1; } -/* override, requires '-Wl,--wrap=iu_page_cs' */ -int __real_iu_page_cs(const char *imsi, const uint32_t *tmsi, uint16_t lac); -int __wrap_iu_page_cs(const char *imsi, const uint32_t *tmsi, uint16_t lac) +/* override, requires '-Wl,--wrap=ranap_iu_page_cs' */ +int __real_ranap_iu_page_cs(const char *imsi, const uint32_t *tmsi, uint16_t lac); +int __wrap_ranap_iu_page_cs(const char *imsi, const uint32_t *tmsi, uint16_t lac) { return _paging_sent(RAN_UTRAN_IU, imsi, tmsi ? *tmsi : GSM_RESERVED_TMSI, lac); } @@ -472,16 +477,16 @@ return 0; } -/* override, requires '-Wl,--wrap=iu_tx' */ -int __real_iu_tx(struct msgb *msg, uint8_t sapi); -int __wrap_iu_tx(struct msgb *msg, uint8_t sapi) +/* override, requires '-Wl,--wrap=ranap_iu_tx' */ +int __real_ranap_iu_tx(struct msgb *msg, uint8_t sapi); +int __wrap_ranap_iu_tx(struct msgb *msg, uint8_t sapi) { return _validate_dtap(msg, RAN_UTRAN_IU); } -/* override, requires '-Wl,--wrap=iu_tx_release' */ -int __real_iu_tx_release(struct ue_conn_ctx *ctx, const struct RANAP_Cause *cause); -int __wrap_iu_tx_release(struct ue_conn_ctx *ctx, const struct RANAP_Cause *cause) +/* override, requires '-Wl,--wrap=ranap_iu_tx_release' */ +int __real_ranap_iu_tx_release(struct ranap_ue_conn_ctx *ctx, const struct RANAP_Cause *cause); +int __wrap_ranap_iu_tx_release(struct ranap_ue_conn_ctx *ctx, const struct RANAP_Cause *cause) { btw("Iu Release --%s--> MS", ran_type_name(RAN_UTRAN_IU)); OSMO_ASSERT(iu_release_expected); @@ -491,8 +496,8 @@ } /* override, requires '-Wl,--wrap=iu_tx_common_id' */ -int __real_iu_tx_common_id(struct ue_conn_ctx *ue_ctx, const char *imsi); -int __wrap_iu_tx_common_id(struct ue_conn_ctx *ue_ctx, const char *imsi) +int __real_ranap_iu_tx_common_id(struct ranap_ue_conn_ctx *ue_ctx, const char *imsi); +int __wrap_ranap_iu_tx_common_id(struct ranap_ue_conn_ctx *ue_ctx, const char *imsi) { btw("Iu Common ID --%s--> MS (IMSI=%s)", ran_type_name(RAN_UTRAN_IU), imsi); return 0; diff --git a/tests/sgsn/Makefile.am b/tests/sgsn/Makefile.am index f1606cb..ccb8f44 100644 --- a/tests/sgsn/Makefile.am +++ b/tests/sgsn/Makefile.am @@ -74,7 +74,6 @@ if BUILD_IU sgsn_test_LDADD += \ - $(top_builddir)/src/libiu/libiu.a \ $(LIBOSMORANAP_LIBS) \ $(LIBOSMOSIGTRAN_LIBS) \ $(LIBASN1C_LIBS) \ diff --git a/tests/sms_queue/Makefile.am b/tests/sms_queue/Makefile.am index d17f996..62c479b 100644 --- a/tests/sms_queue/Makefile.am +++ b/tests/sms_queue/Makefile.am @@ -37,13 +37,6 @@ $(top_builddir)/src/libmgcp/libmgcp.a \ $(top_builddir)/src/libcommon/libcommon.a \ $(top_builddir)/src/libcommon-cs/libcommon-cs.a \ - $(NULL) -if BUILD_IU -sms_queue_test_LDADD += \ - $(top_builddir)/src/libiu/libiu.a \ - $(NULL) -endif -sms_queue_test_LDADD += \ $(LIBSMPP34_LIBS) \ $(LIBOSMOCORE_LIBS) \ $(LIBOSMOGSM_LIBS) \ -- To view, visit https://gerrit.osmocom.org/3489 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ib8c4fcdb4766c5e575618b95ce16dce51063206b Gerrit-PatchSet: 5 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sun Aug 27 02:25:23 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sun, 27 Aug 2017 02:25:23 +0000 Subject: [PATCH] osmo-msc[master]: split off osmo-msc: remove files, apply build, rename In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3497 to look at the new patch set (#5). split off osmo-msc: remove files, apply build, rename Change-Id: Icf025e5ea8d180613b3114282951c9afa67af9a7 --- M configure.ac D debian/osmo-gtphub.default D debian/osmo-gtphub.examples D debian/osmo-gtphub.init D debian/osmo-gtphub.install D debian/osmocom-bs11-utils.install D debian/osmocom-bsc-nat.init D debian/osmocom-bsc-nat.install D debian/osmocom-bsc.examples D debian/osmocom-bsc.install D debian/osmocom-gbproxy.init D debian/osmocom-gbproxy.install D debian/osmocom-ipaccess-utils.install D debian/osmocom-sgsn.default D debian/osmocom-sgsn.examples D debian/osmocom-sgsn.init D debian/osmocom-sgsn.install D doc/BS11-OML.txt D doc/channel_release.txt D doc/examples/osmo-bsc/osmo-bsc.cfg D doc/examples/osmo-bsc_mgcp/mgcp.cfg D doc/examples/osmo-bsc_nat/black-list.cfg D doc/examples/osmo-bsc_nat/osmo-bsc_nat.cfg D doc/examples/osmo-gbproxy/osmo-gbproxy-legacy.cfg D doc/examples/osmo-gbproxy/osmo-gbproxy.cfg D doc/examples/osmo-gtphub/gtphub-example.txt D doc/examples/osmo-gtphub/osmo-gtphub-1iface.cfg D doc/examples/osmo-gtphub/osmo-gtphub.cfg D doc/examples/osmo-sgsn/osmo-sgsn.cfg D doc/oml-interface.txt M include/Makefile.am D include/compat_af_isdn.h D include/mISDNif.h M include/openbsc/Makefile.am D include/openbsc/bsc_nat.h D include/openbsc/bsc_nat_callstats.h D include/openbsc/bsc_nat_sccp.h D include/openbsc/bsc_subscriber.h D include/openbsc/gb_proxy.h D include/openbsc/gprs_gb_parse.h D include/openbsc/gprs_gmm.h D include/openbsc/gprs_llc.h D include/openbsc/gprs_llc_xid.h D include/openbsc/gprs_sgsn.h D include/openbsc/gprs_sndcp.h D include/openbsc/gprs_sndcp_comp.h D include/openbsc/gprs_sndcp_dcomp.h D include/openbsc/gprs_sndcp_pcomp.h D include/openbsc/gprs_sndcp_xid.h D include/openbsc/gprs_subscriber.h D include/openbsc/gprs_utils.h D include/openbsc/nat_rewrite_trie.h M include/openbsc/paging.h D include/openbsc/pcu_if.h D include/openbsc/pcuif_proto.h D include/openbsc/sgsn.h D include/openbsc/v42bis.h D include/openbsc/v42bis_private.h M osmoappdesc.py M src/Makefile.am D src/gprs/.gitignore D src/gprs/Makefile.am D src/gprs/crc24.c D src/gprs/gb_proxy.c D src/gprs/gb_proxy_main.c D src/gprs/gb_proxy_patch.c D src/gprs/gb_proxy_peer.c D src/gprs/gb_proxy_tlli.c D src/gprs/gb_proxy_vty.c D src/gprs/gprs_gb_parse.c D src/gprs/gprs_gmm.c D src/gprs/gprs_llc.c D src/gprs/gprs_llc_parse.c D src/gprs/gprs_llc_vty.c D src/gprs/gprs_llc_xid.c D src/gprs/gprs_sgsn.c D src/gprs/gprs_sndcp.c D src/gprs/gprs_sndcp_comp.c D src/gprs/gprs_sndcp_dcomp.c D src/gprs/gprs_sndcp_pcomp.c D src/gprs/gprs_sndcp_vty.c D src/gprs/gprs_sndcp_xid.c D src/gprs/gprs_subscriber.c D src/gprs/gprs_utils.c D src/gprs/gtphub.c D src/gprs/gtphub_ares.c D src/gprs/gtphub_main.c D src/gprs/gtphub_sock.c D src/gprs/gtphub_vty.c D src/gprs/osmo_sgsn.cfg D src/gprs/sgsn_ares.c D src/gprs/sgsn_auth.c D src/gprs/sgsn_cdr.c D src/gprs/sgsn_ctrl.c D src/gprs/sgsn_libgtp.c D src/gprs/sgsn_main.c D src/gprs/sgsn_vty.c D src/gprs/slhc.c D src/gprs/v42bis.c D src/ipaccess/Makefile.am D src/ipaccess/abisip-find.c D src/ipaccess/ipaccess-config.c D src/ipaccess/ipaccess-firmware.c D src/ipaccess/ipaccess-proxy.c D src/ipaccess/network_listen.c D src/libbsc/Makefile.am D src/libbsc/abis_nm.c D src/libbsc/abis_nm_ipaccess.c D src/libbsc/abis_nm_vty.c D src/libbsc/abis_om2000.c D src/libbsc/abis_om2000_vty.c D src/libbsc/abis_rsl.c D src/libbsc/arfcn_range_encode.c D src/libbsc/bsc_api.c D src/libbsc/bsc_ctrl_commands.c D src/libbsc/bsc_ctrl_lookup.c D src/libbsc/bsc_dyn_ts.c D src/libbsc/bsc_init.c D src/libbsc/bsc_msc.c D src/libbsc/bsc_rf_ctrl.c D src/libbsc/bsc_rll.c D src/libbsc/bsc_subscriber.c D src/libbsc/bsc_vty.c D src/libbsc/bts_ericsson_rbs2000.c D src/libbsc/bts_init.c D src/libbsc/bts_ipaccess_nanobts.c D src/libbsc/bts_ipaccess_nanobts_omlattr.c D src/libbsc/bts_nokia_site.c D src/libbsc/bts_siemens_bs11.c D src/libbsc/bts_sysmobts.c D src/libbsc/bts_unknown.c D src/libbsc/chan_alloc.c D src/libbsc/e1_config.c D src/libbsc/gsm_04_08_utils.c D src/libbsc/gsm_04_80_utils.c D src/libbsc/handover_decision.c D src/libbsc/handover_logic.c D src/libbsc/meas_proc.c D src/libbsc/meas_rep.c D src/libbsc/net_init.c D src/libbsc/paging.c D src/libbsc/pcu_sock.c D src/libbsc/rest_octets.c D src/libbsc/system_information.c M src/libcommon/common_vty.c D src/libfilter/Makefile.am D src/libfilter/bsc_msg_acc.c D src/libfilter/bsc_msg_filter.c D src/libfilter/bsc_msg_vty.c M src/libmsc/vty_interface_layer3.c D src/libtrau/Makefile.am D src/libtrau/rtp_proxy.c D src/libtrau/trau_mux.c D src/libtrau/trau_upqueue.c M src/libvlr/vlr.c D src/osmo-bsc/Makefile.am D src/osmo-bsc/osmo_bsc_api.c D src/osmo-bsc/osmo_bsc_audio.c D src/osmo-bsc/osmo_bsc_bssap.c D src/osmo-bsc/osmo_bsc_ctrl.c D src/osmo-bsc/osmo_bsc_filter.c D src/osmo-bsc/osmo_bsc_grace.c D src/osmo-bsc/osmo_bsc_main.c D src/osmo-bsc/osmo_bsc_msc.c D src/osmo-bsc/osmo_bsc_reset.c D src/osmo-bsc/osmo_bsc_sigtran.c D src/osmo-bsc/osmo_bsc_vty.c D src/osmo-bsc_nat/Makefile.am D src/osmo-bsc_nat/bsc_filter.c D src/osmo-bsc_nat/bsc_mgcp_utils.c D src/osmo-bsc_nat/bsc_nat.c D src/osmo-bsc_nat/bsc_nat_ctrl.c D src/osmo-bsc_nat/bsc_nat_filter.c D src/osmo-bsc_nat/bsc_nat_rewrite.c D src/osmo-bsc_nat/bsc_nat_rewrite_trie.c D src/osmo-bsc_nat/bsc_nat_utils.c D src/osmo-bsc_nat/bsc_nat_vty.c D src/osmo-bsc_nat/bsc_sccp.c D src/osmo-bsc_nat/bsc_ussd.c M src/osmo-msc/Makefile.am M src/utils/Makefile.am D src/utils/bs11_config.c D src/utils/isdnsync.c M tests/Makefile.am D tests/abis/Makefile.am D tests/abis/abis_test.c D tests/abis/abis_test.ok D tests/bsc-nat-trie/Makefile.am D tests/bsc-nat-trie/bsc_nat_trie_test.c D tests/bsc-nat-trie/bsc_nat_trie_test.ok D tests/bsc-nat-trie/prefixes.csv D tests/bsc-nat/Makefile.am D tests/bsc-nat/barr.cfg D tests/bsc-nat/barr_dup.cfg D tests/bsc-nat/bsc_data.c D tests/bsc-nat/bsc_nat_test.c D tests/bsc-nat/bsc_nat_test.ok D tests/bsc-nat/prefixes.csv D tests/bsc/Makefile.am D tests/bsc/bsc_test.c D tests/bsc/bsc_test.ok D tests/channel/Makefile.am D tests/channel/channel_test.c D tests/channel/channel_test.ok D tests/gbproxy/Makefile.am D tests/gbproxy/gbproxy_test.c D tests/gbproxy/gbproxy_test.ok D tests/gprs/Makefile.am D tests/gprs/gprs_test.c D tests/gprs/gprs_test.ok D tests/gsm0408/Makefile.am D tests/gsm0408/gsm0408_test.c D tests/gsm0408/gsm0408_test.ok D tests/gtphub/Makefile.am D tests/gtphub/gtphub_test.c D tests/gtphub/gtphub_test.ok M tests/msc_vlr/Makefile.am M tests/msc_vlr/msc_vlr_tests.c D tests/nanobts_omlattr/Makefile.am D tests/nanobts_omlattr/nanobts_omlattr_test.c D tests/nanobts_omlattr/nanobts_omlattr_test.ok D tests/oap/Makefile.am D tests/oap/oap_client_test.c D tests/oap/oap_client_test.err D tests/oap/oap_client_test.ok D tests/sgsn/Makefile.am D tests/sgsn/sgsn_test.c D tests/sgsn/sgsn_test.ok D tests/slhc/Makefile.am D tests/slhc/slhc_test.c D tests/slhc/slhc_test.ok M tests/sms_queue/Makefile.am D tests/sndcp_xid/Makefile.am D tests/sndcp_xid/sndcp_xid_test.c D tests/sndcp_xid/sndcp_xid_test.ok D tests/subscr/Makefile.am D tests/subscr/bsc_subscr_test.c D tests/subscr/bsc_subscr_test.err D tests/subscr/bsc_subscr_test.ok M tests/testsuite.at D tests/trau/Makefile.am D tests/trau/trau_test.c D tests/trau/trau_test.ok D tests/v42bis/Makefile.am D tests/v42bis/v42bis_test.c D tests/v42bis/v42bis_test.ok M tests/vty_test_runner.py D tests/xid/Makefile.am D tests/xid/xid_test.c D tests/xid/xid_test.ok D tools/hlrstat.pl 251 files changed, 17 insertions(+), 100,392 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/97/3497/5 -- To view, visit https://gerrit.osmocom.org/3497 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Icf025e5ea8d180613b3114282951c9afa67af9a7 Gerrit-PatchSet: 5 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Sun Aug 27 02:39:26 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sun, 27 Aug 2017 02:39:26 +0000 Subject: [PATCH] osmo-msc[master]: add msg type to SMS rx logging 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/3496 to look at the new patch set (#6). add msg type to SMS rx logging Change-Id: I73ea4eebe57b2d1008045a27f174072178b9f077 --- M src/libmsc/gsm_04_11.c 1 file changed, 3 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/96/3496/6 diff --git a/src/libmsc/gsm_04_11.c b/src/libmsc/gsm_04_11.c index c5bcce7..574fe28 100644 --- a/src/libmsc/gsm_04_11.c +++ b/src/libmsc/gsm_04_11.c @@ -917,7 +917,9 @@ return -EIO; /* FIXME: send some error message */ - DEBUGP(DLSMS, "receiving data (trans_id=%x)\n", transaction_id); + DEBUGP(DLSMS, "receiving data (trans_id=%x, msg_type=%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); /* -- To view, visit https://gerrit.osmocom.org/3496 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I73ea4eebe57b2d1008045a27f174072178b9f077 Gerrit-PatchSet: 6 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sun Aug 27 02:46:13 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sun, 27 Aug 2017 02:46:13 +0000 Subject: [MERGED] openbsc[master]: Revert "factor out & introduce struct gsm_encr, in common_cs.h" In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: Revert "factor out & introduce struct gsm_encr, in common_cs.h" ...................................................................... Revert "factor out & introduce struct gsm_encr, in common_cs.h" This reverts commit ac1f1436e9d380f632dd850fcd253d3480f0fc2d. common_cs.h added to gsm_data_shared.h was a mistake, i.e. I added the dependency by accident. Including common_cs.h in the debian installation may have seemed like the logical consequence but was not intended. AFAICT for osmo-msc, the need for struct gsm_encr is obsoleted by libvlr, gsm_encr will only be used in osmo-bsc and can just stay an inline struct. Related: OS#2272 Change-Id: I15d60441c6c6f053486c0482258a8759bdd92df1 --- M openbsc/include/openbsc/common_cs.h M openbsc/include/openbsc/gsm_data_shared.h 2 files changed, 6 insertions(+), 11 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/openbsc/include/openbsc/common_cs.h b/openbsc/include/openbsc/common_cs.h index 6dc956f..4282064 100644 --- a/openbsc/include/openbsc/common_cs.h +++ b/openbsc/include/openbsc/common_cs.h @@ -9,14 +9,6 @@ struct vty; -#define MAX_A5_KEY_LEN (128/8) - -struct gsm_encr { - uint8_t alg_id; - uint8_t key_len; - uint8_t key[MAX_A5_KEY_LEN]; -}; - struct gsm_network *gsm_network_init(void *ctx, uint16_t country_code, uint16_t network_code, diff --git a/openbsc/include/openbsc/gsm_data_shared.h b/openbsc/include/openbsc/gsm_data_shared.h index 369668d..6b2269e 100644 --- a/openbsc/include/openbsc/gsm_data_shared.h +++ b/openbsc/include/openbsc/gsm_data_shared.h @@ -24,8 +24,6 @@ #include #endif -#include - /* 16 is the max. number of SI2quater messages according to 3GPP TS 44.018 Table 10.5.2.33b.1: 4-bit index is used (2#1111 = 10#15) */ #define SI2Q_MAX_NUM 16 @@ -131,6 +129,7 @@ struct osmo_fsm_inst *fsm; }; +#define MAX_A5_KEY_LEN (128/8) #define A38_XOR_MIN_KEY_LEN 12 #define A38_XOR_MAX_KEY_LEN 16 #define A38_COMP128_KEY_LEN 16 @@ -232,7 +231,11 @@ uint8_t bs_power; uint8_t ms_power; /* Encryption information */ - struct gsm_encr encr; + struct { + uint8_t alg_id; + uint8_t key_len; + uint8_t key[MAX_A5_KEY_LEN]; + } encr; /* AMR bits */ uint8_t mr_ms_lv[7]; -- To view, visit https://gerrit.osmocom.org/3570 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I15d60441c6c6f053486c0482258a8759bdd92df1 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Sun Aug 27 03:04:50 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sun, 27 Aug 2017 03:04:50 +0000 Subject: [PATCH] osmo-msc[master]: replace internal libmgcp with libosmo-legacy-mgcp In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3492 to look at the new patch set (#6). replace internal libmgcp with libosmo-legacy-mgcp libosmo-legacy-mgcp is installed from osmo-mgw, hence add the dependency to jenkins.sh (so far using the pre_release branch). Change-Id: Ic99d681759edce11564da62500c2aac5cf5fffe2 --- M configure.ac M contrib/jenkins.sh M include/openbsc/Makefile.am M include/openbsc/bsc_nat.h M include/openbsc/gsm_data.h D include/openbsc/mgcp.h D include/openbsc/mgcp_internal.h D include/openbsc/mgcp_transcode.h D include/openbsc/mgcpgw_client.h M src/Makefile.am M src/libfilter/bsc_msg_acc.c D src/libmgcp/Makefile.am D src/libmgcp/g711common.h D src/libmgcp/mgcp_common.c D src/libmgcp/mgcp_network.c D src/libmgcp/mgcp_osmux.c D src/libmgcp/mgcp_protocol.c D src/libmgcp/mgcp_sdp.c D src/libmgcp/mgcp_transcode.c D src/libmgcp/mgcp_vty.c D src/libmgcp/mgcpgw_client.c D src/libmgcp/mgcpgw_client_vty.c M src/libmsc/a_iface.c M src/libmsc/msc_ifaces.c M src/libmsc/msc_vty.c M src/osmo-bsc/osmo_bsc_bssap.c D src/osmo-bsc_mgcp/Makefile.am D src/osmo-bsc_mgcp/mgcp_main.c M src/osmo-bsc_nat/bsc_mgcp_utils.c M src/osmo-bsc_nat/bsc_nat_ctrl.c M src/osmo-bsc_nat/bsc_nat_vty.c M src/osmo-bsc_nat/bsc_ussd.c M src/osmo-msc/Makefile.am M src/osmo-msc/msc_main.c M tests/Makefile.am D tests/mgcp/Makefile.am D tests/mgcp/mgcp_test.c D tests/mgcp/mgcp_test.ok D tests/mgcp/mgcp_transcoding_test.c D tests/mgcp/mgcp_transcoding_test.ok D tests/mgcp/mgcpgw_client_test.c D tests/mgcp/mgcpgw_client_test.err D tests/mgcp/mgcpgw_client_test.ok M tests/msc_vlr/Makefile.am M tests/sms_queue/Makefile.am M tests/testsuite.at 46 files changed, 30 insertions(+), 11,356 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/92/3492/6 -- To view, visit https://gerrit.osmocom.org/3492 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ic99d681759edce11564da62500c2aac5cf5fffe2 Gerrit-PatchSet: 6 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sun Aug 27 05:52:54 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 27 Aug 2017 05:52:54 +0000 Subject: openbsc[master]: Use verify_value_string_arrays_are_terminated from osmo-ci In-Reply-To: References: Message-ID: Patch Set 5: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3692 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ibe4a7f71d2557dfee94803e909dabb00d2ce10af Gerrit-PatchSet: 5 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sun Aug 27 05:53:03 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 27 Aug 2017 05:53:03 +0000 Subject: [MERGED] openbsc[master]: Use verify_value_string_arrays_are_terminated from osmo-ci In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Use verify_value_string_arrays_are_terminated from osmo-ci ...................................................................... Use verify_value_string_arrays_are_terminated from osmo-ci verify_value_string_arrays_are_terminated has recently been moved from libosmocore.git to osmo-ci.git and the person doing this seems to have forgotten to update openbsc.git Change-Id: Ibe4a7f71d2557dfee94803e909dabb00d2ce10af --- M contrib/jenkins.sh 1 file changed, 2 insertions(+), 3 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/contrib/jenkins.sh b/contrib/jenkins.sh index 7e7ccf0..892d721 100755 --- a/contrib/jenkins.sh +++ b/contrib/jenkins.sh @@ -17,9 +17,7 @@ mkdir "$deps" || true rm -rf "$inst" -osmo-build-dep.sh libosmocore "" ac_cv_path_DOXYGEN=false - -"$deps"/libosmocore/contrib/verify_value_string_arrays_are_terminated.py $(find . -name "*.[hc]") +verify_value_string_arrays_are_terminated.py $(find . -name "*.[hc]") export PKG_CONFIG_PATH="$inst/lib/pkgconfig:$PKG_CONFIG_PATH" export LD_LIBRARY_PATH="$inst/lib" @@ -29,6 +27,7 @@ osmo_iuh_branch="old_sua" fi +osmo-build-dep.sh libosmocore osmo-build-dep.sh libosmo-abis osmo-build-dep.sh libosmo-netif osmo-build-dep.sh libosmo-sccp $sccp_branch -- To view, visit https://gerrit.osmocom.org/3692 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ibe4a7f71d2557dfee94803e909dabb00d2ce10af Gerrit-PatchSet: 6 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sun Aug 27 15:25:56 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sun, 27 Aug 2017 15:25:56 +0000 Subject: [PATCH] osmo-msc[master]: move libiu to osmo-iuh/libosmo-ranap 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/3489 to look at the new patch set (#6). move libiu to osmo-iuh/libosmo-ranap Remove libiu here, use the functions from libosmo-ranap instead, by applying the ranap_ / RANAP_ prefix. Corresponding change-id in osmo-iuh.git is I6a3f7ad15be03fb94689b4af6ccfa828c25f45c0 To be able to run the msc_vlr tests for RAN_UTRAN_IU without Iu client headers available, add iu_dummy.h, containing mere function signatures that match iu_dummy.c and a mostly empty struct ranap_ue_conn_ctx. Make sure we can build with and without --enable-iu: include osmo-iuh headers only with --enable-iu. Change-Id: Ib8c4fcdb4766c5e575618b95ce16dce51063206b --- M configure.ac M include/openbsc/Makefile.am M include/openbsc/gprs_sgsn.h M include/openbsc/gsm_data.h D include/openbsc/iu.h A include/openbsc/iu_dummy.h M include/openbsc/iucs.h M include/openbsc/iucs_ranap.h M include/openbsc/sgsn.h M src/Makefile.am M src/gprs/Makefile.am M src/gprs/gprs_gmm.c M src/gprs/gprs_sgsn.c M src/gprs/sgsn_libgtp.c M src/gprs/sgsn_main.c M src/gprs/sgsn_vty.c D src/libiu/Makefile.am D src/libiu/iu.c D src/libiu/iu_vty.c M src/libmsc/Makefile.am M src/libmsc/a_iface_bssap.c M src/libmsc/gsm_04_08.c M src/libmsc/gsm_subscriber.c M src/libmsc/iu_dummy.c M src/libmsc/iucs.c M src/libmsc/iucs_ranap.c M src/libmsc/msc_ifaces.c M src/libmsc/msc_vty.c M src/libmsc/osmo_msc.c M src/libmsc/subscr_conn.c M src/osmo-msc/Makefile.am M src/osmo-msc/msc_main.c M tests/msc_vlr/Makefile.am M tests/msc_vlr/msc_vlr_tests.c M tests/sgsn/Makefile.am M tests/sms_queue/Makefile.am 36 files changed, 213 insertions(+), 1,150 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/89/3489/6 diff --git a/configure.ac b/configure.ac index 87800fc..7045132 100644 --- a/configure.ac +++ b/configure.ac @@ -229,7 +229,6 @@ src/libmgcp/Makefile src/libcommon/Makefile src/libfilter/Makefile - src/libiu/Makefile src/libcommon-cs/Makefile src/osmo-msc/Makefile src/osmo-bsc/Makefile diff --git a/include/openbsc/Makefile.am b/include/openbsc/Makefile.am index 25709f1..89e0338 100644 --- a/include/openbsc/Makefile.am +++ b/include/openbsc/Makefile.am @@ -49,9 +49,9 @@ handover.h \ handover_decision.h \ ipaccess.h \ - iu.h \ iucs.h \ iucs_ranap.h \ + iu_dummy.h \ meas_feed.h \ meas_rep.h \ mgcp.h \ diff --git a/include/openbsc/gprs_sgsn.h b/include/openbsc/gprs_sgsn.h index 4e49c08..57995e0 100644 --- a/include/openbsc/gprs_sgsn.h +++ b/include/openbsc/gprs_sgsn.h @@ -117,7 +117,7 @@ uint16_t pdp_status; }; -struct ue_conn_ctx; +struct ranap_ue_conn_ctx; /* According to TS 03.60, Table 5: SGSN MM and PDP Contexts */ /* Extended by 3GPP TS 23.060, Table 6: SGSN MM and PDP Contexts */ @@ -159,7 +159,7 @@ /* CSG Subscription Data */ /* LIPA Allowed */ /* Voice Support Match Indicator */ - struct ue_conn_ctx *ue_ctx; + struct ranap_ue_conn_ctx *ue_ctx; struct service_info service; } iu; /* VLR number */ diff --git a/include/openbsc/gsm_data.h b/include/openbsc/gsm_data.h index 43fc6d3..6079900 100644 --- a/include/openbsc/gsm_data.h +++ b/include/openbsc/gsm_data.h @@ -30,7 +30,7 @@ struct bsc_subscr; struct vlr_instance; struct vlr_subscr; -struct ue_conn_ctx; +struct ranap_ue_conn_ctx; #define OBSC_LINKID_CB(__msgb) (__msgb)->cb[3] @@ -203,7 +203,7 @@ /* which Iu-CS connection, if any. */ struct { - struct ue_conn_ctx *ue_ctx; + struct ranap_ue_conn_ctx *ue_ctx; uint8_t rab_id; } iu; @@ -493,7 +493,7 @@ struct { /* CS7 instance id number (set via VTY) */ uint32_t cs7_instance; - enum nsap_addr_enc rab_assign_addr_enc; + int rab_assign_addr_enc; struct osmo_sccp_instance *sccp; } iu; diff --git a/include/openbsc/iu.h b/include/openbsc/iu.h deleted file mode 100644 index 08e4cd0..0000000 --- a/include/openbsc/iu.h +++ /dev/null @@ -1,77 +0,0 @@ -#pragma once - -#include -#include - -#include -#include -#include - -#include - -struct sgsn_pdp_ctx; -struct msgb; -struct gsm_auth_tuple; -struct osmo_sccp_addr; -struct osmo_ss7_instance; - -struct RANAP_RAB_SetupOrModifiedItemIEs_s; -struct RANAP_GlobalRNC_ID; -struct RANAP_Cause; - -/* Debugging switches from asn1c and osmo-iuh */ -extern int asn_debug; -extern int asn1_xer_print; - -struct ue_conn_ctx { - struct llist_head list; - /* TODO: It's not needed to store the full SCCP address for each - * UE. Rather than that, a pointer to the RNC should be far - * sufficient */ - struct osmo_sccp_addr sccp_addr; - uint32_t conn_id; - int integrity_active; - struct gprs_ra_id ra_id; - enum nsap_addr_enc rab_assign_addr_enc; -}; - -enum iu_event_type { - IU_EVENT_RAB_ASSIGN, - IU_EVENT_SECURITY_MODE_COMPLETE, - IU_EVENT_IU_RELEASE, /* An actual Iu Release message was received */ - IU_EVENT_LINK_INVALIDATED, /* A SUA link was lost or closed down */ -}; - -extern const struct value_string iu_event_type_names[]; -static inline const char *iu_event_type_str(enum iu_event_type e) -{ - return get_value_string(iu_event_type_names, e); -} - -/* Implementations of iu_recv_cb_t shall find the ue_conn_ctx in msg->dst. */ -typedef int (* iu_recv_cb_t )(struct msgb *msg, struct gprs_ra_id *ra_id, - uint16_t *sai); - -typedef int (* iu_event_cb_t )(struct ue_conn_ctx *ue_ctx, - enum iu_event_type type, void *data); - -typedef int (* iu_rab_ass_resp_cb_t )(struct ue_conn_ctx *ue_ctx, uint8_t rab_id, - struct RANAP_RAB_SetupOrModifiedItemIEs_s *setup_ies); - -int iu_init(void *ctx, struct osmo_sccp_instance *sccp, - iu_recv_cb_t iu_recv_cb, iu_event_cb_t iu_event_cb); - -int iu_tx(struct msgb *msg, uint8_t sapi); - -int iu_page_cs(const char *imsi, const uint32_t *tmsi, uint16_t lac); -int iu_page_ps(const char *imsi, const uint32_t *ptmsi, uint16_t lac, uint8_t rac); - -int iu_rab_act(struct ue_conn_ctx *ue_ctx, struct msgb *msg); -int iu_rab_deact(struct ue_conn_ctx *ue_ctx, uint8_t rab_id); -int iu_tx_sec_mode_cmd(struct ue_conn_ctx *uectx, struct gsm_auth_tuple *tp, - int send_ck, int new_key); -int iu_tx_common_id(struct ue_conn_ctx *ue_ctx, const char *imsi); -int iu_tx_release(struct ue_conn_ctx *ctx, const struct RANAP_Cause *cause); - -void iu_vty_init(int iu_parent_node, enum nsap_addr_enc *rab_assign_addr_enc); -int iu_vty_config_write(struct vty *vty, const char *indent); diff --git a/include/openbsc/iu_dummy.h b/include/openbsc/iu_dummy.h new file mode 100644 index 0000000..d5e1428 --- /dev/null +++ b/include/openbsc/iu_dummy.h @@ -0,0 +1,51 @@ +/* Trivial switch-off of external Iu dependencies, + * allowing to run full unit tests even when built without Iu support. */ + +/* + * (C) 2016,2017 by sysmocom s.f.m.c. GmbH + * + * Author: Neels Hofmeyr + * + * All Rights Reserved + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + * + */ + +#include +#include + +#include + +struct msgb; +struct gsm_auth_tuple; +struct RANAP_Cause; +struct osmo_auth_vector; + +struct ranap_ue_conn_ctx { + struct llist_head list; + uint32_t conn_id; +}; + +int ranap_iu_tx(struct msgb *msg, uint8_t sapi); +int ranap_iu_tx_sec_mode_cmd(struct ranap_ue_conn_ctx *uectx, struct osmo_auth_vector *vec, + int send_ck); +int ranap_iu_page_cs(const char *imsi, const uint32_t *tmsi, uint16_t lac); +int ranap_iu_page_ps(const char *imsi, const uint32_t *ptmsi, uint16_t lac, uint8_t rac); +struct msgb *ranap_new_msg_rab_assign_voice(uint8_t rab_id, uint32_t rtp_ip, + uint16_t rtp_port, + bool use_x213_nsap); +int ranap_iu_rab_act(struct ranap_ue_conn_ctx *ue_ctx, struct msgb *msg); +int ranap_iu_tx_common_id(struct ranap_ue_conn_ctx *uectx, const char *imsi); +int ranap_iu_tx_release(struct ranap_ue_conn_ctx *ctx, const struct RANAP_Cause *cause); diff --git a/include/openbsc/iucs.h b/include/openbsc/iucs.h index fb61a5c..b7d6064 100644 --- a/include/openbsc/iucs.h +++ b/include/openbsc/iucs.h @@ -4,4 +4,4 @@ uint16_t *lac); struct gsm_subscriber_connection *subscr_conn_lookup_iu(struct gsm_network *network, - struct ue_conn_ctx *ue); + struct ranap_ue_conn_ctx *ue); diff --git a/include/openbsc/iucs_ranap.h b/include/openbsc/iucs_ranap.h index 748de23..c2ff5f9 100644 --- a/include/openbsc/iucs_ranap.h +++ b/include/openbsc/iucs_ranap.h @@ -1,7 +1,7 @@ #pragma once struct gsm_network; -struct ue_conn_ctx; +struct ranap_ue_conn_ctx; int iucs_rx_ranap_event(struct gsm_network *network, - struct ue_conn_ctx *ue_ctx, int type, void *data); + struct ranap_ue_conn_ctx *ue_ctx, int type, void *data); diff --git a/include/openbsc/sgsn.h b/include/openbsc/sgsn.h index 57b2978..f371dc6 100644 --- a/include/openbsc/sgsn.h +++ b/include/openbsc/sgsn.h @@ -112,7 +112,7 @@ } dcomp_v42bis; struct { - enum nsap_addr_enc rab_assign_addr_enc; + int rab_assign_addr_enc; } iu; }; diff --git a/src/Makefile.am b/src/Makefile.am index 7e9e1dc..bd69738 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -31,13 +31,6 @@ libcommon-cs \ $(NULL) -# Conditional Libraries -if BUILD_IU -SUBDIRS += \ - libiu \ - $(NULL) -endif - # Programs SUBDIRS += \ osmo-msc \ diff --git a/src/gprs/Makefile.am b/src/gprs/Makefile.am index e05eb79..39a4c12 100644 --- a/src/gprs/Makefile.am +++ b/src/gprs/Makefile.am @@ -106,7 +106,6 @@ $(NULL) if BUILD_IU osmo_sgsn_LDADD += \ - $(top_builddir)/src/libiu/libiu.a \ $(LIBOSMOSIGTRAN_LIBS) \ $(LIBOSMORANAP_LIBS) \ $(LIBASN1C_LIBS) \ diff --git a/src/gprs/gprs_gmm.c b/src/gprs/gprs_gmm.c index 15e2fed..032137f 100644 --- a/src/gprs/gprs_gmm.c +++ b/src/gprs/gprs_gmm.c @@ -52,6 +52,7 @@ #ifdef BUILD_IU #include #include +#include #endif #include @@ -67,7 +68,6 @@ #include #include #include -#include #include #include @@ -174,7 +174,7 @@ #ifdef BUILD_IU int sgsn_ranap_rab_ass_resp(struct sgsn_mm_ctx *ctx, RANAP_RAB_SetupOrModifiedItemIEs_t *setup_ies); -int sgsn_ranap_iu_event(struct ue_conn_ctx *ctx, enum iu_event_type type, void *data) +int sgsn_ranap_iu_event(struct ranap_ue_conn_ctx *ctx, enum ranap_iu_event_type type, void *data) { struct sgsn_mm_ctx *mm; int rc = -1; @@ -188,14 +188,14 @@ } switch (type) { - case IU_EVENT_RAB_ASSIGN: + case RANAP_IU_EVENT_RAB_ASSIGN: REQUIRE_MM rc = sgsn_ranap_rab_ass_resp(mm, (RANAP_RAB_SetupOrModifiedItemIEs_t *)data); break; - case IU_EVENT_IU_RELEASE: + case RANAP_IU_EVENT_IU_RELEASE: /* fall thru */ - case IU_EVENT_LINK_INVALIDATED: - /* Clean up ue_conn_ctx here */ + case RANAP_IU_EVENT_LINK_INVALIDATED: + /* Clean up ranap_ue_conn_ctx here */ if (mm) LOGMMCTXP(LOGL_INFO, mm, "IU release for imsi %s\n", mm->imsi); else @@ -205,7 +205,7 @@ mmctx_set_pmm_state(mm, PMM_IDLE); rc = 0; break; - case IU_EVENT_SECURITY_MODE_COMPLETE: + case RANAP_IU_EVENT_SECURITY_MODE_COMPLETE: REQUIRE_MM /* Continue authentication here */ mm->iu.ue_ctx->integrity_active = 1; @@ -262,16 +262,16 @@ rate_ctr_inc(&mm->ctrg->ctr[GMM_CTR_PKTS_SIG_OUT]); #ifdef BUILD_IU if (mm->ran_type == MM_CTX_T_UTRAN_Iu) - return iu_tx(msg, GPRS_SAPI_GMM); + return ranap_iu_tx(msg, GPRS_SAPI_GMM); #endif } #ifdef BUILD_IU - /* In Iu mode, msg->dst contains the ue_conn_ctx pointer, in Gb mode + /* In Iu mode, msg->dst contains the ranap_ue_conn_ctx pointer, in Gb mode * dst is empty. */ /* FIXME: have a more explicit indicator for Iu messages */ if (msg->dst) - return iu_tx(msg, GPRS_SAPI_GMM); + return ranap_iu_tx(msg, GPRS_SAPI_GMM); #endif /* caller needs to provide TLLI, BVCI and NSEI */ @@ -296,9 +296,12 @@ /* In case a Iu connection is reconnected we need to update the ue ctx */ mm->iu.ue_ctx = msg->dst; if (mm->ran_type == MM_CTX_T_UTRAN_Iu - && mm->iu.ue_ctx) + && mm->iu.ue_ctx) { +#ifdef BUILD_IU mm->iu.ue_ctx->rab_assign_addr_enc = sgsn->cfg.iu.rab_assign_addr_enc; +#endif + } } /* Store BVCI/NSEI in MM context */ @@ -1048,7 +1051,7 @@ /* The MS is authorized */ #ifdef BUILD_IU if (ctx->ran_type == MM_CTX_T_UTRAN_Iu && !ctx->iu.ue_ctx->integrity_active) { - rc = iu_tx_sec_mode_cmd(ctx->iu.ue_ctx, &ctx->auth_triplet, 0, ctx->iu.new_key); + rc = ranap_iu_tx_sec_mode_cmd(ctx->iu.ue_ctx, &ctx->auth_triplet.vec, 0, ctx->iu.new_key); ctx->iu.new_key = 0; return rc; } @@ -1259,14 +1262,20 @@ * with a foreign TLLI (P-TMSI that was allocated to the MS before), * or with random TLLI. */ - /* In Iu mode, msg->dst contains the ue_conn_ctx pointer, in Gb mode + /* In Iu mode, msg->dst contains the ranap_ue_conn_ctx pointer, in Gb mode * dst is empty. */ /* FIXME: have a more explicit indicator for Iu messages */ if (!msg->dst) { /* Gb mode */ cid = bssgp_parse_cell_id(&ra_id, msgb_bcid(msg)); - } else - ra_id = ((struct ue_conn_ctx*)msg->dst)->ra_id; + } else { +#ifdef BUILD_IU + ra_id = ((struct ranap_ue_conn_ctx*)msg->dst)->ra_id; +#else + LOGMMCTXP(LOGL_ERROR, ctx, "Cannot handle Iu Attach Request, built without Iu support\n"); + return -ENOTSUP; +#endif + } /* MS network capability 10.5.5.12 */ msnc_len = *cur++; @@ -1627,7 +1636,7 @@ * is an optimization to avoid the RA reject (impl detached) * below, which will cause a new attach cycle. */ /* Look-up the MM context based on old RA-ID and TLLI */ - /* In Iu mode, msg->dst contains the ue_conn_ctx pointer, in Gb + /* In Iu mode, msg->dst contains the ranap_ue_conn_ctx pointer, in Gb * mode dst is empty. */ /* FIXME: have a more explicit indicator for Iu messages */ if (!msg->dst) { @@ -2905,12 +2914,12 @@ { struct msgb *msg; struct sgsn_mm_ctx *mm = pdp->mm; - struct ue_conn_ctx *uectx; + struct ranap_ue_conn_ctx *uectx; uint32_t ggsn_ip; bool use_x213_nsap; uectx = mm->iu.ue_ctx; - use_x213_nsap = (uectx->rab_assign_addr_enc == NSAP_ADDR_ENC_X213); + use_x213_nsap = (uectx->rab_assign_addr_enc == RANAP_NSAP_ADDR_ENC_X213); /* Get the IP address for ggsn user plane */ memcpy(&ggsn_ip, pdp->lib->gsnru.v, pdp->lib->gsnru.l); @@ -2923,6 +2932,6 @@ msg = ranap_new_msg_rab_assign_data(rab_id, ggsn_ip, pdp->lib->teid_gn, use_x213_nsap); msg->l2h = msg->data; - return iu_rab_act(uectx, msg); + return ranap_iu_rab_act(uectx, msg); } #endif diff --git a/src/gprs/gprs_sgsn.c b/src/gprs/gprs_sgsn.c index 43eeaaa..de79afb 100644 --- a/src/gprs/gprs_sgsn.c +++ b/src/gprs/gprs_sgsn.c @@ -40,13 +40,18 @@ #include #include #include "openbsc/gprs_llc.h" -#include #include #include #include + +#include "../../bscconfig.h" + +#if BUILD_IU +#include +#endif #define GPRS_LLME_CHECK_TICK 30 @@ -246,6 +251,7 @@ /* Allocate a new SGSN MM context */ struct sgsn_mm_ctx *sgsn_mm_ctx_alloc_iu(void *uectx) { +#if BUILD_IU struct sgsn_mm_ctx *ctx; ctx = talloc_zero(tall_bsc_ctx, struct sgsn_mm_ctx); @@ -274,6 +280,9 @@ llist_add(&ctx->list, &sgsn_mm_ctxts); return ctx; +#else + return NULL; +#endif } diff --git a/src/gprs/sgsn_libgtp.c b/src/gprs/sgsn_libgtp.c index 7ff8ece..90b4d16 100644 --- a/src/gprs/sgsn_libgtp.c +++ b/src/gprs/sgsn_libgtp.c @@ -52,7 +52,7 @@ #include #ifdef BUILD_IU -#include +#include #include #endif @@ -548,7 +548,7 @@ } else { #ifdef BUILD_IU /* Deactivate radio bearer */ - iu_rab_deact(pctx->mm->iu.ue_ctx, 1); + ranap_iu_rab_deact(pctx->mm->iu.ue_ctx, 1); #else return -ENOTSUP; #endif @@ -687,7 +687,7 @@ #ifdef BUILD_IU /* Ignore the packet for now and page the UE to get the RAB * reestablished */ - iu_page_ps(mm->imsi, &mm->p_tmsi, mm->ra.lac, mm->ra.rac); + ranap_iu_page_ps(mm->imsi, &mm->p_tmsi, mm->ra.lac, mm->ra.rac); return 0; #else diff --git a/src/gprs/sgsn_main.c b/src/gprs/sgsn_main.c index d56af0e..25ee632 100644 --- a/src/gprs/sgsn_main.c +++ b/src/gprs/sgsn_main.c @@ -58,7 +58,6 @@ #include #include #include -#include #include #include @@ -68,6 +67,10 @@ #include #include "../../bscconfig.h" + +#if BUILD_IU +#include +#endif #define _GNU_SOURCE #include @@ -322,7 +325,7 @@ .num_cat = ARRAY_SIZE(gprs_categories), }; -int sgsn_ranap_iu_event(struct ue_conn_ctx *ctx, enum iu_event_type type, void *data); +int sgsn_ranap_iu_event(struct ue_conn_ctx *ctx, enum ranap_iu_event_type type, void *data); int main(int argc, char **argv) { @@ -451,7 +454,7 @@ return 8; } - iu_init(tall_bsc_ctx, sccp, gsm0408_gprs_rcvmsg_iu, sgsn_ranap_iu_event); + ranap_iu_init(tall_bsc_ctx, DRANAP, "OsmoSGSN-IuPS", sccp, gsm0408_gprs_rcvmsg_iu, sgsn_ranap_iu_event); #endif if (daemonize) { diff --git a/src/gprs/sgsn_vty.c b/src/gprs/sgsn_vty.c index cf44cc4..3a5b2ca 100644 --- a/src/gprs/sgsn_vty.c +++ b/src/gprs/sgsn_vty.c @@ -48,7 +48,7 @@ #include "../../bscconfig.h" #ifdef BUILD_IU -#include +#include #endif static struct sgsn_config *g_cfg = NULL; @@ -291,7 +291,7 @@ vty_out(vty, " no compression v42bis%s", VTY_NEWLINE); #ifdef BUILD_IU - iu_vty_config_write(vty, " "); + ranap_iu_vty_config_write(vty, " "); #endif return CMD_SUCCESS; @@ -1285,7 +1285,7 @@ install_element(SGSN_NODE, &cfg_comp_v42bisp_cmd); #ifdef BUILD_IU - iu_vty_init(SGSN_NODE, &g_cfg->iu.rab_assign_addr_enc); + ranap_iu_vty_init(SGSN_NODE, &g_cfg->iu.rab_assign_addr_enc); #endif return 0; } diff --git a/src/libiu/Makefile.am b/src/libiu/Makefile.am deleted file mode 100644 index e5f9e27..0000000 --- a/src/libiu/Makefile.am +++ /dev/null @@ -1,28 +0,0 @@ -AM_CPPFLAGS = \ - $(all_includes) \ - -I$(top_srcdir)/include \ - -I$(top_builddir) \ - $(NULL) - -AM_CFLAGS = \ - -Wall \ - $(COVERAGE_CFLAGS) \ - $(LIBCRYPTO_CFLAGS) \ - $(LIBASN1C_CFLAGS) \ - $(LIBOSMOCORE_CFLAGS) \ - $(LIBOSMOVTY_CFLAGS) \ - $(LIBOSMOGSM_CFLAGS) \ - $(LIBOSMOABIS_CFLAGS) \ - $(LIBOSMOSIGTRAN_CFLAGS) \ - $(LIBOSMORANAP_CFLAGS) \ - $(NULL) - -noinst_LIBRARIES = \ - libiu.a \ - $(NULL) - -libiu_a_SOURCES = \ - iu.c \ - iu_vty.c \ - $(NULL) - diff --git a/src/libiu/iu.c b/src/libiu/iu.c deleted file mode 100644 index 7794977..0000000 --- a/src/libiu/iu.c +++ /dev/null @@ -1,771 +0,0 @@ -/* Common parts of IuCS and IuPS interfaces implementation */ - -/* (C) 2016 by sysmocom s.f.m.c. GmbH - * All Rights Reserved - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - * - */ - -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include - -#include -#include - -#include -#include -#include -#include - -#include -#include -#include - -#include - -#include -#include -#include -#include - -#include - -/* Parsed global RNC id. See also struct RANAP_GlobalRNC_ID, and note that the - * PLMN identity is a BCD representation of the MCC and MNC. - * See iu_grnc_id_parse(). */ -struct iu_grnc_id { - uint16_t mcc; - uint16_t mnc; - uint16_t rnc_id; -}; - -/* A remote RNC (Radio Network Controller, like BSC but for UMTS) that has - * called us and is currently reachable at the given osmo_sccp_addr. So, when we - * know a LAC for a subscriber, we can page it at the RNC matching that LAC or - * RAC. An HNB-GW typically presents itself as if it were a single RNC, even - * though it may have several RNCs in hNodeBs connected to it. Those will then - * share the same RNC id, which they actually receive and adopt from the HNB-GW - * in the HNBAP HNB REGISTER ACCEPT message. */ -struct iu_rnc { - struct llist_head entry; - - uint16_t rnc_id; - uint16_t lac; /* Location Area Code (used for CS and PS) */ - uint8_t rac; /* Routing Area Code (used for PS only) */ - struct osmo_sccp_addr sccp_addr; -}; - -void *talloc_iu_ctx; - -/* Implement the extern asn_debug from libasn1c to indicate whether to print - * asn.1 debug messages (see libasn1c). */ -int asn_debug = 0; - -/* Implement the extern asn1_xer_print to indicate whether the ASN.1 binary - * code decoded and encoded during Iu communication should be logged to stderr - * (see asn.1 generated code in osmo-iuh). */ -int asn1_xer_print = 0; - -void *talloc_asn1_ctx; - -iu_recv_cb_t global_iu_recv_cb = NULL; -iu_event_cb_t global_iu_event_cb = NULL; - -static LLIST_HEAD(ue_conn_ctx_list); -static LLIST_HEAD(rnc_list); - -static struct osmo_sccp_instance *g_sccp; -static struct osmo_sccp_user *g_scu; - -const struct value_string iu_event_type_names[] = { - OSMO_VALUE_STRING(IU_EVENT_RAB_ASSIGN), - OSMO_VALUE_STRING(IU_EVENT_SECURITY_MODE_COMPLETE), - OSMO_VALUE_STRING(IU_EVENT_IU_RELEASE), - OSMO_VALUE_STRING(IU_EVENT_LINK_INVALIDATED), - { 0, NULL } -}; - -struct ue_conn_ctx *ue_conn_ctx_alloc(struct osmo_sccp_addr *addr, uint32_t conn_id) -{ - struct ue_conn_ctx *ctx = talloc_zero(talloc_iu_ctx, struct ue_conn_ctx); - - ctx->sccp_addr = *addr; - ctx->conn_id = conn_id; - llist_add(&ctx->list, &ue_conn_ctx_list); - - return ctx; -} - -struct ue_conn_ctx *ue_conn_ctx_find(uint32_t conn_id) -{ - struct ue_conn_ctx *ctx; - - llist_for_each_entry(ctx, &ue_conn_ctx_list, list) { - if (ctx->conn_id == conn_id) - return ctx; - } - return NULL; -} - -static struct iu_rnc *iu_rnc_alloc(uint16_t rnc_id, uint16_t lac, uint8_t rac, - struct osmo_sccp_addr *addr) -{ - struct iu_rnc *rnc = talloc_zero(talloc_iu_ctx, struct iu_rnc); - - rnc->rnc_id = rnc_id; - rnc->lac = lac; - rnc->rac = rac; - rnc->sccp_addr = *addr; - llist_add(&rnc->entry, &rnc_list); - - LOGP(DRANAP, LOGL_NOTICE, "New RNC %d (LAC=%d RAC=%d)\n", - rnc->rnc_id, rnc->lac, rnc->rac); - - return rnc; -} - -static struct iu_rnc *iu_rnc_register(uint16_t rnc_id, uint16_t lac, - uint8_t rac, struct osmo_sccp_addr *addr) -{ - struct iu_rnc *rnc; - llist_for_each_entry(rnc, &rnc_list, entry) { - if (rnc->rnc_id != rnc_id) - continue; - - /* We have this RNC Id registered already. Make sure that the - * details match. */ - - /* TODO should a mismatch be an error? */ - if (rnc->lac != lac || rnc->rac != rac) - LOGP(DRANAP, LOGL_NOTICE, "RNC %d changes its details:" - " LAC=%d RAC=%d --> LAC=%d RAC=%d\n", - rnc->rnc_id, rnc->lac, rnc->rac, - lac, rac); - rnc->lac = lac; - rnc->rac = rac; - - if (addr && memcmp(&rnc->sccp_addr, addr, sizeof(*addr))) - LOGP(DRANAP, LOGL_NOTICE, "RNC %d on New SCCP Addr %s" - " (LAC=%d RAC=%d)\n", - rnc->rnc_id, osmo_sccp_addr_dump(addr), rnc->lac, rnc->rac); - rnc->sccp_addr = *addr; - return rnc; - } - - /* Not found, make a new one. */ - return iu_rnc_alloc(rnc_id, lac, rac, addr); -} - -/*********************************************************************** - * RANAP handling - ***********************************************************************/ - -int iu_rab_act(struct ue_conn_ctx *ue_ctx, struct msgb *msg) -{ - struct osmo_scu_prim *prim; - - /* wrap RANAP message in SCCP N-DATA.req */ - prim = (struct osmo_scu_prim *) msgb_push(msg, sizeof(*prim)); - prim->u.data.conn_id = ue_ctx->conn_id; - osmo_prim_init(&prim->oph, - SCCP_SAP_USER, - OSMO_SCU_PRIM_N_DATA, - PRIM_OP_REQUEST, - msg); - return osmo_sccp_user_sap_down(g_scu, &prim->oph); -} - -int iu_rab_deact(struct ue_conn_ctx *ue_ctx, uint8_t rab_id) -{ - /* FIXME */ - return -1; -} - -int iu_tx_sec_mode_cmd(struct ue_conn_ctx *uectx, struct gsm_auth_tuple *tp, - int send_ck, int new_key) -{ - struct osmo_scu_prim *prim; - struct msgb *msg; - - /* create RANAP message */ - msg = ranap_new_msg_sec_mod_cmd(tp->vec.ik, send_ck? tp->vec.ck : NULL, - new_key ? RANAP_KeyStatus_new : RANAP_KeyStatus_old); - msg->l2h = msg->data; - /* wrap RANAP message in SCCP N-DATA.req */ - prim = (struct osmo_scu_prim *) msgb_push(msg, sizeof(*prim)); - prim->u.data.conn_id = uectx->conn_id; - osmo_prim_init(&prim->oph, SCCP_SAP_USER, - OSMO_SCU_PRIM_N_DATA, - PRIM_OP_REQUEST, msg); - osmo_sccp_user_sap_down(g_scu, &prim->oph); - - return 0; -} - -int iu_tx_common_id(struct ue_conn_ctx *uectx, const char *imsi) -{ - struct msgb *msg; - struct osmo_scu_prim *prim; - - LOGP(DRANAP, LOGL_INFO, "Transmitting RANAP CommonID (SCCP conn_id %u)\n", - uectx->conn_id); - - msg = ranap_new_msg_common_id(imsi); - msg->l2h = msg->data; - prim = (struct osmo_scu_prim *) msgb_push(msg, sizeof(*prim)); - prim->u.data.conn_id = uectx->conn_id; - osmo_prim_init(&prim->oph, SCCP_SAP_USER, - OSMO_SCU_PRIM_N_DATA, - PRIM_OP_REQUEST, msg); - osmo_sccp_user_sap_down(g_scu, &prim->oph); - return 0; -} - -static int iu_grnc_id_parse(struct iu_grnc_id *dst, - struct RANAP_GlobalRNC_ID *src) -{ - /* The size is coming from arbitrary sender, check it gracefully */ - if (src->pLMNidentity.size != 3) { - LOGP(DRANAP, LOGL_ERROR, "Invalid PLMN Identity size:" - " should be 3, is %d\n", src->pLMNidentity.size); - return -1; - } - gsm48_mcc_mnc_from_bcd(&src->pLMNidentity.buf[0], - &dst->mcc, &dst->mnc); - dst->rnc_id = (uint16_t)src->rNC_ID; - return 0; -} - -#if 0 - -- not used at present -- -static int iu_grnc_id_compose(struct iu_grnc_id *src, - struct RANAP_GlobalRNC_ID *dst) -{ - /* The caller must ensure proper size */ - OSMO_ASSERT(dst->pLMNidentity.size == 3); - gsm48_mcc_mnc_to_bcd(&dst->pLMNidentity.buf[0], - src->mcc, src->mnc); - dst->rNC_ID = src->rnc_id; - return 0; -} -#endif - -static int ranap_handle_co_initial_ue(void *ctx, RANAP_InitialUE_MessageIEs_t *ies) -{ - struct ue_conn_ctx *ue_conn = ctx; - struct gprs_ra_id ra_id; - struct iu_grnc_id grnc_id; - uint16_t sai; - struct msgb *msg = msgb_alloc(256, "RANAP->NAS"); - - if (ranap_parse_lai(&ra_id, &ies->lai) != 0) { - LOGP(DRANAP, LOGL_ERROR, "Failed to parse RANAP LAI IE\n"); - return -1; - } - - if (ies->presenceMask & INITIALUE_MESSAGEIES_RANAP_RAC_PRESENT) { - ra_id.rac = asn1str_to_u8(&ies->rac); - } - - if (iu_grnc_id_parse(&grnc_id, &ies->globalRNC_ID) != 0) { - LOGP(DRANAP, LOGL_ERROR, - "Failed to parse RANAP Global-RNC-ID IE\n"); - return -1; - } - - sai = asn1str_to_u16(&ies->sai.sAC); - msgb_gmmh(msg) = msgb_put(msg, ies->nas_pdu.size); - memcpy(msgb_gmmh(msg), ies->nas_pdu.buf, ies->nas_pdu.size); - - /* Make sure we know the RNC Id and LAC+RAC coming in on this connection. */ - iu_rnc_register(grnc_id.rnc_id, ra_id.lac, ra_id.rac, &ue_conn->sccp_addr); - ue_conn->ra_id = ra_id; - - /* Feed into the MM layer */ - msg->dst = ctx; - global_iu_recv_cb(msg, &ra_id, &sai); - - msgb_free(msg); - - return 0; -} - -static int ranap_handle_co_dt(void *ctx, RANAP_DirectTransferIEs_t *ies) -{ - struct gprs_ra_id _ra_id, *ra_id = NULL; - uint16_t _sai, *sai = NULL; - struct msgb *msg = msgb_alloc(256, "RANAP->NAS"); - - if (ies->presenceMask & DIRECTTRANSFERIES_RANAP_LAI_PRESENT) { - if (ranap_parse_lai(&_ra_id, &ies->lai) != 0) { - LOGP(DRANAP, LOGL_ERROR, "Failed to parse RANAP LAI IE\n"); - return -1; - } - ra_id = &_ra_id; - if (ies->presenceMask & DIRECTTRANSFERIES_RANAP_RAC_PRESENT) { - _ra_id.rac = asn1str_to_u8(&ies->rac); - } - if (ies->presenceMask & DIRECTTRANSFERIES_RANAP_SAI_PRESENT) { - _sai = asn1str_to_u16(&ies->sai.sAC); - sai = &_sai; - } - } - - msgb_gmmh(msg) = msgb_put(msg, ies->nas_pdu.size); - memcpy(msgb_gmmh(msg), ies->nas_pdu.buf, ies->nas_pdu.size); - - /* Feed into the MM/CC/SMS-CP layer */ - msg->dst = ctx; - global_iu_recv_cb(msg, ra_id, sai); - - msgb_free(msg); - - return 0; -} - -static int ranap_handle_co_err_ind(void *ctx, RANAP_ErrorIndicationIEs_t *ies) -{ - if (ies->presenceMask & ERRORINDICATIONIES_RANAP_CAUSE_PRESENT) - LOGP(DRANAP, LOGL_ERROR, "Rx Error Indication (%s)\n", - ranap_cause_str(&ies->cause)); - else - LOGP(DRANAP, LOGL_ERROR, "Rx Error Indication\n"); - - return 0; -} - -int iu_tx(struct msgb *msg_nas, uint8_t sapi) -{ - struct ue_conn_ctx *uectx = msg_nas->dst; - struct msgb *msg; - struct osmo_scu_prim *prim; - - LOGP(DRANAP, LOGL_INFO, "Transmitting L3 Message as RANAP DT (SCCP conn_id %u)\n", - uectx->conn_id); - - msg = ranap_new_msg_dt(sapi, msg_nas->data, msgb_length(msg_nas)); - msgb_free(msg_nas); - msg->l2h = msg->data; - prim = (struct osmo_scu_prim *) msgb_push(msg, sizeof(*prim)); - prim->u.data.conn_id = uectx->conn_id; - osmo_prim_init(&prim->oph, SCCP_SAP_USER, - OSMO_SCU_PRIM_N_DATA, - PRIM_OP_REQUEST, msg); - osmo_sccp_user_sap_down(g_scu, &prim->oph); - return 0; -} - -/* Send Iu Release for the given UE connection. - * If cause is NULL, the standard "No remaining RAB" cause is sent, otherwise - * the provided cause. */ -int iu_tx_release(struct ue_conn_ctx *ctx, const struct RANAP_Cause *cause) -{ - struct msgb *msg; - struct osmo_scu_prim *prim; - static const struct RANAP_Cause default_cause = { - .present = RANAP_Cause_PR_radioNetwork, - .choice.radioNetwork = RANAP_CauseRadioNetwork_no_remaining_rab, - }; - - if (!cause) - cause = &default_cause; - - LOGP(DRANAP, LOGL_INFO, "Transmitting Iu Release (SCCP conn_id %u)\n", - ctx->conn_id); - - msg = ranap_new_msg_iu_rel_cmd(cause); - msg->l2h = msg->data; - prim = (struct osmo_scu_prim *) msgb_push(msg, sizeof(*prim)); - prim->u.data.conn_id = ctx->conn_id; - osmo_prim_init(&prim->oph, SCCP_SAP_USER, - OSMO_SCU_PRIM_N_DATA, - PRIM_OP_REQUEST, msg); - return osmo_sccp_user_sap_down(g_scu, &prim->oph); -} - -static int ranap_handle_co_iu_rel_req(struct ue_conn_ctx *ctx, RANAP_Iu_ReleaseRequestIEs_t *ies) -{ - LOGP(DRANAP, LOGL_INFO, "Received Iu Release Request, Sending Release Command\n"); - iu_tx_release(ctx, &ies->cause); - return 0; -} - -static int ranap_handle_co_rab_ass_resp(struct ue_conn_ctx *ctx, RANAP_RAB_AssignmentResponseIEs_t *ies) -{ - int rc = -1; - - LOGP(DRANAP, LOGL_INFO, - "Rx RAB Assignment Response for UE conn_id %u\n", ctx->conn_id); - if (ies->presenceMask & RAB_ASSIGNMENTRESPONSEIES_RANAP_RAB_SETUPORMODIFIEDLIST_PRESENT) { - /* TODO: Iterate over list of SetupOrModifiedList IEs and handle each one */ - RANAP_IE_t *ranap_ie = ies->raB_SetupOrModifiedList.raB_SetupOrModifiedList_ies.list.array[0]; - RANAP_RAB_SetupOrModifiedItemIEs_t setup_ies; - - rc = ranap_decode_rab_setupormodifieditemies_fromlist(&setup_ies, &ranap_ie->value); - if (rc) { - LOGP(DRANAP, LOGL_ERROR, "Error in ranap_decode_rab_setupormodifieditemies()\n"); - return rc; - } - - rc = global_iu_event_cb(ctx, IU_EVENT_RAB_ASSIGN, &setup_ies); - - ranap_free_rab_setupormodifieditemies(&setup_ies); - } - /* FIXME: handle RAB Ass failure? */ - - return rc; -} - -/* Entry point for connection-oriented RANAP message */ -static void cn_ranap_handle_co(void *ctx, ranap_message *message) -{ - int rc; - - LOGP(DRANAP, LOGL_NOTICE, "handle_co(dir=%u, proc=%u)\n", message->direction, message->procedureCode); - - switch (message->direction) { - case RANAP_RANAP_PDU_PR_initiatingMessage: - switch (message->procedureCode) { - case RANAP_ProcedureCode_id_InitialUE_Message: - rc = ranap_handle_co_initial_ue(ctx, &message->msg.initialUE_MessageIEs); - break; - case RANAP_ProcedureCode_id_DirectTransfer: - rc = ranap_handle_co_dt(ctx, &message->msg.directTransferIEs); - break; - case RANAP_ProcedureCode_id_ErrorIndication: - rc = ranap_handle_co_err_ind(ctx, &message->msg.errorIndicationIEs); - break; - case RANAP_ProcedureCode_id_Iu_ReleaseRequest: - /* Iu Release Request */ - rc = ranap_handle_co_iu_rel_req(ctx, &message->msg.iu_ReleaseRequestIEs); - break; - default: - LOGP(DRANAP, LOGL_ERROR, "Received Initiating Message: unknown Procedure Code %d\n", - message->procedureCode); - rc = -1; - break; - } - break; - case RANAP_RANAP_PDU_PR_successfulOutcome: - switch (message->procedureCode) { - case RANAP_ProcedureCode_id_SecurityModeControl: - /* Security Mode Complete */ - rc = global_iu_event_cb(ctx, IU_EVENT_SECURITY_MODE_COMPLETE, NULL); - break; - case RANAP_ProcedureCode_id_Iu_Release: - /* Iu Release Complete */ - rc = global_iu_event_cb(ctx, IU_EVENT_IU_RELEASE, NULL); - if (rc) { - LOGP(DRANAP, LOGL_ERROR, "Iu Release event: Iu Event callback returned %d\n", - rc); - } - break; - default: - LOGP(DRANAP, LOGL_ERROR, "Received Successful Outcome: unknown Procedure Code %d\n", - message->procedureCode); - rc = -1; - break; - } - break; - case RANAP_RANAP_PDU_PR_outcome: - switch (message->procedureCode) { - case RANAP_ProcedureCode_id_RAB_Assignment: - /* RAB Assignment Response */ - rc = ranap_handle_co_rab_ass_resp(ctx, &message->msg.raB_AssignmentResponseIEs); - break; - default: - LOGP(DRANAP, LOGL_ERROR, "Received Outcome: unknown Procedure Code %d\n", - message->procedureCode); - rc = -1; - break; - } - break; - case RANAP_RANAP_PDU_PR_unsuccessfulOutcome: - default: - LOGP(DRANAP, LOGL_ERROR, "Received Unsuccessful Outcome: Procedure Code %d\n", - message->procedureCode); - rc = -1; - break; - } - - if (rc) { - LOGP(DRANAP, LOGL_ERROR, "Error in cn_ranap_handle_co (%d)\n", - rc); - /* TODO handling of the error? */ - } -} - -static int ranap_handle_cl_reset_req(void *ctx, RANAP_ResetIEs_t *ies) -{ - /* FIXME: send reset response */ - return -1; -} - -static int ranap_handle_cl_err_ind(void *ctx, RANAP_ErrorIndicationIEs_t *ies) -{ - if (ies->presenceMask & ERRORINDICATIONIES_RANAP_CAUSE_PRESENT) - LOGP(DRANAP, LOGL_ERROR, "Rx Error Indication (%s)\n", - ranap_cause_str(&ies->cause)); - else - LOGP(DRANAP, LOGL_ERROR, "Rx Error Indication\n"); - - return 0; -} - -/* Entry point for connection-less RANAP message */ -static void cn_ranap_handle_cl(void *ctx, ranap_message *message) -{ - int rc; - - switch (message->direction) { - case RANAP_RANAP_PDU_PR_initiatingMessage: - switch (message->procedureCode) { - case RANAP_ProcedureCode_id_Reset: - /* received reset.req, send reset.resp */ - rc = ranap_handle_cl_reset_req(ctx, &message->msg.resetIEs); - break; - case RANAP_ProcedureCode_id_ErrorIndication: - rc = ranap_handle_cl_err_ind(ctx, &message->msg.errorIndicationIEs); - break; - default: - rc = -1; - break; - } - break; - case RANAP_RANAP_PDU_PR_successfulOutcome: - case RANAP_RANAP_PDU_PR_unsuccessfulOutcome: - case RANAP_RANAP_PDU_PR_outcome: - default: - rc = -1; - break; - } - - if (rc) { - LOGP(DRANAP, LOGL_ERROR, "Error in cn_ranap_handle_cl (%d)\n", - rc); - /* TODO handling of the error? */ - } -} - -/*********************************************************************** - * Paging - ***********************************************************************/ - -struct osmo_sccp_addr local_sccp_addr = { - .presence = OSMO_SCCP_ADDR_T_SSN | OSMO_SCCP_ADDR_T_PC, - .ri = OSMO_SCCP_RI_SSN_PC, - .ssn = OSMO_SCCP_SSN_RANAP, - .pc = 1, -}; - -/* Send a paging command down a given SCCP User. tmsi and paging_cause are - * optional and may be passed NULL and 0, respectively, to disable their use. - * See enum RANAP_PagingCause. - * - * If TMSI is given, the IMSI is not sent over the air interface. Nevertheless, - * the IMSI is still required for resolution in the HNB-GW and/or(?) RNC. */ -static int iu_tx_paging_cmd(struct osmo_sccp_addr *called_addr, - const char *imsi, const uint32_t *tmsi, - bool is_ps, uint32_t paging_cause) -{ - struct msgb *msg; - msg = ranap_new_msg_paging_cmd(imsi, tmsi, is_ps? 1 : 0, paging_cause); - msg->l2h = msg->data; - osmo_sccp_tx_unitdata_msg(g_scu, &local_sccp_addr, called_addr, msg); - return 0; -} - -static int iu_page(const char *imsi, const uint32_t *tmsi_or_ptimsi, - uint16_t lac, uint8_t rac, bool is_ps) -{ - struct iu_rnc *rnc; - int pagings_sent = 0; - - if (tmsi_or_ptimsi) { - LOGP(DRANAP, LOGL_DEBUG, "%s: Looking for RNCs to page for IMSI %s" - " (paging will use %s %x)\n", - is_ps? "IuPS" : "IuCS", - imsi, - is_ps? "PTMSI" : "TMSI", - *tmsi_or_ptimsi); - } else { - LOGP(DRANAP, LOGL_DEBUG, "%s: Looking for RNCs to page for IMSI %s" - " (paging will use IMSI)\n", - is_ps? "IuPS" : "IuCS", - imsi - ); - } - - llist_for_each_entry(rnc, &rnc_list, entry) { - if (rnc->lac != lac) - continue; - if (is_ps && rnc->rac != rac) - continue; - - /* Found a match! */ - if (iu_tx_paging_cmd(&rnc->sccp_addr, imsi, tmsi_or_ptimsi, is_ps, 0) - == 0) { - LOGP(DRANAP, LOGL_DEBUG, - "%s: Paged for IMSI %s on RNC %d, on SCCP addr %s\n", - is_ps? "IuPS" : "IuCS", - imsi, rnc->rnc_id, osmo_sccp_addr_dump(&rnc->sccp_addr)); - pagings_sent ++; - } - } - - /* Some logging... */ - if (pagings_sent > 0) { - LOGP(DRANAP, LOGL_DEBUG, - "%s: %d RNCs were paged for IMSI %s.\n", - is_ps? "IuPS" : "IuCS", - pagings_sent, imsi); - } - else { - if (is_ps) { - LOGP(DRANAP, LOGL_ERROR, "IuPS: Found no RNC to page for" - " LAC %d RAC %d (would have paged IMSI %s)\n", - lac, rac, imsi); - } - else { - LOGP(DRANAP, LOGL_ERROR, "IuCS: Found no RNC to page for" - " LAC %d (would have paged IMSI %s)\n", - lac, imsi); - } - } - - return pagings_sent; -} - -int iu_page_cs(const char *imsi, const uint32_t *tmsi, uint16_t lac) -{ - return iu_page(imsi, tmsi, lac, 0, false); -} - -int iu_page_ps(const char *imsi, const uint32_t *ptmsi, uint16_t lac, uint8_t rac) -{ - return iu_page(imsi, ptmsi, lac, rac, true); -} - - -/*********************************************************************** - * - ***********************************************************************/ - -int tx_unitdata(struct osmo_sccp_user *scu); -int tx_conn_req(struct osmo_sccp_user *scu, uint32_t conn_id); - -struct osmo_prim_hdr *make_conn_req(uint32_t conn_id); -struct osmo_prim_hdr *make_dt1_req(uint32_t conn_id, const uint8_t *data, unsigned int len); - -struct osmo_prim_hdr *make_conn_resp(struct osmo_scu_connect_param *param) -{ - struct msgb *msg = msgb_alloc(1024, "conn_resp"); - struct osmo_scu_prim *prim; - - prim = (struct osmo_scu_prim *) msgb_put(msg, sizeof(*prim)); - osmo_prim_init(&prim->oph, SCCP_SAP_USER, - OSMO_SCU_PRIM_N_CONNECT, - PRIM_OP_RESPONSE, msg); - memcpy(&prim->u.connect, param, sizeof(prim->u.connect)); - return &prim->oph; -} - -static int sccp_sap_up(struct osmo_prim_hdr *oph, void *_scu) -{ - struct osmo_sccp_user *scu = _scu; - struct osmo_scu_prim *prim = (struct osmo_scu_prim *) oph; - struct osmo_prim_hdr *resp = NULL; - int rc; - struct ue_conn_ctx *ue; - - DEBUGP(DRANAP, "sccp_sap_up(%s)\n", osmo_scu_prim_name(oph)); - - switch (OSMO_PRIM_HDR(oph)) { - case OSMO_PRIM(OSMO_SCU_PRIM_N_CONNECT, PRIM_OP_CONFIRM): - /* confirmation of outbound connection */ - rc = -1; - break; - case OSMO_PRIM(OSMO_SCU_PRIM_N_CONNECT, PRIM_OP_INDICATION): - /* indication of new inbound connection request*/ - DEBUGP(DRANAP, "N-CONNECT.ind(X->%u)\n", prim->u.connect.conn_id); - if (/* prim->u.connect.called_addr.ssn != OSMO_SCCP_SSN_RANAP || */ - !msgb_l2(oph->msg) || msgb_l2len(oph->msg) == 0) { - LOGP(DRANAP, LOGL_NOTICE, - "Received invalid N-CONNECT.ind\n"); - return 0; - } - ue = ue_conn_ctx_alloc(&prim->u.connect.calling_addr, prim->u.connect.conn_id); - /* first ensure the local SCCP socket is ACTIVE */ - resp = make_conn_resp(&prim->u.connect); - osmo_sccp_user_sap_down(scu, resp); - /* then handle the RANAP payload */ - rc = ranap_cn_rx_co(cn_ranap_handle_co, ue, msgb_l2(oph->msg), msgb_l2len(oph->msg)); - break; - case OSMO_PRIM(OSMO_SCU_PRIM_N_DISCONNECT, PRIM_OP_INDICATION): - /* indication of disconnect */ - DEBUGP(DRANAP, "N-DISCONNECT.ind(%u)\n", - prim->u.disconnect.conn_id); - ue = ue_conn_ctx_find(prim->u.disconnect.conn_id); - rc = ranap_cn_rx_co(cn_ranap_handle_co, ue, msgb_l2(oph->msg), msgb_l2len(oph->msg)); - break; - case OSMO_PRIM(OSMO_SCU_PRIM_N_DATA, PRIM_OP_INDICATION): - /* connection-oriented data received */ - DEBUGP(DRANAP, "N-DATA.ind(%u, %s)\n", prim->u.data.conn_id, - osmo_hexdump(msgb_l2(oph->msg), msgb_l2len(oph->msg))); - /* resolve UE context */ - ue = ue_conn_ctx_find(prim->u.data.conn_id); - rc = ranap_cn_rx_co(cn_ranap_handle_co, ue, msgb_l2(oph->msg), msgb_l2len(oph->msg)); - break; - case OSMO_PRIM(OSMO_SCU_PRIM_N_UNITDATA, PRIM_OP_INDICATION): - /* connection-less data received */ - DEBUGP(DRANAP, "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)); - break; - default: - rc = -1; - break; - } - - msgb_free(oph->msg); - return rc; -} - -int iu_init(void *ctx, struct osmo_sccp_instance *sccp, - iu_recv_cb_t iu_recv_cb, iu_event_cb_t iu_event_cb) -{ - talloc_iu_ctx = talloc_named_const(ctx, 1, "iu"); - talloc_asn1_ctx = talloc_named_const(talloc_iu_ctx, 1, "asn1"); - - global_iu_recv_cb = iu_recv_cb; - global_iu_event_cb = iu_event_cb; - g_sccp = sccp; - g_scu = osmo_sccp_user_bind(g_sccp, "OsmoMSC-Iu", sccp_sap_up, OSMO_SCCP_SSN_RANAP); - - return 0; -} - diff --git a/src/libiu/iu_vty.c b/src/libiu/iu_vty.c deleted file mode 100644 index 3fd3cd1..0000000 --- a/src/libiu/iu_vty.c +++ /dev/null @@ -1,133 +0,0 @@ -/* OpenBSC Iu related interface to quagga VTY */ -/* (C) 2016 by sysmocom s.m.f.c. GmbH - * All Rights Reserved - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - * - */ - -#include -#include - -#include -#include -#include -#include -#include - -#include - -static enum nsap_addr_enc *g_rab_assign_addr_enc = NULL; - -DEFUN(logging_asn_debug, - logging_asn_debug_cmd, - "logging asn1-debug (1|0)", - LOGGING_STR - "Log ASN.1 debug messages to stderr\n" - "Log ASN.1 debug messages to stderr\n" - "Do not log ASN.1 debug messages to stderr\n") -{ - asn_debug = atoi(argv[0]); - return CMD_SUCCESS; -} - -DEFUN(logging_asn_xer_print, - logging_asn_xer_print_cmd, - "logging asn1-xer-print (1|0)", - LOGGING_STR - "Log human readable representations of all ASN.1 messages to stderr\n" - "Log decoded ASN.1 messages to stderr\n" - "Do not log decoded ASN.1 messages to stderr\n") -{ - asn1_xer_print = atoi(argv[0]); - return CMD_SUCCESS; -} - -#define IU_STR "Iu interface protocol options\n" -DEFUN(cfg_iu_rab_assign_addr_enc, cfg_iu_rab_assign_addr_enc_cmd, - "iu rab-assign-addr-enc (x213|v4raw)", - IU_STR - "Choose RAB Assignment's Transport Layer Address encoding\n" - "ITU-T X.213 compliant address encoding (default)\n" - "32bit length raw IPv4 address (for ip.access nano3G)\n") -{ - if (!g_rab_assign_addr_enc) { - vty_out(vty, "%%RAB Assignment Transport Layer Address" - " encoding not available%s", VTY_NEWLINE); - return CMD_WARNING; - } - - if (strcmp(argv[0], "v4raw") == 0) - *g_rab_assign_addr_enc = NSAP_ADDR_ENC_V4RAW; - else - *g_rab_assign_addr_enc = NSAP_ADDR_ENC_X213; - return CMD_SUCCESS; -} - -extern struct osmo_sccp_addr local_sccp_addr; - -/* Note from the future: change-id Ib8c4fcdb4766c5e575618b95ce16dce51063206b will move this file to - * osmo-iuh, and there, change-id I3bb7fc1cd5261d214c6ba0cccfe95f637e6db087 will drop this vty command - * and use the point code defined via libosmo-sccp vty commands instead. */ -DEFUN(cfg_iu_local_addr_pc, cfg_iu_local_addr_pc_cmd, - "iu local-address point-code PC", - IU_STR "Local SCCP Address\n" "Set local point code\n" "point code\n") -{ - local_sccp_addr.presence = OSMO_SCCP_ADDR_T_PC | OSMO_SCCP_ADDR_T_SSN; - local_sccp_addr.ri = OSMO_SCCP_RI_SSN_PC; - local_sccp_addr.pc = osmo_ss7_pointcode_parse(NULL, argv[0]); - - return CMD_SUCCESS; -} - -/* TODO: GT address configuration, in line with 4.5.1.1.1 of TS 25.410 */ - -int iu_vty_config_write(struct vty *vty, const char *indent) -{ - if (!g_rab_assign_addr_enc) { - vty_out(vty, "%%RAB Assignment Transport Layer Address" - " encoding not available%s", VTY_NEWLINE); - return CMD_WARNING; - } - - switch (*g_rab_assign_addr_enc) { - case NSAP_ADDR_ENC_V4RAW: - vty_out(vty, "%siu rab-assign-addr-enc v4raw%s", indent, - VTY_NEWLINE); - break; - case NSAP_ADDR_ENC_X213: - /* default value, no need to write anything */ - break; - default: - LOGP(0, LOGL_ERROR, "Invalid value for" - " net.iu.rab_assign_addr_enc: %d\n", - *g_rab_assign_addr_enc); - return CMD_WARNING; - } - - vty_out(vty, "%siu local-address point-code %s%s", indent, - osmo_ss7_pointcode_print(NULL, local_sccp_addr.pc), VTY_NEWLINE); - - return CMD_SUCCESS; -} - -void iu_vty_init(int iu_parent_node, enum nsap_addr_enc *rab_assign_addr_enc) -{ - g_rab_assign_addr_enc = rab_assign_addr_enc; - - install_element(CFG_LOG_NODE, &logging_asn_debug_cmd); - install_element(CFG_LOG_NODE, &logging_asn_xer_print_cmd); - install_element(iu_parent_node, &cfg_iu_rab_assign_addr_enc_cmd); - install_element(iu_parent_node, &cfg_iu_local_addr_pc_cmd); -} diff --git a/src/libmsc/Makefile.am b/src/libmsc/Makefile.am index 9f246b3..c9b8bb4 100644 --- a/src/libmsc/Makefile.am +++ b/src/libmsc/Makefile.am @@ -35,8 +35,6 @@ gsm_04_14.c \ gsm_04_80.c \ gsm_subscriber.c \ - iucs.c \ - iucs_ranap.c \ mncc.c \ mncc_builtin.c \ mncc_sock.c \ @@ -52,7 +50,12 @@ meas_feed.c \ subscr_conn.c \ $(NULL) -if !BUILD_IU +if BUILD_IU +libmsc_a_SOURCES += \ + iucs.c \ + iucs_ranap.c \ + $(NULL) +else libmsc_a_SOURCES += \ iu_dummy.c \ $(NULL) diff --git a/src/libmsc/a_iface_bssap.c b/src/libmsc/a_iface_bssap.c index 561ccde..e8a2293 100644 --- a/src/libmsc/a_iface_bssap.c +++ b/src/libmsc/a_iface_bssap.c @@ -29,7 +29,6 @@ #include #include #include -#include #include #include #include diff --git a/src/libmsc/gsm_04_08.c b/src/libmsc/gsm_04_08.c index b6746a5..21bc2b8 100644 --- a/src/libmsc/gsm_04_08.c +++ b/src/libmsc/gsm_04_08.c @@ -72,13 +72,11 @@ #include #include #include - -#include - #ifdef BUILD_IU -#include +#include #endif +#include #include #include @@ -3412,7 +3410,7 @@ #ifdef BUILD_IU DEBUGP(DMM, "-> SECURITY MODE CONTROL %s\n", vlr_subscr_name(conn->vsub)); - return iu_tx_sec_mode_cmd(conn->iu.ue_ctx, tuple, 0, 1); + return ranap_iu_tx_sec_mode_cmd(conn->iu.ue_ctx, &tuple->vec, 0, 1); #else LOGP(DMM, LOGL_ERROR, "Cannot send Security Mode Control over RAN_UTRAN_IU," " built without Iu support\n"); diff --git a/src/libmsc/gsm_subscriber.c b/src/libmsc/gsm_subscriber.c index 73361a1..09540c1 100644 --- a/src/libmsc/gsm_subscriber.c +++ b/src/libmsc/gsm_subscriber.c @@ -20,6 +20,8 @@ * */ +#include "../../bscconfig.h" + #include #include #include @@ -32,6 +34,12 @@ #include +#ifdef BUILD_IU +#include +#else +#include +#endif + #include #include #include @@ -40,7 +48,6 @@ #include #include #include -#include #include #include #include @@ -108,10 +115,10 @@ case RAN_GERAN_A: return a_iface_tx_paging(vsub->imsi, vsub->tmsi, vsub->lac); case RAN_UTRAN_IU: - return iu_page_cs(vsub->imsi, - vsub->tmsi == GSM_RESERVED_TMSI? - NULL : &vsub->tmsi, - vsub->lac); + return ranap_iu_page_cs(vsub->imsi, + vsub->tmsi == GSM_RESERVED_TMSI? + NULL : &vsub->tmsi, + vsub->lac); default: break; } diff --git a/src/libmsc/iu_dummy.c b/src/libmsc/iu_dummy.c index 1f5dffb..e9d335e 100644 --- a/src/libmsc/iu_dummy.c +++ b/src/libmsc/iu_dummy.c @@ -26,39 +26,39 @@ #include "../../bscconfig.h" #ifndef BUILD_IU -#include -#include +#include #include #include #include struct msgb; -struct ue_conn_ctx; +struct ranap_ue_conn_ctx; struct gsm_auth_tuple; struct RANAP_Cause; +struct osmo_auth_vector; -int iu_tx(struct msgb *msg, uint8_t sapi) +int ranap_iu_tx(struct msgb *msg, uint8_t sapi) { LOGP(DLGLOBAL, LOGL_INFO, "iu_tx() dummy called, NOT transmitting %d bytes: %s\n", msg->len, osmo_hexdump(msg->data, msg->len)); return 0; } -int iu_tx_sec_mode_cmd(struct ue_conn_ctx *uectx, struct gsm_auth_tuple *tp, - int send_ck) +int ranap_iu_tx_sec_mode_cmd(struct ranap_ue_conn_ctx *uectx, struct osmo_auth_vector *vec, + int send_ck) { LOGP(DLGLOBAL, LOGL_INFO, "iu_tx_sec_mode_cmd() dummy called, NOT transmitting Security Mode Command\n"); return 0; } -int iu_page_cs(const char *imsi, const uint32_t *tmsi, uint16_t lac) +int ranap_iu_page_cs(const char *imsi, const uint32_t *tmsi, uint16_t lac) { LOGP(DLGLOBAL, LOGL_INFO, "iu_page_cs() dummy called, NOT paging\n"); return 23; } -int iu_page_ps(const char *imsi, const uint32_t *ptmsi, uint16_t lac, uint8_t rac) +int ranap_iu_page_ps(const char *imsi, const uint32_t *ptmsi, uint16_t lac, uint8_t rac) { LOGP(DLGLOBAL, LOGL_INFO, "iu_page_ps() dummy called, NOT paging\n"); return 0; @@ -72,19 +72,19 @@ return NULL; } -int iu_rab_act(struct ue_conn_ctx *ue_ctx, struct msgb *msg) +int ranap_iu_rab_act(struct ranap_ue_conn_ctx *ue_ctx, struct msgb *msg) { LOGP(DLGLOBAL, LOGL_INFO, "iu_rab_act() dummy called, NOT activating RAB\n"); return 0; } -int iu_tx_common_id(struct ue_conn_ctx *uectx, const char *imsi) +int ranap_iu_tx_common_id(struct ranap_ue_conn_ctx *uectx, const char *imsi) { LOGP(DLGLOBAL, LOGL_INFO, "iu_tx_common_id() dummy called, NOT sending CommonID\n"); return 0; } -int iu_tx_release(struct ue_conn_ctx *ctx, const struct RANAP_Cause *cause) +int ranap_iu_tx_release(struct ranap_ue_conn_ctx *ctx, const struct RANAP_Cause *cause) { LOGP(DLGLOBAL, LOGL_INFO, "iu_tx_release() dummy called, NOT sending Release\n"); return 0; diff --git a/src/libmsc/iucs.c b/src/libmsc/iucs.c index be026c8..04b9ece 100644 --- a/src/libmsc/iucs.c +++ b/src/libmsc/iucs.c @@ -25,17 +25,17 @@ #include #include +#include #include #include -#include #include #include #include /* For A-interface see libbsc/bsc_api.c subscr_con_allocate() */ static struct gsm_subscriber_connection *subscr_conn_allocate_iu(struct gsm_network *network, - struct ue_conn_ctx *ue, + struct ranap_ue_conn_ctx *ue, uint16_t lac) { struct gsm_subscriber_connection *conn; @@ -57,7 +57,7 @@ return conn; } -static int same_ue_conn(struct ue_conn_ctx *a, struct ue_conn_ctx *b) +static int same_ue_conn(struct ranap_ue_conn_ctx *a, struct ranap_ue_conn_ctx *b) { if (a == b) return 1; @@ -103,7 +103,7 @@ * connection IDs, or return NULL if not found. */ struct gsm_subscriber_connection *subscr_conn_lookup_iu( struct gsm_network *network, - struct ue_conn_ctx *ue) + struct ranap_ue_conn_ctx *ue) { struct gsm_subscriber_connection *conn; @@ -126,7 +126,7 @@ } /* Receive MM/CC/... message from IuCS (SCCP user SAP). - * msg->dst must reference a struct ue_conn_ctx, which identifies the peer that + * msg->dst must reference a struct ranap_ue_conn_ctx, which identifies the peer that * sent the msg. * * For A-interface see libbsc/bsc_api.c gsm0408_rcvmsg(). */ @@ -134,10 +134,10 @@ uint16_t *lac) { int rc; - struct ue_conn_ctx *ue_ctx; + struct ranap_ue_conn_ctx *ue_ctx; struct gsm_subscriber_connection *conn; - ue_ctx = (struct ue_conn_ctx*)msg->dst; + ue_ctx = (struct ranap_ue_conn_ctx*)msg->dst; /* TODO: are there message types that could allow us to skip this * search? */ diff --git a/src/libmsc/iucs_ranap.c b/src/libmsc/iucs_ranap.c index c016474..45de1ca 100644 --- a/src/libmsc/iucs_ranap.c +++ b/src/libmsc/iucs_ranap.c @@ -27,11 +27,11 @@ #include #include +#include #include #include #include -#include #include #include #include @@ -67,7 +67,7 @@ } int iucs_rx_ranap_event(struct gsm_network *network, - struct ue_conn_ctx *ue_ctx, int type, void *data) + struct ranap_ue_conn_ctx *ue_ctx, int type, void *data) { struct gsm_subscriber_connection *conn; @@ -79,19 +79,19 @@ } switch (type) { - case IU_EVENT_IU_RELEASE: - case IU_EVENT_LINK_INVALIDATED: + case RANAP_IU_EVENT_IU_RELEASE: + case RANAP_IU_EVENT_LINK_INVALIDATED: LOGP(DIUCS, LOGL_INFO, "IuCS release for %s\n", vlr_subscr_name(conn->vsub)); msc_subscr_conn_close(conn, 0); return 0; - case IU_EVENT_SECURITY_MODE_COMPLETE: + case RANAP_IU_EVENT_SECURITY_MODE_COMPLETE: LOGP(DIUCS, LOGL_INFO, "IuCS security mode complete for %s\n", vlr_subscr_name(conn->vsub)); return iucs_rx_sec_mode_compl(conn, (RANAP_SecurityModeCompleteIEs_t*)data); - case IU_EVENT_RAB_ASSIGN: + case RANAP_IU_EVENT_RAB_ASSIGN: return iucs_rx_rab_assign(conn, (RANAP_RAB_SetupOrModifiedItemIEs_t*)data); default: diff --git a/src/libmsc/msc_ifaces.c b/src/libmsc/msc_ifaces.c index 7d2e898..262bf98 100644 --- a/src/libmsc/msc_ifaces.c +++ b/src/libmsc/msc_ifaces.c @@ -23,7 +23,6 @@ #include #include #include -#include #include #include #include @@ -34,10 +33,13 @@ #include "../../bscconfig.h" #ifdef BUILD_IU +#include extern struct msgb *ranap_new_msg_rab_assign_voice(uint8_t rab_id, uint32_t rtp_ip, uint16_t rtp_port, bool use_x213_nsap); +#else +#include #endif /* BUILD_IU */ static int msc_tx(struct gsm_subscriber_connection *conn, struct msgb *msg) @@ -57,7 +59,7 @@ case RAN_UTRAN_IU: msg->dst = conn->iu.ue_ctx; - return iu_tx(msg, 0); + return ranap_iu_tx(msg, 0); default: LOGP(DMSC, LOGL_ERROR, @@ -134,10 +136,10 @@ DEBUGP(DIUCS, "%s: tx CommonID %s\n", vlr_subscr_name(conn->vsub), conn->vsub->imsi); - return iu_tx_common_id(conn->iu.ue_ctx, conn->vsub->imsi); + return ranap_iu_tx_common_id(conn->iu.ue_ctx, conn->vsub->imsi); } -static int iu_rab_act_cs(struct ue_conn_ctx *uectx, uint8_t rab_id, +static int iu_rab_act_cs(struct ranap_ue_conn_ctx *uectx, uint8_t rab_id, uint32_t rtp_ip, uint16_t rtp_port) { #ifdef BUILD_IU @@ -145,7 +147,7 @@ bool use_x213_nsap; uint32_t conn_id = uectx->conn_id; - use_x213_nsap = (uectx->rab_assign_addr_enc == NSAP_ADDR_ENC_X213); + use_x213_nsap = (uectx->rab_assign_addr_enc == RANAP_NSAP_ADDR_ENC_X213); LOGP(DIUCS, LOGL_DEBUG, "Assigning RAB: conn_id=%u, rab_id=%d," " rtp=%x:%u, use_x213_nsap=%d\n", conn_id, rab_id, rtp_ip, @@ -155,7 +157,7 @@ use_x213_nsap); msg->l2h = msg->data; - if (iu_rab_act(uectx, msg)) + if (ranap_iu_rab_act(uectx, msg)) LOGP(DIUCS, LOGL_ERROR, "Failed to send RAB Assignment:" " conn_id=%d rab_id=%d rtp=%x:%u\n", conn_id, rab_id, rtp_ip, rtp_port); @@ -170,7 +172,6 @@ { struct gsm_trans *trans = priv; struct gsm_subscriber_connection *conn = trans->conn; - struct ue_conn_ctx *uectx = conn->iu.ue_ctx; uint32_t rtp_ip; int rc; @@ -195,7 +196,7 @@ if (trans->conn->via_ran == RAN_UTRAN_IU) { /* Assign a voice channel via RANAP on 3G */ - if (iu_rab_act_cs(uectx, conn->iu.rab_id, rtp_ip, conn->rtp.port_subscr)) + if (iu_rab_act_cs(conn->iu.ue_ctx, conn->iu.rab_id, rtp_ip, conn->rtp.port_subscr)) goto rab_act_cs_error; } else if (trans->conn->via_ran == RAN_GERAN_A) { /* Assign a voice channel via A on 2G */ @@ -234,7 +235,7 @@ mgcp = conn->network->mgcpgw.client; #ifdef BUILD_IU - /* FIXME: HACK. where to scope the RAB Id? At the conn / subscriber / ue_conn_ctx? */ + /* FIXME: HACK. where to scope the RAB Id? At the conn / subscriber / ranap_ue_conn_ctx? */ static uint8_t next_iu_rab_id = 1; if (conn->via_ran == RAN_UTRAN_IU) conn->iu.rab_id = next_iu_rab_id ++; diff --git a/src/libmsc/msc_vty.c b/src/libmsc/msc_vty.c index 01e7e82..6ae4529 100644 --- a/src/libmsc/msc_vty.c +++ b/src/libmsc/msc_vty.c @@ -23,15 +23,19 @@ /* NOTE: I would have liked to call this the MSC_NODE instead of the MSC_NODE, * but MSC_NODE already exists to configure a remote MSC for osmo-bsc. */ +#include "../../bscconfig.h" + #include #include +#ifdef BUILD_IU +#include +#endif #include #include #include #include -#include static struct cmd_node msc_node = { MSC_NODE, @@ -99,7 +103,7 @@ mgcpgw_client_config_write(vty, " "); #ifdef BUILD_IU - iu_vty_config_write(vty, " "); + ranap_iu_vty_config_write(vty, " "); #endif return CMD_SUCCESS; @@ -153,6 +157,6 @@ mgcpgw_client_vty_init(MSC_NODE, &msc_network->mgcpgw.conf); #ifdef BUILD_IU - iu_vty_init(MSC_NODE, &msc_network->iu.rab_assign_addr_enc); + ranap_iu_vty_init(MSC_NODE, &msc_network->iu.rab_assign_addr_enc); #endif } diff --git a/src/libmsc/osmo_msc.c b/src/libmsc/osmo_msc.c index 866cfbd..4d24f22 100644 --- a/src/libmsc/osmo_msc.c +++ b/src/libmsc/osmo_msc.c @@ -28,10 +28,16 @@ #include #include #include -#include #include #include + +#include "../../bscconfig.h" +#ifdef BUILD_IU +#include +#else +#include +#endif /* Receive a SAPI-N-REJECT from BSC */ void msc_sapi_n_reject(struct gsm_subscriber_connection *conn, int dlci) @@ -285,7 +291,7 @@ switch (conn->via_ran) { case RAN_UTRAN_IU: - iu_tx_release(conn->iu.ue_ctx, NULL); + ranap_iu_tx_release(conn->iu.ue_ctx, NULL); /* FIXME: keep the conn until the Iu Release Outcome is * received from the UE, or a timeout expires. For now, the log * says "unknown UE" for each release outcome. */ diff --git a/src/libmsc/subscr_conn.c b/src/libmsc/subscr_conn.c index cdeeae9..bcab8e4 100644 --- a/src/libmsc/subscr_conn.c +++ b/src/libmsc/subscr_conn.c @@ -30,9 +30,7 @@ #include #include #include -#include #include - #define SUBSCR_CONN_TIMEOUT 5 /* seconds */ diff --git a/src/osmo-msc/Makefile.am b/src/osmo-msc/Makefile.am index bd734d1..87b6133 100644 --- a/src/osmo-msc/Makefile.am +++ b/src/osmo-msc/Makefile.am @@ -50,7 +50,6 @@ $(NULL) if BUILD_IU osmo_msc_LDADD += \ - $(top_builddir)/src/libiu/libiu.a \ $(LIBOSMORANAP_LIBS) \ $(LIBASN1C_LIBS) \ $(NULL) diff --git a/src/osmo-msc/msc_main.c b/src/osmo-msc/msc_main.c index cd713ee..de6af5d 100644 --- a/src/osmo-msc/msc_main.c +++ b/src/osmo-msc/msc_main.c @@ -66,9 +66,11 @@ #include #include -#include +#ifdef BUILD_IU +#include +#endif -#include +#include #include #include #include @@ -312,6 +314,7 @@ .is_config_node = bsc_vty_is_config_node, }; +#ifdef BUILD_IU static int rcvmsg_iu_cs(struct msgb *msg, struct gprs_ra_id *ra_id, uint16_t *sai) { DEBUGP(DIUCS, "got IuCS message" @@ -326,14 +329,15 @@ return gsm0408_rcvmsg_iucs(msc_network, msg, ra_id? &ra_id->lac : NULL); } -static int rx_iu_event(struct ue_conn_ctx *ctx, enum iu_event_type type, +static int rx_iu_event(struct ranap_ue_conn_ctx *ctx, enum ranap_iu_event_type type, void *data) { DEBUGP(DIUCS, "got IuCS event %u: %s\n", type, - iu_event_type_str(type)); + ranap_iu_event_type_str(type)); return iucs_rx_ranap_event(msc_network, ctx, type, data); } +#endif #define DEFAULT_M3UA_REMOTE_IP "127.0.0.1" #define DEFAULT_PC_A "0.23.1" @@ -564,7 +568,7 @@ #ifdef BUILD_IU /* Set up IuCS */ - iu_init(tall_msc_ctx, msc_network->iu.sccp, rcvmsg_iu_cs, rx_iu_event); + ranap_iu_init(tall_msc_ctx, DRANAP, "OsmoMSC-IuCS", msc_network->iu.sccp, rcvmsg_iu_cs, rx_iu_event); #endif /* Set up A interface */ diff --git a/tests/msc_vlr/Makefile.am b/tests/msc_vlr/Makefile.am index 6d51d6e..3ae0c84 100644 --- a/tests/msc_vlr/Makefile.am +++ b/tests/msc_vlr/Makefile.am @@ -50,13 +50,6 @@ $(top_builddir)/src/libtrau/libtrau.a \ $(top_builddir)/src/libmgcp/libmgcp.a \ $(top_builddir)/src/libcommon/libcommon.a \ - $(NULL) -if BUILD_IU -COMMON_LDADD += \ - $(top_builddir)/src/libiu/libiu.a \ - $(NULL) -endif -COMMON_LDADD += \ $(LIBSMPP34_LIBS) \ $(LIBOSMOCORE_LIBS) \ $(LIBOSMOGSM_LIBS) \ @@ -76,10 +69,10 @@ -Wl,--wrap=a_iface_tx_dtap \ -Wl,--wrap=a_iface_tx_clear_cmd \ -Wl,--wrap=a_iface_tx_paging \ - -Wl,--wrap=iu_tx \ - -Wl,--wrap=iu_tx_release \ - -Wl,--wrap=iu_tx_common_id \ - -Wl,--wrap=iu_page_cs \ + -Wl,--wrap=ranap_iu_tx \ + -Wl,--wrap=ranap_iu_tx_release \ + -Wl,--wrap=ranap_iu_tx_common_id \ + -Wl,--wrap=ranap_iu_page_cs \ -Wl,--wrap=msc_stop_paging \ -Wl,--wrap=gsm340_gen_scts \ -Wl,--wrap=RAND_bytes \ diff --git a/tests/msc_vlr/msc_vlr_tests.c b/tests/msc_vlr/msc_vlr_tests.c index a45b10f..3966aac 100644 --- a/tests/msc_vlr/msc_vlr_tests.c +++ b/tests/msc_vlr/msc_vlr_tests.c @@ -34,8 +34,13 @@ #include #include #include -#include + +#if BUILD_IU #include +#include +#else +#include +#endif #include "msc_vlr_tests.h" @@ -152,8 +157,8 @@ conn->bts = the_bts; conn->via_ran = rx_from_ran; if (conn->via_ran == RAN_UTRAN_IU) { - struct ue_conn_ctx *ue_ctx = talloc_zero(conn, struct ue_conn_ctx); - *ue_ctx = (struct ue_conn_ctx){ + struct ranap_ue_conn_ctx *ue_ctx = talloc_zero(conn, struct ranap_ue_conn_ctx); + *ue_ctx = (struct ranap_ue_conn_ctx){ .conn_id = 42, }; conn->iu.ue_ctx = ue_ctx; @@ -295,9 +300,9 @@ return 1; } -/* override, requires '-Wl,--wrap=iu_page_cs' */ -int __real_iu_page_cs(const char *imsi, const uint32_t *tmsi, uint16_t lac); -int __wrap_iu_page_cs(const char *imsi, const uint32_t *tmsi, uint16_t lac) +/* override, requires '-Wl,--wrap=ranap_iu_page_cs' */ +int __real_ranap_iu_page_cs(const char *imsi, const uint32_t *tmsi, uint16_t lac); +int __wrap_ranap_iu_page_cs(const char *imsi, const uint32_t *tmsi, uint16_t lac) { return _paging_sent(RAN_UTRAN_IU, imsi, tmsi ? *tmsi : GSM_RESERVED_TMSI, lac); } @@ -472,16 +477,16 @@ return 0; } -/* override, requires '-Wl,--wrap=iu_tx' */ -int __real_iu_tx(struct msgb *msg, uint8_t sapi); -int __wrap_iu_tx(struct msgb *msg, uint8_t sapi) +/* override, requires '-Wl,--wrap=ranap_iu_tx' */ +int __real_ranap_iu_tx(struct msgb *msg, uint8_t sapi); +int __wrap_ranap_iu_tx(struct msgb *msg, uint8_t sapi) { return _validate_dtap(msg, RAN_UTRAN_IU); } -/* override, requires '-Wl,--wrap=iu_tx_release' */ -int __real_iu_tx_release(struct ue_conn_ctx *ctx, const struct RANAP_Cause *cause); -int __wrap_iu_tx_release(struct ue_conn_ctx *ctx, const struct RANAP_Cause *cause) +/* override, requires '-Wl,--wrap=ranap_iu_tx_release' */ +int __real_ranap_iu_tx_release(struct ranap_ue_conn_ctx *ctx, const struct RANAP_Cause *cause); +int __wrap_ranap_iu_tx_release(struct ranap_ue_conn_ctx *ctx, const struct RANAP_Cause *cause) { btw("Iu Release --%s--> MS", ran_type_name(RAN_UTRAN_IU)); OSMO_ASSERT(iu_release_expected); @@ -491,8 +496,8 @@ } /* override, requires '-Wl,--wrap=iu_tx_common_id' */ -int __real_iu_tx_common_id(struct ue_conn_ctx *ue_ctx, const char *imsi); -int __wrap_iu_tx_common_id(struct ue_conn_ctx *ue_ctx, const char *imsi) +int __real_ranap_iu_tx_common_id(struct ranap_ue_conn_ctx *ue_ctx, const char *imsi); +int __wrap_ranap_iu_tx_common_id(struct ranap_ue_conn_ctx *ue_ctx, const char *imsi) { btw("Iu Common ID --%s--> MS (IMSI=%s)", ran_type_name(RAN_UTRAN_IU), imsi); return 0; diff --git a/tests/sgsn/Makefile.am b/tests/sgsn/Makefile.am index f1606cb..ccb8f44 100644 --- a/tests/sgsn/Makefile.am +++ b/tests/sgsn/Makefile.am @@ -74,7 +74,6 @@ if BUILD_IU sgsn_test_LDADD += \ - $(top_builddir)/src/libiu/libiu.a \ $(LIBOSMORANAP_LIBS) \ $(LIBOSMOSIGTRAN_LIBS) \ $(LIBASN1C_LIBS) \ diff --git a/tests/sms_queue/Makefile.am b/tests/sms_queue/Makefile.am index d17f996..62c479b 100644 --- a/tests/sms_queue/Makefile.am +++ b/tests/sms_queue/Makefile.am @@ -37,13 +37,6 @@ $(top_builddir)/src/libmgcp/libmgcp.a \ $(top_builddir)/src/libcommon/libcommon.a \ $(top_builddir)/src/libcommon-cs/libcommon-cs.a \ - $(NULL) -if BUILD_IU -sms_queue_test_LDADD += \ - $(top_builddir)/src/libiu/libiu.a \ - $(NULL) -endif -sms_queue_test_LDADD += \ $(LIBSMPP34_LIBS) \ $(LIBOSMOCORE_LIBS) \ $(LIBOSMOGSM_LIBS) \ -- To view, visit https://gerrit.osmocom.org/3489 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ib8c4fcdb4766c5e575618b95ce16dce51063206b Gerrit-PatchSet: 6 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sun Aug 27 15:39:23 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sun, 27 Aug 2017 15:39:23 +0000 Subject: [PATCH] osmo-msc[master]: build: check for -lgsm In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3587 to look at the new patch set (#6). build: check for -lgsm If libosmo-legacy-mgcp is built with --enable-mgcp-transcoding, we need to link -lgsm here as well. This autodetects whether -lgsm is necessary. Todo: how about --with-g729? Todo: osmo-msc is only using the mgcp client and should not actually need transcoding nor -lgsm. Change-Id: Iab55a089ae36017b79e7cbc3cac45ef9fd85dd43 --- M configure.ac 1 file changed, 27 insertions(+), 11 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/87/3587/6 diff --git a/configure.ac b/configure.ac index 67afc2d..397e90c 100644 --- a/configure.ac +++ b/configure.ac @@ -60,17 +60,6 @@ [osmo_ac_mgcp_transcoding="$enableval"],[osmo_ac_mgcp_transcoding="no"]) AC_ARG_WITH([g729], [AS_HELP_STRING([--with-g729], [Enable G.729 encoding/decoding.])], [osmo_ac_with_g729="$withval"],[osmo_ac_with_g729="no"]) -if test "$osmo_ac_mgcp_transcoding" = "yes" ; then - AC_SEARCH_LIBS([gsm_create], [gsm], [LIBRARY_GSM="$LIBS";LIBS=""], [AC_MSG_ERROR([--enable-mgcp-transcoding: cannot find usable libgsm])]) - AC_SUBST(LIBRARY_GSM) - if test "$osmo_ac_with_g729" = "yes" ; then - PKG_CHECK_MODULES(LIBBCG729, libbcg729 >= 0.1, [AC_DEFINE([HAVE_BCG729], [1], [Use bgc729 decoder/encoder])]) - fi - AC_DEFINE(BUILD_MGCP_TRANSCODING, 1, [Define if we want to build the MGCP gateway with transcoding support]) -fi -AM_CONDITIONAL(BUILD_MGCP_TRANSCODING, test "x$osmo_ac_mgcp_transcoding" = "xyes") -AC_SUBST(osmo_ac_mgcp_transcoding) - # Enable/disable 3G aka IuPS + IuCS support? AC_ARG_ENABLE([iu], [AS_HELP_STRING([--enable-iu], [Build 3G support, aka IuPS and IuCS interfaces])], [osmo_ac_iu="$enableval"],[osmo_ac_iu="no"]) @@ -134,6 +123,33 @@ AC_SUBST([COVERAGE_LDFLAGS]) fi +AC_DEFUN([CHECK_LIBOSMO_LEGACY_MGCP_NEEDS_LIBGSM], [ + AC_CACHE_CHECK( + [whether libosmo-legacy-mgcp needs -lgsm], + libosmo_cv_legacy_mgcp_needs_libgsm, [ + SAVE_LDFLAGS="${LDFLAGS}" + LDFLAGS="${LIBOSMOLEGACYMGCP_LIBS} ${LIBOSMOVTY_LIBS}" + AC_LINK_IFELSE( + [AC_LANG_PROGRAM([ + #include + ], [ + mgcpgw_client_init(0, 0); + ])], + [libosmo_cv_legacy_mgcp_needs_libgsm=no], + [libosmo_cv_legacy_mgcp_needs_libgsm=yes]) + LDFLAGS="${SAVE_LDFLAGS}" + ]) + ]) +CHECK_LIBOSMO_LEGACY_MGCP_NEEDS_LIBGSM +if test "x$libosmo_cv_legacy_mgcp_needs_libgsm" = xyes; then + AC_SEARCH_LIBS([gsm_create], [gsm], [LIBRARY_GSM="$LIBS";LIBS=""], + [AC_MSG_ERROR([libosmo-legacy-mgcp is built with transcoding and needs -lgsm but cannot find usable libgsm])]) + AC_SUBST(LIBRARY_GSM) + if test "$osmo_ac_with_g729" = "yes" ; then + PKG_CHECK_MODULES(LIBBCG729, libbcg729 >= 0.1, [AC_DEFINE([HAVE_BCG729], [1], [Use bgc729 decoder/encoder])]) + fi +fi + AC_DEFUN([CHECK_TM_INCLUDES_TM_GMTOFF], [ AC_CACHE_CHECK( [whether struct tm has tm_gmtoff member], -- To view, visit https://gerrit.osmocom.org/3587 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Iab55a089ae36017b79e7cbc3cac45ef9fd85dd43 Gerrit-PatchSet: 6 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sun Aug 27 15:39:23 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sun, 27 Aug 2017 15:39:23 +0000 Subject: [PATCH] osmo-msc[master]: split off osmo-msc: remove files, apply build, rename In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3497 to look at the new patch set (#7). split off osmo-msc: remove files, apply build, rename Change-Id: Icf025e5ea8d180613b3114282951c9afa67af9a7 --- M configure.ac D debian/osmo-gtphub.default D debian/osmo-gtphub.examples D debian/osmo-gtphub.init D debian/osmo-gtphub.install D debian/osmocom-bs11-utils.install D debian/osmocom-bsc-nat.init D debian/osmocom-bsc-nat.install D debian/osmocom-bsc.examples D debian/osmocom-bsc.install D debian/osmocom-gbproxy.init D debian/osmocom-gbproxy.install D debian/osmocom-ipaccess-utils.install D debian/osmocom-sgsn.default D debian/osmocom-sgsn.examples D debian/osmocom-sgsn.init D debian/osmocom-sgsn.install D doc/BS11-OML.txt D doc/channel_release.txt D doc/examples/osmo-bsc/osmo-bsc.cfg D doc/examples/osmo-bsc_mgcp/mgcp.cfg D doc/examples/osmo-bsc_nat/black-list.cfg D doc/examples/osmo-bsc_nat/osmo-bsc_nat.cfg D doc/examples/osmo-gbproxy/osmo-gbproxy-legacy.cfg D doc/examples/osmo-gbproxy/osmo-gbproxy.cfg D doc/examples/osmo-gtphub/gtphub-example.txt D doc/examples/osmo-gtphub/osmo-gtphub-1iface.cfg D doc/examples/osmo-gtphub/osmo-gtphub.cfg D doc/examples/osmo-sgsn/osmo-sgsn.cfg D doc/oml-interface.txt M include/Makefile.am D include/compat_af_isdn.h D include/mISDNif.h M include/openbsc/Makefile.am D include/openbsc/bsc_nat.h D include/openbsc/bsc_nat_callstats.h D include/openbsc/bsc_nat_sccp.h D include/openbsc/bsc_subscriber.h D include/openbsc/gb_proxy.h D include/openbsc/gprs_gb_parse.h D include/openbsc/gprs_gmm.h D include/openbsc/gprs_llc.h D include/openbsc/gprs_llc_xid.h D include/openbsc/gprs_sgsn.h D include/openbsc/gprs_sndcp.h D include/openbsc/gprs_sndcp_comp.h D include/openbsc/gprs_sndcp_dcomp.h D include/openbsc/gprs_sndcp_pcomp.h D include/openbsc/gprs_sndcp_xid.h D include/openbsc/gprs_subscriber.h D include/openbsc/gprs_utils.h D include/openbsc/nat_rewrite_trie.h M include/openbsc/paging.h D include/openbsc/pcu_if.h D include/openbsc/pcuif_proto.h D include/openbsc/sgsn.h D include/openbsc/v42bis.h D include/openbsc/v42bis_private.h M osmoappdesc.py M src/Makefile.am D src/gprs/.gitignore D src/gprs/Makefile.am D src/gprs/crc24.c D src/gprs/gb_proxy.c D src/gprs/gb_proxy_main.c D src/gprs/gb_proxy_patch.c D src/gprs/gb_proxy_peer.c D src/gprs/gb_proxy_tlli.c D src/gprs/gb_proxy_vty.c D src/gprs/gprs_gb_parse.c D src/gprs/gprs_gmm.c D src/gprs/gprs_llc.c D src/gprs/gprs_llc_parse.c D src/gprs/gprs_llc_vty.c D src/gprs/gprs_llc_xid.c D src/gprs/gprs_sgsn.c D src/gprs/gprs_sndcp.c D src/gprs/gprs_sndcp_comp.c D src/gprs/gprs_sndcp_dcomp.c D src/gprs/gprs_sndcp_pcomp.c D src/gprs/gprs_sndcp_vty.c D src/gprs/gprs_sndcp_xid.c D src/gprs/gprs_subscriber.c D src/gprs/gprs_utils.c D src/gprs/gtphub.c D src/gprs/gtphub_ares.c D src/gprs/gtphub_main.c D src/gprs/gtphub_sock.c D src/gprs/gtphub_vty.c D src/gprs/osmo_sgsn.cfg D src/gprs/sgsn_ares.c D src/gprs/sgsn_auth.c D src/gprs/sgsn_cdr.c D src/gprs/sgsn_ctrl.c D src/gprs/sgsn_libgtp.c D src/gprs/sgsn_main.c D src/gprs/sgsn_vty.c D src/gprs/slhc.c D src/gprs/v42bis.c D src/ipaccess/Makefile.am D src/ipaccess/abisip-find.c D src/ipaccess/ipaccess-config.c D src/ipaccess/ipaccess-firmware.c D src/ipaccess/ipaccess-proxy.c D src/ipaccess/network_listen.c D src/libbsc/Makefile.am D src/libbsc/abis_nm.c D src/libbsc/abis_nm_ipaccess.c D src/libbsc/abis_nm_vty.c D src/libbsc/abis_om2000.c D src/libbsc/abis_om2000_vty.c D src/libbsc/abis_rsl.c D src/libbsc/arfcn_range_encode.c D src/libbsc/bsc_api.c D src/libbsc/bsc_ctrl_commands.c D src/libbsc/bsc_ctrl_lookup.c D src/libbsc/bsc_dyn_ts.c D src/libbsc/bsc_init.c D src/libbsc/bsc_msc.c D src/libbsc/bsc_rf_ctrl.c D src/libbsc/bsc_rll.c D src/libbsc/bsc_subscriber.c D src/libbsc/bsc_vty.c D src/libbsc/bts_ericsson_rbs2000.c D src/libbsc/bts_init.c D src/libbsc/bts_ipaccess_nanobts.c D src/libbsc/bts_ipaccess_nanobts_omlattr.c D src/libbsc/bts_nokia_site.c D src/libbsc/bts_siemens_bs11.c D src/libbsc/bts_sysmobts.c D src/libbsc/bts_unknown.c D src/libbsc/chan_alloc.c D src/libbsc/e1_config.c D src/libbsc/gsm_04_08_utils.c D src/libbsc/gsm_04_80_utils.c D src/libbsc/handover_decision.c D src/libbsc/handover_logic.c D src/libbsc/meas_proc.c D src/libbsc/meas_rep.c D src/libbsc/net_init.c D src/libbsc/paging.c D src/libbsc/pcu_sock.c D src/libbsc/rest_octets.c D src/libbsc/system_information.c M src/libcommon/common_vty.c D src/libfilter/Makefile.am D src/libfilter/bsc_msg_acc.c D src/libfilter/bsc_msg_filter.c D src/libfilter/bsc_msg_vty.c M src/libmsc/vty_interface_layer3.c D src/libtrau/Makefile.am D src/libtrau/rtp_proxy.c D src/libtrau/trau_mux.c D src/libtrau/trau_upqueue.c M src/libvlr/vlr.c D src/osmo-bsc/Makefile.am D src/osmo-bsc/osmo_bsc_api.c D src/osmo-bsc/osmo_bsc_audio.c D src/osmo-bsc/osmo_bsc_bssap.c D src/osmo-bsc/osmo_bsc_ctrl.c D src/osmo-bsc/osmo_bsc_filter.c D src/osmo-bsc/osmo_bsc_grace.c D src/osmo-bsc/osmo_bsc_main.c D src/osmo-bsc/osmo_bsc_msc.c D src/osmo-bsc/osmo_bsc_reset.c D src/osmo-bsc/osmo_bsc_sigtran.c D src/osmo-bsc/osmo_bsc_vty.c D src/osmo-bsc_nat/Makefile.am D src/osmo-bsc_nat/bsc_filter.c D src/osmo-bsc_nat/bsc_mgcp_utils.c D src/osmo-bsc_nat/bsc_nat.c D src/osmo-bsc_nat/bsc_nat_ctrl.c D src/osmo-bsc_nat/bsc_nat_filter.c D src/osmo-bsc_nat/bsc_nat_rewrite.c D src/osmo-bsc_nat/bsc_nat_rewrite_trie.c D src/osmo-bsc_nat/bsc_nat_utils.c D src/osmo-bsc_nat/bsc_nat_vty.c D src/osmo-bsc_nat/bsc_sccp.c D src/osmo-bsc_nat/bsc_ussd.c M src/osmo-msc/Makefile.am M src/utils/Makefile.am D src/utils/bs11_config.c D src/utils/isdnsync.c M tests/Makefile.am D tests/abis/Makefile.am D tests/abis/abis_test.c D tests/abis/abis_test.ok D tests/bsc-nat-trie/Makefile.am D tests/bsc-nat-trie/bsc_nat_trie_test.c D tests/bsc-nat-trie/bsc_nat_trie_test.ok D tests/bsc-nat-trie/prefixes.csv D tests/bsc-nat/Makefile.am D tests/bsc-nat/barr.cfg D tests/bsc-nat/barr_dup.cfg D tests/bsc-nat/bsc_data.c D tests/bsc-nat/bsc_nat_test.c D tests/bsc-nat/bsc_nat_test.ok D tests/bsc-nat/prefixes.csv D tests/bsc/Makefile.am D tests/bsc/bsc_test.c D tests/bsc/bsc_test.ok D tests/channel/Makefile.am D tests/channel/channel_test.c D tests/channel/channel_test.ok D tests/gbproxy/Makefile.am D tests/gbproxy/gbproxy_test.c D tests/gbproxy/gbproxy_test.ok D tests/gprs/Makefile.am D tests/gprs/gprs_test.c D tests/gprs/gprs_test.ok D tests/gsm0408/Makefile.am D tests/gsm0408/gsm0408_test.c D tests/gsm0408/gsm0408_test.ok D tests/gtphub/Makefile.am D tests/gtphub/gtphub_test.c D tests/gtphub/gtphub_test.ok M tests/msc_vlr/Makefile.am M tests/msc_vlr/msc_vlr_tests.c D tests/nanobts_omlattr/Makefile.am D tests/nanobts_omlattr/nanobts_omlattr_test.c D tests/nanobts_omlattr/nanobts_omlattr_test.ok D tests/oap/Makefile.am D tests/oap/oap_client_test.c D tests/oap/oap_client_test.err D tests/oap/oap_client_test.ok D tests/sgsn/Makefile.am D tests/sgsn/sgsn_test.c D tests/sgsn/sgsn_test.ok D tests/slhc/Makefile.am D tests/slhc/slhc_test.c D tests/slhc/slhc_test.ok M tests/sms_queue/Makefile.am D tests/sndcp_xid/Makefile.am D tests/sndcp_xid/sndcp_xid_test.c D tests/sndcp_xid/sndcp_xid_test.ok D tests/subscr/Makefile.am D tests/subscr/bsc_subscr_test.c D tests/subscr/bsc_subscr_test.err D tests/subscr/bsc_subscr_test.ok M tests/testsuite.at D tests/trau/Makefile.am D tests/trau/trau_test.c D tests/trau/trau_test.ok D tests/v42bis/Makefile.am D tests/v42bis/v42bis_test.c D tests/v42bis/v42bis_test.ok M tests/vty_test_runner.py D tests/xid/Makefile.am D tests/xid/xid_test.c D tests/xid/xid_test.ok D tools/hlrstat.pl 251 files changed, 17 insertions(+), 100,396 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/97/3497/7 -- To view, visit https://gerrit.osmocom.org/3497 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Icf025e5ea8d180613b3114282951c9afa67af9a7 Gerrit-PatchSet: 7 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Sun Aug 27 15:39:23 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sun, 27 Aug 2017 15:39:23 +0000 Subject: [PATCH] osmo-msc[master]: libmsc: make pitfall in gsm0408_dispatch() more obvious 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/3498 to look at the new patch set (#7). libmsc: make pitfall in gsm0408_dispatch() more obvious The function gsm0408_dispatch() accepts a message buffer pointer and accesses the l3h pointer. Even in a properly allocated message buffer, this may lead into a segfault if the user forgets to set the l3h pointer. This commit adds assertions to popup a more expressive error message. Change-Id: I43bd9bd1c170559aaa8dacaef25dba090744bcd5 --- M src/libmsc/gsm_04_08.c 1 file changed, 6 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/98/3498/7 diff --git a/src/libmsc/gsm_04_08.c b/src/libmsc/gsm_04_08.c index 21bc2b8..90a0431 100644 --- a/src/libmsc/gsm_04_08.c +++ b/src/libmsc/gsm_04_08.c @@ -3216,13 +3216,17 @@ /* Main entry point for GSM 04.08/44.008 Layer 3 data (e.g. from the BSC). */ int gsm0408_dispatch(struct gsm_subscriber_connection *conn, struct msgb *msg) { - struct gsm48_hdr *gh = msgb_l3(msg); - uint8_t pdisc = gsm48_hdr_pdisc(gh); + struct gsm48_hdr *gh; + uint8_t pdisc; int rc = 0; + OSMO_ASSERT(msg->l3h) OSMO_ASSERT(conn); OSMO_ASSERT(msg); + gh = msgb_l3(msg); + pdisc = gsm48_hdr_pdisc(gh); + LOGP(DRLL, LOGL_DEBUG, "Dispatching 04.08 message %s (0x%x:0x%x)\n", gsm48_pdisc_msgtype_name(pdisc, gsm48_hdr_msg_type(gh)), pdisc, gsm48_hdr_msg_type(gh)); -- To view, visit https://gerrit.osmocom.org/3498 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I43bd9bd1c170559aaa8dacaef25dba090744bcd5 Gerrit-PatchSet: 7 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: dexter From gerrit-no-reply at lists.osmocom.org Sun Aug 27 15:39:23 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sun, 27 Aug 2017 15:39:23 +0000 Subject: [PATCH] osmo-msc[master]: rework debian packages 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/3499 to look at the new patch set (#7). rework debian packages support Remove old leftover from split of osmo-mgw out of openbsc. Change-Id: I77544cb38c31777c3fab52979d19488a63e52de3 --- D debian/autoreconf M debian/changelog M debian/control M debian/copyright D debian/docs D debian/openbsc-dev.install A debian/osmo-msc.install D debian/osmocom-nitb.default D debian/osmocom-nitb.dirs D debian/osmocom-nitb.examples D debian/osmocom-nitb.init D debian/osmocom-nitb.install M debian/rules 13 files changed, 240 insertions(+), 557 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/99/3499/7 diff --git a/debian/autoreconf b/debian/autoreconf deleted file mode 100644 index 9a3a67f..0000000 --- a/debian/autoreconf +++ /dev/null @@ -1 +0,0 @@ -openbsc diff --git a/debian/changelog b/debian/changelog index e9a4212..a1b3dda 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,75 +1,5 @@ -openbsc (0.15.1) UNRELEASED; urgency=medium +osmo-msc (0.1.0) UNRELEASED; urgency=low - * Move forward toward a new release. - * Prevent SGSN starting with 'auth-policy remote' when no 'gsup remote-*' are configured. - Note: such configs are broken without extra workarounds anyway. + * Initial release. - -- Holger Hans Peter Freyther Tue, 24 May 2016 23:14:31 +0200 - -openbsc (0.14.0) unstable; urgency=low - - * New upstream tag and additional patches. - - -- Holger Hans Peter Freyther Sat, 14 Mar 2015 20:33:25 +0100 - -openbsc (0.12.0+git26-7) unstable; urgency=low - - * 64bit fix for the MGCP rewriting - - -- Holger Hans Peter Freyther Wed, 07 Nov 2012 11:39:34 +0100 - -openbsc (0.12.0+git26-6) precise; urgency=low - - * Added init script for osmocom-sgsn. - - -- Eric Butler Fri, 24 Aug 2012 21:04:32 -0700 - -openbsc (0.12.0+git26-5) precise; urgency=low - - * Don't enable MNCC sock by default. - * Automatically create important directories. - * Fix init script 'stop' command. - - -- Eric Butler Fri, 24 Aug 2012 20:56:33 -0700 - -openbsc (0.12.0+git26-4) precise; urgency=low - - * Specify HLR path and enable RTP proxy. - - -- Eric Butler Mon, 20 Aug 2012 00:21:07 -0700 - -openbsc (0.12.0+git26-3) precise; urgency=low - - * Fix init script. - - -- Eric Butler Sun, 19 Aug 2012 16:05:44 -0700 - -openbsc (0.12.0+git26-2) precise; urgency=low - - * Fix libdbi package dependency. - - -- Eric Butler Wed, 15 Aug 2012 00:35:37 -0700 - -openbsc (0.12.0+git26-1) precise; urgency=low - - * Fix version issue. - - -- Eric Butler Tue, 14 Aug 2012 21:00:51 -0700 - -openbsc (0.12.0+git26) precise; urgency=low - - * Updated ubuntu package. - - -- Eric Butler Tue, 14 Aug 2012 17:36:51 -0700 - -openbsc (0.9.13.115.eb113-1) natty; urgency=low - - * New upstream release - - -- Harald Welte Wed, 11 May 2011 18:41:24 +0000 - -openbsc (0.9.4-1) unstable; urgency=low - - * Initial release - - -- Harald Welte Tue, 24 Aug 2010 13:34:24 +0200 + -- Alexander Couzens Tue, 08 Aug 2017 01:13:01 +0000 diff --git a/debian/control b/debian/control index 87b6f07..907ec38 100644 --- a/debian/control +++ b/debian/control @@ -1,181 +1,41 @@ -Source: openbsc -Maintainer: Harald Welte +Source: osmo-msc Section: net -Priority: optional -Build-Depends: debhelper (>= 9), - autotools-dev, - autoconf-archive, - pkg-config, - libgtp-dev, - libosmocore-dev, - libosmo-sccp-dev, - libdbi0-dev, +Priority: extra +Maintainer: Alexander Couzens +Build-Depends: debhelper (>=9), dh-autoreconf, - libosmo-abis-dev, - libosmo-netif-dev, - libdbd-sqlite3, - libpcap-dev, + autotools-dev, + autoconf, + automake, + libtool, + pkg-config, + libdbi-dev, + libtalloc-dev, libssl-dev, libc-ares-dev, - libsmpp34-dev + libgtp-dev, + libasn1c-dev, + libc-ares-dev, + libosmocore-dev, + libosmo-sccp-dev, + libosmo-abis-dev, + libosmo-legacy-mgcp-dev, + libosmo-netif-dev, + libosmo-ranap-dev Standards-Version: 3.9.8 -Vcs-Git: git://bs11-abis.gnumonks.org/openbsc.git -Vcs-Browser: http://openbsc.osmocom.org/trac/browser -Homepage: https://projects.osmocom.org/projects/openbsc +Vcs-Git: git://git.osmocom.org/osmo-bsc.git +Vcs-Browser: https://git.osmocom.org/osmo-bsc/ +Homepage: https://projects.osmocom.org/projects/osmo-bsc -Package: osmocom-bsc +Package: osmo-msc Architecture: any -Depends: ${shlibs:Depends}, - ${misc:Depends} -Description: GSM Base Station Controller - This is the BSC-only version of OpenBSC. It requires a Mobile Switching Center - (MSC) to operate. - . - You might rather prefer to use osmocom-nitb which is considered a - "GSM Network-in-a-Box" and does not depend on a MSC. +Multi-Arch: foreign +Depends: ${misc:Depends}, ${shlibs:Depends} +Description: OsmoMSC: Osmocom's Mobile Switching Center for 2G and 3G circuit-switched mobile networks -Package: osmocom-nitb -Architecture: any -Depends: ${shlibs:Depends}, - ${misc:Depends}, - libdbd-sqlite3 -Description: GSM Network-in-a-Box, implements BSC, MSC, SMSC, HLR, VLR - This is the Network-in-a-Box version of OpenBSC. It has all the GSM network - components bundled together. When using osmocom-nitb, there is no need for a - Mobile Switching Center (MSC) which is needed when using osmocom-bsc. - -Package: osmocom-ipaccess-utils -Architecture: any -Depends: ${shlibs:Depends}, - ${misc:Depends} -Description: Command line utilities for ip.access nanoBTS - This package contains utilities that are specific for nanoBTS when being used - together with OpenBSC. It contains mainly three tools: ipaccess-find, - ipaccess-config and ipaccess-proxy. - -Package: osmocom-bs11-utils -Architecture: any -Depends: ${shlibs:Depends}, - ${misc:Depends} -Description: Command line utilities for Siemens BS-11 BTS - There is a tool in this package for configuring the Siemens BS-11 BTS. - Additionally, it contains one tool for making use of an ISDN-card and the - public telephone network as frequency standard for the E1 line. - -Package: osmocom-sgsn -Architecture: any -Depends: ${shlibs:Depends}, - ${misc:Depends} -Suggests: osmocom-bsc -Description: Osmocom Serving GPRS Support Node - This is an implementation of the GPRS Serving GPRS Support Node (SGSN). As - such it implements the GPRS Mobility Management (GMM) and SM (Session - Management). - . - The SGSN connects via the Gb-interface to the BSS (like the osmo-pcu or an - ip.access nanoBTS), and it connects via the GTP protocol to a Gateway GPRS - Support Node (GGSN) like openggsn. - -Package: osmocom-gbproxy -Architecture: any -Depends: ${shlibs:Depends}, - ${misc:Depends} -Recommends: osmocom-sgsn -Description: Osmocom GPRS Gb Interface Proxy - The purpose of the Gb proxy is to aggregate the Gb links of multiple - BSS's and present them in one Gb link to the SGSN. - . - This package is part of OpenBSC and closely related to osmocom-sgsn. - -Package: osmocom-bsc-nat -Architecture: any -Depends: ${shlibs:Depends}, - ${misc:Depends} -Recommends: osmocom-bsc -Description: Osmocom Base Station Controller Network Address Translation - This NAT is useful for masquerading multiple BSCs behind one. It listens - for incoming BSCs on port 5000 and connects to a specified Mobile Switching - Center (MSC). - . - This package is part of OpenBSC and closely related to osmocom-bsc. - -Package: openbsc-dev -Architecture: all -Depends: ${misc:Depends} -Description: Header file needed by tools tightly integrated - Some other programs depend on gsm_data_shared.h and gsm_data_shared.c - from OpenBSC. This package installs these files to your file system so - that the other packages can build-depend on this package. - . - The directory structure is copied after the structure in the repository - and the header and .c file are installed into /usr/src/osmocom/openbsc/. - -Package: osmo-gtphub -Architecture: any -Depends: ${shlibs:Depends}, ${misc:Depends} -Description: Osmocom GTP Hub - Proxy for comms between multiple SGSNs and GGSNs. - -Package: osmocom-bsc-dbg -Architecture: any +Package: osmo-msc-dbg Section: debug -Priority: extra -Depends: osmocom-bsc (= ${binary:Version}), ${misc:Depends} -Description: Debug symbols for the OpenBSC BSC - Make debugging possible - -Package: osmocom-nitb-dbg Architecture: any -Section: debug -Priority: extra -Depends: osmocom-nitb (= ${binary:Version}), ${misc:Depends} -Description: Debug symbols for the OpenBSC NITB - Make debugging possible - -Package: osmocom-ipaccess-utils-dbg -Architecture: any -Section: debug -Priority: extra -Depends: osmocom-ipaccess-utils (= ${binary:Version}), ${misc:Depends} -Description: Debug symbols for the OpenBSC ip.access utils - Make debugging possible - -Package: osmocom-bs11-utils-dbg -Architecture: any -Section: debug -Priority: extra -Depends: osmocom-bs11-utils (= ${binary:Version}), ${misc:Depends} -Description: Debug symbols for the OpenBSC BS11 utils - Make debugging possible - -Package: osmocom-sgsn-dbg -Architecture: any -Section: debug -Priority: extra -Depends: osmocom-sgsn (= ${binary:Version}), ${misc:Depends} -Description: Debug symbols for the OpenBSC Serving GPRS Support Node - Make debugging possible - -Package: osmocom-gbproxy-dbg -Architecture: any -Section: debug -Priority: extra -Depends: osmocom-gbproxy (= ${binary:Version}), ${misc:Depends} -Description: Debug symbols for the OpenBSC GPRS GBProxy - Make debugging possible - -Package: osmocom-bsc-nat-dbg -Architecture: any -Section: debug -Priority: extra -Depends: osmocom-bsc-nat (= ${binary:Version}), ${misc:Depends} -Description: Debug symbols for the OpenBSC Network Address Translation - Make debugging possible - -Package: osmo-gtphub-dbg -Architecture: any -Section: debug -Priority: extra -Depends: osmo-gtphub (= ${binary:Version}), ${misc:Depends} -Description: Debug symbols for Osmocom GTP Hub - Make debugging possible +Multi-Arch: same +Depends: osmo-msc (= ${binary:Version}), ${misc:Depends} +Description: OsmoMSC: Osmocom's Mobile Switching Center for 2G and 3G circuit-switched mobile networks diff --git a/debian/copyright b/debian/copyright index 1e4dee1..e3cd9b3 100644 --- a/debian/copyright +++ b/debian/copyright @@ -1,75 +1,83 @@ Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ -Upstream-Name: OpenBSC -Source: http://openbsc.osmocom.org/ +Upstream-Name: osmo-msc +Source: git://git.osmocom.org/osmo-msc -Files: * -Copyright: 2008-2015 Harald Welte - 2008-2015 Holger Hans Peter Freyther - 2009-2015 On-Waves - 2008 Jan Luebbe - 2008,2010-2011 Daniel Willmann - 2009,2011,2013 Andreas Eversberg - 2009,2011 Dieter Spaar - 2009 Mike Haben - 2010 Sylvain Munaut <246tnt at gmail.com> - 2012-2013 Pablo Neira Ayuso - 2013-2015 Sysmocom s.f.m.c. GmbH (Jacob Erlbeck) - 2014 Alexander Chemeris -License: AGPL-3+ -Comment: Contributions by Stefan Schmidt as well - -Files: wireshark/0001-abis_oml.patch - wireshark/0002-ericsson_rbs2409.patch - wireshark/0003-lucent-hnb.patch - wireshark/0005-rsl-hsl.patch -Copyright: 1998 Gerald Combs - 2007,2011 Anders Broman - 2009 Holger Hans Peter Freyther - 2009-2011 Harald Welte -License: GPL-2+ - -Files: openbsc/include/mISDNif.h -Copyright: 2008 Karsten Keil -License: LGPL-2.1 - -Files: openbsc/src/libmgcp/g711common.h -Copyright: 2009 Abramo Bagnara -License: GPL-2+ - -Files: openbsc/git-version-gen -Copyright: 2007-2010 Free Software Foundation -License: GPL-3+ - -Files: openbsc/osmoappdesc.py - openbsc/tests/smpp_test_runner.py - openbsc/tests/ctrl_test_runner.py - openbsc/tests/vty_test_runner.py -Copyright: 2013 Katerina Barone-Adesi - 2013 Jacob Erlbeck - 2013-2014 Holger Hans Peter Freyther -License: GPL-3+ - -Files: openbsc/src/libbsc/bsc_ctrl_lookup.c -Copyright: 2010-2011 Daniel Willmann - 2010-2011 On-Waves -License: GPL-2+ - -Files: openbsc/src/libmsc/mncc_sock.c - openbsc/src/libmsc/mncc_builtin.c -Copyright: 2008-2010 Harald Welte - 2009 Andreas Eversberg - 2012 Holger Hans Peter Freyther -License: GPL-2+ - -Files: debian/* -Copyright: 2012-2015 Holger Hans Peter Freyther - 2016 Ruben Undheim -License: GPL-2+ - - -License: AGPL-3+ - This package is free software; you can redistribute it and/or modify +Files: * +Copyright: 2008 Daniel Willmann + 2008 Jan Luebbe + 2008-2015 Holger Hans Peter Freyther + 2008-2016 Harald Welte + 2009 Andreas Eversberg + 2009 Mike Haben + 2010 Sylvain Munaut + 2010-2013 On-Waves + 2013 Jacob Erlbeck + 2011 Andreas Eversberg + 2011-2017 sysmocom s.f.m.c. GmbH + 2014-2015 Alexander Chemeris +License: AGPL-3.0+ + This program is free software; you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + . + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Affero General Public License for more details. + . + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see . + +Files: src/libmsc/mncc_builtin.c + src/libmsc/mncc_sock.c +Copyright: 2008-2010 Harald Welte + 2009 Andreas Eversberg + 2012 Holger Hans Peter Freyther +License: GPL-2.0+ + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + . + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + . + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + . + On Debian systems, the complete text of the GNU General Public License + Version 2 can be found in `/usr/share/common-licenses/GPL-2'. + +Files: osmoappdesc.py +Copyright: 2013 Katerina Barone-Adesi +License: GPL-3.0+ + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + . + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + . + You should have received a copy of the GNU General Public License + along with this program. If not, see + . + Most systems won't be able to use these, so they're separated out + . + On Debian systems, the complete text of the GNU General Public License + Version 3 can be found in `/usr/share/common-licenses/GPL-3'. + +Files: git-version-gen +Copyright: 2007-2010 Free Software Foundation, Inc. +License: GPL-3.0+ + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. . @@ -78,60 +86,88 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. . - You should have received a copy of the GNU Affero General Public License - along with this program. If not, see . - - -License: GPL-2+ - This package is free software: you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 2 of the License, or (at - your option) any later version. - . - This program is distributed in the hope that it will be useful, but - WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - for more details. - . You should have received a copy of the GNU General Public License along with this program. If not, see . . - On Debian systems, the complete text of the GNU General Public - License version 2 can be found in "/usr/share/common-licenses/GPL-2". - - -License: GPL-3+ - This package is free software: you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or (at - your option) any later version. + This script is derived from GIT-VERSION-GEN from GIT: http://git.or.cz/. + It may be run two ways: + - from a git repository in which the "git describe" command below + produces useful output (thus requiring at least one signed tag) + - from a non-git-repo directory containing a .tarball-version file, which + presumes this script is invoked like "./git-version-gen .tarball-version". . - This program is distributed in the hope that it will be useful, but - WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - for more details. + In order to use intra-version strings in your project, you will need two + separate generated version string files: . - You should have received a copy of the GNU General Public License - along with this program. If not, see . + .tarball-version - present only in a distribution tarball, and not in + a checked-out repository. Created with contents that were learned at + the last time autoconf was run, and used by git-version-gen. Must not + be present in either $(srcdir) or $(builddir) for git-version-gen to + give accurate answers during normal development with a checked out tree, + but must be present in a tarball when there is no version control system. + Therefore, it cannot be used in any dependencies. GNUmakefile has + hooks to force a reconfigure at distribution time to get the value + correct, without penalizing normal development with extra reconfigures. . - On Debian systems, the complete text of the GNU General Public - License version 3 can be found in "/usr/share/common-licenses/GPL-3". + .version - present in a checked-out repository and in a distribution + tarball. Usable in dependencies, particularly for files that don't + want to depend on config.h but do want to track version changes. + Delete this file prior to any autoconf run where you want to rebuild + files to pick up a version string change; and leave it stale to + minimize rebuild time after unrelated changes to configure sources. + . + It is probably wise to add these two files to .gitignore, so that you + don't accidentally commit either generated file. + . + Use the following line in your configure.ac, so that $(VERSION) will + automatically be up-to-date each time configure is run (and note that + since configure.ac no longer includes a version string, Makefile rules + should not depend on configure.ac for version updates). + . + On Debian systems, the complete text of the GNU General Public License + Version 3 can be found in `/usr/share/common-licenses/GPL-3'. - -License: LGPL-2.1 - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; version - 2.1 of the License. +Files: tests/vty_test_runner.py +Copyright: 2013 Holger Hans Peter Freyther + 2013 Katerina Barone-Adesi +License: GPL-3.0+ + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. . - This library is distributed in the hope that it will be useful, + This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. . - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, see . + You should have received a copy of the GNU General Public License + along with this program. If not, see . . - On Debian systems, the complete text of the GNU Lesser General - Public License version 2.1 can be found in - "/usr/share/common-licenses/LGPL-2.1". + On Debian systems, the complete text of the GNU General Public License + Version 3 can be found in `/usr/share/common-licenses/GPL-3'. + +Files: include/openbsc/slhc.h +Copyright: 1989 Regents of the University of California. +License: __UNKNOWN__ + Redistribution and use in source and binary forms are permitted + provided that the above copyright notice and this paragraph are + duplicated in all such forms and that any documentation, + advertising materials, and other materials related to such + distribution and use acknowledge that the software was developed + by the University of California, Berkeley. The name of the + University may not be used to endorse or promote products derived + from this software without specific prior written permission. + THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. + . + Van Jacobson (van at helios.ee.lbl.gov), Dec 31, 1989: + - Initial distribution. + . + modified for KA9Q Internet Software Package by + Katie Stevens (dkstevens at ucdavis.edu) + University of California, Davis + Computing Services + - 01-31-90 initial adaptation + diff --git a/debian/docs b/debian/docs deleted file mode 100644 index cd545c2..0000000 --- a/debian/docs +++ /dev/null @@ -1 +0,0 @@ -openbsc/README diff --git a/debian/openbsc-dev.install b/debian/openbsc-dev.install deleted file mode 100644 index 0c05545..0000000 --- a/debian/openbsc-dev.install +++ /dev/null @@ -1,4 +0,0 @@ -openbsc/include/openbsc/gsm_data_shared.h usr/src/osmocom/openbsc/openbsc/include/openbsc/ -openbsc/include/openbsc/common_cs.h usr/src/osmocom/openbsc/openbsc/include/openbsc/ -openbsc/src/libcommon/gsm_data_shared.c usr/src/osmocom/openbsc/openbsc/src/libcommon/ -usr/lib/*/pkgconfig/openbsc.pc diff --git a/debian/osmo-msc.install b/debian/osmo-msc.install new file mode 100644 index 0000000..2c733e0 --- /dev/null +++ b/debian/osmo-msc.install @@ -0,0 +1,2 @@ +usr/bin +usr/share/doc/openbsc/examples/osmo-msc/osmo-msc.cfg diff --git a/debian/osmocom-nitb.default b/debian/osmocom-nitb.default deleted file mode 100644 index ef76a5f..0000000 --- a/debian/osmocom-nitb.default +++ /dev/null @@ -1,8 +0,0 @@ -CONFIG_FILE="/etc/osmocom/osmo-nitb.cfg" -HLR_FILE="/var/lib/osmocom/hlr.sqlite3" - -DAEMON_ARGS="-P" - -# Uncomment if using LCR+Asterisk -# DAEMON_ARGS="-m -P" - diff --git a/debian/osmocom-nitb.dirs b/debian/osmocom-nitb.dirs deleted file mode 100644 index efbca2b..0000000 --- a/debian/osmocom-nitb.dirs +++ /dev/null @@ -1,3 +0,0 @@ -/etc/osmocom -/var/log/osmocom -/var/lib/osmocom diff --git a/debian/osmocom-nitb.examples b/debian/osmocom-nitb.examples deleted file mode 100644 index c098d5c..0000000 --- a/debian/osmocom-nitb.examples +++ /dev/null @@ -1 +0,0 @@ -openbsc/doc/examples/osmo-nitb diff --git a/debian/osmocom-nitb.init b/debian/osmocom-nitb.init deleted file mode 100755 index 0747446..0000000 --- a/debian/osmocom-nitb.init +++ /dev/null @@ -1,152 +0,0 @@ -#!/bin/sh -### BEGIN INIT INFO -# Provides: osmo-nitb -# Required-Start: $network $local_fs -# Required-Stop: -# Default-Start: 2 3 4 5 -# Default-Stop: 0 1 6 -# Short-Description: Osmocom GSM network-in-a-box -# Description: A minimal implementation of the GSM Base Station Controller, -# Mobile Switching Center, Home Location regster and all other -# components to run a self-contained GSM network. -### END INIT INFO - -# Author: Harald Welte - -# PATH should only include /usr/* if it runs after the mountnfs.sh script -PATH=/sbin:/usr/sbin:/bin:/usr/bin -NAME=osmo-nitb # Introduce the short server's name here -DESC="Osmocom GSM Network-in-a-Box" # Introduce a short description here -DAEMON=/usr/bin/osmo-nitb # Introduce the server's location here -SCRIPTNAME=/etc/init.d/osmocom-nitb - -# Exit if the package is not installed -[ -x $DAEMON ] || exit 0 - -# Read configuration variable file if it is present -[ -r /etc/default/osmocom-nitb ] && . /etc/default/osmocom-nitb - -# Load the VERBOSE setting and other rcS variables -. /lib/init/vars.sh - -# Define LSB log_* functions. -# Depend on lsb-base (>= 3.0-6) to ensure that this file is present. -. /lib/lsb/init-functions - -DAEMON_ARGS="$DAEMON_ARGS -D -c $CONFIG_FILE -l $HLR_FILE" - -# -# Function that starts the daemon/service -# -do_start() -{ - # Return - # 0 if daemon has been started - # 1 if daemon was already running - # 2 if daemon could not be started - start-stop-daemon --start --quiet --exec $DAEMON --test > /dev/null \ - || return 1 - start-stop-daemon --start --quiet --exec $DAEMON -- \ - $DAEMON_ARGS \ - || return 2 - # Add code here, if necessary, that waits for the process to be ready - # to handle requests from services started subsequently which depend - # on this one. As a last resort, sleep for some time. -} - -# -# Function that stops the daemon/service -# -do_stop() -{ - # Return - # 0 if daemon has been stopped - # 1 if daemon was already stopped - # 2 if daemon could not be stopped - # other if a failure occurred - start-stop-daemon --stop --quiet --retry=TERM/30/KILL/5 --name $NAME - RETVAL="$?" - [ "$RETVAL" = 2 ] && return 2 - # Wait for children to finish too if this is a daemon that forks - # and if the daemon is only ever run from this initscript. - # If the above conditions are not satisfied then add some other code - # that waits for the process to drop all resources that could be - # needed by services started subsequently. A last resort is to - # sleep for some time. - start-stop-daemon --stop --quiet --oknodo --retry=0/30/KILL/5 --exec $DAEMON - [ "$?" = 2 ] && return 2 - return "$RETVAL" -} - -# -# Function that sends a SIGHUP to the daemon/service -# -do_reload() { - # - # If the daemon can reload its configuration without - # restarting (for example, when it is sent a SIGHUP), - # then implement that here. - # - start-stop-daemon --stop --signal 1 --quiet $PIDFILE --name $NAME - return 0 -} - -case "$1" in - start) - [ "$VERBOSE" != no ] && log_daemon_msg "Starting $DESC " "$NAME" - do_start - case "$?" in - 0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;; - 2) [ "$VERBOSE" != no ] && log_end_msg 1 ;; - esac - ;; - stop) - [ "$VERBOSE" != no ] && log_daemon_msg "Stopping $DESC" "$NAME" - do_stop - case "$?" in - 0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;; - 2) [ "$VERBOSE" != no ] && log_end_msg 1 ;; - esac - ;; - status) - status_of_proc "$DAEMON" "$NAME" && exit 0 || exit $? - ;; - #reload|force-reload) - # - # If do_reload() is not implemented then leave this commented out - # and leave 'force-reload' as an alias for 'restart'. - # - #log_daemon_msg "Reloading $DESC" "$NAME" - #do_reload - #log_end_msg $? - #;; - restart|force-reload) - # - # If the "reload" option is implemented then remove the - # 'force-reload' alias - # - log_daemon_msg "Restarting $DESC" "$NAME" - do_stop - case "$?" in - 0|1) - do_start - case "$?" in - 0) log_end_msg 0 ;; - 1) log_end_msg 1 ;; # Old process is still running - *) log_end_msg 1 ;; # Failed to start - esac - ;; - *) - # Failed to stop - log_end_msg 1 - ;; - esac - ;; - *) - #echo "Usage: $SCRIPTNAME {start|stop|restart|reload|force-reload}" >&2 - echo "Usage: $SCRIPTNAME {start|stop|status|restart|force-reload}" >&2 - exit 3 - ;; -esac - -: diff --git a/debian/osmocom-nitb.install b/debian/osmocom-nitb.install deleted file mode 100644 index 26caf71..0000000 --- a/debian/osmocom-nitb.install +++ /dev/null @@ -1,2 +0,0 @@ -/usr/bin/osmo-nitb -openbsc/contrib/*.py usr/bin/ \ No newline at end of file diff --git a/debian/rules b/debian/rules index 4e187a6..3500fbb 100755 --- a/debian/rules +++ b/debian/rules @@ -1,32 +1,59 @@ #!/usr/bin/make -f +# You must remove unused comment lines for the released package. +# See debhelper(7) (uncomment to enable) +# This is an autogenerated template for debian/rules. +# +# Output every command that modifies files on the build system. +#export DH_VERBOSE = 1 +# +# Copy some variable definitions from pkg-info.mk and vendor.mk +# under /usr/share/dpkg/ to here if they are useful. +# +# See FEATURE AREAS/ENVIRONMENT in dpkg-buildflags(1) +# Apply all hardening options +#export DEB_BUILD_MAINT_OPTIONS = hardening=+all +# Package maintainers to append CFLAGS +#export DEB_CFLAGS_MAINT_APPEND = -Wall -pedantic +# Package maintainers to append LDFLAGS +#export DEB_LDFLAGS_MAINT_APPEND = -Wl,--as-needed +# +# With debhelper version 9 or newer, the dh command exports +# all buildflags. So there is no need to include the +# /usr/share/dpkg/buildflags.mk file here if compat is 9 or newer. +# +# These are rarely used code. (START) +# +# The following include for *.mk magically sets miscellaneous +# variables while honoring existing values of pertinent +# environment variables: +# +# Architecture-related variables such as DEB_TARGET_MULTIARCH: +#include /usr/share/dpkg/architecture.mk +# Vendor-related variables such as DEB_VENDOR: +#include /usr/share/dpkg/vendor.mk +# Package-related variables such as DEB_DISTRIBUTION +#include /usr/share/dpkg/pkg-info.mk +# +# You may alternatively set them susing a simple script such as: +# DEB_VENDOR ?= $(shell dpkg-vendor --query Vendor) +# +# These are rarely used code. (END) +# -# Uncomment this to turn on verbose mode. -#export DH_VERBOSE=1 - -DEBIAN := $(shell dpkg-parsechangelog | grep ^Version: | cut -d' ' -f2) -DEBVERS := $(shell echo '$(DEBIAN)' | cut -d- -f1) -VERSION := $(shell echo '$(DEBVERS)' | sed -e 's/[+-].*//' -e 's/~//g') - -export DEB_BUILD_MAINT_OPTIONS = hardening=+all - +# main packaging script based on dh7 syntax %: - dh $@ --sourcedirectory=openbsc --with autoreconf + dh $@ --with autoreconf -# This is needed for debian stable (squeeze) -override_dh_autoreconf: - cd openbsc && autoreconf --install --force - -override_dh_strip: - dh_strip -posmocom-bsc --dbg-package=osmocom-bsc-dbg - dh_strip -posmocom-nitb --dbg-package=osmocom-nitb-dbg - dh_strip -posmocom-ipaccess-utils --dbg-package=osmocom-ipaccess-utils-dbg - dh_strip -posmocom-bs11-utils --dbg-package=osmocom-bs11-utils-dbg - dh_strip -posmocom-sgsn --dbg-package=osmocom-sgsn-dbg - dh_strip -posmocom-gbproxy --dbg-package=osmocom-gbproxy-dbg - dh_strip -posmocom-bsc-nat --dbg-package=osmocom-bsc-nat-dbg - dh_strip -posmo-gtphub --dbg-package=osmo-gtphub-dbg - +# debmake generated override targets +# Set options for ./configure +CONFIGURE_FLAGS += --enable-iu override_dh_auto_configure: - echo $(VERSION) > openbsc/.tarball-version - dh_auto_configure --sourcedirectory=openbsc -- --enable-nat --enable-osmo-bsc --enable-smpp + dh_auto_configure -- $(CONFIGURE_FLAGS) +# +# Do not install libtool archive, python .pyc .pyo +#override_dh_install: +# dh_install --list-missing -X.la -X.pyc -X.pyo +# See https://www.debian.org/doc/manuals/developers-reference/best-pkging-practices.html#bpp-dbg +override_dh_strip: + dh_strip --dbg-package=osmo-msc-dbg -- To view, visit https://gerrit.osmocom.org/3499 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I77544cb38c31777c3fab52979d19488a63e52de3 Gerrit-PatchSet: 7 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: lynxis lazus From gerrit-no-reply at lists.osmocom.org Sun Aug 27 20:53:57 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sun, 27 Aug 2017 20:53:57 +0000 Subject: [PATCH] osmo-msc[master]: move to osmo-mgw.git: osmo-bsc_mgcp and libmgcp as libosmo-l... In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3492 to look at the new patch set (#8). move to osmo-mgw.git: osmo-bsc_mgcp and libmgcp as libosmo-legacy-mgcp Rewire build and includes to libosmo-legacy-mgcp. Drop osmo-bsc_mgcp and related python tests, now found in osmo-mgw.git. libosmo-legacy-mgcp is installed from osmo-mgw, hence add the dependency to jenkins.sh (so far using the pre_release branch). Change-Id: Ic99d681759edce11564da62500c2aac5cf5fffe2 --- M configure.ac M contrib/jenkins.sh M include/openbsc/Makefile.am M include/openbsc/bsc_nat.h M include/openbsc/gsm_data.h D include/openbsc/mgcp.h D include/openbsc/mgcp_internal.h D include/openbsc/mgcp_transcode.h D include/openbsc/mgcpgw_client.h M osmoappdesc.py M src/Makefile.am M src/libfilter/bsc_msg_acc.c D src/libmgcp/Makefile.am D src/libmgcp/g711common.h D src/libmgcp/mgcp_common.c D src/libmgcp/mgcp_network.c D src/libmgcp/mgcp_osmux.c D src/libmgcp/mgcp_protocol.c D src/libmgcp/mgcp_sdp.c D src/libmgcp/mgcp_transcode.c D src/libmgcp/mgcp_vty.c D src/libmgcp/mgcpgw_client.c D src/libmgcp/mgcpgw_client_vty.c M src/libmsc/a_iface.c M src/libmsc/msc_ifaces.c M src/libmsc/msc_vty.c M src/osmo-bsc/osmo_bsc_bssap.c D src/osmo-bsc_mgcp/Makefile.am D src/osmo-bsc_mgcp/mgcp_main.c M src/osmo-bsc_nat/Makefile.am M src/osmo-bsc_nat/bsc_mgcp_utils.c M src/osmo-bsc_nat/bsc_nat_ctrl.c M src/osmo-bsc_nat/bsc_nat_vty.c M src/osmo-bsc_nat/bsc_ussd.c M src/osmo-msc/Makefile.am M src/osmo-msc/msc_main.c M tests/Makefile.am M tests/bsc-nat-trie/Makefile.am M tests/bsc-nat/Makefile.am M tests/bsc/Makefile.am D tests/mgcp/Makefile.am D tests/mgcp/mgcp_test.c D tests/mgcp/mgcp_test.ok D tests/mgcp/mgcp_transcoding_test.c D tests/mgcp/mgcp_transcoding_test.ok D tests/mgcp/mgcpgw_client_test.c D tests/mgcp/mgcpgw_client_test.err D tests/mgcp/mgcpgw_client_test.ok M tests/msc_vlr/Makefile.am M tests/sms_queue/Makefile.am M tests/testsuite.at M tests/vty_test_runner.py 52 files changed, 47 insertions(+), 11,424 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/92/3492/8 -- To view, visit https://gerrit.osmocom.org/3492 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ic99d681759edce11564da62500c2aac5cf5fffe2 Gerrit-PatchSet: 8 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sun Aug 27 21:07:17 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sun, 27 Aug 2017 21:07:17 +0000 Subject: [PATCH] osmo-msc[master]: build: check for -lgsm In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3587 to look at the new patch set (#7). build: check for -lgsm If libosmo-legacy-mgcp is built with --enable-mgcp-transcoding, we need to link -lgsm here as well. This autodetects whether -lgsm is necessary. Todo: how about --with-g729? Todo: osmo-msc is only using the mgcp client and should not actually need transcoding nor -lgsm. Change-Id: Iab55a089ae36017b79e7cbc3cac45ef9fd85dd43 --- M configure.ac 1 file changed, 27 insertions(+), 11 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/87/3587/7 diff --git a/configure.ac b/configure.ac index 67afc2d..397e90c 100644 --- a/configure.ac +++ b/configure.ac @@ -60,17 +60,6 @@ [osmo_ac_mgcp_transcoding="$enableval"],[osmo_ac_mgcp_transcoding="no"]) AC_ARG_WITH([g729], [AS_HELP_STRING([--with-g729], [Enable G.729 encoding/decoding.])], [osmo_ac_with_g729="$withval"],[osmo_ac_with_g729="no"]) -if test "$osmo_ac_mgcp_transcoding" = "yes" ; then - AC_SEARCH_LIBS([gsm_create], [gsm], [LIBRARY_GSM="$LIBS";LIBS=""], [AC_MSG_ERROR([--enable-mgcp-transcoding: cannot find usable libgsm])]) - AC_SUBST(LIBRARY_GSM) - if test "$osmo_ac_with_g729" = "yes" ; then - PKG_CHECK_MODULES(LIBBCG729, libbcg729 >= 0.1, [AC_DEFINE([HAVE_BCG729], [1], [Use bgc729 decoder/encoder])]) - fi - AC_DEFINE(BUILD_MGCP_TRANSCODING, 1, [Define if we want to build the MGCP gateway with transcoding support]) -fi -AM_CONDITIONAL(BUILD_MGCP_TRANSCODING, test "x$osmo_ac_mgcp_transcoding" = "xyes") -AC_SUBST(osmo_ac_mgcp_transcoding) - # Enable/disable 3G aka IuPS + IuCS support? AC_ARG_ENABLE([iu], [AS_HELP_STRING([--enable-iu], [Build 3G support, aka IuPS and IuCS interfaces])], [osmo_ac_iu="$enableval"],[osmo_ac_iu="no"]) @@ -134,6 +123,33 @@ AC_SUBST([COVERAGE_LDFLAGS]) fi +AC_DEFUN([CHECK_LIBOSMO_LEGACY_MGCP_NEEDS_LIBGSM], [ + AC_CACHE_CHECK( + [whether libosmo-legacy-mgcp needs -lgsm], + libosmo_cv_legacy_mgcp_needs_libgsm, [ + SAVE_LDFLAGS="${LDFLAGS}" + LDFLAGS="${LIBOSMOLEGACYMGCP_LIBS} ${LIBOSMOVTY_LIBS}" + AC_LINK_IFELSE( + [AC_LANG_PROGRAM([ + #include + ], [ + mgcpgw_client_init(0, 0); + ])], + [libosmo_cv_legacy_mgcp_needs_libgsm=no], + [libosmo_cv_legacy_mgcp_needs_libgsm=yes]) + LDFLAGS="${SAVE_LDFLAGS}" + ]) + ]) +CHECK_LIBOSMO_LEGACY_MGCP_NEEDS_LIBGSM +if test "x$libosmo_cv_legacy_mgcp_needs_libgsm" = xyes; then + AC_SEARCH_LIBS([gsm_create], [gsm], [LIBRARY_GSM="$LIBS";LIBS=""], + [AC_MSG_ERROR([libosmo-legacy-mgcp is built with transcoding and needs -lgsm but cannot find usable libgsm])]) + AC_SUBST(LIBRARY_GSM) + if test "$osmo_ac_with_g729" = "yes" ; then + PKG_CHECK_MODULES(LIBBCG729, libbcg729 >= 0.1, [AC_DEFINE([HAVE_BCG729], [1], [Use bgc729 decoder/encoder])]) + fi +fi + AC_DEFUN([CHECK_TM_INCLUDES_TM_GMTOFF], [ AC_CACHE_CHECK( [whether struct tm has tm_gmtoff member], -- To view, visit https://gerrit.osmocom.org/3587 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Iab55a089ae36017b79e7cbc3cac45ef9fd85dd43 Gerrit-PatchSet: 7 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sun Aug 27 21:07:17 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sun, 27 Aug 2017 21:07:17 +0000 Subject: [PATCH] osmo-msc[master]: split off osmo-msc: remove files, apply build, rename In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3497 to look at the new patch set (#8). split off osmo-msc: remove files, apply build, rename Change-Id: Icf025e5ea8d180613b3114282951c9afa67af9a7 --- M configure.ac D debian/osmo-gtphub.default D debian/osmo-gtphub.examples D debian/osmo-gtphub.init D debian/osmo-gtphub.install D debian/osmocom-bs11-utils.install D debian/osmocom-bsc-nat.init D debian/osmocom-bsc-nat.install D debian/osmocom-bsc.examples D debian/osmocom-bsc.install D debian/osmocom-gbproxy.init D debian/osmocom-gbproxy.install D debian/osmocom-ipaccess-utils.install D debian/osmocom-sgsn.default D debian/osmocom-sgsn.examples D debian/osmocom-sgsn.init D debian/osmocom-sgsn.install D doc/BS11-OML.txt D doc/channel_release.txt D doc/examples/osmo-bsc/osmo-bsc.cfg D doc/examples/osmo-bsc_mgcp/mgcp.cfg D doc/examples/osmo-bsc_nat/black-list.cfg D doc/examples/osmo-bsc_nat/osmo-bsc_nat.cfg D doc/examples/osmo-gbproxy/osmo-gbproxy-legacy.cfg D doc/examples/osmo-gbproxy/osmo-gbproxy.cfg D doc/examples/osmo-gtphub/gtphub-example.txt D doc/examples/osmo-gtphub/osmo-gtphub-1iface.cfg D doc/examples/osmo-gtphub/osmo-gtphub.cfg D doc/examples/osmo-sgsn/osmo-sgsn.cfg D doc/oml-interface.txt M include/Makefile.am D include/compat_af_isdn.h D include/mISDNif.h M include/openbsc/Makefile.am D include/openbsc/bsc_nat.h D include/openbsc/bsc_nat_callstats.h D include/openbsc/bsc_nat_sccp.h D include/openbsc/bsc_subscriber.h D include/openbsc/gb_proxy.h D include/openbsc/gprs_gb_parse.h D include/openbsc/gprs_gmm.h D include/openbsc/gprs_llc.h D include/openbsc/gprs_llc_xid.h D include/openbsc/gprs_sgsn.h D include/openbsc/gprs_sndcp.h D include/openbsc/gprs_sndcp_comp.h D include/openbsc/gprs_sndcp_dcomp.h D include/openbsc/gprs_sndcp_pcomp.h D include/openbsc/gprs_sndcp_xid.h D include/openbsc/gprs_subscriber.h D include/openbsc/gprs_utils.h D include/openbsc/nat_rewrite_trie.h M include/openbsc/paging.h D include/openbsc/pcu_if.h D include/openbsc/pcuif_proto.h D include/openbsc/sgsn.h D include/openbsc/v42bis.h D include/openbsc/v42bis_private.h M osmoappdesc.py M src/Makefile.am D src/gprs/.gitignore D src/gprs/Makefile.am D src/gprs/crc24.c D src/gprs/gb_proxy.c D src/gprs/gb_proxy_main.c D src/gprs/gb_proxy_patch.c D src/gprs/gb_proxy_peer.c D src/gprs/gb_proxy_tlli.c D src/gprs/gb_proxy_vty.c D src/gprs/gprs_gb_parse.c D src/gprs/gprs_gmm.c D src/gprs/gprs_llc.c D src/gprs/gprs_llc_parse.c D src/gprs/gprs_llc_vty.c D src/gprs/gprs_llc_xid.c D src/gprs/gprs_sgsn.c D src/gprs/gprs_sndcp.c D src/gprs/gprs_sndcp_comp.c D src/gprs/gprs_sndcp_dcomp.c D src/gprs/gprs_sndcp_pcomp.c D src/gprs/gprs_sndcp_vty.c D src/gprs/gprs_sndcp_xid.c D src/gprs/gprs_subscriber.c D src/gprs/gprs_utils.c D src/gprs/gtphub.c D src/gprs/gtphub_ares.c D src/gprs/gtphub_main.c D src/gprs/gtphub_sock.c D src/gprs/gtphub_vty.c D src/gprs/osmo_sgsn.cfg D src/gprs/sgsn_ares.c D src/gprs/sgsn_auth.c D src/gprs/sgsn_cdr.c D src/gprs/sgsn_ctrl.c D src/gprs/sgsn_libgtp.c D src/gprs/sgsn_main.c D src/gprs/sgsn_vty.c D src/gprs/slhc.c D src/gprs/v42bis.c D src/ipaccess/Makefile.am D src/ipaccess/abisip-find.c D src/ipaccess/ipaccess-config.c D src/ipaccess/ipaccess-firmware.c D src/ipaccess/ipaccess-proxy.c D src/ipaccess/network_listen.c D src/libbsc/Makefile.am D src/libbsc/abis_nm.c D src/libbsc/abis_nm_ipaccess.c D src/libbsc/abis_nm_vty.c D src/libbsc/abis_om2000.c D src/libbsc/abis_om2000_vty.c D src/libbsc/abis_rsl.c D src/libbsc/arfcn_range_encode.c D src/libbsc/bsc_api.c D src/libbsc/bsc_ctrl_commands.c D src/libbsc/bsc_ctrl_lookup.c D src/libbsc/bsc_dyn_ts.c D src/libbsc/bsc_init.c D src/libbsc/bsc_msc.c D src/libbsc/bsc_rf_ctrl.c D src/libbsc/bsc_rll.c D src/libbsc/bsc_subscriber.c D src/libbsc/bsc_vty.c D src/libbsc/bts_ericsson_rbs2000.c D src/libbsc/bts_init.c D src/libbsc/bts_ipaccess_nanobts.c D src/libbsc/bts_ipaccess_nanobts_omlattr.c D src/libbsc/bts_nokia_site.c D src/libbsc/bts_siemens_bs11.c D src/libbsc/bts_sysmobts.c D src/libbsc/bts_unknown.c D src/libbsc/chan_alloc.c D src/libbsc/e1_config.c D src/libbsc/gsm_04_08_utils.c D src/libbsc/gsm_04_80_utils.c D src/libbsc/handover_decision.c D src/libbsc/handover_logic.c D src/libbsc/meas_proc.c D src/libbsc/meas_rep.c D src/libbsc/net_init.c D src/libbsc/paging.c D src/libbsc/pcu_sock.c D src/libbsc/rest_octets.c D src/libbsc/system_information.c M src/libcommon/common_vty.c D src/libfilter/Makefile.am D src/libfilter/bsc_msg_acc.c D src/libfilter/bsc_msg_filter.c D src/libfilter/bsc_msg_vty.c M src/libmsc/vty_interface_layer3.c D src/libtrau/Makefile.am D src/libtrau/rtp_proxy.c D src/libtrau/trau_mux.c D src/libtrau/trau_upqueue.c M src/libvlr/vlr.c D src/osmo-bsc/Makefile.am D src/osmo-bsc/osmo_bsc_api.c D src/osmo-bsc/osmo_bsc_audio.c D src/osmo-bsc/osmo_bsc_bssap.c D src/osmo-bsc/osmo_bsc_ctrl.c D src/osmo-bsc/osmo_bsc_filter.c D src/osmo-bsc/osmo_bsc_grace.c D src/osmo-bsc/osmo_bsc_main.c D src/osmo-bsc/osmo_bsc_msc.c D src/osmo-bsc/osmo_bsc_reset.c D src/osmo-bsc/osmo_bsc_sigtran.c D src/osmo-bsc/osmo_bsc_vty.c D src/osmo-bsc_nat/Makefile.am D src/osmo-bsc_nat/bsc_filter.c D src/osmo-bsc_nat/bsc_mgcp_utils.c D src/osmo-bsc_nat/bsc_nat.c D src/osmo-bsc_nat/bsc_nat_ctrl.c D src/osmo-bsc_nat/bsc_nat_filter.c D src/osmo-bsc_nat/bsc_nat_rewrite.c D src/osmo-bsc_nat/bsc_nat_rewrite_trie.c D src/osmo-bsc_nat/bsc_nat_utils.c D src/osmo-bsc_nat/bsc_nat_vty.c D src/osmo-bsc_nat/bsc_sccp.c D src/osmo-bsc_nat/bsc_ussd.c M src/osmo-msc/Makefile.am M src/utils/Makefile.am D src/utils/bs11_config.c D src/utils/isdnsync.c M tests/Makefile.am D tests/abis/Makefile.am D tests/abis/abis_test.c D tests/abis/abis_test.ok D tests/bsc-nat-trie/Makefile.am D tests/bsc-nat-trie/bsc_nat_trie_test.c D tests/bsc-nat-trie/bsc_nat_trie_test.ok D tests/bsc-nat-trie/prefixes.csv D tests/bsc-nat/Makefile.am D tests/bsc-nat/barr.cfg D tests/bsc-nat/barr_dup.cfg D tests/bsc-nat/bsc_data.c D tests/bsc-nat/bsc_nat_test.c D tests/bsc-nat/bsc_nat_test.ok D tests/bsc-nat/prefixes.csv D tests/bsc/Makefile.am D tests/bsc/bsc_test.c D tests/bsc/bsc_test.ok D tests/channel/Makefile.am D tests/channel/channel_test.c D tests/channel/channel_test.ok D tests/gbproxy/Makefile.am D tests/gbproxy/gbproxy_test.c D tests/gbproxy/gbproxy_test.ok D tests/gprs/Makefile.am D tests/gprs/gprs_test.c D tests/gprs/gprs_test.ok D tests/gsm0408/Makefile.am D tests/gsm0408/gsm0408_test.c D tests/gsm0408/gsm0408_test.ok D tests/gtphub/Makefile.am D tests/gtphub/gtphub_test.c D tests/gtphub/gtphub_test.ok M tests/msc_vlr/Makefile.am M tests/msc_vlr/msc_vlr_tests.c D tests/nanobts_omlattr/Makefile.am D tests/nanobts_omlattr/nanobts_omlattr_test.c D tests/nanobts_omlattr/nanobts_omlattr_test.ok D tests/oap/Makefile.am D tests/oap/oap_client_test.c D tests/oap/oap_client_test.err D tests/oap/oap_client_test.ok D tests/sgsn/Makefile.am D tests/sgsn/sgsn_test.c D tests/sgsn/sgsn_test.ok D tests/slhc/Makefile.am D tests/slhc/slhc_test.c D tests/slhc/slhc_test.ok M tests/sms_queue/Makefile.am D tests/sndcp_xid/Makefile.am D tests/sndcp_xid/sndcp_xid_test.c D tests/sndcp_xid/sndcp_xid_test.ok D tests/subscr/Makefile.am D tests/subscr/bsc_subscr_test.c D tests/subscr/bsc_subscr_test.err D tests/subscr/bsc_subscr_test.ok M tests/testsuite.at D tests/trau/Makefile.am D tests/trau/trau_test.c D tests/trau/trau_test.ok D tests/v42bis/Makefile.am D tests/v42bis/v42bis_test.c D tests/v42bis/v42bis_test.ok M tests/vty_test_runner.py D tests/xid/Makefile.am D tests/xid/xid_test.c D tests/xid/xid_test.ok D tools/hlrstat.pl 251 files changed, 17 insertions(+), 100,345 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/97/3497/8 -- To view, visit https://gerrit.osmocom.org/3497 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Icf025e5ea8d180613b3114282951c9afa67af9a7 Gerrit-PatchSet: 8 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Sun Aug 27 21:07:17 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sun, 27 Aug 2017 21:07:17 +0000 Subject: [PATCH] osmo-msc[master]: libmsc: make pitfall in gsm0408_dispatch() more obvious 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/3498 to look at the new patch set (#8). libmsc: make pitfall in gsm0408_dispatch() more obvious The function gsm0408_dispatch() accepts a message buffer pointer and accesses the l3h pointer. Even in a properly allocated message buffer, this may lead into a segfault if the user forgets to set the l3h pointer. This commit adds assertions to popup a more expressive error message. Change-Id: I43bd9bd1c170559aaa8dacaef25dba090744bcd5 --- M src/libmsc/gsm_04_08.c 1 file changed, 6 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/98/3498/8 diff --git a/src/libmsc/gsm_04_08.c b/src/libmsc/gsm_04_08.c index 21bc2b8..90a0431 100644 --- a/src/libmsc/gsm_04_08.c +++ b/src/libmsc/gsm_04_08.c @@ -3216,13 +3216,17 @@ /* Main entry point for GSM 04.08/44.008 Layer 3 data (e.g. from the BSC). */ int gsm0408_dispatch(struct gsm_subscriber_connection *conn, struct msgb *msg) { - struct gsm48_hdr *gh = msgb_l3(msg); - uint8_t pdisc = gsm48_hdr_pdisc(gh); + struct gsm48_hdr *gh; + uint8_t pdisc; int rc = 0; + OSMO_ASSERT(msg->l3h) OSMO_ASSERT(conn); OSMO_ASSERT(msg); + gh = msgb_l3(msg); + pdisc = gsm48_hdr_pdisc(gh); + LOGP(DRLL, LOGL_DEBUG, "Dispatching 04.08 message %s (0x%x:0x%x)\n", gsm48_pdisc_msgtype_name(pdisc, gsm48_hdr_msg_type(gh)), pdisc, gsm48_hdr_msg_type(gh)); -- To view, visit https://gerrit.osmocom.org/3498 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I43bd9bd1c170559aaa8dacaef25dba090744bcd5 Gerrit-PatchSet: 8 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: dexter From gerrit-no-reply at lists.osmocom.org Sun Aug 27 21:07:17 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sun, 27 Aug 2017 21:07:17 +0000 Subject: [PATCH] osmo-msc[master]: rework debian packages 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/3499 to look at the new patch set (#8). rework debian packages support Remove old leftover from split of osmo-mgw out of openbsc. Change-Id: I77544cb38c31777c3fab52979d19488a63e52de3 --- D debian/autoreconf M debian/changelog M debian/control M debian/copyright D debian/docs D debian/openbsc-dev.install A debian/osmo-msc.install D debian/osmocom-nitb.default D debian/osmocom-nitb.dirs D debian/osmocom-nitb.examples D debian/osmocom-nitb.init D debian/osmocom-nitb.install M debian/rules 13 files changed, 240 insertions(+), 557 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/99/3499/8 diff --git a/debian/autoreconf b/debian/autoreconf deleted file mode 100644 index 9a3a67f..0000000 --- a/debian/autoreconf +++ /dev/null @@ -1 +0,0 @@ -openbsc diff --git a/debian/changelog b/debian/changelog index e9a4212..a1b3dda 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,75 +1,5 @@ -openbsc (0.15.1) UNRELEASED; urgency=medium +osmo-msc (0.1.0) UNRELEASED; urgency=low - * Move forward toward a new release. - * Prevent SGSN starting with 'auth-policy remote' when no 'gsup remote-*' are configured. - Note: such configs are broken without extra workarounds anyway. + * Initial release. - -- Holger Hans Peter Freyther Tue, 24 May 2016 23:14:31 +0200 - -openbsc (0.14.0) unstable; urgency=low - - * New upstream tag and additional patches. - - -- Holger Hans Peter Freyther Sat, 14 Mar 2015 20:33:25 +0100 - -openbsc (0.12.0+git26-7) unstable; urgency=low - - * 64bit fix for the MGCP rewriting - - -- Holger Hans Peter Freyther Wed, 07 Nov 2012 11:39:34 +0100 - -openbsc (0.12.0+git26-6) precise; urgency=low - - * Added init script for osmocom-sgsn. - - -- Eric Butler Fri, 24 Aug 2012 21:04:32 -0700 - -openbsc (0.12.0+git26-5) precise; urgency=low - - * Don't enable MNCC sock by default. - * Automatically create important directories. - * Fix init script 'stop' command. - - -- Eric Butler Fri, 24 Aug 2012 20:56:33 -0700 - -openbsc (0.12.0+git26-4) precise; urgency=low - - * Specify HLR path and enable RTP proxy. - - -- Eric Butler Mon, 20 Aug 2012 00:21:07 -0700 - -openbsc (0.12.0+git26-3) precise; urgency=low - - * Fix init script. - - -- Eric Butler Sun, 19 Aug 2012 16:05:44 -0700 - -openbsc (0.12.0+git26-2) precise; urgency=low - - * Fix libdbi package dependency. - - -- Eric Butler Wed, 15 Aug 2012 00:35:37 -0700 - -openbsc (0.12.0+git26-1) precise; urgency=low - - * Fix version issue. - - -- Eric Butler Tue, 14 Aug 2012 21:00:51 -0700 - -openbsc (0.12.0+git26) precise; urgency=low - - * Updated ubuntu package. - - -- Eric Butler Tue, 14 Aug 2012 17:36:51 -0700 - -openbsc (0.9.13.115.eb113-1) natty; urgency=low - - * New upstream release - - -- Harald Welte Wed, 11 May 2011 18:41:24 +0000 - -openbsc (0.9.4-1) unstable; urgency=low - - * Initial release - - -- Harald Welte Tue, 24 Aug 2010 13:34:24 +0200 + -- Alexander Couzens Tue, 08 Aug 2017 01:13:01 +0000 diff --git a/debian/control b/debian/control index 87b6f07..907ec38 100644 --- a/debian/control +++ b/debian/control @@ -1,181 +1,41 @@ -Source: openbsc -Maintainer: Harald Welte +Source: osmo-msc Section: net -Priority: optional -Build-Depends: debhelper (>= 9), - autotools-dev, - autoconf-archive, - pkg-config, - libgtp-dev, - libosmocore-dev, - libosmo-sccp-dev, - libdbi0-dev, +Priority: extra +Maintainer: Alexander Couzens +Build-Depends: debhelper (>=9), dh-autoreconf, - libosmo-abis-dev, - libosmo-netif-dev, - libdbd-sqlite3, - libpcap-dev, + autotools-dev, + autoconf, + automake, + libtool, + pkg-config, + libdbi-dev, + libtalloc-dev, libssl-dev, libc-ares-dev, - libsmpp34-dev + libgtp-dev, + libasn1c-dev, + libc-ares-dev, + libosmocore-dev, + libosmo-sccp-dev, + libosmo-abis-dev, + libosmo-legacy-mgcp-dev, + libosmo-netif-dev, + libosmo-ranap-dev Standards-Version: 3.9.8 -Vcs-Git: git://bs11-abis.gnumonks.org/openbsc.git -Vcs-Browser: http://openbsc.osmocom.org/trac/browser -Homepage: https://projects.osmocom.org/projects/openbsc +Vcs-Git: git://git.osmocom.org/osmo-bsc.git +Vcs-Browser: https://git.osmocom.org/osmo-bsc/ +Homepage: https://projects.osmocom.org/projects/osmo-bsc -Package: osmocom-bsc +Package: osmo-msc Architecture: any -Depends: ${shlibs:Depends}, - ${misc:Depends} -Description: GSM Base Station Controller - This is the BSC-only version of OpenBSC. It requires a Mobile Switching Center - (MSC) to operate. - . - You might rather prefer to use osmocom-nitb which is considered a - "GSM Network-in-a-Box" and does not depend on a MSC. +Multi-Arch: foreign +Depends: ${misc:Depends}, ${shlibs:Depends} +Description: OsmoMSC: Osmocom's Mobile Switching Center for 2G and 3G circuit-switched mobile networks -Package: osmocom-nitb -Architecture: any -Depends: ${shlibs:Depends}, - ${misc:Depends}, - libdbd-sqlite3 -Description: GSM Network-in-a-Box, implements BSC, MSC, SMSC, HLR, VLR - This is the Network-in-a-Box version of OpenBSC. It has all the GSM network - components bundled together. When using osmocom-nitb, there is no need for a - Mobile Switching Center (MSC) which is needed when using osmocom-bsc. - -Package: osmocom-ipaccess-utils -Architecture: any -Depends: ${shlibs:Depends}, - ${misc:Depends} -Description: Command line utilities for ip.access nanoBTS - This package contains utilities that are specific for nanoBTS when being used - together with OpenBSC. It contains mainly three tools: ipaccess-find, - ipaccess-config and ipaccess-proxy. - -Package: osmocom-bs11-utils -Architecture: any -Depends: ${shlibs:Depends}, - ${misc:Depends} -Description: Command line utilities for Siemens BS-11 BTS - There is a tool in this package for configuring the Siemens BS-11 BTS. - Additionally, it contains one tool for making use of an ISDN-card and the - public telephone network as frequency standard for the E1 line. - -Package: osmocom-sgsn -Architecture: any -Depends: ${shlibs:Depends}, - ${misc:Depends} -Suggests: osmocom-bsc -Description: Osmocom Serving GPRS Support Node - This is an implementation of the GPRS Serving GPRS Support Node (SGSN). As - such it implements the GPRS Mobility Management (GMM) and SM (Session - Management). - . - The SGSN connects via the Gb-interface to the BSS (like the osmo-pcu or an - ip.access nanoBTS), and it connects via the GTP protocol to a Gateway GPRS - Support Node (GGSN) like openggsn. - -Package: osmocom-gbproxy -Architecture: any -Depends: ${shlibs:Depends}, - ${misc:Depends} -Recommends: osmocom-sgsn -Description: Osmocom GPRS Gb Interface Proxy - The purpose of the Gb proxy is to aggregate the Gb links of multiple - BSS's and present them in one Gb link to the SGSN. - . - This package is part of OpenBSC and closely related to osmocom-sgsn. - -Package: osmocom-bsc-nat -Architecture: any -Depends: ${shlibs:Depends}, - ${misc:Depends} -Recommends: osmocom-bsc -Description: Osmocom Base Station Controller Network Address Translation - This NAT is useful for masquerading multiple BSCs behind one. It listens - for incoming BSCs on port 5000 and connects to a specified Mobile Switching - Center (MSC). - . - This package is part of OpenBSC and closely related to osmocom-bsc. - -Package: openbsc-dev -Architecture: all -Depends: ${misc:Depends} -Description: Header file needed by tools tightly integrated - Some other programs depend on gsm_data_shared.h and gsm_data_shared.c - from OpenBSC. This package installs these files to your file system so - that the other packages can build-depend on this package. - . - The directory structure is copied after the structure in the repository - and the header and .c file are installed into /usr/src/osmocom/openbsc/. - -Package: osmo-gtphub -Architecture: any -Depends: ${shlibs:Depends}, ${misc:Depends} -Description: Osmocom GTP Hub - Proxy for comms between multiple SGSNs and GGSNs. - -Package: osmocom-bsc-dbg -Architecture: any +Package: osmo-msc-dbg Section: debug -Priority: extra -Depends: osmocom-bsc (= ${binary:Version}), ${misc:Depends} -Description: Debug symbols for the OpenBSC BSC - Make debugging possible - -Package: osmocom-nitb-dbg Architecture: any -Section: debug -Priority: extra -Depends: osmocom-nitb (= ${binary:Version}), ${misc:Depends} -Description: Debug symbols for the OpenBSC NITB - Make debugging possible - -Package: osmocom-ipaccess-utils-dbg -Architecture: any -Section: debug -Priority: extra -Depends: osmocom-ipaccess-utils (= ${binary:Version}), ${misc:Depends} -Description: Debug symbols for the OpenBSC ip.access utils - Make debugging possible - -Package: osmocom-bs11-utils-dbg -Architecture: any -Section: debug -Priority: extra -Depends: osmocom-bs11-utils (= ${binary:Version}), ${misc:Depends} -Description: Debug symbols for the OpenBSC BS11 utils - Make debugging possible - -Package: osmocom-sgsn-dbg -Architecture: any -Section: debug -Priority: extra -Depends: osmocom-sgsn (= ${binary:Version}), ${misc:Depends} -Description: Debug symbols for the OpenBSC Serving GPRS Support Node - Make debugging possible - -Package: osmocom-gbproxy-dbg -Architecture: any -Section: debug -Priority: extra -Depends: osmocom-gbproxy (= ${binary:Version}), ${misc:Depends} -Description: Debug symbols for the OpenBSC GPRS GBProxy - Make debugging possible - -Package: osmocom-bsc-nat-dbg -Architecture: any -Section: debug -Priority: extra -Depends: osmocom-bsc-nat (= ${binary:Version}), ${misc:Depends} -Description: Debug symbols for the OpenBSC Network Address Translation - Make debugging possible - -Package: osmo-gtphub-dbg -Architecture: any -Section: debug -Priority: extra -Depends: osmo-gtphub (= ${binary:Version}), ${misc:Depends} -Description: Debug symbols for Osmocom GTP Hub - Make debugging possible +Multi-Arch: same +Depends: osmo-msc (= ${binary:Version}), ${misc:Depends} +Description: OsmoMSC: Osmocom's Mobile Switching Center for 2G and 3G circuit-switched mobile networks diff --git a/debian/copyright b/debian/copyright index 1e4dee1..e3cd9b3 100644 --- a/debian/copyright +++ b/debian/copyright @@ -1,75 +1,83 @@ Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ -Upstream-Name: OpenBSC -Source: http://openbsc.osmocom.org/ +Upstream-Name: osmo-msc +Source: git://git.osmocom.org/osmo-msc -Files: * -Copyright: 2008-2015 Harald Welte - 2008-2015 Holger Hans Peter Freyther - 2009-2015 On-Waves - 2008 Jan Luebbe - 2008,2010-2011 Daniel Willmann - 2009,2011,2013 Andreas Eversberg - 2009,2011 Dieter Spaar - 2009 Mike Haben - 2010 Sylvain Munaut <246tnt at gmail.com> - 2012-2013 Pablo Neira Ayuso - 2013-2015 Sysmocom s.f.m.c. GmbH (Jacob Erlbeck) - 2014 Alexander Chemeris -License: AGPL-3+ -Comment: Contributions by Stefan Schmidt as well - -Files: wireshark/0001-abis_oml.patch - wireshark/0002-ericsson_rbs2409.patch - wireshark/0003-lucent-hnb.patch - wireshark/0005-rsl-hsl.patch -Copyright: 1998 Gerald Combs - 2007,2011 Anders Broman - 2009 Holger Hans Peter Freyther - 2009-2011 Harald Welte -License: GPL-2+ - -Files: openbsc/include/mISDNif.h -Copyright: 2008 Karsten Keil -License: LGPL-2.1 - -Files: openbsc/src/libmgcp/g711common.h -Copyright: 2009 Abramo Bagnara -License: GPL-2+ - -Files: openbsc/git-version-gen -Copyright: 2007-2010 Free Software Foundation -License: GPL-3+ - -Files: openbsc/osmoappdesc.py - openbsc/tests/smpp_test_runner.py - openbsc/tests/ctrl_test_runner.py - openbsc/tests/vty_test_runner.py -Copyright: 2013 Katerina Barone-Adesi - 2013 Jacob Erlbeck - 2013-2014 Holger Hans Peter Freyther -License: GPL-3+ - -Files: openbsc/src/libbsc/bsc_ctrl_lookup.c -Copyright: 2010-2011 Daniel Willmann - 2010-2011 On-Waves -License: GPL-2+ - -Files: openbsc/src/libmsc/mncc_sock.c - openbsc/src/libmsc/mncc_builtin.c -Copyright: 2008-2010 Harald Welte - 2009 Andreas Eversberg - 2012 Holger Hans Peter Freyther -License: GPL-2+ - -Files: debian/* -Copyright: 2012-2015 Holger Hans Peter Freyther - 2016 Ruben Undheim -License: GPL-2+ - - -License: AGPL-3+ - This package is free software; you can redistribute it and/or modify +Files: * +Copyright: 2008 Daniel Willmann + 2008 Jan Luebbe + 2008-2015 Holger Hans Peter Freyther + 2008-2016 Harald Welte + 2009 Andreas Eversberg + 2009 Mike Haben + 2010 Sylvain Munaut + 2010-2013 On-Waves + 2013 Jacob Erlbeck + 2011 Andreas Eversberg + 2011-2017 sysmocom s.f.m.c. GmbH + 2014-2015 Alexander Chemeris +License: AGPL-3.0+ + This program is free software; you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + . + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Affero General Public License for more details. + . + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see . + +Files: src/libmsc/mncc_builtin.c + src/libmsc/mncc_sock.c +Copyright: 2008-2010 Harald Welte + 2009 Andreas Eversberg + 2012 Holger Hans Peter Freyther +License: GPL-2.0+ + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + . + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + . + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + . + On Debian systems, the complete text of the GNU General Public License + Version 2 can be found in `/usr/share/common-licenses/GPL-2'. + +Files: osmoappdesc.py +Copyright: 2013 Katerina Barone-Adesi +License: GPL-3.0+ + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + . + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + . + You should have received a copy of the GNU General Public License + along with this program. If not, see + . + Most systems won't be able to use these, so they're separated out + . + On Debian systems, the complete text of the GNU General Public License + Version 3 can be found in `/usr/share/common-licenses/GPL-3'. + +Files: git-version-gen +Copyright: 2007-2010 Free Software Foundation, Inc. +License: GPL-3.0+ + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. . @@ -78,60 +86,88 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. . - You should have received a copy of the GNU Affero General Public License - along with this program. If not, see . - - -License: GPL-2+ - This package is free software: you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 2 of the License, or (at - your option) any later version. - . - This program is distributed in the hope that it will be useful, but - WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - for more details. - . You should have received a copy of the GNU General Public License along with this program. If not, see . . - On Debian systems, the complete text of the GNU General Public - License version 2 can be found in "/usr/share/common-licenses/GPL-2". - - -License: GPL-3+ - This package is free software: you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or (at - your option) any later version. + This script is derived from GIT-VERSION-GEN from GIT: http://git.or.cz/. + It may be run two ways: + - from a git repository in which the "git describe" command below + produces useful output (thus requiring at least one signed tag) + - from a non-git-repo directory containing a .tarball-version file, which + presumes this script is invoked like "./git-version-gen .tarball-version". . - This program is distributed in the hope that it will be useful, but - WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - for more details. + In order to use intra-version strings in your project, you will need two + separate generated version string files: . - You should have received a copy of the GNU General Public License - along with this program. If not, see . + .tarball-version - present only in a distribution tarball, and not in + a checked-out repository. Created with contents that were learned at + the last time autoconf was run, and used by git-version-gen. Must not + be present in either $(srcdir) or $(builddir) for git-version-gen to + give accurate answers during normal development with a checked out tree, + but must be present in a tarball when there is no version control system. + Therefore, it cannot be used in any dependencies. GNUmakefile has + hooks to force a reconfigure at distribution time to get the value + correct, without penalizing normal development with extra reconfigures. . - On Debian systems, the complete text of the GNU General Public - License version 3 can be found in "/usr/share/common-licenses/GPL-3". + .version - present in a checked-out repository and in a distribution + tarball. Usable in dependencies, particularly for files that don't + want to depend on config.h but do want to track version changes. + Delete this file prior to any autoconf run where you want to rebuild + files to pick up a version string change; and leave it stale to + minimize rebuild time after unrelated changes to configure sources. + . + It is probably wise to add these two files to .gitignore, so that you + don't accidentally commit either generated file. + . + Use the following line in your configure.ac, so that $(VERSION) will + automatically be up-to-date each time configure is run (and note that + since configure.ac no longer includes a version string, Makefile rules + should not depend on configure.ac for version updates). + . + On Debian systems, the complete text of the GNU General Public License + Version 3 can be found in `/usr/share/common-licenses/GPL-3'. - -License: LGPL-2.1 - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; version - 2.1 of the License. +Files: tests/vty_test_runner.py +Copyright: 2013 Holger Hans Peter Freyther + 2013 Katerina Barone-Adesi +License: GPL-3.0+ + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. . - This library is distributed in the hope that it will be useful, + This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. . - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, see . + You should have received a copy of the GNU General Public License + along with this program. If not, see . . - On Debian systems, the complete text of the GNU Lesser General - Public License version 2.1 can be found in - "/usr/share/common-licenses/LGPL-2.1". + On Debian systems, the complete text of the GNU General Public License + Version 3 can be found in `/usr/share/common-licenses/GPL-3'. + +Files: include/openbsc/slhc.h +Copyright: 1989 Regents of the University of California. +License: __UNKNOWN__ + Redistribution and use in source and binary forms are permitted + provided that the above copyright notice and this paragraph are + duplicated in all such forms and that any documentation, + advertising materials, and other materials related to such + distribution and use acknowledge that the software was developed + by the University of California, Berkeley. The name of the + University may not be used to endorse or promote products derived + from this software without specific prior written permission. + THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. + . + Van Jacobson (van at helios.ee.lbl.gov), Dec 31, 1989: + - Initial distribution. + . + modified for KA9Q Internet Software Package by + Katie Stevens (dkstevens at ucdavis.edu) + University of California, Davis + Computing Services + - 01-31-90 initial adaptation + diff --git a/debian/docs b/debian/docs deleted file mode 100644 index cd545c2..0000000 --- a/debian/docs +++ /dev/null @@ -1 +0,0 @@ -openbsc/README diff --git a/debian/openbsc-dev.install b/debian/openbsc-dev.install deleted file mode 100644 index 0c05545..0000000 --- a/debian/openbsc-dev.install +++ /dev/null @@ -1,4 +0,0 @@ -openbsc/include/openbsc/gsm_data_shared.h usr/src/osmocom/openbsc/openbsc/include/openbsc/ -openbsc/include/openbsc/common_cs.h usr/src/osmocom/openbsc/openbsc/include/openbsc/ -openbsc/src/libcommon/gsm_data_shared.c usr/src/osmocom/openbsc/openbsc/src/libcommon/ -usr/lib/*/pkgconfig/openbsc.pc diff --git a/debian/osmo-msc.install b/debian/osmo-msc.install new file mode 100644 index 0000000..2c733e0 --- /dev/null +++ b/debian/osmo-msc.install @@ -0,0 +1,2 @@ +usr/bin +usr/share/doc/openbsc/examples/osmo-msc/osmo-msc.cfg diff --git a/debian/osmocom-nitb.default b/debian/osmocom-nitb.default deleted file mode 100644 index ef76a5f..0000000 --- a/debian/osmocom-nitb.default +++ /dev/null @@ -1,8 +0,0 @@ -CONFIG_FILE="/etc/osmocom/osmo-nitb.cfg" -HLR_FILE="/var/lib/osmocom/hlr.sqlite3" - -DAEMON_ARGS="-P" - -# Uncomment if using LCR+Asterisk -# DAEMON_ARGS="-m -P" - diff --git a/debian/osmocom-nitb.dirs b/debian/osmocom-nitb.dirs deleted file mode 100644 index efbca2b..0000000 --- a/debian/osmocom-nitb.dirs +++ /dev/null @@ -1,3 +0,0 @@ -/etc/osmocom -/var/log/osmocom -/var/lib/osmocom diff --git a/debian/osmocom-nitb.examples b/debian/osmocom-nitb.examples deleted file mode 100644 index c098d5c..0000000 --- a/debian/osmocom-nitb.examples +++ /dev/null @@ -1 +0,0 @@ -openbsc/doc/examples/osmo-nitb diff --git a/debian/osmocom-nitb.init b/debian/osmocom-nitb.init deleted file mode 100755 index 0747446..0000000 --- a/debian/osmocom-nitb.init +++ /dev/null @@ -1,152 +0,0 @@ -#!/bin/sh -### BEGIN INIT INFO -# Provides: osmo-nitb -# Required-Start: $network $local_fs -# Required-Stop: -# Default-Start: 2 3 4 5 -# Default-Stop: 0 1 6 -# Short-Description: Osmocom GSM network-in-a-box -# Description: A minimal implementation of the GSM Base Station Controller, -# Mobile Switching Center, Home Location regster and all other -# components to run a self-contained GSM network. -### END INIT INFO - -# Author: Harald Welte - -# PATH should only include /usr/* if it runs after the mountnfs.sh script -PATH=/sbin:/usr/sbin:/bin:/usr/bin -NAME=osmo-nitb # Introduce the short server's name here -DESC="Osmocom GSM Network-in-a-Box" # Introduce a short description here -DAEMON=/usr/bin/osmo-nitb # Introduce the server's location here -SCRIPTNAME=/etc/init.d/osmocom-nitb - -# Exit if the package is not installed -[ -x $DAEMON ] || exit 0 - -# Read configuration variable file if it is present -[ -r /etc/default/osmocom-nitb ] && . /etc/default/osmocom-nitb - -# Load the VERBOSE setting and other rcS variables -. /lib/init/vars.sh - -# Define LSB log_* functions. -# Depend on lsb-base (>= 3.0-6) to ensure that this file is present. -. /lib/lsb/init-functions - -DAEMON_ARGS="$DAEMON_ARGS -D -c $CONFIG_FILE -l $HLR_FILE" - -# -# Function that starts the daemon/service -# -do_start() -{ - # Return - # 0 if daemon has been started - # 1 if daemon was already running - # 2 if daemon could not be started - start-stop-daemon --start --quiet --exec $DAEMON --test > /dev/null \ - || return 1 - start-stop-daemon --start --quiet --exec $DAEMON -- \ - $DAEMON_ARGS \ - || return 2 - # Add code here, if necessary, that waits for the process to be ready - # to handle requests from services started subsequently which depend - # on this one. As a last resort, sleep for some time. -} - -# -# Function that stops the daemon/service -# -do_stop() -{ - # Return - # 0 if daemon has been stopped - # 1 if daemon was already stopped - # 2 if daemon could not be stopped - # other if a failure occurred - start-stop-daemon --stop --quiet --retry=TERM/30/KILL/5 --name $NAME - RETVAL="$?" - [ "$RETVAL" = 2 ] && return 2 - # Wait for children to finish too if this is a daemon that forks - # and if the daemon is only ever run from this initscript. - # If the above conditions are not satisfied then add some other code - # that waits for the process to drop all resources that could be - # needed by services started subsequently. A last resort is to - # sleep for some time. - start-stop-daemon --stop --quiet --oknodo --retry=0/30/KILL/5 --exec $DAEMON - [ "$?" = 2 ] && return 2 - return "$RETVAL" -} - -# -# Function that sends a SIGHUP to the daemon/service -# -do_reload() { - # - # If the daemon can reload its configuration without - # restarting (for example, when it is sent a SIGHUP), - # then implement that here. - # - start-stop-daemon --stop --signal 1 --quiet $PIDFILE --name $NAME - return 0 -} - -case "$1" in - start) - [ "$VERBOSE" != no ] && log_daemon_msg "Starting $DESC " "$NAME" - do_start - case "$?" in - 0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;; - 2) [ "$VERBOSE" != no ] && log_end_msg 1 ;; - esac - ;; - stop) - [ "$VERBOSE" != no ] && log_daemon_msg "Stopping $DESC" "$NAME" - do_stop - case "$?" in - 0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;; - 2) [ "$VERBOSE" != no ] && log_end_msg 1 ;; - esac - ;; - status) - status_of_proc "$DAEMON" "$NAME" && exit 0 || exit $? - ;; - #reload|force-reload) - # - # If do_reload() is not implemented then leave this commented out - # and leave 'force-reload' as an alias for 'restart'. - # - #log_daemon_msg "Reloading $DESC" "$NAME" - #do_reload - #log_end_msg $? - #;; - restart|force-reload) - # - # If the "reload" option is implemented then remove the - # 'force-reload' alias - # - log_daemon_msg "Restarting $DESC" "$NAME" - do_stop - case "$?" in - 0|1) - do_start - case "$?" in - 0) log_end_msg 0 ;; - 1) log_end_msg 1 ;; # Old process is still running - *) log_end_msg 1 ;; # Failed to start - esac - ;; - *) - # Failed to stop - log_end_msg 1 - ;; - esac - ;; - *) - #echo "Usage: $SCRIPTNAME {start|stop|restart|reload|force-reload}" >&2 - echo "Usage: $SCRIPTNAME {start|stop|status|restart|force-reload}" >&2 - exit 3 - ;; -esac - -: diff --git a/debian/osmocom-nitb.install b/debian/osmocom-nitb.install deleted file mode 100644 index 26caf71..0000000 --- a/debian/osmocom-nitb.install +++ /dev/null @@ -1,2 +0,0 @@ -/usr/bin/osmo-nitb -openbsc/contrib/*.py usr/bin/ \ No newline at end of file diff --git a/debian/rules b/debian/rules index 4e187a6..3500fbb 100755 --- a/debian/rules +++ b/debian/rules @@ -1,32 +1,59 @@ #!/usr/bin/make -f +# You must remove unused comment lines for the released package. +# See debhelper(7) (uncomment to enable) +# This is an autogenerated template for debian/rules. +# +# Output every command that modifies files on the build system. +#export DH_VERBOSE = 1 +# +# Copy some variable definitions from pkg-info.mk and vendor.mk +# under /usr/share/dpkg/ to here if they are useful. +# +# See FEATURE AREAS/ENVIRONMENT in dpkg-buildflags(1) +# Apply all hardening options +#export DEB_BUILD_MAINT_OPTIONS = hardening=+all +# Package maintainers to append CFLAGS +#export DEB_CFLAGS_MAINT_APPEND = -Wall -pedantic +# Package maintainers to append LDFLAGS +#export DEB_LDFLAGS_MAINT_APPEND = -Wl,--as-needed +# +# With debhelper version 9 or newer, the dh command exports +# all buildflags. So there is no need to include the +# /usr/share/dpkg/buildflags.mk file here if compat is 9 or newer. +# +# These are rarely used code. (START) +# +# The following include for *.mk magically sets miscellaneous +# variables while honoring existing values of pertinent +# environment variables: +# +# Architecture-related variables such as DEB_TARGET_MULTIARCH: +#include /usr/share/dpkg/architecture.mk +# Vendor-related variables such as DEB_VENDOR: +#include /usr/share/dpkg/vendor.mk +# Package-related variables such as DEB_DISTRIBUTION +#include /usr/share/dpkg/pkg-info.mk +# +# You may alternatively set them susing a simple script such as: +# DEB_VENDOR ?= $(shell dpkg-vendor --query Vendor) +# +# These are rarely used code. (END) +# -# Uncomment this to turn on verbose mode. -#export DH_VERBOSE=1 - -DEBIAN := $(shell dpkg-parsechangelog | grep ^Version: | cut -d' ' -f2) -DEBVERS := $(shell echo '$(DEBIAN)' | cut -d- -f1) -VERSION := $(shell echo '$(DEBVERS)' | sed -e 's/[+-].*//' -e 's/~//g') - -export DEB_BUILD_MAINT_OPTIONS = hardening=+all - +# main packaging script based on dh7 syntax %: - dh $@ --sourcedirectory=openbsc --with autoreconf + dh $@ --with autoreconf -# This is needed for debian stable (squeeze) -override_dh_autoreconf: - cd openbsc && autoreconf --install --force - -override_dh_strip: - dh_strip -posmocom-bsc --dbg-package=osmocom-bsc-dbg - dh_strip -posmocom-nitb --dbg-package=osmocom-nitb-dbg - dh_strip -posmocom-ipaccess-utils --dbg-package=osmocom-ipaccess-utils-dbg - dh_strip -posmocom-bs11-utils --dbg-package=osmocom-bs11-utils-dbg - dh_strip -posmocom-sgsn --dbg-package=osmocom-sgsn-dbg - dh_strip -posmocom-gbproxy --dbg-package=osmocom-gbproxy-dbg - dh_strip -posmocom-bsc-nat --dbg-package=osmocom-bsc-nat-dbg - dh_strip -posmo-gtphub --dbg-package=osmo-gtphub-dbg - +# debmake generated override targets +# Set options for ./configure +CONFIGURE_FLAGS += --enable-iu override_dh_auto_configure: - echo $(VERSION) > openbsc/.tarball-version - dh_auto_configure --sourcedirectory=openbsc -- --enable-nat --enable-osmo-bsc --enable-smpp + dh_auto_configure -- $(CONFIGURE_FLAGS) +# +# Do not install libtool archive, python .pyc .pyo +#override_dh_install: +# dh_install --list-missing -X.la -X.pyc -X.pyo +# See https://www.debian.org/doc/manuals/developers-reference/best-pkging-practices.html#bpp-dbg +override_dh_strip: + dh_strip --dbg-package=osmo-msc-dbg -- To view, visit https://gerrit.osmocom.org/3499 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I77544cb38c31777c3fab52979d19488a63e52de3 Gerrit-PatchSet: 8 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: lynxis lazus From gerrit-no-reply at lists.osmocom.org Sun Aug 27 21:31:24 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 27 Aug 2017 21:31:24 +0000 Subject: osmo-msc[master]: add msg type to SMS rx logging In-Reply-To: References: Message-ID: Patch Set 9: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3496 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I73ea4eebe57b2d1008045a27f174072178b9f077 Gerrit-PatchSet: 9 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Aug 28 05:54:57 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 28 Aug 2017 05:54:57 +0000 Subject: osmo-msc[master]: Implement AoIP, port to M3UA SIGTRAN (large addition and ref... In-Reply-To: References: Message-ID: Patch Set 5: (1 comment) https://gerrit.osmocom.org/#/c/3486/5/src/osmo-bsc/osmo_bsc_msc.c File src/osmo-bsc/osmo_bsc_msc.c: Line 45: #if 0 why do we introduce such '#if 0' here rather than removing code? -- To view, visit https://gerrit.osmocom.org/3486 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I5ae4e05ee7c57cad341ea5e86af37c1f6b0ffa77 Gerrit-PatchSet: 5 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: dexter Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Mon Aug 28 08:33:32 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 28 Aug 2017 08:33:32 +0000 Subject: [PATCH] openbsc[master]: Remove common_cs.h from .deb Message-ID: Review at https://gerrit.osmocom.org/3705 Remove common_cs.h from .deb It's not required by gsm_data_shared.h anymore. Change-Id: I22004af84244936ca431f3bf901059f366be8bca Related: OS#2272 --- M debian/openbsc-dev.install 1 file changed, 0 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/05/3705/1 diff --git a/debian/openbsc-dev.install b/debian/openbsc-dev.install index 0c05545..b669b0f 100644 --- a/debian/openbsc-dev.install +++ b/debian/openbsc-dev.install @@ -1,4 +1,3 @@ openbsc/include/openbsc/gsm_data_shared.h usr/src/osmocom/openbsc/openbsc/include/openbsc/ -openbsc/include/openbsc/common_cs.h usr/src/osmocom/openbsc/openbsc/include/openbsc/ openbsc/src/libcommon/gsm_data_shared.c usr/src/osmocom/openbsc/openbsc/src/libcommon/ usr/lib/*/pkgconfig/openbsc.pc -- To view, visit https://gerrit.osmocom.org/3705 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I22004af84244936ca431f3bf901059f366be8bca Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Mon Aug 28 08:47:36 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 28 Aug 2017 08:47:36 +0000 Subject: [MERGED] osmo-iuh[master]: Use value string check from osmo-ci In-Reply-To: References: Message-ID: Max has submitted this change and it was merged. Change subject: Use value string check from osmo-ci ...................................................................... Use value string check from osmo-ci Change-Id: I9fc4a0ce4ca29f8b76e189d040097f3e63298ba5 --- M contrib/jenkins.sh 1 file changed, 3 insertions(+), 4 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/contrib/jenkins.sh b/contrib/jenkins.sh index b500e1c..cda0e2c 100755 --- a/contrib/jenkins.sh +++ b/contrib/jenkins.sh @@ -1,4 +1,4 @@ -#!/usr/bin/env bash +#!/bin/sh set -ex @@ -10,13 +10,12 @@ mkdir "$deps" || true rm -rf "$inst" -osmo-build-dep.sh libosmocore - -"$deps"/libosmocore/contrib/verify_value_string_arrays_are_terminated.py $(find . -name "*.[hc]") +verify_value_string_arrays_are_terminated.py $(find . -name "*.[hc]") export PKG_CONFIG_PATH="$inst/lib/pkgconfig:$PKG_CONFIG_PATH" export LD_LIBRARY_PATH="$inst/lib" +osmo-build-dep.sh libosmocore osmo-build-dep.sh libosmo-abis osmo-build-dep.sh libosmo-netif osmo-build-dep.sh libosmo-sccp -- To view, visit https://gerrit.osmocom.org/3688 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I9fc4a0ce4ca29f8b76e189d040097f3e63298ba5 Gerrit-PatchSet: 2 Gerrit-Project: osmo-iuh Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max From gerrit-no-reply at lists.osmocom.org Mon Aug 28 08:51:06 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 28 Aug 2017 08:51:06 +0000 Subject: [PATCH] libosmocore[master]: Add define for supported a5 key length limit Message-ID: Review at https://gerrit.osmocom.org/3706 Add define for supported a5 key length limit Change-Id: I8ed0f1dbc31aaff22a685ceb3bd2f8db4d2f34fd --- M include/osmocom/crypt/auth.h 1 file changed, 3 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/06/3706/1 diff --git a/include/osmocom/crypt/auth.h b/include/osmocom/crypt/auth.h index 2f88a3a..3555ee8 100644 --- a/include/osmocom/crypt/auth.h +++ b/include/osmocom/crypt/auth.h @@ -8,6 +8,8 @@ #include +#define OSMO_A5_MAX_KEY_LEN_BYTES (128/8) + /*! Authentication Type (GSM/UMTS) */ enum osmo_sub_auth_type { OSMO_AUTH_TYPE_NONE = 0x00, @@ -41,7 +43,7 @@ unsigned int ind; /*!< SQN slot, i.e. (SEQ << ind_bitlen) + ind */ } umts; struct { - uint8_t ki[16]; /*!< secret key */ + uint8_t ki[OSMO_A5_MAX_KEY_LEN_BYTES]; /*!< secret key */ } gsm; } u; }; -- To view, visit https://gerrit.osmocom.org/3706 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I8ed0f1dbc31aaff22a685ceb3bd2f8db4d2f34fd Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Mon Aug 28 09:46:43 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 28 Aug 2017 09:46:43 +0000 Subject: [PATCH] libosmo-netif[master]: Use release helper from libosmocore Message-ID: Review at https://gerrit.osmocom.org/3707 Use release helper from libosmocore Change-Id: I01b0aae741b83a3f17f1caf2b6837cf365a1709b Related: OS#1861 --- M Makefile.am A TODO-RELEASE M configure.ac 3 files changed, 15 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-netif refs/changes/07/3707/1 diff --git a/Makefile.am b/Makefile.am index 9b1c0f1..5dd843b 100644 --- a/Makefile.am +++ b/Makefile.am @@ -8,6 +8,8 @@ EXTRA_DIST = .version README.md + at RELMAKE@ + BUILT_SOURCES = $(top_srcdir)/.version $(top_srcdir)/.version: echo $(VERSION) > $@-t && mv $@-t $@ diff --git a/TODO-RELEASE b/TODO-RELEASE new file mode 100644 index 0000000..d0852fc --- /dev/null +++ b/TODO-RELEASE @@ -0,0 +1,9 @@ +# When cleaning up this file: bump API version in corresponding Makefile.am and rename corresponding debian/lib*.install +# according to https://www.gnu.org/software/libtool/manual/html_node/Updating-version-info.html#Updating-version-info +# In short: +# LIBVERSION=c:r:a +# If the library source code has changed at all since the last update, then increment revision: c:r + 1:a. +# If any interfaces have been added, removed, or changed since the last update: c + 1:0:0. +# If any interfaces have been added since the last public release: c:r:a + 1. +# If any interfaces have been removed or changed since the last public release: c:r:0. +#library what description / commit summary line diff --git a/configure.ac b/configure.ac index 175ab63..6c9ba77 100644 --- a/configure.ac +++ b/configure.ac @@ -11,6 +11,10 @@ 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]) + dnl checks for programs AC_PROG_MAKE_SET AC_PROG_CC -- To view, visit https://gerrit.osmocom.org/3707 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I01b0aae741b83a3f17f1caf2b6837cf365a1709b Gerrit-PatchSet: 1 Gerrit-Project: libosmo-netif Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Mon Aug 28 09:49:11 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 28 Aug 2017 09:49:11 +0000 Subject: [PATCH] libosmo-sccp[master]: Use release helper from libosmocore Message-ID: Review at https://gerrit.osmocom.org/3708 Use release helper from libosmocore Change-Id: I39b3bfa8a1ccf376215a3ce220cb3cf7a85471cb Related: OS#1861 --- M Makefile.am A TODO-RELEASE M configure.ac 3 files changed, 15 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-sccp refs/changes/08/3708/1 diff --git a/Makefile.am b/Makefile.am index 9bb711c..e2c5277 100644 --- a/Makefile.am +++ b/Makefile.am @@ -8,6 +8,8 @@ EXTRA_DIST = .version doc/examples/osmo-stp.cfg + at RELMAKE@ + BUILT_SOURCES = $(top_srcdir)/.version $(top_srcdir)/.version: echo $(VERSION) > $@-t && mv $@-t $@ diff --git a/TODO-RELEASE b/TODO-RELEASE new file mode 100644 index 0000000..d0852fc --- /dev/null +++ b/TODO-RELEASE @@ -0,0 +1,9 @@ +# When cleaning up this file: bump API version in corresponding Makefile.am and rename corresponding debian/lib*.install +# according to https://www.gnu.org/software/libtool/manual/html_node/Updating-version-info.html#Updating-version-info +# In short: +# LIBVERSION=c:r:a +# If the library source code has changed at all since the last update, then increment revision: c:r + 1:a. +# If any interfaces have been added, removed, or changed since the last update: c + 1:0:0. +# If any interfaces have been added since the last public release: c:r:a + 1. +# If any interfaces have been removed or changed since the last public release: c:r:0. +#library what description / commit summary line diff --git a/configure.ac b/configure.ac index 7e3e03e..ed761c3 100644 --- a/configure.ac +++ b/configure.ac @@ -12,6 +12,10 @@ 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]) + dnl checks for programs AC_PROG_MAKE_SET AC_PROG_CC -- To view, visit https://gerrit.osmocom.org/3708 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I39b3bfa8a1ccf376215a3ce220cb3cf7a85471cb Gerrit-PatchSet: 1 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Mon Aug 28 09:51:33 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 28 Aug 2017 09:51:33 +0000 Subject: [PATCH] libsmpp34[master]: Use release helper from libosmocore Message-ID: Review at https://gerrit.osmocom.org/3709 Use release helper from libosmocore Change-Id: Ief2b4d0400b142e84e7ce005a6da5c880c78a8f5 Related: OS#1861 --- M Makefile.am A TODO-RELEASE M configure.ac 3 files changed, 15 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libsmpp34 refs/changes/09/3709/1 diff --git a/Makefile.am b/Makefile.am index b274f45..d526301 100644 --- a/Makefile.am +++ b/Makefile.am @@ -19,5 +19,7 @@ test_apps/recv_and_unpack.inc \ README.md + at RELMAKE@ + pkgconfigdir = $(libdir)/pkgconfig pkgconfig_DATA = libsmpp34.pc diff --git a/TODO-RELEASE b/TODO-RELEASE new file mode 100644 index 0000000..d0852fc --- /dev/null +++ b/TODO-RELEASE @@ -0,0 +1,9 @@ +# When cleaning up this file: bump API version in corresponding Makefile.am and rename corresponding debian/lib*.install +# according to https://www.gnu.org/software/libtool/manual/html_node/Updating-version-info.html#Updating-version-info +# In short: +# LIBVERSION=c:r:a +# If the library source code has changed at all since the last update, then increment revision: c:r + 1:a. +# If any interfaces have been added, removed, or changed since the last update: c + 1:0:0. +# If any interfaces have been added since the last public release: c:r:a + 1. +# If any interfaces have been removed or changed since the last public release: c:r:0. +#library what description / commit summary line diff --git a/configure.ac b/configure.ac index 0354ab9..305cc11 100644 --- a/configure.ac +++ b/configure.ac @@ -8,6 +8,10 @@ AM_INIT_AUTOMAKE([foreign]) AM_CONFIG_HEADER([aux_config/config.h]) +dnl include release helper +RELMAKE='-include osmo-release.mk' +AC_SUBST([RELMAKE]) + # Checks for programs. AC_PROG_CC AM_PROG_CC_C_O -- To view, visit https://gerrit.osmocom.org/3709 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ief2b4d0400b142e84e7ce005a6da5c880c78a8f5 Gerrit-PatchSet: 1 Gerrit-Project: libsmpp34 Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Mon Aug 28 09:56:57 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 28 Aug 2017 09:56:57 +0000 Subject: [PATCH] osmo-bsc[master]: Use release helper from libosmocore Message-ID: Review at https://gerrit.osmocom.org/3710 Use release helper from libosmocore Change-Id: I05bf42d638167c779328fa61b01c917da91a88de Related: OS#1861 --- M Makefile.am M configure.ac 2 files changed, 7 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/10/3710/1 diff --git a/Makefile.am b/Makefile.am index 4a1f65d..536b3f4 100644 --- a/Makefile.am +++ b/Makefile.am @@ -21,6 +21,9 @@ BUILT_SOURCES = $(top_srcdir)/.version EXTRA_DIST = git-version-gen osmoappdesc.py .version + + at RELMAKE@ + $(top_srcdir)/.version: echo $(VERSION) > $@-t && mv $@-t $@ dist-hook: diff --git a/configure.ac b/configure.ac index 871f7e5..b0d6b23 100644 --- a/configure.ac +++ b/configure.ac @@ -12,6 +12,10 @@ 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]) + dnl checks for programs AC_PROG_MAKE_SET AC_PROG_CC -- To view, visit https://gerrit.osmocom.org/3710 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I05bf42d638167c779328fa61b01c917da91a88de Gerrit-PatchSet: 1 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Mon Aug 28 09:59:57 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Mon, 28 Aug 2017 09:59:57 +0000 Subject: [PATCH] osmo-gsm-manuals[master]: OsmoGsmTester: Move coredump section and add reference to ke... Message-ID: Review at https://gerrit.osmocom.org/3711 OsmoGsmTester: Move coredump section and add reference to kernel.core_pattern sysctl This section is moved further below in order to have it after section which explains how to create user jenkins and osmo-gsm-tester group, as we need this group already created anyway for the config to work correctly. Change-Id: I5bdde0a9960f9806f081e9a876b8b66db9e7f37c --- M OsmoGSMTester/chapters/install.adoc 1 file changed, 37 insertions(+), 25 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-manuals refs/changes/11/3711/1 diff --git a/OsmoGSMTester/chapters/install.adoc b/OsmoGSMTester/chapters/install.adoc index f58c611..d01b823 100644 --- a/OsmoGSMTester/chapters/install.adoc +++ b/OsmoGSMTester/chapters/install.adoc @@ -330,31 +330,6 @@ This assumes you have already created the jenkins user (see <>). -==== Allow Core Files - -In case a binary run for the test crashes, a core file of the crash should be -written. This requires a limit rule. Copy the following config file from the -osmo-gsm-tester source tree to the main unit: - ----- -sudo -s -echo "@osmo-gsm-tester - core unlimited" > /etc/security/limits.d/osmo-gsm-tester_allow-core.conf ----- - -Re-login the user to make these changes take effect. - -==== Allow Realtime Priority - -Certain binaries should be run with real-time priority, like 'osmo-bts-trx'. -Add this permission on the main unit: - ----- -sudo -s -echo "@osmo-gsm-tester - rtprio 99" > /etc/security/limits.d/osmo-gsm-tester_allow-rtprio.conf ----- - -Re-login the user to make these changes take effect. - ==== User Permissions On the main unit, create a group for all users that should be allowed to use @@ -467,6 +442,43 @@ TODO: allow skipping pcaps by configuration if access to tcpdump is not wanted +==== Allow Core Files + +In case a binary run for the test crashes, a core file of the crash should be +written. This requires a limit rule. Copy the following config file from the +osmo-gsm-tester source tree to the main unit: + +---- +sudo -s +echo "@osmo-gsm-tester - core unlimited" > /etc/security/limits.d/osmo-gsm-tester_allow-core.conf +---- + +Re-login the user to make these changes take effect. + +The most logical idea is usually to store the core file inside the run +directory, and more specifically in the directory where osmo-gsm-tester is +writing stderr and stdout for that same process. Luckily, osmo-gsm-tester makes +that easy, as it sets the CWD to that mentioned directory. This means setting +sysctl *kernel.core_pattern* to any value specifying a relative path is going to +be enough to have it stored there. This is usually the case for the default +value of that sysctl parameter: + +---- +sysctl -w kernel.core_pattern=core +---- + +==== Allow Realtime Priority + +Certain binaries should be run with real-time priority, like 'osmo-bts-trx'. +Add this permission on the main unit: + +---- +sudo -s +echo "@osmo-gsm-tester - rtprio 99" > /etc/security/limits.d/osmo-gsm-tester_allow-rtprio.conf +---- + +Re-login the user to make these changes take effect. + [[user_config_uhd]] ==== UHD -- To view, visit https://gerrit.osmocom.org/3711 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I5bdde0a9960f9806f081e9a876b8b66db9e7f37c Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Mon Aug 28 10:01:43 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 28 Aug 2017 10:01:43 +0000 Subject: [PATCH] osmo-iuh[master]: Use release helper from libosmocore Message-ID: Review at https://gerrit.osmocom.org/3712 Use release helper from libosmocore Change-Id: I3ccc8202b650268cc9d1721719ba2f205c351a67 Related: OS#1861 --- M Makefile.am A TODO-RELEASE M configure.ac 3 files changed, 15 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-iuh refs/changes/12/3712/1 diff --git a/Makefile.am b/Makefile.am index 447b148..67445ee 100644 --- a/Makefile.am +++ b/Makefile.am @@ -7,6 +7,8 @@ EXTRA_DIST = asn1 .version README.md + at RELMAKE@ + BUILT_SOURCES = $(top_srcdir)/.version $(top_srcdir)/.version: echo $(VERSION) > $@-t && mv $@-t $@ diff --git a/TODO-RELEASE b/TODO-RELEASE new file mode 100644 index 0000000..d0852fc --- /dev/null +++ b/TODO-RELEASE @@ -0,0 +1,9 @@ +# When cleaning up this file: bump API version in corresponding Makefile.am and rename corresponding debian/lib*.install +# according to https://www.gnu.org/software/libtool/manual/html_node/Updating-version-info.html#Updating-version-info +# In short: +# LIBVERSION=c:r:a +# If the library source code has changed at all since the last update, then increment revision: c:r + 1:a. +# If any interfaces have been added, removed, or changed since the last update: c + 1:0:0. +# If any interfaces have been added since the last public release: c:r:a + 1. +# If any interfaces have been removed or changed since the last public release: c:r:0. +#library what description / commit summary line diff --git a/configure.ac b/configure.ac index ab7a637..72cbb56 100644 --- a/configure.ac +++ b/configure.ac @@ -16,6 +16,10 @@ 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]) + dnl checks for programs AC_PROG_MAKE_SET AC_PROG_MKDIR_P -- To view, visit https://gerrit.osmocom.org/3712 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I3ccc8202b650268cc9d1721719ba2f205c351a67 Gerrit-PatchSet: 1 Gerrit-Project: osmo-iuh Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Mon Aug 28 10:03:04 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 28 Aug 2017 10:03:04 +0000 Subject: [PATCH] osmo-mgw[master]: Use release helper from libosmocore Message-ID: Review at https://gerrit.osmocom.org/3713 Use release helper from libosmocore Change-Id: I0905eeb177185da1e2818a01fdb7265694d9903d Related: OS#1861 --- M Makefile.am M configure.ac 2 files changed, 7 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-mgw refs/changes/13/3713/1 diff --git a/Makefile.am b/Makefile.am index 4a1f65d..536b3f4 100644 --- a/Makefile.am +++ b/Makefile.am @@ -21,6 +21,9 @@ BUILT_SOURCES = $(top_srcdir)/.version EXTRA_DIST = git-version-gen osmoappdesc.py .version + + at RELMAKE@ + $(top_srcdir)/.version: echo $(VERSION) > $@-t && mv $@-t $@ dist-hook: diff --git a/configure.ac b/configure.ac index 871f7e5..b0d6b23 100644 --- a/configure.ac +++ b/configure.ac @@ -12,6 +12,10 @@ 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]) + dnl checks for programs AC_PROG_MAKE_SET AC_PROG_CC -- To view, visit https://gerrit.osmocom.org/3713 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I0905eeb177185da1e2818a01fdb7265694d9903d Gerrit-PatchSet: 1 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Mon Aug 28 10:04:37 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 28 Aug 2017 10:04:37 +0000 Subject: [PATCH] osmo-msc[master]: Use release helper from libosmocore Message-ID: Review at https://gerrit.osmocom.org/3714 Use release helper from libosmocore Change-Id: I869395d5c9ab5ec1a487aff15418d1517f47e831 Related: OS#1861 --- M Makefile.am M configure.ac 2 files changed, 7 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/14/3714/1 diff --git a/Makefile.am b/Makefile.am index 4a1f65d..536b3f4 100644 --- a/Makefile.am +++ b/Makefile.am @@ -21,6 +21,9 @@ BUILT_SOURCES = $(top_srcdir)/.version EXTRA_DIST = git-version-gen osmoappdesc.py .version + + at RELMAKE@ + $(top_srcdir)/.version: echo $(VERSION) > $@-t && mv $@-t $@ dist-hook: diff --git a/configure.ac b/configure.ac index 871f7e5..b0d6b23 100644 --- a/configure.ac +++ b/configure.ac @@ -12,6 +12,10 @@ 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]) + dnl checks for programs AC_PROG_MAKE_SET AC_PROG_CC -- To view, visit https://gerrit.osmocom.org/3714 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I869395d5c9ab5ec1a487aff15418d1517f47e831 Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Mon Aug 28 10:06:14 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 28 Aug 2017 10:06:14 +0000 Subject: [PATCH] osmo-pcap[master]: Use release helper from libosmocore Message-ID: Review at https://gerrit.osmocom.org/3715 Use release helper from libosmocore Change-Id: Iafe5905895a656b7055d58ca8f745fcfa4bd9886 Related: OS#1861 --- M Makefile.am M configure.ac 2 files changed, 7 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcap refs/changes/15/3715/1 diff --git a/Makefile.am b/Makefile.am index 798c092..6caa009 100644 --- a/Makefile.am +++ b/Makefile.am @@ -4,6 +4,9 @@ BUILT_SOURCES = $(top_srcdir)/.version EXTRA_DIST = git-version-gen .version + + at RELMAKE@ + $(top_srcdir)/.version: echo $(VERSION) > $@-t && mv $@-t $@ dist-hook: diff --git a/configure.ac b/configure.ac index 4c0a12f..b370e0d 100644 --- a/configure.ac +++ b/configure.ac @@ -9,6 +9,10 @@ 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]) + dnl checks for programs AC_PROG_MAKE_SET AC_PROG_CC -- To view, visit https://gerrit.osmocom.org/3715 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Iafe5905895a656b7055d58ca8f745fcfa4bd9886 Gerrit-PatchSet: 1 Gerrit-Project: osmo-pcap Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Mon Aug 28 10:08:52 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 28 Aug 2017 10:08:52 +0000 Subject: [PATCH] osmo-sgsn[master]: Use release helper from libosmocore Message-ID: Review at https://gerrit.osmocom.org/3716 Use release helper from libosmocore Change-Id: I73823c568cfc55ad21a08dec76874724b43f419f Related: OS#1861 --- M Makefile.am M configure.ac 2 files changed, 7 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-sgsn refs/changes/16/3716/1 diff --git a/Makefile.am b/Makefile.am index 4a1f65d..536b3f4 100644 --- a/Makefile.am +++ b/Makefile.am @@ -21,6 +21,9 @@ BUILT_SOURCES = $(top_srcdir)/.version EXTRA_DIST = git-version-gen osmoappdesc.py .version + + at RELMAKE@ + $(top_srcdir)/.version: echo $(VERSION) > $@-t && mv $@-t $@ dist-hook: diff --git a/configure.ac b/configure.ac index 871f7e5..b0d6b23 100644 --- a/configure.ac +++ b/configure.ac @@ -12,6 +12,10 @@ 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]) + dnl checks for programs AC_PROG_MAKE_SET AC_PROG_CC -- To view, visit https://gerrit.osmocom.org/3716 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I73823c568cfc55ad21a08dec76874724b43f419f Gerrit-PatchSet: 1 Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Mon Aug 28 10:11:18 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 28 Aug 2017 10:11:18 +0000 Subject: [PATCH] osmo-trx[master]: Use release helper from libosmocore Message-ID: Review at https://gerrit.osmocom.org/3717 Use release helper from libosmocore Change-Id: Ieb843923d8f534654413be695f2b5f0c87b75520 Related: OS#1861 --- M Makefile.am M configure.ac 2 files changed, 5 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-trx refs/changes/17/3717/1 diff --git a/Makefile.am b/Makefile.am index 56cb4ba..5cf1a45 100644 --- a/Makefile.am +++ b/Makefile.am @@ -39,6 +39,7 @@ COPYING \ README + at RELMAKE@ dox: FORCE doxygen doxconfig diff --git a/configure.ac b/configure.ac index 8cfd25d..43b5403 100644 --- a/configure.ac +++ b/configure.ac @@ -34,6 +34,10 @@ dnl Linux kernel KBuild style compile messages m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) +dnl include release helper +RELMAKE='-include osmo-release.mk' +AC_SUBST([RELMAKE]) + AM_PROG_AS AC_PROG_CXX AX_CXX_COMPILE_STDCXX_11 -- To view, visit https://gerrit.osmocom.org/3717 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ieb843923d8f534654413be695f2b5f0c87b75520 Gerrit-PatchSet: 1 Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Mon Aug 28 10:15:23 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 28 Aug 2017 10:15:23 +0000 Subject: [PATCH] openggsn[master]: Use release helper from libosmocore Message-ID: Review at https://gerrit.osmocom.org/3718 Use release helper from libosmocore Change-Id: Icdcb388ad22b0c009dac7968408d1e2504c838c1 Related: OS#1861 --- M Makefile.am A TODO-RELEASE M configure.ac 3 files changed, 15 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openggsn refs/changes/18/3718/1 diff --git a/Makefile.am b/Makefile.am index 970fbf7..1d7eaba 100644 --- a/Makefile.am +++ b/Makefile.am @@ -11,3 +11,5 @@ echo $(VERSION) > $(distdir)/.tarball-version EXTRA_DIST = git-version-gen .version README.md README.FreeBSD README.MacOSX README.Solaris + + at RELMAKE@ diff --git a/TODO-RELEASE b/TODO-RELEASE new file mode 100644 index 0000000..d0852fc --- /dev/null +++ b/TODO-RELEASE @@ -0,0 +1,9 @@ +# When cleaning up this file: bump API version in corresponding Makefile.am and rename corresponding debian/lib*.install +# according to https://www.gnu.org/software/libtool/manual/html_node/Updating-version-info.html#Updating-version-info +# In short: +# LIBVERSION=c:r:a +# If the library source code has changed at all since the last update, then increment revision: c:r + 1:a. +# If any interfaces have been added, removed, or changed since the last update: c + 1:0:0. +# If any interfaces have been added since the last public release: c:r:a + 1. +# If any interfaces have been removed or changed since the last public release: c:r:0. +#library what description / commit summary line diff --git a/configure.ac b/configure.ac index 63d3117..9d3a8e4 100644 --- a/configure.ac +++ b/configure.ac @@ -55,6 +55,10 @@ # FIXME: Replace `main' with a function in `-links': #AC_CHECK_LIB([inks], [main]) +dnl include release helper +RELMAKE='-include osmo-release.mk' +AC_SUBST([RELMAKE]) + dnl GTP Linux kernel dependencies AC_ARG_ENABLE([gtp-linux], AS_HELP_STRING([--enable-gtp-linux], [Build GTP tunneling Linux kernel]), -- To view, visit https://gerrit.osmocom.org/3718 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Icdcb388ad22b0c009dac7968408d1e2504c838c1 Gerrit-PatchSet: 1 Gerrit-Project: openggsn Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Mon Aug 28 10:20:31 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 28 Aug 2017 10:20:31 +0000 Subject: [PATCH] libsmpp34[master]: Use release helper from libosmocore In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3709 to look at the new patch set (#2). Use release helper from libosmocore See https://osmocom.org/projects/cellular-infrastructure/wiki/Make_a_new_release for details. Change-Id: Ief2b4d0400b142e84e7ce005a6da5c880c78a8f5 Related: OS#1861 --- M Makefile.am A TODO-RELEASE M configure.ac M debian/changelog 4 files changed, 16 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/libsmpp34 refs/changes/09/3709/2 diff --git a/Makefile.am b/Makefile.am index b274f45..d526301 100644 --- a/Makefile.am +++ b/Makefile.am @@ -19,5 +19,7 @@ test_apps/recv_and_unpack.inc \ README.md + at RELMAKE@ + pkgconfigdir = $(libdir)/pkgconfig pkgconfig_DATA = libsmpp34.pc diff --git a/TODO-RELEASE b/TODO-RELEASE new file mode 100644 index 0000000..d0852fc --- /dev/null +++ b/TODO-RELEASE @@ -0,0 +1,9 @@ +# When cleaning up this file: bump API version in corresponding Makefile.am and rename corresponding debian/lib*.install +# according to https://www.gnu.org/software/libtool/manual/html_node/Updating-version-info.html#Updating-version-info +# In short: +# LIBVERSION=c:r:a +# If the library source code has changed at all since the last update, then increment revision: c:r + 1:a. +# If any interfaces have been added, removed, or changed since the last update: c + 1:0:0. +# If any interfaces have been added since the last public release: c:r:a + 1. +# If any interfaces have been removed or changed since the last public release: c:r:0. +#library what description / commit summary line diff --git a/configure.ac b/configure.ac index 0354ab9..305cc11 100644 --- a/configure.ac +++ b/configure.ac @@ -8,6 +8,10 @@ AM_INIT_AUTOMAKE([foreign]) AM_CONFIG_HEADER([aux_config/config.h]) +dnl include release helper +RELMAKE='-include osmo-release.mk' +AC_SUBST([RELMAKE]) + # Checks for programs. AC_PROG_CC AM_PROG_CC_C_O diff --git a/debian/changelog b/debian/changelog index c0c3948..5a142af 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,4 @@ -libsmpp34 (1.12) UNRELEASED; urgency=medium +libsmpp34 (1.12.0) UNRELEASED; urgency=medium [ Holger Hans Peter Freyther ] * Move forward towards a new release. -- To view, visit https://gerrit.osmocom.org/3709 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ief2b4d0400b142e84e7ce005a6da5c880c78a8f5 Gerrit-PatchSet: 2 Gerrit-Project: libsmpp34 Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Mon Aug 28 10:27:30 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 28 Aug 2017 10:27:30 +0000 Subject: [PATCH] osmo-trx[master]: Use release helper from libosmocore In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3717 to look at the new patch set (#2). Use release helper from libosmocore See https://osmocom.org/projects/cellular-infrastructure/wiki/Make_a_new_release for details. Change-Id: Ieb843923d8f534654413be695f2b5f0c87b75520 Related: OS#1861 --- M Makefile.am M configure.ac 2 files changed, 5 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-trx refs/changes/17/3717/2 diff --git a/Makefile.am b/Makefile.am index 56cb4ba..5cf1a45 100644 --- a/Makefile.am +++ b/Makefile.am @@ -39,6 +39,7 @@ COPYING \ README + at RELMAKE@ dox: FORCE doxygen doxconfig diff --git a/configure.ac b/configure.ac index 8cfd25d..43b5403 100644 --- a/configure.ac +++ b/configure.ac @@ -34,6 +34,10 @@ dnl Linux kernel KBuild style compile messages m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) +dnl include release helper +RELMAKE='-include osmo-release.mk' +AC_SUBST([RELMAKE]) + AM_PROG_AS AC_PROG_CXX AX_CXX_COMPILE_STDCXX_11 -- To view, visit https://gerrit.osmocom.org/3717 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ieb843923d8f534654413be695f2b5f0c87b75520 Gerrit-PatchSet: 2 Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Mon Aug 28 10:29:40 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 28 Aug 2017 10:29:40 +0000 Subject: [PATCH] openggsn[master]: Use release helper from libosmocore In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3718 to look at the new patch set (#2). Use release helper from libosmocore See https://osmocom.org/projects/cellular-infrastructure/wiki/Make_a_new_release for details. Change-Id: Icdcb388ad22b0c009dac7968408d1e2504c838c1 Related: OS#1861 --- M Makefile.am A TODO-RELEASE M configure.ac M debian/changelog 4 files changed, 16 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/openggsn refs/changes/18/3718/2 diff --git a/Makefile.am b/Makefile.am index 970fbf7..1d7eaba 100644 --- a/Makefile.am +++ b/Makefile.am @@ -11,3 +11,5 @@ echo $(VERSION) > $(distdir)/.tarball-version EXTRA_DIST = git-version-gen .version README.md README.FreeBSD README.MacOSX README.Solaris + + at RELMAKE@ diff --git a/TODO-RELEASE b/TODO-RELEASE new file mode 100644 index 0000000..d0852fc --- /dev/null +++ b/TODO-RELEASE @@ -0,0 +1,9 @@ +# When cleaning up this file: bump API version in corresponding Makefile.am and rename corresponding debian/lib*.install +# according to https://www.gnu.org/software/libtool/manual/html_node/Updating-version-info.html#Updating-version-info +# In short: +# LIBVERSION=c:r:a +# If the library source code has changed at all since the last update, then increment revision: c:r + 1:a. +# If any interfaces have been added, removed, or changed since the last update: c + 1:0:0. +# If any interfaces have been added since the last public release: c:r:a + 1. +# If any interfaces have been removed or changed since the last public release: c:r:0. +#library what description / commit summary line diff --git a/configure.ac b/configure.ac index 63d3117..9d3a8e4 100644 --- a/configure.ac +++ b/configure.ac @@ -55,6 +55,10 @@ # FIXME: Replace `main' with a function in `-links': #AC_CHECK_LIB([inks], [main]) +dnl include release helper +RELMAKE='-include osmo-release.mk' +AC_SUBST([RELMAKE]) + dnl GTP Linux kernel dependencies AC_ARG_ENABLE([gtp-linux], AS_HELP_STRING([--enable-gtp-linux], [Build GTP tunneling Linux kernel]), diff --git a/debian/changelog b/debian/changelog index 17a0a36..357cc01 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,4 @@ -openggsn (0.94) UNRELEASED; urgency=medium +openggsn (0.94.0) UNRELEASED; urgency=medium [ Holger Hans Peter Freyther ] * Bump version to ease upgrading from Debian SID. -- To view, visit https://gerrit.osmocom.org/3718 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Icdcb388ad22b0c009dac7968408d1e2504c838c1 Gerrit-PatchSet: 2 Gerrit-Project: openggsn Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Mon Aug 28 10:53:34 2017 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Mon, 28 Aug 2017 10:53:34 +0000 Subject: libosmocore[master]: gsm0480: modify USSD structures to support external handling In-Reply-To: References: Message-ID: Patch Set 2: Hi Harald, Sorry for late response. Regarding to the ABI / API breaking problem, we have discussed suggested solution with Alexander: adding an 'osmo' prefix that is currently missed for exposed symbols would be great. -- To view, visit https://gerrit.osmocom.org/3374 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I5f8972b86cd4dcb54b643a24b5794a87c8758073 Gerrit-PatchSet: 2 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Alexander Chemeris Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Ivan Kluchnikov Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Vadim Yanitskiy Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Aug 28 10:54:10 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 28 Aug 2017 10:54:10 +0000 Subject: [PATCH] libosmo-netif[master]: Use release helper from libosmocore In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3707 to look at the new patch set (#2). Use release helper from libosmocore See https://osmocom.org/projects/cellular-infrastructure/wiki/Make_a_new_release for details. Change-Id: I01b0aae741b83a3f17f1caf2b6837cf365a1709b Related: OS#1861 --- M Makefile.am A TODO-RELEASE M configure.ac 3 files changed, 15 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-netif refs/changes/07/3707/2 diff --git a/Makefile.am b/Makefile.am index 9b1c0f1..5dd843b 100644 --- a/Makefile.am +++ b/Makefile.am @@ -8,6 +8,8 @@ EXTRA_DIST = .version README.md + at RELMAKE@ + BUILT_SOURCES = $(top_srcdir)/.version $(top_srcdir)/.version: echo $(VERSION) > $@-t && mv $@-t $@ diff --git a/TODO-RELEASE b/TODO-RELEASE new file mode 100644 index 0000000..d0852fc --- /dev/null +++ b/TODO-RELEASE @@ -0,0 +1,9 @@ +# When cleaning up this file: bump API version in corresponding Makefile.am and rename corresponding debian/lib*.install +# according to https://www.gnu.org/software/libtool/manual/html_node/Updating-version-info.html#Updating-version-info +# In short: +# LIBVERSION=c:r:a +# If the library source code has changed at all since the last update, then increment revision: c:r + 1:a. +# If any interfaces have been added, removed, or changed since the last update: c + 1:0:0. +# If any interfaces have been added since the last public release: c:r:a + 1. +# If any interfaces have been removed or changed since the last public release: c:r:0. +#library what description / commit summary line diff --git a/configure.ac b/configure.ac index 175ab63..6c9ba77 100644 --- a/configure.ac +++ b/configure.ac @@ -11,6 +11,10 @@ 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]) + dnl checks for programs AC_PROG_MAKE_SET AC_PROG_CC -- To view, visit https://gerrit.osmocom.org/3707 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I01b0aae741b83a3f17f1caf2b6837cf365a1709b Gerrit-PatchSet: 2 Gerrit-Project: libosmo-netif Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Mon Aug 28 10:55:37 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 28 Aug 2017 10:55:37 +0000 Subject: [PATCH] osmo-msc[master]: Use release helper from libosmocore In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3714 to look at the new patch set (#2). Use release helper from libosmocore See https://osmocom.org/projects/cellular-infrastructure/wiki/Make_a_new_release for details. Change-Id: I869395d5c9ab5ec1a487aff15418d1517f47e831 Related: OS#1861 --- M Makefile.am M configure.ac 2 files changed, 7 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/14/3714/2 diff --git a/Makefile.am b/Makefile.am index 4a1f65d..536b3f4 100644 --- a/Makefile.am +++ b/Makefile.am @@ -21,6 +21,9 @@ BUILT_SOURCES = $(top_srcdir)/.version EXTRA_DIST = git-version-gen osmoappdesc.py .version + + at RELMAKE@ + $(top_srcdir)/.version: echo $(VERSION) > $@-t && mv $@-t $@ dist-hook: diff --git a/configure.ac b/configure.ac index 871f7e5..b0d6b23 100644 --- a/configure.ac +++ b/configure.ac @@ -12,6 +12,10 @@ 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]) + dnl checks for programs AC_PROG_MAKE_SET AC_PROG_CC -- To view, visit https://gerrit.osmocom.org/3714 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I869395d5c9ab5ec1a487aff15418d1517f47e831 Gerrit-PatchSet: 2 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Mon Aug 28 10:56:37 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 28 Aug 2017 10:56:37 +0000 Subject: [PATCH] osmo-sgsn[master]: Use release helper from libosmocore In-Reply-To: References: Message-ID: Use release helper from libosmocore See https://osmocom.org/projects/cellular-infrastructure/wiki/Make_a_new_release for details. Change-Id: I73823c568cfc55ad21a08dec76874724b43f419f Related: OS#1861 --- M Makefile.am M configure.ac 2 files changed, 7 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-sgsn refs/changes/16/3716/2 diff --git a/Makefile.am b/Makefile.am index 4a1f65d..536b3f4 100644 --- a/Makefile.am +++ b/Makefile.am @@ -21,6 +21,9 @@ BUILT_SOURCES = $(top_srcdir)/.version EXTRA_DIST = git-version-gen osmoappdesc.py .version + + at RELMAKE@ + $(top_srcdir)/.version: echo $(VERSION) > $@-t && mv $@-t $@ dist-hook: diff --git a/configure.ac b/configure.ac index 871f7e5..b0d6b23 100644 --- a/configure.ac +++ b/configure.ac @@ -12,6 +12,10 @@ 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]) + dnl checks for programs AC_PROG_MAKE_SET AC_PROG_CC -- To view, visit https://gerrit.osmocom.org/3716 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I73823c568cfc55ad21a08dec76874724b43f419f Gerrit-PatchSet: 2 Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Mon Aug 28 10:57:39 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 28 Aug 2017 10:57:39 +0000 Subject: [PATCH] osmo-pcap[master]: Use release helper from libosmocore In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3715 to look at the new patch set (#2). Use release helper from libosmocore See https://osmocom.org/projects/cellular-infrastructure/wiki/Make_a_new_release for details. Change-Id: Iafe5905895a656b7055d58ca8f745fcfa4bd9886 Related: OS#1861 --- M Makefile.am M configure.ac 2 files changed, 7 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcap refs/changes/15/3715/2 diff --git a/Makefile.am b/Makefile.am index 798c092..6caa009 100644 --- a/Makefile.am +++ b/Makefile.am @@ -4,6 +4,9 @@ BUILT_SOURCES = $(top_srcdir)/.version EXTRA_DIST = git-version-gen .version + + at RELMAKE@ + $(top_srcdir)/.version: echo $(VERSION) > $@-t && mv $@-t $@ dist-hook: diff --git a/configure.ac b/configure.ac index 4c0a12f..b370e0d 100644 --- a/configure.ac +++ b/configure.ac @@ -9,6 +9,10 @@ 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]) + dnl checks for programs AC_PROG_MAKE_SET AC_PROG_CC -- To view, visit https://gerrit.osmocom.org/3715 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Iafe5905895a656b7055d58ca8f745fcfa4bd9886 Gerrit-PatchSet: 2 Gerrit-Project: osmo-pcap Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Mon Aug 28 10:59:16 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 28 Aug 2017 10:59:16 +0000 Subject: [PATCH] osmo-iuh[master]: Use release helper from libosmocore In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3712 to look at the new patch set (#2). Use release helper from libosmocore See https://osmocom.org/projects/cellular-infrastructure/wiki/Make_a_new_release for details. Change-Id: I3ccc8202b650268cc9d1721719ba2f205c351a67 Related: OS#1861 --- M Makefile.am A TODO-RELEASE M configure.ac 3 files changed, 15 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-iuh refs/changes/12/3712/2 diff --git a/Makefile.am b/Makefile.am index 447b148..67445ee 100644 --- a/Makefile.am +++ b/Makefile.am @@ -7,6 +7,8 @@ EXTRA_DIST = asn1 .version README.md + at RELMAKE@ + BUILT_SOURCES = $(top_srcdir)/.version $(top_srcdir)/.version: echo $(VERSION) > $@-t && mv $@-t $@ diff --git a/TODO-RELEASE b/TODO-RELEASE new file mode 100644 index 0000000..d0852fc --- /dev/null +++ b/TODO-RELEASE @@ -0,0 +1,9 @@ +# When cleaning up this file: bump API version in corresponding Makefile.am and rename corresponding debian/lib*.install +# according to https://www.gnu.org/software/libtool/manual/html_node/Updating-version-info.html#Updating-version-info +# In short: +# LIBVERSION=c:r:a +# If the library source code has changed at all since the last update, then increment revision: c:r + 1:a. +# If any interfaces have been added, removed, or changed since the last update: c + 1:0:0. +# If any interfaces have been added since the last public release: c:r:a + 1. +# If any interfaces have been removed or changed since the last public release: c:r:0. +#library what description / commit summary line diff --git a/configure.ac b/configure.ac index ab7a637..72cbb56 100644 --- a/configure.ac +++ b/configure.ac @@ -16,6 +16,10 @@ 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]) + dnl checks for programs AC_PROG_MAKE_SET AC_PROG_MKDIR_P -- To view, visit https://gerrit.osmocom.org/3712 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I3ccc8202b650268cc9d1721719ba2f205c351a67 Gerrit-PatchSet: 2 Gerrit-Project: osmo-iuh Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Mon Aug 28 11:00:31 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 28 Aug 2017 11:00:31 +0000 Subject: [PATCH] osmo-mgw[master]: Use release helper from libosmocore In-Reply-To: References: Message-ID: Use release helper from libosmocore See https://osmocom.org/projects/cellular-infrastructure/wiki/Make_a_new_release for details. Change-Id: I0905eeb177185da1e2818a01fdb7265694d9903d Related: OS#1861 --- M Makefile.am M configure.ac 2 files changed, 7 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-mgw refs/changes/13/3713/2 diff --git a/Makefile.am b/Makefile.am index 4a1f65d..536b3f4 100644 --- a/Makefile.am +++ b/Makefile.am @@ -21,6 +21,9 @@ BUILT_SOURCES = $(top_srcdir)/.version EXTRA_DIST = git-version-gen osmoappdesc.py .version + + at RELMAKE@ + $(top_srcdir)/.version: echo $(VERSION) > $@-t && mv $@-t $@ dist-hook: diff --git a/configure.ac b/configure.ac index 871f7e5..b0d6b23 100644 --- a/configure.ac +++ b/configure.ac @@ -12,6 +12,10 @@ 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]) + dnl checks for programs AC_PROG_MAKE_SET AC_PROG_CC -- To view, visit https://gerrit.osmocom.org/3713 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I0905eeb177185da1e2818a01fdb7265694d9903d Gerrit-PatchSet: 2 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Mon Aug 28 11:01:58 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 28 Aug 2017 11:01:58 +0000 Subject: [PATCH] osmo-bsc[master]: Use release helper from libosmocore In-Reply-To: References: Message-ID: Use release helper from libosmocore See https://osmocom.org/projects/cellular-infrastructure/wiki/Make_a_new_release for details. Change-Id: I05bf42d638167c779328fa61b01c917da91a88de Related: OS#1861 --- M Makefile.am M configure.ac 2 files changed, 7 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/10/3710/2 diff --git a/Makefile.am b/Makefile.am index 4a1f65d..536b3f4 100644 --- a/Makefile.am +++ b/Makefile.am @@ -21,6 +21,9 @@ BUILT_SOURCES = $(top_srcdir)/.version EXTRA_DIST = git-version-gen osmoappdesc.py .version + + at RELMAKE@ + $(top_srcdir)/.version: echo $(VERSION) > $@-t && mv $@-t $@ dist-hook: diff --git a/configure.ac b/configure.ac index 871f7e5..b0d6b23 100644 --- a/configure.ac +++ b/configure.ac @@ -12,6 +12,10 @@ 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]) + dnl checks for programs AC_PROG_MAKE_SET AC_PROG_CC -- To view, visit https://gerrit.osmocom.org/3710 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I05bf42d638167c779328fa61b01c917da91a88de Gerrit-PatchSet: 2 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Mon Aug 28 11:03:47 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 28 Aug 2017 11:03:47 +0000 Subject: [PATCH] libosmo-sccp[master]: Use release helper from libosmocore In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3708 to look at the new patch set (#2). Use release helper from libosmocore See https://osmocom.org/projects/cellular-infrastructure/wiki/Make_a_new_release for details. Change-Id: I39b3bfa8a1ccf376215a3ce220cb3cf7a85471cb Related: OS#1861 --- M Makefile.am A TODO-RELEASE M configure.ac 3 files changed, 15 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-sccp refs/changes/08/3708/2 diff --git a/Makefile.am b/Makefile.am index 9bb711c..e2c5277 100644 --- a/Makefile.am +++ b/Makefile.am @@ -8,6 +8,8 @@ EXTRA_DIST = .version doc/examples/osmo-stp.cfg + at RELMAKE@ + BUILT_SOURCES = $(top_srcdir)/.version $(top_srcdir)/.version: echo $(VERSION) > $@-t && mv $@-t $@ diff --git a/TODO-RELEASE b/TODO-RELEASE new file mode 100644 index 0000000..d0852fc --- /dev/null +++ b/TODO-RELEASE @@ -0,0 +1,9 @@ +# When cleaning up this file: bump API version in corresponding Makefile.am and rename corresponding debian/lib*.install +# according to https://www.gnu.org/software/libtool/manual/html_node/Updating-version-info.html#Updating-version-info +# In short: +# LIBVERSION=c:r:a +# If the library source code has changed at all since the last update, then increment revision: c:r + 1:a. +# If any interfaces have been added, removed, or changed since the last update: c + 1:0:0. +# If any interfaces have been added since the last public release: c:r:a + 1. +# If any interfaces have been removed or changed since the last public release: c:r:0. +#library what description / commit summary line diff --git a/configure.ac b/configure.ac index 7e3e03e..ed761c3 100644 --- a/configure.ac +++ b/configure.ac @@ -12,6 +12,10 @@ 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]) + dnl checks for programs AC_PROG_MAKE_SET AC_PROG_CC -- To view, visit https://gerrit.osmocom.org/3708 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I39b3bfa8a1ccf376215a3ce220cb3cf7a85471cb Gerrit-PatchSet: 2 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: dexter From gerrit-no-reply at lists.osmocom.org Mon Aug 28 11:09:41 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 28 Aug 2017 11:09:41 +0000 Subject: [PATCH] openbsc[master]: Use release helper from libosmocore Message-ID: Review at https://gerrit.osmocom.org/3719 Use release helper from libosmocore See https://osmocom.org/projects/cellular-infrastructure/wiki/Make_a_new_release for details. Change-Id: I460fd73230facbba3e326214e46c0b98b7491628 Related: OS#1861 --- M openbsc/Makefile.am M openbsc/configure.ac 2 files changed, 7 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/19/3719/1 diff --git a/openbsc/Makefile.am b/openbsc/Makefile.am index 31a54ea..dc53929 100644 --- a/openbsc/Makefile.am +++ b/openbsc/Makefile.am @@ -20,6 +20,9 @@ BUILT_SOURCES = $(top_srcdir)/.version EXTRA_DIST = git-version-gen osmoappdesc.py .version + + at RELMAKE@ + $(top_srcdir)/.version: echo $(VERSION) > $@-t && mv $@-t $@ dist-hook: diff --git a/openbsc/configure.ac b/openbsc/configure.ac index b155769..48c5c82 100644 --- a/openbsc/configure.ac +++ b/openbsc/configure.ac @@ -12,6 +12,10 @@ 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]) + dnl checks for programs AC_PROG_MAKE_SET AC_PROG_CC -- To view, visit https://gerrit.osmocom.org/3719 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I460fd73230facbba3e326214e46c0b98b7491628 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Mon Aug 28 11:13:01 2017 From: gerrit-no-reply at lists.osmocom.org (Alexander Chemeris) Date: Mon, 28 Aug 2017 11:13:01 +0000 Subject: libosmocore[master]: gsm0480: modify USSD structures to support external handling In-Reply-To: References: Message-ID: Patch Set 2: > Hi Harald, > > Sorry for late response. Regarding to the ABI / API breaking > problem, > we have discussed suggested solution with Alexander: adding an > 'osmo' > prefix that is currently missed for exposed symbols would be great. We may want to change the structure again in near future, e.g. to allow partial message decoding. So I think there should be a more long term sustainable way than adding prefixes. I think incrementing minor library version is a recommended way for libraries? Harald - your input would be greatly appreciated. -- To view, visit https://gerrit.osmocom.org/3374 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I5f8972b86cd4dcb54b643a24b5794a87c8758073 Gerrit-PatchSet: 2 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Alexander Chemeris Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Ivan Kluchnikov Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Vadim Yanitskiy Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Aug 28 11:47:42 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 28 Aug 2017 11:47:42 +0000 Subject: libosmocore[master]: gsm0480: modify USSD structures to support external handling In-Reply-To: References: Message-ID: Patch Set 2: I thought the idea was to use TODO-RELEASE file to track API/ABI breakage until release. I've documented it here https://osmocom.org/projects/cellular-infrastructure/wiki/Make_a_new_release -- To view, visit https://gerrit.osmocom.org/3374 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I5f8972b86cd4dcb54b643a24b5794a87c8758073 Gerrit-PatchSet: 2 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Alexander Chemeris Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Ivan Kluchnikov Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Vadim Yanitskiy Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Aug 28 11:52:48 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 28 Aug 2017 11:52:48 +0000 Subject: libosmocore[master]: gsm0480: drop length check in gsm0480_decode_ss_request() In-Reply-To: References: Message-ID: Patch Set 3: Have a look at tests/ussd/ussd_test - this makes ASAN unhappy about it. -- To view, visit https://gerrit.osmocom.org/3373 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I63b7f8ce403169a9dbdbdb031db16693de2196d6 Gerrit-PatchSet: 3 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Alexander Chemeris Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Aug 28 12:05:08 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 28 Aug 2017 12:05:08 +0000 Subject: [PATCH] osmo-msc[master]: am: msc_vlr_tests: use AM_LDFLAGS instead of COMMON vars Message-ID: Review at https://gerrit.osmocom.org/3720 am: msc_vlr_tests: use AM_LDFLAGS instead of COMMON vars It was a n00b mistake to define COMMON_LDFLAGS and COMMON_LDADD to pass the same linker options to each test binary. Instead, use AM_LDFLAGS and remove the autoreconf warning. Related: OS#2248 Change-Id: I6efae6e192b22de2c1d706edd55385135142532b --- M tests/msc_vlr/Makefile.am 1 file changed, 32 insertions(+), 53 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/20/3720/1 diff --git a/tests/msc_vlr/Makefile.am b/tests/msc_vlr/Makefile.am index 70006dd..fb4857f 100644 --- a/tests/msc_vlr/Makefile.am +++ b/tests/msc_vlr/Makefile.am @@ -18,6 +18,38 @@ $(LIBOSMOLEGACYMGCP_CFLAGS) \ $(NULL) +AM_LDFLAGS = \ + -Wl,--wrap=gsup_client_create \ + -Wl,--wrap=gsup_client_send \ + -Wl,--wrap=a_iface_tx_dtap \ + -Wl,--wrap=a_iface_tx_clear_cmd \ + -Wl,--wrap=a_iface_tx_paging \ + -Wl,--wrap=ranap_iu_tx \ + -Wl,--wrap=ranap_iu_tx_release \ + -Wl,--wrap=ranap_iu_tx_common_id \ + -Wl,--wrap=ranap_iu_page_cs \ + -Wl,--wrap=msc_stop_paging \ + -Wl,--wrap=gsm340_gen_scts \ + -Wl,--wrap=RAND_bytes \ + $(top_builddir)/src/libmsc/libmsc.a \ + $(top_builddir)/src/libcommon-cs/libcommon-cs.a \ + $(top_builddir)/src/libvlr/libvlr.a \ + $(top_builddir)/src/libcommon/libcommon.a \ + $(LIBSMPP34_LIBS) \ + $(LIBOSMOCORE_LIBS) \ + $(LIBOSMOGSM_LIBS) \ + $(LIBCRYPTO_LIBS) \ + $(LIBOSMOVTY_LIBS) \ + $(LIBOSMOABIS_LIBS) \ + $(LIBOSMOSIGTRAN_LIBS) \ + $(LIBOSMORANAP_LIBS) \ + $(LIBASN1C_LIBS) \ + $(LIBOSMOLEGACYMGCP_LIBS) \ + $(LIBRARY_GSM) \ + -ldbi \ + -lrt \ + $(NULL) + noinst_HEADERS = \ msc_vlr_tests.h \ $(NULL) @@ -43,41 +75,6 @@ msc_vlr_test_rest.err \ $(NULL) -COMMON_LDADD = \ - $(top_builddir)/src/libmsc/libmsc.a \ - $(top_builddir)/src/libcommon-cs/libcommon-cs.a \ - $(top_builddir)/src/libvlr/libvlr.a \ - $(top_builddir)/src/libcommon/libcommon.a \ - $(LIBSMPP34_LIBS) \ - $(LIBOSMOCORE_LIBS) \ - $(LIBOSMOGSM_LIBS) \ - $(LIBCRYPTO_LIBS) \ - $(LIBOSMOVTY_LIBS) \ - $(LIBOSMOABIS_LIBS) \ - $(LIBOSMOSIGTRAN_LIBS) \ - $(LIBOSMORANAP_LIBS) \ - $(LIBASN1C_LIBS) \ - $(LIBOSMOLEGACYMGCP_LIBS) \ - $(LIBRARY_GSM) \ - -ldbi \ - -lrt \ - $(NULL) - -COMMON_LDFLAGS = \ - -Wl,--wrap=gsup_client_create \ - -Wl,--wrap=gsup_client_send \ - -Wl,--wrap=a_iface_tx_dtap \ - -Wl,--wrap=a_iface_tx_clear_cmd \ - -Wl,--wrap=a_iface_tx_paging \ - -Wl,--wrap=ranap_iu_tx \ - -Wl,--wrap=ranap_iu_tx_release \ - -Wl,--wrap=ranap_iu_tx_common_id \ - -Wl,--wrap=ranap_iu_page_cs \ - -Wl,--wrap=msc_stop_paging \ - -Wl,--wrap=gsm340_gen_scts \ - -Wl,--wrap=RAND_bytes \ - $(NULL) - noinst_PROGRAMS = \ msc_vlr_test_no_authen \ msc_vlr_test_gsm_authen \ @@ -94,64 +91,46 @@ msc_vlr_test_no_authen.c \ msc_vlr_tests.c \ $(NULL) -msc_vlr_test_no_authen_LDADD = $(COMMON_LDADD) -msc_vlr_test_no_authen_LDFLAGS = $(COMMON_LDFLAGS) msc_vlr_test_gsm_authen_SOURCES = \ msc_vlr_test_gsm_authen.c \ msc_vlr_tests.c \ $(NULL) -msc_vlr_test_gsm_authen_LDADD = $(COMMON_LDADD) -msc_vlr_test_gsm_authen_LDFLAGS = $(COMMON_LDFLAGS) msc_vlr_test_gsm_ciph_SOURCES = \ msc_vlr_test_gsm_ciph.c \ msc_vlr_tests.c \ $(NULL) -msc_vlr_test_gsm_ciph_LDADD = $(COMMON_LDADD) -msc_vlr_test_gsm_ciph_LDFLAGS = $(COMMON_LDFLAGS) msc_vlr_test_umts_authen_SOURCES = \ msc_vlr_test_umts_authen.c \ msc_vlr_tests.c \ $(NULL) -msc_vlr_test_umts_authen_LDADD = $(COMMON_LDADD) -msc_vlr_test_umts_authen_LDFLAGS = $(COMMON_LDFLAGS) msc_vlr_test_hlr_reject_SOURCES = \ msc_vlr_test_hlr_reject.c \ msc_vlr_tests.c \ $(NULL) -msc_vlr_test_hlr_reject_LDADD = $(COMMON_LDADD) -msc_vlr_test_hlr_reject_LDFLAGS = $(COMMON_LDFLAGS) msc_vlr_test_hlr_timeout_SOURCES = \ msc_vlr_test_hlr_timeout.c \ msc_vlr_tests.c \ $(NULL) -msc_vlr_test_hlr_timeout_LDADD = $(COMMON_LDADD) -msc_vlr_test_hlr_timeout_LDFLAGS = $(COMMON_LDFLAGS) msc_vlr_test_ms_timeout_SOURCES = \ msc_vlr_test_ms_timeout.c \ msc_vlr_tests.c \ $(NULL) -msc_vlr_test_ms_timeout_LDADD = $(COMMON_LDADD) -msc_vlr_test_ms_timeout_LDFLAGS = $(COMMON_LDFLAGS) msc_vlr_test_reject_concurrency_SOURCES = \ msc_vlr_test_reject_concurrency.c \ msc_vlr_tests.c \ $(NULL) -msc_vlr_test_reject_concurrency_LDADD = $(COMMON_LDADD) -msc_vlr_test_reject_concurrency_LDFLAGS = $(COMMON_LDFLAGS) msc_vlr_test_rest_SOURCES = \ msc_vlr_test_rest.c \ msc_vlr_tests.c \ $(NULL) -msc_vlr_test_rest_LDADD = $(COMMON_LDADD) -msc_vlr_test_rest_LDFLAGS = $(COMMON_LDFLAGS) .PHONY: update_exp update_exp: -- To view, visit https://gerrit.osmocom.org/3720 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I6efae6e192b22de2c1d706edd55385135142532b Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Mon Aug 28 12:34:02 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Mon, 28 Aug 2017 12:34:02 +0000 Subject: [PATCH] osmo-gsm-tester[master]: resource: Fix list comparison in item_matches Message-ID: Review at https://gerrit.osmocom.org/3721 resource: Fix list comparison in item_matches Change-Id: I27b372aa5906feac2843f24f5cdd0d9578d44b4d --- M src/osmo_gsm_tester/resource.py 1 file changed, 5 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-tester refs/changes/21/3721/1 diff --git a/src/osmo_gsm_tester/resource.py b/src/osmo_gsm_tester/resource.py index c55140a..da543f7 100644 --- a/src/osmo_gsm_tester/resource.py +++ b/src/osmo_gsm_tester/resource.py @@ -441,9 +441,12 @@ return True if is_list(wanted_item): - # multiple possible values - if item not in wanted_item: + if not is_list(item): return False + # multiple possible values + for val in wanted_item: + if val not in item: + return False return True return item == wanted_item -- To view, visit https://gerrit.osmocom.org/3721 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I27b372aa5906feac2843f24f5cdd0d9578d44b4d Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Mon Aug 28 12:34:04 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Mon, 28 Aug 2017 12:34:04 +0000 Subject: [PATCH] osmo-gsm-tester[master]: config: Fix combination of lists Message-ID: Review at https://gerrit.osmocom.org/3722 config: Fix combination of lists It can make sense to recursively call combine() for a list containing complex structures like dictionaries or lists. However, for a list of simple types (eg. integers or strings), we just want to merge both lists and we only need to check if the value is already there. This case won't work if we call combine for each element of the list because for a simple case it will just end up checking if a[i] == b[i]. Change-Id: Ib7a38f10eb9de338a77bf1fa3afceb9df1532015 --- M src/osmo_gsm_tester/config.py 1 file changed, 5 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-tester refs/changes/22/3722/1 diff --git a/src/osmo_gsm_tester/config.py b/src/osmo_gsm_tester/config.py index f6e81ac..392cd04 100644 --- a/src/osmo_gsm_tester/config.py +++ b/src/osmo_gsm_tester/config.py @@ -246,7 +246,11 @@ raise ValueError('cannot combine list with a value of type: %r' % type(src)) for i in range(len(src)): log.ctx(idx=i) - combine(dest[i], src[i]) + assert type(dest[i]) == type(src[i]) + if is_dict(dest[i]) or is_list(dest[i]): + combine(dest[i], src[i]) + elif src[i] not in dest: + dest.append(src[i]) return if dest == src: return -- To view, visit https://gerrit.osmocom.org/3722 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ib7a38f10eb9de338a77bf1fa3afceb9df1532015 Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Mon Aug 28 12:34:04 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Mon, 28 Aug 2017 12:34:04 +0000 Subject: [PATCH] osmo-gsm-tester[master]: Add cipher cfg param for modem and bts Message-ID: Review at https://gerrit.osmocom.org/3723 Add cipher cfg param for modem and bts This parameter is contains a list of supported encryption ciphers by the modem or bts setting it. It is so far not directly/automatically used inside osmo-gsm-tester code, but can be useful to create scenarios for tests that require specific ciphering modes. For instance, aoip_encryption suite contains tests that require a BTS and a modem that supports a5 0 and a5 1, otherwise tests will fail. Change-Id: Ic0e368843a6e58bd3eeef36d2c0a7501296f0f3e --- M example/default-suites.conf M example/resources.conf A example/scenarios/cipher-a50.conf A example/scenarios/cipher-a51.conf M src/osmo_gsm_tester/resource.py M src/osmo_gsm_tester/schema.py 6 files changed, 45 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-tester refs/changes/23/3723/1 diff --git a/example/default-suites.conf b/example/default-suites.conf index 0198486..1e8d47a 100644 --- a/example/default-suites.conf +++ b/example/default-suites.conf @@ -6,4 +6,4 @@ - aoip_sms:trx-sysmocell5000 - smpp - aoip_smpp -- aoip_encryption +- aoip_encryption:cipher-a50+cipher-a51 diff --git a/example/resources.conf b/example/resources.conf index f190c2f..51f5a72 100644 --- a/example/resources.conf +++ b/example/resources.conf @@ -13,6 +13,9 @@ ipa_unit_id: 1 addr: 10.42.42.114 band: GSM-1800 + ciphers: + - 'a5 0' + - 'a5 1' - label: Ettus B200 type: osmo-bts-trx @@ -20,6 +23,9 @@ addr: 10.42.42.50 band: GSM-1800 launch_trx: true + ciphers: + - 'a5 0' + - 'a5 1' - label: sysmoCell 5000 type: osmo-bts-trx @@ -27,6 +33,9 @@ addr: 10.42.42.51 band: GSM-1800 trx_remote_ip: 10.42.42.112 + ciphers: + - 'a5 0' + - 'a5 1' arfcn: - arfcn: 512 @@ -56,21 +65,33 @@ imsi: '901700000009031' ki: '80A37E6FDEA931EAC92FFA5F671EFEAD' auth_algo: 'xor' + ciphers: + - 'a5 0' + - 'a5 1' - label: sierra_2 path: '/sierra_2' imsi: '901700000009029' ki: '00969E283349D354A8239E877F2E0866' auth_algo: 'xor' + ciphers: + - 'a5 0' + - 'a5 1' - label: gobi_0 path: '/gobi_0' imsi: '901700000009030' ki: 'BB70807226393CDBAC8DD3439FF54252' auth_algo: 'xor' + ciphers: + - 'a5 0' + - 'a5 1' - label: gobi_3 path: '/gobi_3' imsi: '901700000009032' ki: '2F70DCA43C45ACB97E947FDD0C7CA30A' auth_algo: 'xor' + ciphers: + - 'a5 0' + - 'a5 1' diff --git a/example/scenarios/cipher-a50.conf b/example/scenarios/cipher-a50.conf new file mode 100644 index 0000000..d4a2e46 --- /dev/null +++ b/example/scenarios/cipher-a50.conf @@ -0,0 +1,7 @@ +resources: + bts: + - ciphers: + - 'a5 0' + modem: + - ciphers: + - 'a5 0' diff --git a/example/scenarios/cipher-a51.conf b/example/scenarios/cipher-a51.conf new file mode 100644 index 0000000..c84cd96 --- /dev/null +++ b/example/scenarios/cipher-a51.conf @@ -0,0 +1,7 @@ +resources: + bts: + - ciphers: + - 'a5 1' + modem: + - ciphers: + - 'a5 1' diff --git a/src/osmo_gsm_tester/resource.py b/src/osmo_gsm_tester/resource.py index da543f7..4f43bfc 100644 --- a/src/osmo_gsm_tester/resource.py +++ b/src/osmo_gsm_tester/resource.py @@ -56,6 +56,7 @@ 'bts[].band': schema.BAND, 'bts[].trx_remote_ip': schema.IPV4, 'bts[].launch_trx': schema.BOOL_STR, + 'bts[].ciphers[]': schema.CIPHER, 'bts[].trx_list[].hw_addr': schema.HWADDR, 'bts[].trx_list[].net_device': schema.STR, 'arfcn[].arfcn': schema.INT, @@ -65,6 +66,7 @@ 'modem[].imsi': schema.IMSI, 'modem[].ki': schema.KI, 'modem[].auth_algo': schema.AUTH_ALGO, + 'modem[].ciphers[]': schema.CIPHER, } WANT_SCHEMA = util.dict_add( diff --git a/src/osmo_gsm_tester/schema.py b/src/osmo_gsm_tester/schema.py index 2da80cd..86acbad 100644 --- a/src/osmo_gsm_tester/schema.py +++ b/src/osmo_gsm_tester/schema.py @@ -66,6 +66,11 @@ return raise ValueError('Unknown Authentication Algorithm: %r' % val) +def cipher(val): + if val in ('a5 0', 'a5 1', 'a5 2', 'a5 3'): + return + raise ValueError('Unknown Cipher value: %r' % val) + INT = 'int' STR = 'str' BOOL_STR = 'bool_str' @@ -76,6 +81,7 @@ KI = 'ki' MSISDN = 'msisdn' AUTH_ALGO = 'auth_algo' +CIPHER = 'cipher' SCHEMA_TYPES = { INT: int, STR: str, @@ -87,6 +93,7 @@ KI: ki, MSISDN: msisdn, AUTH_ALGO: auth_algo, + CIPHER: cipher, } def validate(config, schema): -- To view, visit https://gerrit.osmocom.org/3723 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ic0e368843a6e58bd3eeef36d2c0a7501296f0f3e Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Mon Aug 28 12:34:05 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Mon, 28 Aug 2017 12:34:05 +0000 Subject: [PATCH] osmo-gsm-tester[master]: resource_test: update to check list features (ciphers) Message-ID: Review at https://gerrit.osmocom.org/3724 resource_test: update to check list features (ciphers) Change-Id: I532f66585ab6f7be1a71853190791feeecbf263c --- M selftest/conf/resources.conf M selftest/resource_test.ok M selftest/resource_test.py 3 files changed, 183 insertions(+), 238 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-tester refs/changes/24/3724/1 diff --git a/selftest/conf/resources.conf b/selftest/conf/resources.conf index 2005590..51f5a72 100644 --- a/selftest/conf/resources.conf +++ b/selftest/conf/resources.conf @@ -1,32 +1,41 @@ # all hardware and interfaces available to this osmo-gsm-tester ip_address: -- addr: 10.42.42.1 - addr: 10.42.42.2 - addr: 10.42.42.3 +- addr: 10.42.42.4 +- addr: 10.42.42.5 +- addr: 10.42.42.6 bts: - label: sysmoBTS 1002 - type: sysmo + type: osmo-bts-sysmo ipa_unit_id: 1 addr: 10.42.42.114 band: GSM-1800 + ciphers: + - 'a5 0' + - 'a5 1' -- label: octBTS 3000 - type: oct - ipa_unit_id: 5 - addr: 10.42.42.115 +- label: Ettus B200 + type: osmo-bts-trx + ipa_unit_id: 6 + addr: 10.42.42.50 band: GSM-1800 - trx_list: - - hw_addr: 00:0c:90:32:b5:8a + launch_trx: true + ciphers: + - 'a5 0' + - 'a5 1' -- label: nanoBTS 1900 - type: nanobts - ipa_unit_id: 1902 - addr: 10.42.42.190 - band: GSM-1900 - trx_list: - - hw_addr: 00:02:95:00:41:b3 +- label: sysmoCell 5000 + type: osmo-bts-trx + ipa_unit_id: 7 + addr: 10.42.42.51 + band: GSM-1800 + trx_remote_ip: 10.42.42.112 + ciphers: + - 'a5 0' + - 'a5 1' arfcn: - arfcn: 512 @@ -39,7 +48,6 @@ band: GSM-1800 - arfcn: 520 band: GSM-1800 - - arfcn: 540 band: GSM-1900 - arfcn: 542 @@ -52,82 +60,38 @@ band: GSM-1900 modem: -- label: m7801 - path: '/wavecom_0' - imsi: 901700000007801 - ki: D620F48487B1B782DA55DF6717F08FF9 +- label: sierra_1 + path: '/sierra_1' + imsi: '901700000009031' + ki: '80A37E6FDEA931EAC92FFA5F671EFEAD' + auth_algo: 'xor' + ciphers: + - 'a5 0' + - 'a5 1' -- label: m7802 - path: '/wavecom_1' - imsi: 901700000007802 - ki: 47FDB2D55CE6A10A85ABDAD034A5B7B3 +- label: sierra_2 + path: '/sierra_2' + imsi: '901700000009029' + ki: '00969E283349D354A8239E877F2E0866' + auth_algo: 'xor' + ciphers: + - 'a5 0' + - 'a5 1' -- label: m7803 - path: '/wavecom_2' - imsi: 901700000007803 - ki: ABBED4C91417DF710F60675B6EE2C8D2 +- label: gobi_0 + path: '/gobi_0' + imsi: '901700000009030' + ki: 'BB70807226393CDBAC8DD3439FF54252' + auth_algo: 'xor' + ciphers: + - 'a5 0' + - 'a5 1' -- label: m7804 - path: '/wavecom_3' - imsi: 901700000007804 - ki: 8BA541179156F2BF0918CA3CFF9351B0 - -- label: m7805 - path: '/wavecom_4' - imsi: 901700000007805 - ki: 82BEC24B5B50C9FAA69D17DEC0883A23 - -- label: m7806 - path: '/wavecom_5' - imsi: 901700000007806 - ki: DAF6BD6A188F7A4F09866030BF0F723D - -- label: m7807 - path: '/wavecom_6' - imsi: 901700000007807 - ki: AEB411CFE39681A6352A1EAE4DDC9DBA - -- label: m7808 - path: '/wavecom_7' - imsi: 901700000007808 - ki: F5DEF8692B305D7A65C677CA9EEE09C4 - -- label: m7809 - path: '/wavecom_8' - imsi: 901700000007809 - ki: A644F4503E812FD75329B1C8D625DA44 - -- label: m7810 - path: '/wavecom_9' - imsi: 901700000007810 - ki: EF663BDF3477DCD18D3D2293A2BAED67 - -- label: m7811 - path: '/wavecom_10' - imsi: 901700000007811 - ki: E88F37F048A86A9BC4D652539228C039 - -- label: m7812 - path: '/wavecom_11' - imsi: 901700000007812 - ki: E8D940DD66FCF6F1CD2C0F8F8C45633D - -- label: m7813 - path: '/wavecom_12' - imsi: 901700000007813 - ki: DBF534700C10141C49F699B0419107E3 - -- label: m7814 - path: '/wavecom_13' - imsi: 901700000007814 - ki: B36021DEB90C4EA607E408A92F3B024D - -- label: m7815 - path: '/wavecom_14' - imsi: 901700000007815 - ki: 1E209F6F839F9195778C4F96BE281A24 - -- label: m7816 - path: '/wavecom_15' - imsi: 901700000007816 - ki: BF827D219E739DD189F6F59E60D6455C +- label: gobi_3 + path: '/gobi_3' + imsi: '901700000009032' + ki: '2F70DCA43C45ACB97E947FDD0C7CA30A' + auth_algo: 'xor' + ciphers: + - 'a5 0' + - 'a5 1' diff --git a/selftest/resource_test.ok b/selftest/resource_test.ok index d366cf9..88ff588 100644 --- a/selftest/resource_test.ok +++ b/selftest/resource_test.ok @@ -46,112 +46,67 @@ {'_hash': 'dc9ce027a257da087f31a5bc1ee6b4abd2637369', 'arfcn': '548', 'band': 'GSM-1900'}], - 'bts': [{'_hash': '07d9c8aaa940b674efcbbabdd69f58a6ce4e94f9', + 'bts': [{'_hash': 'f153f466355087b1a838a7aaa8f6f707de1e8925', 'addr': '10.42.42.114', 'band': 'GSM-1800', + 'ciphers': ['a5 0', 'a5 1'], 'ipa_unit_id': '1', 'label': 'sysmoBTS 1002', - 'type': 'sysmo'}, - {'_hash': '76c8d2f459113cd6c99ed62d1a94bbe9a291ba94', - 'addr': '10.42.42.115', + 'type': 'osmo-bts-sysmo'}, + {'_hash': '3343d4cf95efae02644ecb5870417c26830107dc', + 'addr': '10.42.42.50', 'band': 'GSM-1800', - 'ipa_unit_id': '5', - 'label': 'octBTS 3000', - 'trx_list': [{'hw_addr': '00:0c:90:32:b5:8a'}], - 'type': 'oct'}, - {'_hash': '0b7fabd512b36aec43d7d496abd00af4e193b0f8', - 'addr': '10.42.42.190', - 'band': 'GSM-1900', - 'ipa_unit_id': '1902', - 'label': 'nanoBTS 1900', - 'trx_list': [{'hw_addr': '00:02:95:00:41:b3'}], - 'type': 'nanobts'}], - 'ip_address': [{'_hash': 'cde1debf28f07f94f92c761b4b7c6bf35785ced4', - 'addr': '10.42.42.1'}, - {'_hash': 'fd103b22c7cf2480d609150e06f4bbd92ac78d8c', + 'ciphers': ['a5 0', 'a5 1'], + 'ipa_unit_id': '6', + 'label': 'Ettus B200', + 'launch_trx': 'True', + 'type': 'osmo-bts-trx'}, + {'_hash': 'f6faf75c74c240af32658b54123edca33e30498e', + 'addr': '10.42.42.51', + 'band': 'GSM-1800', + 'ciphers': ['a5 0', 'a5 1'], + 'ipa_unit_id': '7', + 'label': 'sysmoCell 5000', + 'trx_remote_ip': '10.42.42.112', + 'type': 'osmo-bts-trx'}], + 'ip_address': [{'_hash': 'fd103b22c7cf2480d609150e06f4bbd92ac78d8c', 'addr': '10.42.42.2'}, {'_hash': '1c614d6210c551d142aadca8f25e1534ebb2a70f', - 'addr': '10.42.42.3'}], - 'modem': [{'_hash': '19c69e45aa090fb511446bd00797690aa82ff52f', - 'imsi': '901700000007801', - 'ki': 'D620F48487B1B782DA55DF6717F08FF9', - 'label': 'm7801', - 'path': '/wavecom_0'}, - {'_hash': 'e1a46516a1fb493b2617ab14fc1693a9a45ec254', - 'imsi': '901700000007802', - 'ki': '47FDB2D55CE6A10A85ABDAD034A5B7B3', - 'label': 'm7802', - 'path': '/wavecom_1'}, - {'_hash': '4fe91500a309782bb0fd8ac6fc827834089f8b00', - 'imsi': '901700000007803', - 'ki': 'ABBED4C91417DF710F60675B6EE2C8D2', - 'label': 'm7803', - 'path': '/wavecom_2'}, - {'_hash': 'c895badf0c2faaa4a997cd9f2313b5ebda7486e4', - 'imsi': '901700000007804', - 'ki': '8BA541179156F2BF0918CA3CFF9351B0', - 'label': 'm7804', - 'path': '/wavecom_3'}, - {'_hash': '60f182abed05adb530e3d06d88cc47703b65d7d8', - 'imsi': '901700000007805', - 'ki': '82BEC24B5B50C9FAA69D17DEC0883A23', - 'label': 'm7805', - 'path': '/wavecom_4'}, - {'_hash': 'd1f0fbf089a4bf32dd566af956d23b89e3d60821', - 'imsi': '901700000007806', - 'ki': 'DAF6BD6A188F7A4F09866030BF0F723D', - 'label': 'm7806', - 'path': '/wavecom_5'}, - {'_hash': '2445e3b5949d15f4351c0db1d3f3f593f9d73aa5', - 'imsi': '901700000007807', - 'ki': 'AEB411CFE39681A6352A1EAE4DDC9DBA', - 'label': 'm7807', - 'path': '/wavecom_6'}, - {'_hash': '80247388b2ca382382c4aec678102355b7922965', - 'imsi': '901700000007808', - 'ki': 'F5DEF8692B305D7A65C677CA9EEE09C4', - 'label': 'm7808', - 'path': '/wavecom_7'}, - {'_hash': '5b9e4e117a8889430542d22a9693e7b999362856', - 'imsi': '901700000007809', - 'ki': 'A644F4503E812FD75329B1C8D625DA44', - 'label': 'm7809', - 'path': '/wavecom_8'}, - {'_hash': '219a7abb057050eef3ce4b99c487f32bbaae9a41', - 'imsi': '901700000007810', - 'ki': 'EF663BDF3477DCD18D3D2293A2BAED67', - 'label': 'm7810', - 'path': '/wavecom_9'}, - {'_hash': '75d45c2d975b893da34c7cae827c25a2039cecd2', - 'imsi': '901700000007811', - 'ki': 'E88F37F048A86A9BC4D652539228C039', - 'label': 'm7811', - 'path': '/wavecom_10'}, - {'_hash': '1777362f556b249a5c1d6a83110704dbd037bc20', - 'imsi': '901700000007812', - 'ki': 'E8D940DD66FCF6F1CD2C0F8F8C45633D', - 'label': 'm7812', - 'path': '/wavecom_11'}, - {'_hash': '21d7eb4b0c782e004821a9f7f778891c93956924', - 'imsi': '901700000007813', - 'ki': 'DBF534700C10141C49F699B0419107E3', - 'label': 'm7813', - 'path': '/wavecom_12'}, - {'_hash': 'f53e4e79bdbc63eb2845de671007d4f733f28409', - 'imsi': '901700000007814', - 'ki': 'B36021DEB90C4EA607E408A92F3B024D', - 'label': 'm7814', - 'path': '/wavecom_13'}, - {'_hash': 'df1abec7704ebc89b2c062a69bd299cf3663ed9e', - 'imsi': '901700000007815', - 'ki': '1E209F6F839F9195778C4F96BE281A24', - 'label': 'm7815', - 'path': '/wavecom_14'}, - {'_hash': '11df1e4c7708157e5b89020c757763f58d6e610b', - 'imsi': '901700000007816', - 'ki': 'BF827D219E739DD189F6F59E60D6455C', - 'label': 'm7816', - 'path': '/wavecom_15'}]} + 'addr': '10.42.42.3'}, + {'_hash': '862b529c701adf302477bc126a8032cfc2ec4753', + 'addr': '10.42.42.4'}, + {'_hash': '05feb6e1e24ca4235889eb28d0a8d5cedac6e5d1', + 'addr': '10.42.42.5'}, + {'_hash': 'e780ac7581ad29f8f46e637b61d0c38898c4c52c', + 'addr': '10.42.42.6'}], + 'modem': [{'_hash': '7ae717cefe8c2b4d471a6c3143e6fa28f3b77955', + 'auth_algo': 'xor', + 'ciphers': ['a5 0', 'a5 1'], + 'imsi': '901700000009031', + 'ki': '80A37E6FDEA931EAC92FFA5F671EFEAD', + 'label': 'sierra_1', + 'path': '/sierra_1'}, + {'_hash': '62e01fd129a58cfe194886cf8098abf966018fa6', + 'auth_algo': 'xor', + 'ciphers': ['a5 0', 'a5 1'], + 'imsi': '901700000009029', + 'ki': '00969E283349D354A8239E877F2E0866', + 'label': 'sierra_2', + 'path': '/sierra_2'}, + {'_hash': 'a1814c31ef0bca596d33fd0f83831273d39e9809', + 'auth_algo': 'xor', + 'ciphers': ['a5 0', 'a5 1'], + 'imsi': '901700000009030', + 'ki': 'BB70807226393CDBAC8DD3439FF54252', + 'label': 'gobi_0', + 'path': '/gobi_0'}, + {'_hash': '09851d9be2fef3ea9697fbb84dbc6bc11c2c0fd4', + 'auth_algo': 'xor', + 'ciphers': ['a5 0', 'a5 1'], + 'imsi': '901700000009032', + 'ki': '2F70DCA43C45ACB97E947FDD0C7CA30A', + 'label': 'gobi_3', + 'path': '/gobi_3'}]} *** end: all resources - request some resources @@ -163,34 +118,47 @@ arfcn: '514' band: GSM-1800 --- testowner: Reserving 2 x bts (candidates: 3) ---- testowner: DBG: Picked - _hash: 07d9c8aaa940b674efcbbabdd69f58a6ce4e94f9 +--- testowner: DBG: Picked - _hash: f153f466355087b1a838a7aaa8f6f707de1e8925 addr: 10.42.42.114 band: GSM-1800 + ciphers: + - a5 0 + - a5 1 ipa_unit_id: '1' label: sysmoBTS 1002 - type: sysmo -- _hash: 76c8d2f459113cd6c99ed62d1a94bbe9a291ba94 - addr: 10.42.42.115 + type: osmo-bts-sysmo +- _hash: 3343d4cf95efae02644ecb5870417c26830107dc + addr: 10.42.42.50 band: GSM-1800 - ipa_unit_id: '5' - label: octBTS 3000 - trx_list: - - hw_addr: 00:0c:90:32:b5:8a - type: oct ---- testowner: Reserving 1 x ip_address (candidates: 3) ---- testowner: DBG: Picked - _hash: cde1debf28f07f94f92c761b4b7c6bf35785ced4 - addr: 10.42.42.1 ---- testowner: Reserving 2 x modem (candidates: 16) ---- testowner: DBG: Picked - _hash: 19c69e45aa090fb511446bd00797690aa82ff52f - imsi: '901700000007801' - ki: D620F48487B1B782DA55DF6717F08FF9 - label: m7801 - path: /wavecom_0 -- _hash: e1a46516a1fb493b2617ab14fc1693a9a45ec254 - imsi: '901700000007802' - ki: 47FDB2D55CE6A10A85ABDAD034A5B7B3 - label: m7802 - path: /wavecom_1 + ciphers: + - a5 0 + - a5 1 + ipa_unit_id: '6' + label: Ettus B200 + launch_trx: 'True' + type: osmo-bts-trx +--- testowner: Reserving 1 x ip_address (candidates: 5) +--- testowner: DBG: Picked - _hash: fd103b22c7cf2480d609150e06f4bbd92ac78d8c + addr: 10.42.42.2 +--- testowner: Reserving 2 x modem (candidates: 4) +--- testowner: DBG: Picked - _hash: 7ae717cefe8c2b4d471a6c3143e6fa28f3b77955 + auth_algo: xor + ciphers: + - a5 0 + - a5 1 + imsi: '901700000009031' + ki: 80A37E6FDEA931EAC92FFA5F671EFEAD + label: sierra_1 + path: /sierra_1 +- _hash: 62e01fd129a58cfe194886cf8098abf966018fa6 + auth_algo: xor + ciphers: + - a5 0 + - a5 1 + imsi: '901700000009029' + ki: 00969E283349D354A8239E877F2E0866 + label: sierra_2 + path: /sierra_2 ~~~ currently reserved: arfcn: - _hash: e620569450f8259b3f0212ec19c285dd07df063c @@ -202,39 +170,52 @@ arfcn: '514' band: GSM-1800 bts: -- _hash: 07d9c8aaa940b674efcbbabdd69f58a6ce4e94f9 +- _hash: f153f466355087b1a838a7aaa8f6f707de1e8925 _reserved_by: testowner-123-1490837279 addr: 10.42.42.114 band: GSM-1800 + ciphers: + - a5 0 + - a5 1 ipa_unit_id: '1' label: sysmoBTS 1002 - type: sysmo -- _hash: 76c8d2f459113cd6c99ed62d1a94bbe9a291ba94 + type: osmo-bts-sysmo +- _hash: 3343d4cf95efae02644ecb5870417c26830107dc _reserved_by: testowner-123-1490837279 - addr: 10.42.42.115 + addr: 10.42.42.50 band: GSM-1800 - ipa_unit_id: '5' - label: octBTS 3000 - trx_list: - - hw_addr: 00:0c:90:32:b5:8a - type: oct + ciphers: + - a5 0 + - a5 1 + ipa_unit_id: '6' + label: Ettus B200 + launch_trx: 'True' + type: osmo-bts-trx ip_address: -- _hash: cde1debf28f07f94f92c761b4b7c6bf35785ced4 +- _hash: fd103b22c7cf2480d609150e06f4bbd92ac78d8c _reserved_by: testowner-123-1490837279 - addr: 10.42.42.1 + addr: 10.42.42.2 modem: -- _hash: 19c69e45aa090fb511446bd00797690aa82ff52f +- _hash: 7ae717cefe8c2b4d471a6c3143e6fa28f3b77955 _reserved_by: testowner-123-1490837279 - imsi: '901700000007801' - ki: D620F48487B1B782DA55DF6717F08FF9 - label: m7801 - path: /wavecom_0 -- _hash: e1a46516a1fb493b2617ab14fc1693a9a45ec254 + auth_algo: xor + ciphers: + - a5 0 + - a5 1 + imsi: '901700000009031' + ki: 80A37E6FDEA931EAC92FFA5F671EFEAD + label: sierra_1 + path: /sierra_1 +- _hash: 62e01fd129a58cfe194886cf8098abf966018fa6 _reserved_by: testowner-123-1490837279 - imsi: '901700000007802' - ki: 47FDB2D55CE6A10A85ABDAD034A5B7B3 - label: m7802 - path: /wavecom_1 + auth_algo: xor + ciphers: + - a5 0 + - a5 1 + imsi: '901700000009029' + ki: 00969E283349D354A8239E877F2E0866 + label: sierra_2 + path: /sierra_2 ~~~ end: currently reserved diff --git a/selftest/resource_test.py b/selftest/resource_test.py index a0ec490..a39847c 100755 --- a/selftest/resource_test.py +++ b/selftest/resource_test.py @@ -37,7 +37,7 @@ try: resource.solve([ [0, 2], [2], - [0, 2] ]) + [0, 2] ]) assert False except resource.NotSolvable as e: print(e) @@ -73,9 +73,9 @@ print('- request some resources') want = { 'ip_address': [ { 'times': 1 } ], - 'bts': [ { 'type': 'sysmo', 'times': 1 }, { 'type': 'oct', 'times': 1 } ], + 'bts': [ { 'type': 'osmo-bts-sysmo', 'times': 1 , 'ciphers': ['a5 1']}, { 'type': 'osmo-bts-trx', 'times': 1 } ], 'arfcn': [ { 'band': 'GSM-1800', 'times': 2 } ], - 'modem': [ { 'times': 2 } ], + 'modem': [ { 'times': 2 , 'ciphers': ['a5 0', 'a5 1']} ], } origin = log.Origin(None, 'testowner') -- To view, visit https://gerrit.osmocom.org/3724 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I532f66585ab6f7be1a71853190791feeecbf263c Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Mon Aug 28 12:55:11 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 28 Aug 2017 12:55:11 +0000 Subject: [PATCH] osmo-mgw[master]: NOT FOR MERGE: check pre_release branch build Message-ID: Review at https://gerrit.osmocom.org/3725 NOT FOR MERGE: check pre_release branch build Change-Id: I0632f1846563efc7d1968632cb0f3582a301b426 --- M .gitignore M Makefile.am M configure.ac D contrib/a-link/sccp-split-by-con.lua D contrib/bsc-test/README D contrib/bsc-test/all_dial D contrib/bsc-test/dial.sh D contrib/bsc-test/drop-oml.sh D contrib/bsc-test/drop.sh D contrib/bsc-test/hangup D contrib/bsc-test/msc.sh D contrib/bsc_control.py D contrib/bt.py D contrib/convert_to_enum.py D contrib/ctrl2sse.py D contrib/gprs/gb-proxy-unblock-bug.py D contrib/gprs/gprs-bssgp-histogram.lua D contrib/gprs/gprs-buffer-count.lua D contrib/gprs/gprs-split-trace-by-tlli.lua D contrib/gprs/gprs-verify-nu.lua D contrib/hlr-remove-old.sql D contrib/hlrsync/hlrsync.py D contrib/ipa.py M contrib/jenkins.sh D contrib/nat/test_regexp.c D contrib/nat/ussd_example.py D contrib/rtp/gen_rtp_header.erl D contrib/rtp/rtp_replay.st D contrib/rtp/rtp_replay_shared.st D contrib/rtp/rtp_replay_sip.st D contrib/rtp/timestamp_rtp.lua D contrib/sms/fill-hlr.st D contrib/sms/hlr-query.st D contrib/sms/sqlite-probe.tap.d D contrib/soap.py D contrib/systemd/osmo-bsc.service D contrib/systemd/osmo-gbproxy.service D contrib/systemd/osmo-msc.service D contrib/systemd/osmo-nitb.service D contrib/systemd/osmo-sgsn.service D contrib/testconv/Makefile D contrib/testconv/testconv_main.c D contrib/twisted_ipa.py D debian/autoreconf M debian/changelog M debian/control M debian/copyright D debian/docs A debian/libosmo-legacy-mgcp-dev.install A debian/libosmo-legacy-mgcp0.install D debian/openbsc-dev.install D debian/osmo-gtphub.default D debian/osmo-gtphub.examples D debian/osmo-gtphub.init D debian/osmo-gtphub.install A debian/osmo-mgw.install D debian/osmocom-bs11-utils.install D debian/osmocom-bsc-nat.init D debian/osmocom-bsc-nat.install D debian/osmocom-bsc.examples D debian/osmocom-bsc.install D debian/osmocom-gbproxy.init D debian/osmocom-gbproxy.install D debian/osmocom-ipaccess-utils.install D debian/osmocom-nitb.default D debian/osmocom-nitb.dirs D debian/osmocom-nitb.examples D debian/osmocom-nitb.init D debian/osmocom-nitb.install D debian/osmocom-sgsn.default D debian/osmocom-sgsn.examples D debian/osmocom-sgsn.init D debian/osmocom-sgsn.install M debian/rules M doc/examples/osmo-bsc/osmo-bsc.cfg M doc/examples/osmo-sgsn/osmo-sgsn.cfg M include/Makefile.am D include/compat_af_isdn.h D include/mISDNif.h D include/openbsc/Makefile.am D include/openbsc/abis_nm.h D include/openbsc/abis_om2000.h D include/openbsc/abis_rsl.h D include/openbsc/arfcn_range_encode.h D include/openbsc/auth.h D include/openbsc/bsc_api.h D include/openbsc/bsc_msc.h D include/openbsc/bsc_msc_data.h D include/openbsc/bsc_msg_filter.h D include/openbsc/bsc_nat.h D include/openbsc/bsc_nat_callstats.h D include/openbsc/bsc_nat_sccp.h D include/openbsc/bsc_rll.h D include/openbsc/bsc_subscriber.h D include/openbsc/bss.h D include/openbsc/bts_ipaccess_nanobts_omlattr.h D include/openbsc/chan_alloc.h D include/openbsc/common.h D include/openbsc/common_bsc.h D include/openbsc/common_cs.h D include/openbsc/crc24.h D include/openbsc/ctrl.h D include/openbsc/db.h D include/openbsc/debug.h D include/openbsc/e1_config.h D include/openbsc/gb_proxy.h D include/openbsc/gprs_gb_parse.h D include/openbsc/gprs_gmm.h D include/openbsc/gprs_llc.h D include/openbsc/gprs_llc_xid.h D include/openbsc/gprs_sgsn.h D include/openbsc/gprs_sndcp.h D include/openbsc/gprs_sndcp_comp.h D include/openbsc/gprs_sndcp_dcomp.h D include/openbsc/gprs_sndcp_pcomp.h D include/openbsc/gprs_sndcp_xid.h D include/openbsc/gprs_subscriber.h D include/openbsc/gprs_utils.h D include/openbsc/gsm_04_08.h D include/openbsc/gsm_04_11.h D include/openbsc/gsm_04_80.h D include/openbsc/gsm_data.h D include/openbsc/gsm_data_shared.h D include/openbsc/gsm_subscriber.h D include/openbsc/gsup_client.h D include/openbsc/gtphub.h D include/openbsc/handover.h D include/openbsc/handover_decision.h D include/openbsc/ipaccess.h D include/openbsc/iu.h A include/openbsc/iu_dummy.h D include/openbsc/iucs.h D include/openbsc/iucs_ranap.h D include/openbsc/meas_feed.h D include/openbsc/meas_rep.h D include/openbsc/mgcp.h D include/openbsc/mgcp_internal.h D include/openbsc/mgcpgw_client.h D include/openbsc/misdn.h D include/openbsc/mncc.h D include/openbsc/mncc_int.h D include/openbsc/msc_ifaces.h D include/openbsc/nat_rewrite_trie.h D include/openbsc/network_listen.h D include/openbsc/oap_client.h D include/openbsc/openbscdefines.h D include/openbsc/osmo_bsc.h D include/openbsc/osmo_bsc_grace.h D include/openbsc/osmo_bsc_rf.h D include/openbsc/osmo_msc.h D include/openbsc/paging.h D include/openbsc/pcu_if.h D include/openbsc/pcuif_proto.h D include/openbsc/rest_octets.h D include/openbsc/rrlp.h D include/openbsc/rs232.h D include/openbsc/rtp_proxy.h D include/openbsc/sgsn.h D include/openbsc/signal.h D include/openbsc/silent_call.h D include/openbsc/slhc.h D include/openbsc/smpp.h D include/openbsc/sms_queue.h D include/openbsc/socket.h D include/openbsc/system_information.h D include/openbsc/transaction.h D include/openbsc/trau_mux.h D include/openbsc/trau_upqueue.h D include/openbsc/ussd.h D include/openbsc/v42bis.h D include/openbsc/v42bis_private.h D include/openbsc/vlr.h D include/openbsc/vty.h A include/osmocom/Makefile.am A include/osmocom/legacy_mgcp/Makefile.am A include/osmocom/legacy_mgcp/mgcp.h A include/osmocom/legacy_mgcp/mgcp_internal.h R include/osmocom/legacy_mgcp/mgcp_transcode.h A include/osmocom/legacy_mgcp/mgcpgw_client.h A include/osmocom/legacy_mgcp/mgcpgw_client_internal.h R include/osmocom/legacy_mgcp/osmux.h A include/osmocom/legacy_mgcp/vty.h A libosmo-legacy-mgcp.pc.in D openbsc.pc.in M osmoappdesc.py M src/Makefile.am D src/gprs/.gitignore D src/gprs/Makefile.am D src/gprs/crc24.c D src/gprs/gb_proxy.c D src/gprs/gb_proxy_main.c D src/gprs/gb_proxy_patch.c D src/gprs/gb_proxy_peer.c D src/gprs/gb_proxy_tlli.c D src/gprs/gb_proxy_vty.c D src/gprs/gprs_gb_parse.c D src/gprs/gprs_gmm.c D src/gprs/gprs_llc.c D src/gprs/gprs_llc_parse.c D src/gprs/gprs_llc_vty.c D src/gprs/gprs_llc_xid.c D src/gprs/gprs_sgsn.c D src/gprs/gprs_sndcp.c D src/gprs/gprs_sndcp_comp.c D src/gprs/gprs_sndcp_dcomp.c D src/gprs/gprs_sndcp_pcomp.c D src/gprs/gprs_sndcp_vty.c D src/gprs/gprs_sndcp_xid.c D src/gprs/gprs_subscriber.c D src/gprs/gprs_utils.c D src/gprs/gtphub.c D src/gprs/gtphub_ares.c D src/gprs/gtphub_main.c D src/gprs/gtphub_sock.c D src/gprs/gtphub_vty.c D src/gprs/osmo_sgsn.cfg D src/gprs/sgsn_ares.c D src/gprs/sgsn_auth.c D src/gprs/sgsn_cdr.c D src/gprs/sgsn_ctrl.c D src/gprs/sgsn_libgtp.c D src/gprs/sgsn_main.c D src/gprs/sgsn_vty.c D src/gprs/slhc.c D src/gprs/v42bis.c D src/ipaccess/Makefile.am D src/ipaccess/abisip-find.c D src/ipaccess/ipaccess-config.c D src/ipaccess/ipaccess-firmware.c D src/ipaccess/ipaccess-proxy.c D src/ipaccess/network_listen.c D src/libbsc/Makefile.am D src/libbsc/abis_nm.c D src/libbsc/abis_nm_ipaccess.c D src/libbsc/abis_nm_vty.c D src/libbsc/abis_om2000.c D src/libbsc/abis_om2000_vty.c D src/libbsc/abis_rsl.c D src/libbsc/arfcn_range_encode.c D src/libbsc/bsc_api.c D src/libbsc/bsc_ctrl_commands.c D src/libbsc/bsc_ctrl_lookup.c D src/libbsc/bsc_dyn_ts.c D src/libbsc/bsc_init.c D src/libbsc/bsc_msc.c D src/libbsc/bsc_rf_ctrl.c D src/libbsc/bsc_rll.c D src/libbsc/bsc_subscriber.c D src/libbsc/bsc_vty.c D src/libbsc/bts_ericsson_rbs2000.c D src/libbsc/bts_init.c D src/libbsc/bts_ipaccess_nanobts.c D src/libbsc/bts_ipaccess_nanobts_omlattr.c D src/libbsc/bts_nokia_site.c D src/libbsc/bts_siemens_bs11.c D src/libbsc/bts_sysmobts.c D src/libbsc/bts_unknown.c D src/libbsc/chan_alloc.c D src/libbsc/e1_config.c D src/libbsc/gsm_04_08_utils.c D src/libbsc/gsm_04_80_utils.c D src/libbsc/handover_decision.c D src/libbsc/handover_logic.c D src/libbsc/meas_proc.c D src/libbsc/meas_rep.c D src/libbsc/net_init.c D src/libbsc/paging.c D src/libbsc/pcu_sock.c D src/libbsc/rest_octets.c D src/libbsc/system_information.c D src/libcommon-cs/Makefile.am D src/libcommon-cs/common_cs.c D src/libcommon-cs/common_cs_vty.c D src/libcommon/Makefile.am D src/libcommon/bsc_version.c D src/libcommon/common_vty.c D src/libcommon/debug.c D src/libcommon/gsm_data.c D src/libcommon/gsm_data_shared.c D src/libcommon/gsm_subscriber_base.c D src/libcommon/gsup_client.c D src/libcommon/gsup_test_client.c D src/libcommon/oap_client.c D src/libcommon/socket.c D src/libcommon/talloc_ctx.c D src/libfilter/Makefile.am D src/libfilter/bsc_msg_acc.c D src/libfilter/bsc_msg_filter.c D src/libfilter/bsc_msg_vty.c D src/libiu/Makefile.am D src/libiu/iu.c D src/libiu/iu_vty.c D src/libmgcp/Makefile.am D src/libmgcp/mgcp_common.c D src/libmgcp/mgcp_network.c D src/libmgcp/mgcp_osmux.c D src/libmgcp/mgcp_protocol.c D src/libmgcp/mgcp_sdp.c D src/libmgcp/mgcp_transcode.c D src/libmgcp/mgcp_vty.c D src/libmgcp/mgcpgw_client.c D src/libmgcp/mgcpgw_client_vty.c D src/libmsc/Makefile.am D src/libmsc/a_iface.c D src/libmsc/auth.c D src/libmsc/ctrl_commands.c D src/libmsc/db.c D src/libmsc/gsm_04_08.c D src/libmsc/gsm_04_11.c D src/libmsc/gsm_04_80.c D src/libmsc/gsm_subscriber.c D src/libmsc/iu_dummy.c D src/libmsc/iucs.c D src/libmsc/iucs_ranap.c D src/libmsc/meas_feed.c D src/libmsc/meas_feed.h D src/libmsc/mncc.c D src/libmsc/mncc_builtin.c D src/libmsc/mncc_sock.c D src/libmsc/msc_ifaces.c D src/libmsc/msc_vty.c D src/libmsc/osmo_msc.c D src/libmsc/rrlp.c D src/libmsc/silent_call.c D src/libmsc/smpp_openbsc.c D src/libmsc/smpp_smsc.c D src/libmsc/smpp_smsc.h D src/libmsc/smpp_utils.c D src/libmsc/smpp_vty.c D src/libmsc/sms_queue.c D src/libmsc/subscr_conn.c D src/libmsc/transaction.c D src/libmsc/ussd.c D src/libmsc/vty_interface_layer3.c A src/libosmo-legacy-mgcp/Makefile.am R src/libosmo-legacy-mgcp/g711common.h A src/libosmo-legacy-mgcp/mgcp_common.c A src/libosmo-legacy-mgcp/mgcp_network.c A src/libosmo-legacy-mgcp/mgcp_osmux.c A src/libosmo-legacy-mgcp/mgcp_protocol.c A src/libosmo-legacy-mgcp/mgcp_sdp.c A src/libosmo-legacy-mgcp/mgcp_transcode.c A src/libosmo-legacy-mgcp/mgcp_vty.c A src/libosmo-legacy-mgcp/mgcpgw_client.c A src/libosmo-legacy-mgcp/mgcpgw_client_vty.c D src/libtrau/Makefile.am D src/libtrau/rtp_proxy.c D src/libtrau/trau_mux.c D src/libtrau/trau_upqueue.c D src/libvlr/Makefile.am D src/libvlr/vlr.c D src/libvlr/vlr_access_req_fsm.c D src/libvlr/vlr_access_req_fsm.h D src/libvlr/vlr_auth_fsm.c D src/libvlr/vlr_auth_fsm.h D src/libvlr/vlr_core.h D src/libvlr/vlr_lu_fsm.c D src/libvlr/vlr_lu_fsm.h D src/osmo-bsc/Makefile.am D src/osmo-bsc/osmo_bsc_api.c D src/osmo-bsc/osmo_bsc_audio.c D src/osmo-bsc/osmo_bsc_bssap.c D src/osmo-bsc/osmo_bsc_ctrl.c D src/osmo-bsc/osmo_bsc_filter.c D src/osmo-bsc/osmo_bsc_grace.c D src/osmo-bsc/osmo_bsc_main.c D src/osmo-bsc/osmo_bsc_msc.c D src/osmo-bsc/osmo_bsc_sccp.c D src/osmo-bsc/osmo_bsc_vty.c M src/osmo-bsc_mgcp/Makefile.am M src/osmo-bsc_mgcp/mgcp_main.c D src/osmo-bsc_nat/Makefile.am D src/osmo-bsc_nat/bsc_filter.c D src/osmo-bsc_nat/bsc_mgcp_utils.c D src/osmo-bsc_nat/bsc_nat.c D src/osmo-bsc_nat/bsc_nat_ctrl.c D src/osmo-bsc_nat/bsc_nat_filter.c D src/osmo-bsc_nat/bsc_nat_rewrite.c D src/osmo-bsc_nat/bsc_nat_rewrite_trie.c D src/osmo-bsc_nat/bsc_nat_utils.c D src/osmo-bsc_nat/bsc_nat_vty.c D src/osmo-bsc_nat/bsc_sccp.c D src/osmo-bsc_nat/bsc_ussd.c D src/osmo-msc/Makefile.am D src/osmo-msc/msc_main.c D src/utils/Makefile.am D src/utils/bs11_config.c D src/utils/isdnsync.c D src/utils/meas_db.c D src/utils/meas_db.h D src/utils/meas_json.c D src/utils/meas_pcap2db.c D src/utils/meas_udp2db.c D src/utils/meas_vis.c D src/utils/smpp_mirror.c M tests/Makefile.am D tests/abis/Makefile.am D tests/abis/abis_test.c D tests/abis/abis_test.ok D tests/bsc-nat-trie/Makefile.am D tests/bsc-nat-trie/bsc_nat_trie_test.c D tests/bsc-nat-trie/bsc_nat_trie_test.ok D tests/bsc-nat-trie/prefixes.csv D tests/bsc-nat/Makefile.am D tests/bsc-nat/barr.cfg D tests/bsc-nat/barr_dup.cfg D tests/bsc-nat/bsc_data.c D tests/bsc-nat/bsc_nat_test.c D tests/bsc-nat/bsc_nat_test.ok D tests/bsc-nat/prefixes.csv D tests/bsc/Makefile.am D tests/bsc/bsc_test.c D tests/bsc/bsc_test.ok D tests/channel/Makefile.am D tests/channel/channel_test.c D tests/channel/channel_test.ok D tests/db/Makefile.am D tests/db/db_test.c D tests/db/db_test.err D tests/db/db_test.ok D tests/db/hlr.sqlite3 D tests/gbproxy/Makefile.am D tests/gbproxy/gbproxy_test.c D tests/gbproxy/gbproxy_test.ok D tests/gprs/Makefile.am D tests/gprs/gprs_test.c D tests/gprs/gprs_test.ok D tests/gsm0408/Makefile.am D tests/gsm0408/gsm0408_test.c D tests/gsm0408/gsm0408_test.ok D tests/gtphub/Makefile.am D tests/gtphub/gtphub_test.c D tests/gtphub/gtphub_test.ok A tests/legacy_mgcp/Makefile.am A tests/legacy_mgcp/mgcp_test.c R tests/legacy_mgcp/mgcp_test.ok A tests/legacy_mgcp/mgcp_transcoding_test.c R tests/legacy_mgcp/mgcp_transcoding_test.ok A tests/legacy_mgcp/mgcpgw_client_test.c R tests/legacy_mgcp/mgcpgw_client_test.err R tests/legacy_mgcp/mgcpgw_client_test.ok D tests/mgcp/Makefile.am D tests/mgcp/mgcp_test.c D tests/mgcp/mgcp_transcoding_test.c D tests/mgcp/mgcpgw_client_test.c D tests/msc_vlr/Makefile.am D tests/msc_vlr/msc_vlr_test_gsm_authen.c D tests/msc_vlr/msc_vlr_test_gsm_authen.err D tests/msc_vlr/msc_vlr_test_gsm_authen.ok D tests/msc_vlr/msc_vlr_test_gsm_ciph.c D tests/msc_vlr/msc_vlr_test_gsm_ciph.err D tests/msc_vlr/msc_vlr_test_gsm_ciph.ok D tests/msc_vlr/msc_vlr_test_hlr_reject.c D tests/msc_vlr/msc_vlr_test_hlr_reject.err D tests/msc_vlr/msc_vlr_test_hlr_reject.ok D tests/msc_vlr/msc_vlr_test_hlr_timeout.c D tests/msc_vlr/msc_vlr_test_hlr_timeout.err D tests/msc_vlr/msc_vlr_test_hlr_timeout.ok D tests/msc_vlr/msc_vlr_test_ms_timeout.c D tests/msc_vlr/msc_vlr_test_ms_timeout.err D tests/msc_vlr/msc_vlr_test_ms_timeout.ok D tests/msc_vlr/msc_vlr_test_no_authen.c D tests/msc_vlr/msc_vlr_test_no_authen.err D tests/msc_vlr/msc_vlr_test_no_authen.ok D tests/msc_vlr/msc_vlr_test_reject_concurrency.c D tests/msc_vlr/msc_vlr_test_reject_concurrency.err D tests/msc_vlr/msc_vlr_test_reject_concurrency.ok D tests/msc_vlr/msc_vlr_test_rest.c D tests/msc_vlr/msc_vlr_test_rest.err D tests/msc_vlr/msc_vlr_test_rest.ok D tests/msc_vlr/msc_vlr_test_umts_authen.c D tests/msc_vlr/msc_vlr_test_umts_authen.err D tests/msc_vlr/msc_vlr_test_umts_authen.ok D tests/msc_vlr/msc_vlr_tests.c D tests/msc_vlr/msc_vlr_tests.h D tests/nanobts_omlattr/Makefile.am D tests/nanobts_omlattr/nanobts_omlattr_test.c D tests/nanobts_omlattr/nanobts_omlattr_test.ok D tests/oap/Makefile.am D tests/oap/oap_client_test.c D tests/oap/oap_client_test.err D tests/oap/oap_client_test.ok D tests/sgsn/Makefile.am D tests/sgsn/sgsn_test.c D tests/sgsn/sgsn_test.ok D tests/slhc/Makefile.am D tests/slhc/slhc_test.c D tests/slhc/slhc_test.ok D tests/smpp/Makefile.am D tests/smpp/smpp_test.c D tests/smpp/smpp_test.err D tests/smpp/smpp_test.ok D tests/smpp_test_runner.py D tests/sms_queue/Makefile.am D tests/sms_queue/sms_queue_test.c D tests/sms_queue/sms_queue_test.err D tests/sms_queue/sms_queue_test.ok D tests/sndcp_xid/Makefile.am D tests/sndcp_xid/sndcp_xid_test.c D tests/sndcp_xid/sndcp_xid_test.ok D tests/subscr/Makefile.am D tests/subscr/bsc_subscr_test.c D tests/subscr/bsc_subscr_test.err D tests/subscr/bsc_subscr_test.ok M tests/testsuite.at D tests/trau/Makefile.am D tests/trau/trau_test.c D tests/trau/trau_test.ok D tests/v42bis/Makefile.am D tests/v42bis/v42bis_test.c D tests/v42bis/v42bis_test.ok D tests/xid/Makefile.am D tests/xid/xid_test.c D tests/xid/xid_test.ok 514 files changed, 9,988 insertions(+), 157,663 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-mgw refs/changes/25/3725/1 -- To view, visit https://gerrit.osmocom.org/3725 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I0632f1846563efc7d1968632cb0f3582a301b426 Gerrit-PatchSet: 1 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: dexter From gerrit-no-reply at lists.osmocom.org Mon Aug 28 12:55:12 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 28 Aug 2017 12:55:12 +0000 Subject: osmo-msc[master]: am: msc_vlr_tests: use AM_LDFLAGS instead of COMMON vars In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 Would be nice to add actual autoreconf warning to commit message instead of just mentioning it. -- To view, visit https://gerrit.osmocom.org/3720 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I6efae6e192b22de2c1d706edd55385135142532b Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Aug 28 12:56:30 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 28 Aug 2017 12:56:30 +0000 Subject: [PATCH] osmo-bsc[master]: NOT FOR MERGE: check pre_release branch build Message-ID: Review at https://gerrit.osmocom.org/3726 NOT FOR MERGE: check pre_release branch build Change-Id: I832d57b882066184b55033bc4bd15e8354788d68 --- M .gitignore M configure.ac M contrib/jenkins.sh D debian/autoreconf M debian/changelog M debian/control M debian/copyright D debian/docs D debian/openbsc-dev.install A debian/osmo-bsc.install D debian/osmo-gtphub.default D debian/osmo-gtphub.examples D debian/osmo-gtphub.init D debian/osmo-gtphub.install D debian/osmocom-bs11-utils.install D debian/osmocom-bsc-nat.init D debian/osmocom-bsc-nat.install D debian/osmocom-bsc.examples D debian/osmocom-bsc.install D debian/osmocom-gbproxy.init D debian/osmocom-gbproxy.install D debian/osmocom-ipaccess-utils.install D debian/osmocom-nitb.default D debian/osmocom-nitb.dirs D debian/osmocom-nitb.examples D debian/osmocom-nitb.init D debian/osmocom-nitb.install D debian/osmocom-sgsn.default D debian/osmocom-sgsn.examples D debian/osmocom-sgsn.init D debian/osmocom-sgsn.install M debian/rules M doc/examples/osmo-bsc/osmo-bsc.cfg M doc/examples/osmo-sgsn/osmo-sgsn.cfg M include/openbsc/Makefile.am A include/openbsc/a_reset.h M include/openbsc/bsc_api.h M include/openbsc/bsc_msc.h M include/openbsc/bsc_msc_data.h M include/openbsc/bsc_nat.h M include/openbsc/common_cs.h D include/openbsc/db.h M include/openbsc/debug.h D include/openbsc/gb_proxy.h D include/openbsc/gprs_gb_parse.h D include/openbsc/gprs_gmm.h D include/openbsc/gprs_llc.h D include/openbsc/gprs_llc_xid.h D include/openbsc/gprs_sgsn.h D include/openbsc/gprs_sndcp.h D include/openbsc/gprs_sndcp_comp.h D include/openbsc/gprs_sndcp_dcomp.h D include/openbsc/gprs_sndcp_pcomp.h D include/openbsc/gprs_sndcp_xid.h D include/openbsc/gprs_subscriber.h D include/openbsc/gprs_utils.h D include/openbsc/gsm_04_08.h A include/openbsc/gsm_04_08_utils.h D include/openbsc/gsm_04_11.h M include/openbsc/gsm_data.h M include/openbsc/gsm_data_shared.h D include/openbsc/gsup_client.h D include/openbsc/gtphub.h D include/openbsc/iu.h A include/openbsc/iu_dummy.h D include/openbsc/iucs.h D include/openbsc/iucs_ranap.h D include/openbsc/mgcp.h D include/openbsc/mgcp_internal.h D include/openbsc/mgcp_transcode.h D include/openbsc/mgcpgw_client.h M include/openbsc/msc_ifaces.h D include/openbsc/oap_client.h M include/openbsc/osmo_bsc.h A include/openbsc/osmo_bsc_reset.h A include/openbsc/osmo_bsc_sigtran.h M include/openbsc/osmo_msc.h M include/openbsc/rest_octets.h M include/openbsc/sgsn.h D include/openbsc/slhc.h M include/openbsc/transaction.h D include/openbsc/v42bis.h D include/openbsc/v42bis_private.h D include/openbsc/vlr.h M osmoappdesc.py M src/Makefile.am D src/gprs/.gitignore D src/gprs/Makefile.am D src/gprs/crc24.c D src/gprs/gb_proxy.c D src/gprs/gb_proxy_main.c D src/gprs/gb_proxy_patch.c D src/gprs/gb_proxy_peer.c D src/gprs/gb_proxy_tlli.c D src/gprs/gb_proxy_vty.c D src/gprs/gprs_gb_parse.c D src/gprs/gprs_gmm.c D src/gprs/gprs_llc.c D src/gprs/gprs_llc_parse.c D src/gprs/gprs_llc_vty.c D src/gprs/gprs_llc_xid.c D src/gprs/gprs_sgsn.c D src/gprs/gprs_sndcp.c D src/gprs/gprs_sndcp_comp.c D src/gprs/gprs_sndcp_dcomp.c D src/gprs/gprs_sndcp_pcomp.c D src/gprs/gprs_sndcp_vty.c D src/gprs/gprs_sndcp_xid.c D src/gprs/gprs_subscriber.c D src/gprs/gprs_utils.c D src/gprs/gtphub.c D src/gprs/gtphub_ares.c D src/gprs/gtphub_main.c D src/gprs/gtphub_sock.c D src/gprs/gtphub_vty.c D src/gprs/osmo_sgsn.cfg D src/gprs/sgsn_ares.c D src/gprs/sgsn_auth.c D src/gprs/sgsn_cdr.c D src/gprs/sgsn_ctrl.c D src/gprs/sgsn_libgtp.c D src/gprs/sgsn_main.c D src/gprs/sgsn_vty.c D src/gprs/slhc.c D src/gprs/v42bis.c M src/libbsc/abis_rsl.c M src/libbsc/bsc_api.c M src/libbsc/bsc_init.c M src/libbsc/bsc_vty.c M src/libbsc/chan_alloc.c M src/libbsc/gsm_04_08_utils.c M src/libbsc/handover_logic.c M src/libbsc/net_init.c M src/libbsc/paging.c M src/libbsc/system_information.c M src/libcommon-cs/Makefile.am A src/libcommon-cs/a_reset.c M src/libcommon-cs/common_cs.c M src/libcommon/Makefile.am M src/libcommon/common_vty.c M src/libcommon/debug.c M src/libcommon/gsm_data.c M src/libcommon/gsm_subscriber_base.c D src/libcommon/gsup_client.c D src/libcommon/gsup_test_client.c M src/libfilter/bsc_msg_acc.c M src/libfilter/bsc_msg_filter.c D src/libiu/Makefile.am D src/libiu/iu.c D src/libiu/iu_vty.c D src/libmgcp/Makefile.am D src/libmgcp/g711common.h D src/libmgcp/mgcp_common.c D src/libmgcp/mgcp_network.c D src/libmgcp/mgcp_osmux.c D src/libmgcp/mgcp_protocol.c D src/libmgcp/mgcp_sdp.c D src/libmgcp/mgcp_transcode.c D src/libmgcp/mgcp_vty.c D src/libmgcp/mgcpgw_client.c D src/libmgcp/mgcpgw_client_vty.c D src/libmsc/Makefile.am D src/libmsc/a_iface.c D src/libmsc/auth.c D src/libmsc/ctrl_commands.c D src/libmsc/db.c D src/libmsc/gsm_04_08.c D src/libmsc/gsm_04_11.c D src/libmsc/gsm_04_80.c D src/libmsc/gsm_subscriber.c D src/libmsc/iu_dummy.c D src/libmsc/iucs.c D src/libmsc/iucs_ranap.c D src/libmsc/meas_feed.c D src/libmsc/meas_feed.h D src/libmsc/mncc.c D src/libmsc/mncc_builtin.c D src/libmsc/mncc_sock.c D src/libmsc/msc_ifaces.c D src/libmsc/msc_vty.c D src/libmsc/osmo_msc.c D src/libmsc/rrlp.c D src/libmsc/silent_call.c D src/libmsc/smpp_openbsc.c D src/libmsc/smpp_smsc.c D src/libmsc/smpp_smsc.h D src/libmsc/smpp_utils.c D src/libmsc/smpp_vty.c D src/libmsc/sms_queue.c D src/libmsc/subscr_conn.c D src/libmsc/transaction.c D src/libmsc/ussd.c D src/libmsc/vty_interface_layer3.c D src/libvlr/Makefile.am D src/libvlr/vlr.c D src/libvlr/vlr_access_req_fsm.c D src/libvlr/vlr_access_req_fsm.h D src/libvlr/vlr_auth_fsm.c D src/libvlr/vlr_auth_fsm.h D src/libvlr/vlr_core.h D src/libvlr/vlr_lu_fsm.c D src/libvlr/vlr_lu_fsm.h M src/osmo-bsc/Makefile.am M src/osmo-bsc/osmo_bsc_api.c M src/osmo-bsc/osmo_bsc_audio.c M src/osmo-bsc/osmo_bsc_bssap.c M src/osmo-bsc/osmo_bsc_filter.c M src/osmo-bsc/osmo_bsc_main.c M src/osmo-bsc/osmo_bsc_msc.c A src/osmo-bsc/osmo_bsc_reset.c D src/osmo-bsc/osmo_bsc_sccp.c A src/osmo-bsc/osmo_bsc_sigtran.c M src/osmo-bsc/osmo_bsc_vty.c D src/osmo-bsc_mgcp/Makefile.am D src/osmo-bsc_mgcp/mgcp_main.c M src/osmo-bsc_nat/Makefile.am M src/osmo-bsc_nat/bsc_mgcp_utils.c M src/osmo-bsc_nat/bsc_nat.c M src/osmo-bsc_nat/bsc_nat_ctrl.c M src/osmo-bsc_nat/bsc_nat_rewrite.c M src/osmo-bsc_nat/bsc_nat_vty.c M src/osmo-bsc_nat/bsc_ussd.c D src/osmo-msc/Makefile.am D src/osmo-msc/msc_main.c M tests/Makefile.am M tests/bsc-nat-trie/Makefile.am M tests/bsc-nat/Makefile.am M tests/bsc/Makefile.am M tests/channel/Makefile.am M tests/channel/channel_test.c D tests/db/Makefile.am D tests/db/db_test.c D tests/db/db_test.err D tests/db/db_test.ok D tests/db/hlr.sqlite3 D tests/gbproxy/Makefile.am D tests/gbproxy/gbproxy_test.c D tests/gbproxy/gbproxy_test.ok D tests/gprs/Makefile.am D tests/gprs/gprs_test.c D tests/gprs/gprs_test.ok M tests/gsm0408/gsm0408_test.c D tests/gtphub/Makefile.am D tests/gtphub/gtphub_test.c D tests/gtphub/gtphub_test.ok D tests/mgcp/Makefile.am D tests/mgcp/mgcp_test.c D tests/mgcp/mgcp_test.ok D tests/mgcp/mgcp_transcoding_test.c D tests/mgcp/mgcp_transcoding_test.ok D tests/mgcp/mgcpgw_client_test.c D tests/mgcp/mgcpgw_client_test.err D tests/mgcp/mgcpgw_client_test.ok D tests/msc_vlr/Makefile.am D tests/msc_vlr/msc_vlr_test_gsm_authen.c D tests/msc_vlr/msc_vlr_test_gsm_authen.err D tests/msc_vlr/msc_vlr_test_gsm_authen.ok D tests/msc_vlr/msc_vlr_test_gsm_ciph.c D tests/msc_vlr/msc_vlr_test_gsm_ciph.err D tests/msc_vlr/msc_vlr_test_gsm_ciph.ok D tests/msc_vlr/msc_vlr_test_hlr_reject.c D tests/msc_vlr/msc_vlr_test_hlr_reject.err D tests/msc_vlr/msc_vlr_test_hlr_reject.ok D tests/msc_vlr/msc_vlr_test_hlr_timeout.c D tests/msc_vlr/msc_vlr_test_hlr_timeout.err D tests/msc_vlr/msc_vlr_test_hlr_timeout.ok D tests/msc_vlr/msc_vlr_test_ms_timeout.c D tests/msc_vlr/msc_vlr_test_ms_timeout.err D tests/msc_vlr/msc_vlr_test_ms_timeout.ok D tests/msc_vlr/msc_vlr_test_no_authen.c D tests/msc_vlr/msc_vlr_test_no_authen.err D tests/msc_vlr/msc_vlr_test_no_authen.ok D tests/msc_vlr/msc_vlr_test_reject_concurrency.c D tests/msc_vlr/msc_vlr_test_reject_concurrency.err D tests/msc_vlr/msc_vlr_test_reject_concurrency.ok D tests/msc_vlr/msc_vlr_test_rest.c D tests/msc_vlr/msc_vlr_test_rest.err D tests/msc_vlr/msc_vlr_test_rest.ok D tests/msc_vlr/msc_vlr_test_umts_authen.c D tests/msc_vlr/msc_vlr_test_umts_authen.err D tests/msc_vlr/msc_vlr_test_umts_authen.ok D tests/msc_vlr/msc_vlr_tests.c D tests/msc_vlr/msc_vlr_tests.h M tests/nanobts_omlattr/Makefile.am M tests/nanobts_omlattr/nanobts_omlattr_test.c D tests/oap/Makefile.am D tests/oap/oap_client_test.c D tests/oap/oap_client_test.err D tests/oap/oap_client_test.ok D tests/sgsn/Makefile.am D tests/sgsn/sgsn_test.c D tests/sgsn/sgsn_test.ok D tests/slhc/Makefile.am D tests/slhc/slhc_test.c D tests/slhc/slhc_test.ok D tests/smpp/Makefile.am D tests/smpp/smpp_test.c D tests/smpp/smpp_test.err D tests/smpp/smpp_test.ok D tests/smpp_test_runner.py D tests/sms_queue/Makefile.am D tests/sms_queue/sms_queue_test.c D tests/sms_queue/sms_queue_test.err D tests/sms_queue/sms_queue_test.ok D tests/sndcp_xid/Makefile.am D tests/sndcp_xid/sndcp_xid_test.c D tests/sndcp_xid/sndcp_xid_test.ok M tests/testsuite.at D tests/v42bis/Makefile.am D tests/v42bis/v42bis_test.c D tests/v42bis/v42bis_test.ok M tests/vty_test_runner.py D tests/xid/Makefile.am D tests/xid/xid_test.c D tests/xid/xid_test.ok 315 files changed, 2,234 insertions(+), 97,577 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/26/3726/1 -- To view, visit https://gerrit.osmocom.org/3726 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I832d57b882066184b55033bc4bd15e8354788d68 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: dexter From gerrit-no-reply at lists.osmocom.org Mon Aug 28 12:57:32 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 28 Aug 2017 12:57:32 +0000 Subject: [PATCH] osmo-sgsn[master]: NOT FOR MERGE: check pre_release branch build Message-ID: Review at https://gerrit.osmocom.org/3727 NOT FOR MERGE: check pre_release branch build Change-Id: Ie22c5a8dbe3a55067c2cd15afee095eba572c2d8 --- M .gitignore M configure.ac M contrib/jenkins.sh D debian/autoreconf M debian/changelog M debian/control M debian/copyright D debian/docs D debian/openbsc-dev.install R debian/osmo-gbproxy.init A debian/osmo-gbproxy.install D debian/osmo-gtphub.examples M debian/osmo-gtphub.install A debian/osmo-sgsn.install D debian/osmocom-bs11-utils.install D debian/osmocom-bsc-nat.init D debian/osmocom-bsc-nat.install D debian/osmocom-bsc.examples D debian/osmocom-bsc.install D debian/osmocom-gbproxy.install D debian/osmocom-ipaccess-utils.install D debian/osmocom-nitb.default D debian/osmocom-nitb.dirs D debian/osmocom-nitb.examples D debian/osmocom-nitb.init D debian/osmocom-nitb.install D debian/osmocom-sgsn.default D debian/osmocom-sgsn.examples D debian/osmocom-sgsn.init D debian/osmocom-sgsn.install M debian/rules M doc/examples/osmo-bsc/osmo-bsc.cfg M doc/examples/osmo-sgsn/osmo-sgsn.cfg M include/openbsc/Makefile.am A include/openbsc/a_reset.h D include/openbsc/abis_nm.h D include/openbsc/abis_om2000.h D include/openbsc/abis_rsl.h D include/openbsc/arfcn_range_encode.h D include/openbsc/auth.h D include/openbsc/bsc_api.h D include/openbsc/bsc_msc.h D include/openbsc/bsc_msc_data.h D include/openbsc/bsc_msg_filter.h D include/openbsc/bsc_nat.h D include/openbsc/bsc_nat_callstats.h D include/openbsc/bsc_nat_sccp.h D include/openbsc/bsc_rll.h D include/openbsc/bsc_subscriber.h D include/openbsc/bss.h D include/openbsc/bts_ipaccess_nanobts_omlattr.h D include/openbsc/chan_alloc.h D include/openbsc/common_bsc.h D include/openbsc/common_cs.h D include/openbsc/ctrl.h D include/openbsc/db.h M include/openbsc/debug.h D include/openbsc/e1_config.h M include/openbsc/gprs_sgsn.h M include/openbsc/gprs_utils.h D include/openbsc/gsm_04_08.h D include/openbsc/gsm_04_11.h D include/openbsc/gsm_04_80.h D include/openbsc/gsm_data.h D include/openbsc/gsm_data_shared.h D include/openbsc/gsm_subscriber.h D include/openbsc/handover.h D include/openbsc/handover_decision.h D include/openbsc/ipaccess.h D include/openbsc/iu.h A include/openbsc/iu_dummy.h D include/openbsc/iucs.h D include/openbsc/iucs_ranap.h D include/openbsc/meas_feed.h D include/openbsc/meas_rep.h D include/openbsc/mgcp.h D include/openbsc/mgcp_internal.h D include/openbsc/mgcp_transcode.h D include/openbsc/mgcpgw_client.h D include/openbsc/misdn.h D include/openbsc/mncc.h D include/openbsc/mncc_int.h D include/openbsc/msc_ifaces.h D include/openbsc/nat_rewrite_trie.h D include/openbsc/network_listen.h D include/openbsc/openbscdefines.h D include/openbsc/osmo_bsc.h D include/openbsc/osmo_bsc_grace.h D include/openbsc/osmo_bsc_rf.h D include/openbsc/osmo_msc.h D include/openbsc/osmux.h D include/openbsc/paging.h D include/openbsc/pcu_if.h D include/openbsc/pcuif_proto.h D include/openbsc/rrlp.h D include/openbsc/rs232.h D include/openbsc/rtp_proxy.h M include/openbsc/sgsn.h M include/openbsc/signal.h D include/openbsc/silent_call.h D include/openbsc/smpp.h D include/openbsc/sms_queue.h D include/openbsc/socket.h D include/openbsc/system_information.h D include/openbsc/transaction.h D include/openbsc/trau_mux.h D include/openbsc/trau_upqueue.h D include/openbsc/ussd.h D include/openbsc/vlr.h M include/openbsc/vty.h M osmoappdesc.py M src/Makefile.am M src/gprs/Makefile.am M src/gprs/gb_proxy.c M src/gprs/gb_proxy_main.c M src/gprs/gb_proxy_patch.c M src/gprs/gb_proxy_peer.c M src/gprs/gb_proxy_vty.c M src/gprs/gprs_gmm.c M src/gprs/gprs_llc.c M src/gprs/gprs_llc_parse.c M src/gprs/gprs_llc_vty.c M src/gprs/gprs_sgsn.c M src/gprs/gprs_sndcp.c M src/gprs/gprs_sndcp_vty.c A src/gprs/gsup_client.c M src/gprs/gtphub_main.c M src/gprs/gtphub_vty.c A src/gprs/oap_client.c M src/gprs/sgsn_ares.c M src/gprs/sgsn_ctrl.c M src/gprs/sgsn_libgtp.c M src/gprs/sgsn_main.c M src/gprs/sgsn_vty.c D src/ipaccess/Makefile.am D src/ipaccess/abisip-find.c D src/ipaccess/ipaccess-config.c D src/ipaccess/ipaccess-firmware.c D src/ipaccess/ipaccess-proxy.c D src/ipaccess/network_listen.c D src/libbsc/Makefile.am D src/libbsc/abis_nm.c D src/libbsc/abis_nm_ipaccess.c D src/libbsc/abis_nm_vty.c D src/libbsc/abis_om2000.c D src/libbsc/abis_om2000_vty.c D src/libbsc/abis_rsl.c D src/libbsc/arfcn_range_encode.c D src/libbsc/bsc_api.c D src/libbsc/bsc_ctrl_commands.c D src/libbsc/bsc_ctrl_lookup.c D src/libbsc/bsc_dyn_ts.c D src/libbsc/bsc_init.c D src/libbsc/bsc_msc.c D src/libbsc/bsc_rf_ctrl.c D src/libbsc/bsc_rll.c D src/libbsc/bsc_subscriber.c D src/libbsc/bsc_vty.c D src/libbsc/bts_ericsson_rbs2000.c D src/libbsc/bts_init.c D src/libbsc/bts_ipaccess_nanobts.c D src/libbsc/bts_ipaccess_nanobts_omlattr.c D src/libbsc/bts_nokia_site.c D src/libbsc/bts_siemens_bs11.c D src/libbsc/bts_sysmobts.c D src/libbsc/bts_unknown.c D src/libbsc/chan_alloc.c D src/libbsc/e1_config.c D src/libbsc/gsm_04_08_utils.c D src/libbsc/gsm_04_80_utils.c D src/libbsc/handover_decision.c D src/libbsc/handover_logic.c D src/libbsc/meas_proc.c D src/libbsc/meas_rep.c D src/libbsc/net_init.c D src/libbsc/paging.c D src/libbsc/pcu_sock.c D src/libbsc/rest_octets.c D src/libbsc/system_information.c D src/libcommon-cs/Makefile.am D src/libcommon-cs/common_cs.c D src/libcommon-cs/common_cs_vty.c M src/libcommon/common_vty.c M src/libcommon/debug.c M src/libcommon/gsup_client.c D src/libfilter/Makefile.am D src/libfilter/bsc_msg_acc.c D src/libfilter/bsc_msg_filter.c D src/libfilter/bsc_msg_vty.c D src/libiu/Makefile.am D src/libiu/iu.c D src/libiu/iu_vty.c D src/libmgcp/Makefile.am D src/libmgcp/g711common.h D src/libmgcp/mgcp_common.c D src/libmgcp/mgcp_network.c D src/libmgcp/mgcp_osmux.c D src/libmgcp/mgcp_protocol.c D src/libmgcp/mgcp_sdp.c D src/libmgcp/mgcp_transcode.c D src/libmgcp/mgcp_vty.c D src/libmgcp/mgcpgw_client.c D src/libmgcp/mgcpgw_client_vty.c D src/libmsc/Makefile.am D src/libmsc/a_iface.c D src/libmsc/auth.c D src/libmsc/ctrl_commands.c D src/libmsc/db.c D src/libmsc/gsm_04_08.c D src/libmsc/gsm_04_11.c D src/libmsc/gsm_04_80.c D src/libmsc/gsm_subscriber.c M src/libmsc/iu_dummy.c D src/libmsc/iucs.c D src/libmsc/iucs_ranap.c D src/libmsc/meas_feed.c D src/libmsc/meas_feed.h D src/libmsc/mncc.c D src/libmsc/mncc_builtin.c D src/libmsc/mncc_sock.c D src/libmsc/msc_ifaces.c D src/libmsc/msc_vty.c D src/libmsc/osmo_msc.c D src/libmsc/rrlp.c D src/libmsc/silent_call.c D src/libmsc/smpp_openbsc.c D src/libmsc/smpp_smsc.c D src/libmsc/smpp_smsc.h D src/libmsc/smpp_utils.c D src/libmsc/smpp_vty.c D src/libmsc/sms_queue.c D src/libmsc/subscr_conn.c D src/libmsc/transaction.c D src/libmsc/ussd.c D src/libmsc/vty_interface_layer3.c D src/libtrau/Makefile.am D src/libtrau/rtp_proxy.c D src/libtrau/trau_mux.c D src/libtrau/trau_upqueue.c D src/libvlr/Makefile.am D src/libvlr/vlr.c D src/libvlr/vlr_access_req_fsm.c D src/libvlr/vlr_access_req_fsm.h D src/libvlr/vlr_auth_fsm.c D src/libvlr/vlr_auth_fsm.h D src/libvlr/vlr_core.h D src/libvlr/vlr_lu_fsm.c D src/libvlr/vlr_lu_fsm.h D src/osmo-bsc/Makefile.am D src/osmo-bsc/osmo_bsc_api.c D src/osmo-bsc/osmo_bsc_audio.c D src/osmo-bsc/osmo_bsc_bssap.c D src/osmo-bsc/osmo_bsc_ctrl.c D src/osmo-bsc/osmo_bsc_filter.c D src/osmo-bsc/osmo_bsc_grace.c D src/osmo-bsc/osmo_bsc_main.c D src/osmo-bsc/osmo_bsc_msc.c D src/osmo-bsc/osmo_bsc_sccp.c D src/osmo-bsc/osmo_bsc_vty.c D src/osmo-bsc_mgcp/Makefile.am D src/osmo-bsc_mgcp/mgcp_main.c D src/osmo-bsc_nat/Makefile.am D src/osmo-bsc_nat/bsc_filter.c D src/osmo-bsc_nat/bsc_mgcp_utils.c D src/osmo-bsc_nat/bsc_nat.c D src/osmo-bsc_nat/bsc_nat_ctrl.c D src/osmo-bsc_nat/bsc_nat_filter.c D src/osmo-bsc_nat/bsc_nat_rewrite.c D src/osmo-bsc_nat/bsc_nat_rewrite_trie.c D src/osmo-bsc_nat/bsc_nat_utils.c D src/osmo-bsc_nat/bsc_nat_vty.c D src/osmo-bsc_nat/bsc_sccp.c D src/osmo-bsc_nat/bsc_ussd.c D src/osmo-msc/Makefile.am D src/osmo-msc/msc_main.c D src/utils/Makefile.am D src/utils/bs11_config.c D src/utils/isdnsync.c D src/utils/meas_db.c D src/utils/meas_db.h D src/utils/meas_json.c D src/utils/meas_pcap2db.c D src/utils/meas_udp2db.c D src/utils/meas_vis.c D src/utils/smpp_mirror.c M tests/Makefile.am D tests/abis/Makefile.am D tests/abis/abis_test.c D tests/abis/abis_test.ok D tests/bsc-nat-trie/Makefile.am D tests/bsc-nat-trie/bsc_nat_trie_test.c D tests/bsc-nat-trie/bsc_nat_trie_test.ok D tests/bsc-nat-trie/prefixes.csv D tests/bsc-nat/Makefile.am D tests/bsc-nat/barr.cfg D tests/bsc-nat/barr_dup.cfg D tests/bsc-nat/bsc_data.c D tests/bsc-nat/bsc_nat_test.c D tests/bsc-nat/bsc_nat_test.ok D tests/bsc-nat/prefixes.csv D tests/bsc/Makefile.am D tests/bsc/bsc_test.c D tests/bsc/bsc_test.ok D tests/channel/Makefile.am D tests/channel/channel_test.c D tests/channel/channel_test.ok D tests/db/Makefile.am D tests/db/db_test.c D tests/db/db_test.err D tests/db/db_test.ok D tests/db/hlr.sqlite3 M tests/gbproxy/Makefile.am M tests/gbproxy/gbproxy_test.c D tests/gsm0408/Makefile.am D tests/gsm0408/gsm0408_test.c D tests/gsm0408/gsm0408_test.ok D tests/mgcp/Makefile.am D tests/mgcp/mgcp_test.c D tests/mgcp/mgcp_test.ok D tests/mgcp/mgcp_transcoding_test.c D tests/mgcp/mgcp_transcoding_test.ok D tests/mgcp/mgcpgw_client_test.c D tests/mgcp/mgcpgw_client_test.err D tests/mgcp/mgcpgw_client_test.ok D tests/msc_vlr/Makefile.am D tests/msc_vlr/msc_vlr_test_gsm_authen.c D tests/msc_vlr/msc_vlr_test_gsm_authen.err D tests/msc_vlr/msc_vlr_test_gsm_authen.ok D tests/msc_vlr/msc_vlr_test_gsm_ciph.c D tests/msc_vlr/msc_vlr_test_gsm_ciph.err D tests/msc_vlr/msc_vlr_test_gsm_ciph.ok D tests/msc_vlr/msc_vlr_test_hlr_reject.c D tests/msc_vlr/msc_vlr_test_hlr_reject.err D tests/msc_vlr/msc_vlr_test_hlr_reject.ok D tests/msc_vlr/msc_vlr_test_hlr_timeout.c D tests/msc_vlr/msc_vlr_test_hlr_timeout.err D tests/msc_vlr/msc_vlr_test_hlr_timeout.ok D tests/msc_vlr/msc_vlr_test_ms_timeout.c D tests/msc_vlr/msc_vlr_test_ms_timeout.err D tests/msc_vlr/msc_vlr_test_ms_timeout.ok D tests/msc_vlr/msc_vlr_test_no_authen.c D tests/msc_vlr/msc_vlr_test_no_authen.err D tests/msc_vlr/msc_vlr_test_no_authen.ok D tests/msc_vlr/msc_vlr_test_reject_concurrency.c D tests/msc_vlr/msc_vlr_test_reject_concurrency.err D tests/msc_vlr/msc_vlr_test_reject_concurrency.ok D tests/msc_vlr/msc_vlr_test_rest.c D tests/msc_vlr/msc_vlr_test_rest.err D tests/msc_vlr/msc_vlr_test_rest.ok D tests/msc_vlr/msc_vlr_test_umts_authen.c D tests/msc_vlr/msc_vlr_test_umts_authen.err D tests/msc_vlr/msc_vlr_test_umts_authen.ok D tests/msc_vlr/msc_vlr_tests.c D tests/msc_vlr/msc_vlr_tests.h D tests/nanobts_omlattr/Makefile.am D tests/nanobts_omlattr/nanobts_omlattr_test.c D tests/nanobts_omlattr/nanobts_omlattr_test.ok M tests/oap/Makefile.am M tests/sgsn/Makefile.am M tests/slhc/Makefile.am D tests/smpp/Makefile.am D tests/smpp/smpp_test.c D tests/smpp/smpp_test.err D tests/smpp/smpp_test.ok D tests/smpp_test_runner.py D tests/sms_queue/Makefile.am D tests/sms_queue/sms_queue_test.c D tests/sms_queue/sms_queue_test.err D tests/sms_queue/sms_queue_test.ok D tests/subscr/Makefile.am D tests/subscr/bsc_subscr_test.c D tests/subscr/bsc_subscr_test.err D tests/subscr/bsc_subscr_test.ok M tests/testsuite.at D tests/trau/Makefile.am D tests/trau/trau_test.c D tests/trau/trau_test.ok M tests/v42bis/Makefile.am M tests/vty_test_runner.py M tests/xid/Makefile.am 380 files changed, 1,575 insertions(+), 105,686 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-sgsn refs/changes/27/3727/1 -- To view, visit https://gerrit.osmocom.org/3727 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ie22c5a8dbe3a55067c2cd15afee095eba572c2d8 Gerrit-PatchSet: 1 Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: dexter From gerrit-no-reply at lists.osmocom.org Mon Aug 28 13:06:00 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 28 Aug 2017 13:06:00 +0000 Subject: [PATCH] osmo-mgw[master]: NOT FOR MERGE: check pre_release branch build In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3725 to look at the new patch set (#2). NOT FOR MERGE: check pre_release branch build Change-Id: I0632f1846563efc7d1968632cb0f3582a301b426 --- M .gitignore M Makefile.am M configure.ac D contrib/a-link/sccp-split-by-con.lua D contrib/bsc-test/README D contrib/bsc-test/all_dial D contrib/bsc-test/dial.sh D contrib/bsc-test/drop-oml.sh D contrib/bsc-test/drop.sh D contrib/bsc-test/hangup D contrib/bsc-test/msc.sh D contrib/bsc_control.py D contrib/bt.py D contrib/convert_to_enum.py D contrib/ctrl2sse.py D contrib/gprs/gb-proxy-unblock-bug.py D contrib/gprs/gprs-bssgp-histogram.lua D contrib/gprs/gprs-buffer-count.lua D contrib/gprs/gprs-split-trace-by-tlli.lua D contrib/gprs/gprs-verify-nu.lua D contrib/hlr-remove-old.sql D contrib/hlrsync/hlrsync.py D contrib/ipa.py M contrib/jenkins.sh D contrib/nat/test_regexp.c D contrib/nat/ussd_example.py D contrib/rtp/gen_rtp_header.erl D contrib/rtp/rtp_replay.st D contrib/rtp/rtp_replay_shared.st D contrib/rtp/rtp_replay_sip.st D contrib/rtp/timestamp_rtp.lua D contrib/sms/fill-hlr.st D contrib/sms/hlr-query.st D contrib/sms/sqlite-probe.tap.d D contrib/soap.py D contrib/systemd/osmo-bsc.service D contrib/systemd/osmo-gbproxy.service D contrib/systemd/osmo-msc.service D contrib/systemd/osmo-nitb.service D contrib/systemd/osmo-sgsn.service D contrib/testconv/Makefile D contrib/testconv/testconv_main.c D contrib/twisted_ipa.py D debian/autoreconf M debian/changelog M debian/control M debian/copyright D debian/docs A debian/libosmo-legacy-mgcp-dev.install A debian/libosmo-legacy-mgcp0.install D debian/openbsc-dev.install D debian/osmo-gtphub.default D debian/osmo-gtphub.examples D debian/osmo-gtphub.init D debian/osmo-gtphub.install A debian/osmo-mgw.install D debian/osmocom-bs11-utils.install D debian/osmocom-bsc-nat.init D debian/osmocom-bsc-nat.install D debian/osmocom-bsc.examples D debian/osmocom-bsc.install D debian/osmocom-gbproxy.init D debian/osmocom-gbproxy.install D debian/osmocom-ipaccess-utils.install D debian/osmocom-nitb.default D debian/osmocom-nitb.dirs D debian/osmocom-nitb.examples D debian/osmocom-nitb.init D debian/osmocom-nitb.install D debian/osmocom-sgsn.default D debian/osmocom-sgsn.examples D debian/osmocom-sgsn.init D debian/osmocom-sgsn.install M debian/rules M doc/examples/osmo-bsc/osmo-bsc.cfg M doc/examples/osmo-sgsn/osmo-sgsn.cfg M include/Makefile.am D include/compat_af_isdn.h D include/mISDNif.h D include/openbsc/Makefile.am D include/openbsc/abis_nm.h D include/openbsc/abis_om2000.h D include/openbsc/abis_rsl.h D include/openbsc/arfcn_range_encode.h D include/openbsc/auth.h D include/openbsc/bsc_api.h D include/openbsc/bsc_msc.h D include/openbsc/bsc_msc_data.h D include/openbsc/bsc_msg_filter.h D include/openbsc/bsc_nat.h D include/openbsc/bsc_nat_callstats.h D include/openbsc/bsc_nat_sccp.h D include/openbsc/bsc_rll.h D include/openbsc/bsc_subscriber.h D include/openbsc/bss.h D include/openbsc/bts_ipaccess_nanobts_omlattr.h D include/openbsc/chan_alloc.h D include/openbsc/common.h D include/openbsc/common_bsc.h D include/openbsc/common_cs.h D include/openbsc/crc24.h D include/openbsc/ctrl.h D include/openbsc/db.h D include/openbsc/debug.h D include/openbsc/e1_config.h D include/openbsc/gb_proxy.h D include/openbsc/gprs_gb_parse.h D include/openbsc/gprs_gmm.h D include/openbsc/gprs_llc.h D include/openbsc/gprs_llc_xid.h D include/openbsc/gprs_sgsn.h D include/openbsc/gprs_sndcp.h D include/openbsc/gprs_sndcp_comp.h D include/openbsc/gprs_sndcp_dcomp.h D include/openbsc/gprs_sndcp_pcomp.h D include/openbsc/gprs_sndcp_xid.h D include/openbsc/gprs_subscriber.h D include/openbsc/gprs_utils.h D include/openbsc/gsm_04_08.h D include/openbsc/gsm_04_11.h D include/openbsc/gsm_04_80.h D include/openbsc/gsm_data.h D include/openbsc/gsm_data_shared.h D include/openbsc/gsm_subscriber.h D include/openbsc/gsup_client.h D include/openbsc/gtphub.h D include/openbsc/handover.h D include/openbsc/handover_decision.h D include/openbsc/ipaccess.h D include/openbsc/iu.h A include/openbsc/iu_dummy.h D include/openbsc/iucs.h D include/openbsc/iucs_ranap.h D include/openbsc/meas_feed.h D include/openbsc/meas_rep.h D include/openbsc/mgcp.h D include/openbsc/mgcp_internal.h D include/openbsc/mgcpgw_client.h D include/openbsc/misdn.h D include/openbsc/mncc.h D include/openbsc/mncc_int.h D include/openbsc/msc_ifaces.h D include/openbsc/nat_rewrite_trie.h D include/openbsc/network_listen.h D include/openbsc/oap_client.h D include/openbsc/openbscdefines.h D include/openbsc/osmo_bsc.h D include/openbsc/osmo_bsc_grace.h D include/openbsc/osmo_bsc_rf.h D include/openbsc/osmo_msc.h D include/openbsc/paging.h D include/openbsc/pcu_if.h D include/openbsc/pcuif_proto.h D include/openbsc/rest_octets.h D include/openbsc/rrlp.h D include/openbsc/rs232.h D include/openbsc/rtp_proxy.h D include/openbsc/sgsn.h D include/openbsc/signal.h D include/openbsc/silent_call.h D include/openbsc/slhc.h D include/openbsc/smpp.h D include/openbsc/sms_queue.h D include/openbsc/socket.h D include/openbsc/system_information.h D include/openbsc/transaction.h D include/openbsc/trau_mux.h D include/openbsc/trau_upqueue.h D include/openbsc/ussd.h D include/openbsc/v42bis.h D include/openbsc/v42bis_private.h D include/openbsc/vlr.h D include/openbsc/vty.h A include/osmocom/Makefile.am A include/osmocom/legacy_mgcp/Makefile.am A include/osmocom/legacy_mgcp/mgcp.h A include/osmocom/legacy_mgcp/mgcp_internal.h R include/osmocom/legacy_mgcp/mgcp_transcode.h A include/osmocom/legacy_mgcp/mgcpgw_client.h A include/osmocom/legacy_mgcp/mgcpgw_client_internal.h R include/osmocom/legacy_mgcp/osmux.h A include/osmocom/legacy_mgcp/vty.h A libosmo-legacy-mgcp.pc.in D openbsc.pc.in M osmoappdesc.py M src/Makefile.am D src/gprs/.gitignore D src/gprs/Makefile.am D src/gprs/crc24.c D src/gprs/gb_proxy.c D src/gprs/gb_proxy_main.c D src/gprs/gb_proxy_patch.c D src/gprs/gb_proxy_peer.c D src/gprs/gb_proxy_tlli.c D src/gprs/gb_proxy_vty.c D src/gprs/gprs_gb_parse.c D src/gprs/gprs_gmm.c D src/gprs/gprs_llc.c D src/gprs/gprs_llc_parse.c D src/gprs/gprs_llc_vty.c D src/gprs/gprs_llc_xid.c D src/gprs/gprs_sgsn.c D src/gprs/gprs_sndcp.c D src/gprs/gprs_sndcp_comp.c D src/gprs/gprs_sndcp_dcomp.c D src/gprs/gprs_sndcp_pcomp.c D src/gprs/gprs_sndcp_vty.c D src/gprs/gprs_sndcp_xid.c D src/gprs/gprs_subscriber.c D src/gprs/gprs_utils.c D src/gprs/gtphub.c D src/gprs/gtphub_ares.c D src/gprs/gtphub_main.c D src/gprs/gtphub_sock.c D src/gprs/gtphub_vty.c D src/gprs/osmo_sgsn.cfg D src/gprs/sgsn_ares.c D src/gprs/sgsn_auth.c D src/gprs/sgsn_cdr.c D src/gprs/sgsn_ctrl.c D src/gprs/sgsn_libgtp.c D src/gprs/sgsn_main.c D src/gprs/sgsn_vty.c D src/gprs/slhc.c D src/gprs/v42bis.c D src/ipaccess/Makefile.am D src/ipaccess/abisip-find.c D src/ipaccess/ipaccess-config.c D src/ipaccess/ipaccess-firmware.c D src/ipaccess/ipaccess-proxy.c D src/ipaccess/network_listen.c D src/libbsc/Makefile.am D src/libbsc/abis_nm.c D src/libbsc/abis_nm_ipaccess.c D src/libbsc/abis_nm_vty.c D src/libbsc/abis_om2000.c D src/libbsc/abis_om2000_vty.c D src/libbsc/abis_rsl.c D src/libbsc/arfcn_range_encode.c D src/libbsc/bsc_api.c D src/libbsc/bsc_ctrl_commands.c D src/libbsc/bsc_ctrl_lookup.c D src/libbsc/bsc_dyn_ts.c D src/libbsc/bsc_init.c D src/libbsc/bsc_msc.c D src/libbsc/bsc_rf_ctrl.c D src/libbsc/bsc_rll.c D src/libbsc/bsc_subscriber.c D src/libbsc/bsc_vty.c D src/libbsc/bts_ericsson_rbs2000.c D src/libbsc/bts_init.c D src/libbsc/bts_ipaccess_nanobts.c D src/libbsc/bts_ipaccess_nanobts_omlattr.c D src/libbsc/bts_nokia_site.c D src/libbsc/bts_siemens_bs11.c D src/libbsc/bts_sysmobts.c D src/libbsc/bts_unknown.c D src/libbsc/chan_alloc.c D src/libbsc/e1_config.c D src/libbsc/gsm_04_08_utils.c D src/libbsc/gsm_04_80_utils.c D src/libbsc/handover_decision.c D src/libbsc/handover_logic.c D src/libbsc/meas_proc.c D src/libbsc/meas_rep.c D src/libbsc/net_init.c D src/libbsc/paging.c D src/libbsc/pcu_sock.c D src/libbsc/rest_octets.c D src/libbsc/system_information.c D src/libcommon-cs/Makefile.am D src/libcommon-cs/common_cs.c D src/libcommon-cs/common_cs_vty.c D src/libcommon/Makefile.am D src/libcommon/bsc_version.c D src/libcommon/common_vty.c D src/libcommon/debug.c D src/libcommon/gsm_data.c D src/libcommon/gsm_data_shared.c D src/libcommon/gsm_subscriber_base.c D src/libcommon/gsup_client.c D src/libcommon/gsup_test_client.c D src/libcommon/oap_client.c D src/libcommon/socket.c D src/libcommon/talloc_ctx.c D src/libfilter/Makefile.am D src/libfilter/bsc_msg_acc.c D src/libfilter/bsc_msg_filter.c D src/libfilter/bsc_msg_vty.c D src/libiu/Makefile.am D src/libiu/iu.c D src/libiu/iu_vty.c D src/libmgcp/Makefile.am D src/libmgcp/mgcp_common.c D src/libmgcp/mgcp_network.c D src/libmgcp/mgcp_osmux.c D src/libmgcp/mgcp_protocol.c D src/libmgcp/mgcp_sdp.c D src/libmgcp/mgcp_transcode.c D src/libmgcp/mgcp_vty.c D src/libmgcp/mgcpgw_client.c D src/libmgcp/mgcpgw_client_vty.c D src/libmsc/Makefile.am D src/libmsc/a_iface.c D src/libmsc/auth.c D src/libmsc/ctrl_commands.c D src/libmsc/db.c D src/libmsc/gsm_04_08.c D src/libmsc/gsm_04_11.c D src/libmsc/gsm_04_80.c D src/libmsc/gsm_subscriber.c D src/libmsc/iu_dummy.c D src/libmsc/iucs.c D src/libmsc/iucs_ranap.c D src/libmsc/meas_feed.c D src/libmsc/meas_feed.h D src/libmsc/mncc.c D src/libmsc/mncc_builtin.c D src/libmsc/mncc_sock.c D src/libmsc/msc_ifaces.c D src/libmsc/msc_vty.c D src/libmsc/osmo_msc.c D src/libmsc/rrlp.c D src/libmsc/silent_call.c D src/libmsc/smpp_openbsc.c D src/libmsc/smpp_smsc.c D src/libmsc/smpp_smsc.h D src/libmsc/smpp_utils.c D src/libmsc/smpp_vty.c D src/libmsc/sms_queue.c D src/libmsc/subscr_conn.c D src/libmsc/transaction.c D src/libmsc/ussd.c D src/libmsc/vty_interface_layer3.c A src/libosmo-legacy-mgcp/Makefile.am R src/libosmo-legacy-mgcp/g711common.h A src/libosmo-legacy-mgcp/mgcp_common.c A src/libosmo-legacy-mgcp/mgcp_network.c A src/libosmo-legacy-mgcp/mgcp_osmux.c A src/libosmo-legacy-mgcp/mgcp_protocol.c A src/libosmo-legacy-mgcp/mgcp_sdp.c A src/libosmo-legacy-mgcp/mgcp_transcode.c A src/libosmo-legacy-mgcp/mgcp_vty.c A src/libosmo-legacy-mgcp/mgcpgw_client.c A src/libosmo-legacy-mgcp/mgcpgw_client_vty.c D src/libtrau/Makefile.am D src/libtrau/rtp_proxy.c D src/libtrau/trau_mux.c D src/libtrau/trau_upqueue.c D src/libvlr/Makefile.am D src/libvlr/vlr.c D src/libvlr/vlr_access_req_fsm.c D src/libvlr/vlr_access_req_fsm.h D src/libvlr/vlr_auth_fsm.c D src/libvlr/vlr_auth_fsm.h D src/libvlr/vlr_core.h D src/libvlr/vlr_lu_fsm.c D src/libvlr/vlr_lu_fsm.h D src/osmo-bsc/Makefile.am D src/osmo-bsc/osmo_bsc_api.c D src/osmo-bsc/osmo_bsc_audio.c D src/osmo-bsc/osmo_bsc_bssap.c D src/osmo-bsc/osmo_bsc_ctrl.c D src/osmo-bsc/osmo_bsc_filter.c D src/osmo-bsc/osmo_bsc_grace.c D src/osmo-bsc/osmo_bsc_main.c D src/osmo-bsc/osmo_bsc_msc.c D src/osmo-bsc/osmo_bsc_sccp.c D src/osmo-bsc/osmo_bsc_vty.c M src/osmo-bsc_mgcp/Makefile.am M src/osmo-bsc_mgcp/mgcp_main.c D src/osmo-bsc_nat/Makefile.am D src/osmo-bsc_nat/bsc_filter.c D src/osmo-bsc_nat/bsc_mgcp_utils.c D src/osmo-bsc_nat/bsc_nat.c D src/osmo-bsc_nat/bsc_nat_ctrl.c D src/osmo-bsc_nat/bsc_nat_filter.c D src/osmo-bsc_nat/bsc_nat_rewrite.c D src/osmo-bsc_nat/bsc_nat_rewrite_trie.c D src/osmo-bsc_nat/bsc_nat_utils.c D src/osmo-bsc_nat/bsc_nat_vty.c D src/osmo-bsc_nat/bsc_sccp.c D src/osmo-bsc_nat/bsc_ussd.c D src/osmo-msc/Makefile.am D src/osmo-msc/msc_main.c D src/utils/Makefile.am D src/utils/bs11_config.c D src/utils/isdnsync.c D src/utils/meas_db.c D src/utils/meas_db.h D src/utils/meas_json.c D src/utils/meas_pcap2db.c D src/utils/meas_udp2db.c D src/utils/meas_vis.c D src/utils/smpp_mirror.c M tests/Makefile.am D tests/abis/Makefile.am D tests/abis/abis_test.c D tests/abis/abis_test.ok D tests/bsc-nat-trie/Makefile.am D tests/bsc-nat-trie/bsc_nat_trie_test.c D tests/bsc-nat-trie/bsc_nat_trie_test.ok D tests/bsc-nat-trie/prefixes.csv D tests/bsc-nat/Makefile.am D tests/bsc-nat/barr.cfg D tests/bsc-nat/barr_dup.cfg D tests/bsc-nat/bsc_data.c D tests/bsc-nat/bsc_nat_test.c D tests/bsc-nat/bsc_nat_test.ok D tests/bsc-nat/prefixes.csv D tests/bsc/Makefile.am D tests/bsc/bsc_test.c D tests/bsc/bsc_test.ok D tests/channel/Makefile.am D tests/channel/channel_test.c D tests/channel/channel_test.ok D tests/db/Makefile.am D tests/db/db_test.c D tests/db/db_test.err D tests/db/db_test.ok D tests/db/hlr.sqlite3 D tests/gbproxy/Makefile.am D tests/gbproxy/gbproxy_test.c D tests/gbproxy/gbproxy_test.ok D tests/gprs/Makefile.am D tests/gprs/gprs_test.c D tests/gprs/gprs_test.ok D tests/gsm0408/Makefile.am D tests/gsm0408/gsm0408_test.c D tests/gsm0408/gsm0408_test.ok D tests/gtphub/Makefile.am D tests/gtphub/gtphub_test.c D tests/gtphub/gtphub_test.ok A tests/legacy_mgcp/Makefile.am A tests/legacy_mgcp/mgcp_test.c R tests/legacy_mgcp/mgcp_test.ok A tests/legacy_mgcp/mgcp_transcoding_test.c R tests/legacy_mgcp/mgcp_transcoding_test.ok A tests/legacy_mgcp/mgcpgw_client_test.c R tests/legacy_mgcp/mgcpgw_client_test.err R tests/legacy_mgcp/mgcpgw_client_test.ok D tests/mgcp/Makefile.am D tests/mgcp/mgcp_test.c D tests/mgcp/mgcp_transcoding_test.c D tests/mgcp/mgcpgw_client_test.c D tests/msc_vlr/Makefile.am D tests/msc_vlr/msc_vlr_test_gsm_authen.c D tests/msc_vlr/msc_vlr_test_gsm_authen.err D tests/msc_vlr/msc_vlr_test_gsm_authen.ok D tests/msc_vlr/msc_vlr_test_gsm_ciph.c D tests/msc_vlr/msc_vlr_test_gsm_ciph.err D tests/msc_vlr/msc_vlr_test_gsm_ciph.ok D tests/msc_vlr/msc_vlr_test_hlr_reject.c D tests/msc_vlr/msc_vlr_test_hlr_reject.err D tests/msc_vlr/msc_vlr_test_hlr_reject.ok D tests/msc_vlr/msc_vlr_test_hlr_timeout.c D tests/msc_vlr/msc_vlr_test_hlr_timeout.err D tests/msc_vlr/msc_vlr_test_hlr_timeout.ok D tests/msc_vlr/msc_vlr_test_ms_timeout.c D tests/msc_vlr/msc_vlr_test_ms_timeout.err D tests/msc_vlr/msc_vlr_test_ms_timeout.ok D tests/msc_vlr/msc_vlr_test_no_authen.c D tests/msc_vlr/msc_vlr_test_no_authen.err D tests/msc_vlr/msc_vlr_test_no_authen.ok D tests/msc_vlr/msc_vlr_test_reject_concurrency.c D tests/msc_vlr/msc_vlr_test_reject_concurrency.err D tests/msc_vlr/msc_vlr_test_reject_concurrency.ok D tests/msc_vlr/msc_vlr_test_rest.c D tests/msc_vlr/msc_vlr_test_rest.err D tests/msc_vlr/msc_vlr_test_rest.ok D tests/msc_vlr/msc_vlr_test_umts_authen.c D tests/msc_vlr/msc_vlr_test_umts_authen.err D tests/msc_vlr/msc_vlr_test_umts_authen.ok D tests/msc_vlr/msc_vlr_tests.c D tests/msc_vlr/msc_vlr_tests.h D tests/nanobts_omlattr/Makefile.am D tests/nanobts_omlattr/nanobts_omlattr_test.c D tests/nanobts_omlattr/nanobts_omlattr_test.ok D tests/oap/Makefile.am D tests/oap/oap_client_test.c D tests/oap/oap_client_test.err D tests/oap/oap_client_test.ok D tests/sgsn/Makefile.am D tests/sgsn/sgsn_test.c D tests/sgsn/sgsn_test.ok D tests/slhc/Makefile.am D tests/slhc/slhc_test.c D tests/slhc/slhc_test.ok D tests/smpp/Makefile.am D tests/smpp/smpp_test.c D tests/smpp/smpp_test.err D tests/smpp/smpp_test.ok D tests/smpp_test_runner.py D tests/sms_queue/Makefile.am D tests/sms_queue/sms_queue_test.c D tests/sms_queue/sms_queue_test.err D tests/sms_queue/sms_queue_test.ok D tests/sndcp_xid/Makefile.am D tests/sndcp_xid/sndcp_xid_test.c D tests/sndcp_xid/sndcp_xid_test.ok D tests/subscr/Makefile.am D tests/subscr/bsc_subscr_test.c D tests/subscr/bsc_subscr_test.err D tests/subscr/bsc_subscr_test.ok M tests/testsuite.at D tests/trau/Makefile.am D tests/trau/trau_test.c D tests/trau/trau_test.ok D tests/v42bis/Makefile.am D tests/v42bis/v42bis_test.c D tests/v42bis/v42bis_test.ok D tests/xid/Makefile.am D tests/xid/xid_test.c D tests/xid/xid_test.ok 514 files changed, 9,989 insertions(+), 157,662 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-mgw refs/changes/25/3725/2 -- To view, visit https://gerrit.osmocom.org/3725 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I0632f1846563efc7d1968632cb0f3582a301b426 Gerrit-PatchSet: 2 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: dexter From gerrit-no-reply at lists.osmocom.org Mon Aug 28 13:08:11 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Mon, 28 Aug 2017 13:08:11 +0000 Subject: [PATCH] osmo-gsm-tester[master]: Add cipher cfg param for modem and bts In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3723 to look at the new patch set (#2). Add cipher cfg param for modem and bts This parameter is contains a list of supported encryption ciphers by the modem or bts setting it. It is so far not directly/automatically used inside osmo-gsm-tester code, but can be useful to create scenarios for tests that require specific ciphering modes. For instance, aoip_encryption suite contains tests that require a BTS and a modem that supports a5 0 and a5 1, otherwise tests will fail. Change-Id: Ic0e368843a6e58bd3eeef36d2c0a7501296f0f3e --- M example/default-suites.conf M example/resources.conf A example/scenarios/cipher-a50.conf A example/scenarios/cipher-a51.conf M src/osmo_gsm_tester/resource.py M src/osmo_gsm_tester/schema.py 6 files changed, 31 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-tester refs/changes/23/3723/2 diff --git a/example/default-suites.conf b/example/default-suites.conf index 0198486..1e8d47a 100644 --- a/example/default-suites.conf +++ b/example/default-suites.conf @@ -6,4 +6,4 @@ - aoip_sms:trx-sysmocell5000 - smpp - aoip_smpp -- aoip_encryption +- aoip_encryption:cipher-a50+cipher-a51 diff --git a/example/resources.conf b/example/resources.conf index f190c2f..01df57e 100644 --- a/example/resources.conf +++ b/example/resources.conf @@ -13,6 +13,7 @@ ipa_unit_id: 1 addr: 10.42.42.114 band: GSM-1800 + ciphers: ['a5 0', 'a5 1', 'a5 2', 'a5 3'] - label: Ettus B200 type: osmo-bts-trx @@ -20,6 +21,7 @@ addr: 10.42.42.50 band: GSM-1800 launch_trx: true + ciphers: ['a5 0', 'a5 1'] - label: sysmoCell 5000 type: osmo-bts-trx @@ -27,6 +29,7 @@ addr: 10.42.42.51 band: GSM-1800 trx_remote_ip: 10.42.42.112 + ciphers: ['a5 0', 'a5 1'] arfcn: - arfcn: 512 @@ -56,21 +59,25 @@ imsi: '901700000009031' ki: '80A37E6FDEA931EAC92FFA5F671EFEAD' auth_algo: 'xor' + ciphers: ['a5 0', 'a5 1'] - label: sierra_2 path: '/sierra_2' imsi: '901700000009029' ki: '00969E283349D354A8239E877F2E0866' auth_algo: 'xor' + ciphers: ['a5 0', 'a5 1'] - label: gobi_0 path: '/gobi_0' imsi: '901700000009030' ki: 'BB70807226393CDBAC8DD3439FF54252' auth_algo: 'xor' + ciphers: ['a5 0', 'a5 1'] - label: gobi_3 path: '/gobi_3' imsi: '901700000009032' ki: '2F70DCA43C45ACB97E947FDD0C7CA30A' auth_algo: 'xor' + ciphers: ['a5 0', 'a5 1'] diff --git a/example/scenarios/cipher-a50.conf b/example/scenarios/cipher-a50.conf new file mode 100644 index 0000000..d4a2e46 --- /dev/null +++ b/example/scenarios/cipher-a50.conf @@ -0,0 +1,7 @@ +resources: + bts: + - ciphers: + - 'a5 0' + modem: + - ciphers: + - 'a5 0' diff --git a/example/scenarios/cipher-a51.conf b/example/scenarios/cipher-a51.conf new file mode 100644 index 0000000..c84cd96 --- /dev/null +++ b/example/scenarios/cipher-a51.conf @@ -0,0 +1,7 @@ +resources: + bts: + - ciphers: + - 'a5 1' + modem: + - ciphers: + - 'a5 1' diff --git a/src/osmo_gsm_tester/resource.py b/src/osmo_gsm_tester/resource.py index da543f7..4f43bfc 100644 --- a/src/osmo_gsm_tester/resource.py +++ b/src/osmo_gsm_tester/resource.py @@ -56,6 +56,7 @@ 'bts[].band': schema.BAND, 'bts[].trx_remote_ip': schema.IPV4, 'bts[].launch_trx': schema.BOOL_STR, + 'bts[].ciphers[]': schema.CIPHER, 'bts[].trx_list[].hw_addr': schema.HWADDR, 'bts[].trx_list[].net_device': schema.STR, 'arfcn[].arfcn': schema.INT, @@ -65,6 +66,7 @@ 'modem[].imsi': schema.IMSI, 'modem[].ki': schema.KI, 'modem[].auth_algo': schema.AUTH_ALGO, + 'modem[].ciphers[]': schema.CIPHER, } WANT_SCHEMA = util.dict_add( diff --git a/src/osmo_gsm_tester/schema.py b/src/osmo_gsm_tester/schema.py index 2da80cd..86acbad 100644 --- a/src/osmo_gsm_tester/schema.py +++ b/src/osmo_gsm_tester/schema.py @@ -66,6 +66,11 @@ return raise ValueError('Unknown Authentication Algorithm: %r' % val) +def cipher(val): + if val in ('a5 0', 'a5 1', 'a5 2', 'a5 3'): + return + raise ValueError('Unknown Cipher value: %r' % val) + INT = 'int' STR = 'str' BOOL_STR = 'bool_str' @@ -76,6 +81,7 @@ KI = 'ki' MSISDN = 'msisdn' AUTH_ALGO = 'auth_algo' +CIPHER = 'cipher' SCHEMA_TYPES = { INT: int, STR: str, @@ -87,6 +93,7 @@ KI: ki, MSISDN: msisdn, AUTH_ALGO: auth_algo, + CIPHER: cipher, } def validate(config, schema): -- To view, visit https://gerrit.osmocom.org/3723 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ic0e368843a6e58bd3eeef36d2c0a7501296f0f3e Gerrit-PatchSet: 2 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Mon Aug 28 13:13:58 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 28 Aug 2017 13:13:58 +0000 Subject: [PATCH] osmo-bsc[master]: NOT FOR MERGE: check pre_release branch build In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3726 to look at the new patch set (#2). NOT FOR MERGE: check pre_release branch build Change-Id: I832d57b882066184b55033bc4bd15e8354788d68 --- M .gitignore M configure.ac M contrib/jenkins.sh D debian/autoreconf M debian/changelog M debian/control M debian/copyright D debian/docs D debian/openbsc-dev.install A debian/osmo-bsc.install D debian/osmo-gtphub.default D debian/osmo-gtphub.examples D debian/osmo-gtphub.init D debian/osmo-gtphub.install D debian/osmocom-bs11-utils.install D debian/osmocom-bsc-nat.init D debian/osmocom-bsc-nat.install D debian/osmocom-bsc.examples D debian/osmocom-bsc.install D debian/osmocom-gbproxy.init D debian/osmocom-gbproxy.install D debian/osmocom-ipaccess-utils.install D debian/osmocom-nitb.default D debian/osmocom-nitb.dirs D debian/osmocom-nitb.examples D debian/osmocom-nitb.init D debian/osmocom-nitb.install D debian/osmocom-sgsn.default D debian/osmocom-sgsn.examples D debian/osmocom-sgsn.init D debian/osmocom-sgsn.install M debian/rules M doc/examples/osmo-bsc/osmo-bsc.cfg M doc/examples/osmo-sgsn/osmo-sgsn.cfg M include/openbsc/Makefile.am A include/openbsc/a_reset.h M include/openbsc/bsc_api.h M include/openbsc/bsc_msc.h M include/openbsc/bsc_msc_data.h M include/openbsc/bsc_nat.h M include/openbsc/common_cs.h D include/openbsc/db.h M include/openbsc/debug.h D include/openbsc/gb_proxy.h D include/openbsc/gprs_gb_parse.h D include/openbsc/gprs_gmm.h D include/openbsc/gprs_llc.h D include/openbsc/gprs_llc_xid.h D include/openbsc/gprs_sgsn.h D include/openbsc/gprs_sndcp.h D include/openbsc/gprs_sndcp_comp.h D include/openbsc/gprs_sndcp_dcomp.h D include/openbsc/gprs_sndcp_pcomp.h D include/openbsc/gprs_sndcp_xid.h D include/openbsc/gprs_subscriber.h D include/openbsc/gprs_utils.h D include/openbsc/gsm_04_08.h A include/openbsc/gsm_04_08_utils.h D include/openbsc/gsm_04_11.h M include/openbsc/gsm_data.h M include/openbsc/gsm_data_shared.h D include/openbsc/gsup_client.h D include/openbsc/gtphub.h D include/openbsc/iu.h A include/openbsc/iu_dummy.h D include/openbsc/iucs.h D include/openbsc/iucs_ranap.h D include/openbsc/mgcp.h D include/openbsc/mgcp_internal.h D include/openbsc/mgcp_transcode.h D include/openbsc/mgcpgw_client.h M include/openbsc/msc_ifaces.h D include/openbsc/oap_client.h M include/openbsc/osmo_bsc.h A include/openbsc/osmo_bsc_reset.h A include/openbsc/osmo_bsc_sigtran.h M include/openbsc/osmo_msc.h M include/openbsc/rest_octets.h M include/openbsc/sgsn.h D include/openbsc/slhc.h M include/openbsc/transaction.h D include/openbsc/v42bis.h D include/openbsc/v42bis_private.h D include/openbsc/vlr.h M osmoappdesc.py M src/Makefile.am D src/gprs/.gitignore D src/gprs/Makefile.am D src/gprs/crc24.c D src/gprs/gb_proxy.c D src/gprs/gb_proxy_main.c D src/gprs/gb_proxy_patch.c D src/gprs/gb_proxy_peer.c D src/gprs/gb_proxy_tlli.c D src/gprs/gb_proxy_vty.c D src/gprs/gprs_gb_parse.c D src/gprs/gprs_gmm.c D src/gprs/gprs_llc.c D src/gprs/gprs_llc_parse.c D src/gprs/gprs_llc_vty.c D src/gprs/gprs_llc_xid.c D src/gprs/gprs_sgsn.c D src/gprs/gprs_sndcp.c D src/gprs/gprs_sndcp_comp.c D src/gprs/gprs_sndcp_dcomp.c D src/gprs/gprs_sndcp_pcomp.c D src/gprs/gprs_sndcp_vty.c D src/gprs/gprs_sndcp_xid.c D src/gprs/gprs_subscriber.c D src/gprs/gprs_utils.c D src/gprs/gtphub.c D src/gprs/gtphub_ares.c D src/gprs/gtphub_main.c D src/gprs/gtphub_sock.c D src/gprs/gtphub_vty.c D src/gprs/osmo_sgsn.cfg D src/gprs/sgsn_ares.c D src/gprs/sgsn_auth.c D src/gprs/sgsn_cdr.c D src/gprs/sgsn_ctrl.c D src/gprs/sgsn_libgtp.c D src/gprs/sgsn_main.c D src/gprs/sgsn_vty.c D src/gprs/slhc.c D src/gprs/v42bis.c M src/libbsc/abis_rsl.c M src/libbsc/bsc_api.c M src/libbsc/bsc_init.c M src/libbsc/bsc_vty.c M src/libbsc/chan_alloc.c M src/libbsc/gsm_04_08_utils.c M src/libbsc/handover_logic.c M src/libbsc/net_init.c M src/libbsc/paging.c M src/libbsc/system_information.c M src/libcommon-cs/Makefile.am A src/libcommon-cs/a_reset.c M src/libcommon-cs/common_cs.c M src/libcommon/Makefile.am M src/libcommon/common_vty.c M src/libcommon/debug.c M src/libcommon/gsm_data.c M src/libcommon/gsm_subscriber_base.c D src/libcommon/gsup_client.c D src/libcommon/gsup_test_client.c M src/libfilter/bsc_msg_acc.c M src/libfilter/bsc_msg_filter.c D src/libiu/Makefile.am D src/libiu/iu.c D src/libiu/iu_vty.c D src/libmgcp/Makefile.am D src/libmgcp/g711common.h D src/libmgcp/mgcp_common.c D src/libmgcp/mgcp_network.c D src/libmgcp/mgcp_osmux.c D src/libmgcp/mgcp_protocol.c D src/libmgcp/mgcp_sdp.c D src/libmgcp/mgcp_transcode.c D src/libmgcp/mgcp_vty.c D src/libmgcp/mgcpgw_client.c D src/libmgcp/mgcpgw_client_vty.c D src/libmsc/Makefile.am D src/libmsc/a_iface.c D src/libmsc/auth.c D src/libmsc/ctrl_commands.c D src/libmsc/db.c D src/libmsc/gsm_04_08.c D src/libmsc/gsm_04_11.c D src/libmsc/gsm_04_80.c D src/libmsc/gsm_subscriber.c D src/libmsc/iu_dummy.c D src/libmsc/iucs.c D src/libmsc/iucs_ranap.c D src/libmsc/meas_feed.c D src/libmsc/meas_feed.h D src/libmsc/mncc.c D src/libmsc/mncc_builtin.c D src/libmsc/mncc_sock.c D src/libmsc/msc_ifaces.c D src/libmsc/msc_vty.c D src/libmsc/osmo_msc.c D src/libmsc/rrlp.c D src/libmsc/silent_call.c D src/libmsc/smpp_openbsc.c D src/libmsc/smpp_smsc.c D src/libmsc/smpp_smsc.h D src/libmsc/smpp_utils.c D src/libmsc/smpp_vty.c D src/libmsc/sms_queue.c D src/libmsc/subscr_conn.c D src/libmsc/transaction.c D src/libmsc/ussd.c D src/libmsc/vty_interface_layer3.c D src/libvlr/Makefile.am D src/libvlr/vlr.c D src/libvlr/vlr_access_req_fsm.c D src/libvlr/vlr_access_req_fsm.h D src/libvlr/vlr_auth_fsm.c D src/libvlr/vlr_auth_fsm.h D src/libvlr/vlr_core.h D src/libvlr/vlr_lu_fsm.c D src/libvlr/vlr_lu_fsm.h M src/osmo-bsc/Makefile.am M src/osmo-bsc/osmo_bsc_api.c M src/osmo-bsc/osmo_bsc_audio.c M src/osmo-bsc/osmo_bsc_bssap.c M src/osmo-bsc/osmo_bsc_filter.c M src/osmo-bsc/osmo_bsc_main.c M src/osmo-bsc/osmo_bsc_msc.c A src/osmo-bsc/osmo_bsc_reset.c D src/osmo-bsc/osmo_bsc_sccp.c A src/osmo-bsc/osmo_bsc_sigtran.c M src/osmo-bsc/osmo_bsc_vty.c D src/osmo-bsc_mgcp/Makefile.am D src/osmo-bsc_mgcp/mgcp_main.c M src/osmo-bsc_nat/Makefile.am M src/osmo-bsc_nat/bsc_mgcp_utils.c M src/osmo-bsc_nat/bsc_nat.c M src/osmo-bsc_nat/bsc_nat_ctrl.c M src/osmo-bsc_nat/bsc_nat_rewrite.c M src/osmo-bsc_nat/bsc_nat_vty.c M src/osmo-bsc_nat/bsc_ussd.c D src/osmo-msc/Makefile.am D src/osmo-msc/msc_main.c M tests/Makefile.am M tests/bsc-nat-trie/Makefile.am M tests/bsc-nat/Makefile.am M tests/bsc/Makefile.am M tests/channel/Makefile.am M tests/channel/channel_test.c D tests/db/Makefile.am D tests/db/db_test.c D tests/db/db_test.err D tests/db/db_test.ok D tests/db/hlr.sqlite3 D tests/gbproxy/Makefile.am D tests/gbproxy/gbproxy_test.c D tests/gbproxy/gbproxy_test.ok D tests/gprs/Makefile.am D tests/gprs/gprs_test.c D tests/gprs/gprs_test.ok M tests/gsm0408/gsm0408_test.c D tests/gtphub/Makefile.am D tests/gtphub/gtphub_test.c D tests/gtphub/gtphub_test.ok D tests/mgcp/Makefile.am D tests/mgcp/mgcp_test.c D tests/mgcp/mgcp_test.ok D tests/mgcp/mgcp_transcoding_test.c D tests/mgcp/mgcp_transcoding_test.ok D tests/mgcp/mgcpgw_client_test.c D tests/mgcp/mgcpgw_client_test.err D tests/mgcp/mgcpgw_client_test.ok D tests/msc_vlr/Makefile.am D tests/msc_vlr/msc_vlr_test_gsm_authen.c D tests/msc_vlr/msc_vlr_test_gsm_authen.err D tests/msc_vlr/msc_vlr_test_gsm_authen.ok D tests/msc_vlr/msc_vlr_test_gsm_ciph.c D tests/msc_vlr/msc_vlr_test_gsm_ciph.err D tests/msc_vlr/msc_vlr_test_gsm_ciph.ok D tests/msc_vlr/msc_vlr_test_hlr_reject.c D tests/msc_vlr/msc_vlr_test_hlr_reject.err D tests/msc_vlr/msc_vlr_test_hlr_reject.ok D tests/msc_vlr/msc_vlr_test_hlr_timeout.c D tests/msc_vlr/msc_vlr_test_hlr_timeout.err D tests/msc_vlr/msc_vlr_test_hlr_timeout.ok D tests/msc_vlr/msc_vlr_test_ms_timeout.c D tests/msc_vlr/msc_vlr_test_ms_timeout.err D tests/msc_vlr/msc_vlr_test_ms_timeout.ok D tests/msc_vlr/msc_vlr_test_no_authen.c D tests/msc_vlr/msc_vlr_test_no_authen.err D tests/msc_vlr/msc_vlr_test_no_authen.ok D tests/msc_vlr/msc_vlr_test_reject_concurrency.c D tests/msc_vlr/msc_vlr_test_reject_concurrency.err D tests/msc_vlr/msc_vlr_test_reject_concurrency.ok D tests/msc_vlr/msc_vlr_test_rest.c D tests/msc_vlr/msc_vlr_test_rest.err D tests/msc_vlr/msc_vlr_test_rest.ok D tests/msc_vlr/msc_vlr_test_umts_authen.c D tests/msc_vlr/msc_vlr_test_umts_authen.err D tests/msc_vlr/msc_vlr_test_umts_authen.ok D tests/msc_vlr/msc_vlr_tests.c D tests/msc_vlr/msc_vlr_tests.h M tests/nanobts_omlattr/Makefile.am M tests/nanobts_omlattr/nanobts_omlattr_test.c D tests/oap/Makefile.am D tests/oap/oap_client_test.c D tests/oap/oap_client_test.err D tests/oap/oap_client_test.ok D tests/sgsn/Makefile.am D tests/sgsn/sgsn_test.c D tests/sgsn/sgsn_test.ok D tests/slhc/Makefile.am D tests/slhc/slhc_test.c D tests/slhc/slhc_test.ok D tests/smpp/Makefile.am D tests/smpp/smpp_test.c D tests/smpp/smpp_test.err D tests/smpp/smpp_test.ok D tests/smpp_test_runner.py D tests/sms_queue/Makefile.am D tests/sms_queue/sms_queue_test.c D tests/sms_queue/sms_queue_test.err D tests/sms_queue/sms_queue_test.ok D tests/sndcp_xid/Makefile.am D tests/sndcp_xid/sndcp_xid_test.c D tests/sndcp_xid/sndcp_xid_test.ok M tests/testsuite.at D tests/v42bis/Makefile.am D tests/v42bis/v42bis_test.c D tests/v42bis/v42bis_test.ok M tests/vty_test_runner.py D tests/xid/Makefile.am D tests/xid/xid_test.c D tests/xid/xid_test.ok 315 files changed, 2,246 insertions(+), 97,577 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/26/3726/2 -- To view, visit https://gerrit.osmocom.org/3726 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I832d57b882066184b55033bc4bd15e8354788d68 Gerrit-PatchSet: 2 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: dexter From gerrit-no-reply at lists.osmocom.org Mon Aug 28 13:18:21 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 28 Aug 2017 13:18:21 +0000 Subject: [PATCH] osmo-dev[master]: gen_makefile: tweak edit detector Message-ID: Review at https://gerrit.osmocom.org/3728 gen_makefile: tweak edit detector Change-Id: I6a1753e24b29226894fdfcac8132910501a633b8 --- M gen_makefile.py 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-dev refs/changes/28/3728/1 diff --git a/gen_makefile.py b/gen_makefile.py index 5af7803..05db443 100755 --- a/gen_makefile.py +++ b/gen_makefile.py @@ -153,7 +153,7 @@ .PHONY: .make.{proj}.detect_edits .make.{proj}.detect_edits: - @test -z "$(shell find {src_proj} -newer .make.{proj}.last_edited -name "*.[hc]")" || (touch .make.{proj}.last_edited; echo {proj} edited) + @test -z "$(shell find {src_proj} -newer .make.{proj}.last_edited -name "*.[hc]" '(' -name "*.[hc]" -or -name "Makefile.am" -or -name "*.py" ')' )" || (touch .make.{proj}.last_edited; echo {proj} edited) .make.{proj}.build: .make.{proj}.configure .make.{proj}.last_edited @echo "\n\n\n===== $@\n" -- To view, visit https://gerrit.osmocom.org/3728 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I6a1753e24b29226894fdfcac8132910501a633b8 Gerrit-PatchSet: 1 Gerrit-Project: osmo-dev Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Mon Aug 28 13:18:22 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 28 Aug 2017 13:18:22 +0000 Subject: [PATCH] osmo-dev[master]: add 2G.deps Message-ID: Review at https://gerrit.osmocom.org/3729 add 2G.deps Change-Id: I834310e07e771128117ac03e69c375457e7f2182 --- A 2G.deps 1 file changed, 12 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-dev refs/changes/29/3729/1 diff --git a/2G.deps b/2G.deps new file mode 100644 index 0000000..f041509 --- /dev/null +++ b/2G.deps @@ -0,0 +1,12 @@ +# project build these first +libosmocore +libosmo-abis libosmocore +libosmo-netif libosmo-abis +libosmo-sccp libosmo-netif +libsmpp34 +openggsn libosmocore +osmo-hlr libosmo-abis +osmo-mgw libosmo-netif +osmo-msc osmo-mgw +osmo-bsc libosmo-sccp osmo-mgw +osmo-sgsn -- To view, visit https://gerrit.osmocom.org/3729 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I834310e07e771128117ac03e69c375457e7f2182 Gerrit-PatchSet: 1 Gerrit-Project: osmo-dev Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Mon Aug 28 13:31:32 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 28 Aug 2017 13:31:32 +0000 Subject: osmo-dev[master]: gen_makefile: tweak edit detector In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 Verified+1 -- To view, visit https://gerrit.osmocom.org/3728 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I6a1753e24b29226894fdfcac8132910501a633b8 Gerrit-PatchSet: 1 Gerrit-Project: osmo-dev Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Aug 28 13:31:39 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 28 Aug 2017 13:31:39 +0000 Subject: osmo-dev[master]: add 2G.deps In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 Verified+1 -- To view, visit https://gerrit.osmocom.org/3729 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I834310e07e771128117ac03e69c375457e7f2182 Gerrit-PatchSet: 1 Gerrit-Project: osmo-dev Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Aug 28 13:31:41 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 28 Aug 2017 13:31:41 +0000 Subject: [MERGED] osmo-dev[master]: add 2G.deps In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: add 2G.deps ...................................................................... add 2G.deps Change-Id: I834310e07e771128117ac03e69c375457e7f2182 --- A 2G.deps 1 file changed, 12 insertions(+), 0 deletions(-) Approvals: Neels Hofmeyr: Looks good to me, approved; Verified diff --git a/2G.deps b/2G.deps new file mode 100644 index 0000000..f041509 --- /dev/null +++ b/2G.deps @@ -0,0 +1,12 @@ +# project build these first +libosmocore +libosmo-abis libosmocore +libosmo-netif libosmo-abis +libosmo-sccp libosmo-netif +libsmpp34 +openggsn libosmocore +osmo-hlr libosmo-abis +osmo-mgw libosmo-netif +osmo-msc osmo-mgw +osmo-bsc libosmo-sccp osmo-mgw +osmo-sgsn -- To view, visit https://gerrit.osmocom.org/3729 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I834310e07e771128117ac03e69c375457e7f2182 Gerrit-PatchSet: 1 Gerrit-Project: osmo-dev Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Mon Aug 28 13:31:41 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 28 Aug 2017 13:31:41 +0000 Subject: [MERGED] osmo-dev[master]: gen_makefile: tweak edit detector In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: gen_makefile: tweak edit detector ...................................................................... gen_makefile: tweak edit detector Change-Id: I6a1753e24b29226894fdfcac8132910501a633b8 --- M gen_makefile.py 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Neels Hofmeyr: Looks good to me, approved; Verified diff --git a/gen_makefile.py b/gen_makefile.py index 5af7803..05db443 100755 --- a/gen_makefile.py +++ b/gen_makefile.py @@ -153,7 +153,7 @@ .PHONY: .make.{proj}.detect_edits .make.{proj}.detect_edits: - @test -z "$(shell find {src_proj} -newer .make.{proj}.last_edited -name "*.[hc]")" || (touch .make.{proj}.last_edited; echo {proj} edited) + @test -z "$(shell find {src_proj} -newer .make.{proj}.last_edited -name "*.[hc]" '(' -name "*.[hc]" -or -name "Makefile.am" -or -name "*.py" ')' )" || (touch .make.{proj}.last_edited; echo {proj} edited) .make.{proj}.build: .make.{proj}.configure .make.{proj}.last_edited @echo "\n\n\n===== $@\n" -- To view, visit https://gerrit.osmocom.org/3728 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I6a1753e24b29226894fdfcac8132910501a633b8 Gerrit-PatchSet: 1 Gerrit-Project: osmo-dev Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Mon Aug 28 13:55:02 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 28 Aug 2017 13:55:02 +0000 Subject: [PATCH] osmo-sgsn[master]: NOT FOR MERGE: check pre_release branch build In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3727 to look at the new patch set (#2). NOT FOR MERGE: check pre_release branch build Change-Id: Ie22c5a8dbe3a55067c2cd15afee095eba572c2d8 --- M .gitignore M configure.ac M contrib/jenkins.sh D debian/autoreconf M debian/changelog M debian/control M debian/copyright D debian/docs D debian/openbsc-dev.install R debian/osmo-gbproxy.init A debian/osmo-gbproxy.install D debian/osmo-gtphub.examples M debian/osmo-gtphub.install A debian/osmo-sgsn.install D debian/osmocom-bs11-utils.install D debian/osmocom-bsc-nat.init D debian/osmocom-bsc-nat.install D debian/osmocom-bsc.examples D debian/osmocom-bsc.install D debian/osmocom-gbproxy.install D debian/osmocom-ipaccess-utils.install D debian/osmocom-nitb.default D debian/osmocom-nitb.dirs D debian/osmocom-nitb.examples D debian/osmocom-nitb.init D debian/osmocom-nitb.install D debian/osmocom-sgsn.default D debian/osmocom-sgsn.examples D debian/osmocom-sgsn.init D debian/osmocom-sgsn.install M debian/rules M doc/examples/osmo-bsc/osmo-bsc.cfg M doc/examples/osmo-sgsn/osmo-sgsn.cfg M include/openbsc/Makefile.am A include/openbsc/a_reset.h D include/openbsc/abis_nm.h D include/openbsc/abis_om2000.h D include/openbsc/abis_rsl.h D include/openbsc/arfcn_range_encode.h D include/openbsc/auth.h D include/openbsc/bsc_api.h D include/openbsc/bsc_msc.h D include/openbsc/bsc_msc_data.h D include/openbsc/bsc_msg_filter.h D include/openbsc/bsc_nat.h D include/openbsc/bsc_nat_callstats.h D include/openbsc/bsc_nat_sccp.h D include/openbsc/bsc_rll.h D include/openbsc/bsc_subscriber.h D include/openbsc/bss.h D include/openbsc/bts_ipaccess_nanobts_omlattr.h D include/openbsc/chan_alloc.h D include/openbsc/common_bsc.h D include/openbsc/common_cs.h D include/openbsc/ctrl.h D include/openbsc/db.h M include/openbsc/debug.h D include/openbsc/e1_config.h M include/openbsc/gprs_sgsn.h M include/openbsc/gprs_utils.h D include/openbsc/gsm_04_08.h D include/openbsc/gsm_04_11.h D include/openbsc/gsm_04_80.h D include/openbsc/gsm_data.h D include/openbsc/gsm_data_shared.h D include/openbsc/gsm_subscriber.h D include/openbsc/handover.h D include/openbsc/handover_decision.h D include/openbsc/ipaccess.h D include/openbsc/iu.h A include/openbsc/iu_dummy.h D include/openbsc/iucs.h D include/openbsc/iucs_ranap.h D include/openbsc/meas_feed.h D include/openbsc/meas_rep.h D include/openbsc/mgcp.h D include/openbsc/mgcp_internal.h D include/openbsc/mgcp_transcode.h D include/openbsc/mgcpgw_client.h D include/openbsc/misdn.h D include/openbsc/mncc.h D include/openbsc/mncc_int.h D include/openbsc/msc_ifaces.h D include/openbsc/nat_rewrite_trie.h D include/openbsc/network_listen.h D include/openbsc/openbscdefines.h D include/openbsc/osmo_bsc.h D include/openbsc/osmo_bsc_grace.h D include/openbsc/osmo_bsc_rf.h D include/openbsc/osmo_msc.h D include/openbsc/osmux.h D include/openbsc/paging.h D include/openbsc/pcu_if.h D include/openbsc/pcuif_proto.h D include/openbsc/rrlp.h D include/openbsc/rs232.h D include/openbsc/rtp_proxy.h M include/openbsc/sgsn.h M include/openbsc/signal.h D include/openbsc/silent_call.h D include/openbsc/smpp.h D include/openbsc/sms_queue.h D include/openbsc/socket.h D include/openbsc/system_information.h D include/openbsc/transaction.h D include/openbsc/trau_mux.h D include/openbsc/trau_upqueue.h D include/openbsc/ussd.h D include/openbsc/vlr.h M include/openbsc/vty.h M osmoappdesc.py M src/Makefile.am M src/gprs/Makefile.am M src/gprs/gb_proxy.c M src/gprs/gb_proxy_main.c M src/gprs/gb_proxy_patch.c M src/gprs/gb_proxy_peer.c M src/gprs/gb_proxy_vty.c M src/gprs/gprs_gmm.c M src/gprs/gprs_llc.c M src/gprs/gprs_llc_parse.c M src/gprs/gprs_llc_vty.c M src/gprs/gprs_sgsn.c M src/gprs/gprs_sndcp.c M src/gprs/gprs_sndcp_vty.c A src/gprs/gsup_client.c M src/gprs/gtphub_main.c M src/gprs/gtphub_vty.c A src/gprs/oap_client.c M src/gprs/sgsn_ares.c M src/gprs/sgsn_ctrl.c M src/gprs/sgsn_libgtp.c M src/gprs/sgsn_main.c M src/gprs/sgsn_vty.c D src/ipaccess/Makefile.am D src/ipaccess/abisip-find.c D src/ipaccess/ipaccess-config.c D src/ipaccess/ipaccess-firmware.c D src/ipaccess/ipaccess-proxy.c D src/ipaccess/network_listen.c D src/libbsc/Makefile.am D src/libbsc/abis_nm.c D src/libbsc/abis_nm_ipaccess.c D src/libbsc/abis_nm_vty.c D src/libbsc/abis_om2000.c D src/libbsc/abis_om2000_vty.c D src/libbsc/abis_rsl.c D src/libbsc/arfcn_range_encode.c D src/libbsc/bsc_api.c D src/libbsc/bsc_ctrl_commands.c D src/libbsc/bsc_ctrl_lookup.c D src/libbsc/bsc_dyn_ts.c D src/libbsc/bsc_init.c D src/libbsc/bsc_msc.c D src/libbsc/bsc_rf_ctrl.c D src/libbsc/bsc_rll.c D src/libbsc/bsc_subscriber.c D src/libbsc/bsc_vty.c D src/libbsc/bts_ericsson_rbs2000.c D src/libbsc/bts_init.c D src/libbsc/bts_ipaccess_nanobts.c D src/libbsc/bts_ipaccess_nanobts_omlattr.c D src/libbsc/bts_nokia_site.c D src/libbsc/bts_siemens_bs11.c D src/libbsc/bts_sysmobts.c D src/libbsc/bts_unknown.c D src/libbsc/chan_alloc.c D src/libbsc/e1_config.c D src/libbsc/gsm_04_08_utils.c D src/libbsc/gsm_04_80_utils.c D src/libbsc/handover_decision.c D src/libbsc/handover_logic.c D src/libbsc/meas_proc.c D src/libbsc/meas_rep.c D src/libbsc/net_init.c D src/libbsc/paging.c D src/libbsc/pcu_sock.c D src/libbsc/rest_octets.c D src/libbsc/system_information.c D src/libcommon-cs/Makefile.am D src/libcommon-cs/common_cs.c D src/libcommon-cs/common_cs_vty.c M src/libcommon/common_vty.c M src/libcommon/debug.c M src/libcommon/gsup_client.c D src/libfilter/Makefile.am D src/libfilter/bsc_msg_acc.c D src/libfilter/bsc_msg_filter.c D src/libfilter/bsc_msg_vty.c D src/libiu/Makefile.am D src/libiu/iu.c D src/libiu/iu_vty.c D src/libmgcp/Makefile.am D src/libmgcp/g711common.h D src/libmgcp/mgcp_common.c D src/libmgcp/mgcp_network.c D src/libmgcp/mgcp_osmux.c D src/libmgcp/mgcp_protocol.c D src/libmgcp/mgcp_sdp.c D src/libmgcp/mgcp_transcode.c D src/libmgcp/mgcp_vty.c D src/libmgcp/mgcpgw_client.c D src/libmgcp/mgcpgw_client_vty.c D src/libmsc/Makefile.am D src/libmsc/a_iface.c D src/libmsc/auth.c D src/libmsc/ctrl_commands.c D src/libmsc/db.c D src/libmsc/gsm_04_08.c D src/libmsc/gsm_04_11.c D src/libmsc/gsm_04_80.c D src/libmsc/gsm_subscriber.c M src/libmsc/iu_dummy.c D src/libmsc/iucs.c D src/libmsc/iucs_ranap.c D src/libmsc/meas_feed.c D src/libmsc/meas_feed.h D src/libmsc/mncc.c D src/libmsc/mncc_builtin.c D src/libmsc/mncc_sock.c D src/libmsc/msc_ifaces.c D src/libmsc/msc_vty.c D src/libmsc/osmo_msc.c D src/libmsc/rrlp.c D src/libmsc/silent_call.c D src/libmsc/smpp_openbsc.c D src/libmsc/smpp_smsc.c D src/libmsc/smpp_smsc.h D src/libmsc/smpp_utils.c D src/libmsc/smpp_vty.c D src/libmsc/sms_queue.c D src/libmsc/subscr_conn.c D src/libmsc/transaction.c D src/libmsc/ussd.c D src/libmsc/vty_interface_layer3.c D src/libtrau/Makefile.am D src/libtrau/rtp_proxy.c D src/libtrau/trau_mux.c D src/libtrau/trau_upqueue.c D src/libvlr/Makefile.am D src/libvlr/vlr.c D src/libvlr/vlr_access_req_fsm.c D src/libvlr/vlr_access_req_fsm.h D src/libvlr/vlr_auth_fsm.c D src/libvlr/vlr_auth_fsm.h D src/libvlr/vlr_core.h D src/libvlr/vlr_lu_fsm.c D src/libvlr/vlr_lu_fsm.h D src/osmo-bsc/Makefile.am D src/osmo-bsc/osmo_bsc_api.c D src/osmo-bsc/osmo_bsc_audio.c D src/osmo-bsc/osmo_bsc_bssap.c D src/osmo-bsc/osmo_bsc_ctrl.c D src/osmo-bsc/osmo_bsc_filter.c D src/osmo-bsc/osmo_bsc_grace.c D src/osmo-bsc/osmo_bsc_main.c D src/osmo-bsc/osmo_bsc_msc.c D src/osmo-bsc/osmo_bsc_sccp.c D src/osmo-bsc/osmo_bsc_vty.c D src/osmo-bsc_mgcp/Makefile.am D src/osmo-bsc_mgcp/mgcp_main.c D src/osmo-bsc_nat/Makefile.am D src/osmo-bsc_nat/bsc_filter.c D src/osmo-bsc_nat/bsc_mgcp_utils.c D src/osmo-bsc_nat/bsc_nat.c D src/osmo-bsc_nat/bsc_nat_ctrl.c D src/osmo-bsc_nat/bsc_nat_filter.c D src/osmo-bsc_nat/bsc_nat_rewrite.c D src/osmo-bsc_nat/bsc_nat_rewrite_trie.c D src/osmo-bsc_nat/bsc_nat_utils.c D src/osmo-bsc_nat/bsc_nat_vty.c D src/osmo-bsc_nat/bsc_sccp.c D src/osmo-bsc_nat/bsc_ussd.c D src/osmo-msc/Makefile.am D src/osmo-msc/msc_main.c D src/utils/Makefile.am D src/utils/bs11_config.c D src/utils/isdnsync.c D src/utils/meas_db.c D src/utils/meas_db.h D src/utils/meas_json.c D src/utils/meas_pcap2db.c D src/utils/meas_udp2db.c D src/utils/meas_vis.c D src/utils/smpp_mirror.c M tests/Makefile.am D tests/abis/Makefile.am D tests/abis/abis_test.c D tests/abis/abis_test.ok D tests/bsc-nat-trie/Makefile.am D tests/bsc-nat-trie/bsc_nat_trie_test.c D tests/bsc-nat-trie/bsc_nat_trie_test.ok D tests/bsc-nat-trie/prefixes.csv D tests/bsc-nat/Makefile.am D tests/bsc-nat/barr.cfg D tests/bsc-nat/barr_dup.cfg D tests/bsc-nat/bsc_data.c D tests/bsc-nat/bsc_nat_test.c D tests/bsc-nat/bsc_nat_test.ok D tests/bsc-nat/prefixes.csv D tests/bsc/Makefile.am D tests/bsc/bsc_test.c D tests/bsc/bsc_test.ok D tests/channel/Makefile.am D tests/channel/channel_test.c D tests/channel/channel_test.ok D tests/db/Makefile.am D tests/db/db_test.c D tests/db/db_test.err D tests/db/db_test.ok D tests/db/hlr.sqlite3 M tests/gbproxy/Makefile.am M tests/gbproxy/gbproxy_test.c D tests/gsm0408/Makefile.am D tests/gsm0408/gsm0408_test.c D tests/gsm0408/gsm0408_test.ok D tests/mgcp/Makefile.am D tests/mgcp/mgcp_test.c D tests/mgcp/mgcp_test.ok D tests/mgcp/mgcp_transcoding_test.c D tests/mgcp/mgcp_transcoding_test.ok D tests/mgcp/mgcpgw_client_test.c D tests/mgcp/mgcpgw_client_test.err D tests/mgcp/mgcpgw_client_test.ok D tests/msc_vlr/Makefile.am D tests/msc_vlr/msc_vlr_test_gsm_authen.c D tests/msc_vlr/msc_vlr_test_gsm_authen.err D tests/msc_vlr/msc_vlr_test_gsm_authen.ok D tests/msc_vlr/msc_vlr_test_gsm_ciph.c D tests/msc_vlr/msc_vlr_test_gsm_ciph.err D tests/msc_vlr/msc_vlr_test_gsm_ciph.ok D tests/msc_vlr/msc_vlr_test_hlr_reject.c D tests/msc_vlr/msc_vlr_test_hlr_reject.err D tests/msc_vlr/msc_vlr_test_hlr_reject.ok D tests/msc_vlr/msc_vlr_test_hlr_timeout.c D tests/msc_vlr/msc_vlr_test_hlr_timeout.err D tests/msc_vlr/msc_vlr_test_hlr_timeout.ok D tests/msc_vlr/msc_vlr_test_ms_timeout.c D tests/msc_vlr/msc_vlr_test_ms_timeout.err D tests/msc_vlr/msc_vlr_test_ms_timeout.ok D tests/msc_vlr/msc_vlr_test_no_authen.c D tests/msc_vlr/msc_vlr_test_no_authen.err D tests/msc_vlr/msc_vlr_test_no_authen.ok D tests/msc_vlr/msc_vlr_test_reject_concurrency.c D tests/msc_vlr/msc_vlr_test_reject_concurrency.err D tests/msc_vlr/msc_vlr_test_reject_concurrency.ok D tests/msc_vlr/msc_vlr_test_rest.c D tests/msc_vlr/msc_vlr_test_rest.err D tests/msc_vlr/msc_vlr_test_rest.ok D tests/msc_vlr/msc_vlr_test_umts_authen.c D tests/msc_vlr/msc_vlr_test_umts_authen.err D tests/msc_vlr/msc_vlr_test_umts_authen.ok D tests/msc_vlr/msc_vlr_tests.c D tests/msc_vlr/msc_vlr_tests.h D tests/nanobts_omlattr/Makefile.am D tests/nanobts_omlattr/nanobts_omlattr_test.c D tests/nanobts_omlattr/nanobts_omlattr_test.ok M tests/oap/Makefile.am M tests/sgsn/Makefile.am M tests/slhc/Makefile.am D tests/smpp/Makefile.am D tests/smpp/smpp_test.c D tests/smpp/smpp_test.err D tests/smpp/smpp_test.ok D tests/smpp_test_runner.py D tests/sms_queue/Makefile.am D tests/sms_queue/sms_queue_test.c D tests/sms_queue/sms_queue_test.err D tests/sms_queue/sms_queue_test.ok D tests/subscr/Makefile.am D tests/subscr/bsc_subscr_test.c D tests/subscr/bsc_subscr_test.err D tests/subscr/bsc_subscr_test.ok M tests/testsuite.at D tests/trau/Makefile.am D tests/trau/trau_test.c D tests/trau/trau_test.ok M tests/v42bis/Makefile.am M tests/vty_test_runner.py M tests/xid/Makefile.am 380 files changed, 1,584 insertions(+), 105,687 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-sgsn refs/changes/27/3727/2 -- To view, visit https://gerrit.osmocom.org/3727 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ie22c5a8dbe3a55067c2cd15afee095eba572c2d8 Gerrit-PatchSet: 2 Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: dexter From gerrit-no-reply at lists.osmocom.org Mon Aug 28 13:58:16 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 28 Aug 2017 13:58:16 +0000 Subject: [PATCH] osmo-mgw[master]: NOT FOR MERGE: check pre_release branch build In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3725 to look at the new patch set (#3). NOT FOR MERGE: check pre_release branch build Change-Id: I0632f1846563efc7d1968632cb0f3582a301b426 --- M .gitignore M Makefile.am M configure.ac D contrib/a-link/sccp-split-by-con.lua D contrib/bsc-test/README D contrib/bsc-test/all_dial D contrib/bsc-test/dial.sh D contrib/bsc-test/drop-oml.sh D contrib/bsc-test/drop.sh D contrib/bsc-test/hangup D contrib/bsc-test/msc.sh D contrib/bsc_control.py D contrib/bt.py D contrib/convert_to_enum.py D contrib/ctrl2sse.py D contrib/gprs/gb-proxy-unblock-bug.py D contrib/gprs/gprs-bssgp-histogram.lua D contrib/gprs/gprs-buffer-count.lua D contrib/gprs/gprs-split-trace-by-tlli.lua D contrib/gprs/gprs-verify-nu.lua D contrib/hlr-remove-old.sql D contrib/hlrsync/hlrsync.py D contrib/ipa.py M contrib/jenkins.sh D contrib/nat/test_regexp.c D contrib/nat/ussd_example.py D contrib/rtp/gen_rtp_header.erl D contrib/rtp/rtp_replay.st D contrib/rtp/rtp_replay_shared.st D contrib/rtp/rtp_replay_sip.st D contrib/rtp/timestamp_rtp.lua D contrib/sms/fill-hlr.st D contrib/sms/hlr-query.st D contrib/sms/sqlite-probe.tap.d D contrib/soap.py D contrib/systemd/osmo-bsc.service D contrib/systemd/osmo-gbproxy.service D contrib/systemd/osmo-msc.service D contrib/systemd/osmo-nitb.service D contrib/systemd/osmo-sgsn.service D contrib/testconv/Makefile D contrib/testconv/testconv_main.c D contrib/twisted_ipa.py D debian/autoreconf M debian/changelog M debian/control M debian/copyright D debian/docs A debian/libosmo-legacy-mgcp-dev.install A debian/libosmo-legacy-mgcp0.install D debian/openbsc-dev.install D debian/osmo-gtphub.default D debian/osmo-gtphub.examples D debian/osmo-gtphub.init D debian/osmo-gtphub.install A debian/osmo-mgw.install D debian/osmocom-bs11-utils.install D debian/osmocom-bsc-nat.init D debian/osmocom-bsc-nat.install D debian/osmocom-bsc.examples D debian/osmocom-bsc.install D debian/osmocom-gbproxy.init D debian/osmocom-gbproxy.install D debian/osmocom-ipaccess-utils.install D debian/osmocom-nitb.default D debian/osmocom-nitb.dirs D debian/osmocom-nitb.examples D debian/osmocom-nitb.init D debian/osmocom-nitb.install D debian/osmocom-sgsn.default D debian/osmocom-sgsn.examples D debian/osmocom-sgsn.init D debian/osmocom-sgsn.install M debian/rules M doc/examples/osmo-bsc/osmo-bsc.cfg M doc/examples/osmo-sgsn/osmo-sgsn.cfg M include/Makefile.am D include/compat_af_isdn.h D include/mISDNif.h D include/openbsc/Makefile.am D include/openbsc/abis_nm.h D include/openbsc/abis_om2000.h D include/openbsc/abis_rsl.h D include/openbsc/arfcn_range_encode.h D include/openbsc/auth.h D include/openbsc/bsc_api.h D include/openbsc/bsc_msc.h D include/openbsc/bsc_msc_data.h D include/openbsc/bsc_msg_filter.h D include/openbsc/bsc_nat.h D include/openbsc/bsc_nat_callstats.h D include/openbsc/bsc_nat_sccp.h D include/openbsc/bsc_rll.h D include/openbsc/bsc_subscriber.h D include/openbsc/bss.h D include/openbsc/bts_ipaccess_nanobts_omlattr.h D include/openbsc/chan_alloc.h D include/openbsc/common.h D include/openbsc/common_bsc.h D include/openbsc/common_cs.h D include/openbsc/crc24.h D include/openbsc/ctrl.h D include/openbsc/db.h D include/openbsc/debug.h D include/openbsc/e1_config.h D include/openbsc/gb_proxy.h D include/openbsc/gprs_gb_parse.h D include/openbsc/gprs_gmm.h D include/openbsc/gprs_llc.h D include/openbsc/gprs_llc_xid.h D include/openbsc/gprs_sgsn.h D include/openbsc/gprs_sndcp.h D include/openbsc/gprs_sndcp_comp.h D include/openbsc/gprs_sndcp_dcomp.h D include/openbsc/gprs_sndcp_pcomp.h D include/openbsc/gprs_sndcp_xid.h D include/openbsc/gprs_subscriber.h D include/openbsc/gprs_utils.h D include/openbsc/gsm_04_08.h D include/openbsc/gsm_04_11.h D include/openbsc/gsm_04_80.h D include/openbsc/gsm_data.h D include/openbsc/gsm_data_shared.h D include/openbsc/gsm_subscriber.h D include/openbsc/gsup_client.h D include/openbsc/gtphub.h D include/openbsc/handover.h D include/openbsc/handover_decision.h D include/openbsc/ipaccess.h D include/openbsc/iu.h A include/openbsc/iu_dummy.h D include/openbsc/iucs.h D include/openbsc/iucs_ranap.h D include/openbsc/meas_feed.h D include/openbsc/meas_rep.h D include/openbsc/mgcp.h D include/openbsc/mgcp_internal.h D include/openbsc/mgcpgw_client.h D include/openbsc/misdn.h D include/openbsc/mncc.h D include/openbsc/mncc_int.h D include/openbsc/msc_ifaces.h D include/openbsc/nat_rewrite_trie.h D include/openbsc/network_listen.h D include/openbsc/oap_client.h D include/openbsc/openbscdefines.h D include/openbsc/osmo_bsc.h D include/openbsc/osmo_bsc_grace.h D include/openbsc/osmo_bsc_rf.h D include/openbsc/osmo_msc.h D include/openbsc/paging.h D include/openbsc/pcu_if.h D include/openbsc/pcuif_proto.h D include/openbsc/rest_octets.h D include/openbsc/rrlp.h D include/openbsc/rs232.h D include/openbsc/rtp_proxy.h D include/openbsc/sgsn.h D include/openbsc/signal.h D include/openbsc/silent_call.h D include/openbsc/slhc.h D include/openbsc/smpp.h D include/openbsc/sms_queue.h D include/openbsc/socket.h D include/openbsc/system_information.h D include/openbsc/transaction.h D include/openbsc/trau_mux.h D include/openbsc/trau_upqueue.h D include/openbsc/ussd.h D include/openbsc/v42bis.h D include/openbsc/v42bis_private.h D include/openbsc/vlr.h D include/openbsc/vty.h A include/osmocom/Makefile.am A include/osmocom/legacy_mgcp/Makefile.am A include/osmocom/legacy_mgcp/mgcp.h A include/osmocom/legacy_mgcp/mgcp_internal.h R include/osmocom/legacy_mgcp/mgcp_transcode.h A include/osmocom/legacy_mgcp/mgcpgw_client.h A include/osmocom/legacy_mgcp/mgcpgw_client_internal.h R include/osmocom/legacy_mgcp/osmux.h A include/osmocom/legacy_mgcp/vty.h A libosmo-legacy-mgcp.pc.in D openbsc.pc.in M osmoappdesc.py M src/Makefile.am D src/gprs/.gitignore D src/gprs/Makefile.am D src/gprs/crc24.c D src/gprs/gb_proxy.c D src/gprs/gb_proxy_main.c D src/gprs/gb_proxy_patch.c D src/gprs/gb_proxy_peer.c D src/gprs/gb_proxy_tlli.c D src/gprs/gb_proxy_vty.c D src/gprs/gprs_gb_parse.c D src/gprs/gprs_gmm.c D src/gprs/gprs_llc.c D src/gprs/gprs_llc_parse.c D src/gprs/gprs_llc_vty.c D src/gprs/gprs_llc_xid.c D src/gprs/gprs_sgsn.c D src/gprs/gprs_sndcp.c D src/gprs/gprs_sndcp_comp.c D src/gprs/gprs_sndcp_dcomp.c D src/gprs/gprs_sndcp_pcomp.c D src/gprs/gprs_sndcp_vty.c D src/gprs/gprs_sndcp_xid.c D src/gprs/gprs_subscriber.c D src/gprs/gprs_utils.c D src/gprs/gtphub.c D src/gprs/gtphub_ares.c D src/gprs/gtphub_main.c D src/gprs/gtphub_sock.c D src/gprs/gtphub_vty.c D src/gprs/osmo_sgsn.cfg D src/gprs/sgsn_ares.c D src/gprs/sgsn_auth.c D src/gprs/sgsn_cdr.c D src/gprs/sgsn_ctrl.c D src/gprs/sgsn_libgtp.c D src/gprs/sgsn_main.c D src/gprs/sgsn_vty.c D src/gprs/slhc.c D src/gprs/v42bis.c D src/ipaccess/Makefile.am D src/ipaccess/abisip-find.c D src/ipaccess/ipaccess-config.c D src/ipaccess/ipaccess-firmware.c D src/ipaccess/ipaccess-proxy.c D src/ipaccess/network_listen.c D src/libbsc/Makefile.am D src/libbsc/abis_nm.c D src/libbsc/abis_nm_ipaccess.c D src/libbsc/abis_nm_vty.c D src/libbsc/abis_om2000.c D src/libbsc/abis_om2000_vty.c D src/libbsc/abis_rsl.c D src/libbsc/arfcn_range_encode.c D src/libbsc/bsc_api.c D src/libbsc/bsc_ctrl_commands.c D src/libbsc/bsc_ctrl_lookup.c D src/libbsc/bsc_dyn_ts.c D src/libbsc/bsc_init.c D src/libbsc/bsc_msc.c D src/libbsc/bsc_rf_ctrl.c D src/libbsc/bsc_rll.c D src/libbsc/bsc_subscriber.c D src/libbsc/bsc_vty.c D src/libbsc/bts_ericsson_rbs2000.c D src/libbsc/bts_init.c D src/libbsc/bts_ipaccess_nanobts.c D src/libbsc/bts_ipaccess_nanobts_omlattr.c D src/libbsc/bts_nokia_site.c D src/libbsc/bts_siemens_bs11.c D src/libbsc/bts_sysmobts.c D src/libbsc/bts_unknown.c D src/libbsc/chan_alloc.c D src/libbsc/e1_config.c D src/libbsc/gsm_04_08_utils.c D src/libbsc/gsm_04_80_utils.c D src/libbsc/handover_decision.c D src/libbsc/handover_logic.c D src/libbsc/meas_proc.c D src/libbsc/meas_rep.c D src/libbsc/net_init.c D src/libbsc/paging.c D src/libbsc/pcu_sock.c D src/libbsc/rest_octets.c D src/libbsc/system_information.c D src/libcommon-cs/Makefile.am D src/libcommon-cs/common_cs.c D src/libcommon-cs/common_cs_vty.c D src/libcommon/Makefile.am D src/libcommon/bsc_version.c D src/libcommon/common_vty.c D src/libcommon/debug.c D src/libcommon/gsm_data.c D src/libcommon/gsm_data_shared.c D src/libcommon/gsm_subscriber_base.c D src/libcommon/gsup_client.c D src/libcommon/gsup_test_client.c D src/libcommon/oap_client.c D src/libcommon/socket.c D src/libcommon/talloc_ctx.c D src/libfilter/Makefile.am D src/libfilter/bsc_msg_acc.c D src/libfilter/bsc_msg_filter.c D src/libfilter/bsc_msg_vty.c D src/libiu/Makefile.am D src/libiu/iu.c D src/libiu/iu_vty.c D src/libmgcp/Makefile.am D src/libmgcp/mgcp_common.c D src/libmgcp/mgcp_network.c D src/libmgcp/mgcp_osmux.c D src/libmgcp/mgcp_protocol.c D src/libmgcp/mgcp_sdp.c D src/libmgcp/mgcp_transcode.c D src/libmgcp/mgcp_vty.c D src/libmgcp/mgcpgw_client.c D src/libmgcp/mgcpgw_client_vty.c D src/libmsc/Makefile.am D src/libmsc/a_iface.c D src/libmsc/auth.c D src/libmsc/ctrl_commands.c D src/libmsc/db.c D src/libmsc/gsm_04_08.c D src/libmsc/gsm_04_11.c D src/libmsc/gsm_04_80.c D src/libmsc/gsm_subscriber.c D src/libmsc/iu_dummy.c D src/libmsc/iucs.c D src/libmsc/iucs_ranap.c D src/libmsc/meas_feed.c D src/libmsc/meas_feed.h D src/libmsc/mncc.c D src/libmsc/mncc_builtin.c D src/libmsc/mncc_sock.c D src/libmsc/msc_ifaces.c D src/libmsc/msc_vty.c D src/libmsc/osmo_msc.c D src/libmsc/rrlp.c D src/libmsc/silent_call.c D src/libmsc/smpp_openbsc.c D src/libmsc/smpp_smsc.c D src/libmsc/smpp_smsc.h D src/libmsc/smpp_utils.c D src/libmsc/smpp_vty.c D src/libmsc/sms_queue.c D src/libmsc/subscr_conn.c D src/libmsc/transaction.c D src/libmsc/ussd.c D src/libmsc/vty_interface_layer3.c A src/libosmo-legacy-mgcp/Makefile.am R src/libosmo-legacy-mgcp/g711common.h A src/libosmo-legacy-mgcp/mgcp_common.c A src/libosmo-legacy-mgcp/mgcp_network.c A src/libosmo-legacy-mgcp/mgcp_osmux.c A src/libosmo-legacy-mgcp/mgcp_protocol.c A src/libosmo-legacy-mgcp/mgcp_sdp.c A src/libosmo-legacy-mgcp/mgcp_transcode.c A src/libosmo-legacy-mgcp/mgcp_vty.c A src/libosmo-legacy-mgcp/mgcpgw_client.c A src/libosmo-legacy-mgcp/mgcpgw_client_vty.c D src/libtrau/Makefile.am D src/libtrau/rtp_proxy.c D src/libtrau/trau_mux.c D src/libtrau/trau_upqueue.c D src/libvlr/Makefile.am D src/libvlr/vlr.c D src/libvlr/vlr_access_req_fsm.c D src/libvlr/vlr_access_req_fsm.h D src/libvlr/vlr_auth_fsm.c D src/libvlr/vlr_auth_fsm.h D src/libvlr/vlr_core.h D src/libvlr/vlr_lu_fsm.c D src/libvlr/vlr_lu_fsm.h D src/osmo-bsc/Makefile.am D src/osmo-bsc/osmo_bsc_api.c D src/osmo-bsc/osmo_bsc_audio.c D src/osmo-bsc/osmo_bsc_bssap.c D src/osmo-bsc/osmo_bsc_ctrl.c D src/osmo-bsc/osmo_bsc_filter.c D src/osmo-bsc/osmo_bsc_grace.c D src/osmo-bsc/osmo_bsc_main.c D src/osmo-bsc/osmo_bsc_msc.c D src/osmo-bsc/osmo_bsc_sccp.c D src/osmo-bsc/osmo_bsc_vty.c M src/osmo-bsc_mgcp/Makefile.am M src/osmo-bsc_mgcp/mgcp_main.c D src/osmo-bsc_nat/Makefile.am D src/osmo-bsc_nat/bsc_filter.c D src/osmo-bsc_nat/bsc_mgcp_utils.c D src/osmo-bsc_nat/bsc_nat.c D src/osmo-bsc_nat/bsc_nat_ctrl.c D src/osmo-bsc_nat/bsc_nat_filter.c D src/osmo-bsc_nat/bsc_nat_rewrite.c D src/osmo-bsc_nat/bsc_nat_rewrite_trie.c D src/osmo-bsc_nat/bsc_nat_utils.c D src/osmo-bsc_nat/bsc_nat_vty.c D src/osmo-bsc_nat/bsc_sccp.c D src/osmo-bsc_nat/bsc_ussd.c D src/osmo-msc/Makefile.am D src/osmo-msc/msc_main.c D src/utils/Makefile.am D src/utils/bs11_config.c D src/utils/isdnsync.c D src/utils/meas_db.c D src/utils/meas_db.h D src/utils/meas_json.c D src/utils/meas_pcap2db.c D src/utils/meas_udp2db.c D src/utils/meas_vis.c D src/utils/smpp_mirror.c M tests/Makefile.am D tests/abis/Makefile.am D tests/abis/abis_test.c D tests/abis/abis_test.ok D tests/bsc-nat-trie/Makefile.am D tests/bsc-nat-trie/bsc_nat_trie_test.c D tests/bsc-nat-trie/bsc_nat_trie_test.ok D tests/bsc-nat-trie/prefixes.csv D tests/bsc-nat/Makefile.am D tests/bsc-nat/barr.cfg D tests/bsc-nat/barr_dup.cfg D tests/bsc-nat/bsc_data.c D tests/bsc-nat/bsc_nat_test.c D tests/bsc-nat/bsc_nat_test.ok D tests/bsc-nat/prefixes.csv D tests/bsc/Makefile.am D tests/bsc/bsc_test.c D tests/bsc/bsc_test.ok D tests/channel/Makefile.am D tests/channel/channel_test.c D tests/channel/channel_test.ok D tests/db/Makefile.am D tests/db/db_test.c D tests/db/db_test.err D tests/db/db_test.ok D tests/db/hlr.sqlite3 D tests/gbproxy/Makefile.am D tests/gbproxy/gbproxy_test.c D tests/gbproxy/gbproxy_test.ok D tests/gprs/Makefile.am D tests/gprs/gprs_test.c D tests/gprs/gprs_test.ok D tests/gsm0408/Makefile.am D tests/gsm0408/gsm0408_test.c D tests/gsm0408/gsm0408_test.ok D tests/gtphub/Makefile.am D tests/gtphub/gtphub_test.c D tests/gtphub/gtphub_test.ok A tests/legacy_mgcp/Makefile.am A tests/legacy_mgcp/mgcp_test.c R tests/legacy_mgcp/mgcp_test.ok A tests/legacy_mgcp/mgcp_transcoding_test.c R tests/legacy_mgcp/mgcp_transcoding_test.ok A tests/legacy_mgcp/mgcpgw_client_test.c R tests/legacy_mgcp/mgcpgw_client_test.err R tests/legacy_mgcp/mgcpgw_client_test.ok D tests/mgcp/Makefile.am D tests/mgcp/mgcp_test.c D tests/mgcp/mgcp_transcoding_test.c D tests/mgcp/mgcpgw_client_test.c D tests/msc_vlr/Makefile.am D tests/msc_vlr/msc_vlr_test_gsm_authen.c D tests/msc_vlr/msc_vlr_test_gsm_authen.err D tests/msc_vlr/msc_vlr_test_gsm_authen.ok D tests/msc_vlr/msc_vlr_test_gsm_ciph.c D tests/msc_vlr/msc_vlr_test_gsm_ciph.err D tests/msc_vlr/msc_vlr_test_gsm_ciph.ok D tests/msc_vlr/msc_vlr_test_hlr_reject.c D tests/msc_vlr/msc_vlr_test_hlr_reject.err D tests/msc_vlr/msc_vlr_test_hlr_reject.ok D tests/msc_vlr/msc_vlr_test_hlr_timeout.c D tests/msc_vlr/msc_vlr_test_hlr_timeout.err D tests/msc_vlr/msc_vlr_test_hlr_timeout.ok D tests/msc_vlr/msc_vlr_test_ms_timeout.c D tests/msc_vlr/msc_vlr_test_ms_timeout.err D tests/msc_vlr/msc_vlr_test_ms_timeout.ok D tests/msc_vlr/msc_vlr_test_no_authen.c D tests/msc_vlr/msc_vlr_test_no_authen.err D tests/msc_vlr/msc_vlr_test_no_authen.ok D tests/msc_vlr/msc_vlr_test_reject_concurrency.c D tests/msc_vlr/msc_vlr_test_reject_concurrency.err D tests/msc_vlr/msc_vlr_test_reject_concurrency.ok D tests/msc_vlr/msc_vlr_test_rest.c D tests/msc_vlr/msc_vlr_test_rest.err D tests/msc_vlr/msc_vlr_test_rest.ok D tests/msc_vlr/msc_vlr_test_umts_authen.c D tests/msc_vlr/msc_vlr_test_umts_authen.err D tests/msc_vlr/msc_vlr_test_umts_authen.ok D tests/msc_vlr/msc_vlr_tests.c D tests/msc_vlr/msc_vlr_tests.h D tests/nanobts_omlattr/Makefile.am D tests/nanobts_omlattr/nanobts_omlattr_test.c D tests/nanobts_omlattr/nanobts_omlattr_test.ok D tests/oap/Makefile.am D tests/oap/oap_client_test.c D tests/oap/oap_client_test.err D tests/oap/oap_client_test.ok D tests/sgsn/Makefile.am D tests/sgsn/sgsn_test.c D tests/sgsn/sgsn_test.ok D tests/slhc/Makefile.am D tests/slhc/slhc_test.c D tests/slhc/slhc_test.ok D tests/smpp/Makefile.am D tests/smpp/smpp_test.c D tests/smpp/smpp_test.err D tests/smpp/smpp_test.ok D tests/smpp_test_runner.py D tests/sms_queue/Makefile.am D tests/sms_queue/sms_queue_test.c D tests/sms_queue/sms_queue_test.err D tests/sms_queue/sms_queue_test.ok D tests/sndcp_xid/Makefile.am D tests/sndcp_xid/sndcp_xid_test.c D tests/sndcp_xid/sndcp_xid_test.ok D tests/subscr/Makefile.am D tests/subscr/bsc_subscr_test.c D tests/subscr/bsc_subscr_test.err D tests/subscr/bsc_subscr_test.ok M tests/testsuite.at D tests/trau/Makefile.am D tests/trau/trau_test.c D tests/trau/trau_test.ok D tests/v42bis/Makefile.am D tests/v42bis/v42bis_test.c D tests/v42bis/v42bis_test.ok D tests/xid/Makefile.am D tests/xid/xid_test.c D tests/xid/xid_test.ok 514 files changed, 9,989 insertions(+), 157,661 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-mgw refs/changes/25/3725/3 -- To view, visit https://gerrit.osmocom.org/3725 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I0632f1846563efc7d1968632cb0f3582a301b426 Gerrit-PatchSet: 3 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: dexter From gerrit-no-reply at lists.osmocom.org Mon Aug 28 16:07:14 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 28 Aug 2017 16:07:14 +0000 Subject: [PATCH] libosmocore[master]: Cleanup jenkins build scripts In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3132 to look at the new patch set (#2). Cleanup jenkins build scripts * reorder builds to avoid rm -rf invocation * avoid useless double autoreconf * move common parts into shared helper * move common build steps into separate function Change-Id: I24e500e132f5c8e8133d35548cb7b4e4552331d0 --- M contrib/jenkins-arm.sh M contrib/jenkins.sh A contrib/jenkins_common.sh 3 files changed, 28 insertions(+), 45 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/32/3132/2 diff --git a/contrib/jenkins-arm.sh b/contrib/jenkins-arm.sh index ad992af..507652f 100755 --- a/contrib/jenkins-arm.sh +++ b/contrib/jenkins-arm.sh @@ -1,33 +1,16 @@ #!/bin/sh -set -ex +. $(dirname "$0")/jenkins_common.sh -verify_value_string_arrays_are_terminated.py $(find . -name "*.[hc]") - -autoreconf --install --force -./configure --enable-static \ - --prefix=/usr/local/arm-none-eabi \ - --host=arm-none-eabi \ - --enable-embedded \ - --disable-shared \ - CFLAGS="-Os -ffunction-sections -fdata-sections -nostartfiles -nodefaultlibs -Werror" - -$MAKE $PARALLEL_MAKE \ - || cat-testlogs.sh +build() { + $1 --enable-static --prefix=/usr/local/arm-none-eabi --host=arm-none-eabi --enable-embedded --disable-shared CFLAGS="-Os -ffunction-sections -fdata-sections -nostartfiles -nodefaultlibs -Werror" + $MAKE $PARALLEL_MAKE || cat-testlogs.sh +} # verify build in dir other than source tree -rm -rf * -git checkout . -autoreconf --install --force -mkdir builddir +mkdir -p builddir cd builddir +build ../configure -../configure --enable-static \ - --prefix=/usr/local/arm-none-eabi \ - --host=arm-none-eabi \ - --enable-embedded \ - --disable-shared \ - CFLAGS="-Os -ffunction-sections -fdata-sections -nostartfiles -nodefaultlibs -Werror" - -$MAKE $PARALLEL_MAKE \ - || cat-testlogs.sh +cd .. +build ./configure diff --git a/contrib/jenkins.sh b/contrib/jenkins.sh index 4a26776..20c1b71 100755 --- a/contrib/jenkins.sh +++ b/contrib/jenkins.sh @@ -1,31 +1,24 @@ #!/bin/sh # jenkins build helper script for libosmo-sccp. This is how we build on jenkins.osmocom.org -set -ex +. $(dirname "$0")/jenkins_common.sh -verify_value_string_arrays_are_terminated.py $(find . -name "*.[hc]") +ENABLE_SANITIZE="--enable-sanitize" if [ "x$label" = "xFreeBSD_amd64" ]; then ENABLE_SANITIZE="" -else - ENABLE_SANITIZE="--enable-sanitize" fi -autoreconf --install --force -./configure --enable-static $ENABLE_SANITIZE CFLAGS="-Werror" CPPFLAGS="-Werror" -$MAKE $PARALLEL_MAKE check \ - || cat-testlogs.sh -$MAKE distcheck \ - || cat-testlogs.sh +build() { + $1 --enable-static $2 CFLAGS="-Werror" CPPFLAGS="-Werror" + $MAKE $PARALLEL_MAKE check || cat-testlogs.sh + $MAKE distcheck || cat-testlogs.sh +} # verify build in dir other than source tree -rm -rf * -git checkout . -autoreconf --install --force -mkdir builddir +mkdir -p builddir cd builddir -../configure --enable-static CFLAGS="-Werror" CPPFLAGS="-Werror" -$MAKE $PARALLEL_MAKE check \ - || cat-testlogs.sh -$MAKE distcheck \ - || cat-testlogs.sh +build ../configure $ENABLE_SANITIZE + +cd .. +build ./configure $ENABLE_SANITIZE diff --git a/contrib/jenkins_common.sh b/contrib/jenkins_common.sh new file mode 100644 index 0000000..e52a96a --- /dev/null +++ b/contrib/jenkins_common.sh @@ -0,0 +1,7 @@ +#!/bin/sh + +set -ex + +verify_value_string_arrays_are_terminated.py $(find . -name "*.[hc]") + +autoreconf --install --force -- To view, visit https://gerrit.osmocom.org/3132 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I24e500e132f5c8e8133d35548cb7b4e4552331d0 Gerrit-PatchSet: 2 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: blobb Gerrit-Reviewer: lynxis lazus Gerrit-Reviewer: neels From gerrit-no-reply at lists.osmocom.org Mon Aug 28 16:12:49 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 28 Aug 2017 16:12:49 +0000 Subject: [PATCH] osmo-bts[master]: Use git-version-gen from gnulib 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/3679 to look at the new patch set (#2). Use git-version-gen from gnulib Depend on gnulib package and use upstream's git-version-gen instead of local copy. Change-Id: I290acecbbb91f5ee713a035d07e23e7d5c0cf03c Related: OS#2467 --- M Makefile.am M configure.ac M debian/control D git-version-gen 4 files changed, 3 insertions(+), 153 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/79/3679/2 diff --git a/Makefile.am b/Makefile.am index 4832c84..0cd5373 100644 --- a/Makefile.am +++ b/Makefile.am @@ -15,7 +15,7 @@ doc/examples/sysmo/sysmobts-mgr.cfg \ doc/examples/virtual/openbsc-virtual.cfg \ doc/examples/virtual/osmobts-virtual.cfg \ - git-version-gen .version \ + .version \ README.md @RELMAKE@ diff --git a/configure.ac b/configure.ac index bc36456..d741d2e 100644 --- a/configure.ac +++ b/configure.ac @@ -1,6 +1,6 @@ dnl Process this file with autoconf to produce a configure script AC_INIT([osmo-bts], - m4_esyscmd([./git-version-gen .tarball-version]), + m4_esyscmd([/usr/share/gnulib/build-aux/git-version-gen .tarball-version]), [openbsc-devel at lists.openbsc.org]) dnl *This* is the root dir, even if an install-sh exists in ../ or ../../ diff --git a/debian/control b/debian/control index e1a58b2..c7c34d8 100644 --- a/debian/control +++ b/debian/control @@ -4,6 +4,7 @@ Priority: optional Build-Depends: debhelper (>= 9), pkg-config, + gnulib, dh-autoreconf, dh-systemd (>= 1.5), autotools-dev, diff --git a/git-version-gen b/git-version-gen deleted file mode 100755 index 42cf3d2..0000000 --- a/git-version-gen +++ /dev/null @@ -1,151 +0,0 @@ -#!/bin/sh -# Print a version string. -scriptversion=2010-01-28.01 - -# Copyright (C) 2007-2010 Free Software Foundation, Inc. -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 3 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . - -# This script is derived from GIT-VERSION-GEN from GIT: http://git.or.cz/. -# It may be run two ways: -# - from a git repository in which the "git describe" command below -# produces useful output (thus requiring at least one signed tag) -# - from a non-git-repo directory containing a .tarball-version file, which -# presumes this script is invoked like "./git-version-gen .tarball-version". - -# In order to use intra-version strings in your project, you will need two -# separate generated version string files: -# -# .tarball-version - present only in a distribution tarball, and not in -# a checked-out repository. Created with contents that were learned at -# the last time autoconf was run, and used by git-version-gen. Must not -# be present in either $(srcdir) or $(builddir) for git-version-gen to -# give accurate answers during normal development with a checked out tree, -# but must be present in a tarball when there is no version control system. -# Therefore, it cannot be used in any dependencies. GNUmakefile has -# hooks to force a reconfigure at distribution time to get the value -# correct, without penalizing normal development with extra reconfigures. -# -# .version - present in a checked-out repository and in a distribution -# tarball. Usable in dependencies, particularly for files that don't -# want to depend on config.h but do want to track version changes. -# Delete this file prior to any autoconf run where you want to rebuild -# files to pick up a version string change; and leave it stale to -# minimize rebuild time after unrelated changes to configure sources. -# -# It is probably wise to add these two files to .gitignore, so that you -# don't accidentally commit either generated file. -# -# Use the following line in your configure.ac, so that $(VERSION) will -# automatically be up-to-date each time configure is run (and note that -# since configure.ac no longer includes a version string, Makefile rules -# should not depend on configure.ac for version updates). -# -# AC_INIT([GNU project], -# m4_esyscmd([build-aux/git-version-gen .tarball-version]), -# [bug-project at example]) -# -# Then use the following lines in your Makefile.am, so that .version -# will be present for dependencies, and so that .tarball-version will -# exist in distribution tarballs. -# -# BUILT_SOURCES = $(top_srcdir)/.version -# $(top_srcdir)/.version: -# echo $(VERSION) > $@-t && mv $@-t $@ -# dist-hook: -# echo $(VERSION) > $(distdir)/.tarball-version - -case $# in - 1) ;; - *) echo 1>&2 "Usage: $0 \$srcdir/.tarball-version"; exit 1;; -esac - -tarball_version_file=$1 -nl=' -' - -# First see if there is a tarball-only version file. -# then try "git describe", then default. -if test -f $tarball_version_file -then - v=`cat $tarball_version_file` || exit 1 - case $v in - *$nl*) v= ;; # reject multi-line output - [0-9]*) ;; - *) v= ;; - esac - test -z "$v" \ - && echo "$0: WARNING: $tarball_version_file seems to be damaged" 1>&2 -fi - -if test -n "$v" -then - : # use $v -elif - v=`git describe --abbrev=4 --match='v*' HEAD 2>/dev/null \ - || git describe --abbrev=4 HEAD 2>/dev/null` \ - && case $v in - [0-9]*) ;; - v[0-9]*) ;; - *) (exit 1) ;; - esac -then - # Is this a new git that lists number of commits since the last - # tag or the previous older version that did not? - # Newer: v6.10-77-g0f8faeb - # Older: v6.10-g0f8faeb - case $v in - *-*-*) : git describe is okay three part flavor ;; - *-*) - : git describe is older two part flavor - # Recreate the number of commits and rewrite such that the - # result is the same as if we were using the newer version - # of git describe. - vtag=`echo "$v" | sed 's/-.*//'` - numcommits=`git rev-list "$vtag"..HEAD | wc -l` - v=`echo "$v" | sed "s/\(.*\)-\(.*\)/\1-$numcommits-\2/"`; - ;; - esac - - # Change the first '-' to a '.', so version-comparing tools work properly. - # Remove the "g" in git describe's output string, to save a byte. - v=`echo "$v" | sed 's/-/./;s/\(.*\)-g/\1-/'`; -else - v=UNKNOWN -fi - -v=`echo "$v" |sed 's/^v//'` - -# Don't declare a version "dirty" merely because a time stamp has changed. -git status > /dev/null 2>&1 - -dirty=`sh -c 'git diff-index --name-only HEAD' 2>/dev/null` || dirty= -case "$dirty" in - '') ;; - *) # Append the suffix only if there isn't one already. - case $v in - *-dirty) ;; - *) v="$v-dirty" ;; - esac ;; -esac - -# Omit the trailing newline, so that m4_esyscmd can use the result directly. -echo "$v" | tr -d '\012' - -# Local variables: -# eval: (add-hook 'write-file-hooks 'time-stamp) -# time-stamp-start: "scriptversion=" -# time-stamp-format: "%:y-%02m-%02d.%02H" -# time-stamp-end: "$" -# End: -- To view, visit https://gerrit.osmocom.org/3679 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I290acecbbb91f5ee713a035d07e23e7d5c0cf03c Gerrit-PatchSet: 2 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Mon Aug 28 16:39:17 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Mon, 28 Aug 2017 16:39:17 +0000 Subject: [PATCH] osmo-gsm-tester[master]: config: Fix variable reference before assigment Message-ID: Review at https://gerrit.osmocom.org/3730 config: Fix variable reference before assigment Change-Id: I1a1acd7b3e5ff96b09a9a8e2825fb864ead9e54b --- M src/osmo_gsm_tester/config.py 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-tester refs/changes/30/3730/1 diff --git a/src/osmo_gsm_tester/config.py b/src/osmo_gsm_tester/config.py index 392cd04..4866524 100644 --- a/src/osmo_gsm_tester/config.py +++ b/src/osmo_gsm_tester/config.py @@ -271,7 +271,7 @@ if not is_list(src): raise ValueError('cannot combine list with a value of type: %r' % type(src)) for i in range(len(src)): - log.ctx(key=key) + log.ctx(idx=i) dest[i] = overlay(dest[i], src[i]) return dest return src -- To view, visit https://gerrit.osmocom.org/3730 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I1a1acd7b3e5ff96b09a9a8e2825fb864ead9e54b Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Mon Aug 28 16:39:18 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Mon, 28 Aug 2017 16:39:18 +0000 Subject: [PATCH] osmo-gsm-tester[master]: Reserve ARFCN dynamically based on BTS band support Message-ID: Review at https://gerrit.osmocom.org/3731 Reserve ARFCN dynamically based on BTS band support Instead of statically specifying a band for a BTS to use, declare a list of supported bands for each BTS. At the time of BTS object creation, ask the BTS for band support and try to dynamically reserve an ARFCN resource which is compatible with any of the bands supported by the BTS. All this happens transparently to the test. Still, the test may want to use a specific band / arfcn. In this case, a test can use suite.reserve_arfcn(band, arfcn) to reserve a specific band/arfcn and pass that to the BTS at creation time, which will then use that one instead of trying to find a suitable one. It is left as future work to support BTs with multiple TRX, in which case several arfcn must be reserved. It should not be that difficult, mostly using "times: X" where X is the amount of trx, changing the API to use a list of arfcns and the configure() methods of the BTS. Change-Id: I6fb5d95bed1fa50c3deaf62a7a6df3cb276bc3c9 --- M example/default-suites.conf M example/defaults.conf M example/resources.conf A example/scenarios/band-1900.conf M selftest/conf/resources.conf M selftest/resource_test.ok M selftest/suite_test.ok M selftest/suite_test/resources.conf M src/osmo_gsm_tester/bts_osmotrx.py M src/osmo_gsm_tester/bts_sysmo.py M src/osmo_gsm_tester/resource.py M src/osmo_gsm_tester/schema.py M src/osmo_gsm_tester/suite.py A suites/register/register_band_1900.py A suites/register/suite.conf 15 files changed, 150 insertions(+), 32 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-tester refs/changes/31/3731/1 diff --git a/example/default-suites.conf b/example/default-suites.conf index 1e8d47a..7fc97d3 100644 --- a/example/default-suites.conf +++ b/example/default-suites.conf @@ -7,3 +7,4 @@ - smpp - aoip_smpp - aoip_encryption:cipher-a50+cipher-a51 +- register:band-1900 diff --git a/example/defaults.conf b/example/defaults.conf index 082f159..36718f9 100644 --- a/example/defaults.conf +++ b/example/defaults.conf @@ -34,7 +34,6 @@ osmobsc_bts_type: sysmobts trx_list: - max_power_red: 0 - arfcn: 868 timeslot_list: - phys_chan_config: CCCH+SDCCH4 - phys_chan_config: SDCCH8 diff --git a/example/resources.conf b/example/resources.conf index 01df57e..b6766ab 100644 --- a/example/resources.conf +++ b/example/resources.conf @@ -12,14 +12,14 @@ type: osmo-bts-sysmo ipa_unit_id: 1 addr: 10.42.42.114 - band: GSM-1800 + bands: ['GSM-850', 'GSM-900', 'GSM-1800', 'GSM-1900'] ciphers: ['a5 0', 'a5 1', 'a5 2', 'a5 3'] - label: Ettus B200 type: osmo-bts-trx ipa_unit_id: 6 addr: 10.42.42.50 - band: GSM-1800 + bands: ['GSM-1800', 'GSM-1900'] launch_trx: true ciphers: ['a5 0', 'a5 1'] @@ -27,7 +27,7 @@ type: osmo-bts-trx ipa_unit_id: 7 addr: 10.42.42.51 - band: GSM-1800 + bands: ['GSM-1800'] trx_remote_ip: 10.42.42.112 ciphers: ['a5 0', 'a5 1'] diff --git a/example/scenarios/band-1900.conf b/example/scenarios/band-1900.conf new file mode 100644 index 0000000..956c8db --- /dev/null +++ b/example/scenarios/band-1900.conf @@ -0,0 +1,4 @@ +resources: + bts: + - bands: + - GSM-1900 diff --git a/selftest/conf/resources.conf b/selftest/conf/resources.conf index 51f5a72..b8e9945 100644 --- a/selftest/conf/resources.conf +++ b/selftest/conf/resources.conf @@ -12,7 +12,7 @@ type: osmo-bts-sysmo ipa_unit_id: 1 addr: 10.42.42.114 - band: GSM-1800 + bands: ['GSM-850', 'GSM-900', 'GSM-1800', 'GSM-1900'] ciphers: - 'a5 0' - 'a5 1' @@ -21,7 +21,7 @@ type: osmo-bts-trx ipa_unit_id: 6 addr: 10.42.42.50 - band: GSM-1800 + bands: ['GSM-1800'] launch_trx: true ciphers: - 'a5 0' @@ -31,7 +31,7 @@ type: osmo-bts-trx ipa_unit_id: 7 addr: 10.42.42.51 - band: GSM-1800 + bands: ['GSM-1800'] trx_remote_ip: 10.42.42.112 ciphers: - 'a5 0' diff --git a/selftest/resource_test.ok b/selftest/resource_test.ok index 88ff588..38b38d4 100644 --- a/selftest/resource_test.ok +++ b/selftest/resource_test.ok @@ -46,16 +46,16 @@ {'_hash': 'dc9ce027a257da087f31a5bc1ee6b4abd2637369', 'arfcn': '548', 'band': 'GSM-1900'}], - 'bts': [{'_hash': 'f153f466355087b1a838a7aaa8f6f707de1e8925', + 'bts': [{'_hash': 'fefeacfa23e2be8b5a0239fafa46a99a30ccbf57', 'addr': '10.42.42.114', - 'band': 'GSM-1800', + 'bands': ['GSM-850', 'GSM-900', 'GSM-1800', 'GSM-1900'], 'ciphers': ['a5 0', 'a5 1'], 'ipa_unit_id': '1', 'label': 'sysmoBTS 1002', 'type': 'osmo-bts-sysmo'}, {'_hash': '3343d4cf95efae02644ecb5870417c26830107dc', 'addr': '10.42.42.50', - 'band': 'GSM-1800', + 'bands': ['GSM-1800'], 'ciphers': ['a5 0', 'a5 1'], 'ipa_unit_id': '6', 'label': 'Ettus B200', @@ -63,7 +63,7 @@ 'type': 'osmo-bts-trx'}, {'_hash': 'f6faf75c74c240af32658b54123edca33e30498e', 'addr': '10.42.42.51', - 'band': 'GSM-1800', + 'bands': ['GSM-1800'], 'ciphers': ['a5 0', 'a5 1'], 'ipa_unit_id': '7', 'label': 'sysmoCell 5000', @@ -118,9 +118,13 @@ arfcn: '514' band: GSM-1800 --- testowner: Reserving 2 x bts (candidates: 3) ---- testowner: DBG: Picked - _hash: f153f466355087b1a838a7aaa8f6f707de1e8925 +--- testowner: DBG: Picked - _hash: fefeacfa23e2be8b5a0239fafa46a99a30ccbf57 addr: 10.42.42.114 - band: GSM-1800 + bands: + - GSM-850 + - GSM-900 + - GSM-1800 + - GSM-1900 ciphers: - a5 0 - a5 1 @@ -129,7 +133,8 @@ type: osmo-bts-sysmo - _hash: 3343d4cf95efae02644ecb5870417c26830107dc addr: 10.42.42.50 - band: GSM-1800 + bands: + - GSM-1800 ciphers: - a5 0 - a5 1 @@ -170,10 +175,14 @@ arfcn: '514' band: GSM-1800 bts: -- _hash: f153f466355087b1a838a7aaa8f6f707de1e8925 +- _hash: fefeacfa23e2be8b5a0239fafa46a99a30ccbf57 _reserved_by: testowner-123-1490837279 addr: 10.42.42.114 - band: GSM-1800 + bands: + - GSM-850 + - GSM-900 + - GSM-1800 + - GSM-1900 ciphers: - a5 0 - a5 1 @@ -183,7 +192,8 @@ - _hash: 3343d4cf95efae02644ecb5870417c26830107dc _reserved_by: testowner-123-1490837279 addr: 10.42.42.50 - band: GSM-1800 + bands: + - GSM-1800 ciphers: - a5 0 - a5 1 diff --git a/selftest/suite_test.ok b/selftest/suite_test.ok index 2808474..8fbf8b8 100644 --- a/selftest/suite_test.ok +++ b/selftest/suite_test.ok @@ -32,9 +32,13 @@ tst test_suite: DBG: {combining='resources'} tst {combining_scenarios='resources'}: DBG: {definition_conf={bts=[{'times': '1'}], ip_address=[{'times': '1'}], modem=[{'times': '2'}]}} [test_suite?{combining_scenarios='resources'}] tst test_suite: Reserving 1 x bts (candidates: 3) -tst test_suite: DBG: Picked - _hash: 07d9c8aaa940b674efcbbabdd69f58a6ce4e94f9 +tst test_suite: DBG: Picked - _hash: c8a01d42f3977e49ceff0734a1475857913dfb13 addr: 10.42.42.114 - band: GSM-1800 + bands: + - GSM-850 + - GSM-900 + - GSM-1800 + - GSM-1900 ipa_unit_id: '1' label: sysmoBTS 1002 type: sysmo diff --git a/selftest/suite_test/resources.conf b/selftest/suite_test/resources.conf index 2005590..6e40798 100644 --- a/selftest/suite_test/resources.conf +++ b/selftest/suite_test/resources.conf @@ -10,13 +10,13 @@ type: sysmo ipa_unit_id: 1 addr: 10.42.42.114 - band: GSM-1800 + bands: ['GSM-850', 'GSM-900', 'GSM-1800', 'GSM-1900'] - label: octBTS 3000 type: oct ipa_unit_id: 5 addr: 10.42.42.115 - band: GSM-1800 + bands: ['GSM-1800'] trx_list: - hw_addr: 00:0c:90:32:b5:8a @@ -24,7 +24,7 @@ type: nanobts ipa_unit_id: 1902 addr: 10.42.42.190 - band: GSM-1900 + bands: ['GSM-1800'] trx_list: - hw_addr: 00:02:95:00:41:b3 diff --git a/src/osmo_gsm_tester/bts_osmotrx.py b/src/osmo_gsm_tester/bts_osmotrx.py index b5262a2..3034c25 100644 --- a/src/osmo_gsm_tester/bts_osmotrx.py +++ b/src/osmo_gsm_tester/bts_osmotrx.py @@ -43,6 +43,18 @@ def remote_addr(self): return self.conf.get('addr') + def supported_bands(self): + return self.conf.get('bands', []) + + def set_arfcn_resource(self, band_arfcn): + self.band_arfcn = band_arfcn + + def band(self): + return self.band_arfcn.get('band') + + def arfcn(self): + return int(self.band_arfcn.get('arfcn')) + def trx_remote_ip(self): conf_ip = self.conf.get('trx_remote_ip', None) if conf_ip is not None: @@ -105,7 +117,8 @@ 'oml_remote_ip': self.bsc.addr(), 'trx_local_ip': self.remote_addr(), 'trx_remote_ip': self.trx_remote_ip(), - 'pcu_socket_path': os.path.join(str(self.run_dir), 'pcu_bts') + 'pcu_socket_path': os.path.join(str(self.run_dir), 'pcu_bts'), + 'band': self.band() } }) config.overlay(values, { 'osmo_bts_trx': self.conf }) @@ -118,7 +131,11 @@ f.write(r) def conf_for_bsc(self): - values = config.get_defaults('bsc_bts') + values = { + 'band': self.band(), + 'trx_list': [ { 'arfcn': self.arfcn() } ] + } + config.overlay(values, config.get_defaults('bsc_bts')) config.overlay(values, config.get_defaults('osmo_bts_trx')) config.overlay(values, self.conf) self.dbg(conf=values) diff --git a/src/osmo_gsm_tester/bts_sysmo.py b/src/osmo_gsm_tester/bts_sysmo.py index f37f88b..e426bb1 100644 --- a/src/osmo_gsm_tester/bts_sysmo.py +++ b/src/osmo_gsm_tester/bts_sysmo.py @@ -110,6 +110,18 @@ def remote_addr(self): return self.conf.get('addr') + def supported_bands(self): + return self.conf.get('bands', []) + + def set_arfcn_resource(self, band_arfcn): + self.band_arfcn = band_arfcn + + def band(self): + return self.band_arfcn.get('band') + + def arfcn(self): + return int(self.band_arfcn.get('arfcn')) + def configure(self): if self.bsc is None: raise RuntimeError('BTS needs to be added to a BSC or NITB before it can be configured') @@ -122,7 +134,8 @@ config.overlay(values, { 'osmo_bts_sysmo': { 'oml_remote_ip': self.bsc.addr(), - 'pcu_socket_path': os.path.join(SysmoBts.REMOTE_DIR, 'pcu_bts') + 'pcu_socket_path': os.path.join(SysmoBts.REMOTE_DIR, 'pcu_bts'), + 'band': self.band() } }) config.overlay(values, { 'osmo_bts_sysmo': self.conf }) @@ -135,7 +148,11 @@ f.write(r) def conf_for_bsc(self): - values = config.get_defaults('bsc_bts') + values = { + 'band': self.band(), + 'trx_list': [ { 'arfcn': self.arfcn() } ] + } + config.overlay(values, config.get_defaults('bsc_bts')) config.overlay(values, config.get_defaults('osmo_bts_sysmo')) config.overlay(values, self.conf) self.dbg(conf=values) diff --git a/src/osmo_gsm_tester/resource.py b/src/osmo_gsm_tester/resource.py index 4f43bfc..65c888d 100644 --- a/src/osmo_gsm_tester/resource.py +++ b/src/osmo_gsm_tester/resource.py @@ -53,7 +53,7 @@ 'bts[].type': schema.STR, 'bts[].ipa_unit_id': schema.INT, 'bts[].addr': schema.IPV4, - 'bts[].band': schema.BAND, + 'bts[].bands[]': schema.BAND, 'bts[].trx_remote_ip': schema.IPV4, 'bts[].launch_trx': schema.BOOL_STR, 'bts[].ciphers[]': schema.CIPHER, @@ -522,6 +522,11 @@ for item in item_list: item.pop(USED_KEY, None) + def add(self, more): + if more is self or more is self.reserved: + raise RuntimeError('adding a list of reserved resources to itself?') + config.add(self.reserved, copy.deepcopy(more.reserved)) + def free(self): if self.reserved: self.resources_pool.free(self.origin, self.reserved) diff --git a/src/osmo_gsm_tester/schema.py b/src/osmo_gsm_tester/schema.py index 86acbad..9bd0686 100644 --- a/src/osmo_gsm_tester/schema.py +++ b/src/osmo_gsm_tester/schema.py @@ -39,7 +39,7 @@ raise ValueError('Invalid %s: %r' % (name, val)) def band(val): - if val in ('GSM-1800', 'GSM-1900'): + if val in ('GSM-850', 'GSM-900', 'GSM-1800', 'GSM-1900'): return raise ValueError('Unknown GSM band: %r' % val) diff --git a/src/osmo_gsm_tester/suite.py b/src/osmo_gsm_tester/suite.py index 2ac2062..decc97c 100644 --- a/src/osmo_gsm_tester/suite.py +++ b/src/osmo_gsm_tester/suite.py @@ -246,6 +246,11 @@ self.log('reserving resources in', self.resources_pool.state_dir, '...') self.reserved_resources = self.resources_pool.reserve(self, self.resource_requirements()) + def reserve_resources_append(self, requirements): + new_reserved = self.resources_pool.reserve(self, requirements) + self.dbg('reserving new resources %r' % new_reserved) + self.reserved_resources.add(new_reserved) + def run_tests(self, names=None): try: log.large_separator(self.trial.name(), self.name(), sublevel=2) @@ -317,6 +322,14 @@ return self.reserved_resources.free() + def reserve_arfcn(self, band, arfcn=None): + '''To be used by tests. Returned resource can be passed when requested a bts object''' + + if arfcn is None: + return self._try_reserve_arfcn((band,)) + else: + return self.reserve_resources_append({ 'arfcn': [{'band': band, 'arfcn': arfcn, 'times': '1'}] }) + def ip_address(self, specifics=None): return self.reserved_resources.get(resource.R_IP_ADDRESS, specifics=specifics) @@ -350,8 +363,18 @@ ip_address = self.ip_address() return osmo_stp.OsmoStp(self, ip_address) - def bts(self, specifics=None): - return bts_obj(self, self.reserved_resources.get(resource.R_BTS, specifics=specifics)) + def bts(self, arfcn=None, specifics=None): + return bts_obj(self, arfcn, self.reserved_resources.get(resource.R_BTS, specifics=specifics)) + + def _try_reserve_arfcn(self, supported_bands): + for band in supported_bands: + try: + self.reserve_resources_append({ 'arfcn': [{'band': band, 'times': '1'}] }) + except resource.NoResourceExn as e: + self.dbg('Band %s has no available arfcns' % band) + continue + return self.reserved_resources.get(resource.R_ARFCN) + raise resource.NoResourceExn("No free arfcns in any of bands", bands=supported_bands) def modem(self, specifics=None): conf = self.reserved_resources.get(resource.R_MODEM, specifics=specifics) @@ -448,12 +471,18 @@ scenarios = [config.get_scenario(scenario_name) for scenario_name in scenario_names] return (suite_scenario_str, suite, scenarios) -def bts_obj(suite_run, conf): + +def bts_obj(suite_run, arfcn, conf): bts_type = conf.get('type') log.dbg('create BTS object', type=bts_type) bts_class = resource.KNOWN_BTS_TYPES.get(bts_type) if bts_class is None: raise RuntimeError('No such BTS type is defined: %r' % bts_type) - return bts_class(suite_run, conf) + bts_inst = bts_class(suite_run, conf) + if arfcn is None: + supported_bands = bts_inst.supported_bands() + arfcn = suite_run._try_reserve_arfcn(supported_bands) + bts_inst.set_arfcn_resource(arfcn) + return bts_inst # vim: expandtab tabstop=4 shiftwidth=4 diff --git a/suites/register/register_band_1900.py b/suites/register/register_band_1900.py new file mode 100755 index 0000000..3e0f6c3 --- /dev/null +++ b/suites/register/register_band_1900.py @@ -0,0 +1,22 @@ +#!/usr/bin/env python3 +from osmo_gsm_tester.test import * + +nitb = suite.nitb() +arfcn = suite.reserve_arfcn(band='GSM-1900') +bts = suite.bts(arfcn) +ms = suite.modem() + +print('start nitb and bts...') +nitb.bts_add(bts) +nitb.start() +bts.start() + +nitb.subscriber_add(ms) + +ms.connect(nitb.mcc_mnc()) + +ms.log_info() + +print('waiting for modems to attach...') +wait(ms.is_connected, nitb.mcc_mnc()) +wait(nitb.subscriber_attached, ms) diff --git a/suites/register/suite.conf b/suites/register/suite.conf new file mode 100644 index 0000000..eb59abb --- /dev/null +++ b/suites/register/suite.conf @@ -0,0 +1,10 @@ +resources: + ip_address: + - times: 1 + bts: + - times: 1 + modem: + - times: 1 + +defaults: + timeout: 60s -- To view, visit https://gerrit.osmocom.org/3731 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I6fb5d95bed1fa50c3deaf62a7a6df3cb276bc3c9 Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Mon Aug 28 16:49:08 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 28 Aug 2017 16:49:08 +0000 Subject: osmo-msc[master]: am: msc_vlr_tests: use AM_LDFLAGS instead of COMMON vars In-Reply-To: References: Message-ID: Patch Set 1: > Would be nice to add actual autoreconf warning to commit message > instead of just mentioning it. I thought the issue # was sufficient, but agreed -- To view, visit https://gerrit.osmocom.org/3720 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I6efae6e192b22de2c1d706edd55385135142532b Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Aug 28 16:50:12 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 28 Aug 2017 16:50:12 +0000 Subject: osmo-msc[master]: am: msc_vlr_tests: use AM_LDFLAGS instead of COMMON vars In-Reply-To: References: Message-ID: Patch Set 1: actually the issue # is the wrong one too :P -- To view, visit https://gerrit.osmocom.org/3720 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I6efae6e192b22de2c1d706edd55385135142532b Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Aug 28 16:51:01 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 28 Aug 2017 16:51:01 +0000 Subject: [PATCH] osmo-msc[master]: am: msc_vlr_tests: use AM_LDFLAGS instead of COMMON vars In-Reply-To: References: Message-ID: Hello Max, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3720 to look at the new patch set (#2). am: msc_vlr_tests: use AM_LDFLAGS instead of COMMON vars It was a n00b mistake to define COMMON_LDFLAGS and COMMON_LDADD to pass the same linker options to each test binary. Instead, use AM_LDFLAGS and remove the autoreconf warning. tests/msc_vlr/Makefile.am:66: warning: variable 'COMMON_LDFLAGS' is defined but no program or tests/msc_vlr/Makefile.am:66: library has 'COMMON' as canonical name (possible typo) Related: OS#2448 Change-Id: I6efae6e192b22de2c1d706edd55385135142532b --- M tests/msc_vlr/Makefile.am 1 file changed, 32 insertions(+), 53 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/20/3720/2 diff --git a/tests/msc_vlr/Makefile.am b/tests/msc_vlr/Makefile.am index 70006dd..fb4857f 100644 --- a/tests/msc_vlr/Makefile.am +++ b/tests/msc_vlr/Makefile.am @@ -18,6 +18,38 @@ $(LIBOSMOLEGACYMGCP_CFLAGS) \ $(NULL) +AM_LDFLAGS = \ + -Wl,--wrap=gsup_client_create \ + -Wl,--wrap=gsup_client_send \ + -Wl,--wrap=a_iface_tx_dtap \ + -Wl,--wrap=a_iface_tx_clear_cmd \ + -Wl,--wrap=a_iface_tx_paging \ + -Wl,--wrap=ranap_iu_tx \ + -Wl,--wrap=ranap_iu_tx_release \ + -Wl,--wrap=ranap_iu_tx_common_id \ + -Wl,--wrap=ranap_iu_page_cs \ + -Wl,--wrap=msc_stop_paging \ + -Wl,--wrap=gsm340_gen_scts \ + -Wl,--wrap=RAND_bytes \ + $(top_builddir)/src/libmsc/libmsc.a \ + $(top_builddir)/src/libcommon-cs/libcommon-cs.a \ + $(top_builddir)/src/libvlr/libvlr.a \ + $(top_builddir)/src/libcommon/libcommon.a \ + $(LIBSMPP34_LIBS) \ + $(LIBOSMOCORE_LIBS) \ + $(LIBOSMOGSM_LIBS) \ + $(LIBCRYPTO_LIBS) \ + $(LIBOSMOVTY_LIBS) \ + $(LIBOSMOABIS_LIBS) \ + $(LIBOSMOSIGTRAN_LIBS) \ + $(LIBOSMORANAP_LIBS) \ + $(LIBASN1C_LIBS) \ + $(LIBOSMOLEGACYMGCP_LIBS) \ + $(LIBRARY_GSM) \ + -ldbi \ + -lrt \ + $(NULL) + noinst_HEADERS = \ msc_vlr_tests.h \ $(NULL) @@ -43,41 +75,6 @@ msc_vlr_test_rest.err \ $(NULL) -COMMON_LDADD = \ - $(top_builddir)/src/libmsc/libmsc.a \ - $(top_builddir)/src/libcommon-cs/libcommon-cs.a \ - $(top_builddir)/src/libvlr/libvlr.a \ - $(top_builddir)/src/libcommon/libcommon.a \ - $(LIBSMPP34_LIBS) \ - $(LIBOSMOCORE_LIBS) \ - $(LIBOSMOGSM_LIBS) \ - $(LIBCRYPTO_LIBS) \ - $(LIBOSMOVTY_LIBS) \ - $(LIBOSMOABIS_LIBS) \ - $(LIBOSMOSIGTRAN_LIBS) \ - $(LIBOSMORANAP_LIBS) \ - $(LIBASN1C_LIBS) \ - $(LIBOSMOLEGACYMGCP_LIBS) \ - $(LIBRARY_GSM) \ - -ldbi \ - -lrt \ - $(NULL) - -COMMON_LDFLAGS = \ - -Wl,--wrap=gsup_client_create \ - -Wl,--wrap=gsup_client_send \ - -Wl,--wrap=a_iface_tx_dtap \ - -Wl,--wrap=a_iface_tx_clear_cmd \ - -Wl,--wrap=a_iface_tx_paging \ - -Wl,--wrap=ranap_iu_tx \ - -Wl,--wrap=ranap_iu_tx_release \ - -Wl,--wrap=ranap_iu_tx_common_id \ - -Wl,--wrap=ranap_iu_page_cs \ - -Wl,--wrap=msc_stop_paging \ - -Wl,--wrap=gsm340_gen_scts \ - -Wl,--wrap=RAND_bytes \ - $(NULL) - noinst_PROGRAMS = \ msc_vlr_test_no_authen \ msc_vlr_test_gsm_authen \ @@ -94,64 +91,46 @@ msc_vlr_test_no_authen.c \ msc_vlr_tests.c \ $(NULL) -msc_vlr_test_no_authen_LDADD = $(COMMON_LDADD) -msc_vlr_test_no_authen_LDFLAGS = $(COMMON_LDFLAGS) msc_vlr_test_gsm_authen_SOURCES = \ msc_vlr_test_gsm_authen.c \ msc_vlr_tests.c \ $(NULL) -msc_vlr_test_gsm_authen_LDADD = $(COMMON_LDADD) -msc_vlr_test_gsm_authen_LDFLAGS = $(COMMON_LDFLAGS) msc_vlr_test_gsm_ciph_SOURCES = \ msc_vlr_test_gsm_ciph.c \ msc_vlr_tests.c \ $(NULL) -msc_vlr_test_gsm_ciph_LDADD = $(COMMON_LDADD) -msc_vlr_test_gsm_ciph_LDFLAGS = $(COMMON_LDFLAGS) msc_vlr_test_umts_authen_SOURCES = \ msc_vlr_test_umts_authen.c \ msc_vlr_tests.c \ $(NULL) -msc_vlr_test_umts_authen_LDADD = $(COMMON_LDADD) -msc_vlr_test_umts_authen_LDFLAGS = $(COMMON_LDFLAGS) msc_vlr_test_hlr_reject_SOURCES = \ msc_vlr_test_hlr_reject.c \ msc_vlr_tests.c \ $(NULL) -msc_vlr_test_hlr_reject_LDADD = $(COMMON_LDADD) -msc_vlr_test_hlr_reject_LDFLAGS = $(COMMON_LDFLAGS) msc_vlr_test_hlr_timeout_SOURCES = \ msc_vlr_test_hlr_timeout.c \ msc_vlr_tests.c \ $(NULL) -msc_vlr_test_hlr_timeout_LDADD = $(COMMON_LDADD) -msc_vlr_test_hlr_timeout_LDFLAGS = $(COMMON_LDFLAGS) msc_vlr_test_ms_timeout_SOURCES = \ msc_vlr_test_ms_timeout.c \ msc_vlr_tests.c \ $(NULL) -msc_vlr_test_ms_timeout_LDADD = $(COMMON_LDADD) -msc_vlr_test_ms_timeout_LDFLAGS = $(COMMON_LDFLAGS) msc_vlr_test_reject_concurrency_SOURCES = \ msc_vlr_test_reject_concurrency.c \ msc_vlr_tests.c \ $(NULL) -msc_vlr_test_reject_concurrency_LDADD = $(COMMON_LDADD) -msc_vlr_test_reject_concurrency_LDFLAGS = $(COMMON_LDFLAGS) msc_vlr_test_rest_SOURCES = \ msc_vlr_test_rest.c \ msc_vlr_tests.c \ $(NULL) -msc_vlr_test_rest_LDADD = $(COMMON_LDADD) -msc_vlr_test_rest_LDFLAGS = $(COMMON_LDFLAGS) .PHONY: update_exp update_exp: -- To view, visit https://gerrit.osmocom.org/3720 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I6efae6e192b22de2c1d706edd55385135142532b Gerrit-PatchSet: 2 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Mon Aug 28 16:52:33 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 28 Aug 2017 16:52:33 +0000 Subject: osmo-msc[master]: am: msc_vlr_tests: use AM_LDFLAGS instead of COMMON vars In-Reply-To: References: Message-ID: Patch Set 2: > Build Started http://jenkins.osmocom.org/jenkins/job/osmo-msc-gerrit/316/ hmm, since when does gerrit rebuild issues when a commit message was modified? I thought it always skipped those trivial ones before. -- To view, visit https://gerrit.osmocom.org/3720 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I6efae6e192b22de2c1d706edd55385135142532b Gerrit-PatchSet: 2 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Aug 28 17:10:05 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 28 Aug 2017 17:10:05 +0000 Subject: [PATCH] libosmo-sccp[master]: cosmetic: aggressively set vty->index to NULL in osmo_ss7_vt... Message-ID: Review at https://gerrit.osmocom.org/3732 cosmetic: aggressively set vty->index to NULL in osmo_ss7_vty_go_parent() Change-Id: I579482f679cd43edfbe796a5806ef360335f1c55 --- M src/osmo_ss7_vty.c 1 file changed, 2 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-sccp refs/changes/32/3732/1 diff --git a/src/osmo_ss7_vty.c b/src/osmo_ss7_vty.c index 5731326..1fb35a1 100644 --- a/src/osmo_ss7_vty.c +++ b/src/osmo_ss7_vty.c @@ -1640,10 +1640,12 @@ break; case L_CS7_SCCPADDR_GT_NODE: vty->node = L_CS7_SCCPADDR_NODE; + vty->index = NULL; break; case L_CS7_NODE: default: vty->node = CONFIG_NODE; + vty->index = NULL; break; } return 0; -- To view, visit https://gerrit.osmocom.org/3732 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I579482f679cd43edfbe796a5806ef360335f1c55 Gerrit-PatchSet: 1 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Mon Aug 28 17:10:52 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 28 Aug 2017 17:10:52 +0000 Subject: [PATCH] libosmocore[master]: vty: 'ctrl' node: add missing default commands like list, exi... Message-ID: Review at https://gerrit.osmocom.org/3733 vty: 'ctrl' node: add missing default commands like list,exit,end Change-Id: I72569ed767b6a4d792b2867d02caa65520e27cd3 --- M src/ctrl/control_vty.c 1 file changed, 1 insertion(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/33/3733/1 diff --git a/src/ctrl/control_vty.c b/src/ctrl/control_vty.c index a968bc0..97f42de 100644 --- a/src/ctrl/control_vty.c +++ b/src/ctrl/control_vty.c @@ -82,6 +82,7 @@ ctrl_vty_ctx = ctx; install_element(CONFIG_NODE, &cfg_ctrl_cmd); install_node(&ctrl_node, config_write_ctrl); + vty_install_default(L_CTRL_NODE); install_element(L_CTRL_NODE, &cfg_ctrl_bind_addr_cmd); return 0; -- To view, visit https://gerrit.osmocom.org/3733 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I72569ed767b6a4d792b2867d02caa65520e27cd3 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Mon Aug 28 17:19:48 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 28 Aug 2017 17:19:48 +0000 Subject: [PATCH] osmo-sgsn[master]: NOT FOR MERGE: check pre_release branch build In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3727 to look at the new patch set (#3). NOT FOR MERGE: check pre_release branch build Change-Id: Ie22c5a8dbe3a55067c2cd15afee095eba572c2d8 --- M .gitignore M configure.ac M contrib/jenkins.sh D debian/autoreconf M debian/changelog M debian/control M debian/copyright D debian/docs D debian/openbsc-dev.install R debian/osmo-gbproxy.init A debian/osmo-gbproxy.install D debian/osmo-gtphub.examples M debian/osmo-gtphub.install A debian/osmo-sgsn.install D debian/osmocom-bs11-utils.install D debian/osmocom-bsc-nat.init D debian/osmocom-bsc-nat.install D debian/osmocom-bsc.examples D debian/osmocom-bsc.install D debian/osmocom-gbproxy.install D debian/osmocom-ipaccess-utils.install D debian/osmocom-nitb.default D debian/osmocom-nitb.dirs D debian/osmocom-nitb.examples D debian/osmocom-nitb.init D debian/osmocom-nitb.install D debian/osmocom-sgsn.default D debian/osmocom-sgsn.examples D debian/osmocom-sgsn.init D debian/osmocom-sgsn.install M debian/rules M doc/examples/osmo-bsc/osmo-bsc.cfg M doc/examples/osmo-sgsn/osmo-sgsn.cfg M include/openbsc/Makefile.am A include/openbsc/a_reset.h D include/openbsc/abis_nm.h D include/openbsc/abis_om2000.h D include/openbsc/abis_rsl.h D include/openbsc/arfcn_range_encode.h D include/openbsc/auth.h D include/openbsc/bsc_api.h D include/openbsc/bsc_msc.h D include/openbsc/bsc_msc_data.h D include/openbsc/bsc_msg_filter.h D include/openbsc/bsc_nat.h D include/openbsc/bsc_nat_callstats.h D include/openbsc/bsc_nat_sccp.h D include/openbsc/bsc_rll.h D include/openbsc/bsc_subscriber.h D include/openbsc/bss.h D include/openbsc/bts_ipaccess_nanobts_omlattr.h D include/openbsc/chan_alloc.h D include/openbsc/common_bsc.h D include/openbsc/common_cs.h D include/openbsc/ctrl.h D include/openbsc/db.h M include/openbsc/debug.h D include/openbsc/e1_config.h M include/openbsc/gprs_sgsn.h M include/openbsc/gprs_utils.h D include/openbsc/gsm_04_08.h D include/openbsc/gsm_04_11.h D include/openbsc/gsm_04_80.h D include/openbsc/gsm_data.h D include/openbsc/gsm_data_shared.h D include/openbsc/gsm_subscriber.h D include/openbsc/handover.h D include/openbsc/handover_decision.h D include/openbsc/ipaccess.h D include/openbsc/iu.h A include/openbsc/iu_dummy.h D include/openbsc/iucs.h D include/openbsc/iucs_ranap.h D include/openbsc/meas_feed.h D include/openbsc/meas_rep.h D include/openbsc/mgcp.h D include/openbsc/mgcp_internal.h D include/openbsc/mgcp_transcode.h D include/openbsc/mgcpgw_client.h D include/openbsc/misdn.h D include/openbsc/mncc.h D include/openbsc/mncc_int.h D include/openbsc/msc_ifaces.h D include/openbsc/nat_rewrite_trie.h D include/openbsc/network_listen.h D include/openbsc/openbscdefines.h D include/openbsc/osmo_bsc.h D include/openbsc/osmo_bsc_grace.h D include/openbsc/osmo_bsc_rf.h D include/openbsc/osmo_msc.h D include/openbsc/osmux.h D include/openbsc/paging.h D include/openbsc/pcu_if.h D include/openbsc/pcuif_proto.h D include/openbsc/rrlp.h D include/openbsc/rs232.h D include/openbsc/rtp_proxy.h M include/openbsc/sgsn.h M include/openbsc/signal.h D include/openbsc/silent_call.h D include/openbsc/smpp.h D include/openbsc/sms_queue.h D include/openbsc/socket.h D include/openbsc/system_information.h D include/openbsc/transaction.h D include/openbsc/trau_mux.h D include/openbsc/trau_upqueue.h D include/openbsc/ussd.h D include/openbsc/vlr.h M include/openbsc/vty.h M osmoappdesc.py M src/Makefile.am M src/gprs/Makefile.am M src/gprs/gb_proxy.c M src/gprs/gb_proxy_main.c M src/gprs/gb_proxy_patch.c M src/gprs/gb_proxy_peer.c M src/gprs/gb_proxy_vty.c M src/gprs/gprs_gmm.c M src/gprs/gprs_llc.c M src/gprs/gprs_llc_parse.c M src/gprs/gprs_llc_vty.c M src/gprs/gprs_sgsn.c M src/gprs/gprs_sndcp.c M src/gprs/gprs_sndcp_vty.c A src/gprs/gsup_client.c M src/gprs/gtphub_main.c M src/gprs/gtphub_vty.c A src/gprs/oap_client.c M src/gprs/sgsn_ares.c M src/gprs/sgsn_ctrl.c M src/gprs/sgsn_libgtp.c M src/gprs/sgsn_main.c M src/gprs/sgsn_vty.c D src/ipaccess/Makefile.am D src/ipaccess/abisip-find.c D src/ipaccess/ipaccess-config.c D src/ipaccess/ipaccess-firmware.c D src/ipaccess/ipaccess-proxy.c D src/ipaccess/network_listen.c D src/libbsc/Makefile.am D src/libbsc/abis_nm.c D src/libbsc/abis_nm_ipaccess.c D src/libbsc/abis_nm_vty.c D src/libbsc/abis_om2000.c D src/libbsc/abis_om2000_vty.c D src/libbsc/abis_rsl.c D src/libbsc/arfcn_range_encode.c D src/libbsc/bsc_api.c D src/libbsc/bsc_ctrl_commands.c D src/libbsc/bsc_ctrl_lookup.c D src/libbsc/bsc_dyn_ts.c D src/libbsc/bsc_init.c D src/libbsc/bsc_msc.c D src/libbsc/bsc_rf_ctrl.c D src/libbsc/bsc_rll.c D src/libbsc/bsc_subscriber.c D src/libbsc/bsc_vty.c D src/libbsc/bts_ericsson_rbs2000.c D src/libbsc/bts_init.c D src/libbsc/bts_ipaccess_nanobts.c D src/libbsc/bts_ipaccess_nanobts_omlattr.c D src/libbsc/bts_nokia_site.c D src/libbsc/bts_siemens_bs11.c D src/libbsc/bts_sysmobts.c D src/libbsc/bts_unknown.c D src/libbsc/chan_alloc.c D src/libbsc/e1_config.c D src/libbsc/gsm_04_08_utils.c D src/libbsc/gsm_04_80_utils.c D src/libbsc/handover_decision.c D src/libbsc/handover_logic.c D src/libbsc/meas_proc.c D src/libbsc/meas_rep.c D src/libbsc/net_init.c D src/libbsc/paging.c D src/libbsc/pcu_sock.c D src/libbsc/rest_octets.c D src/libbsc/system_information.c D src/libcommon-cs/Makefile.am D src/libcommon-cs/common_cs.c D src/libcommon-cs/common_cs_vty.c M src/libcommon/common_vty.c M src/libcommon/debug.c M src/libcommon/gsup_client.c D src/libfilter/Makefile.am D src/libfilter/bsc_msg_acc.c D src/libfilter/bsc_msg_filter.c D src/libfilter/bsc_msg_vty.c D src/libiu/Makefile.am D src/libiu/iu.c D src/libiu/iu_vty.c D src/libmgcp/Makefile.am D src/libmgcp/g711common.h D src/libmgcp/mgcp_common.c D src/libmgcp/mgcp_network.c D src/libmgcp/mgcp_osmux.c D src/libmgcp/mgcp_protocol.c D src/libmgcp/mgcp_sdp.c D src/libmgcp/mgcp_transcode.c D src/libmgcp/mgcp_vty.c D src/libmgcp/mgcpgw_client.c D src/libmgcp/mgcpgw_client_vty.c D src/libmsc/Makefile.am D src/libmsc/a_iface.c D src/libmsc/auth.c D src/libmsc/ctrl_commands.c D src/libmsc/db.c D src/libmsc/gsm_04_08.c D src/libmsc/gsm_04_11.c D src/libmsc/gsm_04_80.c D src/libmsc/gsm_subscriber.c M src/libmsc/iu_dummy.c D src/libmsc/iucs.c D src/libmsc/iucs_ranap.c D src/libmsc/meas_feed.c D src/libmsc/meas_feed.h D src/libmsc/mncc.c D src/libmsc/mncc_builtin.c D src/libmsc/mncc_sock.c D src/libmsc/msc_ifaces.c D src/libmsc/msc_vty.c D src/libmsc/osmo_msc.c D src/libmsc/rrlp.c D src/libmsc/silent_call.c D src/libmsc/smpp_openbsc.c D src/libmsc/smpp_smsc.c D src/libmsc/smpp_smsc.h D src/libmsc/smpp_utils.c D src/libmsc/smpp_vty.c D src/libmsc/sms_queue.c D src/libmsc/subscr_conn.c D src/libmsc/transaction.c D src/libmsc/ussd.c D src/libmsc/vty_interface_layer3.c D src/libtrau/Makefile.am D src/libtrau/rtp_proxy.c D src/libtrau/trau_mux.c D src/libtrau/trau_upqueue.c D src/libvlr/Makefile.am D src/libvlr/vlr.c D src/libvlr/vlr_access_req_fsm.c D src/libvlr/vlr_access_req_fsm.h D src/libvlr/vlr_auth_fsm.c D src/libvlr/vlr_auth_fsm.h D src/libvlr/vlr_core.h D src/libvlr/vlr_lu_fsm.c D src/libvlr/vlr_lu_fsm.h D src/osmo-bsc/Makefile.am D src/osmo-bsc/osmo_bsc_api.c D src/osmo-bsc/osmo_bsc_audio.c D src/osmo-bsc/osmo_bsc_bssap.c D src/osmo-bsc/osmo_bsc_ctrl.c D src/osmo-bsc/osmo_bsc_filter.c D src/osmo-bsc/osmo_bsc_grace.c D src/osmo-bsc/osmo_bsc_main.c D src/osmo-bsc/osmo_bsc_msc.c D src/osmo-bsc/osmo_bsc_sccp.c D src/osmo-bsc/osmo_bsc_vty.c D src/osmo-bsc_mgcp/Makefile.am D src/osmo-bsc_mgcp/mgcp_main.c D src/osmo-bsc_nat/Makefile.am D src/osmo-bsc_nat/bsc_filter.c D src/osmo-bsc_nat/bsc_mgcp_utils.c D src/osmo-bsc_nat/bsc_nat.c D src/osmo-bsc_nat/bsc_nat_ctrl.c D src/osmo-bsc_nat/bsc_nat_filter.c D src/osmo-bsc_nat/bsc_nat_rewrite.c D src/osmo-bsc_nat/bsc_nat_rewrite_trie.c D src/osmo-bsc_nat/bsc_nat_utils.c D src/osmo-bsc_nat/bsc_nat_vty.c D src/osmo-bsc_nat/bsc_sccp.c D src/osmo-bsc_nat/bsc_ussd.c D src/osmo-msc/Makefile.am D src/osmo-msc/msc_main.c D src/utils/Makefile.am D src/utils/bs11_config.c D src/utils/isdnsync.c D src/utils/meas_db.c D src/utils/meas_db.h D src/utils/meas_json.c D src/utils/meas_pcap2db.c D src/utils/meas_udp2db.c D src/utils/meas_vis.c D src/utils/smpp_mirror.c M tests/Makefile.am D tests/abis/Makefile.am D tests/abis/abis_test.c D tests/abis/abis_test.ok D tests/bsc-nat-trie/Makefile.am D tests/bsc-nat-trie/bsc_nat_trie_test.c D tests/bsc-nat-trie/bsc_nat_trie_test.ok D tests/bsc-nat-trie/prefixes.csv D tests/bsc-nat/Makefile.am D tests/bsc-nat/barr.cfg D tests/bsc-nat/barr_dup.cfg D tests/bsc-nat/bsc_data.c D tests/bsc-nat/bsc_nat_test.c D tests/bsc-nat/bsc_nat_test.ok D tests/bsc-nat/prefixes.csv D tests/bsc/Makefile.am D tests/bsc/bsc_test.c D tests/bsc/bsc_test.ok D tests/channel/Makefile.am D tests/channel/channel_test.c D tests/channel/channel_test.ok D tests/db/Makefile.am D tests/db/db_test.c D tests/db/db_test.err D tests/db/db_test.ok D tests/db/hlr.sqlite3 M tests/gbproxy/Makefile.am M tests/gbproxy/gbproxy_test.c D tests/gsm0408/Makefile.am D tests/gsm0408/gsm0408_test.c D tests/gsm0408/gsm0408_test.ok D tests/mgcp/Makefile.am D tests/mgcp/mgcp_test.c D tests/mgcp/mgcp_test.ok D tests/mgcp/mgcp_transcoding_test.c D tests/mgcp/mgcp_transcoding_test.ok D tests/mgcp/mgcpgw_client_test.c D tests/mgcp/mgcpgw_client_test.err D tests/mgcp/mgcpgw_client_test.ok D tests/msc_vlr/Makefile.am D tests/msc_vlr/msc_vlr_test_gsm_authen.c D tests/msc_vlr/msc_vlr_test_gsm_authen.err D tests/msc_vlr/msc_vlr_test_gsm_authen.ok D tests/msc_vlr/msc_vlr_test_gsm_ciph.c D tests/msc_vlr/msc_vlr_test_gsm_ciph.err D tests/msc_vlr/msc_vlr_test_gsm_ciph.ok D tests/msc_vlr/msc_vlr_test_hlr_reject.c D tests/msc_vlr/msc_vlr_test_hlr_reject.err D tests/msc_vlr/msc_vlr_test_hlr_reject.ok D tests/msc_vlr/msc_vlr_test_hlr_timeout.c D tests/msc_vlr/msc_vlr_test_hlr_timeout.err D tests/msc_vlr/msc_vlr_test_hlr_timeout.ok D tests/msc_vlr/msc_vlr_test_ms_timeout.c D tests/msc_vlr/msc_vlr_test_ms_timeout.err D tests/msc_vlr/msc_vlr_test_ms_timeout.ok D tests/msc_vlr/msc_vlr_test_no_authen.c D tests/msc_vlr/msc_vlr_test_no_authen.err D tests/msc_vlr/msc_vlr_test_no_authen.ok D tests/msc_vlr/msc_vlr_test_reject_concurrency.c D tests/msc_vlr/msc_vlr_test_reject_concurrency.err D tests/msc_vlr/msc_vlr_test_reject_concurrency.ok D tests/msc_vlr/msc_vlr_test_rest.c D tests/msc_vlr/msc_vlr_test_rest.err D tests/msc_vlr/msc_vlr_test_rest.ok D tests/msc_vlr/msc_vlr_test_umts_authen.c D tests/msc_vlr/msc_vlr_test_umts_authen.err D tests/msc_vlr/msc_vlr_test_umts_authen.ok D tests/msc_vlr/msc_vlr_tests.c D tests/msc_vlr/msc_vlr_tests.h D tests/nanobts_omlattr/Makefile.am D tests/nanobts_omlattr/nanobts_omlattr_test.c D tests/nanobts_omlattr/nanobts_omlattr_test.ok M tests/oap/Makefile.am M tests/sgsn/Makefile.am M tests/slhc/Makefile.am D tests/smpp/Makefile.am D tests/smpp/smpp_test.c D tests/smpp/smpp_test.err D tests/smpp/smpp_test.ok D tests/smpp_test_runner.py D tests/sms_queue/Makefile.am D tests/sms_queue/sms_queue_test.c D tests/sms_queue/sms_queue_test.err D tests/sms_queue/sms_queue_test.ok D tests/subscr/Makefile.am D tests/subscr/bsc_subscr_test.c D tests/subscr/bsc_subscr_test.err D tests/subscr/bsc_subscr_test.ok M tests/testsuite.at D tests/trau/Makefile.am D tests/trau/trau_test.c D tests/trau/trau_test.ok M tests/v42bis/Makefile.am M tests/vty_test_runner.py M tests/xid/Makefile.am 380 files changed, 1,579 insertions(+), 105,687 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-sgsn refs/changes/27/3727/3 -- To view, visit https://gerrit.osmocom.org/3727 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ie22c5a8dbe3a55067c2cd15afee095eba572c2d8 Gerrit-PatchSet: 3 Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: dexter From gerrit-no-reply at lists.osmocom.org Mon Aug 28 17:39:56 2017 From: gerrit-no-reply at lists.osmocom.org (Alexander Chemeris) Date: Mon, 28 Aug 2017 17:39:56 +0000 Subject: libosmocore[master]: gsm0480: modify USSD structures to support external handling In-Reply-To: References: Message-ID: Patch Set 2: > I thought the idea was to use TODO-RELEASE file to track API/ABI > breakage until release. I've documented it here https://osmocom.org/projects/cellular-infrastructure/wiki/Make_a_new_release Looks like a good option to me -- To view, visit https://gerrit.osmocom.org/3374 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I5f8972b86cd4dcb54b643a24b5794a87c8758073 Gerrit-PatchSet: 2 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Alexander Chemeris Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Ivan Kluchnikov Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Vadim Yanitskiy Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Aug 28 18:06:34 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 28 Aug 2017 18:06:34 +0000 Subject: [PATCH] osmo-mgw[master]: NOT FOR MERGE: check pre_release branch build In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3725 to look at the new patch set (#4). NOT FOR MERGE: check pre_release branch build Change-Id: I0632f1846563efc7d1968632cb0f3582a301b426 --- M .gitignore M Makefile.am M configure.ac D contrib/a-link/sccp-split-by-con.lua D contrib/bsc-test/README D contrib/bsc-test/all_dial D contrib/bsc-test/dial.sh D contrib/bsc-test/drop-oml.sh D contrib/bsc-test/drop.sh D contrib/bsc-test/hangup D contrib/bsc-test/msc.sh D contrib/bsc_control.py D contrib/bt.py D contrib/convert_to_enum.py D contrib/ctrl2sse.py D contrib/gprs/gb-proxy-unblock-bug.py D contrib/gprs/gprs-bssgp-histogram.lua D contrib/gprs/gprs-buffer-count.lua D contrib/gprs/gprs-split-trace-by-tlli.lua D contrib/gprs/gprs-verify-nu.lua D contrib/hlr-remove-old.sql D contrib/hlrsync/hlrsync.py M contrib/jenkins.sh D contrib/nat/test_regexp.c D contrib/nat/ussd_example.py D contrib/rtp/gen_rtp_header.erl D contrib/rtp/rtp_replay.st D contrib/rtp/rtp_replay_shared.st D contrib/rtp/rtp_replay_sip.st D contrib/rtp/timestamp_rtp.lua D contrib/sms/fill-hlr.st D contrib/sms/hlr-query.st D contrib/sms/sqlite-probe.tap.d D contrib/soap.py D contrib/systemd/osmo-bsc.service D contrib/systemd/osmo-gbproxy.service D contrib/systemd/osmo-msc.service D contrib/systemd/osmo-nitb.service D contrib/systemd/osmo-sgsn.service D contrib/testconv/Makefile D contrib/testconv/testconv_main.c D contrib/twisted_ipa.py D debian/autoreconf M debian/changelog M debian/control M debian/copyright D debian/docs A debian/libosmo-legacy-mgcp-dev.install A debian/libosmo-legacy-mgcp0.install D debian/openbsc-dev.install D debian/osmo-gtphub.default D debian/osmo-gtphub.examples D debian/osmo-gtphub.init D debian/osmo-gtphub.install A debian/osmo-mgw.install D debian/osmocom-bs11-utils.install D debian/osmocom-bsc-nat.init D debian/osmocom-bsc-nat.install D debian/osmocom-bsc.examples D debian/osmocom-bsc.install D debian/osmocom-gbproxy.init D debian/osmocom-gbproxy.install D debian/osmocom-ipaccess-utils.install D debian/osmocom-nitb.default D debian/osmocom-nitb.dirs D debian/osmocom-nitb.examples D debian/osmocom-nitb.init D debian/osmocom-nitb.install D debian/osmocom-sgsn.default D debian/osmocom-sgsn.examples D debian/osmocom-sgsn.init D debian/osmocom-sgsn.install M debian/rules M doc/examples/osmo-bsc/osmo-bsc.cfg M doc/examples/osmo-sgsn/osmo-sgsn.cfg M include/Makefile.am D include/compat_af_isdn.h D include/mISDNif.h D include/openbsc/Makefile.am D include/openbsc/abis_nm.h D include/openbsc/abis_om2000.h D include/openbsc/abis_rsl.h D include/openbsc/arfcn_range_encode.h D include/openbsc/auth.h D include/openbsc/bsc_api.h D include/openbsc/bsc_msc.h D include/openbsc/bsc_msc_data.h D include/openbsc/bsc_msg_filter.h D include/openbsc/bsc_nat.h D include/openbsc/bsc_nat_callstats.h D include/openbsc/bsc_nat_sccp.h D include/openbsc/bsc_rll.h D include/openbsc/bsc_subscriber.h D include/openbsc/bss.h D include/openbsc/bts_ipaccess_nanobts_omlattr.h D include/openbsc/chan_alloc.h D include/openbsc/common.h D include/openbsc/common_bsc.h D include/openbsc/common_cs.h D include/openbsc/crc24.h D include/openbsc/ctrl.h D include/openbsc/db.h D include/openbsc/debug.h D include/openbsc/e1_config.h D include/openbsc/gb_proxy.h D include/openbsc/gprs_gb_parse.h D include/openbsc/gprs_gmm.h D include/openbsc/gprs_llc.h D include/openbsc/gprs_llc_xid.h D include/openbsc/gprs_sgsn.h D include/openbsc/gprs_sndcp.h D include/openbsc/gprs_sndcp_comp.h D include/openbsc/gprs_sndcp_dcomp.h D include/openbsc/gprs_sndcp_pcomp.h D include/openbsc/gprs_sndcp_xid.h D include/openbsc/gprs_subscriber.h D include/openbsc/gprs_utils.h D include/openbsc/gsm_04_08.h D include/openbsc/gsm_04_11.h D include/openbsc/gsm_04_80.h D include/openbsc/gsm_data.h D include/openbsc/gsm_data_shared.h D include/openbsc/gsm_subscriber.h D include/openbsc/gsup_client.h D include/openbsc/gtphub.h D include/openbsc/handover.h D include/openbsc/handover_decision.h D include/openbsc/ipaccess.h D include/openbsc/iu.h A include/openbsc/iu_dummy.h D include/openbsc/iucs.h D include/openbsc/iucs_ranap.h D include/openbsc/meas_feed.h D include/openbsc/meas_rep.h D include/openbsc/mgcp.h D include/openbsc/mgcp_internal.h D include/openbsc/mgcpgw_client.h D include/openbsc/misdn.h D include/openbsc/mncc.h D include/openbsc/mncc_int.h D include/openbsc/msc_ifaces.h D include/openbsc/nat_rewrite_trie.h D include/openbsc/network_listen.h D include/openbsc/oap_client.h D include/openbsc/openbscdefines.h D include/openbsc/osmo_bsc.h D include/openbsc/osmo_bsc_grace.h D include/openbsc/osmo_bsc_rf.h D include/openbsc/osmo_msc.h D include/openbsc/paging.h D include/openbsc/pcu_if.h D include/openbsc/pcuif_proto.h D include/openbsc/rest_octets.h D include/openbsc/rrlp.h D include/openbsc/rs232.h D include/openbsc/rtp_proxy.h D include/openbsc/sgsn.h D include/openbsc/signal.h D include/openbsc/silent_call.h D include/openbsc/slhc.h D include/openbsc/smpp.h D include/openbsc/sms_queue.h D include/openbsc/socket.h D include/openbsc/system_information.h D include/openbsc/transaction.h D include/openbsc/trau_mux.h D include/openbsc/trau_upqueue.h D include/openbsc/ussd.h D include/openbsc/v42bis.h D include/openbsc/v42bis_private.h D include/openbsc/vlr.h D include/openbsc/vty.h A include/osmocom/Makefile.am A include/osmocom/legacy_mgcp/Makefile.am A include/osmocom/legacy_mgcp/mgcp.h A include/osmocom/legacy_mgcp/mgcp_internal.h R include/osmocom/legacy_mgcp/mgcp_transcode.h A include/osmocom/legacy_mgcp/mgcpgw_client.h A include/osmocom/legacy_mgcp/mgcpgw_client_internal.h R include/osmocom/legacy_mgcp/osmux.h A include/osmocom/legacy_mgcp/vty.h A libosmo-legacy-mgcp.pc.in D openbsc.pc.in M osmoappdesc.py M src/Makefile.am D src/gprs/.gitignore D src/gprs/Makefile.am D src/gprs/crc24.c D src/gprs/gb_proxy.c D src/gprs/gb_proxy_main.c D src/gprs/gb_proxy_patch.c D src/gprs/gb_proxy_peer.c D src/gprs/gb_proxy_tlli.c D src/gprs/gb_proxy_vty.c D src/gprs/gprs_gb_parse.c D src/gprs/gprs_gmm.c D src/gprs/gprs_llc.c D src/gprs/gprs_llc_parse.c D src/gprs/gprs_llc_vty.c D src/gprs/gprs_llc_xid.c D src/gprs/gprs_sgsn.c D src/gprs/gprs_sndcp.c D src/gprs/gprs_sndcp_comp.c D src/gprs/gprs_sndcp_dcomp.c D src/gprs/gprs_sndcp_pcomp.c D src/gprs/gprs_sndcp_vty.c D src/gprs/gprs_sndcp_xid.c D src/gprs/gprs_subscriber.c D src/gprs/gprs_utils.c D src/gprs/gtphub.c D src/gprs/gtphub_ares.c D src/gprs/gtphub_main.c D src/gprs/gtphub_sock.c D src/gprs/gtphub_vty.c D src/gprs/osmo_sgsn.cfg D src/gprs/sgsn_ares.c D src/gprs/sgsn_auth.c D src/gprs/sgsn_cdr.c D src/gprs/sgsn_ctrl.c D src/gprs/sgsn_libgtp.c D src/gprs/sgsn_main.c D src/gprs/sgsn_vty.c D src/gprs/slhc.c D src/gprs/v42bis.c D src/ipaccess/Makefile.am D src/ipaccess/abisip-find.c D src/ipaccess/ipaccess-config.c D src/ipaccess/ipaccess-firmware.c D src/ipaccess/ipaccess-proxy.c D src/ipaccess/network_listen.c D src/libbsc/Makefile.am D src/libbsc/abis_nm.c D src/libbsc/abis_nm_ipaccess.c D src/libbsc/abis_nm_vty.c D src/libbsc/abis_om2000.c D src/libbsc/abis_om2000_vty.c D src/libbsc/abis_rsl.c D src/libbsc/arfcn_range_encode.c D src/libbsc/bsc_api.c D src/libbsc/bsc_ctrl_commands.c D src/libbsc/bsc_ctrl_lookup.c D src/libbsc/bsc_dyn_ts.c D src/libbsc/bsc_init.c D src/libbsc/bsc_msc.c D src/libbsc/bsc_rf_ctrl.c D src/libbsc/bsc_rll.c D src/libbsc/bsc_subscriber.c D src/libbsc/bsc_vty.c D src/libbsc/bts_ericsson_rbs2000.c D src/libbsc/bts_init.c D src/libbsc/bts_ipaccess_nanobts.c D src/libbsc/bts_ipaccess_nanobts_omlattr.c D src/libbsc/bts_nokia_site.c D src/libbsc/bts_siemens_bs11.c D src/libbsc/bts_sysmobts.c D src/libbsc/bts_unknown.c D src/libbsc/chan_alloc.c D src/libbsc/e1_config.c D src/libbsc/gsm_04_08_utils.c D src/libbsc/gsm_04_80_utils.c D src/libbsc/handover_decision.c D src/libbsc/handover_logic.c D src/libbsc/meas_proc.c D src/libbsc/meas_rep.c D src/libbsc/net_init.c D src/libbsc/paging.c D src/libbsc/pcu_sock.c D src/libbsc/rest_octets.c D src/libbsc/system_information.c D src/libcommon-cs/Makefile.am D src/libcommon-cs/common_cs.c D src/libcommon-cs/common_cs_vty.c D src/libcommon/Makefile.am D src/libcommon/bsc_version.c D src/libcommon/common_vty.c D src/libcommon/debug.c D src/libcommon/gsm_data.c D src/libcommon/gsm_data_shared.c D src/libcommon/gsm_subscriber_base.c D src/libcommon/gsup_client.c D src/libcommon/gsup_test_client.c D src/libcommon/oap_client.c D src/libcommon/socket.c D src/libcommon/talloc_ctx.c D src/libfilter/Makefile.am D src/libfilter/bsc_msg_acc.c D src/libfilter/bsc_msg_filter.c D src/libfilter/bsc_msg_vty.c D src/libiu/Makefile.am D src/libiu/iu.c D src/libiu/iu_vty.c D src/libmgcp/Makefile.am D src/libmgcp/mgcp_common.c D src/libmgcp/mgcp_network.c D src/libmgcp/mgcp_osmux.c D src/libmgcp/mgcp_protocol.c D src/libmgcp/mgcp_sdp.c D src/libmgcp/mgcp_transcode.c D src/libmgcp/mgcp_vty.c D src/libmgcp/mgcpgw_client.c D src/libmgcp/mgcpgw_client_vty.c D src/libmsc/Makefile.am D src/libmsc/a_iface.c D src/libmsc/auth.c D src/libmsc/ctrl_commands.c D src/libmsc/db.c D src/libmsc/gsm_04_08.c D src/libmsc/gsm_04_11.c D src/libmsc/gsm_04_80.c D src/libmsc/gsm_subscriber.c D src/libmsc/iu_dummy.c D src/libmsc/iucs.c D src/libmsc/iucs_ranap.c D src/libmsc/meas_feed.c D src/libmsc/meas_feed.h D src/libmsc/mncc.c D src/libmsc/mncc_builtin.c D src/libmsc/mncc_sock.c D src/libmsc/msc_ifaces.c D src/libmsc/msc_vty.c D src/libmsc/osmo_msc.c D src/libmsc/rrlp.c D src/libmsc/silent_call.c D src/libmsc/smpp_openbsc.c D src/libmsc/smpp_smsc.c D src/libmsc/smpp_smsc.h D src/libmsc/smpp_utils.c D src/libmsc/smpp_vty.c D src/libmsc/sms_queue.c D src/libmsc/subscr_conn.c D src/libmsc/transaction.c D src/libmsc/ussd.c D src/libmsc/vty_interface_layer3.c A src/libosmo-legacy-mgcp/Makefile.am R src/libosmo-legacy-mgcp/g711common.h A src/libosmo-legacy-mgcp/mgcp_common.c A src/libosmo-legacy-mgcp/mgcp_network.c A src/libosmo-legacy-mgcp/mgcp_osmux.c A src/libosmo-legacy-mgcp/mgcp_protocol.c A src/libosmo-legacy-mgcp/mgcp_sdp.c A src/libosmo-legacy-mgcp/mgcp_transcode.c A src/libosmo-legacy-mgcp/mgcp_vty.c A src/libosmo-legacy-mgcp/mgcpgw_client.c A src/libosmo-legacy-mgcp/mgcpgw_client_vty.c D src/libtrau/Makefile.am D src/libtrau/rtp_proxy.c D src/libtrau/trau_mux.c D src/libtrau/trau_upqueue.c D src/libvlr/Makefile.am D src/libvlr/vlr.c D src/libvlr/vlr_access_req_fsm.c D src/libvlr/vlr_access_req_fsm.h D src/libvlr/vlr_auth_fsm.c D src/libvlr/vlr_auth_fsm.h D src/libvlr/vlr_core.h D src/libvlr/vlr_lu_fsm.c D src/libvlr/vlr_lu_fsm.h D src/osmo-bsc/Makefile.am D src/osmo-bsc/osmo_bsc_api.c D src/osmo-bsc/osmo_bsc_audio.c D src/osmo-bsc/osmo_bsc_bssap.c D src/osmo-bsc/osmo_bsc_ctrl.c D src/osmo-bsc/osmo_bsc_filter.c D src/osmo-bsc/osmo_bsc_grace.c D src/osmo-bsc/osmo_bsc_main.c D src/osmo-bsc/osmo_bsc_msc.c D src/osmo-bsc/osmo_bsc_sccp.c D src/osmo-bsc/osmo_bsc_vty.c M src/osmo-bsc_mgcp/Makefile.am M src/osmo-bsc_mgcp/mgcp_main.c D src/osmo-bsc_nat/Makefile.am D src/osmo-bsc_nat/bsc_filter.c D src/osmo-bsc_nat/bsc_mgcp_utils.c D src/osmo-bsc_nat/bsc_nat.c D src/osmo-bsc_nat/bsc_nat_ctrl.c D src/osmo-bsc_nat/bsc_nat_filter.c D src/osmo-bsc_nat/bsc_nat_rewrite.c D src/osmo-bsc_nat/bsc_nat_rewrite_trie.c D src/osmo-bsc_nat/bsc_nat_utils.c D src/osmo-bsc_nat/bsc_nat_vty.c D src/osmo-bsc_nat/bsc_sccp.c D src/osmo-bsc_nat/bsc_ussd.c D src/osmo-msc/Makefile.am D src/osmo-msc/msc_main.c D src/utils/Makefile.am D src/utils/bs11_config.c D src/utils/isdnsync.c D src/utils/meas_db.c D src/utils/meas_db.h D src/utils/meas_json.c D src/utils/meas_pcap2db.c D src/utils/meas_udp2db.c D src/utils/meas_vis.c D src/utils/smpp_mirror.c M tests/Makefile.am D tests/abis/Makefile.am D tests/abis/abis_test.c D tests/abis/abis_test.ok D tests/bsc-nat-trie/Makefile.am D tests/bsc-nat-trie/bsc_nat_trie_test.c D tests/bsc-nat-trie/bsc_nat_trie_test.ok D tests/bsc-nat-trie/prefixes.csv D tests/bsc-nat/Makefile.am D tests/bsc-nat/barr.cfg D tests/bsc-nat/barr_dup.cfg D tests/bsc-nat/bsc_data.c D tests/bsc-nat/bsc_nat_test.c D tests/bsc-nat/bsc_nat_test.ok D tests/bsc-nat/prefixes.csv D tests/bsc/Makefile.am D tests/bsc/bsc_test.c D tests/bsc/bsc_test.ok D tests/channel/Makefile.am D tests/channel/channel_test.c D tests/channel/channel_test.ok D tests/db/Makefile.am D tests/db/db_test.c D tests/db/db_test.err D tests/db/db_test.ok D tests/db/hlr.sqlite3 D tests/gbproxy/Makefile.am D tests/gbproxy/gbproxy_test.c D tests/gbproxy/gbproxy_test.ok D tests/gprs/Makefile.am D tests/gprs/gprs_test.c D tests/gprs/gprs_test.ok D tests/gsm0408/Makefile.am D tests/gsm0408/gsm0408_test.c D tests/gsm0408/gsm0408_test.ok D tests/gtphub/Makefile.am D tests/gtphub/gtphub_test.c D tests/gtphub/gtphub_test.ok A tests/legacy_mgcp/Makefile.am A tests/legacy_mgcp/mgcp_test.c R tests/legacy_mgcp/mgcp_test.ok A tests/legacy_mgcp/mgcp_transcoding_test.c R tests/legacy_mgcp/mgcp_transcoding_test.ok A tests/legacy_mgcp/mgcpgw_client_test.c R tests/legacy_mgcp/mgcpgw_client_test.err R tests/legacy_mgcp/mgcpgw_client_test.ok D tests/mgcp/Makefile.am D tests/mgcp/mgcp_test.c D tests/mgcp/mgcp_transcoding_test.c D tests/mgcp/mgcpgw_client_test.c D tests/msc_vlr/Makefile.am D tests/msc_vlr/msc_vlr_test_gsm_authen.c D tests/msc_vlr/msc_vlr_test_gsm_authen.err D tests/msc_vlr/msc_vlr_test_gsm_authen.ok D tests/msc_vlr/msc_vlr_test_gsm_ciph.c D tests/msc_vlr/msc_vlr_test_gsm_ciph.err D tests/msc_vlr/msc_vlr_test_gsm_ciph.ok D tests/msc_vlr/msc_vlr_test_hlr_reject.c D tests/msc_vlr/msc_vlr_test_hlr_reject.err D tests/msc_vlr/msc_vlr_test_hlr_reject.ok D tests/msc_vlr/msc_vlr_test_hlr_timeout.c D tests/msc_vlr/msc_vlr_test_hlr_timeout.err D tests/msc_vlr/msc_vlr_test_hlr_timeout.ok D tests/msc_vlr/msc_vlr_test_ms_timeout.c D tests/msc_vlr/msc_vlr_test_ms_timeout.err D tests/msc_vlr/msc_vlr_test_ms_timeout.ok D tests/msc_vlr/msc_vlr_test_no_authen.c D tests/msc_vlr/msc_vlr_test_no_authen.err D tests/msc_vlr/msc_vlr_test_no_authen.ok D tests/msc_vlr/msc_vlr_test_reject_concurrency.c D tests/msc_vlr/msc_vlr_test_reject_concurrency.err D tests/msc_vlr/msc_vlr_test_reject_concurrency.ok D tests/msc_vlr/msc_vlr_test_rest.c D tests/msc_vlr/msc_vlr_test_rest.err D tests/msc_vlr/msc_vlr_test_rest.ok D tests/msc_vlr/msc_vlr_test_umts_authen.c D tests/msc_vlr/msc_vlr_test_umts_authen.err D tests/msc_vlr/msc_vlr_test_umts_authen.ok D tests/msc_vlr/msc_vlr_tests.c D tests/msc_vlr/msc_vlr_tests.h D tests/nanobts_omlattr/Makefile.am D tests/nanobts_omlattr/nanobts_omlattr_test.c D tests/nanobts_omlattr/nanobts_omlattr_test.ok D tests/oap/Makefile.am D tests/oap/oap_client_test.c D tests/oap/oap_client_test.err D tests/oap/oap_client_test.ok D tests/sgsn/Makefile.am D tests/sgsn/sgsn_test.c D tests/sgsn/sgsn_test.ok D tests/slhc/Makefile.am D tests/slhc/slhc_test.c D tests/slhc/slhc_test.ok D tests/smpp/Makefile.am D tests/smpp/smpp_test.c D tests/smpp/smpp_test.err D tests/smpp/smpp_test.ok D tests/smpp_test_runner.py D tests/sms_queue/Makefile.am D tests/sms_queue/sms_queue_test.c D tests/sms_queue/sms_queue_test.err D tests/sms_queue/sms_queue_test.ok D tests/sndcp_xid/Makefile.am D tests/sndcp_xid/sndcp_xid_test.c D tests/sndcp_xid/sndcp_xid_test.ok D tests/subscr/Makefile.am D tests/subscr/bsc_subscr_test.c D tests/subscr/bsc_subscr_test.err D tests/subscr/bsc_subscr_test.ok M tests/testsuite.at D tests/trau/Makefile.am D tests/trau/trau_test.c D tests/trau/trau_test.ok D tests/v42bis/Makefile.am D tests/v42bis/v42bis_test.c D tests/v42bis/v42bis_test.ok M tests/vty_test_runner.py D tests/xid/Makefile.am D tests/xid/xid_test.c D tests/xid/xid_test.ok 514 files changed, 9,989 insertions(+), 158,380 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-mgw refs/changes/25/3725/4 -- To view, visit https://gerrit.osmocom.org/3725 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I0632f1846563efc7d1968632cb0f3582a301b426 Gerrit-PatchSet: 4 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: dexter From gerrit-no-reply at lists.osmocom.org Mon Aug 28 18:22:37 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 28 Aug 2017 18:22:37 +0000 Subject: [PATCH] osmo-sgsn[master]: NOT FOR MERGE: check pre_release branch build In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3727 to look at the new patch set (#4). NOT FOR MERGE: check pre_release branch build Change-Id: Ie22c5a8dbe3a55067c2cd15afee095eba572c2d8 --- M .gitignore M configure.ac M contrib/jenkins.sh D debian/autoreconf M debian/changelog M debian/control M debian/copyright D debian/docs D debian/openbsc-dev.install R debian/osmo-gbproxy.init A debian/osmo-gbproxy.install D debian/osmo-gtphub.examples M debian/osmo-gtphub.install A debian/osmo-sgsn.install D debian/osmocom-bs11-utils.install D debian/osmocom-bsc-nat.init D debian/osmocom-bsc-nat.install D debian/osmocom-bsc.examples D debian/osmocom-bsc.install D debian/osmocom-gbproxy.install D debian/osmocom-ipaccess-utils.install D debian/osmocom-nitb.default D debian/osmocom-nitb.dirs D debian/osmocom-nitb.examples D debian/osmocom-nitb.init D debian/osmocom-nitb.install D debian/osmocom-sgsn.default D debian/osmocom-sgsn.examples D debian/osmocom-sgsn.init D debian/osmocom-sgsn.install M debian/rules M doc/examples/osmo-bsc/osmo-bsc.cfg M doc/examples/osmo-sgsn/osmo-sgsn.cfg M include/openbsc/Makefile.am A include/openbsc/a_reset.h D include/openbsc/abis_nm.h D include/openbsc/abis_om2000.h D include/openbsc/abis_rsl.h D include/openbsc/arfcn_range_encode.h D include/openbsc/auth.h D include/openbsc/bsc_api.h D include/openbsc/bsc_msc.h D include/openbsc/bsc_msc_data.h D include/openbsc/bsc_msg_filter.h D include/openbsc/bsc_nat.h D include/openbsc/bsc_nat_callstats.h D include/openbsc/bsc_nat_sccp.h D include/openbsc/bsc_rll.h D include/openbsc/bsc_subscriber.h D include/openbsc/bss.h D include/openbsc/bts_ipaccess_nanobts_omlattr.h D include/openbsc/chan_alloc.h D include/openbsc/common_bsc.h D include/openbsc/common_cs.h D include/openbsc/ctrl.h D include/openbsc/db.h M include/openbsc/debug.h D include/openbsc/e1_config.h M include/openbsc/gprs_sgsn.h M include/openbsc/gprs_utils.h D include/openbsc/gsm_04_08.h D include/openbsc/gsm_04_11.h D include/openbsc/gsm_04_80.h D include/openbsc/gsm_data.h D include/openbsc/gsm_data_shared.h D include/openbsc/gsm_subscriber.h D include/openbsc/handover.h D include/openbsc/handover_decision.h D include/openbsc/ipaccess.h D include/openbsc/iu.h A include/openbsc/iu_dummy.h D include/openbsc/iucs.h D include/openbsc/iucs_ranap.h D include/openbsc/meas_feed.h D include/openbsc/meas_rep.h D include/openbsc/mgcp.h D include/openbsc/mgcp_internal.h D include/openbsc/mgcp_transcode.h D include/openbsc/mgcpgw_client.h D include/openbsc/misdn.h D include/openbsc/mncc.h D include/openbsc/mncc_int.h D include/openbsc/msc_ifaces.h D include/openbsc/nat_rewrite_trie.h D include/openbsc/network_listen.h D include/openbsc/openbscdefines.h D include/openbsc/osmo_bsc.h D include/openbsc/osmo_bsc_grace.h D include/openbsc/osmo_bsc_rf.h D include/openbsc/osmo_msc.h D include/openbsc/osmux.h D include/openbsc/paging.h D include/openbsc/pcu_if.h D include/openbsc/pcuif_proto.h D include/openbsc/rrlp.h D include/openbsc/rs232.h D include/openbsc/rtp_proxy.h M include/openbsc/sgsn.h M include/openbsc/signal.h D include/openbsc/silent_call.h D include/openbsc/smpp.h D include/openbsc/sms_queue.h D include/openbsc/socket.h D include/openbsc/system_information.h D include/openbsc/transaction.h D include/openbsc/trau_mux.h D include/openbsc/trau_upqueue.h D include/openbsc/ussd.h D include/openbsc/vlr.h M include/openbsc/vty.h M osmoappdesc.py M src/Makefile.am M src/gprs/Makefile.am M src/gprs/gb_proxy.c M src/gprs/gb_proxy_main.c M src/gprs/gb_proxy_patch.c M src/gprs/gb_proxy_peer.c M src/gprs/gb_proxy_vty.c M src/gprs/gprs_gmm.c M src/gprs/gprs_llc.c M src/gprs/gprs_llc_parse.c M src/gprs/gprs_llc_vty.c M src/gprs/gprs_sgsn.c M src/gprs/gprs_sndcp.c M src/gprs/gprs_sndcp_vty.c A src/gprs/gsup_client.c M src/gprs/gtphub_main.c M src/gprs/gtphub_vty.c A src/gprs/oap_client.c M src/gprs/sgsn_ares.c M src/gprs/sgsn_ctrl.c M src/gprs/sgsn_libgtp.c M src/gprs/sgsn_main.c M src/gprs/sgsn_vty.c D src/ipaccess/Makefile.am D src/ipaccess/abisip-find.c D src/ipaccess/ipaccess-config.c D src/ipaccess/ipaccess-firmware.c D src/ipaccess/ipaccess-proxy.c D src/ipaccess/network_listen.c D src/libbsc/Makefile.am D src/libbsc/abis_nm.c D src/libbsc/abis_nm_ipaccess.c D src/libbsc/abis_nm_vty.c D src/libbsc/abis_om2000.c D src/libbsc/abis_om2000_vty.c D src/libbsc/abis_rsl.c D src/libbsc/arfcn_range_encode.c D src/libbsc/bsc_api.c D src/libbsc/bsc_ctrl_commands.c D src/libbsc/bsc_ctrl_lookup.c D src/libbsc/bsc_dyn_ts.c D src/libbsc/bsc_init.c D src/libbsc/bsc_msc.c D src/libbsc/bsc_rf_ctrl.c D src/libbsc/bsc_rll.c D src/libbsc/bsc_subscriber.c D src/libbsc/bsc_vty.c D src/libbsc/bts_ericsson_rbs2000.c D src/libbsc/bts_init.c D src/libbsc/bts_ipaccess_nanobts.c D src/libbsc/bts_ipaccess_nanobts_omlattr.c D src/libbsc/bts_nokia_site.c D src/libbsc/bts_siemens_bs11.c D src/libbsc/bts_sysmobts.c D src/libbsc/bts_unknown.c D src/libbsc/chan_alloc.c D src/libbsc/e1_config.c D src/libbsc/gsm_04_08_utils.c D src/libbsc/gsm_04_80_utils.c D src/libbsc/handover_decision.c D src/libbsc/handover_logic.c D src/libbsc/meas_proc.c D src/libbsc/meas_rep.c D src/libbsc/net_init.c D src/libbsc/paging.c D src/libbsc/pcu_sock.c D src/libbsc/rest_octets.c D src/libbsc/system_information.c D src/libcommon-cs/Makefile.am D src/libcommon-cs/common_cs.c D src/libcommon-cs/common_cs_vty.c M src/libcommon/common_vty.c M src/libcommon/debug.c M src/libcommon/gsup_client.c D src/libfilter/Makefile.am D src/libfilter/bsc_msg_acc.c D src/libfilter/bsc_msg_filter.c D src/libfilter/bsc_msg_vty.c D src/libiu/Makefile.am D src/libiu/iu.c D src/libiu/iu_vty.c D src/libmgcp/Makefile.am D src/libmgcp/g711common.h D src/libmgcp/mgcp_common.c D src/libmgcp/mgcp_network.c D src/libmgcp/mgcp_osmux.c D src/libmgcp/mgcp_protocol.c D src/libmgcp/mgcp_sdp.c D src/libmgcp/mgcp_transcode.c D src/libmgcp/mgcp_vty.c D src/libmgcp/mgcpgw_client.c D src/libmgcp/mgcpgw_client_vty.c D src/libmsc/Makefile.am D src/libmsc/a_iface.c D src/libmsc/auth.c D src/libmsc/ctrl_commands.c D src/libmsc/db.c D src/libmsc/gsm_04_08.c D src/libmsc/gsm_04_11.c D src/libmsc/gsm_04_80.c D src/libmsc/gsm_subscriber.c M src/libmsc/iu_dummy.c D src/libmsc/iucs.c D src/libmsc/iucs_ranap.c D src/libmsc/meas_feed.c D src/libmsc/meas_feed.h D src/libmsc/mncc.c D src/libmsc/mncc_builtin.c D src/libmsc/mncc_sock.c D src/libmsc/msc_ifaces.c D src/libmsc/msc_vty.c D src/libmsc/osmo_msc.c D src/libmsc/rrlp.c D src/libmsc/silent_call.c D src/libmsc/smpp_openbsc.c D src/libmsc/smpp_smsc.c D src/libmsc/smpp_smsc.h D src/libmsc/smpp_utils.c D src/libmsc/smpp_vty.c D src/libmsc/sms_queue.c D src/libmsc/subscr_conn.c D src/libmsc/transaction.c D src/libmsc/ussd.c D src/libmsc/vty_interface_layer3.c D src/libtrau/Makefile.am D src/libtrau/rtp_proxy.c D src/libtrau/trau_mux.c D src/libtrau/trau_upqueue.c D src/libvlr/Makefile.am D src/libvlr/vlr.c D src/libvlr/vlr_access_req_fsm.c D src/libvlr/vlr_access_req_fsm.h D src/libvlr/vlr_auth_fsm.c D src/libvlr/vlr_auth_fsm.h D src/libvlr/vlr_core.h D src/libvlr/vlr_lu_fsm.c D src/libvlr/vlr_lu_fsm.h D src/osmo-bsc/Makefile.am D src/osmo-bsc/osmo_bsc_api.c D src/osmo-bsc/osmo_bsc_audio.c D src/osmo-bsc/osmo_bsc_bssap.c D src/osmo-bsc/osmo_bsc_ctrl.c D src/osmo-bsc/osmo_bsc_filter.c D src/osmo-bsc/osmo_bsc_grace.c D src/osmo-bsc/osmo_bsc_main.c D src/osmo-bsc/osmo_bsc_msc.c D src/osmo-bsc/osmo_bsc_sccp.c D src/osmo-bsc/osmo_bsc_vty.c D src/osmo-bsc_mgcp/Makefile.am D src/osmo-bsc_mgcp/mgcp_main.c D src/osmo-bsc_nat/Makefile.am D src/osmo-bsc_nat/bsc_filter.c D src/osmo-bsc_nat/bsc_mgcp_utils.c D src/osmo-bsc_nat/bsc_nat.c D src/osmo-bsc_nat/bsc_nat_ctrl.c D src/osmo-bsc_nat/bsc_nat_filter.c D src/osmo-bsc_nat/bsc_nat_rewrite.c D src/osmo-bsc_nat/bsc_nat_rewrite_trie.c D src/osmo-bsc_nat/bsc_nat_utils.c D src/osmo-bsc_nat/bsc_nat_vty.c D src/osmo-bsc_nat/bsc_sccp.c D src/osmo-bsc_nat/bsc_ussd.c D src/osmo-msc/Makefile.am D src/osmo-msc/msc_main.c D src/utils/Makefile.am D src/utils/bs11_config.c D src/utils/isdnsync.c D src/utils/meas_db.c D src/utils/meas_db.h D src/utils/meas_json.c D src/utils/meas_pcap2db.c D src/utils/meas_udp2db.c D src/utils/meas_vis.c D src/utils/smpp_mirror.c M tests/Makefile.am D tests/abis/Makefile.am D tests/abis/abis_test.c D tests/abis/abis_test.ok D tests/bsc-nat-trie/Makefile.am D tests/bsc-nat-trie/bsc_nat_trie_test.c D tests/bsc-nat-trie/bsc_nat_trie_test.ok D tests/bsc-nat-trie/prefixes.csv D tests/bsc-nat/Makefile.am D tests/bsc-nat/barr.cfg D tests/bsc-nat/barr_dup.cfg D tests/bsc-nat/bsc_data.c D tests/bsc-nat/bsc_nat_test.c D tests/bsc-nat/bsc_nat_test.ok D tests/bsc-nat/prefixes.csv D tests/bsc/Makefile.am D tests/bsc/bsc_test.c D tests/bsc/bsc_test.ok D tests/channel/Makefile.am D tests/channel/channel_test.c D tests/channel/channel_test.ok D tests/db/Makefile.am D tests/db/db_test.c D tests/db/db_test.err D tests/db/db_test.ok D tests/db/hlr.sqlite3 M tests/gbproxy/Makefile.am M tests/gbproxy/gbproxy_test.c D tests/gsm0408/Makefile.am D tests/gsm0408/gsm0408_test.c D tests/gsm0408/gsm0408_test.ok D tests/mgcp/Makefile.am D tests/mgcp/mgcp_test.c D tests/mgcp/mgcp_test.ok D tests/mgcp/mgcp_transcoding_test.c D tests/mgcp/mgcp_transcoding_test.ok D tests/mgcp/mgcpgw_client_test.c D tests/mgcp/mgcpgw_client_test.err D tests/mgcp/mgcpgw_client_test.ok D tests/msc_vlr/Makefile.am D tests/msc_vlr/msc_vlr_test_gsm_authen.c D tests/msc_vlr/msc_vlr_test_gsm_authen.err D tests/msc_vlr/msc_vlr_test_gsm_authen.ok D tests/msc_vlr/msc_vlr_test_gsm_ciph.c D tests/msc_vlr/msc_vlr_test_gsm_ciph.err D tests/msc_vlr/msc_vlr_test_gsm_ciph.ok D tests/msc_vlr/msc_vlr_test_hlr_reject.c D tests/msc_vlr/msc_vlr_test_hlr_reject.err D tests/msc_vlr/msc_vlr_test_hlr_reject.ok D tests/msc_vlr/msc_vlr_test_hlr_timeout.c D tests/msc_vlr/msc_vlr_test_hlr_timeout.err D tests/msc_vlr/msc_vlr_test_hlr_timeout.ok D tests/msc_vlr/msc_vlr_test_ms_timeout.c D tests/msc_vlr/msc_vlr_test_ms_timeout.err D tests/msc_vlr/msc_vlr_test_ms_timeout.ok D tests/msc_vlr/msc_vlr_test_no_authen.c D tests/msc_vlr/msc_vlr_test_no_authen.err D tests/msc_vlr/msc_vlr_test_no_authen.ok D tests/msc_vlr/msc_vlr_test_reject_concurrency.c D tests/msc_vlr/msc_vlr_test_reject_concurrency.err D tests/msc_vlr/msc_vlr_test_reject_concurrency.ok D tests/msc_vlr/msc_vlr_test_rest.c D tests/msc_vlr/msc_vlr_test_rest.err D tests/msc_vlr/msc_vlr_test_rest.ok D tests/msc_vlr/msc_vlr_test_umts_authen.c D tests/msc_vlr/msc_vlr_test_umts_authen.err D tests/msc_vlr/msc_vlr_test_umts_authen.ok D tests/msc_vlr/msc_vlr_tests.c D tests/msc_vlr/msc_vlr_tests.h D tests/nanobts_omlattr/Makefile.am D tests/nanobts_omlattr/nanobts_omlattr_test.c D tests/nanobts_omlattr/nanobts_omlattr_test.ok M tests/oap/Makefile.am M tests/sgsn/Makefile.am M tests/slhc/Makefile.am D tests/smpp/Makefile.am D tests/smpp/smpp_test.c D tests/smpp/smpp_test.err D tests/smpp/smpp_test.ok D tests/smpp_test_runner.py D tests/sms_queue/Makefile.am D tests/sms_queue/sms_queue_test.c D tests/sms_queue/sms_queue_test.err D tests/sms_queue/sms_queue_test.ok D tests/subscr/Makefile.am D tests/subscr/bsc_subscr_test.c D tests/subscr/bsc_subscr_test.err D tests/subscr/bsc_subscr_test.ok M tests/testsuite.at D tests/trau/Makefile.am D tests/trau/trau_test.c D tests/trau/trau_test.ok M tests/v42bis/Makefile.am M tests/vty_test_runner.py M tests/xid/Makefile.am 380 files changed, 1,584 insertions(+), 105,687 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-sgsn refs/changes/27/3727/4 -- To view, visit https://gerrit.osmocom.org/3727 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ie22c5a8dbe3a55067c2cd15afee095eba572c2d8 Gerrit-PatchSet: 4 Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: dexter From gerrit-no-reply at lists.osmocom.org Mon Aug 28 18:33:16 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 28 Aug 2017 18:33:16 +0000 Subject: [PATCH] osmo-mgw[master]: NOT FOR MERGE: check pre_release branch build In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3725 to look at the new patch set (#5). NOT FOR MERGE: check pre_release branch build Change-Id: I0632f1846563efc7d1968632cb0f3582a301b426 --- M .gitignore M Makefile.am M configure.ac D contrib/a-link/sccp-split-by-con.lua D contrib/bsc-test/README D contrib/bsc-test/all_dial D contrib/bsc-test/dial.sh D contrib/bsc-test/drop-oml.sh D contrib/bsc-test/drop.sh D contrib/bsc-test/hangup D contrib/bsc-test/msc.sh D contrib/bsc_control.py D contrib/bt.py D contrib/convert_to_enum.py D contrib/ctrl2sse.py D contrib/gprs/gb-proxy-unblock-bug.py D contrib/gprs/gprs-bssgp-histogram.lua D contrib/gprs/gprs-buffer-count.lua D contrib/gprs/gprs-split-trace-by-tlli.lua D contrib/gprs/gprs-verify-nu.lua D contrib/hlr-remove-old.sql D contrib/hlrsync/hlrsync.py M contrib/jenkins.sh D contrib/nat/test_regexp.c D contrib/nat/ussd_example.py D contrib/rtp/gen_rtp_header.erl D contrib/rtp/rtp_replay.st D contrib/rtp/rtp_replay_shared.st D contrib/rtp/rtp_replay_sip.st D contrib/rtp/timestamp_rtp.lua D contrib/sms/fill-hlr.st D contrib/sms/hlr-query.st D contrib/sms/sqlite-probe.tap.d D contrib/soap.py D contrib/systemd/osmo-bsc.service D contrib/systemd/osmo-gbproxy.service D contrib/systemd/osmo-msc.service D contrib/systemd/osmo-nitb.service D contrib/systemd/osmo-sgsn.service D contrib/testconv/Makefile D contrib/testconv/testconv_main.c D contrib/twisted_ipa.py D debian/autoreconf M debian/changelog M debian/control M debian/copyright D debian/docs A debian/libosmo-legacy-mgcp-dev.install A debian/libosmo-legacy-mgcp0.install D debian/openbsc-dev.install D debian/osmo-gtphub.default D debian/osmo-gtphub.examples D debian/osmo-gtphub.init D debian/osmo-gtphub.install A debian/osmo-mgw.install D debian/osmocom-bs11-utils.install D debian/osmocom-bsc-nat.init D debian/osmocom-bsc-nat.install D debian/osmocom-bsc.examples D debian/osmocom-bsc.install D debian/osmocom-gbproxy.init D debian/osmocom-gbproxy.install D debian/osmocom-ipaccess-utils.install D debian/osmocom-nitb.default D debian/osmocom-nitb.dirs D debian/osmocom-nitb.examples D debian/osmocom-nitb.init D debian/osmocom-nitb.install D debian/osmocom-sgsn.default D debian/osmocom-sgsn.examples D debian/osmocom-sgsn.init D debian/osmocom-sgsn.install M debian/rules M doc/examples/osmo-bsc/osmo-bsc.cfg M doc/examples/osmo-sgsn/osmo-sgsn.cfg M include/Makefile.am D include/compat_af_isdn.h D include/mISDNif.h D include/openbsc/Makefile.am D include/openbsc/abis_nm.h D include/openbsc/abis_om2000.h D include/openbsc/abis_rsl.h D include/openbsc/arfcn_range_encode.h D include/openbsc/auth.h D include/openbsc/bsc_api.h D include/openbsc/bsc_msc.h D include/openbsc/bsc_msc_data.h D include/openbsc/bsc_msg_filter.h D include/openbsc/bsc_nat.h D include/openbsc/bsc_nat_callstats.h D include/openbsc/bsc_nat_sccp.h D include/openbsc/bsc_rll.h D include/openbsc/bsc_subscriber.h D include/openbsc/bss.h D include/openbsc/bts_ipaccess_nanobts_omlattr.h D include/openbsc/chan_alloc.h D include/openbsc/common.h D include/openbsc/common_bsc.h D include/openbsc/common_cs.h D include/openbsc/crc24.h D include/openbsc/ctrl.h D include/openbsc/db.h D include/openbsc/debug.h D include/openbsc/e1_config.h D include/openbsc/gb_proxy.h D include/openbsc/gprs_gb_parse.h D include/openbsc/gprs_gmm.h D include/openbsc/gprs_llc.h D include/openbsc/gprs_llc_xid.h D include/openbsc/gprs_sgsn.h D include/openbsc/gprs_sndcp.h D include/openbsc/gprs_sndcp_comp.h D include/openbsc/gprs_sndcp_dcomp.h D include/openbsc/gprs_sndcp_pcomp.h D include/openbsc/gprs_sndcp_xid.h D include/openbsc/gprs_subscriber.h D include/openbsc/gprs_utils.h D include/openbsc/gsm_04_08.h D include/openbsc/gsm_04_11.h D include/openbsc/gsm_04_80.h D include/openbsc/gsm_data.h D include/openbsc/gsm_data_shared.h D include/openbsc/gsm_subscriber.h D include/openbsc/gsup_client.h D include/openbsc/gtphub.h D include/openbsc/handover.h D include/openbsc/handover_decision.h D include/openbsc/ipaccess.h D include/openbsc/iu.h A include/openbsc/iu_dummy.h D include/openbsc/iucs.h D include/openbsc/iucs_ranap.h D include/openbsc/meas_feed.h D include/openbsc/meas_rep.h D include/openbsc/mgcp.h D include/openbsc/mgcp_internal.h D include/openbsc/mgcpgw_client.h D include/openbsc/misdn.h D include/openbsc/mncc.h D include/openbsc/mncc_int.h D include/openbsc/msc_ifaces.h D include/openbsc/nat_rewrite_trie.h D include/openbsc/network_listen.h D include/openbsc/oap_client.h D include/openbsc/openbscdefines.h D include/openbsc/osmo_bsc.h D include/openbsc/osmo_bsc_grace.h D include/openbsc/osmo_bsc_rf.h D include/openbsc/osmo_msc.h D include/openbsc/paging.h D include/openbsc/pcu_if.h D include/openbsc/pcuif_proto.h D include/openbsc/rest_octets.h D include/openbsc/rrlp.h D include/openbsc/rs232.h D include/openbsc/rtp_proxy.h D include/openbsc/sgsn.h D include/openbsc/signal.h D include/openbsc/silent_call.h D include/openbsc/slhc.h D include/openbsc/smpp.h D include/openbsc/sms_queue.h D include/openbsc/socket.h D include/openbsc/system_information.h D include/openbsc/transaction.h D include/openbsc/trau_mux.h D include/openbsc/trau_upqueue.h D include/openbsc/ussd.h D include/openbsc/v42bis.h D include/openbsc/v42bis_private.h D include/openbsc/vlr.h D include/openbsc/vty.h A include/osmocom/Makefile.am A include/osmocom/legacy_mgcp/Makefile.am A include/osmocom/legacy_mgcp/mgcp.h A include/osmocom/legacy_mgcp/mgcp_internal.h R include/osmocom/legacy_mgcp/mgcp_transcode.h A include/osmocom/legacy_mgcp/mgcpgw_client.h A include/osmocom/legacy_mgcp/mgcpgw_client_internal.h R include/osmocom/legacy_mgcp/osmux.h A include/osmocom/legacy_mgcp/vty.h A libosmo-legacy-mgcp.pc.in D openbsc.pc.in M osmoappdesc.py M src/Makefile.am D src/gprs/.gitignore D src/gprs/Makefile.am D src/gprs/crc24.c D src/gprs/gb_proxy.c D src/gprs/gb_proxy_main.c D src/gprs/gb_proxy_patch.c D src/gprs/gb_proxy_peer.c D src/gprs/gb_proxy_tlli.c D src/gprs/gb_proxy_vty.c D src/gprs/gprs_gb_parse.c D src/gprs/gprs_gmm.c D src/gprs/gprs_llc.c D src/gprs/gprs_llc_parse.c D src/gprs/gprs_llc_vty.c D src/gprs/gprs_llc_xid.c D src/gprs/gprs_sgsn.c D src/gprs/gprs_sndcp.c D src/gprs/gprs_sndcp_comp.c D src/gprs/gprs_sndcp_dcomp.c D src/gprs/gprs_sndcp_pcomp.c D src/gprs/gprs_sndcp_vty.c D src/gprs/gprs_sndcp_xid.c D src/gprs/gprs_subscriber.c D src/gprs/gprs_utils.c D src/gprs/gtphub.c D src/gprs/gtphub_ares.c D src/gprs/gtphub_main.c D src/gprs/gtphub_sock.c D src/gprs/gtphub_vty.c D src/gprs/osmo_sgsn.cfg D src/gprs/sgsn_ares.c D src/gprs/sgsn_auth.c D src/gprs/sgsn_cdr.c D src/gprs/sgsn_ctrl.c D src/gprs/sgsn_libgtp.c D src/gprs/sgsn_main.c D src/gprs/sgsn_vty.c D src/gprs/slhc.c D src/gprs/v42bis.c D src/ipaccess/Makefile.am D src/ipaccess/abisip-find.c D src/ipaccess/ipaccess-config.c D src/ipaccess/ipaccess-firmware.c D src/ipaccess/ipaccess-proxy.c D src/ipaccess/network_listen.c D src/libbsc/Makefile.am D src/libbsc/abis_nm.c D src/libbsc/abis_nm_ipaccess.c D src/libbsc/abis_nm_vty.c D src/libbsc/abis_om2000.c D src/libbsc/abis_om2000_vty.c D src/libbsc/abis_rsl.c D src/libbsc/arfcn_range_encode.c D src/libbsc/bsc_api.c D src/libbsc/bsc_ctrl_commands.c D src/libbsc/bsc_ctrl_lookup.c D src/libbsc/bsc_dyn_ts.c D src/libbsc/bsc_init.c D src/libbsc/bsc_msc.c D src/libbsc/bsc_rf_ctrl.c D src/libbsc/bsc_rll.c D src/libbsc/bsc_subscriber.c D src/libbsc/bsc_vty.c D src/libbsc/bts_ericsson_rbs2000.c D src/libbsc/bts_init.c D src/libbsc/bts_ipaccess_nanobts.c D src/libbsc/bts_ipaccess_nanobts_omlattr.c D src/libbsc/bts_nokia_site.c D src/libbsc/bts_siemens_bs11.c D src/libbsc/bts_sysmobts.c D src/libbsc/bts_unknown.c D src/libbsc/chan_alloc.c D src/libbsc/e1_config.c D src/libbsc/gsm_04_08_utils.c D src/libbsc/gsm_04_80_utils.c D src/libbsc/handover_decision.c D src/libbsc/handover_logic.c D src/libbsc/meas_proc.c D src/libbsc/meas_rep.c D src/libbsc/net_init.c D src/libbsc/paging.c D src/libbsc/pcu_sock.c D src/libbsc/rest_octets.c D src/libbsc/system_information.c D src/libcommon-cs/Makefile.am D src/libcommon-cs/common_cs.c D src/libcommon-cs/common_cs_vty.c D src/libcommon/Makefile.am D src/libcommon/bsc_version.c D src/libcommon/common_vty.c D src/libcommon/debug.c D src/libcommon/gsm_data.c D src/libcommon/gsm_data_shared.c D src/libcommon/gsm_subscriber_base.c D src/libcommon/gsup_client.c D src/libcommon/gsup_test_client.c D src/libcommon/oap_client.c D src/libcommon/socket.c D src/libcommon/talloc_ctx.c D src/libfilter/Makefile.am D src/libfilter/bsc_msg_acc.c D src/libfilter/bsc_msg_filter.c D src/libfilter/bsc_msg_vty.c D src/libiu/Makefile.am D src/libiu/iu.c D src/libiu/iu_vty.c D src/libmgcp/Makefile.am D src/libmgcp/mgcp_common.c D src/libmgcp/mgcp_network.c D src/libmgcp/mgcp_osmux.c D src/libmgcp/mgcp_protocol.c D src/libmgcp/mgcp_sdp.c D src/libmgcp/mgcp_transcode.c D src/libmgcp/mgcp_vty.c D src/libmgcp/mgcpgw_client.c D src/libmgcp/mgcpgw_client_vty.c D src/libmsc/Makefile.am D src/libmsc/a_iface.c D src/libmsc/auth.c D src/libmsc/ctrl_commands.c D src/libmsc/db.c D src/libmsc/gsm_04_08.c D src/libmsc/gsm_04_11.c D src/libmsc/gsm_04_80.c D src/libmsc/gsm_subscriber.c D src/libmsc/iu_dummy.c D src/libmsc/iucs.c D src/libmsc/iucs_ranap.c D src/libmsc/meas_feed.c D src/libmsc/meas_feed.h D src/libmsc/mncc.c D src/libmsc/mncc_builtin.c D src/libmsc/mncc_sock.c D src/libmsc/msc_ifaces.c D src/libmsc/msc_vty.c D src/libmsc/osmo_msc.c D src/libmsc/rrlp.c D src/libmsc/silent_call.c D src/libmsc/smpp_openbsc.c D src/libmsc/smpp_smsc.c D src/libmsc/smpp_smsc.h D src/libmsc/smpp_utils.c D src/libmsc/smpp_vty.c D src/libmsc/sms_queue.c D src/libmsc/subscr_conn.c D src/libmsc/transaction.c D src/libmsc/ussd.c D src/libmsc/vty_interface_layer3.c A src/libosmo-legacy-mgcp/Makefile.am R src/libosmo-legacy-mgcp/g711common.h A src/libosmo-legacy-mgcp/mgcp_common.c A src/libosmo-legacy-mgcp/mgcp_network.c A src/libosmo-legacy-mgcp/mgcp_osmux.c A src/libosmo-legacy-mgcp/mgcp_protocol.c A src/libosmo-legacy-mgcp/mgcp_sdp.c A src/libosmo-legacy-mgcp/mgcp_transcode.c A src/libosmo-legacy-mgcp/mgcp_vty.c A src/libosmo-legacy-mgcp/mgcpgw_client.c A src/libosmo-legacy-mgcp/mgcpgw_client_vty.c D src/libtrau/Makefile.am D src/libtrau/rtp_proxy.c D src/libtrau/trau_mux.c D src/libtrau/trau_upqueue.c D src/libvlr/Makefile.am D src/libvlr/vlr.c D src/libvlr/vlr_access_req_fsm.c D src/libvlr/vlr_access_req_fsm.h D src/libvlr/vlr_auth_fsm.c D src/libvlr/vlr_auth_fsm.h D src/libvlr/vlr_core.h D src/libvlr/vlr_lu_fsm.c D src/libvlr/vlr_lu_fsm.h D src/osmo-bsc/Makefile.am D src/osmo-bsc/osmo_bsc_api.c D src/osmo-bsc/osmo_bsc_audio.c D src/osmo-bsc/osmo_bsc_bssap.c D src/osmo-bsc/osmo_bsc_ctrl.c D src/osmo-bsc/osmo_bsc_filter.c D src/osmo-bsc/osmo_bsc_grace.c D src/osmo-bsc/osmo_bsc_main.c D src/osmo-bsc/osmo_bsc_msc.c D src/osmo-bsc/osmo_bsc_sccp.c D src/osmo-bsc/osmo_bsc_vty.c M src/osmo-bsc_mgcp/Makefile.am M src/osmo-bsc_mgcp/mgcp_main.c D src/osmo-bsc_nat/Makefile.am D src/osmo-bsc_nat/bsc_filter.c D src/osmo-bsc_nat/bsc_mgcp_utils.c D src/osmo-bsc_nat/bsc_nat.c D src/osmo-bsc_nat/bsc_nat_ctrl.c D src/osmo-bsc_nat/bsc_nat_filter.c D src/osmo-bsc_nat/bsc_nat_rewrite.c D src/osmo-bsc_nat/bsc_nat_rewrite_trie.c D src/osmo-bsc_nat/bsc_nat_utils.c D src/osmo-bsc_nat/bsc_nat_vty.c D src/osmo-bsc_nat/bsc_sccp.c D src/osmo-bsc_nat/bsc_ussd.c D src/osmo-msc/Makefile.am D src/osmo-msc/msc_main.c D src/utils/Makefile.am D src/utils/bs11_config.c D src/utils/isdnsync.c D src/utils/meas_db.c D src/utils/meas_db.h D src/utils/meas_json.c D src/utils/meas_pcap2db.c D src/utils/meas_udp2db.c D src/utils/meas_vis.c D src/utils/smpp_mirror.c M tests/Makefile.am D tests/abis/Makefile.am D tests/abis/abis_test.c D tests/abis/abis_test.ok D tests/bsc-nat-trie/Makefile.am D tests/bsc-nat-trie/bsc_nat_trie_test.c D tests/bsc-nat-trie/bsc_nat_trie_test.ok D tests/bsc-nat-trie/prefixes.csv D tests/bsc-nat/Makefile.am D tests/bsc-nat/barr.cfg D tests/bsc-nat/barr_dup.cfg D tests/bsc-nat/bsc_data.c D tests/bsc-nat/bsc_nat_test.c D tests/bsc-nat/bsc_nat_test.ok D tests/bsc-nat/prefixes.csv D tests/bsc/Makefile.am D tests/bsc/bsc_test.c D tests/bsc/bsc_test.ok D tests/channel/Makefile.am D tests/channel/channel_test.c D tests/channel/channel_test.ok D tests/db/Makefile.am D tests/db/db_test.c D tests/db/db_test.err D tests/db/db_test.ok D tests/db/hlr.sqlite3 D tests/gbproxy/Makefile.am D tests/gbproxy/gbproxy_test.c D tests/gbproxy/gbproxy_test.ok D tests/gprs/Makefile.am D tests/gprs/gprs_test.c D tests/gprs/gprs_test.ok D tests/gsm0408/Makefile.am D tests/gsm0408/gsm0408_test.c D tests/gsm0408/gsm0408_test.ok D tests/gtphub/Makefile.am D tests/gtphub/gtphub_test.c D tests/gtphub/gtphub_test.ok A tests/legacy_mgcp/Makefile.am A tests/legacy_mgcp/mgcp_test.c R tests/legacy_mgcp/mgcp_test.ok A tests/legacy_mgcp/mgcp_transcoding_test.c R tests/legacy_mgcp/mgcp_transcoding_test.ok A tests/legacy_mgcp/mgcpgw_client_test.c R tests/legacy_mgcp/mgcpgw_client_test.err R tests/legacy_mgcp/mgcpgw_client_test.ok D tests/mgcp/Makefile.am D tests/mgcp/mgcp_test.c D tests/mgcp/mgcp_transcoding_test.c D tests/mgcp/mgcpgw_client_test.c D tests/msc_vlr/Makefile.am D tests/msc_vlr/msc_vlr_test_gsm_authen.c D tests/msc_vlr/msc_vlr_test_gsm_authen.err D tests/msc_vlr/msc_vlr_test_gsm_authen.ok D tests/msc_vlr/msc_vlr_test_gsm_ciph.c D tests/msc_vlr/msc_vlr_test_gsm_ciph.err D tests/msc_vlr/msc_vlr_test_gsm_ciph.ok D tests/msc_vlr/msc_vlr_test_hlr_reject.c D tests/msc_vlr/msc_vlr_test_hlr_reject.err D tests/msc_vlr/msc_vlr_test_hlr_reject.ok D tests/msc_vlr/msc_vlr_test_hlr_timeout.c D tests/msc_vlr/msc_vlr_test_hlr_timeout.err D tests/msc_vlr/msc_vlr_test_hlr_timeout.ok D tests/msc_vlr/msc_vlr_test_ms_timeout.c D tests/msc_vlr/msc_vlr_test_ms_timeout.err D tests/msc_vlr/msc_vlr_test_ms_timeout.ok D tests/msc_vlr/msc_vlr_test_no_authen.c D tests/msc_vlr/msc_vlr_test_no_authen.err D tests/msc_vlr/msc_vlr_test_no_authen.ok D tests/msc_vlr/msc_vlr_test_reject_concurrency.c D tests/msc_vlr/msc_vlr_test_reject_concurrency.err D tests/msc_vlr/msc_vlr_test_reject_concurrency.ok D tests/msc_vlr/msc_vlr_test_rest.c D tests/msc_vlr/msc_vlr_test_rest.err D tests/msc_vlr/msc_vlr_test_rest.ok D tests/msc_vlr/msc_vlr_test_umts_authen.c D tests/msc_vlr/msc_vlr_test_umts_authen.err D tests/msc_vlr/msc_vlr_test_umts_authen.ok D tests/msc_vlr/msc_vlr_tests.c D tests/msc_vlr/msc_vlr_tests.h D tests/nanobts_omlattr/Makefile.am D tests/nanobts_omlattr/nanobts_omlattr_test.c D tests/nanobts_omlattr/nanobts_omlattr_test.ok D tests/oap/Makefile.am D tests/oap/oap_client_test.c D tests/oap/oap_client_test.err D tests/oap/oap_client_test.ok D tests/sgsn/Makefile.am D tests/sgsn/sgsn_test.c D tests/sgsn/sgsn_test.ok D tests/slhc/Makefile.am D tests/slhc/slhc_test.c D tests/slhc/slhc_test.ok D tests/smpp/Makefile.am D tests/smpp/smpp_test.c D tests/smpp/smpp_test.err D tests/smpp/smpp_test.ok D tests/smpp_test_runner.py D tests/sms_queue/Makefile.am D tests/sms_queue/sms_queue_test.c D tests/sms_queue/sms_queue_test.err D tests/sms_queue/sms_queue_test.ok D tests/sndcp_xid/Makefile.am D tests/sndcp_xid/sndcp_xid_test.c D tests/sndcp_xid/sndcp_xid_test.ok D tests/subscr/Makefile.am D tests/subscr/bsc_subscr_test.c D tests/subscr/bsc_subscr_test.err D tests/subscr/bsc_subscr_test.ok M tests/testsuite.at D tests/trau/Makefile.am D tests/trau/trau_test.c D tests/trau/trau_test.ok D tests/v42bis/Makefile.am D tests/v42bis/v42bis_test.c D tests/v42bis/v42bis_test.ok M tests/vty_test_runner.py D tests/xid/Makefile.am D tests/xid/xid_test.c D tests/xid/xid_test.ok 514 files changed, 9,991 insertions(+), 158,377 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-mgw refs/changes/25/3725/5 -- To view, visit https://gerrit.osmocom.org/3725 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I0632f1846563efc7d1968632cb0f3582a301b426 Gerrit-PatchSet: 5 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: dexter From gerrit-no-reply at lists.osmocom.org Tue Aug 29 07:57:46 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Tue, 29 Aug 2017 07:57:46 +0000 Subject: osmo-msc[master]: am: msc_vlr_tests: use AM_LDFLAGS instead of COMMON vars In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/3720 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I6efae6e192b22de2c1d706edd55385135142532b Gerrit-PatchSet: 2 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Aug 29 08:00:35 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Tue, 29 Aug 2017 08:00:35 +0000 Subject: osmo-msc[master]: am: msc_vlr_tests: use AM_LDFLAGS instead of COMMON vars In-Reply-To: References: Message-ID: Patch Set 2: > since when does gerrit rebuild issues when a commit message was modified? Since the very beginning :) - I don't recall it behaving differently. -- To view, visit https://gerrit.osmocom.org/3720 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I6efae6e192b22de2c1d706edd55385135142532b Gerrit-PatchSet: 2 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Aug 29 08:04:29 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Tue, 29 Aug 2017 08:04:29 +0000 Subject: libosmo-sccp[master]: cosmetic: aggressively set vty->index to NULL in osmo_ss7_vt... In-Reply-To: References: Message-ID: Patch Set 1: Could you clarify why? Other cases seems to not need this. -- To view, visit https://gerrit.osmocom.org/3732 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I579482f679cd43edfbe796a5806ef360335f1c55 Gerrit-PatchSet: 1 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Aug 29 10:24:27 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Tue, 29 Aug 2017 10:24:27 +0000 Subject: [PATCH] osmo-bts[master]: trx: avoid deactivating lchan on LCHAN_REL_ACT_REACT 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/3067 to look at the new patch set (#5). trx: avoid deactivating lchan on LCHAN_REL_ACT_REACT * do not deactivate lchan when called with LCHAN_REL_ACT_REACT * add fixme comment It's unclear yet if any special steps are required for osmo-bts-trx so let's just make it compatible with setups [1] using BS_AG_BLKS_RES != 1 for now. Background: CCCH is activated very early by OsmoBTS - before we receive SI3, see 4a8582846281322e8d7dfc577b18767cf35c24d1. To accommodate for that we deactivate CCCH in common/rsl.c, which triggers BTS-model specific callback sapi_deactivate_cb() which updates parameters and activates it again. In case of osmo-bts-trx there (seems to be) no need in special interaction with hw to activate channel (no lchan_activate()) hence we can just skip entire deactivate/setup/activate again routine. [1] "channel-descrption bs-ag-blks-res N" in OpenBSC config file. Related: OS#1575 Change-Id: I20b89ba1e43d1414180b083cd1e085eeffe5d513 --- M src/osmo-bts-trx/l1_if.c 1 file changed, 6 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/67/3067/5 diff --git a/src/osmo-bts-trx/l1_if.c b/src/osmo-bts-trx/l1_if.c index c629a61..3c11dfd 100644 --- a/src/osmo-bts-trx/l1_if.c +++ b/src/osmo-bts-trx/l1_if.c @@ -109,6 +109,12 @@ struct phy_instance *pinst = trx_phy_instance(lchan->ts->trx); struct trx_l1h *l1h = pinst->u.osmotrx.hdl; + if (lchan->rel_act_kind == LCHAN_REL_ACT_REACT) { + lchan->rel_act_kind = LCHAN_REL_ACT_RSL; + /* FIXME: perform whatever is needed (if any) to set proper PCH/AGCH allocation according to + 3GPP TS 44.018 Table 10.5.2.11.1 using num_agch(lchan->ts->trx, "TRX L1"); function */ + return 0; + } /* set lchan inactive */ lchan_set_state(lchan, LCHAN_S_NONE); -- To view, visit https://gerrit.osmocom.org/3067 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I20b89ba1e43d1414180b083cd1e085eeffe5d513 Gerrit-PatchSet: 5 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Alexander Chemeris Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Ivan Kluchnikov Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Tue Aug 29 11:17:00 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Tue, 29 Aug 2017 11:17:00 +0000 Subject: [PATCH] openbsc[master]: SI13: check for incorrect configuration Message-ID: Review at https://gerrit.osmocom.org/3734 SI13: check for incorrect configuration According to 3GPP TS 44.018 ?1.8 the "network shall never enable PBCCH and PCCCH". Change-Id: I319e71a4b0c682361529e9c21377398a826b934b Related: OS#2400 --- M openbsc/src/libbsc/rest_octets.c 1 file changed, 14 insertions(+), 33 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/34/3734/1 diff --git a/openbsc/src/libbsc/rest_octets.c b/openbsc/src/libbsc/rest_octets.c index fdab70a..96c706d 100644 --- a/openbsc/src/libbsc/rest_octets.c +++ b/openbsc/src/libbsc/rest_octets.c @@ -798,6 +798,11 @@ { struct bitvec bv; + if (si13->pbcch_present) { + LOGP(DRR, LOGL_ERROR, "SI13: attempting to enable PBCCH which should never happen.\n"); + return -EINVAL; + } + memset(&bv, 0, sizeof(bv)); bv.data = data; bv.data_len = 20; @@ -816,39 +821,15 @@ bitvec_set_uint(&bv, si13->bcch_change_mark, 2); append_gprs_mobile_alloc(&bv); } - if (!si13->pbcch_present) { - /* PBCCH not present in cell */ - bitvec_set_bit(&bv, 0); - bitvec_set_uint(&bv, si13->no_pbcch.rac, 8); - bitvec_set_bit(&bv, si13->no_pbcch.spgc_ccch_sup); - bitvec_set_uint(&bv, si13->no_pbcch.prio_acc_thr, 3); - bitvec_set_uint(&bv, si13->no_pbcch.net_ctrl_ord, 2); - append_gprs_cell_opt(&bv, &si13->cell_opts); - append_gprs_pwr_ctrl_pars(&bv, &si13->pwr_ctrl_pars); - } else { - /* PBCCH present in cell */ - bitvec_set_bit(&bv, 1); - bitvec_set_uint(&bv, si13->pbcch.psi1_rep_per, 4); - /* PBCCH Descripiton */ - bitvec_set_uint(&bv, si13->pbcch.pb, 4); - bitvec_set_uint(&bv, si13->pbcch.tsc, 3); - bitvec_set_uint(&bv, si13->pbcch.tn, 3); - switch (si13->pbcch.carrier_type) { - case PBCCH_BCCH: - bitvec_set_bit(&bv, 0); - bitvec_set_bit(&bv, 0); - break; - case PBCCH_ARFCN: - bitvec_set_bit(&bv, 0); - bitvec_set_bit(&bv, 1); - bitvec_set_uint(&bv, si13->pbcch.arfcn, 10); - break; - case PBCCH_MAIO: - bitvec_set_bit(&bv, 1); - bitvec_set_uint(&bv, si13->pbcch.maio, 6); - break; - } - } + /* PBCCH not present in cell */ + bitvec_set_bit(&bv, 0); + bitvec_set_uint(&bv, si13->no_pbcch.rac, 8); + bitvec_set_bit(&bv, si13->no_pbcch.spgc_ccch_sup); + bitvec_set_uint(&bv, si13->no_pbcch.prio_acc_thr, 3); + bitvec_set_uint(&bv, si13->no_pbcch.net_ctrl_ord, 2); + append_gprs_cell_opt(&bv, &si13->cell_opts); + append_gprs_pwr_ctrl_pars(&bv, &si13->pwr_ctrl_pars); + /* 3GPP TS 44.018 Release 6 / 10.5.2.37b */ bitvec_set_bit(&bv, H); /* added Release 99 */ /* claim our SGSN is compatible with Release 99, as EDGE and EGPRS -- To view, visit https://gerrit.osmocom.org/3734 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I319e71a4b0c682361529e9c21377398a826b934b Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Tue Aug 29 11:31:35 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Tue, 29 Aug 2017 11:31:35 +0000 Subject: [PATCH] openbsc[master]: SI13: drop PBCCH-related bits In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3734 to look at the new patch set (#2). SI13: drop PBCCH-related bits According to 3GPP TS 44.018 ?1.8 the "network shall never enable PBCCH and PCCCH". Change-Id: I319e71a4b0c682361529e9c21377398a826b934b Related: OS#2400 --- M openbsc/include/openbsc/rest_octets.h M openbsc/src/libbsc/rest_octets.c M openbsc/src/libbsc/system_information.c 3 files changed, 20 insertions(+), 69 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/34/3734/2 diff --git a/openbsc/include/openbsc/rest_octets.h b/openbsc/include/openbsc/rest_octets.h index 49a2312..ca7b57c 100644 --- a/openbsc/include/openbsc/rest_octets.h +++ b/openbsc/include/openbsc/rest_octets.h @@ -62,12 +62,6 @@ /* Generate SI4 Rest Octets (Chapter 10.5.2.35) */ int rest_octets_si4(uint8_t *data, const struct gsm48_si_ro_info *si4, int len); -enum pbcch_carrier_type { - PBCCH_BCCH, - PBCCH_ARFCN, - PBCCH_MAIO -}; - /* TS 03.60 Chapter 6.3.3.1: Network Mode of Operation */ enum gprs_nmo { GPRS_NMO_I = 0, /* CS pagin on GPRS paging or traffic channel */ @@ -112,25 +106,10 @@ struct gprs_power_ctrl_pars pwr_ctrl_pars; uint8_t bcch_change_mark; uint8_t si_change_field; - uint8_t pbcch_present; - - union { - struct { - uint8_t rac; - uint8_t spgc_ccch_sup; - uint8_t net_ctrl_ord; - uint8_t prio_acc_thr; - } no_pbcch; - struct { - uint8_t psi1_rep_per; - uint8_t pb; - uint8_t tsc; - uint8_t tn; - enum pbcch_carrier_type carrier_type; - uint16_t arfcn; - uint8_t maio; - } pbcch; - }; + uint8_t rac; + uint8_t spgc_ccch_sup; + uint8_t net_ctrl_ord; + uint8_t prio_acc_thr; }; /* Generate SI13 Rest Octests (Chapter 10.5.2.37b) */ diff --git a/openbsc/src/libbsc/rest_octets.c b/openbsc/src/libbsc/rest_octets.c index fdab70a..78e7413 100644 --- a/openbsc/src/libbsc/rest_octets.c +++ b/openbsc/src/libbsc/rest_octets.c @@ -816,39 +816,16 @@ bitvec_set_uint(&bv, si13->bcch_change_mark, 2); append_gprs_mobile_alloc(&bv); } - if (!si13->pbcch_present) { - /* PBCCH not present in cell */ - bitvec_set_bit(&bv, 0); - bitvec_set_uint(&bv, si13->no_pbcch.rac, 8); - bitvec_set_bit(&bv, si13->no_pbcch.spgc_ccch_sup); - bitvec_set_uint(&bv, si13->no_pbcch.prio_acc_thr, 3); - bitvec_set_uint(&bv, si13->no_pbcch.net_ctrl_ord, 2); - append_gprs_cell_opt(&bv, &si13->cell_opts); - append_gprs_pwr_ctrl_pars(&bv, &si13->pwr_ctrl_pars); - } else { - /* PBCCH present in cell */ - bitvec_set_bit(&bv, 1); - bitvec_set_uint(&bv, si13->pbcch.psi1_rep_per, 4); - /* PBCCH Descripiton */ - bitvec_set_uint(&bv, si13->pbcch.pb, 4); - bitvec_set_uint(&bv, si13->pbcch.tsc, 3); - bitvec_set_uint(&bv, si13->pbcch.tn, 3); - switch (si13->pbcch.carrier_type) { - case PBCCH_BCCH: - bitvec_set_bit(&bv, 0); - bitvec_set_bit(&bv, 0); - break; - case PBCCH_ARFCN: - bitvec_set_bit(&bv, 0); - bitvec_set_bit(&bv, 1); - bitvec_set_uint(&bv, si13->pbcch.arfcn, 10); - break; - case PBCCH_MAIO: - bitvec_set_bit(&bv, 1); - bitvec_set_uint(&bv, si13->pbcch.maio, 6); - break; - } - } + /* PBCCH not present in cell: + it shall never be indicated according to 3GPP TS 44.018 Table 10.5.2.37b.1 */ + bitvec_set_bit(&bv, 0); + bitvec_set_uint(&bv, si13->rac, 8); + bitvec_set_bit(&bv, si13->spgc_ccch_sup); + bitvec_set_uint(&bv, si13->prio_acc_thr, 3); + bitvec_set_uint(&bv, si13->net_ctrl_ord, 2); + append_gprs_cell_opt(&bv, &si13->cell_opts); + append_gprs_pwr_ctrl_pars(&bv, &si13->pwr_ctrl_pars); + /* 3GPP TS 44.018 Release 6 / 10.5.2.37b */ bitvec_set_bit(&bv, H); /* added Release 99 */ /* claim our SGSN is compatible with Release 99, as EDGE and EGPRS diff --git a/openbsc/src/libbsc/system_information.c b/openbsc/src/libbsc/system_information.c index dcabbbd..2bc8769 100644 --- a/openbsc/src/libbsc/system_information.c +++ b/openbsc/src/libbsc/system_information.c @@ -1079,15 +1079,10 @@ }, .bcch_change_mark = 1, .si_change_field = 0, - .pbcch_present = 0, - { - .no_pbcch = { - .rac = 0, /* needs to be patched */ - .spgc_ccch_sup = 0, - .net_ctrl_ord = 0, - .prio_acc_thr = 6, - }, - }, + .rac = 0, /* needs to be patched */ + .spgc_ccch_sup = 0, + .net_ctrl_ord = 0, + .prio_acc_thr = 6, }; static int generate_si13(enum osmo_sysinfo_type t, struct gsm_bts *bts) @@ -1102,8 +1097,8 @@ si13->header.skip_indicator = 0; si13->header.system_information = GSM48_MT_RR_SYSINFO_13; - si13_default.no_pbcch.rac = bts->gprs.rac; - si13_default.no_pbcch.net_ctrl_ord = bts->gprs.net_ctrl_ord; + si13_default.rac = bts->gprs.rac; + si13_default.net_ctrl_ord = bts->gprs.net_ctrl_ord; si13_default.cell_opts.ctrl_ack_type_use_block = bts->gprs.ctrl_ack_type_use_block; -- To view, visit https://gerrit.osmocom.org/3734 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I319e71a4b0c682361529e9c21377398a826b934b Gerrit-PatchSet: 2 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Tue Aug 29 11:34:36 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 29 Aug 2017 11:34:36 +0000 Subject: libosmo-sccp[master]: cosmetic: aggressively set vty->index to NULL in osmo_ss7_vt... In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3732 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I579482f679cd43edfbe796a5806ef360335f1c55 Gerrit-PatchSet: 1 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Aug 29 11:35:03 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 29 Aug 2017 11:35:03 +0000 Subject: libosmocore[master]: vty: 'ctrl' node: add missing default commands like list, exi... In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3733 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I72569ed767b6a4d792b2867d02caa65520e27cd3 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Aug 29 11:35:07 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 29 Aug 2017 11:35:07 +0000 Subject: [MERGED] libosmocore[master]: vty: 'ctrl' node: add missing default commands like list, exi... In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: vty: 'ctrl' node: add missing default commands like list,exit,end ...................................................................... vty: 'ctrl' node: add missing default commands like list,exit,end Change-Id: I72569ed767b6a4d792b2867d02caa65520e27cd3 --- M src/ctrl/control_vty.c 1 file changed, 1 insertion(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/ctrl/control_vty.c b/src/ctrl/control_vty.c index a968bc0..97f42de 100644 --- a/src/ctrl/control_vty.c +++ b/src/ctrl/control_vty.c @@ -82,6 +82,7 @@ ctrl_vty_ctx = ctx; install_element(CONFIG_NODE, &cfg_ctrl_cmd); install_node(&ctrl_node, config_write_ctrl); + vty_install_default(L_CTRL_NODE); install_element(L_CTRL_NODE, &cfg_ctrl_bind_addr_cmd); return 0; -- To view, visit https://gerrit.osmocom.org/3733 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I72569ed767b6a4d792b2867d02caa65520e27cd3 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Tue Aug 29 11:35:16 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 29 Aug 2017 11:35:16 +0000 Subject: [MERGED] libosmo-sccp[master]: cosmetic: aggressively set vty->index to NULL in osmo_ss7_vt... In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: cosmetic: aggressively set vty->index to NULL in osmo_ss7_vty_go_parent() ...................................................................... cosmetic: aggressively set vty->index to NULL in osmo_ss7_vty_go_parent() Change-Id: I579482f679cd43edfbe796a5806ef360335f1c55 --- M src/osmo_ss7_vty.c 1 file changed, 2 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/osmo_ss7_vty.c b/src/osmo_ss7_vty.c index 5731326..1fb35a1 100644 --- a/src/osmo_ss7_vty.c +++ b/src/osmo_ss7_vty.c @@ -1640,10 +1640,12 @@ break; case L_CS7_SCCPADDR_GT_NODE: vty->node = L_CS7_SCCPADDR_NODE; + vty->index = NULL; break; case L_CS7_NODE: default: vty->node = CONFIG_NODE; + vty->index = NULL; break; } return 0; -- To view, visit https://gerrit.osmocom.org/3732 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I579482f679cd43edfbe796a5806ef360335f1c55 Gerrit-PatchSet: 1 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max From gerrit-no-reply at lists.osmocom.org Tue Aug 29 11:53:32 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 29 Aug 2017 11:53:32 +0000 Subject: osmo-bts[master]: trx: avoid deactivating lchan on LCHAN_REL_ACT_REACT In-Reply-To: References: Message-ID: Patch Set 5: Code-Review-1 I still don't like this patch - or don't understand it. If there is a bug, then we fix it instead of introducing a hack and a FIXME. I also don't see why there seems to be an assumption that any LCHAN_REL_ACT_REACT is related to SI3 / number of AGCH. The fact that SI3 related code is the only user of LCHAN_REL_ACT_REACT so far doesn't mean that one can make that assumption. Also, our aim should be to make all BTS models as similar as possible, rather than creating short-cuts for some of them. So my preference would clearly be to do a deactivation + re-actiovation as on other BTS models. Nobody will remember the subtle differences so let's avoid introducing any new ones without a really strong argument. -- To view, visit https://gerrit.osmocom.org/3067 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I20b89ba1e43d1414180b083cd1e085eeffe5d513 Gerrit-PatchSet: 5 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Alexander Chemeris Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Ivan Kluchnikov Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Aug 29 11:56:54 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 29 Aug 2017 11:56:54 +0000 Subject: osmo-msc[master]: am: msc_vlr_tests: use AM_LDFLAGS instead of COMMON vars In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3720 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I6efae6e192b22de2c1d706edd55385135142532b Gerrit-PatchSet: 2 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Aug 29 12:08:50 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 29 Aug 2017 12:08:50 +0000 Subject: osmo-gsm-tester[master]: Add cipher cfg param for modem and bts In-Reply-To: References: Message-ID: Patch Set 2: Code-Review-1 (2 comments) https://gerrit.osmocom.org/#/c/3723/2/example/resources.conf File example/resources.conf: Line 16: ciphers: ['a5 0', 'a5 1', 'a5 2', 'a5 3'] 'a5 2' is a weak "export grade" cipher and globally deprecated. I assume our osmo-bts code doesn't support it. https://gerrit.osmocom.org/#/c/3723/2/src/osmo_gsm_tester/schema.py File src/osmo_gsm_tester/schema.py: Line 70: if val in ('a5 0', 'a5 1', 'a5 2', 'a5 3'): spec wise they go up to 7 -- To view, visit https://gerrit.osmocom.org/3723 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ic0e368843a6e58bd3eeef36d2c0a7501296f0f3e Gerrit-PatchSet: 2 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Tue Aug 29 12:16:36 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 29 Aug 2017 12:16:36 +0000 Subject: openbsc[master]: SI13: drop PBCCH-related bits In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3734 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I319e71a4b0c682361529e9c21377398a826b934b Gerrit-PatchSet: 2 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Aug 29 12:18:58 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 29 Aug 2017 12:18:58 +0000 Subject: osmo-bts[master]: Use git-version-gen from gnulib In-Reply-To: References: Message-ID: Patch Set 3: Code-Review-1 I still don't see why we should introduce yet another build-time ddependency that all of our users need to install. I'm already quite unhappy with the recent new 'bumpversion' dependency. The commit message still doesn't state *why* you are proposing this. What is wrong with the current approach? Which important fixes to git-version-gen have we missed? Where is the advantage to us chceking in a new version of the script in all our repos? -- To view, visit https://gerrit.osmocom.org/3679 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I290acecbbb91f5ee713a035d07e23e7d5c0cf03c Gerrit-PatchSet: 3 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Aug 29 12:23:59 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 29 Aug 2017 12:23:59 +0000 Subject: libosmocore[master]: Cleanup jenkins build scripts In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+1 (1 comment) https://gerrit.osmocom.org/#/c/3132/2/contrib/jenkins-arm.sh File contrib/jenkins-arm.sh: PS2, Line 6: - you are introducing cosmetic changes (all arguments on same line vs. separate lines) with a clean-up, making it much harder to read and thus validate that no unintentional changes are introduced. -- To view, visit https://gerrit.osmocom.org/3132 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I24e500e132f5c8e8133d35548cb7b4e4552331d0 Gerrit-PatchSet: 2 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: blobb Gerrit-Reviewer: lynxis lazus Gerrit-Reviewer: neels Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Tue Aug 29 12:31:33 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 29 Aug 2017 12:31:33 +0000 Subject: libosmocore[master]: Add define for supported a5 key length limit In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3706 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I8ed0f1dbc31aaff22a685ceb3bd2f8db4d2f34fd Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Aug 29 12:33:40 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 29 Aug 2017 12:33:40 +0000 Subject: openbsc[master]: Remove common_cs.h from .deb In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3705 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I22004af84244936ca431f3bf901059f366be8bca Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Aug 29 12:33:43 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 29 Aug 2017 12:33:43 +0000 Subject: [MERGED] openbsc[master]: Remove common_cs.h from .deb In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Remove common_cs.h from .deb ...................................................................... Remove common_cs.h from .deb It's not required by gsm_data_shared.h anymore. Change-Id: I22004af84244936ca431f3bf901059f366be8bca Related: OS#2272 --- M debian/openbsc-dev.install 1 file changed, 0 insertions(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/debian/openbsc-dev.install b/debian/openbsc-dev.install index 0c05545..b669b0f 100644 --- a/debian/openbsc-dev.install +++ b/debian/openbsc-dev.install @@ -1,4 +1,3 @@ openbsc/include/openbsc/gsm_data_shared.h usr/src/osmocom/openbsc/openbsc/include/openbsc/ -openbsc/include/openbsc/common_cs.h usr/src/osmocom/openbsc/openbsc/include/openbsc/ openbsc/src/libcommon/gsm_data_shared.c usr/src/osmocom/openbsc/openbsc/src/libcommon/ usr/lib/*/pkgconfig/openbsc.pc -- To view, visit https://gerrit.osmocom.org/3705 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I22004af84244936ca431f3bf901059f366be8bca Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Tue Aug 29 12:33:55 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 29 Aug 2017 12:33:55 +0000 Subject: osmo-mgw[master]: Use release helper from libosmocore In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3713 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I0905eeb177185da1e2818a01fdb7265694d9903d Gerrit-PatchSet: 2 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Aug 29 12:34:02 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 29 Aug 2017 12:34:02 +0000 Subject: osmo-bsc[master]: Use release helper from libosmocore In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3710 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I05bf42d638167c779328fa61b01c917da91a88de Gerrit-PatchSet: 2 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Aug 29 12:34:09 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 29 Aug 2017 12:34:09 +0000 Subject: osmo-iuh[master]: Use release helper from libosmocore In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3712 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I3ccc8202b650268cc9d1721719ba2f205c351a67 Gerrit-PatchSet: 2 Gerrit-Project: osmo-iuh Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Aug 29 12:34:15 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 29 Aug 2017 12:34:15 +0000 Subject: libosmo-sccp[master]: Use release helper from libosmocore In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3708 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I39b3bfa8a1ccf376215a3ce220cb3cf7a85471cb Gerrit-PatchSet: 2 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: dexter Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Aug 29 12:34:19 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 29 Aug 2017 12:34:19 +0000 Subject: osmo-msc[master]: Use release helper from libosmocore In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3714 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I869395d5c9ab5ec1a487aff15418d1517f47e831 Gerrit-PatchSet: 2 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Aug 29 12:34:37 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 29 Aug 2017 12:34:37 +0000 Subject: openbsc[master]: Use release helper from libosmocore In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3719 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I460fd73230facbba3e326214e46c0b98b7491628 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Aug 29 12:35:18 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 29 Aug 2017 12:35:18 +0000 Subject: osmo-pcap[master]: Use release helper from libosmocore In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3715 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Iafe5905895a656b7055d58ca8f745fcfa4bd9886 Gerrit-PatchSet: 2 Gerrit-Project: osmo-pcap Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Aug 29 12:35:44 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 29 Aug 2017 12:35:44 +0000 Subject: osmo-sgsn[master]: Use release helper from libosmocore In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3716 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I73823c568cfc55ad21a08dec76874724b43f419f Gerrit-PatchSet: 2 Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Aug 29 12:35:50 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 29 Aug 2017 12:35:50 +0000 Subject: openggsn[master]: Use release helper from libosmocore In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3718 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Icdcb388ad22b0c009dac7968408d1e2504c838c1 Gerrit-PatchSet: 2 Gerrit-Project: openggsn Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Aug 29 12:35:59 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 29 Aug 2017 12:35:59 +0000 Subject: osmo-trx[master]: Use release helper from libosmocore In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/3717 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ieb843923d8f534654413be695f2b5f0c87b75520 Gerrit-PatchSet: 2 Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Alexander Chemeris Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Tom Tsou Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Aug 29 12:37:21 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 29 Aug 2017 12:37:21 +0000 Subject: libosmocore[master]: umts aka: add sqn_ms out-param, print SQN.MS in osmo-auc-gen In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3704 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I9fc05bbf169d06716f40b995154fd42a3f91bef3 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Aug 29 12:38:07 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 29 Aug 2017 12:38:07 +0000 Subject: libosmocore[master]: cosmetic: umts aka: tweak comments for sqn and ind In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3703 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ia40cd4ddf35f4fbe895b45b8ea59378f5ce9eb1f Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Aug 29 12:44:06 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 29 Aug 2017 12:44:06 +0000 Subject: libosmocore[master]: osmo-auc-gen: umts: print out the IND of the SQN used In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3702 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I91eac53c4af66a58b9372d9baf5781fc9f29b1fc Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Aug 29 12:44:32 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 29 Aug 2017 12:44:32 +0000 Subject: libosmocore[master]: osmo-auc-gen: umts: add --ind-len arg In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3701 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ia1d8b6a823ffc92290b3e39e4e4665aeff80ccc0 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Aug 29 12:45:12 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 29 Aug 2017 12:45:12 +0000 Subject: libosmocore[master]: osmo-auc-gen: umts: add --ind arg In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3700 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ib60eec80d58ca9a0a01e7fbd2bcbbd4339b1a6d8 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Aug 29 12:45:51 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 29 Aug 2017 12:45:51 +0000 Subject: libosmocore[master]: osmo-auc-gen: umts: use default of ind_bitlen = 5 instead of 0 In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3699 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I9fcc11fa2b5816302dcc6b72249b1ee40d5a61f5 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Aug 29 12:46:09 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 29 Aug 2017 12:46:09 +0000 Subject: libosmocore[master]: osmo-auc-gen: umts: properly request --sqn In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3698 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ic51a8f6333fee9c02b4073ca360991d0aa69c74f Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Aug 29 12:46:31 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 29 Aug 2017 12:46:31 +0000 Subject: libosmocore[master]: osmo-auc-gen: umts: remove erratic SQN.MS printout In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3697 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ie2432c6d6a23818f7b3a29b1295dcbb505e2be53 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Aug 29 12:46:36 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 29 Aug 2017 12:46:36 +0000 Subject: libosmocore[master]: cosmetic: test for osmo-auc-gen: print error for missing binary In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3696 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I98c23ae6378a16cf3b76c90d4ea0dfcf61ff3033 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Aug 29 12:46:47 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 29 Aug 2017 12:46:47 +0000 Subject: [MERGED] libosmocore[master]: cosmetic: test for osmo-auc-gen: print error for missing binary In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: cosmetic: test for osmo-auc-gen: print error for missing binary ...................................................................... cosmetic: test for osmo-auc-gen: print error for missing binary Change-Id: I98c23ae6378a16cf3b76c90d4ea0dfcf61ff3033 --- M tests/osmo-auc-gen/osmo-auc-gen_test.sh 1 file changed, 6 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/tests/osmo-auc-gen/osmo-auc-gen_test.sh b/tests/osmo-auc-gen/osmo-auc-gen_test.sh index 7842638..132d9c3 100755 --- a/tests/osmo-auc-gen/osmo-auc-gen_test.sh +++ b/tests/osmo-auc-gen/osmo-auc-gen_test.sh @@ -1,6 +1,12 @@ #!/bin/sh osmo_auc_gen="$1" +if [ -z "$osmo_auc_gen" ]; then + echo 'Error: pass a path to the osmo-auc-gen binary as argument:' + echo ' ./osmo-auc-gen_test.sh /path/to/osmo-auc-gen' + exit 1 +fi + set -e # run the osmo-auc-gen binary verbosely without showing its absolute path -- To view, visit https://gerrit.osmocom.org/3696 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I98c23ae6378a16cf3b76c90d4ea0dfcf61ff3033 Gerrit-PatchSet: 2 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Tue Aug 29 12:46:48 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 29 Aug 2017 12:46:48 +0000 Subject: [MERGED] libosmocore[master]: osmo-auc-gen: umts: remove erratic SQN.MS printout In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: osmo-auc-gen: umts: remove erratic SQN.MS printout ...................................................................... osmo-auc-gen: umts: remove erratic SQN.MS printout osmo-auc-gen tries to be helpful by deriving the SQN.MS from the SQN that resulted from AUTS + milenage_gen_vec(), but there is actually no way to derive the actual AUTS SQN.MS from the resulting SQN. Completely drop the printout to prevent confusion. Adjust test suite expectations. Related: OS#2464 Change-Id: Ie2432c6d6a23818f7b3a29b1295dcbb505e2be53 --- M tests/osmo-auc-gen/osmo-auc-gen_test.ok M utils/osmo-auc-gen.c 2 files changed, 0 insertions(+), 7 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/tests/osmo-auc-gen/osmo-auc-gen_test.ok b/tests/osmo-auc-gen/osmo-auc-gen_test.ok index fb7998f..6a78886 100644 --- a/tests/osmo-auc-gen/osmo-auc-gen_test.ok +++ b/tests/osmo-auc-gen/osmo-auc-gen_test.ok @@ -96,4 +96,3 @@ SRES: 9b36efdf Kc: 059a4f668f6fbe39 SQN: 24 -AUTS success: SQN.MS = 23 diff --git a/utils/osmo-auc-gen.c b/utils/osmo-auc-gen.c index 76c4927..fade6ec 100644 --- a/utils/osmo-auc-gen.c +++ b/utils/osmo-auc-gen.c @@ -266,11 +266,5 @@ printf("SQN:\t%" PRIu64 "\n", test_aud.u.umts.sqn); } - /* After recovering SQN.MS from AUTS, milenage_gen_vec_auts() does - * aud->u.umts.sqn++, so to show SQN.MS we need to -1 */ - if (auts_is_set) - printf("AUTS success: SQN.MS = %" PRIu64 "\n", - test_aud.u.umts.sqn - 1); - exit(0); } -- To view, visit https://gerrit.osmocom.org/3697 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ie2432c6d6a23818f7b3a29b1295dcbb505e2be53 Gerrit-PatchSet: 2 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Tue Aug 29 12:46:48 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 29 Aug 2017 12:46:48 +0000 Subject: [MERGED] libosmocore[master]: osmo-auc-gen: umts: properly request --sqn In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: osmo-auc-gen: umts: properly request --sqn ...................................................................... osmo-auc-gen: umts: properly request --sqn The user supplied an --sqn to generate a vector for, but milenage_gen_vec() performs a nontrivial SQN increment before generating the vector. To end up with the user supplied SQN, we need to reverse this increment beforehand. Do this after all cmdline args have been parsed, in case one of them modifies the IND-bitlen parameter, which affects the SQN calculations. Related: OS#2464 OS#2465 Change-Id: Ic51a8f6333fee9c02b4073ca360991d0aa69c74f --- M utils/osmo-auc-gen.c 1 file changed, 17 insertions(+), 5 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/utils/osmo-auc-gen.c b/utils/osmo-auc-gen.c index fade6ec..87960ae 100644 --- a/utils/osmo-auc-gen.c +++ b/utils/osmo-auc-gen.c @@ -95,9 +95,11 @@ struct osmo_auth_vector _vec; struct osmo_auth_vector *vec = &_vec; uint8_t _rand[16], _auts[14]; + uint64_t sqn; int rc, option_index; int rand_is_set = 0; int auts_is_set = 0; + int sqn_is_set = 0; int fmt_triplets_dat = 0; printf("osmo-auc-gen (C) 2011-2012 by Harald Welte\n"); @@ -196,11 +198,8 @@ fprintf(stderr, "Only UMTS has SQN\n"); exit(2); } - test_aud.u.umts.sqn = strtoull(optarg, 0, 10); - /* Before calculating the UMTS auth vector, - * osmo_auth_gen_vec() increments the SQN. SQN-1 here - * to end up with the SQN the user requested. */ - test_aud.u.umts.sqn--; + sqn = strtoull(optarg, 0, 10); + sqn_is_set = 1; break; case 'r': rc = osmo_hexparse(optarg, _rand, sizeof(_rand)); @@ -246,6 +245,19 @@ memset(vec, 0, sizeof(*vec)); + if (test_aud.type == OSMO_AUTH_TYPE_UMTS) { + uint64_t seq_1 = 1LL << test_aud.u.umts.ind_bitlen; + uint64_t ind_mask = seq_1 - 1; + + if (sqn_is_set) { + /* Before calculating the UMTS auth vector, osmo_auth_gen_vec() increments SEQ. + * To end up with the SQN passed in by the user, we need to pass in SEQ-1, and + * indicate which IND slot to target. */ + test_aud.u.umts.sqn = sqn - seq_1; + test_aud.u.umts.ind = sqn & ind_mask; + } + } + if (!auts_is_set) rc = osmo_auth_gen_vec(vec, &test_aud, _rand); else -- To view, visit https://gerrit.osmocom.org/3698 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ic51a8f6333fee9c02b4073ca360991d0aa69c74f Gerrit-PatchSet: 2 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Tue Aug 29 12:46:48 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 29 Aug 2017 12:46:48 +0000 Subject: [MERGED] libosmocore[master]: osmo-auc-gen: umts: use default of ind_bitlen = 5 instead of 0 In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: osmo-auc-gen: umts: use default of ind_bitlen = 5 instead of 0 ...................................................................... osmo-auc-gen: umts: use default of ind_bitlen = 5 instead of 0 Most USIM out there seem to use IND-length = 5 bits, so do sysmousim-sjs1. Currently from initialization we are using an IND length of zero in osmo-auc-gen, which produces confusing SQN results after AUTS: Where want SQN to be incremented to the next IND array, usually +32, an IND-len of 0 makes for only +1. As result, the osmo-auc-gen_test.sh produces SQN 32 instead of 24 after receiving SQN.MS = 23 from AUTS: adjust test expectations. Related: OS#2465 Change-Id: I9fcc11fa2b5816302dcc6b72249b1ee40d5a61f5 --- M tests/osmo-auc-gen/osmo-auc-gen_test.ok M utils/osmo-auc-gen.c 2 files changed, 3 insertions(+), 2 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/tests/osmo-auc-gen/osmo-auc-gen_test.ok b/tests/osmo-auc-gen/osmo-auc-gen_test.ok index 6a78886..a1d06f0 100644 --- a/tests/osmo-auc-gen/osmo-auc-gen_test.ok +++ b/tests/osmo-auc-gen/osmo-auc-gen_test.ok @@ -89,10 +89,10 @@ This is FREE SOFTWARE with ABSOLUTELY NO WARRANTY RAND: 39fa2f4e3d523d8619a73b4f65c3e14d -AUTN: 8704f5ba55eb0000d7fc4f7f19cfc180 +AUTN: 8704f5ba55d30000541dde77ea5b1d8c IK: 27497388b6cb044648f396aa155b95ef CK: f64735036e5871319c679f4742a75ea1 RES: e229c19e791f2e41 SRES: 9b36efdf Kc: 059a4f668f6fbe39 -SQN: 24 +SQN: 32 diff --git a/utils/osmo-auc-gen.c b/utils/osmo-auc-gen.c index 87960ae..4e07fa7 100644 --- a/utils/osmo-auc-gen.c +++ b/utils/osmo-auc-gen.c @@ -138,6 +138,7 @@ break; case '3': test_aud.type = OSMO_AUTH_TYPE_UMTS; + test_aud.u.umts.ind_bitlen = 5; break; case 'a': rc = osmo_auth_alg_parse(optarg); -- To view, visit https://gerrit.osmocom.org/3699 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I9fcc11fa2b5816302dcc6b72249b1ee40d5a61f5 Gerrit-PatchSet: 2 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Tue Aug 29 12:46:48 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 29 Aug 2017 12:46:48 +0000 Subject: [MERGED] libosmocore[master]: osmo-auc-gen: umts: add --ind arg In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: osmo-auc-gen: umts: add --ind arg ...................................................................... osmo-auc-gen: umts: add --ind arg During UMTS AKA, the caller typically indicates which IND slot the next used SQN should belong to. Without this option, osmo-auc-gen will always produce SQN from IND-slot 0. Add --ind option. Enhance the osmo-auc-gen_test.sh to expect errors with useful printouts on stderr, and add tests that verify valid --ind ranges. Related: OS#2465 Change-Id: Ib60eec80d58ca9a0a01e7fbd2bcbbd4339b1a6d8 --- M tests/osmo-auc-gen/osmo-auc-gen_test.err M tests/osmo-auc-gen/osmo-auc-gen_test.ok M tests/osmo-auc-gen/osmo-auc-gen_test.sh M utils/osmo-auc-gen.c 4 files changed, 120 insertions(+), 2 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/tests/osmo-auc-gen/osmo-auc-gen_test.err b/tests/osmo-auc-gen/osmo-auc-gen_test.err index e69de29..46ecf2e 100644 --- a/tests/osmo-auc-gen/osmo-auc-gen_test.err +++ b/tests/osmo-auc-gen/osmo-auc-gen_test.err @@ -0,0 +1,9 @@ +expecting error: +> osmo-auc-gen -3 -a milenage -r 39fa2f4e3d523d8619a73b4f65c3e14d -k EB215756028D60E3275E613320AEC880 -o FB2A3D1B360F599ABAB99DB8669F8308 -A 979498b1f72d3e28c59fa2e72f9c --ind -1 +Requested --ind 4294967295 is too large for IND bitlen of 5 +expecting error: +> osmo-auc-gen -3 -a milenage -r 39fa2f4e3d523d8619a73b4f65c3e14d -k EB215756028D60E3275E613320AEC880 -o FB2A3D1B360F599ABAB99DB8669F8308 -A 979498b1f72d3e28c59fa2e72f9c --ind 32 +Requested --ind 32 is too large for IND bitlen of 5 +expecting error: +> osmo-auc-gen -3 -a milenage -r 39fa2f4e3d523d8619a73b4f65c3e14d -k EB215756028D60E3275E613320AEC880 -o FB2A3D1B360F599ABAB99DB8669F8308 -A 979498b1f72d3e28c59fa2e72f9c --ind 42 +Requested --ind 42 is too large for IND bitlen of 5 diff --git a/tests/osmo-auc-gen/osmo-auc-gen_test.ok b/tests/osmo-auc-gen/osmo-auc-gen_test.ok index a1d06f0..278c88f 100644 --- a/tests/osmo-auc-gen/osmo-auc-gen_test.ok +++ b/tests/osmo-auc-gen/osmo-auc-gen_test.ok @@ -96,3 +96,66 @@ SRES: 9b36efdf Kc: 059a4f668f6fbe39 SQN: 32 + + +> osmo-auc-gen -3 -a milenage -r 39fa2f4e3d523d8619a73b4f65c3e14d -k EB215756028D60E3275E613320AEC880 -o FB2A3D1B360F599ABAB99DB8669F8308 -A 979498b1f72d3e28c59fa2e72f9c --ind 5 +osmo-auc-gen (C) 2011-2012 by Harald Welte +This is FREE SOFTWARE with ABSOLUTELY NO WARRANTY + +RAND: 39fa2f4e3d523d8619a73b4f65c3e14d +AUTN: 8704f5ba55d6000079267a4b347ad890 +IK: 27497388b6cb044648f396aa155b95ef +CK: f64735036e5871319c679f4742a75ea1 +RES: e229c19e791f2e41 +SRES: 9b36efdf +Kc: 059a4f668f6fbe39 +SQN: 37 + + +> osmo-auc-gen -3 -a milenage -r 39fa2f4e3d523d8619a73b4f65c3e14d -k EB215756028D60E3275E613320AEC880 -o FB2A3D1B360F599ABAB99DB8669F8308 -A 979498b1f72d3e28c59fa2e72f9c --ind 23 +osmo-auc-gen (C) 2011-2012 by Harald Welte +This is FREE SOFTWARE with ABSOLUTELY NO WARRANTY + +RAND: 39fa2f4e3d523d8619a73b4f65c3e14d +AUTN: 8704f5ba55c40000129ddaa4f5016e25 +IK: 27497388b6cb044648f396aa155b95ef +CK: f64735036e5871319c679f4742a75ea1 +RES: e229c19e791f2e41 +SRES: 9b36efdf +Kc: 059a4f668f6fbe39 +SQN: 55 + + +> osmo-auc-gen -3 -a milenage -r 39fa2f4e3d523d8619a73b4f65c3e14d -k EB215756028D60E3275E613320AEC880 -o FB2A3D1B360F599ABAB99DB8669F8308 -A 979498b1f72d3e28c59fa2e72f9c --ind 31 +osmo-auc-gen (C) 2011-2012 by Harald Welte +This is FREE SOFTWARE with ABSOLUTELY NO WARRANTY + +RAND: 39fa2f4e3d523d8619a73b4f65c3e14d +AUTN: 8704f5ba55cc00009d169f5ff89f6087 +IK: 27497388b6cb044648f396aa155b95ef +CK: f64735036e5871319c679f4742a75ea1 +RES: e229c19e791f2e41 +SRES: 9b36efdf +Kc: 059a4f668f6fbe39 +SQN: 63 + + +expecting error: +> osmo-auc-gen -3 -a milenage -r 39fa2f4e3d523d8619a73b4f65c3e14d -k EB215756028D60E3275E613320AEC880 -o FB2A3D1B360F599ABAB99DB8669F8308 -A 979498b1f72d3e28c59fa2e72f9c --ind -1 +osmo-auc-gen (C) 2011-2012 by Harald Welte +This is FREE SOFTWARE with ABSOLUTELY NO WARRANTY + + + +expecting error: +> osmo-auc-gen -3 -a milenage -r 39fa2f4e3d523d8619a73b4f65c3e14d -k EB215756028D60E3275E613320AEC880 -o FB2A3D1B360F599ABAB99DB8669F8308 -A 979498b1f72d3e28c59fa2e72f9c --ind 32 +osmo-auc-gen (C) 2011-2012 by Harald Welte +This is FREE SOFTWARE with ABSOLUTELY NO WARRANTY + + + +expecting error: +> osmo-auc-gen -3 -a milenage -r 39fa2f4e3d523d8619a73b4f65c3e14d -k EB215756028D60E3275E613320AEC880 -o FB2A3D1B360F599ABAB99DB8669F8308 -A 979498b1f72d3e28c59fa2e72f9c --ind 42 +osmo-auc-gen (C) 2011-2012 by Harald Welte +This is FREE SOFTWARE with ABSOLUTELY NO WARRANTY + diff --git a/tests/osmo-auc-gen/osmo-auc-gen_test.sh b/tests/osmo-auc-gen/osmo-auc-gen_test.sh index 132d9c3..f7fc87d 100755 --- a/tests/osmo-auc-gen/osmo-auc-gen_test.sh +++ b/tests/osmo-auc-gen/osmo-auc-gen_test.sh @@ -18,6 +18,16 @@ $osmo_auc_gen $@ } +invoke_err() { + echo + echo + echo expecting error: + echo '>' osmo-auc-gen $@ + echo expecting error: >&2 + echo '>' osmo-auc-gen $@ >&2 + $osmo_auc_gen $@ && exit 1 || true +} + bytes1="6a61050765caa32c90371370e5d6dc2d" bytes2="1dc4f974325cce611e54f516dc1fec56" bytes3="2a48162ff3edca4adf0b7b5e527d6c16" @@ -32,5 +42,13 @@ k="EB215756028D60E3275E613320AEC880" opc="FB2A3D1B360F599ABAB99DB8669F8308" rand="39fa2f4e3d523d8619a73b4f65c3e14d" -auts="979498b1f72d3e28c59fa2e72f9c" +auts="979498b1f72d3e28c59fa2e72f9c" # --> SQN.MS = 23 invoke -3 -a milenage -r $rand -k $k -o $opc -A $auts +invoke -3 -a milenage -r $rand -k $k -o $opc -A $auts --ind 5 +invoke -3 -a milenage -r $rand -k $k -o $opc -A $auts --ind 23 +invoke -3 -a milenage -r $rand -k $k -o $opc -A $auts --ind 31 + +# expect error: IND is too large for IND-bitlen of 5 (max 31) +invoke_err -3 -a milenage -r $rand -k $k -o $opc -A $auts --ind -1 +invoke_err -3 -a milenage -r $rand -k $k -o $opc -A $auts --ind 32 +invoke_err -3 -a milenage -r $rand -k $k -o $opc -A $auts --ind 42 diff --git a/utils/osmo-auc-gen.c b/utils/osmo-auc-gen.c index 4e07fa7..4f36dee 100644 --- a/utils/osmo-auc-gen.c +++ b/utils/osmo-auc-gen.c @@ -80,6 +80,7 @@ "-O --op\tSpecify OP (only for 3G)\n" "-f --amf\tSpecify AMF (only for 3G)\n" "-s --sqn\tSpecify SQN (only for 3G)\n" + "-i --ind\tSpecify IND slot for new SQN after AUTS (only for 3G)\n" "-A --auts\tSpecify AUTS (only for 3G)\n" "-r --rand\tSpecify random value\n" "-I --ipsec\tOutput in triplets.dat format for strongswan\n"); @@ -96,10 +97,12 @@ struct osmo_auth_vector *vec = &_vec; uint8_t _rand[16], _auts[14]; uint64_t sqn; + unsigned int ind; int rc, option_index; int rand_is_set = 0; int auts_is_set = 0; int sqn_is_set = 0; + int ind_is_set = 0; int fmt_triplets_dat = 0; printf("osmo-auc-gen (C) 2011-2012 by Harald Welte\n"); @@ -118,6 +121,7 @@ { "op", 1, 0, 'O' }, { "amf", 1, 0, 'f' }, { "sqn", 1, 0, 's' }, + { "ind", 1, 0, 'i' }, { "rand", 1, 0, 'r' }, { "auts", 1, 0, 'A' }, { "help", 0, 0, 'h' }, @@ -126,7 +130,7 @@ rc = 0; - c = getopt_long(argc, argv, "23a:k:o:f:s:r:hO:A:I", long_options, + c = getopt_long(argc, argv, "23a:k:o:f:s:i:r:hO:A:I", long_options, &option_index); if (c == -1) @@ -202,6 +206,14 @@ sqn = strtoull(optarg, 0, 10); sqn_is_set = 1; break; + case 'i': + if (test_aud.type != OSMO_AUTH_TYPE_UMTS) { + fprintf(stderr, "Only UMTS has IND\n"); + exit(2); + } + ind = atoi(optarg); + ind_is_set = 1; + break; case 'r': rc = osmo_hexparse(optarg, _rand, sizeof(_rand)); rand_is_set = 1; @@ -257,6 +269,22 @@ test_aud.u.umts.sqn = sqn - seq_1; test_aud.u.umts.ind = sqn & ind_mask; } + + if (sqn_is_set && ind_is_set) { + fprintf(stderr, "Requesting --sqn %"PRIu64" implies IND=%u," + " so no further --ind argument is allowed.\n", + sqn, test_aud.u.umts.ind); + exit(2); + } + + if (ind_is_set) { + if (ind >= (1 << test_aud.u.umts.ind_bitlen)) { + fprintf(stderr, "Requested --ind %u is too large for IND bitlen of %u\n", + ind, test_aud.u.umts.ind_bitlen); + exit(2); + } + test_aud.u.umts.ind = ind; + } } if (!auts_is_set) -- To view, visit https://gerrit.osmocom.org/3700 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ib60eec80d58ca9a0a01e7fbd2bcbbd4339b1a6d8 Gerrit-PatchSet: 2 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Tue Aug 29 12:46:49 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 29 Aug 2017 12:46:49 +0000 Subject: [MERGED] libosmocore[master]: osmo-auc-gen: umts: add --ind-len arg In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: osmo-auc-gen: umts: add --ind-len arg ...................................................................... osmo-auc-gen: umts: add --ind-len arg osmo-auc-gen so far does not allow indicating the IND bit length of SQN. A default of 5 serves most practical cases, nevertheless we should allow passing arbitrary IND lengths. Enhance the test suite to test --ind-len. Related: OS#2465 Change-Id: Ia1d8b6a823ffc92290b3e39e4e4665aeff80ccc0 --- M tests/osmo-auc-gen/osmo-auc-gen_test.err M tests/osmo-auc-gen/osmo-auc-gen_test.ok M tests/osmo-auc-gen/osmo-auc-gen_test.sh M utils/osmo-auc-gen.c 4 files changed, 98 insertions(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/tests/osmo-auc-gen/osmo-auc-gen_test.err b/tests/osmo-auc-gen/osmo-auc-gen_test.err index 46ecf2e..d9b5485 100644 --- a/tests/osmo-auc-gen/osmo-auc-gen_test.err +++ b/tests/osmo-auc-gen/osmo-auc-gen_test.err @@ -7,3 +7,6 @@ expecting error: > osmo-auc-gen -3 -a milenage -r 39fa2f4e3d523d8619a73b4f65c3e14d -k EB215756028D60E3275E613320AEC880 -o FB2A3D1B360F599ABAB99DB8669F8308 -A 979498b1f72d3e28c59fa2e72f9c --ind 42 Requested --ind 42 is too large for IND bitlen of 5 +expecting error: +> osmo-auc-gen -3 -a milenage -r 39fa2f4e3d523d8619a73b4f65c3e14d -k EB215756028D60E3275E613320AEC880 -o FB2A3D1B360F599ABAB99DB8669F8308 -A 979498b1f72d3e28c59fa2e72f9c --ind-len 0 --ind 1 +Requested --ind 1 is too large for IND bitlen of 0 diff --git a/tests/osmo-auc-gen/osmo-auc-gen_test.ok b/tests/osmo-auc-gen/osmo-auc-gen_test.ok index 278c88f..f833760 100644 --- a/tests/osmo-auc-gen/osmo-auc-gen_test.ok +++ b/tests/osmo-auc-gen/osmo-auc-gen_test.ok @@ -140,6 +140,76 @@ SQN: 63 +> osmo-auc-gen -3 -a milenage -r 39fa2f4e3d523d8619a73b4f65c3e14d -k EB215756028D60E3275E613320AEC880 -o FB2A3D1B360F599ABAB99DB8669F8308 -A 979498b1f72d3e28c59fa2e72f9c --ind-len 0 +osmo-auc-gen (C) 2011-2012 by Harald Welte +This is FREE SOFTWARE with ABSOLUTELY NO WARRANTY + +RAND: 39fa2f4e3d523d8619a73b4f65c3e14d +AUTN: 8704f5ba55eb0000d7fc4f7f19cfc180 +IK: 27497388b6cb044648f396aa155b95ef +CK: f64735036e5871319c679f4742a75ea1 +RES: e229c19e791f2e41 +SRES: 9b36efdf +Kc: 059a4f668f6fbe39 +SQN: 24 + + +> osmo-auc-gen -3 -a milenage -r 39fa2f4e3d523d8619a73b4f65c3e14d -k EB215756028D60E3275E613320AEC880 -o FB2A3D1B360F599ABAB99DB8669F8308 -A 979498b1f72d3e28c59fa2e72f9c --ind-len 1 +osmo-auc-gen (C) 2011-2012 by Harald Welte +This is FREE SOFTWARE with ABSOLUTELY NO WARRANTY + +RAND: 39fa2f4e3d523d8619a73b4f65c3e14d +AUTN: 8704f5ba55eb0000d7fc4f7f19cfc180 +IK: 27497388b6cb044648f396aa155b95ef +CK: f64735036e5871319c679f4742a75ea1 +RES: e229c19e791f2e41 +SRES: 9b36efdf +Kc: 059a4f668f6fbe39 +SQN: 24 + + +> osmo-auc-gen -3 -a milenage -r 39fa2f4e3d523d8619a73b4f65c3e14d -k EB215756028D60E3275E613320AEC880 -o FB2A3D1B360F599ABAB99DB8669F8308 -A 979498b1f72d3e28c59fa2e72f9c --ind-len 1 --ind 1 +osmo-auc-gen (C) 2011-2012 by Harald Welte +This is FREE SOFTWARE with ABSOLUTELY NO WARRANTY + +RAND: 39fa2f4e3d523d8619a73b4f65c3e14d +AUTN: 8704f5ba55ea0000aab06de3fd6c01af +IK: 27497388b6cb044648f396aa155b95ef +CK: f64735036e5871319c679f4742a75ea1 +RES: e229c19e791f2e41 +SRES: 9b36efdf +Kc: 059a4f668f6fbe39 +SQN: 25 + + +> osmo-auc-gen -3 -a milenage -r 39fa2f4e3d523d8619a73b4f65c3e14d -k EB215756028D60E3275E613320AEC880 -o FB2A3D1B360F599ABAB99DB8669F8308 -A 979498b1f72d3e28c59fa2e72f9c --ind-len 8 +osmo-auc-gen (C) 2011-2012 by Harald Welte +This is FREE SOFTWARE with ABSOLUTELY NO WARRANTY + +RAND: 39fa2f4e3d523d8619a73b4f65c3e14d +AUTN: 8704f5ba54f30000cbba2fbba3c5e242 +IK: 27497388b6cb044648f396aa155b95ef +CK: f64735036e5871319c679f4742a75ea1 +RES: e229c19e791f2e41 +SRES: 9b36efdf +Kc: 059a4f668f6fbe39 +SQN: 256 + + +> osmo-auc-gen -3 -a milenage -r 39fa2f4e3d523d8619a73b4f65c3e14d -k EB215756028D60E3275E613320AEC880 -o FB2A3D1B360F599ABAB99DB8669F8308 -A 979498b1f72d3e28c59fa2e72f9c --ind-len 8 --ind 1 +osmo-auc-gen (C) 2011-2012 by Harald Welte +This is FREE SOFTWARE with ABSOLUTELY NO WARRANTY + +RAND: 39fa2f4e3d523d8619a73b4f65c3e14d +AUTN: 8704f5ba54f200008f8e14579da5ecbb +IK: 27497388b6cb044648f396aa155b95ef +CK: f64735036e5871319c679f4742a75ea1 +RES: e229c19e791f2e41 +SRES: 9b36efdf +Kc: 059a4f668f6fbe39 +SQN: 257 + + expecting error: > osmo-auc-gen -3 -a milenage -r 39fa2f4e3d523d8619a73b4f65c3e14d -k EB215756028D60E3275E613320AEC880 -o FB2A3D1B360F599ABAB99DB8669F8308 -A 979498b1f72d3e28c59fa2e72f9c --ind -1 osmo-auc-gen (C) 2011-2012 by Harald Welte @@ -159,3 +229,10 @@ osmo-auc-gen (C) 2011-2012 by Harald Welte This is FREE SOFTWARE with ABSOLUTELY NO WARRANTY + + +expecting error: +> osmo-auc-gen -3 -a milenage -r 39fa2f4e3d523d8619a73b4f65c3e14d -k EB215756028D60E3275E613320AEC880 -o FB2A3D1B360F599ABAB99DB8669F8308 -A 979498b1f72d3e28c59fa2e72f9c --ind-len 0 --ind 1 +osmo-auc-gen (C) 2011-2012 by Harald Welte +This is FREE SOFTWARE with ABSOLUTELY NO WARRANTY + diff --git a/tests/osmo-auc-gen/osmo-auc-gen_test.sh b/tests/osmo-auc-gen/osmo-auc-gen_test.sh index f7fc87d..55b0757 100755 --- a/tests/osmo-auc-gen/osmo-auc-gen_test.sh +++ b/tests/osmo-auc-gen/osmo-auc-gen_test.sh @@ -48,7 +48,15 @@ invoke -3 -a milenage -r $rand -k $k -o $opc -A $auts --ind 23 invoke -3 -a milenage -r $rand -k $k -o $opc -A $auts --ind 31 +invoke -3 -a milenage -r $rand -k $k -o $opc -A $auts --ind-len 0 +invoke -3 -a milenage -r $rand -k $k -o $opc -A $auts --ind-len 1 +invoke -3 -a milenage -r $rand -k $k -o $opc -A $auts --ind-len 1 --ind 1 +invoke -3 -a milenage -r $rand -k $k -o $opc -A $auts --ind-len 8 +invoke -3 -a milenage -r $rand -k $k -o $opc -A $auts --ind-len 8 --ind 1 + # expect error: IND is too large for IND-bitlen of 5 (max 31) invoke_err -3 -a milenage -r $rand -k $k -o $opc -A $auts --ind -1 invoke_err -3 -a milenage -r $rand -k $k -o $opc -A $auts --ind 32 invoke_err -3 -a milenage -r $rand -k $k -o $opc -A $auts --ind 42 + +invoke_err -3 -a milenage -r $rand -k $k -o $opc -A $auts --ind-len 0 --ind 1 diff --git a/utils/osmo-auc-gen.c b/utils/osmo-auc-gen.c index 4f36dee..6e38b52 100644 --- a/utils/osmo-auc-gen.c +++ b/utils/osmo-auc-gen.c @@ -81,6 +81,7 @@ "-f --amf\tSpecify AMF (only for 3G)\n" "-s --sqn\tSpecify SQN (only for 3G)\n" "-i --ind\tSpecify IND slot for new SQN after AUTS (only for 3G)\n" + "-l --ind-len\tSpecify IND bit length (default=5) (only for 3G)\n" "-A --auts\tSpecify AUTS (only for 3G)\n" "-r --rand\tSpecify random value\n" "-I --ipsec\tOutput in triplets.dat format for strongswan\n"); @@ -122,6 +123,7 @@ { "amf", 1, 0, 'f' }, { "sqn", 1, 0, 's' }, { "ind", 1, 0, 'i' }, + { "ind-len", 1, 0, 'l' }, { "rand", 1, 0, 'r' }, { "auts", 1, 0, 'A' }, { "help", 0, 0, 'h' }, @@ -130,7 +132,7 @@ rc = 0; - c = getopt_long(argc, argv, "23a:k:o:f:s:i:r:hO:A:I", long_options, + c = getopt_long(argc, argv, "23a:k:o:f:s:i:l:r:hO:A:I", long_options, &option_index); if (c == -1) @@ -214,6 +216,13 @@ ind = atoi(optarg); ind_is_set = 1; break; + case 'l': + if (test_aud.type != OSMO_AUTH_TYPE_UMTS) { + fprintf(stderr, "Only UMTS has IND bitlen\n"); + exit(2); + } + test_aud.u.umts.ind_bitlen = atoi(optarg); + break; case 'r': rc = osmo_hexparse(optarg, _rand, sizeof(_rand)); rand_is_set = 1; -- To view, visit https://gerrit.osmocom.org/3701 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ia1d8b6a823ffc92290b3e39e4e4665aeff80ccc0 Gerrit-PatchSet: 2 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Tue Aug 29 12:46:49 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 29 Aug 2017 12:46:49 +0000 Subject: [MERGED] libosmocore[master]: osmo-auc-gen: umts: print out the IND of the SQN used In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: osmo-auc-gen: umts: print out the IND of the SQN used ...................................................................... osmo-auc-gen: umts: print out the IND of the SQN used Make ind_mask available in the main(){} scope, in order to print out IND = SQN & ind_mask. Adjust test suite expectations. Related: OS#2465 Change-Id: I91eac53c4af66a58b9372d9baf5781fc9f29b1fc --- M tests/osmo-auc-gen/osmo-auc-gen_test.ok M utils/osmo-auc-gen.c 2 files changed, 22 insertions(+), 3 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/tests/osmo-auc-gen/osmo-auc-gen_test.ok b/tests/osmo-auc-gen/osmo-auc-gen_test.ok index f833760..82923f1 100644 --- a/tests/osmo-auc-gen/osmo-auc-gen_test.ok +++ b/tests/osmo-auc-gen/osmo-auc-gen_test.ok @@ -12,6 +12,7 @@ SRES: 057fb997 Kc: 60524000cc5e5407 SQN: 0 +IND: 0 > osmo-auc-gen -3 -a milenage -r 6a61050765caa32c90371370e5d6dc2d -k 1dc4f974325cce611e54f516dc1fec56 -o 2a48162ff3edca4adf0b7b5e527d6c16 -s 1 @@ -26,6 +27,7 @@ SRES: 057fb997 Kc: 60524000cc5e5407 SQN: 1 +IND: 1 > osmo-auc-gen -3 -a milenage -r 6a61050765caa32c90371370e5d6dc2d -k 1dc4f974325cce611e54f516dc1fec56 -o 2a48162ff3edca4adf0b7b5e527d6c16 -s 23 @@ -40,6 +42,7 @@ SRES: 057fb997 Kc: 60524000cc5e5407 SQN: 23 +IND: 23 > osmo-auc-gen -3 -a milenage -r 1dc4f974325cce611e54f516dc1fec56 -k 2a48162ff3edca4adf0b7b5e527d6c16 -o 6a61050765caa32c90371370e5d6dc2d -s 42 @@ -54,6 +57,7 @@ SRES: 4c57defe Kc: 169d78081b24c007 SQN: 42 +IND: 10 > osmo-auc-gen -3 -a milenage -r 2a48162ff3edca4adf0b7b5e527d6c16 -k 6a61050765caa32c90371370e5d6dc2d -o 1dc4f974325cce611e54f516dc1fec56 -s 99 @@ -68,6 +72,7 @@ SRES: 1f89e7e9 Kc: d2d5361395b9b74a SQN: 99 +IND: 3 > osmo-auc-gen -3 -a milenage -r 6a61050765caa32c90371370e5d6dc2d -k 2a48162ff3edca4adf0b7b5e527d6c16 -o 1dc4f974325cce611e54f516dc1fec56 -s 281474976710655 @@ -82,6 +87,7 @@ SRES: 1b9297a7 Kc: 10687b71e4eb94c5 SQN: 281474976710655 +IND: 31 > osmo-auc-gen -3 -a milenage -r 39fa2f4e3d523d8619a73b4f65c3e14d -k EB215756028D60E3275E613320AEC880 -o FB2A3D1B360F599ABAB99DB8669F8308 -A 979498b1f72d3e28c59fa2e72f9c @@ -96,6 +102,7 @@ SRES: 9b36efdf Kc: 059a4f668f6fbe39 SQN: 32 +IND: 0 > osmo-auc-gen -3 -a milenage -r 39fa2f4e3d523d8619a73b4f65c3e14d -k EB215756028D60E3275E613320AEC880 -o FB2A3D1B360F599ABAB99DB8669F8308 -A 979498b1f72d3e28c59fa2e72f9c --ind 5 @@ -110,6 +117,7 @@ SRES: 9b36efdf Kc: 059a4f668f6fbe39 SQN: 37 +IND: 5 > osmo-auc-gen -3 -a milenage -r 39fa2f4e3d523d8619a73b4f65c3e14d -k EB215756028D60E3275E613320AEC880 -o FB2A3D1B360F599ABAB99DB8669F8308 -A 979498b1f72d3e28c59fa2e72f9c --ind 23 @@ -124,6 +132,7 @@ SRES: 9b36efdf Kc: 059a4f668f6fbe39 SQN: 55 +IND: 23 > osmo-auc-gen -3 -a milenage -r 39fa2f4e3d523d8619a73b4f65c3e14d -k EB215756028D60E3275E613320AEC880 -o FB2A3D1B360F599ABAB99DB8669F8308 -A 979498b1f72d3e28c59fa2e72f9c --ind 31 @@ -138,6 +147,7 @@ SRES: 9b36efdf Kc: 059a4f668f6fbe39 SQN: 63 +IND: 31 > osmo-auc-gen -3 -a milenage -r 39fa2f4e3d523d8619a73b4f65c3e14d -k EB215756028D60E3275E613320AEC880 -o FB2A3D1B360F599ABAB99DB8669F8308 -A 979498b1f72d3e28c59fa2e72f9c --ind-len 0 @@ -152,6 +162,7 @@ SRES: 9b36efdf Kc: 059a4f668f6fbe39 SQN: 24 +IND: 0 > osmo-auc-gen -3 -a milenage -r 39fa2f4e3d523d8619a73b4f65c3e14d -k EB215756028D60E3275E613320AEC880 -o FB2A3D1B360F599ABAB99DB8669F8308 -A 979498b1f72d3e28c59fa2e72f9c --ind-len 1 @@ -166,6 +177,7 @@ SRES: 9b36efdf Kc: 059a4f668f6fbe39 SQN: 24 +IND: 0 > osmo-auc-gen -3 -a milenage -r 39fa2f4e3d523d8619a73b4f65c3e14d -k EB215756028D60E3275E613320AEC880 -o FB2A3D1B360F599ABAB99DB8669F8308 -A 979498b1f72d3e28c59fa2e72f9c --ind-len 1 --ind 1 @@ -180,6 +192,7 @@ SRES: 9b36efdf Kc: 059a4f668f6fbe39 SQN: 25 +IND: 1 > osmo-auc-gen -3 -a milenage -r 39fa2f4e3d523d8619a73b4f65c3e14d -k EB215756028D60E3275E613320AEC880 -o FB2A3D1B360F599ABAB99DB8669F8308 -A 979498b1f72d3e28c59fa2e72f9c --ind-len 8 @@ -194,6 +207,7 @@ SRES: 9b36efdf Kc: 059a4f668f6fbe39 SQN: 256 +IND: 0 > osmo-auc-gen -3 -a milenage -r 39fa2f4e3d523d8619a73b4f65c3e14d -k EB215756028D60E3275E613320AEC880 -o FB2A3D1B360F599ABAB99DB8669F8308 -A 979498b1f72d3e28c59fa2e72f9c --ind-len 8 --ind 1 @@ -208,6 +222,7 @@ SRES: 9b36efdf Kc: 059a4f668f6fbe39 SQN: 257 +IND: 1 expecting error: diff --git a/utils/osmo-auc-gen.c b/utils/osmo-auc-gen.c index 6e38b52..d4ae1b9 100644 --- a/utils/osmo-auc-gen.c +++ b/utils/osmo-auc-gen.c @@ -105,6 +105,8 @@ int sqn_is_set = 0; int ind_is_set = 0; int fmt_triplets_dat = 0; + uint64_t seq_1; + uint64_t ind_mask; printf("osmo-auc-gen (C) 2011-2012 by Harald Welte\n"); printf("This is FREE SOFTWARE with ABSOLUTELY NO WARRANTY\n\n"); @@ -268,8 +270,8 @@ memset(vec, 0, sizeof(*vec)); if (test_aud.type == OSMO_AUTH_TYPE_UMTS) { - uint64_t seq_1 = 1LL << test_aud.u.umts.ind_bitlen; - uint64_t ind_mask = seq_1 - 1; + seq_1 = 1LL << test_aud.u.umts.ind_bitlen; + ind_mask = seq_1 - 1; if (sqn_is_set) { /* Before calculating the UMTS auth vector, osmo_auth_gen_vec() increments SEQ. @@ -312,8 +314,10 @@ dump_triplets_dat(vec); else { dump_auth_vec(vec); - if (test_aud.type == OSMO_AUTH_TYPE_UMTS) + if (test_aud.type == OSMO_AUTH_TYPE_UMTS) { printf("SQN:\t%" PRIu64 "\n", test_aud.u.umts.sqn); + printf("IND:\t%u\n", (unsigned int)(test_aud.u.umts.sqn & ind_mask)); + } } exit(0); -- To view, visit https://gerrit.osmocom.org/3702 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I91eac53c4af66a58b9372d9baf5781fc9f29b1fc Gerrit-PatchSet: 2 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Tue Aug 29 12:46:49 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 29 Aug 2017 12:46:49 +0000 Subject: [MERGED] libosmocore[master]: cosmetic: umts aka: tweak comments for sqn and ind In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: cosmetic: umts aka: tweak comments for sqn and ind ...................................................................... cosmetic: umts aka: tweak comments for sqn and ind Clearly indicate that 'sqn' is an in *and* out-parameter. Clarify the effect of 'ind'. Change-Id: Ia40cd4ddf35f4fbe895b45b8ea59378f5ce9eb1f --- M include/osmocom/crypt/auth.h 1 file changed, 2 insertions(+), 2 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/include/osmocom/crypt/auth.h b/include/osmocom/crypt/auth.h index 2f88a3a..059e734 100644 --- a/include/osmocom/crypt/auth.h +++ b/include/osmocom/crypt/auth.h @@ -35,10 +35,10 @@ uint8_t opc[16]; /*!< operator invariant value */ uint8_t k[16]; /*!< secret key of the subscriber */ uint8_t amf[2]; - uint64_t sqn; /*!< sequence number */ + uint64_t sqn; /*!< sequence number (in: prev sqn; out: used sqn) */ int opc_is_op; /*!< is the OPC field OPC (0) or OP (1) ? */ unsigned int ind_bitlen; /*!< nr of bits not in SEQ, only SQN */ - unsigned int ind; /*!< SQN slot, i.e. (SEQ << ind_bitlen) + ind */ + unsigned int ind; /*!< which IND slot to use an SQN from */ } umts; struct { uint8_t ki[16]; /*!< secret key */ -- To view, visit https://gerrit.osmocom.org/3703 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ia40cd4ddf35f4fbe895b45b8ea59378f5ce9eb1f Gerrit-PatchSet: 2 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Tue Aug 29 12:46:49 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 29 Aug 2017 12:46:49 +0000 Subject: [MERGED] libosmocore[master]: umts aka: add sqn_ms out-param, print SQN.MS in osmo-auc-gen In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: umts aka: add sqn_ms out-param, print SQN.MS in osmo-auc-gen ...................................................................... umts aka: add sqn_ms out-param, print SQN.MS in osmo-auc-gen When doing UMTS AKA with AUTS, it can be interesting to know the SQN.MS that was encoded in the AUTS. The only way to know this is to provide it as a separate out-parameter from milenage_gen_vec_auts(), because the SQN.MS from AUTS stored in umts.sqn is immediately modified non-trivially by milenage_gen_vec(). Add sqn_ms to struct osmo_sub_auth_data to retain SQN.MS even after a vector was generated. Use this to print out SQN.MS for 'osmo-auc-gen -3 -A'. Adjust test suite expectations. Related: OS#2464 Change-Id: I9fc05bbf169d06716f40b995154fd42a3f91bef3 --- M include/osmocom/crypt/auth.h M src/gsm/auth_milenage.c M tests/osmo-auc-gen/osmo-auc-gen_test.ok M utils/osmo-auc-gen.c 4 files changed, 14 insertions(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/include/osmocom/crypt/auth.h b/include/osmocom/crypt/auth.h index 059e734..6d2c783 100644 --- a/include/osmocom/crypt/auth.h +++ b/include/osmocom/crypt/auth.h @@ -39,6 +39,7 @@ int opc_is_op; /*!< is the OPC field OPC (0) or OP (1) ? */ unsigned int ind_bitlen; /*!< nr of bits not in SEQ, only SQN */ unsigned int ind; /*!< which IND slot to use an SQN from */ + uint64_t sqn_ms; /*!< sqn from AUTS (output value only) */ } umts; struct { uint8_t ki[16]; /*!< secret key */ diff --git a/src/gsm/auth_milenage.c b/src/gsm/auth_milenage.c index 6dd4f45..e1a1dfb 100644 --- a/src/gsm/auth_milenage.c +++ b/src/gsm/auth_milenage.c @@ -158,9 +158,10 @@ if (rc < 0) return rc; + aud->u.umts.sqn_ms = osmo_load64be_ext(sqn_out, 6) >> 16; /* Update our "largest used SQN" from the USIM -- milenage_gen_vec() * below will increment SQN. */ - aud->u.umts.sqn = osmo_load64be_ext(sqn_out, 6) >> 16; + aud->u.umts.sqn = aud->u.umts.sqn_ms; return milenage_gen_vec(vec, aud, _rand); } diff --git a/tests/osmo-auc-gen/osmo-auc-gen_test.ok b/tests/osmo-auc-gen/osmo-auc-gen_test.ok index 82923f1..2840783 100644 --- a/tests/osmo-auc-gen/osmo-auc-gen_test.ok +++ b/tests/osmo-auc-gen/osmo-auc-gen_test.ok @@ -103,6 +103,7 @@ Kc: 059a4f668f6fbe39 SQN: 32 IND: 0 +SQN.MS: 23 > osmo-auc-gen -3 -a milenage -r 39fa2f4e3d523d8619a73b4f65c3e14d -k EB215756028D60E3275E613320AEC880 -o FB2A3D1B360F599ABAB99DB8669F8308 -A 979498b1f72d3e28c59fa2e72f9c --ind 5 @@ -118,6 +119,7 @@ Kc: 059a4f668f6fbe39 SQN: 37 IND: 5 +SQN.MS: 23 > osmo-auc-gen -3 -a milenage -r 39fa2f4e3d523d8619a73b4f65c3e14d -k EB215756028D60E3275E613320AEC880 -o FB2A3D1B360F599ABAB99DB8669F8308 -A 979498b1f72d3e28c59fa2e72f9c --ind 23 @@ -133,6 +135,7 @@ Kc: 059a4f668f6fbe39 SQN: 55 IND: 23 +SQN.MS: 23 > osmo-auc-gen -3 -a milenage -r 39fa2f4e3d523d8619a73b4f65c3e14d -k EB215756028D60E3275E613320AEC880 -o FB2A3D1B360F599ABAB99DB8669F8308 -A 979498b1f72d3e28c59fa2e72f9c --ind 31 @@ -148,6 +151,7 @@ Kc: 059a4f668f6fbe39 SQN: 63 IND: 31 +SQN.MS: 23 > osmo-auc-gen -3 -a milenage -r 39fa2f4e3d523d8619a73b4f65c3e14d -k EB215756028D60E3275E613320AEC880 -o FB2A3D1B360F599ABAB99DB8669F8308 -A 979498b1f72d3e28c59fa2e72f9c --ind-len 0 @@ -163,6 +167,7 @@ Kc: 059a4f668f6fbe39 SQN: 24 IND: 0 +SQN.MS: 23 > osmo-auc-gen -3 -a milenage -r 39fa2f4e3d523d8619a73b4f65c3e14d -k EB215756028D60E3275E613320AEC880 -o FB2A3D1B360F599ABAB99DB8669F8308 -A 979498b1f72d3e28c59fa2e72f9c --ind-len 1 @@ -178,6 +183,7 @@ Kc: 059a4f668f6fbe39 SQN: 24 IND: 0 +SQN.MS: 23 > osmo-auc-gen -3 -a milenage -r 39fa2f4e3d523d8619a73b4f65c3e14d -k EB215756028D60E3275E613320AEC880 -o FB2A3D1B360F599ABAB99DB8669F8308 -A 979498b1f72d3e28c59fa2e72f9c --ind-len 1 --ind 1 @@ -193,6 +199,7 @@ Kc: 059a4f668f6fbe39 SQN: 25 IND: 1 +SQN.MS: 23 > osmo-auc-gen -3 -a milenage -r 39fa2f4e3d523d8619a73b4f65c3e14d -k EB215756028D60E3275E613320AEC880 -o FB2A3D1B360F599ABAB99DB8669F8308 -A 979498b1f72d3e28c59fa2e72f9c --ind-len 8 @@ -208,6 +215,7 @@ Kc: 059a4f668f6fbe39 SQN: 256 IND: 0 +SQN.MS: 23 > osmo-auc-gen -3 -a milenage -r 39fa2f4e3d523d8619a73b4f65c3e14d -k EB215756028D60E3275E613320AEC880 -o FB2A3D1B360F599ABAB99DB8669F8308 -A 979498b1f72d3e28c59fa2e72f9c --ind-len 8 --ind 1 @@ -223,6 +231,7 @@ Kc: 059a4f668f6fbe39 SQN: 257 IND: 1 +SQN.MS: 23 expecting error: diff --git a/utils/osmo-auc-gen.c b/utils/osmo-auc-gen.c index d4ae1b9..fee9767 100644 --- a/utils/osmo-auc-gen.c +++ b/utils/osmo-auc-gen.c @@ -317,6 +317,8 @@ if (test_aud.type == OSMO_AUTH_TYPE_UMTS) { printf("SQN:\t%" PRIu64 "\n", test_aud.u.umts.sqn); printf("IND:\t%u\n", (unsigned int)(test_aud.u.umts.sqn & ind_mask)); + if (auts_is_set) + printf("SQN.MS:\t%" PRIu64 "\n", test_aud.u.umts.sqn_ms); } } -- To view, visit https://gerrit.osmocom.org/3704 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I9fc05bbf169d06716f40b995154fd42a3f91bef3 Gerrit-PatchSet: 2 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Tue Aug 29 12:47:27 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 29 Aug 2017 12:47:27 +0000 Subject: osmo-msc[master]: Implement AoIP, port to M3UA SIGTRAN (large addition and ref... In-Reply-To: References: Message-ID: Patch Set 5: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3486 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I5ae4e05ee7c57cad341ea5e86af37c1f6b0ffa77 Gerrit-PatchSet: 5 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: dexter Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Aug 29 12:47:55 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 29 Aug 2017 12:47:55 +0000 Subject: osmo-gsm-tester[master]: Reserve ARFCN dynamically based on BTS band support In-Reply-To: References: Message-ID: Patch Set 1: Code-Review-1 (7 comments) https://gerrit.osmocom.org/#/c/3731/1//COMMIT_MSG Commit Message: Line 26: "Related: OS#2230" https://gerrit.osmocom.org/#/c/3731/1/src/osmo_gsm_tester/bts_osmotrx.py File src/osmo_gsm_tester/bts_osmotrx.py: Line 137: } (rather first get the defaults and then overlay this dict on top, otherwise the defaults take precedence over the actually chosen value.) But, all other chosen values come from self.conf and are used in the template directly. Can we do this as well here? https://gerrit.osmocom.org/#/c/3731/1/src/osmo_gsm_tester/bts_sysmo.py File src/osmo_gsm_tester/bts_sysmo.py: Line 154: } (same) https://gerrit.osmocom.org/#/c/3731/1/src/osmo_gsm_tester/resource.py File src/osmo_gsm_tester/resource.py: Line 527: raise RuntimeError('adding a list of reserved resources to itself?') I guess this is a fact and not a question :) https://gerrit.osmocom.org/#/c/3731/1/src/osmo_gsm_tester/suite.py File src/osmo_gsm_tester/suite.py: Line 474: (drop blank line) Line 484: arfcn = suite_run._try_reserve_arfcn(supported_bands) I assumed the arfcn could rather be resolved and picked like any other resource. So that the scenario requests an arfcn with a given band, and the resource resolution returns an unused arfcn that matches this band, and everything just falls into place. Is there something keeping us from doing so? It appears that this way starts a test run and only then figures out that there aren't enough arfcns. The idea is that we don't even start to run unless all resources are available. https://gerrit.osmocom.org/#/c/3731/1/suites/register/register_band_1900.py File suites/register/register_band_1900.py: Line 5: arfcn = suite.reserve_arfcn(band='GSM-1900') this shouldn't be a copy, just the same register test file, except that a *scenario* chooses a 1900 band. -- To view, visit https://gerrit.osmocom.org/3731 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I6fb5d95bed1fa50c3deaf62a7a6df3cb276bc3c9 Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: neels Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Tue Aug 29 12:47:59 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 29 Aug 2017 12:47:59 +0000 Subject: libsmpp34[master]: Use release helper from libosmocore In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3709 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ief2b4d0400b142e84e7ce005a6da5c880c78a8f5 Gerrit-PatchSet: 2 Gerrit-Project: libsmpp34 Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Aug 29 12:48:03 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 29 Aug 2017 12:48:03 +0000 Subject: [MERGED] libsmpp34[master]: Use release helper from libosmocore In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Use release helper from libosmocore ...................................................................... Use release helper from libosmocore See https://osmocom.org/projects/cellular-infrastructure/wiki/Make_a_new_release for details. Change-Id: Ief2b4d0400b142e84e7ce005a6da5c880c78a8f5 Related: OS#1861 --- M Makefile.am A TODO-RELEASE M configure.ac M debian/changelog 4 files changed, 16 insertions(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/Makefile.am b/Makefile.am index b274f45..d526301 100644 --- a/Makefile.am +++ b/Makefile.am @@ -19,5 +19,7 @@ test_apps/recv_and_unpack.inc \ README.md + at RELMAKE@ + pkgconfigdir = $(libdir)/pkgconfig pkgconfig_DATA = libsmpp34.pc diff --git a/TODO-RELEASE b/TODO-RELEASE new file mode 100644 index 0000000..d0852fc --- /dev/null +++ b/TODO-RELEASE @@ -0,0 +1,9 @@ +# When cleaning up this file: bump API version in corresponding Makefile.am and rename corresponding debian/lib*.install +# according to https://www.gnu.org/software/libtool/manual/html_node/Updating-version-info.html#Updating-version-info +# In short: +# LIBVERSION=c:r:a +# If the library source code has changed at all since the last update, then increment revision: c:r + 1:a. +# If any interfaces have been added, removed, or changed since the last update: c + 1:0:0. +# If any interfaces have been added since the last public release: c:r:a + 1. +# If any interfaces have been removed or changed since the last public release: c:r:0. +#library what description / commit summary line diff --git a/configure.ac b/configure.ac index 0354ab9..305cc11 100644 --- a/configure.ac +++ b/configure.ac @@ -8,6 +8,10 @@ AM_INIT_AUTOMAKE([foreign]) AM_CONFIG_HEADER([aux_config/config.h]) +dnl include release helper +RELMAKE='-include osmo-release.mk' +AC_SUBST([RELMAKE]) + # Checks for programs. AC_PROG_CC AM_PROG_CC_C_O diff --git a/debian/changelog b/debian/changelog index c0c3948..5a142af 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,4 @@ -libsmpp34 (1.12) UNRELEASED; urgency=medium +libsmpp34 (1.12.0) UNRELEASED; urgency=medium [ Holger Hans Peter Freyther ] * Move forward towards a new release. -- To view, visit https://gerrit.osmocom.org/3709 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ief2b4d0400b142e84e7ce005a6da5c880c78a8f5 Gerrit-PatchSet: 2 Gerrit-Project: libsmpp34 Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Tue Aug 29 12:48:08 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 29 Aug 2017 12:48:08 +0000 Subject: [MERGED] openggsn[master]: Use release helper from libosmocore In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Use release helper from libosmocore ...................................................................... Use release helper from libosmocore See https://osmocom.org/projects/cellular-infrastructure/wiki/Make_a_new_release for details. Change-Id: Icdcb388ad22b0c009dac7968408d1e2504c838c1 Related: OS#1861 --- M Makefile.am A TODO-RELEASE M configure.ac M debian/changelog 4 files changed, 16 insertions(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/Makefile.am b/Makefile.am index 970fbf7..1d7eaba 100644 --- a/Makefile.am +++ b/Makefile.am @@ -11,3 +11,5 @@ echo $(VERSION) > $(distdir)/.tarball-version EXTRA_DIST = git-version-gen .version README.md README.FreeBSD README.MacOSX README.Solaris + + at RELMAKE@ diff --git a/TODO-RELEASE b/TODO-RELEASE new file mode 100644 index 0000000..d0852fc --- /dev/null +++ b/TODO-RELEASE @@ -0,0 +1,9 @@ +# When cleaning up this file: bump API version in corresponding Makefile.am and rename corresponding debian/lib*.install +# according to https://www.gnu.org/software/libtool/manual/html_node/Updating-version-info.html#Updating-version-info +# In short: +# LIBVERSION=c:r:a +# If the library source code has changed at all since the last update, then increment revision: c:r + 1:a. +# If any interfaces have been added, removed, or changed since the last update: c + 1:0:0. +# If any interfaces have been added since the last public release: c:r:a + 1. +# If any interfaces have been removed or changed since the last public release: c:r:0. +#library what description / commit summary line diff --git a/configure.ac b/configure.ac index 63d3117..9d3a8e4 100644 --- a/configure.ac +++ b/configure.ac @@ -55,6 +55,10 @@ # FIXME: Replace `main' with a function in `-links': #AC_CHECK_LIB([inks], [main]) +dnl include release helper +RELMAKE='-include osmo-release.mk' +AC_SUBST([RELMAKE]) + dnl GTP Linux kernel dependencies AC_ARG_ENABLE([gtp-linux], AS_HELP_STRING([--enable-gtp-linux], [Build GTP tunneling Linux kernel]), diff --git a/debian/changelog b/debian/changelog index 17a0a36..357cc01 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,4 @@ -openggsn (0.94) UNRELEASED; urgency=medium +openggsn (0.94.0) UNRELEASED; urgency=medium [ Holger Hans Peter Freyther ] * Bump version to ease upgrading from Debian SID. -- To view, visit https://gerrit.osmocom.org/3718 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Icdcb388ad22b0c009dac7968408d1e2504c838c1 Gerrit-PatchSet: 2 Gerrit-Project: openggsn Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Tue Aug 29 12:48:15 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 29 Aug 2017 12:48:15 +0000 Subject: [MERGED] osmo-pcap[master]: Use release helper from libosmocore In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Use release helper from libosmocore ...................................................................... Use release helper from libosmocore See https://osmocom.org/projects/cellular-infrastructure/wiki/Make_a_new_release for details. Change-Id: Iafe5905895a656b7055d58ca8f745fcfa4bd9886 Related: OS#1861 --- M Makefile.am M configure.ac 2 files changed, 7 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/Makefile.am b/Makefile.am index 798c092..6caa009 100644 --- a/Makefile.am +++ b/Makefile.am @@ -4,6 +4,9 @@ BUILT_SOURCES = $(top_srcdir)/.version EXTRA_DIST = git-version-gen .version + + at RELMAKE@ + $(top_srcdir)/.version: echo $(VERSION) > $@-t && mv $@-t $@ dist-hook: diff --git a/configure.ac b/configure.ac index 4c0a12f..b370e0d 100644 --- a/configure.ac +++ b/configure.ac @@ -9,6 +9,10 @@ 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]) + dnl checks for programs AC_PROG_MAKE_SET AC_PROG_CC -- To view, visit https://gerrit.osmocom.org/3715 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Iafe5905895a656b7055d58ca8f745fcfa4bd9886 Gerrit-PatchSet: 2 Gerrit-Project: osmo-pcap Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Tue Aug 29 12:48:18 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 29 Aug 2017 12:48:18 +0000 Subject: [MERGED] osmo-msc[master]: Use release helper from libosmocore In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Use release helper from libosmocore ...................................................................... Use release helper from libosmocore See https://osmocom.org/projects/cellular-infrastructure/wiki/Make_a_new_release for details. Change-Id: I869395d5c9ab5ec1a487aff15418d1517f47e831 Related: OS#1861 --- M Makefile.am M configure.ac 2 files changed, 7 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/Makefile.am b/Makefile.am index 4a1f65d..536b3f4 100644 --- a/Makefile.am +++ b/Makefile.am @@ -21,6 +21,9 @@ BUILT_SOURCES = $(top_srcdir)/.version EXTRA_DIST = git-version-gen osmoappdesc.py .version + + at RELMAKE@ + $(top_srcdir)/.version: echo $(VERSION) > $@-t && mv $@-t $@ dist-hook: diff --git a/configure.ac b/configure.ac index 871f7e5..b0d6b23 100644 --- a/configure.ac +++ b/configure.ac @@ -12,6 +12,10 @@ 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]) + dnl checks for programs AC_PROG_MAKE_SET AC_PROG_CC -- To view, visit https://gerrit.osmocom.org/3714 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I869395d5c9ab5ec1a487aff15418d1517f47e831 Gerrit-PatchSet: 2 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Tue Aug 29 12:48:23 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 29 Aug 2017 12:48:23 +0000 Subject: [MERGED] libosmo-sccp[master]: Use release helper from libosmocore In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Use release helper from libosmocore ...................................................................... Use release helper from libosmocore See https://osmocom.org/projects/cellular-infrastructure/wiki/Make_a_new_release for details. Change-Id: I39b3bfa8a1ccf376215a3ce220cb3cf7a85471cb Related: OS#1861 --- M Makefile.am A TODO-RELEASE M configure.ac 3 files changed, 15 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/Makefile.am b/Makefile.am index 9bb711c..e2c5277 100644 --- a/Makefile.am +++ b/Makefile.am @@ -8,6 +8,8 @@ EXTRA_DIST = .version doc/examples/osmo-stp.cfg + at RELMAKE@ + BUILT_SOURCES = $(top_srcdir)/.version $(top_srcdir)/.version: echo $(VERSION) > $@-t && mv $@-t $@ diff --git a/TODO-RELEASE b/TODO-RELEASE new file mode 100644 index 0000000..d0852fc --- /dev/null +++ b/TODO-RELEASE @@ -0,0 +1,9 @@ +# When cleaning up this file: bump API version in corresponding Makefile.am and rename corresponding debian/lib*.install +# according to https://www.gnu.org/software/libtool/manual/html_node/Updating-version-info.html#Updating-version-info +# In short: +# LIBVERSION=c:r:a +# If the library source code has changed at all since the last update, then increment revision: c:r + 1:a. +# If any interfaces have been added, removed, or changed since the last update: c + 1:0:0. +# If any interfaces have been added since the last public release: c:r:a + 1. +# If any interfaces have been removed or changed since the last public release: c:r:0. +#library what description / commit summary line diff --git a/configure.ac b/configure.ac index 7e3e03e..ed761c3 100644 --- a/configure.ac +++ b/configure.ac @@ -12,6 +12,10 @@ 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]) + dnl checks for programs AC_PROG_MAKE_SET AC_PROG_CC -- To view, visit https://gerrit.osmocom.org/3708 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I39b3bfa8a1ccf376215a3ce220cb3cf7a85471cb Gerrit-PatchSet: 3 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: dexter From gerrit-no-reply at lists.osmocom.org Tue Aug 29 12:48:25 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 29 Aug 2017 12:48:25 +0000 Subject: [MERGED] openbsc[master]: Use release helper from libosmocore In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Use release helper from libosmocore ...................................................................... Use release helper from libosmocore See https://osmocom.org/projects/cellular-infrastructure/wiki/Make_a_new_release for details. Change-Id: I460fd73230facbba3e326214e46c0b98b7491628 Related: OS#1861 --- M openbsc/Makefile.am M openbsc/configure.ac 2 files changed, 7 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/openbsc/Makefile.am b/openbsc/Makefile.am index 31a54ea..dc53929 100644 --- a/openbsc/Makefile.am +++ b/openbsc/Makefile.am @@ -20,6 +20,9 @@ BUILT_SOURCES = $(top_srcdir)/.version EXTRA_DIST = git-version-gen osmoappdesc.py .version + + at RELMAKE@ + $(top_srcdir)/.version: echo $(VERSION) > $@-t && mv $@-t $@ dist-hook: diff --git a/openbsc/configure.ac b/openbsc/configure.ac index b155769..48c5c82 100644 --- a/openbsc/configure.ac +++ b/openbsc/configure.ac @@ -12,6 +12,10 @@ 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]) + dnl checks for programs AC_PROG_MAKE_SET AC_PROG_CC -- To view, visit https://gerrit.osmocom.org/3719 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I460fd73230facbba3e326214e46c0b98b7491628 Gerrit-PatchSet: 2 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Tue Aug 29 12:48:29 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 29 Aug 2017 12:48:29 +0000 Subject: [MERGED] osmo-iuh[master]: Use release helper from libosmocore In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Use release helper from libosmocore ...................................................................... Use release helper from libosmocore See https://osmocom.org/projects/cellular-infrastructure/wiki/Make_a_new_release for details. Change-Id: I3ccc8202b650268cc9d1721719ba2f205c351a67 Related: OS#1861 --- M Makefile.am A TODO-RELEASE M configure.ac 3 files changed, 15 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/Makefile.am b/Makefile.am index 447b148..67445ee 100644 --- a/Makefile.am +++ b/Makefile.am @@ -7,6 +7,8 @@ EXTRA_DIST = asn1 .version README.md + at RELMAKE@ + BUILT_SOURCES = $(top_srcdir)/.version $(top_srcdir)/.version: echo $(VERSION) > $@-t && mv $@-t $@ diff --git a/TODO-RELEASE b/TODO-RELEASE new file mode 100644 index 0000000..d0852fc --- /dev/null +++ b/TODO-RELEASE @@ -0,0 +1,9 @@ +# When cleaning up this file: bump API version in corresponding Makefile.am and rename corresponding debian/lib*.install +# according to https://www.gnu.org/software/libtool/manual/html_node/Updating-version-info.html#Updating-version-info +# In short: +# LIBVERSION=c:r:a +# If the library source code has changed at all since the last update, then increment revision: c:r + 1:a. +# If any interfaces have been added, removed, or changed since the last update: c + 1:0:0. +# If any interfaces have been added since the last public release: c:r:a + 1. +# If any interfaces have been removed or changed since the last public release: c:r:0. +#library what description / commit summary line diff --git a/configure.ac b/configure.ac index ab7a637..72cbb56 100644 --- a/configure.ac +++ b/configure.ac @@ -16,6 +16,10 @@ 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]) + dnl checks for programs AC_PROG_MAKE_SET AC_PROG_MKDIR_P -- To view, visit https://gerrit.osmocom.org/3712 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I3ccc8202b650268cc9d1721719ba2f205c351a67 Gerrit-PatchSet: 2 Gerrit-Project: osmo-iuh Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Tue Aug 29 12:48:58 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 29 Aug 2017 12:48:58 +0000 Subject: osmo-msc[master]: move libiu to osmo-iuh/libosmo-ranap In-Reply-To: References: Message-ID: Patch Set 6: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3489 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ib8c4fcdb4766c5e575618b95ce16dce51063206b Gerrit-PatchSet: 6 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Aug 29 12:49:39 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 29 Aug 2017 12:49:39 +0000 Subject: osmo-msc[master]: move to osmo-mgw.git: osmo-bsc_mgcp and libmgcp as libosmo-l... In-Reply-To: References: Message-ID: Patch Set 8: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3492 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ic99d681759edce11564da62500c2aac5cf5fffe2 Gerrit-PatchSet: 8 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Aug 29 12:49:47 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 29 Aug 2017 12:49:47 +0000 Subject: osmo-msc[master]: split off osmo-msc: remove files, apply build, rename In-Reply-To: References: Message-ID: Patch Set 8: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3497 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Icf025e5ea8d180613b3114282951c9afa67af9a7 Gerrit-PatchSet: 8 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Aug 29 12:50:36 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 29 Aug 2017 12:50:36 +0000 Subject: libosmo-netif[master]: Use release helper from libosmocore In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3707 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I01b0aae741b83a3f17f1caf2b6837cf365a1709b Gerrit-PatchSet: 2 Gerrit-Project: libosmo-netif Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Aug 29 12:50:39 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 29 Aug 2017 12:50:39 +0000 Subject: [MERGED] libosmo-netif[master]: Use release helper from libosmocore In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Use release helper from libosmocore ...................................................................... Use release helper from libosmocore See https://osmocom.org/projects/cellular-infrastructure/wiki/Make_a_new_release for details. Change-Id: I01b0aae741b83a3f17f1caf2b6837cf365a1709b Related: OS#1861 --- M Makefile.am A TODO-RELEASE M configure.ac 3 files changed, 15 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/Makefile.am b/Makefile.am index 9b1c0f1..5dd843b 100644 --- a/Makefile.am +++ b/Makefile.am @@ -8,6 +8,8 @@ EXTRA_DIST = .version README.md + at RELMAKE@ + BUILT_SOURCES = $(top_srcdir)/.version $(top_srcdir)/.version: echo $(VERSION) > $@-t && mv $@-t $@ diff --git a/TODO-RELEASE b/TODO-RELEASE new file mode 100644 index 0000000..d0852fc --- /dev/null +++ b/TODO-RELEASE @@ -0,0 +1,9 @@ +# When cleaning up this file: bump API version in corresponding Makefile.am and rename corresponding debian/lib*.install +# according to https://www.gnu.org/software/libtool/manual/html_node/Updating-version-info.html#Updating-version-info +# In short: +# LIBVERSION=c:r:a +# If the library source code has changed at all since the last update, then increment revision: c:r + 1:a. +# If any interfaces have been added, removed, or changed since the last update: c + 1:0:0. +# If any interfaces have been added since the last public release: c:r:a + 1. +# If any interfaces have been removed or changed since the last public release: c:r:0. +#library what description / commit summary line diff --git a/configure.ac b/configure.ac index 175ab63..6c9ba77 100644 --- a/configure.ac +++ b/configure.ac @@ -11,6 +11,10 @@ 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]) + dnl checks for programs AC_PROG_MAKE_SET AC_PROG_CC -- To view, visit https://gerrit.osmocom.org/3707 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I01b0aae741b83a3f17f1caf2b6837cf365a1709b Gerrit-PatchSet: 2 Gerrit-Project: libosmo-netif Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Tue Aug 29 12:51:05 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 29 Aug 2017 12:51:05 +0000 Subject: osmo-msc[master]: mgcp: add VTY Option to force-realloc endpoints In-Reply-To: References: Message-ID: Patch Set 4: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3487 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ic8740512c5ea0766ff6ceb1c28b9c2b3fe46e75f Gerrit-PatchSet: 4 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: dexter Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Aug 29 12:51:10 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 29 Aug 2017 12:51:10 +0000 Subject: osmo-msc[master]: build: check for -lgsm In-Reply-To: References: Message-ID: Patch Set 7: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3587 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Iab55a089ae36017b79e7cbc3cac45ef9fd85dd43 Gerrit-PatchSet: 7 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Aug 29 12:51:20 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 29 Aug 2017 12:51:20 +0000 Subject: [MERGED] osmo-msc[master]: build: check for -lgsm In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: build: check for -lgsm ...................................................................... build: check for -lgsm If libosmo-legacy-mgcp is built with --enable-mgcp-transcoding, we need to link -lgsm here as well. This autodetects whether -lgsm is necessary. Todo: how about --with-g729? Todo: osmo-msc is only using the mgcp client and should not actually need transcoding nor -lgsm. Change-Id: Iab55a089ae36017b79e7cbc3cac45ef9fd85dd43 --- M configure.ac 1 file changed, 27 insertions(+), 11 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/configure.ac b/configure.ac index 9b25ab8..1942614 100644 --- a/configure.ac +++ b/configure.ac @@ -64,17 +64,6 @@ [osmo_ac_mgcp_transcoding="$enableval"],[osmo_ac_mgcp_transcoding="no"]) AC_ARG_WITH([g729], [AS_HELP_STRING([--with-g729], [Enable G.729 encoding/decoding.])], [osmo_ac_with_g729="$withval"],[osmo_ac_with_g729="no"]) -if test "$osmo_ac_mgcp_transcoding" = "yes" ; then - AC_SEARCH_LIBS([gsm_create], [gsm], [LIBRARY_GSM="$LIBS";LIBS=""], [AC_MSG_ERROR([--enable-mgcp-transcoding: cannot find usable libgsm])]) - AC_SUBST(LIBRARY_GSM) - if test "$osmo_ac_with_g729" = "yes" ; then - PKG_CHECK_MODULES(LIBBCG729, libbcg729 >= 0.1, [AC_DEFINE([HAVE_BCG729], [1], [Use bgc729 decoder/encoder])]) - fi - AC_DEFINE(BUILD_MGCP_TRANSCODING, 1, [Define if we want to build the MGCP gateway with transcoding support]) -fi -AM_CONDITIONAL(BUILD_MGCP_TRANSCODING, test "x$osmo_ac_mgcp_transcoding" = "xyes") -AC_SUBST(osmo_ac_mgcp_transcoding) - # Enable/disable 3G aka IuPS + IuCS support? AC_ARG_ENABLE([iu], [AS_HELP_STRING([--enable-iu], [Build 3G support, aka IuPS and IuCS interfaces])], [osmo_ac_iu="$enableval"],[osmo_ac_iu="no"]) @@ -138,6 +127,33 @@ AC_SUBST([COVERAGE_LDFLAGS]) fi +AC_DEFUN([CHECK_LIBOSMO_LEGACY_MGCP_NEEDS_LIBGSM], [ + AC_CACHE_CHECK( + [whether libosmo-legacy-mgcp needs -lgsm], + libosmo_cv_legacy_mgcp_needs_libgsm, [ + SAVE_LDFLAGS="${LDFLAGS}" + LDFLAGS="${LIBOSMOLEGACYMGCP_LIBS} ${LIBOSMOVTY_LIBS}" + AC_LINK_IFELSE( + [AC_LANG_PROGRAM([ + #include + ], [ + mgcpgw_client_init(0, 0); + ])], + [libosmo_cv_legacy_mgcp_needs_libgsm=no], + [libosmo_cv_legacy_mgcp_needs_libgsm=yes]) + LDFLAGS="${SAVE_LDFLAGS}" + ]) + ]) +CHECK_LIBOSMO_LEGACY_MGCP_NEEDS_LIBGSM +if test "x$libosmo_cv_legacy_mgcp_needs_libgsm" = xyes; then + AC_SEARCH_LIBS([gsm_create], [gsm], [LIBRARY_GSM="$LIBS";LIBS=""], + [AC_MSG_ERROR([libosmo-legacy-mgcp is built with transcoding and needs -lgsm but cannot find usable libgsm])]) + AC_SUBST(LIBRARY_GSM) + if test "$osmo_ac_with_g729" = "yes" ; then + PKG_CHECK_MODULES(LIBBCG729, libbcg729 >= 0.1, [AC_DEFINE([HAVE_BCG729], [1], [Use bgc729 decoder/encoder])]) + fi +fi + AC_DEFUN([CHECK_TM_INCLUDES_TM_GMTOFF], [ AC_CACHE_CHECK( [whether struct tm has tm_gmtoff member], -- To view, visit https://gerrit.osmocom.org/3587 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Iab55a089ae36017b79e7cbc3cac45ef9fd85dd43 Gerrit-PatchSet: 8 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Tue Aug 29 12:51:20 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 29 Aug 2017 12:51:20 +0000 Subject: [MERGED] osmo-msc[master]: mgcp: add VTY Option to force-realloc endpoints In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: mgcp: add VTY Option to force-realloc endpoints ...................................................................... mgcp: add VTY Option to force-realloc endpoints Currently the force_realloc feature is turnd on and of in a hardcoded way. This patch makes the option available via VTY. Change-Id: Ic8740512c5ea0766ff6ceb1c28b9c2b3fe46e75f --- M src/libmgcp/mgcp_vty.c M src/osmo-bsc_mgcp/mgcp_main.c M src/osmo-bsc_nat/bsc_mgcp_utils.c M src/osmo-bsc_nat/bsc_nat.c 4 files changed, 18 insertions(+), 2 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/libmgcp/mgcp_vty.c b/src/libmgcp/mgcp_vty.c index 7d4b2da..51889d9 100644 --- a/src/libmgcp/mgcp_vty.c +++ b/src/libmgcp/mgcp_vty.c @@ -591,6 +591,16 @@ return CMD_SUCCESS; } +DEFUN(cfg_mgcp_force_realloc, + cfg_mgcp_force_realloc_cmd, + "force-realloc (0|1)", + "Force endpoint reallocation when the endpoint is still seized\n" + "Don't force reallocation\n" "force reallocation\n") +{ + g_cfg->trunk.force_realloc = atoi(argv[0]); + return CMD_SUCCESS; +} + DEFUN(cfg_mgcp_number_endp, cfg_mgcp_number_endp_cmd, "number endpoints <0-65534>", @@ -803,9 +813,10 @@ trunk->keepalive_interval, VTY_NEWLINE); else vty_out(vty, " no rtp keep-alive%s", VTY_NEWLINE); - vty_out(vty, " loop %d%s", trunk->audio_loop, VTY_NEWLINE); + vty_out(vty, " force-realloc %d%s", + trunk->force_realloc, VTY_NEWLINE); if (trunk->omit_rtcp) vty_out(vty, " rtcp-omit%s", VTY_NEWLINE); else @@ -1379,6 +1390,7 @@ install_element(MGCP_NODE, &cfg_mgcp_sdp_payload_number_cmd_old); install_element(MGCP_NODE, &cfg_mgcp_sdp_payload_name_cmd_old); install_element(MGCP_NODE, &cfg_mgcp_loop_cmd); + install_element(MGCP_NODE, &cfg_mgcp_force_realloc_cmd); install_element(MGCP_NODE, &cfg_mgcp_number_endp_cmd); install_element(MGCP_NODE, &cfg_mgcp_omit_rtcp_cmd); install_element(MGCP_NODE, &cfg_mgcp_no_omit_rtcp_cmd); diff --git a/src/osmo-bsc_mgcp/mgcp_main.c b/src/osmo-bsc_mgcp/mgcp_main.c index 4ea0700..6cf9ab7 100644 --- a/src/osmo-bsc_mgcp/mgcp_main.c +++ b/src/osmo-bsc_mgcp/mgcp_main.c @@ -218,6 +218,8 @@ cfg->get_net_downlink_format_cb = &mgcp_transcoding_net_downlink_format; #endif + cfg->trunk.force_realloc = 1; + vty_info.copyright = openbsc_copyright; vty_init(&vty_info); logging_vty_add_cmds(NULL); diff --git a/src/osmo-bsc_nat/bsc_mgcp_utils.c b/src/osmo-bsc_nat/bsc_mgcp_utils.c index 4884786..7df362f 100644 --- a/src/osmo-bsc_nat/bsc_mgcp_utils.c +++ b/src/osmo-bsc_nat/bsc_mgcp_utils.c @@ -1101,7 +1101,6 @@ /* some more MGCP config handling */ cfg->data = nat; cfg->policy_cb = bsc_mgcp_policy_cb; - cfg->trunk.force_realloc = 1; if (cfg->bts_ip) talloc_free(cfg->bts_ip); diff --git a/src/osmo-bsc_nat/bsc_nat.c b/src/osmo-bsc_nat/bsc_nat.c index daa066d..401288d 100644 --- a/src/osmo-bsc_nat/bsc_nat.c +++ b/src/osmo-bsc_nat/bsc_nat.c @@ -1628,6 +1628,9 @@ rate_ctr_init(tall_bsc_ctx); osmo_stats_init(tall_bsc_ctx); + /* Ensure that forced enpoint allocation is turned on by default */ + nat->mgcp_cfg->trunk.force_realloc = 1; + /* init vty and parse */ if (mgcp_parse_config(config_file, nat->mgcp_cfg, MGCP_BSC_NAT) < 0) { fprintf(stderr, "Failed to parse the config file: '%s'\n", config_file); -- To view, visit https://gerrit.osmocom.org/3487 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ic8740512c5ea0766ff6ceb1c28b9c2b3fe46e75f Gerrit-PatchSet: 5 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: dexter From gerrit-no-reply at lists.osmocom.org Tue Aug 29 12:51:20 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 29 Aug 2017 12:51:20 +0000 Subject: [MERGED] osmo-msc[master]: split off osmo-msc: remove files, apply build, rename In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: split off osmo-msc: remove files, apply build, rename ...................................................................... split off osmo-msc: remove files, apply build, rename Change-Id: Icf025e5ea8d180613b3114282951c9afa67af9a7 --- M configure.ac D debian/osmo-gtphub.default D debian/osmo-gtphub.examples D debian/osmo-gtphub.init D debian/osmo-gtphub.install D debian/osmocom-bs11-utils.install D debian/osmocom-bsc-nat.init D debian/osmocom-bsc-nat.install D debian/osmocom-bsc.examples D debian/osmocom-bsc.install D debian/osmocom-gbproxy.init D debian/osmocom-gbproxy.install D debian/osmocom-ipaccess-utils.install D debian/osmocom-sgsn.default D debian/osmocom-sgsn.examples D debian/osmocom-sgsn.init D debian/osmocom-sgsn.install D doc/BS11-OML.txt D doc/channel_release.txt D doc/examples/osmo-bsc/osmo-bsc.cfg D doc/examples/osmo-bsc_mgcp/mgcp.cfg D doc/examples/osmo-bsc_nat/black-list.cfg D doc/examples/osmo-bsc_nat/osmo-bsc_nat.cfg D doc/examples/osmo-gbproxy/osmo-gbproxy-legacy.cfg D doc/examples/osmo-gbproxy/osmo-gbproxy.cfg D doc/examples/osmo-gtphub/gtphub-example.txt D doc/examples/osmo-gtphub/osmo-gtphub-1iface.cfg D doc/examples/osmo-gtphub/osmo-gtphub.cfg D doc/examples/osmo-sgsn/osmo-sgsn.cfg D doc/oml-interface.txt M include/Makefile.am D include/compat_af_isdn.h D include/mISDNif.h M include/openbsc/Makefile.am D include/openbsc/bsc_nat.h D include/openbsc/bsc_nat_callstats.h D include/openbsc/bsc_nat_sccp.h D include/openbsc/bsc_subscriber.h D include/openbsc/gb_proxy.h D include/openbsc/gprs_gb_parse.h D include/openbsc/gprs_gmm.h D include/openbsc/gprs_llc.h D include/openbsc/gprs_llc_xid.h D include/openbsc/gprs_sgsn.h D include/openbsc/gprs_sndcp.h D include/openbsc/gprs_sndcp_comp.h D include/openbsc/gprs_sndcp_dcomp.h D include/openbsc/gprs_sndcp_pcomp.h D include/openbsc/gprs_sndcp_xid.h D include/openbsc/gprs_subscriber.h D include/openbsc/gprs_utils.h D include/openbsc/nat_rewrite_trie.h M include/openbsc/paging.h D include/openbsc/pcu_if.h D include/openbsc/pcuif_proto.h D include/openbsc/sgsn.h D include/openbsc/v42bis.h D include/openbsc/v42bis_private.h M osmoappdesc.py M src/Makefile.am D src/gprs/.gitignore D src/gprs/Makefile.am D src/gprs/crc24.c D src/gprs/gb_proxy.c D src/gprs/gb_proxy_main.c D src/gprs/gb_proxy_patch.c D src/gprs/gb_proxy_peer.c D src/gprs/gb_proxy_tlli.c D src/gprs/gb_proxy_vty.c D src/gprs/gprs_gb_parse.c D src/gprs/gprs_gmm.c D src/gprs/gprs_llc.c D src/gprs/gprs_llc_parse.c D src/gprs/gprs_llc_vty.c D src/gprs/gprs_llc_xid.c D src/gprs/gprs_sgsn.c D src/gprs/gprs_sndcp.c D src/gprs/gprs_sndcp_comp.c D src/gprs/gprs_sndcp_dcomp.c D src/gprs/gprs_sndcp_pcomp.c D src/gprs/gprs_sndcp_vty.c D src/gprs/gprs_sndcp_xid.c D src/gprs/gprs_subscriber.c D src/gprs/gprs_utils.c D src/gprs/gtphub.c D src/gprs/gtphub_ares.c D src/gprs/gtphub_main.c D src/gprs/gtphub_sock.c D src/gprs/gtphub_vty.c D src/gprs/osmo_sgsn.cfg D src/gprs/sgsn_ares.c D src/gprs/sgsn_auth.c D src/gprs/sgsn_cdr.c D src/gprs/sgsn_ctrl.c D src/gprs/sgsn_libgtp.c D src/gprs/sgsn_main.c D src/gprs/sgsn_vty.c D src/gprs/slhc.c D src/gprs/v42bis.c D src/ipaccess/Makefile.am D src/ipaccess/abisip-find.c D src/ipaccess/ipaccess-config.c D src/ipaccess/ipaccess-firmware.c D src/ipaccess/ipaccess-proxy.c D src/ipaccess/network_listen.c D src/libbsc/Makefile.am D src/libbsc/abis_nm.c D src/libbsc/abis_nm_ipaccess.c D src/libbsc/abis_nm_vty.c D src/libbsc/abis_om2000.c D src/libbsc/abis_om2000_vty.c D src/libbsc/abis_rsl.c D src/libbsc/arfcn_range_encode.c D src/libbsc/bsc_api.c D src/libbsc/bsc_ctrl_commands.c D src/libbsc/bsc_ctrl_lookup.c D src/libbsc/bsc_dyn_ts.c D src/libbsc/bsc_init.c D src/libbsc/bsc_msc.c D src/libbsc/bsc_rf_ctrl.c D src/libbsc/bsc_rll.c D src/libbsc/bsc_subscriber.c D src/libbsc/bsc_vty.c D src/libbsc/bts_ericsson_rbs2000.c D src/libbsc/bts_init.c D src/libbsc/bts_ipaccess_nanobts.c D src/libbsc/bts_ipaccess_nanobts_omlattr.c D src/libbsc/bts_nokia_site.c D src/libbsc/bts_siemens_bs11.c D src/libbsc/bts_sysmobts.c D src/libbsc/bts_unknown.c D src/libbsc/chan_alloc.c D src/libbsc/e1_config.c D src/libbsc/gsm_04_08_utils.c D src/libbsc/gsm_04_80_utils.c D src/libbsc/handover_decision.c D src/libbsc/handover_logic.c D src/libbsc/meas_proc.c D src/libbsc/meas_rep.c D src/libbsc/net_init.c D src/libbsc/paging.c D src/libbsc/pcu_sock.c D src/libbsc/rest_octets.c D src/libbsc/system_information.c M src/libcommon/common_vty.c D src/libfilter/Makefile.am D src/libfilter/bsc_msg_acc.c D src/libfilter/bsc_msg_filter.c D src/libfilter/bsc_msg_vty.c M src/libmsc/vty_interface_layer3.c D src/libtrau/Makefile.am D src/libtrau/rtp_proxy.c D src/libtrau/trau_mux.c D src/libtrau/trau_upqueue.c M src/libvlr/vlr.c D src/osmo-bsc/Makefile.am D src/osmo-bsc/osmo_bsc_api.c D src/osmo-bsc/osmo_bsc_audio.c D src/osmo-bsc/osmo_bsc_bssap.c D src/osmo-bsc/osmo_bsc_ctrl.c D src/osmo-bsc/osmo_bsc_filter.c D src/osmo-bsc/osmo_bsc_grace.c D src/osmo-bsc/osmo_bsc_main.c D src/osmo-bsc/osmo_bsc_msc.c D src/osmo-bsc/osmo_bsc_reset.c D src/osmo-bsc/osmo_bsc_sigtran.c D src/osmo-bsc/osmo_bsc_vty.c D src/osmo-bsc_nat/Makefile.am D src/osmo-bsc_nat/bsc_filter.c D src/osmo-bsc_nat/bsc_mgcp_utils.c D src/osmo-bsc_nat/bsc_nat.c D src/osmo-bsc_nat/bsc_nat_ctrl.c D src/osmo-bsc_nat/bsc_nat_filter.c D src/osmo-bsc_nat/bsc_nat_rewrite.c D src/osmo-bsc_nat/bsc_nat_rewrite_trie.c D src/osmo-bsc_nat/bsc_nat_utils.c D src/osmo-bsc_nat/bsc_nat_vty.c D src/osmo-bsc_nat/bsc_sccp.c D src/osmo-bsc_nat/bsc_ussd.c M src/osmo-msc/Makefile.am M src/utils/Makefile.am D src/utils/bs11_config.c D src/utils/isdnsync.c M tests/Makefile.am D tests/abis/Makefile.am D tests/abis/abis_test.c D tests/abis/abis_test.ok D tests/bsc-nat-trie/Makefile.am D tests/bsc-nat-trie/bsc_nat_trie_test.c D tests/bsc-nat-trie/bsc_nat_trie_test.ok D tests/bsc-nat-trie/prefixes.csv D tests/bsc-nat/Makefile.am D tests/bsc-nat/barr.cfg D tests/bsc-nat/barr_dup.cfg D tests/bsc-nat/bsc_data.c D tests/bsc-nat/bsc_nat_test.c D tests/bsc-nat/bsc_nat_test.ok D tests/bsc-nat/prefixes.csv D tests/bsc/Makefile.am D tests/bsc/bsc_test.c D tests/bsc/bsc_test.ok D tests/channel/Makefile.am D tests/channel/channel_test.c D tests/channel/channel_test.ok D tests/gbproxy/Makefile.am D tests/gbproxy/gbproxy_test.c D tests/gbproxy/gbproxy_test.ok D tests/gprs/Makefile.am D tests/gprs/gprs_test.c D tests/gprs/gprs_test.ok D tests/gsm0408/Makefile.am D tests/gsm0408/gsm0408_test.c D tests/gsm0408/gsm0408_test.ok D tests/gtphub/Makefile.am D tests/gtphub/gtphub_test.c D tests/gtphub/gtphub_test.ok M tests/msc_vlr/Makefile.am M tests/msc_vlr/msc_vlr_tests.c D tests/nanobts_omlattr/Makefile.am D tests/nanobts_omlattr/nanobts_omlattr_test.c D tests/nanobts_omlattr/nanobts_omlattr_test.ok D tests/oap/Makefile.am D tests/oap/oap_client_test.c D tests/oap/oap_client_test.err D tests/oap/oap_client_test.ok D tests/sgsn/Makefile.am D tests/sgsn/sgsn_test.c D tests/sgsn/sgsn_test.ok D tests/slhc/Makefile.am D tests/slhc/slhc_test.c D tests/slhc/slhc_test.ok M tests/sms_queue/Makefile.am D tests/sndcp_xid/Makefile.am D tests/sndcp_xid/sndcp_xid_test.c D tests/sndcp_xid/sndcp_xid_test.ok D tests/subscr/Makefile.am D tests/subscr/bsc_subscr_test.c D tests/subscr/bsc_subscr_test.err D tests/subscr/bsc_subscr_test.ok M tests/testsuite.at D tests/trau/Makefile.am D tests/trau/trau_test.c D tests/trau/trau_test.ok D tests/v42bis/Makefile.am D tests/v42bis/v42bis_test.c D tests/v42bis/v42bis_test.ok M tests/vty_test_runner.py D tests/xid/Makefile.am D tests/xid/xid_test.c D tests/xid/xid_test.ok D tools/hlrstat.pl 251 files changed, 17 insertions(+), 100,345 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified -- To view, visit https://gerrit.osmocom.org/3497 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Icf025e5ea8d180613b3114282951c9afa67af9a7 Gerrit-PatchSet: 9 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Tue Aug 29 12:51:21 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 29 Aug 2017 12:51:21 +0000 Subject: [MERGED] osmo-msc[master]: move to osmo-mgw.git: osmo-bsc_mgcp and libmgcp as libosmo-l... In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: move to osmo-mgw.git: osmo-bsc_mgcp and libmgcp as libosmo-legacy-mgcp ...................................................................... move to osmo-mgw.git: osmo-bsc_mgcp and libmgcp as libosmo-legacy-mgcp Rewire build and includes to libosmo-legacy-mgcp. Drop osmo-bsc_mgcp and related python tests, now found in osmo-mgw.git. libosmo-legacy-mgcp is installed from osmo-mgw, hence add the dependency to jenkins.sh (so far using the pre_release branch). Change-Id: Ic99d681759edce11564da62500c2aac5cf5fffe2 --- M configure.ac M contrib/jenkins.sh M include/openbsc/Makefile.am M include/openbsc/bsc_nat.h M include/openbsc/gsm_data.h D include/openbsc/mgcp.h D include/openbsc/mgcp_internal.h D include/openbsc/mgcp_transcode.h D include/openbsc/mgcpgw_client.h M osmoappdesc.py M src/Makefile.am M src/libfilter/bsc_msg_acc.c D src/libmgcp/Makefile.am D src/libmgcp/g711common.h D src/libmgcp/mgcp_common.c D src/libmgcp/mgcp_network.c D src/libmgcp/mgcp_osmux.c D src/libmgcp/mgcp_protocol.c D src/libmgcp/mgcp_sdp.c D src/libmgcp/mgcp_transcode.c D src/libmgcp/mgcp_vty.c D src/libmgcp/mgcpgw_client.c D src/libmgcp/mgcpgw_client_vty.c M src/libmsc/a_iface.c M src/libmsc/msc_ifaces.c M src/libmsc/msc_vty.c M src/osmo-bsc/osmo_bsc_bssap.c D src/osmo-bsc_mgcp/Makefile.am D src/osmo-bsc_mgcp/mgcp_main.c M src/osmo-bsc_nat/Makefile.am M src/osmo-bsc_nat/bsc_mgcp_utils.c M src/osmo-bsc_nat/bsc_nat_ctrl.c M src/osmo-bsc_nat/bsc_nat_vty.c M src/osmo-bsc_nat/bsc_ussd.c M src/osmo-msc/Makefile.am M src/osmo-msc/msc_main.c M tests/Makefile.am M tests/bsc-nat-trie/Makefile.am M tests/bsc-nat/Makefile.am M tests/bsc/Makefile.am D tests/mgcp/Makefile.am D tests/mgcp/mgcp_test.c D tests/mgcp/mgcp_test.ok D tests/mgcp/mgcp_transcoding_test.c D tests/mgcp/mgcp_transcoding_test.ok D tests/mgcp/mgcpgw_client_test.c D tests/mgcp/mgcpgw_client_test.err D tests/mgcp/mgcpgw_client_test.ok M tests/msc_vlr/Makefile.am M tests/sms_queue/Makefile.am M tests/testsuite.at M tests/vty_test_runner.py 52 files changed, 47 insertions(+), 11,424 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified -- To view, visit https://gerrit.osmocom.org/3492 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ic99d681759edce11564da62500c2aac5cf5fffe2 Gerrit-PatchSet: 9 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Tue Aug 29 12:51:21 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 29 Aug 2017 12:51:21 +0000 Subject: [MERGED] osmo-msc[master]: move libiu to osmo-iuh/libosmo-ranap In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: move libiu to osmo-iuh/libosmo-ranap ...................................................................... move libiu to osmo-iuh/libosmo-ranap Remove libiu here, use the functions from libosmo-ranap instead, by applying the ranap_ / RANAP_ prefix. Corresponding change-id in osmo-iuh.git is I6a3f7ad15be03fb94689b4af6ccfa828c25f45c0 To be able to run the msc_vlr tests for RAN_UTRAN_IU without Iu client headers available, add iu_dummy.h, containing mere function signatures that match iu_dummy.c and a mostly empty struct ranap_ue_conn_ctx. Make sure we can build with and without --enable-iu: include osmo-iuh headers only with --enable-iu. Change-Id: Ib8c4fcdb4766c5e575618b95ce16dce51063206b --- M configure.ac M include/openbsc/Makefile.am M include/openbsc/gprs_sgsn.h M include/openbsc/gsm_data.h D include/openbsc/iu.h A include/openbsc/iu_dummy.h M include/openbsc/iucs.h M include/openbsc/iucs_ranap.h M include/openbsc/sgsn.h M src/Makefile.am M src/gprs/Makefile.am M src/gprs/gprs_gmm.c M src/gprs/gprs_sgsn.c M src/gprs/sgsn_libgtp.c M src/gprs/sgsn_main.c M src/gprs/sgsn_vty.c D src/libiu/Makefile.am D src/libiu/iu.c D src/libiu/iu_vty.c M src/libmsc/Makefile.am M src/libmsc/a_iface_bssap.c M src/libmsc/gsm_04_08.c M src/libmsc/gsm_subscriber.c M src/libmsc/iu_dummy.c M src/libmsc/iucs.c M src/libmsc/iucs_ranap.c M src/libmsc/msc_ifaces.c M src/libmsc/msc_vty.c M src/libmsc/osmo_msc.c M src/libmsc/subscr_conn.c M src/osmo-msc/Makefile.am M src/osmo-msc/msc_main.c M tests/msc_vlr/Makefile.am M tests/msc_vlr/msc_vlr_tests.c M tests/sgsn/Makefile.am M tests/sms_queue/Makefile.am 36 files changed, 213 insertions(+), 1,150 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/configure.ac b/configure.ac index 90a95e6..80f50e8 100644 --- a/configure.ac +++ b/configure.ac @@ -233,7 +233,6 @@ src/libmgcp/Makefile src/libcommon/Makefile src/libfilter/Makefile - src/libiu/Makefile src/libcommon-cs/Makefile src/osmo-msc/Makefile src/osmo-bsc/Makefile diff --git a/include/openbsc/Makefile.am b/include/openbsc/Makefile.am index 25709f1..89e0338 100644 --- a/include/openbsc/Makefile.am +++ b/include/openbsc/Makefile.am @@ -49,9 +49,9 @@ handover.h \ handover_decision.h \ ipaccess.h \ - iu.h \ iucs.h \ iucs_ranap.h \ + iu_dummy.h \ meas_feed.h \ meas_rep.h \ mgcp.h \ diff --git a/include/openbsc/gprs_sgsn.h b/include/openbsc/gprs_sgsn.h index 4e49c08..57995e0 100644 --- a/include/openbsc/gprs_sgsn.h +++ b/include/openbsc/gprs_sgsn.h @@ -117,7 +117,7 @@ uint16_t pdp_status; }; -struct ue_conn_ctx; +struct ranap_ue_conn_ctx; /* According to TS 03.60, Table 5: SGSN MM and PDP Contexts */ /* Extended by 3GPP TS 23.060, Table 6: SGSN MM and PDP Contexts */ @@ -159,7 +159,7 @@ /* CSG Subscription Data */ /* LIPA Allowed */ /* Voice Support Match Indicator */ - struct ue_conn_ctx *ue_ctx; + struct ranap_ue_conn_ctx *ue_ctx; struct service_info service; } iu; /* VLR number */ diff --git a/include/openbsc/gsm_data.h b/include/openbsc/gsm_data.h index 43fc6d3..6079900 100644 --- a/include/openbsc/gsm_data.h +++ b/include/openbsc/gsm_data.h @@ -30,7 +30,7 @@ struct bsc_subscr; struct vlr_instance; struct vlr_subscr; -struct ue_conn_ctx; +struct ranap_ue_conn_ctx; #define OBSC_LINKID_CB(__msgb) (__msgb)->cb[3] @@ -203,7 +203,7 @@ /* which Iu-CS connection, if any. */ struct { - struct ue_conn_ctx *ue_ctx; + struct ranap_ue_conn_ctx *ue_ctx; uint8_t rab_id; } iu; @@ -493,7 +493,7 @@ struct { /* CS7 instance id number (set via VTY) */ uint32_t cs7_instance; - enum nsap_addr_enc rab_assign_addr_enc; + int rab_assign_addr_enc; struct osmo_sccp_instance *sccp; } iu; diff --git a/include/openbsc/iu.h b/include/openbsc/iu.h deleted file mode 100644 index 08e4cd0..0000000 --- a/include/openbsc/iu.h +++ /dev/null @@ -1,77 +0,0 @@ -#pragma once - -#include -#include - -#include -#include -#include - -#include - -struct sgsn_pdp_ctx; -struct msgb; -struct gsm_auth_tuple; -struct osmo_sccp_addr; -struct osmo_ss7_instance; - -struct RANAP_RAB_SetupOrModifiedItemIEs_s; -struct RANAP_GlobalRNC_ID; -struct RANAP_Cause; - -/* Debugging switches from asn1c and osmo-iuh */ -extern int asn_debug; -extern int asn1_xer_print; - -struct ue_conn_ctx { - struct llist_head list; - /* TODO: It's not needed to store the full SCCP address for each - * UE. Rather than that, a pointer to the RNC should be far - * sufficient */ - struct osmo_sccp_addr sccp_addr; - uint32_t conn_id; - int integrity_active; - struct gprs_ra_id ra_id; - enum nsap_addr_enc rab_assign_addr_enc; -}; - -enum iu_event_type { - IU_EVENT_RAB_ASSIGN, - IU_EVENT_SECURITY_MODE_COMPLETE, - IU_EVENT_IU_RELEASE, /* An actual Iu Release message was received */ - IU_EVENT_LINK_INVALIDATED, /* A SUA link was lost or closed down */ -}; - -extern const struct value_string iu_event_type_names[]; -static inline const char *iu_event_type_str(enum iu_event_type e) -{ - return get_value_string(iu_event_type_names, e); -} - -/* Implementations of iu_recv_cb_t shall find the ue_conn_ctx in msg->dst. */ -typedef int (* iu_recv_cb_t )(struct msgb *msg, struct gprs_ra_id *ra_id, - uint16_t *sai); - -typedef int (* iu_event_cb_t )(struct ue_conn_ctx *ue_ctx, - enum iu_event_type type, void *data); - -typedef int (* iu_rab_ass_resp_cb_t )(struct ue_conn_ctx *ue_ctx, uint8_t rab_id, - struct RANAP_RAB_SetupOrModifiedItemIEs_s *setup_ies); - -int iu_init(void *ctx, struct osmo_sccp_instance *sccp, - iu_recv_cb_t iu_recv_cb, iu_event_cb_t iu_event_cb); - -int iu_tx(struct msgb *msg, uint8_t sapi); - -int iu_page_cs(const char *imsi, const uint32_t *tmsi, uint16_t lac); -int iu_page_ps(const char *imsi, const uint32_t *ptmsi, uint16_t lac, uint8_t rac); - -int iu_rab_act(struct ue_conn_ctx *ue_ctx, struct msgb *msg); -int iu_rab_deact(struct ue_conn_ctx *ue_ctx, uint8_t rab_id); -int iu_tx_sec_mode_cmd(struct ue_conn_ctx *uectx, struct gsm_auth_tuple *tp, - int send_ck, int new_key); -int iu_tx_common_id(struct ue_conn_ctx *ue_ctx, const char *imsi); -int iu_tx_release(struct ue_conn_ctx *ctx, const struct RANAP_Cause *cause); - -void iu_vty_init(int iu_parent_node, enum nsap_addr_enc *rab_assign_addr_enc); -int iu_vty_config_write(struct vty *vty, const char *indent); diff --git a/include/openbsc/iu_dummy.h b/include/openbsc/iu_dummy.h new file mode 100644 index 0000000..d5e1428 --- /dev/null +++ b/include/openbsc/iu_dummy.h @@ -0,0 +1,51 @@ +/* Trivial switch-off of external Iu dependencies, + * allowing to run full unit tests even when built without Iu support. */ + +/* + * (C) 2016,2017 by sysmocom s.f.m.c. GmbH + * + * Author: Neels Hofmeyr + * + * All Rights Reserved + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + * + */ + +#include +#include + +#include + +struct msgb; +struct gsm_auth_tuple; +struct RANAP_Cause; +struct osmo_auth_vector; + +struct ranap_ue_conn_ctx { + struct llist_head list; + uint32_t conn_id; +}; + +int ranap_iu_tx(struct msgb *msg, uint8_t sapi); +int ranap_iu_tx_sec_mode_cmd(struct ranap_ue_conn_ctx *uectx, struct osmo_auth_vector *vec, + int send_ck); +int ranap_iu_page_cs(const char *imsi, const uint32_t *tmsi, uint16_t lac); +int ranap_iu_page_ps(const char *imsi, const uint32_t *ptmsi, uint16_t lac, uint8_t rac); +struct msgb *ranap_new_msg_rab_assign_voice(uint8_t rab_id, uint32_t rtp_ip, + uint16_t rtp_port, + bool use_x213_nsap); +int ranap_iu_rab_act(struct ranap_ue_conn_ctx *ue_ctx, struct msgb *msg); +int ranap_iu_tx_common_id(struct ranap_ue_conn_ctx *uectx, const char *imsi); +int ranap_iu_tx_release(struct ranap_ue_conn_ctx *ctx, const struct RANAP_Cause *cause); diff --git a/include/openbsc/iucs.h b/include/openbsc/iucs.h index fb61a5c..b7d6064 100644 --- a/include/openbsc/iucs.h +++ b/include/openbsc/iucs.h @@ -4,4 +4,4 @@ uint16_t *lac); struct gsm_subscriber_connection *subscr_conn_lookup_iu(struct gsm_network *network, - struct ue_conn_ctx *ue); + struct ranap_ue_conn_ctx *ue); diff --git a/include/openbsc/iucs_ranap.h b/include/openbsc/iucs_ranap.h index 748de23..c2ff5f9 100644 --- a/include/openbsc/iucs_ranap.h +++ b/include/openbsc/iucs_ranap.h @@ -1,7 +1,7 @@ #pragma once struct gsm_network; -struct ue_conn_ctx; +struct ranap_ue_conn_ctx; int iucs_rx_ranap_event(struct gsm_network *network, - struct ue_conn_ctx *ue_ctx, int type, void *data); + struct ranap_ue_conn_ctx *ue_ctx, int type, void *data); diff --git a/include/openbsc/sgsn.h b/include/openbsc/sgsn.h index 57b2978..f371dc6 100644 --- a/include/openbsc/sgsn.h +++ b/include/openbsc/sgsn.h @@ -112,7 +112,7 @@ } dcomp_v42bis; struct { - enum nsap_addr_enc rab_assign_addr_enc; + int rab_assign_addr_enc; } iu; }; diff --git a/src/Makefile.am b/src/Makefile.am index 7e9e1dc..bd69738 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -31,13 +31,6 @@ libcommon-cs \ $(NULL) -# Conditional Libraries -if BUILD_IU -SUBDIRS += \ - libiu \ - $(NULL) -endif - # Programs SUBDIRS += \ osmo-msc \ diff --git a/src/gprs/Makefile.am b/src/gprs/Makefile.am index e05eb79..39a4c12 100644 --- a/src/gprs/Makefile.am +++ b/src/gprs/Makefile.am @@ -106,7 +106,6 @@ $(NULL) if BUILD_IU osmo_sgsn_LDADD += \ - $(top_builddir)/src/libiu/libiu.a \ $(LIBOSMOSIGTRAN_LIBS) \ $(LIBOSMORANAP_LIBS) \ $(LIBASN1C_LIBS) \ diff --git a/src/gprs/gprs_gmm.c b/src/gprs/gprs_gmm.c index 15e2fed..032137f 100644 --- a/src/gprs/gprs_gmm.c +++ b/src/gprs/gprs_gmm.c @@ -52,6 +52,7 @@ #ifdef BUILD_IU #include #include +#include #endif #include @@ -67,7 +68,6 @@ #include #include #include -#include #include #include @@ -174,7 +174,7 @@ #ifdef BUILD_IU int sgsn_ranap_rab_ass_resp(struct sgsn_mm_ctx *ctx, RANAP_RAB_SetupOrModifiedItemIEs_t *setup_ies); -int sgsn_ranap_iu_event(struct ue_conn_ctx *ctx, enum iu_event_type type, void *data) +int sgsn_ranap_iu_event(struct ranap_ue_conn_ctx *ctx, enum ranap_iu_event_type type, void *data) { struct sgsn_mm_ctx *mm; int rc = -1; @@ -188,14 +188,14 @@ } switch (type) { - case IU_EVENT_RAB_ASSIGN: + case RANAP_IU_EVENT_RAB_ASSIGN: REQUIRE_MM rc = sgsn_ranap_rab_ass_resp(mm, (RANAP_RAB_SetupOrModifiedItemIEs_t *)data); break; - case IU_EVENT_IU_RELEASE: + case RANAP_IU_EVENT_IU_RELEASE: /* fall thru */ - case IU_EVENT_LINK_INVALIDATED: - /* Clean up ue_conn_ctx here */ + case RANAP_IU_EVENT_LINK_INVALIDATED: + /* Clean up ranap_ue_conn_ctx here */ if (mm) LOGMMCTXP(LOGL_INFO, mm, "IU release for imsi %s\n", mm->imsi); else @@ -205,7 +205,7 @@ mmctx_set_pmm_state(mm, PMM_IDLE); rc = 0; break; - case IU_EVENT_SECURITY_MODE_COMPLETE: + case RANAP_IU_EVENT_SECURITY_MODE_COMPLETE: REQUIRE_MM /* Continue authentication here */ mm->iu.ue_ctx->integrity_active = 1; @@ -262,16 +262,16 @@ rate_ctr_inc(&mm->ctrg->ctr[GMM_CTR_PKTS_SIG_OUT]); #ifdef BUILD_IU if (mm->ran_type == MM_CTX_T_UTRAN_Iu) - return iu_tx(msg, GPRS_SAPI_GMM); + return ranap_iu_tx(msg, GPRS_SAPI_GMM); #endif } #ifdef BUILD_IU - /* In Iu mode, msg->dst contains the ue_conn_ctx pointer, in Gb mode + /* In Iu mode, msg->dst contains the ranap_ue_conn_ctx pointer, in Gb mode * dst is empty. */ /* FIXME: have a more explicit indicator for Iu messages */ if (msg->dst) - return iu_tx(msg, GPRS_SAPI_GMM); + return ranap_iu_tx(msg, GPRS_SAPI_GMM); #endif /* caller needs to provide TLLI, BVCI and NSEI */ @@ -296,9 +296,12 @@ /* In case a Iu connection is reconnected we need to update the ue ctx */ mm->iu.ue_ctx = msg->dst; if (mm->ran_type == MM_CTX_T_UTRAN_Iu - && mm->iu.ue_ctx) + && mm->iu.ue_ctx) { +#ifdef BUILD_IU mm->iu.ue_ctx->rab_assign_addr_enc = sgsn->cfg.iu.rab_assign_addr_enc; +#endif + } } /* Store BVCI/NSEI in MM context */ @@ -1048,7 +1051,7 @@ /* The MS is authorized */ #ifdef BUILD_IU if (ctx->ran_type == MM_CTX_T_UTRAN_Iu && !ctx->iu.ue_ctx->integrity_active) { - rc = iu_tx_sec_mode_cmd(ctx->iu.ue_ctx, &ctx->auth_triplet, 0, ctx->iu.new_key); + rc = ranap_iu_tx_sec_mode_cmd(ctx->iu.ue_ctx, &ctx->auth_triplet.vec, 0, ctx->iu.new_key); ctx->iu.new_key = 0; return rc; } @@ -1259,14 +1262,20 @@ * with a foreign TLLI (P-TMSI that was allocated to the MS before), * or with random TLLI. */ - /* In Iu mode, msg->dst contains the ue_conn_ctx pointer, in Gb mode + /* In Iu mode, msg->dst contains the ranap_ue_conn_ctx pointer, in Gb mode * dst is empty. */ /* FIXME: have a more explicit indicator for Iu messages */ if (!msg->dst) { /* Gb mode */ cid = bssgp_parse_cell_id(&ra_id, msgb_bcid(msg)); - } else - ra_id = ((struct ue_conn_ctx*)msg->dst)->ra_id; + } else { +#ifdef BUILD_IU + ra_id = ((struct ranap_ue_conn_ctx*)msg->dst)->ra_id; +#else + LOGMMCTXP(LOGL_ERROR, ctx, "Cannot handle Iu Attach Request, built without Iu support\n"); + return -ENOTSUP; +#endif + } /* MS network capability 10.5.5.12 */ msnc_len = *cur++; @@ -1627,7 +1636,7 @@ * is an optimization to avoid the RA reject (impl detached) * below, which will cause a new attach cycle. */ /* Look-up the MM context based on old RA-ID and TLLI */ - /* In Iu mode, msg->dst contains the ue_conn_ctx pointer, in Gb + /* In Iu mode, msg->dst contains the ranap_ue_conn_ctx pointer, in Gb * mode dst is empty. */ /* FIXME: have a more explicit indicator for Iu messages */ if (!msg->dst) { @@ -2905,12 +2914,12 @@ { struct msgb *msg; struct sgsn_mm_ctx *mm = pdp->mm; - struct ue_conn_ctx *uectx; + struct ranap_ue_conn_ctx *uectx; uint32_t ggsn_ip; bool use_x213_nsap; uectx = mm->iu.ue_ctx; - use_x213_nsap = (uectx->rab_assign_addr_enc == NSAP_ADDR_ENC_X213); + use_x213_nsap = (uectx->rab_assign_addr_enc == RANAP_NSAP_ADDR_ENC_X213); /* Get the IP address for ggsn user plane */ memcpy(&ggsn_ip, pdp->lib->gsnru.v, pdp->lib->gsnru.l); @@ -2923,6 +2932,6 @@ msg = ranap_new_msg_rab_assign_data(rab_id, ggsn_ip, pdp->lib->teid_gn, use_x213_nsap); msg->l2h = msg->data; - return iu_rab_act(uectx, msg); + return ranap_iu_rab_act(uectx, msg); } #endif diff --git a/src/gprs/gprs_sgsn.c b/src/gprs/gprs_sgsn.c index 43eeaaa..de79afb 100644 --- a/src/gprs/gprs_sgsn.c +++ b/src/gprs/gprs_sgsn.c @@ -40,13 +40,18 @@ #include #include #include "openbsc/gprs_llc.h" -#include #include #include #include + +#include "../../bscconfig.h" + +#if BUILD_IU +#include +#endif #define GPRS_LLME_CHECK_TICK 30 @@ -246,6 +251,7 @@ /* Allocate a new SGSN MM context */ struct sgsn_mm_ctx *sgsn_mm_ctx_alloc_iu(void *uectx) { +#if BUILD_IU struct sgsn_mm_ctx *ctx; ctx = talloc_zero(tall_bsc_ctx, struct sgsn_mm_ctx); @@ -274,6 +280,9 @@ llist_add(&ctx->list, &sgsn_mm_ctxts); return ctx; +#else + return NULL; +#endif } diff --git a/src/gprs/sgsn_libgtp.c b/src/gprs/sgsn_libgtp.c index 7ff8ece..90b4d16 100644 --- a/src/gprs/sgsn_libgtp.c +++ b/src/gprs/sgsn_libgtp.c @@ -52,7 +52,7 @@ #include #ifdef BUILD_IU -#include +#include #include #endif @@ -548,7 +548,7 @@ } else { #ifdef BUILD_IU /* Deactivate radio bearer */ - iu_rab_deact(pctx->mm->iu.ue_ctx, 1); + ranap_iu_rab_deact(pctx->mm->iu.ue_ctx, 1); #else return -ENOTSUP; #endif @@ -687,7 +687,7 @@ #ifdef BUILD_IU /* Ignore the packet for now and page the UE to get the RAB * reestablished */ - iu_page_ps(mm->imsi, &mm->p_tmsi, mm->ra.lac, mm->ra.rac); + ranap_iu_page_ps(mm->imsi, &mm->p_tmsi, mm->ra.lac, mm->ra.rac); return 0; #else diff --git a/src/gprs/sgsn_main.c b/src/gprs/sgsn_main.c index d56af0e..25ee632 100644 --- a/src/gprs/sgsn_main.c +++ b/src/gprs/sgsn_main.c @@ -58,7 +58,6 @@ #include #include #include -#include #include #include @@ -68,6 +67,10 @@ #include #include "../../bscconfig.h" + +#if BUILD_IU +#include +#endif #define _GNU_SOURCE #include @@ -322,7 +325,7 @@ .num_cat = ARRAY_SIZE(gprs_categories), }; -int sgsn_ranap_iu_event(struct ue_conn_ctx *ctx, enum iu_event_type type, void *data); +int sgsn_ranap_iu_event(struct ue_conn_ctx *ctx, enum ranap_iu_event_type type, void *data); int main(int argc, char **argv) { @@ -451,7 +454,7 @@ return 8; } - iu_init(tall_bsc_ctx, sccp, gsm0408_gprs_rcvmsg_iu, sgsn_ranap_iu_event); + ranap_iu_init(tall_bsc_ctx, DRANAP, "OsmoSGSN-IuPS", sccp, gsm0408_gprs_rcvmsg_iu, sgsn_ranap_iu_event); #endif if (daemonize) { diff --git a/src/gprs/sgsn_vty.c b/src/gprs/sgsn_vty.c index cf44cc4..3a5b2ca 100644 --- a/src/gprs/sgsn_vty.c +++ b/src/gprs/sgsn_vty.c @@ -48,7 +48,7 @@ #include "../../bscconfig.h" #ifdef BUILD_IU -#include +#include #endif static struct sgsn_config *g_cfg = NULL; @@ -291,7 +291,7 @@ vty_out(vty, " no compression v42bis%s", VTY_NEWLINE); #ifdef BUILD_IU - iu_vty_config_write(vty, " "); + ranap_iu_vty_config_write(vty, " "); #endif return CMD_SUCCESS; @@ -1285,7 +1285,7 @@ install_element(SGSN_NODE, &cfg_comp_v42bisp_cmd); #ifdef BUILD_IU - iu_vty_init(SGSN_NODE, &g_cfg->iu.rab_assign_addr_enc); + ranap_iu_vty_init(SGSN_NODE, &g_cfg->iu.rab_assign_addr_enc); #endif return 0; } diff --git a/src/libiu/Makefile.am b/src/libiu/Makefile.am deleted file mode 100644 index e5f9e27..0000000 --- a/src/libiu/Makefile.am +++ /dev/null @@ -1,28 +0,0 @@ -AM_CPPFLAGS = \ - $(all_includes) \ - -I$(top_srcdir)/include \ - -I$(top_builddir) \ - $(NULL) - -AM_CFLAGS = \ - -Wall \ - $(COVERAGE_CFLAGS) \ - $(LIBCRYPTO_CFLAGS) \ - $(LIBASN1C_CFLAGS) \ - $(LIBOSMOCORE_CFLAGS) \ - $(LIBOSMOVTY_CFLAGS) \ - $(LIBOSMOGSM_CFLAGS) \ - $(LIBOSMOABIS_CFLAGS) \ - $(LIBOSMOSIGTRAN_CFLAGS) \ - $(LIBOSMORANAP_CFLAGS) \ - $(NULL) - -noinst_LIBRARIES = \ - libiu.a \ - $(NULL) - -libiu_a_SOURCES = \ - iu.c \ - iu_vty.c \ - $(NULL) - diff --git a/src/libiu/iu.c b/src/libiu/iu.c deleted file mode 100644 index 7794977..0000000 --- a/src/libiu/iu.c +++ /dev/null @@ -1,771 +0,0 @@ -/* Common parts of IuCS and IuPS interfaces implementation */ - -/* (C) 2016 by sysmocom s.f.m.c. GmbH - * All Rights Reserved - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - * - */ - -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include - -#include -#include - -#include -#include -#include -#include - -#include -#include -#include - -#include - -#include -#include -#include -#include - -#include - -/* Parsed global RNC id. See also struct RANAP_GlobalRNC_ID, and note that the - * PLMN identity is a BCD representation of the MCC and MNC. - * See iu_grnc_id_parse(). */ -struct iu_grnc_id { - uint16_t mcc; - uint16_t mnc; - uint16_t rnc_id; -}; - -/* A remote RNC (Radio Network Controller, like BSC but for UMTS) that has - * called us and is currently reachable at the given osmo_sccp_addr. So, when we - * know a LAC for a subscriber, we can page it at the RNC matching that LAC or - * RAC. An HNB-GW typically presents itself as if it were a single RNC, even - * though it may have several RNCs in hNodeBs connected to it. Those will then - * share the same RNC id, which they actually receive and adopt from the HNB-GW - * in the HNBAP HNB REGISTER ACCEPT message. */ -struct iu_rnc { - struct llist_head entry; - - uint16_t rnc_id; - uint16_t lac; /* Location Area Code (used for CS and PS) */ - uint8_t rac; /* Routing Area Code (used for PS only) */ - struct osmo_sccp_addr sccp_addr; -}; - -void *talloc_iu_ctx; - -/* Implement the extern asn_debug from libasn1c to indicate whether to print - * asn.1 debug messages (see libasn1c). */ -int asn_debug = 0; - -/* Implement the extern asn1_xer_print to indicate whether the ASN.1 binary - * code decoded and encoded during Iu communication should be logged to stderr - * (see asn.1 generated code in osmo-iuh). */ -int asn1_xer_print = 0; - -void *talloc_asn1_ctx; - -iu_recv_cb_t global_iu_recv_cb = NULL; -iu_event_cb_t global_iu_event_cb = NULL; - -static LLIST_HEAD(ue_conn_ctx_list); -static LLIST_HEAD(rnc_list); - -static struct osmo_sccp_instance *g_sccp; -static struct osmo_sccp_user *g_scu; - -const struct value_string iu_event_type_names[] = { - OSMO_VALUE_STRING(IU_EVENT_RAB_ASSIGN), - OSMO_VALUE_STRING(IU_EVENT_SECURITY_MODE_COMPLETE), - OSMO_VALUE_STRING(IU_EVENT_IU_RELEASE), - OSMO_VALUE_STRING(IU_EVENT_LINK_INVALIDATED), - { 0, NULL } -}; - -struct ue_conn_ctx *ue_conn_ctx_alloc(struct osmo_sccp_addr *addr, uint32_t conn_id) -{ - struct ue_conn_ctx *ctx = talloc_zero(talloc_iu_ctx, struct ue_conn_ctx); - - ctx->sccp_addr = *addr; - ctx->conn_id = conn_id; - llist_add(&ctx->list, &ue_conn_ctx_list); - - return ctx; -} - -struct ue_conn_ctx *ue_conn_ctx_find(uint32_t conn_id) -{ - struct ue_conn_ctx *ctx; - - llist_for_each_entry(ctx, &ue_conn_ctx_list, list) { - if (ctx->conn_id == conn_id) - return ctx; - } - return NULL; -} - -static struct iu_rnc *iu_rnc_alloc(uint16_t rnc_id, uint16_t lac, uint8_t rac, - struct osmo_sccp_addr *addr) -{ - struct iu_rnc *rnc = talloc_zero(talloc_iu_ctx, struct iu_rnc); - - rnc->rnc_id = rnc_id; - rnc->lac = lac; - rnc->rac = rac; - rnc->sccp_addr = *addr; - llist_add(&rnc->entry, &rnc_list); - - LOGP(DRANAP, LOGL_NOTICE, "New RNC %d (LAC=%d RAC=%d)\n", - rnc->rnc_id, rnc->lac, rnc->rac); - - return rnc; -} - -static struct iu_rnc *iu_rnc_register(uint16_t rnc_id, uint16_t lac, - uint8_t rac, struct osmo_sccp_addr *addr) -{ - struct iu_rnc *rnc; - llist_for_each_entry(rnc, &rnc_list, entry) { - if (rnc->rnc_id != rnc_id) - continue; - - /* We have this RNC Id registered already. Make sure that the - * details match. */ - - /* TODO should a mismatch be an error? */ - if (rnc->lac != lac || rnc->rac != rac) - LOGP(DRANAP, LOGL_NOTICE, "RNC %d changes its details:" - " LAC=%d RAC=%d --> LAC=%d RAC=%d\n", - rnc->rnc_id, rnc->lac, rnc->rac, - lac, rac); - rnc->lac = lac; - rnc->rac = rac; - - if (addr && memcmp(&rnc->sccp_addr, addr, sizeof(*addr))) - LOGP(DRANAP, LOGL_NOTICE, "RNC %d on New SCCP Addr %s" - " (LAC=%d RAC=%d)\n", - rnc->rnc_id, osmo_sccp_addr_dump(addr), rnc->lac, rnc->rac); - rnc->sccp_addr = *addr; - return rnc; - } - - /* Not found, make a new one. */ - return iu_rnc_alloc(rnc_id, lac, rac, addr); -} - -/*********************************************************************** - * RANAP handling - ***********************************************************************/ - -int iu_rab_act(struct ue_conn_ctx *ue_ctx, struct msgb *msg) -{ - struct osmo_scu_prim *prim; - - /* wrap RANAP message in SCCP N-DATA.req */ - prim = (struct osmo_scu_prim *) msgb_push(msg, sizeof(*prim)); - prim->u.data.conn_id = ue_ctx->conn_id; - osmo_prim_init(&prim->oph, - SCCP_SAP_USER, - OSMO_SCU_PRIM_N_DATA, - PRIM_OP_REQUEST, - msg); - return osmo_sccp_user_sap_down(g_scu, &prim->oph); -} - -int iu_rab_deact(struct ue_conn_ctx *ue_ctx, uint8_t rab_id) -{ - /* FIXME */ - return -1; -} - -int iu_tx_sec_mode_cmd(struct ue_conn_ctx *uectx, struct gsm_auth_tuple *tp, - int send_ck, int new_key) -{ - struct osmo_scu_prim *prim; - struct msgb *msg; - - /* create RANAP message */ - msg = ranap_new_msg_sec_mod_cmd(tp->vec.ik, send_ck? tp->vec.ck : NULL, - new_key ? RANAP_KeyStatus_new : RANAP_KeyStatus_old); - msg->l2h = msg->data; - /* wrap RANAP message in SCCP N-DATA.req */ - prim = (struct osmo_scu_prim *) msgb_push(msg, sizeof(*prim)); - prim->u.data.conn_id = uectx->conn_id; - osmo_prim_init(&prim->oph, SCCP_SAP_USER, - OSMO_SCU_PRIM_N_DATA, - PRIM_OP_REQUEST, msg); - osmo_sccp_user_sap_down(g_scu, &prim->oph); - - return 0; -} - -int iu_tx_common_id(struct ue_conn_ctx *uectx, const char *imsi) -{ - struct msgb *msg; - struct osmo_scu_prim *prim; - - LOGP(DRANAP, LOGL_INFO, "Transmitting RANAP CommonID (SCCP conn_id %u)\n", - uectx->conn_id); - - msg = ranap_new_msg_common_id(imsi); - msg->l2h = msg->data; - prim = (struct osmo_scu_prim *) msgb_push(msg, sizeof(*prim)); - prim->u.data.conn_id = uectx->conn_id; - osmo_prim_init(&prim->oph, SCCP_SAP_USER, - OSMO_SCU_PRIM_N_DATA, - PRIM_OP_REQUEST, msg); - osmo_sccp_user_sap_down(g_scu, &prim->oph); - return 0; -} - -static int iu_grnc_id_parse(struct iu_grnc_id *dst, - struct RANAP_GlobalRNC_ID *src) -{ - /* The size is coming from arbitrary sender, check it gracefully */ - if (src->pLMNidentity.size != 3) { - LOGP(DRANAP, LOGL_ERROR, "Invalid PLMN Identity size:" - " should be 3, is %d\n", src->pLMNidentity.size); - return -1; - } - gsm48_mcc_mnc_from_bcd(&src->pLMNidentity.buf[0], - &dst->mcc, &dst->mnc); - dst->rnc_id = (uint16_t)src->rNC_ID; - return 0; -} - -#if 0 - -- not used at present -- -static int iu_grnc_id_compose(struct iu_grnc_id *src, - struct RANAP_GlobalRNC_ID *dst) -{ - /* The caller must ensure proper size */ - OSMO_ASSERT(dst->pLMNidentity.size == 3); - gsm48_mcc_mnc_to_bcd(&dst->pLMNidentity.buf[0], - src->mcc, src->mnc); - dst->rNC_ID = src->rnc_id; - return 0; -} -#endif - -static int ranap_handle_co_initial_ue(void *ctx, RANAP_InitialUE_MessageIEs_t *ies) -{ - struct ue_conn_ctx *ue_conn = ctx; - struct gprs_ra_id ra_id; - struct iu_grnc_id grnc_id; - uint16_t sai; - struct msgb *msg = msgb_alloc(256, "RANAP->NAS"); - - if (ranap_parse_lai(&ra_id, &ies->lai) != 0) { - LOGP(DRANAP, LOGL_ERROR, "Failed to parse RANAP LAI IE\n"); - return -1; - } - - if (ies->presenceMask & INITIALUE_MESSAGEIES_RANAP_RAC_PRESENT) { - ra_id.rac = asn1str_to_u8(&ies->rac); - } - - if (iu_grnc_id_parse(&grnc_id, &ies->globalRNC_ID) != 0) { - LOGP(DRANAP, LOGL_ERROR, - "Failed to parse RANAP Global-RNC-ID IE\n"); - return -1; - } - - sai = asn1str_to_u16(&ies->sai.sAC); - msgb_gmmh(msg) = msgb_put(msg, ies->nas_pdu.size); - memcpy(msgb_gmmh(msg), ies->nas_pdu.buf, ies->nas_pdu.size); - - /* Make sure we know the RNC Id and LAC+RAC coming in on this connection. */ - iu_rnc_register(grnc_id.rnc_id, ra_id.lac, ra_id.rac, &ue_conn->sccp_addr); - ue_conn->ra_id = ra_id; - - /* Feed into the MM layer */ - msg->dst = ctx; - global_iu_recv_cb(msg, &ra_id, &sai); - - msgb_free(msg); - - return 0; -} - -static int ranap_handle_co_dt(void *ctx, RANAP_DirectTransferIEs_t *ies) -{ - struct gprs_ra_id _ra_id, *ra_id = NULL; - uint16_t _sai, *sai = NULL; - struct msgb *msg = msgb_alloc(256, "RANAP->NAS"); - - if (ies->presenceMask & DIRECTTRANSFERIES_RANAP_LAI_PRESENT) { - if (ranap_parse_lai(&_ra_id, &ies->lai) != 0) { - LOGP(DRANAP, LOGL_ERROR, "Failed to parse RANAP LAI IE\n"); - return -1; - } - ra_id = &_ra_id; - if (ies->presenceMask & DIRECTTRANSFERIES_RANAP_RAC_PRESENT) { - _ra_id.rac = asn1str_to_u8(&ies->rac); - } - if (ies->presenceMask & DIRECTTRANSFERIES_RANAP_SAI_PRESENT) { - _sai = asn1str_to_u16(&ies->sai.sAC); - sai = &_sai; - } - } - - msgb_gmmh(msg) = msgb_put(msg, ies->nas_pdu.size); - memcpy(msgb_gmmh(msg), ies->nas_pdu.buf, ies->nas_pdu.size); - - /* Feed into the MM/CC/SMS-CP layer */ - msg->dst = ctx; - global_iu_recv_cb(msg, ra_id, sai); - - msgb_free(msg); - - return 0; -} - -static int ranap_handle_co_err_ind(void *ctx, RANAP_ErrorIndicationIEs_t *ies) -{ - if (ies->presenceMask & ERRORINDICATIONIES_RANAP_CAUSE_PRESENT) - LOGP(DRANAP, LOGL_ERROR, "Rx Error Indication (%s)\n", - ranap_cause_str(&ies->cause)); - else - LOGP(DRANAP, LOGL_ERROR, "Rx Error Indication\n"); - - return 0; -} - -int iu_tx(struct msgb *msg_nas, uint8_t sapi) -{ - struct ue_conn_ctx *uectx = msg_nas->dst; - struct msgb *msg; - struct osmo_scu_prim *prim; - - LOGP(DRANAP, LOGL_INFO, "Transmitting L3 Message as RANAP DT (SCCP conn_id %u)\n", - uectx->conn_id); - - msg = ranap_new_msg_dt(sapi, msg_nas->data, msgb_length(msg_nas)); - msgb_free(msg_nas); - msg->l2h = msg->data; - prim = (struct osmo_scu_prim *) msgb_push(msg, sizeof(*prim)); - prim->u.data.conn_id = uectx->conn_id; - osmo_prim_init(&prim->oph, SCCP_SAP_USER, - OSMO_SCU_PRIM_N_DATA, - PRIM_OP_REQUEST, msg); - osmo_sccp_user_sap_down(g_scu, &prim->oph); - return 0; -} - -/* Send Iu Release for the given UE connection. - * If cause is NULL, the standard "No remaining RAB" cause is sent, otherwise - * the provided cause. */ -int iu_tx_release(struct ue_conn_ctx *ctx, const struct RANAP_Cause *cause) -{ - struct msgb *msg; - struct osmo_scu_prim *prim; - static const struct RANAP_Cause default_cause = { - .present = RANAP_Cause_PR_radioNetwork, - .choice.radioNetwork = RANAP_CauseRadioNetwork_no_remaining_rab, - }; - - if (!cause) - cause = &default_cause; - - LOGP(DRANAP, LOGL_INFO, "Transmitting Iu Release (SCCP conn_id %u)\n", - ctx->conn_id); - - msg = ranap_new_msg_iu_rel_cmd(cause); - msg->l2h = msg->data; - prim = (struct osmo_scu_prim *) msgb_push(msg, sizeof(*prim)); - prim->u.data.conn_id = ctx->conn_id; - osmo_prim_init(&prim->oph, SCCP_SAP_USER, - OSMO_SCU_PRIM_N_DATA, - PRIM_OP_REQUEST, msg); - return osmo_sccp_user_sap_down(g_scu, &prim->oph); -} - -static int ranap_handle_co_iu_rel_req(struct ue_conn_ctx *ctx, RANAP_Iu_ReleaseRequestIEs_t *ies) -{ - LOGP(DRANAP, LOGL_INFO, "Received Iu Release Request, Sending Release Command\n"); - iu_tx_release(ctx, &ies->cause); - return 0; -} - -static int ranap_handle_co_rab_ass_resp(struct ue_conn_ctx *ctx, RANAP_RAB_AssignmentResponseIEs_t *ies) -{ - int rc = -1; - - LOGP(DRANAP, LOGL_INFO, - "Rx RAB Assignment Response for UE conn_id %u\n", ctx->conn_id); - if (ies->presenceMask & RAB_ASSIGNMENTRESPONSEIES_RANAP_RAB_SETUPORMODIFIEDLIST_PRESENT) { - /* TODO: Iterate over list of SetupOrModifiedList IEs and handle each one */ - RANAP_IE_t *ranap_ie = ies->raB_SetupOrModifiedList.raB_SetupOrModifiedList_ies.list.array[0]; - RANAP_RAB_SetupOrModifiedItemIEs_t setup_ies; - - rc = ranap_decode_rab_setupormodifieditemies_fromlist(&setup_ies, &ranap_ie->value); - if (rc) { - LOGP(DRANAP, LOGL_ERROR, "Error in ranap_decode_rab_setupormodifieditemies()\n"); - return rc; - } - - rc = global_iu_event_cb(ctx, IU_EVENT_RAB_ASSIGN, &setup_ies); - - ranap_free_rab_setupormodifieditemies(&setup_ies); - } - /* FIXME: handle RAB Ass failure? */ - - return rc; -} - -/* Entry point for connection-oriented RANAP message */ -static void cn_ranap_handle_co(void *ctx, ranap_message *message) -{ - int rc; - - LOGP(DRANAP, LOGL_NOTICE, "handle_co(dir=%u, proc=%u)\n", message->direction, message->procedureCode); - - switch (message->direction) { - case RANAP_RANAP_PDU_PR_initiatingMessage: - switch (message->procedureCode) { - case RANAP_ProcedureCode_id_InitialUE_Message: - rc = ranap_handle_co_initial_ue(ctx, &message->msg.initialUE_MessageIEs); - break; - case RANAP_ProcedureCode_id_DirectTransfer: - rc = ranap_handle_co_dt(ctx, &message->msg.directTransferIEs); - break; - case RANAP_ProcedureCode_id_ErrorIndication: - rc = ranap_handle_co_err_ind(ctx, &message->msg.errorIndicationIEs); - break; - case RANAP_ProcedureCode_id_Iu_ReleaseRequest: - /* Iu Release Request */ - rc = ranap_handle_co_iu_rel_req(ctx, &message->msg.iu_ReleaseRequestIEs); - break; - default: - LOGP(DRANAP, LOGL_ERROR, "Received Initiating Message: unknown Procedure Code %d\n", - message->procedureCode); - rc = -1; - break; - } - break; - case RANAP_RANAP_PDU_PR_successfulOutcome: - switch (message->procedureCode) { - case RANAP_ProcedureCode_id_SecurityModeControl: - /* Security Mode Complete */ - rc = global_iu_event_cb(ctx, IU_EVENT_SECURITY_MODE_COMPLETE, NULL); - break; - case RANAP_ProcedureCode_id_Iu_Release: - /* Iu Release Complete */ - rc = global_iu_event_cb(ctx, IU_EVENT_IU_RELEASE, NULL); - if (rc) { - LOGP(DRANAP, LOGL_ERROR, "Iu Release event: Iu Event callback returned %d\n", - rc); - } - break; - default: - LOGP(DRANAP, LOGL_ERROR, "Received Successful Outcome: unknown Procedure Code %d\n", - message->procedureCode); - rc = -1; - break; - } - break; - case RANAP_RANAP_PDU_PR_outcome: - switch (message->procedureCode) { - case RANAP_ProcedureCode_id_RAB_Assignment: - /* RAB Assignment Response */ - rc = ranap_handle_co_rab_ass_resp(ctx, &message->msg.raB_AssignmentResponseIEs); - break; - default: - LOGP(DRANAP, LOGL_ERROR, "Received Outcome: unknown Procedure Code %d\n", - message->procedureCode); - rc = -1; - break; - } - break; - case RANAP_RANAP_PDU_PR_unsuccessfulOutcome: - default: - LOGP(DRANAP, LOGL_ERROR, "Received Unsuccessful Outcome: Procedure Code %d\n", - message->procedureCode); - rc = -1; - break; - } - - if (rc) { - LOGP(DRANAP, LOGL_ERROR, "Error in cn_ranap_handle_co (%d)\n", - rc); - /* TODO handling of the error? */ - } -} - -static int ranap_handle_cl_reset_req(void *ctx, RANAP_ResetIEs_t *ies) -{ - /* FIXME: send reset response */ - return -1; -} - -static int ranap_handle_cl_err_ind(void *ctx, RANAP_ErrorIndicationIEs_t *ies) -{ - if (ies->presenceMask & ERRORINDICATIONIES_RANAP_CAUSE_PRESENT) - LOGP(DRANAP, LOGL_ERROR, "Rx Error Indication (%s)\n", - ranap_cause_str(&ies->cause)); - else - LOGP(DRANAP, LOGL_ERROR, "Rx Error Indication\n"); - - return 0; -} - -/* Entry point for connection-less RANAP message */ -static void cn_ranap_handle_cl(void *ctx, ranap_message *message) -{ - int rc; - - switch (message->direction) { - case RANAP_RANAP_PDU_PR_initiatingMessage: - switch (message->procedureCode) { - case RANAP_ProcedureCode_id_Reset: - /* received reset.req, send reset.resp */ - rc = ranap_handle_cl_reset_req(ctx, &message->msg.resetIEs); - break; - case RANAP_ProcedureCode_id_ErrorIndication: - rc = ranap_handle_cl_err_ind(ctx, &message->msg.errorIndicationIEs); - break; - default: - rc = -1; - break; - } - break; - case RANAP_RANAP_PDU_PR_successfulOutcome: - case RANAP_RANAP_PDU_PR_unsuccessfulOutcome: - case RANAP_RANAP_PDU_PR_outcome: - default: - rc = -1; - break; - } - - if (rc) { - LOGP(DRANAP, LOGL_ERROR, "Error in cn_ranap_handle_cl (%d)\n", - rc); - /* TODO handling of the error? */ - } -} - -/*********************************************************************** - * Paging - ***********************************************************************/ - -struct osmo_sccp_addr local_sccp_addr = { - .presence = OSMO_SCCP_ADDR_T_SSN | OSMO_SCCP_ADDR_T_PC, - .ri = OSMO_SCCP_RI_SSN_PC, - .ssn = OSMO_SCCP_SSN_RANAP, - .pc = 1, -}; - -/* Send a paging command down a given SCCP User. tmsi and paging_cause are - * optional and may be passed NULL and 0, respectively, to disable their use. - * See enum RANAP_PagingCause. - * - * If TMSI is given, the IMSI is not sent over the air interface. Nevertheless, - * the IMSI is still required for resolution in the HNB-GW and/or(?) RNC. */ -static int iu_tx_paging_cmd(struct osmo_sccp_addr *called_addr, - const char *imsi, const uint32_t *tmsi, - bool is_ps, uint32_t paging_cause) -{ - struct msgb *msg; - msg = ranap_new_msg_paging_cmd(imsi, tmsi, is_ps? 1 : 0, paging_cause); - msg->l2h = msg->data; - osmo_sccp_tx_unitdata_msg(g_scu, &local_sccp_addr, called_addr, msg); - return 0; -} - -static int iu_page(const char *imsi, const uint32_t *tmsi_or_ptimsi, - uint16_t lac, uint8_t rac, bool is_ps) -{ - struct iu_rnc *rnc; - int pagings_sent = 0; - - if (tmsi_or_ptimsi) { - LOGP(DRANAP, LOGL_DEBUG, "%s: Looking for RNCs to page for IMSI %s" - " (paging will use %s %x)\n", - is_ps? "IuPS" : "IuCS", - imsi, - is_ps? "PTMSI" : "TMSI", - *tmsi_or_ptimsi); - } else { - LOGP(DRANAP, LOGL_DEBUG, "%s: Looking for RNCs to page for IMSI %s" - " (paging will use IMSI)\n", - is_ps? "IuPS" : "IuCS", - imsi - ); - } - - llist_for_each_entry(rnc, &rnc_list, entry) { - if (rnc->lac != lac) - continue; - if (is_ps && rnc->rac != rac) - continue; - - /* Found a match! */ - if (iu_tx_paging_cmd(&rnc->sccp_addr, imsi, tmsi_or_ptimsi, is_ps, 0) - == 0) { - LOGP(DRANAP, LOGL_DEBUG, - "%s: Paged for IMSI %s on RNC %d, on SCCP addr %s\n", - is_ps? "IuPS" : "IuCS", - imsi, rnc->rnc_id, osmo_sccp_addr_dump(&rnc->sccp_addr)); - pagings_sent ++; - } - } - - /* Some logging... */ - if (pagings_sent > 0) { - LOGP(DRANAP, LOGL_DEBUG, - "%s: %d RNCs were paged for IMSI %s.\n", - is_ps? "IuPS" : "IuCS", - pagings_sent, imsi); - } - else { - if (is_ps) { - LOGP(DRANAP, LOGL_ERROR, "IuPS: Found no RNC to page for" - " LAC %d RAC %d (would have paged IMSI %s)\n", - lac, rac, imsi); - } - else { - LOGP(DRANAP, LOGL_ERROR, "IuCS: Found no RNC to page for" - " LAC %d (would have paged IMSI %s)\n", - lac, imsi); - } - } - - return pagings_sent; -} - -int iu_page_cs(const char *imsi, const uint32_t *tmsi, uint16_t lac) -{ - return iu_page(imsi, tmsi, lac, 0, false); -} - -int iu_page_ps(const char *imsi, const uint32_t *ptmsi, uint16_t lac, uint8_t rac) -{ - return iu_page(imsi, ptmsi, lac, rac, true); -} - - -/*********************************************************************** - * - ***********************************************************************/ - -int tx_unitdata(struct osmo_sccp_user *scu); -int tx_conn_req(struct osmo_sccp_user *scu, uint32_t conn_id); - -struct osmo_prim_hdr *make_conn_req(uint32_t conn_id); -struct osmo_prim_hdr *make_dt1_req(uint32_t conn_id, const uint8_t *data, unsigned int len); - -struct osmo_prim_hdr *make_conn_resp(struct osmo_scu_connect_param *param) -{ - struct msgb *msg = msgb_alloc(1024, "conn_resp"); - struct osmo_scu_prim *prim; - - prim = (struct osmo_scu_prim *) msgb_put(msg, sizeof(*prim)); - osmo_prim_init(&prim->oph, SCCP_SAP_USER, - OSMO_SCU_PRIM_N_CONNECT, - PRIM_OP_RESPONSE, msg); - memcpy(&prim->u.connect, param, sizeof(prim->u.connect)); - return &prim->oph; -} - -static int sccp_sap_up(struct osmo_prim_hdr *oph, void *_scu) -{ - struct osmo_sccp_user *scu = _scu; - struct osmo_scu_prim *prim = (struct osmo_scu_prim *) oph; - struct osmo_prim_hdr *resp = NULL; - int rc; - struct ue_conn_ctx *ue; - - DEBUGP(DRANAP, "sccp_sap_up(%s)\n", osmo_scu_prim_name(oph)); - - switch (OSMO_PRIM_HDR(oph)) { - case OSMO_PRIM(OSMO_SCU_PRIM_N_CONNECT, PRIM_OP_CONFIRM): - /* confirmation of outbound connection */ - rc = -1; - break; - case OSMO_PRIM(OSMO_SCU_PRIM_N_CONNECT, PRIM_OP_INDICATION): - /* indication of new inbound connection request*/ - DEBUGP(DRANAP, "N-CONNECT.ind(X->%u)\n", prim->u.connect.conn_id); - if (/* prim->u.connect.called_addr.ssn != OSMO_SCCP_SSN_RANAP || */ - !msgb_l2(oph->msg) || msgb_l2len(oph->msg) == 0) { - LOGP(DRANAP, LOGL_NOTICE, - "Received invalid N-CONNECT.ind\n"); - return 0; - } - ue = ue_conn_ctx_alloc(&prim->u.connect.calling_addr, prim->u.connect.conn_id); - /* first ensure the local SCCP socket is ACTIVE */ - resp = make_conn_resp(&prim->u.connect); - osmo_sccp_user_sap_down(scu, resp); - /* then handle the RANAP payload */ - rc = ranap_cn_rx_co(cn_ranap_handle_co, ue, msgb_l2(oph->msg), msgb_l2len(oph->msg)); - break; - case OSMO_PRIM(OSMO_SCU_PRIM_N_DISCONNECT, PRIM_OP_INDICATION): - /* indication of disconnect */ - DEBUGP(DRANAP, "N-DISCONNECT.ind(%u)\n", - prim->u.disconnect.conn_id); - ue = ue_conn_ctx_find(prim->u.disconnect.conn_id); - rc = ranap_cn_rx_co(cn_ranap_handle_co, ue, msgb_l2(oph->msg), msgb_l2len(oph->msg)); - break; - case OSMO_PRIM(OSMO_SCU_PRIM_N_DATA, PRIM_OP_INDICATION): - /* connection-oriented data received */ - DEBUGP(DRANAP, "N-DATA.ind(%u, %s)\n", prim->u.data.conn_id, - osmo_hexdump(msgb_l2(oph->msg), msgb_l2len(oph->msg))); - /* resolve UE context */ - ue = ue_conn_ctx_find(prim->u.data.conn_id); - rc = ranap_cn_rx_co(cn_ranap_handle_co, ue, msgb_l2(oph->msg), msgb_l2len(oph->msg)); - break; - case OSMO_PRIM(OSMO_SCU_PRIM_N_UNITDATA, PRIM_OP_INDICATION): - /* connection-less data received */ - DEBUGP(DRANAP, "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)); - break; - default: - rc = -1; - break; - } - - msgb_free(oph->msg); - return rc; -} - -int iu_init(void *ctx, struct osmo_sccp_instance *sccp, - iu_recv_cb_t iu_recv_cb, iu_event_cb_t iu_event_cb) -{ - talloc_iu_ctx = talloc_named_const(ctx, 1, "iu"); - talloc_asn1_ctx = talloc_named_const(talloc_iu_ctx, 1, "asn1"); - - global_iu_recv_cb = iu_recv_cb; - global_iu_event_cb = iu_event_cb; - g_sccp = sccp; - g_scu = osmo_sccp_user_bind(g_sccp, "OsmoMSC-Iu", sccp_sap_up, OSMO_SCCP_SSN_RANAP); - - return 0; -} - diff --git a/src/libiu/iu_vty.c b/src/libiu/iu_vty.c deleted file mode 100644 index 3fd3cd1..0000000 --- a/src/libiu/iu_vty.c +++ /dev/null @@ -1,133 +0,0 @@ -/* OpenBSC Iu related interface to quagga VTY */ -/* (C) 2016 by sysmocom s.m.f.c. GmbH - * All Rights Reserved - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - * - */ - -#include -#include - -#include -#include -#include -#include -#include - -#include - -static enum nsap_addr_enc *g_rab_assign_addr_enc = NULL; - -DEFUN(logging_asn_debug, - logging_asn_debug_cmd, - "logging asn1-debug (1|0)", - LOGGING_STR - "Log ASN.1 debug messages to stderr\n" - "Log ASN.1 debug messages to stderr\n" - "Do not log ASN.1 debug messages to stderr\n") -{ - asn_debug = atoi(argv[0]); - return CMD_SUCCESS; -} - -DEFUN(logging_asn_xer_print, - logging_asn_xer_print_cmd, - "logging asn1-xer-print (1|0)", - LOGGING_STR - "Log human readable representations of all ASN.1 messages to stderr\n" - "Log decoded ASN.1 messages to stderr\n" - "Do not log decoded ASN.1 messages to stderr\n") -{ - asn1_xer_print = atoi(argv[0]); - return CMD_SUCCESS; -} - -#define IU_STR "Iu interface protocol options\n" -DEFUN(cfg_iu_rab_assign_addr_enc, cfg_iu_rab_assign_addr_enc_cmd, - "iu rab-assign-addr-enc (x213|v4raw)", - IU_STR - "Choose RAB Assignment's Transport Layer Address encoding\n" - "ITU-T X.213 compliant address encoding (default)\n" - "32bit length raw IPv4 address (for ip.access nano3G)\n") -{ - if (!g_rab_assign_addr_enc) { - vty_out(vty, "%%RAB Assignment Transport Layer Address" - " encoding not available%s", VTY_NEWLINE); - return CMD_WARNING; - } - - if (strcmp(argv[0], "v4raw") == 0) - *g_rab_assign_addr_enc = NSAP_ADDR_ENC_V4RAW; - else - *g_rab_assign_addr_enc = NSAP_ADDR_ENC_X213; - return CMD_SUCCESS; -} - -extern struct osmo_sccp_addr local_sccp_addr; - -/* Note from the future: change-id Ib8c4fcdb4766c5e575618b95ce16dce51063206b will move this file to - * osmo-iuh, and there, change-id I3bb7fc1cd5261d214c6ba0cccfe95f637e6db087 will drop this vty command - * and use the point code defined via libosmo-sccp vty commands instead. */ -DEFUN(cfg_iu_local_addr_pc, cfg_iu_local_addr_pc_cmd, - "iu local-address point-code PC", - IU_STR "Local SCCP Address\n" "Set local point code\n" "point code\n") -{ - local_sccp_addr.presence = OSMO_SCCP_ADDR_T_PC | OSMO_SCCP_ADDR_T_SSN; - local_sccp_addr.ri = OSMO_SCCP_RI_SSN_PC; - local_sccp_addr.pc = osmo_ss7_pointcode_parse(NULL, argv[0]); - - return CMD_SUCCESS; -} - -/* TODO: GT address configuration, in line with 4.5.1.1.1 of TS 25.410 */ - -int iu_vty_config_write(struct vty *vty, const char *indent) -{ - if (!g_rab_assign_addr_enc) { - vty_out(vty, "%%RAB Assignment Transport Layer Address" - " encoding not available%s", VTY_NEWLINE); - return CMD_WARNING; - } - - switch (*g_rab_assign_addr_enc) { - case NSAP_ADDR_ENC_V4RAW: - vty_out(vty, "%siu rab-assign-addr-enc v4raw%s", indent, - VTY_NEWLINE); - break; - case NSAP_ADDR_ENC_X213: - /* default value, no need to write anything */ - break; - default: - LOGP(0, LOGL_ERROR, "Invalid value for" - " net.iu.rab_assign_addr_enc: %d\n", - *g_rab_assign_addr_enc); - return CMD_WARNING; - } - - vty_out(vty, "%siu local-address point-code %s%s", indent, - osmo_ss7_pointcode_print(NULL, local_sccp_addr.pc), VTY_NEWLINE); - - return CMD_SUCCESS; -} - -void iu_vty_init(int iu_parent_node, enum nsap_addr_enc *rab_assign_addr_enc) -{ - g_rab_assign_addr_enc = rab_assign_addr_enc; - - install_element(CFG_LOG_NODE, &logging_asn_debug_cmd); - install_element(CFG_LOG_NODE, &logging_asn_xer_print_cmd); - install_element(iu_parent_node, &cfg_iu_rab_assign_addr_enc_cmd); - install_element(iu_parent_node, &cfg_iu_local_addr_pc_cmd); -} diff --git a/src/libmsc/Makefile.am b/src/libmsc/Makefile.am index 9f246b3..c9b8bb4 100644 --- a/src/libmsc/Makefile.am +++ b/src/libmsc/Makefile.am @@ -35,8 +35,6 @@ gsm_04_14.c \ gsm_04_80.c \ gsm_subscriber.c \ - iucs.c \ - iucs_ranap.c \ mncc.c \ mncc_builtin.c \ mncc_sock.c \ @@ -52,7 +50,12 @@ meas_feed.c \ subscr_conn.c \ $(NULL) -if !BUILD_IU +if BUILD_IU +libmsc_a_SOURCES += \ + iucs.c \ + iucs_ranap.c \ + $(NULL) +else libmsc_a_SOURCES += \ iu_dummy.c \ $(NULL) diff --git a/src/libmsc/a_iface_bssap.c b/src/libmsc/a_iface_bssap.c index 561ccde..e8a2293 100644 --- a/src/libmsc/a_iface_bssap.c +++ b/src/libmsc/a_iface_bssap.c @@ -29,7 +29,6 @@ #include #include #include -#include #include #include #include diff --git a/src/libmsc/gsm_04_08.c b/src/libmsc/gsm_04_08.c index b6746a5..21bc2b8 100644 --- a/src/libmsc/gsm_04_08.c +++ b/src/libmsc/gsm_04_08.c @@ -72,13 +72,11 @@ #include #include #include - -#include - #ifdef BUILD_IU -#include +#include #endif +#include #include #include @@ -3412,7 +3410,7 @@ #ifdef BUILD_IU DEBUGP(DMM, "-> SECURITY MODE CONTROL %s\n", vlr_subscr_name(conn->vsub)); - return iu_tx_sec_mode_cmd(conn->iu.ue_ctx, tuple, 0, 1); + return ranap_iu_tx_sec_mode_cmd(conn->iu.ue_ctx, &tuple->vec, 0, 1); #else LOGP(DMM, LOGL_ERROR, "Cannot send Security Mode Control over RAN_UTRAN_IU," " built without Iu support\n"); diff --git a/src/libmsc/gsm_subscriber.c b/src/libmsc/gsm_subscriber.c index 73361a1..09540c1 100644 --- a/src/libmsc/gsm_subscriber.c +++ b/src/libmsc/gsm_subscriber.c @@ -20,6 +20,8 @@ * */ +#include "../../bscconfig.h" + #include #include #include @@ -32,6 +34,12 @@ #include +#ifdef BUILD_IU +#include +#else +#include +#endif + #include #include #include @@ -40,7 +48,6 @@ #include #include #include -#include #include #include #include @@ -108,10 +115,10 @@ case RAN_GERAN_A: return a_iface_tx_paging(vsub->imsi, vsub->tmsi, vsub->lac); case RAN_UTRAN_IU: - return iu_page_cs(vsub->imsi, - vsub->tmsi == GSM_RESERVED_TMSI? - NULL : &vsub->tmsi, - vsub->lac); + return ranap_iu_page_cs(vsub->imsi, + vsub->tmsi == GSM_RESERVED_TMSI? + NULL : &vsub->tmsi, + vsub->lac); default: break; } diff --git a/src/libmsc/iu_dummy.c b/src/libmsc/iu_dummy.c index 1f5dffb..e9d335e 100644 --- a/src/libmsc/iu_dummy.c +++ b/src/libmsc/iu_dummy.c @@ -26,39 +26,39 @@ #include "../../bscconfig.h" #ifndef BUILD_IU -#include -#include +#include #include #include #include struct msgb; -struct ue_conn_ctx; +struct ranap_ue_conn_ctx; struct gsm_auth_tuple; struct RANAP_Cause; +struct osmo_auth_vector; -int iu_tx(struct msgb *msg, uint8_t sapi) +int ranap_iu_tx(struct msgb *msg, uint8_t sapi) { LOGP(DLGLOBAL, LOGL_INFO, "iu_tx() dummy called, NOT transmitting %d bytes: %s\n", msg->len, osmo_hexdump(msg->data, msg->len)); return 0; } -int iu_tx_sec_mode_cmd(struct ue_conn_ctx *uectx, struct gsm_auth_tuple *tp, - int send_ck) +int ranap_iu_tx_sec_mode_cmd(struct ranap_ue_conn_ctx *uectx, struct osmo_auth_vector *vec, + int send_ck) { LOGP(DLGLOBAL, LOGL_INFO, "iu_tx_sec_mode_cmd() dummy called, NOT transmitting Security Mode Command\n"); return 0; } -int iu_page_cs(const char *imsi, const uint32_t *tmsi, uint16_t lac) +int ranap_iu_page_cs(const char *imsi, const uint32_t *tmsi, uint16_t lac) { LOGP(DLGLOBAL, LOGL_INFO, "iu_page_cs() dummy called, NOT paging\n"); return 23; } -int iu_page_ps(const char *imsi, const uint32_t *ptmsi, uint16_t lac, uint8_t rac) +int ranap_iu_page_ps(const char *imsi, const uint32_t *ptmsi, uint16_t lac, uint8_t rac) { LOGP(DLGLOBAL, LOGL_INFO, "iu_page_ps() dummy called, NOT paging\n"); return 0; @@ -72,19 +72,19 @@ return NULL; } -int iu_rab_act(struct ue_conn_ctx *ue_ctx, struct msgb *msg) +int ranap_iu_rab_act(struct ranap_ue_conn_ctx *ue_ctx, struct msgb *msg) { LOGP(DLGLOBAL, LOGL_INFO, "iu_rab_act() dummy called, NOT activating RAB\n"); return 0; } -int iu_tx_common_id(struct ue_conn_ctx *uectx, const char *imsi) +int ranap_iu_tx_common_id(struct ranap_ue_conn_ctx *uectx, const char *imsi) { LOGP(DLGLOBAL, LOGL_INFO, "iu_tx_common_id() dummy called, NOT sending CommonID\n"); return 0; } -int iu_tx_release(struct ue_conn_ctx *ctx, const struct RANAP_Cause *cause) +int ranap_iu_tx_release(struct ranap_ue_conn_ctx *ctx, const struct RANAP_Cause *cause) { LOGP(DLGLOBAL, LOGL_INFO, "iu_tx_release() dummy called, NOT sending Release\n"); return 0; diff --git a/src/libmsc/iucs.c b/src/libmsc/iucs.c index be026c8..04b9ece 100644 --- a/src/libmsc/iucs.c +++ b/src/libmsc/iucs.c @@ -25,17 +25,17 @@ #include #include +#include #include #include -#include #include #include #include /* For A-interface see libbsc/bsc_api.c subscr_con_allocate() */ static struct gsm_subscriber_connection *subscr_conn_allocate_iu(struct gsm_network *network, - struct ue_conn_ctx *ue, + struct ranap_ue_conn_ctx *ue, uint16_t lac) { struct gsm_subscriber_connection *conn; @@ -57,7 +57,7 @@ return conn; } -static int same_ue_conn(struct ue_conn_ctx *a, struct ue_conn_ctx *b) +static int same_ue_conn(struct ranap_ue_conn_ctx *a, struct ranap_ue_conn_ctx *b) { if (a == b) return 1; @@ -103,7 +103,7 @@ * connection IDs, or return NULL if not found. */ struct gsm_subscriber_connection *subscr_conn_lookup_iu( struct gsm_network *network, - struct ue_conn_ctx *ue) + struct ranap_ue_conn_ctx *ue) { struct gsm_subscriber_connection *conn; @@ -126,7 +126,7 @@ } /* Receive MM/CC/... message from IuCS (SCCP user SAP). - * msg->dst must reference a struct ue_conn_ctx, which identifies the peer that + * msg->dst must reference a struct ranap_ue_conn_ctx, which identifies the peer that * sent the msg. * * For A-interface see libbsc/bsc_api.c gsm0408_rcvmsg(). */ @@ -134,10 +134,10 @@ uint16_t *lac) { int rc; - struct ue_conn_ctx *ue_ctx; + struct ranap_ue_conn_ctx *ue_ctx; struct gsm_subscriber_connection *conn; - ue_ctx = (struct ue_conn_ctx*)msg->dst; + ue_ctx = (struct ranap_ue_conn_ctx*)msg->dst; /* TODO: are there message types that could allow us to skip this * search? */ diff --git a/src/libmsc/iucs_ranap.c b/src/libmsc/iucs_ranap.c index c016474..45de1ca 100644 --- a/src/libmsc/iucs_ranap.c +++ b/src/libmsc/iucs_ranap.c @@ -27,11 +27,11 @@ #include #include +#include #include #include #include -#include #include #include #include @@ -67,7 +67,7 @@ } int iucs_rx_ranap_event(struct gsm_network *network, - struct ue_conn_ctx *ue_ctx, int type, void *data) + struct ranap_ue_conn_ctx *ue_ctx, int type, void *data) { struct gsm_subscriber_connection *conn; @@ -79,19 +79,19 @@ } switch (type) { - case IU_EVENT_IU_RELEASE: - case IU_EVENT_LINK_INVALIDATED: + case RANAP_IU_EVENT_IU_RELEASE: + case RANAP_IU_EVENT_LINK_INVALIDATED: LOGP(DIUCS, LOGL_INFO, "IuCS release for %s\n", vlr_subscr_name(conn->vsub)); msc_subscr_conn_close(conn, 0); return 0; - case IU_EVENT_SECURITY_MODE_COMPLETE: + case RANAP_IU_EVENT_SECURITY_MODE_COMPLETE: LOGP(DIUCS, LOGL_INFO, "IuCS security mode complete for %s\n", vlr_subscr_name(conn->vsub)); return iucs_rx_sec_mode_compl(conn, (RANAP_SecurityModeCompleteIEs_t*)data); - case IU_EVENT_RAB_ASSIGN: + case RANAP_IU_EVENT_RAB_ASSIGN: return iucs_rx_rab_assign(conn, (RANAP_RAB_SetupOrModifiedItemIEs_t*)data); default: diff --git a/src/libmsc/msc_ifaces.c b/src/libmsc/msc_ifaces.c index 7d2e898..262bf98 100644 --- a/src/libmsc/msc_ifaces.c +++ b/src/libmsc/msc_ifaces.c @@ -23,7 +23,6 @@ #include #include #include -#include #include #include #include @@ -34,10 +33,13 @@ #include "../../bscconfig.h" #ifdef BUILD_IU +#include extern struct msgb *ranap_new_msg_rab_assign_voice(uint8_t rab_id, uint32_t rtp_ip, uint16_t rtp_port, bool use_x213_nsap); +#else +#include #endif /* BUILD_IU */ static int msc_tx(struct gsm_subscriber_connection *conn, struct msgb *msg) @@ -57,7 +59,7 @@ case RAN_UTRAN_IU: msg->dst = conn->iu.ue_ctx; - return iu_tx(msg, 0); + return ranap_iu_tx(msg, 0); default: LOGP(DMSC, LOGL_ERROR, @@ -134,10 +136,10 @@ DEBUGP(DIUCS, "%s: tx CommonID %s\n", vlr_subscr_name(conn->vsub), conn->vsub->imsi); - return iu_tx_common_id(conn->iu.ue_ctx, conn->vsub->imsi); + return ranap_iu_tx_common_id(conn->iu.ue_ctx, conn->vsub->imsi); } -static int iu_rab_act_cs(struct ue_conn_ctx *uectx, uint8_t rab_id, +static int iu_rab_act_cs(struct ranap_ue_conn_ctx *uectx, uint8_t rab_id, uint32_t rtp_ip, uint16_t rtp_port) { #ifdef BUILD_IU @@ -145,7 +147,7 @@ bool use_x213_nsap; uint32_t conn_id = uectx->conn_id; - use_x213_nsap = (uectx->rab_assign_addr_enc == NSAP_ADDR_ENC_X213); + use_x213_nsap = (uectx->rab_assign_addr_enc == RANAP_NSAP_ADDR_ENC_X213); LOGP(DIUCS, LOGL_DEBUG, "Assigning RAB: conn_id=%u, rab_id=%d," " rtp=%x:%u, use_x213_nsap=%d\n", conn_id, rab_id, rtp_ip, @@ -155,7 +157,7 @@ use_x213_nsap); msg->l2h = msg->data; - if (iu_rab_act(uectx, msg)) + if (ranap_iu_rab_act(uectx, msg)) LOGP(DIUCS, LOGL_ERROR, "Failed to send RAB Assignment:" " conn_id=%d rab_id=%d rtp=%x:%u\n", conn_id, rab_id, rtp_ip, rtp_port); @@ -170,7 +172,6 @@ { struct gsm_trans *trans = priv; struct gsm_subscriber_connection *conn = trans->conn; - struct ue_conn_ctx *uectx = conn->iu.ue_ctx; uint32_t rtp_ip; int rc; @@ -195,7 +196,7 @@ if (trans->conn->via_ran == RAN_UTRAN_IU) { /* Assign a voice channel via RANAP on 3G */ - if (iu_rab_act_cs(uectx, conn->iu.rab_id, rtp_ip, conn->rtp.port_subscr)) + if (iu_rab_act_cs(conn->iu.ue_ctx, conn->iu.rab_id, rtp_ip, conn->rtp.port_subscr)) goto rab_act_cs_error; } else if (trans->conn->via_ran == RAN_GERAN_A) { /* Assign a voice channel via A on 2G */ @@ -234,7 +235,7 @@ mgcp = conn->network->mgcpgw.client; #ifdef BUILD_IU - /* FIXME: HACK. where to scope the RAB Id? At the conn / subscriber / ue_conn_ctx? */ + /* FIXME: HACK. where to scope the RAB Id? At the conn / subscriber / ranap_ue_conn_ctx? */ static uint8_t next_iu_rab_id = 1; if (conn->via_ran == RAN_UTRAN_IU) conn->iu.rab_id = next_iu_rab_id ++; diff --git a/src/libmsc/msc_vty.c b/src/libmsc/msc_vty.c index 01e7e82..6ae4529 100644 --- a/src/libmsc/msc_vty.c +++ b/src/libmsc/msc_vty.c @@ -23,15 +23,19 @@ /* NOTE: I would have liked to call this the MSC_NODE instead of the MSC_NODE, * but MSC_NODE already exists to configure a remote MSC for osmo-bsc. */ +#include "../../bscconfig.h" + #include #include +#ifdef BUILD_IU +#include +#endif #include #include #include #include -#include static struct cmd_node msc_node = { MSC_NODE, @@ -99,7 +103,7 @@ mgcpgw_client_config_write(vty, " "); #ifdef BUILD_IU - iu_vty_config_write(vty, " "); + ranap_iu_vty_config_write(vty, " "); #endif return CMD_SUCCESS; @@ -153,6 +157,6 @@ mgcpgw_client_vty_init(MSC_NODE, &msc_network->mgcpgw.conf); #ifdef BUILD_IU - iu_vty_init(MSC_NODE, &msc_network->iu.rab_assign_addr_enc); + ranap_iu_vty_init(MSC_NODE, &msc_network->iu.rab_assign_addr_enc); #endif } diff --git a/src/libmsc/osmo_msc.c b/src/libmsc/osmo_msc.c index 866cfbd..4d24f22 100644 --- a/src/libmsc/osmo_msc.c +++ b/src/libmsc/osmo_msc.c @@ -28,10 +28,16 @@ #include #include #include -#include #include #include + +#include "../../bscconfig.h" +#ifdef BUILD_IU +#include +#else +#include +#endif /* Receive a SAPI-N-REJECT from BSC */ void msc_sapi_n_reject(struct gsm_subscriber_connection *conn, int dlci) @@ -285,7 +291,7 @@ switch (conn->via_ran) { case RAN_UTRAN_IU: - iu_tx_release(conn->iu.ue_ctx, NULL); + ranap_iu_tx_release(conn->iu.ue_ctx, NULL); /* FIXME: keep the conn until the Iu Release Outcome is * received from the UE, or a timeout expires. For now, the log * says "unknown UE" for each release outcome. */ diff --git a/src/libmsc/subscr_conn.c b/src/libmsc/subscr_conn.c index cdeeae9..bcab8e4 100644 --- a/src/libmsc/subscr_conn.c +++ b/src/libmsc/subscr_conn.c @@ -30,9 +30,7 @@ #include #include #include -#include #include - #define SUBSCR_CONN_TIMEOUT 5 /* seconds */ diff --git a/src/osmo-msc/Makefile.am b/src/osmo-msc/Makefile.am index bd734d1..87b6133 100644 --- a/src/osmo-msc/Makefile.am +++ b/src/osmo-msc/Makefile.am @@ -50,7 +50,6 @@ $(NULL) if BUILD_IU osmo_msc_LDADD += \ - $(top_builddir)/src/libiu/libiu.a \ $(LIBOSMORANAP_LIBS) \ $(LIBASN1C_LIBS) \ $(NULL) diff --git a/src/osmo-msc/msc_main.c b/src/osmo-msc/msc_main.c index cd713ee..de6af5d 100644 --- a/src/osmo-msc/msc_main.c +++ b/src/osmo-msc/msc_main.c @@ -66,9 +66,11 @@ #include #include -#include +#ifdef BUILD_IU +#include +#endif -#include +#include #include #include #include @@ -312,6 +314,7 @@ .is_config_node = bsc_vty_is_config_node, }; +#ifdef BUILD_IU static int rcvmsg_iu_cs(struct msgb *msg, struct gprs_ra_id *ra_id, uint16_t *sai) { DEBUGP(DIUCS, "got IuCS message" @@ -326,14 +329,15 @@ return gsm0408_rcvmsg_iucs(msc_network, msg, ra_id? &ra_id->lac : NULL); } -static int rx_iu_event(struct ue_conn_ctx *ctx, enum iu_event_type type, +static int rx_iu_event(struct ranap_ue_conn_ctx *ctx, enum ranap_iu_event_type type, void *data) { DEBUGP(DIUCS, "got IuCS event %u: %s\n", type, - iu_event_type_str(type)); + ranap_iu_event_type_str(type)); return iucs_rx_ranap_event(msc_network, ctx, type, data); } +#endif #define DEFAULT_M3UA_REMOTE_IP "127.0.0.1" #define DEFAULT_PC_A "0.23.1" @@ -564,7 +568,7 @@ #ifdef BUILD_IU /* Set up IuCS */ - iu_init(tall_msc_ctx, msc_network->iu.sccp, rcvmsg_iu_cs, rx_iu_event); + ranap_iu_init(tall_msc_ctx, DRANAP, "OsmoMSC-IuCS", msc_network->iu.sccp, rcvmsg_iu_cs, rx_iu_event); #endif /* Set up A interface */ diff --git a/tests/msc_vlr/Makefile.am b/tests/msc_vlr/Makefile.am index 6d51d6e..3ae0c84 100644 --- a/tests/msc_vlr/Makefile.am +++ b/tests/msc_vlr/Makefile.am @@ -50,13 +50,6 @@ $(top_builddir)/src/libtrau/libtrau.a \ $(top_builddir)/src/libmgcp/libmgcp.a \ $(top_builddir)/src/libcommon/libcommon.a \ - $(NULL) -if BUILD_IU -COMMON_LDADD += \ - $(top_builddir)/src/libiu/libiu.a \ - $(NULL) -endif -COMMON_LDADD += \ $(LIBSMPP34_LIBS) \ $(LIBOSMOCORE_LIBS) \ $(LIBOSMOGSM_LIBS) \ @@ -76,10 +69,10 @@ -Wl,--wrap=a_iface_tx_dtap \ -Wl,--wrap=a_iface_tx_clear_cmd \ -Wl,--wrap=a_iface_tx_paging \ - -Wl,--wrap=iu_tx \ - -Wl,--wrap=iu_tx_release \ - -Wl,--wrap=iu_tx_common_id \ - -Wl,--wrap=iu_page_cs \ + -Wl,--wrap=ranap_iu_tx \ + -Wl,--wrap=ranap_iu_tx_release \ + -Wl,--wrap=ranap_iu_tx_common_id \ + -Wl,--wrap=ranap_iu_page_cs \ -Wl,--wrap=msc_stop_paging \ -Wl,--wrap=gsm340_gen_scts \ -Wl,--wrap=RAND_bytes \ diff --git a/tests/msc_vlr/msc_vlr_tests.c b/tests/msc_vlr/msc_vlr_tests.c index a45b10f..3966aac 100644 --- a/tests/msc_vlr/msc_vlr_tests.c +++ b/tests/msc_vlr/msc_vlr_tests.c @@ -34,8 +34,13 @@ #include #include #include -#include + +#if BUILD_IU #include +#include +#else +#include +#endif #include "msc_vlr_tests.h" @@ -152,8 +157,8 @@ conn->bts = the_bts; conn->via_ran = rx_from_ran; if (conn->via_ran == RAN_UTRAN_IU) { - struct ue_conn_ctx *ue_ctx = talloc_zero(conn, struct ue_conn_ctx); - *ue_ctx = (struct ue_conn_ctx){ + struct ranap_ue_conn_ctx *ue_ctx = talloc_zero(conn, struct ranap_ue_conn_ctx); + *ue_ctx = (struct ranap_ue_conn_ctx){ .conn_id = 42, }; conn->iu.ue_ctx = ue_ctx; @@ -295,9 +300,9 @@ return 1; } -/* override, requires '-Wl,--wrap=iu_page_cs' */ -int __real_iu_page_cs(const char *imsi, const uint32_t *tmsi, uint16_t lac); -int __wrap_iu_page_cs(const char *imsi, const uint32_t *tmsi, uint16_t lac) +/* override, requires '-Wl,--wrap=ranap_iu_page_cs' */ +int __real_ranap_iu_page_cs(const char *imsi, const uint32_t *tmsi, uint16_t lac); +int __wrap_ranap_iu_page_cs(const char *imsi, const uint32_t *tmsi, uint16_t lac) { return _paging_sent(RAN_UTRAN_IU, imsi, tmsi ? *tmsi : GSM_RESERVED_TMSI, lac); } @@ -472,16 +477,16 @@ return 0; } -/* override, requires '-Wl,--wrap=iu_tx' */ -int __real_iu_tx(struct msgb *msg, uint8_t sapi); -int __wrap_iu_tx(struct msgb *msg, uint8_t sapi) +/* override, requires '-Wl,--wrap=ranap_iu_tx' */ +int __real_ranap_iu_tx(struct msgb *msg, uint8_t sapi); +int __wrap_ranap_iu_tx(struct msgb *msg, uint8_t sapi) { return _validate_dtap(msg, RAN_UTRAN_IU); } -/* override, requires '-Wl,--wrap=iu_tx_release' */ -int __real_iu_tx_release(struct ue_conn_ctx *ctx, const struct RANAP_Cause *cause); -int __wrap_iu_tx_release(struct ue_conn_ctx *ctx, const struct RANAP_Cause *cause) +/* override, requires '-Wl,--wrap=ranap_iu_tx_release' */ +int __real_ranap_iu_tx_release(struct ranap_ue_conn_ctx *ctx, const struct RANAP_Cause *cause); +int __wrap_ranap_iu_tx_release(struct ranap_ue_conn_ctx *ctx, const struct RANAP_Cause *cause) { btw("Iu Release --%s--> MS", ran_type_name(RAN_UTRAN_IU)); OSMO_ASSERT(iu_release_expected); @@ -491,8 +496,8 @@ } /* override, requires '-Wl,--wrap=iu_tx_common_id' */ -int __real_iu_tx_common_id(struct ue_conn_ctx *ue_ctx, const char *imsi); -int __wrap_iu_tx_common_id(struct ue_conn_ctx *ue_ctx, const char *imsi) +int __real_ranap_iu_tx_common_id(struct ranap_ue_conn_ctx *ue_ctx, const char *imsi); +int __wrap_ranap_iu_tx_common_id(struct ranap_ue_conn_ctx *ue_ctx, const char *imsi) { btw("Iu Common ID --%s--> MS (IMSI=%s)", ran_type_name(RAN_UTRAN_IU), imsi); return 0; diff --git a/tests/sgsn/Makefile.am b/tests/sgsn/Makefile.am index f1606cb..ccb8f44 100644 --- a/tests/sgsn/Makefile.am +++ b/tests/sgsn/Makefile.am @@ -74,7 +74,6 @@ if BUILD_IU sgsn_test_LDADD += \ - $(top_builddir)/src/libiu/libiu.a \ $(LIBOSMORANAP_LIBS) \ $(LIBOSMOSIGTRAN_LIBS) \ $(LIBASN1C_LIBS) \ diff --git a/tests/sms_queue/Makefile.am b/tests/sms_queue/Makefile.am index d17f996..62c479b 100644 --- a/tests/sms_queue/Makefile.am +++ b/tests/sms_queue/Makefile.am @@ -37,13 +37,6 @@ $(top_builddir)/src/libmgcp/libmgcp.a \ $(top_builddir)/src/libcommon/libcommon.a \ $(top_builddir)/src/libcommon-cs/libcommon-cs.a \ - $(NULL) -if BUILD_IU -sms_queue_test_LDADD += \ - $(top_builddir)/src/libiu/libiu.a \ - $(NULL) -endif -sms_queue_test_LDADD += \ $(LIBSMPP34_LIBS) \ $(LIBOSMOCORE_LIBS) \ $(LIBOSMOGSM_LIBS) \ -- To view, visit https://gerrit.osmocom.org/3489 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ib8c4fcdb4766c5e575618b95ce16dce51063206b Gerrit-PatchSet: 7 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Tue Aug 29 12:51:21 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 29 Aug 2017 12:51:21 +0000 Subject: [MERGED] osmo-msc[master]: Implement AoIP, port to M3UA SIGTRAN (large addition and ref... In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Implement AoIP, port to M3UA SIGTRAN (large addition and refactoring) ...................................................................... Implement AoIP, port to M3UA SIGTRAN (large addition and refactoring) This was originally a long series of commits converging to the final result seen in this patch. It does not make much sense to review the smaller steps' trial and error, we need to review this entire change as a whole. Implement AoIP in osmo-msc and osmo-bsc. Change over to the new libosmo-sigtran API with support for proper SCCP/M3UA/SCTP stacking, as mandated by 3GPP specifications for the IuCS and IuPS interfaces. >From here on, a separate osmo-stp process is required for SCCP routing between OsmoBSC / OsmoHNBGW <-> OsmoMSC / OsmoSGSN jenkins.sh: build from libosmo-sccp and osmo-iuh master branches now for new M3UA SIGTRAN. Patch-by: pmaier, nhofmeyr, laforge Change-Id: I5ae4e05ee7c57cad341ea5e86af37c1f6b0ffa77 --- M configure.ac M contrib/jenkins.sh M doc/examples/osmo-bsc/osmo-bsc.cfg M include/openbsc/Makefile.am A include/openbsc/a_iface.h A include/openbsc/a_iface_bssap.h A include/openbsc/a_reset.h M include/openbsc/bsc_msc.h M include/openbsc/bsc_msc_data.h M include/openbsc/debug.h M include/openbsc/gsm_04_08.h M include/openbsc/gsm_data.h M include/openbsc/gsm_data_shared.h M include/openbsc/iu.h M include/openbsc/mgcpgw_client.h M include/openbsc/msc_ifaces.h M include/openbsc/osmo_bsc.h A include/openbsc/osmo_bsc_reset.h A include/openbsc/osmo_bsc_sigtran.h M include/openbsc/osmo_msc.h M include/openbsc/transaction.h M src/gprs/Makefile.am M src/gprs/sgsn_main.c M src/libbsc/abis_rsl.c M src/libbsc/bsc_vty.c M src/libbsc/handover_logic.c M src/libcommon-cs/Makefile.am A src/libcommon-cs/a_reset.c M src/libcommon-cs/common_cs.c M src/libcommon/common_vty.c M src/libcommon/debug.c M src/libiu/iu.c M src/libiu/iu_vty.c M src/libmgcp/mgcp_protocol.c M src/libmgcp/mgcpgw_client.c M src/libmgcp/mgcpgw_client_vty.c M src/libmsc/Makefile.am M src/libmsc/a_iface.c A src/libmsc/a_iface_bssap.c M src/libmsc/gsm_04_08.c M src/libmsc/gsm_subscriber.c M src/libmsc/iucs.c M src/libmsc/msc_ifaces.c M src/libmsc/msc_vty.c M src/libmsc/osmo_msc.c M src/libmsc/subscr_conn.c M src/osmo-bsc/Makefile.am M src/osmo-bsc/osmo_bsc_api.c M src/osmo-bsc/osmo_bsc_audio.c M src/osmo-bsc/osmo_bsc_bssap.c M src/osmo-bsc/osmo_bsc_main.c M src/osmo-bsc/osmo_bsc_msc.c A src/osmo-bsc/osmo_bsc_reset.c D src/osmo-bsc/osmo_bsc_sccp.c A src/osmo-bsc/osmo_bsc_sigtran.c M src/osmo-bsc/osmo_bsc_vty.c M src/osmo-bsc_mgcp/Makefile.am M src/osmo-bsc_nat/Makefile.am M src/osmo-msc/msc_main.c M tests/msc_vlr/Makefile.am M tests/msc_vlr/msc_vlr_test_gsm_authen.c M tests/msc_vlr/msc_vlr_test_gsm_authen.err M tests/msc_vlr/msc_vlr_test_gsm_ciph.c M tests/msc_vlr/msc_vlr_test_gsm_ciph.err M tests/msc_vlr/msc_vlr_test_hlr_reject.c M tests/msc_vlr/msc_vlr_test_hlr_reject.err M tests/msc_vlr/msc_vlr_test_hlr_timeout.c M tests/msc_vlr/msc_vlr_test_hlr_timeout.err M tests/msc_vlr/msc_vlr_test_ms_timeout.c M tests/msc_vlr/msc_vlr_test_ms_timeout.err M tests/msc_vlr/msc_vlr_test_no_authen.c M tests/msc_vlr/msc_vlr_test_no_authen.err M tests/msc_vlr/msc_vlr_test_reject_concurrency.c M tests/msc_vlr/msc_vlr_test_reject_concurrency.err M tests/msc_vlr/msc_vlr_test_rest.c M tests/msc_vlr/msc_vlr_test_rest.err M tests/msc_vlr/msc_vlr_test_umts_authen.c M tests/msc_vlr/msc_vlr_test_umts_authen.err M tests/msc_vlr/msc_vlr_tests.c M tests/msc_vlr/msc_vlr_tests.h 80 files changed, 4,486 insertions(+), 714 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified -- To view, visit https://gerrit.osmocom.org/3486 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I5ae4e05ee7c57cad341ea5e86af37c1f6b0ffa77 Gerrit-PatchSet: 6 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: dexter From gerrit-no-reply at lists.osmocom.org Tue Aug 29 12:51:21 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 29 Aug 2017 12:51:21 +0000 Subject: [MERGED] osmo-msc[master]: add msg type to SMS rx logging In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: add msg type to SMS rx logging ...................................................................... add msg type to SMS rx logging Change-Id: I73ea4eebe57b2d1008045a27f174072178b9f077 --- M src/libmsc/gsm_04_11.c 1 file changed, 3 insertions(+), 1 deletion(-) 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 c5bcce7..574fe28 100644 --- a/src/libmsc/gsm_04_11.c +++ b/src/libmsc/gsm_04_11.c @@ -917,7 +917,9 @@ return -EIO; /* FIXME: send some error message */ - DEBUGP(DLSMS, "receiving data (trans_id=%x)\n", transaction_id); + DEBUGP(DLSMS, "receiving data (trans_id=%x, msg_type=%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); /* -- To view, visit https://gerrit.osmocom.org/3496 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I73ea4eebe57b2d1008045a27f174072178b9f077 Gerrit-PatchSet: 10 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Tue Aug 29 12:51:22 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 29 Aug 2017 12:51:22 +0000 Subject: [MERGED] osmo-msc[master]: msc_vlr tests: add IMEISV tests In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: msc_vlr tests: add IMEISV tests ...................................................................... msc_vlr tests: add IMEISV tests Change-Id: I752afef2ae3ce04e813c7e9fea0e883e607c0e14 --- M tests/msc_vlr/msc_vlr_test_gsm_authen.c M tests/msc_vlr/msc_vlr_test_gsm_authen.err M tests/msc_vlr/msc_vlr_test_gsm_ciph.c M tests/msc_vlr/msc_vlr_test_gsm_ciph.err M tests/msc_vlr/msc_vlr_test_no_authen.c M tests/msc_vlr/msc_vlr_test_no_authen.err 6 files changed, 1,324 insertions(+), 48 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/tests/msc_vlr/msc_vlr_test_gsm_authen.c b/tests/msc_vlr/msc_vlr_test_gsm_authen.c index 44e4052..70b7614 100644 --- a/tests/msc_vlr/msc_vlr_test_gsm_authen.c +++ b/tests/msc_vlr/msc_vlr_test_gsm_authen.c @@ -563,7 +563,7 @@ btw("MS replies with an Identity Response"); expect_bssap_clear(); - ms_sends_msg("0559084a32244332244332"); + ms_sends_msg("0559084a32244332244302"); VERBOSE_ASSERT(bssap_clear_sent, == true, "%d"); btw("LU was successful, and the conn has already been closed"); @@ -573,7 +573,7 @@ btw("Subscriber has the IMEI"); vsub = vlr_subscr_find_by_imsi(net->vlr, imsi); OSMO_ASSERT(vsub); - VERBOSE_ASSERT(strcmp(vsub->imei, "423423423423423"), == 0, "%d"); + VERBOSE_ASSERT(strcmp(vsub->imei, "423423423423420"), == 0, "%d"); vlr_subscr_put(vsub); BTW("subscriber detaches"); @@ -661,7 +661,7 @@ thwart_rx_non_initial_requests(); btw("MS replies with an Identity Response"); - ms_sends_msg("0559084a32244332244332"); + ms_sends_msg("0559084a32244332244302"); btw("a LU Accept with a new TMSI was sent, waiting for TMSI Realloc Compl"); EXPECT_CONN_COUNT(1); @@ -688,7 +688,7 @@ btw("Subscriber has the IMEI and TMSI"); vsub = vlr_subscr_find_by_imsi(net->vlr, imsi); OSMO_ASSERT(vsub); - VERBOSE_ASSERT(strcmp(vsub->imei, "423423423423423"), == 0, "%d"); + VERBOSE_ASSERT(strcmp(vsub->imei, "423423423423420"), == 0, "%d"); VERBOSE_ASSERT(vsub->tmsi, == 0x03020100, "0x%08x"); vlr_subscr_put(vsub); diff --git a/tests/msc_vlr/msc_vlr_test_gsm_authen.err b/tests/msc_vlr/msc_vlr_test_gsm_authen.err index bca64a4..c12eba1 100644 --- a/tests/msc_vlr/msc_vlr_test_gsm_authen.err +++ b/tests/msc_vlr/msc_vlr_test_gsm_authen.err @@ -1250,8 +1250,8 @@ MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_ID_RESP DREF MSISDN:46071: MSC conn use + 1 == 2 DRLL Dispatching 04.08 message GSM48_MT_MM_ID_RESP (0x5:0x19) -DMM IDENTITY RESPONSE: MI(IMEI)=423423423423423 -DVLR set IMEI on subscriber; IMSI=901700000004620 IMEI=423423423423423 +DMM IDENTITY RESPONSE: MI(IMEI)=423423423423420 +DVLR set IMEI on subscriber; IMSI=901700000004620 IMEI=423423423423420 DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_WAIT_LU_COMPL}: Received Event VLR_ULA_E_ID_IMEI DVLR lu_compl_vlr_fsm(901700000004620){LU_COMPL_VLR_S_WAIT_IMEI}: Received Event LU_COMPL_VLR_E_IMEI_CHECK_ACK - sending LU Accept for MSISDN:46071 @@ -1289,7 +1289,7 @@ llist_count(&net->subscr_conns) == 0 - Subscriber has the IMEI DREF VLR subscr MSISDN:46071 usage increases to: 2 - strcmp(vsub->imei, "423423423423423") == 0 + strcmp(vsub->imei, "423423423423420") == 0 DREF VLR subscr MSISDN:46071 usage decreases to: 1 --- - subscriber detaches @@ -1469,8 +1469,8 @@ MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_ID_RESP DREF MSISDN:46071: MSC conn use + 1 == 2 DRLL Dispatching 04.08 message GSM48_MT_MM_ID_RESP (0x5:0x19) -DMM IDENTITY RESPONSE: MI(IMEI)=423423423423423 -DVLR set IMEI on subscriber; IMSI=901700000004620 IMEI=423423423423423 +DMM IDENTITY RESPONSE: MI(IMEI)=423423423423420 +DVLR set IMEI on subscriber; IMSI=901700000004620 IMEI=423423423423420 DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_WAIT_LU_COMPL}: Received Event VLR_ULA_E_ID_IMEI DVLR lu_compl_vlr_fsm(901700000004620){LU_COMPL_VLR_S_WAIT_IMEI_TMSI}: Received Event LU_COMPL_VLR_E_IMEI_CHECK_ACK DVLR lu_compl_vlr_fsm(901700000004620){LU_COMPL_VLR_S_WAIT_IMEI_TMSI}: lu_compl_vlr_new_tmsi() @@ -1538,7 +1538,7 @@ llist_count(&net->subscr_conns) == 0 - Subscriber has the IMEI and TMSI DREF VLR subscr MSISDN:46071 usage increases to: 2 - strcmp(vsub->imei, "423423423423423") == 0 + strcmp(vsub->imei, "423423423423420") == 0 vsub->tmsi == 0x03020100 DREF VLR subscr MSISDN:46071 usage decreases to: 1 --- diff --git a/tests/msc_vlr/msc_vlr_test_gsm_ciph.c b/tests/msc_vlr/msc_vlr_test_gsm_ciph.c index 42e7c73..e0bd967 100644 --- a/tests/msc_vlr/msc_vlr_test_gsm_ciph.c +++ b/tests/msc_vlr/msc_vlr_test_gsm_ciph.c @@ -553,7 +553,7 @@ btw("MS replies with an Identity Response"); expect_bssap_clear(); - ms_sends_msg("0559084a32244332244332"); + ms_sends_msg("0559084a32244332244302"); VERBOSE_ASSERT(bssap_clear_sent, == true, "%d"); btw("LU was successful, and the conn has already been closed"); @@ -563,7 +563,7 @@ btw("Subscriber has the IMEI"); vsub = vlr_subscr_find_by_imsi(net->vlr, imsi); OSMO_ASSERT(vsub); - VERBOSE_ASSERT(strcmp(vsub->imei, "423423423423423"), == 0, "%d"); + VERBOSE_ASSERT(strcmp(vsub->imei, "423423423423420"), == 0, "%d"); vlr_subscr_put(vsub); BTW("subscriber detaches"); @@ -638,20 +638,17 @@ btw("MS sends Ciphering Mode Complete with IMEISV, VLR accepts and sends GSUP LU Req to HLR"); gsup_expect_tx("04010809710000004026f0"); - ms_sends_msg("063217094b32244332244332f5"); + ms_sends_msg("063217094b32244332244372f5"); VERBOSE_ASSERT(lu_result_sent, == RES_NONE, "%d"); btw("Subscriber has the IMEISV"); vsub = vlr_subscr_find_by_imsi(net->vlr, imsi); OSMO_ASSERT(vsub); - VERBOSE_ASSERT(strcmp(vsub->imeisv, "4234234234234235"), == 0, "%d"); + VERBOSE_ASSERT(strcmp(vsub->imeisv, "4234234234234275"), == 0, "%d"); vlr_subscr_put(vsub); EXPECT_ACCEPTED(false); thwart_rx_non_initial_requests(); - - btw("MS replies with an Identity Response"); - ms_sends_msg("0559084a32244332244332"); btw("HLR sends _INSERT_DATA_REQUEST, VLR responds with _INSERT_DATA_RESULT"); gsup_rx("10010809710000004026f00804036470f1", @@ -756,7 +753,7 @@ thwart_rx_non_initial_requests(); btw("MS replies with an Identity Response"); - ms_sends_msg("0559084a32244332244332"); + ms_sends_msg("0559084a32244332244302"); btw("a LU Accept with a new TMSI was sent, waiting for TMSI Realloc Compl"); EXPECT_CONN_COUNT(1); @@ -783,7 +780,7 @@ btw("Subscriber has the IMEI and TMSI"); vsub = vlr_subscr_find_by_imsi(net->vlr, imsi); OSMO_ASSERT(vsub); - VERBOSE_ASSERT(strcmp(vsub->imei, "423423423423423"), == 0, "%d"); + VERBOSE_ASSERT(strcmp(vsub->imei, "423423423423420"), == 0, "%d"); VERBOSE_ASSERT(vsub->tmsi, == 0x03020100, "0x%08x"); vlr_subscr_put(vsub); diff --git a/tests/msc_vlr/msc_vlr_test_gsm_ciph.err b/tests/msc_vlr/msc_vlr_test_gsm_ciph.err index c219b49..b26f0d2 100644 --- a/tests/msc_vlr/msc_vlr_test_gsm_ciph.err +++ b/tests/msc_vlr/msc_vlr_test_gsm_ciph.err @@ -1152,8 +1152,8 @@ MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_ID_RESP DREF MSISDN:46071: MSC conn use + 1 == 2 DRLL Dispatching 04.08 message GSM48_MT_MM_ID_RESP (0x5:0x19) -DMM IDENTITY RESPONSE: MI(IMEI)=423423423423423 -DVLR set IMEI on subscriber; IMSI=901700000004620 IMEI=423423423423423 +DMM IDENTITY RESPONSE: MI(IMEI)=423423423423420 +DVLR set IMEI on subscriber; IMSI=901700000004620 IMEI=423423423423420 DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_WAIT_LU_COMPL}: Received Event VLR_ULA_E_ID_IMEI DVLR lu_compl_vlr_fsm(901700000004620){LU_COMPL_VLR_S_WAIT_IMEI}: Received Event LU_COMPL_VLR_E_IMEI_CHECK_ACK - sending LU Accept for MSISDN:46071 @@ -1191,7 +1191,7 @@ llist_count(&net->subscr_conns) == 0 - Subscriber has the IMEI DREF VLR subscr MSISDN:46071 usage increases to: 2 - strcmp(vsub->imei, "423423423423423") == 0 + strcmp(vsub->imei, "423423423423420") == 0 DREF VLR subscr MSISDN:46071 usage decreases to: 1 --- - subscriber detaches @@ -1305,8 +1305,8 @@ MSC <--RAN_GERAN_A-- MS: GSM48_MT_RR_CIPH_M_COMPL DRR IMSI:901700000004620: CIPHERING MODE COMPLETE DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_WAIT_CIPH}: Received Event VLR_ULA_E_CIPH_RES -DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_WAIT_CIPH}: got IMEISV: 4234234234234235F -DVLR set IMEISV on subscriber; IMSI=901700000004620 IMEISV=4234234234234235 +DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_WAIT_CIPH}: got IMEISV: 4234234234234275F +DVLR set IMEISV on subscriber; IMSI=901700000004620 IMEISV=4234234234234275 DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_WAIT_CIPH}: vlr_loc_upd_post_ciph() DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_WAIT_CIPH}: vlr_loc_upd_node_4() DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_WAIT_CIPH}: state_chg to VLR_ULA_S_WAIT_HLR_UPD @@ -1319,7 +1319,7 @@ lu_result_sent == 0 - Subscriber has the IMEISV DREF VLR subscr IMSI:901700000004620 usage increases to: 2 - strcmp(vsub->imeisv, "4234234234234235") == 0 + strcmp(vsub->imeisv, "4234234234234275") == 0 DREF VLR subscr IMSI:901700000004620 usage decreases to: 1 msc_subscr_conn_is_accepted() == false requests shall be thwarted @@ -1331,16 +1331,6 @@ DRLL subscr IMSI:901700000004620: Message not permitted for initial conn: GSM48_MT_RR_SYSINFO_1 DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) DRLL subscr IMSI:901700000004620: Message not permitted for initial conn: GSM48_PDISC_SMS:0x01 -- MS replies with an Identity Response - MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_ID_RESP -DREF IMSI:901700000004620: MSC conn use + 1 == 2 -DRLL Dispatching 04.08 message GSM48_MT_MM_ID_RESP (0x5:0x19) -DMM IDENTITY RESPONSE: MI(IMEI)=423423423423423 -DVLR set IMEI on subscriber; IMSI=901700000004620 IMEI=423423423423423 -DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_WAIT_HLR_UPD}: Received Event VLR_ULA_E_ID_IMEI -DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_WAIT_HLR_UPD}: Event VLR_ULA_E_ID_IMEI not permitted -DMM IMSI:901700000004620: bump: conn still being established (SUBSCR_CONN_S_NEW) -DREF IMSI:901700000004620: MSC conn use - 1 == 1 - HLR sends _INSERT_DATA_REQUEST, VLR responds with _INSERT_DATA_RESULT <-- GSUP rx OSMO_GSUP_MSGT_INSERT_DATA_REQUEST: 10010809710000004026f00804036470f1 DVLR GSUP rx 17: 10010809710000004026f00804036470f1 @@ -1589,8 +1579,8 @@ MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_ID_RESP DREF MSISDN:46071: MSC conn use + 1 == 2 DRLL Dispatching 04.08 message GSM48_MT_MM_ID_RESP (0x5:0x19) -DMM IDENTITY RESPONSE: MI(IMEI)=423423423423423 -DVLR set IMEI on subscriber; IMSI=901700000004620 IMEI=423423423423423 +DMM IDENTITY RESPONSE: MI(IMEI)=423423423423420 +DVLR set IMEI on subscriber; IMSI=901700000004620 IMEI=423423423423420 DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_WAIT_LU_COMPL}: Received Event VLR_ULA_E_ID_IMEI DVLR lu_compl_vlr_fsm(901700000004620){LU_COMPL_VLR_S_WAIT_IMEI_TMSI}: Received Event LU_COMPL_VLR_E_IMEI_CHECK_ACK DVLR lu_compl_vlr_fsm(901700000004620){LU_COMPL_VLR_S_WAIT_IMEI_TMSI}: lu_compl_vlr_new_tmsi() @@ -1658,7 +1648,7 @@ llist_count(&net->subscr_conns) == 0 - Subscriber has the IMEI and TMSI DREF VLR subscr MSISDN:46071 usage increases to: 2 - strcmp(vsub->imei, "423423423423423") == 0 + strcmp(vsub->imei, "423423423423420") == 0 vsub->tmsi == 0x03020100 DREF VLR subscr MSISDN:46071 usage decreases to: 1 --- diff --git a/tests/msc_vlr/msc_vlr_test_no_authen.c b/tests/msc_vlr/msc_vlr_test_no_authen.c index 34e392e..32e0b40 100644 --- a/tests/msc_vlr/msc_vlr_test_no_authen.c +++ b/tests/msc_vlr/msc_vlr_test_no_authen.c @@ -425,7 +425,9 @@ btw("MS replies with an Identity Response"); expect_bssap_clear(); - ms_sends_msg("0559084a32244332244332"); + /* 3GPP TS 23.003: 6.2.1 Composition of IMEI: the IMEI ends with a + * spare digit that shall be sent as zero by the MS. */ + ms_sends_msg("0559084a32244332244302"); VERBOSE_ASSERT(bssap_clear_sent, == true, "%d"); btw("LU was successful, and the conn has already been closed"); @@ -435,7 +437,7 @@ btw("Subscriber has the IMEI"); vsub = vlr_subscr_find_by_imsi(net->vlr, imsi); OSMO_ASSERT(vsub); - VERBOSE_ASSERT(strcmp(vsub->imei, "423423423423423"), == 0, "%d"); + VERBOSE_ASSERT(strcmp(vsub->imei, "423423423423420"), == 0, "%d"); vlr_subscr_put(vsub); BTW("subscriber detaches"); @@ -491,7 +493,7 @@ thwart_rx_non_initial_requests(); btw("MS replies with an Identity Response"); - ms_sends_msg("0559084a32244332244332"); + ms_sends_msg("0559084a32244332244302"); btw("a LU Accept with a new TMSI was sent, waiting for TMSI Realloc Compl"); EXPECT_CONN_COUNT(1); @@ -511,7 +513,7 @@ btw("Subscriber has the IMEI and TMSI"); vsub = vlr_subscr_find_by_imsi(net->vlr, imsi); OSMO_ASSERT(vsub); - VERBOSE_ASSERT(strcmp(vsub->imei, "423423423423423"), == 0, "%d"); + VERBOSE_ASSERT(strcmp(vsub->imei, "423423423423420"), == 0, "%d"); VERBOSE_ASSERT(vsub->tmsi, == 0x03020100, "0x%08x"); vlr_subscr_put(vsub); @@ -525,10 +527,382 @@ comment_end(); } +void test_no_authen_imeisv() +{ + struct vlr_subscr *vsub; + const char *imsi = "901700000004620"; + + /* No auth only works on GERAN */ + rx_from_ran = RAN_GERAN_A; + + comment_start(); + + net->vlr->cfg.retrieve_imeisv_early = true; + + btw("Location Update request causes an IMEISV ID request back to the MS"); + lu_result_sent = RES_NONE; + dtap_expect_tx("051803"); + ms_sends_msg("050802008168000130089910070000006402"); + OSMO_ASSERT(dtap_tx_confirmed); + + btw("MS replies with an Identity Response, causes LU to commence with a GSUP LU request to HLR"); + gsup_expect_tx("04010809710000004026f0"); + ms_sends_msg("0559094332244332244372f5"); + OSMO_ASSERT(gsup_tx_confirmed); + VERBOSE_ASSERT(lu_result_sent, == RES_NONE, "%d"); + + btw("Subscriber has the IMEISV from the ID Response"); + vsub = vlr_subscr_find_by_imsi(net->vlr, imsi); + OSMO_ASSERT(vsub); + VERBOSE_ASSERT(strcmp(vsub->imeisv, "4234234234234275"), == 0, "%d"); + vlr_subscr_put(vsub); + + btw("HLR sends _INSERT_DATA_REQUEST, VLR responds with _INSERT_DATA_RESULT"); + gsup_rx("10010809710000004026f00804036470f1", + "12010809710000004026f0"); + VERBOSE_ASSERT(lu_result_sent, == RES_NONE, "%d"); + + btw("having received subscriber data does not mean acceptance"); + EXPECT_ACCEPTED(false); + + thwart_rx_non_initial_requests(); + + VERBOSE_ASSERT(lu_result_sent, == RES_NONE, "%d"); + + btw("HLR also sends GSUP _UPDATE_LOCATION_RESULT"); + expect_bssap_clear(); + gsup_rx("06010809710000004026f0", NULL); + + btw("LU was successful, and the conn has already been closed"); + VERBOSE_ASSERT(lu_result_sent, == RES_ACCEPT, "%d"); + VERBOSE_ASSERT(bssap_clear_sent, == true, "%d"); + EXPECT_CONN_COUNT(0); + + BTW("subscriber detaches"); + expect_bssap_clear(); + ms_sends_msg("050130089910070000006402"); + VERBOSE_ASSERT(bssap_clear_sent, == true, "%d"); + + EXPECT_CONN_COUNT(0); + clear_vlr(); + comment_end(); +} + +void test_no_authen_imeisv_imei() +{ + struct vlr_subscr *vsub; + const char *imsi = "901700000004620"; + + rx_from_ran = RAN_GERAN_A; + + comment_start(); + + net->vlr->cfg.retrieve_imeisv_early = true; + net->vlr->cfg.check_imei_rqd = true; + + btw("Location Update request causes an IMEISV ID request back to the MS"); + lu_result_sent = RES_NONE; + dtap_expect_tx("051803"); + ms_sends_msg("050802008168000130089910070000006402"); + OSMO_ASSERT(dtap_tx_confirmed); + + btw("MS replies with an Identity Response, causes LU to commence with a GSUP LU request to HLR"); + gsup_expect_tx("04010809710000004026f0"); + ms_sends_msg("0559094332244332244372f5"); + OSMO_ASSERT(gsup_tx_confirmed); + VERBOSE_ASSERT(lu_result_sent, == RES_NONE, "%d"); + + btw("Subscriber has the IMEISV from the ID Response"); + vsub = vlr_subscr_find_by_imsi(net->vlr, imsi); + OSMO_ASSERT(vsub); + VERBOSE_ASSERT(strcmp(vsub->imeisv, "4234234234234275"), == 0, "%d"); + vlr_subscr_put(vsub); + + btw("HLR sends _INSERT_DATA_REQUEST, VLR responds with _INSERT_DATA_RESULT"); + gsup_rx("10010809710000004026f00804036470f1", + "12010809710000004026f0"); + VERBOSE_ASSERT(lu_result_sent, == RES_NONE, "%d"); + + btw("having received subscriber data does not mean acceptance"); + EXPECT_ACCEPTED(false); + thwart_rx_non_initial_requests(); + VERBOSE_ASSERT(lu_result_sent, == RES_NONE, "%d"); + + btw("HLR also sends GSUP _UPDATE_LOCATION_RESULT, and we send an ID Request for the IMEI to the MS"); + dtap_expect_tx("051802"); + gsup_rx("06010809710000004026f0", NULL); + + btw("We will only do business when the IMEI is known"); + EXPECT_CONN_COUNT(1); + vsub = vlr_subscr_find_by_imsi(net->vlr, imsi); + OSMO_ASSERT(vsub); + VERBOSE_ASSERT(vsub->imei[0], == 0, "%d"); + vlr_subscr_put(vsub); + EXPECT_ACCEPTED(false); + thwart_rx_non_initial_requests(); + + btw("MS replies with an Identity Response"); + expect_bssap_clear(); + ms_sends_msg("0559084a32244332244302"); + VERBOSE_ASSERT(bssap_clear_sent, == true, "%d"); + + btw("LU was successful, and the conn has already been closed"); + VERBOSE_ASSERT(lu_result_sent, == RES_ACCEPT, "%d"); + EXPECT_CONN_COUNT(0); + + btw("Subscriber has the IMEI"); + vsub = vlr_subscr_find_by_imsi(net->vlr, imsi); + OSMO_ASSERT(vsub); + VERBOSE_ASSERT(strcmp(vsub->imei, "423423423423420"), == 0, "%d"); + vlr_subscr_put(vsub); + + BTW("subscriber detaches"); + expect_bssap_clear(); + ms_sends_msg("050130089910070000006402"); + VERBOSE_ASSERT(bssap_clear_sent, == true, "%d"); + + EXPECT_CONN_COUNT(0); + clear_vlr(); + comment_end(); +} + +void test_no_authen_imeisv_tmsi() +{ + struct vlr_subscr *vsub; + const char *imsi = "901700000004620"; + + rx_from_ran = RAN_GERAN_A; + + comment_start(); + + net->vlr->cfg.retrieve_imeisv_early = true; + net->vlr->cfg.assign_tmsi = true; + + btw("Location Update request causes an IMEISV ID request back to the MS"); + lu_result_sent = RES_NONE; + dtap_expect_tx("051803"); + ms_sends_msg("050802008168000130089910070000006402"); + OSMO_ASSERT(dtap_tx_confirmed); + + btw("MS replies with an Identity Response, causes LU to commence with a GSUP LU request to HLR"); + gsup_expect_tx("04010809710000004026f0"); + ms_sends_msg("0559094332244332244372f5"); + OSMO_ASSERT(gsup_tx_confirmed); + VERBOSE_ASSERT(lu_result_sent, == RES_NONE, "%d"); + + btw("Subscriber has the IMEISV from the ID Response"); + vsub = vlr_subscr_find_by_imsi(net->vlr, imsi); + OSMO_ASSERT(vsub); + VERBOSE_ASSERT(strcmp(vsub->imeisv, "4234234234234275"), == 0, "%d"); + vlr_subscr_put(vsub); + + btw("HLR sends _INSERT_DATA_REQUEST, VLR responds with _INSERT_DATA_RESULT"); + gsup_rx("10010809710000004026f00804036470f1", + "12010809710000004026f0"); + VERBOSE_ASSERT(lu_result_sent, == RES_NONE, "%d"); + + btw("having received subscriber data does not mean acceptance"); + EXPECT_ACCEPTED(false); + thwart_rx_non_initial_requests(); + VERBOSE_ASSERT(lu_result_sent, == RES_NONE, "%d"); + + btw("HLR also sends GSUP _UPDATE_LOCATION_RESULT"); + gsup_rx("06010809710000004026f0", NULL); + + btw("a LU Accept with a new TMSI was sent, waiting for TMSI Realloc Compl"); + EXPECT_CONN_COUNT(1); + VERBOSE_ASSERT(lu_result_sent, == RES_ACCEPT, "%d"); + EXPECT_ACCEPTED(false); + thwart_rx_non_initial_requests(); + + btw("even though the TMSI is not acked, we can already find the subscr with it"); + vsub = vlr_subscr_find_by_tmsi(net->vlr, 0x03020100); + VERBOSE_ASSERT(vsub != NULL, == true, "%d"); + VERBOSE_ASSERT(strcmp(vsub->imsi, imsi), == 0, "%d"); + VERBOSE_ASSERT(vsub->tmsi_new, == 0x03020100, "0x%08x"); + VERBOSE_ASSERT(vsub->tmsi, == GSM_RESERVED_TMSI, "0x%08x"); + vlr_subscr_put(vsub); + + btw("MS sends TMSI Realloc Complete"); + expect_bssap_clear(); + ms_sends_msg("055b"); + VERBOSE_ASSERT(bssap_clear_sent, == true, "%d"); + + btw("LU was successful, and the conn has already been closed"); + EXPECT_CONN_COUNT(0); + + + BTW("subscriber sends LU Request, this time with the TMSI"); + btw("Location Update request causes an IMEISV ID request back to the MS"); + lu_result_sent = RES_NONE; + dtap_expect_tx("051803"); + ms_sends_msg("050802008168000130089910070000006402"); + OSMO_ASSERT(dtap_tx_confirmed); + + btw("MS replies with an Identity Response, causes LU to commence with a GSUP LU request to HLR"); + gsup_expect_tx("04010809710000004026f0"); + ms_sends_msg("0559095332244332244372f6"); + OSMO_ASSERT(gsup_tx_confirmed); + VERBOSE_ASSERT(lu_result_sent, == RES_NONE, "%d"); + + btw("Subscriber has the IMEISV from the ID Response"); + vsub = vlr_subscr_find_by_imsi(net->vlr, imsi); + OSMO_ASSERT(vsub); + VERBOSE_ASSERT(strcmp(vsub->imeisv, "5234234234234276"), == 0, "%d"); + vlr_subscr_put(vsub); + + btw("HLR sends _INSERT_DATA_REQUEST, VLR responds with _INSERT_DATA_RESULT"); + gsup_rx("10010809710000004026f00804036470f1", + "12010809710000004026f0"); + VERBOSE_ASSERT(lu_result_sent, == RES_NONE, "%d"); + + btw("having received subscriber data does not mean acceptance"); + EXPECT_ACCEPTED(false); + thwart_rx_non_initial_requests(); + VERBOSE_ASSERT(lu_result_sent, == RES_NONE, "%d"); + + btw("HLR also sends GSUP _UPDATE_LOCATION_RESULT"); + gsup_rx("06010809710000004026f0", NULL); + + btw("a LU Accept with a new TMSI was sent, waiting for TMSI Realloc Compl"); + EXPECT_CONN_COUNT(1); + VERBOSE_ASSERT(lu_result_sent, == RES_ACCEPT, "%d"); + EXPECT_ACCEPTED(false); + thwart_rx_non_initial_requests(); + + btw("even though the TMSI is not acked, we can already find the subscr with it"); + vsub = vlr_subscr_find_by_tmsi(net->vlr, 0x07060504); + VERBOSE_ASSERT(vsub != NULL, == true, "%d"); + VERBOSE_ASSERT(strcmp(vsub->imsi, imsi), == 0, "%d"); + VERBOSE_ASSERT(vsub->tmsi_new, == 0x07060504, "0x%08x"); + VERBOSE_ASSERT(vsub->tmsi, == 0x03020100, "0x%08x"); + vlr_subscr_put(vsub); + + btw("MS sends TMSI Realloc Complete"); + expect_bssap_clear(); + ms_sends_msg("055b"); + VERBOSE_ASSERT(bssap_clear_sent, == true, "%d"); + + btw("LU was successful, and the conn has already been closed"); + EXPECT_CONN_COUNT(0); + + btw("subscriber has the new TMSI"); + vsub = vlr_subscr_find_by_tmsi(net->vlr, 0x07060504); + VERBOSE_ASSERT(vsub != NULL, == true, "%d"); + VERBOSE_ASSERT(strcmp(vsub->imsi, imsi), == 0, "%d"); + VERBOSE_ASSERT(vsub->tmsi_new, == GSM_RESERVED_TMSI, "0x%08x"); + VERBOSE_ASSERT(vsub->tmsi, == 0x07060504, "0x%08x"); + vlr_subscr_put(vsub); + + BTW("subscriber detaches, using new TMSI"); + expect_bssap_clear(); + ms_sends_msg("050130" "05f4" "07060504"); + VERBOSE_ASSERT(bssap_clear_sent, == true, "%d"); + + EXPECT_CONN_COUNT(0); + clear_vlr(); + comment_end(); +} + +void test_no_authen_imeisv_tmsi_imei() +{ + struct vlr_subscr *vsub; + const char *imsi = "901700000004620"; + + rx_from_ran = RAN_GERAN_A; + + comment_start(); + + net->vlr->cfg.retrieve_imeisv_early = true; + net->vlr->cfg.assign_tmsi = true; + net->vlr->cfg.check_imei_rqd = true; + + btw("Location Update request causes an IMEISV ID request back to the MS"); + lu_result_sent = RES_NONE; + dtap_expect_tx("051803"); + ms_sends_msg("050802008168000130089910070000006402"); + OSMO_ASSERT(dtap_tx_confirmed); + + btw("MS replies with an Identity Response, causes LU to commence with a GSUP LU request to HLR"); + gsup_expect_tx("04010809710000004026f0"); + ms_sends_msg("0559094332244332244372f5"); + OSMO_ASSERT(gsup_tx_confirmed); + VERBOSE_ASSERT(lu_result_sent, == RES_NONE, "%d"); + + btw("Subscriber has the IMEISV from the ID Response"); + vsub = vlr_subscr_find_by_imsi(net->vlr, imsi); + OSMO_ASSERT(vsub); + VERBOSE_ASSERT(strcmp(vsub->imeisv, "4234234234234275"), == 0, "%d"); + vlr_subscr_put(vsub); + + btw("HLR sends _INSERT_DATA_REQUEST, VLR responds with _INSERT_DATA_RESULT"); + gsup_rx("10010809710000004026f00804036470f1", + "12010809710000004026f0"); + VERBOSE_ASSERT(lu_result_sent, == RES_NONE, "%d"); + + btw("having received subscriber data does not mean acceptance"); + EXPECT_ACCEPTED(false); + thwart_rx_non_initial_requests(); + VERBOSE_ASSERT(lu_result_sent, == RES_NONE, "%d"); + + btw("HLR also sends GSUP _UPDATE_LOCATION_RESULT, and we send an ID Request for the IMEI to the MS"); + dtap_expect_tx("051802"); + gsup_rx("06010809710000004026f0", NULL); + + btw("We will only do business when the IMEI is known"); + EXPECT_CONN_COUNT(1); + vsub = vlr_subscr_find_by_imsi(net->vlr, imsi); + OSMO_ASSERT(vsub); + VERBOSE_ASSERT(vsub->imei[0], == 0, "%d"); + vlr_subscr_put(vsub); + EXPECT_ACCEPTED(false); + thwart_rx_non_initial_requests(); + + btw("MS replies with an Identity Response"); + ms_sends_msg("0559084a32244332244302"); + + btw("a LU Accept with a new TMSI was sent, waiting for TMSI Realloc Compl"); + EXPECT_CONN_COUNT(1); + VERBOSE_ASSERT(lu_result_sent, == RES_ACCEPT, "%d"); + EXPECT_ACCEPTED(false); + thwart_rx_non_initial_requests(); + + btw("MS sends TMSI Realloc Complete"); + expect_bssap_clear(); + ms_sends_msg("055b"); + VERBOSE_ASSERT(bssap_clear_sent, == true, "%d"); + + btw("LU was successful, and the conn has already been closed"); + VERBOSE_ASSERT(lu_result_sent, == RES_ACCEPT, "%d"); + EXPECT_CONN_COUNT(0); + + btw("Subscriber has the IMEISV, IMEI and TMSI"); + vsub = vlr_subscr_find_by_imsi(net->vlr, imsi); + OSMO_ASSERT(vsub); + VERBOSE_ASSERT(strcmp(vsub->imeisv, "4234234234234275"), == 0, "%d"); + VERBOSE_ASSERT(strcmp(vsub->imei, "423423423423420"), == 0, "%d"); + VERBOSE_ASSERT(vsub->tmsi, == 0x03020100, "0x%08x"); + vlr_subscr_put(vsub); + + BTW("subscriber detaches"); + expect_bssap_clear(); + ms_sends_msg("050130089910070000006402"); + VERBOSE_ASSERT(bssap_clear_sent, == true, "%d"); + + EXPECT_CONN_COUNT(0); + clear_vlr(); + comment_end(); +} + + msc_vlr_test_func_t msc_vlr_tests[] = { test_no_authen, test_no_authen_tmsi, test_no_authen_imei, test_no_authen_tmsi_imei, + test_no_authen_imeisv, + test_no_authen_imeisv_imei, + test_no_authen_imeisv_tmsi, + test_no_authen_imeisv_tmsi_imei, NULL }; diff --git a/tests/msc_vlr/msc_vlr_test_no_authen.err b/tests/msc_vlr/msc_vlr_test_no_authen.err index 4f40736..931a72f 100644 --- a/tests/msc_vlr/msc_vlr_test_no_authen.err +++ b/tests/msc_vlr/msc_vlr_test_no_authen.err @@ -938,8 +938,8 @@ MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_ID_RESP DREF MSISDN:46071: MSC conn use + 1 == 2 DRLL Dispatching 04.08 message GSM48_MT_MM_ID_RESP (0x5:0x19) -DMM IDENTITY RESPONSE: MI(IMEI)=423423423423423 -DVLR set IMEI on subscriber; IMSI=901700000004620 IMEI=423423423423423 +DMM IDENTITY RESPONSE: MI(IMEI)=423423423423420 +DVLR set IMEI on subscriber; IMSI=901700000004620 IMEI=423423423423420 DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_WAIT_LU_COMPL}: Received Event VLR_ULA_E_ID_IMEI DVLR lu_compl_vlr_fsm(901700000004620){LU_COMPL_VLR_S_WAIT_IMEI}: Received Event LU_COMPL_VLR_E_IMEI_CHECK_ACK - sending LU Accept for MSISDN:46071 @@ -977,7 +977,7 @@ llist_count(&net->subscr_conns) == 0 - Subscriber has the IMEI DREF VLR subscr MSISDN:46071 usage increases to: 2 - strcmp(vsub->imei, "423423423423423") == 0 + strcmp(vsub->imei, "423423423423420") == 0 DREF VLR subscr MSISDN:46071 usage decreases to: 1 --- - subscriber detaches @@ -1110,8 +1110,8 @@ MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_ID_RESP DREF MSISDN:46071: MSC conn use + 1 == 2 DRLL Dispatching 04.08 message GSM48_MT_MM_ID_RESP (0x5:0x19) -DMM IDENTITY RESPONSE: MI(IMEI)=423423423423423 -DVLR set IMEI on subscriber; IMSI=901700000004620 IMEI=423423423423423 +DMM IDENTITY RESPONSE: MI(IMEI)=423423423423420 +DVLR set IMEI on subscriber; IMSI=901700000004620 IMEI=423423423423420 DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_WAIT_LU_COMPL}: Received Event VLR_ULA_E_ID_IMEI DVLR lu_compl_vlr_fsm(901700000004620){LU_COMPL_VLR_S_WAIT_IMEI_TMSI}: Received Event LU_COMPL_VLR_E_IMEI_CHECK_ACK DVLR lu_compl_vlr_fsm(901700000004620){LU_COMPL_VLR_S_WAIT_IMEI_TMSI}: lu_compl_vlr_new_tmsi() @@ -1173,7 +1173,7 @@ llist_count(&net->subscr_conns) == 0 - Subscriber has the IMEI and TMSI DREF VLR subscr MSISDN:46071 usage increases to: 2 - strcmp(vsub->imei, "423423423423423") == 0 + strcmp(vsub->imei, "423423423423420") == 0 vsub->tmsi == 0x03020100 DREF VLR subscr MSISDN:46071 usage decreases to: 1 --- @@ -1199,6 +1199,921 @@ full talloc report on 'msgb' (total 0 bytes in 1 blocks) talloc_total_blocks(tall_bsc_ctx) == 9 +===== test_no_authen_imeisv +- Location Update request causes an IMEISV ID request back to the MS + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_LOC_UPD_REQUEST + new conn +DREF unknown: MSC conn use + 1 == 1 +DRLL Dispatching 04.08 message GSM48_MT_MM_LOC_UPD_REQUEST (0x5:0x8) +DREF unknown: MSC conn use + 1 == 2 +DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Allocated +DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Received Event SUBSCR_CONN_E_START +DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: state_chg to SUBSCR_CONN_S_NEW +DMM LOCATION UPDATING REQUEST: MI(IMSI)=901700000004620 type=IMSI ATTACH +DMM LU/new-LAC: 1/0 +DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_IDLE}: Allocated +DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_IDLE}: is child of Subscr_Conn(901700000004620) +DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_IDLE}: rev=GSM net=GERAN (no Auth) +DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_IDLE}: Received Event VLR_ULA_E_UPDATE_LA +DREF VLR subscr unknown usage increases to: 1 +DVLR set IMSI on subscriber; IMSI=901700000004620 id=901700000004620 +DVLR New subscr, IMSI: 901700000004620 +DREF VLR subscr IMSI:901700000004620 usage increases to: 2 +DREF VLR subscr IMSI:901700000004620 usage decreases to: 1 +DMSC msc_tx 3 bytes to IMSI:901700000004620 via RAN_GERAN_A +- DTAP --RAN_GERAN_A--> MS: GSM48_MT_MM_ID_REQ: 051803 +- DTAP matches expected message +DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_IDLE}: state_chg to VLR_ULA_S_WAIT_IMEISV +DMM IMSI:901700000004620: bump: conn still being established (SUBSCR_CONN_S_NEW) +DREF IMSI:901700000004620: MSC conn use - 1 == 1 +- MS replies with an Identity Response, causes LU to commence with a GSUP LU request to HLR + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_ID_RESP +DREF IMSI:901700000004620: MSC conn use + 1 == 2 +DRLL Dispatching 04.08 message GSM48_MT_MM_ID_RESP (0x5:0x19) +DMM IDENTITY RESPONSE: MI(IMEI-SV)=4234234234234275 +DVLR set IMEISV on subscriber; IMSI=901700000004620 IMEISV=4234234234234275 +DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_WAIT_IMEISV}: Received Event VLR_ULA_E_ID_IMEISV +DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_WAIT_IMEISV}: vlr_loc_upd_node1() +DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_WAIT_IMEISV}: vlr_loc_upd_post_auth() +DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_WAIT_IMEISV}: vlr_loc_upd_post_ciph() +DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_WAIT_IMEISV}: vlr_loc_upd_node_4() +DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_WAIT_IMEISV}: state_chg to VLR_ULA_S_WAIT_HLR_UPD +DVLR upd_hlr_vlr_fsm(901700000004620){UPD_HLR_VLR_S_INIT}: Allocated +DVLR upd_hlr_vlr_fsm(901700000004620){UPD_HLR_VLR_S_INIT}: is child of vlr_lu_fsm(901700000004620) +DVLR upd_hlr_vlr_fsm(901700000004620){UPD_HLR_VLR_S_INIT}: Received Event UPD_HLR_VLR_E_START +DVLR GSUP tx: 04010809710000004026f0 +GSUP --> HLR: OSMO_GSUP_MSGT_UPDATE_LOCATION_REQUEST: 04010809710000004026f0 +DVLR upd_hlr_vlr_fsm(901700000004620){UPD_HLR_VLR_S_INIT}: state_chg to UPD_HLR_VLR_S_WAIT_FOR_DATA +DMM IMSI:901700000004620: bump: conn still being established (SUBSCR_CONN_S_NEW) +DREF IMSI:901700000004620: MSC conn use - 1 == 1 + lu_result_sent == 0 +- Subscriber has the IMEISV from the ID Response +DREF VLR subscr IMSI:901700000004620 usage increases to: 2 + strcmp(vsub->imeisv, "4234234234234275") == 0 +DREF VLR subscr IMSI:901700000004620 usage decreases to: 1 +- HLR sends _INSERT_DATA_REQUEST, VLR responds with _INSERT_DATA_RESULT +<-- GSUP rx OSMO_GSUP_MSGT_INSERT_DATA_REQUEST: 10010809710000004026f00804036470f1 +DVLR GSUP rx 17: 10010809710000004026f00804036470f1 +DREF VLR subscr IMSI:901700000004620 usage increases to: 2 +DVLR IMSI:901700000004620 has MSISDN:46071 +DVLR GSUP tx: 12010809710000004026f0 +GSUP --> HLR: OSMO_GSUP_MSGT_INSERT_DATA_RESULT: 12010809710000004026f0 +DREF VLR subscr MSISDN:46071 usage decreases to: 1 +<-- GSUP rx OSMO_GSUP_MSGT_INSERT_DATA_REQUEST: vlr_gsupc_read_cb() returns 0 + lu_result_sent == 0 +- having received subscriber data does not mean acceptance +msc_subscr_conn_is_accepted() == false + requests shall be thwarted +DRLL Dispatching 04.08 message GSM48_MT_CC_SETUP (0x3:0x5) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_MT_CC_SETUP +DRLL Dispatching 04.08 message unknown 0x33 (0x5:0x33) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: unknown 0x33 +DRLL Dispatching 04.08 message GSM48_MT_RR_SYSINFO_1 (0x6:0x19) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_MT_RR_SYSINFO_1 +DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_PDISC_SMS:0x01 + lu_result_sent == 0 +- HLR also sends GSUP _UPDATE_LOCATION_RESULT +<-- GSUP rx OSMO_GSUP_MSGT_UPDATE_LOCATION_RESULT: 06010809710000004026f0 +DVLR GSUP rx 11: 06010809710000004026f0 +DREF VLR subscr MSISDN:46071 usage increases to: 2 +DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_WAIT_HLR_UPD}: Received Event VLR_ULA_E_HLR_LU_RES +DVLR upd_hlr_vlr_fsm(901700000004620){UPD_HLR_VLR_S_WAIT_FOR_DATA}: Received Event UPD_HLR_VLR_E_UPD_LOC_ACK +DVLR upd_hlr_vlr_fsm(901700000004620){UPD_HLR_VLR_S_WAIT_FOR_DATA}: state_chg to UPD_HLR_VLR_S_DONE +DVLR upd_hlr_vlr_fsm(901700000004620){UPD_HLR_VLR_S_DONE}: Terminating (cause = OSMO_FSM_TERM_REGULAR) +DVLR upd_hlr_vlr_fsm(901700000004620){UPD_HLR_VLR_S_DONE}: Removing from parent vlr_lu_fsm(901700000004620) +DVLR upd_hlr_vlr_fsm(901700000004620){UPD_HLR_VLR_S_DONE}: Freeing instance +DVLR upd_hlr_vlr_fsm(901700000004620){UPD_HLR_VLR_S_DONE}: Deallocated +DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_WAIT_HLR_UPD}: Received Event VLR_ULA_E_UPD_HLR_COMPL +DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_WAIT_HLR_UPD}: state_chg to VLR_ULA_S_WAIT_LU_COMPL +DVLR lu_compl_vlr_fsm(901700000004620){LU_COMPL_VLR_S_INIT}: Allocated +DVLR lu_compl_vlr_fsm(901700000004620){LU_COMPL_VLR_S_INIT}: is child of vlr_lu_fsm(901700000004620) +DVLR lu_compl_vlr_fsm(901700000004620){LU_COMPL_VLR_S_INIT}: Received Event LU_COMPL_VLR_E_START +DVLR lu_compl_vlr_fsm(901700000004620){LU_COMPL_VLR_S_INIT}: state_chg to LU_COMPL_VLR_S_WAIT_SUB_PRES +DVLR sub_pres_vlr_fsm(901700000004620){SUB_PRES_VLR_S_INIT}: Allocated +DVLR sub_pres_vlr_fsm(901700000004620){SUB_PRES_VLR_S_INIT}: is child of lu_compl_vlr_fsm(901700000004620) +DVLR sub_pres_vlr_fsm(901700000004620){SUB_PRES_VLR_S_INIT}: Received Event SUB_PRES_VLR_E_START +DVLR sub_pres_vlr_fsm(901700000004620){SUB_PRES_VLR_S_INIT}: state_chg to SUB_PRES_VLR_S_DONE +DVLR sub_pres_vlr_fsm(901700000004620){SUB_PRES_VLR_S_DONE}: Terminating (cause = OSMO_FSM_TERM_REGULAR) +DVLR sub_pres_vlr_fsm(901700000004620){SUB_PRES_VLR_S_DONE}: Removing from parent lu_compl_vlr_fsm(901700000004620) +DVLR sub_pres_vlr_fsm(901700000004620){SUB_PRES_VLR_S_DONE}: Freeing instance +DVLR sub_pres_vlr_fsm(901700000004620){SUB_PRES_VLR_S_DONE}: Deallocated +DVLR lu_compl_vlr_fsm(901700000004620){LU_COMPL_VLR_S_WAIT_SUB_PRES}: Received Event LU_COMPL_VLR_E_SUB_PRES_COMPL +- sending LU Accept for MSISDN:46071 +DREF VLR subscr MSISDN:46071 usage increases to: 3 +DVLR lu_compl_vlr_fsm(901700000004620){LU_COMPL_VLR_S_WAIT_SUB_PRES}: state_chg to LU_COMPL_VLR_S_DONE +DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_WAIT_LU_COMPL}: Received Event VLR_ULA_E_LU_COMPL_SUCCESS +DVLR lu_compl_vlr_fsm(901700000004620){LU_COMPL_VLR_S_DONE}: Terminating (cause = OSMO_FSM_TERM_PARENT) +DVLR lu_compl_vlr_fsm(901700000004620){LU_COMPL_VLR_S_DONE}: Removing from parent vlr_lu_fsm(901700000004620) +DVLR lu_compl_vlr_fsm(901700000004620){LU_COMPL_VLR_S_DONE}: Freeing instance +DVLR lu_compl_vlr_fsm(901700000004620){LU_COMPL_VLR_S_DONE}: Deallocated +DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_WAIT_LU_COMPL}: state_chg to VLR_ULA_S_DONE +DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_NEW}: Received Event SUBSCR_CONN_E_ACCEPTED +DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_NEW}: SUBSCR_CONN_FROM_LU +DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_NEW}: state_chg to SUBSCR_CONN_S_ACCEPTED +DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_BUMP +DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_ACCEPTED}: bump: releasing conn +DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_ACCEPTED}: state_chg to SUBSCR_CONN_S_RELEASED +DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_RELEASED}: Terminating (cause = OSMO_FSM_TERM_REGULAR) +DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_DONE}: Terminating (cause = OSMO_FSM_TERM_PARENT) +DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_DONE}: Removing from parent Subscr_Conn(901700000004620) +DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_DONE}: fsm_lu_cleanup called with cause OSMO_FSM_TERM_PARENT +DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_DONE}: Freeing instance +DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_DONE}: Deallocated +DMM msc_subscr_conn_close(vsub=MSISDN:46071, cause=2): no conn fsm, releasing directly without release event. +- BSSAP Clear --RAN_GERAN_A--> MS +DREF MSISDN:46071: MSC conn use - 1 == 0 +DRLL subscr MSISDN:46071: Freeing subscriber connection +DREF VLR subscr MSISDN:46071 usage decreases to: 2 +DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_RELEASED}: Freeing instance +DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_RELEASED}: Deallocated +DREF VLR subscr MSISDN:46071 usage decreases to: 1 +<-- GSUP rx OSMO_GSUP_MSGT_UPDATE_LOCATION_RESULT: vlr_gsupc_read_cb() returns 0 +- LU was successful, and the conn has already been closed + lu_result_sent == 1 + bssap_clear_sent == 1 + llist_count(&net->subscr_conns) == 0 +--- +- subscriber detaches + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_IMSI_DETACH_IND + new conn +DREF unknown: MSC conn use + 1 == 1 +DRLL Dispatching 04.08 message GSM48_MT_MM_IMSI_DETACH_IND (0x5:0x1) +DMM IMSI DETACH INDICATION: MI(IMSI)=901700000004620 +DREF VLR subscr MSISDN:46071 usage increases to: 2 +DMM IMSI DETACH for MSISDN:46071 +DREF VLR subscr MSISDN:46071 usage decreases to: 1 +DREF VLR subscr MSISDN:46071 usage decreases to: 0 +DREF freeing VLR subscr MSISDN:46071 +DMM msc_subscr_conn_close(vsub=unknown, cause=0): no conn fsm, releasing directly without release event. +- BSSAP Clear --RAN_GERAN_A--> MS +DREF unknown: MSC conn use - 1 == 0 +DRLL Freeing subscriber connection with NULL subscriber + bssap_clear_sent == 1 + llist_count(&net->subscr_conns) == 0 +===== test_no_authen_imeisv: SUCCESS + +full talloc report on 'msgb' (total 0 bytes in 1 blocks) +talloc_total_blocks(tall_bsc_ctx) == 9 + +===== test_no_authen_imeisv_imei +- Location Update request causes an IMEISV ID request back to the MS + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_LOC_UPD_REQUEST + new conn +DREF unknown: MSC conn use + 1 == 1 +DRLL Dispatching 04.08 message GSM48_MT_MM_LOC_UPD_REQUEST (0x5:0x8) +DREF unknown: MSC conn use + 1 == 2 +DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Allocated +DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Received Event SUBSCR_CONN_E_START +DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: state_chg to SUBSCR_CONN_S_NEW +DMM LOCATION UPDATING REQUEST: MI(IMSI)=901700000004620 type=IMSI ATTACH +DMM LU/new-LAC: 1/0 +DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_IDLE}: Allocated +DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_IDLE}: is child of Subscr_Conn(901700000004620) +DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_IDLE}: rev=GSM net=GERAN (no Auth) +DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_IDLE}: Received Event VLR_ULA_E_UPDATE_LA +DREF VLR subscr unknown usage increases to: 1 +DVLR set IMSI on subscriber; IMSI=901700000004620 id=901700000004620 +DVLR New subscr, IMSI: 901700000004620 +DREF VLR subscr IMSI:901700000004620 usage increases to: 2 +DREF VLR subscr IMSI:901700000004620 usage decreases to: 1 +DMSC msc_tx 3 bytes to IMSI:901700000004620 via RAN_GERAN_A +- DTAP --RAN_GERAN_A--> MS: GSM48_MT_MM_ID_REQ: 051803 +- DTAP matches expected message +DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_IDLE}: state_chg to VLR_ULA_S_WAIT_IMEISV +DMM IMSI:901700000004620: bump: conn still being established (SUBSCR_CONN_S_NEW) +DREF IMSI:901700000004620: MSC conn use - 1 == 1 +- MS replies with an Identity Response, causes LU to commence with a GSUP LU request to HLR + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_ID_RESP +DREF IMSI:901700000004620: MSC conn use + 1 == 2 +DRLL Dispatching 04.08 message GSM48_MT_MM_ID_RESP (0x5:0x19) +DMM IDENTITY RESPONSE: MI(IMEI-SV)=4234234234234275 +DVLR set IMEISV on subscriber; IMSI=901700000004620 IMEISV=4234234234234275 +DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_WAIT_IMEISV}: Received Event VLR_ULA_E_ID_IMEISV +DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_WAIT_IMEISV}: vlr_loc_upd_node1() +DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_WAIT_IMEISV}: vlr_loc_upd_post_auth() +DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_WAIT_IMEISV}: vlr_loc_upd_post_ciph() +DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_WAIT_IMEISV}: vlr_loc_upd_node_4() +DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_WAIT_IMEISV}: state_chg to VLR_ULA_S_WAIT_HLR_UPD +DVLR upd_hlr_vlr_fsm(901700000004620){UPD_HLR_VLR_S_INIT}: Allocated +DVLR upd_hlr_vlr_fsm(901700000004620){UPD_HLR_VLR_S_INIT}: is child of vlr_lu_fsm(901700000004620) +DVLR upd_hlr_vlr_fsm(901700000004620){UPD_HLR_VLR_S_INIT}: Received Event UPD_HLR_VLR_E_START +DVLR GSUP tx: 04010809710000004026f0 +GSUP --> HLR: OSMO_GSUP_MSGT_UPDATE_LOCATION_REQUEST: 04010809710000004026f0 +DVLR upd_hlr_vlr_fsm(901700000004620){UPD_HLR_VLR_S_INIT}: state_chg to UPD_HLR_VLR_S_WAIT_FOR_DATA +DMM IMSI:901700000004620: bump: conn still being established (SUBSCR_CONN_S_NEW) +DREF IMSI:901700000004620: MSC conn use - 1 == 1 + lu_result_sent == 0 +- Subscriber has the IMEISV from the ID Response +DREF VLR subscr IMSI:901700000004620 usage increases to: 2 + strcmp(vsub->imeisv, "4234234234234275") == 0 +DREF VLR subscr IMSI:901700000004620 usage decreases to: 1 +- HLR sends _INSERT_DATA_REQUEST, VLR responds with _INSERT_DATA_RESULT +<-- GSUP rx OSMO_GSUP_MSGT_INSERT_DATA_REQUEST: 10010809710000004026f00804036470f1 +DVLR GSUP rx 17: 10010809710000004026f00804036470f1 +DREF VLR subscr IMSI:901700000004620 usage increases to: 2 +DVLR IMSI:901700000004620 has MSISDN:46071 +DVLR GSUP tx: 12010809710000004026f0 +GSUP --> HLR: OSMO_GSUP_MSGT_INSERT_DATA_RESULT: 12010809710000004026f0 +DREF VLR subscr MSISDN:46071 usage decreases to: 1 +<-- GSUP rx OSMO_GSUP_MSGT_INSERT_DATA_REQUEST: vlr_gsupc_read_cb() returns 0 + lu_result_sent == 0 +- having received subscriber data does not mean acceptance +msc_subscr_conn_is_accepted() == false + requests shall be thwarted +DRLL Dispatching 04.08 message GSM48_MT_CC_SETUP (0x3:0x5) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_MT_CC_SETUP +DRLL Dispatching 04.08 message unknown 0x33 (0x5:0x33) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: unknown 0x33 +DRLL Dispatching 04.08 message GSM48_MT_RR_SYSINFO_1 (0x6:0x19) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_MT_RR_SYSINFO_1 +DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_PDISC_SMS:0x01 + lu_result_sent == 0 +- HLR also sends GSUP _UPDATE_LOCATION_RESULT, and we send an ID Request for the IMEI to the MS +<-- GSUP rx OSMO_GSUP_MSGT_UPDATE_LOCATION_RESULT: 06010809710000004026f0 +DVLR GSUP rx 11: 06010809710000004026f0 +DREF VLR subscr MSISDN:46071 usage increases to: 2 +DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_WAIT_HLR_UPD}: Received Event VLR_ULA_E_HLR_LU_RES +DVLR upd_hlr_vlr_fsm(901700000004620){UPD_HLR_VLR_S_WAIT_FOR_DATA}: Received Event UPD_HLR_VLR_E_UPD_LOC_ACK +DVLR upd_hlr_vlr_fsm(901700000004620){UPD_HLR_VLR_S_WAIT_FOR_DATA}: state_chg to UPD_HLR_VLR_S_DONE +DVLR upd_hlr_vlr_fsm(901700000004620){UPD_HLR_VLR_S_DONE}: Terminating (cause = OSMO_FSM_TERM_REGULAR) +DVLR upd_hlr_vlr_fsm(901700000004620){UPD_HLR_VLR_S_DONE}: Removing from parent vlr_lu_fsm(901700000004620) +DVLR upd_hlr_vlr_fsm(901700000004620){UPD_HLR_VLR_S_DONE}: Freeing instance +DVLR upd_hlr_vlr_fsm(901700000004620){UPD_HLR_VLR_S_DONE}: Deallocated +DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_WAIT_HLR_UPD}: Received Event VLR_ULA_E_UPD_HLR_COMPL +DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_WAIT_HLR_UPD}: state_chg to VLR_ULA_S_WAIT_LU_COMPL +DVLR lu_compl_vlr_fsm(901700000004620){LU_COMPL_VLR_S_INIT}: Allocated +DVLR lu_compl_vlr_fsm(901700000004620){LU_COMPL_VLR_S_INIT}: is child of vlr_lu_fsm(901700000004620) +DVLR lu_compl_vlr_fsm(901700000004620){LU_COMPL_VLR_S_INIT}: Received Event LU_COMPL_VLR_E_START +DVLR lu_compl_vlr_fsm(901700000004620){LU_COMPL_VLR_S_INIT}: state_chg to LU_COMPL_VLR_S_WAIT_SUB_PRES +DVLR sub_pres_vlr_fsm(901700000004620){SUB_PRES_VLR_S_INIT}: Allocated +DVLR sub_pres_vlr_fsm(901700000004620){SUB_PRES_VLR_S_INIT}: is child of lu_compl_vlr_fsm(901700000004620) +DVLR sub_pres_vlr_fsm(901700000004620){SUB_PRES_VLR_S_INIT}: Received Event SUB_PRES_VLR_E_START +DVLR sub_pres_vlr_fsm(901700000004620){SUB_PRES_VLR_S_INIT}: state_chg to SUB_PRES_VLR_S_DONE +DVLR sub_pres_vlr_fsm(901700000004620){SUB_PRES_VLR_S_DONE}: Terminating (cause = OSMO_FSM_TERM_REGULAR) +DVLR sub_pres_vlr_fsm(901700000004620){SUB_PRES_VLR_S_DONE}: Removing from parent lu_compl_vlr_fsm(901700000004620) +DVLR sub_pres_vlr_fsm(901700000004620){SUB_PRES_VLR_S_DONE}: Freeing instance +DVLR sub_pres_vlr_fsm(901700000004620){SUB_PRES_VLR_S_DONE}: Deallocated +DVLR lu_compl_vlr_fsm(901700000004620){LU_COMPL_VLR_S_WAIT_SUB_PRES}: Received Event LU_COMPL_VLR_E_SUB_PRES_COMPL +DVLR lu_compl_vlr_fsm(901700000004620){LU_COMPL_VLR_S_WAIT_SUB_PRES}: state_chg to LU_COMPL_VLR_S_WAIT_IMEI +DMSC msc_tx 3 bytes to MSISDN:46071 via RAN_GERAN_A +- DTAP --RAN_GERAN_A--> MS: GSM48_MT_MM_ID_REQ: 051802 +- DTAP matches expected message +DREF VLR subscr MSISDN:46071 usage decreases to: 1 +<-- GSUP rx OSMO_GSUP_MSGT_UPDATE_LOCATION_RESULT: vlr_gsupc_read_cb() returns 0 +- We will only do business when the IMEI is known + llist_count(&net->subscr_conns) == 1 +DREF VLR subscr MSISDN:46071 usage increases to: 2 + vsub->imei[0] == 0 +DREF VLR subscr MSISDN:46071 usage decreases to: 1 +msc_subscr_conn_is_accepted() == false + requests shall be thwarted +DRLL Dispatching 04.08 message GSM48_MT_CC_SETUP (0x3:0x5) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_MT_CC_SETUP +DRLL Dispatching 04.08 message unknown 0x33 (0x5:0x33) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: unknown 0x33 +DRLL Dispatching 04.08 message GSM48_MT_RR_SYSINFO_1 (0x6:0x19) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_MT_RR_SYSINFO_1 +DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_PDISC_SMS:0x01 +- MS replies with an Identity Response + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_ID_RESP +DREF MSISDN:46071: MSC conn use + 1 == 2 +DRLL Dispatching 04.08 message GSM48_MT_MM_ID_RESP (0x5:0x19) +DMM IDENTITY RESPONSE: MI(IMEI)=423423423423420 +DVLR set IMEI on subscriber; IMSI=901700000004620 IMEI=423423423423420 +DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_WAIT_LU_COMPL}: Received Event VLR_ULA_E_ID_IMEI +DVLR lu_compl_vlr_fsm(901700000004620){LU_COMPL_VLR_S_WAIT_IMEI}: Received Event LU_COMPL_VLR_E_IMEI_CHECK_ACK +- sending LU Accept for MSISDN:46071 +DREF VLR subscr MSISDN:46071 usage increases to: 2 +DVLR lu_compl_vlr_fsm(901700000004620){LU_COMPL_VLR_S_WAIT_IMEI}: state_chg to LU_COMPL_VLR_S_DONE +DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_WAIT_LU_COMPL}: Received Event VLR_ULA_E_LU_COMPL_SUCCESS +DVLR lu_compl_vlr_fsm(901700000004620){LU_COMPL_VLR_S_DONE}: Terminating (cause = OSMO_FSM_TERM_PARENT) +DVLR lu_compl_vlr_fsm(901700000004620){LU_COMPL_VLR_S_DONE}: Removing from parent vlr_lu_fsm(901700000004620) +DVLR lu_compl_vlr_fsm(901700000004620){LU_COMPL_VLR_S_DONE}: Freeing instance +DVLR lu_compl_vlr_fsm(901700000004620){LU_COMPL_VLR_S_DONE}: Deallocated +DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_WAIT_LU_COMPL}: state_chg to VLR_ULA_S_DONE +DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_NEW}: Received Event SUBSCR_CONN_E_ACCEPTED +DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_NEW}: SUBSCR_CONN_FROM_LU +DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_NEW}: state_chg to SUBSCR_CONN_S_ACCEPTED +DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_BUMP +DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_ACCEPTED}: bump: releasing conn +DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_ACCEPTED}: state_chg to SUBSCR_CONN_S_RELEASED +DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_RELEASED}: Terminating (cause = OSMO_FSM_TERM_REGULAR) +DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_DONE}: Terminating (cause = OSMO_FSM_TERM_PARENT) +DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_DONE}: Removing from parent Subscr_Conn(901700000004620) +DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_DONE}: fsm_lu_cleanup called with cause OSMO_FSM_TERM_PARENT +DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_DONE}: Freeing instance +DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_DONE}: Deallocated +DMM msc_subscr_conn_close(vsub=MSISDN:46071, cause=2): no conn fsm, releasing directly without release event. +- BSSAP Clear --RAN_GERAN_A--> MS +DREF MSISDN:46071: MSC conn use - 1 == 1 +DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_RELEASED}: Freeing instance +DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_RELEASED}: Deallocated +DREF MSISDN:46071: MSC conn use - 1 == 0 +DRLL subscr MSISDN:46071: Freeing subscriber connection +DREF VLR subscr MSISDN:46071 usage decreases to: 1 + bssap_clear_sent == 1 +- LU was successful, and the conn has already been closed + lu_result_sent == 1 + llist_count(&net->subscr_conns) == 0 +- Subscriber has the IMEI +DREF VLR subscr MSISDN:46071 usage increases to: 2 + strcmp(vsub->imei, "423423423423420") == 0 +DREF VLR subscr MSISDN:46071 usage decreases to: 1 +--- +- subscriber detaches + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_IMSI_DETACH_IND + new conn +DREF unknown: MSC conn use + 1 == 1 +DRLL Dispatching 04.08 message GSM48_MT_MM_IMSI_DETACH_IND (0x5:0x1) +DMM IMSI DETACH INDICATION: MI(IMSI)=901700000004620 +DREF VLR subscr MSISDN:46071 usage increases to: 2 +DMM IMSI DETACH for MSISDN:46071 +DREF VLR subscr MSISDN:46071 usage decreases to: 1 +DREF VLR subscr MSISDN:46071 usage decreases to: 0 +DREF freeing VLR subscr MSISDN:46071 +DMM msc_subscr_conn_close(vsub=unknown, cause=0): no conn fsm, releasing directly without release event. +- BSSAP Clear --RAN_GERAN_A--> MS +DREF unknown: MSC conn use - 1 == 0 +DRLL Freeing subscriber connection with NULL subscriber + bssap_clear_sent == 1 + llist_count(&net->subscr_conns) == 0 +===== test_no_authen_imeisv_imei: SUCCESS + +full talloc report on 'msgb' (total 0 bytes in 1 blocks) +talloc_total_blocks(tall_bsc_ctx) == 9 + +===== test_no_authen_imeisv_tmsi +- Location Update request causes an IMEISV ID request back to the MS + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_LOC_UPD_REQUEST + new conn +DREF unknown: MSC conn use + 1 == 1 +DRLL Dispatching 04.08 message GSM48_MT_MM_LOC_UPD_REQUEST (0x5:0x8) +DREF unknown: MSC conn use + 1 == 2 +DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Allocated +DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Received Event SUBSCR_CONN_E_START +DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: state_chg to SUBSCR_CONN_S_NEW +DMM LOCATION UPDATING REQUEST: MI(IMSI)=901700000004620 type=IMSI ATTACH +DMM LU/new-LAC: 1/0 +DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_IDLE}: Allocated +DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_IDLE}: is child of Subscr_Conn(901700000004620) +DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_IDLE}: rev=GSM net=GERAN (no Auth) +DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_IDLE}: Received Event VLR_ULA_E_UPDATE_LA +DREF VLR subscr unknown usage increases to: 1 +DVLR set IMSI on subscriber; IMSI=901700000004620 id=901700000004620 +DVLR New subscr, IMSI: 901700000004620 +DREF VLR subscr IMSI:901700000004620 usage increases to: 2 +DREF VLR subscr IMSI:901700000004620 usage decreases to: 1 +DMSC msc_tx 3 bytes to IMSI:901700000004620 via RAN_GERAN_A +- DTAP --RAN_GERAN_A--> MS: GSM48_MT_MM_ID_REQ: 051803 +- DTAP matches expected message +DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_IDLE}: state_chg to VLR_ULA_S_WAIT_IMEISV +DMM IMSI:901700000004620: bump: conn still being established (SUBSCR_CONN_S_NEW) +DREF IMSI:901700000004620: MSC conn use - 1 == 1 +- MS replies with an Identity Response, causes LU to commence with a GSUP LU request to HLR + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_ID_RESP +DREF IMSI:901700000004620: MSC conn use + 1 == 2 +DRLL Dispatching 04.08 message GSM48_MT_MM_ID_RESP (0x5:0x19) +DMM IDENTITY RESPONSE: MI(IMEI-SV)=4234234234234275 +DVLR set IMEISV on subscriber; IMSI=901700000004620 IMEISV=4234234234234275 +DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_WAIT_IMEISV}: Received Event VLR_ULA_E_ID_IMEISV +DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_WAIT_IMEISV}: vlr_loc_upd_node1() +DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_WAIT_IMEISV}: vlr_loc_upd_post_auth() +DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_WAIT_IMEISV}: vlr_loc_upd_post_ciph() +DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_WAIT_IMEISV}: vlr_loc_upd_node_4() +DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_WAIT_IMEISV}: state_chg to VLR_ULA_S_WAIT_HLR_UPD +DVLR upd_hlr_vlr_fsm(901700000004620){UPD_HLR_VLR_S_INIT}: Allocated +DVLR upd_hlr_vlr_fsm(901700000004620){UPD_HLR_VLR_S_INIT}: is child of vlr_lu_fsm(901700000004620) +DVLR upd_hlr_vlr_fsm(901700000004620){UPD_HLR_VLR_S_INIT}: Received Event UPD_HLR_VLR_E_START +DVLR GSUP tx: 04010809710000004026f0 +GSUP --> HLR: OSMO_GSUP_MSGT_UPDATE_LOCATION_REQUEST: 04010809710000004026f0 +DVLR upd_hlr_vlr_fsm(901700000004620){UPD_HLR_VLR_S_INIT}: state_chg to UPD_HLR_VLR_S_WAIT_FOR_DATA +DMM IMSI:901700000004620: bump: conn still being established (SUBSCR_CONN_S_NEW) +DREF IMSI:901700000004620: MSC conn use - 1 == 1 + lu_result_sent == 0 +- Subscriber has the IMEISV from the ID Response +DREF VLR subscr IMSI:901700000004620 usage increases to: 2 + strcmp(vsub->imeisv, "4234234234234275") == 0 +DREF VLR subscr IMSI:901700000004620 usage decreases to: 1 +- HLR sends _INSERT_DATA_REQUEST, VLR responds with _INSERT_DATA_RESULT +<-- GSUP rx OSMO_GSUP_MSGT_INSERT_DATA_REQUEST: 10010809710000004026f00804036470f1 +DVLR GSUP rx 17: 10010809710000004026f00804036470f1 +DREF VLR subscr IMSI:901700000004620 usage increases to: 2 +DVLR IMSI:901700000004620 has MSISDN:46071 +DVLR GSUP tx: 12010809710000004026f0 +GSUP --> HLR: OSMO_GSUP_MSGT_INSERT_DATA_RESULT: 12010809710000004026f0 +DREF VLR subscr MSISDN:46071 usage decreases to: 1 +<-- GSUP rx OSMO_GSUP_MSGT_INSERT_DATA_REQUEST: vlr_gsupc_read_cb() returns 0 + lu_result_sent == 0 +- having received subscriber data does not mean acceptance +msc_subscr_conn_is_accepted() == false + requests shall be thwarted +DRLL Dispatching 04.08 message GSM48_MT_CC_SETUP (0x3:0x5) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_MT_CC_SETUP +DRLL Dispatching 04.08 message unknown 0x33 (0x5:0x33) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: unknown 0x33 +DRLL Dispatching 04.08 message GSM48_MT_RR_SYSINFO_1 (0x6:0x19) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_MT_RR_SYSINFO_1 +DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_PDISC_SMS:0x01 + lu_result_sent == 0 +- HLR also sends GSUP _UPDATE_LOCATION_RESULT +<-- GSUP rx OSMO_GSUP_MSGT_UPDATE_LOCATION_RESULT: 06010809710000004026f0 +DVLR GSUP rx 11: 06010809710000004026f0 +DREF VLR subscr MSISDN:46071 usage increases to: 2 +DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_WAIT_HLR_UPD}: Received Event VLR_ULA_E_HLR_LU_RES +DVLR upd_hlr_vlr_fsm(901700000004620){UPD_HLR_VLR_S_WAIT_FOR_DATA}: Received Event UPD_HLR_VLR_E_UPD_LOC_ACK +DVLR upd_hlr_vlr_fsm(901700000004620){UPD_HLR_VLR_S_WAIT_FOR_DATA}: state_chg to UPD_HLR_VLR_S_DONE +DVLR upd_hlr_vlr_fsm(901700000004620){UPD_HLR_VLR_S_DONE}: Terminating (cause = OSMO_FSM_TERM_REGULAR) +DVLR upd_hlr_vlr_fsm(901700000004620){UPD_HLR_VLR_S_DONE}: Removing from parent vlr_lu_fsm(901700000004620) +DVLR upd_hlr_vlr_fsm(901700000004620){UPD_HLR_VLR_S_DONE}: Freeing instance +DVLR upd_hlr_vlr_fsm(901700000004620){UPD_HLR_VLR_S_DONE}: Deallocated +DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_WAIT_HLR_UPD}: Received Event VLR_ULA_E_UPD_HLR_COMPL +DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_WAIT_HLR_UPD}: state_chg to VLR_ULA_S_WAIT_LU_COMPL +DVLR lu_compl_vlr_fsm(901700000004620){LU_COMPL_VLR_S_INIT}: Allocated +DVLR lu_compl_vlr_fsm(901700000004620){LU_COMPL_VLR_S_INIT}: is child of vlr_lu_fsm(901700000004620) +DVLR lu_compl_vlr_fsm(901700000004620){LU_COMPL_VLR_S_INIT}: Received Event LU_COMPL_VLR_E_START +DVLR lu_compl_vlr_fsm(901700000004620){LU_COMPL_VLR_S_INIT}: state_chg to LU_COMPL_VLR_S_WAIT_SUB_PRES +DVLR sub_pres_vlr_fsm(901700000004620){SUB_PRES_VLR_S_INIT}: Allocated +DVLR sub_pres_vlr_fsm(901700000004620){SUB_PRES_VLR_S_INIT}: is child of lu_compl_vlr_fsm(901700000004620) +DVLR sub_pres_vlr_fsm(901700000004620){SUB_PRES_VLR_S_INIT}: Received Event SUB_PRES_VLR_E_START +DVLR sub_pres_vlr_fsm(901700000004620){SUB_PRES_VLR_S_INIT}: state_chg to SUB_PRES_VLR_S_DONE +DVLR sub_pres_vlr_fsm(901700000004620){SUB_PRES_VLR_S_DONE}: Terminating (cause = OSMO_FSM_TERM_REGULAR) +DVLR sub_pres_vlr_fsm(901700000004620){SUB_PRES_VLR_S_DONE}: Removing from parent lu_compl_vlr_fsm(901700000004620) +DVLR sub_pres_vlr_fsm(901700000004620){SUB_PRES_VLR_S_DONE}: Freeing instance +DVLR sub_pres_vlr_fsm(901700000004620){SUB_PRES_VLR_S_DONE}: Deallocated +DVLR lu_compl_vlr_fsm(901700000004620){LU_COMPL_VLR_S_WAIT_SUB_PRES}: Received Event LU_COMPL_VLR_E_SUB_PRES_COMPL +DVLR lu_compl_vlr_fsm(901700000004620){LU_COMPL_VLR_S_WAIT_SUB_PRES}: lu_compl_vlr_new_tmsi() +DVLR lu_compl_vlr_fsm(901700000004620){LU_COMPL_VLR_S_WAIT_SUB_PRES}: state_chg to LU_COMPL_VLR_S_WAIT_TMSI_CNF +- sending LU Accept for MSISDN:46071, with TMSI 0x03020100 +DREF VLR subscr MSISDN:46071 usage decreases to: 1 +<-- GSUP rx OSMO_GSUP_MSGT_UPDATE_LOCATION_RESULT: vlr_gsupc_read_cb() returns 0 +- a LU Accept with a new TMSI was sent, waiting for TMSI Realloc Compl + llist_count(&net->subscr_conns) == 1 + lu_result_sent == 1 +msc_subscr_conn_is_accepted() == false + requests shall be thwarted +DRLL Dispatching 04.08 message GSM48_MT_CC_SETUP (0x3:0x5) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_MT_CC_SETUP +DRLL Dispatching 04.08 message unknown 0x33 (0x5:0x33) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: unknown 0x33 +DRLL Dispatching 04.08 message GSM48_MT_RR_SYSINFO_1 (0x6:0x19) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_MT_RR_SYSINFO_1 +DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_PDISC_SMS:0x01 +- even though the TMSI is not acked, we can already find the subscr with it +DREF VLR subscr MSISDN:46071 usage increases to: 2 + vsub != NULL == 1 + strcmp(vsub->imsi, imsi) == 0 + vsub->tmsi_new == 0x03020100 + vsub->tmsi == 0xffffffff +DREF VLR subscr MSISDN:46071 usage decreases to: 1 +- MS sends TMSI Realloc Complete + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_TMSI_REALL_COMPL +DREF MSISDN:46071: MSC conn use + 1 == 2 +DRLL Dispatching 04.08 message GSM48_MT_MM_TMSI_REALL_COMPL (0x5:0x1b) +DMM TMSI Reallocation Completed. Subscriber: MSISDN:46071 +DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_WAIT_LU_COMPL}: Received Event VLR_ULA_E_NEW_TMSI_ACK +DVLR lu_compl_vlr_fsm(901700000004620){LU_COMPL_VLR_S_WAIT_TMSI_CNF}: Received Event LU_COMPL_VLR_E_NEW_TMSI_ACK +DREF VLR subscr MSISDN:46071 usage increases to: 2 +DVLR lu_compl_vlr_fsm(901700000004620){LU_COMPL_VLR_S_WAIT_TMSI_CNF}: state_chg to LU_COMPL_VLR_S_DONE +DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_WAIT_LU_COMPL}: Received Event VLR_ULA_E_LU_COMPL_SUCCESS +DVLR lu_compl_vlr_fsm(901700000004620){LU_COMPL_VLR_S_DONE}: Terminating (cause = OSMO_FSM_TERM_PARENT) +DVLR lu_compl_vlr_fsm(901700000004620){LU_COMPL_VLR_S_DONE}: Removing from parent vlr_lu_fsm(901700000004620) +DVLR lu_compl_vlr_fsm(901700000004620){LU_COMPL_VLR_S_DONE}: Freeing instance +DVLR lu_compl_vlr_fsm(901700000004620){LU_COMPL_VLR_S_DONE}: Deallocated +DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_WAIT_LU_COMPL}: state_chg to VLR_ULA_S_DONE +DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_NEW}: Received Event SUBSCR_CONN_E_ACCEPTED +DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_NEW}: SUBSCR_CONN_FROM_LU +DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_NEW}: state_chg to SUBSCR_CONN_S_ACCEPTED +DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_BUMP +DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_ACCEPTED}: bump: releasing conn +DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_ACCEPTED}: state_chg to SUBSCR_CONN_S_RELEASED +DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_RELEASED}: Terminating (cause = OSMO_FSM_TERM_REGULAR) +DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_DONE}: Terminating (cause = OSMO_FSM_TERM_PARENT) +DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_DONE}: Removing from parent Subscr_Conn(901700000004620) +DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_DONE}: fsm_lu_cleanup called with cause OSMO_FSM_TERM_PARENT +DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_DONE}: Freeing instance +DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_DONE}: Deallocated +DMM msc_subscr_conn_close(vsub=MSISDN:46071, cause=2): no conn fsm, releasing directly without release event. +- BSSAP Clear --RAN_GERAN_A--> MS +DREF MSISDN:46071: MSC conn use - 1 == 1 +DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_RELEASED}: Freeing instance +DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_RELEASED}: Deallocated +DREF MSISDN:46071: MSC conn use - 1 == 0 +DRLL subscr MSISDN:46071: Freeing subscriber connection +DREF VLR subscr MSISDN:46071 usage decreases to: 1 + bssap_clear_sent == 1 +- LU was successful, and the conn has already been closed + llist_count(&net->subscr_conns) == 0 +--- +- subscriber sends LU Request, this time with the TMSI +- Location Update request causes an IMEISV ID request back to the MS + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_LOC_UPD_REQUEST + new conn +DREF unknown: MSC conn use + 1 == 1 +DRLL Dispatching 04.08 message GSM48_MT_MM_LOC_UPD_REQUEST (0x5:0x8) +DREF unknown: MSC conn use + 1 == 2 +DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Allocated +DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Received Event SUBSCR_CONN_E_START +DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: state_chg to SUBSCR_CONN_S_NEW +DMM LOCATION UPDATING REQUEST: MI(IMSI)=901700000004620 type=IMSI ATTACH +DMM LU/new-LAC: 1/0 +DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_IDLE}: Allocated +DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_IDLE}: is child of Subscr_Conn(901700000004620) +DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_IDLE}: rev=GSM net=GERAN (no Auth) +DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_IDLE}: Received Event VLR_ULA_E_UPDATE_LA +DREF VLR subscr MSISDN:46071 usage increases to: 2 +DREF VLR subscr MSISDN:46071 usage increases to: 3 +DREF VLR subscr MSISDN:46071 usage decreases to: 2 +DMSC msc_tx 3 bytes to MSISDN:46071 via RAN_GERAN_A +- DTAP --RAN_GERAN_A--> MS: GSM48_MT_MM_ID_REQ: 051803 +- DTAP matches expected message +DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_IDLE}: state_chg to VLR_ULA_S_WAIT_IMEISV +DMM MSISDN:46071: bump: conn still being established (SUBSCR_CONN_S_NEW) +DREF MSISDN:46071: MSC conn use - 1 == 1 +- MS replies with an Identity Response, causes LU to commence with a GSUP LU request to HLR + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_ID_RESP +DREF MSISDN:46071: MSC conn use + 1 == 2 +DRLL Dispatching 04.08 message GSM48_MT_MM_ID_RESP (0x5:0x19) +DMM IDENTITY RESPONSE: MI(IMEI-SV)=5234234234234276 +DVLR set IMEISV on subscriber; IMSI=901700000004620 IMEISV=5234234234234276 +DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_WAIT_IMEISV}: Received Event VLR_ULA_E_ID_IMEISV +DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_WAIT_IMEISV}: vlr_loc_upd_node1() +DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_WAIT_IMEISV}: vlr_loc_upd_post_auth() +DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_WAIT_IMEISV}: vlr_loc_upd_post_ciph() +DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_WAIT_IMEISV}: vlr_loc_upd_node_4() +DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_WAIT_IMEISV}: state_chg to VLR_ULA_S_WAIT_HLR_UPD +DVLR upd_hlr_vlr_fsm(901700000004620){UPD_HLR_VLR_S_INIT}: Allocated +DVLR upd_hlr_vlr_fsm(901700000004620){UPD_HLR_VLR_S_INIT}: is child of vlr_lu_fsm(901700000004620) +DVLR upd_hlr_vlr_fsm(901700000004620){UPD_HLR_VLR_S_INIT}: Received Event UPD_HLR_VLR_E_START +DVLR GSUP tx: 04010809710000004026f0 +GSUP --> HLR: OSMO_GSUP_MSGT_UPDATE_LOCATION_REQUEST: 04010809710000004026f0 +DVLR upd_hlr_vlr_fsm(901700000004620){UPD_HLR_VLR_S_INIT}: state_chg to UPD_HLR_VLR_S_WAIT_FOR_DATA +DMM MSISDN:46071: bump: conn still being established (SUBSCR_CONN_S_NEW) +DREF MSISDN:46071: MSC conn use - 1 == 1 + lu_result_sent == 0 +- Subscriber has the IMEISV from the ID Response +DREF VLR subscr MSISDN:46071 usage increases to: 3 + strcmp(vsub->imeisv, "5234234234234276") == 0 +DREF VLR subscr MSISDN:46071 usage decreases to: 2 +- HLR sends _INSERT_DATA_REQUEST, VLR responds with _INSERT_DATA_RESULT +<-- GSUP rx OSMO_GSUP_MSGT_INSERT_DATA_REQUEST: 10010809710000004026f00804036470f1 +DVLR GSUP rx 17: 10010809710000004026f00804036470f1 +DREF VLR subscr MSISDN:46071 usage increases to: 3 +DVLR IMSI:901700000004620 has MSISDN:46071 +DVLR GSUP tx: 12010809710000004026f0 +GSUP --> HLR: OSMO_GSUP_MSGT_INSERT_DATA_RESULT: 12010809710000004026f0 +DREF VLR subscr MSISDN:46071 usage decreases to: 2 +<-- GSUP rx OSMO_GSUP_MSGT_INSERT_DATA_REQUEST: vlr_gsupc_read_cb() returns 0 + lu_result_sent == 0 +- having received subscriber data does not mean acceptance +msc_subscr_conn_is_accepted() == false + requests shall be thwarted +DRLL Dispatching 04.08 message GSM48_MT_CC_SETUP (0x3:0x5) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_MT_CC_SETUP +DRLL Dispatching 04.08 message unknown 0x33 (0x5:0x33) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: unknown 0x33 +DRLL Dispatching 04.08 message GSM48_MT_RR_SYSINFO_1 (0x6:0x19) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_MT_RR_SYSINFO_1 +DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_PDISC_SMS:0x01 + lu_result_sent == 0 +- HLR also sends GSUP _UPDATE_LOCATION_RESULT +<-- GSUP rx OSMO_GSUP_MSGT_UPDATE_LOCATION_RESULT: 06010809710000004026f0 +DVLR GSUP rx 11: 06010809710000004026f0 +DREF VLR subscr MSISDN:46071 usage increases to: 3 +DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_WAIT_HLR_UPD}: Received Event VLR_ULA_E_HLR_LU_RES +DVLR upd_hlr_vlr_fsm(901700000004620){UPD_HLR_VLR_S_WAIT_FOR_DATA}: Received Event UPD_HLR_VLR_E_UPD_LOC_ACK +DVLR upd_hlr_vlr_fsm(901700000004620){UPD_HLR_VLR_S_WAIT_FOR_DATA}: state_chg to UPD_HLR_VLR_S_DONE +DVLR upd_hlr_vlr_fsm(901700000004620){UPD_HLR_VLR_S_DONE}: Terminating (cause = OSMO_FSM_TERM_REGULAR) +DVLR upd_hlr_vlr_fsm(901700000004620){UPD_HLR_VLR_S_DONE}: Removing from parent vlr_lu_fsm(901700000004620) +DVLR upd_hlr_vlr_fsm(901700000004620){UPD_HLR_VLR_S_DONE}: Freeing instance +DVLR upd_hlr_vlr_fsm(901700000004620){UPD_HLR_VLR_S_DONE}: Deallocated +DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_WAIT_HLR_UPD}: Received Event VLR_ULA_E_UPD_HLR_COMPL +DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_WAIT_HLR_UPD}: state_chg to VLR_ULA_S_WAIT_LU_COMPL +DVLR lu_compl_vlr_fsm(901700000004620){LU_COMPL_VLR_S_INIT}: Allocated +DVLR lu_compl_vlr_fsm(901700000004620){LU_COMPL_VLR_S_INIT}: is child of vlr_lu_fsm(901700000004620) +DVLR lu_compl_vlr_fsm(901700000004620){LU_COMPL_VLR_S_INIT}: Received Event LU_COMPL_VLR_E_START +DVLR lu_compl_vlr_fsm(901700000004620){LU_COMPL_VLR_S_INIT}: state_chg to LU_COMPL_VLR_S_WAIT_SUB_PRES +DVLR sub_pres_vlr_fsm(901700000004620){SUB_PRES_VLR_S_INIT}: Allocated +DVLR sub_pres_vlr_fsm(901700000004620){SUB_PRES_VLR_S_INIT}: is child of lu_compl_vlr_fsm(901700000004620) +DVLR sub_pres_vlr_fsm(901700000004620){SUB_PRES_VLR_S_INIT}: Received Event SUB_PRES_VLR_E_START +DVLR sub_pres_vlr_fsm(901700000004620){SUB_PRES_VLR_S_INIT}: state_chg to SUB_PRES_VLR_S_DONE +DVLR sub_pres_vlr_fsm(901700000004620){SUB_PRES_VLR_S_DONE}: Terminating (cause = OSMO_FSM_TERM_REGULAR) +DVLR sub_pres_vlr_fsm(901700000004620){SUB_PRES_VLR_S_DONE}: Removing from parent lu_compl_vlr_fsm(901700000004620) +DVLR sub_pres_vlr_fsm(901700000004620){SUB_PRES_VLR_S_DONE}: Freeing instance +DVLR sub_pres_vlr_fsm(901700000004620){SUB_PRES_VLR_S_DONE}: Deallocated +DVLR lu_compl_vlr_fsm(901700000004620){LU_COMPL_VLR_S_WAIT_SUB_PRES}: Received Event LU_COMPL_VLR_E_SUB_PRES_COMPL +DVLR lu_compl_vlr_fsm(901700000004620){LU_COMPL_VLR_S_WAIT_SUB_PRES}: lu_compl_vlr_new_tmsi() +DVLR lu_compl_vlr_fsm(901700000004620){LU_COMPL_VLR_S_WAIT_SUB_PRES}: state_chg to LU_COMPL_VLR_S_WAIT_TMSI_CNF +- sending LU Accept for MSISDN:46071, with TMSI 0x07060504 +DREF VLR subscr MSISDN:46071 usage decreases to: 2 +<-- GSUP rx OSMO_GSUP_MSGT_UPDATE_LOCATION_RESULT: vlr_gsupc_read_cb() returns 0 +- a LU Accept with a new TMSI was sent, waiting for TMSI Realloc Compl + llist_count(&net->subscr_conns) == 1 + lu_result_sent == 1 +msc_subscr_conn_is_accepted() == false + requests shall be thwarted +DRLL Dispatching 04.08 message GSM48_MT_CC_SETUP (0x3:0x5) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_MT_CC_SETUP +DRLL Dispatching 04.08 message unknown 0x33 (0x5:0x33) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: unknown 0x33 +DRLL Dispatching 04.08 message GSM48_MT_RR_SYSINFO_1 (0x6:0x19) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_MT_RR_SYSINFO_1 +DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_PDISC_SMS:0x01 +- even though the TMSI is not acked, we can already find the subscr with it +DREF VLR subscr MSISDN:46071 usage increases to: 3 + vsub != NULL == 1 + strcmp(vsub->imsi, imsi) == 0 + vsub->tmsi_new == 0x07060504 + vsub->tmsi == 0x03020100 +DREF VLR subscr MSISDN:46071 usage decreases to: 2 +- MS sends TMSI Realloc Complete + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_TMSI_REALL_COMPL +DREF MSISDN:46071: MSC conn use + 1 == 2 +DRLL Dispatching 04.08 message GSM48_MT_MM_TMSI_REALL_COMPL (0x5:0x1b) +DMM TMSI Reallocation Completed. Subscriber: MSISDN:46071 +DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_WAIT_LU_COMPL}: Received Event VLR_ULA_E_NEW_TMSI_ACK +DVLR lu_compl_vlr_fsm(901700000004620){LU_COMPL_VLR_S_WAIT_TMSI_CNF}: Received Event LU_COMPL_VLR_E_NEW_TMSI_ACK +DVLR lu_compl_vlr_fsm(901700000004620){LU_COMPL_VLR_S_WAIT_TMSI_CNF}: state_chg to LU_COMPL_VLR_S_DONE +DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_WAIT_LU_COMPL}: Received Event VLR_ULA_E_LU_COMPL_SUCCESS +DVLR lu_compl_vlr_fsm(901700000004620){LU_COMPL_VLR_S_DONE}: Terminating (cause = OSMO_FSM_TERM_PARENT) +DVLR lu_compl_vlr_fsm(901700000004620){LU_COMPL_VLR_S_DONE}: Removing from parent vlr_lu_fsm(901700000004620) +DVLR lu_compl_vlr_fsm(901700000004620){LU_COMPL_VLR_S_DONE}: Freeing instance +DVLR lu_compl_vlr_fsm(901700000004620){LU_COMPL_VLR_S_DONE}: Deallocated +DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_WAIT_LU_COMPL}: state_chg to VLR_ULA_S_DONE +DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_NEW}: Received Event SUBSCR_CONN_E_ACCEPTED +DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_NEW}: SUBSCR_CONN_FROM_LU +DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_NEW}: state_chg to SUBSCR_CONN_S_ACCEPTED +DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_BUMP +DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_ACCEPTED}: bump: releasing conn +DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_ACCEPTED}: state_chg to SUBSCR_CONN_S_RELEASED +DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_RELEASED}: Terminating (cause = OSMO_FSM_TERM_REGULAR) +DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_DONE}: Terminating (cause = OSMO_FSM_TERM_PARENT) +DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_DONE}: Removing from parent Subscr_Conn(901700000004620) +DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_DONE}: fsm_lu_cleanup called with cause OSMO_FSM_TERM_PARENT +DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_DONE}: Freeing instance +DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_DONE}: Deallocated +DMM msc_subscr_conn_close(vsub=MSISDN:46071, cause=2): no conn fsm, releasing directly without release event. +- BSSAP Clear --RAN_GERAN_A--> MS +DREF MSISDN:46071: MSC conn use - 1 == 1 +DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_RELEASED}: Freeing instance +DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_RELEASED}: Deallocated +DREF MSISDN:46071: MSC conn use - 1 == 0 +DRLL subscr MSISDN:46071: Freeing subscriber connection +DREF VLR subscr MSISDN:46071 usage decreases to: 1 + bssap_clear_sent == 1 +- LU was successful, and the conn has already been closed + llist_count(&net->subscr_conns) == 0 +- subscriber has the new TMSI +DREF VLR subscr MSISDN:46071 usage increases to: 2 + vsub != NULL == 1 + strcmp(vsub->imsi, imsi) == 0 + vsub->tmsi_new == 0xffffffff + vsub->tmsi == 0x07060504 +DREF VLR subscr MSISDN:46071 usage decreases to: 1 +--- +- subscriber detaches, using new TMSI + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_IMSI_DETACH_IND + new conn +DREF unknown: MSC conn use + 1 == 1 +DRLL Dispatching 04.08 message GSM48_MT_MM_IMSI_DETACH_IND (0x5:0x1) +DMM IMSI DETACH INDICATION: MI(TMSI)=117835012 +DREF VLR subscr MSISDN:46071 usage increases to: 2 +DMM IMSI DETACH for MSISDN:46071 +DREF VLR subscr MSISDN:46071 usage decreases to: 1 +DREF VLR subscr MSISDN:46071 usage decreases to: 0 +DREF freeing VLR subscr MSISDN:46071 +DMM msc_subscr_conn_close(vsub=unknown, cause=0): no conn fsm, releasing directly without release event. +- BSSAP Clear --RAN_GERAN_A--> MS +DREF unknown: MSC conn use - 1 == 0 +DRLL Freeing subscriber connection with NULL subscriber + bssap_clear_sent == 1 + llist_count(&net->subscr_conns) == 0 +===== test_no_authen_imeisv_tmsi: SUCCESS + +full talloc report on 'msgb' (total 0 bytes in 1 blocks) +talloc_total_blocks(tall_bsc_ctx) == 9 + +===== test_no_authen_imeisv_tmsi_imei +- Location Update request causes an IMEISV ID request back to the MS + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_LOC_UPD_REQUEST + new conn +DREF unknown: MSC conn use + 1 == 1 +DRLL Dispatching 04.08 message GSM48_MT_MM_LOC_UPD_REQUEST (0x5:0x8) +DREF unknown: MSC conn use + 1 == 2 +DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Allocated +DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: Received Event SUBSCR_CONN_E_START +DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_INIT}: state_chg to SUBSCR_CONN_S_NEW +DMM LOCATION UPDATING REQUEST: MI(IMSI)=901700000004620 type=IMSI ATTACH +DMM LU/new-LAC: 1/0 +DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_IDLE}: Allocated +DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_IDLE}: is child of Subscr_Conn(901700000004620) +DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_IDLE}: rev=GSM net=GERAN (no Auth) +DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_IDLE}: Received Event VLR_ULA_E_UPDATE_LA +DREF VLR subscr unknown usage increases to: 1 +DVLR set IMSI on subscriber; IMSI=901700000004620 id=901700000004620 +DVLR New subscr, IMSI: 901700000004620 +DREF VLR subscr IMSI:901700000004620 usage increases to: 2 +DREF VLR subscr IMSI:901700000004620 usage decreases to: 1 +DMSC msc_tx 3 bytes to IMSI:901700000004620 via RAN_GERAN_A +- DTAP --RAN_GERAN_A--> MS: GSM48_MT_MM_ID_REQ: 051803 +- DTAP matches expected message +DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_IDLE}: state_chg to VLR_ULA_S_WAIT_IMEISV +DMM IMSI:901700000004620: bump: conn still being established (SUBSCR_CONN_S_NEW) +DREF IMSI:901700000004620: MSC conn use - 1 == 1 +- MS replies with an Identity Response, causes LU to commence with a GSUP LU request to HLR + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_ID_RESP +DREF IMSI:901700000004620: MSC conn use + 1 == 2 +DRLL Dispatching 04.08 message GSM48_MT_MM_ID_RESP (0x5:0x19) +DMM IDENTITY RESPONSE: MI(IMEI-SV)=4234234234234275 +DVLR set IMEISV on subscriber; IMSI=901700000004620 IMEISV=4234234234234275 +DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_WAIT_IMEISV}: Received Event VLR_ULA_E_ID_IMEISV +DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_WAIT_IMEISV}: vlr_loc_upd_node1() +DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_WAIT_IMEISV}: vlr_loc_upd_post_auth() +DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_WAIT_IMEISV}: vlr_loc_upd_post_ciph() +DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_WAIT_IMEISV}: vlr_loc_upd_node_4() +DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_WAIT_IMEISV}: state_chg to VLR_ULA_S_WAIT_HLR_UPD +DVLR upd_hlr_vlr_fsm(901700000004620){UPD_HLR_VLR_S_INIT}: Allocated +DVLR upd_hlr_vlr_fsm(901700000004620){UPD_HLR_VLR_S_INIT}: is child of vlr_lu_fsm(901700000004620) +DVLR upd_hlr_vlr_fsm(901700000004620){UPD_HLR_VLR_S_INIT}: Received Event UPD_HLR_VLR_E_START +DVLR GSUP tx: 04010809710000004026f0 +GSUP --> HLR: OSMO_GSUP_MSGT_UPDATE_LOCATION_REQUEST: 04010809710000004026f0 +DVLR upd_hlr_vlr_fsm(901700000004620){UPD_HLR_VLR_S_INIT}: state_chg to UPD_HLR_VLR_S_WAIT_FOR_DATA +DMM IMSI:901700000004620: bump: conn still being established (SUBSCR_CONN_S_NEW) +DREF IMSI:901700000004620: MSC conn use - 1 == 1 + lu_result_sent == 0 +- Subscriber has the IMEISV from the ID Response +DREF VLR subscr IMSI:901700000004620 usage increases to: 2 + strcmp(vsub->imeisv, "4234234234234275") == 0 +DREF VLR subscr IMSI:901700000004620 usage decreases to: 1 +- HLR sends _INSERT_DATA_REQUEST, VLR responds with _INSERT_DATA_RESULT +<-- GSUP rx OSMO_GSUP_MSGT_INSERT_DATA_REQUEST: 10010809710000004026f00804036470f1 +DVLR GSUP rx 17: 10010809710000004026f00804036470f1 +DREF VLR subscr IMSI:901700000004620 usage increases to: 2 +DVLR IMSI:901700000004620 has MSISDN:46071 +DVLR GSUP tx: 12010809710000004026f0 +GSUP --> HLR: OSMO_GSUP_MSGT_INSERT_DATA_RESULT: 12010809710000004026f0 +DREF VLR subscr MSISDN:46071 usage decreases to: 1 +<-- GSUP rx OSMO_GSUP_MSGT_INSERT_DATA_REQUEST: vlr_gsupc_read_cb() returns 0 + lu_result_sent == 0 +- having received subscriber data does not mean acceptance +msc_subscr_conn_is_accepted() == false + requests shall be thwarted +DRLL Dispatching 04.08 message GSM48_MT_CC_SETUP (0x3:0x5) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_MT_CC_SETUP +DRLL Dispatching 04.08 message unknown 0x33 (0x5:0x33) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: unknown 0x33 +DRLL Dispatching 04.08 message GSM48_MT_RR_SYSINFO_1 (0x6:0x19) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_MT_RR_SYSINFO_1 +DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_PDISC_SMS:0x01 + lu_result_sent == 0 +- HLR also sends GSUP _UPDATE_LOCATION_RESULT, and we send an ID Request for the IMEI to the MS +<-- GSUP rx OSMO_GSUP_MSGT_UPDATE_LOCATION_RESULT: 06010809710000004026f0 +DVLR GSUP rx 11: 06010809710000004026f0 +DREF VLR subscr MSISDN:46071 usage increases to: 2 +DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_WAIT_HLR_UPD}: Received Event VLR_ULA_E_HLR_LU_RES +DVLR upd_hlr_vlr_fsm(901700000004620){UPD_HLR_VLR_S_WAIT_FOR_DATA}: Received Event UPD_HLR_VLR_E_UPD_LOC_ACK +DVLR upd_hlr_vlr_fsm(901700000004620){UPD_HLR_VLR_S_WAIT_FOR_DATA}: state_chg to UPD_HLR_VLR_S_DONE +DVLR upd_hlr_vlr_fsm(901700000004620){UPD_HLR_VLR_S_DONE}: Terminating (cause = OSMO_FSM_TERM_REGULAR) +DVLR upd_hlr_vlr_fsm(901700000004620){UPD_HLR_VLR_S_DONE}: Removing from parent vlr_lu_fsm(901700000004620) +DVLR upd_hlr_vlr_fsm(901700000004620){UPD_HLR_VLR_S_DONE}: Freeing instance +DVLR upd_hlr_vlr_fsm(901700000004620){UPD_HLR_VLR_S_DONE}: Deallocated +DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_WAIT_HLR_UPD}: Received Event VLR_ULA_E_UPD_HLR_COMPL +DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_WAIT_HLR_UPD}: state_chg to VLR_ULA_S_WAIT_LU_COMPL +DVLR lu_compl_vlr_fsm(901700000004620){LU_COMPL_VLR_S_INIT}: Allocated +DVLR lu_compl_vlr_fsm(901700000004620){LU_COMPL_VLR_S_INIT}: is child of vlr_lu_fsm(901700000004620) +DVLR lu_compl_vlr_fsm(901700000004620){LU_COMPL_VLR_S_INIT}: Received Event LU_COMPL_VLR_E_START +DVLR lu_compl_vlr_fsm(901700000004620){LU_COMPL_VLR_S_INIT}: state_chg to LU_COMPL_VLR_S_WAIT_SUB_PRES +DVLR sub_pres_vlr_fsm(901700000004620){SUB_PRES_VLR_S_INIT}: Allocated +DVLR sub_pres_vlr_fsm(901700000004620){SUB_PRES_VLR_S_INIT}: is child of lu_compl_vlr_fsm(901700000004620) +DVLR sub_pres_vlr_fsm(901700000004620){SUB_PRES_VLR_S_INIT}: Received Event SUB_PRES_VLR_E_START +DVLR sub_pres_vlr_fsm(901700000004620){SUB_PRES_VLR_S_INIT}: state_chg to SUB_PRES_VLR_S_DONE +DVLR sub_pres_vlr_fsm(901700000004620){SUB_PRES_VLR_S_DONE}: Terminating (cause = OSMO_FSM_TERM_REGULAR) +DVLR sub_pres_vlr_fsm(901700000004620){SUB_PRES_VLR_S_DONE}: Removing from parent lu_compl_vlr_fsm(901700000004620) +DVLR sub_pres_vlr_fsm(901700000004620){SUB_PRES_VLR_S_DONE}: Freeing instance +DVLR sub_pres_vlr_fsm(901700000004620){SUB_PRES_VLR_S_DONE}: Deallocated +DVLR lu_compl_vlr_fsm(901700000004620){LU_COMPL_VLR_S_WAIT_SUB_PRES}: Received Event LU_COMPL_VLR_E_SUB_PRES_COMPL +DVLR lu_compl_vlr_fsm(901700000004620){LU_COMPL_VLR_S_WAIT_SUB_PRES}: state_chg to LU_COMPL_VLR_S_WAIT_IMEI_TMSI +DMSC msc_tx 3 bytes to MSISDN:46071 via RAN_GERAN_A +- DTAP --RAN_GERAN_A--> MS: GSM48_MT_MM_ID_REQ: 051802 +- DTAP matches expected message +DREF VLR subscr MSISDN:46071 usage decreases to: 1 +<-- GSUP rx OSMO_GSUP_MSGT_UPDATE_LOCATION_RESULT: vlr_gsupc_read_cb() returns 0 +- We will only do business when the IMEI is known + llist_count(&net->subscr_conns) == 1 +DREF VLR subscr MSISDN:46071 usage increases to: 2 + vsub->imei[0] == 0 +DREF VLR subscr MSISDN:46071 usage decreases to: 1 +msc_subscr_conn_is_accepted() == false + requests shall be thwarted +DRLL Dispatching 04.08 message GSM48_MT_CC_SETUP (0x3:0x5) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_MT_CC_SETUP +DRLL Dispatching 04.08 message unknown 0x33 (0x5:0x33) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: unknown 0x33 +DRLL Dispatching 04.08 message GSM48_MT_RR_SYSINFO_1 (0x6:0x19) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_MT_RR_SYSINFO_1 +DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_PDISC_SMS:0x01 +- MS replies with an Identity Response + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_ID_RESP +DREF MSISDN:46071: MSC conn use + 1 == 2 +DRLL Dispatching 04.08 message GSM48_MT_MM_ID_RESP (0x5:0x19) +DMM IDENTITY RESPONSE: MI(IMEI)=423423423423420 +DVLR set IMEI on subscriber; IMSI=901700000004620 IMEI=423423423423420 +DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_WAIT_LU_COMPL}: Received Event VLR_ULA_E_ID_IMEI +DVLR lu_compl_vlr_fsm(901700000004620){LU_COMPL_VLR_S_WAIT_IMEI_TMSI}: Received Event LU_COMPL_VLR_E_IMEI_CHECK_ACK +DVLR lu_compl_vlr_fsm(901700000004620){LU_COMPL_VLR_S_WAIT_IMEI_TMSI}: lu_compl_vlr_new_tmsi() +DVLR lu_compl_vlr_fsm(901700000004620){LU_COMPL_VLR_S_WAIT_IMEI_TMSI}: state_chg to LU_COMPL_VLR_S_WAIT_TMSI_CNF +- sending LU Accept for MSISDN:46071, with TMSI 0x03020100 +DMM MSISDN:46071: bump: conn still being established (SUBSCR_CONN_S_NEW) +DREF MSISDN:46071: MSC conn use - 1 == 1 +- a LU Accept with a new TMSI was sent, waiting for TMSI Realloc Compl + llist_count(&net->subscr_conns) == 1 + lu_result_sent == 1 +msc_subscr_conn_is_accepted() == false + requests shall be thwarted +DRLL Dispatching 04.08 message GSM48_MT_CC_SETUP (0x3:0x5) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_MT_CC_SETUP +DRLL Dispatching 04.08 message unknown 0x33 (0x5:0x33) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: unknown 0x33 +DRLL Dispatching 04.08 message GSM48_MT_RR_SYSINFO_1 (0x6:0x19) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_MT_RR_SYSINFO_1 +DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_PDISC_SMS:0x01 +- MS sends TMSI Realloc Complete + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_TMSI_REALL_COMPL +DREF MSISDN:46071: MSC conn use + 1 == 2 +DRLL Dispatching 04.08 message GSM48_MT_MM_TMSI_REALL_COMPL (0x5:0x1b) +DMM TMSI Reallocation Completed. Subscriber: MSISDN:46071 +DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_WAIT_LU_COMPL}: Received Event VLR_ULA_E_NEW_TMSI_ACK +DVLR lu_compl_vlr_fsm(901700000004620){LU_COMPL_VLR_S_WAIT_TMSI_CNF}: Received Event LU_COMPL_VLR_E_NEW_TMSI_ACK +DREF VLR subscr MSISDN:46071 usage increases to: 2 +DVLR lu_compl_vlr_fsm(901700000004620){LU_COMPL_VLR_S_WAIT_TMSI_CNF}: state_chg to LU_COMPL_VLR_S_DONE +DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_WAIT_LU_COMPL}: Received Event VLR_ULA_E_LU_COMPL_SUCCESS +DVLR lu_compl_vlr_fsm(901700000004620){LU_COMPL_VLR_S_DONE}: Terminating (cause = OSMO_FSM_TERM_PARENT) +DVLR lu_compl_vlr_fsm(901700000004620){LU_COMPL_VLR_S_DONE}: Removing from parent vlr_lu_fsm(901700000004620) +DVLR lu_compl_vlr_fsm(901700000004620){LU_COMPL_VLR_S_DONE}: Freeing instance +DVLR lu_compl_vlr_fsm(901700000004620){LU_COMPL_VLR_S_DONE}: Deallocated +DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_WAIT_LU_COMPL}: state_chg to VLR_ULA_S_DONE +DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_NEW}: Received Event SUBSCR_CONN_E_ACCEPTED +DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_NEW}: SUBSCR_CONN_FROM_LU +DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_NEW}: state_chg to SUBSCR_CONN_S_ACCEPTED +DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_BUMP +DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_ACCEPTED}: bump: releasing conn +DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_ACCEPTED}: state_chg to SUBSCR_CONN_S_RELEASED +DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_RELEASED}: Terminating (cause = OSMO_FSM_TERM_REGULAR) +DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_DONE}: Terminating (cause = OSMO_FSM_TERM_PARENT) +DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_DONE}: Removing from parent Subscr_Conn(901700000004620) +DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_DONE}: fsm_lu_cleanup called with cause OSMO_FSM_TERM_PARENT +DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_DONE}: Freeing instance +DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_DONE}: Deallocated +DMM msc_subscr_conn_close(vsub=MSISDN:46071, cause=2): no conn fsm, releasing directly without release event. +- BSSAP Clear --RAN_GERAN_A--> MS +DREF MSISDN:46071: MSC conn use - 1 == 1 +DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_RELEASED}: Freeing instance +DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_RELEASED}: Deallocated +DREF MSISDN:46071: MSC conn use - 1 == 0 +DRLL subscr MSISDN:46071: Freeing subscriber connection +DREF VLR subscr MSISDN:46071 usage decreases to: 1 + bssap_clear_sent == 1 +- LU was successful, and the conn has already been closed + lu_result_sent == 1 + llist_count(&net->subscr_conns) == 0 +- Subscriber has the IMEISV, IMEI and TMSI +DREF VLR subscr MSISDN:46071 usage increases to: 2 + strcmp(vsub->imeisv, "4234234234234275") == 0 + strcmp(vsub->imei, "423423423423420") == 0 + vsub->tmsi == 0x03020100 +DREF VLR subscr MSISDN:46071 usage decreases to: 1 +--- +- subscriber detaches + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_IMSI_DETACH_IND + new conn +DREF unknown: MSC conn use + 1 == 1 +DRLL Dispatching 04.08 message GSM48_MT_MM_IMSI_DETACH_IND (0x5:0x1) +DMM IMSI DETACH INDICATION: MI(IMSI)=901700000004620 +DREF VLR subscr MSISDN:46071 usage increases to: 2 +DMM IMSI DETACH for MSISDN:46071 +DREF VLR subscr MSISDN:46071 usage decreases to: 1 +DREF VLR subscr MSISDN:46071 usage decreases to: 0 +DREF freeing VLR subscr MSISDN:46071 +DMM msc_subscr_conn_close(vsub=unknown, cause=0): no conn fsm, releasing directly without release event. +- BSSAP Clear --RAN_GERAN_A--> MS +DREF unknown: MSC conn use - 1 == 0 +DRLL Freeing subscriber connection with NULL subscriber + bssap_clear_sent == 1 + llist_count(&net->subscr_conns) == 0 +===== test_no_authen_imeisv_tmsi_imei: SUCCESS + +full talloc report on 'msgb' (total 0 bytes in 1 blocks) +talloc_total_blocks(tall_bsc_ctx) == 9 + full talloc report on 'msgb' (total 0 bytes in 1 blocks) talloc_total_blocks(tall_bsc_ctx) == 9 -- To view, visit https://gerrit.osmocom.org/3494 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I752afef2ae3ce04e813c7e9fea0e883e607c0e14 Gerrit-PatchSet: 9 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Tue Aug 29 12:51:22 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 29 Aug 2017 12:51:22 +0000 Subject: [MERGED] osmo-msc[master]: gsup client: move not-connected to error loglevel In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: gsup client: move not-connected to error loglevel ...................................................................... gsup client: move not-connected to error loglevel Change-Id: I8290963aedb7237da89c9ff98adf4cd33beb5031 --- M src/libcommon/gsup_client.c 1 file changed, 2 insertions(+), 10 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/libcommon/gsup_client.c b/src/libcommon/gsup_client.c index 258f230..fd65e7b 100644 --- a/src/libcommon/gsup_client.c +++ b/src/libcommon/gsup_client.c @@ -330,18 +330,10 @@ int gsup_client_send(struct gsup_client *gsupc, struct msgb *msg) { - if (!gsupc) { - LOGP(DGPRS, LOGL_NOTICE, "No GSUP client, unable to " - "send %s\n", msgb_hexdump(msg)); + if (!gsupc || !gsupc->is_connected) { + LOGP(DGPRS, LOGL_ERROR, "GSUP not connected, unable to send %s\n", msgb_hexdump(msg)); msgb_free(msg); return -ENOTCONN; - } - - if (!gsupc->is_connected) { - LOGP(DGPRS, LOGL_NOTICE, "GSUP not connected, unable to " - "send %s\n", msgb_hexdump(msg)); - msgb_free(msg); - return -EAGAIN; } client_send(gsupc, IPAC_PROTO_EXT_GSUP, msg); -- To view, visit https://gerrit.osmocom.org/3493 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I8290963aedb7237da89c9ff98adf4cd33beb5031 Gerrit-PatchSet: 9 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Tue Aug 29 12:51:23 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 29 Aug 2017 12:51:23 +0000 Subject: [MERGED] osmo-msc[master]: rework debian packages support In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: rework debian packages support ...................................................................... rework debian packages support Remove old leftover from split of osmo-mgw out of openbsc. Change-Id: I77544cb38c31777c3fab52979d19488a63e52de3 --- D debian/autoreconf M debian/changelog M debian/control M debian/copyright D debian/docs D debian/openbsc-dev.install A debian/osmo-msc.install D debian/osmocom-nitb.default D debian/osmocom-nitb.dirs D debian/osmocom-nitb.examples D debian/osmocom-nitb.init D debian/osmocom-nitb.install M debian/rules 13 files changed, 240 insertions(+), 557 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/debian/autoreconf b/debian/autoreconf deleted file mode 100644 index 9a3a67f..0000000 --- a/debian/autoreconf +++ /dev/null @@ -1 +0,0 @@ -openbsc diff --git a/debian/changelog b/debian/changelog index e9a4212..a1b3dda 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,75 +1,5 @@ -openbsc (0.15.1) UNRELEASED; urgency=medium +osmo-msc (0.1.0) UNRELEASED; urgency=low - * Move forward toward a new release. - * Prevent SGSN starting with 'auth-policy remote' when no 'gsup remote-*' are configured. - Note: such configs are broken without extra workarounds anyway. + * Initial release. - -- Holger Hans Peter Freyther Tue, 24 May 2016 23:14:31 +0200 - -openbsc (0.14.0) unstable; urgency=low - - * New upstream tag and additional patches. - - -- Holger Hans Peter Freyther Sat, 14 Mar 2015 20:33:25 +0100 - -openbsc (0.12.0+git26-7) unstable; urgency=low - - * 64bit fix for the MGCP rewriting - - -- Holger Hans Peter Freyther Wed, 07 Nov 2012 11:39:34 +0100 - -openbsc (0.12.0+git26-6) precise; urgency=low - - * Added init script for osmocom-sgsn. - - -- Eric Butler Fri, 24 Aug 2012 21:04:32 -0700 - -openbsc (0.12.0+git26-5) precise; urgency=low - - * Don't enable MNCC sock by default. - * Automatically create important directories. - * Fix init script 'stop' command. - - -- Eric Butler Fri, 24 Aug 2012 20:56:33 -0700 - -openbsc (0.12.0+git26-4) precise; urgency=low - - * Specify HLR path and enable RTP proxy. - - -- Eric Butler Mon, 20 Aug 2012 00:21:07 -0700 - -openbsc (0.12.0+git26-3) precise; urgency=low - - * Fix init script. - - -- Eric Butler Sun, 19 Aug 2012 16:05:44 -0700 - -openbsc (0.12.0+git26-2) precise; urgency=low - - * Fix libdbi package dependency. - - -- Eric Butler Wed, 15 Aug 2012 00:35:37 -0700 - -openbsc (0.12.0+git26-1) precise; urgency=low - - * Fix version issue. - - -- Eric Butler Tue, 14 Aug 2012 21:00:51 -0700 - -openbsc (0.12.0+git26) precise; urgency=low - - * Updated ubuntu package. - - -- Eric Butler Tue, 14 Aug 2012 17:36:51 -0700 - -openbsc (0.9.13.115.eb113-1) natty; urgency=low - - * New upstream release - - -- Harald Welte Wed, 11 May 2011 18:41:24 +0000 - -openbsc (0.9.4-1) unstable; urgency=low - - * Initial release - - -- Harald Welte Tue, 24 Aug 2010 13:34:24 +0200 + -- Alexander Couzens Tue, 08 Aug 2017 01:13:01 +0000 diff --git a/debian/control b/debian/control index 87b6f07..907ec38 100644 --- a/debian/control +++ b/debian/control @@ -1,181 +1,41 @@ -Source: openbsc -Maintainer: Harald Welte +Source: osmo-msc Section: net -Priority: optional -Build-Depends: debhelper (>= 9), - autotools-dev, - autoconf-archive, - pkg-config, - libgtp-dev, - libosmocore-dev, - libosmo-sccp-dev, - libdbi0-dev, +Priority: extra +Maintainer: Alexander Couzens +Build-Depends: debhelper (>=9), dh-autoreconf, - libosmo-abis-dev, - libosmo-netif-dev, - libdbd-sqlite3, - libpcap-dev, + autotools-dev, + autoconf, + automake, + libtool, + pkg-config, + libdbi-dev, + libtalloc-dev, libssl-dev, libc-ares-dev, - libsmpp34-dev + libgtp-dev, + libasn1c-dev, + libc-ares-dev, + libosmocore-dev, + libosmo-sccp-dev, + libosmo-abis-dev, + libosmo-legacy-mgcp-dev, + libosmo-netif-dev, + libosmo-ranap-dev Standards-Version: 3.9.8 -Vcs-Git: git://bs11-abis.gnumonks.org/openbsc.git -Vcs-Browser: http://openbsc.osmocom.org/trac/browser -Homepage: https://projects.osmocom.org/projects/openbsc +Vcs-Git: git://git.osmocom.org/osmo-bsc.git +Vcs-Browser: https://git.osmocom.org/osmo-bsc/ +Homepage: https://projects.osmocom.org/projects/osmo-bsc -Package: osmocom-bsc +Package: osmo-msc Architecture: any -Depends: ${shlibs:Depends}, - ${misc:Depends} -Description: GSM Base Station Controller - This is the BSC-only version of OpenBSC. It requires a Mobile Switching Center - (MSC) to operate. - . - You might rather prefer to use osmocom-nitb which is considered a - "GSM Network-in-a-Box" and does not depend on a MSC. +Multi-Arch: foreign +Depends: ${misc:Depends}, ${shlibs:Depends} +Description: OsmoMSC: Osmocom's Mobile Switching Center for 2G and 3G circuit-switched mobile networks -Package: osmocom-nitb -Architecture: any -Depends: ${shlibs:Depends}, - ${misc:Depends}, - libdbd-sqlite3 -Description: GSM Network-in-a-Box, implements BSC, MSC, SMSC, HLR, VLR - This is the Network-in-a-Box version of OpenBSC. It has all the GSM network - components bundled together. When using osmocom-nitb, there is no need for a - Mobile Switching Center (MSC) which is needed when using osmocom-bsc. - -Package: osmocom-ipaccess-utils -Architecture: any -Depends: ${shlibs:Depends}, - ${misc:Depends} -Description: Command line utilities for ip.access nanoBTS - This package contains utilities that are specific for nanoBTS when being used - together with OpenBSC. It contains mainly three tools: ipaccess-find, - ipaccess-config and ipaccess-proxy. - -Package: osmocom-bs11-utils -Architecture: any -Depends: ${shlibs:Depends}, - ${misc:Depends} -Description: Command line utilities for Siemens BS-11 BTS - There is a tool in this package for configuring the Siemens BS-11 BTS. - Additionally, it contains one tool for making use of an ISDN-card and the - public telephone network as frequency standard for the E1 line. - -Package: osmocom-sgsn -Architecture: any -Depends: ${shlibs:Depends}, - ${misc:Depends} -Suggests: osmocom-bsc -Description: Osmocom Serving GPRS Support Node - This is an implementation of the GPRS Serving GPRS Support Node (SGSN). As - such it implements the GPRS Mobility Management (GMM) and SM (Session - Management). - . - The SGSN connects via the Gb-interface to the BSS (like the osmo-pcu or an - ip.access nanoBTS), and it connects via the GTP protocol to a Gateway GPRS - Support Node (GGSN) like openggsn. - -Package: osmocom-gbproxy -Architecture: any -Depends: ${shlibs:Depends}, - ${misc:Depends} -Recommends: osmocom-sgsn -Description: Osmocom GPRS Gb Interface Proxy - The purpose of the Gb proxy is to aggregate the Gb links of multiple - BSS's and present them in one Gb link to the SGSN. - . - This package is part of OpenBSC and closely related to osmocom-sgsn. - -Package: osmocom-bsc-nat -Architecture: any -Depends: ${shlibs:Depends}, - ${misc:Depends} -Recommends: osmocom-bsc -Description: Osmocom Base Station Controller Network Address Translation - This NAT is useful for masquerading multiple BSCs behind one. It listens - for incoming BSCs on port 5000 and connects to a specified Mobile Switching - Center (MSC). - . - This package is part of OpenBSC and closely related to osmocom-bsc. - -Package: openbsc-dev -Architecture: all -Depends: ${misc:Depends} -Description: Header file needed by tools tightly integrated - Some other programs depend on gsm_data_shared.h and gsm_data_shared.c - from OpenBSC. This package installs these files to your file system so - that the other packages can build-depend on this package. - . - The directory structure is copied after the structure in the repository - and the header and .c file are installed into /usr/src/osmocom/openbsc/. - -Package: osmo-gtphub -Architecture: any -Depends: ${shlibs:Depends}, ${misc:Depends} -Description: Osmocom GTP Hub - Proxy for comms between multiple SGSNs and GGSNs. - -Package: osmocom-bsc-dbg -Architecture: any +Package: osmo-msc-dbg Section: debug -Priority: extra -Depends: osmocom-bsc (= ${binary:Version}), ${misc:Depends} -Description: Debug symbols for the OpenBSC BSC - Make debugging possible - -Package: osmocom-nitb-dbg Architecture: any -Section: debug -Priority: extra -Depends: osmocom-nitb (= ${binary:Version}), ${misc:Depends} -Description: Debug symbols for the OpenBSC NITB - Make debugging possible - -Package: osmocom-ipaccess-utils-dbg -Architecture: any -Section: debug -Priority: extra -Depends: osmocom-ipaccess-utils (= ${binary:Version}), ${misc:Depends} -Description: Debug symbols for the OpenBSC ip.access utils - Make debugging possible - -Package: osmocom-bs11-utils-dbg -Architecture: any -Section: debug -Priority: extra -Depends: osmocom-bs11-utils (= ${binary:Version}), ${misc:Depends} -Description: Debug symbols for the OpenBSC BS11 utils - Make debugging possible - -Package: osmocom-sgsn-dbg -Architecture: any -Section: debug -Priority: extra -Depends: osmocom-sgsn (= ${binary:Version}), ${misc:Depends} -Description: Debug symbols for the OpenBSC Serving GPRS Support Node - Make debugging possible - -Package: osmocom-gbproxy-dbg -Architecture: any -Section: debug -Priority: extra -Depends: osmocom-gbproxy (= ${binary:Version}), ${misc:Depends} -Description: Debug symbols for the OpenBSC GPRS GBProxy - Make debugging possible - -Package: osmocom-bsc-nat-dbg -Architecture: any -Section: debug -Priority: extra -Depends: osmocom-bsc-nat (= ${binary:Version}), ${misc:Depends} -Description: Debug symbols for the OpenBSC Network Address Translation - Make debugging possible - -Package: osmo-gtphub-dbg -Architecture: any -Section: debug -Priority: extra -Depends: osmo-gtphub (= ${binary:Version}), ${misc:Depends} -Description: Debug symbols for Osmocom GTP Hub - Make debugging possible +Multi-Arch: same +Depends: osmo-msc (= ${binary:Version}), ${misc:Depends} +Description: OsmoMSC: Osmocom's Mobile Switching Center for 2G and 3G circuit-switched mobile networks diff --git a/debian/copyright b/debian/copyright index 1e4dee1..e3cd9b3 100644 --- a/debian/copyright +++ b/debian/copyright @@ -1,75 +1,83 @@ Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ -Upstream-Name: OpenBSC -Source: http://openbsc.osmocom.org/ +Upstream-Name: osmo-msc +Source: git://git.osmocom.org/osmo-msc -Files: * -Copyright: 2008-2015 Harald Welte - 2008-2015 Holger Hans Peter Freyther - 2009-2015 On-Waves - 2008 Jan Luebbe - 2008,2010-2011 Daniel Willmann - 2009,2011,2013 Andreas Eversberg - 2009,2011 Dieter Spaar - 2009 Mike Haben - 2010 Sylvain Munaut <246tnt at gmail.com> - 2012-2013 Pablo Neira Ayuso - 2013-2015 Sysmocom s.f.m.c. GmbH (Jacob Erlbeck) - 2014 Alexander Chemeris -License: AGPL-3+ -Comment: Contributions by Stefan Schmidt as well - -Files: wireshark/0001-abis_oml.patch - wireshark/0002-ericsson_rbs2409.patch - wireshark/0003-lucent-hnb.patch - wireshark/0005-rsl-hsl.patch -Copyright: 1998 Gerald Combs - 2007,2011 Anders Broman - 2009 Holger Hans Peter Freyther - 2009-2011 Harald Welte -License: GPL-2+ - -Files: openbsc/include/mISDNif.h -Copyright: 2008 Karsten Keil -License: LGPL-2.1 - -Files: openbsc/src/libmgcp/g711common.h -Copyright: 2009 Abramo Bagnara -License: GPL-2+ - -Files: openbsc/git-version-gen -Copyright: 2007-2010 Free Software Foundation -License: GPL-3+ - -Files: openbsc/osmoappdesc.py - openbsc/tests/smpp_test_runner.py - openbsc/tests/ctrl_test_runner.py - openbsc/tests/vty_test_runner.py -Copyright: 2013 Katerina Barone-Adesi - 2013 Jacob Erlbeck - 2013-2014 Holger Hans Peter Freyther -License: GPL-3+ - -Files: openbsc/src/libbsc/bsc_ctrl_lookup.c -Copyright: 2010-2011 Daniel Willmann - 2010-2011 On-Waves -License: GPL-2+ - -Files: openbsc/src/libmsc/mncc_sock.c - openbsc/src/libmsc/mncc_builtin.c -Copyright: 2008-2010 Harald Welte - 2009 Andreas Eversberg - 2012 Holger Hans Peter Freyther -License: GPL-2+ - -Files: debian/* -Copyright: 2012-2015 Holger Hans Peter Freyther - 2016 Ruben Undheim -License: GPL-2+ - - -License: AGPL-3+ - This package is free software; you can redistribute it and/or modify +Files: * +Copyright: 2008 Daniel Willmann + 2008 Jan Luebbe + 2008-2015 Holger Hans Peter Freyther + 2008-2016 Harald Welte + 2009 Andreas Eversberg + 2009 Mike Haben + 2010 Sylvain Munaut + 2010-2013 On-Waves + 2013 Jacob Erlbeck + 2011 Andreas Eversberg + 2011-2017 sysmocom s.f.m.c. GmbH + 2014-2015 Alexander Chemeris +License: AGPL-3.0+ + This program is free software; you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + . + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Affero General Public License for more details. + . + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see . + +Files: src/libmsc/mncc_builtin.c + src/libmsc/mncc_sock.c +Copyright: 2008-2010 Harald Welte + 2009 Andreas Eversberg + 2012 Holger Hans Peter Freyther +License: GPL-2.0+ + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + . + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + . + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + . + On Debian systems, the complete text of the GNU General Public License + Version 2 can be found in `/usr/share/common-licenses/GPL-2'. + +Files: osmoappdesc.py +Copyright: 2013 Katerina Barone-Adesi +License: GPL-3.0+ + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + . + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + . + You should have received a copy of the GNU General Public License + along with this program. If not, see + . + Most systems won't be able to use these, so they're separated out + . + On Debian systems, the complete text of the GNU General Public License + Version 3 can be found in `/usr/share/common-licenses/GPL-3'. + +Files: git-version-gen +Copyright: 2007-2010 Free Software Foundation, Inc. +License: GPL-3.0+ + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. . @@ -78,60 +86,88 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. . - You should have received a copy of the GNU Affero General Public License - along with this program. If not, see . - - -License: GPL-2+ - This package is free software: you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 2 of the License, or (at - your option) any later version. - . - This program is distributed in the hope that it will be useful, but - WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - for more details. - . You should have received a copy of the GNU General Public License along with this program. If not, see . . - On Debian systems, the complete text of the GNU General Public - License version 2 can be found in "/usr/share/common-licenses/GPL-2". - - -License: GPL-3+ - This package is free software: you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or (at - your option) any later version. + This script is derived from GIT-VERSION-GEN from GIT: http://git.or.cz/. + It may be run two ways: + - from a git repository in which the "git describe" command below + produces useful output (thus requiring at least one signed tag) + - from a non-git-repo directory containing a .tarball-version file, which + presumes this script is invoked like "./git-version-gen .tarball-version". . - This program is distributed in the hope that it will be useful, but - WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - for more details. + In order to use intra-version strings in your project, you will need two + separate generated version string files: . - You should have received a copy of the GNU General Public License - along with this program. If not, see . + .tarball-version - present only in a distribution tarball, and not in + a checked-out repository. Created with contents that were learned at + the last time autoconf was run, and used by git-version-gen. Must not + be present in either $(srcdir) or $(builddir) for git-version-gen to + give accurate answers during normal development with a checked out tree, + but must be present in a tarball when there is no version control system. + Therefore, it cannot be used in any dependencies. GNUmakefile has + hooks to force a reconfigure at distribution time to get the value + correct, without penalizing normal development with extra reconfigures. . - On Debian systems, the complete text of the GNU General Public - License version 3 can be found in "/usr/share/common-licenses/GPL-3". + .version - present in a checked-out repository and in a distribution + tarball. Usable in dependencies, particularly for files that don't + want to depend on config.h but do want to track version changes. + Delete this file prior to any autoconf run where you want to rebuild + files to pick up a version string change; and leave it stale to + minimize rebuild time after unrelated changes to configure sources. + . + It is probably wise to add these two files to .gitignore, so that you + don't accidentally commit either generated file. + . + Use the following line in your configure.ac, so that $(VERSION) will + automatically be up-to-date each time configure is run (and note that + since configure.ac no longer includes a version string, Makefile rules + should not depend on configure.ac for version updates). + . + On Debian systems, the complete text of the GNU General Public License + Version 3 can be found in `/usr/share/common-licenses/GPL-3'. - -License: LGPL-2.1 - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; version - 2.1 of the License. +Files: tests/vty_test_runner.py +Copyright: 2013 Holger Hans Peter Freyther + 2013 Katerina Barone-Adesi +License: GPL-3.0+ + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. . - This library is distributed in the hope that it will be useful, + This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. . - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, see . + You should have received a copy of the GNU General Public License + along with this program. If not, see . . - On Debian systems, the complete text of the GNU Lesser General - Public License version 2.1 can be found in - "/usr/share/common-licenses/LGPL-2.1". + On Debian systems, the complete text of the GNU General Public License + Version 3 can be found in `/usr/share/common-licenses/GPL-3'. + +Files: include/openbsc/slhc.h +Copyright: 1989 Regents of the University of California. +License: __UNKNOWN__ + Redistribution and use in source and binary forms are permitted + provided that the above copyright notice and this paragraph are + duplicated in all such forms and that any documentation, + advertising materials, and other materials related to such + distribution and use acknowledge that the software was developed + by the University of California, Berkeley. The name of the + University may not be used to endorse or promote products derived + from this software without specific prior written permission. + THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. + . + Van Jacobson (van at helios.ee.lbl.gov), Dec 31, 1989: + - Initial distribution. + . + modified for KA9Q Internet Software Package by + Katie Stevens (dkstevens at ucdavis.edu) + University of California, Davis + Computing Services + - 01-31-90 initial adaptation + diff --git a/debian/docs b/debian/docs deleted file mode 100644 index cd545c2..0000000 --- a/debian/docs +++ /dev/null @@ -1 +0,0 @@ -openbsc/README diff --git a/debian/openbsc-dev.install b/debian/openbsc-dev.install deleted file mode 100644 index 0c05545..0000000 --- a/debian/openbsc-dev.install +++ /dev/null @@ -1,4 +0,0 @@ -openbsc/include/openbsc/gsm_data_shared.h usr/src/osmocom/openbsc/openbsc/include/openbsc/ -openbsc/include/openbsc/common_cs.h usr/src/osmocom/openbsc/openbsc/include/openbsc/ -openbsc/src/libcommon/gsm_data_shared.c usr/src/osmocom/openbsc/openbsc/src/libcommon/ -usr/lib/*/pkgconfig/openbsc.pc diff --git a/debian/osmo-msc.install b/debian/osmo-msc.install new file mode 100644 index 0000000..2c733e0 --- /dev/null +++ b/debian/osmo-msc.install @@ -0,0 +1,2 @@ +usr/bin +usr/share/doc/openbsc/examples/osmo-msc/osmo-msc.cfg diff --git a/debian/osmocom-nitb.default b/debian/osmocom-nitb.default deleted file mode 100644 index ef76a5f..0000000 --- a/debian/osmocom-nitb.default +++ /dev/null @@ -1,8 +0,0 @@ -CONFIG_FILE="/etc/osmocom/osmo-nitb.cfg" -HLR_FILE="/var/lib/osmocom/hlr.sqlite3" - -DAEMON_ARGS="-P" - -# Uncomment if using LCR+Asterisk -# DAEMON_ARGS="-m -P" - diff --git a/debian/osmocom-nitb.dirs b/debian/osmocom-nitb.dirs deleted file mode 100644 index efbca2b..0000000 --- a/debian/osmocom-nitb.dirs +++ /dev/null @@ -1,3 +0,0 @@ -/etc/osmocom -/var/log/osmocom -/var/lib/osmocom diff --git a/debian/osmocom-nitb.examples b/debian/osmocom-nitb.examples deleted file mode 100644 index c098d5c..0000000 --- a/debian/osmocom-nitb.examples +++ /dev/null @@ -1 +0,0 @@ -openbsc/doc/examples/osmo-nitb diff --git a/debian/osmocom-nitb.init b/debian/osmocom-nitb.init deleted file mode 100755 index 0747446..0000000 --- a/debian/osmocom-nitb.init +++ /dev/null @@ -1,152 +0,0 @@ -#!/bin/sh -### BEGIN INIT INFO -# Provides: osmo-nitb -# Required-Start: $network $local_fs -# Required-Stop: -# Default-Start: 2 3 4 5 -# Default-Stop: 0 1 6 -# Short-Description: Osmocom GSM network-in-a-box -# Description: A minimal implementation of the GSM Base Station Controller, -# Mobile Switching Center, Home Location regster and all other -# components to run a self-contained GSM network. -### END INIT INFO - -# Author: Harald Welte - -# PATH should only include /usr/* if it runs after the mountnfs.sh script -PATH=/sbin:/usr/sbin:/bin:/usr/bin -NAME=osmo-nitb # Introduce the short server's name here -DESC="Osmocom GSM Network-in-a-Box" # Introduce a short description here -DAEMON=/usr/bin/osmo-nitb # Introduce the server's location here -SCRIPTNAME=/etc/init.d/osmocom-nitb - -# Exit if the package is not installed -[ -x $DAEMON ] || exit 0 - -# Read configuration variable file if it is present -[ -r /etc/default/osmocom-nitb ] && . /etc/default/osmocom-nitb - -# Load the VERBOSE setting and other rcS variables -. /lib/init/vars.sh - -# Define LSB log_* functions. -# Depend on lsb-base (>= 3.0-6) to ensure that this file is present. -. /lib/lsb/init-functions - -DAEMON_ARGS="$DAEMON_ARGS -D -c $CONFIG_FILE -l $HLR_FILE" - -# -# Function that starts the daemon/service -# -do_start() -{ - # Return - # 0 if daemon has been started - # 1 if daemon was already running - # 2 if daemon could not be started - start-stop-daemon --start --quiet --exec $DAEMON --test > /dev/null \ - || return 1 - start-stop-daemon --start --quiet --exec $DAEMON -- \ - $DAEMON_ARGS \ - || return 2 - # Add code here, if necessary, that waits for the process to be ready - # to handle requests from services started subsequently which depend - # on this one. As a last resort, sleep for some time. -} - -# -# Function that stops the daemon/service -# -do_stop() -{ - # Return - # 0 if daemon has been stopped - # 1 if daemon was already stopped - # 2 if daemon could not be stopped - # other if a failure occurred - start-stop-daemon --stop --quiet --retry=TERM/30/KILL/5 --name $NAME - RETVAL="$?" - [ "$RETVAL" = 2 ] && return 2 - # Wait for children to finish too if this is a daemon that forks - # and if the daemon is only ever run from this initscript. - # If the above conditions are not satisfied then add some other code - # that waits for the process to drop all resources that could be - # needed by services started subsequently. A last resort is to - # sleep for some time. - start-stop-daemon --stop --quiet --oknodo --retry=0/30/KILL/5 --exec $DAEMON - [ "$?" = 2 ] && return 2 - return "$RETVAL" -} - -# -# Function that sends a SIGHUP to the daemon/service -# -do_reload() { - # - # If the daemon can reload its configuration without - # restarting (for example, when it is sent a SIGHUP), - # then implement that here. - # - start-stop-daemon --stop --signal 1 --quiet $PIDFILE --name $NAME - return 0 -} - -case "$1" in - start) - [ "$VERBOSE" != no ] && log_daemon_msg "Starting $DESC " "$NAME" - do_start - case "$?" in - 0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;; - 2) [ "$VERBOSE" != no ] && log_end_msg 1 ;; - esac - ;; - stop) - [ "$VERBOSE" != no ] && log_daemon_msg "Stopping $DESC" "$NAME" - do_stop - case "$?" in - 0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;; - 2) [ "$VERBOSE" != no ] && log_end_msg 1 ;; - esac - ;; - status) - status_of_proc "$DAEMON" "$NAME" && exit 0 || exit $? - ;; - #reload|force-reload) - # - # If do_reload() is not implemented then leave this commented out - # and leave 'force-reload' as an alias for 'restart'. - # - #log_daemon_msg "Reloading $DESC" "$NAME" - #do_reload - #log_end_msg $? - #;; - restart|force-reload) - # - # If the "reload" option is implemented then remove the - # 'force-reload' alias - # - log_daemon_msg "Restarting $DESC" "$NAME" - do_stop - case "$?" in - 0|1) - do_start - case "$?" in - 0) log_end_msg 0 ;; - 1) log_end_msg 1 ;; # Old process is still running - *) log_end_msg 1 ;; # Failed to start - esac - ;; - *) - # Failed to stop - log_end_msg 1 - ;; - esac - ;; - *) - #echo "Usage: $SCRIPTNAME {start|stop|restart|reload|force-reload}" >&2 - echo "Usage: $SCRIPTNAME {start|stop|status|restart|force-reload}" >&2 - exit 3 - ;; -esac - -: diff --git a/debian/osmocom-nitb.install b/debian/osmocom-nitb.install deleted file mode 100644 index 26caf71..0000000 --- a/debian/osmocom-nitb.install +++ /dev/null @@ -1,2 +0,0 @@ -/usr/bin/osmo-nitb -openbsc/contrib/*.py usr/bin/ \ No newline at end of file diff --git a/debian/rules b/debian/rules index 4e187a6..3500fbb 100755 --- a/debian/rules +++ b/debian/rules @@ -1,32 +1,59 @@ #!/usr/bin/make -f +# You must remove unused comment lines for the released package. +# See debhelper(7) (uncomment to enable) +# This is an autogenerated template for debian/rules. +# +# Output every command that modifies files on the build system. +#export DH_VERBOSE = 1 +# +# Copy some variable definitions from pkg-info.mk and vendor.mk +# under /usr/share/dpkg/ to here if they are useful. +# +# See FEATURE AREAS/ENVIRONMENT in dpkg-buildflags(1) +# Apply all hardening options +#export DEB_BUILD_MAINT_OPTIONS = hardening=+all +# Package maintainers to append CFLAGS +#export DEB_CFLAGS_MAINT_APPEND = -Wall -pedantic +# Package maintainers to append LDFLAGS +#export DEB_LDFLAGS_MAINT_APPEND = -Wl,--as-needed +# +# With debhelper version 9 or newer, the dh command exports +# all buildflags. So there is no need to include the +# /usr/share/dpkg/buildflags.mk file here if compat is 9 or newer. +# +# These are rarely used code. (START) +# +# The following include for *.mk magically sets miscellaneous +# variables while honoring existing values of pertinent +# environment variables: +# +# Architecture-related variables such as DEB_TARGET_MULTIARCH: +#include /usr/share/dpkg/architecture.mk +# Vendor-related variables such as DEB_VENDOR: +#include /usr/share/dpkg/vendor.mk +# Package-related variables such as DEB_DISTRIBUTION +#include /usr/share/dpkg/pkg-info.mk +# +# You may alternatively set them susing a simple script such as: +# DEB_VENDOR ?= $(shell dpkg-vendor --query Vendor) +# +# These are rarely used code. (END) +# -# Uncomment this to turn on verbose mode. -#export DH_VERBOSE=1 - -DEBIAN := $(shell dpkg-parsechangelog | grep ^Version: | cut -d' ' -f2) -DEBVERS := $(shell echo '$(DEBIAN)' | cut -d- -f1) -VERSION := $(shell echo '$(DEBVERS)' | sed -e 's/[+-].*//' -e 's/~//g') - -export DEB_BUILD_MAINT_OPTIONS = hardening=+all - +# main packaging script based on dh7 syntax %: - dh $@ --sourcedirectory=openbsc --with autoreconf + dh $@ --with autoreconf -# This is needed for debian stable (squeeze) -override_dh_autoreconf: - cd openbsc && autoreconf --install --force - -override_dh_strip: - dh_strip -posmocom-bsc --dbg-package=osmocom-bsc-dbg - dh_strip -posmocom-nitb --dbg-package=osmocom-nitb-dbg - dh_strip -posmocom-ipaccess-utils --dbg-package=osmocom-ipaccess-utils-dbg - dh_strip -posmocom-bs11-utils --dbg-package=osmocom-bs11-utils-dbg - dh_strip -posmocom-sgsn --dbg-package=osmocom-sgsn-dbg - dh_strip -posmocom-gbproxy --dbg-package=osmocom-gbproxy-dbg - dh_strip -posmocom-bsc-nat --dbg-package=osmocom-bsc-nat-dbg - dh_strip -posmo-gtphub --dbg-package=osmo-gtphub-dbg - +# debmake generated override targets +# Set options for ./configure +CONFIGURE_FLAGS += --enable-iu override_dh_auto_configure: - echo $(VERSION) > openbsc/.tarball-version - dh_auto_configure --sourcedirectory=openbsc -- --enable-nat --enable-osmo-bsc --enable-smpp + dh_auto_configure -- $(CONFIGURE_FLAGS) +# +# Do not install libtool archive, python .pyc .pyo +#override_dh_install: +# dh_install --list-missing -X.la -X.pyc -X.pyo +# See https://www.debian.org/doc/manuals/developers-reference/best-pkging-practices.html#bpp-dbg +override_dh_strip: + dh_strip --dbg-package=osmo-msc-dbg -- To view, visit https://gerrit.osmocom.org/3499 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I77544cb38c31777c3fab52979d19488a63e52de3 Gerrit-PatchSet: 9 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: lynxis lazus From gerrit-no-reply at lists.osmocom.org Tue Aug 29 12:51:23 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 29 Aug 2017 12:51:23 +0000 Subject: [MERGED] osmo-msc[master]: libmsc: make pitfall in gsm0408_dispatch() more obvious In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: libmsc: make pitfall in gsm0408_dispatch() more obvious ...................................................................... libmsc: make pitfall in gsm0408_dispatch() more obvious The function gsm0408_dispatch() accepts a message buffer pointer and accesses the l3h pointer. Even in a properly allocated message buffer, this may lead into a segfault if the user forgets to set the l3h pointer. This commit adds assertions to popup a more expressive error message. Change-Id: I43bd9bd1c170559aaa8dacaef25dba090744bcd5 --- M src/libmsc/gsm_04_08.c 1 file changed, 6 insertions(+), 2 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/libmsc/gsm_04_08.c b/src/libmsc/gsm_04_08.c index 21bc2b8..90a0431 100644 --- a/src/libmsc/gsm_04_08.c +++ b/src/libmsc/gsm_04_08.c @@ -3216,13 +3216,17 @@ /* Main entry point for GSM 04.08/44.008 Layer 3 data (e.g. from the BSC). */ int gsm0408_dispatch(struct gsm_subscriber_connection *conn, struct msgb *msg) { - struct gsm48_hdr *gh = msgb_l3(msg); - uint8_t pdisc = gsm48_hdr_pdisc(gh); + struct gsm48_hdr *gh; + uint8_t pdisc; int rc = 0; + OSMO_ASSERT(msg->l3h) OSMO_ASSERT(conn); OSMO_ASSERT(msg); + gh = msgb_l3(msg); + pdisc = gsm48_hdr_pdisc(gh); + LOGP(DRLL, LOGL_DEBUG, "Dispatching 04.08 message %s (0x%x:0x%x)\n", gsm48_pdisc_msgtype_name(pdisc, gsm48_hdr_msg_type(gh)), pdisc, gsm48_hdr_msg_type(gh)); -- To view, visit https://gerrit.osmocom.org/3498 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I43bd9bd1c170559aaa8dacaef25dba090744bcd5 Gerrit-PatchSet: 9 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: dexter From gerrit-no-reply at lists.osmocom.org Tue Aug 29 12:51:23 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 29 Aug 2017 12:51:23 +0000 Subject: [MERGED] osmo-msc[master]: cosmetic: msc_vlr_tests: drop unused var In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: cosmetic: msc_vlr_tests: drop unused var ...................................................................... cosmetic: msc_vlr_tests: drop unused var Change-Id: I584c0dfffe005597563dbd72fad8a087c554ba3d --- M tests/msc_vlr/msc_vlr_tests.c 1 file changed, 0 insertions(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/tests/msc_vlr/msc_vlr_tests.c b/tests/msc_vlr/msc_vlr_tests.c index 3966aac..71f9713 100644 --- a/tests/msc_vlr/msc_vlr_tests.c +++ b/tests/msc_vlr/msc_vlr_tests.c @@ -454,7 +454,6 @@ int _validate_dtap(struct msgb *msg, enum ran_type to_ran) { - struct gsm48_hdr *gh = (void*)msg->data; btw("DTAP --%s--> MS: %s: %s", ran_type_name(to_ran), msg_type_name(msg), osmo_hexdump_nospc(msg->data, msg->len)); -- To view, visit https://gerrit.osmocom.org/3490 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I584c0dfffe005597563dbd72fad8a087c554ba3d Gerrit-PatchSet: 7 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Tue Aug 29 12:51:23 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 29 Aug 2017 12:51:23 +0000 Subject: [MERGED] osmo-msc[master]: .gitignore: cosmetic: use globs to ignore test binaries In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: .gitignore: cosmetic: use globs to ignore test binaries ...................................................................... .gitignore: cosmetic: use globs to ignore test binaries Change-Id: I840e4333a4cad646d751ebafe7e0ef23e7a9c708 --- M .gitignore 1 file changed, 7 insertions(+), 39 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/.gitignore b/.gitignore index cf5542d..a9e6b84 100644 --- a/.gitignore +++ b/.gitignore @@ -62,45 +62,13 @@ #tests tests/testsuite.dir -tests/bsc-nat/bsc_nat_test -tests/bsc-nat-trie/bsc_nat_trie_test -tests/channel/channel_test -tests/db/db_test -tests/debug/debug_test -tests/gsm0408/gsm0408_test -tests/mgcp/mgcp_test -tests/sccp/sccp_test -tests/sms/sms_test -tests/timer/timer_test -tests/gprs/gprs_test -tests/gbproxy/gbproxy_test -tests/abis/abis_test -tests/si/si_test -tests/smpp/smpp_test -tests/bsc/bsc_test -tests/trau/trau_test -tests/mgcp/mgcp_transcoding_test -tests/sgsn/sgsn_test -tests/subscr/subscr_test -tests/subscr/bsc_subscr_test -tests/oap/oap_test -tests/gtphub/gtphub_test -tests/mm_auth/mm_auth_test -tests/xid/xid_test -tests/sndcp_xid/sndcp_xid_test -tests/slhc/slhc_test -tests/v42bis/v42bis_test -tests/nanobts_omlattr/nanobts_omlattr_test -tests/oap/oap_client_test -tests/msc_vlr/msc_vlr_test_no_authen -tests/msc_vlr/msc_vlr_test_gsm_authen -tests/msc_vlr/msc_vlr_test_gsm_ciph -tests/msc_vlr/msc_vlr_test_umts_authen -tests/msc_vlr/msc_vlr_test_hlr_reject -tests/msc_vlr/msc_vlr_test_hlr_timeout -tests/msc_vlr/msc_vlr_test_ms_timeout -tests/msc_vlr/msc_vlr_test_reject_concurrency -tests/msc_vlr/msc_vlr_test_rest +tests/*/*_test +# ignore compiled binaries like msc_vlr_test_foo; do not ignore +# msc_vlr_test_foo.{c,ok,err}, but do still ignore the corresponding .o object +# files: +tests/msc_vlr/msc_vlr_test_* +!tests/msc_vlr/msc_vlr_test_*.* +tests/msc_vlr/msc_vlr_test_*.o tests/atconfig -- To view, visit https://gerrit.osmocom.org/3491 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I840e4333a4cad646d751ebafe7e0ef23e7a9c708 Gerrit-PatchSet: 7 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Tue Aug 29 12:51:24 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 29 Aug 2017 12:51:24 +0000 Subject: [MERGED] osmo-msc[master]: MSC, SGSN: use OSMO_GSUP_PORT == 4222 instead of 2222 In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: MSC,SGSN: use OSMO_GSUP_PORT == 4222 instead of 2222 ...................................................................... MSC,SGSN: use OSMO_GSUP_PORT == 4222 instead of 2222 In SGSN, actually place the port in the SGSN config by default, so that the gsup port may now be omitted in the VTY config (the IP address suffices). Adjust the osmo-sgsn.cfg example. Depends: I4222e21686c823985be8ff1f16b1182be8ad6175 (libosmocore) Change-Id: I50f2040e2eb0baacb43849e93cfed10cbc2fc156 --- M doc/examples/osmo-sgsn/osmo-sgsn.cfg 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/doc/examples/osmo-sgsn/osmo-sgsn.cfg b/doc/examples/osmo-sgsn/osmo-sgsn.cfg index 9703c23..06f035f 100644 --- a/doc/examples/osmo-sgsn/osmo-sgsn.cfg +++ b/doc/examples/osmo-sgsn/osmo-sgsn.cfg @@ -11,7 +11,7 @@ ggsn 0 gtp-version 1 auth-policy remote gsup remote-ip 127.0.0.1 - gsup remote-port 2222 + gsup remote-port 4222 ! ns timer tns-block 3 -- To view, visit https://gerrit.osmocom.org/3488 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I50f2040e2eb0baacb43849e93cfed10cbc2fc156 Gerrit-PatchSet: 5 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Tue Aug 29 15:08:29 2017 From: gerrit-no-reply at lists.osmocom.org (Keith Whyte) Date: Tue, 29 Aug 2017 15:08:29 +0000 Subject: [PATCH] osmo-sip-connector[master]: sdp.c Send octet-align in ftmp Message-ID: Review at https://gerrit.osmocom.org/3735 sdp.c Send octet-align in ftmp rfc4867 8.2: octet-align: Permissible values are 0 and 1. If 1, octet-aligned operation SHALL be used. If 0 or if not present, bandwidth-efficient operation is employed. We don't have any support for AMR BE mode, but if we don't send this the other end expects BE mode can't decode the stream Change-Id: I938758ac4ec55db9223e3da6c3c277e8fa670055 --- M src/sdp.c 1 file changed, 7 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-sip-connector refs/changes/35/3735/1 diff --git a/src/sdp.c b/src/sdp.c index ccd000d..caf83bc 100644 --- a/src/sdp.c +++ b/src/sdp.c @@ -166,8 +166,13 @@ char *sdp_create_file(struct sip_call_leg *leg, struct call_leg *other) { struct in_addr net = { .s_addr = ntohl(other->ip) }; + char *fmtp_str = ""; leg->wanted_codec = app_media_name(other->payload_msg_type); + + if (other->payload_type == 98) + fmtp_str="a=fmtp:98 octet-align=1\r\n"; + return talloc_asprintf(leg, "v=0\r\n" "o=Osmocom 0 0 IN IP4 %s\r\n" @@ -175,9 +180,11 @@ "c=IN IP4 %s\r\n" "t=0 0\r\n" "m=audio %d RTP/AVP %d\r\n" + "%s" "a=rtpmap:%d %s/8000\r\n", inet_ntoa(net), inet_ntoa(net), /* never use diff. addr! */ other->port, other->payload_type, + fmtp_str, other->payload_type, leg->wanted_codec); } -- To view, visit https://gerrit.osmocom.org/3735 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I938758ac4ec55db9223e3da6c3c277e8fa670055 Gerrit-PatchSet: 1 Gerrit-Project: osmo-sip-connector Gerrit-Branch: master Gerrit-Owner: Keith Whyte From gerrit-no-reply at lists.osmocom.org Tue Aug 29 15:13:33 2017 From: gerrit-no-reply at lists.osmocom.org (Keith Whyte) Date: Tue, 29 Aug 2017 15:13:33 +0000 Subject: [PATCH] osmo-sip-connector[master]: sdp.c Send octet-align in fmtp In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3735 to look at the new patch set (#2). sdp.c Send octet-align in fmtp rfc4867 8.2: octet-align: Permissible values are 0 and 1. If 1, octet-aligned operation SHALL be used. If 0 or if not present, bandwidth-efficient operation is employed. We don't have any support for AMR BE mode, but if we don't send this the other end expects BE mode + can't decode the stream Change-Id: I938758ac4ec55db9223e3da6c3c277e8fa670055 --- M src/sdp.c 1 file changed, 7 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-sip-connector refs/changes/35/3735/2 diff --git a/src/sdp.c b/src/sdp.c index ccd000d..caf83bc 100644 --- a/src/sdp.c +++ b/src/sdp.c @@ -166,8 +166,13 @@ char *sdp_create_file(struct sip_call_leg *leg, struct call_leg *other) { struct in_addr net = { .s_addr = ntohl(other->ip) }; + char *fmtp_str = ""; leg->wanted_codec = app_media_name(other->payload_msg_type); + + if (other->payload_type == 98) + fmtp_str="a=fmtp:98 octet-align=1\r\n"; + return talloc_asprintf(leg, "v=0\r\n" "o=Osmocom 0 0 IN IP4 %s\r\n" @@ -175,9 +180,11 @@ "c=IN IP4 %s\r\n" "t=0 0\r\n" "m=audio %d RTP/AVP %d\r\n" + "%s" "a=rtpmap:%d %s/8000\r\n", inet_ntoa(net), inet_ntoa(net), /* never use diff. addr! */ other->port, other->payload_type, + fmtp_str, other->payload_type, leg->wanted_codec); } -- To view, visit https://gerrit.osmocom.org/3735 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I938758ac4ec55db9223e3da6c3c277e8fa670055 Gerrit-PatchSet: 2 Gerrit-Project: osmo-sip-connector Gerrit-Branch: master Gerrit-Owner: Keith Whyte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Tue Aug 29 15:17:31 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Tue, 29 Aug 2017 15:17:31 +0000 Subject: osmo-gsm-tester[master]: Add cipher cfg param for modem and bts In-Reply-To: References: Message-ID: Patch Set 2: (2 comments) https://gerrit.osmocom.org/#/c/3723/2/example/resources.conf File example/resources.conf: Line 16: ciphers: ['a5 0', 'a5 1', 'a5 2', 'a5 3'] > 'a5 2' is a weak "export grade" cipher and globally deprecated. I assume ou De HW supports A5/2. If osmocom stack doesn't support it then I agree we can drop it. https://gerrit.osmocom.org/#/c/3723/2/src/osmo_gsm_tester/schema.py File src/osmo_gsm_tester/schema.py: Line 70: if val in ('a5 0', 'a5 1', 'a5 2', 'a5 3'): > spec wise they go up to 7 Ok I'll add the missing one. -- To view, visit https://gerrit.osmocom.org/3723 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ic0e368843a6e58bd3eeef36d2c0a7501296f0f3e Gerrit-PatchSet: 2 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Tue Aug 29 15:18:09 2017 From: gerrit-no-reply at lists.osmocom.org (Holger Freyther) Date: Tue, 29 Aug 2017 15:18:09 +0000 Subject: osmo-sip-connector[master]: sdp.c Send octet-align in fmtp In-Reply-To: References: Message-ID: Patch Set 2: @max; Could you have a look at the build failure? I remember patches from you in regard to to that? -- To view, visit https://gerrit.osmocom.org/3735 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I938758ac4ec55db9223e3da6c3c277e8fa670055 Gerrit-PatchSet: 2 Gerrit-Project: osmo-sip-connector Gerrit-Branch: master Gerrit-Owner: Keith Whyte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Aug 29 15:19:24 2017 From: gerrit-no-reply at lists.osmocom.org (Holger Freyther) Date: Tue, 29 Aug 2017 15:19:24 +0000 Subject: osmo-sip-connector[master]: sdp.c Send octet-align in fmtp In-Reply-To: References: Message-ID: Patch Set 2: @keith: Thanks for digging into the RFC. It is clear we need to change it but I would prefer to not use 98 (which is a dynamic payload type and could mean anything) but can you check the result of app_media_name() if it returns "AMR"? -- To view, visit https://gerrit.osmocom.org/3735 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I938758ac4ec55db9223e3da6c3c277e8fa670055 Gerrit-PatchSet: 2 Gerrit-Project: osmo-sip-connector Gerrit-Branch: master Gerrit-Owner: Keith Whyte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Aug 29 16:02:58 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Tue, 29 Aug 2017 16:02:58 +0000 Subject: osmo-gsm-tester[master]: Reserve ARFCN dynamically based on BTS band support In-Reply-To: References: Message-ID: Patch Set 1: (5 comments) https://gerrit.osmocom.org/#/c/3731/1/src/osmo_gsm_tester/bts_osmotrx.py File src/osmo_gsm_tester/bts_osmotrx.py: Line 137: } > (rather first get the defaults and then overlay this dict on top, otherwise All other confs can be taken from self.conf because they come from resources.conf, and cannot be changed at runtime by tests before starting the bts. This variables are not in self.conf because that's a static dict from resources.conf We could do something similar to what we do in nitb.py. At the end of configure(self): self.config = values Then self.config contains a dict with all configs (defaults, statics, dynamics) for that specific object. Then we can use self.config inside conf_for_bsc for everything, instead of using a mix of other object variables and self.conf and defaults. What do you think? https://gerrit.osmocom.org/#/c/3731/1/src/osmo_gsm_tester/bts_sysmo.py File src/osmo_gsm_tester/bts_sysmo.py: Line 154: } > (same) Let's follow the discussion on the other thread. https://gerrit.osmocom.org/#/c/3731/1/src/osmo_gsm_tester/resource.py File src/osmo_gsm_tester/resource.py: Line 527: raise RuntimeError('adding a list of reserved resources to itself?') > I guess this is a fact and not a question :) Copied it from same file, line 367 :) As you seem confident, I'll remove the "?". https://gerrit.osmocom.org/#/c/3731/1/src/osmo_gsm_tester/suite.py File src/osmo_gsm_tester/suite.py: Line 484: arfcn = suite_run._try_reserve_arfcn(supported_bands) > I assumed the arfcn could rather be resolved and picked like any other reso I thought a lot about all pros and cons of doing it one or the other way, and still not entirely happy with the solution. If done the way you mentioned, then it means we always need to pass a ARFCN scenario which matches capabilities of the BTS being requested (which again, is unknown unless we provide too a scenario specifying it), otherwise tests can fail. Same goes for the modem(s) in use. I really don't like this. I think the scenario is useful to select/filter which resources we do want to peek, that support specific functionalities we want to / need for the test, for instance a given cipher, auth, type of BTS, etc. This doesn't mean those scenarios are going to be "configured automatically" during every test using it. That's the job of the objects created from the selection of resources provided by the scenarios, because tuning of all parameters may be more complex that what you can do only combining dictionaries. See for instance the case of BTS passing parameters to BSC. This way we can provide a good "automatic configuration", and still give tests the possibility to configure stuff easily to test some specific case. I'm nowadays starting to think that there are actually 2 type of resources. Static ones (independent, limited amount) like a BTS or a modem, and dynamic ones (more dependent on other resources or specific use of test, or which can be dynamically created and require more logic), such as arfcn or ip_address. I think we should end up moving ip_address to this dynamic way, and do some module/hook to automatically provision new ips if required (eg run in a net namespace and launch a script to create a new virtual iface + ip addr when a new ip_address is requested). The only real cons I find so far with the way I did it is the issue you mention, ie we reserve resources after starting the tests. From user point of view, it's not a big issue as it still shows a NoResourceExn, so not a lot changes here. The only big issue I see with this proposal is that there could be some kind of deadlock while reserving resources if they are not acquired in the same order and there's several tests running in parallel, but I think we can probably solve that too, specially given that only a subset of resources is reserved after the test is started. So, I'm open to improve it, but not sure the way you proposed above is really improving what we have already here. I initially thought about that possibility but I was not convinced. https://gerrit.osmocom.org/#/c/3731/1/suites/register/register_band_1900.py File suites/register/register_band_1900.py: Line 5: arfcn = suite.reserve_arfcn(band='GSM-1900') > this shouldn't be a copy, just the same register test file, except that a * I explained what I think regarding this too on the other comment. Let's continue discussion there. -- To view, visit https://gerrit.osmocom.org/3731 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I6fb5d95bed1fa50c3deaf62a7a6df3cb276bc3c9 Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: neels Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Tue Aug 29 16:21:09 2017 From: gerrit-no-reply at lists.osmocom.org (Keith Whyte) Date: Tue, 29 Aug 2017 16:21:09 +0000 Subject: osmo-sip-connector[master]: sdp.c Send octet-align in fmtp In-Reply-To: References: Message-ID: Patch Set 2: > @keith: Thanks for digging into the RFC. Sure! This was meant more by way of a conversation starter. I'm finding a number of things while interfacing AMR enabled nitb to a SIP endpoint. -- To view, visit https://gerrit.osmocom.org/3735 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I938758ac4ec55db9223e3da6c3c277e8fa670055 Gerrit-PatchSet: 2 Gerrit-Project: osmo-sip-connector Gerrit-Branch: master Gerrit-Owner: Keith Whyte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Keith Whyte Gerrit-Reviewer: Max Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Aug 29 17:05:15 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Tue, 29 Aug 2017 17:05:15 +0000 Subject: [PATCH] osmo-gsm-manuals[master]: Allow easily disabling GFDL references Message-ID: Review at https://gerrit.osmocom.org/3736 Allow easily disabling GFDL references All parts referencing GFDL can be easily disabled by removing the 'gfdl-enabled' attribute from the document. Change-Id: I2489726ad2e90301bceadfada926e31ae0f85986 --- M OsmoBSC/osmobsc-usermanual.adoc M OsmoBTS/osmobts-abis.adoc M OsmoBTS/osmobts-usermanual.adoc M OsmoNITB/osmonitb-usermanual.adoc M OsmoPCU/osmopcu-gb.adoc M OsmoPCU/osmopcu-usermanual.adoc M OsmoSGSN/osmosgsn-usermanual.adoc M common/chapters/glossary.adoc M common/chapters/preface.adoc 9 files changed, 33 insertions(+), 6 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-manuals refs/changes/36/3736/1 diff --git a/OsmoBSC/osmobsc-usermanual.adoc b/OsmoBSC/osmobsc-usermanual.adoc index 9323373..f09a2d4 100644 --- a/OsmoBSC/osmobsc-usermanual.adoc +++ b/OsmoBSC/osmobsc-usermanual.adoc @@ -1,3 +1,5 @@ +:gfdl-enabled: + OsmoBSC User Manual =================== Harald Welte @@ -35,5 +37,6 @@ include::../common/chapters/glossary.adoc[] +ifdef::gfdl-enabled[] include::../common/chapters/gfdl.adoc[] - +endif::[] diff --git a/OsmoBTS/osmobts-abis.adoc b/OsmoBTS/osmobts-abis.adoc index 930cbfb..cf4ff51 100644 --- a/OsmoBTS/osmobts-abis.adoc +++ b/OsmoBTS/osmobts-abis.adoc @@ -1,3 +1,5 @@ +:gfdl-enabled: + OsmoBTS Abis Protocol Specification =================================== Neels Hofmeyr @@ -87,4 +89,6 @@ include::../common/chapters/glossary.adoc[] +ifdef::gfdl-enabled[] include::../common/chapters/gfdl.adoc[] +endif::[] diff --git a/OsmoBTS/osmobts-usermanual.adoc b/OsmoBTS/osmobts-usermanual.adoc index 4d47b1c..a4e9c9f 100644 --- a/OsmoBTS/osmobts-usermanual.adoc +++ b/OsmoBTS/osmobts-usermanual.adoc @@ -1,3 +1,5 @@ +:gfdl-enabled: + OsmoBTS User Manual =================== Harald Welte @@ -32,5 +34,6 @@ include::../common/chapters/glossary.adoc[] +ifdef::gfdl-enabled[] include::../common/chapters/gfdl.adoc[] - +endif::[] diff --git a/OsmoNITB/osmonitb-usermanual.adoc b/OsmoNITB/osmonitb-usermanual.adoc index 73166fa..baf4fe9 100644 --- a/OsmoNITB/osmonitb-usermanual.adoc +++ b/OsmoNITB/osmonitb-usermanual.adoc @@ -1,3 +1,5 @@ +:gfdl-enabled: + OsmoNITB User Manual ==================== Harald Welte @@ -41,5 +43,6 @@ include::../common/chapters/glossary.adoc[] +ifdef::gfdl-enabled[] include::../common/chapters/gfdl.adoc[] - +endif::[] diff --git a/OsmoPCU/osmopcu-gb.adoc b/OsmoPCU/osmopcu-gb.adoc index fc2ca8f..a978300 100644 --- a/OsmoPCU/osmopcu-gb.adoc +++ b/OsmoPCU/osmopcu-gb.adoc @@ -1,3 +1,5 @@ +:gfdl-enabled: + OsmoPCU Gb Protocol Specification ================================= Harald Welte @@ -90,4 +92,6 @@ include::../common/chapters/glossary.adoc[] +ifdef::gfdl-enabled[] include::../common/chapters/gfdl.adoc[] +endif::[] diff --git a/OsmoPCU/osmopcu-usermanual.adoc b/OsmoPCU/osmopcu-usermanual.adoc index 5d2b09c..f959aaa 100644 --- a/OsmoPCU/osmopcu-usermanual.adoc +++ b/OsmoPCU/osmopcu-usermanual.adoc @@ -1,3 +1,5 @@ +:gfdl-enabled: + OsmoPCU User Manual =================== Harald Welte @@ -23,4 +25,6 @@ include::../common/chapters/glossary.adoc[] +ifdef::gfdl-enabled[] include::../common/chapters/gfdl.adoc[] +endif::[] diff --git a/OsmoSGSN/osmosgsn-usermanual.adoc b/OsmoSGSN/osmosgsn-usermanual.adoc index 12a7b87..a7a03e6 100644 --- a/OsmoSGSN/osmosgsn-usermanual.adoc +++ b/OsmoSGSN/osmosgsn-usermanual.adoc @@ -1,3 +1,5 @@ +:gfdl-enabled: + OsmoSGSN User Manual ==================== Harald Welte @@ -31,4 +33,6 @@ include::../common/chapters/glossary.adoc[] +ifdef::gfdl-enabled[] include::../common/chapters/gfdl.adoc[] +endif::[] diff --git a/common/chapters/glossary.adoc b/common/chapters/glossary.adoc index c39d439..b697a4c 100644 --- a/common/chapters/glossary.adoc +++ b/common/chapters/glossary.adoc @@ -96,8 +96,10 @@ Interface between PCU and SGSN in GPRS/EDGE network; uses NS, BSSGP, LLC GERAN:: GPRS/EDGE Radio Access Network +ifdef::gfdl-enabled[] GFDL:: GNU Free Documentation License; a copyleft-style Documentation License +endif::[] GGSN:: GPRS Gateway Support Node; gateway between GPRS and external (IP) network GMSK:: @@ -309,4 +311,3 @@ Virtual TeletYpe; a textual command-line interface for configuration and introspection, e.g. the OsmoBSC configuration file as well as its telnet link on port 4242 - diff --git a/common/chapters/preface.adoc b/common/chapters/preface.adoc index 13afec1..abb11db 100644 --- a/common/chapters/preface.adoc +++ b/common/chapters/preface.adoc @@ -83,10 +83,11 @@ This version of the manual is endorsed by Harald Welte as the official version of the manual. +ifdef::gfdl-enabled[] While the GFDL license (see <>) permits anyone to create and distribute modified versions of this manual, such modified versions must remove the above endorsement. - +endif::[] == Preface @@ -221,7 +222,7 @@ ==== Documentation License -Please see <> for further information. +ifdef::gfdl-enabled[Please see <> for further information.] == Introduction -- To view, visit https://gerrit.osmocom.org/3736 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I2489726ad2e90301bceadfada926e31ae0f85986 Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Wed Aug 30 08:26:14 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Wed, 30 Aug 2017 08:26:14 +0000 Subject: [MERGED] openbsc[master]: SI13: drop PBCCH-related bits In-Reply-To: References: Message-ID: Max has submitted this change and it was merged. Change subject: SI13: drop PBCCH-related bits ...................................................................... SI13: drop PBCCH-related bits According to 3GPP TS 44.018 ?1.8 the "network shall never enable PBCCH and PCCCH". Change-Id: I319e71a4b0c682361529e9c21377398a826b934b Related: OS#2400 --- M openbsc/include/openbsc/rest_octets.h M openbsc/src/libbsc/rest_octets.c M openbsc/src/libbsc/system_information.c 3 files changed, 20 insertions(+), 69 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/openbsc/include/openbsc/rest_octets.h b/openbsc/include/openbsc/rest_octets.h index 49a2312..ca7b57c 100644 --- a/openbsc/include/openbsc/rest_octets.h +++ b/openbsc/include/openbsc/rest_octets.h @@ -62,12 +62,6 @@ /* Generate SI4 Rest Octets (Chapter 10.5.2.35) */ int rest_octets_si4(uint8_t *data, const struct gsm48_si_ro_info *si4, int len); -enum pbcch_carrier_type { - PBCCH_BCCH, - PBCCH_ARFCN, - PBCCH_MAIO -}; - /* TS 03.60 Chapter 6.3.3.1: Network Mode of Operation */ enum gprs_nmo { GPRS_NMO_I = 0, /* CS pagin on GPRS paging or traffic channel */ @@ -112,25 +106,10 @@ struct gprs_power_ctrl_pars pwr_ctrl_pars; uint8_t bcch_change_mark; uint8_t si_change_field; - uint8_t pbcch_present; - - union { - struct { - uint8_t rac; - uint8_t spgc_ccch_sup; - uint8_t net_ctrl_ord; - uint8_t prio_acc_thr; - } no_pbcch; - struct { - uint8_t psi1_rep_per; - uint8_t pb; - uint8_t tsc; - uint8_t tn; - enum pbcch_carrier_type carrier_type; - uint16_t arfcn; - uint8_t maio; - } pbcch; - }; + uint8_t rac; + uint8_t spgc_ccch_sup; + uint8_t net_ctrl_ord; + uint8_t prio_acc_thr; }; /* Generate SI13 Rest Octests (Chapter 10.5.2.37b) */ diff --git a/openbsc/src/libbsc/rest_octets.c b/openbsc/src/libbsc/rest_octets.c index fdab70a..78e7413 100644 --- a/openbsc/src/libbsc/rest_octets.c +++ b/openbsc/src/libbsc/rest_octets.c @@ -816,39 +816,16 @@ bitvec_set_uint(&bv, si13->bcch_change_mark, 2); append_gprs_mobile_alloc(&bv); } - if (!si13->pbcch_present) { - /* PBCCH not present in cell */ - bitvec_set_bit(&bv, 0); - bitvec_set_uint(&bv, si13->no_pbcch.rac, 8); - bitvec_set_bit(&bv, si13->no_pbcch.spgc_ccch_sup); - bitvec_set_uint(&bv, si13->no_pbcch.prio_acc_thr, 3); - bitvec_set_uint(&bv, si13->no_pbcch.net_ctrl_ord, 2); - append_gprs_cell_opt(&bv, &si13->cell_opts); - append_gprs_pwr_ctrl_pars(&bv, &si13->pwr_ctrl_pars); - } else { - /* PBCCH present in cell */ - bitvec_set_bit(&bv, 1); - bitvec_set_uint(&bv, si13->pbcch.psi1_rep_per, 4); - /* PBCCH Descripiton */ - bitvec_set_uint(&bv, si13->pbcch.pb, 4); - bitvec_set_uint(&bv, si13->pbcch.tsc, 3); - bitvec_set_uint(&bv, si13->pbcch.tn, 3); - switch (si13->pbcch.carrier_type) { - case PBCCH_BCCH: - bitvec_set_bit(&bv, 0); - bitvec_set_bit(&bv, 0); - break; - case PBCCH_ARFCN: - bitvec_set_bit(&bv, 0); - bitvec_set_bit(&bv, 1); - bitvec_set_uint(&bv, si13->pbcch.arfcn, 10); - break; - case PBCCH_MAIO: - bitvec_set_bit(&bv, 1); - bitvec_set_uint(&bv, si13->pbcch.maio, 6); - break; - } - } + /* PBCCH not present in cell: + it shall never be indicated according to 3GPP TS 44.018 Table 10.5.2.37b.1 */ + bitvec_set_bit(&bv, 0); + bitvec_set_uint(&bv, si13->rac, 8); + bitvec_set_bit(&bv, si13->spgc_ccch_sup); + bitvec_set_uint(&bv, si13->prio_acc_thr, 3); + bitvec_set_uint(&bv, si13->net_ctrl_ord, 2); + append_gprs_cell_opt(&bv, &si13->cell_opts); + append_gprs_pwr_ctrl_pars(&bv, &si13->pwr_ctrl_pars); + /* 3GPP TS 44.018 Release 6 / 10.5.2.37b */ bitvec_set_bit(&bv, H); /* added Release 99 */ /* claim our SGSN is compatible with Release 99, as EDGE and EGPRS diff --git a/openbsc/src/libbsc/system_information.c b/openbsc/src/libbsc/system_information.c index dcabbbd..2bc8769 100644 --- a/openbsc/src/libbsc/system_information.c +++ b/openbsc/src/libbsc/system_information.c @@ -1079,15 +1079,10 @@ }, .bcch_change_mark = 1, .si_change_field = 0, - .pbcch_present = 0, - { - .no_pbcch = { - .rac = 0, /* needs to be patched */ - .spgc_ccch_sup = 0, - .net_ctrl_ord = 0, - .prio_acc_thr = 6, - }, - }, + .rac = 0, /* needs to be patched */ + .spgc_ccch_sup = 0, + .net_ctrl_ord = 0, + .prio_acc_thr = 6, }; static int generate_si13(enum osmo_sysinfo_type t, struct gsm_bts *bts) @@ -1102,8 +1097,8 @@ si13->header.skip_indicator = 0; si13->header.system_information = GSM48_MT_RR_SYSINFO_13; - si13_default.no_pbcch.rac = bts->gprs.rac; - si13_default.no_pbcch.net_ctrl_ord = bts->gprs.net_ctrl_ord; + si13_default.rac = bts->gprs.rac; + si13_default.net_ctrl_ord = bts->gprs.net_ctrl_ord; si13_default.cell_opts.ctrl_ack_type_use_block = bts->gprs.ctrl_ack_type_use_block; -- To view, visit https://gerrit.osmocom.org/3734 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I319e71a4b0c682361529e9c21377398a826b934b Gerrit-PatchSet: 3 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Wed Aug 30 09:09:40 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Wed, 30 Aug 2017 09:09:40 +0000 Subject: [MERGED] libosmocore[master]: Add define for supported a5 key length limit In-Reply-To: References: Message-ID: Max has submitted this change and it was merged. Change subject: Add define for supported a5 key length limit ...................................................................... Add define for supported a5 key length limit Change-Id: I8ed0f1dbc31aaff22a685ceb3bd2f8db4d2f34fd --- M include/osmocom/crypt/auth.h 1 file changed, 3 insertions(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/include/osmocom/crypt/auth.h b/include/osmocom/crypt/auth.h index 6d2c783..2f2a8d3 100644 --- a/include/osmocom/crypt/auth.h +++ b/include/osmocom/crypt/auth.h @@ -8,6 +8,8 @@ #include +#define OSMO_A5_MAX_KEY_LEN_BYTES (128/8) + /*! Authentication Type (GSM/UMTS) */ enum osmo_sub_auth_type { OSMO_AUTH_TYPE_NONE = 0x00, @@ -42,7 +44,7 @@ uint64_t sqn_ms; /*!< sqn from AUTS (output value only) */ } umts; struct { - uint8_t ki[16]; /*!< secret key */ + uint8_t ki[OSMO_A5_MAX_KEY_LEN_BYTES]; /*!< secret key */ } gsm; } u; }; -- To view, visit https://gerrit.osmocom.org/3706 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I8ed0f1dbc31aaff22a685ceb3bd2f8db4d2f34fd Gerrit-PatchSet: 2 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max From gerrit-no-reply at lists.osmocom.org Wed Aug 30 12:11:53 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 30 Aug 2017 12:11:53 +0000 Subject: [PATCH] osmo-bsc[master]: split off osmo-bsc: remove files, apply build Message-ID: Review at https://gerrit.osmocom.org/3737 split off osmo-bsc: remove files, apply build Change-Id: I64d84c52f6e38e98144eb9be8f0ab82e0e1f6cca --- M configure.ac M include/openbsc/Makefile.am D include/openbsc/a_iface.h D include/openbsc/a_iface_bssap.h M include/openbsc/bsc_api.h M include/openbsc/common_cs.h D include/openbsc/db.h D include/openbsc/gb_proxy.h D include/openbsc/gprs_gb_parse.h D include/openbsc/gprs_gmm.h D include/openbsc/gprs_llc.h D include/openbsc/gprs_llc_xid.h D include/openbsc/gprs_sgsn.h D include/openbsc/gprs_sndcp.h D include/openbsc/gprs_sndcp_comp.h D include/openbsc/gprs_sndcp_dcomp.h D include/openbsc/gprs_sndcp_pcomp.h D include/openbsc/gprs_sndcp_xid.h D include/openbsc/gprs_subscriber.h D include/openbsc/gprs_utils.h D include/openbsc/gsm_04_08.h A include/openbsc/gsm_04_08_utils.h D include/openbsc/gsm_04_11.h M include/openbsc/gsm_data.h M include/openbsc/gsm_data_shared.h D include/openbsc/gsup_client.h D include/openbsc/gtphub.h D include/openbsc/iucs.h D include/openbsc/iucs_ranap.h D include/openbsc/oap_client.h M include/openbsc/rest_octets.h D include/openbsc/slhc.h M include/openbsc/transaction.h D include/openbsc/v42bis.h D include/openbsc/v42bis_private.h D include/openbsc/vlr.h M osmoappdesc.py M src/Makefile.am D src/gprs/.gitignore D src/gprs/Makefile.am D src/gprs/crc24.c D src/gprs/gb_proxy.c D src/gprs/gb_proxy_main.c D src/gprs/gb_proxy_patch.c D src/gprs/gb_proxy_peer.c D src/gprs/gb_proxy_tlli.c D src/gprs/gb_proxy_vty.c D src/gprs/gprs_gb_parse.c D src/gprs/gprs_gmm.c D src/gprs/gprs_llc.c D src/gprs/gprs_llc_parse.c D src/gprs/gprs_llc_vty.c D src/gprs/gprs_llc_xid.c D src/gprs/gprs_sgsn.c D src/gprs/gprs_sndcp.c D src/gprs/gprs_sndcp_comp.c D src/gprs/gprs_sndcp_dcomp.c D src/gprs/gprs_sndcp_pcomp.c D src/gprs/gprs_sndcp_vty.c D src/gprs/gprs_sndcp_xid.c D src/gprs/gprs_subscriber.c D src/gprs/gprs_utils.c D src/gprs/gtphub.c D src/gprs/gtphub_ares.c D src/gprs/gtphub_main.c D src/gprs/gtphub_sock.c D src/gprs/gtphub_vty.c D src/gprs/osmo_sgsn.cfg D src/gprs/sgsn_ares.c D src/gprs/sgsn_auth.c D src/gprs/sgsn_cdr.c D src/gprs/sgsn_ctrl.c D src/gprs/sgsn_libgtp.c D src/gprs/sgsn_main.c D src/gprs/sgsn_vty.c D src/gprs/slhc.c D src/gprs/v42bis.c M src/libbsc/abis_rsl.c M src/libbsc/bsc_api.c M src/libbsc/bsc_init.c M src/libbsc/bsc_vty.c M src/libbsc/chan_alloc.c M src/libbsc/gsm_04_08_utils.c M src/libbsc/handover_logic.c M src/libbsc/net_init.c M src/libbsc/paging.c M src/libbsc/system_information.c M src/libcommon-cs/common_cs.c M src/libcommon/Makefile.am M src/libcommon/gsm_data.c M src/libcommon/gsm_subscriber_base.c D src/libcommon/gsup_client.c D src/libcommon/gsup_test_client.c M src/libfilter/bsc_msg_filter.c D src/libmsc/Makefile.am D src/libmsc/a_iface.c D src/libmsc/a_iface_bssap.c D src/libmsc/auth.c D src/libmsc/ctrl_commands.c D src/libmsc/db.c D src/libmsc/gsm_04_08.c D src/libmsc/gsm_04_11.c D src/libmsc/gsm_04_80.c D src/libmsc/gsm_subscriber.c D src/libmsc/iu_dummy.c D src/libmsc/iucs.c D src/libmsc/iucs_ranap.c D src/libmsc/meas_feed.c D src/libmsc/meas_feed.h D src/libmsc/mncc.c D src/libmsc/mncc_builtin.c D src/libmsc/mncc_sock.c D src/libmsc/msc_ifaces.c D src/libmsc/msc_vty.c D src/libmsc/osmo_msc.c D src/libmsc/rrlp.c D src/libmsc/silent_call.c D src/libmsc/smpp_openbsc.c D src/libmsc/smpp_smsc.c D src/libmsc/smpp_smsc.h D src/libmsc/smpp_utils.c D src/libmsc/smpp_vty.c D src/libmsc/sms_queue.c D src/libmsc/subscr_conn.c D src/libmsc/transaction.c D src/libmsc/ussd.c D src/libmsc/vty_interface_layer3.c D src/libvlr/Makefile.am D src/libvlr/vlr.c D src/libvlr/vlr_access_req_fsm.c D src/libvlr/vlr_access_req_fsm.h D src/libvlr/vlr_auth_fsm.c D src/libvlr/vlr_auth_fsm.h D src/libvlr/vlr_core.h D src/libvlr/vlr_lu_fsm.c D src/libvlr/vlr_lu_fsm.h M src/osmo-bsc/Makefile.am M src/osmo-bsc/osmo_bsc_api.c M src/osmo-bsc/osmo_bsc_bssap.c M src/osmo-bsc/osmo_bsc_filter.c M src/osmo-bsc/osmo_bsc_main.c M src/osmo-bsc_nat/bsc_nat_rewrite.c M src/osmo-bsc_nat/bsc_nat_vty.c M src/osmo-bsc_nat/bsc_ussd.c D src/osmo-msc/Makefile.am D src/osmo-msc/msc_main.c M tests/Makefile.am M tests/channel/Makefile.am M tests/channel/channel_test.c D tests/db/Makefile.am D tests/db/db_test.c D tests/db/db_test.err D tests/db/db_test.ok D tests/db/hlr.sqlite3 D tests/gbproxy/Makefile.am D tests/gbproxy/gbproxy_test.c D tests/gbproxy/gbproxy_test.ok D tests/gprs/Makefile.am D tests/gprs/gprs_test.c D tests/gprs/gprs_test.ok M tests/gsm0408/gsm0408_test.c D tests/gtphub/Makefile.am D tests/gtphub/gtphub_test.c D tests/gtphub/gtphub_test.ok D tests/msc_vlr/Makefile.am D tests/msc_vlr/msc_vlr_test_gsm_authen.c D tests/msc_vlr/msc_vlr_test_gsm_authen.err D tests/msc_vlr/msc_vlr_test_gsm_authen.ok D tests/msc_vlr/msc_vlr_test_gsm_ciph.c D tests/msc_vlr/msc_vlr_test_gsm_ciph.err D tests/msc_vlr/msc_vlr_test_gsm_ciph.ok D tests/msc_vlr/msc_vlr_test_hlr_reject.c D tests/msc_vlr/msc_vlr_test_hlr_reject.err D tests/msc_vlr/msc_vlr_test_hlr_reject.ok D tests/msc_vlr/msc_vlr_test_hlr_timeout.c D tests/msc_vlr/msc_vlr_test_hlr_timeout.err D tests/msc_vlr/msc_vlr_test_hlr_timeout.ok D tests/msc_vlr/msc_vlr_test_ms_timeout.c D tests/msc_vlr/msc_vlr_test_ms_timeout.err D tests/msc_vlr/msc_vlr_test_ms_timeout.ok D tests/msc_vlr/msc_vlr_test_no_authen.c D tests/msc_vlr/msc_vlr_test_no_authen.err D tests/msc_vlr/msc_vlr_test_no_authen.ok D tests/msc_vlr/msc_vlr_test_reject_concurrency.c D tests/msc_vlr/msc_vlr_test_reject_concurrency.err D tests/msc_vlr/msc_vlr_test_reject_concurrency.ok D tests/msc_vlr/msc_vlr_test_rest.c D tests/msc_vlr/msc_vlr_test_rest.err D tests/msc_vlr/msc_vlr_test_rest.ok D tests/msc_vlr/msc_vlr_test_umts_authen.c D tests/msc_vlr/msc_vlr_test_umts_authen.err D tests/msc_vlr/msc_vlr_test_umts_authen.ok D tests/msc_vlr/msc_vlr_tests.c D tests/msc_vlr/msc_vlr_tests.h M tests/nanobts_omlattr/Makefile.am M tests/nanobts_omlattr/nanobts_omlattr_test.c D tests/oap/Makefile.am D tests/oap/oap_client_test.c D tests/oap/oap_client_test.err D tests/oap/oap_client_test.ok D tests/sgsn/Makefile.am D tests/sgsn/sgsn_test.c D tests/sgsn/sgsn_test.ok D tests/slhc/Makefile.am D tests/slhc/slhc_test.c D tests/slhc/slhc_test.ok D tests/smpp/Makefile.am D tests/smpp/smpp_test.c D tests/smpp/smpp_test.err D tests/smpp/smpp_test.ok D tests/smpp_test_runner.py D tests/sms_queue/Makefile.am D tests/sms_queue/sms_queue_test.c D tests/sms_queue/sms_queue_test.err D tests/sms_queue/sms_queue_test.ok D tests/sndcp_xid/Makefile.am D tests/sndcp_xid/sndcp_xid_test.c D tests/sndcp_xid/sndcp_xid_test.ok M tests/testsuite.at D tests/v42bis/Makefile.am D tests/v42bis/v42bis_test.c D tests/v42bis/v42bis_test.ok M tests/vty_test_runner.py D tests/xid/Makefile.am D tests/xid/xid_test.c D tests/xid/xid_test.ok 226 files changed, 100 insertions(+), 87,177 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/37/3737/1 -- To view, visit https://gerrit.osmocom.org/3737 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I64d84c52f6e38e98144eb9be8f0ab82e0e1f6cca Gerrit-PatchSet: 1 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Wed Aug 30 12:11:53 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 30 Aug 2017 12:11:53 +0000 Subject: [PATCH] osmo-bsc[master]: rework /debian package support to match new osmo-bsc Message-ID: Review at https://gerrit.osmocom.org/3738 rework /debian package support to match new osmo-bsc Remove leftover from split out of openbsc Change-Id: I9fe1003f7d2af5c6a07c41aec59ea91594b825bd --- D debian/autoreconf M debian/changelog M debian/control M debian/copyright D debian/docs D debian/openbsc-dev.install A debian/osmo-bsc.install D debian/osmo-gtphub.default D debian/osmo-gtphub.examples D debian/osmo-gtphub.init D debian/osmo-gtphub.install D debian/osmocom-bs11-utils.install D debian/osmocom-bsc-nat.init D debian/osmocom-bsc-nat.install D debian/osmocom-bsc.examples D debian/osmocom-bsc.install D debian/osmocom-gbproxy.init D debian/osmocom-gbproxy.install D debian/osmocom-ipaccess-utils.install D debian/osmocom-nitb.default D debian/osmocom-nitb.dirs D debian/osmocom-nitb.examples D debian/osmocom-nitb.init D debian/osmocom-nitb.install D debian/osmocom-sgsn.default D debian/osmocom-sgsn.examples D debian/osmocom-sgsn.init D debian/osmocom-sgsn.install M debian/rules 29 files changed, 215 insertions(+), 1,180 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/38/3738/1 diff --git a/debian/autoreconf b/debian/autoreconf deleted file mode 100644 index 9a3a67f..0000000 --- a/debian/autoreconf +++ /dev/null @@ -1 +0,0 @@ -openbsc diff --git a/debian/changelog b/debian/changelog index e9a4212..28b5ebf 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,75 +1,5 @@ -openbsc (0.15.1) UNRELEASED; urgency=medium +osmo-bsc (0.1.0) UNRELEASED; urgency=low - * Move forward toward a new release. - * Prevent SGSN starting with 'auth-policy remote' when no 'gsup remote-*' are configured. - Note: such configs are broken without extra workarounds anyway. + * Initial release. - -- Holger Hans Peter Freyther Tue, 24 May 2016 23:14:31 +0200 - -openbsc (0.14.0) unstable; urgency=low - - * New upstream tag and additional patches. - - -- Holger Hans Peter Freyther Sat, 14 Mar 2015 20:33:25 +0100 - -openbsc (0.12.0+git26-7) unstable; urgency=low - - * 64bit fix for the MGCP rewriting - - -- Holger Hans Peter Freyther Wed, 07 Nov 2012 11:39:34 +0100 - -openbsc (0.12.0+git26-6) precise; urgency=low - - * Added init script for osmocom-sgsn. - - -- Eric Butler Fri, 24 Aug 2012 21:04:32 -0700 - -openbsc (0.12.0+git26-5) precise; urgency=low - - * Don't enable MNCC sock by default. - * Automatically create important directories. - * Fix init script 'stop' command. - - -- Eric Butler Fri, 24 Aug 2012 20:56:33 -0700 - -openbsc (0.12.0+git26-4) precise; urgency=low - - * Specify HLR path and enable RTP proxy. - - -- Eric Butler Mon, 20 Aug 2012 00:21:07 -0700 - -openbsc (0.12.0+git26-3) precise; urgency=low - - * Fix init script. - - -- Eric Butler Sun, 19 Aug 2012 16:05:44 -0700 - -openbsc (0.12.0+git26-2) precise; urgency=low - - * Fix libdbi package dependency. - - -- Eric Butler Wed, 15 Aug 2012 00:35:37 -0700 - -openbsc (0.12.0+git26-1) precise; urgency=low - - * Fix version issue. - - -- Eric Butler Tue, 14 Aug 2012 21:00:51 -0700 - -openbsc (0.12.0+git26) precise; urgency=low - - * Updated ubuntu package. - - -- Eric Butler Tue, 14 Aug 2012 17:36:51 -0700 - -openbsc (0.9.13.115.eb113-1) natty; urgency=low - - * New upstream release - - -- Harald Welte Wed, 11 May 2011 18:41:24 +0000 - -openbsc (0.9.4-1) unstable; urgency=low - - * Initial release - - -- Harald Welte Tue, 24 Aug 2010 13:34:24 +0200 + -- Alexander Couzens Tue, 08 Aug 2017 01:12:56 +0000 diff --git a/debian/control b/debian/control index 87b6f07..e6e5724 100644 --- a/debian/control +++ b/debian/control @@ -1,181 +1,42 @@ -Source: openbsc -Maintainer: Harald Welte +Source: osmo-bsc Section: net -Priority: optional -Build-Depends: debhelper (>= 9), +Priority: extra +Maintainer: Alexander Couzens +Build-Depends: debhelper (>=9), + dh-autoreconf, autotools-dev, - autoconf-archive, + autoconf, + automake, + libtool, pkg-config, + python-minimal, + libdbi-dev, + libssl-dev, + libsctp-dev, + libtalloc-dev, + libasn1c-dev, + libc-ares-dev, libgtp-dev, libosmocore-dev, libosmo-sccp-dev, - libdbi0-dev, - dh-autoreconf, + libosmo-ranap-dev, libosmo-abis-dev, libosmo-netif-dev, - libdbd-sqlite3, - libpcap-dev, - libssl-dev, - libc-ares-dev, - libsmpp34-dev + libosmo-legacy-mgcp-dev Standards-Version: 3.9.8 -Vcs-Git: git://bs11-abis.gnumonks.org/openbsc.git -Vcs-Browser: http://openbsc.osmocom.org/trac/browser -Homepage: https://projects.osmocom.org/projects/openbsc +Vcs-Git: git://git.osmocom.org/osmo-bsc.git +Vcs-Browser: https://git.osmocom.org/osmo-bsc/ +Homepage: https://projects.osmocom.org/projects/osmo-bsc -Package: osmocom-bsc +Package: osmo-bsc Architecture: any -Depends: ${shlibs:Depends}, - ${misc:Depends} -Description: GSM Base Station Controller - This is the BSC-only version of OpenBSC. It requires a Mobile Switching Center - (MSC) to operate. - . - You might rather prefer to use osmocom-nitb which is considered a - "GSM Network-in-a-Box" and does not depend on a MSC. +Multi-Arch: foreign +Depends: ${misc:Depends}, ${shlibs:Depends} +Description: OsmoBSC: Osmocom's Base Station Controller for 2G circuit-switched mobile networks -Package: osmocom-nitb -Architecture: any -Depends: ${shlibs:Depends}, - ${misc:Depends}, - libdbd-sqlite3 -Description: GSM Network-in-a-Box, implements BSC, MSC, SMSC, HLR, VLR - This is the Network-in-a-Box version of OpenBSC. It has all the GSM network - components bundled together. When using osmocom-nitb, there is no need for a - Mobile Switching Center (MSC) which is needed when using osmocom-bsc. - -Package: osmocom-ipaccess-utils -Architecture: any -Depends: ${shlibs:Depends}, - ${misc:Depends} -Description: Command line utilities for ip.access nanoBTS - This package contains utilities that are specific for nanoBTS when being used - together with OpenBSC. It contains mainly three tools: ipaccess-find, - ipaccess-config and ipaccess-proxy. - -Package: osmocom-bs11-utils -Architecture: any -Depends: ${shlibs:Depends}, - ${misc:Depends} -Description: Command line utilities for Siemens BS-11 BTS - There is a tool in this package for configuring the Siemens BS-11 BTS. - Additionally, it contains one tool for making use of an ISDN-card and the - public telephone network as frequency standard for the E1 line. - -Package: osmocom-sgsn -Architecture: any -Depends: ${shlibs:Depends}, - ${misc:Depends} -Suggests: osmocom-bsc -Description: Osmocom Serving GPRS Support Node - This is an implementation of the GPRS Serving GPRS Support Node (SGSN). As - such it implements the GPRS Mobility Management (GMM) and SM (Session - Management). - . - The SGSN connects via the Gb-interface to the BSS (like the osmo-pcu or an - ip.access nanoBTS), and it connects via the GTP protocol to a Gateway GPRS - Support Node (GGSN) like openggsn. - -Package: osmocom-gbproxy -Architecture: any -Depends: ${shlibs:Depends}, - ${misc:Depends} -Recommends: osmocom-sgsn -Description: Osmocom GPRS Gb Interface Proxy - The purpose of the Gb proxy is to aggregate the Gb links of multiple - BSS's and present them in one Gb link to the SGSN. - . - This package is part of OpenBSC and closely related to osmocom-sgsn. - -Package: osmocom-bsc-nat -Architecture: any -Depends: ${shlibs:Depends}, - ${misc:Depends} -Recommends: osmocom-bsc -Description: Osmocom Base Station Controller Network Address Translation - This NAT is useful for masquerading multiple BSCs behind one. It listens - for incoming BSCs on port 5000 and connects to a specified Mobile Switching - Center (MSC). - . - This package is part of OpenBSC and closely related to osmocom-bsc. - -Package: openbsc-dev -Architecture: all -Depends: ${misc:Depends} -Description: Header file needed by tools tightly integrated - Some other programs depend on gsm_data_shared.h and gsm_data_shared.c - from OpenBSC. This package installs these files to your file system so - that the other packages can build-depend on this package. - . - The directory structure is copied after the structure in the repository - and the header and .c file are installed into /usr/src/osmocom/openbsc/. - -Package: osmo-gtphub -Architecture: any -Depends: ${shlibs:Depends}, ${misc:Depends} -Description: Osmocom GTP Hub - Proxy for comms between multiple SGSNs and GGSNs. - -Package: osmocom-bsc-dbg -Architecture: any +Package: osmo-bsc-dbg Section: debug -Priority: extra -Depends: osmocom-bsc (= ${binary:Version}), ${misc:Depends} -Description: Debug symbols for the OpenBSC BSC - Make debugging possible - -Package: osmocom-nitb-dbg Architecture: any -Section: debug -Priority: extra -Depends: osmocom-nitb (= ${binary:Version}), ${misc:Depends} -Description: Debug symbols for the OpenBSC NITB - Make debugging possible - -Package: osmocom-ipaccess-utils-dbg -Architecture: any -Section: debug -Priority: extra -Depends: osmocom-ipaccess-utils (= ${binary:Version}), ${misc:Depends} -Description: Debug symbols for the OpenBSC ip.access utils - Make debugging possible - -Package: osmocom-bs11-utils-dbg -Architecture: any -Section: debug -Priority: extra -Depends: osmocom-bs11-utils (= ${binary:Version}), ${misc:Depends} -Description: Debug symbols for the OpenBSC BS11 utils - Make debugging possible - -Package: osmocom-sgsn-dbg -Architecture: any -Section: debug -Priority: extra -Depends: osmocom-sgsn (= ${binary:Version}), ${misc:Depends} -Description: Debug symbols for the OpenBSC Serving GPRS Support Node - Make debugging possible - -Package: osmocom-gbproxy-dbg -Architecture: any -Section: debug -Priority: extra -Depends: osmocom-gbproxy (= ${binary:Version}), ${misc:Depends} -Description: Debug symbols for the OpenBSC GPRS GBProxy - Make debugging possible - -Package: osmocom-bsc-nat-dbg -Architecture: any -Section: debug -Priority: extra -Depends: osmocom-bsc-nat (= ${binary:Version}), ${misc:Depends} -Description: Debug symbols for the OpenBSC Network Address Translation - Make debugging possible - -Package: osmo-gtphub-dbg -Architecture: any -Section: debug -Priority: extra -Depends: osmo-gtphub (= ${binary:Version}), ${misc:Depends} -Description: Debug symbols for Osmocom GTP Hub - Make debugging possible +Multi-Arch: same +Depends: osmo-bsc (= ${binary:Version}), ${misc:Depends} +Description: OsmoBSC: Osmocom's Base Station Controller for 2G circuit-switched mobile networks diff --git a/debian/copyright b/debian/copyright index 1e4dee1..c748589 100644 --- a/debian/copyright +++ b/debian/copyright @@ -1,74 +1,18 @@ Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ -Upstream-Name: OpenBSC -Source: http://openbsc.osmocom.org/ +Upstream-Name: osmo-bsc +Source: git://git.osmocom.org/osmo-bsc -Files: * -Copyright: 2008-2015 Harald Welte - 2008-2015 Holger Hans Peter Freyther - 2009-2015 On-Waves - 2008 Jan Luebbe - 2008,2010-2011 Daniel Willmann - 2009,2011,2013 Andreas Eversberg - 2009,2011 Dieter Spaar - 2009 Mike Haben - 2010 Sylvain Munaut <246tnt at gmail.com> - 2012-2013 Pablo Neira Ayuso - 2013-2015 Sysmocom s.f.m.c. GmbH (Jacob Erlbeck) - 2014 Alexander Chemeris -License: AGPL-3+ -Comment: Contributions by Stefan Schmidt as well - -Files: wireshark/0001-abis_oml.patch - wireshark/0002-ericsson_rbs2409.patch - wireshark/0003-lucent-hnb.patch - wireshark/0005-rsl-hsl.patch -Copyright: 1998 Gerald Combs - 2007,2011 Anders Broman - 2009 Holger Hans Peter Freyther - 2009-2011 Harald Welte -License: GPL-2+ - -Files: openbsc/include/mISDNif.h -Copyright: 2008 Karsten Keil -License: LGPL-2.1 - -Files: openbsc/src/libmgcp/g711common.h -Copyright: 2009 Abramo Bagnara -License: GPL-2+ - -Files: openbsc/git-version-gen -Copyright: 2007-2010 Free Software Foundation -License: GPL-3+ - -Files: openbsc/osmoappdesc.py - openbsc/tests/smpp_test_runner.py - openbsc/tests/ctrl_test_runner.py - openbsc/tests/vty_test_runner.py -Copyright: 2013 Katerina Barone-Adesi - 2013 Jacob Erlbeck - 2013-2014 Holger Hans Peter Freyther -License: GPL-3+ - -Files: openbsc/src/libbsc/bsc_ctrl_lookup.c -Copyright: 2010-2011 Daniel Willmann - 2010-2011 On-Waves -License: GPL-2+ - -Files: openbsc/src/libmsc/mncc_sock.c - openbsc/src/libmsc/mncc_builtin.c -Copyright: 2008-2010 Harald Welte - 2009 Andreas Eversberg - 2012 Holger Hans Peter Freyther -License: GPL-2+ - -Files: debian/* -Copyright: 2012-2015 Holger Hans Peter Freyther - 2016 Ruben Undheim -License: GPL-2+ - - -License: AGPL-3+ - This package is free software; you can redistribute it and/or modify +Files: * +Copyright: 2008-2015 Holger Hans Peter Freyther + 2008-2016 Harald Welte + 2009-2015 On-Waves + 2010-2011 Daniel Willmann + 2011-2017 sysmocom s.f.m.c. GmbH + 2014-2015 Alexander Chemeris + 2008 Jan Luebbe + 2013 Andreas Eversberg +License: AGPL-3.0+ + This program is free software; you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. @@ -76,62 +20,129 @@ This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. + GNU Affero General Public License for more details. . You should have received a copy of the GNU Affero General Public License along with this program. If not, see . - -License: GPL-2+ - This package is free software: you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 2 of the License, or (at - your option) any later version. +Files: src/libbsc/bsc_ctrl_lookup.c + src/libbsc/pcu_sock.c +Copyright: 2008-2010 Harald Welte + 2009-2012 Andreas Eversberg + 2010-2011 Daniel Willmann + 2010-2011 On-Waves + 2012 Holger Hans Peter Freyther +License: GPL-2.0+ + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. . - This program is distributed in the hope that it will be useful, but - WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - for more details. - . - You should have received a copy of the GNU General Public License - along with this program. If not, see . - . - On Debian systems, the complete text of the GNU General Public - License version 2 can be found in "/usr/share/common-licenses/GPL-2". - - -License: GPL-3+ - This package is free software: you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or (at - your option) any later version. - . - This program is distributed in the hope that it will be useful, but - WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - for more details. - . - You should have received a copy of the GNU General Public License - along with this program. If not, see . - . - On Debian systems, the complete text of the GNU General Public - License version 3 can be found in "/usr/share/common-licenses/GPL-3". - - -License: LGPL-2.1 - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; version - 2.1 of the License. - . - This library is distributed in the hope that it will be useful, + This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. . - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, see . + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. . - On Debian systems, the complete text of the GNU Lesser General - Public License version 2.1 can be found in - "/usr/share/common-licenses/LGPL-2.1". + On Debian systems, the complete text of the GNU General Public License + Version 2 can be found in `/usr/share/common-licenses/GPL-2'. + +Files: osmoappdesc.py +Copyright: 2013 Katerina Barone-Adesi +License: GPL-3.0+ + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + . + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + . + You should have received a copy of the GNU General Public License + along with this program. If not, see + . + Most systems won't be able to use these, so they're separated out + . + On Debian systems, the complete text of the GNU General Public License + Version 3 can be found in `/usr/share/common-licenses/GPL-3'. + +Files: tests/vty_test_runner.py +Copyright: 2013 Holger Hans Peter Freyther + 2013 Katerina Barone-Adesi +License: GPL-3.0+ + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + . + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + . + You should have received a copy of the GNU General Public License + along with this program. If not, see . + . + On Debian systems, the complete text of the GNU General Public License + Version 3 can be found in `/usr/share/common-licenses/GPL-3'. + +Files: include/mISDNif.h +Copyright: 2008 Karsten Keil +License: LGPL-2.1 + This code is free software; you can redistribute it and/or modify + it under the terms of the GNU LESSER GENERAL PUBLIC LICENSE + version 2.1 as published by the Free Software Foundation. + . + This code is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU LESSER GENERAL PUBLIC LICENSE for more details. + . + On Debian systems, the complete text of the GNU Lesser General Public License + Version 2.1 can be found in `/usr/share/common-licenses/LGPL-2.1'. + +Files: include/openbsc/bsc_msc_data.h +Copyright: 2010-2015 Holger Hans Peter Freyther + 2010-2015 On-Waves +License: AGPL-3.0+ + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU Affero General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + . + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Affero General Public License for more details. + . + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see . + . + NOTE: This is about a *remote* MSC for OsmoBSC and is not part of libmsc. + +Files: src/libbsc/bts_nokia_site.c +Copyright: 2011 Dieter Spaar +License: AGPL-3.0+ + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU Affero General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + . + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Affero General Public License for more details. + . + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see . + . + TODO: Attention: There are some static variables used for states during + configuration. Those variables have to be moved to a BTS specific context, + otherwise there will most certainly be problems if more than one Nokia BTS + is used. + diff --git a/debian/docs b/debian/docs deleted file mode 100644 index cd545c2..0000000 --- a/debian/docs +++ /dev/null @@ -1 +0,0 @@ -openbsc/README diff --git a/debian/openbsc-dev.install b/debian/openbsc-dev.install deleted file mode 100644 index 0c05545..0000000 --- a/debian/openbsc-dev.install +++ /dev/null @@ -1,4 +0,0 @@ -openbsc/include/openbsc/gsm_data_shared.h usr/src/osmocom/openbsc/openbsc/include/openbsc/ -openbsc/include/openbsc/common_cs.h usr/src/osmocom/openbsc/openbsc/include/openbsc/ -openbsc/src/libcommon/gsm_data_shared.c usr/src/osmocom/openbsc/openbsc/src/libcommon/ -usr/lib/*/pkgconfig/openbsc.pc diff --git a/debian/osmo-bsc.install b/debian/osmo-bsc.install new file mode 100644 index 0000000..85e2103 --- /dev/null +++ b/debian/osmo-bsc.install @@ -0,0 +1,2 @@ +usr/bin +usr/share/doc/openbsc/examples/osmo-bsc diff --git a/debian/osmo-gtphub.default b/debian/osmo-gtphub.default deleted file mode 100644 index 6af82da..0000000 --- a/debian/osmo-gtphub.default +++ /dev/null @@ -1,2 +0,0 @@ -CONFIG_FILE="/etc/osmocom/osmo-gtphub.cfg" - diff --git a/debian/osmo-gtphub.examples b/debian/osmo-gtphub.examples deleted file mode 100644 index 48c2dc0..0000000 --- a/debian/osmo-gtphub.examples +++ /dev/null @@ -1 +0,0 @@ -openbsc/doc/examples/osmo-gtphub diff --git a/debian/osmo-gtphub.init b/debian/osmo-gtphub.init deleted file mode 100755 index 160d55b..0000000 --- a/debian/osmo-gtphub.init +++ /dev/null @@ -1,150 +0,0 @@ -#!/bin/sh -### BEGIN INIT INFO -# Provides: osmo-gtphub -# Required-Start: $network $local_fs -# Required-Stop: -# Default-Start: 2 3 4 5 -# Default-Stop: 0 1 6 -# Short-Description: Osmocom GTP hub -# Description: Osmocom GTP hub -### END INIT INFO - -# Author: Neels Hofmeyr - -# PATH should only include /usr/* if it runs after the mountnfs.sh script -PATH=/sbin:/usr/sbin:/bin:/usr/bin -NAME=osmo-gtphub # Introduce the short server's name here -DESC="Osmocom GTP hub" # Introduce a short description here -DAEMON=/usr/bin/osmo-gtphub # Introduce the server's location here -SCRIPTNAME=/etc/init.d/osmo-gtphub - -# Exit if the package is not installed -[ -x $DAEMON ] || exit 0 - -# Read configuration variable file if it is present -[ -r /etc/default/osmo-gtphub ] && . /etc/default/osmo-gtphub - -# Load the VERBOSE setting and other rcS variables -. /lib/init/vars.sh - -# Define LSB log_* functions. -# Depend on lsb-base (>= 3.0-6) to ensure that this file is present. -. /lib/lsb/init-functions - -DAEMON_ARGS="$DAEMON_ARGS -D -c $CONFIG_FILE" - -# -# Function that starts the daemon/service -# -do_start() -{ - # Return - # 0 if daemon has been started - # 1 if daemon was already running - # 2 if daemon could not be started - start-stop-daemon --start --quiet --exec $DAEMON --test > /dev/null \ - || return 1 - start-stop-daemon --start --quiet --exec $DAEMON -- \ - $DAEMON_ARGS \ - || return 2 - # Add code here, if necessary, that waits for the process to be ready - # to handle requests from services started subsequently which depend - # on this one. As a last resort, sleep for some time. -} - -# -# Function that stops the daemon/service -# -do_stop() -{ - # Return - # 0 if daemon has been stopped - # 1 if daemon was already stopped - # 2 if daemon could not be stopped - # other if a failure occurred - start-stop-daemon --stop --quiet --retry=TERM/30/KILL/5 --name $NAME - RETVAL="$?" - [ "$RETVAL" = 2 ] && return 2 - # Wait for children to finish too if this is a daemon that forks - # and if the daemon is only ever run from this initscript. - # If the above conditions are not satisfied then add some other code - # that waits for the process to drop all resources that could be - # needed by services started subsequently. A last resort is to - # sleep for some time. - start-stop-daemon --stop --quiet --oknodo --retry=0/30/KILL/5 --exec $DAEMON - [ "$?" = 2 ] && return 2 - return "$RETVAL" -} - -# -# Function that sends a SIGHUP to the daemon/service -# -do_reload() { - # - # If the daemon can reload its configuration without - # restarting (for example, when it is sent a SIGHUP), - # then implement that here. - # - start-stop-daemon --stop --signal 1 --quiet $PIDFILE --name $NAME - return 0 -} - -case "$1" in - start) - [ "$VERBOSE" != no ] && log_daemon_msg "Starting $DESC " "$NAME" - do_start - case "$?" in - 0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;; - 2) [ "$VERBOSE" != no ] && log_end_msg 1 ;; - esac - ;; - stop) - [ "$VERBOSE" != no ] && log_daemon_msg "Stopping $DESC" "$NAME" - do_stop - case "$?" in - 0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;; - 2) [ "$VERBOSE" != no ] && log_end_msg 1 ;; - esac - ;; - status) - status_of_proc "$DAEMON" "$NAME" && exit 0 || exit $? - ;; - #reload|force-reload) - # - # If do_reload() is not implemented then leave this commented out - # and leave 'force-reload' as an alias for 'restart'. - # - #log_daemon_msg "Reloading $DESC" "$NAME" - #do_reload - #log_end_msg $? - #;; - restart|force-reload) - # - # If the "reload" option is implemented then remove the - # 'force-reload' alias - # - log_daemon_msg "Restarting $DESC" "$NAME" - do_stop - case "$?" in - 0|1) - do_start - case "$?" in - 0) log_end_msg 0 ;; - 1) log_end_msg 1 ;; # Old process is still running - *) log_end_msg 1 ;; # Failed to start - esac - ;; - *) - # Failed to stop - log_end_msg 1 - ;; - esac - ;; - *) - #echo "Usage: $SCRIPTNAME {start|stop|restart|reload|force-reload}" >&2 - echo "Usage: $SCRIPTNAME {start|stop|status|restart|force-reload}" >&2 - exit 3 - ;; -esac - -: diff --git a/debian/osmo-gtphub.install b/debian/osmo-gtphub.install deleted file mode 100644 index 908c1a5..0000000 --- a/debian/osmo-gtphub.install +++ /dev/null @@ -1 +0,0 @@ -/usr/bin/osmo-gtphub diff --git a/debian/osmocom-bs11-utils.install b/debian/osmocom-bs11-utils.install deleted file mode 100644 index 757a854..0000000 --- a/debian/osmocom-bs11-utils.install +++ /dev/null @@ -1,2 +0,0 @@ -/usr/bin/bs11_config -/usr/bin/isdnsync diff --git a/debian/osmocom-bsc-nat.init b/debian/osmocom-bsc-nat.init deleted file mode 100755 index 984a7ce..0000000 --- a/debian/osmocom-bsc-nat.init +++ /dev/null @@ -1,153 +0,0 @@ -#!/bin/sh -### BEGIN INIT INFO -# Provides: osmocom-bsc-nat -# Required-Start: $network $local_fs -# Required-Stop: -# Default-Start: 2 3 4 5 -# Default-Stop: 0 1 6 -# Short-Description: Osmocom GSM network-in-a-box -# Description: A minimal implementation of the GSM Base Station Controller, -# Mobile Switching Center, Home Location regster and all other -# components to run a self-contained GSM network. -### END INIT INFO - -# Author: Harald Welte - -# PATH should only include /usr/* if it runs after the mountnfs.sh script -PATH=/sbin:/usr/sbin:/bin:/usr/bin -NAME=osmo-bsc_nat # Introduce the short server's name here -DESC="Osmocom GSM BSC Multiplexer (NAT)" # Introduce a short description here -DAEMON=/usr/bin/osmo-bsc_nat # Introduce the server's location here -SCRIPTNAME=/etc/init.d/osmocom-bsc-nat -CONFIG_FILE=/etc/osmocom/osmocom-bsc-nat.cfg - -# Exit if the package is not installed -[ -x $DAEMON ] || exit 0 - -# Read configuration variable file if it is present -[ -r /etc/default/osmocom-bsc-nat ] && . /etc/default/osmocom-bsc-nat - -# Load the VERBOSE setting and other rcS variables -. /lib/init/vars.sh - -# Define LSB log_* functions. -# Depend on lsb-base (>= 3.0-6) to ensure that this file is present. -. /lib/lsb/init-functions - -DAEMON_ARGS="-D -c $CONFIG_FILE" - -# -# Function that starts the daemon/service -# -do_start() -{ - # Return - # 0 if daemon has been started - # 1 if daemon was already running - # 2 if daemon could not be started - start-stop-daemon --start --quiet --exec $DAEMON --test > /dev/null \ - || return 1 - start-stop-daemon --start --quiet --exec $DAEMON -- \ - $DAEMON_ARGS \ - || return 2 - # Add code here, if necessary, that waits for the process to be ready - # to handle requests from services started subsequently which depend - # on this one. As a last resort, sleep for some time. -} - -# -# Function that stops the daemon/service -# -do_stop() -{ - # Return - # 0 if daemon has been stopped - # 1 if daemon was already stopped - # 2 if daemon could not be stopped - # other if a failure occurred - start-stop-daemon --stop --quiet --retry=TERM/30/KILL/5 --name $NAME - RETVAL="$?" - [ "$RETVAL" = 2 ] && return 2 - # Wait for children to finish too if this is a daemon that forks - # and if the daemon is only ever run from this initscript. - # If the above conditions are not satisfied then add some other code - # that waits for the process to drop all resources that could be - # needed by services started subsequently. A last resort is to - # sleep for some time. - start-stop-daemon --stop --quiet --oknodo --retry=0/30/KILL/5 --exec $DAEMON - [ "$?" = 2 ] && return 2 - return "$RETVAL" -} - -# -# Function that sends a SIGHUP to the daemon/service -# -do_reload() { - # - # If the daemon can reload its configuration without - # restarting (for example, when it is sent a SIGHUP), - # then implement that here. - # - start-stop-daemon --stop --signal 1 --quiet $PIDFILE --name $NAME - return 0 -} - -case "$1" in - start) - [ "$VERBOSE" != no ] && log_daemon_msg "Starting $DESC " "$NAME" - do_start - case "$?" in - 0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;; - 2) [ "$VERBOSE" != no ] && log_end_msg 1 ;; - esac - ;; - stop) - [ "$VERBOSE" != no ] && log_daemon_msg "Stopping $DESC" "$NAME" - do_stop - case "$?" in - 0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;; - 2) [ "$VERBOSE" != no ] && log_end_msg 1 ;; - esac - ;; - status) - status_of_proc "$DAEMON" "$NAME" && exit 0 || exit $? - ;; - #reload|force-reload) - # - # If do_reload() is not implemented then leave this commented out - # and leave 'force-reload' as an alias for 'restart'. - # - #log_daemon_msg "Reloading $DESC" "$NAME" - #do_reload - #log_end_msg $? - #;; - restart|force-reload) - # - # If the "reload" option is implemented then remove the - # 'force-reload' alias - # - log_daemon_msg "Restarting $DESC" "$NAME" - do_stop - case "$?" in - 0|1) - do_start - case "$?" in - 0) log_end_msg 0 ;; - 1) log_end_msg 1 ;; # Old process is still running - *) log_end_msg 1 ;; # Failed to start - esac - ;; - *) - # Failed to stop - log_end_msg 1 - ;; - esac - ;; - *) - #echo "Usage: $SCRIPTNAME {start|stop|restart|reload|force-reload}" >&2 - echo "Usage: $SCRIPTNAME {start|stop|status|restart|force-reload}" >&2 - exit 3 - ;; -esac - -: diff --git a/debian/osmocom-bsc-nat.install b/debian/osmocom-bsc-nat.install deleted file mode 100644 index b561a7e..0000000 --- a/debian/osmocom-bsc-nat.install +++ /dev/null @@ -1 +0,0 @@ -/usr/bin/osmo-bsc_nat diff --git a/debian/osmocom-bsc.examples b/debian/osmocom-bsc.examples deleted file mode 100644 index a95f12b..0000000 --- a/debian/osmocom-bsc.examples +++ /dev/null @@ -1 +0,0 @@ -openbsc/doc/examples/osmo-bsc_mgcp diff --git a/debian/osmocom-bsc.install b/debian/osmocom-bsc.install deleted file mode 100644 index ab9459e..0000000 --- a/debian/osmocom-bsc.install +++ /dev/null @@ -1,2 +0,0 @@ -/usr/bin/osmo-bsc_mgcp -/usr/bin/osmo-bsc diff --git a/debian/osmocom-gbproxy.init b/debian/osmocom-gbproxy.init deleted file mode 100755 index 924f32d..0000000 --- a/debian/osmocom-gbproxy.init +++ /dev/null @@ -1,151 +0,0 @@ -#!/bin/sh -### BEGIN INIT INFO -# Provides: osmo-gbproxy -# Required-Start: $network $local_fs -# Required-Stop: -# Default-Start: 2 3 4 5 -# Default-Stop: 0 1 6 -# Short-Description: Osmocom GBproxy -# Description: A tool to proxy the GPRS Gb interface. -### END INIT INFO - -# Author: Harald Welte - -# PATH should only include /usr/* if it runs after the mountnfs.sh script -PATH=/sbin:/usr/sbin:/bin:/usr/bin -NAME=osmo-gbproxy # Introduce the short server's name here -DESC="Osmocom GBProxy" # Introduce a short description here -DAEMON=/usr/bin/osmo-gbproxy # Introduce the server's location here -SCRIPTNAME=/etc/init.d/osmocom-gbproxy -CONFIG_FILE=/etc/osmocom/osmocom-gbproxy.cfg - -# Exit if the package is not installed -[ -x $DAEMON ] || exit 0 - -# Read configuration variable file if it is present -[ -r /etc/default/osmocom-gbproxy ] && . /etc/default/osmocom-gbproxy - -# Load the VERBOSE setting and other rcS variables -. /lib/init/vars.sh - -# Define LSB log_* functions. -# Depend on lsb-base (>= 3.0-6) to ensure that this file is present. -. /lib/lsb/init-functions - -DAEMON_ARGS="-D -c $CONFIG_FILE" - -# -# Function that starts the daemon/service -# -do_start() -{ - # Return - # 0 if daemon has been started - # 1 if daemon was already running - # 2 if daemon could not be started - start-stop-daemon --start --quiet --exec $DAEMON --test > /dev/null \ - || return 1 - start-stop-daemon --start --quiet --exec $DAEMON -- \ - $DAEMON_ARGS \ - || return 2 - # Add code here, if necessary, that waits for the process to be ready - # to handle requests from services started subsequently which depend - # on this one. As a last resort, sleep for some time. -} - -# -# Function that stops the daemon/service -# -do_stop() -{ - # Return - # 0 if daemon has been stopped - # 1 if daemon was already stopped - # 2 if daemon could not be stopped - # other if a failure occurred - start-stop-daemon --stop --quiet --retry=TERM/30/KILL/5 --name $NAME - RETVAL="$?" - [ "$RETVAL" = 2 ] && return 2 - # Wait for children to finish too if this is a daemon that forks - # and if the daemon is only ever run from this initscript. - # If the above conditions are not satisfied then add some other code - # that waits for the process to drop all resources that could be - # needed by services started subsequently. A last resort is to - # sleep for some time. - start-stop-daemon --stop --quiet --oknodo --retry=0/30/KILL/5 --exec $DAEMON - [ "$?" = 2 ] && return 2 - return "$RETVAL" -} - -# -# Function that sends a SIGHUP to the daemon/service -# -do_reload() { - # - # If the daemon can reload its configuration without - # restarting (for example, when it is sent a SIGHUP), - # then implement that here. - # - start-stop-daemon --stop --signal 1 --quiet $PIDFILE --name $NAME - return 0 -} - -case "$1" in - start) - [ "$VERBOSE" != no ] && log_daemon_msg "Starting $DESC " "$NAME" - do_start - case "$?" in - 0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;; - 2) [ "$VERBOSE" != no ] && log_end_msg 1 ;; - esac - ;; - stop) - [ "$VERBOSE" != no ] && log_daemon_msg "Stopping $DESC" "$NAME" - do_stop - case "$?" in - 0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;; - 2) [ "$VERBOSE" != no ] && log_end_msg 1 ;; - esac - ;; - status) - status_of_proc "$DAEMON" "$NAME" && exit 0 || exit $? - ;; - #reload|force-reload) - # - # If do_reload() is not implemented then leave this commented out - # and leave 'force-reload' as an alias for 'restart'. - # - #log_daemon_msg "Reloading $DESC" "$NAME" - #do_reload - #log_end_msg $? - #;; - restart|force-reload) - # - # If the "reload" option is implemented then remove the - # 'force-reload' alias - # - log_daemon_msg "Restarting $DESC" "$NAME" - do_stop - case "$?" in - 0|1) - do_start - case "$?" in - 0) log_end_msg 0 ;; - 1) log_end_msg 1 ;; # Old process is still running - *) log_end_msg 1 ;; # Failed to start - esac - ;; - *) - # Failed to stop - log_end_msg 1 - ;; - esac - ;; - *) - #echo "Usage: $SCRIPTNAME {start|stop|restart|reload|force-reload}" >&2 - echo "Usage: $SCRIPTNAME {start|stop|status|restart|force-reload}" >&2 - exit 3 - ;; -esac - -: diff --git a/debian/osmocom-gbproxy.install b/debian/osmocom-gbproxy.install deleted file mode 100644 index ba3f6ee..0000000 --- a/debian/osmocom-gbproxy.install +++ /dev/null @@ -1 +0,0 @@ -/usr/bin/osmo-gbproxy diff --git a/debian/osmocom-ipaccess-utils.install b/debian/osmocom-ipaccess-utils.install deleted file mode 100644 index de13c18..0000000 --- a/debian/osmocom-ipaccess-utils.install +++ /dev/null @@ -1,3 +0,0 @@ -/usr/bin/ipaccess-config -/usr/bin/abisip-find -/usr/bin/ipaccess-proxy diff --git a/debian/osmocom-nitb.default b/debian/osmocom-nitb.default deleted file mode 100644 index ef76a5f..0000000 --- a/debian/osmocom-nitb.default +++ /dev/null @@ -1,8 +0,0 @@ -CONFIG_FILE="/etc/osmocom/osmo-nitb.cfg" -HLR_FILE="/var/lib/osmocom/hlr.sqlite3" - -DAEMON_ARGS="-P" - -# Uncomment if using LCR+Asterisk -# DAEMON_ARGS="-m -P" - diff --git a/debian/osmocom-nitb.dirs b/debian/osmocom-nitb.dirs deleted file mode 100644 index efbca2b..0000000 --- a/debian/osmocom-nitb.dirs +++ /dev/null @@ -1,3 +0,0 @@ -/etc/osmocom -/var/log/osmocom -/var/lib/osmocom diff --git a/debian/osmocom-nitb.examples b/debian/osmocom-nitb.examples deleted file mode 100644 index c098d5c..0000000 --- a/debian/osmocom-nitb.examples +++ /dev/null @@ -1 +0,0 @@ -openbsc/doc/examples/osmo-nitb diff --git a/debian/osmocom-nitb.init b/debian/osmocom-nitb.init deleted file mode 100755 index 0747446..0000000 --- a/debian/osmocom-nitb.init +++ /dev/null @@ -1,152 +0,0 @@ -#!/bin/sh -### BEGIN INIT INFO -# Provides: osmo-nitb -# Required-Start: $network $local_fs -# Required-Stop: -# Default-Start: 2 3 4 5 -# Default-Stop: 0 1 6 -# Short-Description: Osmocom GSM network-in-a-box -# Description: A minimal implementation of the GSM Base Station Controller, -# Mobile Switching Center, Home Location regster and all other -# components to run a self-contained GSM network. -### END INIT INFO - -# Author: Harald Welte - -# PATH should only include /usr/* if it runs after the mountnfs.sh script -PATH=/sbin:/usr/sbin:/bin:/usr/bin -NAME=osmo-nitb # Introduce the short server's name here -DESC="Osmocom GSM Network-in-a-Box" # Introduce a short description here -DAEMON=/usr/bin/osmo-nitb # Introduce the server's location here -SCRIPTNAME=/etc/init.d/osmocom-nitb - -# Exit if the package is not installed -[ -x $DAEMON ] || exit 0 - -# Read configuration variable file if it is present -[ -r /etc/default/osmocom-nitb ] && . /etc/default/osmocom-nitb - -# Load the VERBOSE setting and other rcS variables -. /lib/init/vars.sh - -# Define LSB log_* functions. -# Depend on lsb-base (>= 3.0-6) to ensure that this file is present. -. /lib/lsb/init-functions - -DAEMON_ARGS="$DAEMON_ARGS -D -c $CONFIG_FILE -l $HLR_FILE" - -# -# Function that starts the daemon/service -# -do_start() -{ - # Return - # 0 if daemon has been started - # 1 if daemon was already running - # 2 if daemon could not be started - start-stop-daemon --start --quiet --exec $DAEMON --test > /dev/null \ - || return 1 - start-stop-daemon --start --quiet --exec $DAEMON -- \ - $DAEMON_ARGS \ - || return 2 - # Add code here, if necessary, that waits for the process to be ready - # to handle requests from services started subsequently which depend - # on this one. As a last resort, sleep for some time. -} - -# -# Function that stops the daemon/service -# -do_stop() -{ - # Return - # 0 if daemon has been stopped - # 1 if daemon was already stopped - # 2 if daemon could not be stopped - # other if a failure occurred - start-stop-daemon --stop --quiet --retry=TERM/30/KILL/5 --name $NAME - RETVAL="$?" - [ "$RETVAL" = 2 ] && return 2 - # Wait for children to finish too if this is a daemon that forks - # and if the daemon is only ever run from this initscript. - # If the above conditions are not satisfied then add some other code - # that waits for the process to drop all resources that could be - # needed by services started subsequently. A last resort is to - # sleep for some time. - start-stop-daemon --stop --quiet --oknodo --retry=0/30/KILL/5 --exec $DAEMON - [ "$?" = 2 ] && return 2 - return "$RETVAL" -} - -# -# Function that sends a SIGHUP to the daemon/service -# -do_reload() { - # - # If the daemon can reload its configuration without - # restarting (for example, when it is sent a SIGHUP), - # then implement that here. - # - start-stop-daemon --stop --signal 1 --quiet $PIDFILE --name $NAME - return 0 -} - -case "$1" in - start) - [ "$VERBOSE" != no ] && log_daemon_msg "Starting $DESC " "$NAME" - do_start - case "$?" in - 0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;; - 2) [ "$VERBOSE" != no ] && log_end_msg 1 ;; - esac - ;; - stop) - [ "$VERBOSE" != no ] && log_daemon_msg "Stopping $DESC" "$NAME" - do_stop - case "$?" in - 0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;; - 2) [ "$VERBOSE" != no ] && log_end_msg 1 ;; - esac - ;; - status) - status_of_proc "$DAEMON" "$NAME" && exit 0 || exit $? - ;; - #reload|force-reload) - # - # If do_reload() is not implemented then leave this commented out - # and leave 'force-reload' as an alias for 'restart'. - # - #log_daemon_msg "Reloading $DESC" "$NAME" - #do_reload - #log_end_msg $? - #;; - restart|force-reload) - # - # If the "reload" option is implemented then remove the - # 'force-reload' alias - # - log_daemon_msg "Restarting $DESC" "$NAME" - do_stop - case "$?" in - 0|1) - do_start - case "$?" in - 0) log_end_msg 0 ;; - 1) log_end_msg 1 ;; # Old process is still running - *) log_end_msg 1 ;; # Failed to start - esac - ;; - *) - # Failed to stop - log_end_msg 1 - ;; - esac - ;; - *) - #echo "Usage: $SCRIPTNAME {start|stop|restart|reload|force-reload}" >&2 - echo "Usage: $SCRIPTNAME {start|stop|status|restart|force-reload}" >&2 - exit 3 - ;; -esac - -: diff --git a/debian/osmocom-nitb.install b/debian/osmocom-nitb.install deleted file mode 100644 index 26caf71..0000000 --- a/debian/osmocom-nitb.install +++ /dev/null @@ -1,2 +0,0 @@ -/usr/bin/osmo-nitb -openbsc/contrib/*.py usr/bin/ \ No newline at end of file diff --git a/debian/osmocom-sgsn.default b/debian/osmocom-sgsn.default deleted file mode 100644 index 77c9679..0000000 --- a/debian/osmocom-sgsn.default +++ /dev/null @@ -1,2 +0,0 @@ -CONFIG_FILE="/etc/osmocom/osmo-sgsn.cfg" - diff --git a/debian/osmocom-sgsn.examples b/debian/osmocom-sgsn.examples deleted file mode 100644 index 15de78d..0000000 --- a/debian/osmocom-sgsn.examples +++ /dev/null @@ -1 +0,0 @@ -openbsc/doc/examples/osmo-sgsn diff --git a/debian/osmocom-sgsn.init b/debian/osmocom-sgsn.init deleted file mode 100755 index 0794dc1..0000000 --- a/debian/osmocom-sgsn.init +++ /dev/null @@ -1,150 +0,0 @@ -#!/bin/sh -### BEGIN INIT INFO -# Provides: osmo-sgsn -# Required-Start: $network $local_fs -# Required-Stop: -# Default-Start: 2 3 4 5 -# Default-Stop: 0 1 6 -# Short-Description: Osmocom Serving GPRS Support Node -# Description: Osmocom Serving GPRS Support Node -### END INIT INFO - -# Author: Harald Welte - -# PATH should only include /usr/* if it runs after the mountnfs.sh script -PATH=/sbin:/usr/sbin:/bin:/usr/bin -NAME=osmo-sgsn # Introduce the short server's name here -DESC="Osmocom Serving GPRS Support Node" # Introduce a short description here -DAEMON=/usr/bin/osmo-sgsn # Introduce the server's location here -SCRIPTNAME=/etc/init.d/osmocom-sgsn - -# Exit if the package is not installed -[ -x $DAEMON ] || exit 0 - -# Read configuration variable file if it is present -[ -r /etc/default/osmocom-sgsn ] && . /etc/default/osmocom-sgsn - -# Load the VERBOSE setting and other rcS variables -. /lib/init/vars.sh - -# Define LSB log_* functions. -# Depend on lsb-base (>= 3.0-6) to ensure that this file is present. -. /lib/lsb/init-functions - -DAEMON_ARGS="$DAEMON_ARGS -D -c $CONFIG_FILE" - -# -# Function that starts the daemon/service -# -do_start() -{ - # Return - # 0 if daemon has been started - # 1 if daemon was already running - # 2 if daemon could not be started - start-stop-daemon --start --quiet --exec $DAEMON --test > /dev/null \ - || return 1 - start-stop-daemon --start --quiet --exec $DAEMON -- \ - $DAEMON_ARGS \ - || return 2 - # Add code here, if necessary, that waits for the process to be ready - # to handle requests from services started subsequently which depend - # on this one. As a last resort, sleep for some time. -} - -# -# Function that stops the daemon/service -# -do_stop() -{ - # Return - # 0 if daemon has been stopped - # 1 if daemon was already stopped - # 2 if daemon could not be stopped - # other if a failure occurred - start-stop-daemon --stop --quiet --retry=TERM/30/KILL/5 --name $NAME - RETVAL="$?" - [ "$RETVAL" = 2 ] && return 2 - # Wait for children to finish too if this is a daemon that forks - # and if the daemon is only ever run from this initscript. - # If the above conditions are not satisfied then add some other code - # that waits for the process to drop all resources that could be - # needed by services started subsequently. A last resort is to - # sleep for some time. - start-stop-daemon --stop --quiet --oknodo --retry=0/30/KILL/5 --exec $DAEMON - [ "$?" = 2 ] && return 2 - return "$RETVAL" -} - -# -# Function that sends a SIGHUP to the daemon/service -# -do_reload() { - # - # If the daemon can reload its configuration without - # restarting (for example, when it is sent a SIGHUP), - # then implement that here. - # - start-stop-daemon --stop --signal 1 --quiet $PIDFILE --name $NAME - return 0 -} - -case "$1" in - start) - [ "$VERBOSE" != no ] && log_daemon_msg "Starting $DESC " "$NAME" - do_start - case "$?" in - 0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;; - 2) [ "$VERBOSE" != no ] && log_end_msg 1 ;; - esac - ;; - stop) - [ "$VERBOSE" != no ] && log_daemon_msg "Stopping $DESC" "$NAME" - do_stop - case "$?" in - 0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;; - 2) [ "$VERBOSE" != no ] && log_end_msg 1 ;; - esac - ;; - status) - status_of_proc "$DAEMON" "$NAME" && exit 0 || exit $? - ;; - #reload|force-reload) - # - # If do_reload() is not implemented then leave this commented out - # and leave 'force-reload' as an alias for 'restart'. - # - #log_daemon_msg "Reloading $DESC" "$NAME" - #do_reload - #log_end_msg $? - #;; - restart|force-reload) - # - # If the "reload" option is implemented then remove the - # 'force-reload' alias - # - log_daemon_msg "Restarting $DESC" "$NAME" - do_stop - case "$?" in - 0|1) - do_start - case "$?" in - 0) log_end_msg 0 ;; - 1) log_end_msg 1 ;; # Old process is still running - *) log_end_msg 1 ;; # Failed to start - esac - ;; - *) - # Failed to stop - log_end_msg 1 - ;; - esac - ;; - *) - #echo "Usage: $SCRIPTNAME {start|stop|restart|reload|force-reload}" >&2 - echo "Usage: $SCRIPTNAME {start|stop|status|restart|force-reload}" >&2 - exit 3 - ;; -esac - -: diff --git a/debian/osmocom-sgsn.install b/debian/osmocom-sgsn.install deleted file mode 100644 index d89c456..0000000 --- a/debian/osmocom-sgsn.install +++ /dev/null @@ -1 +0,0 @@ -/usr/bin/osmo-sgsn diff --git a/debian/rules b/debian/rules index 4e187a6..72a7d18 100755 --- a/debian/rules +++ b/debian/rules @@ -1,32 +1,57 @@ #!/usr/bin/make -f +# You must remove unused comment lines for the released package. +# See debhelper(7) (uncomment to enable) +# This is an autogenerated template for debian/rules. +# +# Output every command that modifies files on the build system. +#export DH_VERBOSE = 1 +# +# Copy some variable definitions from pkg-info.mk and vendor.mk +# under /usr/share/dpkg/ to here if they are useful. +# +# See FEATURE AREAS/ENVIRONMENT in dpkg-buildflags(1) +# Apply all hardening options +#export DEB_BUILD_MAINT_OPTIONS = hardening=+all +# Package maintainers to append CFLAGS +#export DEB_CFLAGS_MAINT_APPEND = -Wall -pedantic +# Package maintainers to append LDFLAGS +#export DEB_LDFLAGS_MAINT_APPEND = -Wl,--as-needed +# +# With debhelper version 9 or newer, the dh command exports +# all buildflags. So there is no need to include the +# /usr/share/dpkg/buildflags.mk file here if compat is 9 or newer. +# +# These are rarely used code. (START) +# +# The following include for *.mk magically sets miscellaneous +# variables while honoring existing values of pertinent +# environment variables: +# +# Architecture-related variables such as DEB_TARGET_MULTIARCH: +#include /usr/share/dpkg/architecture.mk +# Vendor-related variables such as DEB_VENDOR: +#include /usr/share/dpkg/vendor.mk +# Package-related variables such as DEB_DISTRIBUTION +#include /usr/share/dpkg/pkg-info.mk +# +# You may alternatively set them susing a simple script such as: +# DEB_VENDOR ?= $(shell dpkg-vendor --query Vendor) +# +# These are rarely used code. (END) +# -# Uncomment this to turn on verbose mode. -#export DH_VERBOSE=1 - -DEBIAN := $(shell dpkg-parsechangelog | grep ^Version: | cut -d' ' -f2) -DEBVERS := $(shell echo '$(DEBIAN)' | cut -d- -f1) -VERSION := $(shell echo '$(DEBVERS)' | sed -e 's/[+-].*//' -e 's/~//g') - -export DEB_BUILD_MAINT_OPTIONS = hardening=+all - +# main packaging script based on dh7 syntax %: - dh $@ --sourcedirectory=openbsc --with autoreconf + dh $@ --with autoreconf -# This is needed for debian stable (squeeze) -override_dh_autoreconf: - cd openbsc && autoreconf --install --force - -override_dh_strip: - dh_strip -posmocom-bsc --dbg-package=osmocom-bsc-dbg - dh_strip -posmocom-nitb --dbg-package=osmocom-nitb-dbg - dh_strip -posmocom-ipaccess-utils --dbg-package=osmocom-ipaccess-utils-dbg - dh_strip -posmocom-bs11-utils --dbg-package=osmocom-bs11-utils-dbg - dh_strip -posmocom-sgsn --dbg-package=osmocom-sgsn-dbg - dh_strip -posmocom-gbproxy --dbg-package=osmocom-gbproxy-dbg - dh_strip -posmocom-bsc-nat --dbg-package=osmocom-bsc-nat-dbg - dh_strip -posmo-gtphub --dbg-package=osmo-gtphub-dbg - +CONFIGURE_FLAGS += --enable-osmo-bsc override_dh_auto_configure: - echo $(VERSION) > openbsc/.tarball-version - dh_auto_configure --sourcedirectory=openbsc -- --enable-nat --enable-osmo-bsc --enable-smpp + dh_auto_configure -- $(CONFIGURE_FLAGS) +# +# Do not install libtool archive, python .pyc .pyo +#override_dh_install: +# dh_install --list-missing -X.la -X.pyc -X.pyo +# See https://www.debian.org/doc/manuals/developers-reference/best-pkging-practices.html#bpp-dbg +override_dh_strip: + dh_strip --dbg-package=osmo-bsc-dbg -- To view, visit https://gerrit.osmocom.org/3738 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I9fe1003f7d2af5c6a07c41aec59ea91594b825bd Gerrit-PatchSet: 1 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: lynxis lazus From gerrit-no-reply at lists.osmocom.org Wed Aug 30 12:18:35 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 30 Aug 2017 12:18:35 +0000 Subject: [PATCH] osmo-sgsn[master]: split off osmo-sgsn: remove files, apply build Message-ID: Review at https://gerrit.osmocom.org/3739 split off osmo-sgsn: remove files, apply build Change-Id: I5d27ff93e56cd13e0e70edd15e2080201e35e91f --- M configure.ac M include/openbsc/Makefile.am D include/openbsc/a_iface.h D include/openbsc/a_iface_bssap.h D include/openbsc/abis_nm.h D include/openbsc/abis_om2000.h D include/openbsc/abis_rsl.h D include/openbsc/arfcn_range_encode.h D include/openbsc/auth.h D include/openbsc/bsc_api.h D include/openbsc/bsc_msc.h D include/openbsc/bsc_msc_data.h D include/openbsc/bsc_msg_filter.h D include/openbsc/bsc_nat.h D include/openbsc/bsc_nat_callstats.h D include/openbsc/bsc_nat_sccp.h D include/openbsc/bsc_rll.h D include/openbsc/bsc_subscriber.h D include/openbsc/bss.h D include/openbsc/bts_ipaccess_nanobts_omlattr.h D include/openbsc/chan_alloc.h D include/openbsc/common_bsc.h D include/openbsc/common_cs.h D include/openbsc/ctrl.h D include/openbsc/db.h D include/openbsc/e1_config.h M include/openbsc/gprs_sgsn.h M include/openbsc/gprs_utils.h D include/openbsc/gsm_04_08.h D include/openbsc/gsm_04_11.h D include/openbsc/gsm_04_80.h D include/openbsc/gsm_data.h D include/openbsc/gsm_data_shared.h D include/openbsc/gsm_subscriber.h D include/openbsc/handover.h D include/openbsc/handover_decision.h D include/openbsc/ipaccess.h D include/openbsc/iucs.h D include/openbsc/iucs_ranap.h D include/openbsc/meas_feed.h D include/openbsc/meas_rep.h D include/openbsc/misdn.h D include/openbsc/mncc.h D include/openbsc/mncc_int.h D include/openbsc/msc_ifaces.h D include/openbsc/nat_rewrite_trie.h D include/openbsc/network_listen.h D include/openbsc/openbscdefines.h D include/openbsc/osmo_bsc.h D include/openbsc/osmo_bsc_grace.h D include/openbsc/osmo_bsc_reset.h D include/openbsc/osmo_bsc_rf.h D include/openbsc/osmo_bsc_sigtran.h D include/openbsc/osmo_msc.h D include/openbsc/osmux.h D include/openbsc/paging.h D include/openbsc/pcu_if.h D include/openbsc/pcuif_proto.h D include/openbsc/rrlp.h D include/openbsc/rs232.h D include/openbsc/rtp_proxy.h M include/openbsc/signal.h D include/openbsc/silent_call.h D include/openbsc/smpp.h D include/openbsc/sms_queue.h D include/openbsc/socket.h D include/openbsc/system_information.h D include/openbsc/transaction.h D include/openbsc/trau_mux.h D include/openbsc/trau_upqueue.h D include/openbsc/ussd.h D include/openbsc/vlr.h M include/openbsc/vty.h M osmoappdesc.py M src/Makefile.am M src/gprs/Makefile.am M src/gprs/gb_proxy.c M src/gprs/gb_proxy_main.c M src/gprs/gb_proxy_patch.c M src/gprs/gb_proxy_peer.c M src/gprs/gb_proxy_vty.c M src/gprs/gprs_gmm.c M src/gprs/gprs_llc.c M src/gprs/gprs_llc_parse.c M src/gprs/gprs_llc_vty.c M src/gprs/gprs_sgsn.c M src/gprs/gprs_sndcp.c M src/gprs/gprs_sndcp_vty.c A src/gprs/gsup_client.c M src/gprs/gtphub_main.c M src/gprs/gtphub_vty.c A src/gprs/oap_client.c M src/gprs/sgsn_ares.c M src/gprs/sgsn_ctrl.c M src/gprs/sgsn_main.c M src/gprs/sgsn_vty.c D src/ipaccess/Makefile.am D src/ipaccess/abisip-find.c D src/ipaccess/ipaccess-config.c D src/ipaccess/ipaccess-firmware.c D src/ipaccess/ipaccess-proxy.c D src/ipaccess/network_listen.c D src/libbsc/Makefile.am D src/libbsc/abis_nm.c D src/libbsc/abis_nm_ipaccess.c D src/libbsc/abis_nm_vty.c D src/libbsc/abis_om2000.c D src/libbsc/abis_om2000_vty.c D src/libbsc/abis_rsl.c D src/libbsc/arfcn_range_encode.c D src/libbsc/bsc_api.c D src/libbsc/bsc_ctrl_commands.c D src/libbsc/bsc_ctrl_lookup.c D src/libbsc/bsc_dyn_ts.c D src/libbsc/bsc_init.c D src/libbsc/bsc_msc.c D src/libbsc/bsc_rf_ctrl.c D src/libbsc/bsc_rll.c D src/libbsc/bsc_subscriber.c D src/libbsc/bsc_vty.c D src/libbsc/bts_ericsson_rbs2000.c D src/libbsc/bts_init.c D src/libbsc/bts_ipaccess_nanobts.c D src/libbsc/bts_ipaccess_nanobts_omlattr.c D src/libbsc/bts_nokia_site.c D src/libbsc/bts_siemens_bs11.c D src/libbsc/bts_sysmobts.c D src/libbsc/bts_unknown.c D src/libbsc/chan_alloc.c D src/libbsc/e1_config.c D src/libbsc/gsm_04_08_utils.c D src/libbsc/gsm_04_80_utils.c D src/libbsc/handover_decision.c D src/libbsc/handover_logic.c D src/libbsc/meas_proc.c D src/libbsc/meas_rep.c D src/libbsc/net_init.c D src/libbsc/paging.c D src/libbsc/pcu_sock.c D src/libbsc/rest_octets.c D src/libbsc/system_information.c D src/libcommon-cs/Makefile.am D src/libcommon-cs/a_reset.c D src/libcommon-cs/common_cs.c D src/libcommon-cs/common_cs_vty.c M src/libcommon/common_vty.c D src/libfilter/Makefile.am D src/libfilter/bsc_msg_acc.c D src/libfilter/bsc_msg_filter.c D src/libfilter/bsc_msg_vty.c D src/libmsc/Makefile.am D src/libmsc/a_iface.c D src/libmsc/a_iface_bssap.c D src/libmsc/auth.c D src/libmsc/ctrl_commands.c D src/libmsc/db.c D src/libmsc/gsm_04_08.c D src/libmsc/gsm_04_11.c D src/libmsc/gsm_04_80.c D src/libmsc/gsm_subscriber.c D src/libmsc/iucs.c D src/libmsc/iucs_ranap.c D src/libmsc/meas_feed.c D src/libmsc/meas_feed.h D src/libmsc/mncc.c D src/libmsc/mncc_builtin.c D src/libmsc/mncc_sock.c D src/libmsc/msc_ifaces.c D src/libmsc/msc_vty.c D src/libmsc/osmo_msc.c D src/libmsc/rrlp.c D src/libmsc/silent_call.c D src/libmsc/smpp_openbsc.c D src/libmsc/smpp_smsc.c D src/libmsc/smpp_smsc.h D src/libmsc/smpp_utils.c D src/libmsc/smpp_vty.c D src/libmsc/sms_queue.c D src/libmsc/subscr_conn.c D src/libmsc/transaction.c D src/libmsc/ussd.c D src/libmsc/vty_interface_layer3.c D src/libtrau/Makefile.am D src/libtrau/rtp_proxy.c D src/libtrau/trau_mux.c D src/libtrau/trau_upqueue.c D src/libvlr/Makefile.am D src/libvlr/vlr.c D src/libvlr/vlr_access_req_fsm.c D src/libvlr/vlr_access_req_fsm.h D src/libvlr/vlr_auth_fsm.c D src/libvlr/vlr_auth_fsm.h D src/libvlr/vlr_core.h D src/libvlr/vlr_lu_fsm.c D src/libvlr/vlr_lu_fsm.h D src/osmo-bsc/Makefile.am D src/osmo-bsc/osmo_bsc_api.c D src/osmo-bsc/osmo_bsc_audio.c D src/osmo-bsc/osmo_bsc_bssap.c D src/osmo-bsc/osmo_bsc_ctrl.c D src/osmo-bsc/osmo_bsc_filter.c D src/osmo-bsc/osmo_bsc_grace.c D src/osmo-bsc/osmo_bsc_main.c D src/osmo-bsc/osmo_bsc_msc.c D src/osmo-bsc/osmo_bsc_reset.c D src/osmo-bsc/osmo_bsc_sigtran.c D src/osmo-bsc/osmo_bsc_vty.c D src/osmo-bsc_nat/Makefile.am D src/osmo-bsc_nat/bsc_filter.c D src/osmo-bsc_nat/bsc_mgcp_utils.c D src/osmo-bsc_nat/bsc_nat.c D src/osmo-bsc_nat/bsc_nat_ctrl.c D src/osmo-bsc_nat/bsc_nat_filter.c D src/osmo-bsc_nat/bsc_nat_rewrite.c D src/osmo-bsc_nat/bsc_nat_rewrite_trie.c D src/osmo-bsc_nat/bsc_nat_utils.c D src/osmo-bsc_nat/bsc_nat_vty.c D src/osmo-bsc_nat/bsc_sccp.c D src/osmo-bsc_nat/bsc_ussd.c D src/osmo-msc/Makefile.am D src/osmo-msc/msc_main.c D src/utils/Makefile.am D src/utils/bs11_config.c D src/utils/isdnsync.c D src/utils/meas_db.c D src/utils/meas_db.h D src/utils/meas_json.c D src/utils/meas_pcap2db.c D src/utils/meas_udp2db.c D src/utils/meas_vis.c D src/utils/smpp_mirror.c M tests/Makefile.am D tests/abis/Makefile.am D tests/abis/abis_test.c D tests/abis/abis_test.ok D tests/bsc-nat-trie/Makefile.am D tests/bsc-nat-trie/bsc_nat_trie_test.c D tests/bsc-nat-trie/bsc_nat_trie_test.ok D tests/bsc-nat-trie/prefixes.csv D tests/bsc-nat/Makefile.am D tests/bsc-nat/barr.cfg D tests/bsc-nat/barr_dup.cfg D tests/bsc-nat/bsc_data.c D tests/bsc-nat/bsc_nat_test.c D tests/bsc-nat/bsc_nat_test.ok D tests/bsc-nat/prefixes.csv D tests/bsc/Makefile.am D tests/bsc/bsc_test.c D tests/bsc/bsc_test.ok D tests/channel/Makefile.am D tests/channel/channel_test.c D tests/channel/channel_test.ok D tests/db/Makefile.am D tests/db/db_test.c D tests/db/db_test.err D tests/db/db_test.ok D tests/db/hlr.sqlite3 M tests/gbproxy/Makefile.am M tests/gbproxy/gbproxy_test.c D tests/gsm0408/Makefile.am D tests/gsm0408/gsm0408_test.c D tests/gsm0408/gsm0408_test.ok D tests/msc_vlr/Makefile.am D tests/msc_vlr/msc_vlr_test_gsm_authen.c D tests/msc_vlr/msc_vlr_test_gsm_authen.err D tests/msc_vlr/msc_vlr_test_gsm_authen.ok D tests/msc_vlr/msc_vlr_test_gsm_ciph.c D tests/msc_vlr/msc_vlr_test_gsm_ciph.err D tests/msc_vlr/msc_vlr_test_gsm_ciph.ok D tests/msc_vlr/msc_vlr_test_hlr_reject.c D tests/msc_vlr/msc_vlr_test_hlr_reject.err D tests/msc_vlr/msc_vlr_test_hlr_reject.ok D tests/msc_vlr/msc_vlr_test_hlr_timeout.c D tests/msc_vlr/msc_vlr_test_hlr_timeout.err D tests/msc_vlr/msc_vlr_test_hlr_timeout.ok D tests/msc_vlr/msc_vlr_test_ms_timeout.c D tests/msc_vlr/msc_vlr_test_ms_timeout.err D tests/msc_vlr/msc_vlr_test_ms_timeout.ok D tests/msc_vlr/msc_vlr_test_no_authen.c D tests/msc_vlr/msc_vlr_test_no_authen.err D tests/msc_vlr/msc_vlr_test_no_authen.ok D tests/msc_vlr/msc_vlr_test_reject_concurrency.c D tests/msc_vlr/msc_vlr_test_reject_concurrency.err D tests/msc_vlr/msc_vlr_test_reject_concurrency.ok D tests/msc_vlr/msc_vlr_test_rest.c D tests/msc_vlr/msc_vlr_test_rest.err D tests/msc_vlr/msc_vlr_test_rest.ok D tests/msc_vlr/msc_vlr_test_umts_authen.c D tests/msc_vlr/msc_vlr_test_umts_authen.err D tests/msc_vlr/msc_vlr_test_umts_authen.ok D tests/msc_vlr/msc_vlr_tests.c D tests/msc_vlr/msc_vlr_tests.h D tests/nanobts_omlattr/Makefile.am D tests/nanobts_omlattr/nanobts_omlattr_test.c D tests/nanobts_omlattr/nanobts_omlattr_test.ok M tests/oap/Makefile.am M tests/sgsn/Makefile.am M tests/slhc/Makefile.am D tests/smpp/Makefile.am D tests/smpp/smpp_test.c D tests/smpp/smpp_test.err D tests/smpp/smpp_test.ok D tests/smpp_test_runner.py D tests/sms_queue/Makefile.am D tests/sms_queue/sms_queue_test.c D tests/sms_queue/sms_queue_test.err D tests/sms_queue/sms_queue_test.ok D tests/subscr/Makefile.am D tests/subscr/bsc_subscr_test.c D tests/subscr/bsc_subscr_test.err D tests/subscr/bsc_subscr_test.ok M tests/testsuite.at D tests/trau/Makefile.am D tests/trau/trau_test.c D tests/trau/trau_test.ok M tests/v42bis/Makefile.am M tests/vty_test_runner.py M tests/xid/Makefile.am 318 files changed, 795 insertions(+), 97,309 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-sgsn refs/changes/39/3739/1 -- To view, visit https://gerrit.osmocom.org/3739 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I5d27ff93e56cd13e0e70edd15e2080201e35e91f Gerrit-PatchSet: 1 Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Wed Aug 30 12:18:36 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 30 Aug 2017 12:18:36 +0000 Subject: [PATCH] osmo-sgsn[master]: sccp init: pass no local m3ua addr to use defaults Message-ID: Review at https://gerrit.osmocom.org/3740 sccp init: pass no local m3ua addr to use defaults Remove the FIXMEs because these addresses are configurable via the cs7 / {as,asp} vty commands. Change-Id: Ibafda0a9097183c26b21f3380d24dbe293e132e2 --- M src/gprs/sgsn_main.c 1 file changed, 3 insertions(+), 4 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-sgsn refs/changes/40/3740/1 diff --git a/src/gprs/sgsn_main.c b/src/gprs/sgsn_main.c index e24a57b..8ffc6c8 100644 --- a/src/gprs/sgsn_main.c +++ b/src/gprs/sgsn_main.c @@ -479,10 +479,9 @@ #if BUILD_IU sccp = osmo_sccp_simple_client(tall_bsc_ctx, "OsmoSGSN", 2 /* FIXME: configurable */, - OSMO_SS7_ASP_PROT_M3UA, 0, - "127.0.0.4" /* FIXME: configurable */, - M3UA_PORT, - "127.0.0.1" /* FIXME: configurable */); + OSMO_SS7_ASP_PROT_M3UA, + 0, NULL, + 0, "127.0.0.1"); if (!sccp) { printf("Setting up SCCP client failed.\n"); return 8; -- To view, visit https://gerrit.osmocom.org/3740 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ibafda0a9097183c26b21f3380d24dbe293e132e2 Gerrit-PatchSet: 1 Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Wed Aug 30 12:18:36 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 30 Aug 2017 12:18:36 +0000 Subject: [PATCH] osmo-sgsn[master]: rework /debian support to match new osmo-sgsn Message-ID: Review at https://gerrit.osmocom.org/3741 rework /debian support to match new osmo-sgsn Remove old leftover from split of osmo-sgsn out of openbsc. Change-Id: Ic0135a1118a115e8f053154e280f60674390f43a --- D debian/autoreconf M debian/changelog M debian/control M debian/copyright D debian/docs D debian/openbsc-dev.install R debian/osmo-gbproxy.init A debian/osmo-gbproxy.install D debian/osmo-gtphub.examples M debian/osmo-gtphub.install A debian/osmo-sgsn.install D debian/osmocom-bs11-utils.install D debian/osmocom-bsc-nat.init D debian/osmocom-bsc-nat.install D debian/osmocom-bsc.examples D debian/osmocom-bsc.install D debian/osmocom-gbproxy.install D debian/osmocom-ipaccess-utils.install D debian/osmocom-nitb.default D debian/osmocom-nitb.dirs D debian/osmocom-nitb.examples D debian/osmocom-nitb.init D debian/osmocom-nitb.install D debian/osmocom-sgsn.default D debian/osmocom-sgsn.examples D debian/osmocom-sgsn.init D debian/osmocom-sgsn.install M debian/rules 28 files changed, 556 insertions(+), 855 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-sgsn refs/changes/41/3741/1 diff --git a/debian/autoreconf b/debian/autoreconf deleted file mode 100644 index 9a3a67f..0000000 --- a/debian/autoreconf +++ /dev/null @@ -1 +0,0 @@ -openbsc diff --git a/debian/changelog b/debian/changelog index e9a4212..6216695 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,75 +1,5 @@ -openbsc (0.15.1) UNRELEASED; urgency=medium +osmo-sgsn (0.1.0) unstable; urgency=low - * Move forward toward a new release. - * Prevent SGSN starting with 'auth-policy remote' when no 'gsup remote-*' are configured. - Note: such configs are broken without extra workarounds anyway. + * Initial release. - -- Holger Hans Peter Freyther Tue, 24 May 2016 23:14:31 +0200 - -openbsc (0.14.0) unstable; urgency=low - - * New upstream tag and additional patches. - - -- Holger Hans Peter Freyther Sat, 14 Mar 2015 20:33:25 +0100 - -openbsc (0.12.0+git26-7) unstable; urgency=low - - * 64bit fix for the MGCP rewriting - - -- Holger Hans Peter Freyther Wed, 07 Nov 2012 11:39:34 +0100 - -openbsc (0.12.0+git26-6) precise; urgency=low - - * Added init script for osmocom-sgsn. - - -- Eric Butler Fri, 24 Aug 2012 21:04:32 -0700 - -openbsc (0.12.0+git26-5) precise; urgency=low - - * Don't enable MNCC sock by default. - * Automatically create important directories. - * Fix init script 'stop' command. - - -- Eric Butler Fri, 24 Aug 2012 20:56:33 -0700 - -openbsc (0.12.0+git26-4) precise; urgency=low - - * Specify HLR path and enable RTP proxy. - - -- Eric Butler Mon, 20 Aug 2012 00:21:07 -0700 - -openbsc (0.12.0+git26-3) precise; urgency=low - - * Fix init script. - - -- Eric Butler Sun, 19 Aug 2012 16:05:44 -0700 - -openbsc (0.12.0+git26-2) precise; urgency=low - - * Fix libdbi package dependency. - - -- Eric Butler Wed, 15 Aug 2012 00:35:37 -0700 - -openbsc (0.12.0+git26-1) precise; urgency=low - - * Fix version issue. - - -- Eric Butler Tue, 14 Aug 2012 21:00:51 -0700 - -openbsc (0.12.0+git26) precise; urgency=low - - * Updated ubuntu package. - - -- Eric Butler Tue, 14 Aug 2012 17:36:51 -0700 - -openbsc (0.9.13.115.eb113-1) natty; urgency=low - - * New upstream release - - -- Harald Welte Wed, 11 May 2011 18:41:24 +0000 - -openbsc (0.9.4-1) unstable; urgency=low - - * Initial release - - -- Harald Welte Tue, 24 Aug 2010 13:34:24 +0200 + -- Alexander Couzens Tue, 08 Aug 2017 01:13:05 +0000 diff --git a/debian/control b/debian/control index 87b6f07..16fd244 100644 --- a/debian/control +++ b/debian/control @@ -1,82 +1,59 @@ -Source: openbsc -Maintainer: Harald Welte +Source: osmo-sgsn Section: net -Priority: optional -Build-Depends: debhelper (>= 9), - autotools-dev, - autoconf-archive, - pkg-config, - libgtp-dev, - libosmocore-dev, - libosmo-sccp-dev, - libdbi0-dev, +Priority: extra +Maintainer: Alexander Couzens +Build-Depends: debhelper (>=9), dh-autoreconf, - libosmo-abis-dev, - libosmo-netif-dev, - libdbd-sqlite3, - libpcap-dev, + autotools-dev, + autoconf, + automake, + libtool, + pkg-config, libssl-dev, + libtalloc-dev, libc-ares-dev, - libsmpp34-dev + libgtp-dev, + libdbi-dev, + libdbd-sqlite3, + libosmocore-dev, + libosmo-abis-dev, + libosmo-ranap-dev, + libosmo-sccp-dev, + libosmo-netif-dev Standards-Version: 3.9.8 -Vcs-Git: git://bs11-abis.gnumonks.org/openbsc.git -Vcs-Browser: http://openbsc.osmocom.org/trac/browser -Homepage: https://projects.osmocom.org/projects/openbsc +Vcs-Git: git://git.osmocom.org/osmo-sgsn.git +Vcs-Browser: http://git.osmocom.org/gitweb?p=osmo-sgsn.git;a=summary +Homepage: https://projects.osmocom.org/projects/osmo-sgsn -Package: osmocom-bsc + +Package: osmo-sgsn Architecture: any -Depends: ${shlibs:Depends}, - ${misc:Depends} -Description: GSM Base Station Controller - This is the BSC-only version of OpenBSC. It requires a Mobile Switching Center - (MSC) to operate. - . - You might rather prefer to use osmocom-nitb which is considered a - "GSM Network-in-a-Box" and does not depend on a MSC. +Multi-Arch: foreign +Depends: ${misc:Depends}, ${shlibs:Depends} +Description: OsmoSGSN: Osmocom's Serving GPRS Support Node for 2G and 3G packet-switched mobile networks -Package: osmocom-nitb +Package: osmo-sgsn-dbg +Section: debug Architecture: any -Depends: ${shlibs:Depends}, - ${misc:Depends}, - libdbd-sqlite3 -Description: GSM Network-in-a-Box, implements BSC, MSC, SMSC, HLR, VLR - This is the Network-in-a-Box version of OpenBSC. It has all the GSM network - components bundled together. When using osmocom-nitb, there is no need for a - Mobile Switching Center (MSC) which is needed when using osmocom-bsc. +Multi-Arch: same +Depends: osmo-sgsn (= ${binary:Version}), ${misc:Depends} +Description: OsmoSGSN: Osmocom's Serving GPRS Support Node for 2G and 3G packet-switched mobile networks -Package: osmocom-ipaccess-utils +Package: osmo-gtphub Architecture: any -Depends: ${shlibs:Depends}, - ${misc:Depends} -Description: Command line utilities for ip.access nanoBTS - This package contains utilities that are specific for nanoBTS when being used - together with OpenBSC. It contains mainly three tools: ipaccess-find, - ipaccess-config and ipaccess-proxy. +Depends: ${shlibs:Depends}, ${misc:Depends} +Description: Osmocom GTP Hub + Proxy for comms between multiple SGSNs and GGSNs. -Package: osmocom-bs11-utils +Package: osmo-gtphub-dbg Architecture: any -Depends: ${shlibs:Depends}, - ${misc:Depends} -Description: Command line utilities for Siemens BS-11 BTS - There is a tool in this package for configuring the Siemens BS-11 BTS. - Additionally, it contains one tool for making use of an ISDN-card and the - public telephone network as frequency standard for the E1 line. +Section: debug +Priority: extra +Depends: osmo-gtphub (= ${binary:Version}), ${misc:Depends} +Description: Debug symbols for Osmocom GTP Hub + Make debugging possible -Package: osmocom-sgsn -Architecture: any -Depends: ${shlibs:Depends}, - ${misc:Depends} -Suggests: osmocom-bsc -Description: Osmocom Serving GPRS Support Node - This is an implementation of the GPRS Serving GPRS Support Node (SGSN). As - such it implements the GPRS Mobility Management (GMM) and SM (Session - Management). - . - The SGSN connects via the Gb-interface to the BSS (like the osmo-pcu or an - ip.access nanoBTS), and it connects via the GTP protocol to a Gateway GPRS - Support Node (GGSN) like openggsn. - -Package: osmocom-gbproxy +Package: osmo-gbproxy Architecture: any Depends: ${shlibs:Depends}, ${misc:Depends} @@ -87,95 +64,11 @@ . This package is part of OpenBSC and closely related to osmocom-sgsn. -Package: osmocom-bsc-nat -Architecture: any -Depends: ${shlibs:Depends}, - ${misc:Depends} -Recommends: osmocom-bsc -Description: Osmocom Base Station Controller Network Address Translation - This NAT is useful for masquerading multiple BSCs behind one. It listens - for incoming BSCs on port 5000 and connects to a specified Mobile Switching - Center (MSC). - . - This package is part of OpenBSC and closely related to osmocom-bsc. - -Package: openbsc-dev -Architecture: all -Depends: ${misc:Depends} -Description: Header file needed by tools tightly integrated - Some other programs depend on gsm_data_shared.h and gsm_data_shared.c - from OpenBSC. This package installs these files to your file system so - that the other packages can build-depend on this package. - . - The directory structure is copied after the structure in the repository - and the header and .c file are installed into /usr/src/osmocom/openbsc/. - -Package: osmo-gtphub -Architecture: any -Depends: ${shlibs:Depends}, ${misc:Depends} -Description: Osmocom GTP Hub - Proxy for comms between multiple SGSNs and GGSNs. - -Package: osmocom-bsc-dbg +Package: osmo-gbproxy-dbg Architecture: any Section: debug Priority: extra -Depends: osmocom-bsc (= ${binary:Version}), ${misc:Depends} -Description: Debug symbols for the OpenBSC BSC - Make debugging possible - -Package: osmocom-nitb-dbg -Architecture: any -Section: debug -Priority: extra -Depends: osmocom-nitb (= ${binary:Version}), ${misc:Depends} -Description: Debug symbols for the OpenBSC NITB - Make debugging possible - -Package: osmocom-ipaccess-utils-dbg -Architecture: any -Section: debug -Priority: extra -Depends: osmocom-ipaccess-utils (= ${binary:Version}), ${misc:Depends} -Description: Debug symbols for the OpenBSC ip.access utils - Make debugging possible - -Package: osmocom-bs11-utils-dbg -Architecture: any -Section: debug -Priority: extra -Depends: osmocom-bs11-utils (= ${binary:Version}), ${misc:Depends} -Description: Debug symbols for the OpenBSC BS11 utils - Make debugging possible - -Package: osmocom-sgsn-dbg -Architecture: any -Section: debug -Priority: extra -Depends: osmocom-sgsn (= ${binary:Version}), ${misc:Depends} -Description: Debug symbols for the OpenBSC Serving GPRS Support Node - Make debugging possible - -Package: osmocom-gbproxy-dbg -Architecture: any -Section: debug -Priority: extra -Depends: osmocom-gbproxy (= ${binary:Version}), ${misc:Depends} -Description: Debug symbols for the OpenBSC GPRS GBProxy - Make debugging possible - -Package: osmocom-bsc-nat-dbg -Architecture: any -Section: debug -Priority: extra -Depends: osmocom-bsc-nat (= ${binary:Version}), ${misc:Depends} -Description: Debug symbols for the OpenBSC Network Address Translation - Make debugging possible - -Package: osmo-gtphub-dbg -Architecture: any -Section: debug -Priority: extra -Depends: osmo-gtphub (= ${binary:Version}), ${misc:Depends} +Depends: osmo-gbproxy (= ${binary:Version}), ${misc:Depends} Description: Debug symbols for Osmocom GTP Hub Make debugging possible + diff --git a/debian/copyright b/debian/copyright index 1e4dee1..8d731ee 100644 --- a/debian/copyright +++ b/debian/copyright @@ -1,75 +1,277 @@ Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ -Upstream-Name: OpenBSC -Source: http://openbsc.osmocom.org/ +Upstream-Name: osmo-sgsn +Source: git://git.osmocom.org/osmo-sgsn -Files: * -Copyright: 2008-2015 Harald Welte - 2008-2015 Holger Hans Peter Freyther - 2009-2015 On-Waves - 2008 Jan Luebbe - 2008,2010-2011 Daniel Willmann - 2009,2011,2013 Andreas Eversberg - 2009,2011 Dieter Spaar - 2009 Mike Haben - 2010 Sylvain Munaut <246tnt at gmail.com> - 2012-2013 Pablo Neira Ayuso - 2013-2015 Sysmocom s.f.m.c. GmbH (Jacob Erlbeck) - 2014 Alexander Chemeris -License: AGPL-3+ -Comment: Contributions by Stefan Schmidt as well +Files: .gitignore + .gitreview + .mailmap + AUTHORS + Makefile.am + README + README.vty-tests + configure.ac + contrib/Makefile.am + contrib/a-link/sccp-split-by-con.lua + contrib/bsc-test/README + contrib/bsc-test/all_dial + contrib/bsc-test/dial.sh + contrib/bsc-test/drop-oml.sh + contrib/bsc-test/drop.sh + contrib/bsc-test/hangup + contrib/bsc-test/msc.sh + contrib/bsc_control.py + contrib/bt.py + contrib/convert_to_enum.py + contrib/ctrl2sse.py + contrib/gprs/gb-proxy-unblock-bug.py + contrib/gprs/gprs-bssgp-histogram.lua + contrib/gprs/gprs-buffer-count.lua + contrib/gprs/gprs-split-trace-by-tlli.lua + contrib/gprs/gprs-verify-nu.lua + contrib/hlr-remove-old.sql + contrib/hlrsync/hlrsync.py + contrib/ipa.py + contrib/jenkins.sh + contrib/mgcp_server.py + contrib/nat/test_regexp.c + contrib/nat/ussd_example.py + contrib/rtp/gen_rtp_header.erl + contrib/rtp/rtp_replay.st + contrib/rtp/rtp_replay_shared.st + contrib/rtp/rtp_replay_sip.st + contrib/rtp/timestamp_rtp.lua + contrib/sms/fill-hlr.st + contrib/sms/hlr-query.st + contrib/sms/sqlite-probe.tap.d + contrib/soap.py + contrib/systemd/osmo-bsc-mgcp.service + contrib/systemd/osmo-bsc.service + contrib/systemd/osmo-gbproxy.service + contrib/systemd/osmo-msc.service + contrib/systemd/osmo-nitb.service + contrib/systemd/osmo-sgsn.service + contrib/testconv/Makefile + contrib/testconv/testconv_main.c + contrib/twisted_ipa.py + doc/BS11-OML.txt + doc/Makefile.am + doc/call-routing.txt + doc/channel_release.txt + doc/e1-data-model.txt + doc/examples/Makefile.am + doc/examples/osmo-bsc/osmo-bsc.cfg + doc/examples/osmo-bsc_mgcp/mgcp.cfg + doc/examples/osmo-bsc_nat/black-list.cfg + doc/examples/osmo-bsc_nat/bscs.cfg + doc/examples/osmo-bsc_nat/osmo-bsc_nat.cfg + doc/examples/osmo-gbproxy/osmo-gbproxy-legacy.cfg + doc/examples/osmo-gbproxy/osmo-gbproxy.cfg + doc/examples/osmo-gtphub/gtphub-example.txt + doc/examples/osmo-gtphub/osmo-gtphub-1iface.cfg + doc/examples/osmo-gtphub/osmo-gtphub.cfg + doc/examples/osmo-msc/osmo-msc.cfg + doc/examples/osmo-sgsn/osmo-sgsn.cfg + doc/gsm-hopping.txt + doc/handover.txt + doc/ipa-sccp.txt + doc/oml-interface.txt + doc/osmo-nitb-data_structures.dot + doc/paging.txt + include/Makefile.am + include/compat_af_isdn.h + include/openbsc/Makefile.am + include/openbsc/common.h + include/openbsc/crc24.h + include/openbsc/debug.h + include/openbsc/gb_proxy.h + include/openbsc/gprs_gb_parse.h + include/openbsc/gprs_gmm.h + include/openbsc/gprs_llc.h + include/openbsc/gprs_sgsn.h + include/openbsc/gprs_sndcp.h + include/openbsc/gprs_subscriber.h + include/openbsc/rest_octets.h + include/openbsc/sgsn.h + include/openbsc/vty.h + m4/README + openbsc.pc.in + src/Makefile.am + src/gprs/.gitignore + src/gprs/Makefile.am + src/gprs/osmo_sgsn.cfg + src/libcommon/Makefile.am + src/libcommon/gsup_test_client.c + tests/Makefile.am + tests/atlocal.in + tests/gbproxy/Makefile.am + tests/gbproxy/gbproxy_test.ok + tests/gprs/Makefile.am + tests/gprs/gprs_test.c + tests/gprs/gprs_test.ok + tests/gtphub/Makefile.am + tests/gtphub/gtphub_test.ok + tests/libiudummy/Makefile.am + tests/libiudummy/README + tests/libiudummy/iudummy.c + tests/oap/Makefile.am + tests/oap/oap_client_test.err + tests/oap/oap_client_test.ok + tests/sgsn/Makefile.am + tests/sgsn/sgsn_test.ok + tests/slhc/Makefile.am + tests/slhc/slhc_test.ok + tests/sndcp_xid/Makefile.am + tests/sndcp_xid/sndcp_xid_test.ok + tests/testsuite.at + tests/v42bis/Makefile.am + tests/v42bis/v42bis_test.ok + tests/xid/Makefile.am + tests/xid/xid_test.ok + tools/hlrstat.pl +Copyright: __NO_COPYRIGHT_NOR_LICENSE__ +License: __NO_COPYRIGHT_NOR_LICENSE__ -Files: wireshark/0001-abis_oml.patch - wireshark/0002-ericsson_rbs2409.patch - wireshark/0003-lucent-hnb.patch - wireshark/0005-rsl-hsl.patch -Copyright: 1998 Gerald Combs - 2007,2011 Anders Broman - 2009 Holger Hans Peter Freyther - 2009-2011 Harald Welte -License: GPL-2+ - -Files: openbsc/include/mISDNif.h -Copyright: 2008 Karsten Keil -License: LGPL-2.1 - -Files: openbsc/src/libmgcp/g711common.h -Copyright: 2009 Abramo Bagnara -License: GPL-2+ - -Files: openbsc/git-version-gen -Copyright: 2007-2010 Free Software Foundation -License: GPL-3+ - -Files: openbsc/osmoappdesc.py - openbsc/tests/smpp_test_runner.py - openbsc/tests/ctrl_test_runner.py - openbsc/tests/vty_test_runner.py -Copyright: 2013 Katerina Barone-Adesi - 2013 Jacob Erlbeck - 2013-2014 Holger Hans Peter Freyther -License: GPL-3+ - -Files: openbsc/src/libbsc/bsc_ctrl_lookup.c -Copyright: 2010-2011 Daniel Willmann - 2010-2011 On-Waves -License: GPL-2+ - -Files: openbsc/src/libmsc/mncc_sock.c - openbsc/src/libmsc/mncc_builtin.c -Copyright: 2008-2010 Harald Welte - 2009 Andreas Eversberg - 2012 Holger Hans Peter Freyther -License: GPL-2+ - -Files: debian/* -Copyright: 2012-2015 Holger Hans Peter Freyther - 2016 Ruben Undheim -License: GPL-2+ - - -License: AGPL-3+ - This package is free software; you can redistribute it and/or modify +Files: include/openbsc/a_reset.h + include/openbsc/gprs_llc_xid.h + include/openbsc/gprs_sndcp_comp.h + include/openbsc/gprs_sndcp_dcomp.h + include/openbsc/gprs_sndcp_pcomp.h + include/openbsc/gprs_sndcp_xid.h + include/openbsc/gprs_utils.h + include/openbsc/gsup_client.h + include/openbsc/gtphub.h + include/openbsc/oap_client.h + include/openbsc/signal.h + src/gprs/crc24.c + src/gprs/gb_proxy.c + src/gprs/gb_proxy_main.c + src/gprs/gb_proxy_patch.c + src/gprs/gb_proxy_peer.c + src/gprs/gb_proxy_tlli.c + src/gprs/gb_proxy_vty.c + src/gprs/gprs_gb_parse.c + src/gprs/gprs_gmm.c + src/gprs/gprs_llc.c + src/gprs/gprs_llc_parse.c + src/gprs/gprs_llc_vty.c + src/gprs/gprs_llc_xid.c + src/gprs/gprs_sgsn.c + src/gprs/gprs_sndcp.c + src/gprs/gprs_sndcp_comp.c + src/gprs/gprs_sndcp_dcomp.c + src/gprs/gprs_sndcp_pcomp.c + src/gprs/gprs_sndcp_vty.c + src/gprs/gprs_sndcp_xid.c + src/gprs/gprs_subscriber.c + src/gprs/gprs_utils.c + src/gprs/gsup_client.c + src/gprs/gtphub.c + src/gprs/gtphub_main.c + src/gprs/gtphub_vty.c + src/gprs/oap_client.c + src/gprs/sgsn_ares.c + src/gprs/sgsn_auth.c + src/gprs/sgsn_cdr.c + src/gprs/sgsn_ctrl.c + src/gprs/sgsn_libgtp.c + src/gprs/sgsn_main.c + src/gprs/sgsn_vty.c + src/libcommon/bsc_version.c + src/libcommon/common_vty.c + src/libcommon/debug.c + src/libcommon/gsm_data.c + src/libcommon/gsm_data_shared.c + src/libcommon/gsm_subscriber_base.c + src/libcommon/gsup_client.c + src/libcommon/oap_client.c + src/libcommon/socket.c + src/libcommon/talloc_ctx.c + tests/gtphub/gtphub_test.c + tests/oap/oap_client_test.c + tests/sgsn/sgsn_test.c + tests/slhc/slhc_test.c + tests/sndcp_xid/sndcp_xid_test.c + tests/v42bis/v42bis_test.c + tests/xid/xid_test.c +Copyright: 2008-2015 Holger Hans Peter Freyther + 2008-2016 Harald Welte + 2009-2015 Holger Hans Peter Freyther + 2010-2014 On-Waves + 2011-2016 sysmocom s.f.m.c. GmbH + 2014-2016 Sysmocom s.f.m.c. GmbH + 2014-2017 sysmocom s.f.m.c. GmbH +License: AGPL-3.0+ + This program is free software; you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + . + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Affero General Public License for more details. + . + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see . + +Files: src/gprs/gtphub_ares.c + src/gprs/gtphub_sock.c + tests/ctrl_test_runner.py + tests/gbproxy/gbproxy_test.c +Copyright: 2013 Jacob Erlbeck + 2013 sysmocom s.f.m.c. GmbH + 2014 Holger Hans Peter Freyther + 2015 sysmocom s.f.m.c. GmbH +License: __NO_LICENSE__ + +Files: include/openbsc/v42bis.h + include/openbsc/v42bis_private.h +Copyright: 2005-2011 Steve Underwood +License: LGPL-2.1 + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU Lesser General Public License version 2.1, + as published by the Free Software Foundation. + . + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Lesser General Public License for more details. + . + You should have received a copy of the GNU Lesser General Public + License along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + . + The FSF address in the above text is the old one. + . + On Debian systems, the complete text of the GNU Lesser General Public License + Version 2.1 can be found in `/usr/share/common-licenses/LGPL-2.1'. + +Files: osmoappdesc.py +Copyright: 2013 Katerina Barone-Adesi +License: GPL-3.0+ + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + . + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + . + You should have received a copy of the GNU General Public License + along with this program. If not, see + . + Most systems won't be able to use these, so they're separated out + . + On Debian systems, the complete text of the GNU General Public License + Version 3 can be found in `/usr/share/common-licenses/GPL-3'. + +Files: git-version-gen +Copyright: 2007-2010 Free Software Foundation, Inc. +License: GPL-3.0+ + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. . @@ -78,60 +280,190 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. . - You should have received a copy of the GNU Affero General Public License - along with this program. If not, see . - - -License: GPL-2+ - This package is free software: you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 2 of the License, or (at - your option) any later version. - . - This program is distributed in the hope that it will be useful, but - WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - for more details. - . You should have received a copy of the GNU General Public License along with this program. If not, see . . - On Debian systems, the complete text of the GNU General Public - License version 2 can be found in "/usr/share/common-licenses/GPL-2". - - -License: GPL-3+ - This package is free software: you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or (at - your option) any later version. + This script is derived from GIT-VERSION-GEN from GIT: http://git.or.cz/. + It may be run two ways: + - from a git repository in which the "git describe" command below + produces useful output (thus requiring at least one signed tag) + - from a non-git-repo directory containing a .tarball-version file, which + presumes this script is invoked like "./git-version-gen .tarball-version". . - This program is distributed in the hope that it will be useful, but - WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - for more details. + In order to use intra-version strings in your project, you will need two + separate generated version string files: . - You should have received a copy of the GNU General Public License - along with this program. If not, see . + .tarball-version - present only in a distribution tarball, and not in + a checked-out repository. Created with contents that were learned at + the last time autoconf was run, and used by git-version-gen. Must not + be present in either $(srcdir) or $(builddir) for git-version-gen to + give accurate answers during normal development with a checked out tree, + but must be present in a tarball when there is no version control system. + Therefore, it cannot be used in any dependencies. GNUmakefile has + hooks to force a reconfigure at distribution time to get the value + correct, without penalizing normal development with extra reconfigures. . - On Debian systems, the complete text of the GNU General Public - License version 3 can be found in "/usr/share/common-licenses/GPL-3". + .version - present in a checked-out repository and in a distribution + tarball. Usable in dependencies, particularly for files that don't + want to depend on config.h but do want to track version changes. + Delete this file prior to any autoconf run where you want to rebuild + files to pick up a version string change; and leave it stale to + minimize rebuild time after unrelated changes to configure sources. + . + It is probably wise to add these two files to .gitignore, so that you + don't accidentally commit either generated file. + . + Use the following line in your configure.ac, so that $(VERSION) will + automatically be up-to-date each time configure is run (and note that + since configure.ac no longer includes a version string, Makefile rules + should not depend on configure.ac for version updates). + . + On Debian systems, the complete text of the GNU General Public License + Version 3 can be found in `/usr/share/common-licenses/GPL-3'. - -License: LGPL-2.1 - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; version - 2.1 of the License. +Files: tests/vty_test_runner.py +Copyright: 2013 Holger Hans Peter Freyther + 2013 Katerina Barone-Adesi +License: GPL-3.0+ + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. . - This library is distributed in the hope that it will be useful, + This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + . + You should have received a copy of the GNU General Public License + along with this program. If not, see . + . + On Debian systems, the complete text of the GNU General Public License + Version 3 can be found in `/usr/share/common-licenses/GPL-3'. + +Files: include/mISDNif.h +Copyright: 2008 Karsten Keil +License: LGPL-2.1 + This code is free software; you can redistribute it and/or modify + it under the terms of the GNU LESSER GENERAL PUBLIC LICENSE + version 2.1 as published by the Free Software Foundation. + . + This code is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU LESSER GENERAL PUBLIC LICENSE for more details. + . + On Debian systems, the complete text of the GNU Lesser General Public License + Version 2.1 can be found in `/usr/share/common-licenses/LGPL-2.1'. + +Files: src/gprs/v42bis.c +Copyright: 2005-2011 Steve Underwood +License: LGPL-2.1 + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU Lesser General Public License version 2.1, + as published by the Free Software Foundation. + . + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Lesser General Public License for more details. . You should have received a copy of the GNU Lesser General Public - License along with this library; if not, see . + License along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. . - On Debian systems, the complete text of the GNU Lesser General - Public License version 2.1 can be found in - "/usr/share/common-licenses/LGPL-2.1". + THIS IS A WORK IN PROGRESS. IT IS NOT FINISHED. + Currently it performs the core compression and decompression functions OK. + However, a number of the bells and whistles in V.42bis are incomplete. + . + ! \file + . + The FSF address in the above text is the old one. + . + On Debian systems, the complete text of the GNU Lesser General Public License + Version 2.1 can be found in `/usr/share/common-licenses/LGPL-2.1'. + +Files: include/openbsc/slhc.h +Copyright: 1989 Regents of the University of California. +License: __UNKNOWN__ + Redistribution and use in source and binary forms are permitted + provided that the above copyright notice and this paragraph are + duplicated in all such forms and that any documentation, + advertising materials, and other materials related to such + distribution and use acknowledge that the software was developed + by the University of California, Berkeley. The name of the + University may not be used to endorse or promote products derived + from this software without specific prior written permission. + THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. + . + Van Jacobson (van at helios.ee.lbl.gov), Dec 31, 1989: + - Initial distribution. + . + modified for KA9Q Internet Software Package by + Katie Stevens (dkstevens at ucdavis.edu) + University of California, Davis + Computing Services + - 01-31-90 initial adaptation + +Files: src/gprs/slhc.c +Copyright: 1989 Regents of the University of California. +License: __UNKNOWN__ + Redistribution and use in source and binary forms are permitted + provided that the above copyright notice and this paragraph are + duplicated in all such forms and that any documentation, + advertising materials, and other materials related to such + distribution and use acknowledge that the software was developed + by the University of California, Berkeley. The name of the + University may not be used to endorse or promote products derived + from this software without specific prior written permission. + THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. + . + Van Jacobson (van at helios.ee.lbl.gov), Dec 31, 1989: + - Initial distribution. + . + modified for KA9Q Internet Software Package by + Katie Stevens (dkstevens at ucdavis.edu) + University of California, Davis + Computing Services + - 01-31-90 initial adaptation (from 1.19) + PPP.05 02-15-90 [ks] + PPP.08 05-02-90 [ks] use PPP protocol field to signal compression + PPP.15 09-90 [ks] improve mbuf handling + PPP.16 11-02 [karn] substantially rewritten to use NOS facilities + +Files: m4/ax_check_compile_flag.m4 +Copyright: 2008 Guido U. Draheim + 2011 Maarten Bosmans +License: GPL-3.0+ with unknown exception *** check multiple exceptions *** + This program is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the + Free Software Foundation, either version 3 of the License, or (at your + option) any later version. + . + This program is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General + Public License for more details. + . + You should have received a copy of the GNU General Public License along + with this program. If not, see . + . + As a special exception, the respective Autoconf Macro's copyright owner + gives unlimited permission to copy, distribute and modify the configure + scripts that are the output of Autoconf when processing the Macro. You + need not follow the terms of the GNU General Public License when using + or distributing such scripts, even though portions of the text of the + Macro appear in them. The GNU General Public License (GPL) does govern + all other use of the material that constitutes the Autoconf Macro. + . + This special exception to the GPL applies to versions of the Autoconf + Macro released by the Autoconf Archive. When you make and distribute a + modified version of the Autoconf Macro, you may extend this special + exception to the GPL to apply to your modified version as well. + . + On Debian systems, the complete text of the GNU General Public License + Version 3 can be found in `/usr/share/common-licenses/GPL-3'. diff --git a/debian/docs b/debian/docs deleted file mode 100644 index cd545c2..0000000 --- a/debian/docs +++ /dev/null @@ -1 +0,0 @@ -openbsc/README diff --git a/debian/openbsc-dev.install b/debian/openbsc-dev.install deleted file mode 100644 index 0c05545..0000000 --- a/debian/openbsc-dev.install +++ /dev/null @@ -1,4 +0,0 @@ -openbsc/include/openbsc/gsm_data_shared.h usr/src/osmocom/openbsc/openbsc/include/openbsc/ -openbsc/include/openbsc/common_cs.h usr/src/osmocom/openbsc/openbsc/include/openbsc/ -openbsc/src/libcommon/gsm_data_shared.c usr/src/osmocom/openbsc/openbsc/src/libcommon/ -usr/lib/*/pkgconfig/openbsc.pc diff --git a/debian/osmocom-gbproxy.init b/debian/osmo-gbproxy.init similarity index 100% rename from debian/osmocom-gbproxy.init rename to debian/osmo-gbproxy.init diff --git a/debian/osmo-gbproxy.install b/debian/osmo-gbproxy.install new file mode 100644 index 0000000..62ebe2a --- /dev/null +++ b/debian/osmo-gbproxy.install @@ -0,0 +1,2 @@ +usr/bin/osmo-gbproxy +usr/share/doc/openbsc/examples/osmo-gbproxy diff --git a/debian/osmo-gtphub.examples b/debian/osmo-gtphub.examples deleted file mode 100644 index 48c2dc0..0000000 --- a/debian/osmo-gtphub.examples +++ /dev/null @@ -1 +0,0 @@ -openbsc/doc/examples/osmo-gtphub diff --git a/debian/osmo-gtphub.install b/debian/osmo-gtphub.install index 908c1a5..8a5dafd 100644 --- a/debian/osmo-gtphub.install +++ b/debian/osmo-gtphub.install @@ -1 +1,2 @@ -/usr/bin/osmo-gtphub +usr/bin/osmo-gtphub +usr/share/doc/openbsc/examples/osmo-gtphub diff --git a/debian/osmo-sgsn.install b/debian/osmo-sgsn.install new file mode 100644 index 0000000..55086cc --- /dev/null +++ b/debian/osmo-sgsn.install @@ -0,0 +1,4 @@ +usr/bin +usr/share/doc/openbsc/examples/osmo-gtphub +usr/share/doc/openbsc/examples/osmo-gbproxy +usr/share/doc/openbsc/examples/osmo-sgsn diff --git a/debian/osmocom-bs11-utils.install b/debian/osmocom-bs11-utils.install deleted file mode 100644 index 757a854..0000000 --- a/debian/osmocom-bs11-utils.install +++ /dev/null @@ -1,2 +0,0 @@ -/usr/bin/bs11_config -/usr/bin/isdnsync diff --git a/debian/osmocom-bsc-nat.init b/debian/osmocom-bsc-nat.init deleted file mode 100755 index 984a7ce..0000000 --- a/debian/osmocom-bsc-nat.init +++ /dev/null @@ -1,153 +0,0 @@ -#!/bin/sh -### BEGIN INIT INFO -# Provides: osmocom-bsc-nat -# Required-Start: $network $local_fs -# Required-Stop: -# Default-Start: 2 3 4 5 -# Default-Stop: 0 1 6 -# Short-Description: Osmocom GSM network-in-a-box -# Description: A minimal implementation of the GSM Base Station Controller, -# Mobile Switching Center, Home Location regster and all other -# components to run a self-contained GSM network. -### END INIT INFO - -# Author: Harald Welte - -# PATH should only include /usr/* if it runs after the mountnfs.sh script -PATH=/sbin:/usr/sbin:/bin:/usr/bin -NAME=osmo-bsc_nat # Introduce the short server's name here -DESC="Osmocom GSM BSC Multiplexer (NAT)" # Introduce a short description here -DAEMON=/usr/bin/osmo-bsc_nat # Introduce the server's location here -SCRIPTNAME=/etc/init.d/osmocom-bsc-nat -CONFIG_FILE=/etc/osmocom/osmocom-bsc-nat.cfg - -# Exit if the package is not installed -[ -x $DAEMON ] || exit 0 - -# Read configuration variable file if it is present -[ -r /etc/default/osmocom-bsc-nat ] && . /etc/default/osmocom-bsc-nat - -# Load the VERBOSE setting and other rcS variables -. /lib/init/vars.sh - -# Define LSB log_* functions. -# Depend on lsb-base (>= 3.0-6) to ensure that this file is present. -. /lib/lsb/init-functions - -DAEMON_ARGS="-D -c $CONFIG_FILE" - -# -# Function that starts the daemon/service -# -do_start() -{ - # Return - # 0 if daemon has been started - # 1 if daemon was already running - # 2 if daemon could not be started - start-stop-daemon --start --quiet --exec $DAEMON --test > /dev/null \ - || return 1 - start-stop-daemon --start --quiet --exec $DAEMON -- \ - $DAEMON_ARGS \ - || return 2 - # Add code here, if necessary, that waits for the process to be ready - # to handle requests from services started subsequently which depend - # on this one. As a last resort, sleep for some time. -} - -# -# Function that stops the daemon/service -# -do_stop() -{ - # Return - # 0 if daemon has been stopped - # 1 if daemon was already stopped - # 2 if daemon could not be stopped - # other if a failure occurred - start-stop-daemon --stop --quiet --retry=TERM/30/KILL/5 --name $NAME - RETVAL="$?" - [ "$RETVAL" = 2 ] && return 2 - # Wait for children to finish too if this is a daemon that forks - # and if the daemon is only ever run from this initscript. - # If the above conditions are not satisfied then add some other code - # that waits for the process to drop all resources that could be - # needed by services started subsequently. A last resort is to - # sleep for some time. - start-stop-daemon --stop --quiet --oknodo --retry=0/30/KILL/5 --exec $DAEMON - [ "$?" = 2 ] && return 2 - return "$RETVAL" -} - -# -# Function that sends a SIGHUP to the daemon/service -# -do_reload() { - # - # If the daemon can reload its configuration without - # restarting (for example, when it is sent a SIGHUP), - # then implement that here. - # - start-stop-daemon --stop --signal 1 --quiet $PIDFILE --name $NAME - return 0 -} - -case "$1" in - start) - [ "$VERBOSE" != no ] && log_daemon_msg "Starting $DESC " "$NAME" - do_start - case "$?" in - 0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;; - 2) [ "$VERBOSE" != no ] && log_end_msg 1 ;; - esac - ;; - stop) - [ "$VERBOSE" != no ] && log_daemon_msg "Stopping $DESC" "$NAME" - do_stop - case "$?" in - 0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;; - 2) [ "$VERBOSE" != no ] && log_end_msg 1 ;; - esac - ;; - status) - status_of_proc "$DAEMON" "$NAME" && exit 0 || exit $? - ;; - #reload|force-reload) - # - # If do_reload() is not implemented then leave this commented out - # and leave 'force-reload' as an alias for 'restart'. - # - #log_daemon_msg "Reloading $DESC" "$NAME" - #do_reload - #log_end_msg $? - #;; - restart|force-reload) - # - # If the "reload" option is implemented then remove the - # 'force-reload' alias - # - log_daemon_msg "Restarting $DESC" "$NAME" - do_stop - case "$?" in - 0|1) - do_start - case "$?" in - 0) log_end_msg 0 ;; - 1) log_end_msg 1 ;; # Old process is still running - *) log_end_msg 1 ;; # Failed to start - esac - ;; - *) - # Failed to stop - log_end_msg 1 - ;; - esac - ;; - *) - #echo "Usage: $SCRIPTNAME {start|stop|restart|reload|force-reload}" >&2 - echo "Usage: $SCRIPTNAME {start|stop|status|restart|force-reload}" >&2 - exit 3 - ;; -esac - -: diff --git a/debian/osmocom-bsc-nat.install b/debian/osmocom-bsc-nat.install deleted file mode 100644 index b561a7e..0000000 --- a/debian/osmocom-bsc-nat.install +++ /dev/null @@ -1 +0,0 @@ -/usr/bin/osmo-bsc_nat diff --git a/debian/osmocom-bsc.examples b/debian/osmocom-bsc.examples deleted file mode 100644 index a95f12b..0000000 --- a/debian/osmocom-bsc.examples +++ /dev/null @@ -1 +0,0 @@ -openbsc/doc/examples/osmo-bsc_mgcp diff --git a/debian/osmocom-bsc.install b/debian/osmocom-bsc.install deleted file mode 100644 index ab9459e..0000000 --- a/debian/osmocom-bsc.install +++ /dev/null @@ -1,2 +0,0 @@ -/usr/bin/osmo-bsc_mgcp -/usr/bin/osmo-bsc diff --git a/debian/osmocom-gbproxy.install b/debian/osmocom-gbproxy.install deleted file mode 100644 index ba3f6ee..0000000 --- a/debian/osmocom-gbproxy.install +++ /dev/null @@ -1 +0,0 @@ -/usr/bin/osmo-gbproxy diff --git a/debian/osmocom-ipaccess-utils.install b/debian/osmocom-ipaccess-utils.install deleted file mode 100644 index de13c18..0000000 --- a/debian/osmocom-ipaccess-utils.install +++ /dev/null @@ -1,3 +0,0 @@ -/usr/bin/ipaccess-config -/usr/bin/abisip-find -/usr/bin/ipaccess-proxy diff --git a/debian/osmocom-nitb.default b/debian/osmocom-nitb.default deleted file mode 100644 index ef76a5f..0000000 --- a/debian/osmocom-nitb.default +++ /dev/null @@ -1,8 +0,0 @@ -CONFIG_FILE="/etc/osmocom/osmo-nitb.cfg" -HLR_FILE="/var/lib/osmocom/hlr.sqlite3" - -DAEMON_ARGS="-P" - -# Uncomment if using LCR+Asterisk -# DAEMON_ARGS="-m -P" - diff --git a/debian/osmocom-nitb.dirs b/debian/osmocom-nitb.dirs deleted file mode 100644 index efbca2b..0000000 --- a/debian/osmocom-nitb.dirs +++ /dev/null @@ -1,3 +0,0 @@ -/etc/osmocom -/var/log/osmocom -/var/lib/osmocom diff --git a/debian/osmocom-nitb.examples b/debian/osmocom-nitb.examples deleted file mode 100644 index c098d5c..0000000 --- a/debian/osmocom-nitb.examples +++ /dev/null @@ -1 +0,0 @@ -openbsc/doc/examples/osmo-nitb diff --git a/debian/osmocom-nitb.init b/debian/osmocom-nitb.init deleted file mode 100755 index 0747446..0000000 --- a/debian/osmocom-nitb.init +++ /dev/null @@ -1,152 +0,0 @@ -#!/bin/sh -### BEGIN INIT INFO -# Provides: osmo-nitb -# Required-Start: $network $local_fs -# Required-Stop: -# Default-Start: 2 3 4 5 -# Default-Stop: 0 1 6 -# Short-Description: Osmocom GSM network-in-a-box -# Description: A minimal implementation of the GSM Base Station Controller, -# Mobile Switching Center, Home Location regster and all other -# components to run a self-contained GSM network. -### END INIT INFO - -# Author: Harald Welte - -# PATH should only include /usr/* if it runs after the mountnfs.sh script -PATH=/sbin:/usr/sbin:/bin:/usr/bin -NAME=osmo-nitb # Introduce the short server's name here -DESC="Osmocom GSM Network-in-a-Box" # Introduce a short description here -DAEMON=/usr/bin/osmo-nitb # Introduce the server's location here -SCRIPTNAME=/etc/init.d/osmocom-nitb - -# Exit if the package is not installed -[ -x $DAEMON ] || exit 0 - -# Read configuration variable file if it is present -[ -r /etc/default/osmocom-nitb ] && . /etc/default/osmocom-nitb - -# Load the VERBOSE setting and other rcS variables -. /lib/init/vars.sh - -# Define LSB log_* functions. -# Depend on lsb-base (>= 3.0-6) to ensure that this file is present. -. /lib/lsb/init-functions - -DAEMON_ARGS="$DAEMON_ARGS -D -c $CONFIG_FILE -l $HLR_FILE" - -# -# Function that starts the daemon/service -# -do_start() -{ - # Return - # 0 if daemon has been started - # 1 if daemon was already running - # 2 if daemon could not be started - start-stop-daemon --start --quiet --exec $DAEMON --test > /dev/null \ - || return 1 - start-stop-daemon --start --quiet --exec $DAEMON -- \ - $DAEMON_ARGS \ - || return 2 - # Add code here, if necessary, that waits for the process to be ready - # to handle requests from services started subsequently which depend - # on this one. As a last resort, sleep for some time. -} - -# -# Function that stops the daemon/service -# -do_stop() -{ - # Return - # 0 if daemon has been stopped - # 1 if daemon was already stopped - # 2 if daemon could not be stopped - # other if a failure occurred - start-stop-daemon --stop --quiet --retry=TERM/30/KILL/5 --name $NAME - RETVAL="$?" - [ "$RETVAL" = 2 ] && return 2 - # Wait for children to finish too if this is a daemon that forks - # and if the daemon is only ever run from this initscript. - # If the above conditions are not satisfied then add some other code - # that waits for the process to drop all resources that could be - # needed by services started subsequently. A last resort is to - # sleep for some time. - start-stop-daemon --stop --quiet --oknodo --retry=0/30/KILL/5 --exec $DAEMON - [ "$?" = 2 ] && return 2 - return "$RETVAL" -} - -# -# Function that sends a SIGHUP to the daemon/service -# -do_reload() { - # - # If the daemon can reload its configuration without - # restarting (for example, when it is sent a SIGHUP), - # then implement that here. - # - start-stop-daemon --stop --signal 1 --quiet $PIDFILE --name $NAME - return 0 -} - -case "$1" in - start) - [ "$VERBOSE" != no ] && log_daemon_msg "Starting $DESC " "$NAME" - do_start - case "$?" in - 0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;; - 2) [ "$VERBOSE" != no ] && log_end_msg 1 ;; - esac - ;; - stop) - [ "$VERBOSE" != no ] && log_daemon_msg "Stopping $DESC" "$NAME" - do_stop - case "$?" in - 0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;; - 2) [ "$VERBOSE" != no ] && log_end_msg 1 ;; - esac - ;; - status) - status_of_proc "$DAEMON" "$NAME" && exit 0 || exit $? - ;; - #reload|force-reload) - # - # If do_reload() is not implemented then leave this commented out - # and leave 'force-reload' as an alias for 'restart'. - # - #log_daemon_msg "Reloading $DESC" "$NAME" - #do_reload - #log_end_msg $? - #;; - restart|force-reload) - # - # If the "reload" option is implemented then remove the - # 'force-reload' alias - # - log_daemon_msg "Restarting $DESC" "$NAME" - do_stop - case "$?" in - 0|1) - do_start - case "$?" in - 0) log_end_msg 0 ;; - 1) log_end_msg 1 ;; # Old process is still running - *) log_end_msg 1 ;; # Failed to start - esac - ;; - *) - # Failed to stop - log_end_msg 1 - ;; - esac - ;; - *) - #echo "Usage: $SCRIPTNAME {start|stop|restart|reload|force-reload}" >&2 - echo "Usage: $SCRIPTNAME {start|stop|status|restart|force-reload}" >&2 - exit 3 - ;; -esac - -: diff --git a/debian/osmocom-nitb.install b/debian/osmocom-nitb.install deleted file mode 100644 index 26caf71..0000000 --- a/debian/osmocom-nitb.install +++ /dev/null @@ -1,2 +0,0 @@ -/usr/bin/osmo-nitb -openbsc/contrib/*.py usr/bin/ \ No newline at end of file diff --git a/debian/osmocom-sgsn.default b/debian/osmocom-sgsn.default deleted file mode 100644 index 77c9679..0000000 --- a/debian/osmocom-sgsn.default +++ /dev/null @@ -1,2 +0,0 @@ -CONFIG_FILE="/etc/osmocom/osmo-sgsn.cfg" - diff --git a/debian/osmocom-sgsn.examples b/debian/osmocom-sgsn.examples deleted file mode 100644 index 15de78d..0000000 --- a/debian/osmocom-sgsn.examples +++ /dev/null @@ -1 +0,0 @@ -openbsc/doc/examples/osmo-sgsn diff --git a/debian/osmocom-sgsn.init b/debian/osmocom-sgsn.init deleted file mode 100755 index 0794dc1..0000000 --- a/debian/osmocom-sgsn.init +++ /dev/null @@ -1,150 +0,0 @@ -#!/bin/sh -### BEGIN INIT INFO -# Provides: osmo-sgsn -# Required-Start: $network $local_fs -# Required-Stop: -# Default-Start: 2 3 4 5 -# Default-Stop: 0 1 6 -# Short-Description: Osmocom Serving GPRS Support Node -# Description: Osmocom Serving GPRS Support Node -### END INIT INFO - -# Author: Harald Welte - -# PATH should only include /usr/* if it runs after the mountnfs.sh script -PATH=/sbin:/usr/sbin:/bin:/usr/bin -NAME=osmo-sgsn # Introduce the short server's name here -DESC="Osmocom Serving GPRS Support Node" # Introduce a short description here -DAEMON=/usr/bin/osmo-sgsn # Introduce the server's location here -SCRIPTNAME=/etc/init.d/osmocom-sgsn - -# Exit if the package is not installed -[ -x $DAEMON ] || exit 0 - -# Read configuration variable file if it is present -[ -r /etc/default/osmocom-sgsn ] && . /etc/default/osmocom-sgsn - -# Load the VERBOSE setting and other rcS variables -. /lib/init/vars.sh - -# Define LSB log_* functions. -# Depend on lsb-base (>= 3.0-6) to ensure that this file is present. -. /lib/lsb/init-functions - -DAEMON_ARGS="$DAEMON_ARGS -D -c $CONFIG_FILE" - -# -# Function that starts the daemon/service -# -do_start() -{ - # Return - # 0 if daemon has been started - # 1 if daemon was already running - # 2 if daemon could not be started - start-stop-daemon --start --quiet --exec $DAEMON --test > /dev/null \ - || return 1 - start-stop-daemon --start --quiet --exec $DAEMON -- \ - $DAEMON_ARGS \ - || return 2 - # Add code here, if necessary, that waits for the process to be ready - # to handle requests from services started subsequently which depend - # on this one. As a last resort, sleep for some time. -} - -# -# Function that stops the daemon/service -# -do_stop() -{ - # Return - # 0 if daemon has been stopped - # 1 if daemon was already stopped - # 2 if daemon could not be stopped - # other if a failure occurred - start-stop-daemon --stop --quiet --retry=TERM/30/KILL/5 --name $NAME - RETVAL="$?" - [ "$RETVAL" = 2 ] && return 2 - # Wait for children to finish too if this is a daemon that forks - # and if the daemon is only ever run from this initscript. - # If the above conditions are not satisfied then add some other code - # that waits for the process to drop all resources that could be - # needed by services started subsequently. A last resort is to - # sleep for some time. - start-stop-daemon --stop --quiet --oknodo --retry=0/30/KILL/5 --exec $DAEMON - [ "$?" = 2 ] && return 2 - return "$RETVAL" -} - -# -# Function that sends a SIGHUP to the daemon/service -# -do_reload() { - # - # If the daemon can reload its configuration without - # restarting (for example, when it is sent a SIGHUP), - # then implement that here. - # - start-stop-daemon --stop --signal 1 --quiet $PIDFILE --name $NAME - return 0 -} - -case "$1" in - start) - [ "$VERBOSE" != no ] && log_daemon_msg "Starting $DESC " "$NAME" - do_start - case "$?" in - 0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;; - 2) [ "$VERBOSE" != no ] && log_end_msg 1 ;; - esac - ;; - stop) - [ "$VERBOSE" != no ] && log_daemon_msg "Stopping $DESC" "$NAME" - do_stop - case "$?" in - 0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;; - 2) [ "$VERBOSE" != no ] && log_end_msg 1 ;; - esac - ;; - status) - status_of_proc "$DAEMON" "$NAME" && exit 0 || exit $? - ;; - #reload|force-reload) - # - # If do_reload() is not implemented then leave this commented out - # and leave 'force-reload' as an alias for 'restart'. - # - #log_daemon_msg "Reloading $DESC" "$NAME" - #do_reload - #log_end_msg $? - #;; - restart|force-reload) - # - # If the "reload" option is implemented then remove the - # 'force-reload' alias - # - log_daemon_msg "Restarting $DESC" "$NAME" - do_stop - case "$?" in - 0|1) - do_start - case "$?" in - 0) log_end_msg 0 ;; - 1) log_end_msg 1 ;; # Old process is still running - *) log_end_msg 1 ;; # Failed to start - esac - ;; - *) - # Failed to stop - log_end_msg 1 - ;; - esac - ;; - *) - #echo "Usage: $SCRIPTNAME {start|stop|restart|reload|force-reload}" >&2 - echo "Usage: $SCRIPTNAME {start|stop|status|restart|force-reload}" >&2 - exit 3 - ;; -esac - -: diff --git a/debian/osmocom-sgsn.install b/debian/osmocom-sgsn.install deleted file mode 100644 index d89c456..0000000 --- a/debian/osmocom-sgsn.install +++ /dev/null @@ -1 +0,0 @@ -/usr/bin/osmo-sgsn diff --git a/debian/rules b/debian/rules index 4e187a6..4fe1f46 100755 --- a/debian/rules +++ b/debian/rules @@ -1,32 +1,61 @@ #!/usr/bin/make -f +# You must remove unused comment lines for the released package. +# See debhelper(7) (uncomment to enable) +# This is an autogenerated template for debian/rules. +# +# Output every command that modifies files on the build system. +#export DH_VERBOSE = 1 +# +# Copy some variable definitions from pkg-info.mk and vendor.mk +# under /usr/share/dpkg/ to here if they are useful. +# +# See FEATURE AREAS/ENVIRONMENT in dpkg-buildflags(1) +# Apply all hardening options +#export DEB_BUILD_MAINT_OPTIONS = hardening=+all +# Package maintainers to append CFLAGS +#export DEB_CFLAGS_MAINT_APPEND = -Wall -pedantic +# Package maintainers to append LDFLAGS +#export DEB_LDFLAGS_MAINT_APPEND = -Wl,--as-needed +# +# With debhelper version 9 or newer, the dh command exports +# all buildflags. So there is no need to include the +# /usr/share/dpkg/buildflags.mk file here if compat is 9 or newer. +# +# These are rarely used code. (START) +# +# The following include for *.mk magically sets miscellaneous +# variables while honoring existing values of pertinent +# environment variables: +# +# Architecture-related variables such as DEB_TARGET_MULTIARCH: +#include /usr/share/dpkg/architecture.mk +# Vendor-related variables such as DEB_VENDOR: +#include /usr/share/dpkg/vendor.mk +# Package-related variables such as DEB_DISTRIBUTION +#include /usr/share/dpkg/pkg-info.mk +# +# You may alternatively set them susing a simple script such as: +# DEB_VENDOR ?= $(shell dpkg-vendor --query Vendor) +# +# These are rarely used code. (END) +# -# Uncomment this to turn on verbose mode. -#export DH_VERBOSE=1 - -DEBIAN := $(shell dpkg-parsechangelog | grep ^Version: | cut -d' ' -f2) -DEBVERS := $(shell echo '$(DEBIAN)' | cut -d- -f1) -VERSION := $(shell echo '$(DEBVERS)' | sed -e 's/[+-].*//' -e 's/~//g') - -export DEB_BUILD_MAINT_OPTIONS = hardening=+all - +# main packaging script based on dh7 syntax %: - dh $@ --sourcedirectory=openbsc --with autoreconf + dh $@ --with autoreconf -# This is needed for debian stable (squeeze) -override_dh_autoreconf: - cd openbsc && autoreconf --install --force +# debmake generated override targets +# Set options for ./configure +CONFIGURE_FLAGS += --enable-iu +override_dh_configure: + dh_auto_configure -- $(CONFIGURE_FLAGS) +# +# Do not install libtool archive, python .pyc .pyo +#override_dh_install: +# dh_install --list-missing -X.la -X.pyc -X.pyo +# See https://www.debian.org/doc/manuals/developers-reference/best-pkging-practices.html#bpp-dbg override_dh_strip: - dh_strip -posmocom-bsc --dbg-package=osmocom-bsc-dbg - dh_strip -posmocom-nitb --dbg-package=osmocom-nitb-dbg - dh_strip -posmocom-ipaccess-utils --dbg-package=osmocom-ipaccess-utils-dbg - dh_strip -posmocom-bs11-utils --dbg-package=osmocom-bs11-utils-dbg - dh_strip -posmocom-sgsn --dbg-package=osmocom-sgsn-dbg - dh_strip -posmocom-gbproxy --dbg-package=osmocom-gbproxy-dbg - dh_strip -posmocom-bsc-nat --dbg-package=osmocom-bsc-nat-dbg - dh_strip -posmo-gtphub --dbg-package=osmo-gtphub-dbg - -override_dh_auto_configure: - echo $(VERSION) > openbsc/.tarball-version - dh_auto_configure --sourcedirectory=openbsc -- --enable-nat --enable-osmo-bsc --enable-smpp - + dh_strip --dbg-package=osmo-sgsn-dbg + dh_strip --dbg-package=osmo-gtphub-dbg + dh_strip --dbg-package=osmo-gbproxy-dbg -- To view, visit https://gerrit.osmocom.org/3741 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ic0135a1118a115e8f053154e280f60674390f43a Gerrit-PatchSet: 1 Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: lynxis lazus From gerrit-no-reply at lists.osmocom.org Wed Aug 30 12:27:38 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 30 Aug 2017 12:27:38 +0000 Subject: [PATCH] osmo-mgw[master]: split off osmo-mgw: remove files, apply build, rename Message-ID: Review at https://gerrit.osmocom.org/3742 split off osmo-mgw: remove files, apply build, rename Add vty and logging previously used from libcommon Rename libmgcp to libosmo-legacy-mgcp and install. Use DLMGCP, not DMGCP. Depends: libosmocore I09c587e2d59472cbde852d467d457254746d9e67 Change-Id: I71a0a16ebaaef881c34235849601fc40aa12cfd7 --- M Makefile.am M configure.ac D contrib/a-link/sccp-split-by-con.lua D contrib/bsc-test/README D contrib/bsc-test/all_dial D contrib/bsc-test/dial.sh D contrib/bsc-test/drop-oml.sh D contrib/bsc-test/drop.sh D contrib/bsc-test/hangup D contrib/bsc-test/msc.sh D contrib/bsc_control.py D contrib/bt.py D contrib/convert_to_enum.py D contrib/ctrl2sse.py D contrib/gprs/gb-proxy-unblock-bug.py D contrib/gprs/gprs-bssgp-histogram.lua D contrib/gprs/gprs-buffer-count.lua D contrib/gprs/gprs-split-trace-by-tlli.lua D contrib/gprs/gprs-verify-nu.lua D contrib/hlr-remove-old.sql D contrib/hlrsync/hlrsync.py M contrib/jenkins.sh D contrib/nat/test_regexp.c D contrib/nat/ussd_example.py D contrib/rtp/gen_rtp_header.erl D contrib/rtp/rtp_replay.st D contrib/rtp/rtp_replay_shared.st D contrib/rtp/rtp_replay_sip.st D contrib/rtp/timestamp_rtp.lua D contrib/sms/fill-hlr.st D contrib/sms/hlr-query.st D contrib/sms/sqlite-probe.tap.d D contrib/soap.py D contrib/systemd/osmo-bsc.service D contrib/systemd/osmo-gbproxy.service D contrib/systemd/osmo-msc.service D contrib/systemd/osmo-nitb.service D contrib/systemd/osmo-sgsn.service D contrib/testconv/Makefile D contrib/testconv/testconv_main.c D contrib/twisted_ipa.py M include/Makefile.am D include/compat_af_isdn.h D include/mISDNif.h D include/openbsc/Makefile.am D include/openbsc/a_iface.h D include/openbsc/a_iface_bssap.h D include/openbsc/a_reset.h D include/openbsc/abis_nm.h D include/openbsc/abis_om2000.h D include/openbsc/abis_rsl.h D include/openbsc/arfcn_range_encode.h D include/openbsc/auth.h D include/openbsc/bsc_api.h D include/openbsc/bsc_msc.h D include/openbsc/bsc_msc_data.h D include/openbsc/bsc_msg_filter.h D include/openbsc/bsc_nat.h D include/openbsc/bsc_nat_callstats.h D include/openbsc/bsc_nat_sccp.h D include/openbsc/bsc_rll.h D include/openbsc/bsc_subscriber.h D include/openbsc/bss.h D include/openbsc/bts_ipaccess_nanobts_omlattr.h D include/openbsc/chan_alloc.h D include/openbsc/common.h D include/openbsc/common_bsc.h D include/openbsc/common_cs.h D include/openbsc/crc24.h D include/openbsc/ctrl.h D include/openbsc/db.h D include/openbsc/debug.h D include/openbsc/e1_config.h D include/openbsc/gb_proxy.h D include/openbsc/gprs_gb_parse.h D include/openbsc/gprs_gmm.h D include/openbsc/gprs_llc.h D include/openbsc/gprs_llc_xid.h D include/openbsc/gprs_sgsn.h D include/openbsc/gprs_sndcp.h D include/openbsc/gprs_sndcp_comp.h D include/openbsc/gprs_sndcp_dcomp.h D include/openbsc/gprs_sndcp_pcomp.h D include/openbsc/gprs_sndcp_xid.h D include/openbsc/gprs_subscriber.h D include/openbsc/gprs_utils.h D include/openbsc/gsm_04_08.h D include/openbsc/gsm_04_11.h D include/openbsc/gsm_04_80.h D include/openbsc/gsm_data.h D include/openbsc/gsm_data_shared.h D include/openbsc/gsm_subscriber.h D include/openbsc/gsup_client.h D include/openbsc/gtphub.h D include/openbsc/handover.h D include/openbsc/handover_decision.h D include/openbsc/ipaccess.h D include/openbsc/iucs.h D include/openbsc/iucs_ranap.h D include/openbsc/meas_feed.h D include/openbsc/meas_rep.h D include/openbsc/mgcp.h D include/openbsc/mgcp_internal.h D include/openbsc/mgcpgw_client.h D include/openbsc/misdn.h D include/openbsc/mncc.h D include/openbsc/mncc_int.h D include/openbsc/msc_ifaces.h D include/openbsc/nat_rewrite_trie.h D include/openbsc/network_listen.h D include/openbsc/oap_client.h D include/openbsc/openbscdefines.h D include/openbsc/osmo_bsc.h D include/openbsc/osmo_bsc_grace.h D include/openbsc/osmo_bsc_reset.h D include/openbsc/osmo_bsc_rf.h D include/openbsc/osmo_bsc_sigtran.h D include/openbsc/osmo_msc.h D include/openbsc/paging.h D include/openbsc/pcu_if.h D include/openbsc/pcuif_proto.h D include/openbsc/rest_octets.h D include/openbsc/rrlp.h D include/openbsc/rs232.h D include/openbsc/rtp_proxy.h D include/openbsc/sgsn.h D include/openbsc/signal.h D include/openbsc/silent_call.h D include/openbsc/slhc.h D include/openbsc/smpp.h D include/openbsc/sms_queue.h D include/openbsc/socket.h D include/openbsc/system_information.h D include/openbsc/transaction.h D include/openbsc/trau_mux.h D include/openbsc/trau_upqueue.h D include/openbsc/ussd.h D include/openbsc/v42bis.h D include/openbsc/v42bis_private.h D include/openbsc/vlr.h D include/openbsc/vty.h A include/osmocom/Makefile.am A include/osmocom/legacy_mgcp/Makefile.am A include/osmocom/legacy_mgcp/mgcp.h A include/osmocom/legacy_mgcp/mgcp_internal.h R include/osmocom/legacy_mgcp/mgcp_transcode.h A include/osmocom/legacy_mgcp/mgcpgw_client.h R include/osmocom/legacy_mgcp/osmux.h A include/osmocom/legacy_mgcp/vty.h A libosmo-legacy-mgcp.pc.in D openbsc.pc.in M osmoappdesc.py M src/Makefile.am D src/gprs/.gitignore D src/gprs/Makefile.am D src/gprs/crc24.c D src/gprs/gb_proxy.c D src/gprs/gb_proxy_main.c D src/gprs/gb_proxy_patch.c D src/gprs/gb_proxy_peer.c D src/gprs/gb_proxy_tlli.c D src/gprs/gb_proxy_vty.c D src/gprs/gprs_gb_parse.c D src/gprs/gprs_gmm.c D src/gprs/gprs_llc.c D src/gprs/gprs_llc_parse.c D src/gprs/gprs_llc_vty.c D src/gprs/gprs_llc_xid.c D src/gprs/gprs_sgsn.c D src/gprs/gprs_sndcp.c D src/gprs/gprs_sndcp_comp.c D src/gprs/gprs_sndcp_dcomp.c D src/gprs/gprs_sndcp_pcomp.c D src/gprs/gprs_sndcp_vty.c D src/gprs/gprs_sndcp_xid.c D src/gprs/gprs_subscriber.c D src/gprs/gprs_utils.c D src/gprs/gtphub.c D src/gprs/gtphub_ares.c D src/gprs/gtphub_main.c D src/gprs/gtphub_sock.c D src/gprs/gtphub_vty.c D src/gprs/osmo_sgsn.cfg D src/gprs/sgsn_ares.c D src/gprs/sgsn_auth.c D src/gprs/sgsn_cdr.c D src/gprs/sgsn_ctrl.c D src/gprs/sgsn_libgtp.c D src/gprs/sgsn_main.c D src/gprs/sgsn_vty.c D src/gprs/slhc.c D src/gprs/v42bis.c D src/ipaccess/Makefile.am D src/ipaccess/abisip-find.c D src/ipaccess/ipaccess-config.c D src/ipaccess/ipaccess-firmware.c D src/ipaccess/ipaccess-proxy.c D src/ipaccess/network_listen.c D src/libbsc/Makefile.am D src/libbsc/abis_nm.c D src/libbsc/abis_nm_ipaccess.c D src/libbsc/abis_nm_vty.c D src/libbsc/abis_om2000.c D src/libbsc/abis_om2000_vty.c D src/libbsc/abis_rsl.c D src/libbsc/arfcn_range_encode.c D src/libbsc/bsc_api.c D src/libbsc/bsc_ctrl_commands.c D src/libbsc/bsc_ctrl_lookup.c D src/libbsc/bsc_dyn_ts.c D src/libbsc/bsc_init.c D src/libbsc/bsc_msc.c D src/libbsc/bsc_rf_ctrl.c D src/libbsc/bsc_rll.c D src/libbsc/bsc_subscriber.c D src/libbsc/bsc_vty.c D src/libbsc/bts_ericsson_rbs2000.c D src/libbsc/bts_init.c D src/libbsc/bts_ipaccess_nanobts.c D src/libbsc/bts_ipaccess_nanobts_omlattr.c D src/libbsc/bts_nokia_site.c D src/libbsc/bts_siemens_bs11.c D src/libbsc/bts_sysmobts.c D src/libbsc/bts_unknown.c D src/libbsc/chan_alloc.c D src/libbsc/e1_config.c D src/libbsc/gsm_04_08_utils.c D src/libbsc/gsm_04_80_utils.c D src/libbsc/handover_decision.c D src/libbsc/handover_logic.c D src/libbsc/meas_proc.c D src/libbsc/meas_rep.c D src/libbsc/net_init.c D src/libbsc/paging.c D src/libbsc/pcu_sock.c D src/libbsc/rest_octets.c D src/libbsc/system_information.c D src/libcommon-cs/Makefile.am D src/libcommon-cs/a_reset.c D src/libcommon-cs/common_cs.c D src/libcommon-cs/common_cs_vty.c D src/libcommon/Makefile.am D src/libcommon/bsc_version.c D src/libcommon/common_vty.c D src/libcommon/debug.c D src/libcommon/gsm_data.c D src/libcommon/gsm_data_shared.c D src/libcommon/gsm_subscriber_base.c D src/libcommon/gsup_client.c D src/libcommon/gsup_test_client.c D src/libcommon/oap_client.c D src/libcommon/socket.c D src/libcommon/talloc_ctx.c D src/libfilter/Makefile.am D src/libfilter/bsc_msg_acc.c D src/libfilter/bsc_msg_filter.c D src/libfilter/bsc_msg_vty.c D src/libmgcp/Makefile.am D src/libmgcp/mgcp_common.c D src/libmgcp/mgcp_network.c D src/libmgcp/mgcp_osmux.c D src/libmgcp/mgcp_protocol.c D src/libmgcp/mgcp_sdp.c D src/libmgcp/mgcp_transcode.c D src/libmgcp/mgcp_vty.c D src/libmgcp/mgcpgw_client.c D src/libmgcp/mgcpgw_client_vty.c D src/libmsc/Makefile.am D src/libmsc/a_iface.c D src/libmsc/a_iface_bssap.c D src/libmsc/auth.c D src/libmsc/ctrl_commands.c D src/libmsc/db.c D src/libmsc/gsm_04_08.c D src/libmsc/gsm_04_11.c D src/libmsc/gsm_04_80.c D src/libmsc/gsm_subscriber.c D src/libmsc/iu_dummy.c D src/libmsc/iucs.c D src/libmsc/iucs_ranap.c D src/libmsc/meas_feed.c D src/libmsc/meas_feed.h D src/libmsc/mncc.c D src/libmsc/mncc_builtin.c D src/libmsc/mncc_sock.c D src/libmsc/msc_ifaces.c D src/libmsc/msc_vty.c D src/libmsc/osmo_msc.c D src/libmsc/rrlp.c D src/libmsc/silent_call.c D src/libmsc/smpp_openbsc.c D src/libmsc/smpp_smsc.c D src/libmsc/smpp_smsc.h D src/libmsc/smpp_utils.c D src/libmsc/smpp_vty.c D src/libmsc/sms_queue.c D src/libmsc/subscr_conn.c D src/libmsc/transaction.c D src/libmsc/ussd.c D src/libmsc/vty_interface_layer3.c A src/libosmo-legacy-mgcp/Makefile.am R src/libosmo-legacy-mgcp/g711common.h A src/libosmo-legacy-mgcp/mgcp_common.c A src/libosmo-legacy-mgcp/mgcp_network.c A src/libosmo-legacy-mgcp/mgcp_osmux.c A src/libosmo-legacy-mgcp/mgcp_protocol.c A src/libosmo-legacy-mgcp/mgcp_sdp.c A src/libosmo-legacy-mgcp/mgcp_transcode.c A src/libosmo-legacy-mgcp/mgcp_vty.c A src/libosmo-legacy-mgcp/mgcpgw_client.c A src/libosmo-legacy-mgcp/mgcpgw_client_vty.c D src/libtrau/Makefile.am D src/libtrau/rtp_proxy.c D src/libtrau/trau_mux.c D src/libtrau/trau_upqueue.c D src/libvlr/Makefile.am D src/libvlr/vlr.c D src/libvlr/vlr_access_req_fsm.c D src/libvlr/vlr_access_req_fsm.h D src/libvlr/vlr_auth_fsm.c D src/libvlr/vlr_auth_fsm.h D src/libvlr/vlr_core.h D src/libvlr/vlr_lu_fsm.c D src/libvlr/vlr_lu_fsm.h D src/osmo-bsc/Makefile.am D src/osmo-bsc/osmo_bsc_api.c D src/osmo-bsc/osmo_bsc_audio.c D src/osmo-bsc/osmo_bsc_bssap.c D src/osmo-bsc/osmo_bsc_ctrl.c D src/osmo-bsc/osmo_bsc_filter.c D src/osmo-bsc/osmo_bsc_grace.c D src/osmo-bsc/osmo_bsc_main.c D src/osmo-bsc/osmo_bsc_msc.c D src/osmo-bsc/osmo_bsc_reset.c D src/osmo-bsc/osmo_bsc_sigtran.c D src/osmo-bsc/osmo_bsc_vty.c M src/osmo-bsc_mgcp/Makefile.am M src/osmo-bsc_mgcp/mgcp_main.c D src/osmo-bsc_nat/Makefile.am D src/osmo-bsc_nat/bsc_filter.c D src/osmo-bsc_nat/bsc_mgcp_utils.c D src/osmo-bsc_nat/bsc_nat.c D src/osmo-bsc_nat/bsc_nat_ctrl.c D src/osmo-bsc_nat/bsc_nat_filter.c D src/osmo-bsc_nat/bsc_nat_rewrite.c D src/osmo-bsc_nat/bsc_nat_rewrite_trie.c D src/osmo-bsc_nat/bsc_nat_utils.c D src/osmo-bsc_nat/bsc_nat_vty.c D src/osmo-bsc_nat/bsc_sccp.c D src/osmo-bsc_nat/bsc_ussd.c D src/osmo-msc/Makefile.am D src/osmo-msc/msc_main.c D src/utils/Makefile.am D src/utils/bs11_config.c D src/utils/isdnsync.c D src/utils/meas_db.c D src/utils/meas_db.h D src/utils/meas_json.c D src/utils/meas_pcap2db.c D src/utils/meas_udp2db.c D src/utils/meas_vis.c D src/utils/smpp_mirror.c M tests/Makefile.am D tests/abis/Makefile.am D tests/abis/abis_test.c D tests/abis/abis_test.ok D tests/bsc-nat-trie/Makefile.am D tests/bsc-nat-trie/bsc_nat_trie_test.c D tests/bsc-nat-trie/bsc_nat_trie_test.ok D tests/bsc-nat-trie/prefixes.csv D tests/bsc-nat/Makefile.am D tests/bsc-nat/barr.cfg D tests/bsc-nat/barr_dup.cfg D tests/bsc-nat/bsc_data.c D tests/bsc-nat/bsc_nat_test.c D tests/bsc-nat/bsc_nat_test.ok D tests/bsc-nat/prefixes.csv D tests/bsc/Makefile.am D tests/bsc/bsc_test.c D tests/bsc/bsc_test.ok D tests/channel/Makefile.am D tests/channel/channel_test.c D tests/channel/channel_test.ok D tests/db/Makefile.am D tests/db/db_test.c D tests/db/db_test.err D tests/db/db_test.ok D tests/db/hlr.sqlite3 D tests/gbproxy/Makefile.am D tests/gbproxy/gbproxy_test.c D tests/gbproxy/gbproxy_test.ok D tests/gprs/Makefile.am D tests/gprs/gprs_test.c D tests/gprs/gprs_test.ok D tests/gsm0408/Makefile.am D tests/gsm0408/gsm0408_test.c D tests/gsm0408/gsm0408_test.ok D tests/gtphub/Makefile.am D tests/gtphub/gtphub_test.c D tests/gtphub/gtphub_test.ok A tests/legacy_mgcp/Makefile.am A tests/legacy_mgcp/mgcp_test.c R tests/legacy_mgcp/mgcp_test.ok A tests/legacy_mgcp/mgcp_transcoding_test.c R tests/legacy_mgcp/mgcp_transcoding_test.ok A tests/legacy_mgcp/mgcpgw_client_test.c R tests/legacy_mgcp/mgcpgw_client_test.err R tests/legacy_mgcp/mgcpgw_client_test.ok D tests/mgcp/Makefile.am D tests/mgcp/mgcp_test.c D tests/mgcp/mgcp_transcoding_test.c D tests/mgcp/mgcpgw_client_test.c D tests/msc_vlr/Makefile.am D tests/msc_vlr/msc_vlr_test_gsm_authen.c D tests/msc_vlr/msc_vlr_test_gsm_authen.err D tests/msc_vlr/msc_vlr_test_gsm_authen.ok D tests/msc_vlr/msc_vlr_test_gsm_ciph.c D tests/msc_vlr/msc_vlr_test_gsm_ciph.err D tests/msc_vlr/msc_vlr_test_gsm_ciph.ok D tests/msc_vlr/msc_vlr_test_hlr_reject.c D tests/msc_vlr/msc_vlr_test_hlr_reject.err D tests/msc_vlr/msc_vlr_test_hlr_reject.ok D tests/msc_vlr/msc_vlr_test_hlr_timeout.c D tests/msc_vlr/msc_vlr_test_hlr_timeout.err D tests/msc_vlr/msc_vlr_test_hlr_timeout.ok D tests/msc_vlr/msc_vlr_test_ms_timeout.c D tests/msc_vlr/msc_vlr_test_ms_timeout.err D tests/msc_vlr/msc_vlr_test_ms_timeout.ok D tests/msc_vlr/msc_vlr_test_no_authen.c D tests/msc_vlr/msc_vlr_test_no_authen.err D tests/msc_vlr/msc_vlr_test_no_authen.ok D tests/msc_vlr/msc_vlr_test_reject_concurrency.c D tests/msc_vlr/msc_vlr_test_reject_concurrency.err D tests/msc_vlr/msc_vlr_test_reject_concurrency.ok D tests/msc_vlr/msc_vlr_test_rest.c D tests/msc_vlr/msc_vlr_test_rest.err D tests/msc_vlr/msc_vlr_test_rest.ok D tests/msc_vlr/msc_vlr_test_umts_authen.c D tests/msc_vlr/msc_vlr_test_umts_authen.err D tests/msc_vlr/msc_vlr_test_umts_authen.ok D tests/msc_vlr/msc_vlr_tests.c D tests/msc_vlr/msc_vlr_tests.h D tests/nanobts_omlattr/Makefile.am D tests/nanobts_omlattr/nanobts_omlattr_test.c D tests/nanobts_omlattr/nanobts_omlattr_test.ok D tests/oap/Makefile.am D tests/oap/oap_client_test.c D tests/oap/oap_client_test.err D tests/oap/oap_client_test.ok D tests/sgsn/Makefile.am D tests/sgsn/sgsn_test.c D tests/sgsn/sgsn_test.ok D tests/slhc/Makefile.am D tests/slhc/slhc_test.c D tests/slhc/slhc_test.ok D tests/smpp/Makefile.am D tests/smpp/smpp_test.c D tests/smpp/smpp_test.err D tests/smpp/smpp_test.ok D tests/smpp_test_runner.py D tests/sms_queue/Makefile.am D tests/sms_queue/sms_queue_test.c D tests/sms_queue/sms_queue_test.err D tests/sms_queue/sms_queue_test.ok D tests/sndcp_xid/Makefile.am D tests/sndcp_xid/sndcp_xid_test.c D tests/sndcp_xid/sndcp_xid_test.ok D tests/subscr/Makefile.am D tests/subscr/bsc_subscr_test.c D tests/subscr/bsc_subscr_test.err D tests/subscr/bsc_subscr_test.ok M tests/testsuite.at D tests/trau/Makefile.am D tests/trau/trau_test.c D tests/trau/trau_test.ok D tests/v42bis/Makefile.am D tests/v42bis/v42bis_test.c D tests/v42bis/v42bis_test.ok M tests/vty_test_runner.py D tests/xid/Makefile.am D tests/xid/xid_test.c D tests/xid/xid_test.ok 482 files changed, 9,797 insertions(+), 159,951 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-mgw refs/changes/42/3742/1 -- To view, visit https://gerrit.osmocom.org/3742 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I71a0a16ebaaef881c34235849601fc40aa12cfd7 Gerrit-PatchSet: 1 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Wed Aug 30 12:27:39 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 30 Aug 2017 12:27:39 +0000 Subject: [PATCH] osmo-mgw[master]: prune public mgcpgw_client api Message-ID: Review at https://gerrit.osmocom.org/3743 prune public mgcpgw_client api Slim down the public mgcpgw_client API, move all elements not actually used by current callers to private headers / static c. Change-Id: Ic9199c87c4ac6d249fd210579a877d5404ed8514 --- M include/osmocom/legacy_mgcp/Makefile.am M include/osmocom/legacy_mgcp/mgcpgw_client.h A include/osmocom/legacy_mgcp/mgcpgw_client_internal.h M src/libosmo-legacy-mgcp/mgcpgw_client.c M tests/legacy_mgcp/mgcpgw_client_test.c 5 files changed, 36 insertions(+), 50 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-mgw refs/changes/43/3743/1 diff --git a/include/osmocom/legacy_mgcp/Makefile.am b/include/osmocom/legacy_mgcp/Makefile.am index 4a9550c..52f0b5b 100644 --- a/include/osmocom/legacy_mgcp/Makefile.am +++ b/include/osmocom/legacy_mgcp/Makefile.am @@ -1,4 +1,5 @@ noinst_HEADERS = \ + mgcpgw_client_internal.h \ mgcp_transcode.h \ vty.h \ $(NULL) diff --git a/include/osmocom/legacy_mgcp/mgcpgw_client.h b/include/osmocom/legacy_mgcp/mgcpgw_client.h index 9e7a529..c8d92e9 100644 --- a/include/osmocom/legacy_mgcp/mgcpgw_client.h +++ b/include/osmocom/legacy_mgcp/mgcpgw_client.h @@ -59,8 +59,6 @@ enum mgcp_connection_mode; -int mgcp_response_parse_params(struct mgcp_response *r); - struct msgb *mgcp_msg_crcx(struct mgcpgw_client *mgcp, uint16_t rtp_endpoint, unsigned int call_id, enum mgcp_connection_mode mode); @@ -71,10 +69,3 @@ struct msgb *mgcp_msg_dlcx(struct mgcpgw_client *mgcp, uint16_t rtp_endpoint, unsigned int call_id); - -struct mgcp_response_pending * mgcpgw_client_pending_add( - struct mgcpgw_client *mgcp, - mgcp_trans_id_t trans_id, - mgcp_response_cb_t response_cb, - void *priv); -int mgcpgw_client_rx(struct mgcpgw_client *mgcp, struct msgb *msg); diff --git a/include/osmocom/legacy_mgcp/mgcpgw_client_internal.h b/include/osmocom/legacy_mgcp/mgcpgw_client_internal.h new file mode 100644 index 0000000..d3a7849 --- /dev/null +++ b/include/osmocom/legacy_mgcp/mgcpgw_client_internal.h @@ -0,0 +1,33 @@ +#pragma once + +#define MSGB_CB_MGCP_TRANS_ID 0 + +struct mgcpgw_client { + struct mgcpgw_client_conf actual; + uint32_t remote_addr; + struct osmo_wqueue wq; + mgcp_trans_id_t next_trans_id; + struct llist_head responses_pending; + struct llist_head inuse_endpoints; +}; + +struct mgcp_inuse_endpoint { + struct llist_head entry; + uint16_t id; +}; + +struct mgcp_response_pending { + struct llist_head entry; + + mgcp_trans_id_t trans_id; + mgcp_response_cb_t response_cb; + void *priv; +}; + +int mgcpgw_client_rx(struct mgcpgw_client *mgcp, struct msgb *msg); + +struct mgcp_response_pending * mgcpgw_client_pending_add( + struct mgcpgw_client *mgcp, + mgcp_trans_id_t trans_id, + mgcp_response_cb_t response_cb, + void *priv); diff --git a/src/libosmo-legacy-mgcp/mgcpgw_client.c b/src/libosmo-legacy-mgcp/mgcpgw_client.c index 2a7ae97..2064355 100644 --- a/src/libosmo-legacy-mgcp/mgcpgw_client.c +++ b/src/libosmo-legacy-mgcp/mgcpgw_client.c @@ -27,6 +27,7 @@ #include #include #include +#include #include #include @@ -34,47 +35,6 @@ #include #include #include - -/* When changed, also remember to update the unit test */ -#define MSGB_CB_MGCP_TRANS_ID 0 - -typedef unsigned int mgcp_trans_id_t; - -struct mgcpgw_client { - struct mgcpgw_client_conf actual; - uint32_t remote_addr; - struct osmo_wqueue wq; - mgcp_trans_id_t next_trans_id; - struct llist_head responses_pending; - struct llist_head inuse_endpoints; -}; - -struct mgcp_response_head { - int response_code; - mgcp_trans_id_t trans_id; - const char *comment; -}; - -struct mgcp_response { - char *body; - struct mgcp_response_head head; - uint16_t audio_port; -}; - -struct mgcp_inuse_endpoint { - struct llist_head entry; - uint16_t id; -}; - -struct mgcp_response_pending { - struct llist_head entry; - - mgcp_trans_id_t trans_id; - mgcp_response_cb_t response_cb; - void *priv; -}; - - void mgcpgw_client_conf_init(struct mgcpgw_client_conf *conf) { diff --git a/tests/legacy_mgcp/mgcpgw_client_test.c b/tests/legacy_mgcp/mgcpgw_client_test.c index 4a0ee66..51d5272 100644 --- a/tests/legacy_mgcp/mgcpgw_client_test.c +++ b/tests/legacy_mgcp/mgcpgw_client_test.c @@ -24,6 +24,7 @@ #include #include #include +#include void *ctx; -- To view, visit https://gerrit.osmocom.org/3743 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ic9199c87c4ac6d249fd210579a877d5404ed8514 Gerrit-PatchSet: 1 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Wed Aug 30 12:27:39 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 30 Aug 2017 12:27:39 +0000 Subject: [PATCH] osmo-mgw[master]: mgcp client: allow getting actual conf from opaque struct Message-ID: Review at https://gerrit.osmocom.org/3744 mgcp client: allow getting actual conf from opaque struct Change-Id: I90ba16f1e2cafb64c7e3af65e9402722bf7586b0 --- M include/osmocom/legacy_mgcp/mgcpgw_client.h M src/libosmo-legacy-mgcp/mgcpgw_client.c 2 files changed, 7 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-mgw refs/changes/44/3744/1 diff --git a/include/osmocom/legacy_mgcp/mgcpgw_client.h b/include/osmocom/legacy_mgcp/mgcpgw_client.h index c8d92e9..09db816 100644 --- a/include/osmocom/legacy_mgcp/mgcpgw_client.h +++ b/include/osmocom/legacy_mgcp/mgcpgw_client.h @@ -9,6 +9,7 @@ struct msgb; struct vty; +struct mgcpgw_client; struct mgcpgw_client_conf { const char *local_addr; @@ -37,6 +38,7 @@ void mgcpgw_client_conf_init(struct mgcpgw_client_conf *conf); void mgcpgw_client_vty_init(void *talloc_ctx, int node, struct mgcpgw_client_conf *conf); int mgcpgw_client_config_write(struct vty *vty, const char *indent); +struct mgcpgw_client_conf *mgcpgw_client_conf_actual(struct mgcpgw_client *mgcp); struct mgcpgw_client *mgcpgw_client_init(void *ctx, struct mgcpgw_client_conf *conf); diff --git a/src/libosmo-legacy-mgcp/mgcpgw_client.c b/src/libosmo-legacy-mgcp/mgcpgw_client.c index 2064355..810ba16 100644 --- a/src/libosmo-legacy-mgcp/mgcpgw_client.c +++ b/src/libosmo-legacy-mgcp/mgcpgw_client.c @@ -615,3 +615,8 @@ "DLCX %u %x at mgw MGCP 1.0\r\n" "C: %x\r\n", trans_id, rtp_endpoint, call_id); } + +struct mgcpgw_client_conf *mgcpgw_client_conf_actual(struct mgcpgw_client *mgcp) +{ + return &mgcp->actual; +} -- To view, visit https://gerrit.osmocom.org/3744 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I90ba16f1e2cafb64c7e3af65e9402722bf7586b0 Gerrit-PatchSet: 1 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Wed Aug 30 12:27:39 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 30 Aug 2017 12:27:39 +0000 Subject: [PATCH] osmo-mgw[master]: rework debian packages support Message-ID: Review at https://gerrit.osmocom.org/3745 rework debian packages support Remove old leftover from split of osmo-mgw out of openbsc. Change-Id: I96a6a56c401833d053d48908872fb0474f5aec53 --- D debian/autoreconf M debian/changelog M debian/control M debian/copyright D debian/docs A debian/libosmo-legacy-mgcp-dev.install A debian/libosmo-legacy-mgcp0.install D debian/openbsc-dev.install D debian/osmo-gtphub.default D debian/osmo-gtphub.examples D debian/osmo-gtphub.init D debian/osmo-gtphub.install A debian/osmo-mgw.install D debian/osmocom-bs11-utils.install D debian/osmocom-bsc-nat.init D debian/osmocom-bsc-nat.install D debian/osmocom-bsc.examples D debian/osmocom-bsc.install D debian/osmocom-gbproxy.init D debian/osmocom-gbproxy.install D debian/osmocom-ipaccess-utils.install D debian/osmocom-nitb.default D debian/osmocom-nitb.dirs D debian/osmocom-nitb.examples D debian/osmocom-nitb.init D debian/osmocom-nitb.install D debian/osmocom-sgsn.default D debian/osmocom-sgsn.examples D debian/osmocom-sgsn.init D debian/osmocom-sgsn.install M debian/rules 31 files changed, 131 insertions(+), 1,175 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-mgw refs/changes/45/3745/1 diff --git a/debian/autoreconf b/debian/autoreconf deleted file mode 100644 index 9a3a67f..0000000 --- a/debian/autoreconf +++ /dev/null @@ -1 +0,0 @@ -openbsc diff --git a/debian/changelog b/debian/changelog index e9a4212..21e4bbd 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,75 +1,5 @@ -openbsc (0.15.1) UNRELEASED; urgency=medium +osmo-mgw (0.1.0) unstable; urgency=low - * Move forward toward a new release. - * Prevent SGSN starting with 'auth-policy remote' when no 'gsup remote-*' are configured. - Note: such configs are broken without extra workarounds anyway. + * Initial release. - -- Holger Hans Peter Freyther Tue, 24 May 2016 23:14:31 +0200 - -openbsc (0.14.0) unstable; urgency=low - - * New upstream tag and additional patches. - - -- Holger Hans Peter Freyther Sat, 14 Mar 2015 20:33:25 +0100 - -openbsc (0.12.0+git26-7) unstable; urgency=low - - * 64bit fix for the MGCP rewriting - - -- Holger Hans Peter Freyther Wed, 07 Nov 2012 11:39:34 +0100 - -openbsc (0.12.0+git26-6) precise; urgency=low - - * Added init script for osmocom-sgsn. - - -- Eric Butler Fri, 24 Aug 2012 21:04:32 -0700 - -openbsc (0.12.0+git26-5) precise; urgency=low - - * Don't enable MNCC sock by default. - * Automatically create important directories. - * Fix init script 'stop' command. - - -- Eric Butler Fri, 24 Aug 2012 20:56:33 -0700 - -openbsc (0.12.0+git26-4) precise; urgency=low - - * Specify HLR path and enable RTP proxy. - - -- Eric Butler Mon, 20 Aug 2012 00:21:07 -0700 - -openbsc (0.12.0+git26-3) precise; urgency=low - - * Fix init script. - - -- Eric Butler Sun, 19 Aug 2012 16:05:44 -0700 - -openbsc (0.12.0+git26-2) precise; urgency=low - - * Fix libdbi package dependency. - - -- Eric Butler Wed, 15 Aug 2012 00:35:37 -0700 - -openbsc (0.12.0+git26-1) precise; urgency=low - - * Fix version issue. - - -- Eric Butler Tue, 14 Aug 2012 21:00:51 -0700 - -openbsc (0.12.0+git26) precise; urgency=low - - * Updated ubuntu package. - - -- Eric Butler Tue, 14 Aug 2012 17:36:51 -0700 - -openbsc (0.9.13.115.eb113-1) natty; urgency=low - - * New upstream release - - -- Harald Welte Wed, 11 May 2011 18:41:24 +0000 - -openbsc (0.9.4-1) unstable; urgency=low - - * Initial release - - -- Harald Welte Tue, 24 Aug 2010 13:34:24 +0200 + -- Alexander Couzens Tue, 08 Aug 2017 01:12:53 +0000 diff --git a/debian/control b/debian/control index 87b6f07..a1e4704 100644 --- a/debian/control +++ b/debian/control @@ -1,181 +1,49 @@ -Source: openbsc -Maintainer: Harald Welte +Source: osmo-mgw Section: net -Priority: optional -Build-Depends: debhelper (>= 9), - autotools-dev, - autoconf-archive, - pkg-config, - libgtp-dev, - libosmocore-dev, - libosmo-sccp-dev, - libdbi0-dev, +Priority: extra +Maintainer: Alexander Couzens +Build-Depends: debhelper (>=9), dh-autoreconf, - libosmo-abis-dev, - libosmo-netif-dev, - libdbd-sqlite3, - libpcap-dev, - libssl-dev, - libc-ares-dev, - libsmpp34-dev + pkg-config, + autotools-dev, + libosmocore-dev, + libosmo-netif-dev Standards-Version: 3.9.8 -Vcs-Git: git://bs11-abis.gnumonks.org/openbsc.git -Vcs-Browser: http://openbsc.osmocom.org/trac/browser -Homepage: https://projects.osmocom.org/projects/openbsc +Vcs-Git: git://git.osmocom.org/osmo-iuh.git +Vcs-Browser: https://git.osmocom.org/osmo-iuh/ +Homepage: https://projects.osmocom.org/projects/osmohnbgw -Package: osmocom-bsc +Package: osmo-mgw Architecture: any -Depends: ${shlibs:Depends}, - ${misc:Depends} -Description: GSM Base Station Controller - This is the BSC-only version of OpenBSC. It requires a Mobile Switching Center - (MSC) to operate. - . - You might rather prefer to use osmocom-nitb which is considered a - "GSM Network-in-a-Box" and does not depend on a MSC. +Multi-Arch: foreign +Depends: libosmo-legacy-mgcp0, ${misc:Depends}, ${shlibs:Depends} +Description: OsmoMGW: Osmocom's Media Gateway for 2G and 3G circuit-switched mobile networks -Package: osmocom-nitb -Architecture: any -Depends: ${shlibs:Depends}, - ${misc:Depends}, - libdbd-sqlite3 -Description: GSM Network-in-a-Box, implements BSC, MSC, SMSC, HLR, VLR - This is the Network-in-a-Box version of OpenBSC. It has all the GSM network - components bundled together. When using osmocom-nitb, there is no need for a - Mobile Switching Center (MSC) which is needed when using osmocom-bsc. - -Package: osmocom-ipaccess-utils -Architecture: any -Depends: ${shlibs:Depends}, - ${misc:Depends} -Description: Command line utilities for ip.access nanoBTS - This package contains utilities that are specific for nanoBTS when being used - together with OpenBSC. It contains mainly three tools: ipaccess-find, - ipaccess-config and ipaccess-proxy. - -Package: osmocom-bs11-utils -Architecture: any -Depends: ${shlibs:Depends}, - ${misc:Depends} -Description: Command line utilities for Siemens BS-11 BTS - There is a tool in this package for configuring the Siemens BS-11 BTS. - Additionally, it contains one tool for making use of an ISDN-card and the - public telephone network as frequency standard for the E1 line. - -Package: osmocom-sgsn -Architecture: any -Depends: ${shlibs:Depends}, - ${misc:Depends} -Suggests: osmocom-bsc -Description: Osmocom Serving GPRS Support Node - This is an implementation of the GPRS Serving GPRS Support Node (SGSN). As - such it implements the GPRS Mobility Management (GMM) and SM (Session - Management). - . - The SGSN connects via the Gb-interface to the BSS (like the osmo-pcu or an - ip.access nanoBTS), and it connects via the GTP protocol to a Gateway GPRS - Support Node (GGSN) like openggsn. - -Package: osmocom-gbproxy -Architecture: any -Depends: ${shlibs:Depends}, - ${misc:Depends} -Recommends: osmocom-sgsn -Description: Osmocom GPRS Gb Interface Proxy - The purpose of the Gb proxy is to aggregate the Gb links of multiple - BSS's and present them in one Gb link to the SGSN. - . - This package is part of OpenBSC and closely related to osmocom-sgsn. - -Package: osmocom-bsc-nat -Architecture: any -Depends: ${shlibs:Depends}, - ${misc:Depends} -Recommends: osmocom-bsc -Description: Osmocom Base Station Controller Network Address Translation - This NAT is useful for masquerading multiple BSCs behind one. It listens - for incoming BSCs on port 5000 and connects to a specified Mobile Switching - Center (MSC). - . - This package is part of OpenBSC and closely related to osmocom-bsc. - -Package: openbsc-dev -Architecture: all -Depends: ${misc:Depends} -Description: Header file needed by tools tightly integrated - Some other programs depend on gsm_data_shared.h and gsm_data_shared.c - from OpenBSC. This package installs these files to your file system so - that the other packages can build-depend on this package. - . - The directory structure is copied after the structure in the repository - and the header and .c file are installed into /usr/src/osmocom/openbsc/. - -Package: osmo-gtphub -Architecture: any -Depends: ${shlibs:Depends}, ${misc:Depends} -Description: Osmocom GTP Hub - Proxy for comms between multiple SGSNs and GGSNs. - -Package: osmocom-bsc-dbg -Architecture: any +Package: osmo-mgw-dbg Section: debug -Priority: extra -Depends: osmocom-bsc (= ${binary:Version}), ${misc:Depends} -Description: Debug symbols for the OpenBSC BSC - Make debugging possible - -Package: osmocom-nitb-dbg Architecture: any -Section: debug -Priority: extra -Depends: osmocom-nitb (= ${binary:Version}), ${misc:Depends} -Description: Debug symbols for the OpenBSC NITB - Make debugging possible +Multi-Arch: same +Depends: osmo-mgw (= ${binary:Version}), ${misc:Depends} +Description: OsmoMGW: Osmocom's Media Gateway for 2G and 3G circuit-switched mobile networks -Package: osmocom-ipaccess-utils-dbg +Package: libosmo-legacy-mgcp0 +Section: libs Architecture: any -Section: debug -Priority: extra -Depends: osmocom-ipaccess-utils (= ${binary:Version}), ${misc:Depends} -Description: Debug symbols for the OpenBSC ip.access utils - Make debugging possible +Multi-Arch: same +Pre-Depends: ${misc:Pre-Depends} +Depends: ${misc:Depends}, ${shlibs:Depends} +Description: OsmoMGW: Osmocom's Media Gateway for 2G and 3G circuit-switched mobile networks -Package: osmocom-bs11-utils-dbg -Architecture: any +Package: libosmo-legacy-mgcp-dbg Section: debug -Priority: extra -Depends: osmocom-bs11-utils (= ${binary:Version}), ${misc:Depends} -Description: Debug symbols for the OpenBSC BS11 utils - Make debugging possible +Architecture: any +Multi-Arch: same +Depends: libosmo-legacy-mgcp0 (= ${binary:Version}), ${misc:Depends} +Description: OsmoMGW: Osmocom's Media Gateway for 2G and 3G circuit-switched mobile networks -Package: osmocom-sgsn-dbg +Package: libosmo-legacy-mgcp-dev +Section: libdevel Architecture: any -Section: debug -Priority: extra -Depends: osmocom-sgsn (= ${binary:Version}), ${misc:Depends} -Description: Debug symbols for the OpenBSC Serving GPRS Support Node - Make debugging possible - -Package: osmocom-gbproxy-dbg -Architecture: any -Section: debug -Priority: extra -Depends: osmocom-gbproxy (= ${binary:Version}), ${misc:Depends} -Description: Debug symbols for the OpenBSC GPRS GBProxy - Make debugging possible - -Package: osmocom-bsc-nat-dbg -Architecture: any -Section: debug -Priority: extra -Depends: osmocom-bsc-nat (= ${binary:Version}), ${misc:Depends} -Description: Debug symbols for the OpenBSC Network Address Translation - Make debugging possible - -Package: osmo-gtphub-dbg -Architecture: any -Section: debug -Priority: extra -Depends: osmo-gtphub (= ${binary:Version}), ${misc:Depends} -Description: Debug symbols for Osmocom GTP Hub - Make debugging possible +Multi-Arch: same +Depends: libosmo-legacy-mgcp0 (= ${binary:Version}), ${misc:Depends} +Description: OsmoMGW: Osmocom's Media Gateway for 2G and 3G circuit-switched mobile networks diff --git a/debian/copyright b/debian/copyright index 1e4dee1..f1dada2 100644 --- a/debian/copyright +++ b/debian/copyright @@ -1,74 +1,14 @@ Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ -Upstream-Name: OpenBSC -Source: http://openbsc.osmocom.org/ +Upstream-Name: osmo-mgw +Source: git://git.osmocom.org/osmo-mgw -Files: * -Copyright: 2008-2015 Harald Welte - 2008-2015 Holger Hans Peter Freyther - 2009-2015 On-Waves - 2008 Jan Luebbe - 2008,2010-2011 Daniel Willmann - 2009,2011,2013 Andreas Eversberg - 2009,2011 Dieter Spaar - 2009 Mike Haben - 2010 Sylvain Munaut <246tnt at gmail.com> - 2012-2013 Pablo Neira Ayuso - 2013-2015 Sysmocom s.f.m.c. GmbH (Jacob Erlbeck) - 2014 Alexander Chemeris -License: AGPL-3+ -Comment: Contributions by Stefan Schmidt as well - -Files: wireshark/0001-abis_oml.patch - wireshark/0002-ericsson_rbs2409.patch - wireshark/0003-lucent-hnb.patch - wireshark/0005-rsl-hsl.patch -Copyright: 1998 Gerald Combs - 2007,2011 Anders Broman - 2009 Holger Hans Peter Freyther - 2009-2011 Harald Welte -License: GPL-2+ - -Files: openbsc/include/mISDNif.h -Copyright: 2008 Karsten Keil -License: LGPL-2.1 - -Files: openbsc/src/libmgcp/g711common.h -Copyright: 2009 Abramo Bagnara -License: GPL-2+ - -Files: openbsc/git-version-gen -Copyright: 2007-2010 Free Software Foundation -License: GPL-3+ - -Files: openbsc/osmoappdesc.py - openbsc/tests/smpp_test_runner.py - openbsc/tests/ctrl_test_runner.py - openbsc/tests/vty_test_runner.py -Copyright: 2013 Katerina Barone-Adesi - 2013 Jacob Erlbeck - 2013-2014 Holger Hans Peter Freyther -License: GPL-3+ - -Files: openbsc/src/libbsc/bsc_ctrl_lookup.c -Copyright: 2010-2011 Daniel Willmann - 2010-2011 On-Waves -License: GPL-2+ - -Files: openbsc/src/libmsc/mncc_sock.c - openbsc/src/libmsc/mncc_builtin.c -Copyright: 2008-2010 Harald Welte - 2009 Andreas Eversberg - 2012 Holger Hans Peter Freyther -License: GPL-2+ - -Files: debian/* -Copyright: 2012-2015 Holger Hans Peter Freyther - 2016 Ruben Undheim -License: GPL-2+ - - -License: AGPL-3+ - This package is free software; you can redistribute it and/or modify +Files: * +Copyright: 2009-2014 On-Waves + 2009-2015 Holger Hans Peter Freyther + 2013 Jacob Erlbeck + 2016 sysmocom s.m.f.c. GmbH +License: AGPL-3.0+ + This program is free software; you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. @@ -76,62 +16,67 @@ This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. + GNU Affero General Public License for more details. . You should have received a copy of the GNU Affero General Public License along with this program. If not, see . - -License: GPL-2+ - This package is free software: you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 2 of the License, or (at - your option) any later version. +Files: src/libosmo-legacy-mgcp/g711common.h +Copyright: 2000 Abramo Bagnara +License: GPL-2.0+ + Wrapper for linphone Codec class by Simon Morlat . - This program is distributed in the hope that it will be useful, but - WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - for more details. + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. . - You should have received a copy of the GNU General Public License - along with this program. If not, see . - . - On Debian systems, the complete text of the GNU General Public - License version 2 can be found in "/usr/share/common-licenses/GPL-2". - - -License: GPL-3+ - This package is free software: you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or (at - your option) any later version. - . - This program is distributed in the hope that it will be useful, but - WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - for more details. - . - You should have received a copy of the GNU General Public License - along with this program. If not, see . - . - On Debian systems, the complete text of the GNU General Public - License version 3 can be found in "/usr/share/common-licenses/GPL-3". - - -License: LGPL-2.1 - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; version - 2.1 of the License. - . - This library is distributed in the hope that it will be useful, + This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. . - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, see . + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA . - On Debian systems, the complete text of the GNU Lesser General - Public License version 2.1 can be found in - "/usr/share/common-licenses/LGPL-2.1". + The FSF address in the above text is the old one. + . + On Debian systems, the complete text of the GNU General Public License + Version 2 can be found in `/usr/share/common-licenses/GPL-2'. + +Files: tests/vty_test_runner.py +Copyright: 2013 Holger Hans Peter Freyther + 2013 Katerina Barone-Adesi +License: GPL-3.0+ + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + . + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + . + You should have received a copy of the GNU General Public License + along with this program. If not, see . + . + On Debian systems, the complete text of the GNU General Public License + Version 3 can be found in `/usr/share/common-licenses/GPL-3'. + +Files: osmoappdesc.py +Copyright: 2013 Katerina Barone-Adesi +License: GPL-3.0+ + +Files: src/libosmo-legacy-mgcp/mgcp_osmux.c +Copyright: 2012-2013 On Waves ehf + 2012-2013 Pablo Neira Ayuso +License: AGPL-3.0+ + All rights not specifically granted under this license are reserved. + . + This program is free software; you can redistribute it and/or modify it + under the terms of the GNU Affero General Public License as published by the + Free Software Foundation; either version 3 of the License, or (at your + option) any later version. + diff --git a/debian/docs b/debian/docs deleted file mode 100644 index cd545c2..0000000 --- a/debian/docs +++ /dev/null @@ -1 +0,0 @@ -openbsc/README diff --git a/debian/libosmo-legacy-mgcp-dev.install b/debian/libosmo-legacy-mgcp-dev.install new file mode 100644 index 0000000..5bd9dd0 --- /dev/null +++ b/debian/libosmo-legacy-mgcp-dev.install @@ -0,0 +1,3 @@ +usr/include +usr/lib/*/*.so +usr/lib/*/pkgconfig/*.pc diff --git a/debian/libosmo-legacy-mgcp0.install b/debian/libosmo-legacy-mgcp0.install new file mode 100644 index 0000000..3de3b10 --- /dev/null +++ b/debian/libosmo-legacy-mgcp0.install @@ -0,0 +1 @@ +usr/lib/*/*.so.* diff --git a/debian/openbsc-dev.install b/debian/openbsc-dev.install deleted file mode 100644 index 0c05545..0000000 --- a/debian/openbsc-dev.install +++ /dev/null @@ -1,4 +0,0 @@ -openbsc/include/openbsc/gsm_data_shared.h usr/src/osmocom/openbsc/openbsc/include/openbsc/ -openbsc/include/openbsc/common_cs.h usr/src/osmocom/openbsc/openbsc/include/openbsc/ -openbsc/src/libcommon/gsm_data_shared.c usr/src/osmocom/openbsc/openbsc/src/libcommon/ -usr/lib/*/pkgconfig/openbsc.pc diff --git a/debian/osmo-gtphub.default b/debian/osmo-gtphub.default deleted file mode 100644 index 6af82da..0000000 --- a/debian/osmo-gtphub.default +++ /dev/null @@ -1,2 +0,0 @@ -CONFIG_FILE="/etc/osmocom/osmo-gtphub.cfg" - diff --git a/debian/osmo-gtphub.examples b/debian/osmo-gtphub.examples deleted file mode 100644 index 48c2dc0..0000000 --- a/debian/osmo-gtphub.examples +++ /dev/null @@ -1 +0,0 @@ -openbsc/doc/examples/osmo-gtphub diff --git a/debian/osmo-gtphub.init b/debian/osmo-gtphub.init deleted file mode 100755 index 160d55b..0000000 --- a/debian/osmo-gtphub.init +++ /dev/null @@ -1,150 +0,0 @@ -#!/bin/sh -### BEGIN INIT INFO -# Provides: osmo-gtphub -# Required-Start: $network $local_fs -# Required-Stop: -# Default-Start: 2 3 4 5 -# Default-Stop: 0 1 6 -# Short-Description: Osmocom GTP hub -# Description: Osmocom GTP hub -### END INIT INFO - -# Author: Neels Hofmeyr - -# PATH should only include /usr/* if it runs after the mountnfs.sh script -PATH=/sbin:/usr/sbin:/bin:/usr/bin -NAME=osmo-gtphub # Introduce the short server's name here -DESC="Osmocom GTP hub" # Introduce a short description here -DAEMON=/usr/bin/osmo-gtphub # Introduce the server's location here -SCRIPTNAME=/etc/init.d/osmo-gtphub - -# Exit if the package is not installed -[ -x $DAEMON ] || exit 0 - -# Read configuration variable file if it is present -[ -r /etc/default/osmo-gtphub ] && . /etc/default/osmo-gtphub - -# Load the VERBOSE setting and other rcS variables -. /lib/init/vars.sh - -# Define LSB log_* functions. -# Depend on lsb-base (>= 3.0-6) to ensure that this file is present. -. /lib/lsb/init-functions - -DAEMON_ARGS="$DAEMON_ARGS -D -c $CONFIG_FILE" - -# -# Function that starts the daemon/service -# -do_start() -{ - # Return - # 0 if daemon has been started - # 1 if daemon was already running - # 2 if daemon could not be started - start-stop-daemon --start --quiet --exec $DAEMON --test > /dev/null \ - || return 1 - start-stop-daemon --start --quiet --exec $DAEMON -- \ - $DAEMON_ARGS \ - || return 2 - # Add code here, if necessary, that waits for the process to be ready - # to handle requests from services started subsequently which depend - # on this one. As a last resort, sleep for some time. -} - -# -# Function that stops the daemon/service -# -do_stop() -{ - # Return - # 0 if daemon has been stopped - # 1 if daemon was already stopped - # 2 if daemon could not be stopped - # other if a failure occurred - start-stop-daemon --stop --quiet --retry=TERM/30/KILL/5 --name $NAME - RETVAL="$?" - [ "$RETVAL" = 2 ] && return 2 - # Wait for children to finish too if this is a daemon that forks - # and if the daemon is only ever run from this initscript. - # If the above conditions are not satisfied then add some other code - # that waits for the process to drop all resources that could be - # needed by services started subsequently. A last resort is to - # sleep for some time. - start-stop-daemon --stop --quiet --oknodo --retry=0/30/KILL/5 --exec $DAEMON - [ "$?" = 2 ] && return 2 - return "$RETVAL" -} - -# -# Function that sends a SIGHUP to the daemon/service -# -do_reload() { - # - # If the daemon can reload its configuration without - # restarting (for example, when it is sent a SIGHUP), - # then implement that here. - # - start-stop-daemon --stop --signal 1 --quiet $PIDFILE --name $NAME - return 0 -} - -case "$1" in - start) - [ "$VERBOSE" != no ] && log_daemon_msg "Starting $DESC " "$NAME" - do_start - case "$?" in - 0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;; - 2) [ "$VERBOSE" != no ] && log_end_msg 1 ;; - esac - ;; - stop) - [ "$VERBOSE" != no ] && log_daemon_msg "Stopping $DESC" "$NAME" - do_stop - case "$?" in - 0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;; - 2) [ "$VERBOSE" != no ] && log_end_msg 1 ;; - esac - ;; - status) - status_of_proc "$DAEMON" "$NAME" && exit 0 || exit $? - ;; - #reload|force-reload) - # - # If do_reload() is not implemented then leave this commented out - # and leave 'force-reload' as an alias for 'restart'. - # - #log_daemon_msg "Reloading $DESC" "$NAME" - #do_reload - #log_end_msg $? - #;; - restart|force-reload) - # - # If the "reload" option is implemented then remove the - # 'force-reload' alias - # - log_daemon_msg "Restarting $DESC" "$NAME" - do_stop - case "$?" in - 0|1) - do_start - case "$?" in - 0) log_end_msg 0 ;; - 1) log_end_msg 1 ;; # Old process is still running - *) log_end_msg 1 ;; # Failed to start - esac - ;; - *) - # Failed to stop - log_end_msg 1 - ;; - esac - ;; - *) - #echo "Usage: $SCRIPTNAME {start|stop|restart|reload|force-reload}" >&2 - echo "Usage: $SCRIPTNAME {start|stop|status|restart|force-reload}" >&2 - exit 3 - ;; -esac - -: diff --git a/debian/osmo-gtphub.install b/debian/osmo-gtphub.install deleted file mode 100644 index 908c1a5..0000000 --- a/debian/osmo-gtphub.install +++ /dev/null @@ -1 +0,0 @@ -/usr/bin/osmo-gtphub diff --git a/debian/osmo-mgw.install b/debian/osmo-mgw.install new file mode 100644 index 0000000..e772481 --- /dev/null +++ b/debian/osmo-mgw.install @@ -0,0 +1 @@ +usr/bin diff --git a/debian/osmocom-bs11-utils.install b/debian/osmocom-bs11-utils.install deleted file mode 100644 index 757a854..0000000 --- a/debian/osmocom-bs11-utils.install +++ /dev/null @@ -1,2 +0,0 @@ -/usr/bin/bs11_config -/usr/bin/isdnsync diff --git a/debian/osmocom-bsc-nat.init b/debian/osmocom-bsc-nat.init deleted file mode 100755 index 984a7ce..0000000 --- a/debian/osmocom-bsc-nat.init +++ /dev/null @@ -1,153 +0,0 @@ -#!/bin/sh -### BEGIN INIT INFO -# Provides: osmocom-bsc-nat -# Required-Start: $network $local_fs -# Required-Stop: -# Default-Start: 2 3 4 5 -# Default-Stop: 0 1 6 -# Short-Description: Osmocom GSM network-in-a-box -# Description: A minimal implementation of the GSM Base Station Controller, -# Mobile Switching Center, Home Location regster and all other -# components to run a self-contained GSM network. -### END INIT INFO - -# Author: Harald Welte - -# PATH should only include /usr/* if it runs after the mountnfs.sh script -PATH=/sbin:/usr/sbin:/bin:/usr/bin -NAME=osmo-bsc_nat # Introduce the short server's name here -DESC="Osmocom GSM BSC Multiplexer (NAT)" # Introduce a short description here -DAEMON=/usr/bin/osmo-bsc_nat # Introduce the server's location here -SCRIPTNAME=/etc/init.d/osmocom-bsc-nat -CONFIG_FILE=/etc/osmocom/osmocom-bsc-nat.cfg - -# Exit if the package is not installed -[ -x $DAEMON ] || exit 0 - -# Read configuration variable file if it is present -[ -r /etc/default/osmocom-bsc-nat ] && . /etc/default/osmocom-bsc-nat - -# Load the VERBOSE setting and other rcS variables -. /lib/init/vars.sh - -# Define LSB log_* functions. -# Depend on lsb-base (>= 3.0-6) to ensure that this file is present. -. /lib/lsb/init-functions - -DAEMON_ARGS="-D -c $CONFIG_FILE" - -# -# Function that starts the daemon/service -# -do_start() -{ - # Return - # 0 if daemon has been started - # 1 if daemon was already running - # 2 if daemon could not be started - start-stop-daemon --start --quiet --exec $DAEMON --test > /dev/null \ - || return 1 - start-stop-daemon --start --quiet --exec $DAEMON -- \ - $DAEMON_ARGS \ - || return 2 - # Add code here, if necessary, that waits for the process to be ready - # to handle requests from services started subsequently which depend - # on this one. As a last resort, sleep for some time. -} - -# -# Function that stops the daemon/service -# -do_stop() -{ - # Return - # 0 if daemon has been stopped - # 1 if daemon was already stopped - # 2 if daemon could not be stopped - # other if a failure occurred - start-stop-daemon --stop --quiet --retry=TERM/30/KILL/5 --name $NAME - RETVAL="$?" - [ "$RETVAL" = 2 ] && return 2 - # Wait for children to finish too if this is a daemon that forks - # and if the daemon is only ever run from this initscript. - # If the above conditions are not satisfied then add some other code - # that waits for the process to drop all resources that could be - # needed by services started subsequently. A last resort is to - # sleep for some time. - start-stop-daemon --stop --quiet --oknodo --retry=0/30/KILL/5 --exec $DAEMON - [ "$?" = 2 ] && return 2 - return "$RETVAL" -} - -# -# Function that sends a SIGHUP to the daemon/service -# -do_reload() { - # - # If the daemon can reload its configuration without - # restarting (for example, when it is sent a SIGHUP), - # then implement that here. - # - start-stop-daemon --stop --signal 1 --quiet $PIDFILE --name $NAME - return 0 -} - -case "$1" in - start) - [ "$VERBOSE" != no ] && log_daemon_msg "Starting $DESC " "$NAME" - do_start - case "$?" in - 0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;; - 2) [ "$VERBOSE" != no ] && log_end_msg 1 ;; - esac - ;; - stop) - [ "$VERBOSE" != no ] && log_daemon_msg "Stopping $DESC" "$NAME" - do_stop - case "$?" in - 0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;; - 2) [ "$VERBOSE" != no ] && log_end_msg 1 ;; - esac - ;; - status) - status_of_proc "$DAEMON" "$NAME" && exit 0 || exit $? - ;; - #reload|force-reload) - # - # If do_reload() is not implemented then leave this commented out - # and leave 'force-reload' as an alias for 'restart'. - # - #log_daemon_msg "Reloading $DESC" "$NAME" - #do_reload - #log_end_msg $? - #;; - restart|force-reload) - # - # If the "reload" option is implemented then remove the - # 'force-reload' alias - # - log_daemon_msg "Restarting $DESC" "$NAME" - do_stop - case "$?" in - 0|1) - do_start - case "$?" in - 0) log_end_msg 0 ;; - 1) log_end_msg 1 ;; # Old process is still running - *) log_end_msg 1 ;; # Failed to start - esac - ;; - *) - # Failed to stop - log_end_msg 1 - ;; - esac - ;; - *) - #echo "Usage: $SCRIPTNAME {start|stop|restart|reload|force-reload}" >&2 - echo "Usage: $SCRIPTNAME {start|stop|status|restart|force-reload}" >&2 - exit 3 - ;; -esac - -: diff --git a/debian/osmocom-bsc-nat.install b/debian/osmocom-bsc-nat.install deleted file mode 100644 index b561a7e..0000000 --- a/debian/osmocom-bsc-nat.install +++ /dev/null @@ -1 +0,0 @@ -/usr/bin/osmo-bsc_nat diff --git a/debian/osmocom-bsc.examples b/debian/osmocom-bsc.examples deleted file mode 100644 index a95f12b..0000000 --- a/debian/osmocom-bsc.examples +++ /dev/null @@ -1 +0,0 @@ -openbsc/doc/examples/osmo-bsc_mgcp diff --git a/debian/osmocom-bsc.install b/debian/osmocom-bsc.install deleted file mode 100644 index ab9459e..0000000 --- a/debian/osmocom-bsc.install +++ /dev/null @@ -1,2 +0,0 @@ -/usr/bin/osmo-bsc_mgcp -/usr/bin/osmo-bsc diff --git a/debian/osmocom-gbproxy.init b/debian/osmocom-gbproxy.init deleted file mode 100755 index 924f32d..0000000 --- a/debian/osmocom-gbproxy.init +++ /dev/null @@ -1,151 +0,0 @@ -#!/bin/sh -### BEGIN INIT INFO -# Provides: osmo-gbproxy -# Required-Start: $network $local_fs -# Required-Stop: -# Default-Start: 2 3 4 5 -# Default-Stop: 0 1 6 -# Short-Description: Osmocom GBproxy -# Description: A tool to proxy the GPRS Gb interface. -### END INIT INFO - -# Author: Harald Welte - -# PATH should only include /usr/* if it runs after the mountnfs.sh script -PATH=/sbin:/usr/sbin:/bin:/usr/bin -NAME=osmo-gbproxy # Introduce the short server's name here -DESC="Osmocom GBProxy" # Introduce a short description here -DAEMON=/usr/bin/osmo-gbproxy # Introduce the server's location here -SCRIPTNAME=/etc/init.d/osmocom-gbproxy -CONFIG_FILE=/etc/osmocom/osmocom-gbproxy.cfg - -# Exit if the package is not installed -[ -x $DAEMON ] || exit 0 - -# Read configuration variable file if it is present -[ -r /etc/default/osmocom-gbproxy ] && . /etc/default/osmocom-gbproxy - -# Load the VERBOSE setting and other rcS variables -. /lib/init/vars.sh - -# Define LSB log_* functions. -# Depend on lsb-base (>= 3.0-6) to ensure that this file is present. -. /lib/lsb/init-functions - -DAEMON_ARGS="-D -c $CONFIG_FILE" - -# -# Function that starts the daemon/service -# -do_start() -{ - # Return - # 0 if daemon has been started - # 1 if daemon was already running - # 2 if daemon could not be started - start-stop-daemon --start --quiet --exec $DAEMON --test > /dev/null \ - || return 1 - start-stop-daemon --start --quiet --exec $DAEMON -- \ - $DAEMON_ARGS \ - || return 2 - # Add code here, if necessary, that waits for the process to be ready - # to handle requests from services started subsequently which depend - # on this one. As a last resort, sleep for some time. -} - -# -# Function that stops the daemon/service -# -do_stop() -{ - # Return - # 0 if daemon has been stopped - # 1 if daemon was already stopped - # 2 if daemon could not be stopped - # other if a failure occurred - start-stop-daemon --stop --quiet --retry=TERM/30/KILL/5 --name $NAME - RETVAL="$?" - [ "$RETVAL" = 2 ] && return 2 - # Wait for children to finish too if this is a daemon that forks - # and if the daemon is only ever run from this initscript. - # If the above conditions are not satisfied then add some other code - # that waits for the process to drop all resources that could be - # needed by services started subsequently. A last resort is to - # sleep for some time. - start-stop-daemon --stop --quiet --oknodo --retry=0/30/KILL/5 --exec $DAEMON - [ "$?" = 2 ] && return 2 - return "$RETVAL" -} - -# -# Function that sends a SIGHUP to the daemon/service -# -do_reload() { - # - # If the daemon can reload its configuration without - # restarting (for example, when it is sent a SIGHUP), - # then implement that here. - # - start-stop-daemon --stop --signal 1 --quiet $PIDFILE --name $NAME - return 0 -} - -case "$1" in - start) - [ "$VERBOSE" != no ] && log_daemon_msg "Starting $DESC " "$NAME" - do_start - case "$?" in - 0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;; - 2) [ "$VERBOSE" != no ] && log_end_msg 1 ;; - esac - ;; - stop) - [ "$VERBOSE" != no ] && log_daemon_msg "Stopping $DESC" "$NAME" - do_stop - case "$?" in - 0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;; - 2) [ "$VERBOSE" != no ] && log_end_msg 1 ;; - esac - ;; - status) - status_of_proc "$DAEMON" "$NAME" && exit 0 || exit $? - ;; - #reload|force-reload) - # - # If do_reload() is not implemented then leave this commented out - # and leave 'force-reload' as an alias for 'restart'. - # - #log_daemon_msg "Reloading $DESC" "$NAME" - #do_reload - #log_end_msg $? - #;; - restart|force-reload) - # - # If the "reload" option is implemented then remove the - # 'force-reload' alias - # - log_daemon_msg "Restarting $DESC" "$NAME" - do_stop - case "$?" in - 0|1) - do_start - case "$?" in - 0) log_end_msg 0 ;; - 1) log_end_msg 1 ;; # Old process is still running - *) log_end_msg 1 ;; # Failed to start - esac - ;; - *) - # Failed to stop - log_end_msg 1 - ;; - esac - ;; - *) - #echo "Usage: $SCRIPTNAME {start|stop|restart|reload|force-reload}" >&2 - echo "Usage: $SCRIPTNAME {start|stop|status|restart|force-reload}" >&2 - exit 3 - ;; -esac - -: diff --git a/debian/osmocom-gbproxy.install b/debian/osmocom-gbproxy.install deleted file mode 100644 index ba3f6ee..0000000 --- a/debian/osmocom-gbproxy.install +++ /dev/null @@ -1 +0,0 @@ -/usr/bin/osmo-gbproxy diff --git a/debian/osmocom-ipaccess-utils.install b/debian/osmocom-ipaccess-utils.install deleted file mode 100644 index de13c18..0000000 --- a/debian/osmocom-ipaccess-utils.install +++ /dev/null @@ -1,3 +0,0 @@ -/usr/bin/ipaccess-config -/usr/bin/abisip-find -/usr/bin/ipaccess-proxy diff --git a/debian/osmocom-nitb.default b/debian/osmocom-nitb.default deleted file mode 100644 index ef76a5f..0000000 --- a/debian/osmocom-nitb.default +++ /dev/null @@ -1,8 +0,0 @@ -CONFIG_FILE="/etc/osmocom/osmo-nitb.cfg" -HLR_FILE="/var/lib/osmocom/hlr.sqlite3" - -DAEMON_ARGS="-P" - -# Uncomment if using LCR+Asterisk -# DAEMON_ARGS="-m -P" - diff --git a/debian/osmocom-nitb.dirs b/debian/osmocom-nitb.dirs deleted file mode 100644 index efbca2b..0000000 --- a/debian/osmocom-nitb.dirs +++ /dev/null @@ -1,3 +0,0 @@ -/etc/osmocom -/var/log/osmocom -/var/lib/osmocom diff --git a/debian/osmocom-nitb.examples b/debian/osmocom-nitb.examples deleted file mode 100644 index c098d5c..0000000 --- a/debian/osmocom-nitb.examples +++ /dev/null @@ -1 +0,0 @@ -openbsc/doc/examples/osmo-nitb diff --git a/debian/osmocom-nitb.init b/debian/osmocom-nitb.init deleted file mode 100755 index 0747446..0000000 --- a/debian/osmocom-nitb.init +++ /dev/null @@ -1,152 +0,0 @@ -#!/bin/sh -### BEGIN INIT INFO -# Provides: osmo-nitb -# Required-Start: $network $local_fs -# Required-Stop: -# Default-Start: 2 3 4 5 -# Default-Stop: 0 1 6 -# Short-Description: Osmocom GSM network-in-a-box -# Description: A minimal implementation of the GSM Base Station Controller, -# Mobile Switching Center, Home Location regster and all other -# components to run a self-contained GSM network. -### END INIT INFO - -# Author: Harald Welte - -# PATH should only include /usr/* if it runs after the mountnfs.sh script -PATH=/sbin:/usr/sbin:/bin:/usr/bin -NAME=osmo-nitb # Introduce the short server's name here -DESC="Osmocom GSM Network-in-a-Box" # Introduce a short description here -DAEMON=/usr/bin/osmo-nitb # Introduce the server's location here -SCRIPTNAME=/etc/init.d/osmocom-nitb - -# Exit if the package is not installed -[ -x $DAEMON ] || exit 0 - -# Read configuration variable file if it is present -[ -r /etc/default/osmocom-nitb ] && . /etc/default/osmocom-nitb - -# Load the VERBOSE setting and other rcS variables -. /lib/init/vars.sh - -# Define LSB log_* functions. -# Depend on lsb-base (>= 3.0-6) to ensure that this file is present. -. /lib/lsb/init-functions - -DAEMON_ARGS="$DAEMON_ARGS -D -c $CONFIG_FILE -l $HLR_FILE" - -# -# Function that starts the daemon/service -# -do_start() -{ - # Return - # 0 if daemon has been started - # 1 if daemon was already running - # 2 if daemon could not be started - start-stop-daemon --start --quiet --exec $DAEMON --test > /dev/null \ - || return 1 - start-stop-daemon --start --quiet --exec $DAEMON -- \ - $DAEMON_ARGS \ - || return 2 - # Add code here, if necessary, that waits for the process to be ready - # to handle requests from services started subsequently which depend - # on this one. As a last resort, sleep for some time. -} - -# -# Function that stops the daemon/service -# -do_stop() -{ - # Return - # 0 if daemon has been stopped - # 1 if daemon was already stopped - # 2 if daemon could not be stopped - # other if a failure occurred - start-stop-daemon --stop --quiet --retry=TERM/30/KILL/5 --name $NAME - RETVAL="$?" - [ "$RETVAL" = 2 ] && return 2 - # Wait for children to finish too if this is a daemon that forks - # and if the daemon is only ever run from this initscript. - # If the above conditions are not satisfied then add some other code - # that waits for the process to drop all resources that could be - # needed by services started subsequently. A last resort is to - # sleep for some time. - start-stop-daemon --stop --quiet --oknodo --retry=0/30/KILL/5 --exec $DAEMON - [ "$?" = 2 ] && return 2 - return "$RETVAL" -} - -# -# Function that sends a SIGHUP to the daemon/service -# -do_reload() { - # - # If the daemon can reload its configuration without - # restarting (for example, when it is sent a SIGHUP), - # then implement that here. - # - start-stop-daemon --stop --signal 1 --quiet $PIDFILE --name $NAME - return 0 -} - -case "$1" in - start) - [ "$VERBOSE" != no ] && log_daemon_msg "Starting $DESC " "$NAME" - do_start - case "$?" in - 0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;; - 2) [ "$VERBOSE" != no ] && log_end_msg 1 ;; - esac - ;; - stop) - [ "$VERBOSE" != no ] && log_daemon_msg "Stopping $DESC" "$NAME" - do_stop - case "$?" in - 0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;; - 2) [ "$VERBOSE" != no ] && log_end_msg 1 ;; - esac - ;; - status) - status_of_proc "$DAEMON" "$NAME" && exit 0 || exit $? - ;; - #reload|force-reload) - # - # If do_reload() is not implemented then leave this commented out - # and leave 'force-reload' as an alias for 'restart'. - # - #log_daemon_msg "Reloading $DESC" "$NAME" - #do_reload - #log_end_msg $? - #;; - restart|force-reload) - # - # If the "reload" option is implemented then remove the - # 'force-reload' alias - # - log_daemon_msg "Restarting $DESC" "$NAME" - do_stop - case "$?" in - 0|1) - do_start - case "$?" in - 0) log_end_msg 0 ;; - 1) log_end_msg 1 ;; # Old process is still running - *) log_end_msg 1 ;; # Failed to start - esac - ;; - *) - # Failed to stop - log_end_msg 1 - ;; - esac - ;; - *) - #echo "Usage: $SCRIPTNAME {start|stop|restart|reload|force-reload}" >&2 - echo "Usage: $SCRIPTNAME {start|stop|status|restart|force-reload}" >&2 - exit 3 - ;; -esac - -: diff --git a/debian/osmocom-nitb.install b/debian/osmocom-nitb.install deleted file mode 100644 index 26caf71..0000000 --- a/debian/osmocom-nitb.install +++ /dev/null @@ -1,2 +0,0 @@ -/usr/bin/osmo-nitb -openbsc/contrib/*.py usr/bin/ \ No newline at end of file diff --git a/debian/osmocom-sgsn.default b/debian/osmocom-sgsn.default deleted file mode 100644 index 77c9679..0000000 --- a/debian/osmocom-sgsn.default +++ /dev/null @@ -1,2 +0,0 @@ -CONFIG_FILE="/etc/osmocom/osmo-sgsn.cfg" - diff --git a/debian/osmocom-sgsn.examples b/debian/osmocom-sgsn.examples deleted file mode 100644 index 15de78d..0000000 --- a/debian/osmocom-sgsn.examples +++ /dev/null @@ -1 +0,0 @@ -openbsc/doc/examples/osmo-sgsn diff --git a/debian/osmocom-sgsn.init b/debian/osmocom-sgsn.init deleted file mode 100755 index 0794dc1..0000000 --- a/debian/osmocom-sgsn.init +++ /dev/null @@ -1,150 +0,0 @@ -#!/bin/sh -### BEGIN INIT INFO -# Provides: osmo-sgsn -# Required-Start: $network $local_fs -# Required-Stop: -# Default-Start: 2 3 4 5 -# Default-Stop: 0 1 6 -# Short-Description: Osmocom Serving GPRS Support Node -# Description: Osmocom Serving GPRS Support Node -### END INIT INFO - -# Author: Harald Welte - -# PATH should only include /usr/* if it runs after the mountnfs.sh script -PATH=/sbin:/usr/sbin:/bin:/usr/bin -NAME=osmo-sgsn # Introduce the short server's name here -DESC="Osmocom Serving GPRS Support Node" # Introduce a short description here -DAEMON=/usr/bin/osmo-sgsn # Introduce the server's location here -SCRIPTNAME=/etc/init.d/osmocom-sgsn - -# Exit if the package is not installed -[ -x $DAEMON ] || exit 0 - -# Read configuration variable file if it is present -[ -r /etc/default/osmocom-sgsn ] && . /etc/default/osmocom-sgsn - -# Load the VERBOSE setting and other rcS variables -. /lib/init/vars.sh - -# Define LSB log_* functions. -# Depend on lsb-base (>= 3.0-6) to ensure that this file is present. -. /lib/lsb/init-functions - -DAEMON_ARGS="$DAEMON_ARGS -D -c $CONFIG_FILE" - -# -# Function that starts the daemon/service -# -do_start() -{ - # Return - # 0 if daemon has been started - # 1 if daemon was already running - # 2 if daemon could not be started - start-stop-daemon --start --quiet --exec $DAEMON --test > /dev/null \ - || return 1 - start-stop-daemon --start --quiet --exec $DAEMON -- \ - $DAEMON_ARGS \ - || return 2 - # Add code here, if necessary, that waits for the process to be ready - # to handle requests from services started subsequently which depend - # on this one. As a last resort, sleep for some time. -} - -# -# Function that stops the daemon/service -# -do_stop() -{ - # Return - # 0 if daemon has been stopped - # 1 if daemon was already stopped - # 2 if daemon could not be stopped - # other if a failure occurred - start-stop-daemon --stop --quiet --retry=TERM/30/KILL/5 --name $NAME - RETVAL="$?" - [ "$RETVAL" = 2 ] && return 2 - # Wait for children to finish too if this is a daemon that forks - # and if the daemon is only ever run from this initscript. - # If the above conditions are not satisfied then add some other code - # that waits for the process to drop all resources that could be - # needed by services started subsequently. A last resort is to - # sleep for some time. - start-stop-daemon --stop --quiet --oknodo --retry=0/30/KILL/5 --exec $DAEMON - [ "$?" = 2 ] && return 2 - return "$RETVAL" -} - -# -# Function that sends a SIGHUP to the daemon/service -# -do_reload() { - # - # If the daemon can reload its configuration without - # restarting (for example, when it is sent a SIGHUP), - # then implement that here. - # - start-stop-daemon --stop --signal 1 --quiet $PIDFILE --name $NAME - return 0 -} - -case "$1" in - start) - [ "$VERBOSE" != no ] && log_daemon_msg "Starting $DESC " "$NAME" - do_start - case "$?" in - 0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;; - 2) [ "$VERBOSE" != no ] && log_end_msg 1 ;; - esac - ;; - stop) - [ "$VERBOSE" != no ] && log_daemon_msg "Stopping $DESC" "$NAME" - do_stop - case "$?" in - 0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;; - 2) [ "$VERBOSE" != no ] && log_end_msg 1 ;; - esac - ;; - status) - status_of_proc "$DAEMON" "$NAME" && exit 0 || exit $? - ;; - #reload|force-reload) - # - # If do_reload() is not implemented then leave this commented out - # and leave 'force-reload' as an alias for 'restart'. - # - #log_daemon_msg "Reloading $DESC" "$NAME" - #do_reload - #log_end_msg $? - #;; - restart|force-reload) - # - # If the "reload" option is implemented then remove the - # 'force-reload' alias - # - log_daemon_msg "Restarting $DESC" "$NAME" - do_stop - case "$?" in - 0|1) - do_start - case "$?" in - 0) log_end_msg 0 ;; - 1) log_end_msg 1 ;; # Old process is still running - *) log_end_msg 1 ;; # Failed to start - esac - ;; - *) - # Failed to stop - log_end_msg 1 - ;; - esac - ;; - *) - #echo "Usage: $SCRIPTNAME {start|stop|restart|reload|force-reload}" >&2 - echo "Usage: $SCRIPTNAME {start|stop|status|restart|force-reload}" >&2 - exit 3 - ;; -esac - -: diff --git a/debian/osmocom-sgsn.install b/debian/osmocom-sgsn.install deleted file mode 100644 index d89c456..0000000 --- a/debian/osmocom-sgsn.install +++ /dev/null @@ -1 +0,0 @@ -/usr/bin/osmo-sgsn diff --git a/debian/rules b/debian/rules index 4e187a6..ee680cc 100755 --- a/debian/rules +++ b/debian/rules @@ -1,32 +1,34 @@ #!/usr/bin/make -f +# You must remove unused comment lines for the released package. +# See debhelper(7) (uncomment to enable) +# This is an autogenerated template for debian/rules. +# +# Output every command that modifies files on the build system. +#export DH_VERBOSE = 1 -# Uncomment this to turn on verbose mode. -#export DH_VERBOSE=1 - -DEBIAN := $(shell dpkg-parsechangelog | grep ^Version: | cut -d' ' -f2) +DEBIAN := $(shell dpkg-parsechangelog | grep '^Version:' | cut -d' ' -f2) DEBVERS := $(shell echo '$(DEBIAN)' | cut -d- -f1) VERSION := $(shell echo '$(DEBVERS)' | sed -e 's/[+-].*//' -e 's/~//g') -export DEB_BUILD_MAINT_OPTIONS = hardening=+all - +# main packaging script based on dh7 syntax %: - dh $@ --sourcedirectory=openbsc --with autoreconf + dh $@ --with autoreconf -# This is needed for debian stable (squeeze) +# debmake generated override targets +# Set options for ./configure +#CONFIGURE_FLAGS = +#overrride_dh_configure: +# dh_configure -- $(CONFIGURE_FLAGS) +# +# Do not install libtool archive, python .pyc .pyo +#override_dh_install: +# dh_install --list-missing -X.la -X.pyc -X.pyo + override_dh_autoreconf: - cd openbsc && autoreconf --install --force + echo $(VERSION) > .tarball-version + dh_autoreconf +# See https://www.debian.org/doc/manuals/developers-reference/best-pkging-practices.html#bpp-dbg override_dh_strip: - dh_strip -posmocom-bsc --dbg-package=osmocom-bsc-dbg - dh_strip -posmocom-nitb --dbg-package=osmocom-nitb-dbg - dh_strip -posmocom-ipaccess-utils --dbg-package=osmocom-ipaccess-utils-dbg - dh_strip -posmocom-bs11-utils --dbg-package=osmocom-bs11-utils-dbg - dh_strip -posmocom-sgsn --dbg-package=osmocom-sgsn-dbg - dh_strip -posmocom-gbproxy --dbg-package=osmocom-gbproxy-dbg - dh_strip -posmocom-bsc-nat --dbg-package=osmocom-bsc-nat-dbg - dh_strip -posmo-gtphub --dbg-package=osmo-gtphub-dbg - -override_dh_auto_configure: - echo $(VERSION) > openbsc/.tarball-version - dh_auto_configure --sourcedirectory=openbsc -- --enable-nat --enable-osmo-bsc --enable-smpp - + dh_strip --dbg-package=osmo-mgw-dbg + dh_strip --dbg-package=libosmo-legacy-mgcp-dbg -- To view, visit https://gerrit.osmocom.org/3745 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I96a6a56c401833d053d48908872fb0474f5aec53 Gerrit-PatchSet: 1 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: lynxis lazus From gerrit-no-reply at lists.osmocom.org Wed Aug 30 12:27:39 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 30 Aug 2017 12:27:39 +0000 Subject: [PATCH] osmo-mgw[master]: log: output message content also on retransmissions Message-ID: Review at https://gerrit.osmocom.org/3746 log: output message content also on retransmissions When a duplicate command is sent, the MGCP-GW will interpret this as a retramsmission and will send the response of the already executed command again. This response is not printed in the log. Make sure that also responses, which are retrsnamitted are displayed in the log Change-Id: Ic41c2defb521e2f81762d932f8e29f7c8fed06a9 --- M src/libosmo-legacy-mgcp/mgcp_protocol.c 1 file changed, 1 insertion(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-mgw refs/changes/46/3746/1 diff --git a/src/libosmo-legacy-mgcp/mgcp_protocol.c b/src/libosmo-legacy-mgcp/mgcp_protocol.c index 332aa91..bc1ec0d 100644 --- a/src/libosmo-legacy-mgcp/mgcp_protocol.c +++ b/src/libosmo-legacy-mgcp/mgcp_protocol.c @@ -172,6 +172,7 @@ msg->l2h = msgb_put(msg, strlen(endp->last_response)); memcpy(msg->l2h, endp->last_response, msgb_l2len(msg)); + display_mgcp_message(msg->l2h, msgb_l2len(msg), "Retransmitted response"); return msg; } -- To view, visit https://gerrit.osmocom.org/3746 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ic41c2defb521e2f81762d932f8e29f7c8fed06a9 Gerrit-PatchSet: 1 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: dexter From gerrit-no-reply at lists.osmocom.org Wed Aug 30 12:27:40 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 30 Aug 2017 12:27:40 +0000 Subject: [PATCH] osmo-mgw[master]: vty: fix broken vty console Message-ID: Review at https://gerrit.osmocom.org/3747 vty: fix broken vty console The VTY console hangs in OpenBSC MGCP(config-mgcp-trunk)# and there is no way to exit from that. Assign proper node numbers to MGCP_NODE and TRUNK_NODE in order to prevent the VTY-Parser from getting lost. Change-Id: I506c8c4b60af5af6a43268dff8025de7eaa59254 --- M include/osmocom/legacy_mgcp/vty.h 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-mgw refs/changes/47/3747/1 diff --git a/include/osmocom/legacy_mgcp/vty.h b/include/osmocom/legacy_mgcp/vty.h index ff0c405..c277c0a 100644 --- a/include/osmocom/legacy_mgcp/vty.h +++ b/include/osmocom/legacy_mgcp/vty.h @@ -16,7 +16,7 @@ extern struct cmd_element cfg_no_description_cmd; enum mgcp_vty_node { - MGCP_NODE, + MGCP_NODE = _LAST_OSMOVTY_NODE + 1, TRUNK_NODE, }; -- To view, visit https://gerrit.osmocom.org/3747 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I506c8c4b60af5af6a43268dff8025de7eaa59254 Gerrit-PatchSet: 1 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: dexter From gerrit-no-reply at lists.osmocom.org Wed Aug 30 12:30:10 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 30 Aug 2017 12:30:10 +0000 Subject: [ABANDON] osmo-mgw[master]: NOT FOR MERGE: check pre_release branch build In-Reply-To: References: Message-ID: Neels Hofmeyr has abandoned this change. Change subject: NOT FOR MERGE: check pre_release branch build ...................................................................... Abandoned -- To view, visit https://gerrit.osmocom.org/3725 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: abandon Gerrit-Change-Id: I0632f1846563efc7d1968632cb0f3582a301b426 Gerrit-PatchSet: 5 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: dexter From gerrit-no-reply at lists.osmocom.org Wed Aug 30 12:30:18 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 30 Aug 2017 12:30:18 +0000 Subject: [ABANDON] osmo-sgsn[master]: NOT FOR MERGE: check pre_release branch build In-Reply-To: References: Message-ID: Neels Hofmeyr has abandoned this change. Change subject: NOT FOR MERGE: check pre_release branch build ...................................................................... Abandoned -- To view, visit https://gerrit.osmocom.org/3727 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: abandon Gerrit-Change-Id: Ie22c5a8dbe3a55067c2cd15afee095eba572c2d8 Gerrit-PatchSet: 4 Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: dexter From gerrit-no-reply at lists.osmocom.org Wed Aug 30 12:30:22 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 30 Aug 2017 12:30:22 +0000 Subject: [ABANDON] osmo-bsc[master]: NOT FOR MERGE: check pre_release branch build In-Reply-To: References: Message-ID: Neels Hofmeyr has abandoned this change. Change subject: NOT FOR MERGE: check pre_release branch build ...................................................................... Abandoned -- To view, visit https://gerrit.osmocom.org/3726 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: abandon Gerrit-Change-Id: I832d57b882066184b55033bc4bd15e8354788d68 Gerrit-PatchSet: 2 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: dexter From gerrit-no-reply at lists.osmocom.org Wed Aug 30 13:05:38 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 30 Aug 2017 13:05:38 +0000 Subject: [PATCH] osmo-mgw[master]: split off osmo-mgw: remove files, apply build, rename In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3742 to look at the new patch set (#2). split off osmo-mgw: remove files, apply build, rename Add vty and logging previously used from libcommon Rename libmgcp to libosmo-legacy-mgcp and install. Use DLMGCP, not DMGCP. Slim down the public mgcpgw_client API, move all elements not actually used by current callers to private headers / static c. Depends: libosmocore I09c587e2d59472cbde852d467d457254746d9e67 Change-Id: I71a0a16ebaaef881c34235849601fc40aa12cfd7 --- M Makefile.am M configure.ac D contrib/a-link/sccp-split-by-con.lua D contrib/bsc-test/README D contrib/bsc-test/all_dial D contrib/bsc-test/dial.sh D contrib/bsc-test/drop-oml.sh D contrib/bsc-test/drop.sh D contrib/bsc-test/hangup D contrib/bsc-test/msc.sh D contrib/bsc_control.py D contrib/bt.py D contrib/convert_to_enum.py D contrib/ctrl2sse.py D contrib/gprs/gb-proxy-unblock-bug.py D contrib/gprs/gprs-bssgp-histogram.lua D contrib/gprs/gprs-buffer-count.lua D contrib/gprs/gprs-split-trace-by-tlli.lua D contrib/gprs/gprs-verify-nu.lua D contrib/hlr-remove-old.sql D contrib/hlrsync/hlrsync.py M contrib/jenkins.sh D contrib/nat/test_regexp.c D contrib/nat/ussd_example.py D contrib/rtp/gen_rtp_header.erl D contrib/rtp/rtp_replay.st D contrib/rtp/rtp_replay_shared.st D contrib/rtp/rtp_replay_sip.st D contrib/rtp/timestamp_rtp.lua D contrib/sms/fill-hlr.st D contrib/sms/hlr-query.st D contrib/sms/sqlite-probe.tap.d D contrib/soap.py D contrib/systemd/osmo-bsc.service D contrib/systemd/osmo-gbproxy.service D contrib/systemd/osmo-msc.service D contrib/systemd/osmo-nitb.service D contrib/systemd/osmo-sgsn.service D contrib/testconv/Makefile D contrib/testconv/testconv_main.c D contrib/twisted_ipa.py M include/Makefile.am D include/compat_af_isdn.h D include/mISDNif.h D include/openbsc/Makefile.am D include/openbsc/a_iface.h D include/openbsc/a_iface_bssap.h D include/openbsc/a_reset.h D include/openbsc/abis_nm.h D include/openbsc/abis_om2000.h D include/openbsc/abis_rsl.h D include/openbsc/arfcn_range_encode.h D include/openbsc/auth.h D include/openbsc/bsc_api.h D include/openbsc/bsc_msc.h D include/openbsc/bsc_msc_data.h D include/openbsc/bsc_msg_filter.h D include/openbsc/bsc_nat.h D include/openbsc/bsc_nat_callstats.h D include/openbsc/bsc_nat_sccp.h D include/openbsc/bsc_rll.h D include/openbsc/bsc_subscriber.h D include/openbsc/bss.h D include/openbsc/bts_ipaccess_nanobts_omlattr.h D include/openbsc/chan_alloc.h D include/openbsc/common.h D include/openbsc/common_bsc.h D include/openbsc/common_cs.h D include/openbsc/crc24.h D include/openbsc/ctrl.h D include/openbsc/db.h D include/openbsc/debug.h D include/openbsc/e1_config.h D include/openbsc/gb_proxy.h D include/openbsc/gprs_gb_parse.h D include/openbsc/gprs_gmm.h D include/openbsc/gprs_llc.h D include/openbsc/gprs_llc_xid.h D include/openbsc/gprs_sgsn.h D include/openbsc/gprs_sndcp.h D include/openbsc/gprs_sndcp_comp.h D include/openbsc/gprs_sndcp_dcomp.h D include/openbsc/gprs_sndcp_pcomp.h D include/openbsc/gprs_sndcp_xid.h D include/openbsc/gprs_subscriber.h D include/openbsc/gprs_utils.h D include/openbsc/gsm_04_08.h D include/openbsc/gsm_04_11.h D include/openbsc/gsm_04_80.h D include/openbsc/gsm_data.h D include/openbsc/gsm_data_shared.h D include/openbsc/gsm_subscriber.h D include/openbsc/gsup_client.h D include/openbsc/gtphub.h D include/openbsc/handover.h D include/openbsc/handover_decision.h D include/openbsc/ipaccess.h D include/openbsc/iucs.h D include/openbsc/iucs_ranap.h D include/openbsc/meas_feed.h D include/openbsc/meas_rep.h D include/openbsc/mgcp.h D include/openbsc/mgcp_internal.h D include/openbsc/mgcpgw_client.h D include/openbsc/misdn.h D include/openbsc/mncc.h D include/openbsc/mncc_int.h D include/openbsc/msc_ifaces.h D include/openbsc/nat_rewrite_trie.h D include/openbsc/network_listen.h D include/openbsc/oap_client.h D include/openbsc/openbscdefines.h D include/openbsc/osmo_bsc.h D include/openbsc/osmo_bsc_grace.h D include/openbsc/osmo_bsc_reset.h D include/openbsc/osmo_bsc_rf.h D include/openbsc/osmo_bsc_sigtran.h D include/openbsc/osmo_msc.h D include/openbsc/paging.h D include/openbsc/pcu_if.h D include/openbsc/pcuif_proto.h D include/openbsc/rest_octets.h D include/openbsc/rrlp.h D include/openbsc/rs232.h D include/openbsc/rtp_proxy.h D include/openbsc/sgsn.h D include/openbsc/signal.h D include/openbsc/silent_call.h D include/openbsc/slhc.h D include/openbsc/smpp.h D include/openbsc/sms_queue.h D include/openbsc/socket.h D include/openbsc/system_information.h D include/openbsc/transaction.h D include/openbsc/trau_mux.h D include/openbsc/trau_upqueue.h D include/openbsc/ussd.h D include/openbsc/v42bis.h D include/openbsc/v42bis_private.h D include/openbsc/vlr.h D include/openbsc/vty.h A include/osmocom/Makefile.am A include/osmocom/legacy_mgcp/Makefile.am A include/osmocom/legacy_mgcp/mgcp.h A include/osmocom/legacy_mgcp/mgcp_internal.h R include/osmocom/legacy_mgcp/mgcp_transcode.h A include/osmocom/legacy_mgcp/mgcpgw_client.h A include/osmocom/legacy_mgcp/mgcpgw_client_internal.h R include/osmocom/legacy_mgcp/osmux.h A include/osmocom/legacy_mgcp/vty.h A libosmo-legacy-mgcp.pc.in D openbsc.pc.in M osmoappdesc.py M src/Makefile.am D src/gprs/.gitignore D src/gprs/Makefile.am D src/gprs/crc24.c D src/gprs/gb_proxy.c D src/gprs/gb_proxy_main.c D src/gprs/gb_proxy_patch.c D src/gprs/gb_proxy_peer.c D src/gprs/gb_proxy_tlli.c D src/gprs/gb_proxy_vty.c D src/gprs/gprs_gb_parse.c D src/gprs/gprs_gmm.c D src/gprs/gprs_llc.c D src/gprs/gprs_llc_parse.c D src/gprs/gprs_llc_vty.c D src/gprs/gprs_llc_xid.c D src/gprs/gprs_sgsn.c D src/gprs/gprs_sndcp.c D src/gprs/gprs_sndcp_comp.c D src/gprs/gprs_sndcp_dcomp.c D src/gprs/gprs_sndcp_pcomp.c D src/gprs/gprs_sndcp_vty.c D src/gprs/gprs_sndcp_xid.c D src/gprs/gprs_subscriber.c D src/gprs/gprs_utils.c D src/gprs/gtphub.c D src/gprs/gtphub_ares.c D src/gprs/gtphub_main.c D src/gprs/gtphub_sock.c D src/gprs/gtphub_vty.c D src/gprs/osmo_sgsn.cfg D src/gprs/sgsn_ares.c D src/gprs/sgsn_auth.c D src/gprs/sgsn_cdr.c D src/gprs/sgsn_ctrl.c D src/gprs/sgsn_libgtp.c D src/gprs/sgsn_main.c D src/gprs/sgsn_vty.c D src/gprs/slhc.c D src/gprs/v42bis.c D src/ipaccess/Makefile.am D src/ipaccess/abisip-find.c D src/ipaccess/ipaccess-config.c D src/ipaccess/ipaccess-firmware.c D src/ipaccess/ipaccess-proxy.c D src/ipaccess/network_listen.c D src/libbsc/Makefile.am D src/libbsc/abis_nm.c D src/libbsc/abis_nm_ipaccess.c D src/libbsc/abis_nm_vty.c D src/libbsc/abis_om2000.c D src/libbsc/abis_om2000_vty.c D src/libbsc/abis_rsl.c D src/libbsc/arfcn_range_encode.c D src/libbsc/bsc_api.c D src/libbsc/bsc_ctrl_commands.c D src/libbsc/bsc_ctrl_lookup.c D src/libbsc/bsc_dyn_ts.c D src/libbsc/bsc_init.c D src/libbsc/bsc_msc.c D src/libbsc/bsc_rf_ctrl.c D src/libbsc/bsc_rll.c D src/libbsc/bsc_subscriber.c D src/libbsc/bsc_vty.c D src/libbsc/bts_ericsson_rbs2000.c D src/libbsc/bts_init.c D src/libbsc/bts_ipaccess_nanobts.c D src/libbsc/bts_ipaccess_nanobts_omlattr.c D src/libbsc/bts_nokia_site.c D src/libbsc/bts_siemens_bs11.c D src/libbsc/bts_sysmobts.c D src/libbsc/bts_unknown.c D src/libbsc/chan_alloc.c D src/libbsc/e1_config.c D src/libbsc/gsm_04_08_utils.c D src/libbsc/gsm_04_80_utils.c D src/libbsc/handover_decision.c D src/libbsc/handover_logic.c D src/libbsc/meas_proc.c D src/libbsc/meas_rep.c D src/libbsc/net_init.c D src/libbsc/paging.c D src/libbsc/pcu_sock.c D src/libbsc/rest_octets.c D src/libbsc/system_information.c D src/libcommon-cs/Makefile.am D src/libcommon-cs/a_reset.c D src/libcommon-cs/common_cs.c D src/libcommon-cs/common_cs_vty.c D src/libcommon/Makefile.am D src/libcommon/bsc_version.c D src/libcommon/common_vty.c D src/libcommon/debug.c D src/libcommon/gsm_data.c D src/libcommon/gsm_data_shared.c D src/libcommon/gsm_subscriber_base.c D src/libcommon/gsup_client.c D src/libcommon/gsup_test_client.c D src/libcommon/oap_client.c D src/libcommon/socket.c D src/libcommon/talloc_ctx.c D src/libfilter/Makefile.am D src/libfilter/bsc_msg_acc.c D src/libfilter/bsc_msg_filter.c D src/libfilter/bsc_msg_vty.c D src/libmgcp/Makefile.am D src/libmgcp/mgcp_common.c D src/libmgcp/mgcp_network.c D src/libmgcp/mgcp_osmux.c D src/libmgcp/mgcp_protocol.c D src/libmgcp/mgcp_sdp.c D src/libmgcp/mgcp_transcode.c D src/libmgcp/mgcp_vty.c D src/libmgcp/mgcpgw_client.c D src/libmgcp/mgcpgw_client_vty.c D src/libmsc/Makefile.am D src/libmsc/a_iface.c D src/libmsc/a_iface_bssap.c D src/libmsc/auth.c D src/libmsc/ctrl_commands.c D src/libmsc/db.c D src/libmsc/gsm_04_08.c D src/libmsc/gsm_04_11.c D src/libmsc/gsm_04_80.c D src/libmsc/gsm_subscriber.c D src/libmsc/iu_dummy.c D src/libmsc/iucs.c D src/libmsc/iucs_ranap.c D src/libmsc/meas_feed.c D src/libmsc/meas_feed.h D src/libmsc/mncc.c D src/libmsc/mncc_builtin.c D src/libmsc/mncc_sock.c D src/libmsc/msc_ifaces.c D src/libmsc/msc_vty.c D src/libmsc/osmo_msc.c D src/libmsc/rrlp.c D src/libmsc/silent_call.c D src/libmsc/smpp_openbsc.c D src/libmsc/smpp_smsc.c D src/libmsc/smpp_smsc.h D src/libmsc/smpp_utils.c D src/libmsc/smpp_vty.c D src/libmsc/sms_queue.c D src/libmsc/subscr_conn.c D src/libmsc/transaction.c D src/libmsc/ussd.c D src/libmsc/vty_interface_layer3.c A src/libosmo-legacy-mgcp/Makefile.am R src/libosmo-legacy-mgcp/g711common.h A src/libosmo-legacy-mgcp/mgcp_common.c A src/libosmo-legacy-mgcp/mgcp_network.c A src/libosmo-legacy-mgcp/mgcp_osmux.c A src/libosmo-legacy-mgcp/mgcp_protocol.c A src/libosmo-legacy-mgcp/mgcp_sdp.c A src/libosmo-legacy-mgcp/mgcp_transcode.c A src/libosmo-legacy-mgcp/mgcp_vty.c A src/libosmo-legacy-mgcp/mgcpgw_client.c A src/libosmo-legacy-mgcp/mgcpgw_client_vty.c D src/libtrau/Makefile.am D src/libtrau/rtp_proxy.c D src/libtrau/trau_mux.c D src/libtrau/trau_upqueue.c D src/libvlr/Makefile.am D src/libvlr/vlr.c D src/libvlr/vlr_access_req_fsm.c D src/libvlr/vlr_access_req_fsm.h D src/libvlr/vlr_auth_fsm.c D src/libvlr/vlr_auth_fsm.h D src/libvlr/vlr_core.h D src/libvlr/vlr_lu_fsm.c D src/libvlr/vlr_lu_fsm.h D src/osmo-bsc/Makefile.am D src/osmo-bsc/osmo_bsc_api.c D src/osmo-bsc/osmo_bsc_audio.c D src/osmo-bsc/osmo_bsc_bssap.c D src/osmo-bsc/osmo_bsc_ctrl.c D src/osmo-bsc/osmo_bsc_filter.c D src/osmo-bsc/osmo_bsc_grace.c D src/osmo-bsc/osmo_bsc_main.c D src/osmo-bsc/osmo_bsc_msc.c D src/osmo-bsc/osmo_bsc_reset.c D src/osmo-bsc/osmo_bsc_sigtran.c D src/osmo-bsc/osmo_bsc_vty.c M src/osmo-bsc_mgcp/Makefile.am M src/osmo-bsc_mgcp/mgcp_main.c D src/osmo-bsc_nat/Makefile.am D src/osmo-bsc_nat/bsc_filter.c D src/osmo-bsc_nat/bsc_mgcp_utils.c D src/osmo-bsc_nat/bsc_nat.c D src/osmo-bsc_nat/bsc_nat_ctrl.c D src/osmo-bsc_nat/bsc_nat_filter.c D src/osmo-bsc_nat/bsc_nat_rewrite.c D src/osmo-bsc_nat/bsc_nat_rewrite_trie.c D src/osmo-bsc_nat/bsc_nat_utils.c D src/osmo-bsc_nat/bsc_nat_vty.c D src/osmo-bsc_nat/bsc_sccp.c D src/osmo-bsc_nat/bsc_ussd.c D src/osmo-msc/Makefile.am D src/osmo-msc/msc_main.c D src/utils/Makefile.am D src/utils/bs11_config.c D src/utils/isdnsync.c D src/utils/meas_db.c D src/utils/meas_db.h D src/utils/meas_json.c D src/utils/meas_pcap2db.c D src/utils/meas_udp2db.c D src/utils/meas_vis.c D src/utils/smpp_mirror.c M tests/Makefile.am D tests/abis/Makefile.am D tests/abis/abis_test.c D tests/abis/abis_test.ok D tests/bsc-nat-trie/Makefile.am D tests/bsc-nat-trie/bsc_nat_trie_test.c D tests/bsc-nat-trie/bsc_nat_trie_test.ok D tests/bsc-nat-trie/prefixes.csv D tests/bsc-nat/Makefile.am D tests/bsc-nat/barr.cfg D tests/bsc-nat/barr_dup.cfg D tests/bsc-nat/bsc_data.c D tests/bsc-nat/bsc_nat_test.c D tests/bsc-nat/bsc_nat_test.ok D tests/bsc-nat/prefixes.csv D tests/bsc/Makefile.am D tests/bsc/bsc_test.c D tests/bsc/bsc_test.ok D tests/channel/Makefile.am D tests/channel/channel_test.c D tests/channel/channel_test.ok D tests/db/Makefile.am D tests/db/db_test.c D tests/db/db_test.err D tests/db/db_test.ok D tests/db/hlr.sqlite3 D tests/gbproxy/Makefile.am D tests/gbproxy/gbproxy_test.c D tests/gbproxy/gbproxy_test.ok D tests/gprs/Makefile.am D tests/gprs/gprs_test.c D tests/gprs/gprs_test.ok D tests/gsm0408/Makefile.am D tests/gsm0408/gsm0408_test.c D tests/gsm0408/gsm0408_test.ok D tests/gtphub/Makefile.am D tests/gtphub/gtphub_test.c D tests/gtphub/gtphub_test.ok A tests/legacy_mgcp/Makefile.am A tests/legacy_mgcp/mgcp_test.c R tests/legacy_mgcp/mgcp_test.ok A tests/legacy_mgcp/mgcp_transcoding_test.c R tests/legacy_mgcp/mgcp_transcoding_test.ok A tests/legacy_mgcp/mgcpgw_client_test.c R tests/legacy_mgcp/mgcpgw_client_test.err R tests/legacy_mgcp/mgcpgw_client_test.ok D tests/mgcp/Makefile.am D tests/mgcp/mgcp_test.c D tests/mgcp/mgcp_transcoding_test.c D tests/mgcp/mgcpgw_client_test.c D tests/msc_vlr/Makefile.am D tests/msc_vlr/msc_vlr_test_gsm_authen.c D tests/msc_vlr/msc_vlr_test_gsm_authen.err D tests/msc_vlr/msc_vlr_test_gsm_authen.ok D tests/msc_vlr/msc_vlr_test_gsm_ciph.c D tests/msc_vlr/msc_vlr_test_gsm_ciph.err D tests/msc_vlr/msc_vlr_test_gsm_ciph.ok D tests/msc_vlr/msc_vlr_test_hlr_reject.c D tests/msc_vlr/msc_vlr_test_hlr_reject.err D tests/msc_vlr/msc_vlr_test_hlr_reject.ok D tests/msc_vlr/msc_vlr_test_hlr_timeout.c D tests/msc_vlr/msc_vlr_test_hlr_timeout.err D tests/msc_vlr/msc_vlr_test_hlr_timeout.ok D tests/msc_vlr/msc_vlr_test_ms_timeout.c D tests/msc_vlr/msc_vlr_test_ms_timeout.err D tests/msc_vlr/msc_vlr_test_ms_timeout.ok D tests/msc_vlr/msc_vlr_test_no_authen.c D tests/msc_vlr/msc_vlr_test_no_authen.err D tests/msc_vlr/msc_vlr_test_no_authen.ok D tests/msc_vlr/msc_vlr_test_reject_concurrency.c D tests/msc_vlr/msc_vlr_test_reject_concurrency.err D tests/msc_vlr/msc_vlr_test_reject_concurrency.ok D tests/msc_vlr/msc_vlr_test_rest.c D tests/msc_vlr/msc_vlr_test_rest.err D tests/msc_vlr/msc_vlr_test_rest.ok D tests/msc_vlr/msc_vlr_test_umts_authen.c D tests/msc_vlr/msc_vlr_test_umts_authen.err D tests/msc_vlr/msc_vlr_test_umts_authen.ok D tests/msc_vlr/msc_vlr_tests.c D tests/msc_vlr/msc_vlr_tests.h D tests/nanobts_omlattr/Makefile.am D tests/nanobts_omlattr/nanobts_omlattr_test.c D tests/nanobts_omlattr/nanobts_omlattr_test.ok D tests/oap/Makefile.am D tests/oap/oap_client_test.c D tests/oap/oap_client_test.err D tests/oap/oap_client_test.ok D tests/sgsn/Makefile.am D tests/sgsn/sgsn_test.c D tests/sgsn/sgsn_test.ok D tests/slhc/Makefile.am D tests/slhc/slhc_test.c D tests/slhc/slhc_test.ok D tests/smpp/Makefile.am D tests/smpp/smpp_test.c D tests/smpp/smpp_test.err D tests/smpp/smpp_test.ok D tests/smpp_test_runner.py D tests/sms_queue/Makefile.am D tests/sms_queue/sms_queue_test.c D tests/sms_queue/sms_queue_test.err D tests/sms_queue/sms_queue_test.ok D tests/sndcp_xid/Makefile.am D tests/sndcp_xid/sndcp_xid_test.c D tests/sndcp_xid/sndcp_xid_test.ok D tests/subscr/Makefile.am D tests/subscr/bsc_subscr_test.c D tests/subscr/bsc_subscr_test.err D tests/subscr/bsc_subscr_test.ok M tests/testsuite.at D tests/trau/Makefile.am D tests/trau/trau_test.c D tests/trau/trau_test.ok D tests/v42bis/Makefile.am D tests/v42bis/v42bis_test.c D tests/v42bis/v42bis_test.ok M tests/vty_test_runner.py D tests/xid/Makefile.am D tests/xid/xid_test.c D tests/xid/xid_test.ok 483 files changed, 9,790 insertions(+), 159,951 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-mgw refs/changes/42/3742/2 -- To view, visit https://gerrit.osmocom.org/3742 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I71a0a16ebaaef881c34235849601fc40aa12cfd7 Gerrit-PatchSet: 2 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Aug 30 13:06:55 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 30 Aug 2017 13:06:55 +0000 Subject: [ABANDON] osmo-mgw[master]: prune public mgcpgw_client api In-Reply-To: References: Message-ID: Neels Hofmeyr has abandoned this change. Change subject: prune public mgcpgw_client api ...................................................................... Abandoned squashed into G#3742 -- To view, visit https://gerrit.osmocom.org/3743 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: abandon Gerrit-Change-Id: Ic9199c87c4ac6d249fd210579a877d5404ed8514 Gerrit-PatchSet: 1 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Aug 30 13:07:10 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 30 Aug 2017 13:07:10 +0000 Subject: [ABANDON] osmo-mgw[master]: mgcp client: allow getting actual conf from opaque struct In-Reply-To: References: Message-ID: Neels Hofmeyr has abandoned this change. Change subject: mgcp client: allow getting actual conf from opaque struct ...................................................................... Abandoned squashed into G#3742 -- To view, visit https://gerrit.osmocom.org/3744 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: abandon Gerrit-Change-Id: I90ba16f1e2cafb64c7e3af65e9402722bf7586b0 Gerrit-PatchSet: 1 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Aug 30 13:07:17 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 30 Aug 2017 13:07:17 +0000 Subject: [ABANDON] osmo-mgw[master]: vty: fix broken vty console In-Reply-To: References: Message-ID: Neels Hofmeyr has abandoned this change. Change subject: vty: fix broken vty console ...................................................................... Abandoned squashed into G#3742 -- To view, visit https://gerrit.osmocom.org/3747 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: abandon Gerrit-Change-Id: I506c8c4b60af5af6a43268dff8025de7eaa59254 Gerrit-PatchSet: 1 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: dexter From gerrit-no-reply at lists.osmocom.org Wed Aug 30 13:07:29 2017 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 30 Aug 2017 13:07:29 +0000 Subject: [MERGED] osmo-msc[master]: am: msc_vlr_tests: use AM_LDFLAGS instead of COMMON vars In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: am: msc_vlr_tests: use AM_LDFLAGS instead of COMMON vars ...................................................................... am: msc_vlr_tests: use AM_LDFLAGS instead of COMMON vars It was a n00b mistake to define COMMON_LDFLAGS and COMMON_LDADD to pass the same linker options to each test binary. Instead, use AM_LDFLAGS and remove the autoreconf warning. tests/msc_vlr/Makefile.am:66: warning: variable 'COMMON_LDFLAGS' is defined but no program or tests/msc_vlr/Makefile.am:66: library has 'COMMON' as canonical name (possible typo) Related: OS#2448 Change-Id: I6efae6e192b22de2c1d706edd55385135142532b --- M tests/msc_vlr/Makefile.am 1 file changed, 32 insertions(+), 53 deletions(-) Approvals: Max: Looks good to me, but someone else must approve Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/tests/msc_vlr/Makefile.am b/tests/msc_vlr/Makefile.am index 70006dd..fb4857f 100644 --- a/tests/msc_vlr/Makefile.am +++ b/tests/msc_vlr/Makefile.am @@ -18,6 +18,38 @@ $(LIBOSMOLEGACYMGCP_CFLAGS) \ $(NULL) +AM_LDFLAGS = \ + -Wl,--wrap=gsup_client_create \ + -Wl,--wrap=gsup_client_send \ + -Wl,--wrap=a_iface_tx_dtap \ + -Wl,--wrap=a_iface_tx_clear_cmd \ + -Wl,--wrap=a_iface_tx_paging \ + -Wl,--wrap=ranap_iu_tx \ + -Wl,--wrap=ranap_iu_tx_release \ + -Wl,--wrap=ranap_iu_tx_common_id \ + -Wl,--wrap=ranap_iu_page_cs \ + -Wl,--wrap=msc_stop_paging \ + -Wl,--wrap=gsm340_gen_scts \ + -Wl,--wrap=RAND_bytes \ + $(top_builddir)/src/libmsc/libmsc.a \ + $(top_builddir)/src/libcommon-cs/libcommon-cs.a \ + $(top_builddir)/src/libvlr/libvlr.a \ + $(top_builddir)/src/libcommon/libcommon.a \ + $(LIBSMPP34_LIBS) \ + $(LIBOSMOCORE_LIBS) \ + $(LIBOSMOGSM_LIBS) \ + $(LIBCRYPTO_LIBS) \ + $(LIBOSMOVTY_LIBS) \ + $(LIBOSMOABIS_LIBS) \ + $(LIBOSMOSIGTRAN_LIBS) \ + $(LIBOSMORANAP_LIBS) \ + $(LIBASN1C_LIBS) \ + $(LIBOSMOLEGACYMGCP_LIBS) \ + $(LIBRARY_GSM) \ + -ldbi \ + -lrt \ + $(NULL) + noinst_HEADERS = \ msc_vlr_tests.h \ $(NULL) @@ -43,41 +75,6 @@ msc_vlr_test_rest.err \ $(NULL) -COMMON_LDADD = \ - $(top_builddir)/src/libmsc/libmsc.a \ - $(top_builddir)/src/libcommon-cs/libcommon-cs.a \ - $(top_builddir)/src/libvlr/libvlr.a \ - $(top_builddir)/src/libcommon/libcommon.a \ - $(LIBSMPP34_LIBS) \ - $(LIBOSMOCORE_LIBS) \ - $(LIBOSMOGSM_LIBS) \ - $(LIBCRYPTO_LIBS) \ - $(LIBOSMOVTY_LIBS) \ - $(LIBOSMOABIS_LIBS) \ - $(LIBOSMOSIGTRAN_LIBS) \ - $(LIBOSMORANAP_LIBS) \ - $(LIBASN1C_LIBS) \ - $(LIBOSMOLEGACYMGCP_LIBS) \ - $(LIBRARY_GSM) \ - -ldbi \ - -lrt \ - $(NULL) - -COMMON_LDFLAGS = \ - -Wl,--wrap=gsup_client_create \ - -Wl,--wrap=gsup_client_send \ - -Wl,--wrap=a_iface_tx_dtap \ - -Wl,--wrap=a_iface_tx_clear_cmd \ - -Wl,--wrap=a_iface_tx_paging \ - -Wl,--wrap=ranap_iu_tx \ - -Wl,--wrap=ranap_iu_tx_release \ - -Wl,--wrap=ranap_iu_tx_common_id \ - -Wl,--wrap=ranap_iu_page_cs \ - -Wl,--wrap=msc_stop_paging \ - -Wl,--wrap=gsm340_gen_scts \ - -Wl,--wrap=RAND_bytes \ - $(NULL) - noinst_PROGRAMS = \ msc_vlr_test_no_authen \ msc_vlr_test_gsm_authen \ @@ -94,64 +91,46 @@ msc_vlr_test_no_authen.c \ msc_vlr_tests.c \ $(NULL) -msc_vlr_test_no_authen_LDADD = $(COMMON_LDADD) -msc_vlr_test_no_authen_LDFLAGS = $(COMMON_LDFLAGS) msc_vlr_test_gsm_authen_SOURCES = \ msc_vlr_test_gsm_authen.c \ msc_vlr_tests.c \ $(NULL) -msc_vlr_test_gsm_authen_LDADD = $(COMMON_LDADD) -msc_vlr_test_gsm_authen_LDFLAGS = $(COMMON_LDFLAGS) msc_vlr_test_gsm_ciph_SOURCES = \ msc_vlr_test_gsm_ciph.c \ msc_vlr_tests.c \ $(NULL) -msc_vlr_test_gsm_ciph_LDADD = $(COMMON_LDADD) -msc_vlr_test_gsm_ciph_LDFLAGS = $(COMMON_LDFLAGS) msc_vlr_test_umts_authen_SOURCES = \ msc_vlr_test_umts_authen.c \ msc_vlr_tests.c \ $(NULL) -msc_vlr_test_umts_authen_LDADD = $(COMMON_LDADD) -msc_vlr_test_umts_authen_LDFLAGS = $(COMMON_LDFLAGS) msc_vlr_test_hlr_reject_SOURCES = \ msc_vlr_test_hlr_reject.c \ msc_vlr_tests.c \ $(NULL) -msc_vlr_test_hlr_reject_LDADD = $(COMMON_LDADD) -msc_vlr_test_hlr_reject_LDFLAGS = $(COMMON_LDFLAGS) msc_vlr_test_hlr_timeout_SOURCES = \ msc_vlr_test_hlr_timeout.c \ msc_vlr_tests.c \ $(NULL) -msc_vlr_test_hlr_timeout_LDADD = $(COMMON_LDADD) -msc_vlr_test_hlr_timeout_LDFLAGS = $(COMMON_LDFLAGS) msc_vlr_test_ms_timeout_SOURCES = \ msc_vlr_test_ms_timeout.c \ msc_vlr_tests.c \ $(NULL) -msc_vlr_test_ms_timeout_LDADD = $(COMMON_LDADD) -msc_vlr_test_ms_timeout_LDFLAGS = $(COMMON_LDFLAGS) msc_vlr_test_reject_concurrency_SOURCES = \ msc_vlr_test_reject_concurrency.c \ msc_vlr_tests.c \ $(NULL) -msc_vlr_test_reject_concurrency_LDADD = $(COMMON_LDADD) -msc_vlr_test_reject_concurrency_LDFLAGS = $(COMMON_LDFLAGS) msc_vlr_test_rest_SOURCES = \ msc_vlr_test_rest.c \ msc_vlr_tests.c \ $(NULL) -msc_vlr_test_rest_LDADD = $(COMMON_LDADD) -msc_vlr_test_rest_LDFLAGS = $(COMMON_LDFLAGS) .PHONY: update_exp update_exp: -- To view, visit https://gerrit.osmocom.org/3720 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I6efae6e192b22de2c1d706edd55385135142532b Gerrit-PatchSet: 3 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Wed Aug 30 13:57:52 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Wed, 30 Aug 2017 13:57:52 +0000 Subject: [PATCH] openggsn[master]: ggsn: Fix DNS not sent in PDP context response Message-ID: Review at https://gerrit.osmocom.org/3748 ggsn: Fix DNS not sent in PDP context response During IPv6 support implementation, helper function pco_contains_proto was added which contains an error: It is only capable of finding first protocol correctly, and as a consequence, in my setup DNS servers where not sent back to the SGSN/MS, resulting in phone being able to connect to IPs but not to domain names which required DNS resolution. The condition in the while loop is also changed to match the increment of the variable inside the loop to make it easier to understand at first glance. Fixes: 1ae98777d9b1ee62e6900caf4bb580d1a42bb416 Change-Id: Icc2e6716c33d78d3c3e000f529806228d8aa155e --- M ggsn/ggsn.c 1 file changed, 2 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openggsn refs/changes/48/3748/1 diff --git a/ggsn/ggsn.c b/ggsn/ggsn.c index c6a6dac..1e92956 100644 --- a/ggsn/ggsn.c +++ b/ggsn/ggsn.c @@ -215,14 +215,14 @@ uint8_t *cur = pco->v + 1; /* iterate over PCO and check if protocol contained */ - while (cur + 2 < pco->v + pco->l) { + while (cur + 3 <= pco->v + pco->l) { uint16_t cur_prot = osmo_load16be(cur); uint8_t cur_len = cur[2]; if (cur_prot == prot) return true; if (cur_len == 0) break; - cur += cur_len; + cur += cur_len + 3; } return false; } -- To view, visit https://gerrit.osmocom.org/3748 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Icc2e6716c33d78d3c3e000f529806228d8aa155e Gerrit-PatchSet: 1 Gerrit-Project: openggsn Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Wed Aug 30 14:02:33 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Wed, 30 Aug 2017 14:02:33 +0000 Subject: openggsn[master]: ggsn: Fix DNS not sent in PDP context response In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/3748 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Icc2e6716c33d78d3c3e000f529806228d8aa155e Gerrit-PatchSet: 1 Gerrit-Project: openggsn Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Aug 30 17:20:17 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Wed, 30 Aug 2017 17:20:17 +0000 Subject: [PATCH] libosmocore[master]: libosmogsm: add Routing Area Identifier test Message-ID: Review at https://gerrit.osmocom.org/3749 libosmogsm: add Routing Area Identifier test Ensure that gsm48_parse_ra() and gsm48_construct_ra() behave properly. Change-Id: I27117fe728407dd10886459e89ba4ff9d5e53e6b --- M tests/gsm0408/gsm0408_test.c M tests/gsm0408/gsm0408_test.ok 2 files changed, 57 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/49/3749/1 diff --git a/tests/gsm0408/gsm0408_test.c b/tests/gsm0408/gsm0408_test.c index f922a4f..3f3a5c7 100644 --- a/tests/gsm0408/gsm0408_test.c +++ b/tests/gsm0408/gsm0408_test.c @@ -130,6 +130,54 @@ return 0; } +static inline void dump_ra(const struct gprs_ra_id *raid) +{ + printf("RA: MNC=%u, MCC=%u, LAC=%u, RAC=%u\n", raid->mnc, raid->mcc, raid->lac, raid->rac); +} + +static inline void check_ra(const struct gprs_ra_id *raid) +{ + uint8_t buf[6]; + int res; + struct gprs_ra_id raid0 = { + .mnc = 0, + .mcc = 0, + .lac = 0, + .rac = 0, + }; + + res = gsm48_construct_ra(buf, raid); + printf("Constructed RA: %d - %s\n", res, res != sizeof(buf) ? "FAIL" : "OK"); + + gsm48_parse_ra(&raid0, buf); + dump_ra(raid); + dump_ra(&raid0); + printf("RA test..."); + if (raid->mnc != raid0.mnc || raid->mcc != raid0.mcc || raid->lac != raid0.lac || raid->rac != raid0.rac) + printf("FAIL\n"); + else + printf("passed\n"); +} + +static void test_ra_cap(void) +{ + struct gprs_ra_id raid1 = { + .mnc = 121, + .mcc = 77, + .lac = 666, + .rac = 5, + }; + struct gprs_ra_id raid2 = { + .mnc = 98, + .mcc = 84, + .lac = 11, + .rac = 89, + }; + + check_ra(&raid1); + check_ra(&raid2); +} + static void test_mid_from_tmsi(void) { static const uint8_t res[] = { 0x17, 0x05, 0xf4, 0xaa, 0xbb, 0xcc, 0xdd }; @@ -152,6 +200,7 @@ msgb_talloc_ctx_init(NULL, 0); test_bearer_cap(); test_mid_from_tmsi(); + test_ra_cap(); return EXIT_SUCCESS; } diff --git a/tests/gsm0408/gsm0408_test.ok b/tests/gsm0408/gsm0408_test.ok index 4a6d78b..f0abfd5 100644 --- a/tests/gsm0408/gsm0408_test.ok +++ b/tests/gsm0408/gsm0408_test.ok @@ -1,3 +1,11 @@ Test `CSD 9600/V.110/transparent' passed Test `Speech, all codecs' passed Simple TMSI encoding test....passed +Constructed RA: 6 - OK +RA: MNC=121, MCC=77, LAC=666, RAC=5 +RA: MNC=121, MCC=77, LAC=666, RAC=5 +RA test...passed +Constructed RA: 6 - OK +RA: MNC=98, MCC=84, LAC=11, RAC=89 +RA: MNC=98, MCC=84, LAC=11, RAC=89 +RA test...passed -- To view, visit https://gerrit.osmocom.org/3749 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I27117fe728407dd10886459e89ba4ff9d5e53e6b Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Wed Aug 30 17:50:26 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Wed, 30 Aug 2017 17:50:26 +0000 Subject: [PATCH] openbsc[master]: abis: fix unaligned memory access Message-ID: Review at https://gerrit.osmocom.org/3750 abis: fix unaligned memory access * replace pointer arithmetic with struct use to prevent unaligned memory access on arm. * constify function parameters Change-Id: Ie8a3107c22cd7f3682fac037e04a50ef3ea9171c Fixes: OS#2472 --- M openbsc/include/openbsc/gsm_data.h M openbsc/src/libbsc/abis_nm.c M openbsc/src/libcommon/gsm_data.c 3 files changed, 8 insertions(+), 6 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/50/3750/1 diff --git a/openbsc/include/openbsc/gsm_data.h b/openbsc/include/openbsc/gsm_data.h index 4035b39..8b689a5 100644 --- a/openbsc/include/openbsc/gsm_data.h +++ b/openbsc/include/openbsc/gsm_data.h @@ -558,8 +558,8 @@ const char *bts_gprs_mode_name(enum bts_gprs_mode mode); int bts_gprs_mode_is_compat(struct gsm_bts *bts, enum bts_gprs_mode mode); -int gsm48_ra_id_by_bts(uint8_t *buf, struct gsm_bts *bts); -void gprs_ra_id_by_bts(struct gprs_ra_id *raid, struct gsm_bts *bts); +int gsm48_ra_id_by_bts(uint8_t *buf, const struct gsm_bts *bts, bool rac_override); +void gprs_ra_id_by_bts(struct gprs_ra_id *raid, const struct gsm_bts *bts); struct gsm_meas_rep *lchan_next_meas_rep(struct gsm_lchan *lchan); int gsm_btsmodel_set_feature(struct gsm_bts_model *model, enum gsm_bts_features feat); diff --git a/openbsc/src/libbsc/abis_nm.c b/openbsc/src/libbsc/abis_nm.c index cf20d7c..ec1f8d1 100644 --- a/openbsc/src/libbsc/abis_nm.c +++ b/openbsc/src/libbsc/abis_nm.c @@ -2787,8 +2787,7 @@ { /* we simply reuse the GSM48 function and overwrite the RAC * with the Cell ID */ - gsm48_ra_id_by_bts(buf, bts); - *((uint16_t *)(buf + 5)) = htons(bts->cell_identity); + gsm48_ra_id_by_bts(buf, bts, true); } void gsm_trx_lock_rf(struct gsm_bts_trx *trx, int locked) diff --git a/openbsc/src/libcommon/gsm_data.c b/openbsc/src/libcommon/gsm_data.c index f1049e9..c62072f 100644 --- a/openbsc/src/libcommon/gsm_data.c +++ b/openbsc/src/libcommon/gsm_data.c @@ -335,7 +335,7 @@ return bts; } -void gprs_ra_id_by_bts(struct gprs_ra_id *raid, struct gsm_bts *bts) +void gprs_ra_id_by_bts(struct gprs_ra_id *raid, const struct gsm_bts *bts) { raid->mcc = bts->network->country_code; raid->mnc = bts->network->network_code; @@ -343,12 +343,15 @@ raid->rac = bts->gprs.rac; } -int gsm48_ra_id_by_bts(uint8_t *buf, struct gsm_bts *bts) +int gsm48_ra_id_by_bts(uint8_t *buf, const struct gsm_bts *bts, bool rac_override) { struct gprs_ra_id raid; gprs_ra_id_by_bts(&raid, bts); + if (rac_override) + raid.rac = htons(bts->cell_identity); + return gsm48_construct_ra(buf, &raid); } -- To view, visit https://gerrit.osmocom.org/3750 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ie8a3107c22cd7f3682fac037e04a50ef3ea9171c Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Wed Aug 30 17:52:11 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Wed, 30 Aug 2017 17:52:11 +0000 Subject: openbsc[master]: abis: fix unaligned memory access In-Reply-To: References: Message-ID: Patch Set 1: Note: this has not been tested with actual nanobts. It's also unclear from the comment why we have to replace RAC in a first place. -- To view, visit https://gerrit.osmocom.org/3750 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ie8a3107c22cd7f3682fac037e04a50ef3ea9171c Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Aug 31 08:11:16 2017 From: gerrit-no-reply at lists.osmocom.org (daniel) Date: Thu, 31 Aug 2017 08:11:16 +0000 Subject: [PATCH] pysim[master]: Support writing SMSP for sysmoUSIM-SJS1 Message-ID: Review at https://gerrit.osmocom.org/3751 Support writing SMSP for sysmoUSIM-SJS1 Change-Id: I6cbf69be3d410c18a509b98a63cb69bab74a528a --- M pySim/cards.py 1 file changed, 3 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/51/3751/1 diff --git a/pySim/cards.py b/pySim/cards.py index 925c5e6..9f678ab 100644 --- a/pySim/cards.py +++ b/pySim/cards.py @@ -459,6 +459,9 @@ # write EF.IMSI data, sw = self._scc.update_binary('6f07', enc_imsi(p['imsi'])) + # EF.SMSP + r = self._scc.select_file(['3f00', '7f10']) + data, sw = self._scc.update_record('6f42', 1, lpad(p['smsp'], 104), force_len=True) def erase(self): -- To view, visit https://gerrit.osmocom.org/3751 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I6cbf69be3d410c18a509b98a63cb69bab74a528a Gerrit-PatchSet: 1 Gerrit-Project: pysim Gerrit-Branch: master Gerrit-Owner: daniel From gerrit-no-reply at lists.osmocom.org Thu Aug 31 10:58:36 2017 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Thu, 31 Aug 2017 10:58:36 +0000 Subject: [PATCH] libosmocore[master]: Makefile.am: fix missing LTLDFLAGS for libosmocoding Message-ID: Review at https://gerrit.osmocom.org/3752 Makefile.am: fix missing LTLDFLAGS for libosmocoding Despite the libosmocoding.map is preset since the library release, one was not used in a proper way. The LTLDFLAGS were missing, so let's add them. Change-Id: Idf677825ff642d50bea43c7f970810783e864fdd --- M configure.ac M src/coding/Makefile.am 2 files changed, 2 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/52/3752/1 diff --git a/configure.ac b/configure.ac index 5821ad3..33c151e 100644 --- a/configure.ac +++ b/configure.ac @@ -51,6 +51,7 @@ esac AC_SUBST(LTLDFLAGS_OSMOGB) AC_SUBST(LTLDFLAGS_OSMOGSM) +AC_SUBST(LTLDFLAGS_OSMOCODING) dnl checks for header files AC_HEADER_STDC diff --git a/src/coding/Makefile.am b/src/coding/Makefile.am index 06e55e5..dcbbd8f 100644 --- a/src/coding/Makefile.am +++ b/src/coding/Makefile.am @@ -22,6 +22,7 @@ gsm0503_parity.c \ gsm0503_coding.c libosmocoding_la_LDFLAGS = \ + $(LTLDFLAGS_OSMOCODING) \ -version-info \ $(LIBVERSION) \ -no-undefined \ -- To view, visit https://gerrit.osmocom.org/3752 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Idf677825ff642d50bea43c7f970810783e864fdd Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy From gerrit-no-reply at lists.osmocom.org Thu Aug 31 11:06:31 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Thu, 31 Aug 2017 11:06:31 +0000 Subject: [PATCH] openbsc[master]: abis: fix unaligned memory access In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3750 to look at the new patch set (#2). abis: fix unaligned memory access * replace pointer arithmetic with struct use to prevent unaligned memory access on arm * remove redundant functions * constify function parameter Change-Id: Ie8a3107c22cd7f3682fac037e04a50ef3ea9171c Fixes: OS#2472 --- M openbsc/include/openbsc/abis_nm.h M openbsc/include/openbsc/gsm_data.h M openbsc/src/libbsc/abis_nm.c M openbsc/src/libbsc/bts_ipaccess_nanobts_omlattr.c M openbsc/src/libcommon/gsm_data.c 5 files changed, 15 insertions(+), 26 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/50/3750/2 diff --git a/openbsc/include/openbsc/abis_nm.h b/openbsc/include/openbsc/abis_nm.h index db2a659..658e2bb 100644 --- a/openbsc/include/openbsc/abis_nm.h +++ b/openbsc/include/openbsc/abis_nm.h @@ -157,7 +157,7 @@ uint8_t *attr, uint8_t attr_len); int abis_nm_ipaccess_rsl_connect(struct gsm_bts_trx *trx, uint32_t ip, uint16_t port, uint8_t stream); -void abis_nm_ipaccess_cgi(uint8_t *buf, struct gsm_bts *bts); +void abis_nm_ipaccess_cgi(uint8_t *buf, const struct gsm_bts *bts, bool rac_lac_override); int ipac_parse_bcch_info(struct ipac_bcch_info *binf, uint8_t *buf); const char *ipacc_testres_name(uint8_t res); diff --git a/openbsc/include/openbsc/gsm_data.h b/openbsc/include/openbsc/gsm_data.h index 4035b39..995ffea 100644 --- a/openbsc/include/openbsc/gsm_data.h +++ b/openbsc/include/openbsc/gsm_data.h @@ -558,8 +558,6 @@ const char *bts_gprs_mode_name(enum bts_gprs_mode mode); int bts_gprs_mode_is_compat(struct gsm_bts *bts, enum bts_gprs_mode mode); -int gsm48_ra_id_by_bts(uint8_t *buf, struct gsm_bts *bts); -void gprs_ra_id_by_bts(struct gprs_ra_id *raid, struct gsm_bts *bts); struct gsm_meas_rep *lchan_next_meas_rep(struct gsm_lchan *lchan); int gsm_btsmodel_set_feature(struct gsm_bts_model *model, enum gsm_bts_features feat); diff --git a/openbsc/src/libbsc/abis_nm.c b/openbsc/src/libbsc/abis_nm.c index cf20d7c..80e4183 100644 --- a/openbsc/src/libbsc/abis_nm.c +++ b/openbsc/src/libbsc/abis_nm.c @@ -2783,12 +2783,20 @@ attr, attr_len); } -void abis_nm_ipaccess_cgi(uint8_t *buf, struct gsm_bts *bts) +void abis_nm_ipaccess_cgi(uint8_t *buf, const struct gsm_bts *bts, bool rac_lac_override) { - /* we simply reuse the GSM48 function and overwrite the RAC - * with the Cell ID */ - gsm48_ra_id_by_bts(buf, bts); - *((uint16_t *)(buf + 5)) = htons(bts->cell_identity); + struct gprs_ra_id raid; + + raid.mcc = bts->network->country_code; + raid.mnc = bts->network->network_code; + raid.lac = bts->location_area_code; + raid.rac = bts->gprs.rac; + + gsm48_construct_ra(buf, &raid); + + /* FIXME: we try to overwrite the RAC (1 byte) with the Cell ID (2 bytes) so we also override part of LAC?! */ + if (rac_lac_override) + osmo_store16be(bts->cell_identity, buf + 5); } void gsm_trx_lock_rf(struct gsm_bts_trx *trx, int locked) diff --git a/openbsc/src/libbsc/bts_ipaccess_nanobts_omlattr.c b/openbsc/src/libbsc/bts_ipaccess_nanobts_omlattr.c index 473e1ca..42575a0 100644 --- a/openbsc/src/libbsc/bts_ipaccess_nanobts_omlattr.c +++ b/openbsc/src/libbsc/bts_ipaccess_nanobts_omlattr.c @@ -101,7 +101,7 @@ msgb_tv_put(msgb, NM_ATT_BSIC, bts->bsic); - abis_nm_ipaccess_cgi(buf, bts); + abis_nm_ipaccess_cgi(buf, bts, true); msgb_tl16v_put(msgb, NM_ATT_IPACC_CGI, 7, buf); return msgb; diff --git a/openbsc/src/libcommon/gsm_data.c b/openbsc/src/libcommon/gsm_data.c index f1049e9..f6e775b 100644 --- a/openbsc/src/libcommon/gsm_data.c +++ b/openbsc/src/libcommon/gsm_data.c @@ -335,23 +335,6 @@ return bts; } -void gprs_ra_id_by_bts(struct gprs_ra_id *raid, struct gsm_bts *bts) -{ - raid->mcc = bts->network->country_code; - raid->mnc = bts->network->network_code; - raid->lac = bts->location_area_code; - raid->rac = bts->gprs.rac; -} - -int gsm48_ra_id_by_bts(uint8_t *buf, struct gsm_bts *bts) -{ - struct gprs_ra_id raid; - - gprs_ra_id_by_bts(&raid, bts); - - return gsm48_construct_ra(buf, &raid); -} - int gsm_parse_reg(void *ctx, regex_t *reg, char **str, int argc, const char **argv) { int ret; -- To view, visit https://gerrit.osmocom.org/3750 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ie8a3107c22cd7f3682fac037e04a50ef3ea9171c Gerrit-PatchSet: 2 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max From gerrit-no-reply at lists.osmocom.org Thu Aug 31 11:10:10 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Thu, 31 Aug 2017 11:10:10 +0000 Subject: [PATCH] openbsc[master]: abis: fix unaligned memory access In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3750 to look at the new patch set (#3). abis: fix unaligned memory access * replace pointer arithmetic and direct assignment with struct modification and function call to prevent unaligned memory access on arm * remove redundant functions * constify function parameter Change-Id: Ie8a3107c22cd7f3682fac037e04a50ef3ea9171c Fixes: OS#2472 --- M openbsc/include/openbsc/abis_nm.h M openbsc/include/openbsc/gsm_data.h M openbsc/src/libbsc/abis_nm.c M openbsc/src/libbsc/bts_ipaccess_nanobts_omlattr.c M openbsc/src/libcommon/gsm_data.c 5 files changed, 15 insertions(+), 26 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/50/3750/3 diff --git a/openbsc/include/openbsc/abis_nm.h b/openbsc/include/openbsc/abis_nm.h index db2a659..658e2bb 100644 --- a/openbsc/include/openbsc/abis_nm.h +++ b/openbsc/include/openbsc/abis_nm.h @@ -157,7 +157,7 @@ uint8_t *attr, uint8_t attr_len); int abis_nm_ipaccess_rsl_connect(struct gsm_bts_trx *trx, uint32_t ip, uint16_t port, uint8_t stream); -void abis_nm_ipaccess_cgi(uint8_t *buf, struct gsm_bts *bts); +void abis_nm_ipaccess_cgi(uint8_t *buf, const struct gsm_bts *bts, bool rac_lac_override); int ipac_parse_bcch_info(struct ipac_bcch_info *binf, uint8_t *buf); const char *ipacc_testres_name(uint8_t res); diff --git a/openbsc/include/openbsc/gsm_data.h b/openbsc/include/openbsc/gsm_data.h index 4035b39..995ffea 100644 --- a/openbsc/include/openbsc/gsm_data.h +++ b/openbsc/include/openbsc/gsm_data.h @@ -558,8 +558,6 @@ const char *bts_gprs_mode_name(enum bts_gprs_mode mode); int bts_gprs_mode_is_compat(struct gsm_bts *bts, enum bts_gprs_mode mode); -int gsm48_ra_id_by_bts(uint8_t *buf, struct gsm_bts *bts); -void gprs_ra_id_by_bts(struct gprs_ra_id *raid, struct gsm_bts *bts); struct gsm_meas_rep *lchan_next_meas_rep(struct gsm_lchan *lchan); int gsm_btsmodel_set_feature(struct gsm_bts_model *model, enum gsm_bts_features feat); diff --git a/openbsc/src/libbsc/abis_nm.c b/openbsc/src/libbsc/abis_nm.c index cf20d7c..80e4183 100644 --- a/openbsc/src/libbsc/abis_nm.c +++ b/openbsc/src/libbsc/abis_nm.c @@ -2783,12 +2783,20 @@ attr, attr_len); } -void abis_nm_ipaccess_cgi(uint8_t *buf, struct gsm_bts *bts) +void abis_nm_ipaccess_cgi(uint8_t *buf, const struct gsm_bts *bts, bool rac_lac_override) { - /* we simply reuse the GSM48 function and overwrite the RAC - * with the Cell ID */ - gsm48_ra_id_by_bts(buf, bts); - *((uint16_t *)(buf + 5)) = htons(bts->cell_identity); + struct gprs_ra_id raid; + + raid.mcc = bts->network->country_code; + raid.mnc = bts->network->network_code; + raid.lac = bts->location_area_code; + raid.rac = bts->gprs.rac; + + gsm48_construct_ra(buf, &raid); + + /* FIXME: we try to overwrite the RAC (1 byte) with the Cell ID (2 bytes) so we also override part of LAC?! */ + if (rac_lac_override) + osmo_store16be(bts->cell_identity, buf + 5); } void gsm_trx_lock_rf(struct gsm_bts_trx *trx, int locked) diff --git a/openbsc/src/libbsc/bts_ipaccess_nanobts_omlattr.c b/openbsc/src/libbsc/bts_ipaccess_nanobts_omlattr.c index 473e1ca..42575a0 100644 --- a/openbsc/src/libbsc/bts_ipaccess_nanobts_omlattr.c +++ b/openbsc/src/libbsc/bts_ipaccess_nanobts_omlattr.c @@ -101,7 +101,7 @@ msgb_tv_put(msgb, NM_ATT_BSIC, bts->bsic); - abis_nm_ipaccess_cgi(buf, bts); + abis_nm_ipaccess_cgi(buf, bts, true); msgb_tl16v_put(msgb, NM_ATT_IPACC_CGI, 7, buf); return msgb; diff --git a/openbsc/src/libcommon/gsm_data.c b/openbsc/src/libcommon/gsm_data.c index f1049e9..f6e775b 100644 --- a/openbsc/src/libcommon/gsm_data.c +++ b/openbsc/src/libcommon/gsm_data.c @@ -335,23 +335,6 @@ return bts; } -void gprs_ra_id_by_bts(struct gprs_ra_id *raid, struct gsm_bts *bts) -{ - raid->mcc = bts->network->country_code; - raid->mnc = bts->network->network_code; - raid->lac = bts->location_area_code; - raid->rac = bts->gprs.rac; -} - -int gsm48_ra_id_by_bts(uint8_t *buf, struct gsm_bts *bts) -{ - struct gprs_ra_id raid; - - gprs_ra_id_by_bts(&raid, bts); - - return gsm48_construct_ra(buf, &raid); -} - int gsm_parse_reg(void *ctx, regex_t *reg, char **str, int argc, const char **argv) { int ret; -- To view, visit https://gerrit.osmocom.org/3750 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ie8a3107c22cd7f3682fac037e04a50ef3ea9171c Gerrit-PatchSet: 3 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max From gerrit-no-reply at lists.osmocom.org Thu Aug 31 11:13:03 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Thu, 31 Aug 2017 11:13:03 +0000 Subject: libosmocore[master]: Makefile.am: fix missing LTLDFLAGS for libosmocoding In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/3752 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Idf677825ff642d50bea43c7f970810783e864fdd Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Aug 31 12:49:29 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Thu, 31 Aug 2017 12:49:29 +0000 Subject: [PATCH] osmo-pcu[master]: Support receiving SI13 from BTS Message-ID: Review at https://gerrit.osmocom.org/3753 Support receiving SI13 from BTS * store SI13 in BTS struct * check and handle BCCH SAPI * bundle direct-phy related code together to simplify modifications Change-Id: I610a93ce23725b182ec14e3507331295bd542f74 Related: OS#2400 --- M src/bts.h M src/pcu_l1_if.cpp M src/pcu_main.cpp M src/pcu_vty.h 4 files changed, 34 insertions(+), 12 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/53/3753/1 diff --git a/src/bts.h b/src/bts.h index b1fb8cc..d65cd2f 100644 --- a/src/bts.h +++ b/src/bts.h @@ -29,6 +29,7 @@ #include #include #include +#include } #include "poll_controller.h" @@ -212,7 +213,8 @@ uint8_t alpha, gamma; uint8_t egprs_enabled; uint32_t dl_tbf_idle_msec; /* hold time for idle DL TBFs */ - + uint8_t si13[GSM_MACBLOCK_LEN]; + bool si13_is_set; /* 0 to support resegmentation in DL, 1 for no reseg */ uint8_t dl_arq_type; diff --git a/src/pcu_l1_if.cpp b/src/pcu_l1_if.cpp index 50e181e..6d94850 100644 --- a/src/pcu_l1_if.cpp +++ b/src/pcu_l1_if.cpp @@ -163,9 +163,9 @@ void pcu_l1if_tx_pdtch(msgb *msg, uint8_t trx, uint8_t ts, uint16_t arfcn, uint32_t fn, uint8_t block_nr) { +#ifdef ENABLE_DIRECT_PHY struct gprs_rlcmac_bts *bts = bts_main_data(); -#ifdef ENABLE_DIRECT_PHY if (bts->trx[trx].fl1h) { l1if_pdch_req(bts->trx[trx].fl1h, ts, 0, fn, arfcn, block_nr, msg->data, msg->len); @@ -245,21 +245,27 @@ return pdch->rcv_block(data, len, fn, meas); } +static int pcu_rx_data_ind_bcch(uint8_t *data, uint8_t len) +{ + struct gprs_rlcmac_bts *bts = bts_main_data(); + + if (len != GSM_MACBLOCK_LEN) { + LOGP(DL1IF, LOGL_ERROR, "Received PCU data indication with SI13 with unexpected length %u\n", len); + return -EINVAL; + } + + memcpy(bts->si13, data, GSM_MACBLOCK_LEN); + bts->si13_is_set = true; + + return 0; +} + static int pcu_rx_data_ind(struct gsm_pcu_if_data *data_ind) { struct gprs_rlcmac_bts *bts = bts_main_data(); int rc; pcu_l1_meas meas; - meas.set_rssi(data_ind->rssi); -#ifndef ENABLE_DIRECT_PHY - /* convert BER to % value */ - meas.set_ber(data_ind->ber10k / 100); - meas.set_bto(data_ind->ta_offs_qbits); - meas.set_link_qual(data_ind->lqual_cb / 10); - LOGP(DL1IF, LOGL_DEBUG, "Data indication with raw measurements " - "received: BER10k = %d, BTO = %d, Q = %d\n", data_ind->ber10k, - data_ind->ta_offs_qbits, data_ind->lqual_cb); -#endif + LOGP(DL1IF, LOGL_DEBUG, "Data indication received: sapi=%d arfcn=%d " "block=%d data=%s\n", data_ind->sapi, data_ind->arfcn, data_ind->block_nr, @@ -267,10 +273,22 @@ switch (data_ind->sapi) { case PCU_IF_SAPI_PDTCH: + meas.set_rssi(data_ind->rssi); +#ifndef ENABLE_DIRECT_PHY + /* convert BER to % value */ + meas.set_ber(data_ind->ber10k / 100); + meas.set_bto(data_ind->ta_offs_qbits); + meas.set_link_qual(data_ind->lqual_cb / 10); + LOGP(DL1IF, LOGL_DEBUG, "Data indication with raw measurements received: BER10k = %d, BTO = %d, Q = %d\n", + data_ind->ber10k, data_ind->ta_offs_qbits, data_ind->lqual_cb); +#endif rc = pcu_rx_data_ind_pdtch(data_ind->trx_nr, data_ind->ts_nr, data_ind->data, data_ind->len, data_ind->fn, &meas); break; + case PCU_IF_SAPI_BCCH: + rc = pcu_rx_data_ind_bcch(data_ind->data, data_ind->len); + break; default: LOGP(DL1IF, LOGL_ERROR, "Received PCU data indication with " "unsupported sapi %d\n", data_ind->sapi); diff --git a/src/pcu_main.cpp b/src/pcu_main.cpp index e909b75..b7574f9 100644 --- a/src/pcu_main.cpp +++ b/src/pcu_main.cpp @@ -183,6 +183,7 @@ bts->n3103 = 4; bts->n3105 = 8; bts->alpha = 0; /* a = 0.0 */ + bts->si13_is_set = false; bts->ms_idle_sec = 60; /* slightly above T3314 (default 44s, 24.008, 11.2.2) */ bts->cs_adj_enabled = 1; bts->cs_adj_upper_limit = 33; /* Decrease CS if the error rate is above */ diff --git a/src/pcu_vty.h b/src/pcu_vty.h index c00b882..a075350 100644 --- a/src/pcu_vty.h +++ b/src/pcu_vty.h @@ -1,6 +1,7 @@ #ifndef _PCU_VTY_H #define _PCU_VTY_H +#include #include #include -- To view, visit https://gerrit.osmocom.org/3753 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I610a93ce23725b182ec14e3507331295bd542f74 Gerrit-PatchSet: 1 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Thu Aug 31 12:50:04 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Thu, 31 Aug 2017 12:50:04 +0000 Subject: [PATCH] osmo-bts[master]: Support sending SI13 to PCU Message-ID: Review at https://gerrit.osmocom.org/3754 Support sending SI13 to PCU * explicitly set SAPI when sending data_ind to PCU * drop unused receiving code for BCCH SAPI * send SI13 when PCU is connected * send SI13 when new SI is received Change-Id: I9e83ef792585aa962f99897d9973cef12f186bcf Related: OS#2400 --- M include/osmo-bts/pcu_if.h M src/common/l1sap.c M src/common/pcu_sock.c M src/common/rsl.c 4 files changed, 32 insertions(+), 17 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/54/3754/1 diff --git a/include/osmo-bts/pcu_if.h b/include/osmo-bts/pcu_if.h index a020c05..ba3873e 100644 --- a/include/osmo-bts/pcu_if.h +++ b/include/osmo-bts/pcu_if.h @@ -6,6 +6,7 @@ extern int pcu_direct; int pcu_tx_info_ind(void); +int pcu_tx_si13(const struct gsm_bts *bts); int pcu_tx_rts_req(struct gsm_bts_trx_ts *ts, uint8_t is_ptcch, uint32_t fn, uint16_t arfcn, uint8_t block_nr); int pcu_tx_data_ind(struct gsm_bts_trx_ts *ts, uint8_t is_ptcch, uint32_t fn, diff --git a/src/common/l1sap.c b/src/common/l1sap.c index 21d9dc6..1b3a3ad 100644 --- a/src/common/l1sap.c +++ b/src/common/l1sap.c @@ -52,6 +52,7 @@ #include #include #include +#include struct gsm_lchan *get_lchan_by_chan_nr(struct gsm_bts_trx *trx, unsigned int chan_nr) @@ -1013,7 +1014,7 @@ if (len == 0) return -EINVAL; if (L1SAP_IS_PTCCH(fn)) { - pcu_tx_data_ind(&trx->ts[tn], 1, fn, + pcu_tx_data_ind(&trx->ts[tn], PCU_IF_SAPI_PTCCH, fn, 0 /* ARFCN */, L1SAP_FN2PTCCHBLOCK(fn), data, len, rssi, data_ind->ber10k, data_ind->ta_offs_qbits, @@ -1023,7 +1024,7 @@ if (pr_info != PRES_INFO_BOTH) return 0; /* PDTCH / PACCH frame handling */ - pcu_tx_data_ind(&trx->ts[tn], 0, fn, 0 /* ARFCN */, + pcu_tx_data_ind(&trx->ts[tn], PCU_IF_SAPI_PDTCH, fn, 0 /* ARFCN */, L1SAP_FN2MACBLOCK(fn), data, len, rssi, data_ind->ber10k, data_ind->ta_offs_qbits, data_ind->lqual_cb); } diff --git a/src/common/pcu_sock.c b/src/common/pcu_sock.c index a4ddc05..0a9ba2d 100644 --- a/src/common/pcu_sock.c +++ b/src/common/pcu_sock.c @@ -322,7 +322,7 @@ return pcu_sock_send(&bts_gsmnet, msg); } -int pcu_tx_data_ind(struct gsm_bts_trx_ts *ts, uint8_t is_ptcch, uint32_t fn, +int pcu_tx_data_ind(struct gsm_bts_trx_ts *ts, uint8_t sapi, uint32_t fn, uint16_t arfcn, uint8_t block_nr, uint8_t *data, uint8_t len, int8_t rssi, uint16_t ber10k, int16_t bto, int16_t lqual) { @@ -332,9 +332,8 @@ struct gsm_bts *bts = ts->trx->bts; struct gsm_bts_role_bts *btsb = bts_role_bts(bts); - LOGP(DPCU, LOGL_DEBUG, "Sending data indication: is_ptcch=%d arfcn=%d " - "block=%d data=%s\n", is_ptcch, arfcn, block_nr, - osmo_hexdump(data, len)); + LOGP(DPCU, LOGL_DEBUG, "Sending data indication: sapi=%s arfcn=%d block=%d data=%s\n", + sapi_string[sapi], arfcn, block_nr, osmo_hexdump(data, len)); if (lqual / 10 < btsb->min_qual_norm) { LOGP(DPCU, LOGL_DEBUG, "Link quality %"PRId16" is below threshold %f, dropping packet\n", @@ -348,7 +347,7 @@ pcu_prim = (struct gsm_pcu_if *) msg->data; data_ind = &pcu_prim->u.data_ind; - data_ind->sapi = (is_ptcch) ? PCU_IF_SAPI_PTCCH : PCU_IF_SAPI_PDTCH; + data_ind->sapi = sapi; data_ind->rssi = rssi; data_ind->fn = fn; data_ind->arfcn = arfcn; @@ -488,16 +487,6 @@ osmo_hexdump(data_req->data, data_req->len)); switch (data_req->sapi) { - case PCU_IF_SAPI_BCCH: - if (data_req->len == 23) { - bts->si_valid |= (1 << SYSINFO_TYPE_13); - memcpy(bts->si_buf[SYSINFO_TYPE_13], data_req->data, - data_req->len); - } else { - bts->si_valid &= ~(1 << SYSINFO_TYPE_13); - } - osmo_signal_dispatch(SS_GLOBAL, S_NEW_SYSINFO, bts); - break; case PCU_IF_SAPI_PCH: if (msg_type == PCU_IF_MSG_PAG_REQ) { /* FIXME: Add function to schedule paging request. @@ -546,6 +535,21 @@ return rc; } +int pcu_tx_si13(const struct gsm_bts *bts) +{ + /* the SI is per-BTS so it doesn't matter which TRX we use */ + struct gsm_bts_trx *trx = gsm_bts_trx_num(bts, 0); + + /* The low-level data like FN, ARFCN etc will be ignored but we have to set lqual high enough to bypass + the check at lower levels */ + int rc = pcu_tx_data_ind(&trx->ts[0], PCU_IF_SAPI_BCCH, 0, 0, 0, GSM_BTS_SI(bts, SYSINFO_TYPE_13), + GSM_MACBLOCK_LEN, 0, 0, 0, INT16_MAX); + if (rc < 0) + LOGP(DPCU, LOGL_NOTICE, "Failed to send SI13 to PCU: %d\n", rc); + + return rc; +} + static int pcu_rx_txt_ind(struct gsm_bts *bts, struct gsm_pcu_if_txt_ind *txt) { @@ -555,6 +559,11 @@ txt->text); osmo_signal_dispatch(SS_FAIL, OSMO_EVT_PCU_VERS, txt->text); osmo_strlcpy(bts->pcu_version, txt->text, MAX_VERSION_LENGTH); + + if (GSM_BTS_HAS_SI(bts, SYSINFO_TYPE_13)) + return pcu_tx_si13(bts); + else + LOGP(DPCU, LOGL_INFO, "SI13 is not available on PCU connection\n"); break; case PCU_OML_ALERT: osmo_signal_dispatch(SS_FAIL, OSMO_EVT_EXT_ALARM, txt->text); diff --git a/src/common/rsl.c b/src/common/rsl.c index dc176ea..69ecf2e 100644 --- a/src/common/rsl.c +++ b/src/common/rsl.c @@ -50,6 +50,7 @@ #include #include #include +#include //#define FAKE_CIPH_MODE_COMPL @@ -306,6 +307,9 @@ LCHAN_REL_ACT_REACT; } + if (SYSINFO_TYPE_13 == osmo_si) + pcu_tx_si13(trx->bts); + if (SYSINFO_TYPE_2quater == osmo_si) { si2q = (struct gsm48_system_information_type_2quater *) TLVP_VAL(&tp, RSL_IE_FULL_BCCH_INFO); bv.data = si2q->rest_octets; -- To view, visit https://gerrit.osmocom.org/3754 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I9e83ef792585aa962f99897d9973cef12f186bcf Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Thu Aug 31 13:44:14 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Thu, 31 Aug 2017 13:44:14 +0000 Subject: [PATCH] osmo-pcu[master]: Move gsmtap and accounting into separate function Message-ID: Review at https://gerrit.osmocom.org/3755 Move gsmtap and accounting into separate function Change-Id: I3609da1850244f25bd4611c9d25795ca379d6325 --- M src/gprs_rlcmac_sched.cpp 1 file changed, 31 insertions(+), 13 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/55/3755/1 diff --git a/src/gprs_rlcmac_sched.cpp b/src/gprs_rlcmac_sched.cpp index 42f0308..e059ae1 100644 --- a/src/gprs_rlcmac_sched.cpp +++ b/src/gprs_rlcmac_sched.cpp @@ -307,6 +307,34 @@ return msg; } +static inline void tap_n_acc(const struct msgb *msg, const struct gprs_rlcmac_bts *bts, uint8_t trx, uint8_t ts, + uint32_t fn, enum pcu_gsmtap_category cat) +{ + if (!msg) + return; + + switch(cat) { + case PCU_GSMTAP_C_DL_CTRL: + bts->bts->rlc_sent_control(); + bts->bts->send_gsmtap(PCU_GSMTAP_C_DL_CTRL, false, trx, ts, GSMTAP_CHANNEL_PACCH, fn, msg->data, + msg->len); + break; + case PCU_GSMTAP_C_DL_DATA_GPRS: + bts->bts->rlc_sent(); + /* FIXME: distinguish between GPRS and EGPRS */ + bts->bts->send_gsmtap(PCU_GSMTAP_C_DL_DATA_GPRS, false, trx, ts, GSMTAP_CHANNEL_PDTCH, fn, msg->data, + msg->len); + break; + case PCU_GSMTAP_C_DL_DUMMY: + bts->bts->rlc_sent_dummy(); + bts->bts->send_gsmtap(PCU_GSMTAP_C_DL_DUMMY, false, trx, ts, GSMTAP_CHANNEL_PACCH, fn, msg->data, + msg->len); + break; + default: + break; + } +} + int gprs_rlcmac_rcv_rts_block(struct gprs_rlcmac_bts *bts, uint8_t trx, uint8_t ts, uint32_t fn, uint8_t block_nr) @@ -356,29 +384,19 @@ /* Prio 1: select control message */ msg = sched_select_ctrl_msg(trx, ts, fn, block_nr, pdch, ul_ass_tbf, dl_ass_tbf, ul_ack_tbf); - if (msg) { - bts->bts->rlc_sent_control(); - bts->bts->send_gsmtap(PCU_GSMTAP_C_DL_CTRL, false, trx, ts, GSMTAP_CHANNEL_PACCH, fn, msg->data, msg->len); - } + tap_n_acc(msg, bts, trx, ts, fn, PCU_GSMTAP_C_DL_CTRL); /* Prio 2: select data message for downlink */ if (!msg) { msg = sched_select_downlink(bts, trx, ts, fn, block_nr, pdch); - if (msg) { - bts->bts->rlc_sent(); - /* FIXME: distinguish between GPRS and EGPRS */ - bts->bts->send_gsmtap(PCU_GSMTAP_C_DL_DATA_GPRS, false, trx, ts, GSMTAP_CHANNEL_PDTCH, fn, msg->data, msg->len); - } + tap_n_acc(msg, bts, trx, ts, fn, PCU_GSMTAP_C_DL_DATA_GPRS); } /* Prio 3: send dummy contol message */ if (!msg) { /* increase counter */ msg = sched_dummy(); - if (msg) { - bts->bts->rlc_sent_dummy(); - bts->bts->send_gsmtap(PCU_GSMTAP_C_DL_DUMMY, false, trx, ts, GSMTAP_CHANNEL_PACCH, fn, msg->data, msg->len); - } + tap_n_acc(msg, bts, trx, ts, fn, PCU_GSMTAP_C_DL_DUMMY); } if (!msg) -- To view, visit https://gerrit.osmocom.org/3755 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I3609da1850244f25bd4611c9d25795ca379d6325 Gerrit-PatchSet: 1 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Thu Aug 31 13:50:06 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Thu, 31 Aug 2017 13:50:06 +0000 Subject: [PATCH] osmo-pcu[master]: Support receiving SI13 from BTS In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3753 to look at the new patch set (#2). Support receiving SI13 from BTS * store SI13 in BTS struct * check and handle BCCH SAPI * bundle direct-phy related code together to simplify modifications Change-Id: I610a93ce23725b182ec14e3507331295bd542f74 Related: OS#2400 --- M src/bts.h M src/osmo-bts-litecell15/lc15_l1_if.c M src/osmo-bts-sysmo/sysmo_l1_if.c M src/pcu_l1_if.cpp M src/pcu_main.cpp M src/pcu_vty.h 6 files changed, 38 insertions(+), 12 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/53/3753/2 diff --git a/src/bts.h b/src/bts.h index b1fb8cc..d65cd2f 100644 --- a/src/bts.h +++ b/src/bts.h @@ -29,6 +29,7 @@ #include #include #include +#include } #include "poll_controller.h" @@ -212,7 +213,8 @@ uint8_t alpha, gamma; uint8_t egprs_enabled; uint32_t dl_tbf_idle_msec; /* hold time for idle DL TBFs */ - + uint8_t si13[GSM_MACBLOCK_LEN]; + bool si13_is_set; /* 0 to support resegmentation in DL, 1 for no reseg */ uint8_t dl_arq_type; diff --git a/src/osmo-bts-litecell15/lc15_l1_if.c b/src/osmo-bts-litecell15/lc15_l1_if.c index c82ddba..37b7f78 100644 --- a/src/osmo-bts-litecell15/lc15_l1_if.c +++ b/src/osmo-bts-litecell15/lc15_l1_if.c @@ -29,6 +29,8 @@ #include #include #include +#include + #include #include #include diff --git a/src/osmo-bts-sysmo/sysmo_l1_if.c b/src/osmo-bts-sysmo/sysmo_l1_if.c index 9170972..1c5ecc9 100644 --- a/src/osmo-bts-sysmo/sysmo_l1_if.c +++ b/src/osmo-bts-sysmo/sysmo_l1_if.c @@ -10,6 +10,8 @@ #include #include #include +#include + #include #include #include diff --git a/src/pcu_l1_if.cpp b/src/pcu_l1_if.cpp index 50e181e..6d94850 100644 --- a/src/pcu_l1_if.cpp +++ b/src/pcu_l1_if.cpp @@ -163,9 +163,9 @@ void pcu_l1if_tx_pdtch(msgb *msg, uint8_t trx, uint8_t ts, uint16_t arfcn, uint32_t fn, uint8_t block_nr) { +#ifdef ENABLE_DIRECT_PHY struct gprs_rlcmac_bts *bts = bts_main_data(); -#ifdef ENABLE_DIRECT_PHY if (bts->trx[trx].fl1h) { l1if_pdch_req(bts->trx[trx].fl1h, ts, 0, fn, arfcn, block_nr, msg->data, msg->len); @@ -245,21 +245,27 @@ return pdch->rcv_block(data, len, fn, meas); } +static int pcu_rx_data_ind_bcch(uint8_t *data, uint8_t len) +{ + struct gprs_rlcmac_bts *bts = bts_main_data(); + + if (len != GSM_MACBLOCK_LEN) { + LOGP(DL1IF, LOGL_ERROR, "Received PCU data indication with SI13 with unexpected length %u\n", len); + return -EINVAL; + } + + memcpy(bts->si13, data, GSM_MACBLOCK_LEN); + bts->si13_is_set = true; + + return 0; +} + static int pcu_rx_data_ind(struct gsm_pcu_if_data *data_ind) { struct gprs_rlcmac_bts *bts = bts_main_data(); int rc; pcu_l1_meas meas; - meas.set_rssi(data_ind->rssi); -#ifndef ENABLE_DIRECT_PHY - /* convert BER to % value */ - meas.set_ber(data_ind->ber10k / 100); - meas.set_bto(data_ind->ta_offs_qbits); - meas.set_link_qual(data_ind->lqual_cb / 10); - LOGP(DL1IF, LOGL_DEBUG, "Data indication with raw measurements " - "received: BER10k = %d, BTO = %d, Q = %d\n", data_ind->ber10k, - data_ind->ta_offs_qbits, data_ind->lqual_cb); -#endif + LOGP(DL1IF, LOGL_DEBUG, "Data indication received: sapi=%d arfcn=%d " "block=%d data=%s\n", data_ind->sapi, data_ind->arfcn, data_ind->block_nr, @@ -267,10 +273,22 @@ switch (data_ind->sapi) { case PCU_IF_SAPI_PDTCH: + meas.set_rssi(data_ind->rssi); +#ifndef ENABLE_DIRECT_PHY + /* convert BER to % value */ + meas.set_ber(data_ind->ber10k / 100); + meas.set_bto(data_ind->ta_offs_qbits); + meas.set_link_qual(data_ind->lqual_cb / 10); + LOGP(DL1IF, LOGL_DEBUG, "Data indication with raw measurements received: BER10k = %d, BTO = %d, Q = %d\n", + data_ind->ber10k, data_ind->ta_offs_qbits, data_ind->lqual_cb); +#endif rc = pcu_rx_data_ind_pdtch(data_ind->trx_nr, data_ind->ts_nr, data_ind->data, data_ind->len, data_ind->fn, &meas); break; + case PCU_IF_SAPI_BCCH: + rc = pcu_rx_data_ind_bcch(data_ind->data, data_ind->len); + break; default: LOGP(DL1IF, LOGL_ERROR, "Received PCU data indication with " "unsupported sapi %d\n", data_ind->sapi); diff --git a/src/pcu_main.cpp b/src/pcu_main.cpp index e909b75..b7574f9 100644 --- a/src/pcu_main.cpp +++ b/src/pcu_main.cpp @@ -183,6 +183,7 @@ bts->n3103 = 4; bts->n3105 = 8; bts->alpha = 0; /* a = 0.0 */ + bts->si13_is_set = false; bts->ms_idle_sec = 60; /* slightly above T3314 (default 44s, 24.008, 11.2.2) */ bts->cs_adj_enabled = 1; bts->cs_adj_upper_limit = 33; /* Decrease CS if the error rate is above */ diff --git a/src/pcu_vty.h b/src/pcu_vty.h index c00b882..a075350 100644 --- a/src/pcu_vty.h +++ b/src/pcu_vty.h @@ -1,6 +1,7 @@ #ifndef _PCU_VTY_H #define _PCU_VTY_H +#include #include #include -- To view, visit https://gerrit.osmocom.org/3753 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I610a93ce23725b182ec14e3507331295bd542f74 Gerrit-PatchSet: 2 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Thu Aug 31 14:16:23 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Thu, 31 Aug 2017 14:16:23 +0000 Subject: [PATCH] osmo-bts[master]: trx: avoid deactivating lchan on LCHAN_REL_ACT_REACT 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/3067 to look at the new patch set (#6). trx: avoid deactivating lchan on LCHAN_REL_ACT_REACT * do not deactivate lchan when called with LCHAN_REL_ACT_REACT * add fixme comment It's unclear yet if any special steps are required for osmo-bts-trx so let's just make it compatible with setups [1] using BS_AG_BLKS_RES != 1 for now. Background: CCCH is auto activated by some OsmoBTS - before we receive SI3, see 4a8582846281322e8d7dfc577b18767cf35c24d1. To accommodate for that we deactivate CCCH in common/rsl.c, which triggers BTS-model specific callback sapi_deactivate_cb() which updates parameters and activates it again. In case of osmo-bts-trx there is no auto-activation and (seems to be) no need in special interaction with hw to activate channel (no lchan_activate()) hence we can just skip entire deactivate/setup/activate again routine. [1] "channel-descrption bs-ag-blks-res N" in OpenBSC config file. Related: OS#1575 Change-Id: I20b89ba1e43d1414180b083cd1e085eeffe5d513 --- M include/osmo-bts/rsl.h M src/osmo-bts-trx/l1_if.c 2 files changed, 7 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/67/3067/6 diff --git a/include/osmo-bts/rsl.h b/include/osmo-bts/rsl.h index d5d0f1a..ddd756e 100644 --- a/include/osmo-bts/rsl.h +++ b/include/osmo-bts/rsl.h @@ -9,7 +9,7 @@ LCHAN_REL_ACT_RSL, LCHAN_REL_ACT_PCU, LCHAN_REL_ACT_OML, - LCHAN_REL_ACT_REACT, + LCHAN_REL_ACT_REACT, /* remove once auto-activation hack is removed from opstart_compl() */ }; #define LCHAN_FN_DUMMY 0xFFFFFFFF diff --git a/src/osmo-bts-trx/l1_if.c b/src/osmo-bts-trx/l1_if.c index c629a61..3c11dfd 100644 --- a/src/osmo-bts-trx/l1_if.c +++ b/src/osmo-bts-trx/l1_if.c @@ -109,6 +109,12 @@ struct phy_instance *pinst = trx_phy_instance(lchan->ts->trx); struct trx_l1h *l1h = pinst->u.osmotrx.hdl; + if (lchan->rel_act_kind == LCHAN_REL_ACT_REACT) { + lchan->rel_act_kind = LCHAN_REL_ACT_RSL; + /* FIXME: perform whatever is needed (if any) to set proper PCH/AGCH allocation according to + 3GPP TS 44.018 Table 10.5.2.11.1 using num_agch(lchan->ts->trx, "TRX L1"); function */ + return 0; + } /* set lchan inactive */ lchan_set_state(lchan, LCHAN_S_NONE); -- To view, visit https://gerrit.osmocom.org/3067 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I20b89ba1e43d1414180b083cd1e085eeffe5d513 Gerrit-PatchSet: 6 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Alexander Chemeris Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Ivan Kluchnikov Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Tom Tsou From gerrit-no-reply at lists.osmocom.org Thu Aug 31 14:21:20 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Thu, 31 Aug 2017 14:21:20 +0000 Subject: osmo-bts[master]: trx: avoid deactivating lchan on LCHAN_REL_ACT_REACT In-Reply-To: References: Message-ID: Patch Set 6: The problem is that -oct, -lc15, -sysmo activate CCCH automatically in opstart_compl() before receiving SI3. As far as I understood it just a hack due to lack of proper FSM-based implementation of OML. The LCHAN_REL_ACT_REACT and activation/deactivation was introduced specifically to workaround this hack. The idea is that it'll be removed eventually - when OML is re-written based on osmo_fsm and we do not need auto-activation hack anymore. -- To view, visit https://gerrit.osmocom.org/3067 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I20b89ba1e43d1414180b083cd1e085eeffe5d513 Gerrit-PatchSet: 6 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Alexander Chemeris Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Ivan Kluchnikov Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Tom Tsou Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Aug 31 14:25:10 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 31 Aug 2017 14:25:10 +0000 Subject: osmo-gsm-manuals[master]: Allow easily disabling GFDL references In-Reply-To: References: Message-ID: Patch Set 1: (1 comment) https://gerrit.osmocom.org/#/c/3736/1/OsmoPCU/osmopcu-usermanual.adoc File OsmoPCU/osmopcu-usermanual.adoc: Line 28: ifdef::gfdl-enabled[] why do we need this? If we build a complete Osmocom manual, it will always be under GFDL. -- To view, visit https://gerrit.osmocom.org/3736 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I2489726ad2e90301bceadfada926e31ae0f85986 Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Thu Aug 31 14:34:24 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 31 Aug 2017 14:34:24 +0000 Subject: [PATCH] osmo-gsm-manuals[master]: Allow easily disabling GFDL references In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3736 to look at the new patch set (#2). Allow easily disabling GFDL references All parts referencing GFDL can be easily disabled by removing the 'gfdl-enabled' attribute from the document. Change-Id: I2489726ad2e90301bceadfada926e31ae0f85986 --- M OsmoBSC/osmobsc-usermanual.adoc M OsmoBTS/osmobts-abis.adoc M OsmoBTS/osmobts-usermanual.adoc M OsmoNITB/osmonitb-usermanual.adoc M OsmoPCU/osmopcu-gb.adoc M OsmoPCU/osmopcu-usermanual.adoc M OsmoSGSN/osmosgsn-usermanual.adoc M common/chapters/glossary.adoc M common/chapters/preface.adoc 9 files changed, 19 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-manuals refs/changes/36/3736/2 diff --git a/OsmoBSC/osmobsc-usermanual.adoc b/OsmoBSC/osmobsc-usermanual.adoc index 9323373..b455897 100644 --- a/OsmoBSC/osmobsc-usermanual.adoc +++ b/OsmoBSC/osmobsc-usermanual.adoc @@ -1,3 +1,5 @@ +:gfdl-enabled: + OsmoBSC User Manual =================== Harald Welte diff --git a/OsmoBTS/osmobts-abis.adoc b/OsmoBTS/osmobts-abis.adoc index 930cbfb..1e02414 100644 --- a/OsmoBTS/osmobts-abis.adoc +++ b/OsmoBTS/osmobts-abis.adoc @@ -1,3 +1,5 @@ +:gfdl-enabled: + OsmoBTS Abis Protocol Specification =================================== Neels Hofmeyr diff --git a/OsmoBTS/osmobts-usermanual.adoc b/OsmoBTS/osmobts-usermanual.adoc index 4d47b1c..d746d85 100644 --- a/OsmoBTS/osmobts-usermanual.adoc +++ b/OsmoBTS/osmobts-usermanual.adoc @@ -1,3 +1,5 @@ +:gfdl-enabled: + OsmoBTS User Manual =================== Harald Welte diff --git a/OsmoNITB/osmonitb-usermanual.adoc b/OsmoNITB/osmonitb-usermanual.adoc index 73166fa..0d6fa7e 100644 --- a/OsmoNITB/osmonitb-usermanual.adoc +++ b/OsmoNITB/osmonitb-usermanual.adoc @@ -1,3 +1,5 @@ +:gfdl-enabled: + OsmoNITB User Manual ==================== Harald Welte diff --git a/OsmoPCU/osmopcu-gb.adoc b/OsmoPCU/osmopcu-gb.adoc index fc2ca8f..64316a2 100644 --- a/OsmoPCU/osmopcu-gb.adoc +++ b/OsmoPCU/osmopcu-gb.adoc @@ -1,3 +1,5 @@ +:gfdl-enabled: + OsmoPCU Gb Protocol Specification ================================= Harald Welte diff --git a/OsmoPCU/osmopcu-usermanual.adoc b/OsmoPCU/osmopcu-usermanual.adoc index 5d2b09c..f47a0a9 100644 --- a/OsmoPCU/osmopcu-usermanual.adoc +++ b/OsmoPCU/osmopcu-usermanual.adoc @@ -1,3 +1,5 @@ +:gfdl-enabled: + OsmoPCU User Manual =================== Harald Welte diff --git a/OsmoSGSN/osmosgsn-usermanual.adoc b/OsmoSGSN/osmosgsn-usermanual.adoc index 12a7b87..79c94f6 100644 --- a/OsmoSGSN/osmosgsn-usermanual.adoc +++ b/OsmoSGSN/osmosgsn-usermanual.adoc @@ -1,3 +1,5 @@ +:gfdl-enabled: + OsmoSGSN User Manual ==================== Harald Welte diff --git a/common/chapters/glossary.adoc b/common/chapters/glossary.adoc index c39d439..2a0d3c4 100644 --- a/common/chapters/glossary.adoc +++ b/common/chapters/glossary.adoc @@ -96,8 +96,10 @@ Interface between PCU and SGSN in GPRS/EDGE network; uses NS, BSSGP, LLC GERAN:: GPRS/EDGE Radio Access Network +ifdef::gfdl-enabled[] GFDL:: GNU Free Documentation License; a copyleft-style Documentation License +endif::[] GGSN:: GPRS Gateway Support Node; gateway between GPRS and external (IP) network GMSK:: diff --git a/common/chapters/preface.adoc b/common/chapters/preface.adoc index 13afec1..abb11db 100644 --- a/common/chapters/preface.adoc +++ b/common/chapters/preface.adoc @@ -83,10 +83,11 @@ This version of the manual is endorsed by Harald Welte as the official version of the manual. +ifdef::gfdl-enabled[] While the GFDL license (see <>) permits anyone to create and distribute modified versions of this manual, such modified versions must remove the above endorsement. - +endif::[] == Preface @@ -221,7 +222,7 @@ ==== Documentation License -Please see <> for further information. +ifdef::gfdl-enabled[Please see <> for further information.] == Introduction -- To view, visit https://gerrit.osmocom.org/3736 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I2489726ad2e90301bceadfada926e31ae0f85986 Gerrit-PatchSet: 2 Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Thu Aug 31 15:44:25 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 31 Aug 2017 15:44:25 +0000 Subject: [PATCH] osmo-gsm-tester[master]: contrib: Add scripts to build osmo-pcu Message-ID: Review at https://gerrit.osmocom.org/3756 contrib: Add scripts to build osmo-pcu Change-Id: I90e7d2a79fb4ab7cc7fae5f3a1287a2e5bb748ab --- A contrib/jenkins-build-osmo-pcu-sysmo.sh A contrib/jenkins-build-osmo-pcu.sh 2 files changed, 29 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-tester refs/changes/56/3756/1 diff --git a/contrib/jenkins-build-osmo-pcu-sysmo.sh b/contrib/jenkins-build-osmo-pcu-sysmo.sh new file mode 100755 index 0000000..b912252 --- /dev/null +++ b/contrib/jenkins-build-osmo-pcu-sysmo.sh @@ -0,0 +1,19 @@ +#!/bin/sh +set -e -x + +poky="/opt/poky/1.5.4" +. "$poky/environment-setup-armv5te-poky-linux-gnueabi" + +# Cross-compilation: all installations need to be put in the sysmo SDK sysroot +export DESTDIR="$poky/sysroots/armv5te-poky-linux-gnueabi" + +base="$PWD" +name="osmo-pcu-sysmo" +prefix="/usr/local/jenkins-build/inst-$name" +prefix_real="$DESTDIR$prefix" +. "$(dirname "$0")/jenkins-build-common.sh" + +build_repo libosmocore --disable-pcsc --disable-doxygen +build_repo osmo-pcu --enable-sysmocom-dsp + +create_bin_tgz diff --git a/contrib/jenkins-build-osmo-pcu.sh b/contrib/jenkins-build-osmo-pcu.sh new file mode 100755 index 0000000..7953875 --- /dev/null +++ b/contrib/jenkins-build-osmo-pcu.sh @@ -0,0 +1,10 @@ +#!/bin/sh +set -e -x +base="$PWD" +name="osmo-pcu" +. "$(dirname "$0")/jenkins-build-common.sh" + +build_repo libosmocore --disable-pcsc --disable-doxygen +build_repo osmo-pcu + +create_bin_tgz -- To view, visit https://gerrit.osmocom.org/3756 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I90e7d2a79fb4ab7cc7fae5f3a1287a2e5bb748ab Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Thu Aug 31 15:46:20 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 31 Aug 2017 15:46:20 +0000 Subject: osmo-gsm-tester[master]: contrib: Add scripts to build osmo-pcu In-Reply-To: References: Message-ID: Patch Set 1: Jobs have been added: https://jenkins.osmocom.org/jenkins/view/osmo-gsm-tester/job/osmo-gsm-tester_build-osmo-pcu-sysmo/ https://jenkins.osmocom.org/jenkins/view/osmo-gsm-tester/job/osmo-gsm-tester_build-osmo-pcu/ Other jobs have been modified to take the tar.gz from them, and trigger when they build, etc. -- To view, visit https://gerrit.osmocom.org/3756 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I90e7d2a79fb4ab7cc7fae5f3a1287a2e5bb748ab Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Aug 31 17:20:20 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 31 Aug 2017 17:20:20 +0000 Subject: [PATCH] osmo-gsm-tester[master]: Reserve ARFCN dynamically based on BTS band support In-Reply-To: References: Message-ID: Hello Neels Hofmeyr, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3731 to look at the new patch set (#2). Reserve ARFCN dynamically based on BTS band support Instead of statically specifying a band for a BTS to use, declare a list of supported bands for each BTS. At the time of BTS object creation, ask the BTS for band support and try to dynamically reserve an ARFCN resource which is compatible with any of the bands supported by the BTS. All this happens transparently to the test. Still, the test may want to use a specific band / arfcn. In this case, a test can use suite.reserve_arfcn(band, arfcn) to reserve a specific band/arfcn and pass that to the BTS at creation time, which will then use that one instead of trying to find a suitable one. It is left as future work to support BTs with multiple TRX, in which case several arfcn must be reserved. It should not be that difficult, mostly using "times: X" where X is the amount of trx, changing the API to use a list of arfcns and the configure() methods of the BTS. Related: OS#2230 Change-Id: I6fb5d95bed1fa50c3deaf62a7a6df3cb276bc3c9 --- M example/default-suites.conf M example/defaults.conf M example/resources.conf A example/scenarios/band-1900.conf M selftest/conf/resources.conf M selftest/resource_test.ok M selftest/suite_test.ok M selftest/suite_test/resources.conf M src/osmo_gsm_tester/bts_osmotrx.py M src/osmo_gsm_tester/bts_sysmo.py M src/osmo_gsm_tester/resource.py M src/osmo_gsm_tester/schema.py M src/osmo_gsm_tester/suite.py A suites/register/register_band_1900.py A suites/register/suite.conf 15 files changed, 147 insertions(+), 30 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-tester refs/changes/31/3731/2 diff --git a/example/default-suites.conf b/example/default-suites.conf index 1e8d47a..7fc97d3 100644 --- a/example/default-suites.conf +++ b/example/default-suites.conf @@ -7,3 +7,4 @@ - smpp - aoip_smpp - aoip_encryption:cipher-a50+cipher-a51 +- register:band-1900 diff --git a/example/defaults.conf b/example/defaults.conf index 082f159..36718f9 100644 --- a/example/defaults.conf +++ b/example/defaults.conf @@ -34,7 +34,6 @@ osmobsc_bts_type: sysmobts trx_list: - max_power_red: 0 - arfcn: 868 timeslot_list: - phys_chan_config: CCCH+SDCCH4 - phys_chan_config: SDCCH8 diff --git a/example/resources.conf b/example/resources.conf index e7e64ee..3d95e60 100644 --- a/example/resources.conf +++ b/example/resources.conf @@ -12,14 +12,14 @@ type: osmo-bts-sysmo ipa_unit_id: 1 addr: 10.42.42.114 - band: GSM-1800 + bands: ['GSM-850', 'GSM-900', 'GSM-1800', 'GSM-1900'] ciphers: ['a5 0', 'a5 1', 'a5 3'] - label: Ettus B200 type: osmo-bts-trx ipa_unit_id: 6 addr: 10.42.42.50 - band: GSM-1800 + bands: ['GSM-1800', 'GSM-1900'] launch_trx: true ciphers: ['a5 0', 'a5 1'] @@ -27,7 +27,7 @@ type: osmo-bts-trx ipa_unit_id: 7 addr: 10.42.42.51 - band: GSM-1800 + bands: ['GSM-1800'] trx_remote_ip: 10.42.42.112 ciphers: ['a5 0', 'a5 1'] diff --git a/example/scenarios/band-1900.conf b/example/scenarios/band-1900.conf new file mode 100644 index 0000000..956c8db --- /dev/null +++ b/example/scenarios/band-1900.conf @@ -0,0 +1,4 @@ +resources: + bts: + - bands: + - GSM-1900 diff --git a/selftest/conf/resources.conf b/selftest/conf/resources.conf index 51f5a72..b8e9945 100644 --- a/selftest/conf/resources.conf +++ b/selftest/conf/resources.conf @@ -12,7 +12,7 @@ type: osmo-bts-sysmo ipa_unit_id: 1 addr: 10.42.42.114 - band: GSM-1800 + bands: ['GSM-850', 'GSM-900', 'GSM-1800', 'GSM-1900'] ciphers: - 'a5 0' - 'a5 1' @@ -21,7 +21,7 @@ type: osmo-bts-trx ipa_unit_id: 6 addr: 10.42.42.50 - band: GSM-1800 + bands: ['GSM-1800'] launch_trx: true ciphers: - 'a5 0' @@ -31,7 +31,7 @@ type: osmo-bts-trx ipa_unit_id: 7 addr: 10.42.42.51 - band: GSM-1800 + bands: ['GSM-1800'] trx_remote_ip: 10.42.42.112 ciphers: - 'a5 0' diff --git a/selftest/resource_test.ok b/selftest/resource_test.ok index 88ff588..38b38d4 100644 --- a/selftest/resource_test.ok +++ b/selftest/resource_test.ok @@ -46,16 +46,16 @@ {'_hash': 'dc9ce027a257da087f31a5bc1ee6b4abd2637369', 'arfcn': '548', 'band': 'GSM-1900'}], - 'bts': [{'_hash': 'f153f466355087b1a838a7aaa8f6f707de1e8925', + 'bts': [{'_hash': 'fefeacfa23e2be8b5a0239fafa46a99a30ccbf57', 'addr': '10.42.42.114', - 'band': 'GSM-1800', + 'bands': ['GSM-850', 'GSM-900', 'GSM-1800', 'GSM-1900'], 'ciphers': ['a5 0', 'a5 1'], 'ipa_unit_id': '1', 'label': 'sysmoBTS 1002', 'type': 'osmo-bts-sysmo'}, {'_hash': '3343d4cf95efae02644ecb5870417c26830107dc', 'addr': '10.42.42.50', - 'band': 'GSM-1800', + 'bands': ['GSM-1800'], 'ciphers': ['a5 0', 'a5 1'], 'ipa_unit_id': '6', 'label': 'Ettus B200', @@ -63,7 +63,7 @@ 'type': 'osmo-bts-trx'}, {'_hash': 'f6faf75c74c240af32658b54123edca33e30498e', 'addr': '10.42.42.51', - 'band': 'GSM-1800', + 'bands': ['GSM-1800'], 'ciphers': ['a5 0', 'a5 1'], 'ipa_unit_id': '7', 'label': 'sysmoCell 5000', @@ -118,9 +118,13 @@ arfcn: '514' band: GSM-1800 --- testowner: Reserving 2 x bts (candidates: 3) ---- testowner: DBG: Picked - _hash: f153f466355087b1a838a7aaa8f6f707de1e8925 +--- testowner: DBG: Picked - _hash: fefeacfa23e2be8b5a0239fafa46a99a30ccbf57 addr: 10.42.42.114 - band: GSM-1800 + bands: + - GSM-850 + - GSM-900 + - GSM-1800 + - GSM-1900 ciphers: - a5 0 - a5 1 @@ -129,7 +133,8 @@ type: osmo-bts-sysmo - _hash: 3343d4cf95efae02644ecb5870417c26830107dc addr: 10.42.42.50 - band: GSM-1800 + bands: + - GSM-1800 ciphers: - a5 0 - a5 1 @@ -170,10 +175,14 @@ arfcn: '514' band: GSM-1800 bts: -- _hash: f153f466355087b1a838a7aaa8f6f707de1e8925 +- _hash: fefeacfa23e2be8b5a0239fafa46a99a30ccbf57 _reserved_by: testowner-123-1490837279 addr: 10.42.42.114 - band: GSM-1800 + bands: + - GSM-850 + - GSM-900 + - GSM-1800 + - GSM-1900 ciphers: - a5 0 - a5 1 @@ -183,7 +192,8 @@ - _hash: 3343d4cf95efae02644ecb5870417c26830107dc _reserved_by: testowner-123-1490837279 addr: 10.42.42.50 - band: GSM-1800 + bands: + - GSM-1800 ciphers: - a5 0 - a5 1 diff --git a/selftest/suite_test.ok b/selftest/suite_test.ok index 2808474..8fbf8b8 100644 --- a/selftest/suite_test.ok +++ b/selftest/suite_test.ok @@ -32,9 +32,13 @@ tst test_suite: DBG: {combining='resources'} tst {combining_scenarios='resources'}: DBG: {definition_conf={bts=[{'times': '1'}], ip_address=[{'times': '1'}], modem=[{'times': '2'}]}} [test_suite?{combining_scenarios='resources'}] tst test_suite: Reserving 1 x bts (candidates: 3) -tst test_suite: DBG: Picked - _hash: 07d9c8aaa940b674efcbbabdd69f58a6ce4e94f9 +tst test_suite: DBG: Picked - _hash: c8a01d42f3977e49ceff0734a1475857913dfb13 addr: 10.42.42.114 - band: GSM-1800 + bands: + - GSM-850 + - GSM-900 + - GSM-1800 + - GSM-1900 ipa_unit_id: '1' label: sysmoBTS 1002 type: sysmo diff --git a/selftest/suite_test/resources.conf b/selftest/suite_test/resources.conf index 2005590..6e40798 100644 --- a/selftest/suite_test/resources.conf +++ b/selftest/suite_test/resources.conf @@ -10,13 +10,13 @@ type: sysmo ipa_unit_id: 1 addr: 10.42.42.114 - band: GSM-1800 + bands: ['GSM-850', 'GSM-900', 'GSM-1800', 'GSM-1900'] - label: octBTS 3000 type: oct ipa_unit_id: 5 addr: 10.42.42.115 - band: GSM-1800 + bands: ['GSM-1800'] trx_list: - hw_addr: 00:0c:90:32:b5:8a @@ -24,7 +24,7 @@ type: nanobts ipa_unit_id: 1902 addr: 10.42.42.190 - band: GSM-1900 + bands: ['GSM-1800'] trx_list: - hw_addr: 00:02:95:00:41:b3 diff --git a/src/osmo_gsm_tester/bts_osmotrx.py b/src/osmo_gsm_tester/bts_osmotrx.py index b5262a2..a53874f 100644 --- a/src/osmo_gsm_tester/bts_osmotrx.py +++ b/src/osmo_gsm_tester/bts_osmotrx.py @@ -43,6 +43,18 @@ def remote_addr(self): return self.conf.get('addr') + def supported_bands(self): + return self.conf.get('bands', []) + + def set_arfcn_resource(self, band_arfcn): + self.band_arfcn = band_arfcn + + def band(self): + return self.band_arfcn.get('band') + + def arfcn(self): + return int(self.band_arfcn.get('arfcn')) + def trx_remote_ip(self): conf_ip = self.conf.get('trx_remote_ip', None) if conf_ip is not None: @@ -105,7 +117,8 @@ 'oml_remote_ip': self.bsc.addr(), 'trx_local_ip': self.remote_addr(), 'trx_remote_ip': self.trx_remote_ip(), - 'pcu_socket_path': os.path.join(str(self.run_dir), 'pcu_bts') + 'pcu_socket_path': os.path.join(str(self.run_dir), 'pcu_bts'), + 'band': self.band() } }) config.overlay(values, { 'osmo_bts_trx': self.conf }) @@ -121,6 +134,10 @@ values = config.get_defaults('bsc_bts') config.overlay(values, config.get_defaults('osmo_bts_trx')) config.overlay(values, self.conf) + config.overlay(values, { + 'band': self.band(), + 'trx_list': [ { 'arfcn': self.arfcn() } ] + }) self.dbg(conf=values) return values diff --git a/src/osmo_gsm_tester/bts_sysmo.py b/src/osmo_gsm_tester/bts_sysmo.py index f37f88b..49252c1 100644 --- a/src/osmo_gsm_tester/bts_sysmo.py +++ b/src/osmo_gsm_tester/bts_sysmo.py @@ -110,6 +110,18 @@ def remote_addr(self): return self.conf.get('addr') + def supported_bands(self): + return self.conf.get('bands', []) + + def set_arfcn_resource(self, band_arfcn): + self.band_arfcn = band_arfcn + + def band(self): + return self.band_arfcn.get('band') + + def arfcn(self): + return int(self.band_arfcn.get('arfcn')) + def configure(self): if self.bsc is None: raise RuntimeError('BTS needs to be added to a BSC or NITB before it can be configured') @@ -122,7 +134,8 @@ config.overlay(values, { 'osmo_bts_sysmo': { 'oml_remote_ip': self.bsc.addr(), - 'pcu_socket_path': os.path.join(SysmoBts.REMOTE_DIR, 'pcu_bts') + 'pcu_socket_path': os.path.join(SysmoBts.REMOTE_DIR, 'pcu_bts'), + 'band': self.band() } }) config.overlay(values, { 'osmo_bts_sysmo': self.conf }) @@ -138,6 +151,10 @@ values = config.get_defaults('bsc_bts') config.overlay(values, config.get_defaults('osmo_bts_sysmo')) config.overlay(values, self.conf) + config.overlay(values, { + 'band': self.band(), + 'trx_list': [ { 'arfcn': self.arfcn() } ] + }) self.dbg(conf=values) return values diff --git a/src/osmo_gsm_tester/resource.py b/src/osmo_gsm_tester/resource.py index 4f43bfc..b7ca7d8 100644 --- a/src/osmo_gsm_tester/resource.py +++ b/src/osmo_gsm_tester/resource.py @@ -53,7 +53,7 @@ 'bts[].type': schema.STR, 'bts[].ipa_unit_id': schema.INT, 'bts[].addr': schema.IPV4, - 'bts[].band': schema.BAND, + 'bts[].bands[]': schema.BAND, 'bts[].trx_remote_ip': schema.IPV4, 'bts[].launch_trx': schema.BOOL_STR, 'bts[].ciphers[]': schema.CIPHER, @@ -522,6 +522,11 @@ for item in item_list: item.pop(USED_KEY, None) + def add(self, more): + if more is self or more is self.reserved: + raise RuntimeError('adding a list of reserved resources to itself') + config.add(self.reserved, copy.deepcopy(more.reserved)) + def free(self): if self.reserved: self.resources_pool.free(self.origin, self.reserved) diff --git a/src/osmo_gsm_tester/schema.py b/src/osmo_gsm_tester/schema.py index 91ad883..9182e6a 100644 --- a/src/osmo_gsm_tester/schema.py +++ b/src/osmo_gsm_tester/schema.py @@ -39,7 +39,7 @@ raise ValueError('Invalid %s: %r' % (name, val)) def band(val): - if val in ('GSM-1800', 'GSM-1900'): + if val in ('GSM-850', 'GSM-900', 'GSM-1800', 'GSM-1900'): return raise ValueError('Unknown GSM band: %r' % val) diff --git a/src/osmo_gsm_tester/suite.py b/src/osmo_gsm_tester/suite.py index 2ac2062..f92e533 100644 --- a/src/osmo_gsm_tester/suite.py +++ b/src/osmo_gsm_tester/suite.py @@ -246,6 +246,11 @@ self.log('reserving resources in', self.resources_pool.state_dir, '...') self.reserved_resources = self.resources_pool.reserve(self, self.resource_requirements()) + def reserve_resources_append(self, requirements): + new_reserved = self.resources_pool.reserve(self, requirements) + self.dbg('reserving new resources %r' % new_reserved) + self.reserved_resources.add(new_reserved) + def run_tests(self, names=None): try: log.large_separator(self.trial.name(), self.name(), sublevel=2) @@ -317,6 +322,14 @@ return self.reserved_resources.free() + def reserve_arfcn(self, band, arfcn=None): + '''To be used by tests. Returned resource can be passed when requested a bts object''' + + if arfcn is None: + return self._try_reserve_arfcn((band,)) + else: + return self.reserve_resources_append({ 'arfcn': [{'band': band, 'arfcn': arfcn, 'times': '1'}] }) + def ip_address(self, specifics=None): return self.reserved_resources.get(resource.R_IP_ADDRESS, specifics=specifics) @@ -350,8 +363,18 @@ ip_address = self.ip_address() return osmo_stp.OsmoStp(self, ip_address) - def bts(self, specifics=None): - return bts_obj(self, self.reserved_resources.get(resource.R_BTS, specifics=specifics)) + def bts(self, arfcn=None, specifics=None): + return bts_obj(self, arfcn, self.reserved_resources.get(resource.R_BTS, specifics=specifics)) + + def _try_reserve_arfcn(self, supported_bands): + for band in supported_bands: + try: + self.reserve_resources_append({ 'arfcn': [{'band': band, 'times': '1'}] }) + except resource.NoResourceExn as e: + self.dbg('Band %s has no available arfcns' % band) + continue + return self.reserved_resources.get(resource.R_ARFCN) + raise resource.NoResourceExn("No free arfcns in any of bands", bands=supported_bands) def modem(self, specifics=None): conf = self.reserved_resources.get(resource.R_MODEM, specifics=specifics) @@ -448,12 +471,17 @@ scenarios = [config.get_scenario(scenario_name) for scenario_name in scenario_names] return (suite_scenario_str, suite, scenarios) -def bts_obj(suite_run, conf): +def bts_obj(suite_run, arfcn, conf): bts_type = conf.get('type') log.dbg('create BTS object', type=bts_type) bts_class = resource.KNOWN_BTS_TYPES.get(bts_type) if bts_class is None: raise RuntimeError('No such BTS type is defined: %r' % bts_type) - return bts_class(suite_run, conf) + bts_inst = bts_class(suite_run, conf) + if arfcn is None: + supported_bands = bts_inst.supported_bands() + arfcn = suite_run._try_reserve_arfcn(supported_bands) + bts_inst.set_arfcn_resource(arfcn) + return bts_inst # vim: expandtab tabstop=4 shiftwidth=4 diff --git a/suites/register/register_band_1900.py b/suites/register/register_band_1900.py new file mode 100755 index 0000000..3e0f6c3 --- /dev/null +++ b/suites/register/register_band_1900.py @@ -0,0 +1,22 @@ +#!/usr/bin/env python3 +from osmo_gsm_tester.test import * + +nitb = suite.nitb() +arfcn = suite.reserve_arfcn(band='GSM-1900') +bts = suite.bts(arfcn) +ms = suite.modem() + +print('start nitb and bts...') +nitb.bts_add(bts) +nitb.start() +bts.start() + +nitb.subscriber_add(ms) + +ms.connect(nitb.mcc_mnc()) + +ms.log_info() + +print('waiting for modems to attach...') +wait(ms.is_connected, nitb.mcc_mnc()) +wait(nitb.subscriber_attached, ms) diff --git a/suites/register/suite.conf b/suites/register/suite.conf new file mode 100644 index 0000000..eb59abb --- /dev/null +++ b/suites/register/suite.conf @@ -0,0 +1,10 @@ +resources: + ip_address: + - times: 1 + bts: + - times: 1 + modem: + - times: 1 + +defaults: + timeout: 60s -- To view, visit https://gerrit.osmocom.org/3731 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I6fb5d95bed1fa50c3deaf62a7a6df3cb276bc3c9 Gerrit-PatchSet: 2 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: neels From gerrit-no-reply at lists.osmocom.org Thu Aug 31 17:20:20 2017 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 31 Aug 2017 17:20:20 +0000 Subject: [PATCH] osmo-gsm-tester[master]: Add cipher cfg param for modem and bts In-Reply-To: References: Message-ID: Hello Neels Hofmeyr, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3723 to look at the new patch set (#3). Add cipher cfg param for modem and bts This parameter is contains a list of supported encryption ciphers by the modem or bts setting it. It is so far not directly/automatically used inside osmo-gsm-tester code, but can be useful to create scenarios for tests that require specific ciphering modes. For instance, aoip_encryption suite contains tests that require a BTS and a modem that supports a5 0 and a5 1, otherwise tests will fail. Change-Id: Ic0e368843a6e58bd3eeef36d2c0a7501296f0f3e --- M example/default-suites.conf M example/resources.conf A example/scenarios/cipher-a50.conf A example/scenarios/cipher-a51.conf M src/osmo_gsm_tester/resource.py M src/osmo_gsm_tester/schema.py 6 files changed, 31 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-tester refs/changes/23/3723/3 diff --git a/example/default-suites.conf b/example/default-suites.conf index 0198486..1e8d47a 100644 --- a/example/default-suites.conf +++ b/example/default-suites.conf @@ -6,4 +6,4 @@ - aoip_sms:trx-sysmocell5000 - smpp - aoip_smpp -- aoip_encryption +- aoip_encryption:cipher-a50+cipher-a51 diff --git a/example/resources.conf b/example/resources.conf index f190c2f..e7e64ee 100644 --- a/example/resources.conf +++ b/example/resources.conf @@ -13,6 +13,7 @@ ipa_unit_id: 1 addr: 10.42.42.114 band: GSM-1800 + ciphers: ['a5 0', 'a5 1', 'a5 3'] - label: Ettus B200 type: osmo-bts-trx @@ -20,6 +21,7 @@ addr: 10.42.42.50 band: GSM-1800 launch_trx: true + ciphers: ['a5 0', 'a5 1'] - label: sysmoCell 5000 type: osmo-bts-trx @@ -27,6 +29,7 @@ addr: 10.42.42.51 band: GSM-1800 trx_remote_ip: 10.42.42.112 + ciphers: ['a5 0', 'a5 1'] arfcn: - arfcn: 512 @@ -56,21 +59,25 @@ imsi: '901700000009031' ki: '80A37E6FDEA931EAC92FFA5F671EFEAD' auth_algo: 'xor' + ciphers: ['a5 0', 'a5 1'] - label: sierra_2 path: '/sierra_2' imsi: '901700000009029' ki: '00969E283349D354A8239E877F2E0866' auth_algo: 'xor' + ciphers: ['a5 0', 'a5 1'] - label: gobi_0 path: '/gobi_0' imsi: '901700000009030' ki: 'BB70807226393CDBAC8DD3439FF54252' auth_algo: 'xor' + ciphers: ['a5 0', 'a5 1'] - label: gobi_3 path: '/gobi_3' imsi: '901700000009032' ki: '2F70DCA43C45ACB97E947FDD0C7CA30A' auth_algo: 'xor' + ciphers: ['a5 0', 'a5 1'] diff --git a/example/scenarios/cipher-a50.conf b/example/scenarios/cipher-a50.conf new file mode 100644 index 0000000..d4a2e46 --- /dev/null +++ b/example/scenarios/cipher-a50.conf @@ -0,0 +1,7 @@ +resources: + bts: + - ciphers: + - 'a5 0' + modem: + - ciphers: + - 'a5 0' diff --git a/example/scenarios/cipher-a51.conf b/example/scenarios/cipher-a51.conf new file mode 100644 index 0000000..c84cd96 --- /dev/null +++ b/example/scenarios/cipher-a51.conf @@ -0,0 +1,7 @@ +resources: + bts: + - ciphers: + - 'a5 1' + modem: + - ciphers: + - 'a5 1' diff --git a/src/osmo_gsm_tester/resource.py b/src/osmo_gsm_tester/resource.py index da543f7..4f43bfc 100644 --- a/src/osmo_gsm_tester/resource.py +++ b/src/osmo_gsm_tester/resource.py @@ -56,6 +56,7 @@ 'bts[].band': schema.BAND, 'bts[].trx_remote_ip': schema.IPV4, 'bts[].launch_trx': schema.BOOL_STR, + 'bts[].ciphers[]': schema.CIPHER, 'bts[].trx_list[].hw_addr': schema.HWADDR, 'bts[].trx_list[].net_device': schema.STR, 'arfcn[].arfcn': schema.INT, @@ -65,6 +66,7 @@ 'modem[].imsi': schema.IMSI, 'modem[].ki': schema.KI, 'modem[].auth_algo': schema.AUTH_ALGO, + 'modem[].ciphers[]': schema.CIPHER, } WANT_SCHEMA = util.dict_add( diff --git a/src/osmo_gsm_tester/schema.py b/src/osmo_gsm_tester/schema.py index 2da80cd..91ad883 100644 --- a/src/osmo_gsm_tester/schema.py +++ b/src/osmo_gsm_tester/schema.py @@ -66,6 +66,11 @@ return raise ValueError('Unknown Authentication Algorithm: %r' % val) +def cipher(val): + if val in ('a5 0', 'a5 1', 'a5 2', 'a5 3', 'a5 4', 'a5 5', 'a5 6', 'a5 7'): + return + raise ValueError('Unknown Cipher value: %r' % val) + INT = 'int' STR = 'str' BOOL_STR = 'bool_str' @@ -76,6 +81,7 @@ KI = 'ki' MSISDN = 'msisdn' AUTH_ALGO = 'auth_algo' +CIPHER = 'cipher' SCHEMA_TYPES = { INT: int, STR: str, @@ -87,6 +93,7 @@ KI: ki, MSISDN: msisdn, AUTH_ALGO: auth_algo, + CIPHER: cipher, } def validate(config, schema): -- To view, visit https://gerrit.osmocom.org/3723 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ic0e368843a6e58bd3eeef36d2c0a7501296f0f3e Gerrit-PatchSet: 3 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Thu Aug 31 17:23:48 2017 From: gerrit-no-reply at lists.osmocom.org (Tom Tsou) Date: Thu, 31 Aug 2017 17:23:48 +0000 Subject: osmo-trx[master]: Use release helper from libosmocore In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3717 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ieb843923d8f534654413be695f2b5f0c87b75520 Gerrit-PatchSet: 2 Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Alexander Chemeris Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Tom Tsou Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Aug 31 17:56:01 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Thu, 31 Aug 2017 17:56:01 +0000 Subject: [MERGED] osmo-trx[master]: Use release helper from libosmocore In-Reply-To: References: Message-ID: Max has submitted this change and it was merged. Change subject: Use release helper from libosmocore ...................................................................... Use release helper from libosmocore See https://osmocom.org/projects/cellular-infrastructure/wiki/Make_a_new_release for details. Change-Id: Ieb843923d8f534654413be695f2b5f0c87b75520 Related: OS#1861 --- M Makefile.am M configure.ac 2 files changed, 5 insertions(+), 0 deletions(-) Approvals: Tom Tsou: Looks good to me, approved Harald Welte: Looks good to me, but someone else must approve Jenkins Builder: Verified diff --git a/Makefile.am b/Makefile.am index 56cb4ba..5cf1a45 100644 --- a/Makefile.am +++ b/Makefile.am @@ -39,6 +39,7 @@ COPYING \ README + at RELMAKE@ dox: FORCE doxygen doxconfig diff --git a/configure.ac b/configure.ac index 8cfd25d..43b5403 100644 --- a/configure.ac +++ b/configure.ac @@ -34,6 +34,10 @@ dnl Linux kernel KBuild style compile messages m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) +dnl include release helper +RELMAKE='-include osmo-release.mk' +AC_SUBST([RELMAKE]) + AM_PROG_AS AC_PROG_CXX AX_CXX_COMPILE_STDCXX_11 -- To view, visit https://gerrit.osmocom.org/3717 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ieb843923d8f534654413be695f2b5f0c87b75520 Gerrit-PatchSet: 2 Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Alexander Chemeris Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Tom Tsou From gerrit-no-reply at lists.osmocom.org Thu Aug 31 17:57:39 2017 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Thu, 31 Aug 2017 17:57:39 +0000 Subject: osmo-trx[master]: Use release helper from libosmocore In-Reply-To: References: Message-ID: Patch Set 2: Would be pretty cool if you could give it a try next time you want to make OsmoTRX release :) -- To view, visit https://gerrit.osmocom.org/3717 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ieb843923d8f534654413be695f2b5f0c87b75520 Gerrit-PatchSet: 2 Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Alexander Chemeris Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Tom Tsou Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Aug 31 18:27:34 2017 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 31 Aug 2017 18:27:34 +0000 Subject: [PATCH] libosmo-sccp[master]: osmo-stp: Fix process termination on SIGINT+SIGTERM Message-ID: Review at https://gerrit.osmocom.org/3757 osmo-stp: Fix process termination on SIGINT+SIGTERM In commit eed8c1bfae1d151e135b574d83ed295d36ad8b44 we introduced some singal handling code for (among others) SIGINT and SIGTERM. This code causes the process to hang rather than terminate, as it only dispatches a signal that nobody handles yet in libosmo-sccp. Until a proper implementation is made, let's terminate the process as expected. Change-Id: Iff79c8ac0b347660333912c9258073a013ea799b --- M stp/stp_main.c 1 file changed, 4 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-sccp refs/changes/57/3757/1 diff --git a/stp/stp_main.c b/stp/stp_main.c index 8e3282c..a33045a 100644 --- a/stp/stp_main.c +++ b/stp/stp_main.c @@ -134,8 +134,11 @@ switch (signal) { case SIGINT: case SIGTERM: + /* FIXME: handle the signal somewhere else and gracefully shut down + * SIGTRAN links osmo_signal_dispatch(SS_L_GLOBAL, S_L_GLOBAL_SHUTDOWN, NULL); - sleep(1); + sleep(1); */ + exit(0); break; case SIGABRT: osmo_generate_backtrace(); -- To view, visit https://gerrit.osmocom.org/3757 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Iff79c8ac0b347660333912c9258073a013ea799b Gerrit-PatchSet: 1 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: Harald Welte