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 | dc80281 | 2019-02-23 11:10:08 +0100 | [diff] [blame] | 201 | if (nsi->frgre.enabled) { |
| 202 | ia.s_addr = osmo_htonl(vty_nsi->frgre.local_ip); |
| 203 | vty_out(vty, "Encapsulation NS-FR-GRE-IP Local IP: %s%s", inet_ntoa(ia), VTY_NEWLINE); |
| 204 | } |
Harald Welte | 144e029 | 2010-05-13 11:45:07 +0200 | [diff] [blame] | 205 | |
| 206 | llist_for_each_entry(nsvc, &nsi->gprs_nsvcs, list) { |
Harald Welte | dd1c83c | 2010-05-13 13:58:08 +0200 | [diff] [blame] | 207 | if (nsvc == nsi->unknown_nsvc) |
| 208 | continue; |
Max | 296511b | 2017-10-24 18:05:35 +0200 | [diff] [blame] | 209 | dump_nse(vty, nsvc, stats, persistent_only); |
Harald Welte | 144e029 | 2010-05-13 11:45:07 +0200 | [diff] [blame] | 210 | } |
Harald Welte | af1d4cb | 2010-05-13 12:32:30 +0200 | [diff] [blame] | 211 | } |
Harald Welte | 144e029 | 2010-05-13 11:45:07 +0200 | [diff] [blame] | 212 | |
Harald Welte | af1d4cb | 2010-05-13 12:32:30 +0200 | [diff] [blame] | 213 | DEFUN(show_ns, show_ns_cmd, "show ns", |
| 214 | SHOW_STR "Display information about the NS protocol") |
| 215 | { |
| 216 | struct gprs_ns_inst *nsi = vty_nsi; |
Max | 296511b | 2017-10-24 18:05:35 +0200 | [diff] [blame] | 217 | dump_ns(vty, nsi, false, false); |
Harald Welte | 144e029 | 2010-05-13 11:45:07 +0200 | [diff] [blame] | 218 | return CMD_SUCCESS; |
| 219 | } |
| 220 | |
Harald Welte | af1d4cb | 2010-05-13 12:32:30 +0200 | [diff] [blame] | 221 | DEFUN(show_ns_stats, show_ns_stats_cmd, "show ns stats", |
| 222 | SHOW_STR |
| 223 | "Display information about the NS protocol\n" |
| 224 | "Include statistics\n") |
| 225 | { |
| 226 | struct gprs_ns_inst *nsi = vty_nsi; |
Max | 296511b | 2017-10-24 18:05:35 +0200 | [diff] [blame] | 227 | dump_ns(vty, nsi, true, false); |
| 228 | return CMD_SUCCESS; |
| 229 | } |
| 230 | |
| 231 | DEFUN(show_ns_pers, show_ns_pers_cmd, "show ns persistent", |
| 232 | SHOW_STR |
| 233 | "Display information about the NS protocol\n" |
| 234 | "Show only persistent NS\n") |
| 235 | { |
| 236 | struct gprs_ns_inst *nsi = vty_nsi; |
| 237 | dump_ns(vty, nsi, true, true); |
Harald Welte | af1d4cb | 2010-05-13 12:32:30 +0200 | [diff] [blame] | 238 | return CMD_SUCCESS; |
| 239 | } |
Harald Welte | 144e029 | 2010-05-13 11:45:07 +0200 | [diff] [blame] | 240 | |
Harald Welte | 9288334 | 2010-05-15 23:04:03 +0200 | [diff] [blame] | 241 | DEFUN(show_nse, show_nse_cmd, "show ns (nsei|nsvc) <0-65535> [stats]", |
| 242 | SHOW_STR "Display information about the NS protocol\n" |
| 243 | "Select one NSE by its NSE Identifier\n" |
| 244 | "Select one NSE by its NS-VC Identifier\n" |
| 245 | "The Identifier of selected type\n" |
| 246 | "Include Statistics\n") |
| 247 | { |
| 248 | struct gprs_ns_inst *nsi = vty_nsi; |
| 249 | struct gprs_nsvc *nsvc; |
| 250 | uint16_t id = atoi(argv[1]); |
Max | 296511b | 2017-10-24 18:05:35 +0200 | [diff] [blame] | 251 | bool show_stats = false; |
Harald Welte | 9288334 | 2010-05-15 23:04:03 +0200 | [diff] [blame] | 252 | |
| 253 | if (!strcmp(argv[0], "nsei")) |
Harald Welte | f543036 | 2012-06-17 12:25:53 +0800 | [diff] [blame] | 254 | nsvc = gprs_nsvc_by_nsei(nsi, id); |
Harald Welte | 9288334 | 2010-05-15 23:04:03 +0200 | [diff] [blame] | 255 | else |
Harald Welte | f543036 | 2012-06-17 12:25:53 +0800 | [diff] [blame] | 256 | nsvc = gprs_nsvc_by_nsvci(nsi, id); |
Harald Welte | 9288334 | 2010-05-15 23:04:03 +0200 | [diff] [blame] | 257 | |
| 258 | if (!nsvc) { |
| 259 | vty_out(vty, "No such NS Entity%s", VTY_NEWLINE); |
| 260 | return CMD_WARNING; |
| 261 | } |
| 262 | |
| 263 | if (argc >= 3) |
Max | 296511b | 2017-10-24 18:05:35 +0200 | [diff] [blame] | 264 | show_stats = true; |
Harald Welte | 9288334 | 2010-05-15 23:04:03 +0200 | [diff] [blame] | 265 | |
Max | 296511b | 2017-10-24 18:05:35 +0200 | [diff] [blame] | 266 | dump_nse(vty, nsvc, show_stats, false); |
Harald Welte | 9288334 | 2010-05-15 23:04:03 +0200 | [diff] [blame] | 267 | return CMD_SUCCESS; |
| 268 | } |
| 269 | |
Harald Welte | 24133c3 | 2010-05-15 23:06:26 +0200 | [diff] [blame] | 270 | #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] | 271 | |
| 272 | DEFUN(cfg_nse_nsvc, cfg_nse_nsvci_cmd, |
| 273 | "nse <0-65535> nsvci <0-65534>", |
| 274 | NSE_CMD_STR |
| 275 | "NS Virtual Connection\n" |
| 276 | "NS Virtual Connection ID (NSVCI)\n" |
| 277 | ) |
| 278 | { |
| 279 | uint16_t nsei = atoi(argv[0]); |
| 280 | uint16_t nsvci = atoi(argv[1]); |
| 281 | struct gprs_nsvc *nsvc; |
| 282 | |
Harald Welte | f543036 | 2012-06-17 12:25:53 +0800 | [diff] [blame] | 283 | nsvc = gprs_nsvc_by_nsei(vty_nsi, nsei); |
Harald Welte | 144e029 | 2010-05-13 11:45:07 +0200 | [diff] [blame] | 284 | if (!nsvc) { |
Harald Welte | f543036 | 2012-06-17 12:25:53 +0800 | [diff] [blame] | 285 | nsvc = gprs_nsvc_create(vty_nsi, nsvci); |
Harald Welte | 144e029 | 2010-05-13 11:45:07 +0200 | [diff] [blame] | 286 | nsvc->nsei = nsei; |
| 287 | } |
| 288 | nsvc->nsvci = nsvci; |
| 289 | /* All NSVCs that are explicitly configured by VTY are |
| 290 | * marked as persistent so we can write them to the config |
| 291 | * file at some later point */ |
| 292 | nsvc->persistent = 1; |
| 293 | |
| 294 | return CMD_SUCCESS; |
| 295 | } |
| 296 | |
| 297 | DEFUN(cfg_nse_remoteip, cfg_nse_remoteip_cmd, |
| 298 | "nse <0-65535> remote-ip A.B.C.D", |
| 299 | NSE_CMD_STR |
| 300 | "Remote IP Address\n" |
| 301 | "Remote IP Address\n") |
| 302 | { |
| 303 | uint16_t nsei = atoi(argv[0]); |
| 304 | struct gprs_nsvc *nsvc; |
| 305 | |
Harald Welte | f543036 | 2012-06-17 12:25:53 +0800 | [diff] [blame] | 306 | nsvc = gprs_nsvc_by_nsei(vty_nsi, nsei); |
Harald Welte | 144e029 | 2010-05-13 11:45:07 +0200 | [diff] [blame] | 307 | if (!nsvc) { |
| 308 | vty_out(vty, "No such NSE (%u)%s", nsei, VTY_NEWLINE); |
| 309 | return CMD_WARNING; |
| 310 | } |
| 311 | inet_aton(argv[1], &nsvc->ip.bts_addr.sin_addr); |
| 312 | |
| 313 | return CMD_SUCCESS; |
| 314 | |
| 315 | } |
| 316 | |
| 317 | DEFUN(cfg_nse_remoteport, cfg_nse_remoteport_cmd, |
| 318 | "nse <0-65535> remote-port <0-65535>", |
| 319 | NSE_CMD_STR |
| 320 | "Remote UDP Port\n" |
| 321 | "Remote UDP Port Number\n") |
| 322 | { |
| 323 | uint16_t nsei = atoi(argv[0]); |
| 324 | uint16_t port = atoi(argv[1]); |
| 325 | struct gprs_nsvc *nsvc; |
| 326 | |
Harald Welte | f543036 | 2012-06-17 12:25:53 +0800 | [diff] [blame] | 327 | nsvc = gprs_nsvc_by_nsei(vty_nsi, nsei); |
Harald Welte | 144e029 | 2010-05-13 11:45:07 +0200 | [diff] [blame] | 328 | if (!nsvc) { |
| 329 | vty_out(vty, "No such NSE (%u)%s", nsei, VTY_NEWLINE); |
| 330 | return CMD_WARNING; |
| 331 | } |
| 332 | |
Harald Welte | b3ee265 | 2010-05-19 14:38:50 +0200 | [diff] [blame] | 333 | if (nsvc->ll != GPRS_NS_LL_UDP) { |
| 334 | vty_out(vty, "Cannot set UDP Port on non-UDP NSE%s", |
| 335 | VTY_NEWLINE); |
| 336 | return CMD_WARNING; |
| 337 | } |
| 338 | |
Harald Welte | bfe62e5 | 2017-05-15 12:48:30 +0200 | [diff] [blame] | 339 | nsvc->ip.bts_addr.sin_port = osmo_htons(port); |
Harald Welte | 144e029 | 2010-05-13 11:45:07 +0200 | [diff] [blame] | 340 | |
| 341 | return CMD_SUCCESS; |
| 342 | } |
| 343 | |
Harald Welte | b3ee265 | 2010-05-19 14:38:50 +0200 | [diff] [blame] | 344 | DEFUN(cfg_nse_fr_dlci, cfg_nse_fr_dlci_cmd, |
Harald Welte | 188bda6 | 2010-05-28 14:11:49 +0200 | [diff] [blame] | 345 | "nse <0-65535> fr-dlci <16-1007>", |
Harald Welte | b3ee265 | 2010-05-19 14:38:50 +0200 | [diff] [blame] | 346 | NSE_CMD_STR |
| 347 | "Frame Relay DLCI\n" |
| 348 | "Frame Relay DLCI Number\n") |
| 349 | { |
| 350 | uint16_t nsei = atoi(argv[0]); |
| 351 | uint16_t dlci = atoi(argv[1]); |
| 352 | struct gprs_nsvc *nsvc; |
| 353 | |
Harald Welte | f543036 | 2012-06-17 12:25:53 +0800 | [diff] [blame] | 354 | nsvc = gprs_nsvc_by_nsei(vty_nsi, nsei); |
Harald Welte | b3ee265 | 2010-05-19 14:38:50 +0200 | [diff] [blame] | 355 | if (!nsvc) { |
| 356 | vty_out(vty, "No such NSE (%u)%s", nsei, VTY_NEWLINE); |
| 357 | return CMD_WARNING; |
| 358 | } |
| 359 | |
| 360 | if (nsvc->ll != GPRS_NS_LL_FR_GRE) { |
| 361 | vty_out(vty, "Cannot set FR DLCI on non-FR NSE%s", |
| 362 | VTY_NEWLINE); |
| 363 | return CMD_WARNING; |
| 364 | } |
| 365 | |
Harald Welte | bfe62e5 | 2017-05-15 12:48:30 +0200 | [diff] [blame] | 366 | nsvc->frgre.bts_addr.sin_port = osmo_htons(dlci); |
Harald Welte | b3ee265 | 2010-05-19 14:38:50 +0200 | [diff] [blame] | 367 | |
| 368 | return CMD_SUCCESS; |
| 369 | } |
| 370 | |
| 371 | DEFUN(cfg_nse_encaps, cfg_nse_encaps_cmd, |
| 372 | "nse <0-65535> encapsulation (udp|framerelay-gre)", |
| 373 | NSE_CMD_STR |
| 374 | "Encapsulation for NS\n" |
| 375 | "UDP/IP Encapsulation\n" "Frame-Relay/GRE/IP Encapsulation\n") |
| 376 | { |
| 377 | uint16_t nsei = atoi(argv[0]); |
| 378 | struct gprs_nsvc *nsvc; |
| 379 | |
Harald Welte | f543036 | 2012-06-17 12:25:53 +0800 | [diff] [blame] | 380 | nsvc = gprs_nsvc_by_nsei(vty_nsi, nsei); |
Harald Welte | b3ee265 | 2010-05-19 14:38:50 +0200 | [diff] [blame] | 381 | if (!nsvc) { |
| 382 | vty_out(vty, "No such NSE (%u)%s", nsei, VTY_NEWLINE); |
| 383 | return CMD_WARNING; |
| 384 | } |
| 385 | |
| 386 | if (!strcmp(argv[1], "udp")) |
| 387 | nsvc->ll = GPRS_NS_LL_UDP; |
| 388 | else |
| 389 | nsvc->ll = GPRS_NS_LL_FR_GRE; |
| 390 | |
| 391 | return CMD_SUCCESS; |
| 392 | } |
| 393 | |
| 394 | |
Harald Welte | 144e029 | 2010-05-13 11:45:07 +0200 | [diff] [blame] | 395 | DEFUN(cfg_nse_remoterole, cfg_nse_remoterole_cmd, |
| 396 | "nse <0-65535> remote-role (sgsn|bss)", |
| 397 | NSE_CMD_STR |
| 398 | "Remote NSE Role\n" |
| 399 | "Remote Peer is SGSN\n" |
| 400 | "Remote Peer is BSS\n") |
| 401 | { |
| 402 | uint16_t nsei = atoi(argv[0]); |
| 403 | struct gprs_nsvc *nsvc; |
| 404 | |
Harald Welte | f543036 | 2012-06-17 12:25:53 +0800 | [diff] [blame] | 405 | nsvc = gprs_nsvc_by_nsei(vty_nsi, nsei); |
Harald Welte | 144e029 | 2010-05-13 11:45:07 +0200 | [diff] [blame] | 406 | if (!nsvc) { |
| 407 | vty_out(vty, "No such NSE (%u)%s", nsei, VTY_NEWLINE); |
| 408 | return CMD_WARNING; |
| 409 | } |
| 410 | |
| 411 | if (!strcmp(argv[1], "sgsn")) |
| 412 | nsvc->remote_end_is_sgsn = 1; |
| 413 | else |
| 414 | nsvc->remote_end_is_sgsn = 0; |
| 415 | |
| 416 | return CMD_SUCCESS; |
| 417 | } |
| 418 | |
| 419 | DEFUN(cfg_no_nse, cfg_no_nse_cmd, |
| 420 | "no nse <0-65535>", |
Harald Welte | 24133c3 | 2010-05-15 23:06:26 +0200 | [diff] [blame] | 421 | "Delete Persistent NS Entity\n" |
Harald Welte | 144e029 | 2010-05-13 11:45:07 +0200 | [diff] [blame] | 422 | "Delete " NSE_CMD_STR) |
| 423 | { |
| 424 | uint16_t nsei = atoi(argv[0]); |
| 425 | struct gprs_nsvc *nsvc; |
| 426 | |
Harald Welte | f543036 | 2012-06-17 12:25:53 +0800 | [diff] [blame] | 427 | nsvc = gprs_nsvc_by_nsei(vty_nsi, nsei); |
Harald Welte | 144e029 | 2010-05-13 11:45:07 +0200 | [diff] [blame] | 428 | if (!nsvc) { |
| 429 | vty_out(vty, "No such NSE (%u)%s", nsei, VTY_NEWLINE); |
| 430 | return CMD_WARNING; |
| 431 | } |
| 432 | |
Harald Welte | 24133c3 | 2010-05-15 23:06:26 +0200 | [diff] [blame] | 433 | if (!nsvc->persistent) { |
| 434 | vty_out(vty, "NSEI %u is not a persistent NSE%s", |
| 435 | nsei, VTY_NEWLINE); |
| 436 | return CMD_WARNING; |
| 437 | } |
| 438 | |
| 439 | nsvc->persistent = 0; |
Harald Welte | 144e029 | 2010-05-13 11:45:07 +0200 | [diff] [blame] | 440 | |
| 441 | return CMD_SUCCESS; |
| 442 | } |
| 443 | |
| 444 | DEFUN(cfg_ns_timer, cfg_ns_timer_cmd, |
| 445 | "timer " NS_TIMERS " <0-65535>", |
| 446 | "Network Service Timer\n" |
| 447 | NS_TIMERS_HELP "Timer Value\n") |
| 448 | { |
| 449 | int idx = get_string_value(gprs_ns_timer_strs, argv[0]); |
| 450 | int val = atoi(argv[1]); |
| 451 | |
| 452 | if (idx < 0 || idx >= ARRAY_SIZE(vty_nsi->timeout)) |
| 453 | return CMD_WARNING; |
| 454 | |
| 455 | vty_nsi->timeout[idx] = val; |
| 456 | |
| 457 | return CMD_SUCCESS; |
| 458 | } |
| 459 | |
Harald Welte | 7fb0523 | 2010-05-19 15:09:09 +0200 | [diff] [blame] | 460 | #define ENCAPS_STR "NS encapsulation options\n" |
| 461 | |
| 462 | DEFUN(cfg_nsip_local_ip, cfg_nsip_local_ip_cmd, |
| 463 | "encapsulation udp local-ip A.B.C.D", |
| 464 | ENCAPS_STR "NS over UDP Encapsulation\n" |
| 465 | "Set the IP address on which we listen for NS/UDP\n" |
| 466 | "IP Address\n") |
| 467 | { |
| 468 | struct in_addr ia; |
| 469 | |
| 470 | inet_aton(argv[0], &ia); |
Harald Welte | bfe62e5 | 2017-05-15 12:48:30 +0200 | [diff] [blame] | 471 | vty_nsi->nsip.local_ip = osmo_ntohl(ia.s_addr); |
Harald Welte | 7fb0523 | 2010-05-19 15:09:09 +0200 | [diff] [blame] | 472 | |
| 473 | return CMD_SUCCESS; |
| 474 | } |
| 475 | |
| 476 | DEFUN(cfg_nsip_local_port, cfg_nsip_local_port_cmd, |
| 477 | "encapsulation udp local-port <0-65535>", |
| 478 | ENCAPS_STR "NS over UDP Encapsulation\n" |
| 479 | "Set the UDP port on which we listen for NS/UDP\n" |
| 480 | "UDP port number\n") |
| 481 | { |
| 482 | unsigned int port = atoi(argv[0]); |
| 483 | |
| 484 | vty_nsi->nsip.local_port = port; |
| 485 | |
| 486 | return CMD_SUCCESS; |
| 487 | } |
| 488 | |
Holger Hans Peter Freyther | 2c3393d | 2013-03-25 11:59:58 +0100 | [diff] [blame] | 489 | DEFUN(cfg_nsip_dscp, cfg_nsip_dscp_cmd, |
| 490 | "encapsulation udp dscp <0-255>", |
| 491 | ENCAPS_STR "NS over UDP Encapsulation\n" |
| 492 | "Set DSCP/TOS on the UDP socket\n" "DSCP Value\n") |
| 493 | { |
| 494 | int dscp = atoi(argv[0]); |
| 495 | vty_nsi->nsip.dscp = dscp; |
| 496 | return CMD_SUCCESS; |
| 497 | } |
| 498 | |
Harald Welte | 7fb0523 | 2010-05-19 15:09:09 +0200 | [diff] [blame] | 499 | DEFUN(cfg_frgre_local_ip, cfg_frgre_local_ip_cmd, |
| 500 | "encapsulation framerelay-gre local-ip A.B.C.D", |
| 501 | ENCAPS_STR "NS over Frame Relay over GRE Encapsulation\n" |
| 502 | "Set the IP address on which we listen for NS/FR/GRE\n" |
| 503 | "IP Address\n") |
| 504 | { |
| 505 | struct in_addr ia; |
| 506 | |
| 507 | if (!vty_nsi->frgre.enabled) { |
| 508 | vty_out(vty, "FR/GRE is not enabled%s", VTY_NEWLINE); |
| 509 | return CMD_WARNING; |
| 510 | } |
| 511 | inet_aton(argv[0], &ia); |
Harald Welte | bfe62e5 | 2017-05-15 12:48:30 +0200 | [diff] [blame] | 512 | vty_nsi->frgre.local_ip = osmo_ntohl(ia.s_addr); |
Harald Welte | 7fb0523 | 2010-05-19 15:09:09 +0200 | [diff] [blame] | 513 | |
| 514 | return CMD_SUCCESS; |
| 515 | } |
| 516 | |
| 517 | DEFUN(cfg_frgre_enable, cfg_frgre_enable_cmd, |
| 518 | "encapsulation framerelay-gre enabled (1|0)", |
| 519 | ENCAPS_STR "NS over Frame Relay over GRE Encapsulation\n" |
| 520 | "Enable or disable Frame Relay over GRE\n" |
| 521 | "Enable\n" "Disable\n") |
| 522 | { |
| 523 | int enabled = atoi(argv[0]); |
| 524 | |
| 525 | vty_nsi->frgre.enabled = enabled; |
| 526 | |
| 527 | return CMD_SUCCESS; |
| 528 | } |
| 529 | |
Harald Welte | 43f3b69 | 2010-05-14 19:36:59 +0200 | [diff] [blame] | 530 | DEFUN(nsvc_nsei, nsvc_nsei_cmd, |
Jacob Erlbeck | 687b690 | 2013-10-24 01:33:19 +0200 | [diff] [blame] | 531 | "nsvc (nsei|nsvci) <0-65535> (block|unblock|reset)", |
Harald Welte | 43f3b69 | 2010-05-14 19:36:59 +0200 | [diff] [blame] | 532 | "Perform an operation on a NSVC\n" |
Holger Hans Peter Freyther | 887934e | 2011-11-05 15:14:59 +0100 | [diff] [blame] | 533 | "NSEI to identify NS-VC Identifier (NS-VCI)\n" |
Jacob Erlbeck | 687b690 | 2013-10-24 01:33:19 +0200 | [diff] [blame] | 534 | "NS-VC Identifier (NS-VCI)\n" |
Holger Hans Peter Freyther | 887934e | 2011-11-05 15:14:59 +0100 | [diff] [blame] | 535 | "The NSEI\n" |
Harald Welte | 43f3b69 | 2010-05-14 19:36:59 +0200 | [diff] [blame] | 536 | "Initiate BLOCK procedure\n" |
| 537 | "Initiate UNBLOCK procedure\n" |
| 538 | "Initiate RESET procedure\n") |
| 539 | { |
Jacob Erlbeck | 687b690 | 2013-10-24 01:33:19 +0200 | [diff] [blame] | 540 | const char *id_type = argv[0]; |
| 541 | uint16_t id = atoi(argv[1]); |
| 542 | const char *operation = argv[2]; |
Harald Welte | 43f3b69 | 2010-05-14 19:36:59 +0200 | [diff] [blame] | 543 | struct gprs_nsvc *nsvc; |
| 544 | |
Jacob Erlbeck | 687b690 | 2013-10-24 01:33:19 +0200 | [diff] [blame] | 545 | if (!strcmp(id_type, "nsei")) |
| 546 | nsvc = gprs_nsvc_by_nsei(vty_nsi, id); |
| 547 | else if (!strcmp(id_type, "nsvci")) |
| 548 | nsvc = gprs_nsvc_by_nsvci(vty_nsi, id); |
| 549 | else { |
| 550 | vty_out(vty, "%%No such id_type '%s'%s", id_type, VTY_NEWLINE); |
| 551 | return CMD_WARNING; |
| 552 | } |
| 553 | |
Harald Welte | 43f3b69 | 2010-05-14 19:36:59 +0200 | [diff] [blame] | 554 | if (!nsvc) { |
Jacob Erlbeck | 687b690 | 2013-10-24 01:33:19 +0200 | [diff] [blame] | 555 | 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] | 556 | return CMD_WARNING; |
| 557 | } |
| 558 | |
| 559 | if (!strcmp(operation, "block")) |
| 560 | gprs_ns_tx_block(nsvc, NS_CAUSE_OM_INTERVENTION); |
| 561 | else if (!strcmp(operation, "unblock")) |
| 562 | gprs_ns_tx_unblock(nsvc); |
| 563 | else if (!strcmp(operation, "reset")) |
| 564 | gprs_nsvc_reset(nsvc, NS_CAUSE_OM_INTERVENTION); |
| 565 | else |
| 566 | return CMD_WARNING; |
| 567 | |
| 568 | return CMD_SUCCESS; |
| 569 | } |
| 570 | |
Harald Welte | 91f7f4b | 2010-05-15 23:52:02 +0200 | [diff] [blame] | 571 | DEFUN(logging_fltr_nsvc, |
| 572 | logging_fltr_nsvc_cmd, |
| 573 | "logging filter nsvc (nsei|nsvci) <0-65535>", |
Harald Welte | 6703bf7 | 2010-05-16 00:00:04 +0200 | [diff] [blame] | 574 | LOGGING_STR FILTER_STR |
Harald Welte | 91f7f4b | 2010-05-15 23:52:02 +0200 | [diff] [blame] | 575 | "Filter based on NS Virtual Connection\n" |
| 576 | "Identify NS-VC by NSEI\n" |
| 577 | "Identify NS-VC by NSVCI\n" |
| 578 | "Numeric identifier\n") |
| 579 | { |
Harald Welte | 43ae94e | 2011-02-18 21:10:05 +0100 | [diff] [blame] | 580 | struct log_target *tgt = osmo_log_vty2tgt(vty); |
Harald Welte | 91f7f4b | 2010-05-15 23:52:02 +0200 | [diff] [blame] | 581 | struct gprs_nsvc *nsvc; |
| 582 | uint16_t id = atoi(argv[1]); |
| 583 | |
Harald Welte | 43ae94e | 2011-02-18 21:10:05 +0100 | [diff] [blame] | 584 | if (!tgt) |
Harald Welte | 91f7f4b | 2010-05-15 23:52:02 +0200 | [diff] [blame] | 585 | return CMD_WARNING; |
Harald Welte | 91f7f4b | 2010-05-15 23:52:02 +0200 | [diff] [blame] | 586 | |
| 587 | if (!strcmp(argv[0], "nsei")) |
Harald Welte | f543036 | 2012-06-17 12:25:53 +0800 | [diff] [blame] | 588 | nsvc = gprs_nsvc_by_nsei(vty_nsi, id); |
Harald Welte | 91f7f4b | 2010-05-15 23:52:02 +0200 | [diff] [blame] | 589 | else |
Harald Welte | f543036 | 2012-06-17 12:25:53 +0800 | [diff] [blame] | 590 | nsvc = gprs_nsvc_by_nsvci(vty_nsi, id); |
Harald Welte | 91f7f4b | 2010-05-15 23:52:02 +0200 | [diff] [blame] | 591 | |
| 592 | if (!nsvc) { |
| 593 | vty_out(vty, "No NS-VC by that identifier%s", VTY_NEWLINE); |
| 594 | return CMD_WARNING; |
| 595 | } |
| 596 | |
Harald Welte | 43ae94e | 2011-02-18 21:10:05 +0100 | [diff] [blame] | 597 | log_set_nsvc_filter(tgt, nsvc); |
Harald Welte | 91f7f4b | 2010-05-15 23:52:02 +0200 | [diff] [blame] | 598 | return CMD_SUCCESS; |
| 599 | } |
Harald Welte | 43f3b69 | 2010-05-14 19:36:59 +0200 | [diff] [blame] | 600 | |
Harald Welte | 144e029 | 2010-05-13 11:45:07 +0200 | [diff] [blame] | 601 | int gprs_ns_vty_init(struct gprs_ns_inst *nsi) |
| 602 | { |
Neels Hofmeyr | c32bfd5 | 2017-01-12 22:32:19 +0100 | [diff] [blame] | 603 | static bool vty_elements_installed = false; |
| 604 | |
Harald Welte | 144e029 | 2010-05-13 11:45:07 +0200 | [diff] [blame] | 605 | vty_nsi = nsi; |
| 606 | |
Neels Hofmeyr | c32bfd5 | 2017-01-12 22:32:19 +0100 | [diff] [blame] | 607 | /* Regression test code may call this function repeatedly, so make sure |
| 608 | * that VTY elements are not duplicated, which would assert. */ |
| 609 | if (vty_elements_installed) |
| 610 | return 0; |
| 611 | vty_elements_installed = true; |
| 612 | |
Harald Welte | 144e029 | 2010-05-13 11:45:07 +0200 | [diff] [blame] | 613 | install_element_ve(&show_ns_cmd); |
Harald Welte | af1d4cb | 2010-05-13 12:32:30 +0200 | [diff] [blame] | 614 | install_element_ve(&show_ns_stats_cmd); |
Max | 296511b | 2017-10-24 18:05:35 +0200 | [diff] [blame] | 615 | install_element_ve(&show_ns_pers_cmd); |
Harald Welte | 9288334 | 2010-05-15 23:04:03 +0200 | [diff] [blame] | 616 | install_element_ve(&show_nse_cmd); |
Harald Welte | 91f7f4b | 2010-05-15 23:52:02 +0200 | [diff] [blame] | 617 | install_element_ve(&logging_fltr_nsvc_cmd); |
Harald Welte | 144e029 | 2010-05-13 11:45:07 +0200 | [diff] [blame] | 618 | |
Harald Welte | 43ae94e | 2011-02-18 21:10:05 +0100 | [diff] [blame] | 619 | install_element(CFG_LOG_NODE, &logging_fltr_nsvc_cmd); |
| 620 | |
Harald Welte | 144e029 | 2010-05-13 11:45:07 +0200 | [diff] [blame] | 621 | install_element(CONFIG_NODE, &cfg_ns_cmd); |
| 622 | install_node(&ns_node, config_write_ns); |
Harald Welte | 4f5883b | 2012-06-16 16:54:06 +0800 | [diff] [blame] | 623 | install_element(L_NS_NODE, &cfg_nse_nsvci_cmd); |
| 624 | install_element(L_NS_NODE, &cfg_nse_remoteip_cmd); |
| 625 | install_element(L_NS_NODE, &cfg_nse_remoteport_cmd); |
| 626 | install_element(L_NS_NODE, &cfg_nse_fr_dlci_cmd); |
| 627 | install_element(L_NS_NODE, &cfg_nse_encaps_cmd); |
| 628 | install_element(L_NS_NODE, &cfg_nse_remoterole_cmd); |
| 629 | install_element(L_NS_NODE, &cfg_no_nse_cmd); |
| 630 | install_element(L_NS_NODE, &cfg_ns_timer_cmd); |
| 631 | install_element(L_NS_NODE, &cfg_nsip_local_ip_cmd); |
| 632 | install_element(L_NS_NODE, &cfg_nsip_local_port_cmd); |
Holger Hans Peter Freyther | 2c3393d | 2013-03-25 11:59:58 +0100 | [diff] [blame] | 633 | install_element(L_NS_NODE, &cfg_nsip_dscp_cmd); |
Harald Welte | 4f5883b | 2012-06-16 16:54:06 +0800 | [diff] [blame] | 634 | install_element(L_NS_NODE, &cfg_frgre_enable_cmd); |
| 635 | install_element(L_NS_NODE, &cfg_frgre_local_ip_cmd); |
Harald Welte | 144e029 | 2010-05-13 11:45:07 +0200 | [diff] [blame] | 636 | |
Harald Welte | 43f3b69 | 2010-05-14 19:36:59 +0200 | [diff] [blame] | 637 | install_element(ENABLE_NODE, &nsvc_nsei_cmd); |
| 638 | |
Harald Welte | 144e029 | 2010-05-13 11:45:07 +0200 | [diff] [blame] | 639 | return 0; |
| 640 | } |