aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMax <msuraev@sysmocom.de>2016-06-28 14:03:21 +0200
committerHarald Welte <laforge@gnumonks.org>2016-06-29 16:32:27 +0000
commitb897c4299329688bb0aba6e32cd10b361bda1dee (patch)
tree855a153658c671a296aedd5f25dd09de3b1ec9db
parent6797b3a808cdc9f2998e500269630c822ce9c189 (diff)
Add strings for GPRS ciphers
-rw-r--r--include/osmocom/crypt/gprs_cipher.h3
-rw-r--r--src/gsm/gprs_cipher_core.c9
-rw-r--r--src/gsm/libosmogsm.map1
3 files changed, 13 insertions, 0 deletions
diff --git a/include/osmocom/crypt/gprs_cipher.h b/include/osmocom/crypt/gprs_cipher.h
index d6edefaf..9d98f88a 100644
--- a/include/osmocom/crypt/gprs_cipher.h
+++ b/include/osmocom/crypt/gprs_cipher.h
@@ -1,6 +1,7 @@
#pragma once
#include <osmocom/core/linuxlist.h>
+#include <osmocom/core/utils.h>
#define GSM0464_CIPH_MAX_BLOCK 1523
@@ -18,6 +19,8 @@ enum gprs_cipher_direction {
GPRS_CIPH_SGSN2MS,
};
+extern const struct value_string gprs_cipher_names[];
+
/* An implementation of a GPRS cipher */
struct gprs_cipher_impl {
struct llist_head list;
diff --git a/src/gsm/gprs_cipher_core.c b/src/gsm/gprs_cipher_core.c
index e4fac04b..8f020b38 100644
--- a/src/gsm/gprs_cipher_core.c
+++ b/src/gsm/gprs_cipher_core.c
@@ -33,6 +33,15 @@ static LLIST_HEAD(gprs_ciphers);
static struct gprs_cipher_impl *selected_ciphers[_GPRS_ALGO_NUM];
+const struct value_string gprs_cipher_names[] = {
+ { GPRS_ALGO_GEA0, "GEA0" },
+ { GPRS_ALGO_GEA1, "GEA1" },
+ { GPRS_ALGO_GEA2, "GEA2" },
+ { GPRS_ALGO_GEA3, "GEA3" },
+ { GPRS_ALGO_GEA4, "GEA4" },
+ { 0, NULL },
+};
+
/* register a cipher with the core */
int gprs_cipher_register(struct gprs_cipher_impl *ciph)
{
diff --git a/src/gsm/libosmogsm.map b/src/gsm/libosmogsm.map
index ea2101c9..ebeabcdc 100644
--- a/src/gsm/libosmogsm.map
+++ b/src/gsm/libosmogsm.map
@@ -39,6 +39,7 @@ gprs_cipher_gen_input_ui;
gprs_cipher_load;
gprs_cipher_register;
gprs_cipher_run;
+gprs_cipher_names;
gprs_cipher_supported;
gprs_cipher_key_length;
gprs_tlli_type;