Change in libosmocore[master]: ns2: Add gprs_ns2_nsvc_state_name() to get the current state of a VC

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
Tue Nov 3 22:13:08 UTC 2020


daniel has uploaded this change for review. ( https://gerrit.osmocom.org/c/libosmocore/+/21039 )


Change subject: ns2: Add gprs_ns2_nsvc_state_name() to get the current state of a VC
......................................................................

ns2: Add gprs_ns2_nsvc_state_name() to get the current state of a VC

Change-Id: I4c4c5b9142d7240ed452218e263ba12e2b70d1a0
Related: SYS#4998
---
M include/osmocom/gprs/gprs_ns2.h
M src/gb/gprs_ns2.c
M src/gb/libosmogb.map
3 files changed, 12 insertions(+), 0 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/39/21039/1

diff --git a/include/osmocom/gprs/gprs_ns2.h b/include/osmocom/gprs/gprs_ns2.h
index ffc2ad8..728ca9f 100644
--- a/include/osmocom/gprs/gprs_ns2.h
+++ b/include/osmocom/gprs/gprs_ns2.h
@@ -192,9 +192,12 @@
 		struct gprs_ns2_nse *nse,
 		const struct osmo_sockaddr *sockaddr);
 void gprs_ns2_start_alive_all_nsvcs(struct gprs_ns2_nse *nse);
+
+/* VC information */
 const char *gprs_ns2_ll_str(struct gprs_ns2_vc *nsvc);
 char *gprs_ns2_ll_str_buf(char *buf, size_t buf_len, struct gprs_ns2_vc *nsvc);
 char *gprs_ns2_ll_str_c(const void *ctx, struct gprs_ns2_vc *nsvc);
+const char *gprs_ns2_nsvc_state_name(struct gprs_ns2_vc *nsvc);
 
 /* vty */
 int gprs_ns2_vty_init(struct gprs_ns2_inst *nsi,
diff --git a/src/gb/gprs_ns2.c b/src/gb/gprs_ns2.c
index ffa3135..f86608f 100644
--- a/src/gb/gprs_ns2.c
+++ b/src/gb/gprs_ns2.c
@@ -292,6 +292,14 @@
 	return gprs_ns2_ll_str_buf(buf, NS2_LL_MAX_STR, nsvc);
 }
 
+/*! Return the current state name of a given NS-VC to a thread-local static buffer.
+ *  \param[in] nsvc NS-VC to return the state of
+ *  \return pointer to the string on success; NULL on error */
+const char *gprs_ns2_nsvc_state_name(struct gprs_ns2_vc *nsvc)
+{
+	return osmo_fsm_inst_state_name(nsvc->fi);
+}
+
 /*! Receive a primitive from the NS User (Gb).
  *  \param[in] nsi NS instance to which the primitive is issued
  *  \param[in] oph The primitive
diff --git a/src/gb/libosmogb.map b/src/gb/libosmogb.map
index 2ef12bc..72437ab 100644
--- a/src/gb/libosmogb.map
+++ b/src/gb/libosmogb.map
@@ -109,6 +109,7 @@
 gprs_ns2_nse_sns_remote;
 gprs_ns2_nsvc_by_nsvci;
 gprs_ns2_nsvc_by_sockaddr;
+gprs_ns2_nsvc_state_name;
 gprs_ns2_prim_strs;
 gprs_ns2_recv_prim;
 gprs_ns2_reset_persistent_nsvcs;

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

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: I4c4c5b9142d7240ed452218e263ba12e2b70d1a0
Gerrit-Change-Number: 21039
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/20201103/5a5076cc/attachment.htm>


More information about the gerrit-log mailing list