blob: 6c6d30fbdaf8f348c14794e488c40ce77b853736 [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
80
81DEFUN(node_exit, node_exit_cmd,
82 "exit", "Exit the current node\n")
83{
84 ss7_go_parent(vty);
85 return CMD_SUCCESS;
86}
87
88DEFUN(node_end, node_end_cmd,
89 "end", "End the current mode and change to the enable node\n")
90{
91 switch (vty->node) {
92 case VIEW_NODE:
93 case ENABLE_NODE:
94 break;
95 default:
96 vty_config_unlock(vty);
97 vty->node = ENABLE_NODE;
98 vty->index = NULL;
99 vty->index_sub = NULL;
100 break;
101 }
102 return CMD_SUCCESS;
103}
104
Holger Hans Peter Freyther7942abc2010-09-30 00:34:46 +0800105static struct vty_app_info vty_info = {
106 .name = "Cellmgr-ng",
107 .version = VERSION,
Holger Hans Peter Freyther71760302011-02-22 20:57:08 +0100108 .go_parent_cb = ss7_go_parent,
Holger Hans Peter Freyther7942abc2010-09-30 00:34:46 +0800109};
110
111/* vty code */
Holger Hans Peter Freyther7942abc2010-09-30 00:34:46 +0800112
Holger Hans Peter Freyther71760302011-02-22 20:57:08 +0100113static struct cmd_node ss7_node = {
114 SS7_NODE,
115 "%s(ss7)#",
Holger Hans Peter Freyther7942abc2010-09-30 00:34:46 +0800116 1,
117};
118
Holger Hans Peter Freyther71760302011-02-22 20:57:08 +0100119static struct cmd_node linkset_node = {
120 LINKSETS_NODE,
121 "%s(linkset)#",
122 1,
123};
124
125static struct cmd_node link_node = {
126 LINK_NODE,
127 "%s(link)#",
128 1,
129};
130
131static struct cmd_node msc_node = {
132 MSC_NODE,
133 "%s(msc)#",
134 1,
135};
136
137static struct cmd_node app_node = {
138 APP_NODE,
139 "%s(application)#",
140 1,
141};
142
143static int dummy_write(struct vty *vty)
Holger Hans Peter Freyther7942abc2010-09-30 00:34:46 +0800144{
Holger Hans Peter Freyther71760302011-02-22 20:57:08 +0100145 return CMD_SUCCESS;
146}
Holger Hans Peter Freyther84ec8712011-02-15 20:01:47 +0100147
Holger Hans Peter Freyther71760302011-02-22 20:57:08 +0100148static int config_write_ss7(struct vty *vty)
149{
150 vty_out(vty, "ss7%s", VTY_NEWLINE);
151 vty_out(vty, " udp src-port %d%s", bsc->udp_src_port, VTY_NEWLINE);
152 vty_out(vty, " m2ua src-port %d%s", bsc->m2ua_src_port, VTY_NEWLINE);
153 return CMD_SUCCESS;
154}
Holger Hans Peter Freyther2656e8f2010-09-30 00:41:37 +0800155
Holger Hans Peter Freyther71760302011-02-22 20:57:08 +0100156static void write_link(struct vty *vty, struct mtp_link *link)
157{
158 const char *name = link->name ? link->name : "";
159 struct mtp_udp_link *ulnk;
160 struct mtp_m2ua_link *m2ua;
Holger Hans Peter Freytherd2f21e02015-03-23 16:19:37 +0100161 struct mtp_m3ua_client_link *m3ua_client;
Holger Hans Peter Freyther71760302011-02-22 20:57:08 +0100162
163 vty_out(vty, " link %d%s", link->nr, VTY_NEWLINE);
164 vty_out(vty, " description %s%s", name, VTY_NEWLINE);
165
166 switch (link->type) {
167 case SS7_LTYPE_UDP:
168 ulnk = (struct mtp_udp_link *) link->data;
169 vty_out(vty, " ss7-transport udp%s", VTY_NEWLINE);
170 vty_out(vty, " udp dest ip %s%s",
171 inet_ntoa(ulnk->remote.sin_addr), VTY_NEWLINE);
172 vty_out(vty, " udp dest port %d%s",
173 ntohs(ulnk->remote.sin_port), VTY_NEWLINE);
174 vty_out(vty, " udp reset-timeout %d%s",
175 ulnk->reset_timeout, VTY_NEWLINE);
176 vty_out(vty, " udp link-index %d%s",
177 ulnk->link_index, VTY_NEWLINE);
178 break;
179 case SS7_LTYPE_M2UA:
180 m2ua = (struct mtp_m2ua_link *) link->data;
181 vty_out(vty, " ss7-transport m2ua%s", VTY_NEWLINE);
182
183 if (m2ua->as)
Holger Hans Peter Freytherd2f21e02015-03-23 16:19:37 +0100184 vty_out(vty, " m2ua application-server-index %s%s",
Holger Hans Peter Freyther71760302011-02-22 20:57:08 +0100185 m2ua->as, VTY_NEWLINE);
186 vty_out(vty, " m2ua link-index %d%s",
187 m2ua->link_index, VTY_NEWLINE);
188 break;
Holger Hans Peter Freytherd2f21e02015-03-23 16:19:37 +0100189 case SS7_LTYPE_M3UA_CLIENT:
190 m3ua_client = (struct mtp_m3ua_client_link *) link->data;
191 vty_out(vty, " ss7-transport m3ua-client%s", VTY_NEWLINE);
192 vty_out(vty, " m3ua-client source ip %s%s",
193 inet_ntoa(m3ua_client->local.sin_addr), VTY_NEWLINE);
194 vty_out(vty, " m3ua-client source port %d%s",
195 ntohs(m3ua_client->local.sin_port), VTY_NEWLINE);
196 vty_out(vty, " m3ua-client dest ip %s%s",
197 inet_ntoa(m3ua_client->remote.sin_addr), VTY_NEWLINE);
198 vty_out(vty, " m3ua-client dest port %d%s",
199 ntohs(m3ua_client->remote.sin_port), VTY_NEWLINE);
200 vty_out(vty, " m3ua-client link-index %d%s",
201 m3ua_client->link_index, VTY_NEWLINE);
202 vty_out(vty, " m3ua-client routing-context %d%s",
203 m3ua_client->routing_context, VTY_NEWLINE);
Holger Hans Peter Freyther6a441c82015-04-16 22:31:41 +0200204 vty_out(vty, " m3ua-client traffic-mode %s%s",
205 m3ua_traffic_mode_name(m3ua_client->traffic_mode),
206 VTY_NEWLINE);
Holger Hans Peter Freythera41c9922015-10-09 14:48:05 +0200207 vty_out(vty, " m3ua-client link-up-timeout %d%s",
208 m3ua_client->aspac_ack_timeout, VTY_NEWLINE);
Holger Hans Peter Freytherd2f21e02015-03-23 16:19:37 +0100209 break;
Holger Hans Peter Freyther71760302011-02-22 20:57:08 +0100210 case SS7_LTYPE_NONE:
211 break;
212 }
213}
214
215static void write_linkset(struct vty *vty, struct mtp_link_set *set)
216{
217 const char *name = set->name ? set->name : "";
218 struct mtp_link *link;
219 int i;
220
221 vty_out(vty, " linkset %d%s", set->nr, VTY_NEWLINE);
222 vty_out(vty, " description %s%s", name, VTY_NEWLINE);
223 vty_out(vty, " mtp3 dpc %d%s", set->dpc, VTY_NEWLINE);
224 vty_out(vty, " mtp3 opc %d%s", set->opc, VTY_NEWLINE);
225 vty_out(vty, " mtp3 ni %d%s", set->ni, VTY_NEWLINE);
226 vty_out(vty, " mtp3 spare %d%s", set->spare, VTY_NEWLINE);
227 vty_out(vty, " mtp3 sltm-once %d%s", set->sltm_once, VTY_NEWLINE);
Holger Hans Peter Freyther47c9faa2011-02-23 11:25:45 +0100228 vty_out(vty, " mtp3 timeout t18 %d%s",
229 set->timeout_t18, VTY_NEWLINE);
230 vty_out(vty, " mtp3 timeout t20 %d%s",
231 set->timeout_t20, VTY_NEWLINE);
Holger Hans Peter Freyther60bc8e72012-01-16 11:51:18 +0100232 if (set->sccp_dpc != -1)
233 vty_out(vty, " mtp3 sccp dpc %d%s", set->sccp_dpc, VTY_NEWLINE);
234 if (set->sccp_opc != -1)
235 vty_out(vty, " mtp3 sccp opc %d%s", set->sccp_opc, VTY_NEWLINE);
236 if (set->isup_dpc != -1)
237 vty_out(vty, " mtp3 isup dpc %d%s", set->isup_dpc, VTY_NEWLINE);
238 if (set->isup_opc != -1)
239 vty_out(vty, " mtp3 isup opc %d%s", set->isup_opc, VTY_NEWLINE);
Holger Hans Peter Freyther71760302011-02-22 20:57:08 +0100240
241 for (i = 0; i < ARRAY_SIZE(set->supported_ssn); ++i) {
242 if (!set->supported_ssn[i])
243 continue;
244 vty_out(vty, " mtp3 ssn %d%s", i, VTY_NEWLINE);
Holger Hans Peter Freyther84ec8712011-02-15 20:01:47 +0100245 }
246
Holger Hans Peter Freyther71760302011-02-22 20:57:08 +0100247 llist_for_each_entry(link, &set->links, entry)
248 write_link(vty, link);
249}
250
251static int config_write_linkset(struct vty *vty)
252{
253 struct mtp_link_set *set;
254
255 llist_for_each_entry(set, &bsc->linksets, entry)
256 write_linkset(vty, set);
Holger Hans Peter Freyther84ec8712011-02-15 20:01:47 +0100257
Holger Hans Peter Freyther7942abc2010-09-30 00:34:46 +0800258 return CMD_SUCCESS;
259}
260
Holger Hans Peter Freyther71760302011-02-22 20:57:08 +0100261static void write_msc(struct vty *vty, struct msc_connection *msc)
Holger Hans Peter Freyther7942abc2010-09-30 00:34:46 +0800262{
Holger Hans Peter Freyther71760302011-02-22 20:57:08 +0100263 const char *name = msc->name ? msc->name : "";
264
265 vty_out(vty, " msc %d%s", msc->nr, VTY_NEWLINE);
266 vty_out(vty, " description %s%s", name, VTY_NEWLINE);
Holger Hans Peter Freythera5a17fa2013-03-19 22:29:41 +0100267 vty_out(vty, " mode %s%s", msc_mode(msc), VTY_NEWLINE);
Holger Hans Peter Freytherc5950d72015-04-21 13:08:35 -0400268 if (msc->ip)
269 vty_out(vty, " ip %s%s", msc->ip, VTY_NEWLINE);
Holger Hans Peter Freythera5a17fa2013-03-19 22:29:41 +0100270 vty_out(vty, " port %d%s", msc->port, VTY_NEWLINE);
Holger Hans Peter Freyther71760302011-02-22 20:57:08 +0100271 vty_out(vty, " token %s%s", msc->token, VTY_NEWLINE);
272 vty_out(vty, " dscp %d%s", msc->dscp, VTY_NEWLINE);
273 vty_out(vty, " timeout ping %d%s", msc->ping_time, VTY_NEWLINE);
274 vty_out(vty, " timeout pong %d%s", msc->pong_time, VTY_NEWLINE);
275 vty_out(vty, " timeout restart %d%s", msc->msc_time, VTY_NEWLINE);
276}
277
278static int config_write_msc(struct vty *vty)
279{
280 struct msc_connection *msc;
281
282 llist_for_each_entry(msc, &bsc->mscs, entry)
283 write_msc(vty, msc);
284 return 0;
285}
286
287static const char *app_type(enum ss7_app_type type)
288{
289 switch (type) {
290 case APP_NONE:
291 return "none";
292 case APP_CELLMGR:
293 return "msc";
294 case APP_RELAY:
295 return "relay";
296 case APP_STP:
297 return "stp";
298 default:
299 LOGP(DINP, LOGL_ERROR, "Should no be reached.\n");
300 return "";
301 }
302}
303
304static const char *link_type(enum ss7_set_type type)
305{
306 switch (type) {
307 case SS7_SET_LINKSET:
308 return "linkset";
309 case SS7_SET_MSC:
310 return "msc";
311 default:
312 LOGP(DINP, LOGL_ERROR, "Should no be reached.\n");
313 return "";
314 }
315}
316
317static void write_application(struct vty *vty, struct ss7_application *app)
318{
319 const char *name = app->name ? app->name : "";
320
321 vty_out(vty, " application %d%s", app->nr, VTY_NEWLINE);
322 vty_out(vty, " description %s%s", name, VTY_NEWLINE);
323 vty_out(vty, " type %s%s", app_type(app->type), VTY_NEWLINE);
324
Holger Hans Peter Freyther4db78de2013-05-13 21:08:36 +0200325 if (app->fixed_ass_cmpl_reply)
326 vty_out(vty, " hardcode-assignment-complete%s", VTY_NEWLINE);
327
Holger Hans Peter Freytherb35c5c32012-12-11 15:32:09 +0100328 if (app->type == APP_STP) {
Holger Hans Peter Freyther71760302011-02-22 20:57:08 +0100329 vty_out(vty, " isup-pass-through %d%s", app->isup_pass, VTY_NEWLINE);
Holger Hans Peter Freythere8334782012-12-11 14:19:03 +0100330 if (app->trunk_name)
331 vty_out(vty, " trunk-name %s%s",
332 app->trunk_name, VTY_NEWLINE);
Holger Hans Peter Freytherb35c5c32012-12-11 15:32:09 +0100333 }
Holger Hans Peter Freyther71760302011-02-22 20:57:08 +0100334
Holger Hans Peter Freytherfc98ce22011-09-13 20:08:57 +0200335 if (app->type == APP_CELLMGR && app->mgcp_domain_name) {
336 vty_out(vty, " domain-name %s%s",
337 app->mgcp_domain_name, VTY_NEWLINE);
338 }
339
Holger Hans Peter Freyther71760302011-02-22 20:57:08 +0100340 if (app->route_is_set) {
341 vty_out(vty, " route %s %d %s %d%s",
342 link_type(app->route_src.type), app->route_src.nr,
343 link_type(app->route_dst.type), app->route_dst.nr,
344 VTY_NEWLINE);
345 }
Holger Hans Peter Freythere2aba7d2015-04-21 13:06:34 -0400346 if (app->forward_only)
347 vty_out(vty, " forward-only%s", VTY_NEWLINE);
Holger Hans Peter Freyther2f79ae92015-09-21 16:52:03 +0200348
349 if (app->force_down)
350 vty_out(vty, " on-msc-down-force-down%s", VTY_NEWLINE);
Holger Hans Peter Freyther71760302011-02-22 20:57:08 +0100351}
352
353static int config_write_app(struct vty *vty)
354{
355 struct ss7_application *app;
356
357 llist_for_each_entry(app, &bsc->apps, entry)
358 write_application(vty, app);
359
Holger Hans Peter Freyther7942abc2010-09-30 00:34:46 +0800360 return CMD_SUCCESS;
361}
362
Holger Hans Peter Freyther71760302011-02-22 20:57:08 +0100363DEFUN(cfg_ss7, cfg_ss7_cmd,
364 "ss7", "Configure the application\n")
Holger Hans Peter Freyther7942abc2010-09-30 00:34:46 +0800365{
Holger Hans Peter Freyther71760302011-02-22 20:57:08 +0100366 vty->node = SS7_NODE;
367 return CMD_SUCCESS;
368}
369
370DEFUN(cfg_ss7_udp_src_port, cfg_ss7_udp_src_port_cmd,
371 "udp src-port <1-65535>",
372 "UDP related commands\n"
373 "Source port for SS7 via UDP transport\n"
374 "Port to bind to\n")
375{
376 bsc->udp_src_port = atoi(argv[0]);
377 return CMD_SUCCESS;
378}
379
380DEFUN(cfg_ss7_m2ua_src_port, cfg_ss7_m2ua_src_port_cmd,
381 "m2ua src-port <1-65535>",
382 "M2UA related commands\n"
383 "Source port for SS7 via M2UA\n"
384 "Port to bind to\n")
385{
386 bsc->m2ua_src_port = atoi(argv[0]);
387 return CMD_SUCCESS;
388}
389
390DEFUN(cfg_ss7_linkset, cfg_ss7_linkset_cmd,
391 "linkset <0-100>",
392 "Linkset commands\n" "Linkset number\n")
393{
394 struct mtp_link_set *set;
395 int nr;
396
397 nr = atoi(argv[0]);
398 if (nr > bsc->num_linksets) {
399 vty_out(vty, "%% The next unused Linkset number is %u%s",
400 bsc->num_linksets, VTY_NEWLINE);
401 return CMD_WARNING;
402 } else if (nr == bsc->num_linksets) {
403 set = mtp_link_set_alloc(bsc);
404 } else
405 set = mtp_link_set_num(bsc, nr);
406
407 if (!set) {
408 vty_out(vty, "%% Unable to allocate Linkset %u%s",
409 nr, VTY_NEWLINE);
410 return CMD_WARNING;
411 }
412
413 vty->node = LINKSETS_NODE;
414 vty->index = set;
415 vty->index_sub = &set->name;
416 return CMD_SUCCESS;
417}
418
419DEFUN(cfg_linkset_mtp3_dpc, cfg_linkset_mtp3_dpc_cmd,
Holger Hans Peter Freytheraf3faf82011-02-23 16:59:45 +0100420 "mtp3 dpc <0-8191>",
Holger Hans Peter Freyther71760302011-02-22 20:57:08 +0100421 "MTP Level3\n" "Destination Point Code\n" "Point Code\n")
422{
423 struct mtp_link_set *set = vty->index;
Holger Hans Peter Freythercfe9d712011-02-17 20:32:09 +0100424 set->dpc = atoi(argv[0]);
Holger Hans Peter Freyther7942abc2010-09-30 00:34:46 +0800425 return CMD_SUCCESS;
426}
427
Holger Hans Peter Freyther71760302011-02-22 20:57:08 +0100428DEFUN(cfg_linkset_mtp3_opc, cfg_linkset_mtp3_opc_cmd,
Holger Hans Peter Freytheraf3faf82011-02-23 16:59:45 +0100429 "mtp3 opc <0-8191>",
Holger Hans Peter Freyther71760302011-02-22 20:57:08 +0100430 "MTP Level3\n" "Originating Point Code\n" "Point Code\n")
Holger Hans Peter Freyther7942abc2010-09-30 00:34:46 +0800431{
Holger Hans Peter Freyther71760302011-02-22 20:57:08 +0100432 struct mtp_link_set *set = vty->index;
Holger Hans Peter Freythercfe9d712011-02-17 20:32:09 +0100433 set->opc = atoi(argv[0]);
Holger Hans Peter Freyther7942abc2010-09-30 00:34:46 +0800434 return CMD_SUCCESS;
435}
436
Holger Hans Peter Freyther71760302011-02-22 20:57:08 +0100437DEFUN(cfg_linkset_mtp3_ni, cfg_linkset_mtp3_ni_cmd,
438 "mtp3 ni <0-3>",
439 "MTP Level3\n" "NI for the address\n" "NI\n")
Holger Hans Peter Freyther7a725562011-01-01 13:34:58 +0100440{
Holger Hans Peter Freyther71760302011-02-22 20:57:08 +0100441 struct mtp_link_set *set = vty->index;
Holger Hans Peter Freythercfe9d712011-02-17 20:32:09 +0100442 set->ni = atoi(argv[0]);
Holger Hans Peter Freytherb38b33b2010-11-26 21:21:04 +0100443 return CMD_SUCCESS;
444}
445
Holger Hans Peter Freyther71760302011-02-22 20:57:08 +0100446DEFUN(cfg_linkset_mtp3_spare, cfg_linkset_mtp3_spare_cmd,
447 "mtp3 spare <0-3>",
448 "MTP Level3\n" "Spare for the address\n" "Spare\n")
Holger Hans Peter Freytherb38b33b2010-11-26 21:21:04 +0100449{
Holger Hans Peter Freyther71760302011-02-22 20:57:08 +0100450 struct mtp_link_set *set = vty->index;
Holger Hans Peter Freythercfe9d712011-02-17 20:32:09 +0100451 set->spare = atoi(argv[0]);
Holger Hans Peter Freytherb38b33b2010-11-26 21:21:04 +0100452 return CMD_SUCCESS;
453}
454
Holger Hans Peter Freyther71760302011-02-22 20:57:08 +0100455DEFUN(cfg_linkset_mtp3_ssn, cfg_linkset_mtp3_ssn_cmd,
456 "mtp3 ssn <0-255>",
457 "MTP Level3\n" "SSN supported\n" "SSN\n")
458{
459 struct mtp_link_set *set = vty->index;
460 set->supported_ssn[atoi(argv[0])] = 1;
461 return CMD_SUCCESS;
462}
Holger Hans Peter Freytherb38b33b2010-11-26 21:21:04 +0100463
Holger Hans Peter Freyther71760302011-02-22 20:57:08 +0100464DEFUN(cfg_linkset_no_mtp3_ssn, cfg_linkset_no_mtp3_ssn_cmd,
465 "no mtp3 ssn <0-255>",
466 "MTP Level3\n" "SSN supported\n" "SSN\n")
467{
468 struct mtp_link_set *set = vty->index;
469 set->supported_ssn[atoi(argv[0])] = 0;
470 return CMD_SUCCESS;
471}
472
473DEFUN(cfg_linkset_sltm_once, cfg_linkset_sltm_once_cmd,
474 "mtp3 sltm-once (0|1)",
475 "MTP Level3\n" "Test the link once\n" "Continous testing\n" "Test once\n")
476{
477 struct mtp_link_set *set = vty->index;
478 set->sltm_once = !!atoi(argv[0]);
479
480 return CMD_SUCCESS;
481}
482
Holger Hans Peter Freyther47c9faa2011-02-23 11:25:45 +0100483DEFUN(cfg_linkset_t18, cfg_linkset_t18_cmd,
484 "mtp3 timeout t18 <0-1000>",
485 "MTP Level3\n" "Timeouts\n" "T18 link restart timeout\n" "Seconds\n")
486{
487 struct mtp_link_set *set = vty->index;
488 set->timeout_t18 = atoi(argv[0]);
489 return CMD_SUCCESS;
490}
491
492DEFUN(cfg_linkset_t20, cfg_linkset_t20_cmd,
493 "mtp3 timeout t20 <0-1000>",
494 "MTP Level3\n" "Timeouts\n" "T20 link restart timeout\n" "Seconds\n")
495{
496 struct mtp_link_set *set = vty->index;
497 set->timeout_t20 = atoi(argv[0]);
498 return CMD_SUCCESS;
499}
500
Holger Hans Peter Freyther60bc8e72012-01-16 11:51:18 +0100501DEFUN(cfg_linkset_mtp3_isup_opc, cfg_linkset_mtp3_isup_opc_cmd,
502 "mtp3 isup opc <0-8191>",
503 "MTP Level3\n" "ISUP Commands\n" "OPC\n" "OPC Number\n")
504{
505 struct mtp_link_set *set = vty->index;
506 set->isup_opc = atoi(argv[0]);
507 return CMD_SUCCESS;
508}
509
510DEFUN(cfg_linkset_no_mtp3_isup_opc, cfg_linkset_no_mtp3_isup_opc_cmd,
511 "no mtp3 isup opc",
512 NO_STR "MTP Level3\n" "ISUP Commands\n" "OPC\n")
513{
514 struct mtp_link_set *set = vty->index;
515 set->isup_opc = -1;
516 return CMD_SUCCESS;
517}
518
519DEFUN(cfg_linkset_mtp3_isup_dpc, cfg_linkset_mtp3_isup_dpc_cmd,
520 "mtp3 isup dpc <0-8191>",
521 "MTP Level3\n" "ISUP Commands\n" "DPC\n" "DPC Number\n")
522{
523 struct mtp_link_set *set = vty->index;
524 set->isup_dpc = atoi(argv[0]);
525 return CMD_SUCCESS;
526}
527
528DEFUN(cfg_linkset_no_mtp3_isup_dpc, cfg_linkset_no_mtp3_isup_dpc_cmd,
529 "no mtp3 isup dpc",
530 NO_STR "MTP Level3\n" "ISUP Commands\n" "DPC\n")
531{
532 struct mtp_link_set *set = vty->index;
533 set->isup_dpc = -1;
534 return CMD_SUCCESS;
535}
536
537DEFUN(cfg_linkset_mtp3_sccp_opc, cfg_linkset_mtp3_sccp_opc_cmd,
538 "mtp3 sccp opc <0-8191>",
539 "MTP Level3\n" "SCCP Commands\n" "OPC\n" "OPC Number\n")
540{
541 struct mtp_link_set *set = vty->index;
542 set->sccp_opc = atoi(argv[0]);
543 return CMD_SUCCESS;
544}
545
546DEFUN(cfg_linkset_no_mtp3_sccp_opc, cfg_linkset_no_mtp3_sccp_opc_cmd,
547 "no mtp3 sccp opc",
548 NO_STR "MTP Level3\n" "SCCP Commands\n" "OPC\n")
549{
550 struct mtp_link_set *set = vty->index;
551 set->sccp_opc = -1;
552 return CMD_SUCCESS;
553}
554
555DEFUN(cfg_linkset_mtp3_sccp_dpc, cfg_linkset_mtp3_sccp_dpc_cmd,
556 "mtp3 sccp dpc <0-8191>",
557 "MTP Level3\n" "SCCP Commands\n" "DPC\n" "DPC Number\n")
558{
559 struct mtp_link_set *set = vty->index;
560 set->sccp_dpc = atoi(argv[0]);
561 return CMD_SUCCESS;
562}
563
564DEFUN(cfg_linkset_no_mtp3_sccp_dpc, cfg_linkset_no_mtp3_sccp_dpc_cmd,
565 "no mtp3 sccp dpc",
566 NO_STR "MTP Level3\n" "SCCP Commands\n" "DPC\n")
567{
568 struct mtp_link_set *set = vty->index;
569 set->sccp_dpc = -1;
570 return CMD_SUCCESS;
571}
572
Holger Hans Peter Freyther71760302011-02-22 20:57:08 +0100573DEFUN(cfg_linkset_link, cfg_linkset_link_cmd,
574 "link <0-100>",
575 "Link\n" "Link number\n")
576{
577 struct mtp_link_set *set = vty->index;
578
579 struct mtp_link *lnk;
580 int nr;
581
582 nr = atoi(argv[0]);
583 if (nr > set->nr_links) {
584 vty_out(vty, "%% The next unused Link number is %u%s",
585 set->nr_links, VTY_NEWLINE);
586 return CMD_WARNING;
587 } else if (nr == set->nr_links) {
588 lnk = mtp_link_alloc(set);
589 } else
590 lnk = mtp_link_num(set, nr);
591
592 if (!set) {
593 vty_out(vty, "%% Unable to allocate Link %u%s",
594 nr, VTY_NEWLINE);
595 return CMD_WARNING;
596 }
597
598 vty->node = LINK_NODE;
599 vty->index = lnk;
600 vty->index_sub = &lnk->name;
601 return CMD_SUCCESS;
602}
603
604DEFUN(cfg_link_ss7_transport, cfg_link_ss7_transport_cmd,
Holger Hans Peter Freytherd2f21e02015-03-23 16:19:37 +0100605 "ss7-transport (none|udp|m2ua|m3ua-client)",
Holger Hans Peter Freyther71760302011-02-22 20:57:08 +0100606 "SS7 transport for the link\n"
607 "No transport\n" "MTP over UDP\n" "SCTP M2UA\n")
608{
609 int wanted = SS7_LTYPE_NONE;
610 struct mtp_link *link;
611
612 link = vty->index;
613
614 if (strcmp("udp", argv[0]) == 0)
615 wanted = SS7_LTYPE_UDP;
616 else if (strcmp("m2ua", argv[0]) == 0)
617 wanted = SS7_LTYPE_M2UA;
Holger Hans Peter Freytherd2f21e02015-03-23 16:19:37 +0100618 else if (strcmp("m3ua-client", argv[0]) == 0)
619 wanted = SS7_LTYPE_M3UA_CLIENT;
Holger Hans Peter Freyther71760302011-02-22 20:57:08 +0100620
621 if (link->type != wanted && link->type != SS7_LTYPE_NONE) {
622 vty_out(vty, "%%Can not change the type of a link.\n");
623 return CMD_WARNING;
624 }
625
626 switch (wanted) {
627 case SS7_LTYPE_UDP:
628 link->data = mtp_udp_link_init(link);
629 break;
630 case SS7_LTYPE_M2UA:
631 link->data = mtp_m2ua_link_init(link);
632 break;
Holger Hans Peter Freytherd2f21e02015-03-23 16:19:37 +0100633 case SS7_LTYPE_M3UA_CLIENT:
634 link->data = mtp_m3ua_client_link_init(link);
635 break;
Holger Hans Peter Freyther71760302011-02-22 20:57:08 +0100636 case SS7_LTYPE_NONE:
637 /* nothing */
638 break;
639 }
640
641 if (!link->data) {
642 vty_out(vty, "Failed to allocate the link type.%s", VTY_NEWLINE);
643 return CMD_WARNING;
644 }
645
646 return CMD_SUCCESS;
647}
648
649DEFUN(cfg_link_udp_dest_ip, cfg_link_udp_dest_ip_cmd,
650 "udp dest ip HOST_NAME",
651 "UDP Transport\n" "IP\n" "Hostname\n")
Holger Hans Peter Freyther7942abc2010-09-30 00:34:46 +0800652{
653 struct hostent *hosts;
Holger Hans Peter Freyther7942abc2010-09-30 00:34:46 +0800654
Holger Hans Peter Freyther71760302011-02-22 20:57:08 +0100655 struct mtp_link *link = vty->index;
656 struct mtp_udp_link *ulnk;
657
658 if (link->type != SS7_LTYPE_UDP) {
659 vty_out(vty, "%%This only applies to UDP links.%s", VTY_NEWLINE);
660 return CMD_WARNING;
661 }
662
663 ulnk = link->data;
664
665 if (ulnk->dest)
666 talloc_free(ulnk->dest);
667 ulnk->dest = talloc_strdup(ulnk, argv[0]);
668
669 hosts = gethostbyname(ulnk->dest);
Holger Hans Peter Freyther7942abc2010-09-30 00:34:46 +0800670 if (!hosts || hosts->h_length < 1 || hosts->h_addrtype != AF_INET) {
671 vty_out(vty, "Failed to resolve '%s'%s", argv[0], VTY_NEWLINE);
672 return CMD_WARNING;
673 }
Holger Hans Peter Freyther71760302011-02-22 20:57:08 +0100674 ulnk->remote.sin_addr = * (struct in_addr *) hosts->h_addr_list[0];
Holger Hans Peter Freyther7942abc2010-09-30 00:34:46 +0800675
Holger Hans Peter Freyther71760302011-02-22 20:57:08 +0100676 if (snmp_mtp_peer_name(ulnk->session, ulnk->dest) != 0) {
677 vty_out(vty, "%%Failed to open SNMP port on link %d.%s",
678 link->nr, VTY_NEWLINE);
679 return CMD_WARNING;
680 }
681
Holger Hans Peter Freyther7942abc2010-09-30 00:34:46 +0800682 return CMD_SUCCESS;
683}
684
Holger Hans Peter Freyther71760302011-02-22 20:57:08 +0100685DEFUN(cfg_link_udp_dest_port, cfg_link_udp_dest_port_cmd,
686 "udp dest port <1-65535>",
687 "UDP Transport\n" "Set the port number\n" "Port\n")
Holger Hans Peter Freyther7942abc2010-09-30 00:34:46 +0800688{
Holger Hans Peter Freyther71760302011-02-22 20:57:08 +0100689 struct mtp_link *link = vty->index;
690 struct mtp_udp_link *ulnk;
691
692 if (link->type != SS7_LTYPE_UDP) {
693 vty_out(vty, "%%This only applies to UDP links.%s", VTY_NEWLINE);
694 return CMD_WARNING;
695 }
696
697 ulnk = link->data;
698 ulnk->remote.sin_port = htons(atoi(argv[0]));
Holger Hans Peter Freyther7942abc2010-09-30 00:34:46 +0800699 return CMD_SUCCESS;
700}
701
Holger Hans Peter Freyther71760302011-02-22 20:57:08 +0100702DEFUN(cfg_link_udp_reset, cfg_link_udp_reset_cmd,
703 "udp reset-timeout <1-65535>",
704 "UDP Transport\n" "Reset timeout after a failure\n" "Seconds\n")
Holger Hans Peter Freyther7942abc2010-09-30 00:34:46 +0800705{
Holger Hans Peter Freyther71760302011-02-22 20:57:08 +0100706 struct mtp_link *link = vty->index;
707 struct mtp_udp_link *ulnk;
708
709 if (link->type != SS7_LTYPE_UDP) {
710 vty_out(vty, "%%This only applies to UDP links.%s", VTY_NEWLINE);
711 return CMD_WARNING;
712 }
713
714 ulnk = link->data;
715 ulnk->reset_timeout = atoi(argv[0]);
Holger Hans Peter Freyther7942abc2010-09-30 00:34:46 +0800716 return CMD_SUCCESS;
717}
718
Holger Hans Peter Freyther71760302011-02-22 20:57:08 +0100719DEFUN(cfg_link_udp_link_index, cfg_link_udp_link_index_cmd,
720 "udp link-index <0-65535>",
721 "UDP Transport\n" "Link index\n" "Index\n")
Holger Hans Peter Freyther7942abc2010-09-30 00:34:46 +0800722{
Holger Hans Peter Freyther71760302011-02-22 20:57:08 +0100723 struct mtp_link *link = vty->index;
724 struct mtp_udp_link *ulnk;
725
726 if (link->type != SS7_LTYPE_UDP) {
727 vty_out(vty, "%%This only applies to UDP links.%s", VTY_NEWLINE);
728 return CMD_WARNING;
729 }
730
731 ulnk = link->data;
732 ulnk->link_index = atoi(argv[0]);
Holger Hans Peter Freyther7942abc2010-09-30 00:34:46 +0800733 return CMD_SUCCESS;
734}
735
Holger Hans Peter Freyther71760302011-02-22 20:57:08 +0100736DEFUN(cfg_link_m2ua_as, cfg_link_m2ua_as_cmd,
737 "m2ua application-server NAME",
738 "M2UA Transport\n" "Application Server Name\n" "Name\n")
Holger Hans Peter Freytherc6bfa272011-01-22 17:06:34 +0100739{
Holger Hans Peter Freyther71760302011-02-22 20:57:08 +0100740 struct mtp_link *link = vty->index;
741 struct mtp_m2ua_link *m2ua;
742
743 if (link->type != SS7_LTYPE_M2UA) {
744 vty_out(vty, "%%This only applies to M2UA links.%s", VTY_NEWLINE);
745 return CMD_WARNING;
746 }
747
748 m2ua = link->data;
749 if (m2ua->as)
750 talloc_free(m2ua->as);
751 m2ua->as = talloc_strdup(m2ua, argv[0]);
Holger Hans Peter Freytherc6bfa272011-01-22 17:06:34 +0100752 return CMD_SUCCESS;
753}
754
Holger Hans Peter Freyther71760302011-02-22 20:57:08 +0100755DEFUN(cfg_link_m2ua_link_index, cfg_link_m2ua_link_index_cmd,
756 "m2ua link-index <0-65535>",
757 "M2UA Transport\n" "Link index\n" "Index\n")
Holger Hans Peter Freyther7942abc2010-09-30 00:34:46 +0800758{
Holger Hans Peter Freyther71760302011-02-22 20:57:08 +0100759 struct mtp_link *link = vty->index;
760 struct mtp_m2ua_link *m2ua;
761
762 if (link->type != SS7_LTYPE_M2UA) {
763 vty_out(vty, "%%This only applies to M2UA links.%s", VTY_NEWLINE);
764 return CMD_WARNING;
765 }
766
767 m2ua = link->data;
768 m2ua->link_index = atoi(argv[0]);
769 return CMD_SUCCESS;
770}
771
Holger Hans Peter Freytherd2f21e02015-03-23 16:19:37 +0100772
773DEFUN(cfg_link_m3ua_client_source_ip, cfg_link_m3ua_client_source_ip_cmd,
774 "m3ua-client source ip HOST_NAME",
775 "M3UA Client\n" "Source Address\n" "IP\n" "Hostname or IPv4 address\n")
776{
777 struct hostent *hosts;
778
779 struct mtp_link *link = vty->index;
780 struct mtp_m3ua_client_link *m3ua_link;
781
782 if (link->type != SS7_LTYPE_M3UA_CLIENT) {
783 vty_out(vty, "%%This only applies to UDP links.%s", VTY_NEWLINE);
784 return CMD_WARNING;
785 }
786
787 m3ua_link = link->data;
788
789 talloc_free(m3ua_link->source);
790 m3ua_link->source = talloc_strdup(m3ua_link, argv[0]);
791
792 hosts = gethostbyname(m3ua_link->source);
793 if (!hosts || hosts->h_length < 1 || hosts->h_addrtype != AF_INET) {
794 vty_out(vty, "Failed to resolve '%s'%s", argv[0], VTY_NEWLINE);
795 return CMD_WARNING;
796 }
797 m3ua_link->local.sin_addr = * (struct in_addr *) hosts->h_addr_list[0];
798 return CMD_SUCCESS;
799}
800
801DEFUN(cfg_link_m3ua_client_source_port, cfg_link_m3ua_client_source_port_cmd,
802 "m3ua-client source port <1-65535>",
803 "M3UA Client\n" "Source Address\n" "Port\n" "Number\n")
804{
805 struct mtp_link *link = vty->index;
806 struct mtp_m3ua_client_link *m3ua_link;
807
808 if (link->type != SS7_LTYPE_M3UA_CLIENT) {
809 vty_out(vty, "%%This only applies to UDP links.%s", VTY_NEWLINE);
810 return CMD_WARNING;
811 }
812
813 m3ua_link = link->data;
814 m3ua_link->local.sin_port = htons(atoi(argv[0]));
815 return CMD_SUCCESS;
816}
817
818DEFUN(cfg_link_m3ua_client_dest_ip, cfg_link_m3ua_client_dest_ip_cmd,
819 "m3ua-client dest ip HOST_NAME",
820 "M3UA Client\n" "Destination Address\n" "IP\n" "Hostname or IPv4 address\n")
821{
822 struct hostent *hosts;
823
824 struct mtp_link *link = vty->index;
825 struct mtp_m3ua_client_link *m3ua_link;
826
827 if (link->type != SS7_LTYPE_M3UA_CLIENT) {
828 vty_out(vty, "%%This only applies to M3UA client links.%s", VTY_NEWLINE);
829 return CMD_WARNING;
830 }
831
832 m3ua_link = link->data;
833
834 talloc_free(m3ua_link->dest);
835 m3ua_link->dest = talloc_strdup(m3ua_link, argv[0]);
836
837 hosts = gethostbyname(m3ua_link->dest);
838 if (!hosts || hosts->h_length < 1 || hosts->h_addrtype != AF_INET) {
839 vty_out(vty, "Failed to resolve '%s'%s", argv[0], VTY_NEWLINE);
840 return CMD_WARNING;
841 }
842 m3ua_link->remote.sin_addr = * (struct in_addr *) hosts->h_addr_list[0];
843 return CMD_SUCCESS;
844}
845
846DEFUN(cfg_link_m3ua_client_dest_port, cfg_link_m3ua_client_dest_port_cmd,
847 "m3ua-client dest port <1-65535>",
848 "M3UA Client\n" "Destination Address\n" "Port\n" "Number\n")
849{
850 struct mtp_link *link = vty->index;
851 struct mtp_m3ua_client_link *m3ua_link;
852
853 if (link->type != SS7_LTYPE_M3UA_CLIENT) {
854 vty_out(vty, "%%This only applies to M3UA client links.%s", VTY_NEWLINE);
855 return CMD_WARNING;
856 }
857
858 m3ua_link = link->data;
859 m3ua_link->remote.sin_port = htons(atoi(argv[0]));
860 return CMD_SUCCESS;
861}
862
863DEFUN(cfg_link_m3ua_client_link_index, cfg_link_m3ua_client_link_index_cmd,
864 "m3ua-client link-index <0-65535>",
865 "M3UA Client\n" "Link index\n" "Index\n")
866{
867 struct mtp_link *link = vty->index;
868 struct mtp_m3ua_client_link *m3ua_link;
869
870 if (link->type != SS7_LTYPE_M3UA_CLIENT) {
871 vty_out(vty, "%%This only applies to M3UA client links.%s", VTY_NEWLINE);
872 return CMD_WARNING;
873 }
874
875 m3ua_link = link->data;
876 m3ua_link->link_index = atoi(argv[0]);
877 return CMD_SUCCESS;
878}
879
880DEFUN(cfg_link_m3ua_client_routing_ctx, cfg_link_m3ua_client_routing_ctx_cmd,
881 "m3ua-client routing-context <0-65535>",
882 "M3UA Client\n" "Routing Context\n" "Nunber\n")
883{
884 struct mtp_link *link = vty->index;
885 struct mtp_m3ua_client_link *m3ua_link;
886
887 if (link->type != SS7_LTYPE_M3UA_CLIENT) {
888 vty_out(vty, "%%This only applies to M3UA client links.%s", VTY_NEWLINE);
889 return CMD_WARNING;
890 }
891
892 m3ua_link = link->data;
893 m3ua_link->routing_context = atoi(argv[0]);
894 return CMD_SUCCESS;
895}
896
Holger Hans Peter Freyther6a441c82015-04-16 22:31:41 +0200897DEFUN(cfg_link_m3ua_client_traffic_mode, cfg_link_m3ua_client_traffic_mode_cmd,
898 "m3ua-client traffic-mode (override|loadshare|broadcast)",
899 "M3UA Client\n" "Traffic Mode\n" "Override" "Loadshare\n" "Broadcast\n")
900{
901 struct mtp_link *link = vty->index;
902 struct mtp_m3ua_client_link *m3ua_link;
903
904 if (link->type != SS7_LTYPE_M3UA_CLIENT) {
905 vty_out(vty, "%%This only applies to M3UA client links.%s", VTY_NEWLINE);
906 return CMD_WARNING;
907 }
908
909 m3ua_link = link->data;
910 m3ua_link->traffic_mode = m3ua_traffic_mode_num(argv[0]);
911 return CMD_SUCCESS;
912}
913
Holger Hans Peter Freythera41c9922015-10-09 14:48:05 +0200914DEFUN(cfg_link_m3ua_client_lnk_up_tout, cfg_link_m3ua_client_lnk_up_tout_cmd,
915 "m3ua-client link-up-timeout <0-100000>",
916 "M3UA Client\n" "ASPAC_ACK timeout\n" "Timeout in seconds\n")
917{
918 struct mtp_link *link = vty->index;
919 struct mtp_m3ua_client_link *m3ua_link;
920
921 if (link->type != SS7_LTYPE_M3UA_CLIENT) {
922 vty_out(vty, "%%This only applies to M3UA client links.%s", VTY_NEWLINE);
923 return CMD_WARNING;
924 }
925
926 m3ua_link = link->data;
927 m3ua_link->aspac_ack_timeout = atoi(argv[0]);
928 return CMD_SUCCESS;
929}
930
Holger Hans Peter Freyther71760302011-02-22 20:57:08 +0100931DEFUN(cfg_ss7_msc, cfg_ss7_msc_cmd,
932 "msc <0-100>",
933 "MSC Connection\n" "MSC Number\n")
934{
935 struct msc_connection *msc;
936 int nr;
937
938 nr = atoi(argv[0]);
939 if (nr > bsc->num_mscs) {
940 vty_out(vty, "%% The next unused MSC number is %u%s",
941 bsc->num_mscs, VTY_NEWLINE);
942 return CMD_WARNING;
943 } else if (nr == bsc->num_mscs) {
944 msc = msc_connection_create(bsc, 1);
945 } else
946 msc = msc_connection_num(bsc, nr);
947
948 if (!msc) {
949 vty_out(vty, "%% Unable to allocate MSC %u%s",
950 nr, VTY_NEWLINE);
951 return CMD_WARNING;
952 }
953
954 vty->node = MSC_NODE;
955 vty->index = msc;
956 vty->index_sub = &msc->name;
Holger Hans Peter Freyther7942abc2010-09-30 00:34:46 +0800957 return CMD_SUCCESS;
958}
959
Holger Hans Peter Freythera5a17fa2013-03-19 22:29:41 +0100960DEFUN(cfg_msc_mode, cfg_msc_mode_cmd,
961 "mode (server|client)",
962 "Change the mode of the A-link\n"
963 "Accept incoming connection\n" "Open outgoing connection\n")
964{
965 struct msc_connection *msc = vty->index;
966
967 switch (argv[0][0]) {
968 case 's':
969 msc->mode = MSC_MODE_SERVER;
970 break;
971 case 'c':
972 msc->mode = MSC_MODE_CLIENT;
973 break;
974 }
975
976 return CMD_SUCCESS;
977}
978
Holger Hans Peter Freyther7942abc2010-09-30 00:34:46 +0800979DEFUN(cfg_msc_ip, cfg_msc_ip_cmd,
Holger Hans Peter Freyther71760302011-02-22 20:57:08 +0100980 "ip ADDR",
981 "IP Address of the MSC\n" "Address\n")
Holger Hans Peter Freyther7942abc2010-09-30 00:34:46 +0800982{
983 struct hostent *hosts;
Holger Hans Peter Freyther71760302011-02-22 20:57:08 +0100984 struct msc_connection *msc;
Holger Hans Peter Freyther84ec8712011-02-15 20:01:47 +0100985
Holger Hans Peter Freyther71760302011-02-22 20:57:08 +0100986 msc = vty->index;
Holger Hans Peter Freyther7942abc2010-09-30 00:34:46 +0800987 hosts = gethostbyname(argv[0]);
988 if (!hosts || hosts->h_length < 1 || hosts->h_addrtype != AF_INET) {
989 vty_out(vty, "Failed to resolve '%s'%s", argv[0], VTY_NEWLINE);
990 return CMD_WARNING;
991 }
992
Holger Hans Peter Freyther84ec8712011-02-15 20:01:47 +0100993 if (msc->ip)
994 talloc_free(msc->ip);
Holger Hans Peter Freyther71760302011-02-22 20:57:08 +0100995
996 msc->ip = talloc_strdup(msc,
997 inet_ntoa(*((struct in_addr *) hosts->h_addr_list[0])));
Holger Hans Peter Freyther7942abc2010-09-30 00:34:46 +0800998 return CMD_SUCCESS;
999}
1000
Holger Hans Peter Freythera5a17fa2013-03-19 22:29:41 +01001001DEFUN(cfg_msc_port, cfg_msc_port_cmd,
1002 "port <1-65535>",
1003 "Port for the TCP connection\n" "Port Number\n")
1004{
1005 struct msc_connection *msc = vty->index;
1006 msc->port = atoi(argv[0]);
1007 return CMD_SUCCESS;
1008}
1009
Holger Hans Peter Freyther7942abc2010-09-30 00:34:46 +08001010DEFUN(cfg_msc_token, cfg_msc_token_cmd,
Holger Hans Peter Freyther71760302011-02-22 20:57:08 +01001011 "token TOKEN",
1012 "Token for the MSC\n" "The token\n")
Holger Hans Peter Freyther7942abc2010-09-30 00:34:46 +08001013{
Holger Hans Peter Freyther71760302011-02-22 20:57:08 +01001014 struct msc_connection *msc = vty->index;
Holger Hans Peter Freyther84ec8712011-02-15 20:01:47 +01001015
1016 if (msc->token)
1017 talloc_free(msc->token);
1018 msc->token = talloc_strdup(msc, argv[0]);
Holger Hans Peter Freyther7942abc2010-09-30 00:34:46 +08001019 return CMD_SUCCESS;
1020}
1021
Holger Hans Peter Freyther71760302011-02-22 20:57:08 +01001022DEFUN(cfg_msc_dscp, cfg_msc_dscp_cmd,
1023 "dscp <0-255>",
1024 "DSCP for the IP Connection\n" "Nr\n")
Holger Hans Peter Freyther7942abc2010-09-30 00:34:46 +08001025{
Holger Hans Peter Freyther71760302011-02-22 20:57:08 +01001026 struct msc_connection *msc = vty->index;
1027 msc->dscp = atoi(argv[0]);
1028 return CMD_SUCCESS;
1029}
Holger Hans Peter Freyther84ec8712011-02-15 20:01:47 +01001030
Holger Hans Peter Freyther71760302011-02-22 20:57:08 +01001031DEFUN(cfg_msc_timeout_ping, cfg_msc_timeout_ping_cmd,
1032 "timeout ping <1-65535>",
1033 "Timeout commands\n" "Time between pings\n" "Seconds\n")
1034{
1035 struct msc_connection *msc = vty->index;
Holger Hans Peter Freyther84ec8712011-02-15 20:01:47 +01001036 msc->ping_time = atoi(argv[0]);
Holger Hans Peter Freyther7942abc2010-09-30 00:34:46 +08001037 return CMD_SUCCESS;
1038}
1039
Holger Hans Peter Freyther71760302011-02-22 20:57:08 +01001040DEFUN(cfg_msc_timeout_pong, cfg_msc_timeout_pong_cmd,
1041 "timeout pong <1-65535>",
1042 "Timeout commands\n" "Time between pongs\n" "Seconds\n")
Holger Hans Peter Freyther7942abc2010-09-30 00:34:46 +08001043{
Holger Hans Peter Freyther71760302011-02-22 20:57:08 +01001044 struct msc_connection *msc = vty->index;
Holger Hans Peter Freyther84ec8712011-02-15 20:01:47 +01001045 msc->pong_time = atoi(argv[0]);
Holger Hans Peter Freyther7942abc2010-09-30 00:34:46 +08001046 return CMD_SUCCESS;
1047}
1048
Holger Hans Peter Freyther71760302011-02-22 20:57:08 +01001049DEFUN(cfg_msc_timeout_restart, cfg_msc_timeout_restart_cmd,
1050 "timeout restart <1-65535>",
1051 "Timeout commands\n" "Time between restarts\n" "Seconds\n")
Holger Hans Peter Freyther7942abc2010-09-30 00:34:46 +08001052{
Holger Hans Peter Freyther71760302011-02-22 20:57:08 +01001053 struct msc_connection *msc = vty->index;
Holger Hans Peter Freyther84ec8712011-02-15 20:01:47 +01001054 msc->msc_time = atoi(argv[0]);
Holger Hans Peter Freyther7942abc2010-09-30 00:34:46 +08001055 return CMD_SUCCESS;
1056}
1057
Holger Hans Peter Freyther71760302011-02-22 20:57:08 +01001058DEFUN(cfg_ss7_app, cfg_ss7_app_cmd,
1059 "application <0-100>",
1060 "Application Commands\n" "Number\n")
Holger Hans Peter Freytherf603f282011-01-30 00:24:15 +01001061{
Holger Hans Peter Freyther71760302011-02-22 20:57:08 +01001062 struct ss7_application *app;
1063 int nr;
1064
1065 nr = atoi(argv[0]);
1066 if (nr > bsc->num_apps) {
1067 vty_out(vty, "%% The next unused Application number is %u%s",
1068 bsc->num_apps, VTY_NEWLINE);
1069 return CMD_WARNING;
1070 } else if (nr == bsc->num_apps) {
1071 app = ss7_application_alloc(bsc);
1072 } else
1073 app = ss7_application_num(bsc, nr);
1074
1075 if (!app) {
1076 vty_out(vty, "%% Unable to allocate Application %u%s",
1077 nr, VTY_NEWLINE);
1078 return CMD_WARNING;
1079 }
1080
1081 vty->node = APP_NODE;
1082 vty->index = app;
1083 vty->index_sub = &app->name;
1084 return CMD_SUCCESS;
1085}
1086
1087DEFUN(cfg_app_type, cfg_app_type_cmd,
1088 "type (none|stp|relay|msc)",
1089 "Type of Application\n"
1090 "No type\n" "Signalling Transfer Point\n"
1091 "Relay SCCP/ISUP messages\n" "MSC connector with state\n")
1092{
1093 enum ss7_app_type type;
1094 struct ss7_application *app = vty->index;
1095
1096 switch (argv[0][0]) {
1097 case 'm':
1098 type = APP_CELLMGR;
1099 break;
1100 case 'r':
1101 type = APP_RELAY;
1102 break;
1103 case 's':
1104 type = APP_STP;
1105 break;
1106 default:
1107 case 'n':
1108 type = APP_NONE;
1109 break;
1110 }
1111
1112 if (app->type != APP_NONE && app->type != type) {
1113 vty_out(vty, "The type can not be changed at runtime on app %d.%s",
1114 app->nr, VTY_NEWLINE);
1115 return CMD_WARNING;
1116 }
1117
1118 app->type = type;
1119 return CMD_SUCCESS;
1120}
1121
1122DEFUN(cfg_app_isup_pass, cfg_app_isup_pass_cmd,
1123 "isup-pass-through (0|1)",
1124 "Pass all ISUP messages\n" "Handle some ISUP locally\n" "Pass all messages\n")
1125{
1126 struct ss7_application *app = vty->index;
1127
1128 if (app->type != APP_STP) {
1129 vty_out(vty, "%%Need to use the 'stp' app for this option on app %d.%s",
1130 app->nr, VTY_NEWLINE);
1131 return CMD_WARNING;
1132 }
1133
Holger Hans Peter Freythercfe9d712011-02-17 20:32:09 +01001134 ss7_application_pass_isup(app, atoi(argv[0]));
Holger Hans Peter Freyther71760302011-02-22 20:57:08 +01001135 return CMD_SUCCESS;
1136}
1137
Holger Hans Peter Freyther2f79ae92015-09-21 16:52:03 +02001138DEFUN(cfg_app_fail, cfg_app_fail_cmd,
1139 "on-msc-down-force-down",
1140 "When the MSC connection is down force MTP linksets down\n")
1141{
1142 struct ss7_application *app = vty->index;
1143
1144 /* check if there is a MSC route? */
1145 app->force_down = 1;
1146 return CMD_SUCCESS;
1147}
1148
1149DEFUN(cfg_app_no_fail, cfg_app_no_fail_cmd,
1150 "no on-msc-down-force-down",
1151 NO_STR "When the MSC connection is down force MTP linksets down\n")
1152{
1153 struct ss7_application *app = vty->index;
1154
1155 /* check if there is a MSC route? */
1156 app->force_down = 0;
1157 return CMD_SUCCESS;
1158}
1159
Holger Hans Peter Freyther71760302011-02-22 20:57:08 +01001160DEFUN(cfg_app_route, cfg_app_route_cmd,
1161 "route linkset <0-100> msc <0-100>",
1162 "Routing commands\n" "Source Linkset\n" "Linkset Nr\n"
1163 "Dest MSC\n" "MSC Nr\n")
1164{
1165 struct ss7_application *app = vty->index;
1166
1167 if (app->type != APP_CELLMGR && app->type != APP_RELAY) {
1168 vty_out(vty, "The app type needs to be 'relay' or 'msc'.%s", VTY_NEWLINE);
1169 return CMD_WARNING;
1170 }
1171
1172 if (ss7_application_setup(app, app->type,
1173 SS7_SET_LINKSET, atoi(argv[0]),
1174 SS7_SET_MSC, atoi(argv[1])) != 0) {
1175 vty_out(vty, "Failed to route linkset %d to msc %d.%s",
1176 atoi(argv[0]), atoi(argv[1]), VTY_NEWLINE);
1177 return CMD_WARNING;
1178 }
Holger Hans Peter Freytherf603f282011-01-30 00:24:15 +01001179
1180 return CMD_SUCCESS;
1181}
1182
Holger Hans Peter Freyther71760302011-02-22 20:57:08 +01001183DEFUN(cfg_app_route_ls, cfg_app_route_ls_cmd,
1184 "route linkset <0-100> linkset <0-100>",
1185 "Routing commands\n" "Source Linkset\n" "Linkset Nr\n"
1186 "Dest Linkset\n" "Linkset Nr\n" )
1187{
1188 struct ss7_application *app = vty->index;
1189
1190 if (app->type != APP_STP) {
1191 vty_out(vty, "The app type needs to be 'stp'.%s", VTY_NEWLINE);
1192 return CMD_WARNING;
1193 }
1194
1195 if (ss7_application_setup(app, app->type,
1196 SS7_SET_LINKSET, atoi(argv[0]),
1197 SS7_SET_LINKSET, atoi(argv[1])) != 0) {
1198 vty_out(vty, "Failed to route linkset %d to linkset %d.%s",
1199 atoi(argv[0]), atoi(argv[1]), VTY_NEWLINE);
1200 return CMD_WARNING;
1201 }
1202
1203 return CMD_SUCCESS;
1204}
1205
Holger Hans Peter Freytherfc98ce22011-09-13 20:08:57 +02001206#define MGCP_DOMAIN_STR "MGCP domain name to use\n"
1207
1208DEFUN(cfg_app_domain_name, cfg_app_domain_name_cmd,
1209 "domain-name NAME",
1210 MGCP_DOMAIN_STR "Domain Name\n")
1211{
1212 struct ss7_application *app = vty->index;
1213
1214 if (app->type != APP_CELLMGR) {
1215 vty_out(vty, "The app type needs to be 'msc'.%s", VTY_NEWLINE);
1216 return CMD_WARNING;
1217 }
1218
1219 if (ss7_application_mgcp_domain_name(app, argv[0]) != 0) {
1220 vty_out(vty, "Failed to set the domain name.%s", VTY_NEWLINE);
1221 return CMD_WARNING;
1222 }
1223
1224 return CMD_SUCCESS;
1225}
1226
1227DEFUN(cfg_app_no_domain_name, cfg_app_no_domain_name_cmd,
1228 "no domain-name",
1229 NO_STR MGCP_DOMAIN_STR)
1230{
1231 struct ss7_application *app = vty->index;
1232
1233 if (app->type != APP_CELLMGR) {
1234 vty_out(vty, "The app type needs to be 'msc'.%s", VTY_NEWLINE);
1235 return CMD_WARNING;
1236 }
1237
1238 talloc_free(app->mgcp_domain_name);
1239 app->mgcp_domain_name = NULL;
1240 return CMD_SUCCESS;
1241}
1242
Holger Hans Peter Freytherb35c5c32012-12-11 15:32:09 +01001243#define TRUNK_NAME_STR "Trunk name to use\n"
1244
1245DEFUN(cfg_app_trunk_name, cfg_app_trunk_name_cmd,
1246 "trunk-name NAME",
1247 TRUNK_NAME_STR "The name\n")
1248{
1249 struct ss7_application *app = vty->index;
1250
1251 if (app->type != APP_STP) {
1252 vty_out(vty, "The app type needs to be 'stp'.%s", VTY_NEWLINE);
1253 return CMD_WARNING;
1254 }
1255
1256 if (ss7_application_trunk_name(app, argv[0]) != 0) {
1257 vty_out(vty, "Failed to set the trunk name.%s", VTY_NEWLINE);
1258 return CMD_WARNING;
1259 }
1260
1261 return CMD_SUCCESS;
1262}
1263
1264DEFUN(cfg_app_no_trunk_name, cfg_app_no_trunk_name_cmd,
1265 "no trunk-name NAME",
1266 NO_STR TRUNK_NAME_STR "The name\n")
1267{
1268 struct ss7_application *app = vty->index;
1269
1270 if (app->type != APP_STP) {
1271 vty_out(vty, "The app type needs to be 'stp'.%s", VTY_NEWLINE);
1272 return CMD_WARNING;
1273 }
1274
1275 talloc_free(app->trunk_name);
1276 app->trunk_name = NULL;
1277 return CMD_SUCCESS;
1278}
Holger Hans Peter Freytherfc98ce22011-09-13 20:08:57 +02001279
Holger Hans Peter Freytherd90834c2013-04-22 17:55:39 +02001280DEFUN(cfg_app_forward_only, cfg_app_forward_only_cmd,
1281 "forward-only",
1282 "Forward SCCP messages untouched to/from a IPA/SCCP connection\n")
1283{
1284 struct ss7_application *app = vty->index;
1285 app->forward_only = 1;
1286 return CMD_SUCCESS;
1287}
1288
1289DEFUN(cfg_app_no_forward_only, cfg_app_no_forward_only_cmd,
1290 "no forward-only",
1291 NO_STR "Forward SCCP messages untouched to/from a IPA/SCCP connection\n")
1292{
1293 struct ss7_application *app = vty->index;
1294 app->forward_only = 0;
1295 return CMD_SUCCESS;
1296}
1297
Holger Hans Peter Freyther4db78de2013-05-13 21:08:36 +02001298DEFUN(cfg_app_hardcode_ass, cfg_app_hardcode_ass_cmd,
1299 "hardcode-assignment-complete",
1300 "Hardcode the assignment complete message to HR3\n")
1301{
1302 struct ss7_application *app = vty->index;
1303 app->fixed_ass_cmpl_reply = 1;
1304 return CMD_SUCCESS;
1305}
1306
1307DEFUN(cfg_app_no_hardcode_ass, cfg_app_no_hardcode_ass_cmd,
1308 "no hardcode-assignment-complete",
1309 "Hardcode the assignment complete message to HR3\n")
1310{
1311 struct ss7_application *app = vty->index;
1312 app->fixed_ass_cmpl_reply = 0;
1313 return CMD_SUCCESS;
1314}
1315
Holger Hans Peter Freyther71760302011-02-22 20:57:08 +01001316static void install_defaults(int node)
1317{
1318 install_default(node);
1319 install_element(node, &node_exit_cmd);
1320 install_element(node, &node_end_cmd);
1321 install_element(node, &cfg_description_cmd);
1322 install_element(node, &cfg_no_description_cmd);
1323}
1324
Holger Hans Peter Freyther29176442011-02-22 16:00:36 +01001325extern void cell_vty_init_cmds(void);
Holger Hans Peter Freyther7942abc2010-09-30 00:34:46 +08001326void cell_vty_init(void)
1327{
1328 cmd_init(1);
1329 vty_init(&vty_info);
Harald Welteff397ed2011-05-08 10:29:23 +02001330 logging_vty_add_cmds(&log_info);
Holger Hans Peter Freyther7942abc2010-09-30 00:34:46 +08001331
Holger Hans Peter Freyther71760302011-02-22 20:57:08 +01001332 install_element(CONFIG_NODE, &cfg_ss7_cmd);
1333 install_node(&ss7_node, config_write_ss7);
1334 install_defaults(SS7_NODE);
1335 install_element(SS7_NODE, &cfg_ss7_udp_src_port_cmd);
1336 install_element(SS7_NODE, &cfg_ss7_m2ua_src_port_cmd);
Holger Hans Peter Freyther7942abc2010-09-30 00:34:46 +08001337
Holger Hans Peter Freyther71760302011-02-22 20:57:08 +01001338 install_element(SS7_NODE, &cfg_ss7_linkset_cmd);
1339 install_node(&linkset_node, config_write_linkset);
1340 install_defaults(LINKSETS_NODE);
1341 install_element(LINKSETS_NODE, &cfg_linkset_mtp3_dpc_cmd);
1342 install_element(LINKSETS_NODE, &cfg_linkset_mtp3_opc_cmd);
1343 install_element(LINKSETS_NODE, &cfg_linkset_mtp3_ni_cmd);
1344 install_element(LINKSETS_NODE, &cfg_linkset_mtp3_spare_cmd);
1345 install_element(LINKSETS_NODE, &cfg_linkset_mtp3_ssn_cmd);
1346 install_element(LINKSETS_NODE, &cfg_linkset_no_mtp3_ssn_cmd);
1347 install_element(LINKSETS_NODE, &cfg_linkset_sltm_once_cmd);
Holger Hans Peter Freyther47c9faa2011-02-23 11:25:45 +01001348 install_element(LINKSETS_NODE, &cfg_linkset_t18_cmd);
1349 install_element(LINKSETS_NODE, &cfg_linkset_t20_cmd);
Holger Hans Peter Freyther60bc8e72012-01-16 11:51:18 +01001350 install_element(LINKSETS_NODE, &cfg_linkset_mtp3_isup_opc_cmd);
1351 install_element(LINKSETS_NODE, &cfg_linkset_no_mtp3_isup_opc_cmd);
1352 install_element(LINKSETS_NODE, &cfg_linkset_mtp3_sccp_opc_cmd);
1353 install_element(LINKSETS_NODE, &cfg_linkset_no_mtp3_sccp_opc_cmd);
1354 install_element(LINKSETS_NODE, &cfg_linkset_mtp3_isup_dpc_cmd);
1355 install_element(LINKSETS_NODE, &cfg_linkset_no_mtp3_isup_dpc_cmd);
1356 install_element(LINKSETS_NODE, &cfg_linkset_mtp3_sccp_dpc_cmd);
1357 install_element(LINKSETS_NODE, &cfg_linkset_no_mtp3_sccp_dpc_cmd);
Holger Hans Peter Freyther71760302011-02-22 20:57:08 +01001358
1359 install_element(LINKSETS_NODE, &cfg_linkset_link_cmd);
1360 install_node(&link_node, dummy_write);
1361 install_defaults(LINK_NODE);
1362 install_element(LINK_NODE, &cfg_link_ss7_transport_cmd);
1363 install_element(LINK_NODE, &cfg_link_udp_dest_ip_cmd);
1364 install_element(LINK_NODE, &cfg_link_udp_dest_port_cmd);
1365 install_element(LINK_NODE, &cfg_link_udp_reset_cmd);
1366 install_element(LINK_NODE, &cfg_link_udp_link_index_cmd);
1367 install_element(LINK_NODE, &cfg_link_m2ua_as_cmd);
1368 install_element(LINK_NODE, &cfg_link_m2ua_link_index_cmd);
Holger Hans Peter Freytherd2f21e02015-03-23 16:19:37 +01001369 install_element(LINK_NODE, &cfg_link_m3ua_client_source_ip_cmd);
1370 install_element(LINK_NODE, &cfg_link_m3ua_client_source_port_cmd);
1371 install_element(LINK_NODE, &cfg_link_m3ua_client_dest_ip_cmd);
1372 install_element(LINK_NODE, &cfg_link_m3ua_client_dest_port_cmd);
1373 install_element(LINK_NODE, &cfg_link_m3ua_client_link_index_cmd);
1374 install_element(LINK_NODE, &cfg_link_m3ua_client_routing_ctx_cmd);
Holger Hans Peter Freyther6a441c82015-04-16 22:31:41 +02001375 install_element(LINK_NODE, &cfg_link_m3ua_client_traffic_mode_cmd);
Holger Hans Peter Freythera41c9922015-10-09 14:48:05 +02001376 install_element(LINK_NODE, &cfg_link_m3ua_client_lnk_up_tout_cmd);
Holger Hans Peter Freyther71760302011-02-22 20:57:08 +01001377
1378 install_element(SS7_NODE, &cfg_ss7_msc_cmd);
1379 install_node(&msc_node, config_write_msc);
1380 install_defaults(MSC_NODE);
Holger Hans Peter Freythera5a17fa2013-03-19 22:29:41 +01001381 install_element(MSC_NODE, &cfg_msc_mode_cmd);
Holger Hans Peter Freyther71760302011-02-22 20:57:08 +01001382 install_element(MSC_NODE, &cfg_msc_ip_cmd);
Holger Hans Peter Freythera5a17fa2013-03-19 22:29:41 +01001383 install_element(MSC_NODE, &cfg_msc_port_cmd);
Holger Hans Peter Freyther71760302011-02-22 20:57:08 +01001384 install_element(MSC_NODE, &cfg_msc_token_cmd);
1385 install_element(MSC_NODE, &cfg_msc_dscp_cmd);
1386 install_element(MSC_NODE, &cfg_msc_timeout_ping_cmd);
1387 install_element(MSC_NODE, &cfg_msc_timeout_pong_cmd);
1388 install_element(MSC_NODE, &cfg_msc_timeout_restart_cmd);
1389
1390 install_element(SS7_NODE, &cfg_ss7_app_cmd);
1391 install_node(&app_node, config_write_app);
1392 install_defaults(APP_NODE);
1393 install_element(APP_NODE, &cfg_app_type_cmd);
1394 install_element(APP_NODE, &cfg_app_isup_pass_cmd);
Holger Hans Peter Freyther2f79ae92015-09-21 16:52:03 +02001395 install_element(APP_NODE, &cfg_app_fail_cmd);
1396 install_element(APP_NODE, &cfg_app_no_fail_cmd);
Holger Hans Peter Freyther71760302011-02-22 20:57:08 +01001397 install_element(APP_NODE, &cfg_app_route_cmd);
1398 install_element(APP_NODE, &cfg_app_route_ls_cmd);
Holger Hans Peter Freytherfc98ce22011-09-13 20:08:57 +02001399 install_element(APP_NODE, &cfg_app_domain_name_cmd);
1400 install_element(APP_NODE, &cfg_app_no_domain_name_cmd);
Holger Hans Peter Freytherb35c5c32012-12-11 15:32:09 +01001401 install_element(APP_NODE, &cfg_app_trunk_name_cmd);
1402 install_element(APP_NODE, &cfg_app_no_trunk_name_cmd);
Holger Hans Peter Freytherd90834c2013-04-22 17:55:39 +02001403 install_element(APP_NODE, &cfg_app_forward_only_cmd);
1404 install_element(APP_NODE, &cfg_app_no_forward_only_cmd);
Holger Hans Peter Freyther4db78de2013-05-13 21:08:36 +02001405 install_element(APP_NODE, &cfg_app_hardcode_ass_cmd);
1406 install_element(APP_NODE, &cfg_app_no_hardcode_ass_cmd);
Holger Hans Peter Freyther51b9e7a2011-01-22 16:02:13 +01001407
Holger Hans Peter Freyther29176442011-02-22 16:00:36 +01001408 cell_vty_init_cmds();
Holger Hans Peter Freyther7942abc2010-09-30 00:34:46 +08001409}
1410
1411const char *openbsc_copyright = "";