rename gsm_subscriber_connection to ran_conn

In preparation for inter-BSC and inter-MSC handover, we need to separate the
subscriber management logic from the actual RAN connections. What better time
to finally rename gsm_subscriber_connection.

* Name choice:

In 2G, this is a connection to the BSS, but even though 3GPP TS commonly talk
of "BSS-A" and "BSS-B" when explaining handover, it's not good to call it
"bss_conn": in 3G a BSS is called RNS, IIUC.

The overall term for 2G (GERAN) and 3G (UTRAN) is RAN: Radio Access Network.

* Rationale:

A subscriber in the MSC so far has only one RAN connection, but e.g. for
inter-BSC handover, a second one needs to be created to handover to. Most of
the items in the former gsm_subscriber_connection are actually related to the
RAN, with only a few MM and RTP related items. So, as a first step, just rename
it to ran_conn, to cosmetically prepare for moving the not strictly RAN related
items away later.

Also:

- Rename some functions from msc_subscr_conn_* to ran_conn_*
- Rename "Subscr_Conn" FSM instance name to "RAN_conn"
- Rename SUBSCR_CONN_* to RAN_CONN_*

Change-Id: Ic595f7a558d3553c067f77dc67543ab59659707a
changes/15/12015/10
Neels Hofmeyr 4 years ago
parent d03e728915
commit c036b79918
  1. 8
      include/osmocom/msc/a_iface.h
  2. 26
      include/osmocom/msc/gsm_04_08.h
  3. 6
      include/osmocom/msc/gsm_04_11.h
  4. 12
      include/osmocom/msc/gsm_04_14.h
  5. 8
      include/osmocom/msc/gsm_04_80.h
  6. 2
      include/osmocom/msc/gsm_09_11.h
  7. 18
      include/osmocom/msc/gsm_data.h
  8. 4
      include/osmocom/msc/gsm_subscriber.h
  9. 4
      include/osmocom/msc/iucs.h
  10. 8
      include/osmocom/msc/msc_ifaces.h
  11. 6
      include/osmocom/msc/msc_mgcp.h
  12. 115
      include/osmocom/msc/osmo_msc.h
  13. 4
      include/osmocom/msc/signal.h
  14. 6
      include/osmocom/msc/silent_call.h
  15. 10
      include/osmocom/msc/transaction.h
  16. 2
      include/osmocom/msc/vlr.h
  17. 24
      src/libmsc/a_iface.c
  18. 60
      src/libmsc/a_iface_bssap.c
  19. 142
      src/libmsc/gsm_04_08.c
  20. 16
      src/libmsc/gsm_04_08_cc.c
  21. 24
      src/libmsc/gsm_04_11.c
  22. 18
      src/libmsc/gsm_04_14.c
  23. 8
      src/libmsc/gsm_04_80.c
  24. 14
      src/libmsc/gsm_09_11.c
  25. 8
      src/libmsc/gsm_subscriber.c
  26. 32
      src/libmsc/iucs.c
  27. 12
      src/libmsc/iucs_ranap.c
  28. 10
      src/libmsc/msc_ifaces.c
  29. 24
      src/libmsc/msc_mgcp.c
  30. 14
      src/libmsc/msc_vty.c
  31. 62
      src/libmsc/osmo_msc.c
  32. 4
      src/libmsc/rrlp.c
  33. 12
      src/libmsc/silent_call.c
  34. 10
      src/libmsc/smpp_openbsc.c
  35. 6
      src/libmsc/smpp_smsc.h
  36. 384
      src/libmsc/subscr_conn.c
  37. 14
      src/libmsc/transaction.c
  38. 2
      src/libvlr/vlr.c
  39. 2
      src/osmo-msc/msc_main.c
  40. 900
      tests/msc_vlr/msc_vlr_test_authen_reuse.err
  41. 494
      tests/msc_vlr/msc_vlr_test_call.err
  42. 702
      tests/msc_vlr/msc_vlr_test_gsm_authen.err
  43. 1070
      tests/msc_vlr/msc_vlr_test_gsm_ciph.err
  44. 410
      tests/msc_vlr/msc_vlr_test_hlr_reject.err
  45. 4
      tests/msc_vlr/msc_vlr_test_hlr_timeout.c
  46. 108
      tests/msc_vlr/msc_vlr_test_hlr_timeout.err
  47. 6
      tests/msc_vlr/msc_vlr_test_ms_timeout.c
  48. 268
      tests/msc_vlr/msc_vlr_test_ms_timeout.err
  49. 828
      tests/msc_vlr/msc_vlr_test_no_authen.err
  50. 2
      tests/msc_vlr/msc_vlr_test_reject_concurrency.c
  51. 700
      tests/msc_vlr/msc_vlr_test_reject_concurrency.err
  52. 8
      tests/msc_vlr/msc_vlr_test_rest.c
  53. 210
      tests/msc_vlr/msc_vlr_test_rest.err
  54. 154
      tests/msc_vlr/msc_vlr_test_ss.err
  55. 632
      tests/msc_vlr/msc_vlr_test_umts_authen.err
  56. 46
      tests/msc_vlr/msc_vlr_tests.c
  57. 12
      tests/msc_vlr/msc_vlr_tests.h

@ -66,7 +66,7 @@ int a_init(struct osmo_sccp_instance *sccp, struct gsm_network *network);
int a_iface_tx_dtap(struct msgb *msg);
/* Send Cipher mode command via A-interface */
int a_iface_tx_cipher_mode(const struct gsm_subscriber_connection *conn,
int a_iface_tx_cipher_mode(const struct ran_conn *conn,
struct gsm0808_encrypt_info *ei, int include_imeisv);
/* Page a subscriber via A-interface */
@ -76,11 +76,11 @@ int a_iface_tx_paging(const char *imsi, uint32_t tmsi, uint16_t lac);
int a_iface_tx_assignment(const struct gsm_trans *trans);
/* Send clear command via A-interface */
int a_iface_tx_clear_cmd(struct gsm_subscriber_connection *conn);
int a_iface_tx_clear_cmd(struct ran_conn *conn);
int a_iface_tx_classmark_request(const struct gsm_subscriber_connection *conn);
int a_iface_tx_classmark_request(const struct ran_conn *conn);
/* Clear all subscriber connections on a specified BSC
/* Clear all RAN connections on a specified BSC
* (Helper function for a_iface_bssap.c) */
void a_clear_all(struct osmo_sccp_user *scu, const struct osmo_sccp_addr *bsc_addr);

@ -9,7 +9,7 @@ struct msgb;
struct gsm_bts;
struct gsm_network;
struct gsm_trans;
struct gsm_subscriber_connection;
struct ran_conn;
struct amr_multirate_conf;
struct amr_mode;
@ -22,29 +22,29 @@ static inline struct msgb *gsm48_msgb_alloc_name(const char *name)
name);
}
void cm_service_request_concludes(struct gsm_subscriber_connection *conn,
void cm_service_request_concludes(struct ran_conn *conn,
struct msgb *msg);
/* config options controlling the behaviour of the lower leves */
void gsm0408_clear_all_trans(struct gsm_network *net, int protocol);
int gsm0408_dispatch(struct gsm_subscriber_connection *conn, struct msgb *msg);
int gsm0408_dispatch(struct ran_conn *conn, struct msgb *msg);
int gsm0408_rcvmsg(struct msgb *msg, uint8_t link_id);
/* don't use "enum gsm_chreq_reason_t" to avoid circular dependency */
void gsm_net_update_ctype(struct gsm_network *net);
int gsm48_tx_simple(struct gsm_subscriber_connection *conn,
int gsm48_tx_simple(struct ran_conn *conn,
uint8_t pdisc, uint8_t msg_type);
int gsm48_tx_mm_info(struct gsm_subscriber_connection *conn);
int gsm48_tx_mm_auth_req(struct gsm_subscriber_connection *conn, uint8_t *rand,
int gsm48_tx_mm_info(struct ran_conn *conn);
int gsm48_tx_mm_auth_req(struct ran_conn *conn, uint8_t *rand,
uint8_t *autn, int key_seq);
int gsm48_tx_mm_auth_rej(struct gsm_subscriber_connection *conn);
int gsm48_tx_mm_serv_ack(struct gsm_subscriber_connection *conn);
int gsm48_tx_mm_serv_rej(struct gsm_subscriber_connection *conn,
int gsm48_tx_mm_auth_rej(struct ran_conn *conn);
int gsm48_tx_mm_serv_ack(struct ran_conn *conn);
int gsm48_tx_mm_serv_rej(struct ran_conn *conn,
enum gsm48_reject_value value);
int gsm48_send_rr_release(struct gsm_lchan *lchan);
int gsm48_send_rr_ciph_mode(struct gsm_lchan *lchan, int want_imeisv);
int gsm48_send_rr_app_info(struct gsm_subscriber_connection *conn, uint8_t apdu_id,
int gsm48_send_rr_app_info(struct ran_conn *conn, uint8_t apdu_id,
uint8_t apdu_len, const uint8_t *apdu);
int gsm48_send_rr_ass_cmd(struct gsm_lchan *dest_lchan, struct gsm_lchan *lchan, uint8_t power_class);
int gsm48_send_ho_cmd(struct gsm_lchan *old_lchan, struct gsm_lchan *new_lchan,
@ -70,12 +70,12 @@ struct msgb *gsm48_create_loc_upd_rej(uint8_t cause);
void gsm48_lchan2chan_desc(struct gsm48_chan_desc *cd,
const struct gsm_lchan *lchan);
void release_security_operation(struct gsm_subscriber_connection *conn);
void allocate_security_operation(struct gsm_subscriber_connection *conn);
void release_security_operation(struct ran_conn *conn);
void allocate_security_operation(struct ran_conn *conn);
int gsm48_multirate_config(uint8_t *lv, const struct amr_multirate_conf *mr, const struct amr_mode *modes);
int gsm48_tch_rtp_create(struct gsm_trans *trans);
int gsm48_conn_sendmsg(struct msgb *msg, struct gsm_subscriber_connection *conn, struct gsm_trans *trans);
int gsm48_conn_sendmsg(struct msgb *msg, struct ran_conn *conn, struct gsm_trans *trans);
#endif

@ -4,7 +4,7 @@
#include <osmocom/gsm/protocol/gsm_04_11.h>
struct vlr_subscr;
struct gsm_subscriber_connection;
struct ran_conn;
struct gsm_trans;
#define UM_SAPI_SMS 3 /* See GSM 04.05/04.06 */
@ -30,7 +30,7 @@ struct sms_deliver {
struct gsm_network;
struct msgb;
int gsm0411_rcv_sms(struct gsm_subscriber_connection *conn, struct msgb *msg);
int gsm0411_rcv_sms(struct ran_conn *conn, struct msgb *msg);
struct gsm_sms *sms_alloc(void);
void sms_free(struct gsm_sms *sms);
@ -41,7 +41,7 @@ struct gsm_sms *sms_from_text(struct vlr_subscr *receiver,
int gsm411_send_sms(struct gsm_network *net,
struct vlr_subscr *vsub,
struct gsm_sms *sms);
void gsm411_sapi_n_reject(struct gsm_subscriber_connection *conn);
void gsm411_sapi_n_reject(struct ran_conn *conn);
int gsm411_send_rp_ack(struct gsm_trans *trans, uint8_t msg_ref);
int gsm411_send_rp_error(struct gsm_trans *trans, uint8_t msg_ref,

@ -2,14 +2,14 @@
#include <osmocom/gsm/protocol/gsm_04_14.h>
int gsm0414_tx_close_tch_loop_cmd(struct gsm_subscriber_connection *conn,
int gsm0414_tx_close_tch_loop_cmd(struct ran_conn *conn,
enum gsm414_tch_loop_mode loop_mode);
int gsm0414_tx_open_loop_cmd(struct gsm_subscriber_connection *conn);
int gsm0414_tx_act_emmi_cmd(struct gsm_subscriber_connection *conn);
int gsm0414_tx_test_interface(struct gsm_subscriber_connection *conn,
int gsm0414_tx_open_loop_cmd(struct ran_conn *conn);
int gsm0414_tx_act_emmi_cmd(struct ran_conn *conn);
int gsm0414_tx_test_interface(struct ran_conn *conn,
uint8_t tested_devs);
int gsm0414_tx_reset_ms_pos_store(struct gsm_subscriber_connection *conn,
int gsm0414_tx_reset_ms_pos_store(struct ran_conn *conn,
uint8_t technology);
int gsm0414_rcv_test(struct gsm_subscriber_connection *conn,
int gsm0414_rcv_test(struct ran_conn *conn,
struct msgb *msg);

@ -2,12 +2,12 @@
#include <stdint.h>
struct gsm_subscriber_connection;
struct ran_conn;
int msc_send_ussd_reject(struct gsm_subscriber_connection *conn,
int msc_send_ussd_reject(struct ran_conn *conn,
uint8_t transaction_id, int invoke_id,
uint8_t problem_tag, uint8_t problem_code);
int msc_send_ussd_notify(struct gsm_subscriber_connection *conn, int level,
int msc_send_ussd_notify(struct ran_conn *conn, int level,
const char *text);
int msc_send_ussd_release_complete(struct gsm_subscriber_connection *conn);
int msc_send_ussd_release_complete(struct ran_conn *conn);

@ -3,5 +3,5 @@
#include <osmocom/core/msgb.h>
#include <osmocom/gsm/gsup.h>
int gsm0911_rcv_nc_ss(struct gsm_subscriber_connection *conn, struct msgb *msg);
int gsm0911_rcv_nc_ss(struct ran_conn *conn, struct msgb *msg);
int gsm0911_gsup_handler(struct vlr_subscr *vsub, struct osmo_gsup_message *gsup);

@ -90,11 +90,11 @@ static inline const char *complete_layer3_type_name(enum complete_layer3_type va
}
/* active radio connection of a mobile subscriber */
struct gsm_subscriber_connection {
/* global linked list of subscriber_connections */
struct ran_conn {
/* global linked list of ran_conn instances */
struct llist_head entry;
/* FSM instance to control the subscriber connection's permissions and lifetime. */
/* FSM instance to control the RAN connection's permissions and lifetime. */
struct osmo_fsm_inst *fi;
enum complete_layer3_type complete_layer3_type;
@ -168,12 +168,12 @@ struct gsm_subscriber_connection {
struct osmo_sccp_user *scu;
/* The address of the BSC that is associated
* with this subscriber connection */
* with this RAN connection */
struct osmo_sccp_addr bsc_addr;
/* The connection identifier that is used
* to reference the SCCP connection that is
* associated with this subscriber connection */
* associated with this RAN connection */
uint32_t conn_id;
bool waiting_for_clear_complete;
@ -293,9 +293,9 @@ struct gsm_network {
mncc_recv_cb_t mncc_recv;
struct llist_head upqueue;
/*
* TODO: Move the trans_list into the subscriber connection and
* TODO: Move the trans_list into the RAN connection and
* create a pending list for MT transactions. These exist before
* we have a subscriber connection.
* we have a RAN connection.
*/
struct llist_head trans_list;
@ -311,8 +311,8 @@ struct gsm_network {
/* control interface */
struct ctrl_handle *ctrl;
/* all active subscriber connections. */
struct llist_head subscr_conns;
/* all active RAN connections. */
struct llist_head ran_conns;
/* if override is nonzero, this timezone data is used for all MM
* contexts. */

@ -58,13 +58,13 @@ struct subscr_request *subscr_request_conn(struct vlr_subscr *vsub,
void subscr_remove_request(struct subscr_request *req);
int subscr_rx_paging_response(struct msgb *msg,
struct gsm_subscriber_connection *conn);
struct ran_conn *conn);
void subscr_paging_cancel(struct vlr_subscr *vsub, enum gsm_paging_event event);
int subscr_paging_dispatch(unsigned int hooknum, unsigned int event,
struct msgb *msg, void *data, void *param);
/* Find an allocated channel for a specified subscriber */
struct gsm_subscriber_connection *connection_for_subscr(struct vlr_subscr *vsub);
struct ran_conn *connection_for_subscr(struct vlr_subscr *vsub);
#endif /* _GSM_SUBSCR_H */

@ -5,8 +5,8 @@
int gsm0408_rcvmsg_iucs(struct gsm_network *network, struct msgb *msg,
uint16_t *lac);
struct gsm_subscriber_connection *subscr_conn_lookup_iu(struct gsm_network *network,
struct ranap_ue_conn_ctx *ue);
struct ran_conn *ran_conn_lookup_iu(struct gsm_network *network,
struct ranap_ue_conn_ctx *ue);
int iu_rab_act_cs(struct gsm_trans *trans);
uint32_t iu_get_conn_id(const struct ranap_ue_conn_ctx *ue);

@ -29,11 +29,11 @@
/* Each main linkage must implement this function (see comment above). */
extern int iu_tx(struct msgb *msg, uint8_t sapi);
int msc_tx_dtap(struct gsm_subscriber_connection *conn,
int msc_tx_dtap(struct ran_conn *conn,
struct msgb *msg);
int msc_gsm48_tx_mm_serv_ack(struct gsm_subscriber_connection *conn);
int msc_gsm48_tx_mm_serv_rej(struct gsm_subscriber_connection *conn,
int msc_gsm48_tx_mm_serv_ack(struct ran_conn *conn);
int msc_gsm48_tx_mm_serv_rej(struct ran_conn *conn,
enum gsm48_reject_value value);
int msc_tx_common_id(struct gsm_subscriber_connection *conn);
int msc_tx_common_id(struct ran_conn *conn);

@ -25,8 +25,8 @@
/* MGCP state handler context. This context information stores all information
* to handle the direction of the RTP streams via MGCP. There is one instance
* of this context struct per subscriber connection.
* (see also struct gsm_subscriber_connection) */
* of this context struct per RAN connection.
* (see also struct ran_conn) */
struct mgcp_ctx {
/* FSM instance, which handles the connection switching procedure */
struct osmo_fsm_inst *fsm;
@ -56,6 +56,6 @@ struct mgcp_ctx {
};
int msc_mgcp_call_assignment(struct gsm_trans *trans);
int msc_mgcp_ass_complete(struct gsm_subscriber_connection *conn, uint16_t port, char *addr);
int msc_mgcp_ass_complete(struct ran_conn *conn, uint16_t port, char *addr);
int msc_mgcp_call_complete(struct gsm_trans *trans, uint16_t port, char *addr);
int msc_mgcp_call_release(struct gsm_trans *trans);

@ -11,77 +11,74 @@
#define MSC_HLR_REMOTE_IP_DEFAULT "127.0.0.1"
#define MSC_HLR_REMOTE_PORT_DEFAULT OSMO_GSUP_PORT
enum subscr_conn_fsm_event {
enum ran_conn_fsm_event {
/* Accepted the initial Complete Layer 3 (starting to evaluate Authentication and Ciphering) */
SUBSCR_CONN_E_COMPLETE_LAYER_3,
RAN_CONN_E_COMPLETE_LAYER_3,
/* Received Classmark Update, typically neede for Ciphering Mode Command */
SUBSCR_CONN_E_CLASSMARK_UPDATE,
RAN_CONN_E_CLASSMARK_UPDATE,
/* LU or Process Access FSM has determined that this conn is good */
SUBSCR_CONN_E_ACCEPTED,
RAN_CONN_E_ACCEPTED,
/* received first reply from MS in "real" CC, SMS, USSD communication */
SUBSCR_CONN_E_COMMUNICATING,
RAN_CONN_E_COMMUNICATING,
/* Some async action has completed, check again whether all is done */
SUBSCR_CONN_E_RELEASE_WHEN_UNUSED,
RAN_CONN_E_RELEASE_WHEN_UNUSED,
/* MS/BTS/BSC originated close request */
SUBSCR_CONN_E_MO_CLOSE,
RAN_CONN_E_MO_CLOSE,
/* MSC originated close request, e.g. failed authentication */
SUBSCR_CONN_E_CN_CLOSE,
RAN_CONN_E_CN_CLOSE,
/* The usage count for the conn has reached zero */
SUBSCR_CONN_E_UNUSED,
RAN_CONN_E_UNUSED,
};
enum subscr_conn_fsm_state {
SUBSCR_CONN_S_NEW,
SUBSCR_CONN_S_AUTH_CIPH,
SUBSCR_CONN_S_WAIT_CLASSMARK_UPDATE,
SUBSCR_CONN_S_ACCEPTED,
SUBSCR_CONN_S_COMMUNICATING,
SUBSCR_CONN_S_RELEASING,
SUBSCR_CONN_S_RELEASED,
enum ran_conn_fsm_state {
RAN_CONN_S_NEW,
RAN_CONN_S_AUTH_CIPH,
RAN_CONN_S_WAIT_CLASSMARK_UPDATE,
RAN_CONN_S_ACCEPTED,
RAN_CONN_S_COMMUNICATING,
RAN_CONN_S_RELEASING,
RAN_CONN_S_RELEASED,
};
struct gsm_subscriber_connection *msc_subscr_conn_alloc(struct gsm_network *network,
enum ran_type via_ran, uint16_t lac);
struct ran_conn *ran_conn_alloc(struct gsm_network *network, enum ran_type via_ran, uint16_t lac);
void msc_subscr_conn_update_id(struct gsm_subscriber_connection *conn,
enum complete_layer3_type from, const char *id);
char *msc_subscr_conn_get_conn_id(struct gsm_subscriber_connection *conn);
void ran_conn_update_id(struct ran_conn *conn, enum complete_layer3_type from, const char *id);
char *ran_conn_get_conn_id(struct ran_conn *conn);
void msc_subscr_conn_complete_layer_3(struct gsm_subscriber_connection *conn);
void ran_conn_complete_layer_3(struct ran_conn *conn);
int msc_vlr_alloc(struct gsm_network *net);
int msc_vlr_start(struct gsm_network *net);
void msc_sapi_n_reject(struct gsm_subscriber_connection *conn, int dlci);
int msc_clear_request(struct gsm_subscriber_connection *conn, uint32_t cause);
void msc_compl_l3(struct gsm_subscriber_connection *conn,
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 gsm_subscriber_connection *conn, struct msgb *msg);
int msc_classmark_request_then_cipher_mode_cmd(struct gsm_subscriber_connection *conn, bool umts_aka,
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 gsm_subscriber_connection *conn, bool umts_aka, bool retrieve_imeisv);
void msc_cipher_mode_compl(struct gsm_subscriber_connection *conn,
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 gsm_subscriber_connection *conn);
void msc_classmark_chg(struct gsm_subscriber_connection *conn,
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 gsm_subscriber_connection *conn,
void msc_assign_fail(struct ran_conn *conn,
uint8_t cause, uint8_t *rr_cause);
void msc_subscr_conn_init(void);
bool msc_subscr_conn_is_accepted(const struct gsm_subscriber_connection *conn);
bool msc_subscr_conn_is_establishing_auth_ciph(const struct gsm_subscriber_connection *conn);
void msc_subscr_conn_communicating(struct gsm_subscriber_connection *conn);
void msc_subscr_conn_close(struct gsm_subscriber_connection *conn,
uint32_t cause);
void msc_subscr_conn_mo_close(struct gsm_subscriber_connection *conn, uint32_t cause);
bool msc_subscr_conn_in_release(struct gsm_subscriber_connection *conn);
void ran_conn_init(void);
bool ran_conn_is_accepted(const struct ran_conn *conn);
bool ran_conn_is_establishing_auth_ciph(const struct ran_conn *conn);
void ran_conn_communicating(struct ran_conn *conn);
void ran_conn_close(struct ran_conn *conn, uint32_t cause);
void ran_conn_mo_close(struct ran_conn *conn, uint32_t cause);
bool ran_conn_in_release(struct ran_conn *conn);
void msc_subscr_conn_rx_bssmap_clear_complete(struct gsm_subscriber_connection *conn);
void msc_subscr_conn_rx_iu_release_complete(struct gsm_subscriber_connection *conn);
void ran_conn_rx_bssmap_clear_complete(struct ran_conn *conn);
void ran_conn_rx_iu_release_complete(struct ran_conn *conn);
enum msc_subscr_conn_use {
enum ran_conn_use {
MSC_CONN_USE_UNTRACKED = -1,
MSC_CONN_USE_COMPL_L3,
MSC_CONN_USE_DTAP,
@ -94,23 +91,19 @@ enum msc_subscr_conn_use {
MSC_CONN_USE_RELEASE,
};
extern const struct value_string msc_subscr_conn_use_names[];
static inline const char *msc_subscr_conn_use_name(enum msc_subscr_conn_use val)
{ return get_value_string(msc_subscr_conn_use_names, val); }
#define msc_subscr_conn_get(conn, balance_token) \
_msc_subscr_conn_get(conn, balance_token, __FILE__, __LINE__)
#define msc_subscr_conn_put(conn, balance_token) \
_msc_subscr_conn_put(conn, balance_token, __FILE__, __LINE__)
struct gsm_subscriber_connection *
_msc_subscr_conn_get(struct gsm_subscriber_connection *conn,
enum msc_subscr_conn_use balance_token,
const char *file, int line);
void _msc_subscr_conn_put(struct gsm_subscriber_connection *conn,
enum msc_subscr_conn_use balance_token,
const char *file, int line);
bool msc_subscr_conn_used_by(struct gsm_subscriber_connection *conn,
enum msc_subscr_conn_use token);
extern const struct value_string ran_conn_use_names[];
static inline const char *ran_conn_use_name(enum ran_conn_use val)
{ return get_value_string(ran_conn_use_names, val); }
#define ran_conn_get(conn, balance_token) \
_ran_conn_get(conn, balance_token, __FILE__, __LINE__)
#define ran_conn_put(conn, balance_token) \
_ran_conn_put(conn, balance_token, __FILE__, __LINE__)
struct ran_conn * _ran_conn_get(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);
bool ran_conn_used_by(struct ran_conn *conn, enum ran_conn_use token);
void msc_stop_paging(struct vlr_subscr *vsub);

@ -83,11 +83,11 @@ struct paging_signal_data {
int paging_result;
/* NULL in case the paging didn't work */
struct gsm_subscriber_connection *conn;
struct ran_conn *conn;
};
struct scall_signal_data {
struct gsm_subscriber_connection *conn;
struct ran_conn *conn;
void *data;
};
struct sms_signal_data {

@ -1,15 +1,15 @@
#ifndef _SILENT_CALL_H
#define _SILENT_CALL_H
struct gsm_subscriber_connection;
struct ran_conn;
extern int gsm_silent_call_start(struct vlr_subscr *vsub,
void *data, int type);
extern int gsm_silent_call_stop(struct vlr_subscr *vsub);
#if 0
extern int silent_call_rx(struct gsm_subscriber_connection *conn, struct msgb *msg);
extern int silent_call_reroute(struct gsm_subscriber_connection *conn, struct msgb *msg);
extern int silent_call_rx(struct ran_conn *conn, struct msgb *msg);
extern int silent_call_reroute(struct ran_conn *conn, struct msgb *msg);
#endif
#endif /* _SILENT_CALL_H */

@ -38,7 +38,7 @@ struct gsm_trans {
struct vlr_subscr *vsub;
/* The associated connection we are using to transmit messages */
struct gsm_subscriber_connection *conn;
struct ran_conn *conn;
/* reference from MNCC or other application */
uint32_t callref;
@ -98,11 +98,11 @@ struct gsm_trans {
struct gsm_trans *trans_find_by_id(struct gsm_subscriber_connection *conn,
struct gsm_trans *trans_find_by_id(struct ran_conn *conn,
uint8_t proto, uint8_t trans_id);
struct gsm_trans *trans_find_by_callref(struct gsm_network *net,
uint32_t callref);
struct gsm_trans *trans_find_by_sm_rp_mr(struct gsm_subscriber_connection *conn,
struct gsm_trans *trans_find_by_sm_rp_mr(struct ran_conn *conn,
uint8_t sm_rp_mr);
struct gsm_trans *trans_alloc(struct gsm_network *net,
@ -113,7 +113,7 @@ void trans_free(struct gsm_trans *trans);
int trans_assign_trans_id(struct gsm_network *net, struct vlr_subscr *vsub,
uint8_t protocol, uint8_t ti_flag);
struct gsm_trans *trans_has_conn(const struct gsm_subscriber_connection *conn);
void trans_conn_closed(struct gsm_subscriber_connection *conn);
struct gsm_trans *trans_has_conn(const struct ran_conn *conn);
void trans_conn_closed(struct ran_conn *conn);
#endif

@ -289,7 +289,7 @@ void vlr_loc_update_cancel(struct osmo_fsm_inst *fi,
enum osmo_fsm_term_cause fsm_cause,
uint8_t gsm48_cause);
/* tell the VLR that the subscriber connection is gone */
/* tell the VLR that the RAN connection is gone */
int vlr_subscr_disconnected(struct vlr_subscr *vsub);
bool vlr_subscr_expire(struct vlr_subscr *vsub);
int vlr_subscr_rx_id_resp(struct vlr_subscr *vsub, const uint8_t *mi, size_t mi_len);

@ -142,12 +142,12 @@ static struct bsc_context *get_bsc_context_by_sccp_addr(const struct osmo_sccp_a
/* Send DTAP message via A-interface, take ownership of msg */
int a_iface_tx_dtap(struct msgb *msg)
{
struct gsm_subscriber_connection *conn;
struct ran_conn *conn;
struct msgb *msg_resp;
uint8_t link_id = OMSC_LINKID_CB(msg);
OSMO_ASSERT(msg);
conn = (struct gsm_subscriber_connection *)msg->dst;
conn = (struct ran_conn *)msg->dst;
OSMO_ASSERT(conn);
OSMO_ASSERT(conn->a.scu);
@ -171,7 +171,7 @@ int a_iface_tx_dtap(struct msgb *msg)
}
/* Send Cipher mode command via A-interface */
int a_iface_tx_cipher_mode(const struct gsm_subscriber_connection *conn,
int a_iface_tx_cipher_mode(const struct ran_conn *conn,
struct gsm0808_encrypt_info *ei, int include_imeisv)
{
/* TODO generalize for A- and Iu interfaces, don't name after 08.08 */
@ -358,7 +358,7 @@ static int enc_speech_codec_list(struct gsm0808_speech_codec_list *scl, const st
/* Send assignment request via A-interface */
int a_iface_tx_assignment(const struct gsm_trans *trans)
{
struct gsm_subscriber_connection *conn;
struct ran_conn *conn;
struct gsm0808_channel_type ct;
struct gsm0808_speech_codec_list scl;
uint32_t *ci_ptr = NULL;
@ -412,7 +412,7 @@ int a_iface_tx_assignment(const struct gsm_trans *trans)
}
/* Send clear command via A-interface */
int a_iface_tx_clear_cmd(struct gsm_subscriber_connection *conn)
int a_iface_tx_clear_cmd(struct ran_conn *conn)
{
struct msgb *msg;
@ -422,7 +422,7 @@ int a_iface_tx_clear_cmd(struct gsm_subscriber_connection *conn)
return osmo_sccp_tx_data_msg(conn->a.scu, conn->a.conn_id, msg);
}
int a_iface_tx_classmark_request(const struct gsm_subscriber_connection *conn)
int a_iface_tx_classmark_request(const struct ran_conn *conn)
{
struct msgb *msg;
@ -443,7 +443,7 @@ static void a_reset_cb(const void *priv)
if (!gsm_network)
return;
/* Clear all now orphaned subscriber connections */
/* Clear all now orphaned RAN connections */
a_clear_all(bsc_ctx->sccp_user, &bsc_ctx->bsc_addr);
/* Send reset to the remote BSC */
@ -612,22 +612,22 @@ static int sccp_sap_up(struct osmo_prim_hdr *oph, void *_scu)
return rc;
}
/* Clear all subscriber connections on a specified BSC */
/* Clear all RAN connections on a specified BSC */
void a_clear_all(struct osmo_sccp_user *scu, const struct osmo_sccp_addr *bsc_addr)
{
struct gsm_subscriber_connection *conn;
struct gsm_subscriber_connection *conn_temp;
struct ran_conn *conn;
struct ran_conn *conn_temp;
struct gsm_network *network = gsm_network;
OSMO_ASSERT(scu);
OSMO_ASSERT(bsc_addr);
llist_for_each_entry_safe(conn, conn_temp, &network->subscr_conns, entry) {
llist_for_each_entry_safe(conn, conn_temp, &network->ran_conns, entry) {
/* Clear only A connections and connections that actually
* belong to the specified BSC */
if (conn->via_ran == RAN_GERAN_A && memcmp(bsc_addr, &conn->a.bsc_addr, sizeof(conn->a.bsc_addr)) == 0) {
uint32_t conn_id = conn->a.conn_id;
LOGPCONN(conn, LOGL_NOTICE, "Dropping orphaned subscriber connection\n");
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);

@ -45,16 +45,16 @@
* Helper functions to lookup and allocate subscribers
*/
/* Allocate a new subscriber connection */
static struct gsm_subscriber_connection *subscr_conn_allocate_a(const struct a_conn_info *a_conn_info,
/* Allocate a new RAN connection */
static struct ran_conn *ran_conn_allocate_a(const struct a_conn_info *a_conn_info,
struct gsm_network *network,
uint16_t lac, struct osmo_sccp_user *scu, int conn_id)
{
struct gsm_subscriber_connection *conn;
struct ran_conn *conn;
LOGP(DMSC, LOGL_DEBUG, "Allocating A-Interface subscriber conn: lac %i, conn_id %i\n", lac, conn_id);
LOGP(DMSC, LOGL_DEBUG, "Allocating A-Interface RAN conn: lac %i, conn_id %i\n", lac, conn_id);
conn = msc_subscr_conn_alloc(network, RAN_GERAN_A, lac);
conn = ran_conn_alloc(network, RAN_GERAN_A, lac);
if (!conn)
return NULL;
@ -62,18 +62,18 @@ static struct gsm_subscriber_connection *subscr_conn_allocate_a(const struct a_c
conn->a.scu = scu;
/* Also backup the calling address of the BSC, this allows us to
* identify later which BSC is responsible for this subscriber connection */
* identify later which BSC is responsible for this RAN connection */
memcpy(&conn->a.bsc_addr, &a_conn_info->bsc->bsc_addr, sizeof(conn->a.bsc_addr));
LOGPCONN(conn, LOGL_DEBUG, "A-Interface subscriber connection successfully allocated!\n");
LOGPCONN(conn, LOGL_DEBUG, "A-Interface RAN connection successfully allocated!\n");
return conn;
}
/* Return an existing A subscriber connection record for the given
/* Return an existing A RAN connection record for the given
* connection IDs, or return NULL if not found. */
static struct gsm_subscriber_connection *subscr_conn_lookup_a(const struct gsm_network *network, int conn_id)
static struct ran_conn *ran_conn_lookup_a(const struct gsm_network *network, int conn_id)
{
struct gsm_subscriber_connection *conn;
struct ran_conn *conn;
OSMO_ASSERT(network);
@ -83,7 +83,7 @@ static struct gsm_subscriber_connection *subscr_conn_lookup_a(const struct gsm_n
* maybe this function should be public to reach it from here? */
/* log_subscribers(network); */
llist_for_each_entry(conn, &network->subscr_conns, entry) {
llist_for_each_entry(conn, &network->ran_conns, entry) {
if (conn->via_ran == RAN_GERAN_A && conn->a.conn_id == conn_id) {
LOGPCONN(conn, LOGL_DEBUG, "Found A subscriber for conn_id %i\n", conn_id);
return conn;
@ -111,7 +111,7 @@ static void bssmap_rx_reset(struct osmo_sccp_user *scu, const struct a_conn_info
osmo_sccp_tx_unitdata_msg(scu, &a_conn_info->bsc->msc_addr, &a_conn_info->bsc->bsc_addr,
gsm0808_create_reset_ack());
/* Make sure all orphand subscriber connections will be cleard */
/* Make sure all orphand RAN connections will be cleard */
a_clear_all(scu, &a_conn_info->bsc->bsc_addr);
if (!a_conn_info->bsc->reset_fsm)
@ -213,7 +213,7 @@ void a_sccp_rx_udt(struct osmo_sccp_user *scu, const struct a_conn_info *a_conn_
*/
/* Endpoint to handle BSSMAP clear request */
static int bssmap_rx_clear_rqst(struct gsm_subscriber_connection *conn,
static int bssmap_rx_clear_rqst(struct ran_conn *conn,
struct msgb *msg, struct tlv_parsed *tp)
{
uint8_t cause;
@ -226,7 +226,7 @@ static int bssmap_rx_clear_rqst(struct gsm_subscriber_connection *conn,
}
cause = TLVP_VAL(tp, GSM0808_IE_CAUSE)[0];
msc_subscr_conn_mo_close(conn, cause);
ran_conn_mo_close(conn, cause);
return 0;
}
@ -234,14 +234,14 @@ static int bssmap_rx_clear_rqst(struct gsm_subscriber_connection *conn,
/* Endpoint to handle BSSMAP clear complete */
static int bssmap_rx_clear_complete(struct osmo_sccp_user *scu,
const struct a_conn_info *a_conn_info,
struct gsm_subscriber_connection *conn)
struct ran_conn *conn)
{
int rc;
LOGPCONN(conn, LOGL_INFO, "Rx BSSMAP CLEAR COMPLETE, releasing SCCP connection\n");
if (conn)
msc_subscr_conn_rx_bssmap_clear_complete(conn);
ran_conn_rx_bssmap_clear_complete(conn);
rc = osmo_sccp_tx_disconn(scu, a_conn_info->conn_id,
NULL, SCCP_RELEASE_CAUSE_END_USER_ORIGINATED);
@ -261,7 +261,7 @@ static int bssmap_rx_l3_compl(struct osmo_sccp_user *scu, const struct a_conn_in
uint8_t data_length;
const uint8_t *data;
struct gsm_network *network = a_conn_info->network;
struct gsm_subscriber_connection *conn;
struct ran_conn *conn;
LOGP(DBSSAP, LOGL_INFO, "Rx BSSMAP COMPLETE L3 INFO (conn_id=%i)\n", a_conn_info->conn_id);
@ -340,7 +340,7 @@ static int bssmap_rx_l3_compl(struct osmo_sccp_user *scu, const struct a_conn_in
}
/* Create new subscriber context */
conn = subscr_conn_allocate_a(a_conn_info, network, lac, scu, a_conn_info->conn_id);
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);
@ -348,7 +348,7 @@ static int bssmap_rx_l3_compl(struct osmo_sccp_user *scu, const struct a_conn_in
}
/* Endpoint to handle BSSMAP classmark update */
static int bssmap_rx_classmark_upd(struct gsm_subscriber_connection *conn, struct msgb *msg,
static int bssmap_rx_classmark_upd(struct ran_conn *conn, struct msgb *msg,
struct tlv_parsed *tp)
{
const uint8_t *cm2 = NULL;
@ -378,7 +378,7 @@ static int bssmap_rx_classmark_upd(struct gsm_subscriber_connection *conn, struc
}
/* Endpoint to handle BSSMAP cipher mode complete */
static int bssmap_rx_ciph_compl(struct gsm_subscriber_connection *conn, struct msgb *msg,
static int bssmap_rx_ciph_compl(struct ran_conn *conn, struct msgb *msg,
struct tlv_parsed *tp)
{
/* FIXME: The field GSM0808_IE_LAYER_3_MESSAGE_CONTENTS is optional by
@ -413,7 +413,7 @@ static int bssmap_rx_ciph_compl(struct gsm_subscriber_connection *conn, struct m
}
/* Endpoint to handle BSSMAP cipher mode reject, 3GPP TS 08.08 §3.2.1.48 */
static int bssmap_rx_ciph_rej(struct gsm_subscriber_connection *conn,
static int bssmap_rx_ciph_rej(struct ran_conn *conn,
struct msgb *msg, struct tlv_parsed *tp)
{
int rc;
@ -440,7 +440,7 @@ static int bssmap_rx_ciph_rej(struct gsm_subscriber_connection *conn,
}
/* Endpoint to handle BSSMAP assignment failure */
static int bssmap_rx_ass_fail(struct gsm_subscriber_connection *conn, struct msgb *msg,
static int bssmap_rx_ass_fail(struct ran_conn *conn, struct msgb *msg,
struct tlv_parsed *tp)
{
uint8_t cause;
@ -473,7 +473,7 @@ static int bssmap_rx_ass_fail(struct gsm_subscriber_connection *conn, struct msg
}
/* Endpoint to handle sapi "n" reject */
static int bssmap_rx_sapi_n_rej(struct gsm_subscriber_connection *conn, struct msgb *msg,
static int bssmap_rx_sapi_n_rej(struct ran_conn *conn, struct msgb *msg,
struct tlv_parsed *tp)
{
uint8_t dlci;
@ -538,7 +538,7 @@ static enum mgcp_codecs mgcp_codec_from_sc(struct gsm0808_speech_codec *sc)
}
/* Endpoint to handle assignment complete */
static int bssmap_rx_ass_compl(struct gsm_subscriber_connection *conn, struct msgb *msg,
static int bssmap_rx_ass_compl(struct ran_conn *conn, struct msgb *msg,
struct tlv_parsed *tp)
{
struct sockaddr_storage rtp_addr;
@ -590,7 +590,7 @@ static int bssmap_rx_ass_compl(struct gsm_subscriber_connection *conn, struct ms
/* Handle incoming connection oriented BSSMAP messages */
static int rx_bssmap(struct osmo_sccp_user *scu, const struct a_conn_info *a_conn_info, struct msgb *msg)
{
struct gsm_subscriber_connection *conn;
struct ran_conn *conn;
struct tlv_parsed tp;
int rc;
uint8_t msg_type;
@ -616,11 +616,11 @@ static int rx_bssmap(struct osmo_sccp_user *scu, const struct a_conn_info *a_con
break;
}
conn = subscr_conn_lookup_a(a_conn_info->network, a_conn_info->conn_id);
conn = ran_conn_lookup_a(a_conn_info->network, a_conn_info->conn_id);
if (!conn) {
LOGP(DBSSAP, LOGL_ERROR, "Couldn't find subscr_conn for conn_id=%d\n", a_conn_info->conn_id);
LOGP(DBSSAP, LOGL_ERROR, "Couldn't find ran_conn for conn_id=%d\n", a_conn_info->conn_id);
/* We expect a Clear Complete to come in on a valid conn. But if for some reason we still
* have the SCCP connection while the subscriber connection data is already gone, at
* have the SCCP connection while the RAN connection data is already gone, at
* least close the SCCP conn. */
if (msg_type == BSS_MAP_MSG_CLEAR_COMPLETE)
@ -660,10 +660,10 @@ static int rx_bssmap(struct osmo_sccp_user *scu, const struct a_conn_info *a_con
static int rx_dtap(const struct osmo_sccp_user *scu, const struct a_conn_info *a_conn_info, struct msgb *msg)
{
struct gsm_network *network = a_conn_info->network;
struct gsm_subscriber_connection *conn;
struct ran_conn *conn;
struct dtap_header *dtap = (struct dtap_header *) msg->l2h;
conn = subscr_conn_lookup_a(network, a_conn_info->conn_id);
conn = ran_conn_lookup_a(network, a_conn_info->conn_id);
if (!conn) {
return -EINVAL;
}

@ -77,16 +77,16 @@
void *tall_locop_ctx;
void *tall_authciphop_ctx;
static int gsm0408_loc_upd_acc(struct gsm_subscriber_connection *conn,
static int gsm0408_loc_upd_acc(struct ran_conn *conn,
uint32_t send_tmsi);
/*! Send a simple GSM 04.08 message without any payload
* \param conn Active subscriber connection
* \param conn Active RAN connection
* \param[in] pdisc Protocol discriminator
* \param[in] msg_type Message type
* \return result of \ref gsm48_conn_sendmsg
*/
int gsm48_tx_simple(struct gsm_subscriber_connection *conn,
int gsm48_tx_simple(struct ran_conn *conn,
uint8_t pdisc, uint8_t msg_type)
{
struct msgb *msg = gsm48_msgb_alloc_name("GSM 04.08 TX SIMPLE");
@ -176,7 +176,7 @@ static int classmark_supports_a5(const struct gsm_classmark *cm, uint8_t a5)
}
}
int gsm48_conn_sendmsg(struct msgb *msg, struct gsm_subscriber_connection *conn, struct gsm_trans *trans)
int gsm48_conn_sendmsg(struct msgb *msg, struct ran_conn *conn, struct gsm_trans *trans)
{
struct gsm48_hdr *gh = (struct gsm48_hdr *) msg->data;
@ -206,7 +206,7 @@ void gsm0408_clear_all_trans(struct gsm_network *net, int protocol)
}
/* Chapter 9.2.14 : Send LOCATION UPDATING REJECT */
static int gsm0408_loc_upd_rej(struct gsm_subscriber_connection *conn, uint8_t cause)
static int gsm0408_loc_upd_rej(struct ran_conn *conn, uint8_t cause)
{
struct msgb *msg;
@ -223,7 +223,7 @@ static int gsm0408_loc_upd_rej(struct gsm_subscriber_connection *conn, uint8_t c
}
/* Chapter 9.2.13 : Send LOCATION UPDATE ACCEPT */
static int gsm0408_loc_upd_acc(struct gsm_subscriber_connection *conn,
static int gsm0408_loc_upd_acc(struct ran_conn *conn,
uint32_t send_tmsi)
{
struct msgb *msg = gsm48_msgb_alloc_name("GSM 04.08 LOC UPD ACC");
@ -274,7 +274,7 @@ static int gsm0408_loc_upd_acc(struct gsm_subscriber_connection *conn,
}
/* Transmit Chapter 9.2.10 Identity Request */
static int mm_tx_identity_req(struct gsm_subscriber_connection *conn, uint8_t id_type)
static int mm_tx_identity_req(struct ran_conn *conn, uint8_t id_type)
{
struct msgb *msg = gsm48_msgb_alloc_name("GSM 04.08 ID REQ");
struct gsm48_hdr *gh;
@ -288,7 +288,7 @@ static int mm_tx_identity_req(struct gsm_subscriber_connection *conn, uint8_t id
}
/* Parse Chapter 9.2.11 Identity Response */
static int mm_rx_id_resp(struct gsm_subscriber_connection *conn, struct msgb *msg)
static int mm_rx_id_resp(struct ran_conn *conn, struct msgb *msg)
{
struct gsm48_hdr *gh = msgb_l3(msg);
uint8_t mi_type = gh->data[1] & GSM_MI_TYPE_MASK;
@ -319,7 +319,7 @@ static const struct value_string lupd_names[] = {
/* Chapter 9.2.15: Receive Location Updating Request.
* Keep this function non-static for direct invocation by unit tests. */
int mm_rx_loc_upd_req(struct gsm_subscriber_connection *conn, struct msgb *msg)
int mm_rx_loc_upd_req(struct ran_conn *conn, struct msgb *msg)
{
struct gsm_network *net = conn->network;
struct gsm48_hdr *gh = msgb_l3(msg);
@ -339,7 +339,7 @@ int mm_rx_loc_upd_req(struct gsm_subscriber_connection *conn, struct msgb *msg)
gsm48_mi_to_string(mi_string, sizeof(mi_string), lu->mi, lu->mi_len);
if (msc_subscr_conn_is_establishing_auth_ciph(conn)) {
if (ran_conn_is_establishing_auth_ciph(conn)) {
LOGP(DMM, LOGL_ERROR,
"Cannot accept another LU, conn already busy establishing authenticity;"
" extraneous LOCATION UPDATING REQUEST: MI(%s)=%s type=%s\n",
@ -347,7 +347,7 @@ int mm_rx_loc_upd_req(struct gsm_subscriber_connection *conn, struct msgb *msg)
return -EINVAL;
}
if (msc_subscr_conn_is_accepted(conn)) {
if (ran_conn_is_accepted(conn)) {
LOGP(DMM, LOGL_ERROR,
"Cannot accept another LU, conn already established;"
" extraneous LOCATION UPDATING REQUEST: MI(%s)=%s type=%s\n",
@ -355,7 +355,7 @@ int mm_rx_loc_upd_req(struct gsm_subscriber_connection *conn, struct msgb *msg)
return -EINVAL;
}
msc_subscr_conn_update_id(conn, COMPLETE_LAYER3_LU, mi_string);
ran_conn_update_id(conn, COMPLETE_LAYER3_LU, mi_string);
DEBUGP(DMM, "LOCATION UPDATING REQUEST: MI(%s)=%s type=%s\n",
gsm48_mi_type_name(mi_type), mi_string,
@ -406,7 +406,7 @@ int mm_rx_loc_upd_req(struct gsm_subscriber_connection *conn, struct msgb *msg)
is_utran = (conn->via_ran == RAN_UTRAN_IU);
lu_fsm = vlr_loc_update(conn->fi,
SUBSCR_CONN_E_ACCEPTED, SUBSCR_CONN_E_CN_CLOSE, NULL,
RAN_CONN_E_ACCEPTED, RAN_CONN_E_CN_CLOSE, NULL,
net->vlr, conn, vlr_lu_type, tmsi, imsi,
&old_lai, &new_lai,
is_utran || conn->network->authentication_required,
@ -433,7 +433,7 @@ int mm_rx_loc_upd_req(struct gsm_subscriber_connection *conn, struct msgb *msg)
conn->vsub->classmark.classmark1 = lu->classmark1;
conn->vsub->classmark.classmark1_set = true;
msc_subscr_conn_complete_layer_3(conn);
ran_conn_complete_layer_3(conn);
return 0;
}
@ -451,7 +451,7 @@ static uint8_t bcdify(uint8_t value)
/* Section 9.2.15a */
int gsm48_tx_mm_info(struct gsm_subscriber_connection *conn)
int gsm48_tx_mm_info(struct ran_conn *conn)
{
struct msgb *msg = gsm48_msgb_alloc_name("GSM 04.08 MM INF");
struct gsm48_hdr *gh;
@ -602,7 +602,7 @@ int gsm48_tx_mm_info(struct gsm_subscriber_connection *conn)
return gsm48_conn_sendmsg(msg, conn, NULL);
}
/*! Send an Authentication Request to MS on the given subscriber connection
/*! Send an Authentication Request to MS on the given RAN connection
* according to 3GPP/ETSI TS 24.008, Section 9.2.2.
* \param[in] conn Subscriber connection to send on.
* \param[in] rand Random challenge token to send, must be 16 bytes long.
@ -610,7 +610,7 @@ int gsm48_tx_mm_info(struct gsm_subscriber_connection *conn)
* send; must be 16 bytes long, or pass NULL for plain GSM auth.
* \param[in] key_seq auth tuple's sequence number.
*/
int gsm48_tx_mm_auth_req(struct gsm_subscriber_connection *conn, uint8_t *rand,
int gsm48_tx_mm_auth_req(struct ran_conn *conn, uint8_t *rand,
uint8_t *autn, int key_seq)
{
struct msgb *msg = gsm48_msgb_alloc_name("GSM 04.08 AUTH REQ");
@ -640,7 +640,7 @@ int gsm48_tx_mm_auth_req(struct gsm_subscriber_connection *conn, uint8_t *rand,
}
/* Section 9.2.1 */
int gsm48_tx_mm_auth_rej(struct gsm_subscriber_connection *conn)
int gsm48_tx_mm_auth_rej(struct ran_conn *conn)
{
DEBUGP(DMM, "-> AUTH REJECT\n");
return gsm48_tx_simple(conn, GSM48_PDISC_MM, GSM48_MT_MM_AUTH_REJ);
@ -649,7 +649,7 @@ int gsm48_tx_mm_auth_rej(struct gsm_subscriber_connection *conn)
static int msc_vlr_tx_cm_serv_acc(void *msc_conn_ref);
static int msc_vlr_tx_cm_serv_rej(void *msc_conn_ref, enum gsm48_reject_value result);
static int cm_serv_reuse_conn(struct gsm_subscriber_connection *conn, const uint8_t *mi_lv)
static int cm_serv_reuse_conn(struct ran_conn *conn, const uint8_t *mi_lv)
{
uint8_t mi_type;
char mi_string[GSM48_MI_SIZE];
@ -687,9 +687,9 @@ accept_reuse:
if (!conn->received_cm_service_request) {
conn->received_cm_service_request = true;
msc_subscr_conn_get(conn, MSC_CONN_USE_CM_SERVICE);
ran_conn_get(conn, MSC_CONN_USE_CM_SERVICE);
}
msc_subscr_conn_update_id(conn, conn->complete_layer3_type, mi_string);
ran_conn_update_id(conn, conn->complete_layer3_type, mi_string);
return conn->network->vlr->ops.tx_cm_serv_acc(conn);
}
@ -704,7 +704,7 @@ accept_reuse:
*
* Keep this function non-static for direct invocation by unit tests.
*/
int gsm48_rx_mm_serv_req(struct gsm_subscriber_connection *conn, struct msgb *msg)
int gsm48_rx_mm_serv_req(struct ran_conn *conn, struct msgb *msg)
{
struct gsm_network *net = conn->network;
uint8_t mi_type;
@ -771,10 +771,10 @@ int gsm48_rx_mm_serv_req(struct gsm_subscriber_connection *conn, struct msgb *ms
return msc_gsm48_tx_mm_serv_rej(conn, GSM48_REJECT_SRV_OPT_NOT_SUPPORTED);
}
if (msc_subscr_conn_is_accepted(conn))
if (ran_conn_is_accepted(conn))
return cm_serv_reuse_conn(conn, mi_p);
if (msc_subscr_conn_is_establishing_auth_ciph(conn)) {
if (ran_conn_is_establishing_auth_ciph(conn)) {
LOGP(DMM, LOGL_ERROR,
"Cannot accept CM Service Request, conn already busy establishing authenticity\n");
msc_vlr_tx_cm_serv_rej(conn, GSM48_REJECT_CONGESTION);
@ -782,13 +782,13 @@ int gsm48_rx_mm_serv_req(struct gsm_subscriber_connection *conn, struct msgb *ms
/* or should we accept and note down the service request anyway? */
}
msc_subscr_conn_update_id(conn, COMPLETE_LAYER3_CM_SERVICE_REQ, mi_string);
ran_conn_update_id(conn, COMPLETE_LAYER3_CM_SERVICE_REQ, mi_string);
osmo_signal_dispatch(SS_SUBSCR, S_SUBSCR_IDENTITY, mi_p);
is_utran = (conn->via_ran == RAN_UTRAN_IU);
vlr_proc_acc_req(conn->fi,
SUBSCR_CONN_E_ACCEPTED, SUBSCR_CONN_E_CN_CLOSE, NULL,
RAN_CONN_E_ACCEPTED, RAN_CONN_E_CN_CLOSE, NULL,
net->vlr, conn,
VLR_PR_ARQ_T_CM_SERV_REQ, mi-1, &lai,
is_utran || conn->network->authentication_required,
@ -807,12 +807,12 @@ int gsm48_rx_mm_serv_req(struct gsm_subscriber_connection *conn, struct msgb *ms
memcpy(conn->vsub->classmark.classmark2, classmark2, classmark2_len);
conn->vsub->classmark.classmark2_len = classmark2_len;
msc_subscr_conn_complete_layer_3(conn);
ran_conn_complete_layer_3(conn);
return 0;
}
/* Receive a CM Re-establish Request */
static int gsm48_rx_cm_reest_req(struct gsm_subscriber_connection *conn, struct msgb *msg)
static int gsm48_rx_cm_reest_req(struct ran_conn *conn, struct msgb *msg)
{
uint8_t mi_type;
char mi_string[GSM48_MI_SIZE];
@ -831,7 +831,7 @@ static int gsm48_rx_cm_reest_req(struct gsm_subscriber_connection *conn, struct
return msc_gsm48_tx_mm_serv_rej(conn, GSM48_REJECT_SRV_OPT_NOT_SUPPORTED);
}
static int gsm48_rx_mm_imsi_detach_ind(struct gsm_subscriber_connection *conn, struct msgb *msg)
static int gsm48_rx_mm_imsi_detach_ind(struct ran_conn *conn, struct msgb *msg)
{
struct gsm_network *network = conn->network;
struct gsm48_hdr *gh = msgb_l3(msg);
@ -884,7 +884,7 @@ static int gsm48_rx_mm_imsi_detach_ind(struct gsm_subscriber_connection *conn, s
vlr_subscr_put(vsub);
}
msc_subscr_conn_close(conn, 0);
ran_conn_close(conn, 0);
return 0;
}
@ -898,7 +898,7 @@ static int gsm48_rx_mm_status(struct msgb *msg)
}
static int parse_gsm_auth_resp(uint8_t *res, uint8_t *res_len,
struct gsm_subscriber_connection *conn,
struct ran_conn *conn,
struct msgb *msg)
{
struct gsm48_hdr *gh = msgb_l3(msg);
@ -918,7 +918,7 @@ static int parse_gsm_auth_resp(uint8_t *res, uint8_t *res_len,
}
static int parse_umts_auth_resp(uint8_t *res, uint8_t *res_len,
struct gsm_subscriber_connection *conn,
struct ran_conn *conn,
struct msgb *msg)
{
struct gsm48_hdr *gh;
@ -970,7 +970,7 @@ static int parse_umts_auth_resp(uint8_t *res, uint8_t *res_len,
}
/* Chapter 9.2.3: Authentication Response */
static int gsm48_rx_mm_auth_resp(struct gsm_subscriber_connection *conn, struct msgb *msg)
static int gsm48_rx_mm_auth_resp(struct ran_conn *conn, struct msgb *msg)
{
uint8_t res[16];
uint8_t res_len;
@ -980,7 +980,7 @@ static int gsm48_rx_mm_auth_resp(struct gsm_subscriber_connection *conn, struct
if (!conn->vsub) {
LOGP(DMM, LOGL_ERROR,
"MM AUTHENTICATION RESPONSE: invalid: no subscriber\n");
msc_subscr_conn_close(conn, GSM_CAUSE_AUTH_FAILED);
ran_conn_close(conn, GSM_CAUSE_AUTH_FAILED);
return -EINVAL;
}
@ -1010,7 +1010,7 @@ static int gsm48_rx_mm_auth_resp(struct gsm_subscriber_connection *conn, struct
res, res_len);
}
static int gsm48_rx_mm_auth_fail(struct gsm_subscriber_connection *conn, struct msgb *msg)
static int gsm48_rx_mm_auth_fail(struct ran_conn *conn, struct msgb *msg)
{
struct gsm48_hdr *gh = msgb_l3(msg);
uint8_t cause;
@ -1021,7 +1021,7 @@ static int gsm48_rx_mm_auth_fail(struct gsm_subscriber_connection *conn, struct
if (!conn->vsub) {
LOGP(DMM, LOGL_ERROR,
"MM R99 AUTHENTICATION FAILURE: invalid: no subscriber\n");
msc_subscr_conn_close(conn, GSM_CAUSE_AUTH_FAILED);
ran_conn_close(conn, GSM_CAUSE_AUTH_FAILED);
return -EINVAL;
}
@ -1030,7 +1030,7 @@ static int gsm48_rx_mm_auth_fail(struct gsm_subscriber_connection *conn, struct
"%s: MM R99 AUTHENTICATION FAILURE:"