[bsc_hack] Allow to select the cardnr defaulting to number 0
Patch from Andreas Eversberg to allow to select the ISDN
card number. The default remains the same.
diff --git a/src/bsc_hack.c b/src/bsc_hack.c
index 8b25144..38fa5c4 100644
--- a/src/bsc_hack.c
+++ b/src/bsc_hack.c
@@ -55,6 +55,7 @@
static int MNC = 1;
static int LAC = 1;
static int ARFCN = HARDCODED_ARFCN;
+static int cardnr = 0;
static enum gsm_bts_type BTS_TYPE = GSM_BTS_TYPE_BS11;
static const char *database_name = "hlr.sqlite3";
@@ -926,7 +927,7 @@
/* E1 mISDN input setup */
if (BTS_TYPE == GSM_BTS_TYPE_BS11)
- return e1_config(bts);
+ return e1_config(bts, cardnr);
else
return ia_config(bts);
}
@@ -963,6 +964,7 @@
printf(" -r --reject-cause number The reject cause for LOCATION UPDATING REJECT.\n");
printf(" -p --pcap file The filename of the pcap file\n");
printf(" -t --bts-type type The BTS type (bs11, nanobts900, nanobts1800)\n");
+ printf(" -C --cardnr number For bs11 select E1 card number other than 0\n");
printf(" -h --help this text\n");
}
@@ -983,10 +985,11 @@
{"pcap", 1, 0, 'p'},
{"arfcn", 1, 0, 'f'},
{"bts-type", 1, 0, 't'},
+ {"cardnr", 1, 0, 'C'},
{0, 0, 0, 0}
};
- c = getopt_long(argc, argv, "hc:n:d:sar:p:f:t:L:",
+ c = getopt_long(argc, argv, "hc:n:d:sar:p:f:t:C:L:",
long_options, &option_index);
if (c == -1)
break;
@@ -1029,6 +1032,9 @@
case 't':
BTS_TYPE = parse_btstype(optarg);
break;
+ case 'C':
+ cardnr = atoi(optarg);
+ break;
default:
/* ignore */
break;