pespin has uploaded a new patch set (#3). ( https://gerrit.osmocom.org/c/osmo-sgsn/+/30784 )
Change subject: Create new specific file for BSSGP code
......................................................................
Create new specific file for BSSGP code
Right now there's no much code there since the related code is totally
entangled with the LLC once.
This will eventually change in the future when we switch to use
libosmo-gprs.
Hence, this commit is a preparation to have already some place to put
new BSSGP specific code in the future.
Change-Id: I816396ab5ccb86032bbc21b41a959934a7768780
---
M include/osmocom/sgsn/Makefile.am
A include/osmocom/sgsn/gprs_bssgp.h
M include/osmocom/sgsn/gprs_gb.h
M src/sgsn/Makefile.am
A src/sgsn/gprs_bssgp.c
M src/sgsn/gprs_gb.c
M src/sgsn/sgsn_libgtp.c
M src/sgsn/sgsn_main.c
M src/sgsn/sgsn_vty.c
M tests/sgsn/Makefile.am
10 files changed, 118 insertions(+), 69 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-sgsn refs/changes/84/30784/3
--
To view, visit https://gerrit.osmocom.org/c/osmo-sgsn/+/30784
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-sgsn
Gerrit-Branch: master
Gerrit-Change-Id: I816396ab5ccb86032bbc21b41a959934a7768780
Gerrit-Change-Number: 30784
Gerrit-PatchSet: 3
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
Gerrit-CC: Jenkins Builder
Gerrit-MessageType: newpatchset
pespin has uploaded a new patch set (#2). ( https://gerrit.osmocom.org/c/osmo-sgsn/+/30786 )
Change subject: Rename gprs_gb.[c,h] -> gprs_ns.[c,h]
......................................................................
Rename gprs_gb.[c,h] -> gprs_ns.[c,h]
Change-Id: I8312c8a70d60cab48764950c5b57ca02964e9db2
---
M include/osmocom/sgsn/Makefile.am
R include/osmocom/sgsn/gprs_ns.h
M src/sgsn/Makefile.am
R src/sgsn/gprs_ns.c
M src/sgsn/gprs_sndcp.c
M src/sgsn/sgsn_libgtp.c
M src/sgsn/sgsn_main.c
M src/sgsn/sgsn_vty.c
M tests/sgsn/Makefile.am
9 files changed, 7 insertions(+), 7 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-sgsn refs/changes/86/30786/2
--
To view, visit https://gerrit.osmocom.org/c/osmo-sgsn/+/30786
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-sgsn
Gerrit-Branch: master
Gerrit-Change-Id: I8312c8a70d60cab48764950c5b57ca02964e9db2
Gerrit-Change-Number: 30786
Gerrit-PatchSet: 2
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
Gerrit-MessageType: newpatchset
Jenkins Builder has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-sgsn/+/30784 )
Change subject: Create new specific file for BSSGP code
......................................................................
Patch Set 1:
(1 comment)
File src/sgsn/gprs_bssgp.c:
Robot Comment from checkpatch (run ID jenkins-gerrit-lint-2264):
https://gerrit.osmocom.org/c/osmo-sgsn/+/30784/comment/29a6a787_36f23db8
PS1, Line 94: }
adding a line without newline at end of file
--
To view, visit https://gerrit.osmocom.org/c/osmo-sgsn/+/30784
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-sgsn
Gerrit-Branch: master
Gerrit-Change-Id: I816396ab5ccb86032bbc21b41a959934a7768780
Gerrit-Change-Number: 30784
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
Gerrit-CC: Jenkins Builder
Gerrit-Comment-Date: Fri, 23 Dec 2022 16:15:07 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Gerrit-MessageType: comment
pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-sgsn/+/30784 )
Change subject: Create new specific file for BSSGP code
......................................................................
Create new specific file for BSSGP code
Right now there's no much code there since the related code is totally
entangled with the LLC once.
This will eventually change in the future when we switch to use
libosmo-gprs.
Hence, this commit is a preparation to have already some place to put
new BSSGP specific code in the future.
Change-Id: I816396ab5ccb86032bbc21b41a959934a7768780
---
M include/osmocom/sgsn/Makefile.am
A include/osmocom/sgsn/gprs_bssgp.h
M include/osmocom/sgsn/gprs_gb.h
M src/sgsn/Makefile.am
A src/sgsn/gprs_bssgp.c
M src/sgsn/gprs_gb.c
M src/sgsn/sgsn_libgtp.c
M src/sgsn/sgsn_main.c
M src/sgsn/sgsn_vty.c
M tests/sgsn/Makefile.am
10 files changed, 118 insertions(+), 69 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-sgsn refs/changes/84/30784/1
diff --git a/include/osmocom/sgsn/Makefile.am b/include/osmocom/sgsn/Makefile.am
index 515c79c..3b1f840 100644
--- a/include/osmocom/sgsn/Makefile.am
+++ b/include/osmocom/sgsn/Makefile.am
@@ -2,6 +2,7 @@
common.h \
crc24.h \
debug.h \
+ gprs_bssgp.h \
gprs_gb.h \
gprs_gmm.h \
gprs_gmm_fsm.h \
diff --git a/include/osmocom/sgsn/gprs_bssgp.h b/include/osmocom/sgsn/gprs_bssgp.h
new file mode 100644
index 0000000..0feaa97
--- /dev/null
+++ b/include/osmocom/sgsn/gprs_bssgp.h
@@ -0,0 +1,12 @@
+#pragma once
+
+#include <osmocom/core/msgb.h>
+
+/* Called by bssgp layer when a prim is received from lower layers. */
+int sgsn_bssgp_rx_prim(struct osmo_prim_hdr *oph);
+
+/* called by the bssgp layer to send NS PDUs */
+int sgsn_bssgp_dispatch_ns_unitdata_req_cb(void *ctx, struct msgb *msg);
+
+/* page a MS in its routing area */
+int sgsn_bssgp_page_ps_ra(struct sgsn_mm_ctx *mmctx);
diff --git a/include/osmocom/sgsn/gprs_gb.h b/include/osmocom/sgsn/gprs_gb.h
index 9162367..e39ebc6 100644
--- a/include/osmocom/sgsn/gprs_gb.h
+++ b/include/osmocom/sgsn/gprs_gb.h
@@ -10,11 +10,5 @@
/* Has to be called whenever any PDU (signaling, data, ...) has been received */
void gprs_gb_recv_pdu(struct sgsn_mm_ctx *mmctx, const struct msgb *msg);
-/* page a MS in its routing area */
-int gprs_gb_page_ps_ra(struct sgsn_mm_ctx *mmctx);
-
-/* called by the bssgp layer to send NS PDUs */
-int gprs_gb_send_cb(void *ctx, struct msgb *msg);
-
/* called by the ns layer */
int gprs_ns_prim_cb(struct osmo_prim_hdr *oph, void *ctx);
diff --git a/src/sgsn/Makefile.am b/src/sgsn/Makefile.am
index 9e4a342..8bc5ccb 100644
--- a/src/sgsn/Makefile.am
+++ b/src/sgsn/Makefile.am
@@ -40,6 +40,7 @@
$(NULL)
osmo_sgsn_SOURCES = \
+ gprs_bssgp.c \
gprs_gb.c \
gprs_gmm_attach.c \
gprs_gmm.c \
diff --git a/src/sgsn/gprs_bssgp.c b/src/sgsn/gprs_bssgp.c
new file mode 100644
index 0000000..77500c5
--- /dev/null
+++ b/src/sgsn/gprs_bssgp.c
@@ -0,0 +1,94 @@
+/* GPRS BSSGP protocol implementation as per 3GPP TS 08.18 */
+
+/* (C) 2010 by Harald Welte <laforge(a)gnumonks.org>
+ * (C) 2010 by On-Waves
+ * (C) 2022 by sysmocom - s.f.m.c. GmbH <info(a)sysmocom.de>
+ *
+ * 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 <http://www.gnu.org/licenses/>.
+ *
+ */
+#include <osmocom/core/prim.h>
+#include <osmocom/core/rate_ctr.h>
+
+#include <osmocom/gprs/gprs_bssgp.h>
+#include <osmocom/gprs/gprs_ns2.h>
+
+#include <osmocom/sgsn/gprs_llc.h>
+#include <osmocom/sgsn/gprs_gmm.h>
+#include <osmocom/sgsn/sgsn_rim.h>
+
+/* call-back function for the BSSGP protocol */
+int sgsn_bssgp_rx_prim(struct osmo_prim_hdr *oph)
+{
+ struct osmo_bssgp_prim *bp;
+ bp = container_of(oph, struct osmo_bssgp_prim, oph);
+
+ switch (oph->sap) {
+ case SAP_BSSGP_LL:
+ switch (oph->primitive) {
+ case PRIM_BSSGP_UL_UD:
+ return gprs_llc_rcvmsg(oph->msg, bp->tp);
+ }
+ break;
+ case SAP_BSSGP_GMM:
+ switch (oph->primitive) {
+ case PRIM_BSSGP_GMM_SUSPEND:
+ return gprs_gmm_rx_suspend(bp->ra_id, bp->tlli);
+ case PRIM_BSSGP_GMM_RESUME:
+ return gprs_gmm_rx_resume(bp->ra_id, bp->tlli,
+ bp->u.resume.suspend_ref);
+ }
+ break;
+ case SAP_BSSGP_NM:
+ break;
+ case SAP_BSSGP_RIM:
+ return sgsn_rim_rx_from_gb(bp, oph->msg);
+ }
+ return 0;
+}
+
+int sgsn_bssgp_page_ps_ra(struct sgsn_mm_ctx *mmctx)
+{
+ struct bssgp_paging_info pinfo;
+ int rc;
+
+ /* FIXME: page whole routing area, not only the last known cell */
+
+ /* initiate PS PAGING procedure */
+ memset(&pinfo, 0, sizeof(pinfo));
+ pinfo.mode = BSSGP_PAGING_PS;
+ pinfo.scope = BSSGP_PAGING_BVCI;
+ pinfo.bvci = mmctx->gb.bvci;
+ pinfo.imsi = mmctx->imsi;
+ pinfo.ptmsi = &mmctx->p_tmsi;
+ pinfo.drx_params = mmctx->drx_parms;
+ pinfo.qos[0] = 0; // FIXME
+ rc = bssgp_tx_paging(mmctx->gb.nsei, 0, &pinfo);
+ rate_ctr_inc(rate_ctr_group_get_ctr(mmctx->ctrg, GMM_CTR_PAGING_PS));
+
+ return rc;
+}
+
+/* called by the bssgp layer to send NS PDUs */
+int sgsn_bssgp_dispatch_ns_unitdata_req_cb(void *ctx, struct msgb *msg)
+{
+ struct gprs_ns2_inst *nsi = (struct gprs_ns2_inst *) ctx;
+ struct osmo_gprs_ns2_prim nsp = {};
+ nsp.nsei = msgb_nsei(msg);
+ nsp.bvci = msgb_bvci(msg);
+ osmo_prim_init(&nsp.oph, SAP_NS, GPRS_NS2_PRIM_UNIT_DATA, PRIM_OP_REQUEST, msg);
+ return gprs_ns2_recv_prim(nsi, &nsp.oph);
+}
\ No newline at end of file
diff --git a/src/sgsn/gprs_gb.c b/src/sgsn/gprs_gb.c
index 96157a0..703223f 100644
--- a/src/sgsn/gprs_gb.c
+++ b/src/sgsn/gprs_gb.c
@@ -84,40 +84,6 @@
return rc;
}
-
-int gprs_gb_page_ps_ra(struct sgsn_mm_ctx *mmctx)
-{
- struct bssgp_paging_info pinfo;
- int rc;
-
- /* FIXME: page whole routing area, not only the last known cell */
-
- /* initiate PS PAGING procedure */
- memset(&pinfo, 0, sizeof(pinfo));
- pinfo.mode = BSSGP_PAGING_PS;
- pinfo.scope = BSSGP_PAGING_BVCI;
- pinfo.bvci = mmctx->gb.bvci;
- pinfo.imsi = mmctx->imsi;
- pinfo.ptmsi = &mmctx->p_tmsi;
- pinfo.drx_params = mmctx->drx_parms;
- pinfo.qos[0] = 0; // FIXME
- rc = bssgp_tx_paging(mmctx->gb.nsei, 0, &pinfo);
- rate_ctr_inc(rate_ctr_group_get_ctr(mmctx->ctrg, GMM_CTR_PAGING_PS));
-
- return rc;
-}
-
-/* called by the bssgp layer to send NS PDUs */
-int gprs_gb_send_cb(void *ctx, struct msgb *msg)
-{
- struct gprs_ns2_inst *nsi = (struct gprs_ns2_inst *) ctx;
- struct osmo_gprs_ns2_prim nsp = {};
- nsp.nsei = msgb_nsei(msg);
- nsp.bvci = msgb_bvci(msg);
- osmo_prim_init(&nsp.oph, SAP_NS, GPRS_NS2_PRIM_UNIT_DATA, PRIM_OP_REQUEST, msg);
- return gprs_ns2_recv_prim(nsi, &nsp.oph);
-}
-
void gprs_ns_prim_status_cb(struct osmo_gprs_ns2_prim *nsp)
{
switch (nsp->u.status.cause) {
diff --git a/src/sgsn/sgsn_libgtp.c b/src/sgsn/sgsn_libgtp.c
index 033637d..caab953 100644
--- a/src/sgsn/sgsn_libgtp.c
+++ b/src/sgsn/sgsn_libgtp.c
@@ -57,6 +57,7 @@
#include <osmocom/sgsn/gprs_mm_state_gb_fsm.h>
#include <osmocom/sgsn/gtp_mme.h>
#include <osmocom/sgsn/sgsn_rim.h>
+#include <osmocom/sgsn/gprs_bssgp.h>
#include <gtp.h>
#include <pdp.h>
@@ -781,7 +782,7 @@
LOGMMCTXP(LOGL_INFO, mm, "Paging MS in GMM state %s, MM state %s\n",
osmo_fsm_inst_state_name(mm->gmm_fsm),
osmo_fsm_inst_state_name(mm->gb.mm_state_fsm));
- gprs_gb_page_ps_ra(mm);
+ sgsn_bssgp_page_ps_ra(mm);
/* FIXME: queue the packet we received from GTP */
break;
diff --git a/src/sgsn/sgsn_main.c b/src/sgsn/sgsn_main.c
index c775922..77797b9 100644
--- a/src/sgsn/sgsn_main.c
+++ b/src/sgsn/sgsn_main.c
@@ -62,6 +62,7 @@
#include <osmocom/sgsn/gprs_gmm.h>
#include <osmocom/sgsn/gprs_ranap.h>
#include <osmocom/sgsn/gprs_gb.h>
+#include <osmocom/sgsn/gprs_bssgp.h>
#include <osmocom/ctrl/control_if.h>
#include <osmocom/ctrl/ports.h>
@@ -97,34 +98,11 @@
struct sgsn_instance *sgsn;
-/* call-back function for the BSSGP protocol */
+/* call-back function for the BSSGP protocol.
+ * Must be left here so that we can add a new one in tests/sgsn_test */
int bssgp_prim_cb(struct osmo_prim_hdr *oph, void *ctx)
{
- struct osmo_bssgp_prim *bp;
- bp = container_of(oph, struct osmo_bssgp_prim, oph);
-
- switch (oph->sap) {
- case SAP_BSSGP_LL:
- switch (oph->primitive) {
- case PRIM_BSSGP_UL_UD:
- return gprs_llc_rcvmsg(oph->msg, bp->tp);
- }
- break;
- case SAP_BSSGP_GMM:
- switch (oph->primitive) {
- case PRIM_BSSGP_GMM_SUSPEND:
- return gprs_gmm_rx_suspend(bp->ra_id, bp->tlli);
- case PRIM_BSSGP_GMM_RESUME:
- return gprs_gmm_rx_resume(bp->ra_id, bp->tlli,
- bp->u.resume.suspend_ref);
- }
- break;
- case SAP_BSSGP_NM:
- break;
- case SAP_BSSGP_RIM:
- return sgsn_rim_rx_from_gb(bp, oph->msg);
- }
- return 0;
+ return sgsn_bssgp_rx_prim(oph);
}
static void signal_handler(int signum)
@@ -434,7 +412,7 @@
exit(1);
}
sgsn->cfg.nsi = sgsn_nsi;
- bssgp_set_bssgp_callback(gprs_gb_send_cb, sgsn_nsi);
+ bssgp_set_bssgp_callback(sgsn_bssgp_dispatch_ns_unitdata_req_cb, sgsn_nsi);
gprs_llc_init("/usr/local/lib/osmocom/crypt/");
sgsn_rate_ctr_init();
diff --git a/src/sgsn/sgsn_vty.c b/src/sgsn/sgsn_vty.c
index 0929f1f..db76c35 100644
--- a/src/sgsn/sgsn_vty.c
+++ b/src/sgsn/sgsn_vty.c
@@ -37,6 +37,7 @@
#include <osmocom/gprs/gprs_ns2.h>
#include <osmocom/sgsn/gprs_gb.h>
#include <osmocom/sgsn/gprs_gmm.h>
+#include <osmocom/sgsn/gprs_bssgp.h>
#include <osmocom/sgsn/gprs_sgsn.h>
#include <osmocom/sgsn/gtp_mme.h>
#include <osmocom/sgsn/vty.h>
@@ -1284,7 +1285,7 @@
return CMD_WARNING;
}
- gprs_gb_page_ps_ra(mm);
+ sgsn_bssgp_page_ps_ra(mm);
return CMD_SUCCESS;
}
diff --git a/tests/sgsn/Makefile.am b/tests/sgsn/Makefile.am
index bd8e19c..5a01903 100644
--- a/tests/sgsn/Makefile.am
+++ b/tests/sgsn/Makefile.am
@@ -47,6 +47,7 @@
$(NULL)
sgsn_test_LDADD = \
+ $(top_builddir)/src/sgsn/gprs_bssgp.o \
$(top_builddir)/src/sgsn/gprs_llc.o \
$(top_builddir)/src/sgsn/gprs_gb.o \
$(top_builddir)/src/sgsn/gprs_sndcp.o \
--
To view, visit https://gerrit.osmocom.org/c/osmo-sgsn/+/30784
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-sgsn
Gerrit-Branch: master
Gerrit-Change-Id: I816396ab5ccb86032bbc21b41a959934a7768780
Gerrit-Change-Number: 30784
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
Gerrit-MessageType: newchange
fixeria has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-trx/+/30783 )
Change subject: configure.ac: fix: properly check whether to enable ms-trx
......................................................................
configure.ac: fix: properly check whether to enable ms-trx
Condition 'test ENABLE_MS_TRX' is always true because 'ENABLE_MS_TRX'
is a string literal, not a variable... Because of this, automeke will
unconditionally try to configure the submodule.
Change-Id: Icbb9278c688bfe506d5ad726f16a6c200572de1b
Fixes: b7253c6fdc88a3e2e0c8b441dc3c34dfb1c15d24
Related: OS#5599
---
M configure.ac
1 file changed, 1 insertion(+), 1 deletion(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-trx refs/changes/83/30783/1
diff --git a/configure.ac b/configure.ac
index 699fb32..ff1ae8b 100644
--- a/configure.ac
+++ b/configure.ac
@@ -334,7 +334,7 @@
AC_MSG_RESULT([CXXFLAGS="$CXXFLAGS"])
AC_MSG_RESULT([LDFLAGS="$LDFLAGS"])
-if test ENABLE_MS_TRX; then
+if test "x$with_mstrx" = "xyes"; then
AC_MSG_NOTICE(["Enabling ms-trx..."])
AC_CONFIG_SUBDIRS([osmocom-bb/src/host/trxcon])
fi
--
To view, visit https://gerrit.osmocom.org/c/osmo-trx/+/30783
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-trx
Gerrit-Branch: master
Gerrit-Change-Id: Icbb9278c688bfe506d5ad726f16a6c200572de1b
Gerrit-Change-Number: 30783
Gerrit-PatchSet: 1
Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-MessageType: newchange
pespin has submitted this change. ( https://gerrit.osmocom.org/c/osmo-hnbgw/+/30723 )
Change subject: context_map: Lower loglevel to INFO when deallocating context IDs
......................................................................
context_map: Lower loglevel to INFO when deallocating context IDs
Change-Id: Iefe13934d097d646db232127040feb02db37bc38
---
M src/osmo-hnbgw/context_map.c
1 file changed, 2 insertions(+), 2 deletions(-)
Approvals:
fixeria: Looks good to me, but someone else must approve
osmith: Looks good to me, approved
Jenkins Builder: Verified
diff --git a/src/osmo-hnbgw/context_map.c b/src/osmo-hnbgw/context_map.c
index 7549942..98dffad 100644
--- a/src/osmo-hnbgw/context_map.c
+++ b/src/osmo-hnbgw/context_map.c
@@ -165,7 +165,7 @@
void context_map_deactivate(struct hnbgw_context_map *map)
{
- LOG_MAP(map, DMAIN, LOGL_NOTICE, "Deactivating\n");
+ LOG_MAP(map, DMAIN, LOGL_INFO, "Deactivating\n");
/* set the state to reserved. We still show up in the list and
* avoid re-allocation of the context-id until we are cleaned up
@@ -205,7 +205,7 @@
case MAP_S_RESERVED2:
/* second time we see this reserved
* entry: remove it */
- LOG_MAP(map, DMAIN, LOGL_NOTICE, "Deallocating\n");
+ LOG_MAP(map, DMAIN, LOGL_INFO, "Deallocating\n");
map->state = MAP_S_NULL;
llist_del(&map->cn_list);
llist_del(&map->hnb_list);
--
To view, visit https://gerrit.osmocom.org/c/osmo-hnbgw/+/30723
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-hnbgw
Gerrit-Branch: master
Gerrit-Change-Id: Iefe13934d097d646db232127040feb02db37bc38
Gerrit-Change-Number: 30723
Gerrit-PatchSet: 2
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: dexter <pmaier(a)sysmocom.de>
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: lynxis lazus <lynxis(a)fe80.eu>
Gerrit-Reviewer: osmith <osmith(a)sysmocom.de>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-MessageType: merged