From eab84a112c3ef8c35835a2ba23fa978fff4d218b Mon Sep 17 00:00:00 2001 From: Harald Welte Date: Sun, 13 Dec 2009 10:53:12 +0100 Subject: [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. --- openbsc/src/gsm_data.c | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'openbsc/src/gsm_data.c') 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]; +} -- cgit v1.2.3