summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/osmocom/gsm/gsm0480.h10
-rw-r--r--src/gsm/gsm0480.c32
-rw-r--r--src/gsm/libosmogsm.map2
3 files changed, 44 insertions, 0 deletions
diff --git a/include/osmocom/gsm/gsm0480.h b/include/osmocom/gsm/gsm0480.h
index fafa1f4b..e928d83f 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 300c0ede..165b309f 100644
--- a/src/gsm/gsm0480.c
+++ b/src/gsm/gsm0480.c
@@ -3,6 +3,7 @@
/*
* (C) 2010 by Holger Hans Peter Freyther <zecke@selfish.org>
* (C) 2009 by Mike Haben <michael.haben@btinternet.com>
+ * (C) 2018 by Harald Welte <laforge@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 4d9811b0..3dccb227 100644
--- a/src/gsm/libosmogsm.map
+++ b/src/gsm/libosmogsm.map
@@ -95,6 +95,8 @@ gsm0480_decode_ussd_request;
gsm0480_decode_ss_request;
gsm0480_wrap_facility;
gsm0480_wrap_invoke;
+gsm0480_comp_type_names;
+gsm0480_op_code_names;
gsm0502_calc_paging_group;