Attention is currently required from: laforge, pespin, fixeria.
neels has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-upf/+/27631 )
Change subject: libosmo-pfcp: implement PFCP header and msg handling
......................................................................
Patch Set 7:
(1 comment)
File include/osmocom/pfcp/pfcp_msg.h:
https://gerrit.osmocom.org/c/osmo-upf/+/27631/comment/e1f2fac1_e2d2c39c
PS3, Line 44: #define OSMO_LOG_PFCP_MSG_SRC(M, LEVEL, file, line, FMT, ARGS...) do { \
> Its also the first time we are reaching this kind of complexit in a log macro...
in principle LOG_TS(), LOG_LCHAN() and others are doing similar things.
You can see them with this run across all osmo trees:
rgrep '#define.LOG_.*do' -A 10
I don't understand why you guys oppose this being a macro, and I guess I never will.
But if you insist, I can change it to a va_list function.
Maybe in a separate patch?
--
To view, visit https://gerrit.osmocom.org/c/osmo-upf/+/27631
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-upf
Gerrit-Branch: master
Gerrit-Change-Id: I3f85ea052a6b7c064244a8093777e53a47c8c61e
Gerrit-Change-Number: 27631
Gerrit-PatchSet: 7
Gerrit-Owner: neels <nhofmeyr(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-CC: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-CC: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: laforge <laforge(a)osmocom.org>
Gerrit-Attention: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Comment-Date: Wed, 08 Jun 2022 11:40:39 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: neels <nhofmeyr(a)sysmocom.de>
Comment-In-Reply-To: laforge <laforge(a)osmocom.org>
Comment-In-Reply-To: fixeria <vyanitskiy(a)sysmocom.de>
Comment-In-Reply-To: pespin <pespin(a)sysmocom.de>
Gerrit-MessageType: comment
Attention is currently required from: osmith, neels, laforge, fixeria.
pespin has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-bsc-nat/+/27712 )
Change subject: Add subscr_conn_fsm
......................................................................
Patch Set 5:
(1 comment)
File src/osmo-bsc-nat/bssap_conn.c:
https://gerrit.osmocom.org/c/osmo-bsc-nat/+/27712/comment/8b62b779_d5b703b7
PS4, Line 47: uint8_t tag = tag_order[i];
> Of course you can, it's just a matter of memmove the buffer a few bytes left/right and changing the […]
That's probably the best approach to be as transparent as possible leaving the whole message untoched, passing through unknown IEs, etc.
--
To view, visit https://gerrit.osmocom.org/c/osmo-bsc-nat/+/27712
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-bsc-nat
Gerrit-Branch: master
Gerrit-Change-Id: I7e491aada6f5db0eb35ef2039869c6ba07f9ca3b
Gerrit-Change-Number: 27712
Gerrit-PatchSet: 5
Gerrit-Owner: osmith <osmith(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: neels <nhofmeyr(a)sysmocom.de>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: osmith <osmith(a)sysmocom.de>
Gerrit-Attention: neels <nhofmeyr(a)sysmocom.de>
Gerrit-Attention: laforge <laforge(a)osmocom.org>
Gerrit-Attention: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Comment-Date: Wed, 08 Jun 2022 11:40:34 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: osmith <osmith(a)sysmocom.de>
Comment-In-Reply-To: neels <nhofmeyr(a)sysmocom.de>
Comment-In-Reply-To: pespin <pespin(a)sysmocom.de>
Gerrit-MessageType: comment
Attention is currently required from: osmith, neels, laforge, fixeria.
pespin has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-bsc-nat/+/27712 )
Change subject: Add subscr_conn_fsm
......................................................................
Patch Set 5:
(1 comment)
File src/osmo-bsc-nat/bssap_conn.c:
https://gerrit.osmocom.org/c/osmo-bsc-nat/+/27712/comment/72ef77e4_0d814e8c
PS4, Line 47: uint8_t tag = tag_order[i];
> The length of the IE is different depending on IPv4 or IPv6 address being encoded (3GPP TS 48. […]
Of course you can, it's just a matter of memmove the buffer a few bytes left/right and changing the len value of the IE in the buffer. And maybe some general "len" field at the message level. The rest of the IEs/message in the buffer should be independent of that change.
--
To view, visit https://gerrit.osmocom.org/c/osmo-bsc-nat/+/27712
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-bsc-nat
Gerrit-Branch: master
Gerrit-Change-Id: I7e491aada6f5db0eb35ef2039869c6ba07f9ca3b
Gerrit-Change-Number: 27712
Gerrit-PatchSet: 5
Gerrit-Owner: osmith <osmith(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: neels <nhofmeyr(a)sysmocom.de>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: osmith <osmith(a)sysmocom.de>
Gerrit-Attention: neels <nhofmeyr(a)sysmocom.de>
Gerrit-Attention: laforge <laforge(a)osmocom.org>
Gerrit-Attention: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Comment-Date: Wed, 08 Jun 2022 11:39:43 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: osmith <osmith(a)sysmocom.de>
Comment-In-Reply-To: neels <nhofmeyr(a)sysmocom.de>
Comment-In-Reply-To: pespin <pespin(a)sysmocom.de>
Gerrit-MessageType: comment
Attention is currently required from: neels, laforge, pespin, fixeria.
osmith has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-bsc-nat/+/27712 )
Change subject: Add subscr_conn_fsm
......................................................................
Patch Set 5:
(1 comment)
File src/osmo-bsc-nat/bssap_conn.c:
https://gerrit.osmocom.org/c/osmo-bsc-nat/+/27712/comment/cbae2127_e8bcd74b
PS4, Line 47: uint8_t tag = tag_order[i];
> The best approach is probably locating the important IE start of buffer by using tlv_parse, then sim […]
The length of the IE is different depending on IPv4 or IPv6 address being encoded (3GPP TS 48.008 § 3.2.2.102). So I can't just modify the existing buffer without re-encoding, I'll implement Neels approach. Thanks for the feedback!
--
To view, visit https://gerrit.osmocom.org/c/osmo-bsc-nat/+/27712
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-bsc-nat
Gerrit-Branch: master
Gerrit-Change-Id: I7e491aada6f5db0eb35ef2039869c6ba07f9ca3b
Gerrit-Change-Number: 27712
Gerrit-PatchSet: 5
Gerrit-Owner: osmith <osmith(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: neels <nhofmeyr(a)sysmocom.de>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: neels <nhofmeyr(a)sysmocom.de>
Gerrit-Attention: laforge <laforge(a)osmocom.org>
Gerrit-Attention: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Comment-Date: Wed, 08 Jun 2022 11:35:04 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: neels <nhofmeyr(a)sysmocom.de>
Comment-In-Reply-To: pespin <pespin(a)sysmocom.de>
Gerrit-MessageType: comment
Attention is currently required from: pespin.
Hello Jenkins Builder, laforge,
I'd like you to reexamine a change. Please visit
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/28228
to look at the new patch set (#2).
Change subject: GTP: Send more QoS IE fields by default
......................................................................
GTP: Send more QoS IE fields by default
This way we trigger more code paths in the GGSN_Tests IUT, like parsing
the QoS IE. This is interesting because the QoS IE has quite a complex
encoding, specially the MBR/GBR part. Those fields in turn are also
modified during the answer based on AVPs received during Gx set up of
that session.
Related: SYS#5984
Change-Id: Id195eedf530e2eff753d057ce2302dfb5275bfcd
---
M library/GTP_Templates.ttcn
1 file changed, 20 insertions(+), 20 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/28/28228/2
--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/28228
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: Id195eedf530e2eff753d057ce2302dfb5275bfcd
Gerrit-Change-Number: 28228
Gerrit-PatchSet: 2
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-CC: neels <nhofmeyr(a)sysmocom.de>
Gerrit-Attention: pespin <pespin(a)sysmocom.de>
Gerrit-MessageType: newpatchset
Attention is currently required from: osmith, neels, laforge, fixeria.
pespin has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-bsc-nat/+/27712 )
Change subject: Add subscr_conn_fsm
......................................................................
Patch Set 5:
(1 comment)
File src/osmo-bsc-nat/bssap_conn.c:
https://gerrit.osmocom.org/c/osmo-bsc-nat/+/27712/comment/7ada68e1_4223f2f1
PS4, Line 47: uint8_t tag = tag_order[i];
> About leaving all other known and unknown IEs unchanged: I think there can theoretically also be unk […]
The best approach is probably locating the important IE start of buffer by using tlv_parse, then simply modify that IE buffer with the new content and resend the buffer as it is, no need to encode it again?
--
To view, visit https://gerrit.osmocom.org/c/osmo-bsc-nat/+/27712
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-bsc-nat
Gerrit-Branch: master
Gerrit-Change-Id: I7e491aada6f5db0eb35ef2039869c6ba07f9ca3b
Gerrit-Change-Number: 27712
Gerrit-PatchSet: 5
Gerrit-Owner: osmith <osmith(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: neels <nhofmeyr(a)sysmocom.de>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: osmith <osmith(a)sysmocom.de>
Gerrit-Attention: neels <nhofmeyr(a)sysmocom.de>
Gerrit-Attention: laforge <laforge(a)osmocom.org>
Gerrit-Attention: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Comment-Date: Wed, 08 Jun 2022 11:12:21 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: neels <nhofmeyr(a)sysmocom.de>
Gerrit-MessageType: comment
neels has submitted this change. ( https://gerrit.osmocom.org/c/osmo-hnbgw/+/28230 )
Change subject: add option to send SCCP CR without payload
......................................................................
add option to send SCCP CR without payload
It is reported that a third-party SGSN is rejecting SCCP CR when the
SCCP message part exceeds a certain length. The solution is to first
send an SCCP CR without payload, and send the payload in a DT later.
Add config option
hnbgw
sccp cr max-payload-len <0-999999>
If the RANAP payload surpasses the given length, osmo-hnbgw will first
send an SCCP CR without payload, cache the RANAP payload, and put that
in an SCCP DT once the SCCP CC is received.
The original idea was to limit the size of the entire SCCP part of the
message, but I'm currently not sure how to determine that without
copying much of the osmo_sccp code. I figured using a limit on the RANAP
payload is sufficient. To avoid the error with above third-party SGSN,
the easy solution is to set max-payload-len to 0, so that we always get
a separate SCCP CR without payload.
Related: SYS#5968
Related: I827e081eaacfb8e76684ed1560603e6c8f896c38 (osmo-ttcn3-hacks)
Change-Id: If0c5c0a76e5230bf22871f527dcb2dbdf34d7328
---
M include/osmocom/hnbgw/context_map.h
M include/osmocom/hnbgw/hnbgw.h
M include/osmocom/hnbgw/hnbgw_rua.h
M src/osmo-hnbgw/context_map.c
M src/osmo-hnbgw/hnbgw.c
M src/osmo-hnbgw/hnbgw_cn.c
M src/osmo-hnbgw/hnbgw_rua.c
M src/osmo-hnbgw/hnbgw_vty.c
8 files changed, 122 insertions(+), 13 deletions(-)
Approvals:
Jenkins Builder: Verified
laforge: Looks good to me, but someone else must approve
pespin: Looks good to me, but someone else must approve
neels: Looks good to me, approved
diff --git a/include/osmocom/hnbgw/context_map.h b/include/osmocom/hnbgw/context_map.h
index 6910fe8..d6fc2e7 100644
--- a/include/osmocom/hnbgw/context_map.h
+++ b/include/osmocom/hnbgw/context_map.h
@@ -2,6 +2,9 @@
#include <stdint.h>
#include <osmocom/core/linuxlist.h>
+#include <osmocom/rua/RUA_CN-DomainIndicator.h>
+
+struct msgb;
enum hnbgw_context_map_state {
MAP_S_NULL,
@@ -33,6 +36,9 @@
bool is_ps;
/* SCCP User SAP connection ID */
uint32_t scu_conn_id;
+ /* Pending data to be sent: when we send an "empty" SCCP CR first, the initial RANAP message will be sent in a
+ * separate DT once the CR is confirmed. This caches the initial RANAP message. */
+ struct msgb *cached_msg;
enum hnbgw_context_map_state state;
@@ -49,6 +55,8 @@
struct hnbgw_context_map *
context_map_by_cn(struct hnbgw_cnlink *cn, uint32_t scu_conn_id);
+int context_map_send_cached_msg(struct hnbgw_context_map *map);
+
void context_map_deactivate(struct hnbgw_context_map *map);
int context_map_init(struct hnb_gw *gw);
diff --git a/include/osmocom/hnbgw/hnbgw.h b/include/osmocom/hnbgw/hnbgw.h
index 9a46301..76c5b84 100644
--- a/include/osmocom/hnbgw/hnbgw.h
+++ b/include/osmocom/hnbgw/hnbgw.h
@@ -134,6 +134,7 @@
bool hnbap_allow_tmsi;
/*! print hnb-id (true) or MCC-MNC-LAC-RAC-SAC (false) in logs */
bool log_prefix_hnb_id;
+ unsigned int max_sccp_cr_payload_len;
struct mgcp_client_conf *mgcp_client;
} config;
/*! SCTP listen socket for incoming connections */
@@ -175,3 +176,5 @@
void hnbgw_vty_init(struct hnb_gw *gw, void *tall_ctx);
int hnbgw_vty_go_parent(struct vty *vty);
+
+bool hnbgw_requires_empty_sccp_cr(struct hnb_gw *gw, unsigned int ranap_msg_len);
diff --git a/include/osmocom/hnbgw/hnbgw_rua.h b/include/osmocom/hnbgw/hnbgw_rua.h
index 4b65115..fa33d6b 100644
--- a/include/osmocom/hnbgw/hnbgw_rua.h
+++ b/include/osmocom/hnbgw/hnbgw_rua.h
@@ -2,6 +2,7 @@
#include <osmocom/hnbgw/hnbgw.h>
#include <osmocom/rua/RUA_Cause.h>
+#include <osmocom/rua/RUA_CN-DomainIndicator.h>
int hnbgw_rua_rx(struct hnb_context *hnb, struct msgb *msg);
int hnbgw_rua_init(void);
@@ -11,3 +12,9 @@
const uint8_t *data, unsigned int len);
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);
+
+int rua_to_scu(struct hnb_context *hnb,
+ RUA_CN_DomainIndicator_t cN_DomainIndicator,
+ enum osmo_scu_prim_type type,
+ uint32_t context_id, uint32_t cause,
+ const uint8_t *data, unsigned int len);
diff --git a/src/osmo-hnbgw/context_map.c b/src/osmo-hnbgw/context_map.c
index 18f71ce..5a7b48b 100644
--- a/src/osmo-hnbgw/context_map.c
+++ b/src/osmo-hnbgw/context_map.c
@@ -25,6 +25,7 @@
#include <osmocom/core/timer.h>
#include <osmocom/hnbgw/hnbgw.h>
+#include <osmocom/hnbgw/hnbgw_rua.h>
#include <osmocom/hnbgw/context_map.h>
#include <osmocom/hnbgw/mgw_fsm.h>
@@ -130,6 +131,20 @@
return NULL;
}
+int context_map_send_cached_msg(struct hnbgw_context_map *map)
+{
+ int rc;
+ if (!map || !map->cached_msg)
+ return 0;
+ rc = rua_to_scu(map->hnb_ctx,
+ map->is_ps ? RUA_CN_DomainIndicator_ps_domain : RUA_CN_DomainIndicator_cs_domain,
+ OSMO_SCU_PRIM_N_DATA, map->rua_ctx_id, 0,
+ msgb_data(map->cached_msg), msgb_length(map->cached_msg));
+ msgb_free(map->cached_msg);
+ map->cached_msg = NULL;
+ return rc;
+}
+
void context_map_deactivate(struct hnbgw_context_map *map)
{
/* set the state to reserved. We still show up in the list and
diff --git a/src/osmo-hnbgw/hnbgw.c b/src/osmo-hnbgw/hnbgw.c
index 96c7ad1..04ca34c 100644
--- a/src/osmo-hnbgw/hnbgw.c
+++ b/src/osmo-hnbgw/hnbgw.c
@@ -88,6 +88,10 @@
gw->config.iuh_local_port = IUH_DEFAULT_SCTP_PORT;
gw->config.log_prefix_hnb_id = true;
+ /* No limit by default, always include the initial RANAP message in the SCCP CR towards the CN.
+ * 999999 is the maximum value in hnbgw_vty.c */
+ gw->config.max_sccp_cr_payload_len = 999999;
+
gw->next_ue_ctx_id = 23;
INIT_LLIST_HEAD(&gw->hnb_list);
INIT_LLIST_HEAD(&gw->ue_list);
@@ -343,6 +347,11 @@
talloc_free(ctx);
}
+bool hnbgw_requires_empty_sccp_cr(struct hnb_gw *gw, unsigned int ranap_msg_len)
+{
+ return ranap_msg_len > gw->config.max_sccp_cr_payload_len;
+}
+
/*! call-back when the listen FD has something to read */
static int accept_cb(struct osmo_stream_srv_link *srv, int fd)
{
diff --git a/src/osmo-hnbgw/hnbgw_cn.c b/src/osmo-hnbgw/hnbgw_cn.c
index 25baeca..5499e5d 100644
--- a/src/osmo-hnbgw/hnbgw_cn.c
+++ b/src/osmo-hnbgw/hnbgw_cn.c
@@ -339,6 +339,10 @@
/* Nothing needs to happen for RUA, RUA towards the HNB doesn't seem to know any confirmations to its CONNECT
* operation. */
+ /* If our initial SCCP CR was sent without data payload, then the initial RANAP message is cached and waiting to
+ * be sent as soon as the SCCP connection is confirmed. See if that is the case, send cached data. */
+ context_map_send_cached_msg(context_map_by_cn(cnlink, param->conn_id));
+
return 0;
}
diff --git a/src/osmo-hnbgw/hnbgw_rua.c b/src/osmo-hnbgw/hnbgw_rua.c
index e4f345e..56d2724 100644
--- a/src/osmo-hnbgw/hnbgw_rua.c
+++ b/src/osmo-hnbgw/hnbgw_rua.c
@@ -177,11 +177,11 @@
/* forward a RUA message to the SCCP User API to SCCP */
-static int rua_to_scu(struct hnb_context *hnb,
- RUA_CN_DomainIndicator_t cN_DomainIndicator,
- enum osmo_scu_prim_type type,
- uint32_t context_id, uint32_t cause,
- const uint8_t *data, unsigned int len)
+int rua_to_scu(struct hnb_context *hnb,
+ RUA_CN_DomainIndicator_t cN_DomainIndicator,
+ enum osmo_scu_prim_type type,
+ uint32_t context_id, uint32_t cause,
+ const uint8_t *data, unsigned int len)
{
struct msgb *msg;
struct osmo_scu_prim *prim;
@@ -225,9 +225,9 @@
default:
map = context_map_alloc_by_hnb(hnb, context_id, is_ps, cn);
OSMO_ASSERT(map);
- LOGHNB(hnb, DRUA, LOGL_DEBUG, "rua_to_scu() %s to %s, rua_ctx_id %u scu_conn_id %u\n",
+ LOGHNB(hnb, DRUA, LOGL_DEBUG, "rua_to_scu() %s to %s, rua_ctx_id %u scu_conn_id %u data-len %u\n",
cn_domain_indicator_to_str(cN_DomainIndicator), osmo_sccp_addr_dump(remote_addr),
- map->rua_ctx_id, map->scu_conn_id);
+ map->rua_ctx_id, map->scu_conn_id, len);
}
/* add primitive header */
@@ -365,21 +365,69 @@
struct hnb_context *hnb = msg->dst;
uint32_t context_id;
int rc;
+ const uint8_t *data;
+ unsigned int data_len;
rc = rua_decode_connecties(&ies, in);
if (rc < 0)
return rc;
context_id = asn1bitstr_to_u24(&ies.context_ID);
+ data = ies.ranaP_Message.buf;
+ data_len = ies.ranaP_Message.size;
- LOGHNB(hnb, DRUA, LOGL_DEBUG, "RUA %s Connect.req(ctx=0x%x, %s)\n",
- cn_domain_indicator_to_str(ies.cN_DomainIndicator), context_id,
- ies.establishment_Cause == RUA_Establishment_Cause_emergency_call ? "emergency" : "normal");
+ LOGHNB(hnb, DRUA, LOGL_DEBUG, "RUA %s Connect.req(ctx=0x%x, %s, RANAP.size=%u)\n",
+ cn_domain_indicator_to_str(ies.cN_DomainIndicator), context_id,
+ ies.establishment_Cause == RUA_Establishment_Cause_emergency_call ? "emergency" : "normal",
+ data_len);
+
+ if (hnbgw_requires_empty_sccp_cr(hnb->gw, data_len)) {
+ /* Do not include data in the SCCP CR, to avoid hitting a message size limit at the remote end that may
+ * lead to rejection. */
+ bool is_ps;
+ struct osmo_sccp_addr *remote_addr;
+ struct hnbgw_context_map *map;
+
+ switch (ies.cN_DomainIndicator) {
+ case RUA_CN_DomainIndicator_cs_domain:
+ remote_addr = &hnb->gw->sccp.iucs_remote_addr;
+ is_ps = false;
+ break;
+ case RUA_CN_DomainIndicator_ps_domain:
+ remote_addr = &hnb->gw->sccp.iups_remote_addr;
+ is_ps = true;
+ break;
+ default:
+ LOGHNB(hnb, DRUA, LOGL_ERROR, "Unsupported Domain %ld\n", ies.cN_DomainIndicator);
+ rua_free_connecties(&ies);
+ return -1;
+ }
+
+ if (!hnb->gw->sccp.cnlink) {
+ LOGHNB(hnb, DRUA, LOGL_NOTICE, "CN=NULL, discarding message\n");
+ rua_free_connecties(&ies);
+ return 0;
+ }
+
+ map = context_map_alloc_by_hnb(hnb, context_id, is_ps, hnb->gw->sccp.cnlink);
+ OSMO_ASSERT(map);
+ OSMO_ASSERT(map->is_ps == is_ps);
+ LOGHNB(hnb, DRUA, LOGL_DEBUG, "rua_rx_init_connect() %s to %s, rua_ctx_id %u scu_conn_id %u;"
+ " Sending SCCP CR without payload, caching %u octets\n",
+ cn_domain_indicator_to_str(ies.cN_DomainIndicator), osmo_sccp_addr_dump(remote_addr),
+ map->rua_ctx_id, map->scu_conn_id, data_len);
+
+ map->cached_msg = msgb_alloc_c(map, data_len, "map.cached_msg");
+ OSMO_ASSERT(map->cached_msg);
+ memcpy(msgb_put(map->cached_msg, data_len), data, data_len);
+
+ /* Data is cached for after CR is confirmed, send SCCP CR but omit payload. */
+ data = NULL;
+ data_len = 0;
+ }
rc = rua_to_scu(hnb, ies.cN_DomainIndicator, OSMO_SCU_PRIM_N_CONNECT,
- context_id, 0, ies.ranaP_Message.buf,
- ies.ranaP_Message.size);
-
+ context_id, 0, data, data_len);
rua_free_connecties(&ies);
return rc;
diff --git a/src/osmo-hnbgw/hnbgw_vty.c b/src/osmo-hnbgw/hnbgw_vty.c
index d064b7d..c263ab3 100644
--- a/src/osmo-hnbgw/hnbgw_vty.c
+++ b/src/osmo-hnbgw/hnbgw_vty.c
@@ -330,6 +330,18 @@
return CMD_SUCCESS;
}
+DEFUN(cfg_hnbgw_max_sccp_cr_payload_len, cfg_hnbgw_max_sccp_cr_payload_len_cmd,
+ "sccp cr max-payload-len <0-999999>",
+ "Configure SCCP behavior\n"
+ "Configure SCCP Connection Request\n"
+ "Set an upper bound for payload data length included directly in the CR. If an initial RUA message has a"
+ " RANAP payload larger than this value (octets), send an SCCP CR without data, followed by an SCCP DT."
+ " This may be necessary if the remote component has a size limit on valid SCCP CR messages.\n")
+{
+ g_hnb_gw->config.max_sccp_cr_payload_len = atoi(argv[0]);
+ return CMD_SUCCESS;
+}
+
DEFUN(cfg_hnbgw_iucs_remote_addr,
cfg_hnbgw_iucs_remote_addr_cmd,
"remote-addr NAME",
@@ -355,6 +367,8 @@
vty_out(vty, "hnbgw%s", VTY_NEWLINE);
vty_out(vty, " log-prefix %s%s", g_hnb_gw->config.log_prefix_hnb_id ? "hnb-id" : "umts-cell-id",
VTY_NEWLINE);
+ if (g_hnb_gw->config.max_sccp_cr_payload_len != 999999)
+ vty_out(vty, " sccp cr max-payload-len %u%s", g_hnb_gw->config.max_sccp_cr_payload_len, VTY_NEWLINE);
return CMD_SUCCESS;
}
@@ -421,6 +435,7 @@
install_element(HNBGW_NODE, &cfg_hnbgw_rnc_id_cmd);
install_element(HNBGW_NODE, &cfg_hnbgw_log_prefix_cmd);
+ install_element(HNBGW_NODE, &cfg_hnbgw_max_sccp_cr_payload_len_cmd);
install_element(HNBGW_NODE, &cfg_hnbgw_iuh_cmd);
install_node(&iuh_node, config_write_hnbgw_iuh);
--
To view, visit https://gerrit.osmocom.org/c/osmo-hnbgw/+/28230
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-hnbgw
Gerrit-Branch: master
Gerrit-Change-Id: If0c5c0a76e5230bf22871f527dcb2dbdf34d7328
Gerrit-Change-Number: 28230
Gerrit-PatchSet: 5
Gerrit-Owner: neels <nhofmeyr(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: neels <nhofmeyr(a)sysmocom.de>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-MessageType: merged
neels has submitted this change. ( https://gerrit.osmocom.org/c/osmo-hnbgw/+/28233 )
Change subject: tweak comments in rua_to_scu()
......................................................................
tweak comments in rua_to_scu()
Change-Id: I227a5e6b869da453fa72ff0eebaa1e95aa9625e6
---
M src/osmo-hnbgw/hnbgw_rua.c
1 file changed, 4 insertions(+), 2 deletions(-)
Approvals:
Jenkins Builder: Verified
laforge: Looks good to me, approved
pespin: Looks good to me, approved
diff --git a/src/osmo-hnbgw/hnbgw_rua.c b/src/osmo-hnbgw/hnbgw_rua.c
index 00ac09e..e4f345e 100644
--- a/src/osmo-hnbgw/hnbgw_rua.c
+++ b/src/osmo-hnbgw/hnbgw_rua.c
@@ -264,13 +264,15 @@
return -EINVAL;
}
- /* add optional data section, if needed */
+ /* If there is RANAP data, include it in the msgb. Usually there is data, but this could also be an SCCP CR
+ * a.k.a. OSMO_SCU_PRIM_N_CONNECT without RANAP payload. */
if (data && len) {
msg->l2h = msgb_put(msg, len);
memcpy(msg->l2h, data, len);
}
- /* Intercept RAB Assignment Response, inform MGW FSM. */
+ /* If there is data, see if it is a RAB Assignment message where we need to change the user plane information,
+ * for RTP mapping via MGW (soon also GTP mapping via UPF). */
if (data && len && map && !map->is_ps && !release_context_map) {
message = talloc_zero(map, ranap_message);
rc = ranap_cn_rx_co_decode(map, message, msgb_l2(prim->oph.msg), msgb_l2len(prim->oph.msg));
--
To view, visit https://gerrit.osmocom.org/c/osmo-hnbgw/+/28233
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-hnbgw
Gerrit-Branch: master
Gerrit-Change-Id: I227a5e6b869da453fa72ff0eebaa1e95aa9625e6
Gerrit-Change-Number: 28233
Gerrit-PatchSet: 2
Gerrit-Owner: neels <nhofmeyr(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: neels <nhofmeyr(a)sysmocom.de>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-MessageType: merged