cosmetic: rename struct osmo_msc_data to bsc_msc_data

With the OsmoMSC program coming up, the name osmo_msc_data becomes even
more confusing than it already is. Clearly indicate it as libbsc's data of
a remote MSC by prefixing with bsc_.

Also, the Osmocom community has in the meantime agreed to have the osmo_
prefix only in libosmocore, to avoid naming conflicts in case things are
moved there. So while renaming anyway, also drop the osmo_ prefix.

Change-Id: I0dfbcb7d1a579211180f71319982820d8700afab
This commit is contained in:
Neels Hofmeyr 2017-02-23 21:57:23 +01:00
parent a42855f09f
commit a369e24cb9
14 changed files with 107 additions and 107 deletions

View File

@ -49,7 +49,7 @@ enum {
/*! /brief Information on a remote MSC for libbsc. /*! /brief Information on a remote MSC for libbsc.
*/ */
struct osmo_msc_data { struct bsc_msc_data {
struct llist_head entry; struct llist_head entry;
/* Back pointer */ /* Back pointer */
@ -128,15 +128,15 @@ struct osmo_bsc_data {
}; };
int osmo_bsc_msc_init(struct osmo_msc_data *msc); int osmo_bsc_msc_init(struct bsc_msc_data *msc);
int osmo_bsc_sccp_init(struct gsm_network *gsmnet); int osmo_bsc_sccp_init(struct gsm_network *gsmnet);
int msc_queue_write(struct bsc_msc_connection *conn, struct msgb *msg, int proto); int msc_queue_write(struct bsc_msc_connection *conn, struct msgb *msg, int proto);
int msc_queue_write_with_ping(struct bsc_msc_connection *, struct msgb *msg, int proto); int msc_queue_write_with_ping(struct bsc_msc_connection *, struct msgb *msg, int proto);
int osmo_bsc_audio_init(struct gsm_network *network); int osmo_bsc_audio_init(struct gsm_network *network);
struct osmo_msc_data *osmo_msc_data_find(struct gsm_network *, int); struct bsc_msc_data *osmo_msc_data_find(struct gsm_network *, int);
struct osmo_msc_data *osmo_msc_data_alloc(struct gsm_network *, int); struct bsc_msc_data *osmo_msc_data_alloc(struct gsm_network *, int);
#endif #endif

View File

@ -16,7 +16,7 @@ enum bsc_con {
}; };
struct sccp_connection; struct sccp_connection;
struct osmo_msc_data; struct bsc_msc_data;
struct bsc_msc_connection; struct bsc_msc_connection;
struct osmo_bsc_sccp_con { struct osmo_bsc_sccp_con {
@ -33,7 +33,7 @@ struct osmo_bsc_sccp_con {
/* SCCP connection realted */ /* SCCP connection realted */
struct sccp_connection *sccp; struct sccp_connection *sccp;
struct osmo_msc_data *msc; struct bsc_msc_data *msc;
struct osmo_timer_list sccp_it_timeout; struct osmo_timer_list sccp_it_timeout;
struct osmo_timer_list sccp_cc_timeout; struct osmo_timer_list sccp_cc_timeout;
@ -51,15 +51,15 @@ struct bsc_api *osmo_bsc_api();
int bsc_queue_for_msc(struct osmo_bsc_sccp_con *conn, struct msgb *msg); int bsc_queue_for_msc(struct osmo_bsc_sccp_con *conn, struct msgb *msg);
int bsc_open_connection(struct osmo_bsc_sccp_con *sccp, struct msgb *msg); int bsc_open_connection(struct osmo_bsc_sccp_con *sccp, struct msgb *msg);
enum bsc_con bsc_create_new_connection(struct gsm_subscriber_connection *conn, enum bsc_con bsc_create_new_connection(struct gsm_subscriber_connection *conn,
struct osmo_msc_data *msc, int send_ping); struct bsc_msc_data *msc, int send_ping);
int bsc_delete_connection(struct osmo_bsc_sccp_con *sccp); int bsc_delete_connection(struct osmo_bsc_sccp_con *sccp);
struct osmo_msc_data *bsc_find_msc(struct gsm_subscriber_connection *conn, struct msgb *); struct bsc_msc_data *bsc_find_msc(struct gsm_subscriber_connection *conn, struct msgb *);
int bsc_scan_bts_msg(struct gsm_subscriber_connection *conn, struct msgb *msg); int bsc_scan_bts_msg(struct gsm_subscriber_connection *conn, struct msgb *msg);
int bsc_scan_msc_msg(struct gsm_subscriber_connection *conn, struct msgb *msg); int bsc_scan_msc_msg(struct gsm_subscriber_connection *conn, struct msgb *msg);
int bsc_send_welcome_ussd(struct gsm_subscriber_connection *conn); int bsc_send_welcome_ussd(struct gsm_subscriber_connection *conn);
int bsc_handle_udt(struct osmo_msc_data *msc, struct msgb *msg, unsigned int length); int bsc_handle_udt(struct bsc_msc_data *msc, struct msgb *msg, unsigned int length);
int bsc_handle_dt1(struct osmo_bsc_sccp_con *conn, struct msgb *msg, unsigned int len); int bsc_handle_dt1(struct osmo_bsc_sccp_con *conn, struct msgb *msg, unsigned int len);
int bsc_ctrl_cmds_install(); int bsc_ctrl_cmds_install();

View File

@ -23,9 +23,9 @@
#include <openbsc/gsm_data.h> #include <openbsc/gsm_data.h>
struct osmo_msc_data; struct bsc_msc_data;
int bsc_grace_allow_new_connection(struct gsm_network *net, struct gsm_bts *bts); int bsc_grace_allow_new_connection(struct gsm_network *net, struct gsm_bts *bts);
int bsc_grace_paging_request(struct gsm_subscriber *sub, int type, struct osmo_msc_data *msc); int bsc_grace_paging_request(struct gsm_subscriber *sub, int type, struct bsc_msc_data *msc);
#endif #endif

View File

@ -222,9 +222,9 @@ enum signal_msc {
S_MSC_AUTHENTICATED, S_MSC_AUTHENTICATED,
}; };
struct osmo_msc_data; struct bsc_msc_data;
struct msc_signal_data { struct msc_signal_data {
struct osmo_msc_data *data; struct bsc_msc_data *data;
}; };
/* SS_CCCH signals */ /* SS_CCCH signals */

View File

@ -49,30 +49,30 @@
static int bsc_clear_request(struct gsm_subscriber_connection *conn, uint32_t cause); static int bsc_clear_request(struct gsm_subscriber_connection *conn, uint32_t cause);
static int complete_layer3(struct gsm_subscriber_connection *conn, static int complete_layer3(struct gsm_subscriber_connection *conn,
struct msgb *msg, struct osmo_msc_data *msc); struct msgb *msg, struct bsc_msc_data *msc);
static uint16_t get_network_code_for_msc(struct osmo_msc_data *msc) static uint16_t get_network_code_for_msc(struct bsc_msc_data *msc)
{ {
if (msc->core_mnc != -1) if (msc->core_mnc != -1)
return msc->core_mnc; return msc->core_mnc;
return msc->network->network_code; return msc->network->network_code;
} }
static uint16_t get_country_code_for_msc(struct osmo_msc_data *msc) static uint16_t get_country_code_for_msc(struct bsc_msc_data *msc)
{ {
if (msc->core_mcc != -1) if (msc->core_mcc != -1)
return msc->core_mcc; return msc->core_mcc;
return msc->network->country_code; return msc->network->country_code;
} }
static uint16_t get_lac_for_msc(struct osmo_msc_data *msc, struct gsm_bts *bts) static uint16_t get_lac_for_msc(struct bsc_msc_data *msc, struct gsm_bts *bts)
{ {
if (msc->core_lac != -1) if (msc->core_lac != -1)
return msc->core_lac; return msc->core_lac;
return bts->location_area_code; return bts->location_area_code;
} }
static uint16_t get_ci_for_msc(struct osmo_msc_data *msc, struct gsm_bts *bts) static uint16_t get_ci_for_msc(struct bsc_msc_data *msc, struct gsm_bts *bts)
{ {
if (msc->core_ci != -1) if (msc->core_ci != -1)
return msc->core_ci; return msc->core_ci;
@ -98,7 +98,7 @@ static void bsc_maybe_lu_reject(struct gsm_subscriber_connection *conn, int con_
} }
static int bsc_filter_initial(struct osmo_bsc_data *bsc, static int bsc_filter_initial(struct osmo_bsc_data *bsc,
struct osmo_msc_data *msc, struct bsc_msc_data *msc,
struct gsm_subscriber_connection *conn, struct gsm_subscriber_connection *conn,
struct msgb *msg, char **imsi, int *con_type, struct msgb *msg, char **imsi, int *con_type,
int *lu_cause) int *lu_cause)
@ -216,7 +216,7 @@ static void bsc_send_ussd_no_srv(struct gsm_subscriber_connection *conn,
static int bsc_compl_l3(struct gsm_subscriber_connection *conn, struct msgb *msg, static int bsc_compl_l3(struct gsm_subscriber_connection *conn, struct msgb *msg,
uint16_t chosen_channel) uint16_t chosen_channel)
{ {
struct osmo_msc_data *msc; struct bsc_msc_data *msc;
LOGP(DMSC, LOGL_INFO, "Tx MSC COMPL L3\n"); LOGP(DMSC, LOGL_INFO, "Tx MSC COMPL L3\n");
@ -233,7 +233,7 @@ static int bsc_compl_l3(struct gsm_subscriber_connection *conn, struct msgb *msg
} }
static int complete_layer3(struct gsm_subscriber_connection *conn, static int complete_layer3(struct gsm_subscriber_connection *conn,
struct msgb *msg, struct osmo_msc_data *msc) struct msgb *msg, struct bsc_msc_data *msc)
{ {
int con_type, rc, lu_cause; int con_type, rc, lu_cause;
char *imsi = NULL; char *imsi = NULL;
@ -310,7 +310,7 @@ static int complete_layer3(struct gsm_subscriber_connection *conn,
* Plastic surgery... we want to give up the current connection * Plastic surgery... we want to give up the current connection
*/ */
static int move_to_msc(struct gsm_subscriber_connection *_conn, static int move_to_msc(struct gsm_subscriber_connection *_conn,
struct msgb *msg, struct osmo_msc_data *msc) struct msgb *msg, struct bsc_msc_data *msc)
{ {
struct osmo_bsc_sccp_con *old_con = _conn->sccp_con; struct osmo_bsc_sccp_con *old_con = _conn->sccp_con;
@ -344,7 +344,7 @@ static int handle_cc_setup(struct gsm_subscriber_connection *conn,
uint8_t pdisc = gsm48_hdr_pdisc(gh); uint8_t pdisc = gsm48_hdr_pdisc(gh);
uint8_t mtype = gsm48_hdr_msg_type(gh); uint8_t mtype = gsm48_hdr_msg_type(gh);
struct osmo_msc_data *msc; struct bsc_msc_data *msc;
struct gsm_mncc_number called; struct gsm_mncc_number called;
struct tlv_parsed tp; struct tlv_parsed tp;
unsigned payload_len; unsigned payload_len;
@ -493,7 +493,7 @@ static void bsc_cm_update(struct gsm_subscriber_connection *conn,
static void bsc_mr_config(struct gsm_subscriber_connection *conn, static void bsc_mr_config(struct gsm_subscriber_connection *conn,
struct gsm_lchan *lchan, int full_rate) struct gsm_lchan *lchan, int full_rate)
{ {
struct osmo_msc_data *msc; struct bsc_msc_data *msc;
struct gsm48_multi_rate_conf *ms_conf, *bts_conf; struct gsm48_multi_rate_conf *ms_conf, *bts_conf;
if (!conn->sccp_con) { if (!conn->sccp_con) {

View File

@ -88,7 +88,7 @@ enum gsm48_chan_mode gsm88_to_chan_mode(enum gsm0808_permitted_speech speech)
return GSM48_CMODE_SPEECH_AMR; return GSM48_CMODE_SPEECH_AMR;
} }
static int bssmap_handle_reset_ack(struct osmo_msc_data *msc, static int bssmap_handle_reset_ack(struct bsc_msc_data *msc,
struct msgb *msg, unsigned int length) struct msgb *msg, unsigned int length)
{ {
LOGP(DMSC, LOGL_NOTICE, "Reset ACK from MSC\n"); LOGP(DMSC, LOGL_NOTICE, "Reset ACK from MSC\n");
@ -96,7 +96,7 @@ static int bssmap_handle_reset_ack(struct osmo_msc_data *msc,
} }
/* GSM 08.08 § 3.2.1.19 */ /* GSM 08.08 § 3.2.1.19 */
static int bssmap_handle_paging(struct osmo_msc_data *msc, static int bssmap_handle_paging(struct bsc_msc_data *msc,
struct msgb *msg, unsigned int payload_length) struct msgb *msg, unsigned int payload_length)
{ {
struct gsm_subscriber *subscr; struct gsm_subscriber *subscr;
@ -286,7 +286,7 @@ static int bssmap_handle_assignm_req(struct osmo_bsc_sccp_con *conn,
struct msgb *msg, unsigned int length) struct msgb *msg, unsigned int length)
{ {
struct msgb *resp; struct msgb *resp;
struct osmo_msc_data *msc; struct bsc_msc_data *msc;
struct tlv_parsed tp; struct tlv_parsed tp;
uint8_t *data; uint8_t *data;
uint8_t timeslot; uint8_t timeslot;
@ -384,7 +384,7 @@ reject:
return -1; return -1;
} }
static int bssmap_rcvmsg_udt(struct osmo_msc_data *msc, static int bssmap_rcvmsg_udt(struct bsc_msc_data *msc,
struct msgb *msg, unsigned int length) struct msgb *msg, unsigned int length)
{ {
int ret = 0; int ret = 0;
@ -491,7 +491,7 @@ static int dtap_rcvmsg(struct osmo_bsc_sccp_con *conn,
return dtap_rc; return dtap_rc;
} }
int bsc_handle_udt(struct osmo_msc_data *msc, int bsc_handle_udt(struct bsc_msc_data *msc,
struct msgb *msgb, unsigned int length) struct msgb *msgb, unsigned int length)
{ {
struct bssmap_header *bs; struct bssmap_header *bs;

View File

@ -40,9 +40,9 @@ void osmo_bsc_send_trap(struct ctrl_cmd *cmd, struct bsc_msc_connection *msc_con
{ {
struct ctrl_cmd *trap; struct ctrl_cmd *trap;
struct ctrl_handle *ctrl; struct ctrl_handle *ctrl;
struct osmo_msc_data *msc_data; struct bsc_msc_data *msc_data;
msc_data = (struct osmo_msc_data *) msc_con->write_queue.bfd.data; msc_data = (struct bsc_msc_data *) msc_con->write_queue.bfd.data;
ctrl = msc_data->network->ctrl; ctrl = msc_data->network->ctrl;
trap = ctrl_cmd_trap(cmd); trap = ctrl_cmd_trap(cmd);
@ -197,7 +197,7 @@ static void generate_location_state_trap(struct gsm_bts *bts, struct bsc_msc_con
void bsc_gen_location_state_trap(struct gsm_bts *bts) void bsc_gen_location_state_trap(struct gsm_bts *bts)
{ {
struct osmo_msc_data *msc; struct bsc_msc_data *msc;
llist_for_each_entry(msc, &bts->network->bsc_data->mscs, entry) llist_for_each_entry(msc, &bts->network->bsc_data->mscs, entry)
generate_location_state_trap(bts, msc->msc_con); generate_location_state_trap(bts, msc->msc_con);
@ -517,7 +517,7 @@ static int get_net_inform_msc(struct ctrl_cmd *cmd, void *data)
static int set_net_inform_msc(struct ctrl_cmd *cmd, void *data) static int set_net_inform_msc(struct ctrl_cmd *cmd, void *data)
{ {
struct gsm_network *net; struct gsm_network *net;
struct osmo_msc_data *msc; struct bsc_msc_data *msc;
net = cmd->node; net = cmd->node;
llist_for_each_entry(msc, &net->bsc_data->mscs, entry) { llist_for_each_entry(msc, &net->bsc_data->mscs, entry) {

View File

@ -122,14 +122,14 @@ static int is_cm_service_for_emerg(struct msgb *msg)
return cm->cm_service_type == GSM48_CMSERV_EMERGENCY; return cm->cm_service_type == GSM48_CMSERV_EMERGENCY;
} }
struct osmo_msc_data *bsc_find_msc(struct gsm_subscriber_connection *conn, struct bsc_msc_data *bsc_find_msc(struct gsm_subscriber_connection *conn,
struct msgb *msg) struct msgb *msg)
{ {
struct gsm48_hdr *gh; struct gsm48_hdr *gh;
int8_t pdisc; int8_t pdisc;
uint8_t mtype; uint8_t mtype;
struct osmo_bsc_data *bsc; struct osmo_bsc_data *bsc;
struct osmo_msc_data *msc, *pag_msc; struct bsc_msc_data *msc, *pag_msc;
struct gsm_subscriber *subscr; struct gsm_subscriber *subscr;
int is_emerg = 0; int is_emerg = 0;
@ -315,7 +315,7 @@ static int bsc_patch_mm_info(struct gsm_subscriber_connection *conn,
return 0; return 0;
} }
static int has_core_identity(struct osmo_msc_data *msc) static int has_core_identity(struct bsc_msc_data *msc)
{ {
if (msc->core_mnc != -1) if (msc->core_mnc != -1)
return 1; return 1;
@ -333,7 +333,7 @@ static int has_core_identity(struct osmo_msc_data *msc)
*/ */
int bsc_scan_msc_msg(struct gsm_subscriber_connection *conn, struct msgb *msg) int bsc_scan_msc_msg(struct gsm_subscriber_connection *conn, struct msgb *msg)
{ {
struct osmo_msc_data *msc; struct bsc_msc_data *msc;
struct gsm_network *net; struct gsm_network *net;
struct gsm48_loc_area_id *lai; struct gsm48_loc_area_id *lai;
struct gsm48_hdr *gh; struct gsm48_hdr *gh;

View File

@ -35,7 +35,7 @@ int bsc_grace_allow_new_connection(struct gsm_network *network, struct gsm_bts *
static int normal_paging(struct gsm_subscriber *subscr, int chan_needed, static int normal_paging(struct gsm_subscriber *subscr, int chan_needed,
struct osmo_msc_data *msc) struct bsc_msc_data *msc)
{ {
/* we can't page by lac.. we need to page everything */ /* we can't page by lac.. we need to page everything */
if (msc->core_lac != -1) { if (msc->core_lac != -1) {
@ -52,7 +52,7 @@ static int normal_paging(struct gsm_subscriber *subscr, int chan_needed,
} }
static int locked_paging(struct gsm_subscriber *subscr, int chan_needed, static int locked_paging(struct gsm_subscriber *subscr, int chan_needed,
struct osmo_msc_data *msc) struct bsc_msc_data *msc)
{ {
struct gsm_bts *bts = NULL; struct gsm_bts *bts = NULL;
@ -85,7 +85,7 @@ static int locked_paging(struct gsm_subscriber *subscr, int chan_needed,
* Try to not page if everything the cell is not on. * Try to not page if everything the cell is not on.
*/ */
int bsc_grace_paging_request(struct gsm_subscriber *subscr, int chan_needed, int bsc_grace_paging_request(struct gsm_subscriber *subscr, int chan_needed,
struct osmo_msc_data *msc) struct bsc_msc_data *msc)
{ {
if (subscr->group->net->bsc_data->rf_ctrl->policy == S_RF_ON) if (subscr->group->net->bsc_data->rf_ctrl->policy == S_RF_ON)
return normal_paging(subscr, chan_needed, msc); return normal_paging(subscr, chan_needed, msc);

View File

@ -156,7 +156,7 @@ static struct vty_app_info vty_info = {
extern int bsc_shutdown_net(struct gsm_network *net); extern int bsc_shutdown_net(struct gsm_network *net);
static void signal_handler(int signal) static void signal_handler(int signal)
{ {
struct osmo_msc_data *msc; struct bsc_msc_data *msc;
fprintf(stdout, "signal %u received\n", signal); fprintf(stdout, "signal %u received\n", signal);
@ -187,7 +187,7 @@ static void signal_handler(int signal)
int main(int argc, char **argv) int main(int argc, char **argv)
{ {
struct osmo_msc_data *msc; struct bsc_msc_data *msc;
struct osmo_bsc_data *data; struct osmo_bsc_data *data;
int rc; int rc;

View File

@ -45,16 +45,16 @@
static void initialize_if_needed(struct bsc_msc_connection *conn); static void initialize_if_needed(struct bsc_msc_connection *conn);
static void send_lacs(struct gsm_network *net, struct bsc_msc_connection *conn); static void send_lacs(struct gsm_network *net, struct bsc_msc_connection *conn);
static void send_id_get_response(struct osmo_msc_data *data, int fd, struct msgb *inp); static void send_id_get_response(struct bsc_msc_data *data, int fd, struct msgb *inp);
static void send_ping(struct osmo_msc_data *data); static void send_ping(struct bsc_msc_data *data);
static void schedule_ping_pong(struct osmo_msc_data *data); static void schedule_ping_pong(struct bsc_msc_data *data);
/* /*
* MGCP forwarding code * MGCP forwarding code
*/ */
static int mgcp_do_read(struct osmo_fd *fd) static int mgcp_do_read(struct osmo_fd *fd)
{ {
struct osmo_msc_data *data = (struct osmo_msc_data *) fd->data; struct bsc_msc_data *data = (struct bsc_msc_data *) fd->data;
struct msgb *mgcp; struct msgb *mgcp;
int ret; int ret;
@ -93,7 +93,7 @@ static int mgcp_do_write(struct osmo_fd *fd, struct msgb *msg)
return ret; return ret;
} }
static void mgcp_forward(struct osmo_msc_data *data, struct msgb *msg) static void mgcp_forward(struct bsc_msc_data *data, struct msgb *msg)
{ {
struct msgb *mgcp; struct msgb *mgcp;
@ -116,7 +116,7 @@ static void mgcp_forward(struct osmo_msc_data *data, struct msgb *msg)
} }
} }
static int mgcp_create_port(struct osmo_msc_data *data) static int mgcp_create_port(struct bsc_msc_data *data)
{ {
int on; int on;
struct sockaddr_in addr; struct sockaddr_in addr;
@ -186,7 +186,7 @@ int msc_queue_write(struct bsc_msc_connection *conn, struct msgb *msg, int proto
int msc_queue_write_with_ping(struct bsc_msc_connection *conn, int msc_queue_write_with_ping(struct bsc_msc_connection *conn,
struct msgb *msg, int proto) struct msgb *msg, int proto)
{ {
struct osmo_msc_data *data; struct bsc_msc_data *data;
uint8_t val; uint8_t val;
/* prepend the header */ /* prepend the header */
@ -201,7 +201,7 @@ int msc_queue_write_with_ping(struct bsc_msc_connection *conn,
val = IPAC_MSGT_PING; val = IPAC_MSGT_PING;
msgb_l16tv_put(msg, 1, IPAC_PROTO_IPACCESS, &val); msgb_l16tv_put(msg, 1, IPAC_PROTO_IPACCESS, &val);
data = (struct osmo_msc_data *) conn->write_queue.bfd.data; data = (struct bsc_msc_data *) conn->write_queue.bfd.data;
schedule_ping_pong(data); schedule_ping_pong(data);
return 0; return 0;
} }
@ -220,7 +220,7 @@ static int msc_alink_do_write(struct osmo_fd *fd, struct msgb *msg)
return ret; return ret;
} }
static void handle_ctrl(struct osmo_msc_data *msc, struct msgb *msg) static void handle_ctrl(struct bsc_msc_data *msc, struct msgb *msg)
{ {
int ret; int ret;
struct ctrl_cmd *cmd; struct ctrl_cmd *cmd;
@ -249,7 +249,7 @@ static void handle_ctrl(struct osmo_msc_data *msc, struct msgb *msg)
talloc_free(cmd); talloc_free(cmd);
} }
static void osmo_ext_handle(struct osmo_msc_data *msc, struct msgb *msg) static void osmo_ext_handle(struct bsc_msc_data *msc, struct msgb *msg)
{ {
struct ipaccess_head *hh; struct ipaccess_head *hh;
struct ipaccess_head_ext *hh_ext; struct ipaccess_head_ext *hh_ext;
@ -274,7 +274,7 @@ static int ipaccess_a_fd_cb(struct osmo_fd *bfd)
{ {
struct msgb *msg = NULL; struct msgb *msg = NULL;
struct ipaccess_head *hh; struct ipaccess_head *hh;
struct osmo_msc_data *data = (struct osmo_msc_data *) bfd->data; struct bsc_msc_data *data = (struct bsc_msc_data *) bfd->data;
int ret; int ret;
ret = ipa_msg_recv_buffered(bfd->fd, &msg, &data->msc_con->pending_msg); ret = ipa_msg_recv_buffered(bfd->fd, &msg, &data->msc_con->pending_msg);
@ -319,7 +319,7 @@ static int ipaccess_a_fd_cb(struct osmo_fd *bfd)
return 0; return 0;
} }
static void send_ping(struct osmo_msc_data *data) static void send_ping(struct bsc_msc_data *data)
{ {
struct msgb *msg; struct msgb *msg;
@ -335,7 +335,7 @@ static void send_ping(struct osmo_msc_data *data)
msc_queue_write(data->msc_con, msg, IPAC_PROTO_IPACCESS); msc_queue_write(data->msc_con, msg, IPAC_PROTO_IPACCESS);
} }
static void schedule_ping_pong(struct osmo_msc_data *data) static void schedule_ping_pong(struct bsc_msc_data *data)
{ {
/* send another ping in 20 seconds */ /* send another ping in 20 seconds */
osmo_timer_schedule(&data->ping_timer, data->ping_timeout, 0); osmo_timer_schedule(&data->ping_timer, data->ping_timeout, 0);
@ -346,7 +346,7 @@ static void schedule_ping_pong(struct osmo_msc_data *data)
static void msc_ping_timeout_cb(void *_data) static void msc_ping_timeout_cb(void *_data)
{ {
struct osmo_msc_data *data = (struct osmo_msc_data *) _data; struct bsc_msc_data *data = (struct bsc_msc_data *) _data;
if (data->ping_timeout <= 0) if (data->ping_timeout <= 0)
return; return;
@ -356,7 +356,7 @@ static void msc_ping_timeout_cb(void *_data)
static void msc_pong_timeout_cb(void *_data) static void msc_pong_timeout_cb(void *_data)
{ {
struct osmo_msc_data *data = (struct osmo_msc_data *) _data; struct bsc_msc_data *data = (struct bsc_msc_data *) _data;
LOGP(DMSC, LOGL_ERROR, "MSC didn't answer PING. Closing connection.\n"); LOGP(DMSC, LOGL_ERROR, "MSC didn't answer PING. Closing connection.\n");
bsc_msc_lost(data->msc_con); bsc_msc_lost(data->msc_con);
@ -365,14 +365,14 @@ static void msc_pong_timeout_cb(void *_data)
static void msc_connection_connected(struct bsc_msc_connection *con) static void msc_connection_connected(struct bsc_msc_connection *con)
{ {
struct msc_signal_data sig; struct msc_signal_data sig;
struct osmo_msc_data *data; struct bsc_msc_data *data;
int ret, on; int ret, on;
on = 1; on = 1;
ret = setsockopt(con->write_queue.bfd.fd, IPPROTO_TCP, TCP_NODELAY, &on, sizeof(on)); ret = setsockopt(con->write_queue.bfd.fd, IPPROTO_TCP, TCP_NODELAY, &on, sizeof(on));
if (ret != 0) if (ret != 0)
LOGP(DMSC, LOGL_ERROR, "Failed to set TCP_NODELAY: %s\n", strerror(errno)); LOGP(DMSC, LOGL_ERROR, "Failed to set TCP_NODELAY: %s\n", strerror(errno));
data = (struct osmo_msc_data *) con->write_queue.bfd.data; data = (struct bsc_msc_data *) con->write_queue.bfd.data;
msc_ping_timeout_cb(data); msc_ping_timeout_cb(data);
sig.data = data; sig.data = data;
@ -386,11 +386,11 @@ static void msc_connection_connected(struct bsc_msc_connection *con)
static void msc_connection_was_lost(struct bsc_msc_connection *msc) static void msc_connection_was_lost(struct bsc_msc_connection *msc)
{ {
struct msc_signal_data sig; struct msc_signal_data sig;
struct osmo_msc_data *data; struct bsc_msc_data *data;
LOGP(DMSC, LOGL_ERROR, "Lost MSC connection. Freing stuff.\n"); LOGP(DMSC, LOGL_ERROR, "Lost MSC connection. Freing stuff.\n");
data = (struct osmo_msc_data *) msc->write_queue.bfd.data; data = (struct bsc_msc_data *) msc->write_queue.bfd.data;
osmo_timer_del(&data->ping_timer); osmo_timer_del(&data->ping_timer);
osmo_timer_del(&data->pong_timer); osmo_timer_del(&data->pong_timer);
@ -452,7 +452,7 @@ static void initialize_if_needed(struct bsc_msc_connection *conn)
} }
} }
static int answer_challenge(struct osmo_msc_data *data, struct msgb *inp, struct osmo_auth_vector *vec) static int answer_challenge(struct bsc_msc_data *data, struct msgb *inp, struct osmo_auth_vector *vec)
{ {
int ret; int ret;
struct tlv_parsed tvp; struct tlv_parsed tvp;
@ -495,7 +495,7 @@ static int answer_challenge(struct osmo_msc_data *data, struct msgb *inp, struct
} }
static void send_id_get_response(struct osmo_msc_data *data, int fd, struct msgb *inp) static void send_id_get_response(struct bsc_msc_data *data, int fd, struct msgb *inp)
{ {
struct msc_signal_data sig; struct msc_signal_data sig;
struct msgb *msg; struct msgb *msg;
@ -515,7 +515,7 @@ static void send_id_get_response(struct osmo_msc_data *data, int fd, struct msgb
osmo_signal_dispatch(SS_MSC, S_MSC_AUTHENTICATED, &sig); osmo_signal_dispatch(SS_MSC, S_MSC_AUTHENTICATED, &sig);
} }
int osmo_bsc_msc_init(struct osmo_msc_data *data) int osmo_bsc_msc_init(struct bsc_msc_data *data)
{ {
if (mgcp_create_port(data) != 0) if (mgcp_create_port(data) != 0)
return -1; return -1;
@ -541,9 +541,9 @@ int osmo_bsc_msc_init(struct osmo_msc_data *data)
return 0; return 0;
} }
struct osmo_msc_data *osmo_msc_data_find(struct gsm_network *net, int nr) struct bsc_msc_data *osmo_msc_data_find(struct gsm_network *net, int nr)
{ {
struct osmo_msc_data *msc_data; struct bsc_msc_data *msc_data;
llist_for_each_entry(msc_data, &net->bsc_data->mscs, entry) llist_for_each_entry(msc_data, &net->bsc_data->mscs, entry)
if (msc_data->nr == nr) if (msc_data->nr == nr)
@ -551,16 +551,16 @@ struct osmo_msc_data *osmo_msc_data_find(struct gsm_network *net, int nr)
return NULL; return NULL;
} }
struct osmo_msc_data *osmo_msc_data_alloc(struct gsm_network *net, int nr) struct bsc_msc_data *osmo_msc_data_alloc(struct gsm_network *net, int nr)
{ {
struct osmo_msc_data *msc_data; struct bsc_msc_data *msc_data;
/* check if there is already one */ /* check if there is already one */
msc_data = osmo_msc_data_find(net, nr); msc_data = osmo_msc_data_find(net, nr);
if (msc_data) if (msc_data)
return msc_data; return msc_data;
msc_data = talloc_zero(net, struct osmo_msc_data); msc_data = talloc_zero(net, struct bsc_msc_data);
if (!msc_data) if (!msc_data)
return NULL; return NULL;

View File

@ -166,7 +166,7 @@ static int msc_sccp_accept(struct sccp_connection *connection, void *data)
static int msc_sccp_read(struct msgb *msgb, unsigned int length, void *data) static int msc_sccp_read(struct msgb *msgb, unsigned int length, void *data)
{ {
struct osmo_msc_data *msc = (struct osmo_msc_data *) msgb->cb[0]; struct bsc_msc_data *msc = (struct bsc_msc_data *) msgb->cb[0];
return bsc_handle_udt(msc, msgb, length); return bsc_handle_udt(msc, msgb, length);
} }
@ -194,7 +194,7 @@ int bsc_queue_for_msc(struct osmo_bsc_sccp_con *conn, struct msgb *msg)
} }
enum bsc_con bsc_create_new_connection(struct gsm_subscriber_connection *conn, enum bsc_con bsc_create_new_connection(struct gsm_subscriber_connection *conn,
struct osmo_msc_data *msc, int send_ping) struct bsc_msc_data *msc, int send_ping)
{ {
struct osmo_bsc_sccp_con *bsc_con; struct osmo_bsc_sccp_con *bsc_con;
struct sccp_connection *sccp; struct sccp_connection *sccp;

View File

@ -41,7 +41,7 @@ static struct osmo_bsc_data *osmo_bsc_data(struct vty *vty)
return bsc_gsmnet->bsc_data; return bsc_gsmnet->bsc_data;
} }
static struct osmo_msc_data *osmo_msc_data(struct vty *vty) static struct bsc_msc_data *bsc_msc_data(struct vty *vty)
{ {
return vty->index; return vty->index;
} }
@ -62,7 +62,7 @@ DEFUN(cfg_net_msc, cfg_net_msc_cmd,
"msc [<0-1000>]", "Configure MSC details\n" "MSC connection to configure\n") "msc [<0-1000>]", "Configure MSC details\n" "MSC connection to configure\n")
{ {
int index = argc == 1 ? atoi(argv[0]) : 0; int index = argc == 1 ? atoi(argv[0]) : 0;
struct osmo_msc_data *msc; struct bsc_msc_data *msc;
msc = osmo_msc_data_alloc(bsc_gsmnet, index); msc = osmo_msc_data_alloc(bsc_gsmnet, index);
if (!msc) { if (!msc) {
@ -82,7 +82,7 @@ DEFUN(cfg_net_bsc, cfg_net_bsc_cmd,
return CMD_SUCCESS; return CMD_SUCCESS;
} }
static void write_msc_amr_options(struct vty *vty, struct osmo_msc_data *msc) static void write_msc_amr_options(struct vty *vty, struct bsc_msc_data *msc)
{ {
#define WRITE_AMR(vty, msc, name, var) \ #define WRITE_AMR(vty, msc, name, var) \
vty_out(vty, " amr-config %s %s%s", \ vty_out(vty, " amr-config %s %s%s", \
@ -100,7 +100,7 @@ static void write_msc_amr_options(struct vty *vty, struct osmo_msc_data *msc)
#undef WRITE_AMR #undef WRITE_AMR
} }
static void write_msc(struct vty *vty, struct osmo_msc_data *msc) static void write_msc(struct vty *vty, struct bsc_msc_data *msc)
{ {
struct bsc_msc_dest *dest; struct bsc_msc_dest *dest;
@ -188,7 +188,7 @@ static void write_msc(struct vty *vty, struct osmo_msc_data *msc)
static int config_write_msc(struct vty *vty) static int config_write_msc(struct vty *vty)
{ {
struct osmo_msc_data *msc; struct bsc_msc_data *msc;
struct osmo_bsc_data *bsc = osmo_bsc_data(vty); struct osmo_bsc_data *bsc = osmo_bsc_data(vty);
llist_for_each_entry(msc, &bsc->mscs, entry) llist_for_each_entry(msc, &bsc->mscs, entry)
@ -228,7 +228,7 @@ DEFUN(cfg_net_bsc_token,
"token TOKEN", "token TOKEN",
"A token for the BSC to be sent to the MSC\n" "A token\n") "A token for the BSC to be sent to the MSC\n" "A token\n")
{ {
struct osmo_msc_data *data = osmo_msc_data(vty); struct bsc_msc_data *data = bsc_msc_data(vty);
bsc_replace_string(osmo_bsc_data(vty), &data->bsc_token, argv[0]); bsc_replace_string(osmo_bsc_data(vty), &data->bsc_token, argv[0]);
return CMD_SUCCESS; return CMD_SUCCESS;
@ -240,7 +240,7 @@ DEFUN(cfg_net_bsc_key,
"Authentication (secret) key configuration\n" "Authentication (secret) key configuration\n"
"Security key\n") "Security key\n")
{ {
struct osmo_msc_data *data = osmo_msc_data(vty); struct bsc_msc_data *data = bsc_msc_data(vty);
osmo_hexparse(argv[0], data->bsc_key, sizeof(data->bsc_key)); osmo_hexparse(argv[0], data->bsc_key, sizeof(data->bsc_key));
data->bsc_key_present = 1; data->bsc_key_present = 1;
@ -251,7 +251,7 @@ DEFUN(cfg_net_no_bsc_key, cfg_net_bsc_no_key_cmd,
"no auth-key", "no auth-key",
NO_STR "Authentication (secret) key configuration\n") NO_STR "Authentication (secret) key configuration\n")
{ {
struct osmo_msc_data *data = osmo_msc_data(vty); struct bsc_msc_data *data = bsc_msc_data(vty);
memset(data->bsc_key, 0, sizeof(data->bsc_key)); memset(data->bsc_key, 0, sizeof(data->bsc_key));
data->bsc_key_present = 0; data->bsc_key_present = 0;
@ -263,7 +263,7 @@ DEFUN(cfg_net_bsc_ncc,
"core-mobile-network-code <1-999>", "core-mobile-network-code <1-999>",
"Use this network code for the core network\n" "MNC value\n") "Use this network code for the core network\n" "MNC value\n")
{ {
struct osmo_msc_data *data = osmo_msc_data(vty); struct bsc_msc_data *data = bsc_msc_data(vty);
data->core_mnc = atoi(argv[0]); data->core_mnc = atoi(argv[0]);
return CMD_SUCCESS; return CMD_SUCCESS;
} }
@ -273,7 +273,7 @@ DEFUN(cfg_net_bsc_mcc,
"core-mobile-country-code <1-999>", "core-mobile-country-code <1-999>",
"Use this country code for the core network\n" "MCC value\n") "Use this country code for the core network\n" "MCC value\n")
{ {
struct osmo_msc_data *data = osmo_msc_data(vty); struct bsc_msc_data *data = bsc_msc_data(vty);
data->core_mcc = atoi(argv[0]); data->core_mcc = atoi(argv[0]);
return CMD_SUCCESS; return CMD_SUCCESS;
} }
@ -283,7 +283,7 @@ DEFUN(cfg_net_bsc_lac,
"core-location-area-code <0-65535>", "core-location-area-code <0-65535>",
"Use this location area code for the core network\n" "LAC value\n") "Use this location area code for the core network\n" "LAC value\n")
{ {
struct osmo_msc_data *data = osmo_msc_data(vty); struct bsc_msc_data *data = bsc_msc_data(vty);
data->core_lac = atoi(argv[0]); data->core_lac = atoi(argv[0]);
return CMD_SUCCESS; return CMD_SUCCESS;
} }
@ -293,7 +293,7 @@ DEFUN(cfg_net_bsc_ci,
"core-cell-identity <0-65535>", "core-cell-identity <0-65535>",
"Use this cell identity for the core network\n" "CI value\n") "Use this cell identity for the core network\n" "CI value\n")
{ {
struct osmo_msc_data *data = osmo_msc_data(vty); struct bsc_msc_data *data = bsc_msc_data(vty);
data->core_ci = atoi(argv[0]); data->core_ci = atoi(argv[0]);
return CMD_SUCCESS; return CMD_SUCCESS;
} }
@ -305,7 +305,7 @@ DEFUN(cfg_net_bsc_rtp_base,
"Set the rtp-base port for the RTP stream\n" "Set the rtp-base port for the RTP stream\n"
"Port number\n") "Port number\n")
{ {
struct osmo_msc_data *data = osmo_msc_data(vty); struct bsc_msc_data *data = bsc_msc_data(vty);
data->rtp_base = atoi(argv[0]); data->rtp_base = atoi(argv[0]);
return CMD_SUCCESS; return CMD_SUCCESS;
} }
@ -316,7 +316,7 @@ DEFUN(cfg_net_bsc_codec_list,
"Set the allowed audio codecs\n" "Set the allowed audio codecs\n"
"List of audio codecs, e.g. fr3 fr1 hr3\n") "List of audio codecs, e.g. fr3 fr1 hr3\n")
{ {
struct osmo_msc_data *data = osmo_msc_data(vty); struct bsc_msc_data *data = bsc_msc_data(vty);
int saw_fr, saw_hr; int saw_fr, saw_hr;
int i; int i;
@ -377,7 +377,7 @@ DEFUN(cfg_net_msc_dest,
"IP Address\n" "Port\n" "DSCP\n") "IP Address\n" "Port\n" "DSCP\n")
{ {
struct bsc_msc_dest *dest; struct bsc_msc_dest *dest;
struct osmo_msc_data *data = osmo_msc_data(vty); struct bsc_msc_data *data = bsc_msc_data(vty);
dest = talloc_zero(osmo_bsc_data(vty), struct bsc_msc_dest); dest = talloc_zero(osmo_bsc_data(vty), struct bsc_msc_dest);
if (!dest) { if (!dest) {
@ -405,7 +405,7 @@ DEFUN(cfg_net_msc_no_dest,
"IP Address\n" "Port\n" "DSCP\n") "IP Address\n" "Port\n" "DSCP\n")
{ {
struct bsc_msc_dest *dest, *tmp; struct bsc_msc_dest *dest, *tmp;
struct osmo_msc_data *data = osmo_msc_data(vty); struct bsc_msc_data *data = bsc_msc_data(vty);
int port = atoi(argv[1]); int port = atoi(argv[1]);
int dscp = atoi(argv[2]); int dscp = atoi(argv[2]);
@ -427,7 +427,7 @@ DEFUN(cfg_net_msc_no_ping_time,
"no timeout-ping", "no timeout-ping",
NO_STR "Disable the ping/pong handling on A-link\n") NO_STR "Disable the ping/pong handling on A-link\n")
{ {
struct osmo_msc_data *data = osmo_msc_data(vty); struct bsc_msc_data *data = bsc_msc_data(vty);
data->ping_timeout = -1; data->ping_timeout = -1;
return CMD_SUCCESS; return CMD_SUCCESS;
} }
@ -438,7 +438,7 @@ DEFUN(cfg_net_msc_ping_time,
"Set the PING interval, negative for not sending PING\n" "Set the PING interval, negative for not sending PING\n"
"Timeout in seconds\n") "Timeout in seconds\n")
{ {
struct osmo_msc_data *data = osmo_msc_data(vty); struct bsc_msc_data *data = bsc_msc_data(vty);
data->ping_timeout = atoi(argv[0]); data->ping_timeout = atoi(argv[0]);
return CMD_SUCCESS; return CMD_SUCCESS;
} }
@ -448,7 +448,7 @@ DEFUN(cfg_net_msc_pong_time,
"timeout-pong <1-2147483647>", "timeout-pong <1-2147483647>",
"Set the time to wait for a PONG\n" "Timeout in seconds\n") "Set the time to wait for a PONG\n" "Timeout in seconds\n")
{ {
struct osmo_msc_data *data = osmo_msc_data(vty); struct bsc_msc_data *data = bsc_msc_data(vty);
data->pong_timeout = atoi(argv[0]); data->pong_timeout = atoi(argv[0]);
return CMD_SUCCESS; return CMD_SUCCESS;
} }
@ -458,7 +458,7 @@ DEFUN(cfg_net_msc_advanced_ping,
"timeout-ping advanced", "timeout-ping advanced",
"Ping timeout handling\nEnable advanced mode during SCCP\n") "Ping timeout handling\nEnable advanced mode during SCCP\n")
{ {
struct osmo_msc_data *data = osmo_msc_data(vty); struct bsc_msc_data *data = bsc_msc_data(vty);
if (data->ping_timeout == -1) { if (data->ping_timeout == -1) {
vty_out(vty, "%%ping handling is disabled. Enable it first.%s", vty_out(vty, "%%ping handling is disabled. Enable it first.%s",
@ -475,7 +475,7 @@ DEFUN(cfg_no_net_msc_advanced_ping,
"no timeout-ping advanced", "no timeout-ping advanced",
NO_STR "Ping timeout handling\nEnable advanced mode during SCCP\n") NO_STR "Ping timeout handling\nEnable advanced mode during SCCP\n")
{ {
struct osmo_msc_data *data = osmo_msc_data(vty); struct bsc_msc_data *data = bsc_msc_data(vty);
data->advanced_ping = 0; data->advanced_ping = 0;
return CMD_SUCCESS; return CMD_SUCCESS;
} }
@ -485,7 +485,7 @@ DEFUN(cfg_net_msc_welcome_ussd,
"bsc-welcome-text .TEXT", "bsc-welcome-text .TEXT",
"Set the USSD notification to be sent\n" "Text to be sent\n") "Set the USSD notification to be sent\n" "Text to be sent\n")
{ {
struct osmo_msc_data *data = osmo_msc_data(vty); struct bsc_msc_data *data = bsc_msc_data(vty);
char *str = argv_concat(argv, argc, 0); char *str = argv_concat(argv, argc, 0);
if (!str) if (!str)
return CMD_WARNING; return CMD_WARNING;
@ -500,7 +500,7 @@ DEFUN(cfg_net_msc_no_welcome_ussd,
"no bsc-welcome-text", "no bsc-welcome-text",
NO_STR "Clear the USSD notification to be sent\n") NO_STR "Clear the USSD notification to be sent\n")
{ {
struct osmo_msc_data *data = osmo_msc_data(vty); struct bsc_msc_data *data = bsc_msc_data(vty);
talloc_free(data->ussd_welcome_txt); talloc_free(data->ussd_welcome_txt);
data->ussd_welcome_txt = NULL; data->ussd_welcome_txt = NULL;
@ -513,7 +513,7 @@ DEFUN(cfg_net_msc_lost_ussd,
"bsc-msc-lost-text .TEXT", "bsc-msc-lost-text .TEXT",
"Set the USSD notification to be sent on MSC connection loss\n" "Text to be sent\n") "Set the USSD notification to be sent on MSC connection loss\n" "Text to be sent\n")
{ {
struct osmo_msc_data *data = osmo_msc_data(vty); struct bsc_msc_data *data = bsc_msc_data(vty);
char *str = argv_concat(argv, argc, 0); char *str = argv_concat(argv, argc, 0);
if (!str) if (!str)
return CMD_WARNING; return CMD_WARNING;
@ -528,7 +528,7 @@ DEFUN(cfg_net_msc_no_lost_ussd,
"no bsc-msc-lost-text", "no bsc-msc-lost-text",
NO_STR "Clear the USSD notification to be sent on MSC connection loss\n") NO_STR "Clear the USSD notification to be sent on MSC connection loss\n")
{ {
struct osmo_msc_data *data = osmo_msc_data(vty); struct bsc_msc_data *data = bsc_msc_data(vty);
talloc_free(data->ussd_msc_lost_txt); talloc_free(data->ussd_msc_lost_txt);
data->ussd_msc_lost_txt = 0; data->ussd_msc_lost_txt = 0;
@ -541,7 +541,7 @@ DEFUN(cfg_net_msc_grace_ussd,
"bsc-grace-text .TEXT", "bsc-grace-text .TEXT",
"Set the USSD notification to be sent when the MSC has entered the grace period\n" "Text to be sent\n") "Set the USSD notification to be sent when the MSC has entered the grace period\n" "Text to be sent\n")
{ {
struct osmo_msc_data *data = osmo_msc_data(vty); struct bsc_msc_data *data = bsc_msc_data(vty);
char *str = argv_concat(argv, argc, 0); char *str = argv_concat(argv, argc, 0);
if (!str) if (!str)
return CMD_WARNING; return CMD_WARNING;
@ -556,7 +556,7 @@ DEFUN(cfg_net_msc_no_grace_ussd,
"no bsc-grace-text", "no bsc-grace-text",
NO_STR "Clear the USSD notification to be sent when the MSC has entered the grace period\n") NO_STR "Clear the USSD notification to be sent when the MSC has entered the grace period\n")
{ {
struct osmo_msc_data *data = osmo_msc_data(vty); struct bsc_msc_data *data = bsc_msc_data(vty);
talloc_free(data->ussd_grace_txt); talloc_free(data->ussd_grace_txt);
data->ussd_grace_txt = NULL; data->ussd_grace_txt = NULL;
@ -599,7 +599,7 @@ DEFUN(cfg_net_msc_type,
"Select the MSC type\n" "Select the MSC type\n"
"Plain GSM MSC\n" "Special MSC for local call routing\n") "Plain GSM MSC\n" "Special MSC for local call routing\n")
{ {
struct osmo_msc_data *data = osmo_msc_data(vty); struct bsc_msc_data *data = bsc_msc_data(vty);
if (strcmp(argv[0], "normal") == 0) if (strcmp(argv[0], "normal") == 0)
data->type = MSC_CON_TYPE_NORMAL; data->type = MSC_CON_TYPE_NORMAL;
@ -615,7 +615,7 @@ DEFUN(cfg_net_msc_emerg,
"Allow CM ServiceRequests with type emergency\n" "Allow CM ServiceRequests with type emergency\n"
"Allow\n" "Deny\n") "Allow\n" "Deny\n")
{ {
struct osmo_msc_data *data = osmo_msc_data(vty); struct bsc_msc_data *data = bsc_msc_data(vty);
data->allow_emerg = strcmp("allow", argv[0]) == 0; data->allow_emerg = strcmp("allow", argv[0]) == 0;
return CMD_SUCCESS; return CMD_SUCCESS;
} }
@ -625,7 +625,7 @@ DEFUN(cfg_net_msc_local_prefix,
"local-prefix REGEXP", "local-prefix REGEXP",
"Prefix for local numbers\n" "REGEXP used\n") "Prefix for local numbers\n" "REGEXP used\n")
{ {
struct osmo_msc_data *msc = osmo_msc_data(vty); struct bsc_msc_data *msc = bsc_msc_data(vty);
if (gsm_parse_reg(msc, &msc->local_pref_reg, &msc->local_pref, argc, argv) != 0) { if (gsm_parse_reg(msc, &msc->local_pref_reg, &msc->local_pref, argc, argv) != 0) {
vty_out(vty, "%%Failed to parse the regexp: '%s'%s", vty_out(vty, "%%Failed to parse the regexp: '%s'%s",
@ -643,7 +643,7 @@ DEFUN(cfg_net_msc_local_prefix,
"amr-config " #name "k (allowed|forbidden)", \ "amr-config " #name "k (allowed|forbidden)", \
AMR_CONF_STR "Bitrate\n" "Allowed\n" "Forbidden\n") \ AMR_CONF_STR "Bitrate\n" "Allowed\n" "Forbidden\n") \
{ \ { \
struct osmo_msc_data *msc = osmo_msc_data(vty); \ struct bsc_msc_data *msc = bsc_msc_data(vty); \
\ \
msc->amr_conf.m##name = strcmp(argv[0], "allowed") == 0; \ msc->amr_conf.m##name = strcmp(argv[0], "allowed") == 0; \
return CMD_SUCCESS; \ return CMD_SUCCESS; \
@ -664,7 +664,7 @@ DEFUN(cfg_msc_acc_lst_name,
"Set the name of the access list to use.\n" "Set the name of the access list to use.\n"
"The name of the to be used access list.") "The name of the to be used access list.")
{ {
struct osmo_msc_data *msc = osmo_msc_data(vty); struct bsc_msc_data *msc = bsc_msc_data(vty);
bsc_replace_string(msc, &msc->acc_lst_name, argv[0]); bsc_replace_string(msc, &msc->acc_lst_name, argv[0]);
return CMD_SUCCESS; return CMD_SUCCESS;
@ -675,7 +675,7 @@ DEFUN(cfg_msc_no_acc_lst_name,
"no access-list-name", "no access-list-name",
NO_STR "Remove the access list from the NAT.\n") NO_STR "Remove the access list from the NAT.\n")
{ {
struct osmo_msc_data *msc = osmo_msc_data(vty); struct bsc_msc_data *msc = bsc_msc_data(vty);
if (msc->acc_lst_name) { if (msc->acc_lst_name) {
talloc_free(msc->acc_lst_name); talloc_free(msc->acc_lst_name);
@ -782,7 +782,7 @@ DEFUN(show_mscs,
"show mscs", "show mscs",
SHOW_STR "MSC Connections and State\n") SHOW_STR "MSC Connections and State\n")
{ {
struct osmo_msc_data *msc; struct bsc_msc_data *msc;
llist_for_each_entry(msc, &bsc_gsmnet->bsc_data->mscs, entry) { llist_for_each_entry(msc, &bsc_gsmnet->bsc_data->mscs, entry) {
vty_out(vty, "MSC Nr: %d is connected: %d auth: %d.%s", vty_out(vty, "MSC Nr: %d is connected: %d auth: %d.%s",
msc->nr, msc->nr,

View File

@ -125,13 +125,13 @@ static void test_scan(void)
struct gsm_network *net; struct gsm_network *net;
struct gsm_bts *bts; struct gsm_bts *bts;
struct osmo_bsc_sccp_con *sccp_con; struct osmo_bsc_sccp_con *sccp_con;
struct osmo_msc_data *msc; struct bsc_msc_data *msc;
struct gsm_subscriber_connection *conn; struct gsm_subscriber_connection *conn;
net = talloc_zero(NULL, struct gsm_network); net = talloc_zero(NULL, struct gsm_network);
bts = talloc_zero(net, struct gsm_bts); bts = talloc_zero(net, struct gsm_bts);
sccp_con = talloc_zero(net, struct osmo_bsc_sccp_con); sccp_con = talloc_zero(net, struct osmo_bsc_sccp_con);
msc = talloc_zero(net, struct osmo_msc_data); msc = talloc_zero(net, struct bsc_msc_data);
conn = talloc_zero(net, struct gsm_subscriber_connection); conn = talloc_zero(net, struct gsm_subscriber_connection);
bts->network = net; bts->network = net;