Change in osmo-gbproxy[master]: gbproxy: Route DL STATUS with BVCI on SIG-BVC

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

daniel gerrit-no-reply at lists.osmocom.org
Wed Oct 27 14:10:52 UTC 2021


daniel has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-gbproxy/+/25985 )


Change subject: gbproxy: Route DL STATUS with BVCI on SIG-BVC
......................................................................

gbproxy: Route DL STATUS with BVCI on SIG-BVC

Fixes TTCN3 gbproxy test TC_status_sig_dl_bvci

Related: OS#4892
Change-Id: I5928cebea7f39d6648f95dfa1a46437de202f723
---
M src/gb_proxy.c
1 file changed, 37 insertions(+), 0 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-gbproxy refs/changes/85/25985/1

diff --git a/src/gb_proxy.c b/src/gb_proxy.c
index f92585a..4c45adb 100644
--- a/src/gb_proxy.c
+++ b/src/gb_proxy.c
@@ -1018,6 +1018,30 @@
 	return 0;
 }
 
+static int gbproxy_bvci_from_status_pdu(struct msgb *msg, struct tlv_parsed *tp, uint16_t *bvci, char *log_pfx)
+{
+	int rc;
+	int pdu_len = TLVP_LEN(&tp[0], BSSGP_IE_PDU_IN_ERROR);
+	const uint8_t *pdu_data = TLVP_VAL(&tp[0], BSSGP_IE_PDU_IN_ERROR);
+	struct bssgp_normal_hdr *bgph = (struct bssgp_normal_hdr *)pdu_data;
+	struct tlv_parsed tp_inner[2];
+
+	/* TODO: Parse partial messages as well */
+	rc = osmo_tlv_prot_parse(&osmo_pdef_bssgp, tp_inner, ARRAY_SIZE(tp_inner), bgph->pdu_type, bgph->data,
+				 pdu_len - sizeof(*bgph), 0, 0, DGPRS, log_pfx);
+
+	if (rc < 0)
+		return rc;
+
+	if (TLVP_PRESENT(&tp_inner[0], BSSGP_IE_BVCI)) {
+		*bvci = ntohs(tlvp_val16_unal(&tp_inner[0], BSSGP_IE_BVCI));
+	} else {
+		return -ENOENT;
+	}
+
+	return 0;
+}
+
 /* Receive an incoming signalling message from a BSS-side NS-VC */
 static int gbprox_rx_sig_from_bss(struct gbproxy_nse *nse, struct msgb *msg, uint16_t ns_bvci)
 {
@@ -1498,6 +1522,19 @@
 		LOGPNSE(nse, LOGL_NOTICE, "Rx STATUS cause=0x%02x(%s)\n", cause,
 			bssgp_cause_str(cause));
 
+
+		if (gbproxy_bvci_from_status_pdu(msg, tp, &bvci, log_pfx) == 0) {
+			if (bvci != 0) {
+				struct gbproxy_cell *cell = gbproxy_cell_by_bvci(cfg, bvci);
+
+				/* TODO: Log */
+				if ((!cell || !cell->bss_bvc || !cell->bss_bvc->nse))
+					break;
+
+				return gbprox_relay2nse(msg, cell->bss_bvc->nse, 0);
+			}
+		}
+
 		if (gbproxy_tlli_from_status_pdu(msg, tp, &tlli, log_pfx) == 0) {
 			nse_peer = gbproxy_nse_by_tlli(cfg, tlli);
 			if (nse_peer)

-- 
To view, visit https://gerrit.osmocom.org/c/osmo-gbproxy/+/25985
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-gbproxy
Gerrit-Branch: master
Gerrit-Change-Id: I5928cebea7f39d6648f95dfa1a46437de202f723
Gerrit-Change-Number: 25985
Gerrit-PatchSet: 1
Gerrit-Owner: daniel <dwillmann at sysmocom.de>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20211027/4b0e6c04/attachment.htm>


More information about the gerrit-log mailing list