summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2010-03-04 10:39:50 +0100
committerHarald Welte <laforge@gnumonks.org>2010-03-04 10:39:50 +0100
commitfbc5ca080beedf8ca032cdd409db30838843f79b (patch)
tree5694d4de43a5bac6a97ea24d5fe2ff2ebb5ea99f
parent3c9c5f941d6053985a3fb2aaea2774a24df1bfd3 (diff)
move gsm_band_name() and gsm_band_parse() to libosmocore
-rw-r--r--openbsc/src/gsm_data.c56
1 files changed, 2 insertions, 54 deletions
diff --git a/openbsc/src/gsm_data.c b/openbsc/src/gsm_data.c
index a6b060c2d..a951821fe 100644
--- a/openbsc/src/gsm_data.c
+++ b/openbsc/src/gsm_data.c
@@ -1,4 +1,4 @@
-/* (C) 2008-2009 by Harald Welte <laforge@gnumonks.org>
+/* (C) 2008-2010 by Harald Welte <laforge@gnumonks.org>
*
* All Rights Reserved
*
@@ -27,6 +27,7 @@
#include <openbsc/gsm_data.h>
#include <osmocore/talloc.h>
+#include <osmocore/gsm_utils.h>
#include <openbsc/abis_nm.h>
#include <osmocore/statistics.h>
@@ -435,59 +436,6 @@ struct gsm_bts *gsm_bts_by_lac(struct gsm_network *net, unsigned int lac,
return NULL;
}
-char *gsm_band_name(enum gsm_band band)
-{
- switch (band) {
- case GSM_BAND_450:
- return "GSM450";
- case GSM_BAND_480:
- return "GSM450";
- case GSM_BAND_750:
- return "GSM750";
- case GSM_BAND_810:
- return "GSM810";
- case GSM_BAND_850:
- return "GSM850";
- case GSM_BAND_900:
- return "GSM900";
- case GSM_BAND_1800:
- return "DCS1800";
- case GSM_BAND_1900:
- return "PCS1900";
- }
- return "invalid";
-}
-
-enum gsm_band gsm_band_parse(const char* mhz)
-{
- while (*mhz && !isdigit(*mhz))
- mhz++;
-
- if (*mhz == '\0')
- return -EINVAL;
-
- switch (atoi(mhz)) {
- case 450:
- return GSM_BAND_450;
- case 480:
- return GSM_BAND_480;
- case 750:
- return GSM_BAND_750;
- case 810:
- return GSM_BAND_810;
- case 850:
- return GSM_BAND_850;
- case 900:
- return GSM_BAND_900;
- case 1800:
- return GSM_BAND_1800;
- case 1900:
- return GSM_BAND_1900;
- default:
- return -EINVAL;
- }
-}
-
static const char *gsm_auth_policy_names[] = {
[GSM_AUTH_POLICY_CLOSED] = "closed",
[GSM_AUTH_POLICY_ACCEPT_ALL] = "accept-all",