summaryrefslogtreecommitdiffstats
path: root/openbsc/include
diff options
context:
space:
mode:
authorNeels Hofmeyr <nhofmeyr@sysmocom.de>2017-02-03 02:42:47 +0100
committerNeels Hofmeyr <nhofmeyr@sysmocom.de>2017-03-16 15:32:29 +0100
commitd20e7483d0872270a38d83efe1b7a14e87fe37de (patch)
tree19110266eb7f2879abb4c2f81943039a6f6549f4 /openbsc/include
parent067991aeb2b404f120678bd618ebd15614de3446 (diff)
Use libvlr in libmsc (large refactoring)
Original libvlr code is by Harald Welte <laforge@gnumonks.org>, polished and tweaked by Neels Hofmeyr <nhofmeyr@sysmocom.de>. This is a long series of development collapsed in one patch. The original history may still be available as branch neels/vlr_orig. TODO: This commit may be split in several smaller changes before merging to master. Related: OS#1592 Change-Id: I702ba504ce2de93507312c28eca8d11f09f4ee8b
Diffstat (limited to 'openbsc/include')
-rw-r--r--openbsc/include/openbsc/abis_rsl.h1
-rw-r--r--openbsc/include/openbsc/auth.h4
-rw-r--r--openbsc/include/openbsc/bsc_api.h3
-rw-r--r--openbsc/include/openbsc/chan_alloc.h2
-rw-r--r--openbsc/include/openbsc/db.h36
-rw-r--r--openbsc/include/openbsc/debug.h6
-rw-r--r--openbsc/include/openbsc/gsm_04_08.h1
-rw-r--r--openbsc/include/openbsc/gsm_04_11.h8
-rw-r--r--openbsc/include/openbsc/gsm_data.h78
-rw-r--r--openbsc/include/openbsc/gsm_data_shared.h1
-rw-r--r--openbsc/include/openbsc/gsm_subscriber.h92
-rw-r--r--openbsc/include/openbsc/osmo_msc.h68
-rw-r--r--openbsc/include/openbsc/signal.h4
-rw-r--r--openbsc/include/openbsc/silent_call.h4
-rw-r--r--openbsc/include/openbsc/transaction.h7
-rw-r--r--openbsc/include/openbsc/vlr.h6
-rw-r--r--openbsc/include/openbsc/vty.h1
17 files changed, 150 insertions, 172 deletions
diff --git a/openbsc/include/openbsc/abis_rsl.h b/openbsc/include/openbsc/abis_rsl.h
index 758c5557a..46e824320 100644
--- a/openbsc/include/openbsc/abis_rsl.h
+++ b/openbsc/include/openbsc/abis_rsl.h
@@ -29,7 +29,6 @@
struct gsm_bts;
struct gsm_lchan;
-struct gsm_subscriber;
struct gsm_bts_trx_ts;
#define GSM48_LEN2PLEN(a) (((a) << 2) | 1)
diff --git a/openbsc/include/openbsc/auth.h b/openbsc/include/openbsc/auth.h
index 61811316b..b314bbf19 100644
--- a/openbsc/include/openbsc/auth.h
+++ b/openbsc/include/openbsc/auth.h
@@ -4,7 +4,6 @@
#include <osmocom/core/utils.h>
struct gsm_auth_tuple;
-struct gsm_subscriber;
enum auth_action {
AUTH_ERROR = -1, /* Internal error */
@@ -20,7 +19,4 @@ static inline const char *auth_action_str(enum auth_action a)
return get_value_string(auth_action_names, a);
}
-int auth_get_tuple_for_subscr(struct gsm_auth_tuple *atuple,
- struct gsm_subscriber *subscr, int key_seq);
-
#endif /* _AUTH_H */
diff --git a/openbsc/include/openbsc/bsc_api.h b/openbsc/include/openbsc/bsc_api.h
index 3a9311991..40068d6ef 100644
--- a/openbsc/include/openbsc/bsc_api.h
+++ b/openbsc/include/openbsc/bsc_api.h
@@ -41,6 +41,9 @@ struct bsc_api {
*/
void (*mr_config)(struct gsm_subscriber_connection *conn,
struct gsm_lchan *lchan, int full_rate);
+
+ /** Callback for additional actions during conn cleanup */
+ void (*conn_cleanup)(struct gsm_subscriber_connection *conn);
};
int bsc_api_init(struct gsm_network *network, struct bsc_api *api);
diff --git a/openbsc/include/openbsc/chan_alloc.h b/openbsc/include/openbsc/chan_alloc.h
index 78242e5b7..7388e14c5 100644
--- a/openbsc/include/openbsc/chan_alloc.h
+++ b/openbsc/include/openbsc/chan_alloc.h
@@ -25,7 +25,7 @@
struct gsm_subscriber_connection;
/* Find an allocated channel for a specified subscriber */
-struct gsm_subscriber_connection *connection_for_subscr(struct gsm_subscriber *subscr);
+struct gsm_subscriber_connection *connection_for_subscr(struct vlr_subscr *vsub);
/* Allocate a logical channel (SDCCH, TCH, ...) */
struct gsm_lchan *lchan_alloc(struct gsm_bts *bts, enum gsm_chan_t type, int allow_bigger);
diff --git a/openbsc/include/openbsc/db.h b/openbsc/include/openbsc/db.h
index bb90705ab..660451a50 100644
--- a/openbsc/include/openbsc/db.h
+++ b/openbsc/include/openbsc/db.h
@@ -29,53 +29,21 @@ struct gsm_network;
struct gsm_auth_info;
struct gsm_auth_tuple;
struct gsm_sms;
-struct gsm_subscriber;
/* one time initialisation */
int db_init(const char *name);
int db_prepare(void);
int db_fini(void);
-/* subscriber management */
-struct gsm_subscriber *db_create_subscriber(const char *imsi, uint64_t smin,
- uint64_t smax, bool alloc_exten);
-struct gsm_subscriber *db_get_subscriber(enum gsm_subscriber_field field,
- const char *subscr);
-int db_sync_subscriber(struct gsm_subscriber *subscriber);
-int db_subscriber_expire(void *priv, void (*callback)(void *priv, long long unsigned int id));
-int db_subscriber_alloc_tmsi(struct gsm_subscriber *subscriber);
-int db_subscriber_alloc_exten(struct gsm_subscriber *subscriber, uint64_t smin,
- uint64_t smax);
-int db_subscriber_alloc_token(struct gsm_subscriber *subscriber, uint32_t* token);
-int db_subscriber_assoc_imei(struct gsm_subscriber *subscriber, char *imei);
-int db_subscriber_delete(struct gsm_subscriber *subscriber);
-int db_sync_equipment(struct gsm_equipment *equip);
-int db_subscriber_update(struct gsm_subscriber *subscriber);
-int db_subscriber_list_active(void (*list_cb)(struct gsm_subscriber*,void*), void*);
-
-/* auth info */
-int db_get_authinfo_for_subscr(struct gsm_auth_info *ainfo,
- struct gsm_subscriber *subscr);
-int db_sync_authinfo_for_subscr(struct gsm_auth_info *ainfo,
- struct gsm_subscriber *subscr);
-int db_get_lastauthtuple_for_subscr(struct gsm_auth_tuple *atuple,
- struct gsm_subscriber *subscr);
-int db_sync_lastauthtuple_for_subscr(struct gsm_auth_tuple *atuple,
- struct gsm_subscriber *subscr);
-
/* SMS store-and-forward */
int db_sms_store(struct gsm_sms *sms);
struct gsm_sms *db_sms_get(struct gsm_network *net, unsigned long long id);
struct gsm_sms *db_sms_get_unsent(struct gsm_network *net, unsigned long long min_id);
struct gsm_sms *db_sms_get_unsent_by_subscr(struct gsm_network *net, unsigned long long min_subscr_id, unsigned int failed);
-struct gsm_sms *db_sms_get_unsent_for_subscr(struct gsm_subscriber *subscr);
+struct gsm_sms *db_sms_get_unsent_for_subscr(struct vlr_subscr *vsub);
int db_sms_mark_delivered(struct gsm_sms *sms);
int db_sms_inc_deliver_attempts(struct gsm_sms *sms);
-
-/* APDU blob storage */
-int db_apdu_blob_store(struct gsm_subscriber *subscr,
- uint8_t apdu_id_flags, uint8_t len,
- uint8_t *apdu);
+int db_sms_delete_by_msisdn(const char *msisdn);
/* Statistics counter storage */
struct osmo_counter;
diff --git a/openbsc/include/openbsc/debug.h b/openbsc/include/openbsc/debug.h
index 74db72397..d8b6f4021 100644
--- a/openbsc/include/openbsc/debug.h
+++ b/openbsc/include/openbsc/debug.h
@@ -37,12 +37,8 @@ enum {
DRANAP,
DSUA,
DV42BIS,
+ DVLR,
Debug_LastEntry,
};
-struct gsm_subscriber;
-
-void log_set_filter_vlr_subscr(struct log_target *target,
- struct gsm_subscriber *vlr_subscr);
-
extern const struct log_info log_info;
diff --git a/openbsc/include/openbsc/gsm_04_08.h b/openbsc/include/openbsc/gsm_04_08.h
index bdf4ed2a6..727e8d368 100644
--- a/openbsc/include/openbsc/gsm_04_08.h
+++ b/openbsc/include/openbsc/gsm_04_08.h
@@ -9,7 +9,6 @@
struct msgb;
struct gsm_bts;
-struct gsm_subscriber;
struct gsm_network;
struct gsm_trans;
struct gsm_subscriber_connection;
diff --git a/openbsc/include/openbsc/gsm_04_11.h b/openbsc/include/openbsc/gsm_04_11.h
index 149de9083..c67ed146b 100644
--- a/openbsc/include/openbsc/gsm_04_11.h
+++ b/openbsc/include/openbsc/gsm_04_11.h
@@ -3,6 +3,8 @@
#include <osmocom/gsm/protocol/gsm_04_11.h>
+struct vlr_subscr;
+
#define UM_SAPI_SMS 3 /* See GSM 04.05/04.06 */
/* SMS deliver PDU */
@@ -29,10 +31,12 @@ int gsm0411_rcv_sms(struct gsm_subscriber_connection *conn, struct msgb *msg);
struct gsm_sms *sms_alloc(void);
void sms_free(struct gsm_sms *sms);
-struct gsm_sms *sms_from_text(struct gsm_subscriber *receiver, struct gsm_subscriber *sender, int dcs, const char *text);
+struct gsm_sms *sms_from_text(struct vlr_subscr *receiver,
+ struct vlr_subscr *sender,
+ int dcs, const char *text);
void _gsm411_sms_trans_free(struct gsm_trans *trans);
-int gsm411_send_sms_subscr(struct gsm_subscriber *subscr,
+int gsm411_send_sms_subscr(struct vlr_subscr *vsub,
struct gsm_sms *sms);
int gsm411_send_sms(struct gsm_subscriber_connection *conn,
struct gsm_sms *sms);
diff --git a/openbsc/include/openbsc/gsm_data.h b/openbsc/include/openbsc/gsm_data.h
index 5194b91f9..e757e72ea 100644
--- a/openbsc/include/openbsc/gsm_data.h
+++ b/openbsc/include/openbsc/gsm_data.h
@@ -24,6 +24,8 @@
struct mncc_sock_state;
struct gsm_subscriber_group;
struct bsc_subscr;
+struct vlr_instance;
+struct vlr_subscr;
#define OBSC_LINKID_CB(__msgb) (__msgb)->cb[3]
@@ -63,20 +65,6 @@ struct gsm_auth_tuple {
#define GSM_KEY_SEQ_INVAL 7 /* GSM 04.08 - 10.5.1.2 */
/*
- * LOCATION UPDATING REQUEST state
- *
- * Our current operation is:
- * - Get imei/tmsi
- * - Accept/Reject according to global policy
- */
-struct gsm_loc_updating_operation {
- struct osmo_timer_list updating_timer;
- unsigned int waiting_for_imsi : 1;
- unsigned int waiting_for_imei : 1;
- unsigned int key_seq : 4;
-};
-
-/*
* AUTHENTICATION/CIPHERING state
*/
struct gsm_security_operation {
@@ -113,6 +101,15 @@ enum ran_type {
RAN_UTRAN_IU, /* 3G / Iu-interface (IuCS or IuPS) */
};
+struct gsm_classmark {
+ bool classmark1_set;
+ struct gsm48_classmark1 classmark1;
+ uint8_t classmark2_len;
+ uint8_t classmark2[3];
+ uint8_t classmark3_len;
+ uint8_t classmark3[14];
+};
+
/* active radio connection of a mobile subscriber */
struct gsm_subscriber_connection {
/* global linked list of subscriber_connections */
@@ -122,12 +119,33 @@ struct gsm_subscriber_connection {
* towards A/Iu */
uint32_t use_count;
- /* To whom we are allocated at the moment */
- struct gsm_subscriber *subscr;
-
- /* libbsc subscriber information */
+ /* temporary hack: while the same gsm_subscriber_connection is in use
+ * between libbsc and libmsc, we need to prevent a second free from
+ * within libbsc after bsc_api->compl_l3() returns. In
+ * gsm0408_rcvmsg(), compl_l3() is called, and if it returns
+ * BSC_API_CONN_POL_REJECT, the conn is discarded right away. This is
+ * the only instance where libbsc discards a gsm_subscriber_connection.
+ * If compl_l3() returns BSC_API_CONN_POL_ACCEPT and in all other API
+ * calls, ownership of the conn is in libmsc (in the osmo-nitb case) or
+ * in the osmo-bsc code (in the OsmoBSC standalone case). Our VLR
+ * however assumes full ownership of the conn and will discard it when
+ * nothing is pending. So in case we're still in compl_l3() and going
+ * to reject the conn, we must tell libmsc to not free it yet, since
+ * bsc_api.c will do so again/anyway. When the
+ * gsm_subscriber_connection structs are properly separated, this will
+ * go away magically. */
+ bool owned_by_msc;
+
+ /* The MS has opened the conn with a CM Service Request, and we shall
+ * keep it open for an actual request (or until timeout). */
+ bool received_cm_service_request;
+
+ /* libbsc subscriber information (if available) */
struct bsc_subscr *bsub;
+ /* libmsc/libvlr subscriber information (if available) */
+ struct vlr_subscr *vsub;
+
/* LU expiration handling */
uint8_t expire_timer_stopped;
/* SMS helpers for libmsc */
@@ -136,10 +154,11 @@ struct gsm_subscriber_connection {
/*
* Operations that have a state and might be pending
*/
- struct gsm_loc_updating_operation *loc_operation;
struct gsm_security_operation *sec_operation;
struct gsm_anchor_operation *anch_operation;
+ struct osmo_fsm_inst *conn_fsm;
+
/* Are we part of a special "silent" call */
int silent_call;
@@ -154,7 +173,7 @@ struct gsm_subscriber_connection {
/* back pointers */
struct gsm_network *network;
- int in_release;
+ bool in_release;
struct gsm_lchan *lchan; /* BSC */
struct gsm_lchan *ho_lchan; /* BSC */
struct gsm_bts *bts; /* BSC */
@@ -165,6 +184,8 @@ struct gsm_subscriber_connection {
/* connected via 2G or 3G? */
enum ran_type via_ran;
+
+ struct gsm_classmark classmark;
};
@@ -310,6 +331,7 @@ struct gsm_network {
char *authorized_reg_str;
enum gsm48_reject_value reject_cause;
int a5_encryption;
+ bool authentication_required;
int neci;
int send_mm_info;
struct {
@@ -378,12 +400,8 @@ struct gsm_network {
bool auto_assign_exten;
uint64_t ext_min;
uint64_t ext_max;
- struct gsm_subscriber_group *subscr_group;
struct gsm_sms_queue *sms_queue;
- /* nitb related control */
- int avoid_tmsi;
-
/* control interface */
struct ctrl_handle *ctrl;
@@ -408,6 +426,12 @@ struct gsm_network {
* not require gsm_data.h). In an MSC-without-BSC environment, this
* pointer is NULL to indicate absence of a bsc_subscribers list. */
struct llist_head *bsc_subscribers;
+
+ /* MSC: GSUP server address of the HLR */
+ const char *gsup_server_addr_str;
+ uint16_t gsup_server_port;
+
+ struct vlr_instance *vlr;
};
struct osmo_esme;
@@ -430,7 +454,7 @@ struct gsm_sms_addr {
struct gsm_sms {
unsigned long long id;
- struct gsm_subscriber *receiver;
+ struct vlr_subscr *receiver;
struct gsm_sms_addr src, dst;
enum gsm_sms_source_id source;
@@ -576,7 +600,7 @@ extern const struct value_string bts_type_descs[_NUM_GSM_BTS_TYPE+1];
/* control interface handling */
int bsc_base_ctrl_cmds_install(void);
-int msc_ctrl_cmds_install(void);
+int msc_ctrl_cmds_install(struct gsm_network *net);
/* dependency handling */
void bts_depend_mark(struct gsm_bts *bts, int dep);
@@ -584,4 +608,6 @@ void bts_depend_clear(struct gsm_bts *bts, int dep);
int bts_depend_check(struct gsm_bts *bts);
int bts_depend_is_depedency(struct gsm_bts *base, struct gsm_bts *other);
+bool classmark_is_r99(struct gsm_classmark *cm);
+
#endif /* _GSM_DATA_H */
diff --git a/openbsc/include/openbsc/gsm_data_shared.h b/openbsc/include/openbsc/gsm_data_shared.h
index e697cb87d..0f149bdd1 100644
--- a/openbsc/include/openbsc/gsm_data_shared.h
+++ b/openbsc/include/openbsc/gsm_data_shared.h
@@ -84,7 +84,6 @@ enum bts_gprs_mode {
};
struct gsm_lchan;
-struct gsm_subscriber;
struct gsm_mncc;
struct osmo_rtp_socket;
struct rtp_socket;
diff --git a/openbsc/include/openbsc/gsm_subscriber.h b/openbsc/include/openbsc/gsm_subscriber.h
index 7e656145a..c65b8a315 100644
--- a/openbsc/include/openbsc/gsm_subscriber.h
+++ b/openbsc/include/openbsc/gsm_subscriber.h
@@ -19,63 +19,8 @@
#define GSM_SUBSCRIBER_NO_EXPIRATION 0x0
-struct vty;
-struct sgsn_mm_ctx;
-struct sgsn_subscriber_data;
-
struct subscr_request;
-struct gsm_subscriber_group {
- struct gsm_network *net;
-
- int keep_subscr;
-};
-
-struct gsm_equipment {
- long long unsigned int id;
- char imei[GSM23003_IMEISV_NUM_DIGITS+1];
- char name[GSM_NAME_LENGTH];
-
- struct gsm48_classmark1 classmark1;
- uint8_t classmark2_len;
- uint8_t classmark2[3];
- uint8_t classmark3_len;
- uint8_t classmark3[14];
-};
-
-struct gsm_subscriber {
- struct gsm_subscriber_group *group;
- long long unsigned int id;
- char imsi[GSM23003_IMSI_MAX_DIGITS+1];
- uint32_t tmsi;
- uint16_t lac;
- char name[GSM_NAME_LENGTH];
- char extension[GSM_EXTENSION_LENGTH];
- int authorized;
- time_t expire_lu;
-
- /* Don't delete subscribers even if group->keep_subscr is not set */
- int keep_in_ram;
-
- /* Temporary field which is not stored in the DB/HLR */
- uint32_t flags;
-
- /* Every user can only have one equipment in use at any given
- * point in time */
- struct gsm_equipment equipment;
-
- /* for internal management */
- int use_count;
- struct llist_head entry;
-
- /* pending requests */
- int is_paging;
- struct llist_head requests;
-
- /* GPRS/SGSN related fields */
- struct sgsn_subscriber_data *sgsn_data;
-};
-
enum gsm_subscriber_field {
GSM_SUBSCRIBER_IMSI,
GSM_SUBSCRIBER_TMSI,
@@ -89,42 +34,17 @@ enum gsm_subscriber_update_reason {
GSM_SUBSCRIBER_UPDATE_EQUIPMENT,
};
-struct gsm_subscriber *subscr_get(struct gsm_subscriber *subscr);
-struct gsm_subscriber *subscr_put(struct gsm_subscriber *subscr);
-struct gsm_subscriber *subscr_create_subscriber(struct gsm_subscriber_group *sgrp,
- const char *imsi);
-struct gsm_subscriber *subscr_get_by_tmsi(struct gsm_subscriber_group *sgrp,
- uint32_t tmsi);
-struct gsm_subscriber *subscr_get_by_imsi(struct gsm_subscriber_group *sgrp,
- const char *imsi);
-struct gsm_subscriber *subscr_get_by_extension(struct gsm_subscriber_group *sgrp,
- const char *ext);
-struct gsm_subscriber *subscr_get_by_id(struct gsm_subscriber_group *sgrp,
- unsigned long long id);
-struct gsm_subscriber *subscr_get_or_create(struct gsm_subscriber_group *sgrp,
- const char *imsi);
-int subscr_update(struct gsm_subscriber *s, struct gsm_bts *bts, int reason);
-struct gsm_subscriber *subscr_active_by_tmsi(struct gsm_subscriber_group *sgrp,
- uint32_t tmsi);
-struct gsm_subscriber *subscr_active_by_imsi(struct gsm_subscriber_group *sgrp,
- const char *imsi);
-
-char *subscr_name(struct gsm_subscriber *subscr);
-
-int subscr_purge_inactive(struct gsm_subscriber_group *sgrp);
-void subscr_update_from_db(struct gsm_subscriber *subscr);
-void subscr_expire(struct gsm_subscriber_group *sgrp);
-int subscr_update_expire_lu(struct gsm_subscriber *subscr, struct gsm_bts *bts);
+int subscr_update(struct vlr_subscr *vsub, struct gsm_bts *bts, int reason);
/*
* Paging handling with authentication
*/
-struct subscr_request *subscr_request_channel(struct gsm_subscriber *subscr,
- int type, gsm_cbfn *cbfn, void *param);
+struct subscr_request *subscr_request_channel(struct vlr_subscr *vsub,
+ int channel_type,
+ gsm_cbfn *cbfn, void *param);
void subscr_remove_request(struct subscr_request *req);
-/* internal */
-struct gsm_subscriber *subscr_alloc(void);
-extern struct llist_head active_subscribers;
+int subscr_paging_dispatch(unsigned int hooknum, unsigned int event,
+ struct msgb *msg, void *data, void *param);
#endif /* _GSM_SUBSCR_H */
diff --git a/openbsc/include/openbsc/osmo_msc.h b/openbsc/include/openbsc/osmo_msc.h
index 8f57ce25f..c1791777d 100644
--- a/openbsc/include/openbsc/osmo_msc.h
+++ b/openbsc/include/openbsc/osmo_msc.h
@@ -3,10 +3,74 @@
#ifndef OSMO_MSC_H
#define OSMO_MSC_H
+#include <osmocom/core/fsm.h>
+
+#include <openbsc/gsm_data.h>
+
#include "bsc_api.h"
+#define MSC_HLR_REMOTE_IP_DEFAULT "127.0.0.1"
+#define MSC_HLR_REMOTE_PORT_DEFAULT 2222
+
+enum subscr_conn_fsm_event {
+ /* Mark 0 as invalid to catch uninitialized vars */
+ SUBSCR_CONN_E_INVALID = 0,
+ /* Timeout on connection establishment starts */
+ SUBSCR_CONN_E_START,
+ /* LU or Process Access FSM has determined that this conn is good */
+ SUBSCR_CONN_E_ACCEPTED,
+ /* received first reply from MS in "real" CC, SMS, USSD communication */
+ SUBSCR_CONN_E_COMMUNICATING,
+ /* Some async action has completed, check again whether all is done */
+ SUBSCR_CONN_E_BUMP,
+ /* MS/BTS/BSC originated close request */
+ SUBSCR_CONN_E_MO_CLOSE,
+ /* MSC originated close request, e.g. failed authentication */
+ SUBSCR_CONN_E_CN_CLOSE,
+};
+
+enum subscr_conn_fsm_state {
+ SUBSCR_CONN_S_INIT,
+ SUBSCR_CONN_S_NEW,
+ SUBSCR_CONN_S_ACCEPTED,
+ SUBSCR_CONN_S_COMMUNICATING,
+ SUBSCR_CONN_S_RELEASED,
+};
+
+enum subscr_conn_from {
+ SUBSCR_CONN_FROM_INVALID,
+ SUBSCR_CONN_FROM_LU,
+ SUBSCR_CONN_FROM_CM_SERVICE_REQ,
+ SUBSCR_CONN_FROM_PAGING_RESP,
+};
+
+extern const struct value_string subscr_conn_from_names[];
+static inline const char *subscr_conn_from_name(enum subscr_conn_from val)
+{
+ return get_value_string(subscr_conn_from_names, val);
+}
+
+void msc_subscr_conn_init(void);
+
struct bsc_api *msc_bsc_api();
-struct gsm_subscriber_connection *subscr_con_get(struct gsm_subscriber_connection *conn);
-void subscr_con_put(struct gsm_subscriber_connection *conn);
+#define subscr_con_get(conn) _subscr_con_get(conn, __BASE_FILE__, __LINE__)
+struct gsm_subscriber_connection *
+_subscr_con_get(struct gsm_subscriber_connection *conn,
+ const char *file, int line);
+#define subscr_con_put(conn) _subscr_con_put(conn, __BASE_FILE__, __LINE__)
+void _subscr_con_put(struct gsm_subscriber_connection *conn, const char *file,
+ int line);
+
+int msc_create_conn_fsm(struct gsm_subscriber_connection *conn, const char *id);
+
+int msc_vlr_alloc(struct gsm_network *net);
+int msc_vlr_start(struct gsm_network *net);
+
+void msc_close_connection(struct gsm_subscriber_connection *conn);
+
+bool msc_subscr_conn_is_accepted(struct gsm_subscriber_connection *conn);
+void msc_subscr_conn_communicating(struct gsm_subscriber_connection *conn);
+
+void msc_release_anchor(struct gsm_subscriber_connection *conn);
#endif
diff --git a/openbsc/include/openbsc/signal.h b/openbsc/include/openbsc/signal.h
index d4ccf80da..49f86d612 100644
--- a/openbsc/include/openbsc/signal.h
+++ b/openbsc/include/openbsc/signal.h
@@ -138,10 +138,8 @@ enum signal_rf {
S_RF_GRACE,
};
-struct gsm_subscriber;
-
struct paging_signal_data {
- struct gsm_subscriber *subscr;
+ struct vlr_subscr *vsub;
struct gsm_bts *bts;
int paging_result;
diff --git a/openbsc/include/openbsc/silent_call.h b/openbsc/include/openbsc/silent_call.h
index 619a54327..5fec77b73 100644
--- a/openbsc/include/openbsc/silent_call.h
+++ b/openbsc/include/openbsc/silent_call.h
@@ -3,9 +3,9 @@
struct gsm_subscriber_connection;
-extern int gsm_silent_call_start(struct gsm_subscriber *subscr,
+extern int gsm_silent_call_start(struct vlr_subscr *vsub,
void *data, int type);
-extern int gsm_silent_call_stop(struct gsm_subscriber *subscr);
+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);
diff --git a/openbsc/include/openbsc/transaction.h b/openbsc/include/openbsc/transaction.h
index 9a87d04e4..07ab7a7da 100644
--- a/openbsc/include/openbsc/transaction.h
+++ b/openbsc/include/openbsc/transaction.h
@@ -24,7 +24,7 @@ struct gsm_trans {
uint8_t transaction_id;
/* To whom we belong, unique identifier of remote MM entity */
- struct gsm_subscriber *subscr;
+ struct vlr_subscr *vsub;
/* The associated connection we are using to transmit messages */
struct gsm_subscriber_connection *conn;
@@ -67,13 +67,14 @@ struct gsm_trans *trans_find_by_callref(struct gsm_network *net,
uint32_t callref);
struct gsm_trans *trans_alloc(struct gsm_network *net,
- struct gsm_subscriber *subscr,
+ struct vlr_subscr *vsub,
uint8_t protocol, uint8_t trans_id,
uint32_t callref);
void trans_free(struct gsm_trans *trans);
-int trans_assign_trans_id(struct gsm_network *net, struct gsm_subscriber *subscr,
+int trans_assign_trans_id(struct gsm_network *net, struct vlr_subscr *vsub,
uint8_t protocol, uint8_t ti_flag);
int trans_has_conn(const struct gsm_subscriber_connection *conn);
+void trans_conn_closed(struct gsm_subscriber_connection *conn);
#endif
diff --git a/openbsc/include/openbsc/vlr.h b/openbsc/include/openbsc/vlr.h
index 878bd25e4..9c469cec9 100644
--- a/openbsc/include/openbsc/vlr.h
+++ b/openbsc/include/openbsc/vlr.h
@@ -10,6 +10,8 @@
// for GSM_NAME_LENGTH
#include <openbsc/gsm_subscriber.h>
+struct log_target;
+
/* from 3s to 10s */
#define GSM_29002_TIMER_S 10
/* from 15s to 30s */
@@ -19,7 +21,6 @@
/* from 28h to 38h */
#define GSM_29002_TIMER_L (32*60*60)
-
/* VLR subscriber authentication state */
enum vlr_subscr_auth_state {
/* subscriber needs to be autenticated */
@@ -402,3 +403,6 @@ int vlr_set_ciph_mode(struct vlr_instance *vlr,
void *msc_conn_ref,
enum vlr_ciph ciph_mode,
bool retrieve_imeisv);
+
+void log_set_filter_vlr_subscr(struct log_target *target,
+ struct vlr_subscr *vlr_subscr);
diff --git a/openbsc/include/openbsc/vty.h b/openbsc/include/openbsc/vty.h
index f79eab582..1d5481599 100644
--- a/openbsc/include/openbsc/vty.h
+++ b/openbsc/include/openbsc/vty.h
@@ -38,6 +38,7 @@ enum bsc_vty_node {
SMPP_NODE,
SMPP_ESME_NODE,
GTPHUB_NODE,
+ HLR_NODE,
};
extern int bsc_vty_is_config_node(struct vty *vty, int node);