diff options
author | Neels Hofmeyr <neels@hofmeyr.de> | 2018-02-21 00:39:07 +0100 |
---|---|---|
committer | Neels Hofmeyr <neels@hofmeyr.de> | 2018-03-11 00:47:14 +0100 |
commit | bdc55fad62e333951a0eb1fc7b96aaaec16dd6ff (patch) | |
tree | 2dde9a0de875f3e21e4e461df5bcb8f74c6c9496 /src/pcu_main.cpp | |
parent | 8343b4adbbe9afd4294232429696ee9736ec1004 (diff) |
implement support for 3-digit MNC with leading zeros
Receive the mnc_3_digits flag from the PCU interface.
Bump the PCU interface to 9.
This is one part of the three identical pcuif_proto.h patches:
- I49cd762c3c9d7ee6a82451bdf3ffa2a060767947 (osmo-bts)
- I787fed84a7b613158a5618dd5cffafe4e4927234 (osmo-pcu)
- I78f30aef7aa224b2e9db54c3a844d8f520b3aee0 (osmo-bsc)
Add 3-digit flags and use the new RAI and LAI API from libosmocore throughout
the code base to be able to handle an MNC < 100 that has three digits (leading
zeros).
Depends: Id2240f7f518494c9df6c8bda52c0d5092f90f221 (libosmocore),
Ib7176b1d65a03b76f41f94bc9d3293a8a07d24c6 (libosmocore)
Change-Id: I787fed84a7b613158a5618dd5cffafe4e4927234
Diffstat (limited to 'src/pcu_main.cpp')
-rw-r--r-- | src/pcu_main.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/pcu_main.cpp b/src/pcu_main.cpp index 0c3a4142..84ade6f3 100644 --- a/src/pcu_main.cpp +++ b/src/pcu_main.cpp @@ -52,6 +52,7 @@ extern "C" { extern struct gprs_nsvc *nsvc; uint16_t spoof_mcc = 0, spoof_mnc = 0; +bool spoof_mnc_3_digits = false; static int config_given = 0; static char *config_file = strdup("osmo-pcu.cfg"); extern struct vty_app_info pcu_vty_info; @@ -114,7 +115,10 @@ static void handle_options(int argc, char **argv) spoof_mcc = atoi(optarg); break; case 'n': - spoof_mnc = atoi(optarg); + if (osmo_mnc_from_str(optarg, &spoof_mnc, &spoof_mnc_3_digits)) { + fprintf(stderr, "Error decoding MNC '%s'\n", optarg); + exit(1); + } break; case 'V': print_version(1); |