Neels Hofmeyr has submitted this change and it was merged. ( 
https://gerrit.osmocom.org/12030 )

Change subject: rename some RAN conn related stuff to ran_conn_*
......................................................................

rename some RAN conn related stuff to ran_conn_*

Following previous rename of gsm_subscriber_connection:

Some functions and #defines are still called like "msc_conn" or just "msc_",
while they are clearly about a RAN conn.

To avoid confusion with the future separate concepts of MSC roles and a RAN
connection, rename all those to match the common "ran_conn" prefix.

Change-Id: Ia17a0a35f11911e00e19cafb5d7828d729a69640
---
M include/osmocom/msc/osmo_msc.h
M src/libmsc/a_iface.c
M src/libmsc/a_iface_bssap.c
M src/libmsc/gsm_04_08.c
M src/libmsc/gsm_04_08_cc.c
M src/libmsc/gsm_04_11.c
M src/libmsc/gsm_09_11.c
M src/libmsc/iucs.c
M src/libmsc/iucs_ranap.c
M src/libmsc/osmo_msc.c
M src/libmsc/silent_call.c
M src/libmsc/subscr_conn.c
M src/libmsc/transaction.c
M tests/msc_vlr/msc_vlr_test_call.c
M tests/msc_vlr/msc_vlr_tests.c
15 files changed, 104 insertions(+), 109 deletions(-)



diff --git a/include/osmocom/msc/osmo_msc.h b/include/osmocom/msc/osmo_msc.h
index 38cb497..fe6e0cd 100644
--- a/include/osmocom/msc/osmo_msc.h
+++ b/include/osmocom/msc/osmo_msc.h
@@ -50,22 +50,20 @@
 int msc_vlr_alloc(struct gsm_network *net);
 int msc_vlr_start(struct gsm_network *net);

-void msc_sapi_n_reject(struct ran_conn *conn, int dlci);
-int msc_clear_request(struct ran_conn *conn, uint32_t cause);
-void msc_compl_l3(struct ran_conn *conn,
-                 struct msgb *msg, uint16_t chosen_channel);
-void msc_dtap(struct ran_conn *conn, struct msgb *msg);
-int msc_classmark_request_then_cipher_mode_cmd(struct ran_conn *conn, bool 
umts_aka,
-                                              bool retrieve_imeisv);
-int msc_geran_set_cipher_mode(struct ran_conn *conn, bool umts_aka, bool 
retrieve_imeisv);
-void msc_cipher_mode_compl(struct ran_conn *conn,
-                          struct msgb *msg, uint8_t alg_id);
-void msc_rx_sec_mode_compl(struct ran_conn *conn);
-void msc_classmark_chg(struct ran_conn *conn,
-                      const uint8_t *cm2, uint8_t cm2_len,
-                      const uint8_t *cm3, uint8_t cm3_len);
-void msc_assign_fail(struct ran_conn *conn,
-                    uint8_t cause, uint8_t *rr_cause);
+void ran_conn_sapi_n_reject(struct ran_conn *conn, int dlci);
+int ran_conn_clear_request(struct ran_conn *conn, uint32_t cause);
+void ran_conn_compl_l3(struct ran_conn *conn,
+                      struct msgb *msg, uint16_t chosen_channel);
+void ran_conn_dtap(struct ran_conn *conn, struct msgb *msg);
+int ran_conn_classmark_request_then_cipher_mode_cmd(struct ran_conn *conn, 
bool umts_aka,
+                                                   bool retrieve_imeisv);
+int ran_conn_geran_set_cipher_mode(struct ran_conn *conn, bool umts_aka, bool 
retrieve_imeisv);
+void ran_conn_cipher_mode_compl(struct ran_conn *conn, struct msgb *msg, 
uint8_t alg_id);
+void ran_conn_rx_sec_mode_compl(struct ran_conn *conn);
+void ran_conn_classmark_chg(struct ran_conn *conn,
+                           const uint8_t *cm2, uint8_t cm2_len,
+                           const uint8_t *cm3, uint8_t cm3_len);
+void ran_conn_assign_fail(struct ran_conn *conn, uint8_t cause, uint8_t 
*rr_cause);

 void ran_conn_init(void);
 bool ran_conn_is_accepted(const struct ran_conn *conn);
@@ -79,16 +77,16 @@
 void ran_conn_rx_iu_release_complete(struct ran_conn *conn);

 enum ran_conn_use {
-       MSC_CONN_USE_UNTRACKED = -1,
-       MSC_CONN_USE_COMPL_L3,
-       MSC_CONN_USE_DTAP,
-       MSC_CONN_USE_AUTH_CIPH,
-       MSC_CONN_USE_CM_SERVICE,
-       MSC_CONN_USE_TRANS_CC,
-       MSC_CONN_USE_TRANS_SMS,
-       MSC_CONN_USE_TRANS_NC_SS,
-       MSC_CONN_USE_SILENT_CALL,
-       MSC_CONN_USE_RELEASE,
+       RAN_CONN_USE_UNTRACKED = -1,
+       RAN_CONN_USE_COMPL_L3,
+       RAN_CONN_USE_DTAP,
+       RAN_CONN_USE_AUTH_CIPH,
+       RAN_CONN_USE_CM_SERVICE,
+       RAN_CONN_USE_TRANS_CC,
+       RAN_CONN_USE_TRANS_SMS,
+       RAN_CONN_USE_TRANS_NC_SS,
+       RAN_CONN_USE_SILENT_CALL,
+       RAN_CONN_USE_RELEASE,
 };

 extern const struct value_string ran_conn_use_names[];
diff --git a/src/libmsc/a_iface.c b/src/libmsc/a_iface.c
index fa0cb5f..82519d6 100644
--- a/src/libmsc/a_iface.c
+++ b/src/libmsc/a_iface.c
@@ -629,7 +629,7 @@
                        uint32_t conn_id = conn->a.conn_id;
                        LOGPCONN(conn, LOGL_NOTICE, "Dropping orphaned RAN 
connection\n");
                        /* This call will/may talloc_free(conn), so we must 
save conn_id above */
-                       msc_clear_request(conn, GSM48_CC_CAUSE_SWITCH_CONG);
+                       ran_conn_clear_request(conn, 
GSM48_CC_CAUSE_SWITCH_CONG);

                        /* If there is still an SCCP connection active, remove 
it now */
                        if (check_connection_active(conn_id)) {
diff --git a/src/libmsc/a_iface_bssap.c b/src/libmsc/a_iface_bssap.c
index 31cdb06..4d03d23 100644
--- a/src/libmsc/a_iface_bssap.c
+++ b/src/libmsc/a_iface_bssap.c
@@ -343,7 +343,7 @@
        conn = ran_conn_allocate_a(a_conn_info, network, lac, scu, 
a_conn_info->conn_id);

        /* Handover location update to the MSC code */
-       msc_compl_l3(conn, msg, 0);
+       ran_conn_compl_l3(conn, msg, 0);
        return 0;
 }

@@ -372,7 +372,7 @@
        }

        /* Inform MSC about the classmark change */
-       msc_classmark_chg(conn, cm2, cm2_len, cm3, cm3_len);
+       ran_conn_classmark_chg(conn, cm2, cm2_len, cm3, cm3_len);

        return 0;
 }
@@ -383,9 +383,9 @@
 {
        /* FIXME: The field GSM0808_IE_LAYER_3_MESSAGE_CONTENTS is optional by
         * means of the specification. So there can be messages without L3 info.
-        * In this case, the code will crash becrause msc_cipher_mode_compl()
+        * In this case, the code will crash becrause 
ran_conn_cipher_mode_compl()
         * is not able to deal with msg = NULL and apperently
-        * msc_cipher_mode_compl() was never meant to be used without L3 data.
+        * ran_conn_cipher_mode_compl() was never meant to be used without L3 
data.
         * This needs to be discussed further! */

        uint8_t alg_id = 1;
@@ -407,7 +407,7 @@
        rate_ctr_inc(&msc->ctr[MSC_CTR_BSSMAP_CIPHER_MODE_COMPLETE]);

        /* Hand over cipher mode complete message to the MSC */
-       msc_cipher_mode_compl(conn, msg, alg_id);
+       ran_conn_cipher_mode_compl(conn, msg, alg_id);

        return 0;
 }
@@ -462,12 +462,12 @@

        /* FIXME: In AoIP, the Assignment failure will carry also an optional
         * Codec List (BSS Supported) element. It has to be discussed if we
-        * can ignore this element. If not, The msc_assign_fail() function
-        * call has to change. However msc_assign_fail() does nothing in the
+        * can ignore this element. If not, The ran_conn_assign_fail() function
+        * call has to change. However ran_conn_assign_fail() does nothing in 
the
         * end. So probably we can just leave it as it is. Even for AoIP */

        /* Inform the MSC about the assignment failure event */
-       msc_assign_fail(conn, cause, rr_cause_ptr);
+       ran_conn_assign_fail(conn, cause, rr_cause_ptr);

        return 0;
 }
@@ -494,7 +494,7 @@
        dlci = TLVP_VAL(tp, GSM0808_IE_DLCI)[0];

        /* Inform the MSC about the sapi "n" reject event */
-       msc_sapi_n_reject(conn, dlci);
+       ran_conn_sapi_n_reject(conn, dlci);

        return 0;
 }
@@ -582,7 +582,7 @@

        /* FIXME: Seems to be related to authentication or,
           encryption. Is this really in the right place? */
-       msc_rx_sec_mode_compl(conn);
+       ran_conn_rx_sec_mode_compl(conn);

        return 0;
 }
@@ -670,12 +670,12 @@

        LOGPCONN(conn, LOGL_DEBUG, "Rx DTAP %s\n", msgb_hexdump_l2(msg));

-       /* msc_dtap expects the dtap payload in l3h */
+       /* ran_conn_dtap expects the dtap payload in l3h */
        msg->l3h = msg->l2h + 3;
        OMSC_LINKID_CB(msg) = dtap->link_id;

        /* Forward dtap payload into the msc */
-       msc_dtap(conn, msg);
+       ran_conn_dtap(conn, msg);

        return 0;
 }
diff --git a/src/libmsc/gsm_04_08.c b/src/libmsc/gsm_04_08.c
index 407144e..97a632b 100644
--- a/src/libmsc/gsm_04_08.c
+++ b/src/libmsc/gsm_04_08.c
@@ -687,7 +687,7 @@

        if (!conn->received_cm_service_request) {
                conn->received_cm_service_request = true;
-               ran_conn_get(conn, MSC_CONN_USE_CM_SERVICE);
+               ran_conn_get(conn, RAN_CONN_USE_CM_SERVICE);
        }
        ran_conn_update_id(conn, conn->complete_layer3_type, mi_string);
        return conn->network->vlr->ops.tx_cm_serv_acc(conn);
@@ -1332,7 +1332,7 @@
                       gsm48_pdisc_msgtype_name(pdisc, msg_type));
        }
        conn->received_cm_service_request = false;
-       ran_conn_put(conn, MSC_CONN_USE_CM_SERVICE);
+       ran_conn_put(conn, RAN_CONN_USE_CM_SERVICE);
 }

 /* TS 24.007 11.2.3.2.3 Message Type Octet / Duplicate Detection */
@@ -1584,7 +1584,7 @@

        if (conn->received_cm_service_request) {
                conn->received_cm_service_request = false;
-               ran_conn_put(conn, MSC_CONN_USE_CM_SERVICE);
+               ran_conn_put(conn, RAN_CONN_USE_CM_SERVICE);
        }

        return rc;
@@ -1594,7 +1594,7 @@
 osmo_static_assert(sizeof(((struct gsm0808_encrypt_info*)0)->key) >= 
sizeof(((struct osmo_auth_vector*)0)->kc),
                   gsm0808_encrypt_info_key_fits_osmo_auth_vec_kc);

-int msc_geran_set_cipher_mode(struct ran_conn *conn, bool umts_aka, bool 
retrieve_imeisv)
+int ran_conn_geran_set_cipher_mode(struct ran_conn *conn, bool umts_aka, bool 
retrieve_imeisv)
 {
        struct gsm_network *net = conn->network;
        struct gsm0808_encrypt_info ei;
@@ -1640,7 +1640,7 @@
                     vlr_subscr_name(conn->vsub), request_classmark_for_a5_n,
                     request_classmark);

-               return msc_classmark_request_then_cipher_mode_cmd(conn, 
umts_aka, retrieve_imeisv);
+               return ran_conn_classmark_request_then_cipher_mode_cmd(conn, 
umts_aka, retrieve_imeisv);
        }

        if (ei.perm_algo_len == 0) {
@@ -1701,7 +1701,7 @@

        switch (conn->via_ran) {
        case RAN_GERAN_A:
-               return msc_geran_set_cipher_mode(conn, umts_aka, 
retrieve_imeisv);
+               return ran_conn_geran_set_cipher_mode(conn, umts_aka, 
retrieve_imeisv);

        case RAN_UTRAN_IU:
 #ifdef BUILD_IU
@@ -1723,7 +1723,7 @@
        return -ENOTSUP;
 }

-void msc_rx_sec_mode_compl(struct ran_conn *conn)
+void ran_conn_rx_sec_mode_compl(struct ran_conn *conn)
 {
        struct vlr_ciph_result vlr_res = {};

diff --git a/src/libmsc/gsm_04_08_cc.c b/src/libmsc/gsm_04_08_cc.c
index 516fc51..8ac87c1 100644
--- a/src/libmsc/gsm_04_08_cc.c
+++ b/src/libmsc/gsm_04_08_cc.c
@@ -322,7 +322,7 @@
                       vlr_subscr_msisdn_or_name(transt->vsub));
                OSMO_ASSERT(conn);
                /* Assign conn */
-               transt->conn = ran_conn_get(conn, MSC_CONN_USE_TRANS_CC);
+               transt->conn = ran_conn_get(conn, RAN_CONN_USE_TRANS_CC);
                transt->paging_request = NULL;
                /* send SETUP request to called party */
                gsm48_cc_tx_setup(transt, &transt->cc.msg);
@@ -2005,7 +2005,7 @@
                }

                /* Assign conn */
-               trans->conn = ran_conn_get(conn, MSC_CONN_USE_TRANS_CC);
+               trans->conn = ran_conn_get(conn, RAN_CONN_USE_TRANS_CC);
                trans->dlci = 0x00; /* SAPI=0, not SACCH */
                vlr_subscr_put(vsub);
        } else {
@@ -2160,7 +2160,7 @@
                        return -ENOMEM;
                }
                /* Assign transaction */
-               trans->conn = ran_conn_get(conn, MSC_CONN_USE_TRANS_CC);
+               trans->conn = ran_conn_get(conn, RAN_CONN_USE_TRANS_CC);
                trans->dlci = OMSC_LINKID_CB(msg); /* DLCI as received from BSC 
*/
                cm_service_request_concludes(conn, msg);
        }
diff --git a/src/libmsc/gsm_04_11.c b/src/libmsc/gsm_04_11.c
index d214f2e..d012443 100644
--- a/src/libmsc/gsm_04_11.c
+++ b/src/libmsc/gsm_04_11.c
@@ -148,7 +148,7 @@
        switch (event) {
        case GSM_PAGING_SUCCEEDED:
                /* Associate transaction with established connection */
-               trans->conn = ran_conn_get(conn, MSC_CONN_USE_TRANS_SMS);
+               trans->conn = ran_conn_get(conn, RAN_CONN_USE_TRANS_SMS);
                /* Confirm successful connection establishment */
                gsm411_smc_recv(&trans->sms.smc_inst,
                        GSM411_MMSMS_EST_CNF, NULL, 0);
@@ -1010,7 +1010,7 @@
        conn = connection_for_subscr(vsub);
        if (conn) {
                /* Associate transaction with connection */
-               trans->conn = ran_conn_get(conn, MSC_CONN_USE_TRANS_SMS);
+               trans->conn = ran_conn_get(conn, RAN_CONN_USE_TRANS_SMS);
                /* Generate unique RP Message Reference */
                trans->sms.sm_rp_mr = conn->next_rp_ref++;
        }
@@ -1140,7 +1140,7 @@
                gsm411_smr_init(&trans->sms.smr_inst, 0, 1,
                        gsm411_rl_recv, gsm411_mn_send);

-               trans->conn = ran_conn_get(conn, MSC_CONN_USE_TRANS_SMS);
+               trans->conn = ran_conn_get(conn, RAN_CONN_USE_TRANS_SMS);
                trans->dlci = OMSC_LINKID_CB(msg); /* DLCI as received from BSC 
*/

                new_trans = 1;
diff --git a/src/libmsc/gsm_09_11.c b/src/libmsc/gsm_09_11.c
index e1ea681..c0a0bdd 100644
--- a/src/libmsc/gsm_09_11.c
+++ b/src/libmsc/gsm_09_11.c
@@ -113,7 +113,7 @@
                /* Count active NC SS/USSD sessions */
                osmo_counter_inc(conn->network->active_nc_ss);

-               trans->conn = ran_conn_get(conn, MSC_CONN_USE_TRANS_NC_SS);
+               trans->conn = ran_conn_get(conn, RAN_CONN_USE_TRANS_NC_SS);
                trans->dlci = OMSC_LINKID_CB(msg);
                cm_service_request_concludes(conn, msg);
        }
@@ -232,7 +232,7 @@
                        vlr_subscr_msisdn_or_name(transt->vsub));

                /* Assign connection */
-               transt->conn = ran_conn_get(conn, MSC_CONN_USE_TRANS_NC_SS);
+               transt->conn = ran_conn_get(conn, RAN_CONN_USE_TRANS_NC_SS);
                transt->paging_request = NULL;

                /* Send stored message */
@@ -324,7 +324,7 @@
        conn = connection_for_subscr(vsub);
        if (conn) {
                /* Assign connection */
-               trans->conn = ran_conn_get(conn, MSC_CONN_USE_TRANS_NC_SS);
+               trans->conn = ran_conn_get(conn, RAN_CONN_USE_TRANS_NC_SS);
                trans->dlci = 0x00; /* SAPI=0, not SACCH */
                return trans;
        }
diff --git a/src/libmsc/iucs.c b/src/libmsc/iucs.c
index f9ed759..1e4ab19 100644
--- a/src/libmsc/iucs.c
+++ b/src/libmsc/iucs.c
@@ -172,7 +172,7 @@
                uint8_t pdisc = gh->proto_discr & 0x0f;
                OSMO_ASSERT(pdisc != GSM48_PDISC_RR);

-               msc_dtap(conn, msg);
+               ran_conn_dtap(conn, msg);
        } else {
                /* allocate a new connection */

@@ -189,7 +189,7 @@
                        abort();

                /* ownership of conn hereby goes to the MSC: */
-               msc_compl_l3(conn, msg, 0);
+               ran_conn_compl_l3(conn, msg, 0);
        }

        return 0;
diff --git a/src/libmsc/iucs_ranap.c b/src/libmsc/iucs_ranap.c
index 7358080..a657857 100644
--- a/src/libmsc/iucs_ranap.c
+++ b/src/libmsc/iucs_ranap.c
@@ -96,7 +96,7 @@

        /* TODO evalute ies */

-       msc_rx_sec_mode_compl(conn);
+       ran_conn_rx_sec_mode_compl(conn);
        return 0;
 }

diff --git a/src/libmsc/osmo_msc.c b/src/libmsc/osmo_msc.c
index f2fe85c..45dfd73 100644
--- a/src/libmsc/osmo_msc.c
+++ b/src/libmsc/osmo_msc.c
@@ -79,7 +79,7 @@
 }

 /* Receive a SAPI-N-REJECT from BSC */
-void msc_sapi_n_reject(struct ran_conn *conn, int dlci)
+void ran_conn_sapi_n_reject(struct ran_conn *conn, int dlci)
 {
        int sapi = dlci & 0x7;

@@ -90,21 +90,21 @@
 /* receive a Level 3 Complete message.
  * Ownership of the conn is completely passed to the conn FSM, i.e. for both 
acceptance and rejection,
  * the conn FSM shall decide when to release this conn. It may already be 
discarded before this exits. */
-void msc_compl_l3(struct ran_conn *conn,
-                 struct msgb *msg, uint16_t chosen_channel)
+void ran_conn_compl_l3(struct ran_conn *conn,
+                      struct msgb *msg, uint16_t chosen_channel)
 {
-       ran_conn_get(conn, MSC_CONN_USE_COMPL_L3);
+       ran_conn_get(conn, RAN_CONN_USE_COMPL_L3);
        gsm0408_dispatch(conn, msg);
-       ran_conn_put(conn, MSC_CONN_USE_COMPL_L3);
+       ran_conn_put(conn, RAN_CONN_USE_COMPL_L3);
 }

 /* Receive a DTAP message from BSC */
-void msc_dtap(struct ran_conn *conn, struct msgb *msg)
+void ran_conn_dtap(struct ran_conn *conn, struct msgb *msg)
 {
-       ran_conn_get(conn, MSC_CONN_USE_DTAP);
+       ran_conn_get(conn, RAN_CONN_USE_DTAP);
        gsm0408_dispatch(conn, msg);

-       ran_conn_put(conn, MSC_CONN_USE_DTAP);
+       ran_conn_put(conn, RAN_CONN_USE_DTAP);
 }

 /* Receive an ASSIGNMENT COMPLETE from BSC */
@@ -116,16 +116,15 @@
 }

 /* Receive an ASSIGNMENT FAILURE from BSC */
-void msc_assign_fail(struct ran_conn *conn,
-                    uint8_t cause, uint8_t *rr_cause)
+void ran_conn_assign_fail(struct ran_conn *conn, uint8_t cause, uint8_t 
*rr_cause)
 {
        LOGP(DRR, LOGL_DEBUG, "MSC assign failure (do nothing).\n");
 }

 /* Receive a CLASSMARK CHANGE from BSC */
-void msc_classmark_chg(struct ran_conn *conn,
-                      const uint8_t *cm2, uint8_t cm2_len,
-                      const uint8_t *cm3, uint8_t cm3_len)
+void ran_conn_classmark_chg(struct ran_conn *conn,
+                           const uint8_t *cm2, uint8_t cm2_len,
+                           const uint8_t *cm3, uint8_t cm3_len)
 {
        struct gsm_classmark *cm;

@@ -159,8 +158,7 @@
 }

 /* Receive a CIPHERING MODE COMPLETE from BSC */
-void msc_cipher_mode_compl(struct ran_conn *conn,
-                          struct msgb *msg, uint8_t alg_id)
+void ran_conn_cipher_mode_compl(struct ran_conn *conn, struct msgb *msg, 
uint8_t alg_id)
 {
        struct vlr_ciph_result ciph_res = { .cause = VLR_CIPH_REJECT };

@@ -207,7 +205,7 @@
 }

 /* Receive a CLEAR REQUEST from BSC */
-int msc_clear_request(struct ran_conn *conn, uint32_t cause)
+int ran_conn_clear_request(struct ran_conn *conn, uint32_t cause)
 {
        ran_conn_close(conn, cause);
        return 1;
@@ -250,7 +248,7 @@
 {
        OSMO_ASSERT(conn);

-       if (balance_token != MSC_CONN_USE_UNTRACKED) {
+       if (balance_token != RAN_CONN_USE_UNTRACKED) {
                uint32_t flag = 1 << balance_token;
                OSMO_ASSERT(balance_token < 32);
                if (conn->use_tokens & flag)
@@ -271,13 +269,12 @@
 }

 /* decrement the ref-count. Once it reaches zero, we release */
-void _ran_conn_put(struct ran_conn *conn,
-                         enum ran_conn_use balance_token,
-                         const char *file, int line)
+void _ran_conn_put(struct ran_conn *conn, enum ran_conn_use balance_token,
+                  const char *file, int line)
 {
        OSMO_ASSERT(conn);

-       if (balance_token != MSC_CONN_USE_UNTRACKED) {
+       if (balance_token != RAN_CONN_USE_UNTRACKED) {
                uint32_t flag = 1 << balance_token;
                OSMO_ASSERT(balance_token < 32);
                if (!(conn->use_tokens & flag))
@@ -312,16 +309,16 @@
 }

 const struct value_string ran_conn_use_names[] = {
-       {MSC_CONN_USE_UNTRACKED,        "UNTRACKED"},
-       {MSC_CONN_USE_COMPL_L3,         "compl_l3"},
-       {MSC_CONN_USE_DTAP,             "dtap"},
-       {MSC_CONN_USE_AUTH_CIPH,        "auth+ciph"},
-       {MSC_CONN_USE_CM_SERVICE,       "cm_service"},
-       {MSC_CONN_USE_TRANS_CC,         "trans_cc"},
-       {MSC_CONN_USE_TRANS_SMS,        "trans_sms"},
-       {MSC_CONN_USE_TRANS_NC_SS,      "trans_nc_ss"},
-       {MSC_CONN_USE_SILENT_CALL,      "silent_call"},
-       {MSC_CONN_USE_RELEASE,          "release"},
+       {RAN_CONN_USE_UNTRACKED,        "UNTRACKED"},
+       {RAN_CONN_USE_COMPL_L3,         "compl_l3"},
+       {RAN_CONN_USE_DTAP,             "dtap"},
+       {RAN_CONN_USE_AUTH_CIPH,        "auth+ciph"},
+       {RAN_CONN_USE_CM_SERVICE,       "cm_service"},
+       {RAN_CONN_USE_TRANS_CC,         "trans_cc"},
+       {RAN_CONN_USE_TRANS_SMS,        "trans_sms"},
+       {RAN_CONN_USE_TRANS_NC_SS,      "trans_nc_ss"},
+       {RAN_CONN_USE_SILENT_CALL,      "silent_call"},
+       {RAN_CONN_USE_RELEASE,          "release"},
        {0, NULL},
 };

diff --git a/src/libmsc/silent_call.c b/src/libmsc/silent_call.c
index 6c6e217..c6c31a0 100644
--- a/src/libmsc/silent_call.c
+++ b/src/libmsc/silent_call.c
@@ -57,7 +57,7 @@
                        conn->lchan->ts->nr, conn->lchan->ts->trx->arfcn);
 #endif
                conn->silent_call = 1;
-               ran_conn_get(conn, MSC_CONN_USE_SILENT_CALL);
+               ran_conn_get(conn, RAN_CONN_USE_SILENT_CALL);
                /* increment lchan reference count */
                osmo_signal_dispatch(SS_SCALL, S_SCALL_SUCCESS, &sigdata);
                break;
@@ -162,7 +162,7 @@
 #endif

        conn->silent_call = 0;
-       ran_conn_put(conn, MSC_CONN_USE_SILENT_CALL);
+       ran_conn_put(conn, RAN_CONN_USE_SILENT_CALL);

        return 0;
 }
diff --git a/src/libmsc/subscr_conn.c b/src/libmsc/subscr_conn.c
index b1c8bc9..5fab1c6 100644
--- a/src/libmsc/subscr_conn.c
+++ b/src/libmsc/subscr_conn.c
@@ -94,7 +94,7 @@
        if (conn->complete_layer3_type == COMPLETE_LAYER3_CM_SERVICE_REQ
            && conn_accepted) {
                conn->received_cm_service_request = true;
-               ran_conn_get(conn, MSC_CONN_USE_CM_SERVICE);
+               ran_conn_get(conn, RAN_CONN_USE_CM_SERVICE);
        }

        if (conn_accepted)
@@ -163,7 +163,7 @@
        }
 }

-int msc_classmark_request_then_cipher_mode_cmd(struct ran_conn *conn, bool 
umts_aka,
+int ran_conn_classmark_request_then_cipher_mode_cmd(struct ran_conn *conn, 
bool umts_aka,
                                               bool retrieve_imeisv)
 {
        int rc;
@@ -190,14 +190,14 @@
                 * So far though, the only time we send a Classmark Request is 
during Ciphering. As soon
                 * as more such situations arise, we need to add state to 
indicate what action should
                 * follow after a Classmark Update is received (e.g.
-                * msc_classmark_request_then_cipher_mode_cmd() sets an enum 
value to indicate that
+                * ran_conn_classmark_request_then_cipher_mode_cmd() sets an 
enum value to indicate that
                 * Ciphering should continue afterwards). But right now, it is 
accurate to always
                 * continue with Ciphering: */

                /* During Ciphering, we needed Classmark information. The 
Classmark Update has come in,
                 * go back into the Set Ciphering Command procedure. */
                osmo_fsm_inst_state_chg(fi, RAN_CONN_S_AUTH_CIPH, 
RAN_CONN_TIMEOUT, 0);
-               if (msc_geran_set_cipher_mode(conn, 
conn->geran_set_cipher_mode.umts_aka,
+               if (ran_conn_geran_set_cipher_mode(conn, 
conn->geran_set_cipher_mode.umts_aka,
                                              
conn->geran_set_cipher_mode.retrieve_imeisv)) {
                        LOGPFSML(fi, LOGL_ERROR,
                                 "Sending Cipher Mode Command failed, aborting 
attach\n");
@@ -341,13 +341,13 @@
        /* Use count for either conn->a.waiting_for_clear_complete or
         * conn->iu.waiting_for_release_complete. 'get' it early, so we don't 
deallocate after tearing
         * down active transactions. Safeguard against double-get (though it 
shouldn't happen). */
-       if (!ran_conn_used_by(conn, MSC_CONN_USE_RELEASE))
-               ran_conn_get(conn, MSC_CONN_USE_RELEASE);
+       if (!ran_conn_used_by(conn, RAN_CONN_USE_RELEASE))
+               ran_conn_get(conn, RAN_CONN_USE_RELEASE);

        /* Cancel pending CM Service Requests */
        if (conn->received_cm_service_request) {
                conn->received_cm_service_request = false;
-               ran_conn_put(conn, MSC_CONN_USE_CM_SERVICE);
+               ran_conn_put(conn, RAN_CONN_USE_CM_SERVICE);
        }

        /* Cancel all VLR FSMs, if any */
@@ -693,7 +693,7 @@
        }
        if (*flag) {
                *flag = false;
-               ran_conn_put(conn, MSC_CONN_USE_RELEASE);
+               ran_conn_put(conn, RAN_CONN_USE_RELEASE);
        }
 }

diff --git a/src/libmsc/transaction.c b/src/libmsc/transaction.c
index 5c80e5f..cf12066 100644
--- a/src/libmsc/transaction.c
+++ b/src/libmsc/transaction.c
@@ -140,21 +140,21 @@
  */
 void trans_free(struct gsm_trans *trans)
 {
-       enum ran_conn_use conn_usage_token = MSC_CONN_USE_UNTRACKED;
+       enum ran_conn_use conn_usage_token = RAN_CONN_USE_UNTRACKED;
        struct ran_conn *conn;

        switch (trans->protocol) {
        case GSM48_PDISC_CC:
                _gsm48_cc_trans_free(trans);
-               conn_usage_token = MSC_CONN_USE_TRANS_CC;
+               conn_usage_token = RAN_CONN_USE_TRANS_CC;
                break;
        case GSM48_PDISC_SMS:
                _gsm411_sms_trans_free(trans);
-               conn_usage_token = MSC_CONN_USE_TRANS_SMS;
+               conn_usage_token = RAN_CONN_USE_TRANS_SMS;
                break;
        case GSM48_PDISC_NC_SS:
                _gsm911_nc_ss_trans_free(trans);
-               conn_usage_token = MSC_CONN_USE_TRANS_NC_SS;
+               conn_usage_token = RAN_CONN_USE_TRANS_NC_SS;
                break;
        }

diff --git a/tests/msc_vlr/msc_vlr_test_call.c 
b/tests/msc_vlr/msc_vlr_test_call.c
index 5819e51..ef88c5a 100644
--- a/tests/msc_vlr/msc_vlr_test_call.c
+++ b/tests/msc_vlr/msc_vlr_test_call.c
@@ -404,7 +404,7 @@
        cc_to_mncc_expect_tx("", MNCC_REL_CNF);
        dtap_expect_tx("032d"); /* CC: Release */
        expect_iu_release();
-       msc_clear_request(g_conn, 0);
+       ran_conn_clear_request(g_conn, 0);
        OSMO_ASSERT(cc_to_mncc_tx_confirmed);
        OSMO_ASSERT(iu_release_sent);

diff --git a/tests/msc_vlr/msc_vlr_tests.c b/tests/msc_vlr/msc_vlr_tests.c
index 92e0acc..2443e31 100644
--- a/tests/msc_vlr/msc_vlr_tests.c
+++ b/tests/msc_vlr/msc_vlr_tests.c
@@ -186,7 +186,7 @@
        OSMO_ASSERT(conn->received_cm_service_request);

        conn->received_cm_service_request = false;
-       ran_conn_put(conn, MSC_CONN_USE_CM_SERVICE);
+       ran_conn_put(conn, RAN_CONN_USE_CM_SERVICE);

        ASSERT_RELEASE_CLEAR(via_ran);
 }
@@ -225,14 +225,14 @@
                g_conn = conn_new();
                reset_l3_seq_nr();
                patch_l3_seq_nr(msg);
-               msc_compl_l3(g_conn, msg, 23);
+               ran_conn_compl_l3(g_conn, msg, 23);
        } else {
                patch_l3_seq_nr(msg);
                if ((gsm48_hdr_pdisc(gh) == GSM48_PDISC_RR)
                    && (gsm48_hdr_msg_type(gh) == GSM48_MT_RR_CIPH_M_COMPL))
-                       msc_cipher_mode_compl(g_conn, msg, 0);
+                       ran_conn_cipher_mode_compl(g_conn, msg, 0);
                else
-                       msc_dtap(g_conn, msg);
+                       ran_conn_dtap(g_conn, msg);
        }

        if (!conn_exists(g_conn))
@@ -842,7 +842,7 @@
        OSMO_ASSERT(g_conn);
        OSMO_ASSERT(g_conn->via_ran == RAN_UTRAN_IU);
        OSMO_ASSERT(g_conn->iu.ue_ctx);
-       msc_rx_sec_mode_compl(g_conn);
+       ran_conn_rx_sec_mode_compl(g_conn);
 }

 void bss_sends_clear_complete()

--
To view, visit https://gerrit.osmocom.org/12030
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: Ia17a0a35f11911e00e19cafb5d7828d729a69640
Gerrit-Change-Number: 12030
Gerrit-PatchSet: 7
Gerrit-Owner: Neels Hofmeyr <[email protected]>
Gerrit-Reviewer: Jenkins Builder (1000002)
Gerrit-Reviewer: Pau Espin Pedrol <[email protected]>
Gerrit-Reviewer: Vadim Yanitskiy <[email protected]>

Reply via email to