Change in libosmocore[master]: gprs_ns2: add gprs_ns2_nse_sns_remote() returns the initial SNS address

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

lynxis lazus gerrit-no-reply at lists.osmocom.org
Mon Oct 12 14:13:28 UTC 2020


lynxis lazus has submitted this change. ( https://gerrit.osmocom.org/c/libosmocore/+/20560 )

Change subject: gprs_ns2: add gprs_ns2_nse_sns_remote() returns the initial SNS address
......................................................................

gprs_ns2: add gprs_ns2_nse_sns_remote() returns the initial SNS address

Allows the PCU to get the SNS remote address.

Change-Id: I54f110acc3acccb362f6e554324d08cc42b7c328
---
M include/osmocom/gprs/gprs_ns2.h
M src/gb/gprs_ns2_sns.c
M src/gb/libosmogb.map
3 files changed, 17 insertions(+), 0 deletions(-)

Approvals:
  Jenkins Builder: Verified
  pespin: Looks good to me, but someone else must approve
  daniel: Looks good to me, approved
  laforge: Looks good to me, approved



diff --git a/include/osmocom/gprs/gprs_ns2.h b/include/osmocom/gprs/gprs_ns2.h
index d332e48..0d08af5 100644
--- a/include/osmocom/gprs/gprs_ns2.h
+++ b/include/osmocom/gprs/gprs_ns2.h
@@ -138,6 +138,7 @@
 int gprs_ns2_ip_connect_sns(struct gprs_ns2_vc_bind *bind,
 			    const struct osmo_sockaddr *remote,
 			    uint16_t nsei);
+const struct osmo_sockaddr *gprs_ns2_nse_sns_remote(struct gprs_ns2_nse *nse);
 
 const struct osmo_sockaddr *gprs_ns2_ip_vc_remote(struct gprs_ns2_vc *nsvc);
 const struct osmo_sockaddr *gprs_ns2_ip_vc_local(const struct gprs_ns2_vc *nsvc);
diff --git a/src/gb/gprs_ns2_sns.c b/src/gb/gprs_ns2_sns.c
index d4de8ae..1afd4b7 100644
--- a/src/gb/gprs_ns2_sns.c
+++ b/src/gb/gprs_ns2_sns.c
@@ -194,6 +194,21 @@
 	return gprs_ns2_nsvc_by_sockaddr_nse(nse, &sa);
 }
 
+/*! Return the initial SNS remote socket address
+ * \param nse NS Entity
+ * \return address of the initial SNS connection; NULL in case of error
+ */
+const struct osmo_sockaddr *gprs_ns2_nse_sns_remote(struct gprs_ns2_nse *nse)
+{
+	struct ns2_sns_state *gss;
+
+	if (!nse->bss_sns_fi)
+		return NULL;
+
+	gss = (struct ns2_sns_state *) nse->bss_sns_fi->priv;
+	return &gss->initial;
+}
+
 /*! called when a nsvc is beeing freed */
 void ns2_sns_free_nsvc(struct gprs_ns2_vc *nsvc)
 {
diff --git a/src/gb/libosmogb.map b/src/gb/libosmogb.map
index f542496..e6557b7 100644
--- a/src/gb/libosmogb.map
+++ b/src/gb/libosmogb.map
@@ -102,6 +102,7 @@
 gprs_ns2_ll_str_c;
 gprs_ns2_nse_by_nsei;
 gprs_ns2_nse_nsei;
+gprs_ns2_nse_sns_remote;
 gprs_ns2_nsvc_by_nsvci;
 gprs_ns2_nsvc_by_sockaddr;
 gprs_ns2_recv_prim;

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

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: I54f110acc3acccb362f6e554324d08cc42b7c328
Gerrit-Change-Number: 20560
Gerrit-PatchSet: 2
Gerrit-Owner: lynxis lazus <lynxis at fe80.eu>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: daniel <dwillmann at sysmocom.de>
Gerrit-Reviewer: laforge <laforge at osmocom.org>
Gerrit-Reviewer: lynxis lazus <lynxis at fe80.eu>
Gerrit-Reviewer: pespin <pespin at sysmocom.de>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20201012/11b8636f/attachment.htm>


More information about the gerrit-log mailing list