Harald Welte has submitted this change and it was merged. ( 
https://gerrit.osmocom.org/9651 )

Change subject: gsup: Add value_string for Session State IE
......................................................................

gsup: Add value_string for Session State IE

In Change-Id I1cee271fed0284a134ffed103c0d4bebbcfde2a8 we added support
for a new session state IE, but we didn't add any value_string array
for string conversion of it.  Let's fix this.

Change-Id: I3d9f087786dc37c42498fa9a2be07483ec93ba7b
---
M include/osmocom/gsm/gsup.h
M src/gsm/gsup.c
M src/gsm/libosmogsm.map
3 files changed, 14 insertions(+), 0 deletions(-)

Approvals:
  Jenkins Builder: Verified
  Vadim Yanitskiy: Looks good to me, but someone else must approve
  Harald Welte: Looks good to me, approved



diff --git a/include/osmocom/gsm/gsup.h b/include/osmocom/gsm/gsup.h
index e246639..0ef5a75 100644
--- a/include/osmocom/gsm/gsup.h
+++ b/include/osmocom/gsm/gsup.h
@@ -154,6 +154,11 @@
        OSMO_GSUP_SESSION_STATE_END             = 0x03,
 };

+extern const struct value_string osmo_gsup_session_state_names[];
+static inline const char *
+osmo_gsup_session_state_name(enum osmo_gsup_session_state val)
+{      return get_value_string(osmo_gsup_session_state_names, val); }
+
 /*! parsed/decoded PDP context information */
 struct osmo_gsup_pdp_info {
        unsigned int                    context_id;
diff --git a/src/gsm/gsup.c b/src/gsm/gsup.c
index e3eef02..9c2f817 100644
--- a/src/gsm/gsup.c
+++ b/src/gsm/gsup.c
@@ -70,6 +70,14 @@
        { 0, NULL }
 };

+const struct value_string osmo_gsup_session_state_names[] = {
+       { OSMO_GSUP_SESSION_STATE_NONE, "NONE" },
+       { OSMO_GSUP_SESSION_STATE_BEGIN, "BEGIN" },
+       { OSMO_GSUP_SESSION_STATE_CONTINUE, "CONTINUE" },
+       { OSMO_GSUP_SESSION_STATE_END, "END" },
+       { 0, NULL }
+};
+

 /*! return the error message type corresponding to \a type_in
  *  \returns matching error message type; -1 on error */
diff --git a/src/gsm/libosmogsm.map b/src/gsm/libosmogsm.map
index f98f7c9..4d9811b 100644
--- a/src/gsm/libosmogsm.map
+++ b/src/gsm/libosmogsm.map
@@ -469,6 +469,7 @@
 osmo_gsup_encode;
 osmo_gsup_decode;
 osmo_gsup_message_type_names;
+osmo_gsup_session_state_names;
 osmo_gsup_get_err_msg_type;

 osmo_oap_encode;

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

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: I3d9f087786dc37c42498fa9a2be07483ec93ba7b
Gerrit-Change-Number: 9651
Gerrit-PatchSet: 1
Gerrit-Owner: Harald Welte <[email protected]>
Gerrit-Reviewer: Harald Welte <[email protected]>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Vadim Yanitskiy <[email protected]>

Reply via email to