Holger Hans Peter Freyther | 7942abc | 2010-09-30 00:34:46 +0800 | [diff] [blame] | 1 | /* VTY code for the Cellmgr */ |
| 2 | /* |
Holger Hans Peter Freyther | a310e53 | 2011-01-22 16:34:16 +0100 | [diff] [blame] | 3 | * (C) 2010-2011 by Holger Hans Peter Freyther <zecke@selfish.org> |
| 4 | * (C) 2010-2011 by On-Waves |
Holger Hans Peter Freyther | 7942abc | 2010-09-30 00:34:46 +0800 | [diff] [blame] | 5 | * All Rights Reserved |
| 6 | * |
Holger Hans Peter Freyther | de56c22 | 2011-01-16 17:45:14 +0100 | [diff] [blame] | 7 | * This program is free software: you can redistribute it and/or modify |
| 8 | * it under the terms of the GNU Affero General Public License as published by |
| 9 | * the Free Software Foundation, either version 3 of the License, or |
Holger Hans Peter Freyther | 7942abc | 2010-09-30 00:34:46 +0800 | [diff] [blame] | 10 | * (at your option) any later version. |
| 11 | * |
| 12 | * This program is distributed in the hope that it will be useful, |
| 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
Holger Hans Peter Freyther | de56c22 | 2011-01-16 17:45:14 +0100 | [diff] [blame] | 15 | * GNU Affero General Public License for more details. |
Holger Hans Peter Freyther | 7942abc | 2010-09-30 00:34:46 +0800 | [diff] [blame] | 16 | * |
Holger Hans Peter Freyther | de56c22 | 2011-01-16 17:45:14 +0100 | [diff] [blame] | 17 | * You should have received a copy of the GNU Affero General Public License |
| 18 | * along with this program. If not, see <http://www.gnu.org/licenses/>. |
Holger Hans Peter Freyther | 7942abc | 2010-09-30 00:34:46 +0800 | [diff] [blame] | 19 | * |
| 20 | */ |
| 21 | |
| 22 | #include <bsc_data.h> |
Holger Hans Peter Freyther | 5b2fe8d | 2011-01-22 21:09:53 +0100 | [diff] [blame] | 23 | #include <mtp_pcap.h> |
Holger Hans Peter Freyther | 84ec871 | 2011-02-15 20:01:47 +0100 | [diff] [blame] | 24 | #include <msc_connection.h> |
Holger Hans Peter Freyther | cfe9d71 | 2011-02-17 20:32:09 +0100 | [diff] [blame] | 25 | #include <ss7_application.h> |
Holger Hans Peter Freyther | 7942abc | 2010-09-30 00:34:46 +0800 | [diff] [blame] | 26 | |
| 27 | #include <osmocore/talloc.h> |
Holger Hans Peter Freyther | 0e4e35f | 2010-09-30 03:04:28 +0800 | [diff] [blame] | 28 | #include <osmocore/gsm48.h> |
Holger Hans Peter Freyther | 7942abc | 2010-09-30 00:34:46 +0800 | [diff] [blame] | 29 | |
| 30 | #include <osmocom/vty/command.h> |
Holger Hans Peter Freyther | fca7b12 | 2011-01-22 23:19:44 +0100 | [diff] [blame] | 31 | #include <osmocom/vty/logging.h> |
Holger Hans Peter Freyther | 7942abc | 2010-09-30 00:34:46 +0800 | [diff] [blame] | 32 | #include <osmocom/vty/vty.h> |
| 33 | |
| 34 | #include <unistd.h> |
| 35 | #include <netdb.h> |
| 36 | |
| 37 | #undef PACKAGE_NAME |
| 38 | #undef PACKAGE_VERSION |
| 39 | #undef PACKAGE_BUGREPORT |
| 40 | #undef PACKAGE_TARNAME |
| 41 | #undef PACKAGE_STRING |
| 42 | #include <cellmgr_config.h> |
| 43 | |
Holger Hans Peter Freyther | 2ff47b8 | 2011-02-15 20:25:10 +0100 | [diff] [blame] | 44 | extern struct bsc_data *bsc; |
Holger Hans Peter Freyther | 7942abc | 2010-09-30 00:34:46 +0800 | [diff] [blame] | 45 | |
| 46 | static struct vty_app_info vty_info = { |
| 47 | .name = "Cellmgr-ng", |
| 48 | .version = VERSION, |
| 49 | .go_parent_cb = NULL, |
| 50 | }; |
| 51 | |
| 52 | /* vty code */ |
| 53 | enum cellmgr_node { |
| 54 | CELLMGR_NODE = _LAST_OSMOVTY_NODE, |
| 55 | }; |
| 56 | |
| 57 | static struct cmd_node cell_node = { |
| 58 | CELLMGR_NODE, |
| 59 | "%s(cellmgr)#", |
| 60 | 1, |
| 61 | }; |
| 62 | |
Holger Hans Peter Freyther | 2656e8f | 2010-09-30 00:41:37 +0800 | [diff] [blame] | 63 | static int config_write_cell(struct vty *vty) |
Holger Hans Peter Freyther | 7942abc | 2010-09-30 00:34:46 +0800 | [diff] [blame] | 64 | { |
Holger Hans Peter Freyther | cfe9d71 | 2011-02-17 20:32:09 +0100 | [diff] [blame] | 65 | struct mtp_link_set *set = mtp_link_set_num(bsc, 0); |
Holger Hans Peter Freyther | 84ec871 | 2011-02-15 20:01:47 +0100 | [diff] [blame] | 66 | struct msc_connection *msc = msc_connection_num(bsc, 0); |
Holger Hans Peter Freyther | cfe9d71 | 2011-02-17 20:32:09 +0100 | [diff] [blame] | 67 | struct ss7_application *app = ss7_application_num(bsc, 0); |
Holger Hans Peter Freyther | 84ec871 | 2011-02-15 20:01:47 +0100 | [diff] [blame] | 68 | |
Holger Hans Peter Freyther | 2656e8f | 2010-09-30 00:41:37 +0800 | [diff] [blame] | 69 | vty_out(vty, "cellmgr%s", VTY_NEWLINE); |
Holger Hans Peter Freyther | cfe9d71 | 2011-02-17 20:32:09 +0100 | [diff] [blame] | 70 | vty_out(vty, " mtp dpc %d%s", set->dpc, VTY_NEWLINE); |
| 71 | vty_out(vty, " mtp opc %d%s", set->opc, VTY_NEWLINE); |
| 72 | vty_out(vty, " mtp sccp-opc %d%s", set->sccp_opc, VTY_NEWLINE); |
| 73 | vty_out(vty, " mtp ni %d%s", set->ni, VTY_NEWLINE); |
| 74 | vty_out(vty, " mtp spare %d%s", set->spare, VTY_NEWLINE); |
| 75 | vty_out(vty, " mtp sltm once %d%s", set->sltm_once, VTY_NEWLINE); |
Holger Hans Peter Freyther | 2ff47b8 | 2011-02-15 20:25:10 +0100 | [diff] [blame] | 76 | if (bsc->udp_ip) |
| 77 | vty_out(vty, " udp dest ip %s%s", bsc->udp_ip, VTY_NEWLINE); |
| 78 | vty_out(vty, " udp dest port %d%s", bsc->udp_port, VTY_NEWLINE); |
| 79 | vty_out(vty, " udp src port %d%s", bsc->src_port, VTY_NEWLINE); |
| 80 | vty_out(vty, " udp reset %d%s", bsc->udp_reset_timeout, VTY_NEWLINE); |
| 81 | vty_out(vty, " udp number-links %d%s", bsc->udp_nr_links, VTY_NEWLINE); |
Holger Hans Peter Freyther | cfe9d71 | 2011-02-17 20:32:09 +0100 | [diff] [blame] | 82 | vty_out(vty, " isup pass-through %d%s", app->isup_pass, VTY_NEWLINE); |
Holger Hans Peter Freyther | 2656e8f | 2010-09-30 00:41:37 +0800 | [diff] [blame] | 83 | |
Holger Hans Peter Freyther | 84ec871 | 2011-02-15 20:01:47 +0100 | [diff] [blame] | 84 | if (msc) { |
| 85 | vty_out(vty, " msc ip %s%s", msc->ip, VTY_NEWLINE); |
| 86 | vty_out(vty, " msc ip-dscp %d%s", msc->dscp, VTY_NEWLINE); |
| 87 | vty_out(vty, " msc token %s%s", msc->token, VTY_NEWLINE); |
| 88 | } |
| 89 | |
| 90 | |
Holger Hans Peter Freyther | 7942abc | 2010-09-30 00:34:46 +0800 | [diff] [blame] | 91 | return CMD_SUCCESS; |
| 92 | } |
| 93 | |
| 94 | DEFUN(cfg_cell, cfg_cell_cmd, |
| 95 | "cellmgr", "Configure the Cellmgr") |
| 96 | { |
| 97 | vty->node = CELLMGR_NODE; |
| 98 | return CMD_SUCCESS; |
| 99 | } |
| 100 | |
| 101 | DEFUN(cfg_net_dpc, cfg_net_dpc_cmd, |
| 102 | "mtp dpc DPC_NR", |
| 103 | "Set the DPC to be used.") |
| 104 | { |
Holger Hans Peter Freyther | cfe9d71 | 2011-02-17 20:32:09 +0100 | [diff] [blame] | 105 | struct mtp_link_set *set = mtp_link_set_num(bsc, 0); |
| 106 | set->dpc = atoi(argv[0]); |
Holger Hans Peter Freyther | 7942abc | 2010-09-30 00:34:46 +0800 | [diff] [blame] | 107 | return CMD_SUCCESS; |
| 108 | } |
| 109 | |
| 110 | DEFUN(cfg_net_opc, cfg_net_opc_cmd, |
| 111 | "mtp opc OPC_NR", |
| 112 | "Set the OPC to be used.") |
| 113 | { |
Holger Hans Peter Freyther | cfe9d71 | 2011-02-17 20:32:09 +0100 | [diff] [blame] | 114 | struct mtp_link_set *set = mtp_link_set_num(bsc, 0); |
| 115 | set->opc = atoi(argv[0]); |
Holger Hans Peter Freyther | 7942abc | 2010-09-30 00:34:46 +0800 | [diff] [blame] | 116 | return CMD_SUCCESS; |
| 117 | } |
| 118 | |
Holger Hans Peter Freyther | 7a72556 | 2011-01-01 13:34:58 +0100 | [diff] [blame] | 119 | DEFUN(cfg_net_sccp_opc, cfg_net_sccp_opc_cmd, |
| 120 | "mtp sccp-opc OPC_NR", |
| 121 | "Set the SCCP OPC to be used.") |
| 122 | { |
Holger Hans Peter Freyther | cfe9d71 | 2011-02-17 20:32:09 +0100 | [diff] [blame] | 123 | struct mtp_link_set *set = mtp_link_set_num(bsc, 0); |
| 124 | set->sccp_opc = atoi(argv[0]); |
Holger Hans Peter Freyther | 7a72556 | 2011-01-01 13:34:58 +0100 | [diff] [blame] | 125 | return CMD_SUCCESS; |
| 126 | } |
| 127 | |
Holger Hans Peter Freyther | b38b33b | 2010-11-26 21:21:04 +0100 | [diff] [blame] | 128 | DEFUN(cfg_net_mtp_ni, cfg_net_mtp_ni_cmd, |
| 129 | "mtp ni NR", |
| 130 | "Set the MTP NI to be used.\n" "NR") |
| 131 | { |
Holger Hans Peter Freyther | cfe9d71 | 2011-02-17 20:32:09 +0100 | [diff] [blame] | 132 | struct mtp_link_set *set = mtp_link_set_num(bsc, 0); |
| 133 | set->ni = atoi(argv[0]); |
Holger Hans Peter Freyther | b38b33b | 2010-11-26 21:21:04 +0100 | [diff] [blame] | 134 | return CMD_SUCCESS; |
| 135 | } |
| 136 | |
| 137 | DEFUN(cfg_net_mtp_spare, cfg_net_mtp_spare_cmd, |
| 138 | "mtp spare NR", |
| 139 | "Set the MTP Spare to be used.\n" "NR") |
| 140 | { |
Holger Hans Peter Freyther | cfe9d71 | 2011-02-17 20:32:09 +0100 | [diff] [blame] | 141 | struct mtp_link_set *set = mtp_link_set_num(bsc, 0); |
| 142 | set->spare = atoi(argv[0]); |
Holger Hans Peter Freyther | b38b33b | 2010-11-26 21:21:04 +0100 | [diff] [blame] | 143 | return CMD_SUCCESS; |
| 144 | } |
| 145 | |
| 146 | |
Holger Hans Peter Freyther | 7942abc | 2010-09-30 00:34:46 +0800 | [diff] [blame] | 147 | DEFUN(cfg_udp_dst_ip, cfg_udp_dst_ip_cmd, |
| 148 | "udp dest ip IP", |
| 149 | "Set the IP when UDP mode is supposed to be used.") |
| 150 | { |
| 151 | struct hostent *hosts; |
| 152 | struct in_addr *addr; |
| 153 | |
| 154 | hosts = gethostbyname(argv[0]); |
| 155 | if (!hosts || hosts->h_length < 1 || hosts->h_addrtype != AF_INET) { |
| 156 | vty_out(vty, "Failed to resolve '%s'%s", argv[0], VTY_NEWLINE); |
| 157 | return CMD_WARNING; |
| 158 | } |
| 159 | |
| 160 | addr = (struct in_addr *) hosts->h_addr_list[0]; |
Holger Hans Peter Freyther | 2ff47b8 | 2011-02-15 20:25:10 +0100 | [diff] [blame] | 161 | bsc->udp_ip = talloc_strdup(NULL, inet_ntoa(*addr)); |
Holger Hans Peter Freyther | 7942abc | 2010-09-30 00:34:46 +0800 | [diff] [blame] | 162 | return CMD_SUCCESS; |
| 163 | } |
| 164 | |
| 165 | DEFUN(cfg_udp_dst_port, cfg_udp_dst_port_cmd, |
| 166 | "udp dest port PORT_NR", |
| 167 | "If UDP mode is used specify the UDP dest port") |
| 168 | { |
Holger Hans Peter Freyther | 2ff47b8 | 2011-02-15 20:25:10 +0100 | [diff] [blame] | 169 | bsc->udp_port = atoi(argv[0]); |
Holger Hans Peter Freyther | 7942abc | 2010-09-30 00:34:46 +0800 | [diff] [blame] | 170 | return CMD_SUCCESS; |
| 171 | } |
| 172 | |
| 173 | DEFUN(cfg_udp_src_port, cfg_udp_src_port_cmd, |
| 174 | "udp src port PORT_NR", |
| 175 | "Set the UDP source port to be used.") |
| 176 | { |
Holger Hans Peter Freyther | 2ff47b8 | 2011-02-15 20:25:10 +0100 | [diff] [blame] | 177 | bsc->src_port = atoi(argv[0]); |
Holger Hans Peter Freyther | 7942abc | 2010-09-30 00:34:46 +0800 | [diff] [blame] | 178 | return CMD_SUCCESS; |
| 179 | } |
| 180 | |
| 181 | DEFUN(cfg_udp_reset, cfg_udp_reset_cmd, |
| 182 | "udp reset TIMEOUT", |
| 183 | "Set the timeout to take the link down") |
| 184 | { |
Holger Hans Peter Freyther | 2ff47b8 | 2011-02-15 20:25:10 +0100 | [diff] [blame] | 185 | bsc->udp_reset_timeout = atoi(argv[0]); |
Holger Hans Peter Freyther | 7942abc | 2010-09-30 00:34:46 +0800 | [diff] [blame] | 186 | return CMD_SUCCESS; |
| 187 | } |
| 188 | |
Holger Hans Peter Freyther | c6bfa27 | 2011-01-22 17:06:34 +0100 | [diff] [blame] | 189 | DEFUN(cfg_udp_nr_links, cfg_udp_nr_links_cmd, |
| 190 | "udp number-links <1-32>", |
| 191 | "Set the number of links to use\n") |
| 192 | { |
Holger Hans Peter Freyther | 2ff47b8 | 2011-02-15 20:25:10 +0100 | [diff] [blame] | 193 | bsc->udp_nr_links = atoi(argv[0]); |
Holger Hans Peter Freyther | c6bfa27 | 2011-01-22 17:06:34 +0100 | [diff] [blame] | 194 | return CMD_SUCCESS; |
| 195 | } |
| 196 | |
Holger Hans Peter Freyther | 7942abc | 2010-09-30 00:34:46 +0800 | [diff] [blame] | 197 | DEFUN(cfg_sltm_once, cfg_sltm_once_cmd, |
| 198 | "mtp sltm once (0|1)", |
| 199 | "Send SLTMs until the link is established.") |
| 200 | { |
Holger Hans Peter Freyther | cfe9d71 | 2011-02-17 20:32:09 +0100 | [diff] [blame] | 201 | struct mtp_link_set *set = mtp_link_set_num(bsc, 0); |
| 202 | set->sltm_once = !!atoi(argv[0]); |
Holger Hans Peter Freyther | 7942abc | 2010-09-30 00:34:46 +0800 | [diff] [blame] | 203 | return CMD_SUCCESS; |
| 204 | } |
| 205 | |
| 206 | DEFUN(cfg_msc_ip, cfg_msc_ip_cmd, |
| 207 | "msc ip IP", |
| 208 | "Set the MSC IP") |
| 209 | { |
| 210 | struct hostent *hosts; |
| 211 | struct in_addr *addr; |
Holger Hans Peter Freyther | 84ec871 | 2011-02-15 20:01:47 +0100 | [diff] [blame] | 212 | struct msc_connection *msc = msc_connection_num(bsc, 0); |
| 213 | |
| 214 | if (!msc) { |
| 215 | vty_out(vty, "%%No MSC Connection defined in this app.%s", VTY_NEWLINE); |
| 216 | return CMD_WARNING; |
| 217 | } |
Holger Hans Peter Freyther | 7942abc | 2010-09-30 00:34:46 +0800 | [diff] [blame] | 218 | |
| 219 | hosts = gethostbyname(argv[0]); |
| 220 | if (!hosts || hosts->h_length < 1 || hosts->h_addrtype != AF_INET) { |
| 221 | vty_out(vty, "Failed to resolve '%s'%s", argv[0], VTY_NEWLINE); |
| 222 | return CMD_WARNING; |
| 223 | } |
| 224 | |
| 225 | addr = (struct in_addr *) hosts->h_addr_list[0]; |
| 226 | |
Holger Hans Peter Freyther | 84ec871 | 2011-02-15 20:01:47 +0100 | [diff] [blame] | 227 | if (msc->ip) |
| 228 | talloc_free(msc->ip); |
| 229 | msc->ip = talloc_strdup(msc, inet_ntoa(*addr)); |
Holger Hans Peter Freyther | 7942abc | 2010-09-30 00:34:46 +0800 | [diff] [blame] | 230 | return CMD_SUCCESS; |
| 231 | } |
| 232 | |
| 233 | DEFUN(cfg_msc_ip_dscp, cfg_msc_ip_dscp_cmd, |
| 234 | "msc ip-dscp <0-255>", |
| 235 | "Set the IP DSCP on the A-link\n" |
| 236 | "Set the DSCP in IP packets to the MSC") |
| 237 | { |
Holger Hans Peter Freyther | 84ec871 | 2011-02-15 20:01:47 +0100 | [diff] [blame] | 238 | struct msc_connection *msc = msc_connection_num(bsc, 0); |
| 239 | |
| 240 | if (!msc) { |
| 241 | vty_out(vty, "%%No MSC Connection defined in this app.%s", VTY_NEWLINE); |
| 242 | return CMD_WARNING; |
| 243 | } |
| 244 | |
| 245 | msc->dscp = atoi(argv[0]); |
Holger Hans Peter Freyther | 7942abc | 2010-09-30 00:34:46 +0800 | [diff] [blame] | 246 | return CMD_SUCCESS; |
| 247 | } |
| 248 | |
| 249 | ALIAS_DEPRECATED(cfg_msc_ip_dscp, cfg_msc_ip_tos_cmd, |
| 250 | "msc ip-tos <0-255>", |
| 251 | "Set the IP DSCP on the A-link\n" |
| 252 | "Set the DSCP in IP packets to the MSC") |
| 253 | |
| 254 | DEFUN(cfg_msc_token, cfg_msc_token_cmd, |
| 255 | "msc token TOKEN", |
| 256 | "Set the Token to be used for the MSC") |
| 257 | { |
Holger Hans Peter Freyther | 84ec871 | 2011-02-15 20:01:47 +0100 | [diff] [blame] | 258 | struct msc_connection *msc = msc_connection_num(bsc, 0); |
| 259 | |
| 260 | if (!msc) { |
| 261 | vty_out(vty, "%%No MSC Connection defined in this app.%s", VTY_NEWLINE); |
| 262 | return CMD_WARNING; |
| 263 | } |
| 264 | |
| 265 | if (msc->token) |
| 266 | talloc_free(msc->token); |
| 267 | msc->token = talloc_strdup(msc, argv[0]); |
Holger Hans Peter Freyther | 7942abc | 2010-09-30 00:34:46 +0800 | [diff] [blame] | 268 | return CMD_SUCCESS; |
| 269 | } |
| 270 | |
| 271 | DEFUN(cfg_ping_time, cfg_ping_time_cmd, |
| 272 | "timeout ping NR", |
| 273 | "Set the PING interval. Negative to disable it") |
| 274 | { |
Holger Hans Peter Freyther | 84ec871 | 2011-02-15 20:01:47 +0100 | [diff] [blame] | 275 | struct msc_connection *msc = msc_connection_num(bsc, 0); |
| 276 | |
| 277 | if (!msc) { |
| 278 | vty_out(vty, "%%No MSC Connection defined in this app.%s", VTY_NEWLINE); |
| 279 | return CMD_WARNING; |
| 280 | } |
| 281 | |
| 282 | msc->ping_time = atoi(argv[0]); |
Holger Hans Peter Freyther | 7942abc | 2010-09-30 00:34:46 +0800 | [diff] [blame] | 283 | return CMD_SUCCESS; |
| 284 | } |
| 285 | |
| 286 | DEFUN(cfg_pong_time, cfg_pong_time_cmd, |
| 287 | "timeout pong NR", |
| 288 | "Set the PING interval. Negative to disable it") |
| 289 | { |
Holger Hans Peter Freyther | 84ec871 | 2011-02-15 20:01:47 +0100 | [diff] [blame] | 290 | struct msc_connection *msc = msc_connection_num(bsc, 0); |
| 291 | |
| 292 | if (!msc) { |
| 293 | vty_out(vty, "%%No MSC Connection defined in this app.%s", VTY_NEWLINE); |
| 294 | return CMD_WARNING; |
| 295 | } |
| 296 | |
| 297 | msc->pong_time = atoi(argv[0]); |
Holger Hans Peter Freyther | 7942abc | 2010-09-30 00:34:46 +0800 | [diff] [blame] | 298 | return CMD_SUCCESS; |
| 299 | } |
| 300 | |
| 301 | DEFUN(cfg_msc_time, cfg_msc_time_cmd, |
| 302 | "timeout msc NR", |
| 303 | "Set the MSC connect timeout") |
| 304 | { |
Holger Hans Peter Freyther | 84ec871 | 2011-02-15 20:01:47 +0100 | [diff] [blame] | 305 | struct msc_connection *msc = msc_connection_num(bsc, 0); |
| 306 | |
| 307 | if (!msc) { |
| 308 | vty_out(vty, "%%No MSC Connection defined in this app.%s", VTY_NEWLINE); |
| 309 | return CMD_WARNING; |
| 310 | } |
| 311 | |
| 312 | msc->msc_time = atoi(argv[0]); |
Holger Hans Peter Freyther | 7942abc | 2010-09-30 00:34:46 +0800 | [diff] [blame] | 313 | return CMD_SUCCESS; |
| 314 | } |
| 315 | |
Holger Hans Peter Freyther | f603f28 | 2011-01-30 00:24:15 +0100 | [diff] [blame] | 316 | DEFUN(cfg_isup_pass, cfg_isup_pass_cmd, |
| 317 | "isup pass-through (0|1)", |
| 318 | "ISUP related functionality\n" |
| 319 | "Pass through all ISUP messages directly\n" |
| 320 | "Handle some messages locally\n" "Pass through everything\n") |
| 321 | { |
Holger Hans Peter Freyther | cfe9d71 | 2011-02-17 20:32:09 +0100 | [diff] [blame] | 322 | struct ss7_application *app = ss7_application_num(bsc, 0); |
| 323 | ss7_application_pass_isup(app, atoi(argv[0])); |
Holger Hans Peter Freyther | f603f28 | 2011-01-30 00:24:15 +0100 | [diff] [blame] | 324 | |
| 325 | return CMD_SUCCESS; |
| 326 | } |
| 327 | |
Holger Hans Peter Freyther | 2917644 | 2011-02-22 16:00:36 +0100 | [diff] [blame^] | 328 | extern void cell_vty_init_cmds(void); |
Holger Hans Peter Freyther | 7942abc | 2010-09-30 00:34:46 +0800 | [diff] [blame] | 329 | void cell_vty_init(void) |
| 330 | { |
| 331 | cmd_init(1); |
| 332 | vty_init(&vty_info); |
Holger Hans Peter Freyther | fca7b12 | 2011-01-22 23:19:44 +0100 | [diff] [blame] | 333 | logging_vty_add_cmds(); |
Holger Hans Peter Freyther | 7942abc | 2010-09-30 00:34:46 +0800 | [diff] [blame] | 334 | |
| 335 | install_element(CONFIG_NODE, &cfg_cell_cmd); |
| 336 | install_node(&cell_node, config_write_cell); |
| 337 | |
| 338 | install_element(CELLMGR_NODE, &cfg_net_dpc_cmd); |
| 339 | install_element(CELLMGR_NODE, &cfg_net_opc_cmd); |
Holger Hans Peter Freyther | 7a72556 | 2011-01-01 13:34:58 +0100 | [diff] [blame] | 340 | install_element(CELLMGR_NODE, &cfg_net_sccp_opc_cmd); |
Holger Hans Peter Freyther | b38b33b | 2010-11-26 21:21:04 +0100 | [diff] [blame] | 341 | install_element(CELLMGR_NODE, &cfg_net_mtp_ni_cmd); |
| 342 | install_element(CELLMGR_NODE, &cfg_net_mtp_spare_cmd); |
Holger Hans Peter Freyther | 7942abc | 2010-09-30 00:34:46 +0800 | [diff] [blame] | 343 | install_element(CELLMGR_NODE, &cfg_udp_dst_ip_cmd); |
| 344 | install_element(CELLMGR_NODE, &cfg_udp_dst_port_cmd); |
| 345 | install_element(CELLMGR_NODE, &cfg_udp_src_port_cmd); |
| 346 | install_element(CELLMGR_NODE, &cfg_udp_reset_cmd); |
Holger Hans Peter Freyther | c6bfa27 | 2011-01-22 17:06:34 +0100 | [diff] [blame] | 347 | install_element(CELLMGR_NODE, &cfg_udp_nr_links_cmd); |
Holger Hans Peter Freyther | 7942abc | 2010-09-30 00:34:46 +0800 | [diff] [blame] | 348 | install_element(CELLMGR_NODE, &cfg_sltm_once_cmd); |
| 349 | install_element(CELLMGR_NODE, &cfg_msc_ip_cmd); |
| 350 | install_element(CELLMGR_NODE, &cfg_msc_token_cmd); |
| 351 | install_element(CELLMGR_NODE, &cfg_msc_ip_dscp_cmd); |
| 352 | install_element(CELLMGR_NODE, &cfg_msc_ip_tos_cmd); |
| 353 | install_element(CELLMGR_NODE, &cfg_ping_time_cmd); |
| 354 | install_element(CELLMGR_NODE, &cfg_pong_time_cmd); |
| 355 | install_element(CELLMGR_NODE, &cfg_msc_time_cmd); |
Holger Hans Peter Freyther | f603f28 | 2011-01-30 00:24:15 +0100 | [diff] [blame] | 356 | install_element(CELLMGR_NODE, &cfg_isup_pass_cmd); |
Holger Hans Peter Freyther | 51b9e7a | 2011-01-22 16:02:13 +0100 | [diff] [blame] | 357 | |
Holger Hans Peter Freyther | 2917644 | 2011-02-22 16:00:36 +0100 | [diff] [blame^] | 358 | cell_vty_init_cmds(); |
Holger Hans Peter Freyther | 7942abc | 2010-09-30 00:34:46 +0800 | [diff] [blame] | 359 | } |
| 360 | |
| 361 | const char *openbsc_copyright = ""; |