diff options
author | Harald Welte <laforge@netfilter.org> | 2009-12-13 10:53:12 +0100 |
---|---|---|
committer | Harald Welte <laforge@netfilter.org> | 2009-12-13 10:53:12 +0100 |
commit | eab84a112c3ef8c35835a2ba23fa978fff4d218b (patch) | |
tree | 99fa6ef4f469c55a9993bd1ef746e714af497b4d /openbsc/src/gsm_data.c | |
parent | 09b7e7fa43c74d35e8ea935f3096993e3360f33a (diff) |
[RRLP] make RRLP mode configurable from config file
We now support different RRLP modes (including "none" to disable RRLP),
you can configure it via "rrlp mode" in the "network" section of
openbsc.cfg.
Diffstat (limited to 'openbsc/src/gsm_data.c')
-rw-r--r-- | openbsc/src/gsm_data.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/openbsc/src/gsm_data.c b/openbsc/src/gsm_data.c index fef1127eb..cdaba9e52 100644 --- a/openbsc/src/gsm_data.c +++ b/openbsc/src/gsm_data.c @@ -367,3 +367,26 @@ const char *gsm_auth_policy_name(enum gsm_auth_policy policy) return gsm_auth_policy_names[policy]; } +static const char *rrlp_mode_names[] = { + [RRLP_MODE_NONE] = "none", + [RRLP_MODE_MS_BASED] = "ms-based", + [RRLP_MODE_MS_PREF] = "ms-preferred", + [RRLP_MODE_ASS_PREF] = "ass-preferred", +}; + +enum rrlp_mode rrlp_mode_parse(const char *arg) +{ + int i; + for (i = 0; i < ARRAY_SIZE(rrlp_mode_names); i++) { + if (!strcmp(arg, rrlp_mode_names[i])) + return i; + } + return RRLP_MODE_NONE; +} + +const char *rrlp_mode_name(enum rrlp_mode mode) +{ + if (mode > ARRAY_SIZE(rrlp_mode_names)) + return "none"; + return rrlp_mode_names[mode]; +} |