diff options
author | Holger Hans Peter Freyther <zecke@selfish.org> | 2010-11-05 19:43:07 +0100 |
---|---|---|
committer | Holger Hans Peter Freyther <zecke@selfish.org> | 2010-11-15 20:06:48 +0100 |
commit | 2a8675e49a5fac26778f6397696bd98981422f21 (patch) | |
tree | e4996757da258981d6d0fa176a2dcd8bd9fa1b64 | |
parent | 52d42abdb7b75d41b9291ca266d5d71610b2088b (diff) |
bsc: Add a mobile country code setting for the backbone.
-rw-r--r-- | openbsc/include/openbsc/osmo_msc_data.h | 1 | ||||
-rw-r--r-- | openbsc/src/bsc/osmo_bsc_filter.c | 3 | ||||
-rw-r--r-- | openbsc/src/bsc/osmo_bsc_vty.c | 14 | ||||
-rw-r--r-- | openbsc/src/gsm_data.c | 1 |
4 files changed, 18 insertions, 1 deletions
diff --git a/openbsc/include/openbsc/osmo_msc_data.h b/openbsc/include/openbsc/osmo_msc_data.h index 522f9efe6..caf49ef19 100644 --- a/openbsc/include/openbsc/osmo_msc_data.h +++ b/openbsc/include/openbsc/osmo_msc_data.h @@ -47,6 +47,7 @@ struct osmo_msc_data { struct timer_list pong_timer; struct bsc_msc_connection *msc_con; int core_ncc; + int core_mcc; int rtp_payload; int rtp_base; diff --git a/openbsc/src/bsc/osmo_bsc_filter.c b/openbsc/src/bsc/osmo_bsc_filter.c index 2503cfbf8..24710fabd 100644 --- a/openbsc/src/bsc/osmo_bsc_filter.c +++ b/openbsc/src/bsc/osmo_bsc_filter.c @@ -101,7 +101,8 @@ int bsc_scan_msc_msg(struct gsm_subscriber_connection *conn, struct msgb *msg) net = conn->bts->network; if (mtype == GSM48_MT_MM_LOC_UPD_ACCEPT) { - if (net->msc_data->core_ncc != -1) { + if (net->msc_data->core_ncc != -1 || + net->msc_data->core_mcc != -1) { if (msgb_l3len(msg) >= sizeof(*gh) + sizeof(*lai)) { lai = (struct gsm48_loc_area_id *) &gh->data[0]; gsm48_generate_lai(lai, net->country_code, diff --git a/openbsc/src/bsc/osmo_bsc_vty.c b/openbsc/src/bsc/osmo_bsc_vty.c index ba6bc1e95..a76a7e103 100644 --- a/openbsc/src/bsc/osmo_bsc_vty.c +++ b/openbsc/src/bsc/osmo_bsc_vty.c @@ -60,6 +60,9 @@ static int config_write_msc(struct vty *vty) if (data->core_ncc != -1) vty_out(vty, " core-mobile-network-code %d%s", data->core_ncc, VTY_NEWLINE); + if (data->core_mcc != -1) + vty_out(vty, " core-mobile-country-code %d%s", + data->core_mcc, VTY_NEWLINE); vty_out(vty, " ip.access rtp-payload %d%s", data->rtp_payload, VTY_NEWLINE); vty_out(vty, " ip.access rtp-base %d%s", data->rtp_base, VTY_NEWLINE); @@ -112,6 +115,16 @@ DEFUN(cfg_net_bsc_ncc, return CMD_SUCCESS; } +DEFUN(cfg_net_bsc_mcc, + cfg_net_bsc_mcc_cmd, + "core-mobile-country-code <0-255>", + "Use this country code for the backbone\n" "MCC value\n") +{ + struct osmo_msc_data *data = osmo_msc_data(vty); + data->core_mcc = atoi(argv[0]); + return CMD_SUCCESS; +} + DEFUN(cfg_net_bsc_rtp_payload, cfg_net_bsc_rtp_payload_cmd, "ip.access rtp-payload <0-255>", @@ -269,6 +282,7 @@ int bsc_vty_init_extra(void) install_default(MSC_NODE); install_element(MSC_NODE, &cfg_net_bsc_token_cmd); install_element(MSC_NODE, &cfg_net_bsc_ncc_cmd); + install_element(MSC_NODE, &cfg_net_bsc_mcc_cmd); install_element(MSC_NODE, &cfg_net_bsc_rtp_payload_cmd); install_element(MSC_NODE, &cfg_net_bsc_rtp_base_cmd); install_element(MSC_NODE, &cfg_net_bsc_codec_list_cmd); diff --git a/openbsc/src/gsm_data.c b/openbsc/src/gsm_data.c index dc8024aa9..a4a5b2065 100644 --- a/openbsc/src/gsm_data.c +++ b/openbsc/src/gsm_data.c @@ -318,6 +318,7 @@ struct gsm_network *gsm_network_init(u_int16_t country_code, u_int16_t network_c net->msc_data->ping_timeout = 20; net->msc_data->pong_timeout = 5; net->msc_data->core_ncc = -1; + net->msc_data->core_mcc = -1; net->msc_data->rtp_payload = 126; net->msc_data->rtp_base = 4000; |