Attention is currently required from: pespin.
laforge has posted comments on this change by pespin. ( https://gerrit.osmocom.org/c/osmo-hnbgw/+/39983?usp=email )
Change subject: Rename function s/hnbgw_decode_ranap_co/hnbgw_decode_ranap_cn_co/g
......................................................................
Patch Set 1:
(1 comment)
File src/osmo-hnbgw/context_map_rua.c:
https://gerrit.osmocom.org/c/osmo-hnbgw/+/39983/comment/c8357974_a9691339?u… :
PS1, Line 140: hnbgw_decode_ranap_cn_co
now I'm confused. _cn_ seems to indicate from the core network. That's DL, but you say UL in your comment change above?a
--
To view, visit https://gerrit.osmocom.org/c/osmo-hnbgw/+/39983?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: comment
Gerrit-Project: osmo-hnbgw
Gerrit-Branch: master
Gerrit-Change-Id: Ia4e5a21a9724ebf759b62c13759a776189b09e91
Gerrit-Change-Number: 39983
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-CC: laforge <laforge(a)osmocom.org>
Gerrit-Attention: pespin <pespin(a)sysmocom.de>
Gerrit-Comment-Date: Tue, 08 Apr 2025 18:10:45 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Attention is currently required from: pespin.
laforge has posted comments on this change by pespin. ( https://gerrit.osmocom.org/c/osmo-hnbgw/+/39979?usp=email )
Change subject: hnbap: Make hnbgw_tx_ue_register_acc_tmsi() signature similar to hnbgw_tx_ue_register_acc()
......................................................................
Patch Set 1: Code-Review+1
--
To view, visit https://gerrit.osmocom.org/c/osmo-hnbgw/+/39979?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: comment
Gerrit-Project: osmo-hnbgw
Gerrit-Branch: master
Gerrit-Change-Id: I9ce01babda7cb7e415cb7514c26f10a1773166fa
Gerrit-Change-Number: 39979
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Attention: pespin <pespin(a)sysmocom.de>
Gerrit-Comment-Date: Tue, 08 Apr 2025 18:09:20 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-hnbgw/+/39983?usp=email )
Change subject: Rename function s/hnbgw_decode_ranap_co/hnbgw_decode_ranap_cn_co/g
......................................................................
Rename function s/hnbgw_decode_ranap_co/hnbgw_decode_ranap_cn_co/g
This function is only used to decode UL RANAP messages. Mark it as "CN"
like most other related APIs.
Change-Id: Ia4e5a21a9724ebf759b62c13759a776189b09e91
---
M include/osmocom/hnbgw/hnbgw_rua.h
M src/osmo-hnbgw/context_map_rua.c
M src/osmo-hnbgw/hnbgw_l3.c
3 files changed, 5 insertions(+), 5 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-hnbgw refs/changes/83/39983/1
diff --git a/include/osmocom/hnbgw/hnbgw_rua.h b/include/osmocom/hnbgw/hnbgw_rua.h
index b7e7ee6..55e90c0 100644
--- a/include/osmocom/hnbgw/hnbgw_rua.h
+++ b/include/osmocom/hnbgw/hnbgw_rua.h
@@ -13,4 +13,4 @@
int rua_tx_disc(struct hnb_context *hnb, int is_ps, uint32_t context_id,
const RUA_Cause_t *cause, const uint8_t *data, unsigned int len);
-ranap_message *hnbgw_decode_ranap_co(struct msgb *ranap_msg);
+ranap_message *hnbgw_decode_ranap_cn_co(struct msgb *ranap_msg);
diff --git a/src/osmo-hnbgw/context_map_rua.c b/src/osmo-hnbgw/context_map_rua.c
index 2d9fd8d..f73b8e2 100644
--- a/src/osmo-hnbgw/context_map_rua.c
+++ b/src/osmo-hnbgw/context_map_rua.c
@@ -134,10 +134,10 @@
return 0;
}
-/* Decode RANAP message with convenient memory freeing: just talloc_free() the returned pointer..
+/* Decode UL RANAP message with convenient memory freeing: just talloc_free() the returned pointer..
* Allocate a ranap_message from OTC_SELECT, decode RANAP msgb into it, attach a talloc destructor that calls
* ranap_cn_rx_co_free() upon talloc_free(), and return the decoded ranap_message. */
-ranap_message *hnbgw_decode_ranap_co(struct msgb *ranap_msg)
+ranap_message *hnbgw_decode_ranap_cn_co(struct msgb *ranap_msg)
{
int rc;
ranap_message *message;
@@ -166,7 +166,7 @@
if (!msg_has_l2_data(ranap_msg))
return 0;
- ranap_message *message = hnbgw_decode_ranap_co(ranap_msg);
+ ranap_message *message = hnbgw_decode_ranap_cn_co(ranap_msg);
if (message) {
LOGPFSML(fi, LOGL_DEBUG, "rx from RUA: RANAP %s\n",
get_value_string(ranap_procedure_code_vals, message->procedureCode));
diff --git a/src/osmo-hnbgw/hnbgw_l3.c b/src/osmo-hnbgw/hnbgw_l3.c
index a6c44f7..65d9eff 100644
--- a/src/osmo-hnbgw/hnbgw_l3.c
+++ b/src/osmo-hnbgw/hnbgw_l3.c
@@ -314,7 +314,7 @@
* This is relevant for CN pooling, to decide which CN link to map the RUA context to. */
int hnbgw_peek_l3_ul(struct hnbgw_context_map *map, struct msgb *ranap_msg)
{
- ranap_message *message = hnbgw_decode_ranap_co(ranap_msg);
+ ranap_message *message = hnbgw_decode_ranap_cn_co(ranap_msg);
if (!message) {
LOGP(DCN, LOGL_ERROR, "Failed to decode RANAP PDU\n");
return -EINVAL;
--
To view, visit https://gerrit.osmocom.org/c/osmo-hnbgw/+/39983?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: newchange
Gerrit-Project: osmo-hnbgw
Gerrit-Branch: master
Gerrit-Change-Id: Ia4e5a21a9724ebf759b62c13759a776189b09e91
Gerrit-Change-Number: 39983
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-hnbgw/+/39984?usp=email )
Change subject: Add function helper hnbgw_decode_ranap_ran_co()
......................................................................
Add function helper hnbgw_decode_ranap_ran_co()
Similar to already existing counterpart hnbgw_decode_ranap_cn_co().
This helps simplifying logic into smaller chunks, and will make both UL
and DL look more similar.
Change-Id: Ifbb058d5340a6cb3a1703415e49c0de04fa6aec1
---
M src/osmo-hnbgw/context_map_sccp.c
1 file changed, 22 insertions(+), 5 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-hnbgw refs/changes/84/39984/1
diff --git a/src/osmo-hnbgw/context_map_sccp.c b/src/osmo-hnbgw/context_map_sccp.c
index c933e8d..fc82426 100644
--- a/src/osmo-hnbgw/context_map_sccp.c
+++ b/src/osmo-hnbgw/context_map_sccp.c
@@ -193,10 +193,29 @@
return 0;
}
+/* Decode DL RANAP message with convenient memory freeing: just talloc_free() the returned pointer..
+ * Allocate a ranap_message from OTC_SELECT, decode RANAP msgb into it, attach a talloc destructor that calls
+ * ranap_cn_rx_co_free() upon talloc_free(), and return the decoded ranap_message. */
+static ranap_message *hnbgw_decode_ranap_ran_co(struct msgb *ranap_msg)
+{
+ int rc;
+ ranap_message *message;
+
+ if (!msg_has_l2_data(ranap_msg))
+ return NULL;
+ message = talloc_zero(OTC_SELECT, ranap_message);
+ rc = ranap_ran_rx_co_decode(NULL, message, msgb_l2(ranap_msg), msgb_l2len(ranap_msg));
+ if (rc != 0) {
+ talloc_free(message);
+ return NULL;
+ }
+ talloc_set_destructor(message, destruct_ranap_ran_rx_co_ies);
+ return message;
+}
+
static int handle_rx_sccp(struct osmo_fsm_inst *fi, struct msgb *ranap_msg)
{
struct hnbgw_context_map *map = fi->priv;
- int rc;
/* If the FSM instance has already terminated, don't dispatch anything. */
if (fi->proc.terminating)
@@ -208,10 +227,8 @@
/* See if it is a RAB Assignment Request message from SCCP to RUA, where we need to change the user plane
* information, for RTP mapping via MGW, or GTP mapping via UPF. */
- ranap_message *message;
- message = talloc_zero(OTC_SELECT, ranap_message);
- rc = ranap_ran_rx_co_decode(message, message, msgb_l2(ranap_msg), msgb_l2len(ranap_msg));
- if (rc == 0) {
+ ranap_message *message = hnbgw_decode_ranap_ran_co(ranap_msg);
+ if (message) {
talloc_set_destructor(message, destruct_ranap_ran_rx_co_ies);
LOGPFSML(fi, LOGL_DEBUG, "rx from SCCP: RANAP %s\n",
--
To view, visit https://gerrit.osmocom.org/c/osmo-hnbgw/+/39984?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: newchange
Gerrit-Project: osmo-hnbgw
Gerrit-Branch: master
Gerrit-Change-Id: Ifbb058d5340a6cb3a1703415e49c0de04fa6aec1
Gerrit-Change-Number: 39984
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-iuh/+/39980?usp=email )
Change subject: ranap_common_ran: remove unused ctx args
......................................................................
ranap_common_ran: remove unused ctx args
This commit is basically 8b6dad3331eab339a7ffea7c22ed1830fe9ced60
applied to ranap_common_ran instead of ranap_common_cn.
ranap_ran_rx_co has a void *ctx argument, that gets passed to:
* a callback function and
* to various decode functions in the same file.
As it is named "ctx", it looks like a talloc context. But the decode
functions don't use ctx at all and so in reality it is private userdata
for the callback. It is used as such by test/hnb-test-rua and in
osmo-msc.
Change-Id: I57b320c2fdd72d11b87507d0cd9c2e7b479e7fe4
---
M TODO-RELEASE
M include/osmocom/ranap/ranap_common_ran.h
M src/ranap_common_ran.c
3 files changed, 16 insertions(+), 7 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-iuh refs/changes/80/39980/1
diff --git a/TODO-RELEASE b/TODO-RELEASE
index 0ed7189..34f3506 100644
--- a/TODO-RELEASE
+++ b/TODO-RELEASE
@@ -7,3 +7,5 @@
# 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-ranap add API ranap_ran_rx_co_decode2()
+libosmo-ranap deprecate API ranap_ran_rx_co_decode()
diff --git a/include/osmocom/ranap/ranap_common_ran.h b/include/osmocom/ranap/ranap_common_ran.h
index 5eef272..7118c7e 100644
--- a/include/osmocom/ranap/ranap_common_ran.h
+++ b/include/osmocom/ranap/ranap_common_ran.h
@@ -9,7 +9,9 @@
void ranap_ran_rx_co_free(ranap_message *message);
/* decode a connection-oriented RANAP message */
-int ranap_ran_rx_co_decode(void *ctx, ranap_message *message, uint8_t *data, size_t len);
+int ranap_ran_rx_co_decode2(ranap_message *message, uint8_t *data, size_t len);
+int ranap_ran_rx_co_decode(void *unused, ranap_message *message, uint8_t *data, size_t len)
+ OSMO_DEPRECATED("Use ranap_ran_rx_co_decode2() instead, the first arg is not used");
/* receive a connection-oriented RANAP message */
int ranap_ran_rx_co(ranap_handle_cb cb, void *ctx, uint8_t *data, size_t len);
diff --git a/src/ranap_common_ran.c b/src/ranap_common_ran.c
index 828587e..fe11610 100644
--- a/src/ranap_common_ran.c
+++ b/src/ranap_common_ran.c
@@ -33,7 +33,7 @@
#define DRANAP _ranap_DRANAP
-static int ran_ranap_rx_initiating_msg_co(void *ctx, RANAP_InitiatingMessage_t *imsg, ranap_message *message)
+static int ran_ranap_rx_initiating_msg_co(RANAP_InitiatingMessage_t *imsg, ranap_message *message)
{
int rc = 0;
@@ -232,13 +232,13 @@
}
}
-static int _ran_ranap_rx_co(void *ctx, RANAP_RANAP_PDU_t *pdu, ranap_message *message)
+static int _ran_ranap_rx_co(RANAP_RANAP_PDU_t *pdu, ranap_message *message)
{
int rc = 0;
switch (pdu->present) {
case RANAP_RANAP_PDU_PR_initiatingMessage:
- rc = ran_ranap_rx_initiating_msg_co(ctx, &pdu->choice.initiatingMessage, message);
+ rc = ran_ranap_rx_initiating_msg_co(&pdu->choice.initiatingMessage, message);
break;
case RANAP_RANAP_PDU_PR_successfulOutcome:
rc = ran_ranap_rx_successful_msg_co(&pdu->choice.successfulOutcome, message);
@@ -289,7 +289,7 @@
}
/* decode a connection-oriented RANAP message */
-int ranap_ran_rx_co_decode(void *ctx, ranap_message *message, uint8_t *data, size_t len)
+int ranap_ran_rx_co_decode2(ranap_message *message, uint8_t *data, size_t len)
{
RANAP_RANAP_PDU_t *pdu = NULL;
asn_dec_rval_t dec_ret;
@@ -306,7 +306,7 @@
message->direction = pdu->present;
- rc = _ran_ranap_rx_co(ctx, pdu, message);
+ rc = _ran_ranap_rx_co(pdu, message);
error_free:
ASN_STRUCT_FREE(asn_DEF_RANAP_RANAP_PDU, pdu);
@@ -314,6 +314,11 @@
return rc;
}
+int ranap_ran_rx_co_decode(void *unused, ranap_message *message, uint8_t *data, size_t len)
+{
+ return ranap_ran_rx_co_decode2(message, data, len);
+}
+
/* receive a connection-oriented RANAP message and call
* cn_ranap_handle_co() with the resulting ranap_message struct */
int ranap_ran_rx_co(ranap_handle_cb cb, void *ctx, uint8_t *data, size_t len)
@@ -321,7 +326,7 @@
ranap_message message;
int rc;
- rc = ranap_ran_rx_co_decode(ctx, &message, data, len);
+ rc = ranap_ran_rx_co_decode2(&message, data, len);
if (rc == 0)
(*cb) (ctx, &message);
--
To view, visit https://gerrit.osmocom.org/c/osmo-iuh/+/39980?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: newchange
Gerrit-Project: osmo-iuh
Gerrit-Branch: master
Gerrit-Change-Id: I57b320c2fdd72d11b87507d0cd9c2e7b479e7fe4
Gerrit-Change-Number: 39980
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin(a)sysmocom.de>