[PATCH] osmo-hlr[master]: RFC: add the osmo_gsup_conn directly to the lu_operation if ...

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

Neels Hofmeyr gerrit-no-reply at lists.osmocom.org
Wed Mar 1 14:41:34 UTC 2017


Review at  https://gerrit.osmocom.org/1953

RFC: add the osmo_gsup_conn directly to the lu_operation if known

Change-Id: I427b8e5ed2a6ce82231fe7e05d1b47e9f057d9cc
---
M src/luop.c
M src/luop.h
2 files changed, 26 insertions(+), 3 deletions(-)


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

diff --git a/src/luop.c b/src/luop.c
index ecf31b4..b0028da 100644
--- a/src/luop.c
+++ b/src/luop.c
@@ -54,9 +54,14 @@
 	msg_out = msgb_alloc_headroom(1024+16, 16, "GSUP LUOP");
 	osmo_gsup_encode(msg_out, gsup);
 
-	osmo_gsup_addr_send(luop->gsup_server, luop->peer,
-			    talloc_total_size(luop->peer),
-			    msg_out);
+	if (luop->conn)
+		osmo_gsup_addr_send_direct(luop->gsup_server,
+					   luop->conn,
+					   msg_out);
+	else
+		osmo_gsup_addr_send(luop->gsup_server, luop->peer,
+				    talloc_total_size(luop->peer),
+				    msg_out);
 }
 
 static inline void fill_gsup_msg(struct osmo_gsup_message *out,
@@ -123,6 +128,7 @@
 		return NULL;
 
 	luop->peer = talloc_memdup(luop, peer_addr, rc);
+	luop->conn = conn;
 
 	return luop;
 }
@@ -166,6 +172,17 @@
 		return -ENODEV;
 	}
 
+	return osmo_gsup_addr_send_direct(gs, conn, msg);
+}
+
+int osmo_gsup_addr_send_direct(struct osmo_gsup_server *gs,
+			       struct osmo_gsup_conn *conn, struct msgb *msg)
+{
+	OSMO_ASSERT(conn);
+	DEBUGP(DMAIN, "Tx to peer %s:%u  msg %s\n",
+	       conn->conn->addr, conn->conn->port,
+	       osmo_hexdump_nospc(msg->data, msg->len));
+
 	return osmo_gsup_conn_send(conn, msg);
 }
 
diff --git a/src/luop.h b/src/luop.h
index 7e2fbb0..659a09d 100644
--- a/src/luop.h
+++ b/src/luop.h
@@ -60,12 +60,18 @@
 	struct hlr_subscriber subscr;
 	/*! peer VLR/SGSN starting the request */
 	uint8_t *peer;
+
+	/*! peer, if we already know it */
+	struct osmo_gsup_conn *conn;
 };
 
 int osmo_gsup_addr_send(struct osmo_gsup_server *gs,
 			const uint8_t *addr, size_t addrlen,
 			struct msgb *msg);
 
+int osmo_gsup_addr_send_direct(struct osmo_gsup_server *gs,
+			       struct osmo_gsup_conn *conn, struct msgb *msg);
+
 struct lu_operation *lu_op_alloc(struct osmo_gsup_server *srv);
 struct lu_operation *lu_op_alloc_conn(struct osmo_gsup_conn *conn);
 void lu_op_statechg(struct lu_operation *luop, enum lu_state new_state);

-- 
To view, visit https://gerrit.osmocom.org/1953
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I427b8e5ed2a6ce82231fe7e05d1b47e9f057d9cc
Gerrit-PatchSet: 1
Gerrit-Project: osmo-hlr
Gerrit-Branch: master
Gerrit-Owner: Neels Hofmeyr <nhofmeyr at sysmocom.de>



More information about the gerrit-log mailing list