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