diff --git a/src/bsc_hack.c b/src/bsc_hack.c index 9bec0b4b7..253826af0 100644 --- a/src/bsc_hack.c +++ b/src/bsc_hack.c @@ -19,7 +19,12 @@ * */ - +#include +#include +#include +#include +#include +#include #include #include @@ -536,8 +541,36 @@ static void bootstrap_network() bts->location_area_code = 1; bts->trx[0].arfcn = HARDCODED_ARFCN; - mi_setup(); - /* initialize the BTS */ bootstrap_bts(&gsmnet->bts[0]); } + +void debugp(int subsys, char *file, int line, const char *format, ...) +{ + char *timestr; + va_list ap; + time_t tm; + FILE *outfd = stderr; + + va_start(ap, format); + + tm = time(NULL); + timestr = ctime(&tm); + timestr[strlen(timestr)-1] = '\0'; + fprintf(outfd, "%s <%4.4x> %s:%d ", timestr, subsys, file, line); + vsprintf(outfd, format, ap); + va_end(ap); + fflush(outfd); +} + +int main(int argc, char **argv) +{ + if (mi_setup() < 0) + exit(1); + + bootstrap_network(); + + while (1) { + bsc_select_main(); + } +}