Change in osmo-gbproxy[master]: Add Function to get gbproxy cell by cell id

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 Feb 3 15:03:22 UTC 2021


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


Change subject: Add Function to get gbproxy cell by cell id
......................................................................

Add Function to get gbproxy cell by cell id

Related: SYS#5103
Change-Id: I3403736eed9d6819634c26db0b90393ac6f4416a
---
M include/osmocom/sgsn/gb_proxy.h
M src/gb_proxy_peer.c
2 files changed, 15 insertions(+), 0 deletions(-)



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

diff --git a/include/osmocom/sgsn/gb_proxy.h b/include/osmocom/sgsn/gb_proxy.h
index d988cae..f69cb56 100644
--- a/include/osmocom/sgsn/gb_proxy.h
+++ b/include/osmocom/sgsn/gb_proxy.h
@@ -8,6 +8,7 @@
 #include <osmocom/core/hashtable.h>
 #include <osmocom/gsm/gsm23003.h>
 #include <osmocom/gsm/gsm23236.h>
+#include <osmocom/gsm/gsm48.h>
 #include <osmocom/gsm/protocol/gsm_23_003.h>
 
 #include <osmocom/gprs/gprs_ns2.h>
@@ -264,6 +265,7 @@
 
 struct gbproxy_cell *gbproxy_cell_alloc(struct gbproxy_config *cfg, uint16_t bvci);
 struct gbproxy_cell *gbproxy_cell_by_bvci(struct gbproxy_config *cfg, uint16_t bvci);
+struct gbproxy_cell *gbproxy_cell_by_cellid(struct gbproxy_config *cfg, const struct gprs_ra_id *raid, uint16_t cid);
 void gbproxy_cell_free(struct gbproxy_cell *cell);
 bool gbproxy_cell_add_sgsn_bvc(struct gbproxy_cell *cell, struct gbproxy_bvc *bvc);
 
diff --git a/src/gb_proxy_peer.c b/src/gb_proxy_peer.c
index e276c85..bd11719 100644
--- a/src/gb_proxy_peer.c
+++ b/src/gb_proxy_peer.c
@@ -206,6 +206,19 @@
 	return cell;
 }
 
+struct gbproxy_cell *gbproxy_cell_by_cellid(struct gbproxy_config *cfg, const struct gprs_ra_id *raid, uint16_t cid)
+{
+	int i;
+	struct gbproxy_cell *cell;
+
+	hash_for_each(cfg->cells, i, cell, list) {
+		if ((cell->id.cid == cid) && (!memcmp(&cell->id.raid, raid, sizeof(*raid)))) {
+			return cell;
+		}
+	}
+	return NULL;
+}
+
 void gbproxy_cell_free(struct gbproxy_cell *cell)
 {
 	unsigned int i;

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

Gerrit-Project: osmo-gbproxy
Gerrit-Branch: master
Gerrit-Change-Id: I3403736eed9d6819634c26db0b90393ac6f4416a
Gerrit-Change-Number: 22652
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/20210203/08e977a8/attachment.htm>


More information about the gerrit-log mailing list