blob: ab9089717499c125eac24714aab90d293905afcc [file] [log] [blame]
Holger Hans Peter Freyther71760302011-02-22 20:57:08 +01001/* VTY code for the osmo-stp */
Holger Hans Peter Freyther7942abc2010-09-30 00:34:46 +08002/*
Holger Hans Peter Freyther4db78de2013-05-13 21:08:36 +02003 * (C) 2010-2013 by Holger Hans Peter Freyther <zecke@selfish.org>
4 * (C) 2010-2013 by On-Waves
Holger Hans Peter Freyther7942abc2010-09-30 00:34:46 +08005 * All Rights Reserved
6 *
Holger Hans Peter Freytherde56c222011-01-16 17:45:14 +01007 * 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 Freyther7942abc2010-09-30 00:34:46 +080010 * (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 Freytherde56c222011-01-16 17:45:14 +010015 * GNU Affero General Public License for more details.
Holger Hans Peter Freyther7942abc2010-09-30 00:34:46 +080016 *
Holger Hans Peter Freytherde56c222011-01-16 17:45:14 +010017 * 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 Freyther7942abc2010-09-30 00:34:46 +080019 *
20 */
21
22#include <bsc_data.h>
Holger Hans Peter Freyther5b2fe8d2011-01-22 21:09:53 +010023#include <mtp_pcap.h>
Holger Hans Peter Freyther84ec8712011-02-15 20:01:47 +010024#include <msc_connection.h>
Holger Hans Peter Freyther71760302011-02-22 20:57:08 +010025#include <sctp_m2ua.h>
Holger Hans Peter Freytherd2f21e02015-03-23 16:19:37 +010026#include <sctp_m3ua.h>
Holger Hans Peter Freythercfe9d712011-02-17 20:32:09 +010027#include <ss7_application.h>
Holger Hans Peter Freyther71760302011-02-22 20:57:08 +010028#include <ss7_vty.h>
29#include <cellmgr_debug.h>
30#include <snmp_mtp.h>
Holger Hans Peter Freyther7942abc2010-09-30 00:34:46 +080031
Harald Welteff397ed2011-05-08 10:29:23 +020032#include <osmocom/core/talloc.h>
33#include <osmocom/gsm/gsm48.h>
Holger Hans Peter Freyther7942abc2010-09-30 00:34:46 +080034
35#include <osmocom/vty/command.h>
Holger Hans Peter Freytherfca7b122011-01-22 23:19:44 +010036#include <osmocom/vty/logging.h>
Holger Hans Peter Freyther7942abc2010-09-30 00:34:46 +080037#include <osmocom/vty/vty.h>
38
39#include <unistd.h>
40#include <netdb.h>
41
42#undef PACKAGE_NAME
43#undef PACKAGE_VERSION
44#undef PACKAGE_BUGREPORT
45#undef PACKAGE_TARNAME
46#undef PACKAGE_STRING
47#include <cellmgr_config.h>
48
Holger Hans Peter Freyther2ff47b82011-02-15 20:25:10 +010049extern struct bsc_data *bsc;
Holger Hans Peter Freyther7942abc2010-09-30 00:34:46 +080050
Holger Hans Peter Freythere0b626a2016-08-14 08:10:53 +020051static int ss7_go_parent(struct vty *vty)
Holger Hans Peter Freyther71760302011-02-22 20:57:08 +010052{
53 switch (vty->node) {
54 case LINK_NODE:
55 vty->node = LINKSETS_NODE;
56 {
57 struct mtp_link *lnk = vty->index;
58 vty->index = lnk->set;
59 vty->index_sub = &lnk->set->name;
60 }
61 break;
62 case MSC_NODE:
63 case APP_NODE:
64 case LINKSETS_NODE:
65 vty->node = SS7_NODE;
66 vty->index = NULL;
67 vty->index_sub = NULL;
68 break;
69 case SS7_NODE:
70 default:
71 vty->node = CONFIG_NODE;
72 vty->index = NULL;
73 vty->index_sub = NULL;
74 break;
75 }
76
77 return vty->node;
78}
79
Holger Hans Peter Freyther7942abc2010-09-30 00:34:46 +080080static struct vty_app_info vty_info = {
Holger Hans Peter Freyther368e5492016-08-15 11:54:24 +020081 .name = "OsmoSTP",
Holger Hans Peter Freyther7942abc2010-09-30 00:34:46 +080082 .version = VERSION,
Holger Hans Peter Freyther71760302011-02-22 20:57:08 +010083 .go_parent_cb = ss7_go_parent,
Holger Hans Peter Freyther7942abc2010-09-30 00:34:46 +080084};
85
86/* vty code */
Holger Hans Peter Freyther7942abc2010-09-30 00:34:46 +080087
Holger Hans Peter Freyther71760302011-02-22 20:57:08 +010088static struct cmd_node ss7_node = {
89 SS7_NODE,
90 "%s(ss7)#",
Holger Hans Peter Freyther7942abc2010-09-30 00:34:46 +080091 1,
92};
93
Holger Hans Peter Freyther71760302011-02-22 20:57:08 +010094static struct cmd_node linkset_node = {
95 LINKSETS_NODE,
96 "%s(linkset)#",
97 1,
98};
99
100static struct cmd_node link_node = {
101 LINK_NODE,
102 "%s(link)#",
103 1,
104};
105
106static struct cmd_node msc_node = {
107 MSC_NODE,
108 "%s(msc)#",
109 1,
110};
111
112static struct cmd_node app_node = {
113 APP_NODE,
114 "%s(application)#",
115 1,
116};
117
118static int dummy_write(struct vty *vty)
Holger Hans Peter Freyther7942abc2010-09-30 00:34:46 +0800119{
Holger Hans Peter Freyther71760302011-02-22 20:57:08 +0100120 return CMD_SUCCESS;
121}
Holger Hans Peter Freyther84ec8712011-02-15 20:01:47 +0100122
Holger Hans Peter Freyther71760302011-02-22 20:57:08 +0100123static int config_write_ss7(struct vty *vty)
124{
125 vty_out(vty, "ss7%s", VTY_NEWLINE);
126 vty_out(vty, " udp src-port %d%s", bsc->udp_src_port, VTY_NEWLINE);
127 vty_out(vty, " m2ua src-port %d%s", bsc->m2ua_src_port, VTY_NEWLINE);
128 return CMD_SUCCESS;
129}
Holger Hans Peter Freyther2656e8f2010-09-30 00:41:37 +0800130
Holger Hans Peter Freyther71760302011-02-22 20:57:08 +0100131static void write_link(struct vty *vty, struct mtp_link *link)
132{
Holger Hans Peter Freyther71760302011-02-22 20:57:08 +0100133 struct mtp_udp_link *ulnk;
134 struct mtp_m2ua_link *m2ua;
Holger Hans Peter Freytherd2f21e02015-03-23 16:19:37 +0100135 struct mtp_m3ua_client_link *m3ua_client;
Holger Hans Peter Freyther71760302011-02-22 20:57:08 +0100136
137 vty_out(vty, " link %d%s", link->nr, VTY_NEWLINE);
Holger Hans Peter Freyther368e5492016-08-15 11:54:24 +0200138 if (link->name && strlen(link->name) > 0)
139 vty_out(vty, " description %s%s", link->name, VTY_NEWLINE);
Holger Hans Peter Freyther71760302011-02-22 20:57:08 +0100140
141 switch (link->type) {
142 case SS7_LTYPE_UDP:
143 ulnk = (struct mtp_udp_link *) link->data;
144 vty_out(vty, " ss7-transport udp%s", VTY_NEWLINE);
145 vty_out(vty, " udp dest ip %s%s",
146 inet_ntoa(ulnk->remote.sin_addr), VTY_NEWLINE);
147 vty_out(vty, " udp dest port %d%s",
148 ntohs(ulnk->remote.sin_port), VTY_NEWLINE);
149 vty_out(vty, " udp reset-timeout %d%s",
150 ulnk->reset_timeout, VTY_NEWLINE);
151 vty_out(vty, " udp link-index %d%s",
152 ulnk->link_index, VTY_NEWLINE);
153 break;
154 case SS7_LTYPE_M2UA:
155 m2ua = (struct mtp_m2ua_link *) link->data;
156 vty_out(vty, " ss7-transport m2ua%s", VTY_NEWLINE);
157
158 if (m2ua->as)
Holger Hans Peter Freytherd2f21e02015-03-23 16:19:37 +0100159 vty_out(vty, " m2ua application-server-index %s%s",
Holger Hans Peter Freyther71760302011-02-22 20:57:08 +0100160 m2ua->as, VTY_NEWLINE);
161 vty_out(vty, " m2ua link-index %d%s",
162 m2ua->link_index, VTY_NEWLINE);
163 break;
Holger Hans Peter Freytherd2f21e02015-03-23 16:19:37 +0100164 case SS7_LTYPE_M3UA_CLIENT:
165 m3ua_client = (struct mtp_m3ua_client_link *) link->data;
166 vty_out(vty, " ss7-transport m3ua-client%s", VTY_NEWLINE);
167 vty_out(vty, " m3ua-client source ip %s%s",
168 inet_ntoa(m3ua_client->local.sin_addr), VTY_NEWLINE);
169 vty_out(vty, " m3ua-client source port %d%s",
170 ntohs(m3ua_client->local.sin_port), VTY_NEWLINE);
171 vty_out(vty, " m3ua-client dest ip %s%s",
172 inet_ntoa(m3ua_client->remote.sin_addr), VTY_NEWLINE);
173 vty_out(vty, " m3ua-client dest port %d%s",
174 ntohs(m3ua_client->remote.sin_port), VTY_NEWLINE);
175 vty_out(vty, " m3ua-client link-index %d%s",
176 m3ua_client->link_index, VTY_NEWLINE);
177 vty_out(vty, " m3ua-client routing-context %d%s",
178 m3ua_client->routing_context, VTY_NEWLINE);
Holger Hans Peter Freyther6a441c82015-04-16 22:31:41 +0200179 vty_out(vty, " m3ua-client traffic-mode %s%s",
180 m3ua_traffic_mode_name(m3ua_client->traffic_mode),
181 VTY_NEWLINE);
Holger Hans Peter Freythera41c9922015-10-09 14:48:05 +0200182 vty_out(vty, " m3ua-client link-up-timeout %d%s",
183 m3ua_client->aspac_ack_timeout, VTY_NEWLINE);
Holger Hans Peter Freytherd2f21e02015-03-23 16:19:37 +0100184 break;
Holger Hans Peter Freyther71760302011-02-22 20:57:08 +0100185 case SS7_LTYPE_NONE:
186 break;
187 }
188}
189
190static void write_linkset(struct vty *vty, struct mtp_link_set *set)
191{
Holger Hans Peter Freyther71760302011-02-22 20:57:08 +0100192 struct mtp_link *link;
193 int i;
194
195 vty_out(vty, " linkset %d%s", set->nr, VTY_NEWLINE);
Holger Hans Peter Freyther368e5492016-08-15 11:54:24 +0200196 if (set->name && strlen(set->name) > 0)
197 vty_out(vty, " description %s%s", set->name, VTY_NEWLINE);
Holger Hans Peter Freyther71760302011-02-22 20:57:08 +0100198 vty_out(vty, " mtp3 dpc %d%s", set->dpc, VTY_NEWLINE);
199 vty_out(vty, " mtp3 opc %d%s", set->opc, VTY_NEWLINE);
200 vty_out(vty, " mtp3 ni %d%s", set->ni, VTY_NEWLINE);
201 vty_out(vty, " mtp3 spare %d%s", set->spare, VTY_NEWLINE);
202 vty_out(vty, " mtp3 sltm-once %d%s", set->sltm_once, VTY_NEWLINE);
Holger Hans Peter Freyther47c9faa2011-02-23 11:25:45 +0100203 vty_out(vty, " mtp3 timeout t18 %d%s",
204 set->timeout_t18, VTY_NEWLINE);
205 vty_out(vty, " mtp3 timeout t20 %d%s",
206 set->timeout_t20, VTY_NEWLINE);
Holger Hans Peter Freyther60bc8e72012-01-16 11:51:18 +0100207 if (set->sccp_dpc != -1)
208 vty_out(vty, " mtp3 sccp dpc %d%s", set->sccp_dpc, VTY_NEWLINE);
209 if (set->sccp_opc != -1)
210 vty_out(vty, " mtp3 sccp opc %d%s", set->sccp_opc, VTY_NEWLINE);
211 if (set->isup_dpc != -1)
212 vty_out(vty, " mtp3 isup dpc %d%s", set->isup_dpc, VTY_NEWLINE);
213 if (set->isup_opc != -1)
214 vty_out(vty, " mtp3 isup opc %d%s", set->isup_opc, VTY_NEWLINE);
Holger Hans Peter Freyther71760302011-02-22 20:57:08 +0100215
216 for (i = 0; i < ARRAY_SIZE(set->supported_ssn); ++i) {
217 if (!set->supported_ssn[i])
218 continue;
219 vty_out(vty, " mtp3 ssn %d%s", i, VTY_NEWLINE);
Holger Hans Peter Freyther84ec8712011-02-15 20:01:47 +0100220 }
221
Holger Hans Peter Freyther71760302011-02-22 20:57:08 +0100222 llist_for_each_entry(link, &set->links, entry)
223 write_link(vty, link);
224}
225
226static int config_write_linkset(struct vty *vty)
227{
228 struct mtp_link_set *set;
229
230 llist_for_each_entry(set, &bsc->linksets, entry)
231 write_linkset(vty, set);
Holger Hans Peter Freyther84ec8712011-02-15 20:01:47 +0100232
Holger Hans Peter Freyther7942abc2010-09-30 00:34:46 +0800233 return CMD_SUCCESS;
234}
235
Holger Hans Peter Freyther71760302011-02-22 20:57:08 +0100236static void write_msc(struct vty *vty, struct msc_connection *msc)
Holger Hans Peter Freyther7942abc2010-09-30 00:34:46 +0800237{
Holger Hans Peter Freyther71760302011-02-22 20:57:08 +0100238
239 vty_out(vty, " msc %d%s", msc->nr, VTY_NEWLINE);
Holger Hans Peter Freyther368e5492016-08-15 11:54:24 +0200240 if (msc->name && strlen(msc->name) > 0)
241 vty_out(vty, " description %s%s", msc->name, VTY_NEWLINE);
Holger Hans Peter Freythera5a17fa2013-03-19 22:29:41 +0100242 vty_out(vty, " mode %s%s", msc_mode(msc), VTY_NEWLINE);
Holger Hans Peter Freytherc5950d72015-04-21 13:08:35 -0400243 if (msc->ip)
244 vty_out(vty, " ip %s%s", msc->ip, VTY_NEWLINE);
Holger Hans Peter Freythera5a17fa2013-03-19 22:29:41 +0100245 vty_out(vty, " port %d%s", msc->port, VTY_NEWLINE);
Holger Hans Peter Freyther71760302011-02-22 20:57:08 +0100246 vty_out(vty, " token %s%s", msc->token, VTY_NEWLINE);
247 vty_out(vty, " dscp %d%s", msc->dscp, VTY_NEWLINE);
Holger Hans Peter Freyther368e5492016-08-15 11:54:24 +0200248 if (msc->ping_time > 0) {
249 vty_out(vty, " timeout ping %d%s", msc->ping_time, VTY_NEWLINE);
250 vty_out(vty, " timeout pong %d%s", msc->pong_time, VTY_NEWLINE);
251 }
Holger Hans Peter Freyther71760302011-02-22 20:57:08 +0100252 vty_out(vty, " timeout restart %d%s", msc->msc_time, VTY_NEWLINE);
253}
254
255static int config_write_msc(struct vty *vty)
256{
257 struct msc_connection *msc;
258
259 llist_for_each_entry(msc, &bsc->mscs, entry)
260 write_msc(vty, msc);
261 return 0;
262}
263
264static const char *app_type(enum ss7_app_type type)
265{
266 switch (type) {
267 case APP_NONE:
268 return "none";
269 case APP_CELLMGR:
270 return "msc";
271 case APP_RELAY:
272 return "relay";
273 case APP_STP:
274 return "stp";
275 default:
276 LOGP(DINP, LOGL_ERROR, "Should no be reached.\n");
277 return "";
278 }
279}
280
281static const char *link_type(enum ss7_set_type type)
282{
283 switch (type) {
284 case SS7_SET_LINKSET:
285 return "linkset";
286 case SS7_SET_MSC:
287 return "msc";
288 default:
289 LOGP(DINP, LOGL_ERROR, "Should no be reached.\n");
290 return "";
291 }
292}
293
294static void write_application(struct vty *vty, struct ss7_application *app)
295{
Holger Hans Peter Freyther71760302011-02-22 20:57:08 +0100296 vty_out(vty, " application %d%s", app->nr, VTY_NEWLINE);
Holger Hans Peter Freyther368e5492016-08-15 11:54:24 +0200297 if (app->name && strlen(app->name) > 0)
298 vty_out(vty, " description %s%s", app->name, VTY_NEWLINE);
Holger Hans Peter Freyther71760302011-02-22 20:57:08 +0100299 vty_out(vty, " type %s%s", app_type(app->type), VTY_NEWLINE);
300
Holger Hans Peter Freyther4db78de2013-05-13 21:08:36 +0200301 if (app->fixed_ass_cmpl_reply)
302 vty_out(vty, " hardcode-assignment-complete%s", VTY_NEWLINE);
303
Holger Hans Peter Freytherb35c5c32012-12-11 15:32:09 +0100304 if (app->type == APP_STP) {
Holger Hans Peter Freyther71760302011-02-22 20:57:08 +0100305 vty_out(vty, " isup-pass-through %d%s", app->isup_pass, VTY_NEWLINE);
Holger Hans Peter Freythere8334782012-12-11 14:19:03 +0100306 if (app->trunk_name)
307 vty_out(vty, " trunk-name %s%s",
308 app->trunk_name, VTY_NEWLINE);
Holger Hans Peter Freytherb35c5c32012-12-11 15:32:09 +0100309 }
Holger Hans Peter Freyther71760302011-02-22 20:57:08 +0100310
Holger Hans Peter Freytherfc98ce22011-09-13 20:08:57 +0200311 if (app->type == APP_CELLMGR && app->mgcp_domain_name) {
312 vty_out(vty, " domain-name %s%s",
313 app->mgcp_domain_name, VTY_NEWLINE);
314 }
315
Holger Hans Peter Freyther71760302011-02-22 20:57:08 +0100316 if (app->route_is_set) {
317 vty_out(vty, " route %s %d %s %d%s",
318 link_type(app->route_src.type), app->route_src.nr,
319 link_type(app->route_dst.type), app->route_dst.nr,
320 VTY_NEWLINE);
321 }
Holger Hans Peter Freythere2aba7d2015-04-21 13:06:34 -0400322 if (app->forward_only)
323 vty_out(vty, " forward-only%s", VTY_NEWLINE);
Holger Hans Peter Freyther2f79ae92015-09-21 16:52:03 +0200324
325 if (app->force_down)
326 vty_out(vty, " on-msc-down-force-down%s", VTY_NEWLINE);
Holger Hans Peter Freyther71760302011-02-22 20:57:08 +0100327}
328
329static int config_write_app(struct vty *vty)
330{
331 struct ss7_application *app;
332
333 llist_for_each_entry(app, &bsc->apps, entry)
334 write_application(vty, app);
335
Holger Hans Peter Freyther7942abc2010-09-30 00:34:46 +0800336 return CMD_SUCCESS;
337}
338
Holger Hans Peter Freyther71760302011-02-22 20:57:08 +0100339DEFUN(cfg_ss7, cfg_ss7_cmd,
340 "ss7", "Configure the application\n")
Holger Hans Peter Freyther7942abc2010-09-30 00:34:46 +0800341{
Holger Hans Peter Freyther71760302011-02-22 20:57:08 +0100342 vty->node = SS7_NODE;
343 return CMD_SUCCESS;
344}
345
346DEFUN(cfg_ss7_udp_src_port, cfg_ss7_udp_src_port_cmd,
347 "udp src-port <1-65535>",
348 "UDP related commands\n"
349 "Source port for SS7 via UDP transport\n"
350 "Port to bind to\n")
351{
352 bsc->udp_src_port = atoi(argv[0]);
353 return CMD_SUCCESS;
354}
355
356DEFUN(cfg_ss7_m2ua_src_port, cfg_ss7_m2ua_src_port_cmd,
357 "m2ua src-port <1-65535>",
358 "M2UA related commands\n"
359 "Source port for SS7 via M2UA\n"
360 "Port to bind to\n")
361{
362 bsc->m2ua_src_port = atoi(argv[0]);
363 return CMD_SUCCESS;
364}
365
366DEFUN(cfg_ss7_linkset, cfg_ss7_linkset_cmd,
367 "linkset <0-100>",
368 "Linkset commands\n" "Linkset number\n")
369{
370 struct mtp_link_set *set;
371 int nr;
372
373 nr = atoi(argv[0]);
374 if (nr > bsc->num_linksets) {
375 vty_out(vty, "%% The next unused Linkset number is %u%s",
376 bsc->num_linksets, VTY_NEWLINE);
377 return CMD_WARNING;
378 } else if (nr == bsc->num_linksets) {
379 set = mtp_link_set_alloc(bsc);
380 } else
381 set = mtp_link_set_num(bsc, nr);
382
383 if (!set) {
384 vty_out(vty, "%% Unable to allocate Linkset %u%s",
385 nr, VTY_NEWLINE);
386 return CMD_WARNING;
387 }
388
389 vty->node = LINKSETS_NODE;
390 vty->index = set;
391 vty->index_sub = &set->name;
392 return CMD_SUCCESS;
393}
394
395DEFUN(cfg_linkset_mtp3_dpc, cfg_linkset_mtp3_dpc_cmd,
Holger Hans Peter Freytheraf3faf82011-02-23 16:59:45 +0100396 "mtp3 dpc <0-8191>",
Holger Hans Peter Freyther71760302011-02-22 20:57:08 +0100397 "MTP Level3\n" "Destination Point Code\n" "Point Code\n")
398{
399 struct mtp_link_set *set = vty->index;
Holger Hans Peter Freythercfe9d712011-02-17 20:32:09 +0100400 set->dpc = atoi(argv[0]);
Holger Hans Peter Freyther7942abc2010-09-30 00:34:46 +0800401 return CMD_SUCCESS;
402}
403
Holger Hans Peter Freyther71760302011-02-22 20:57:08 +0100404DEFUN(cfg_linkset_mtp3_opc, cfg_linkset_mtp3_opc_cmd,
Holger Hans Peter Freytheraf3faf82011-02-23 16:59:45 +0100405 "mtp3 opc <0-8191>",
Holger Hans Peter Freyther71760302011-02-22 20:57:08 +0100406 "MTP Level3\n" "Originating Point Code\n" "Point Code\n")
Holger Hans Peter Freyther7942abc2010-09-30 00:34:46 +0800407{
Holger Hans Peter Freyther71760302011-02-22 20:57:08 +0100408 struct mtp_link_set *set = vty->index;
Holger Hans Peter Freythercfe9d712011-02-17 20:32:09 +0100409 set->opc = atoi(argv[0]);
Holger Hans Peter Freyther7942abc2010-09-30 00:34:46 +0800410 return CMD_SUCCESS;
411}
412
Holger Hans Peter Freyther71760302011-02-22 20:57:08 +0100413DEFUN(cfg_linkset_mtp3_ni, cfg_linkset_mtp3_ni_cmd,
414 "mtp3 ni <0-3>",
415 "MTP Level3\n" "NI for the address\n" "NI\n")
Holger Hans Peter Freyther7a725562011-01-01 13:34:58 +0100416{
Holger Hans Peter Freyther71760302011-02-22 20:57:08 +0100417 struct mtp_link_set *set = vty->index;
Holger Hans Peter Freythercfe9d712011-02-17 20:32:09 +0100418 set->ni = atoi(argv[0]);
Holger Hans Peter Freytherb38b33b2010-11-26 21:21:04 +0100419 return CMD_SUCCESS;
420}
421
Holger Hans Peter Freyther71760302011-02-22 20:57:08 +0100422DEFUN(cfg_linkset_mtp3_spare, cfg_linkset_mtp3_spare_cmd,
423 "mtp3 spare <0-3>",
424 "MTP Level3\n" "Spare for the address\n" "Spare\n")
Holger Hans Peter Freytherb38b33b2010-11-26 21:21:04 +0100425{
Holger Hans Peter Freyther71760302011-02-22 20:57:08 +0100426 struct mtp_link_set *set = vty->index;
Holger Hans Peter Freythercfe9d712011-02-17 20:32:09 +0100427 set->spare = atoi(argv[0]);
Holger Hans Peter Freytherb38b33b2010-11-26 21:21:04 +0100428 return CMD_SUCCESS;
429}
430
Holger Hans Peter Freyther71760302011-02-22 20:57:08 +0100431DEFUN(cfg_linkset_mtp3_ssn, cfg_linkset_mtp3_ssn_cmd,
432 "mtp3 ssn <0-255>",
433 "MTP Level3\n" "SSN supported\n" "SSN\n")
434{
435 struct mtp_link_set *set = vty->index;
436 set->supported_ssn[atoi(argv[0])] = 1;
437 return CMD_SUCCESS;
438}
Holger Hans Peter Freytherb38b33b2010-11-26 21:21:04 +0100439
Holger Hans Peter Freyther71760302011-02-22 20:57:08 +0100440DEFUN(cfg_linkset_no_mtp3_ssn, cfg_linkset_no_mtp3_ssn_cmd,
441 "no mtp3 ssn <0-255>",
Holger Hans Peter Freyther368e5492016-08-15 11:54:24 +0200442 NO_STR "MTP Level3\n" "SSN supported\n" "SSN\n")
Holger Hans Peter Freyther71760302011-02-22 20:57:08 +0100443{
444 struct mtp_link_set *set = vty->index;
445 set->supported_ssn[atoi(argv[0])] = 0;
446 return CMD_SUCCESS;
447}
448
449DEFUN(cfg_linkset_sltm_once, cfg_linkset_sltm_once_cmd,
450 "mtp3 sltm-once (0|1)",
451 "MTP Level3\n" "Test the link once\n" "Continous testing\n" "Test once\n")
452{
453 struct mtp_link_set *set = vty->index;
454 set->sltm_once = !!atoi(argv[0]);
455
456 return CMD_SUCCESS;
457}
458
Holger Hans Peter Freyther47c9faa2011-02-23 11:25:45 +0100459DEFUN(cfg_linkset_t18, cfg_linkset_t18_cmd,
460 "mtp3 timeout t18 <0-1000>",
461 "MTP Level3\n" "Timeouts\n" "T18 link restart timeout\n" "Seconds\n")
462{
463 struct mtp_link_set *set = vty->index;
464 set->timeout_t18 = atoi(argv[0]);
465 return CMD_SUCCESS;
466}
467
468DEFUN(cfg_linkset_t20, cfg_linkset_t20_cmd,
469 "mtp3 timeout t20 <0-1000>",
470 "MTP Level3\n" "Timeouts\n" "T20 link restart timeout\n" "Seconds\n")
471{
472 struct mtp_link_set *set = vty->index;
473 set->timeout_t20 = atoi(argv[0]);
474 return CMD_SUCCESS;
475}
476
Holger Hans Peter Freyther60bc8e72012-01-16 11:51:18 +0100477DEFUN(cfg_linkset_mtp3_isup_opc, cfg_linkset_mtp3_isup_opc_cmd,
478 "mtp3 isup opc <0-8191>",
479 "MTP Level3\n" "ISUP Commands\n" "OPC\n" "OPC Number\n")
480{
481 struct mtp_link_set *set = vty->index;
482 set->isup_opc = atoi(argv[0]);
483 return CMD_SUCCESS;
484}
485
486DEFUN(cfg_linkset_no_mtp3_isup_opc, cfg_linkset_no_mtp3_isup_opc_cmd,
487 "no mtp3 isup opc",
488 NO_STR "MTP Level3\n" "ISUP Commands\n" "OPC\n")
489{
490 struct mtp_link_set *set = vty->index;
491 set->isup_opc = -1;
492 return CMD_SUCCESS;
493}
494
495DEFUN(cfg_linkset_mtp3_isup_dpc, cfg_linkset_mtp3_isup_dpc_cmd,
496 "mtp3 isup dpc <0-8191>",
497 "MTP Level3\n" "ISUP Commands\n" "DPC\n" "DPC Number\n")
498{
499 struct mtp_link_set *set = vty->index;
500 set->isup_dpc = atoi(argv[0]);
501 return CMD_SUCCESS;
502}
503
504DEFUN(cfg_linkset_no_mtp3_isup_dpc, cfg_linkset_no_mtp3_isup_dpc_cmd,
505 "no mtp3 isup dpc",
506 NO_STR "MTP Level3\n" "ISUP Commands\n" "DPC\n")
507{
508 struct mtp_link_set *set = vty->index;
509 set->isup_dpc = -1;
510 return CMD_SUCCESS;
511}
512
513DEFUN(cfg_linkset_mtp3_sccp_opc, cfg_linkset_mtp3_sccp_opc_cmd,
514 "mtp3 sccp opc <0-8191>",
515 "MTP Level3\n" "SCCP Commands\n" "OPC\n" "OPC Number\n")
516{
517 struct mtp_link_set *set = vty->index;
518 set->sccp_opc = atoi(argv[0]);
519 return CMD_SUCCESS;
520}
521
522DEFUN(cfg_linkset_no_mtp3_sccp_opc, cfg_linkset_no_mtp3_sccp_opc_cmd,
523 "no mtp3 sccp opc",
524 NO_STR "MTP Level3\n" "SCCP Commands\n" "OPC\n")
525{
526 struct mtp_link_set *set = vty->index;
527 set->sccp_opc = -1;
528 return CMD_SUCCESS;
529}
530
531DEFUN(cfg_linkset_mtp3_sccp_dpc, cfg_linkset_mtp3_sccp_dpc_cmd,
532 "mtp3 sccp dpc <0-8191>",
533 "MTP Level3\n" "SCCP Commands\n" "DPC\n" "DPC Number\n")
534{
535 struct mtp_link_set *set = vty->index;
536 set->sccp_dpc = atoi(argv[0]);
537 return CMD_SUCCESS;
538}
539
540DEFUN(cfg_linkset_no_mtp3_sccp_dpc, cfg_linkset_no_mtp3_sccp_dpc_cmd,
541 "no mtp3 sccp dpc",
542 NO_STR "MTP Level3\n" "SCCP Commands\n" "DPC\n")
543{
544 struct mtp_link_set *set = vty->index;
545 set->sccp_dpc = -1;
546 return CMD_SUCCESS;
547}
548
Holger Hans Peter Freyther71760302011-02-22 20:57:08 +0100549DEFUN(cfg_linkset_link, cfg_linkset_link_cmd,
550 "link <0-100>",
551 "Link\n" "Link number\n")
552{
553 struct mtp_link_set *set = vty->index;
554
555 struct mtp_link *lnk;
556 int nr;
557
558 nr = atoi(argv[0]);
559 if (nr > set->nr_links) {
560 vty_out(vty, "%% The next unused Link number is %u%s",
561 set->nr_links, VTY_NEWLINE);
562 return CMD_WARNING;
563 } else if (nr == set->nr_links) {
564 lnk = mtp_link_alloc(set);
565 } else
566 lnk = mtp_link_num(set, nr);
567
568 if (!set) {
569 vty_out(vty, "%% Unable to allocate Link %u%s",
570 nr, VTY_NEWLINE);
571 return CMD_WARNING;
572 }
573
574 vty->node = LINK_NODE;
575 vty->index = lnk;
576 vty->index_sub = &lnk->name;
577 return CMD_SUCCESS;
578}
579
580DEFUN(cfg_link_ss7_transport, cfg_link_ss7_transport_cmd,
Holger Hans Peter Freytherd2f21e02015-03-23 16:19:37 +0100581 "ss7-transport (none|udp|m2ua|m3ua-client)",
Holger Hans Peter Freyther71760302011-02-22 20:57:08 +0100582 "SS7 transport for the link\n"
Holger Hans Peter Freyther368e5492016-08-15 11:54:24 +0200583 "No transport\n" "MTP over UDP\n" "SCTP M2UA server\n" "SCTP M3UA client\n")
Holger Hans Peter Freyther71760302011-02-22 20:57:08 +0100584{
585 int wanted = SS7_LTYPE_NONE;
586 struct mtp_link *link;
587
588 link = vty->index;
589
590 if (strcmp("udp", argv[0]) == 0)
591 wanted = SS7_LTYPE_UDP;
592 else if (strcmp("m2ua", argv[0]) == 0)
593 wanted = SS7_LTYPE_M2UA;
Holger Hans Peter Freytherd2f21e02015-03-23 16:19:37 +0100594 else if (strcmp("m3ua-client", argv[0]) == 0)
595 wanted = SS7_LTYPE_M3UA_CLIENT;
Holger Hans Peter Freyther71760302011-02-22 20:57:08 +0100596
597 if (link->type != wanted && link->type != SS7_LTYPE_NONE) {
598 vty_out(vty, "%%Can not change the type of a link.\n");
599 return CMD_WARNING;
600 }
601
602 switch (wanted) {
603 case SS7_LTYPE_UDP:
604 link->data = mtp_udp_link_init(link);
605 break;
606 case SS7_LTYPE_M2UA:
607 link->data = mtp_m2ua_link_init(link);
608 break;
Holger Hans Peter Freytherd2f21e02015-03-23 16:19:37 +0100609 case SS7_LTYPE_M3UA_CLIENT:
610 link->data = mtp_m3ua_client_link_init(link);
611 break;
Holger Hans Peter Freyther71760302011-02-22 20:57:08 +0100612 case SS7_LTYPE_NONE:
613 /* nothing */
614 break;
615 }
616
617 if (!link->data) {
618 vty_out(vty, "Failed to allocate the link type.%s", VTY_NEWLINE);
619 return CMD_WARNING;
620 }
621
622 return CMD_SUCCESS;
623}
624
625DEFUN(cfg_link_udp_dest_ip, cfg_link_udp_dest_ip_cmd,
626 "udp dest ip HOST_NAME",
Holger Hans Peter Freyther368e5492016-08-15 11:54:24 +0200627 "UDP Transport\n" "Destination\n" "IP\n" "Hostname\n")
Holger Hans Peter Freyther7942abc2010-09-30 00:34:46 +0800628{
629 struct hostent *hosts;
Holger Hans Peter Freyther7942abc2010-09-30 00:34:46 +0800630
Holger Hans Peter Freyther71760302011-02-22 20:57:08 +0100631 struct mtp_link *link = vty->index;
632 struct mtp_udp_link *ulnk;
633
634 if (link->type != SS7_LTYPE_UDP) {
635 vty_out(vty, "%%This only applies to UDP links.%s", VTY_NEWLINE);
636 return CMD_WARNING;
637 }
638
639 ulnk = link->data;
640
641 if (ulnk->dest)
642 talloc_free(ulnk->dest);
643 ulnk->dest = talloc_strdup(ulnk, argv[0]);
644
645 hosts = gethostbyname(ulnk->dest);
Holger Hans Peter Freyther7942abc2010-09-30 00:34:46 +0800646 if (!hosts || hosts->h_length < 1 || hosts->h_addrtype != AF_INET) {
647 vty_out(vty, "Failed to resolve '%s'%s", argv[0], VTY_NEWLINE);
648 return CMD_WARNING;
649 }
Holger Hans Peter Freyther71760302011-02-22 20:57:08 +0100650 ulnk->remote.sin_addr = * (struct in_addr *) hosts->h_addr_list[0];
Holger Hans Peter Freyther7942abc2010-09-30 00:34:46 +0800651
Holger Hans Peter Freyther71760302011-02-22 20:57:08 +0100652 if (snmp_mtp_peer_name(ulnk->session, ulnk->dest) != 0) {
653 vty_out(vty, "%%Failed to open SNMP port on link %d.%s",
654 link->nr, VTY_NEWLINE);
655 return CMD_WARNING;
656 }
657
Holger Hans Peter Freyther7942abc2010-09-30 00:34:46 +0800658 return CMD_SUCCESS;
659}
660
Holger Hans Peter Freyther71760302011-02-22 20:57:08 +0100661DEFUN(cfg_link_udp_dest_port, cfg_link_udp_dest_port_cmd,
662 "udp dest port <1-65535>",
Holger Hans Peter Freyther368e5492016-08-15 11:54:24 +0200663 "UDP Transport\n" "Destination\n" "Set the port number\n" "Port\n")
Holger Hans Peter Freyther7942abc2010-09-30 00:34:46 +0800664{
Holger Hans Peter Freyther71760302011-02-22 20:57:08 +0100665 struct mtp_link *link = vty->index;
666 struct mtp_udp_link *ulnk;
667
668 if (link->type != SS7_LTYPE_UDP) {
669 vty_out(vty, "%%This only applies to UDP links.%s", VTY_NEWLINE);
670 return CMD_WARNING;
671 }
672
673 ulnk = link->data;
674 ulnk->remote.sin_port = htons(atoi(argv[0]));
Holger Hans Peter Freyther7942abc2010-09-30 00:34:46 +0800675 return CMD_SUCCESS;
676}
677
Holger Hans Peter Freyther71760302011-02-22 20:57:08 +0100678DEFUN(cfg_link_udp_reset, cfg_link_udp_reset_cmd,
679 "udp reset-timeout <1-65535>",
680 "UDP Transport\n" "Reset timeout after a failure\n" "Seconds\n")
Holger Hans Peter Freyther7942abc2010-09-30 00:34:46 +0800681{
Holger Hans Peter Freyther71760302011-02-22 20:57:08 +0100682 struct mtp_link *link = vty->index;
683 struct mtp_udp_link *ulnk;
684
685 if (link->type != SS7_LTYPE_UDP) {
686 vty_out(vty, "%%This only applies to UDP links.%s", VTY_NEWLINE);
687 return CMD_WARNING;
688 }
689
690 ulnk = link->data;
691 ulnk->reset_timeout = atoi(argv[0]);
Holger Hans Peter Freyther7942abc2010-09-30 00:34:46 +0800692 return CMD_SUCCESS;
693}
694
Holger Hans Peter Freyther71760302011-02-22 20:57:08 +0100695DEFUN(cfg_link_udp_link_index, cfg_link_udp_link_index_cmd,
696 "udp link-index <0-65535>",
697 "UDP Transport\n" "Link index\n" "Index\n")
Holger Hans Peter Freyther7942abc2010-09-30 00:34:46 +0800698{
Holger Hans Peter Freyther71760302011-02-22 20:57:08 +0100699 struct mtp_link *link = vty->index;
700 struct mtp_udp_link *ulnk;
701
702 if (link->type != SS7_LTYPE_UDP) {
703 vty_out(vty, "%%This only applies to UDP links.%s", VTY_NEWLINE);
704 return CMD_WARNING;
705 }
706
707 ulnk = link->data;
708 ulnk->link_index = atoi(argv[0]);
Holger Hans Peter Freyther7942abc2010-09-30 00:34:46 +0800709 return CMD_SUCCESS;
710}
711
Holger Hans Peter Freyther71760302011-02-22 20:57:08 +0100712DEFUN(cfg_link_m2ua_as, cfg_link_m2ua_as_cmd,
713 "m2ua application-server NAME",
714 "M2UA Transport\n" "Application Server Name\n" "Name\n")
Holger Hans Peter Freytherc6bfa272011-01-22 17:06:34 +0100715{
Holger Hans Peter Freyther71760302011-02-22 20:57:08 +0100716 struct mtp_link *link = vty->index;
717 struct mtp_m2ua_link *m2ua;
718
719 if (link->type != SS7_LTYPE_M2UA) {
720 vty_out(vty, "%%This only applies to M2UA links.%s", VTY_NEWLINE);
721 return CMD_WARNING;
722 }
723
724 m2ua = link->data;
725 if (m2ua->as)
726 talloc_free(m2ua->as);
727 m2ua->as = talloc_strdup(m2ua, argv[0]);
Holger Hans Peter Freytherc6bfa272011-01-22 17:06:34 +0100728 return CMD_SUCCESS;
729}
730
Holger Hans Peter Freyther71760302011-02-22 20:57:08 +0100731DEFUN(cfg_link_m2ua_link_index, cfg_link_m2ua_link_index_cmd,
732 "m2ua link-index <0-65535>",
733 "M2UA Transport\n" "Link index\n" "Index\n")
Holger Hans Peter Freyther7942abc2010-09-30 00:34:46 +0800734{
Holger Hans Peter Freyther71760302011-02-22 20:57:08 +0100735 struct mtp_link *link = vty->index;
736 struct mtp_m2ua_link *m2ua;
737
738 if (link->type != SS7_LTYPE_M2UA) {
739 vty_out(vty, "%%This only applies to M2UA links.%s", VTY_NEWLINE);
740 return CMD_WARNING;
741 }
742
743 m2ua = link->data;
744 m2ua->link_index = atoi(argv[0]);
745 return CMD_SUCCESS;
746}
747
Holger Hans Peter Freytherd2f21e02015-03-23 16:19:37 +0100748
749DEFUN(cfg_link_m3ua_client_source_ip, cfg_link_m3ua_client_source_ip_cmd,
750 "m3ua-client source ip HOST_NAME",
751 "M3UA Client\n" "Source Address\n" "IP\n" "Hostname or IPv4 address\n")
752{
753 struct hostent *hosts;
754
755 struct mtp_link *link = vty->index;
756 struct mtp_m3ua_client_link *m3ua_link;
757
758 if (link->type != SS7_LTYPE_M3UA_CLIENT) {
759 vty_out(vty, "%%This only applies to UDP links.%s", VTY_NEWLINE);
760 return CMD_WARNING;
761 }
762
763 m3ua_link = link->data;
764
765 talloc_free(m3ua_link->source);
766 m3ua_link->source = talloc_strdup(m3ua_link, argv[0]);
767
768 hosts = gethostbyname(m3ua_link->source);
769 if (!hosts || hosts->h_length < 1 || hosts->h_addrtype != AF_INET) {
770 vty_out(vty, "Failed to resolve '%s'%s", argv[0], VTY_NEWLINE);
771 return CMD_WARNING;
772 }
773 m3ua_link->local.sin_addr = * (struct in_addr *) hosts->h_addr_list[0];
774 return CMD_SUCCESS;
775}
776
777DEFUN(cfg_link_m3ua_client_source_port, cfg_link_m3ua_client_source_port_cmd,
778 "m3ua-client source port <1-65535>",
779 "M3UA Client\n" "Source Address\n" "Port\n" "Number\n")
780{
781 struct mtp_link *link = vty->index;
782 struct mtp_m3ua_client_link *m3ua_link;
783
784 if (link->type != SS7_LTYPE_M3UA_CLIENT) {
785 vty_out(vty, "%%This only applies to UDP links.%s", VTY_NEWLINE);
786 return CMD_WARNING;
787 }
788
789 m3ua_link = link->data;
790 m3ua_link->local.sin_port = htons(atoi(argv[0]));
791 return CMD_SUCCESS;
792}
793
794DEFUN(cfg_link_m3ua_client_dest_ip, cfg_link_m3ua_client_dest_ip_cmd,
795 "m3ua-client dest ip HOST_NAME",
796 "M3UA Client\n" "Destination Address\n" "IP\n" "Hostname or IPv4 address\n")
797{
798 struct hostent *hosts;
799
800 struct mtp_link *link = vty->index;
801 struct mtp_m3ua_client_link *m3ua_link;
802
803 if (link->type != SS7_LTYPE_M3UA_CLIENT) {
804 vty_out(vty, "%%This only applies to M3UA client links.%s", VTY_NEWLINE);
805 return CMD_WARNING;
806 }
807
808 m3ua_link = link->data;
809
810 talloc_free(m3ua_link->dest);
811 m3ua_link->dest = talloc_strdup(m3ua_link, argv[0]);
812
813 hosts = gethostbyname(m3ua_link->dest);
814 if (!hosts || hosts->h_length < 1 || hosts->h_addrtype != AF_INET) {
815 vty_out(vty, "Failed to resolve '%s'%s", argv[0], VTY_NEWLINE);
816 return CMD_WARNING;
817 }
818 m3ua_link->remote.sin_addr = * (struct in_addr *) hosts->h_addr_list[0];
819 return CMD_SUCCESS;
820}
821
822DEFUN(cfg_link_m3ua_client_dest_port, cfg_link_m3ua_client_dest_port_cmd,
823 "m3ua-client dest port <1-65535>",
824 "M3UA Client\n" "Destination Address\n" "Port\n" "Number\n")
825{
826 struct mtp_link *link = vty->index;
827 struct mtp_m3ua_client_link *m3ua_link;
828
829 if (link->type != SS7_LTYPE_M3UA_CLIENT) {
830 vty_out(vty, "%%This only applies to M3UA client links.%s", VTY_NEWLINE);
831 return CMD_WARNING;
832 }
833
834 m3ua_link = link->data;
835 m3ua_link->remote.sin_port = htons(atoi(argv[0]));
836 return CMD_SUCCESS;
837}
838
839DEFUN(cfg_link_m3ua_client_link_index, cfg_link_m3ua_client_link_index_cmd,
840 "m3ua-client link-index <0-65535>",
841 "M3UA Client\n" "Link index\n" "Index\n")
842{
843 struct mtp_link *link = vty->index;
844 struct mtp_m3ua_client_link *m3ua_link;
845
846 if (link->type != SS7_LTYPE_M3UA_CLIENT) {
847 vty_out(vty, "%%This only applies to M3UA client links.%s", VTY_NEWLINE);
848 return CMD_WARNING;
849 }
850
851 m3ua_link = link->data;
852 m3ua_link->link_index = atoi(argv[0]);
853 return CMD_SUCCESS;
854}
855
856DEFUN(cfg_link_m3ua_client_routing_ctx, cfg_link_m3ua_client_routing_ctx_cmd,
857 "m3ua-client routing-context <0-65535>",
858 "M3UA Client\n" "Routing Context\n" "Nunber\n")
859{
860 struct mtp_link *link = vty->index;
861 struct mtp_m3ua_client_link *m3ua_link;
862
863 if (link->type != SS7_LTYPE_M3UA_CLIENT) {
864 vty_out(vty, "%%This only applies to M3UA client links.%s", VTY_NEWLINE);
865 return CMD_WARNING;
866 }
867
868 m3ua_link = link->data;
869 m3ua_link->routing_context = atoi(argv[0]);
870 return CMD_SUCCESS;
871}
872
Holger Hans Peter Freyther6a441c82015-04-16 22:31:41 +0200873DEFUN(cfg_link_m3ua_client_traffic_mode, cfg_link_m3ua_client_traffic_mode_cmd,
874 "m3ua-client traffic-mode (override|loadshare|broadcast)",
Holger Hans Peter Freyther368e5492016-08-15 11:54:24 +0200875 "M3UA Client\n" "Traffic Mode\n" "Override\n" "Loadshare\n" "Broadcast\n")
Holger Hans Peter Freyther6a441c82015-04-16 22:31:41 +0200876{
877 struct mtp_link *link = vty->index;
878 struct mtp_m3ua_client_link *m3ua_link;
879
880 if (link->type != SS7_LTYPE_M3UA_CLIENT) {
881 vty_out(vty, "%%This only applies to M3UA client links.%s", VTY_NEWLINE);
882 return CMD_WARNING;
883 }
884
885 m3ua_link = link->data;
886 m3ua_link->traffic_mode = m3ua_traffic_mode_num(argv[0]);
887 return CMD_SUCCESS;
888}
889
Holger Hans Peter Freythera41c9922015-10-09 14:48:05 +0200890DEFUN(cfg_link_m3ua_client_lnk_up_tout, cfg_link_m3ua_client_lnk_up_tout_cmd,
891 "m3ua-client link-up-timeout <0-100000>",
892 "M3UA Client\n" "ASPAC_ACK timeout\n" "Timeout in seconds\n")
893{
894 struct mtp_link *link = vty->index;
895 struct mtp_m3ua_client_link *m3ua_link;
896
897 if (link->type != SS7_LTYPE_M3UA_CLIENT) {
898 vty_out(vty, "%%This only applies to M3UA client links.%s", VTY_NEWLINE);
899 return CMD_WARNING;
900 }
901
902 m3ua_link = link->data;
903 m3ua_link->aspac_ack_timeout = atoi(argv[0]);
904 return CMD_SUCCESS;
905}
906
Holger Hans Peter Freyther71760302011-02-22 20:57:08 +0100907DEFUN(cfg_ss7_msc, cfg_ss7_msc_cmd,
908 "msc <0-100>",
909 "MSC Connection\n" "MSC Number\n")
910{
911 struct msc_connection *msc;
912 int nr;
913
914 nr = atoi(argv[0]);
915 if (nr > bsc->num_mscs) {
916 vty_out(vty, "%% The next unused MSC number is %u%s",
917 bsc->num_mscs, VTY_NEWLINE);
918 return CMD_WARNING;
919 } else if (nr == bsc->num_mscs) {
920 msc = msc_connection_create(bsc, 1);
921 } else
922 msc = msc_connection_num(bsc, nr);
923
924 if (!msc) {
925 vty_out(vty, "%% Unable to allocate MSC %u%s",
926 nr, VTY_NEWLINE);
927 return CMD_WARNING;
928 }
929
930 vty->node = MSC_NODE;
931 vty->index = msc;
932 vty->index_sub = &msc->name;
Holger Hans Peter Freyther7942abc2010-09-30 00:34:46 +0800933 return CMD_SUCCESS;
934}
935
Holger Hans Peter Freythera5a17fa2013-03-19 22:29:41 +0100936DEFUN(cfg_msc_mode, cfg_msc_mode_cmd,
937 "mode (server|client)",
938 "Change the mode of the A-link\n"
939 "Accept incoming connection\n" "Open outgoing connection\n")
940{
941 struct msc_connection *msc = vty->index;
942
943 switch (argv[0][0]) {
944 case 's':
945 msc->mode = MSC_MODE_SERVER;
946 break;
947 case 'c':
948 msc->mode = MSC_MODE_CLIENT;
949 break;
950 }
951
952 return CMD_SUCCESS;
953}
954
Holger Hans Peter Freyther7942abc2010-09-30 00:34:46 +0800955DEFUN(cfg_msc_ip, cfg_msc_ip_cmd,
Holger Hans Peter Freyther71760302011-02-22 20:57:08 +0100956 "ip ADDR",
957 "IP Address of the MSC\n" "Address\n")
Holger Hans Peter Freyther7942abc2010-09-30 00:34:46 +0800958{
959 struct hostent *hosts;
Holger Hans Peter Freyther71760302011-02-22 20:57:08 +0100960 struct msc_connection *msc;
Holger Hans Peter Freyther84ec8712011-02-15 20:01:47 +0100961
Holger Hans Peter Freyther71760302011-02-22 20:57:08 +0100962 msc = vty->index;
Holger Hans Peter Freyther7942abc2010-09-30 00:34:46 +0800963 hosts = gethostbyname(argv[0]);
964 if (!hosts || hosts->h_length < 1 || hosts->h_addrtype != AF_INET) {
965 vty_out(vty, "Failed to resolve '%s'%s", argv[0], VTY_NEWLINE);
966 return CMD_WARNING;
967 }
968
Holger Hans Peter Freyther84ec8712011-02-15 20:01:47 +0100969 if (msc->ip)
970 talloc_free(msc->ip);
Holger Hans Peter Freyther71760302011-02-22 20:57:08 +0100971
972 msc->ip = talloc_strdup(msc,
973 inet_ntoa(*((struct in_addr *) hosts->h_addr_list[0])));
Holger Hans Peter Freyther7942abc2010-09-30 00:34:46 +0800974 return CMD_SUCCESS;
975}
976
Holger Hans Peter Freythera5a17fa2013-03-19 22:29:41 +0100977DEFUN(cfg_msc_port, cfg_msc_port_cmd,
978 "port <1-65535>",
979 "Port for the TCP connection\n" "Port Number\n")
980{
981 struct msc_connection *msc = vty->index;
982 msc->port = atoi(argv[0]);
983 return CMD_SUCCESS;
984}
985
Holger Hans Peter Freyther7942abc2010-09-30 00:34:46 +0800986DEFUN(cfg_msc_token, cfg_msc_token_cmd,
Holger Hans Peter Freyther71760302011-02-22 20:57:08 +0100987 "token TOKEN",
988 "Token for the MSC\n" "The token\n")
Holger Hans Peter Freyther7942abc2010-09-30 00:34:46 +0800989{
Holger Hans Peter Freyther71760302011-02-22 20:57:08 +0100990 struct msc_connection *msc = vty->index;
Holger Hans Peter Freyther84ec8712011-02-15 20:01:47 +0100991
992 if (msc->token)
993 talloc_free(msc->token);
994 msc->token = talloc_strdup(msc, argv[0]);
Holger Hans Peter Freyther7942abc2010-09-30 00:34:46 +0800995 return CMD_SUCCESS;
996}
997
Holger Hans Peter Freyther71760302011-02-22 20:57:08 +0100998DEFUN(cfg_msc_dscp, cfg_msc_dscp_cmd,
999 "dscp <0-255>",
1000 "DSCP for the IP Connection\n" "Nr\n")
Holger Hans Peter Freyther7942abc2010-09-30 00:34:46 +08001001{
Holger Hans Peter Freyther71760302011-02-22 20:57:08 +01001002 struct msc_connection *msc = vty->index;
1003 msc->dscp = atoi(argv[0]);
1004 return CMD_SUCCESS;
1005}
Holger Hans Peter Freyther84ec8712011-02-15 20:01:47 +01001006
Holger Hans Peter Freyther71760302011-02-22 20:57:08 +01001007DEFUN(cfg_msc_timeout_ping, cfg_msc_timeout_ping_cmd,
1008 "timeout ping <1-65535>",
1009 "Timeout commands\n" "Time between pings\n" "Seconds\n")
1010{
1011 struct msc_connection *msc = vty->index;
Holger Hans Peter Freyther84ec8712011-02-15 20:01:47 +01001012 msc->ping_time = atoi(argv[0]);
Holger Hans Peter Freyther7942abc2010-09-30 00:34:46 +08001013 return CMD_SUCCESS;
1014}
1015
Holger Hans Peter Freyther71760302011-02-22 20:57:08 +01001016DEFUN(cfg_msc_timeout_pong, cfg_msc_timeout_pong_cmd,
1017 "timeout pong <1-65535>",
1018 "Timeout commands\n" "Time between pongs\n" "Seconds\n")
Holger Hans Peter Freyther7942abc2010-09-30 00:34:46 +08001019{
Holger Hans Peter Freyther71760302011-02-22 20:57:08 +01001020 struct msc_connection *msc = vty->index;
Holger Hans Peter Freyther84ec8712011-02-15 20:01:47 +01001021 msc->pong_time = atoi(argv[0]);
Holger Hans Peter Freyther7942abc2010-09-30 00:34:46 +08001022 return CMD_SUCCESS;
1023}
1024
Holger Hans Peter Freyther71760302011-02-22 20:57:08 +01001025DEFUN(cfg_msc_timeout_restart, cfg_msc_timeout_restart_cmd,
Holger Hans Peter Freyther368e5492016-08-15 11:54:24 +02001026 "timeout restart <0-65535>",
Holger Hans Peter Freyther71760302011-02-22 20:57:08 +01001027 "Timeout commands\n" "Time between restarts\n" "Seconds\n")
Holger Hans Peter Freyther7942abc2010-09-30 00:34:46 +08001028{
Holger Hans Peter Freyther71760302011-02-22 20:57:08 +01001029 struct msc_connection *msc = vty->index;
Holger Hans Peter Freyther84ec8712011-02-15 20:01:47 +01001030 msc->msc_time = atoi(argv[0]);
Holger Hans Peter Freyther7942abc2010-09-30 00:34:46 +08001031 return CMD_SUCCESS;
1032}
1033
Holger Hans Peter Freyther71760302011-02-22 20:57:08 +01001034DEFUN(cfg_ss7_app, cfg_ss7_app_cmd,
1035 "application <0-100>",
1036 "Application Commands\n" "Number\n")
Holger Hans Peter Freytherf603f282011-01-30 00:24:15 +01001037{
Holger Hans Peter Freyther71760302011-02-22 20:57:08 +01001038 struct ss7_application *app;
1039 int nr;
1040
1041 nr = atoi(argv[0]);
1042 if (nr > bsc->num_apps) {
1043 vty_out(vty, "%% The next unused Application number is %u%s",
1044 bsc->num_apps, VTY_NEWLINE);
1045 return CMD_WARNING;
1046 } else if (nr == bsc->num_apps) {
1047 app = ss7_application_alloc(bsc);
1048 } else
1049 app = ss7_application_num(bsc, nr);
1050
1051 if (!app) {
1052 vty_out(vty, "%% Unable to allocate Application %u%s",
1053 nr, VTY_NEWLINE);
1054 return CMD_WARNING;
1055 }
1056
1057 vty->node = APP_NODE;
1058 vty->index = app;
1059 vty->index_sub = &app->name;
1060 return CMD_SUCCESS;
1061}
1062
1063DEFUN(cfg_app_type, cfg_app_type_cmd,
1064 "type (none|stp|relay|msc)",
1065 "Type of Application\n"
1066 "No type\n" "Signalling Transfer Point\n"
1067 "Relay SCCP/ISUP messages\n" "MSC connector with state\n")
1068{
1069 enum ss7_app_type type;
1070 struct ss7_application *app = vty->index;
1071
1072 switch (argv[0][0]) {
1073 case 'm':
1074 type = APP_CELLMGR;
1075 break;
1076 case 'r':
1077 type = APP_RELAY;
1078 break;
1079 case 's':
1080 type = APP_STP;
1081 break;
1082 default:
1083 case 'n':
1084 type = APP_NONE;
1085 break;
1086 }
1087
1088 if (app->type != APP_NONE && app->type != type) {
1089 vty_out(vty, "The type can not be changed at runtime on app %d.%s",
1090 app->nr, VTY_NEWLINE);
1091 return CMD_WARNING;
1092 }
1093
1094 app->type = type;
1095 return CMD_SUCCESS;
1096}
1097
1098DEFUN(cfg_app_isup_pass, cfg_app_isup_pass_cmd,
1099 "isup-pass-through (0|1)",
1100 "Pass all ISUP messages\n" "Handle some ISUP locally\n" "Pass all messages\n")
1101{
1102 struct ss7_application *app = vty->index;
1103
1104 if (app->type != APP_STP) {
1105 vty_out(vty, "%%Need to use the 'stp' app for this option on app %d.%s",
1106 app->nr, VTY_NEWLINE);
1107 return CMD_WARNING;
1108 }
1109
Holger Hans Peter Freythercfe9d712011-02-17 20:32:09 +01001110 ss7_application_pass_isup(app, atoi(argv[0]));
Holger Hans Peter Freyther71760302011-02-22 20:57:08 +01001111 return CMD_SUCCESS;
1112}
1113
Holger Hans Peter Freyther2f79ae92015-09-21 16:52:03 +02001114DEFUN(cfg_app_fail, cfg_app_fail_cmd,
1115 "on-msc-down-force-down",
1116 "When the MSC connection is down force MTP linksets down\n")
1117{
1118 struct ss7_application *app = vty->index;
1119
1120 /* check if there is a MSC route? */
1121 app->force_down = 1;
1122 return CMD_SUCCESS;
1123}
1124
1125DEFUN(cfg_app_no_fail, cfg_app_no_fail_cmd,
1126 "no on-msc-down-force-down",
1127 NO_STR "When the MSC connection is down force MTP linksets down\n")
1128{
1129 struct ss7_application *app = vty->index;
1130
1131 /* check if there is a MSC route? */
1132 app->force_down = 0;
1133 return CMD_SUCCESS;
1134}
1135
Holger Hans Peter Freyther71760302011-02-22 20:57:08 +01001136DEFUN(cfg_app_route, cfg_app_route_cmd,
1137 "route linkset <0-100> msc <0-100>",
1138 "Routing commands\n" "Source Linkset\n" "Linkset Nr\n"
1139 "Dest MSC\n" "MSC Nr\n")
1140{
1141 struct ss7_application *app = vty->index;
1142
1143 if (app->type != APP_CELLMGR && app->type != APP_RELAY) {
1144 vty_out(vty, "The app type needs to be 'relay' or 'msc'.%s", VTY_NEWLINE);
1145 return CMD_WARNING;
1146 }
1147
1148 if (ss7_application_setup(app, app->type,
1149 SS7_SET_LINKSET, atoi(argv[0]),
1150 SS7_SET_MSC, atoi(argv[1])) != 0) {
1151 vty_out(vty, "Failed to route linkset %d to msc %d.%s",
1152 atoi(argv[0]), atoi(argv[1]), VTY_NEWLINE);
1153 return CMD_WARNING;
1154 }
Holger Hans Peter Freytherf603f282011-01-30 00:24:15 +01001155
1156 return CMD_SUCCESS;
1157}
1158
Holger Hans Peter Freyther71760302011-02-22 20:57:08 +01001159DEFUN(cfg_app_route_ls, cfg_app_route_ls_cmd,
1160 "route linkset <0-100> linkset <0-100>",
1161 "Routing commands\n" "Source Linkset\n" "Linkset Nr\n"
1162 "Dest Linkset\n" "Linkset Nr\n" )
1163{
1164 struct ss7_application *app = vty->index;
1165
1166 if (app->type != APP_STP) {
1167 vty_out(vty, "The app type needs to be 'stp'.%s", VTY_NEWLINE);
1168 return CMD_WARNING;
1169 }
1170
1171 if (ss7_application_setup(app, app->type,
1172 SS7_SET_LINKSET, atoi(argv[0]),
1173 SS7_SET_LINKSET, atoi(argv[1])) != 0) {
1174 vty_out(vty, "Failed to route linkset %d to linkset %d.%s",
1175 atoi(argv[0]), atoi(argv[1]), VTY_NEWLINE);
1176 return CMD_WARNING;
1177 }
1178
1179 return CMD_SUCCESS;
1180}
1181
Holger Hans Peter Freytherfc98ce22011-09-13 20:08:57 +02001182#define MGCP_DOMAIN_STR "MGCP domain name to use\n"
1183
1184DEFUN(cfg_app_domain_name, cfg_app_domain_name_cmd,
1185 "domain-name NAME",
1186 MGCP_DOMAIN_STR "Domain Name\n")
1187{
1188 struct ss7_application *app = vty->index;
1189
1190 if (app->type != APP_CELLMGR) {
1191 vty_out(vty, "The app type needs to be 'msc'.%s", VTY_NEWLINE);
1192 return CMD_WARNING;
1193 }
1194
1195 if (ss7_application_mgcp_domain_name(app, argv[0]) != 0) {
1196 vty_out(vty, "Failed to set the domain name.%s", VTY_NEWLINE);
1197 return CMD_WARNING;
1198 }
1199
1200 return CMD_SUCCESS;
1201}
1202
1203DEFUN(cfg_app_no_domain_name, cfg_app_no_domain_name_cmd,
1204 "no domain-name",
1205 NO_STR MGCP_DOMAIN_STR)
1206{
1207 struct ss7_application *app = vty->index;
1208
1209 if (app->type != APP_CELLMGR) {
1210 vty_out(vty, "The app type needs to be 'msc'.%s", VTY_NEWLINE);
1211 return CMD_WARNING;
1212 }
1213
1214 talloc_free(app->mgcp_domain_name);
1215 app->mgcp_domain_name = NULL;
1216 return CMD_SUCCESS;
1217}
1218
Holger Hans Peter Freytherb35c5c32012-12-11 15:32:09 +01001219#define TRUNK_NAME_STR "Trunk name to use\n"
1220
1221DEFUN(cfg_app_trunk_name, cfg_app_trunk_name_cmd,
1222 "trunk-name NAME",
1223 TRUNK_NAME_STR "The name\n")
1224{
1225 struct ss7_application *app = vty->index;
1226
1227 if (app->type != APP_STP) {
1228 vty_out(vty, "The app type needs to be 'stp'.%s", VTY_NEWLINE);
1229 return CMD_WARNING;
1230 }
1231
1232 if (ss7_application_trunk_name(app, argv[0]) != 0) {
1233 vty_out(vty, "Failed to set the trunk name.%s", VTY_NEWLINE);
1234 return CMD_WARNING;
1235 }
1236
1237 return CMD_SUCCESS;
1238}
1239
1240DEFUN(cfg_app_no_trunk_name, cfg_app_no_trunk_name_cmd,
1241 "no trunk-name NAME",
1242 NO_STR TRUNK_NAME_STR "The name\n")
1243{
1244 struct ss7_application *app = vty->index;
1245
1246 if (app->type != APP_STP) {
1247 vty_out(vty, "The app type needs to be 'stp'.%s", VTY_NEWLINE);
1248 return CMD_WARNING;
1249 }
1250
1251 talloc_free(app->trunk_name);
1252 app->trunk_name = NULL;
1253 return CMD_SUCCESS;
1254}
Holger Hans Peter Freytherfc98ce22011-09-13 20:08:57 +02001255
Holger Hans Peter Freytherd90834c2013-04-22 17:55:39 +02001256DEFUN(cfg_app_forward_only, cfg_app_forward_only_cmd,
1257 "forward-only",
1258 "Forward SCCP messages untouched to/from a IPA/SCCP connection\n")
1259{
1260 struct ss7_application *app = vty->index;
1261 app->forward_only = 1;
1262 return CMD_SUCCESS;
1263}
1264
1265DEFUN(cfg_app_no_forward_only, cfg_app_no_forward_only_cmd,
1266 "no forward-only",
1267 NO_STR "Forward SCCP messages untouched to/from a IPA/SCCP connection\n")
1268{
1269 struct ss7_application *app = vty->index;
1270 app->forward_only = 0;
1271 return CMD_SUCCESS;
1272}
1273
Holger Hans Peter Freyther4db78de2013-05-13 21:08:36 +02001274DEFUN(cfg_app_hardcode_ass, cfg_app_hardcode_ass_cmd,
1275 "hardcode-assignment-complete",
1276 "Hardcode the assignment complete message to HR3\n")
1277{
1278 struct ss7_application *app = vty->index;
1279 app->fixed_ass_cmpl_reply = 1;
1280 return CMD_SUCCESS;
1281}
1282
1283DEFUN(cfg_app_no_hardcode_ass, cfg_app_no_hardcode_ass_cmd,
1284 "no hardcode-assignment-complete",
Holger Hans Peter Freyther368e5492016-08-15 11:54:24 +02001285 NO_STR "Hardcode the assignment complete message to HR3\n")
Holger Hans Peter Freyther4db78de2013-05-13 21:08:36 +02001286{
1287 struct ss7_application *app = vty->index;
1288 app->fixed_ass_cmpl_reply = 0;
1289 return CMD_SUCCESS;
1290}
1291
Holger Hans Peter Freyther71760302011-02-22 20:57:08 +01001292static void install_defaults(int node)
1293{
Holger Hans Peter Freyther71760302011-02-22 20:57:08 +01001294 install_element(node, &cfg_description_cmd);
1295 install_element(node, &cfg_no_description_cmd);
1296}
1297
Holger Hans Peter Freyther29176442011-02-22 16:00:36 +01001298extern void cell_vty_init_cmds(void);
Holger Hans Peter Freyther7942abc2010-09-30 00:34:46 +08001299void cell_vty_init(void)
1300{
1301 cmd_init(1);
1302 vty_init(&vty_info);
Harald Welteff397ed2011-05-08 10:29:23 +02001303 logging_vty_add_cmds(&log_info);
Holger Hans Peter Freyther7942abc2010-09-30 00:34:46 +08001304
Holger Hans Peter Freyther71760302011-02-22 20:57:08 +01001305 install_element(CONFIG_NODE, &cfg_ss7_cmd);
1306 install_node(&ss7_node, config_write_ss7);
1307 install_defaults(SS7_NODE);
1308 install_element(SS7_NODE, &cfg_ss7_udp_src_port_cmd);
1309 install_element(SS7_NODE, &cfg_ss7_m2ua_src_port_cmd);
Holger Hans Peter Freyther7942abc2010-09-30 00:34:46 +08001310
Holger Hans Peter Freyther71760302011-02-22 20:57:08 +01001311 install_element(SS7_NODE, &cfg_ss7_linkset_cmd);
1312 install_node(&linkset_node, config_write_linkset);
1313 install_defaults(LINKSETS_NODE);
1314 install_element(LINKSETS_NODE, &cfg_linkset_mtp3_dpc_cmd);
1315 install_element(LINKSETS_NODE, &cfg_linkset_mtp3_opc_cmd);
1316 install_element(LINKSETS_NODE, &cfg_linkset_mtp3_ni_cmd);
1317 install_element(LINKSETS_NODE, &cfg_linkset_mtp3_spare_cmd);
1318 install_element(LINKSETS_NODE, &cfg_linkset_mtp3_ssn_cmd);
1319 install_element(LINKSETS_NODE, &cfg_linkset_no_mtp3_ssn_cmd);
1320 install_element(LINKSETS_NODE, &cfg_linkset_sltm_once_cmd);
Holger Hans Peter Freyther47c9faa2011-02-23 11:25:45 +01001321 install_element(LINKSETS_NODE, &cfg_linkset_t18_cmd);
1322 install_element(LINKSETS_NODE, &cfg_linkset_t20_cmd);
Holger Hans Peter Freyther60bc8e72012-01-16 11:51:18 +01001323 install_element(LINKSETS_NODE, &cfg_linkset_mtp3_isup_opc_cmd);
1324 install_element(LINKSETS_NODE, &cfg_linkset_no_mtp3_isup_opc_cmd);
1325 install_element(LINKSETS_NODE, &cfg_linkset_mtp3_sccp_opc_cmd);
1326 install_element(LINKSETS_NODE, &cfg_linkset_no_mtp3_sccp_opc_cmd);
1327 install_element(LINKSETS_NODE, &cfg_linkset_mtp3_isup_dpc_cmd);
1328 install_element(LINKSETS_NODE, &cfg_linkset_no_mtp3_isup_dpc_cmd);
1329 install_element(LINKSETS_NODE, &cfg_linkset_mtp3_sccp_dpc_cmd);
1330 install_element(LINKSETS_NODE, &cfg_linkset_no_mtp3_sccp_dpc_cmd);
Holger Hans Peter Freyther71760302011-02-22 20:57:08 +01001331
1332 install_element(LINKSETS_NODE, &cfg_linkset_link_cmd);
1333 install_node(&link_node, dummy_write);
1334 install_defaults(LINK_NODE);
1335 install_element(LINK_NODE, &cfg_link_ss7_transport_cmd);
1336 install_element(LINK_NODE, &cfg_link_udp_dest_ip_cmd);
1337 install_element(LINK_NODE, &cfg_link_udp_dest_port_cmd);
1338 install_element(LINK_NODE, &cfg_link_udp_reset_cmd);
1339 install_element(LINK_NODE, &cfg_link_udp_link_index_cmd);
1340 install_element(LINK_NODE, &cfg_link_m2ua_as_cmd);
1341 install_element(LINK_NODE, &cfg_link_m2ua_link_index_cmd);
Holger Hans Peter Freytherd2f21e02015-03-23 16:19:37 +01001342 install_element(LINK_NODE, &cfg_link_m3ua_client_source_ip_cmd);
1343 install_element(LINK_NODE, &cfg_link_m3ua_client_source_port_cmd);
1344 install_element(LINK_NODE, &cfg_link_m3ua_client_dest_ip_cmd);
1345 install_element(LINK_NODE, &cfg_link_m3ua_client_dest_port_cmd);
1346 install_element(LINK_NODE, &cfg_link_m3ua_client_link_index_cmd);
1347 install_element(LINK_NODE, &cfg_link_m3ua_client_routing_ctx_cmd);
Holger Hans Peter Freyther6a441c82015-04-16 22:31:41 +02001348 install_element(LINK_NODE, &cfg_link_m3ua_client_traffic_mode_cmd);
Holger Hans Peter Freythera41c9922015-10-09 14:48:05 +02001349 install_element(LINK_NODE, &cfg_link_m3ua_client_lnk_up_tout_cmd);
Holger Hans Peter Freyther71760302011-02-22 20:57:08 +01001350
1351 install_element(SS7_NODE, &cfg_ss7_msc_cmd);
1352 install_node(&msc_node, config_write_msc);
1353 install_defaults(MSC_NODE);
Holger Hans Peter Freythera5a17fa2013-03-19 22:29:41 +01001354 install_element(MSC_NODE, &cfg_msc_mode_cmd);
Holger Hans Peter Freyther71760302011-02-22 20:57:08 +01001355 install_element(MSC_NODE, &cfg_msc_ip_cmd);
Holger Hans Peter Freythera5a17fa2013-03-19 22:29:41 +01001356 install_element(MSC_NODE, &cfg_msc_port_cmd);
Holger Hans Peter Freyther71760302011-02-22 20:57:08 +01001357 install_element(MSC_NODE, &cfg_msc_token_cmd);
1358 install_element(MSC_NODE, &cfg_msc_dscp_cmd);
1359 install_element(MSC_NODE, &cfg_msc_timeout_ping_cmd);
1360 install_element(MSC_NODE, &cfg_msc_timeout_pong_cmd);
1361 install_element(MSC_NODE, &cfg_msc_timeout_restart_cmd);
1362
1363 install_element(SS7_NODE, &cfg_ss7_app_cmd);
1364 install_node(&app_node, config_write_app);
1365 install_defaults(APP_NODE);
1366 install_element(APP_NODE, &cfg_app_type_cmd);
1367 install_element(APP_NODE, &cfg_app_isup_pass_cmd);
Holger Hans Peter Freyther2f79ae92015-09-21 16:52:03 +02001368 install_element(APP_NODE, &cfg_app_fail_cmd);
1369 install_element(APP_NODE, &cfg_app_no_fail_cmd);
Holger Hans Peter Freyther71760302011-02-22 20:57:08 +01001370 install_element(APP_NODE, &cfg_app_route_cmd);
1371 install_element(APP_NODE, &cfg_app_route_ls_cmd);
Holger Hans Peter Freytherfc98ce22011-09-13 20:08:57 +02001372 install_element(APP_NODE, &cfg_app_domain_name_cmd);
1373 install_element(APP_NODE, &cfg_app_no_domain_name_cmd);
Holger Hans Peter Freytherb35c5c32012-12-11 15:32:09 +01001374 install_element(APP_NODE, &cfg_app_trunk_name_cmd);
1375 install_element(APP_NODE, &cfg_app_no_trunk_name_cmd);
Holger Hans Peter Freytherd90834c2013-04-22 17:55:39 +02001376 install_element(APP_NODE, &cfg_app_forward_only_cmd);
1377 install_element(APP_NODE, &cfg_app_no_forward_only_cmd);
Holger Hans Peter Freyther4db78de2013-05-13 21:08:36 +02001378 install_element(APP_NODE, &cfg_app_hardcode_ass_cmd);
1379 install_element(APP_NODE, &cfg_app_no_hardcode_ass_cmd);
Holger Hans Peter Freyther51b9e7a2011-01-22 16:02:13 +01001380
Holger Hans Peter Freyther29176442011-02-22 16:00:36 +01001381 cell_vty_init_cmds();
Holger Hans Peter Freyther7942abc2010-09-30 00:34:46 +08001382}
1383
1384const char *openbsc_copyright = "";