Harald Welte has submitted this change and it was merged. ( 
https://gerrit.osmocom.org/10340 )

Change subject: RRLP: migrate and share mode definitions from msc_vty.c
......................................................................

RRLP: migrate and share mode definitions from msc_vty.c

Change-Id: I9560e6eab0ad1b5d57ca732741fc0b6f61f1a4a2
---
M include/osmocom/msc/rrlp.h
M src/libmsc/msc_vty.c
M src/libmsc/rrlp.c
3 files changed, 28 insertions(+), 20 deletions(-)

Approvals:
  Harald Welte: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/include/osmocom/msc/rrlp.h b/include/osmocom/msc/rrlp.h
index 319af70..7d1369d 100644
--- a/include/osmocom/msc/rrlp.h
+++ b/include/osmocom/msc/rrlp.h
@@ -1,3 +1,8 @@
 #pragma once

+#include <osmocom/msc/gsm_data_shared.h>
+
+enum rrlp_mode msc_rrlp_mode_parse(const char *arg);
+const char *msc_rrlp_mode_name(enum rrlp_mode mode);
+
 void msc_rrlp_init(void);
diff --git a/src/libmsc/msc_vty.c b/src/libmsc/msc_vty.c
index 3cbb001..fe6ae88 100644
--- a/src/libmsc/msc_vty.c
+++ b/src/libmsc/msc_vty.c
@@ -53,6 +53,7 @@
 #include <osmocom/msc/gsm_04_14.h>
 #include <osmocom/msc/signal.h>
 #include <osmocom/msc/mncc_int.h>
+#include <osmocom/msc/rrlp.h>

 static struct gsm_network *gsmnet = NULL;

@@ -161,24 +162,6 @@
        return CMD_SUCCESS;
 }

-static const struct value_string 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" },
-       { 0,                    NULL }
-};
-
-static enum rrlp_mode rrlp_mode_parse(const char *arg)
-{
-       return get_string_value(rrlp_mode_names, arg);
-}
-
-static const char *rrlp_mode_name(enum rrlp_mode mode)
-{
-       return get_value_string(rrlp_mode_names, mode);
-}
-
 DEFUN(cfg_net_rrlp_mode, cfg_net_rrlp_mode_cmd,
       "rrlp mode (none|ms-based|ms-preferred|ass-preferred)",
        "Radio Resource Location Protocol\n"
@@ -188,7 +171,7 @@
        "Request any location, prefer MS-based\n"
        "Request any location, prefer MS-assisted\n")
 {
-       gsmnet->rrlp.mode = rrlp_mode_parse(argv[0]);
+       gsmnet->rrlp.mode = msc_rrlp_mode_parse(argv[0]);

        return CMD_SUCCESS;
 }
@@ -311,7 +294,7 @@
        vty_out(vty, "%s", VTY_NEWLINE);
        vty_out(vty, " authentication %s%s",
                gsmnet->authentication_required ? "required" : "optional", 
VTY_NEWLINE);
-       vty_out(vty, " rrlp mode %s%s", rrlp_mode_name(gsmnet->rrlp.mode),
+       vty_out(vty, " rrlp mode %s%s", msc_rrlp_mode_name(gsmnet->rrlp.mode),
                VTY_NEWLINE);
        vty_out(vty, " mm info %u%s", gsmnet->send_mm_info, VTY_NEWLINE);
        if (gsmnet->tz.override != 0) {
diff --git a/src/libmsc/rrlp.c b/src/libmsc/rrlp.c
index 42f5036..40a0a10 100644
--- a/src/libmsc/rrlp.c
+++ b/src/libmsc/rrlp.c
@@ -21,6 +21,8 @@

 #include <stdint.h>

+#include <osmocom/core/utils.h>
+
 #include <osmocom/msc/gsm_04_08.h>
 #include <osmocom/msc/signal.h>
 #include <osmocom/msc/gsm_subscriber.h>
@@ -37,6 +39,24 @@
        Accuracy=60, Method=gpsOrEOTD, ResponseTime=5, multipleSets */
 static const uint8_t ass_pref_pos_req[] = { 0x40, 0x03, 0x79, 0x50 };

+static const struct value_string 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" },
+       { 0,                    NULL }
+};
+
+enum rrlp_mode msc_rrlp_mode_parse(const char *arg)
+{
+       return get_string_value(rrlp_mode_names, arg);
+}
+
+const char *msc_rrlp_mode_name(enum rrlp_mode mode)
+{
+       return get_value_string(rrlp_mode_names, mode);
+}
+
 static int send_rrlp_req(struct gsm_subscriber_connection *conn)
 {
        struct gsm_network *net = conn->network;

--
To view, visit https://gerrit.osmocom.org/10340
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-msc
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: I9560e6eab0ad1b5d57ca732741fc0b6f61f1a4a2
Gerrit-Change-Number: 10340
Gerrit-PatchSet: 2
Gerrit-Owner: Vadim Yanitskiy <[email protected]>
Gerrit-Reviewer: Harald Welte <[email protected]>
Gerrit-Reviewer: Jenkins Builder

Reply via email to