Change in libosmocore[master]: gprs_ns2: add gprs_ns2_ip_vc_local() return the local sockaddr

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:24 UTC 2020


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

Change subject: gprs_ns2: add gprs_ns2_ip_vc_local() return the local sockaddr
......................................................................

gprs_ns2: add gprs_ns2_ip_vc_local() return the local sockaddr

Change-Id: I65a739772596015b90473045d32d4934d924e43f
---
M include/osmocom/gprs/gprs_ns2.h
M src/gb/gprs_ns2_udp.c
M src/gb/libosmogb.map
3 files changed, 19 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 5f341d9..d332e48 100644
--- a/include/osmocom/gprs/gprs_ns2.h
+++ b/include/osmocom/gprs/gprs_ns2.h
@@ -140,6 +140,7 @@
 			    uint16_t nsei);
 
 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);
 const struct osmo_sockaddr *gprs_ns2_ip_bind_sockaddr(struct gprs_ns2_vc_bind *bind);
 int gprs_ns2_is_ip_bind(struct gprs_ns2_vc_bind *bind);
 int gprs_ns2_ip_bind_set_dscp(struct gprs_ns2_vc_bind *bind, int dscp);
diff --git a/src/gb/gprs_ns2_udp.c b/src/gb/gprs_ns2_udp.c
index e689118..a3e9da6 100644
--- a/src/gb/gprs_ns2_udp.c
+++ b/src/gb/gprs_ns2_udp.c
@@ -393,6 +393,23 @@
 	return nsvc;
 }
 
+/*! Return the socket address of the local peer of a NS-VC.
+ *  \param[in] nsvc NS-VC whose local peer we want to know
+ *  \return address of the local peer; NULL in case of error */
+const struct osmo_sockaddr *gprs_ns2_ip_vc_local(const struct gprs_ns2_vc *nsvc)
+{
+	struct priv_bind *priv;
+
+	if (nsvc->ll != GPRS_NS_LL_UDP)
+		return NULL;
+
+	if (nsvc->bind->driver != &vc_driver_ip)
+		return NULL;
+
+	priv = nsvc->bind->priv;
+	return &priv->addr;
+}
+
 /*! Return the socket address of the remote peer of a NS-VC.
  *  \param[in] nsvc NS-VC whose remote peer we want to know
  *  \return address of the remote peer; NULL in case of error */
diff --git a/src/gb/libosmogb.map b/src/gb/libosmogb.map
index ee8651e..f542496 100644
--- a/src/gb/libosmogb.map
+++ b/src/gb/libosmogb.map
@@ -93,6 +93,7 @@
 gprs_ns2_ip_connect2;
 gprs_ns2_ip_connect_inactive;
 gprs_ns2_ip_connect_sns;
+gprs_ns2_ip_vc_local;
 gprs_ns2_ip_vc_remote;
 gprs_ns2_is_frgre_bind;
 gprs_ns2_is_ip_bind;

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

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: I65a739772596015b90473045d32d4934d924e43f
Gerrit-Change-Number: 20559
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/9436c6a5/attachment.htm>


More information about the gerrit-log mailing list