diff options
author | Holger Hans Peter Freyther <holger@moiji-mobile.com> | 2014-02-22 10:30:32 +0100 |
---|---|---|
committer | Holger Hans Peter Freyther <holger@moiji-mobile.com> | 2014-02-22 10:36:14 +0100 |
commit | 98258dbbc648f5fe02a62cf3d47b388376125926 (patch) | |
tree | 1df8d34bce205073e0298a422970aaafdd184010 /openbsc/src/osmo-bsc/osmo_bsc_vty.c | |
parent | 7e40be3949f99560d07854ee8d90b11237f92e3b (diff) |
bsc: Add vty command to send location trap through VTY
I have manually tested this by entering the VTY command and
observing the CTRL interface using wireshark.
Ticket: OW#1129
Diffstat (limited to 'openbsc/src/osmo-bsc/osmo_bsc_vty.c')
-rw-r--r-- | openbsc/src/osmo-bsc/osmo_bsc_vty.c | 29 |
1 files changed, 27 insertions, 2 deletions
diff --git a/openbsc/src/osmo-bsc/osmo_bsc_vty.c b/openbsc/src/osmo-bsc/osmo_bsc_vty.c index 4fac8ea56..94a92f1ce 100644 --- a/openbsc/src/osmo-bsc/osmo_bsc_vty.c +++ b/openbsc/src/osmo-bsc/osmo_bsc_vty.c @@ -1,6 +1,6 @@ /* Osmo BSC VTY Configuration */ -/* (C) 2009-2011 by Holger Hans Peter Freyther - * (C) 2009-2011 by On-Waves +/* (C) 2009-2014 by Holger Hans Peter Freyther + * (C) 2009-2014 by On-Waves * All Rights Reserved * * This program is free software; you can redistribute it and/or modify @@ -19,6 +19,7 @@ */ #include <openbsc/gsm_data.h> +#include <openbsc/osmo_bsc.h> #include <openbsc/osmo_msc_data.h> #include <openbsc/vty.h> @@ -670,6 +671,28 @@ DEFUN(show_pos, return CMD_SUCCESS; } +DEFUN(gen_position_trap, + gen_position_trap_cmd, + "generate-location-state-trap <0-255>", + "Generate location state report\n" + "BTS to report\n") +{ + int bts_nr; + struct gsm_bts *bts; + struct gsm_network *net = bsc_gsmnet; + + bts_nr = atoi(argv[0]); + if (bts_nr >= net->num_bts) { + vty_out(vty, "%% can't find BTS '%s'%s", argv[0], + VTY_NEWLINE); + return CMD_WARNING; + } + + bts = gsm_bts_num(net, bts_nr); + bsc_gen_location_state_trap(bts); + return CMD_SUCCESS; +} + int bsc_vty_init_extra(void) { install_element(CONFIG_NODE, &cfg_net_msc_cmd); @@ -718,5 +741,7 @@ int bsc_vty_init_extra(void) install_element_ve(&show_mscs_cmd); install_element_ve(&show_pos_cmd); + install_element(ENABLE_NODE, &gen_position_trap_cmd); + return 0; } |