diff options
author | Andreas Eversberg <jolly@eversberg.eu> | 2011-06-26 10:53:28 +0200 |
---|---|---|
committer | Andreas Eversberg <jolly@eversberg.eu> | 2011-07-17 12:15:04 +0200 |
commit | 051dedd23551854ceecc0241af2edad07e15df88 (patch) | |
tree | 4a8a7e892667e19935b8be560a4ed56aa85235f7 /src/host/layer23/src/mobile/vty_interface.c | |
parent | 9cfc0964771d2d3f0e47251124c3d8c60be8104f (diff) |
[layer23] Added special return value for invalid MCC/MNC input
This way an MNC of 000 can be entered.
Diffstat (limited to 'src/host/layer23/src/mobile/vty_interface.c')
-rw-r--r-- | src/host/layer23/src/mobile/vty_interface.c | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/src/host/layer23/src/mobile/vty_interface.c b/src/host/layer23/src/mobile/vty_interface.c index f5ccac33..5fe34411 100644 --- a/src/host/layer23/src/mobile/vty_interface.c +++ b/src/host/layer23/src/mobile/vty_interface.c @@ -391,11 +391,11 @@ DEFUN(show_ba, show_ba_cmd, "show ba MS_NAME [MCC] [MNC]", if (argc >= 3) { mcc = gsm_input_mcc((char *)argv[1]); mnc = gsm_input_mnc((char *)argv[2]); - if (!mcc) { + if (mcc == GSM_INPUT_INVALID) { vty_out(vty, "Given MCC invalid%s", VTY_NEWLINE); return CMD_WARNING; } - if (!mnc) { + if (mnc == GSM_INPUT_INVALID) { vty_out(vty, "Given MNC invalid%s", VTY_NEWLINE); return CMD_WARNING; } @@ -487,11 +487,11 @@ DEFUN(sim_test, sim_test_cmd, "sim testcard MS_NAME [MCC] [MNC] [LAC] [TMSI]", if (argc >= 3) { mcc = gsm_input_mcc((char *)argv[1]); mnc = gsm_input_mnc((char *)argv[2]); - if (!mcc) { + if (mcc == GSM_INPUT_INVALID) { vty_out(vty, "Given MCC invalid%s", VTY_NEWLINE); return CMD_WARNING; } - if (!mnc) { + if (mnc == GSM_INPUT_INVALID) { vty_out(vty, "Given MNC invalid%s", VTY_NEWLINE); return CMD_WARNING; } @@ -674,11 +674,11 @@ DEFUN(sim_lai, sim_lai_cmd, "sim lai MS_NAME MCC MNC LAC", if (!ms) return CMD_WARNING; - if (!mcc) { + if (mcc == GSM_INPUT_INVALID) { vty_out(vty, "Given MCC invalid%s", VTY_NEWLINE); return CMD_WARNING; } - if (!mnc) { + if (mnc == GSM_INPUT_INVALID) { vty_out(vty, "Given MNC invalid%s", VTY_NEWLINE); return CMD_WARNING; } @@ -719,11 +719,11 @@ DEFUN(network_select, network_select_cmd, return CMD_WARNING; } - if (!mcc) { + if (mcc == GSM_INPUT_INVALID) { vty_out(vty, "Given MCC invalid%s", VTY_NEWLINE); return CMD_WARNING; } - if (!mnc) { + if (mnc == GSM_INPUT_INVALID) { vty_out(vty, "Given MNC invalid%s", VTY_NEWLINE); return CMD_WARNING; } @@ -877,11 +877,11 @@ DEFUN(delete_forbidden_plmn, delete_forbidden_plmn_cmd, if (!ms) return CMD_WARNING; - if (!mcc) { + if (mcc == GSM_INPUT_INVALID) { vty_out(vty, "Given MCC invalid%s", VTY_NEWLINE); return CMD_WARNING; } - if (!mnc) { + if (mnc == GSM_INPUT_INVALID) { vty_out(vty, "Given MNC invalid%s", VTY_NEWLINE); return CMD_WARNING; } @@ -2410,11 +2410,11 @@ DEFUN(cfg_test_rplmn, cfg_test_rplmn_cmd, "rplmn MCC MNC [LAC] [TMSI]", uint16_t mcc = gsm_input_mcc((char *)argv[0]), mnc = gsm_input_mnc((char *)argv[1]); - if (!mcc) { + if (mcc == GSM_INPUT_INVALID) { vty_out(vty, "Given MCC invalid%s", VTY_NEWLINE); return CMD_WARNING; } - if (!mnc) { + if (mnc == GSM_INPUT_INVALID) { vty_out(vty, "Given MNC invalid%s", VTY_NEWLINE); return CMD_WARNING; } |