Change in osmo-hlr[master]: gsup_server: Add "priv" pointer and make it point to 'struct hlr'

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/.

Harald Welte gerrit-no-reply at lists.osmocom.org
Sat Jun 16 18:21:54 UTC 2018


Harald Welte has uploaded this change for review. ( https://gerrit.osmocom.org/9655


Change subject: gsup_server: Add "priv" pointer and make it point to 'struct hlr'
......................................................................

gsup_server: Add "priv" pointer and make it point to 'struct hlr'

Change-Id: Iada68996b7f4cbdcca92b254ddaf6b88b962e6f1
---
M src/gsup_server.c
M src/gsup_server.h
M src/hlr.c
3 files changed, 8 insertions(+), 3 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-hlr refs/changes/55/9655/1

diff --git a/src/gsup_server.c b/src/gsup_server.c
index 4b8a0fa..e75bbd7 100644
--- a/src/gsup_server.c
+++ b/src/gsup_server.c
@@ -292,7 +292,7 @@
 struct osmo_gsup_server *
 osmo_gsup_server_create(void *ctx, const char *ip_addr, uint16_t tcp_port,
 			osmo_gsup_read_cb_t read_cb,
-			struct llist_head *lu_op_lst)
+			struct llist_head *lu_op_lst, void *priv)
 {
 	struct osmo_gsup_server *gsups;
 	int rc;
@@ -312,6 +312,7 @@
 		goto failed;
 
 	gsups->read_cb = read_cb;
+	gsups->priv = priv;
 
 	rc = ipa_server_link_open(gsups->link);
 	if (rc < 0)
diff --git a/src/gsup_server.h b/src/gsup_server.h
index e49d283..9c4d483 100644
--- a/src/gsup_server.h
+++ b/src/gsup_server.h
@@ -16,6 +16,9 @@
 typedef int (*osmo_gsup_read_cb_t)(struct osmo_gsup_conn *conn, struct msgb *msg);
 
 struct osmo_gsup_server {
+	/* private data of the application/user */
+	void *priv;
+
 	/* list of osmo_gsup_conn */
 	struct llist_head clients;
 
@@ -53,7 +56,8 @@
 						 const char *ip_addr,
 						 uint16_t tcp_port,
 						 osmo_gsup_read_cb_t read_cb,
-						 struct llist_head *lu_op_lst);
+						 struct llist_head *lu_op_lst,
+						 void *priv);
 
 void osmo_gsup_server_destroy(struct osmo_gsup_server *gsups);
 
diff --git a/src/hlr.c b/src/hlr.c
index 940165f..643dfff 100644
--- a/src/hlr.c
+++ b/src/hlr.c
@@ -600,7 +600,7 @@
 	}
 
 	g_hlr->gs = osmo_gsup_server_create(hlr_ctx, g_hlr->gsup_bind_addr, OSMO_GSUP_PORT,
-					    read_cb, &g_lu_ops);
+					    read_cb, &g_lu_ops, g_hlr);
 	if (!g_hlr->gs) {
 		LOGP(DMAIN, LOGL_FATAL, "Error starting GSUP server\n");
 		exit(1);

-- 
To view, visit https://gerrit.osmocom.org/9655
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-hlr
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: Iada68996b7f4cbdcca92b254ddaf6b88b962e6f1
Gerrit-Change-Number: 9655
Gerrit-PatchSet: 1
Gerrit-Owner: Harald Welte <laforge at gnumonks.org>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20180616/d62dbede/attachment.htm>


More information about the gerrit-log mailing list