Neels Hofmeyr | 17518fe | 2017-06-20 04:35:06 +0200 | [diff] [blame] | 1 | /*! \file gprs_ns_vty.c |
| 2 | * VTY interface for our GPRS Networks Service (NS) implementation. */ |
| 3 | /* |
Harald Welte | e08da97 | 2017-11-13 01:00:26 +0900 | [diff] [blame] | 4 | * (C) 2009-2014 by Harald Welte <laforge@gnumonks.org> |
| 5 | * (C) 2016-2017 by sysmocom - s.f.m.c. GmbH |
Harald Welte | 144e029 | 2010-05-13 11:45:07 +0200 | [diff] [blame] | 6 | * |
| 7 | * All Rights Reserved |
| 8 | * |
Harald Welte | e08da97 | 2017-11-13 01:00:26 +0900 | [diff] [blame] | 9 | * SPDX-License-Identifier: GPL-2.0+ |
| 10 | * |
Harald Welte | 144e029 | 2010-05-13 11:45:07 +0200 | [diff] [blame] | 11 | * This program is free software; you can redistribute it and/or modify |
Harald Welte | 7fa89c2 | 2014-10-26 20:33:09 +0100 | [diff] [blame] | 12 | * it under the terms of the GNU General Public License as published by |
| 13 | * the Free Software Foundation; either version 2 of the License, or |
Harald Welte | 144e029 | 2010-05-13 11:45:07 +0200 | [diff] [blame] | 14 | * (at your option) any later version. |
| 15 | * |
| 16 | * This program is distributed in the hope that it will be useful, |
| 17 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 18 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
Harald Welte | 7fa89c2 | 2014-10-26 20:33:09 +0100 | [diff] [blame] | 19 | * GNU General Public License for more details. |
Harald Welte | 144e029 | 2010-05-13 11:45:07 +0200 | [diff] [blame] | 20 | * |
Harald Welte | 7fa89c2 | 2014-10-26 20:33:09 +0100 | [diff] [blame] | 21 | * You should have received a copy of the GNU General Public License |
Harald Welte | e4cbb3f | 2011-01-01 15:25:50 +0100 | [diff] [blame] | 22 | * along with this program. If not, see <http://www.gnu.org/licenses/>. |
Harald Welte | 144e029 | 2010-05-13 11:45:07 +0200 | [diff] [blame] | 23 | * |
| 24 | */ |
| 25 | |
| 26 | #include <stdlib.h> |
| 27 | #include <unistd.h> |
| 28 | #include <errno.h> |
| 29 | #include <stdint.h> |
| 30 | |
| 31 | #include <arpa/inet.h> |
| 32 | |
Pablo Neira Ayuso | ff66323 | 2011-03-22 16:47:59 +0100 | [diff] [blame] | 33 | #include <osmocom/core/msgb.h> |
Harald Welte | bfe62e5 | 2017-05-15 12:48:30 +0200 | [diff] [blame] | 34 | #include <osmocom/core/byteswap.h> |
Pablo Neira Ayuso | ff66323 | 2011-03-22 16:47:59 +0100 | [diff] [blame] | 35 | #include <osmocom/gsm/tlv.h> |
| 36 | #include <osmocom/core/talloc.h> |
| 37 | #include <osmocom/core/select.h> |
| 38 | #include <osmocom/core/rate_ctr.h> |
Harald Welte | 73952e3 | 2012-06-16 14:59:56 +0800 | [diff] [blame] | 39 | #include <osmocom/gprs/gprs_ns.h> |
| 40 | #include <osmocom/gprs/gprs_bssgp.h> |
Max | 37f465e | 2017-10-24 16:04:55 +0200 | [diff] [blame] | 41 | #include <osmocom/core/socket.h> |
Harald Welte | ac1a715 | 2010-05-19 19:45:32 +0200 | [diff] [blame] | 42 | #include <osmocom/vty/vty.h> |
| 43 | #include <osmocom/vty/command.h> |
| 44 | #include <osmocom/vty/logging.h> |
| 45 | #include <osmocom/vty/telnet_interface.h> |
Pablo Neira Ayuso | 167281e | 2011-03-28 19:35:00 +0200 | [diff] [blame] | 46 | #include <osmocom/vty/misc.h> |
Harald Welte | 144e029 | 2010-05-13 11:45:07 +0200 | [diff] [blame] | 47 | |
Harald Welte | 4f5883b | 2012-06-16 16:54:06 +0800 | [diff] [blame] | 48 | #include "common_vty.h" |
Harald Welte | 73952e3 | 2012-06-16 14:59:56 +0800 | [diff] [blame] | 49 | |
Harald Welte | 144e029 | 2010-05-13 11:45:07 +0200 | [diff] [blame] | 50 | static struct gprs_ns_inst *vty_nsi = NULL; |
| 51 | |
| 52 | /* FIXME: this should go to some common file as it is copied |
| 53 | * in vty_interface.c of the BSC */ |
| 54 | static const struct value_string gprs_ns_timer_strs[] = { |
| 55 | { 0, "tns-block" }, |
| 56 | { 1, "tns-block-retries" }, |
| 57 | { 2, "tns-reset" }, |
| 58 | { 3, "tns-reset-retries" }, |
| 59 | { 4, "tns-test" }, |
| 60 | { 5, "tns-alive" }, |
| 61 | { 6, "tns-alive-retries" }, |
| 62 | { 0, NULL } |
| 63 | }; |
| 64 | |
Harald Welte | f543036 | 2012-06-17 12:25:53 +0800 | [diff] [blame] | 65 | static void log_set_nsvc_filter(struct log_target *target, |
| 66 | struct gprs_nsvc *nsvc) |
| 67 | { |
| 68 | if (nsvc) { |
Neels Hofmeyr | 8b86cd7 | 2017-02-23 18:03:28 +0100 | [diff] [blame] | 69 | target->filter_map |= (1 << LOG_FLT_GB_NSVC); |
| 70 | target->filter_data[LOG_FLT_GB_NSVC] = nsvc; |
| 71 | } else if (target->filter_data[LOG_FLT_GB_NSVC]) { |
| 72 | target->filter_map = ~(1 << LOG_FLT_GB_NSVC); |
| 73 | target->filter_data[LOG_FLT_GB_NSVC] = NULL; |
Harald Welte | f543036 | 2012-06-17 12:25:53 +0800 | [diff] [blame] | 74 | } |
| 75 | } |
| 76 | |
Harald Welte | 144e029 | 2010-05-13 11:45:07 +0200 | [diff] [blame] | 77 | static struct cmd_node ns_node = { |
Harald Welte | 4f5883b | 2012-06-16 16:54:06 +0800 | [diff] [blame] | 78 | L_NS_NODE, |
Jacob Erlbeck | 35fe87c | 2013-10-24 01:33:20 +0200 | [diff] [blame] | 79 | "%s(config-ns)# ", |
Harald Welte | 144e029 | 2010-05-13 11:45:07 +0200 | [diff] [blame] | 80 | 1, |
| 81 | }; |
| 82 | |
| 83 | static int config_write_ns(struct vty *vty) |
| 84 | { |
| 85 | struct gprs_nsvc *nsvc; |
| 86 | unsigned int i; |
Harald Welte | 7fb0523 | 2010-05-19 15:09:09 +0200 | [diff] [blame] | 87 | struct in_addr ia; |
Harald Welte | 144e029 | 2010-05-13 11:45:07 +0200 | [diff] [blame] | 88 | |
| 89 | vty_out(vty, "ns%s", VTY_NEWLINE); |
| 90 | |
| 91 | llist_for_each_entry(nsvc, &vty_nsi->gprs_nsvcs, list) { |
| 92 | if (!nsvc->persistent) |
| 93 | continue; |
| 94 | vty_out(vty, " nse %u nsvci %u%s", |
| 95 | nsvc->nsei, nsvc->nsvci, VTY_NEWLINE); |
| 96 | vty_out(vty, " nse %u remote-role %s%s", |
| 97 | nsvc->nsei, nsvc->remote_end_is_sgsn ? "sgsn" : "bss", |
| 98 | VTY_NEWLINE); |
Harald Welte | b3ee265 | 2010-05-19 14:38:50 +0200 | [diff] [blame] | 99 | switch (nsvc->ll) { |
| 100 | case GPRS_NS_LL_UDP: |
| 101 | vty_out(vty, " nse %u encapsulation udp%s", nsvc->nsei, |
| 102 | VTY_NEWLINE); |
Harald Welte | 144e029 | 2010-05-13 11:45:07 +0200 | [diff] [blame] | 103 | vty_out(vty, " nse %u remote-ip %s%s", |
| 104 | nsvc->nsei, |
| 105 | inet_ntoa(nsvc->ip.bts_addr.sin_addr), |
| 106 | VTY_NEWLINE); |
| 107 | vty_out(vty, " nse %u remote-port %u%s", |
Harald Welte | bfe62e5 | 2017-05-15 12:48:30 +0200 | [diff] [blame] | 108 | nsvc->nsei, osmo_ntohs(nsvc->ip.bts_addr.sin_port), |
Harald Welte | 144e029 | 2010-05-13 11:45:07 +0200 | [diff] [blame] | 109 | VTY_NEWLINE); |
Harald Welte | b3ee265 | 2010-05-19 14:38:50 +0200 | [diff] [blame] | 110 | break; |
| 111 | case GPRS_NS_LL_FR_GRE: |
| 112 | vty_out(vty, " nse %u encapsulation framerelay-gre%s", |
| 113 | nsvc->nsei, VTY_NEWLINE); |
| 114 | vty_out(vty, " nse %u remote-ip %s%s", |
| 115 | nsvc->nsei, |
| 116 | inet_ntoa(nsvc->frgre.bts_addr.sin_addr), |
| 117 | VTY_NEWLINE); |
| 118 | vty_out(vty, " nse %u fr-dlci %u%s", |
Harald Welte | bfe62e5 | 2017-05-15 12:48:30 +0200 | [diff] [blame] | 119 | nsvc->nsei, osmo_ntohs(nsvc->frgre.bts_addr.sin_port), |
Harald Welte | b3ee265 | 2010-05-19 14:38:50 +0200 | [diff] [blame] | 120 | VTY_NEWLINE); |
| 121 | default: |
| 122 | break; |
Harald Welte | 144e029 | 2010-05-13 11:45:07 +0200 | [diff] [blame] | 123 | } |
| 124 | } |
| 125 | |
| 126 | for (i = 0; i < ARRAY_SIZE(vty_nsi->timeout); i++) |
| 127 | vty_out(vty, " timer %s %u%s", |
| 128 | get_value_string(gprs_ns_timer_strs, i), |
| 129 | vty_nsi->timeout[i], VTY_NEWLINE); |
| 130 | |
Harald Welte | 7fb0523 | 2010-05-19 15:09:09 +0200 | [diff] [blame] | 131 | if (vty_nsi->nsip.local_ip) { |
Harald Welte | bfe62e5 | 2017-05-15 12:48:30 +0200 | [diff] [blame] | 132 | ia.s_addr = osmo_htonl(vty_nsi->nsip.local_ip); |
Harald Welte | 7fb0523 | 2010-05-19 15:09:09 +0200 | [diff] [blame] | 133 | vty_out(vty, " encapsulation udp local-ip %s%s", |
| 134 | inet_ntoa(ia), VTY_NEWLINE); |
Harald Welte | 7fb0523 | 2010-05-19 15:09:09 +0200 | [diff] [blame] | 135 | } |
Harald Welte | ce4ccbc | 2010-05-19 17:02:57 +0200 | [diff] [blame] | 136 | if (vty_nsi->nsip.local_port) |
| 137 | vty_out(vty, " encapsulation udp local-port %u%s", |
| 138 | vty_nsi->nsip.local_port, VTY_NEWLINE); |
Holger Hans Peter Freyther | 2c3393d | 2013-03-25 11:59:58 +0100 | [diff] [blame] | 139 | if (vty_nsi->nsip.dscp) |
| 140 | vty_out(vty, " encapsulation udp dscp %d%s", |
| 141 | vty_nsi->nsip.dscp, VTY_NEWLINE); |
Harald Welte | ce4ccbc | 2010-05-19 17:02:57 +0200 | [diff] [blame] | 142 | |
Harald Welte | 7fb0523 | 2010-05-19 15:09:09 +0200 | [diff] [blame] | 143 | vty_out(vty, " encapsulation framerelay-gre enabled %u%s", |
| 144 | vty_nsi->frgre.enabled ? 1 : 0, VTY_NEWLINE); |
Harald Welte | ce4ccbc | 2010-05-19 17:02:57 +0200 | [diff] [blame] | 145 | if (vty_nsi->frgre.local_ip) { |
Harald Welte | bfe62e5 | 2017-05-15 12:48:30 +0200 | [diff] [blame] | 146 | ia.s_addr = osmo_htonl(vty_nsi->frgre.local_ip); |
Harald Welte | 7fb0523 | 2010-05-19 15:09:09 +0200 | [diff] [blame] | 147 | vty_out(vty, " encapsulation framerelay-gre local-ip %s%s", |
| 148 | inet_ntoa(ia), VTY_NEWLINE); |
| 149 | } |
| 150 | |
Harald Welte | 144e029 | 2010-05-13 11:45:07 +0200 | [diff] [blame] | 151 | return CMD_SUCCESS; |
| 152 | } |
| 153 | |
| 154 | DEFUN(cfg_ns, cfg_ns_cmd, |
| 155 | "ns", |
| 156 | "Configure the GPRS Network Service") |
| 157 | { |
Harald Welte | 4f5883b | 2012-06-16 16:54:06 +0800 | [diff] [blame] | 158 | vty->node = L_NS_NODE; |
Harald Welte | 144e029 | 2010-05-13 11:45:07 +0200 | [diff] [blame] | 159 | return CMD_SUCCESS; |
| 160 | } |
| 161 | |
Max | cbf5cdf | 2017-10-24 18:18:55 +0200 | [diff] [blame] | 162 | static void dump_nse(struct vty *vty, const struct gprs_nsvc *nsvc, bool stats, bool persistent_only) |
Harald Welte | 9288334 | 2010-05-15 23:04:03 +0200 | [diff] [blame] | 163 | { |
Max | 296511b | 2017-10-24 18:05:35 +0200 | [diff] [blame] | 164 | if (persistent_only) |
| 165 | if (!nsvc->persistent) |
| 166 | return; |
| 167 | |
Max | 37f465e | 2017-10-24 16:04:55 +0200 | [diff] [blame] | 168 | vty_out(vty, "NSEI %5u, NS-VC %5u, %5s %9s, ", |
Harald Welte | 9288334 | 2010-05-15 23:04:03 +0200 | [diff] [blame] | 169 | nsvc->nsei, nsvc->nsvci, |
Max | 4ce24c4 | 2017-10-23 15:09:23 +0200 | [diff] [blame] | 170 | NS_DESC_A(nsvc->state), |
Max | 37f465e | 2017-10-24 16:04:55 +0200 | [diff] [blame] | 171 | NS_DESC_B(nsvc->state)); |
| 172 | |
| 173 | if (nsvc->ll == GPRS_NS_LL_UDP) { |
| 174 | char local[INET6_ADDRSTRLEN + 1]; |
| 175 | int rc = osmo_sock_local_ip((char *)&local, inet_ntoa(nsvc->ip.bts_addr.sin_addr)); |
| 176 | vty_out(vty, "%s:%u ", (rc < 0) ? "unknown" : local, nsvc->nsi->nsip.local_port); |
| 177 | } |
| 178 | |
| 179 | vty_out(vty, "Remote: %-4s, %5s %9s, %s ", |
Max | 32f9971 | 2017-10-20 12:27:49 +0200 | [diff] [blame] | 180 | nsvc->remote_end_is_sgsn ? "SGSN" : "BSS", |
Max | 4ce24c4 | 2017-10-23 15:09:23 +0200 | [diff] [blame] | 181 | NS_DESC_A(nsvc->remote_state), |
Max | 37f465e | 2017-10-24 16:04:55 +0200 | [diff] [blame] | 182 | NS_DESC_B(nsvc->remote_state), gprs_ns_ll_str(nsvc)); |
Max | 9530859 | 2017-10-24 15:54:28 +0200 | [diff] [blame] | 183 | |
Max | 37f465e | 2017-10-24 16:04:55 +0200 | [diff] [blame] | 184 | vty_out(vty, "%s%s", nsvc->ll == GPRS_NS_LL_UDP ? "UDP" : "FR-GRE", VTY_NEWLINE); |
Max | 9530859 | 2017-10-24 15:54:28 +0200 | [diff] [blame] | 185 | |
Jacob Erlbeck | 0a1400f | 2015-10-06 15:23:25 +0200 | [diff] [blame] | 186 | if (stats) { |
Harald Welte | 9288334 | 2010-05-15 23:04:03 +0200 | [diff] [blame] | 187 | vty_out_rate_ctr_group(vty, " ", nsvc->ctrg); |
Jacob Erlbeck | 0a1400f | 2015-10-06 15:23:25 +0200 | [diff] [blame] | 188 | vty_out_stat_item_group(vty, " ", nsvc->statg); |
| 189 | } |
Harald Welte | 9288334 | 2010-05-15 23:04:03 +0200 | [diff] [blame] | 190 | } |
| 191 | |
Max | cbf5cdf | 2017-10-24 18:18:55 +0200 | [diff] [blame] | 192 | static void dump_ns(struct vty *vty, const struct gprs_ns_inst *nsi, bool stats, bool persistent_only) |
Harald Welte | 144e029 | 2010-05-13 11:45:07 +0200 | [diff] [blame] | 193 | { |
Harald Welte | 144e029 | 2010-05-13 11:45:07 +0200 | [diff] [blame] | 194 | struct gprs_nsvc *nsvc; |
Harald Welte | 7fb0523 | 2010-05-19 15:09:09 +0200 | [diff] [blame] | 195 | struct in_addr ia; |
| 196 | |
Harald Welte | bfe62e5 | 2017-05-15 12:48:30 +0200 | [diff] [blame] | 197 | ia.s_addr = osmo_htonl(vty_nsi->nsip.local_ip); |
Harald Welte | ce4ccbc | 2010-05-19 17:02:57 +0200 | [diff] [blame] | 198 | vty_out(vty, "Encapsulation NS-UDP-IP Local IP: %s, UDP Port: %u%s", |
Harald Welte | 7fb0523 | 2010-05-19 15:09:09 +0200 | [diff] [blame] | 199 | inet_ntoa(ia), vty_nsi->nsip.local_port, VTY_NEWLINE); |
| 200 | |
Harald Welte | bfe62e5 | 2017-05-15 12:48:30 +0200 | [diff] [blame] | 201 | ia.s_addr = osmo_htonl(vty_nsi->frgre.local_ip); |
Harald Welte | ce4ccbc | 2010-05-19 17:02:57 +0200 | [diff] [blame] | 202 | vty_out(vty, "Encapsulation NS-FR-GRE-IP Local IP: %s%s", |
Harald Welte | 7fb0523 | 2010-05-19 15:09:09 +0200 | [diff] [blame] | 203 | inet_ntoa(ia), VTY_NEWLINE); |
Harald Welte | 144e029 | 2010-05-13 11:45:07 +0200 | [diff] [blame] | 204 | |
| 205 | llist_for_each_entry(nsvc, &nsi->gprs_nsvcs, list) { |
Harald Welte | dd1c83c | 2010-05-13 13:58:08 +0200 | [diff] [blame] | 206 | if (nsvc == nsi->unknown_nsvc) |
| 207 | continue; |
Max | 296511b | 2017-10-24 18:05:35 +0200 | [diff] [blame] | 208 | dump_nse(vty, nsvc, stats, persistent_only); |
Harald Welte | 144e029 | 2010-05-13 11:45:07 +0200 | [diff] [blame] | 209 | } |
Harald Welte | af1d4cb | 2010-05-13 12:32:30 +0200 | [diff] [blame] | 210 | } |
Harald Welte | 144e029 | 2010-05-13 11:45:07 +0200 | [diff] [blame] | 211 | |
Harald Welte | af1d4cb | 2010-05-13 12:32:30 +0200 | [diff] [blame] | 212 | DEFUN(show_ns, show_ns_cmd, "show ns", |
| 213 | SHOW_STR "Display information about the NS protocol") |
| 214 | { |
| 215 | struct gprs_ns_inst *nsi = vty_nsi; |
Max | 296511b | 2017-10-24 18:05:35 +0200 | [diff] [blame] | 216 | dump_ns(vty, nsi, false, false); |
Harald Welte | 144e029 | 2010-05-13 11:45:07 +0200 | [diff] [blame] | 217 | return CMD_SUCCESS; |
| 218 | } |
| 219 | |
Harald Welte | af1d4cb | 2010-05-13 12:32:30 +0200 | [diff] [blame] | 220 | DEFUN(show_ns_stats, show_ns_stats_cmd, "show ns stats", |
| 221 | SHOW_STR |
| 222 | "Display information about the NS protocol\n" |
| 223 | "Include statistics\n") |
| 224 | { |
| 225 | struct gprs_ns_inst *nsi = vty_nsi; |
Max | 296511b | 2017-10-24 18:05:35 +0200 | [diff] [blame] | 226 | dump_ns(vty, nsi, true, false); |
| 227 | return CMD_SUCCESS; |
| 228 | } |
| 229 | |
| 230 | DEFUN(show_ns_pers, show_ns_pers_cmd, "show ns persistent", |
| 231 | SHOW_STR |
| 232 | "Display information about the NS protocol\n" |
| 233 | "Show only persistent NS\n") |
| 234 | { |
| 235 | struct gprs_ns_inst *nsi = vty_nsi; |
| 236 | dump_ns(vty, nsi, true, true); |
Harald Welte | af1d4cb | 2010-05-13 12:32:30 +0200 | [diff] [blame] | 237 | return CMD_SUCCESS; |
| 238 | } |
Harald Welte | 144e029 | 2010-05-13 11:45:07 +0200 | [diff] [blame] | 239 | |
Harald Welte | 9288334 | 2010-05-15 23:04:03 +0200 | [diff] [blame] | 240 | DEFUN(show_nse, show_nse_cmd, "show ns (nsei|nsvc) <0-65535> [stats]", |
| 241 | SHOW_STR "Display information about the NS protocol\n" |
| 242 | "Select one NSE by its NSE Identifier\n" |
| 243 | "Select one NSE by its NS-VC Identifier\n" |
| 244 | "The Identifier of selected type\n" |
| 245 | "Include Statistics\n") |
| 246 | { |
| 247 | struct gprs_ns_inst *nsi = vty_nsi; |
| 248 | struct gprs_nsvc *nsvc; |
| 249 | uint16_t id = atoi(argv[1]); |
Max | 296511b | 2017-10-24 18:05:35 +0200 | [diff] [blame] | 250 | bool show_stats = false; |
Harald Welte | 9288334 | 2010-05-15 23:04:03 +0200 | [diff] [blame] | 251 | |
| 252 | if (!strcmp(argv[0], "nsei")) |
Harald Welte | f543036 | 2012-06-17 12:25:53 +0800 | [diff] [blame] | 253 | nsvc = gprs_nsvc_by_nsei(nsi, id); |
Harald Welte | 9288334 | 2010-05-15 23:04:03 +0200 | [diff] [blame] | 254 | else |
Harald Welte | f543036 | 2012-06-17 12:25:53 +0800 | [diff] [blame] | 255 | nsvc = gprs_nsvc_by_nsvci(nsi, id); |
Harald Welte | 9288334 | 2010-05-15 23:04:03 +0200 | [diff] [blame] | 256 | |
| 257 | if (!nsvc) { |
| 258 | vty_out(vty, "No such NS Entity%s", VTY_NEWLINE); |
| 259 | return CMD_WARNING; |
| 260 | } |
| 261 | |
| 262 | if (argc >= 3) |
Max | 296511b | 2017-10-24 18:05:35 +0200 | [diff] [blame] | 263 | show_stats = true; |
Harald Welte | 9288334 | 2010-05-15 23:04:03 +0200 | [diff] [blame] | 264 | |
Max | 296511b | 2017-10-24 18:05:35 +0200 | [diff] [blame] | 265 | dump_nse(vty, nsvc, show_stats, false); |
Harald Welte | 9288334 | 2010-05-15 23:04:03 +0200 | [diff] [blame] | 266 | return CMD_SUCCESS; |
| 267 | } |
| 268 | |
Harald Welte | 24133c3 | 2010-05-15 23:06:26 +0200 | [diff] [blame] | 269 | #define NSE_CMD_STR "Persistent NS Entity\n" "NS Entity ID (NSEI)\n" |
Harald Welte | 144e029 | 2010-05-13 11:45:07 +0200 | [diff] [blame] | 270 | |
| 271 | DEFUN(cfg_nse_nsvc, cfg_nse_nsvci_cmd, |
| 272 | "nse <0-65535> nsvci <0-65534>", |
| 273 | NSE_CMD_STR |
| 274 | "NS Virtual Connection\n" |
| 275 | "NS Virtual Connection ID (NSVCI)\n" |
| 276 | ) |
| 277 | { |
| 278 | uint16_t nsei = atoi(argv[0]); |
| 279 | uint16_t nsvci = atoi(argv[1]); |
| 280 | struct gprs_nsvc *nsvc; |
| 281 | |
Harald Welte | f543036 | 2012-06-17 12:25:53 +0800 | [diff] [blame] | 282 | nsvc = gprs_nsvc_by_nsei(vty_nsi, nsei); |
Harald Welte | 144e029 | 2010-05-13 11:45:07 +0200 | [diff] [blame] | 283 | if (!nsvc) { |
Harald Welte | f543036 | 2012-06-17 12:25:53 +0800 | [diff] [blame] | 284 | nsvc = gprs_nsvc_create(vty_nsi, nsvci); |
Harald Welte | 144e029 | 2010-05-13 11:45:07 +0200 | [diff] [blame] | 285 | nsvc->nsei = nsei; |
| 286 | } |
| 287 | nsvc->nsvci = nsvci; |
| 288 | /* All NSVCs that are explicitly configured by VTY are |
| 289 | * marked as persistent so we can write them to the config |
| 290 | * file at some later point */ |
| 291 | nsvc->persistent = 1; |
| 292 | |
| 293 | return CMD_SUCCESS; |
| 294 | } |
| 295 | |
| 296 | DEFUN(cfg_nse_remoteip, cfg_nse_remoteip_cmd, |
| 297 | "nse <0-65535> remote-ip A.B.C.D", |
| 298 | NSE_CMD_STR |
| 299 | "Remote IP Address\n" |
| 300 | "Remote IP Address\n") |
| 301 | { |
| 302 | uint16_t nsei = atoi(argv[0]); |
| 303 | struct gprs_nsvc *nsvc; |
| 304 | |
Harald Welte | f543036 | 2012-06-17 12:25:53 +0800 | [diff] [blame] | 305 | nsvc = gprs_nsvc_by_nsei(vty_nsi, nsei); |
Harald Welte | 144e029 | 2010-05-13 11:45:07 +0200 | [diff] [blame] | 306 | if (!nsvc) { |
| 307 | vty_out(vty, "No such NSE (%u)%s", nsei, VTY_NEWLINE); |
| 308 | return CMD_WARNING; |
| 309 | } |
| 310 | inet_aton(argv[1], &nsvc->ip.bts_addr.sin_addr); |
| 311 | |
| 312 | return CMD_SUCCESS; |
| 313 | |
| 314 | } |
| 315 | |
| 316 | DEFUN(cfg_nse_remoteport, cfg_nse_remoteport_cmd, |
| 317 | "nse <0-65535> remote-port <0-65535>", |
| 318 | NSE_CMD_STR |
| 319 | "Remote UDP Port\n" |
| 320 | "Remote UDP Port Number\n") |
| 321 | { |
| 322 | uint16_t nsei = atoi(argv[0]); |
| 323 | uint16_t port = atoi(argv[1]); |
| 324 | struct gprs_nsvc *nsvc; |
| 325 | |
Harald Welte | f543036 | 2012-06-17 12:25:53 +0800 | [diff] [blame] | 326 | nsvc = gprs_nsvc_by_nsei(vty_nsi, nsei); |
Harald Welte | 144e029 | 2010-05-13 11:45:07 +0200 | [diff] [blame] | 327 | if (!nsvc) { |
| 328 | vty_out(vty, "No such NSE (%u)%s", nsei, VTY_NEWLINE); |
| 329 | return CMD_WARNING; |
| 330 | } |
| 331 | |
Harald Welte | b3ee265 | 2010-05-19 14:38:50 +0200 | [diff] [blame] | 332 | if (nsvc->ll != GPRS_NS_LL_UDP) { |
| 333 | vty_out(vty, "Cannot set UDP Port on non-UDP NSE%s", |
| 334 | VTY_NEWLINE); |
| 335 | return CMD_WARNING; |
| 336 | } |
| 337 | |
Harald Welte | bfe62e5 | 2017-05-15 12:48:30 +0200 | [diff] [blame] | 338 | nsvc->ip.bts_addr.sin_port = osmo_htons(port); |
Harald Welte | 144e029 | 2010-05-13 11:45:07 +0200 | [diff] [blame] | 339 | |
| 340 | return CMD_SUCCESS; |
| 341 | } |
| 342 | |
Harald Welte | b3ee265 | 2010-05-19 14:38:50 +0200 | [diff] [blame] | 343 | DEFUN(cfg_nse_fr_dlci, cfg_nse_fr_dlci_cmd, |
Harald Welte | 188bda6 | 2010-05-28 14:11:49 +0200 | [diff] [blame] | 344 | "nse <0-65535> fr-dlci <16-1007>", |
Harald Welte | b3ee265 | 2010-05-19 14:38:50 +0200 | [diff] [blame] | 345 | NSE_CMD_STR |
| 346 | "Frame Relay DLCI\n" |
| 347 | "Frame Relay DLCI Number\n") |
| 348 | { |
| 349 | uint16_t nsei = atoi(argv[0]); |
| 350 | uint16_t dlci = atoi(argv[1]); |
| 351 | struct gprs_nsvc *nsvc; |
| 352 | |
Harald Welte | f543036 | 2012-06-17 12:25:53 +0800 | [diff] [blame] | 353 | nsvc = gprs_nsvc_by_nsei(vty_nsi, nsei); |
Harald Welte | b3ee265 | 2010-05-19 14:38:50 +0200 | [diff] [blame] | 354 | if (!nsvc) { |
| 355 | vty_out(vty, "No such NSE (%u)%s", nsei, VTY_NEWLINE); |
| 356 | return CMD_WARNING; |
| 357 | } |
| 358 | |
| 359 | if (nsvc->ll != GPRS_NS_LL_FR_GRE) { |
| 360 | vty_out(vty, "Cannot set FR DLCI on non-FR NSE%s", |
| 361 | VTY_NEWLINE); |
| 362 | return CMD_WARNING; |
| 363 | } |
| 364 | |
Harald Welte | bfe62e5 | 2017-05-15 12:48:30 +0200 | [diff] [blame] | 365 | nsvc->frgre.bts_addr.sin_port = osmo_htons(dlci); |
Harald Welte | b3ee265 | 2010-05-19 14:38:50 +0200 | [diff] [blame] | 366 | |
| 367 | return CMD_SUCCESS; |
| 368 | } |
| 369 | |
| 370 | DEFUN(cfg_nse_encaps, cfg_nse_encaps_cmd, |
| 371 | "nse <0-65535> encapsulation (udp|framerelay-gre)", |
| 372 | NSE_CMD_STR |
| 373 | "Encapsulation for NS\n" |
| 374 | "UDP/IP Encapsulation\n" "Frame-Relay/GRE/IP Encapsulation\n") |
| 375 | { |
| 376 | uint16_t nsei = atoi(argv[0]); |
| 377 | struct gprs_nsvc *nsvc; |
| 378 | |
Harald Welte | f543036 | 2012-06-17 12:25:53 +0800 | [diff] [blame] | 379 | nsvc = gprs_nsvc_by_nsei(vty_nsi, nsei); |
Harald Welte | b3ee265 | 2010-05-19 14:38:50 +0200 | [diff] [blame] | 380 | if (!nsvc) { |
| 381 | vty_out(vty, "No such NSE (%u)%s", nsei, VTY_NEWLINE); |
| 382 | return CMD_WARNING; |
| 383 | } |
| 384 | |
| 385 | if (!strcmp(argv[1], "udp")) |
| 386 | nsvc->ll = GPRS_NS_LL_UDP; |
| 387 | else |
| 388 | nsvc->ll = GPRS_NS_LL_FR_GRE; |
| 389 | |
| 390 | return CMD_SUCCESS; |
| 391 | } |
| 392 | |
| 393 | |
Harald Welte | 144e029 | 2010-05-13 11:45:07 +0200 | [diff] [blame] | 394 | DEFUN(cfg_nse_remoterole, cfg_nse_remoterole_cmd, |
| 395 | "nse <0-65535> remote-role (sgsn|bss)", |
| 396 | NSE_CMD_STR |
| 397 | "Remote NSE Role\n" |
| 398 | "Remote Peer is SGSN\n" |
| 399 | "Remote Peer is BSS\n") |
| 400 | { |
| 401 | uint16_t nsei = atoi(argv[0]); |
| 402 | struct gprs_nsvc *nsvc; |
| 403 | |
Harald Welte | f543036 | 2012-06-17 12:25:53 +0800 | [diff] [blame] | 404 | nsvc = gprs_nsvc_by_nsei(vty_nsi, nsei); |
Harald Welte | 144e029 | 2010-05-13 11:45:07 +0200 | [diff] [blame] | 405 | if (!nsvc) { |
| 406 | vty_out(vty, "No such NSE (%u)%s", nsei, VTY_NEWLINE); |
| 407 | return CMD_WARNING; |
| 408 | } |
| 409 | |
| 410 | if (!strcmp(argv[1], "sgsn")) |
| 411 | nsvc->remote_end_is_sgsn = 1; |
| 412 | else |
| 413 | nsvc->remote_end_is_sgsn = 0; |
| 414 | |
| 415 | return CMD_SUCCESS; |
| 416 | } |
| 417 | |
| 418 | DEFUN(cfg_no_nse, cfg_no_nse_cmd, |
| 419 | "no nse <0-65535>", |
Harald Welte | 24133c3 | 2010-05-15 23:06:26 +0200 | [diff] [blame] | 420 | "Delete Persistent NS Entity\n" |
Harald Welte | 144e029 | 2010-05-13 11:45:07 +0200 | [diff] [blame] | 421 | "Delete " NSE_CMD_STR) |
| 422 | { |
| 423 | uint16_t nsei = atoi(argv[0]); |
| 424 | struct gprs_nsvc *nsvc; |
| 425 | |
Harald Welte | f543036 | 2012-06-17 12:25:53 +0800 | [diff] [blame] | 426 | nsvc = gprs_nsvc_by_nsei(vty_nsi, nsei); |
Harald Welte | 144e029 | 2010-05-13 11:45:07 +0200 | [diff] [blame] | 427 | if (!nsvc) { |
| 428 | vty_out(vty, "No such NSE (%u)%s", nsei, VTY_NEWLINE); |
| 429 | return CMD_WARNING; |
| 430 | } |
| 431 | |
Harald Welte | 24133c3 | 2010-05-15 23:06:26 +0200 | [diff] [blame] | 432 | if (!nsvc->persistent) { |
| 433 | vty_out(vty, "NSEI %u is not a persistent NSE%s", |
| 434 | nsei, VTY_NEWLINE); |
| 435 | return CMD_WARNING; |
| 436 | } |
| 437 | |
| 438 | nsvc->persistent = 0; |
Harald Welte | 144e029 | 2010-05-13 11:45:07 +0200 | [diff] [blame] | 439 | |
| 440 | return CMD_SUCCESS; |
| 441 | } |
| 442 | |
| 443 | DEFUN(cfg_ns_timer, cfg_ns_timer_cmd, |
| 444 | "timer " NS_TIMERS " <0-65535>", |
| 445 | "Network Service Timer\n" |
| 446 | NS_TIMERS_HELP "Timer Value\n") |
| 447 | { |
| 448 | int idx = get_string_value(gprs_ns_timer_strs, argv[0]); |
| 449 | int val = atoi(argv[1]); |
| 450 | |
| 451 | if (idx < 0 || idx >= ARRAY_SIZE(vty_nsi->timeout)) |
| 452 | return CMD_WARNING; |
| 453 | |
| 454 | vty_nsi->timeout[idx] = val; |
| 455 | |
| 456 | return CMD_SUCCESS; |
| 457 | } |
| 458 | |
Harald Welte | 7fb0523 | 2010-05-19 15:09:09 +0200 | [diff] [blame] | 459 | #define ENCAPS_STR "NS encapsulation options\n" |
| 460 | |
| 461 | DEFUN(cfg_nsip_local_ip, cfg_nsip_local_ip_cmd, |
| 462 | "encapsulation udp local-ip A.B.C.D", |
| 463 | ENCAPS_STR "NS over UDP Encapsulation\n" |
| 464 | "Set the IP address on which we listen for NS/UDP\n" |
| 465 | "IP Address\n") |
| 466 | { |
| 467 | struct in_addr ia; |
| 468 | |
| 469 | inet_aton(argv[0], &ia); |
Harald Welte | bfe62e5 | 2017-05-15 12:48:30 +0200 | [diff] [blame] | 470 | vty_nsi->nsip.local_ip = osmo_ntohl(ia.s_addr); |
Harald Welte | 7fb0523 | 2010-05-19 15:09:09 +0200 | [diff] [blame] | 471 | |
| 472 | return CMD_SUCCESS; |
| 473 | } |
| 474 | |
| 475 | DEFUN(cfg_nsip_local_port, cfg_nsip_local_port_cmd, |
| 476 | "encapsulation udp local-port <0-65535>", |
| 477 | ENCAPS_STR "NS over UDP Encapsulation\n" |
| 478 | "Set the UDP port on which we listen for NS/UDP\n" |
| 479 | "UDP port number\n") |
| 480 | { |
| 481 | unsigned int port = atoi(argv[0]); |
| 482 | |
| 483 | vty_nsi->nsip.local_port = port; |
| 484 | |
| 485 | return CMD_SUCCESS; |
| 486 | } |
| 487 | |
Holger Hans Peter Freyther | 2c3393d | 2013-03-25 11:59:58 +0100 | [diff] [blame] | 488 | DEFUN(cfg_nsip_dscp, cfg_nsip_dscp_cmd, |
| 489 | "encapsulation udp dscp <0-255>", |
| 490 | ENCAPS_STR "NS over UDP Encapsulation\n" |
| 491 | "Set DSCP/TOS on the UDP socket\n" "DSCP Value\n") |
| 492 | { |
| 493 | int dscp = atoi(argv[0]); |
| 494 | vty_nsi->nsip.dscp = dscp; |
| 495 | return CMD_SUCCESS; |
| 496 | } |
| 497 | |
Harald Welte | 7fb0523 | 2010-05-19 15:09:09 +0200 | [diff] [blame] | 498 | DEFUN(cfg_frgre_local_ip, cfg_frgre_local_ip_cmd, |
| 499 | "encapsulation framerelay-gre local-ip A.B.C.D", |
| 500 | ENCAPS_STR "NS over Frame Relay over GRE Encapsulation\n" |
| 501 | "Set the IP address on which we listen for NS/FR/GRE\n" |
| 502 | "IP Address\n") |
| 503 | { |
| 504 | struct in_addr ia; |
| 505 | |
| 506 | if (!vty_nsi->frgre.enabled) { |
| 507 | vty_out(vty, "FR/GRE is not enabled%s", VTY_NEWLINE); |
| 508 | return CMD_WARNING; |
| 509 | } |
| 510 | inet_aton(argv[0], &ia); |
Harald Welte | bfe62e5 | 2017-05-15 12:48:30 +0200 | [diff] [blame] | 511 | vty_nsi->frgre.local_ip = osmo_ntohl(ia.s_addr); |
Harald Welte | 7fb0523 | 2010-05-19 15:09:09 +0200 | [diff] [blame] | 512 | |
| 513 | return CMD_SUCCESS; |
| 514 | } |
| 515 | |
| 516 | DEFUN(cfg_frgre_enable, cfg_frgre_enable_cmd, |
| 517 | "encapsulation framerelay-gre enabled (1|0)", |
| 518 | ENCAPS_STR "NS over Frame Relay over GRE Encapsulation\n" |
| 519 | "Enable or disable Frame Relay over GRE\n" |
| 520 | "Enable\n" "Disable\n") |
| 521 | { |
| 522 | int enabled = atoi(argv[0]); |
| 523 | |
| 524 | vty_nsi->frgre.enabled = enabled; |
| 525 | |
| 526 | return CMD_SUCCESS; |
| 527 | } |
| 528 | |
Harald Welte | 43f3b69 | 2010-05-14 19:36:59 +0200 | [diff] [blame] | 529 | DEFUN(nsvc_nsei, nsvc_nsei_cmd, |
Jacob Erlbeck | 687b690 | 2013-10-24 01:33:19 +0200 | [diff] [blame] | 530 | "nsvc (nsei|nsvci) <0-65535> (block|unblock|reset)", |
Harald Welte | 43f3b69 | 2010-05-14 19:36:59 +0200 | [diff] [blame] | 531 | "Perform an operation on a NSVC\n" |
Holger Hans Peter Freyther | 887934e | 2011-11-05 15:14:59 +0100 | [diff] [blame] | 532 | "NSEI to identify NS-VC Identifier (NS-VCI)\n" |
Jacob Erlbeck | 687b690 | 2013-10-24 01:33:19 +0200 | [diff] [blame] | 533 | "NS-VC Identifier (NS-VCI)\n" |
Holger Hans Peter Freyther | 887934e | 2011-11-05 15:14:59 +0100 | [diff] [blame] | 534 | "The NSEI\n" |
Harald Welte | 43f3b69 | 2010-05-14 19:36:59 +0200 | [diff] [blame] | 535 | "Initiate BLOCK procedure\n" |
| 536 | "Initiate UNBLOCK procedure\n" |
| 537 | "Initiate RESET procedure\n") |
| 538 | { |
Jacob Erlbeck | 687b690 | 2013-10-24 01:33:19 +0200 | [diff] [blame] | 539 | const char *id_type = argv[0]; |
| 540 | uint16_t id = atoi(argv[1]); |
| 541 | const char *operation = argv[2]; |
Harald Welte | 43f3b69 | 2010-05-14 19:36:59 +0200 | [diff] [blame] | 542 | struct gprs_nsvc *nsvc; |
| 543 | |
Jacob Erlbeck | 687b690 | 2013-10-24 01:33:19 +0200 | [diff] [blame] | 544 | if (!strcmp(id_type, "nsei")) |
| 545 | nsvc = gprs_nsvc_by_nsei(vty_nsi, id); |
| 546 | else if (!strcmp(id_type, "nsvci")) |
| 547 | nsvc = gprs_nsvc_by_nsvci(vty_nsi, id); |
| 548 | else { |
| 549 | vty_out(vty, "%%No such id_type '%s'%s", id_type, VTY_NEWLINE); |
| 550 | return CMD_WARNING; |
| 551 | } |
| 552 | |
Harald Welte | 43f3b69 | 2010-05-14 19:36:59 +0200 | [diff] [blame] | 553 | if (!nsvc) { |
Jacob Erlbeck | 687b690 | 2013-10-24 01:33:19 +0200 | [diff] [blame] | 554 | vty_out(vty, "No such %s (%u)%s", id_type, id, VTY_NEWLINE); |
Harald Welte | 43f3b69 | 2010-05-14 19:36:59 +0200 | [diff] [blame] | 555 | return CMD_WARNING; |
| 556 | } |
| 557 | |
| 558 | if (!strcmp(operation, "block")) |
| 559 | gprs_ns_tx_block(nsvc, NS_CAUSE_OM_INTERVENTION); |
| 560 | else if (!strcmp(operation, "unblock")) |
| 561 | gprs_ns_tx_unblock(nsvc); |
| 562 | else if (!strcmp(operation, "reset")) |
| 563 | gprs_nsvc_reset(nsvc, NS_CAUSE_OM_INTERVENTION); |
| 564 | else |
| 565 | return CMD_WARNING; |
| 566 | |
| 567 | return CMD_SUCCESS; |
| 568 | } |
| 569 | |
Harald Welte | 91f7f4b | 2010-05-15 23:52:02 +0200 | [diff] [blame] | 570 | DEFUN(logging_fltr_nsvc, |
| 571 | logging_fltr_nsvc_cmd, |
| 572 | "logging filter nsvc (nsei|nsvci) <0-65535>", |
Harald Welte | 6703bf7 | 2010-05-16 00:00:04 +0200 | [diff] [blame] | 573 | LOGGING_STR FILTER_STR |
Harald Welte | 91f7f4b | 2010-05-15 23:52:02 +0200 | [diff] [blame] | 574 | "Filter based on NS Virtual Connection\n" |
| 575 | "Identify NS-VC by NSEI\n" |
| 576 | "Identify NS-VC by NSVCI\n" |
| 577 | "Numeric identifier\n") |
| 578 | { |
Harald Welte | 43ae94e | 2011-02-18 21:10:05 +0100 | [diff] [blame] | 579 | struct log_target *tgt = osmo_log_vty2tgt(vty); |
Harald Welte | 91f7f4b | 2010-05-15 23:52:02 +0200 | [diff] [blame] | 580 | struct gprs_nsvc *nsvc; |
| 581 | uint16_t id = atoi(argv[1]); |
| 582 | |
Harald Welte | 43ae94e | 2011-02-18 21:10:05 +0100 | [diff] [blame] | 583 | if (!tgt) |
Harald Welte | 91f7f4b | 2010-05-15 23:52:02 +0200 | [diff] [blame] | 584 | return CMD_WARNING; |
Harald Welte | 91f7f4b | 2010-05-15 23:52:02 +0200 | [diff] [blame] | 585 | |
| 586 | if (!strcmp(argv[0], "nsei")) |
Harald Welte | f543036 | 2012-06-17 12:25:53 +0800 | [diff] [blame] | 587 | nsvc = gprs_nsvc_by_nsei(vty_nsi, id); |
Harald Welte | 91f7f4b | 2010-05-15 23:52:02 +0200 | [diff] [blame] | 588 | else |
Harald Welte | f543036 | 2012-06-17 12:25:53 +0800 | [diff] [blame] | 589 | nsvc = gprs_nsvc_by_nsvci(vty_nsi, id); |
Harald Welte | 91f7f4b | 2010-05-15 23:52:02 +0200 | [diff] [blame] | 590 | |
| 591 | if (!nsvc) { |
| 592 | vty_out(vty, "No NS-VC by that identifier%s", VTY_NEWLINE); |
| 593 | return CMD_WARNING; |
| 594 | } |
| 595 | |
Harald Welte | 43ae94e | 2011-02-18 21:10:05 +0100 | [diff] [blame] | 596 | log_set_nsvc_filter(tgt, nsvc); |
Harald Welte | 91f7f4b | 2010-05-15 23:52:02 +0200 | [diff] [blame] | 597 | return CMD_SUCCESS; |
| 598 | } |
Harald Welte | 43f3b69 | 2010-05-14 19:36:59 +0200 | [diff] [blame] | 599 | |
Harald Welte | 144e029 | 2010-05-13 11:45:07 +0200 | [diff] [blame] | 600 | int gprs_ns_vty_init(struct gprs_ns_inst *nsi) |
| 601 | { |
Neels Hofmeyr | c32bfd5 | 2017-01-12 22:32:19 +0100 | [diff] [blame] | 602 | static bool vty_elements_installed = false; |
| 603 | |
Harald Welte | 144e029 | 2010-05-13 11:45:07 +0200 | [diff] [blame] | 604 | vty_nsi = nsi; |
| 605 | |
Neels Hofmeyr | c32bfd5 | 2017-01-12 22:32:19 +0100 | [diff] [blame] | 606 | /* Regression test code may call this function repeatedly, so make sure |
| 607 | * that VTY elements are not duplicated, which would assert. */ |
| 608 | if (vty_elements_installed) |
| 609 | return 0; |
| 610 | vty_elements_installed = true; |
| 611 | |
Harald Welte | 144e029 | 2010-05-13 11:45:07 +0200 | [diff] [blame] | 612 | install_element_ve(&show_ns_cmd); |
Harald Welte | af1d4cb | 2010-05-13 12:32:30 +0200 | [diff] [blame] | 613 | install_element_ve(&show_ns_stats_cmd); |
Max | 296511b | 2017-10-24 18:05:35 +0200 | [diff] [blame] | 614 | install_element_ve(&show_ns_pers_cmd); |
Harald Welte | 9288334 | 2010-05-15 23:04:03 +0200 | [diff] [blame] | 615 | install_element_ve(&show_nse_cmd); |
Harald Welte | 91f7f4b | 2010-05-15 23:52:02 +0200 | [diff] [blame] | 616 | install_element_ve(&logging_fltr_nsvc_cmd); |
Harald Welte | 144e029 | 2010-05-13 11:45:07 +0200 | [diff] [blame] | 617 | |
Harald Welte | 43ae94e | 2011-02-18 21:10:05 +0100 | [diff] [blame] | 618 | install_element(CFG_LOG_NODE, &logging_fltr_nsvc_cmd); |
| 619 | |
Harald Welte | 144e029 | 2010-05-13 11:45:07 +0200 | [diff] [blame] | 620 | install_element(CONFIG_NODE, &cfg_ns_cmd); |
| 621 | install_node(&ns_node, config_write_ns); |
Harald Welte | 4f5883b | 2012-06-16 16:54:06 +0800 | [diff] [blame] | 622 | install_element(L_NS_NODE, &cfg_nse_nsvci_cmd); |
| 623 | install_element(L_NS_NODE, &cfg_nse_remoteip_cmd); |
| 624 | install_element(L_NS_NODE, &cfg_nse_remoteport_cmd); |
| 625 | install_element(L_NS_NODE, &cfg_nse_fr_dlci_cmd); |
| 626 | install_element(L_NS_NODE, &cfg_nse_encaps_cmd); |
| 627 | install_element(L_NS_NODE, &cfg_nse_remoterole_cmd); |
| 628 | install_element(L_NS_NODE, &cfg_no_nse_cmd); |
| 629 | install_element(L_NS_NODE, &cfg_ns_timer_cmd); |
| 630 | install_element(L_NS_NODE, &cfg_nsip_local_ip_cmd); |
| 631 | install_element(L_NS_NODE, &cfg_nsip_local_port_cmd); |
Holger Hans Peter Freyther | 2c3393d | 2013-03-25 11:59:58 +0100 | [diff] [blame] | 632 | install_element(L_NS_NODE, &cfg_nsip_dscp_cmd); |
Harald Welte | 4f5883b | 2012-06-16 16:54:06 +0800 | [diff] [blame] | 633 | install_element(L_NS_NODE, &cfg_frgre_enable_cmd); |
| 634 | install_element(L_NS_NODE, &cfg_frgre_local_ip_cmd); |
Harald Welte | 144e029 | 2010-05-13 11:45:07 +0200 | [diff] [blame] | 635 | |
Harald Welte | 43f3b69 | 2010-05-14 19:36:59 +0200 | [diff] [blame] | 636 | install_element(ENABLE_NODE, &nsvc_nsei_cmd); |
| 637 | |
Harald Welte | 144e029 | 2010-05-13 11:45:07 +0200 | [diff] [blame] | 638 | return 0; |
| 639 | } |