aboutsummaryrefslogtreecommitdiffstats
path: root/src/bsc_hack.c
diff options
context:
space:
mode:
authorHolger Freyther <zecke@selfish.org>2008-12-28 14:14:56 +0000
committerHolger Freyther <zecke@selfish.org>2008-12-28 14:14:56 +0000
commitefde7fb1eb0fd3597c5171584380c41cfe4a0685 (patch)
treee9d8a037955a84150c05689e5975ace793cc7d00 /src/bsc_hack.c
parent3444ddb85d390bbd6ab3cc44079d138f31315b0a (diff)
bsc_hack: Add command line parameter to set the MCC and MNC
The patching of the system information type1-type4 messages are still to be done.
Diffstat (limited to 'src/bsc_hack.c')
-rw-r--r--src/bsc_hack.c32
1 files changed, 28 insertions, 4 deletions
diff --git a/src/bsc_hack.c b/src/bsc_hack.c
index 2838ff8bc..6885d0eba 100644
--- a/src/bsc_hack.c
+++ b/src/bsc_hack.c
@@ -43,6 +43,11 @@
/* global pointer to the gsm network data structure */
static struct gsm_network *gsmnet;
+/* MCC and MNC for the Location Area Identifier */
+static int MCC = 1;
+static int MNC = 1;
+
+
/* The following definitions are for OM and NM packets that we cannot yet
* generate by code but we just pass on */
@@ -568,12 +573,20 @@ static void mi_cb(int event, struct gsm_bts *bts)
}
}
+/*
+ * Patch the various SYSTEM INFORMATION tables to update
+ * the LAI
+ */
+static void patch_tables(void)
+{
+}
+
static int bootstrap_network(void)
{
struct gsm_bts *bts;
/* initialize our data structures */
- gsmnet = gsm_network_init(1, 1, 1);
+ gsmnet = gsm_network_init(1, MCC, MNC);
if (!gsmnet)
return -ENOMEM;
@@ -596,7 +609,9 @@ static void print_help()
{
printf(" Some useful help...\n");
printf(" -d option --debug=DRLL:DCC:DMM:DRR:DRSL:DNM enable debugging\n");
- printf(" -n --disable-color\n");
+ printf(" -s --disable-color\n");
+ printf(" -n --network-code number(MNC) \n");
+ printf(" -c --country-code number (MCC) \n");
printf(" -h --help this text\n");
}
@@ -607,7 +622,9 @@ static void handle_options(int argc, char** argv)
static struct option long_options[] = {
{"help", 0, 0, 'h'},
{"debug", 1, 0, 'd'},
- {"disable-color", 0, 0, 'n'},
+ {"disable-color", 0, 0, 's'},
+ {"network-code", 1, 0, 'n'},
+ {"country-code", 1, 0, 'c'},
{0, 0, 0, 0}
};
@@ -621,12 +638,18 @@ static void handle_options(int argc, char** argv)
print_usage();
print_help();
exit(0);
- case 'n':
+ case 's':
debug_use_color(0);
break;
case 'd':
debug_parse_category_mask(optarg);
break;
+ case 'n':
+ MNC = atoi(optarg);
+ break;
+ case 'c':
+ MCC = atoi(optarg);
+ break;
default:
/* ignore */
break;
@@ -719,6 +742,7 @@ int main(int argc, char **argv)
}
printf("DB: Database prepared.\n");
+ patch_tables();
bootstrap_network();
pag_timer.cb = pag_timer_cb;