Change in libosmocore[master]: gsm 04.80: Add value_string for component type and op code

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

Harald Welte gerrit-no-reply at lists.osmocom.org
Mon Jun 18 09:42:30 UTC 2018


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

Change subject: gsm 04.80: Add value_string for component type and op code
......................................................................

gsm 04.80: Add value_string for component type and op code

Change-Id: I2615a88db5224d65f37c7cc505e183ec8b196e8a
---
M include/osmocom/gsm/gsm0480.h
M src/gsm/gsm0480.c
M src/gsm/libosmogsm.map
3 files changed, 44 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/gsm0480.h b/include/osmocom/gsm/gsm0480.h
index fafa1f4..e928d83 100644
--- a/include/osmocom/gsm/gsm0480.h
+++ b/include/osmocom/gsm/gsm0480.h
@@ -7,6 +7,16 @@
 #include <osmocom/gsm/protocol/gsm_04_08.h>
 #include <osmocom/gsm/protocol/gsm_04_80.h>
 
+extern const struct value_string gsm0480_comp_type_names[];
+static inline const char *gsm0480_comp_type_name(uint8_t comp_type) {
+	return get_value_string(gsm0480_comp_type_names, comp_type);
+}
+
+extern const struct value_string gsm0480_op_code_names[];
+static inline const char *gsm0480_op_code_name(uint8_t op_code) {
+	return get_value_string(gsm0480_op_code_names, op_code);
+}
+
 /**
  * According to the GSM 04.80 (version 5.0.0) specification Annex A
  * "Expanded ASN.1 Module "SS-Protocol", the maximum size of a USSD
diff --git a/src/gsm/gsm0480.c b/src/gsm/gsm0480.c
index 300c0ed..165b309 100644
--- a/src/gsm/gsm0480.c
+++ b/src/gsm/gsm0480.c
@@ -3,6 +3,7 @@
 /*
  * (C) 2010 by Holger Hans Peter Freyther <zecke at selfish.org>
  * (C) 2009 by Mike Haben <michael.haben at btinternet.com>
+ * (C) 2018 by Harald Welte <laforge at gnumonks.org>
  *
  * All Rights Reserved
  *
@@ -35,6 +36,37 @@
 #include <string.h>
 #include <errno.h>
 
+const struct value_string gsm0480_comp_type_names[] = {
+	{ GSM0480_CTYPE_INVOKE,			"Invoke" },
+	{ GSM0480_CTYPE_RETURN_RESULT,		"ReturnResult" },
+	{ GSM0480_CTYPE_RETURN_ERROR,		"ReturnError" },
+	{ GSM0480_CTYPE_REJECT,			"Reject" },
+	{ 0, NULL }
+};
+
+const struct value_string gsm0480_op_code_names[] = {
+	{ GSM0480_OP_CODE_REGISTER_SS,			"RegisterSS" },
+	{ GSM0480_OP_CODE_ERASE_SS,			"EraseSS" },
+	{ GSM0480_OP_CODE_ACTIVATE_SS,			"ActivateSS" },
+	{ GSM0480_OP_CODE_DEACTIVATE_SS,		"DeactivateSS" },
+	{ GSM0480_OP_CODE_INTERROGATE_SS,		"IngerrogateSS" },
+	{ GSM0480_OP_CODE_NOTIFY_SS,			"NotifySS" },
+	{ GSM0480_OP_CODE_REGISTER_PASSWORD,		"RegisterPassword" },
+	{ GSM0480_OP_CODE_GET_PASSWORD,			"GetPassword" },
+	{ GSM0480_OP_CODE_PROCESS_USS_DATA,		"ProcessUSSD" },
+	{ GSM0480_OP_CODE_FORWARD_CHECK_SS_IND,		"ForwardChecckSSind" },
+	{ GSM0480_OP_CODE_PROCESS_USS_REQ,		"ProcessUssReq" },
+	{ GSM0480_OP_CODE_USS_REQUEST,			"UssRequest" },
+	{ GSM0480_OP_CODE_USS_NOTIFY,			"UssNotify" },
+	{ GSM0480_OP_CODE_FORWARD_CUG_INFO,		"ForwardCugInfo" },
+	{ GSM0480_OP_CODE_SPLIT_MPTY,			"SplitMPTY" },
+	{ GSM0480_OP_CODE_RETRIEVE_MPTY,		"RetrieveMPTY" },
+	{ GSM0480_OP_CODE_HOLD_MPTY,			"HoldMPTY" },
+	{ GSM0480_OP_CODE_BUILD_MPTY,			"BuildMPTY" },
+	{ GSM0480_OP_CODE_FORWARD_CHARGE_ADVICE,	"ForwardChargeAdvice" },
+	{ 0, NULL }
+};
+
 static inline unsigned char *msgb_wrap_with_TL(struct msgb *msgb, uint8_t tag)
 {
 	uint8_t *data = msgb_push(msgb, 2);
diff --git a/src/gsm/libosmogsm.map b/src/gsm/libosmogsm.map
index 4d9811b..3dccb22 100644
--- a/src/gsm/libosmogsm.map
+++ b/src/gsm/libosmogsm.map
@@ -95,6 +95,8 @@
 gsm0480_decode_ss_request;
 gsm0480_wrap_facility;
 gsm0480_wrap_invoke;
+gsm0480_comp_type_names;
+gsm0480_op_code_names;
 
 gsm0502_calc_paging_group;
 

-- 
To view, visit https://gerrit.osmocom.org/9654
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: I2615a88db5224d65f37c7cc505e183ec8b196e8a
Gerrit-Change-Number: 9654
Gerrit-PatchSet: 2
Gerrit-Owner: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Vadim Yanitskiy <axilirator at gmail.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20180618/7e20d487/attachment.htm>


More information about the gerrit-log mailing list