pespin has submitted this change. ( https://gerrit.osmocom.org/c/osmo-mgw/+/33304 )
Change subject: mgcp_client: Introduce mgcp_client_conf_alloc(), deprecate mgcp_client_conf_init()
......................................................................
mgcp_client: Introduce mgcp_client_conf_alloc(), deprecate mgcp_client_conf_init()
So far, the users of the old non-pooled API were in charge of allocating
the struct mgcp_client_conf by themselves, then init them using
mgcp_client_conf_init(). This causes a major problem, since it makes it
difficult to extend the struct mgcp_client_conf structure to add new
features, which may happen frequently.
The MGW pool API doesn't have this problem, because the struct
mgcp_client_conf is allocated as parts/fields of private structs defined
in internal headers. Only pointers to it are used in public headers.
Since it still has to internally initialize the conf fields, we still
need the API to initialize it internally, and hence why is it marked as
DEPRECTED_OUTSIDE instead of DEPRECATED.
While some programs already moved to the new MGW pool infrastructure,
they still use the old APIs to accomodate for old config files in order
to be back-compatible, hence most users of libosmo-mgcp-client are
affected.
Introduce an API to allocate the conf struct internally, which, while
still breaking the ABI, allows for a more relaxed update path where it's
possible to extend the struct mgcp_client_conf at the end.
Eventually the non pooled API should be gone and the struct
mgcp_client_conf can then be moved to a private header, but for now
let's add this small feature to avoid major ABI breakage.
Change-Id: Iba0853ed099a32cf1dde78c17e1b34343db41cfc
---
M TODO-RELEASE
M configure.ac
M include/Makefile.am
A include/osmocom/mgcp_client/defs.h
M include/osmocom/mgcp_client/mgcp_client.h
M src/libosmo-mgcp-client/mgcp_client.c
M tests/mgcp_client/mgcp_client_test.c
7 files changed, 79 insertions(+), 10 deletions(-)
Approvals:
pespin: Looks good to me, approved
Jenkins Builder: Verified
diff --git a/TODO-RELEASE b/TODO-RELEASE
index c5a3b36..69b38a9 100644
--- a/TODO-RELEASE
+++ b/TODO-RELEASE
@@ -24,3 +24,5 @@
# If any interfaces have been removed or changed since the last public release, a=0.
#
#library what description / commit summary line
+libosmo-mgcp-client NEW API mgcp_client_conf_alloc()
+libosmo-mgcp-client DEPRECATED mgcp_client_conf_init()
\ No newline at end of file
diff --git a/configure.ac b/configure.ac
index db8c4e6..8aa9c4e 100644
--- a/configure.ac
+++ b/configure.ac
@@ -52,7 +52,8 @@
PKG_CHECK_MODULES(LIBOSMOABIS, libosmoabis >= 1.4.0)
PKG_CHECK_MODULES(LIBOSMOTRAU, libosmotrau >= 1.4.0)
-CFLAGS="$CFLAGS -pthread"
+CFLAGS="$CFLAGS -DBUILDING_LIBOSMOMGCPCLIENT -pthread"
+CPPFLAGS="$CPPFLAGS -DBUILDING_LIBOSMOMGCPCLIENT -pthread"
LDFLAGS="$LDFLAGS -pthread"
AC_ARG_ENABLE(sanitize,
diff --git a/include/Makefile.am b/include/Makefile.am
index eb262a6..0b66cb3 100644
--- a/include/Makefile.am
+++ b/include/Makefile.am
@@ -3,6 +3,7 @@
$(NULL)
nobase_include_HEADERS = \
+ osmocom/mgcp_client/defs.h \
osmocom/mgcp_client/mgcp_client.h \
osmocom/mgcp_client/mgcp_client_endpoint_fsm.h \
osmocom/mgcp_client/mgcp_client_fsm.h \
diff --git a/include/osmocom/mgcp_client/defs.h b/include/osmocom/mgcp_client/defs.h
new file mode 100644
index 0000000..edf27d1
--- /dev/null
+++ b/include/osmocom/mgcp_client/defs.h
@@ -0,0 +1,7 @@
+#include <osmocom/core/defs.h>
+
+#if BUILDING_LIBOSMOMGCPCLIENT
+# define OSMO_DEPRECATED_OUTSIDE_LIBOSMOMGCPCLIENT(text)
+#else
+# define OSMO_DEPRECATED_OUTSIDE_LIBOSMOMGCPCLIENT(text) OSMO_DEPRECATED(text)
+#endif
diff --git a/include/osmocom/mgcp_client/mgcp_client.h b/include/osmocom/mgcp_client/mgcp_client.h
index 6adaf4b..46ec210 100644
--- a/include/osmocom/mgcp_client/mgcp_client.h
+++ b/include/osmocom/mgcp_client/mgcp_client.h
@@ -3,6 +3,7 @@
#include <stdint.h>
#include <arpa/inet.h>
+#include <osmocom/mgcp_client/defs.h>
#include <osmocom/mgcp_client/mgcp_common.h>
/* See also: RFC 3435, chapter 3.5 Transmission over UDP */
@@ -133,7 +134,8 @@
struct mgcp_codec_param param;
};
-void mgcp_client_conf_init(struct mgcp_client_conf *conf);
+struct mgcp_client_conf *mgcp_client_conf_alloc(void *ctx);
+void mgcp_client_conf_init(struct mgcp_client_conf *conf) OSMO_DEPRECATED_OUTSIDE_LIBOSMOMGCPCLIENT("use mgcp_client_conf_alloc() (or even better, switch to the mgcp_client_pool API!)");
void mgcp_client_vty_init(void *talloc_ctx, int node, struct mgcp_client_conf *conf);
int mgcp_client_config_write(struct vty *vty, const char *indent);
struct mgcp_client_conf *mgcp_client_conf_actual(struct mgcp_client *mgcp);
diff --git a/src/libosmo-mgcp-client/mgcp_client.c b/src/libosmo-mgcp-client/mgcp_client.c
index fc7d8e8..f0f320c 100644
--- a/src/libosmo-mgcp-client/mgcp_client.c
+++ b/src/libosmo-mgcp-client/mgcp_client.c
@@ -194,9 +194,7 @@
return pt;
}
-/*! Initialize MGCP client configuration struct with default values.
- * \param[out] conf Client configuration.*/
-void mgcp_client_conf_init(struct mgcp_client_conf *conf)
+static void _mgcp_client_conf_init(struct mgcp_client_conf *conf)
{
/* NULL and -1 default to MGCP_CLIENT_*_DEFAULT values */
*conf = (struct mgcp_client_conf){
@@ -209,6 +207,29 @@
INIT_LLIST_HEAD(&conf->reset_epnames);
}
+/*! Allocate and initialize MGCP client configuration struct with default values.
+ * \param[in] ctx talloc context to use as a parent during allocation.
+ *
+ * The returned struct can be freed using talloc_free().
+ */
+struct mgcp_client_conf *mgcp_client_conf_alloc(void *ctx)
+{
+ struct mgcp_client_conf *conf = talloc(ctx, struct mgcp_client_conf);
+ _mgcp_client_conf_init(conf);
+ return conf;
+}
+
+/*! Initialize MGCP client configuration struct with default values.
+ * \param[out] conf Client configuration.
+ *
+ * This function is deprecated and should not be used, as it may break if size
+ * of struct mgcp_client_conf changes in the future!
+ */
+void mgcp_client_conf_init(struct mgcp_client_conf *conf)
+{
+ _mgcp_client_conf_init(conf);
+}
+
static void mgcp_client_handle_response(struct mgcp_client *mgcp,
struct mgcp_response_pending *pending,
struct mgcp_response *response)
diff --git a/tests/mgcp_client/mgcp_client_test.c b/tests/mgcp_client/mgcp_client_test.c
index ef05adc..37c5f6c 100644
--- a/tests/mgcp_client/mgcp_client_test.c
+++ b/tests/mgcp_client/mgcp_client_test.c
@@ -73,7 +73,7 @@
return msg;
}
-static struct mgcp_client_conf conf;
+static struct mgcp_client_conf *conf;
struct mgcp_client *mgcp = NULL;
static int reply_to(mgcp_trans_id_t trans_id, int code, const char *comment,
@@ -162,7 +162,7 @@
if (mgcp)
talloc_free(mgcp);
- mgcp = mgcp_client_init(ctx, &conf);
+ mgcp = mgcp_client_init(ctx, conf);
printf("\n");
@@ -339,7 +339,7 @@
if (mgcp)
talloc_free(mgcp);
- mgcp = mgcp_client_init(ctx, &conf);
+ mgcp = mgcp_client_init(ctx, conf);
msg = mgcp_msg_gen(mgcp, &mgcp_msg);
trans_id = mgcp_msg_trans_id(msg);
@@ -630,7 +630,7 @@
if (mgcp)
talloc_free(mgcp);
- mgcp = mgcp_client_init(ctx, &conf);
+ mgcp = mgcp_client_init(ctx, conf);
/* Valid endpoint names */
epname = (char *)mgcp_client_e1_epname(ctx, mgcp, 1, 15, 64, 0);
@@ -697,7 +697,7 @@
log_set_category_filter(osmo_stderr_target, DLMGCP, 1, LOGL_DEBUG);
- mgcp_client_conf_init(&conf);
+ conf = mgcp_client_conf_alloc(ctx);
test_mgcp_msg();
test_mgcp_client_cancel();
--
To view, visit https://gerrit.osmocom.org/c/osmo-mgw/+/33304
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-mgw
Gerrit-Branch: master
Gerrit-Change-Id: Iba0853ed099a32cf1dde78c17e1b34343db41cfc
Gerrit-Change-Number: 33304
Gerrit-PatchSet: 4
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: dexter <pmaier(a)sysmocom.de>
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: osmith <osmith(a)sysmocom.de>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-MessageType: merged
Attention is currently required from: pespin.
Hello osmith, Jenkins Builder, laforge, dexter,
I'd like you to reexamine a change. Please visit
https://gerrit.osmocom.org/c/osmo-mgw/+/33304
to look at the new patch set (#4).
Change subject: mgcp_client: Introduce mgcp_client_conf_alloc(), deprecate mgcp_client_conf_init()
......................................................................
mgcp_client: Introduce mgcp_client_conf_alloc(), deprecate mgcp_client_conf_init()
So far, the users of the old non-pooled API were in charge of allocating
the struct mgcp_client_conf by themselves, then init them using
mgcp_client_conf_init(). This causes a major problem, since it makes it
difficult to extend the struct mgcp_client_conf structure to add new
features, which may happen frequently.
The MGW pool API doesn't have this problem, because the struct
mgcp_client_conf is allocated as parts/fields of private structs defined
in internal headers. Only pointers to it are used in public headers.
Since it still has to internally initialize the conf fields, we still
need the API to initialize it internally, and hence why is it marked as
DEPRECTED_OUTSIDE instead of DEPRECATED.
While some programs already moved to the new MGW pool infrastructure,
they still use the old APIs to accomodate for old config files in order
to be back-compatible, hence most users of libosmo-mgcp-client are
affected.
Introduce an API to allocate the conf struct internally, which, while
still breaking the ABI, allows for a more relaxed update path where it's
possible to extend the struct mgcp_client_conf at the end.
Eventually the non pooled API should be gone and the struct
mgcp_client_conf can then be moved to a private header, but for now
let's add this small feature to avoid major ABI breakage.
Change-Id: Iba0853ed099a32cf1dde78c17e1b34343db41cfc
---
M TODO-RELEASE
M configure.ac
M include/Makefile.am
A include/osmocom/mgcp_client/defs.h
M include/osmocom/mgcp_client/mgcp_client.h
M src/libosmo-mgcp-client/mgcp_client.c
M tests/mgcp_client/mgcp_client_test.c
7 files changed, 79 insertions(+), 10 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-mgw refs/changes/04/33304/4
--
To view, visit https://gerrit.osmocom.org/c/osmo-mgw/+/33304
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-mgw
Gerrit-Branch: master
Gerrit-Change-Id: Iba0853ed099a32cf1dde78c17e1b34343db41cfc
Gerrit-Change-Number: 33304
Gerrit-PatchSet: 4
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: dexter <pmaier(a)sysmocom.de>
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: osmith <osmith(a)sysmocom.de>
Gerrit-Attention: pespin <pespin(a)sysmocom.de>
Gerrit-MessageType: newpatchset
pespin has submitted this change. ( https://gerrit.osmocom.org/c/osmo-pcu/+/33303 )
Change subject: cosmetic: Improve comment
......................................................................
cosmetic: Improve comment
Change-Id: I8c963ba7421faf2b3dcab006ea629c4628d17b44
---
M src/tbf_ul_ass_fsm.c
1 file changed, 12 insertions(+), 3 deletions(-)
Approvals:
Jenkins Builder: Verified
laforge: Looks good to me, approved
diff --git a/src/tbf_ul_ass_fsm.c b/src/tbf_ul_ass_fsm.c
index 26ed8ee..6f88f11 100644
--- a/src/tbf_ul_ass_fsm.c
+++ b/src/tbf_ul_ass_fsm.c
@@ -195,10 +195,10 @@
unsigned int sec, micro;
struct GprsMs *ms = tbf_ms(ctx->tbf);
- /* Here it's time where received PKT RES REQ or DL ACK/NACK to request a new UL TBF,
+ /* Here it's point in time where we received PKT RES REQ or DL ACK/NACK to request a new UL TBF,
* so MS will be gone after T3168 (* 4 retrans, 8.1.1.1.2) if we are unable to seize it.
- * Hence, attempt re-scheduling PKT UL ASS (states SEND_ASS<->WAIT_ACK ping-pong)
- * until T3168 we announced to the MS expires:
+ * Hence, attempt re-scheduling PKT UL ASS (states SEND_ASS<->WAIT_ACK ping-pong) until T3168 we
+ * announced (SI13) to the MS expires:
*/
if (prev_state == TBF_UL_ASS_NONE) {
/* tbf_free() called upon trigger */
--
To view, visit https://gerrit.osmocom.org/c/osmo-pcu/+/33303
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-pcu
Gerrit-Branch: master
Gerrit-Change-Id: I8c963ba7421faf2b3dcab006ea629c4628d17b44
Gerrit-Change-Number: 33303
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: osmith <osmith(a)sysmocom.de>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-MessageType: merged
pespin has submitted this change. ( https://gerrit.osmocom.org/c/osmo-pcu/+/33280 )
Change subject: Move call to bts_snd_dl_ass() from tbf_dl.cpp to tbf_dl_fsm.c
......................................................................
Move call to bts_snd_dl_ass() from tbf_dl.cpp to tbf_dl_fsm.c
It makes more sense to have it there, where it is transmitted with more
control depending on current state. Furthermore, it's
counterpart/continuation TBF_EV_ASSIGN_PCUIF_CNF logic is already there,
so it makes sense to have the whole logic together.
Change-Id: I8af39d3087ccf197321f0c71cb29b67adbe1f36e
---
M src/tbf_dl.cpp
M src/tbf_dl_fsm.c
2 files changed, 26 insertions(+), 10 deletions(-)
Approvals:
Jenkins Builder: Verified
osmith: Looks good to me, but someone else must approve
laforge: Looks good to me, approved
diff --git a/src/tbf_dl.cpp b/src/tbf_dl.cpp
index 17d2934..40442c3 100644
--- a/src/tbf_dl.cpp
+++ b/src/tbf_dl.cpp
@@ -485,9 +485,6 @@
/* change state */
osmo_fsm_inst_dispatch(tbf->state_fi, TBF_EV_ASSIGN_ADD_CCCH, NULL);
-
- /* send immediate assignment */
- bts_snd_dl_ass(ms->bts, tbf);
}
int dl_tbf_upgrade_to_multislot(struct gprs_rlcmac_dl_tbf *dl_tbf)
diff --git a/src/tbf_dl_fsm.c b/src/tbf_dl_fsm.c
index a977507..02e1ff5 100644
--- a/src/tbf_dl_fsm.c
+++ b/src/tbf_dl_fsm.c
@@ -104,6 +104,7 @@
static void st_assign_on_enter(struct osmo_fsm_inst *fi, uint32_t prev_state)
{
struct tbf_dl_fsm_ctx *ctx = (struct tbf_dl_fsm_ctx *)fi->priv;
+ struct GprsMs *ms = tbf_ms(ctx->tbf);
unsigned long val;
unsigned int sec, micro;
@@ -125,20 +126,29 @@
sec, micro);
osmo_timer_schedule(&fi->timer, sec, micro);
} else {
- /* GPRS_RLCMAC_FLAG_CCCH is set, so here we submitted an DL Ass
+ /* GPRS_RLCMAC_FLAG_CCCH is set, so here we submit a DL Ass
* through PCUIF on CCCH */
+ OSMO_ASSERT(ctx->state_flags & (1 << GPRS_RLCMAC_FLAG_CCCH));
+ /* Send CCCH (PCH) Immediate Assignment over PCUIF: */
+ bts_snd_dl_ass(ms->bts, ctx->dl_tbf);
}
}
static void st_assign(struct osmo_fsm_inst *fi, uint32_t event, void *data)
{
struct tbf_dl_fsm_ctx *ctx = (struct tbf_dl_fsm_ctx *)fi->priv;
+ struct GprsMs *ms;
unsigned long val;
unsigned int sec, micro;
switch (event) {
case TBF_EV_ASSIGN_ADD_CCCH:
+ /* Note: This code path is not really used nowadays, since ADD_CCCH is
+ * only dispatched during dl_tbf allocation (st=NEW) */
+ ms = tbf_ms(ctx->tbf);
mod_ass_type(ctx, GPRS_RLCMAC_FLAG_CCCH, true);
+ /* Re-send CCCH (PCH) Immediate Assignment over PCUIF: */
+ bts_snd_dl_ass(ms->bts, ctx->dl_tbf);
break;
case TBF_EV_ASSIGN_ADD_PACCH:
mod_ass_type(ctx, GPRS_RLCMAC_FLAG_PACCH, true);
@@ -210,13 +220,8 @@
* from continuing and start assignment on CCCH again */
if ((ctx->state_flags & (1 << GPRS_RLCMAC_FLAG_CCCH)) &&
!dl_tbf_first_dl_ack_rcvd(ctx->dl_tbf)) {
- struct GprsMs *ms = tbf_ms(ctx->tbf);
- LOGPTBFDL(ctx->dl_tbf, LOGL_DEBUG,
- "Re-send downlink assignment on PCH (IMSI=%s)\n",
- ms_imsi_is_valid(ms) ? ms_imsi(ms) : "");
+ LOGPTBFDL(ctx->dl_tbf, LOGL_DEBUG, "Retransmit ImmAss[PktDlAss] on PCH\n");
tbf_dl_fsm_state_chg(fi, TBF_ST_ASSIGN);
- /* send immediate assignment */
- bts_snd_dl_ass(ms->bts, ctx->dl_tbf);
}
break;
case TBF_EV_LAST_DL_DATA_SENT:
--
To view, visit https://gerrit.osmocom.org/c/osmo-pcu/+/33280
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-pcu
Gerrit-Branch: master
Gerrit-Change-Id: I8af39d3087ccf197321f0c71cb29b67adbe1f36e
Gerrit-Change-Number: 33280
Gerrit-PatchSet: 3
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: osmith <osmith(a)sysmocom.de>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-MessageType: merged
Attention is currently required from: falconia, pespin, fixeria.
dexter has posted comments on this change. ( https://gerrit.osmocom.org/c/libosmocore/+/32740 )
Change subject: gsm620: make osmo_hr_check_sid compatible with RFC 5993
......................................................................
Patch Set 2: Code-Review-2
(1 comment)
Patchset:
PS1:
> @dexter - please read my notes under the Redmine ticket for OS#5688. […]
I thought this would be helpful but apparently it would cause even more problems. So then we should abandon this patch.
(Meanwhile OS#5688 got resolved.)
--
To view, visit https://gerrit.osmocom.org/c/libosmocore/+/32740
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: I25728299b757fbc87dd1b3f5adaec9b8b240c5d1
Gerrit-Change-Number: 32740
Gerrit-PatchSet: 2
Gerrit-Owner: dexter <pmaier(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: dexter <pmaier(a)sysmocom.de>
Gerrit-Reviewer: falconia <falcon(a)freecalypso.org>
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: falconia <falcon(a)freecalypso.org>
Gerrit-Attention: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Comment-Date: Wed, 14 Jun 2023 08:42:22 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Comment-In-Reply-To: falconia <falcon(a)freecalypso.org>
Comment-In-Reply-To: fixeria <vyanitskiy(a)sysmocom.de>
Comment-In-Reply-To: pespin <pespin(a)sysmocom.de>
Comment-In-Reply-To: dexter <pmaier(a)sysmocom.de>
Gerrit-MessageType: comment
dexter has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-bts/+/32752 )
Change subject: l1sap: cosmetic: rename payload_len to rtp_pl_len
......................................................................
Patch Set 4: Code-Review+2
(1 comment)
Patchset:
PS4:
I am re-adding the +2 we had before since all that changed was that the function amr_is_octet_aligned had been moved from l1sap.c to rtp_input_reen.c. Essentially nothing has changed in comparison to the previous patch-sets (which you cannot see anymore because gerrit deleted everything older, presumably because the file is now different.)
--
To view, visit https://gerrit.osmocom.org/c/osmo-bts/+/32752
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Change-Id: I8a0e0357aab2a78e25811f66b1b870e8c6ebffe9
Gerrit-Change-Number: 32752
Gerrit-PatchSet: 4
Gerrit-Owner: dexter <pmaier(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: dexter <pmaier(a)sysmocom.de>
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-Comment-Date: Wed, 14 Jun 2023 08:35:43 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment