Harald Welte | 9f75c35 | 2010-04-30 20:26:32 +0200 | [diff] [blame] | 1 | /* NS-over-IP proxy */ |
| 2 | |
| 3 | /* (C) 2010 by Harald Welte <laforge@gnumonks.org> |
Holger Hans Peter Freyther | 85531cc | 2010-10-06 20:37:09 +0800 | [diff] [blame] | 4 | * (C) 2010 by On-Waves |
Harald Welte | 9f75c35 | 2010-04-30 20:26:32 +0200 | [diff] [blame] | 5 | * All Rights Reserved |
| 6 | * |
| 7 | * This program is free software; you can redistribute it and/or modify |
Harald Welte | 9af6ddf | 2011-01-01 15:25:50 +0100 | [diff] [blame] | 8 | * it under the terms of the GNU Affero General Public License as published by |
| 9 | * the Free Software Foundation; either version 3 of the License, or |
Harald Welte | 9f75c35 | 2010-04-30 20:26:32 +0200 | [diff] [blame] | 10 | * (at your option) any later version. |
| 11 | * |
| 12 | * This program is distributed in the hope that it will be useful, |
| 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
Harald Welte | 9af6ddf | 2011-01-01 15:25:50 +0100 | [diff] [blame] | 15 | * GNU Affero General Public License for more details. |
Harald Welte | 9f75c35 | 2010-04-30 20:26:32 +0200 | [diff] [blame] | 16 | * |
Harald Welte | 9af6ddf | 2011-01-01 15:25:50 +0100 | [diff] [blame] | 17 | * You should have received a copy of the GNU Affero General Public License |
| 18 | * along with this program. If not, see <http://www.gnu.org/licenses/>. |
Harald Welte | 9f75c35 | 2010-04-30 20:26:32 +0200 | [diff] [blame] | 19 | * |
| 20 | */ |
| 21 | |
| 22 | #include <unistd.h> |
| 23 | #include <stdio.h> |
| 24 | #include <stdlib.h> |
| 25 | #include <string.h> |
| 26 | #include <getopt.h> |
| 27 | #include <errno.h> |
Harald Welte | 6df0c51 | 2010-05-12 18:40:01 +0000 | [diff] [blame] | 28 | #include <signal.h> |
Harald Welte | 9f75c35 | 2010-04-30 20:26:32 +0200 | [diff] [blame] | 29 | #include <sys/fcntl.h> |
| 30 | #include <sys/stat.h> |
Harald Welte | 9f75c35 | 2010-04-30 20:26:32 +0200 | [diff] [blame] | 31 | #include <sys/socket.h> |
| 32 | #include <netinet/in.h> |
| 33 | #include <arpa/inet.h> |
| 34 | |
Holger Hans Peter Freyther | 67cd75f | 2011-05-12 16:02:07 +0200 | [diff] [blame] | 35 | #include <osmocom/core/application.h> |
Pablo Neira Ayuso | 136f453 | 2011-03-22 16:47:59 +0100 | [diff] [blame] | 36 | #include <osmocom/core/talloc.h> |
| 37 | #include <osmocom/core/select.h> |
| 38 | #include <osmocom/core/rate_ctr.h> |
Harald Welte | 9f75c35 | 2010-04-30 20:26:32 +0200 | [diff] [blame] | 39 | |
Harald Welte | ea34a4e | 2012-06-16 14:59:56 +0800 | [diff] [blame] | 40 | #include <osmocom/gprs/gprs_ns.h> |
| 41 | #include <osmocom/gprs/gprs_bssgp.h> |
| 42 | |
Harald Welte | 9f75c35 | 2010-04-30 20:26:32 +0200 | [diff] [blame] | 43 | #include <openbsc/signal.h> |
| 44 | #include <openbsc/debug.h> |
Harald Welte | 9f75c35 | 2010-04-30 20:26:32 +0200 | [diff] [blame] | 45 | #include <openbsc/vty.h> |
Harald Welte | b77c697 | 2010-05-01 11:28:43 +0200 | [diff] [blame] | 46 | #include <openbsc/gb_proxy.h> |
Harald Welte | 9f75c35 | 2010-04-30 20:26:32 +0200 | [diff] [blame] | 47 | |
Harald Welte | 4b037e4 | 2010-05-19 19:45:32 +0200 | [diff] [blame] | 48 | #include <osmocom/vty/command.h> |
| 49 | #include <osmocom/vty/telnet_interface.h> |
Pablo Neira Ayuso | 3848770 | 2011-03-23 08:49:00 +0100 | [diff] [blame] | 50 | #include <osmocom/vty/logging.h> |
Harald Welte | 55dc31e | 2014-08-24 17:54:49 +0200 | [diff] [blame] | 51 | #include <osmocom/vty/ports.h> |
Harald Welte | 1353f96 | 2010-05-16 19:20:24 +0200 | [diff] [blame] | 52 | |
Harald Welte | e236596 | 2010-05-04 07:41:59 +0200 | [diff] [blame] | 53 | #include "../../bscconfig.h" |
Harald Welte | 9f75c35 | 2010-04-30 20:26:32 +0200 | [diff] [blame] | 54 | |
| 55 | /* this is here for the vty... it will never be called */ |
| 56 | void subscr_put() { abort(); } |
| 57 | |
| 58 | #define _GNU_SOURCE |
| 59 | #include <getopt.h> |
| 60 | |
| 61 | void *tall_bsc_ctx; |
| 62 | |
Harald Welte | 9f75c35 | 2010-04-30 20:26:32 +0200 | [diff] [blame] | 63 | const char *openbsc_copyright = |
Holger Hans Peter Freyther | 5f54075 | 2010-09-11 13:32:30 +0800 | [diff] [blame] | 64 | "Copyright (C) 2010 Harald Welte and On-Waves\r\n" |
Harald Welte | 9af6ddf | 2011-01-01 15:25:50 +0100 | [diff] [blame] | 65 | "License AGPLv3+: GNU AGPL version 3 or later <http://gnu.org/licenses/agpl-3.0.html>\r\n" |
Holger Hans Peter Freyther | 5f54075 | 2010-09-11 13:32:30 +0800 | [diff] [blame] | 66 | "This is free software: you are free to change and redistribute it.\r\n" |
| 67 | "There is NO WARRANTY, to the extent permitted by law.\r\n"; |
Harald Welte | 9f75c35 | 2010-04-30 20:26:32 +0200 | [diff] [blame] | 68 | |
Harald Welte | 288be16 | 2010-05-01 16:48:27 +0200 | [diff] [blame] | 69 | static char *config_file = "osmo_gbproxy.cfg"; |
Jacob Erlbeck | 67a4445 | 2014-05-19 10:14:58 +0200 | [diff] [blame] | 70 | struct gbproxy_config gbcfg = {0}; |
Harald Welte | 2c869ef | 2010-08-25 19:43:54 +0200 | [diff] [blame] | 71 | static int daemonize = 0; |
Harald Welte | 9f75c35 | 2010-04-30 20:26:32 +0200 | [diff] [blame] | 72 | |
| 73 | /* Pointer to the SGSN peer */ |
| 74 | extern struct gbprox_peer *gbprox_peer_sgsn; |
| 75 | |
| 76 | /* call-back function for the NS protocol */ |
| 77 | static int proxy_ns_cb(enum gprs_ns_evt event, struct gprs_nsvc *nsvc, |
Holger Hans Peter Freyther | c42ad8b | 2011-04-18 17:04:00 +0200 | [diff] [blame] | 78 | struct msgb *msg, uint16_t bvci) |
Harald Welte | 9f75c35 | 2010-04-30 20:26:32 +0200 | [diff] [blame] | 79 | { |
| 80 | int rc = 0; |
| 81 | |
| 82 | switch (event) { |
| 83 | case GPRS_NS_EVT_UNIT_DATA: |
Holger Hans Peter Freyther | eece6277 | 2014-08-04 15:42:36 +0200 | [diff] [blame] | 84 | rc = gbprox_rcvmsg(&gbcfg, msg, nsvc->nsei, bvci, nsvc->nsvci); |
Harald Welte | 9f75c35 | 2010-04-30 20:26:32 +0200 | [diff] [blame] | 85 | break; |
| 86 | default: |
| 87 | LOGP(DGPRS, LOGL_ERROR, "SGSN: Unknown event %u from NS\n", event); |
| 88 | if (msg) |
Holger Hans Peter Freyther | a8ddb08 | 2012-03-01 20:30:32 +0100 | [diff] [blame] | 89 | msgb_free(msg); |
Harald Welte | 9f75c35 | 2010-04-30 20:26:32 +0200 | [diff] [blame] | 90 | rc = -EIO; |
| 91 | break; |
| 92 | } |
| 93 | return rc; |
| 94 | } |
| 95 | |
Harald Welte | 6df0c51 | 2010-05-12 18:40:01 +0000 | [diff] [blame] | 96 | static void signal_handler(int signal) |
| 97 | { |
| 98 | fprintf(stdout, "signal %u received\n", signal); |
| 99 | |
| 100 | switch (signal) { |
| 101 | case SIGINT: |
Pablo Neira Ayuso | ed5cacb | 2011-08-17 22:44:07 +0200 | [diff] [blame] | 102 | osmo_signal_dispatch(SS_L_GLOBAL, S_L_GLOBAL_SHUTDOWN, NULL); |
Harald Welte | 6df0c51 | 2010-05-12 18:40:01 +0000 | [diff] [blame] | 103 | sleep(1); |
| 104 | exit(0); |
| 105 | break; |
| 106 | case SIGABRT: |
| 107 | /* in case of abort, we want to obtain a talloc report |
| 108 | * and then return to the caller, who will abort the process */ |
| 109 | case SIGUSR1: |
| 110 | talloc_report(tall_vty_ctx, stderr); |
| 111 | talloc_report_full(tall_bsc_ctx, stderr); |
| 112 | break; |
| 113 | case SIGUSR2: |
| 114 | talloc_report_full(tall_vty_ctx, stderr); |
| 115 | break; |
| 116 | default: |
| 117 | break; |
| 118 | } |
| 119 | } |
| 120 | |
Harald Welte | 768f287 | 2010-05-14 11:22:33 +0000 | [diff] [blame] | 121 | static void print_usage() |
| 122 | { |
| 123 | printf("Usage: bsc_hack\n"); |
| 124 | } |
| 125 | |
| 126 | static void print_help() |
| 127 | { |
| 128 | printf(" Some useful help...\n"); |
| 129 | printf(" -h --help this text\n"); |
| 130 | printf(" -d option --debug=DNS:DGPRS,0:0 enable debugging\n"); |
Harald Welte | 2c869ef | 2010-08-25 19:43:54 +0200 | [diff] [blame] | 131 | printf(" -D --daemonize Fork the process into a background daemon\n"); |
Harald Welte | 768f287 | 2010-05-14 11:22:33 +0000 | [diff] [blame] | 132 | printf(" -c --config-file filename The config file to use.\n"); |
| 133 | printf(" -s --disable-color\n"); |
| 134 | printf(" -T --timestamp Prefix every log line with a timestamp\n"); |
| 135 | printf(" -V --version. Print the version of OpenBSC.\n"); |
| 136 | printf(" -e --log-level number. Set a global loglevel.\n"); |
| 137 | } |
| 138 | |
| 139 | static void handle_options(int argc, char **argv) |
| 140 | { |
| 141 | while (1) { |
| 142 | int option_index = 0, c; |
| 143 | static struct option long_options[] = { |
| 144 | { "help", 0, 0, 'h' }, |
| 145 | { "debug", 1, 0, 'd' }, |
Harald Welte | 2c869ef | 2010-08-25 19:43:54 +0200 | [diff] [blame] | 146 | { "daemonize", 0, 0, 'D' }, |
Harald Welte | 768f287 | 2010-05-14 11:22:33 +0000 | [diff] [blame] | 147 | { "config-file", 1, 0, 'c' }, |
| 148 | { "disable-color", 0, 0, 's' }, |
| 149 | { "timestamp", 0, 0, 'T' }, |
| 150 | { "version", 0, 0, 'V' }, |
| 151 | { "log-level", 1, 0, 'e' }, |
| 152 | { 0, 0, 0, 0 } |
| 153 | }; |
| 154 | |
Harald Welte | 2c869ef | 2010-08-25 19:43:54 +0200 | [diff] [blame] | 155 | c = getopt_long(argc, argv, "hd:Dc:sTVe:", |
Harald Welte | 768f287 | 2010-05-14 11:22:33 +0000 | [diff] [blame] | 156 | long_options, &option_index); |
| 157 | if (c == -1) |
| 158 | break; |
| 159 | |
| 160 | switch (c) { |
| 161 | case 'h': |
| 162 | print_usage(); |
| 163 | print_help(); |
| 164 | exit(0); |
| 165 | case 's': |
Holger Hans Peter Freyther | 67cd75f | 2011-05-12 16:02:07 +0200 | [diff] [blame] | 166 | log_set_use_color(osmo_stderr_target, 0); |
Harald Welte | 768f287 | 2010-05-14 11:22:33 +0000 | [diff] [blame] | 167 | break; |
| 168 | case 'd': |
Holger Hans Peter Freyther | 67cd75f | 2011-05-12 16:02:07 +0200 | [diff] [blame] | 169 | log_parse_category_mask(osmo_stderr_target, optarg); |
Harald Welte | 768f287 | 2010-05-14 11:22:33 +0000 | [diff] [blame] | 170 | break; |
Harald Welte | 2c869ef | 2010-08-25 19:43:54 +0200 | [diff] [blame] | 171 | case 'D': |
| 172 | daemonize = 1; |
| 173 | break; |
Harald Welte | 768f287 | 2010-05-14 11:22:33 +0000 | [diff] [blame] | 174 | case 'c': |
| 175 | config_file = strdup(optarg); |
| 176 | break; |
| 177 | case 'T': |
Holger Hans Peter Freyther | 67cd75f | 2011-05-12 16:02:07 +0200 | [diff] [blame] | 178 | log_set_print_timestamp(osmo_stderr_target, 1); |
Harald Welte | 768f287 | 2010-05-14 11:22:33 +0000 | [diff] [blame] | 179 | break; |
| 180 | case 'e': |
Holger Hans Peter Freyther | 67cd75f | 2011-05-12 16:02:07 +0200 | [diff] [blame] | 181 | log_set_log_level(osmo_stderr_target, atoi(optarg)); |
Harald Welte | 768f287 | 2010-05-14 11:22:33 +0000 | [diff] [blame] | 182 | break; |
| 183 | case 'V': |
Harald Welte | 1353f96 | 2010-05-16 19:20:24 +0200 | [diff] [blame] | 184 | print_version(1); |
Harald Welte | 768f287 | 2010-05-14 11:22:33 +0000 | [diff] [blame] | 185 | exit(0); |
| 186 | break; |
| 187 | default: |
| 188 | break; |
| 189 | } |
| 190 | } |
| 191 | } |
| 192 | |
Harald Welte | 6df0c51 | 2010-05-12 18:40:01 +0000 | [diff] [blame] | 193 | extern void *tall_msgb_ctx; |
Harald Welte | 9f75c35 | 2010-04-30 20:26:32 +0200 | [diff] [blame] | 194 | |
Holger Hans Peter Freyther | 57da447 | 2010-06-08 16:11:06 +0800 | [diff] [blame] | 195 | extern enum node_type bsc_vty_go_parent(struct vty *vty); |
Harald Welte | c31f480 | 2010-05-25 23:31:39 +0200 | [diff] [blame] | 196 | |
| 197 | static struct vty_app_info vty_info = { |
Harald Welte | ec1921d | 2011-02-24 23:57:06 +0100 | [diff] [blame] | 198 | .name = "OsmoGbProxy", |
Harald Welte | c31f480 | 2010-05-25 23:31:39 +0200 | [diff] [blame] | 199 | .version = PACKAGE_VERSION, |
| 200 | .go_parent_cb = bsc_vty_go_parent, |
Holger Hans Peter Freyther | 81506b4 | 2010-09-04 11:00:01 +0800 | [diff] [blame] | 201 | .is_config_node = bsc_vty_is_config_node, |
Harald Welte | c31f480 | 2010-05-25 23:31:39 +0200 | [diff] [blame] | 202 | }; |
| 203 | |
Harald Welte | 11461a6 | 2012-06-17 12:58:46 +0800 | [diff] [blame] | 204 | /* default categories */ |
| 205 | static struct log_info_cat gprs_categories[] = { |
| 206 | [DGPRS] = { |
| 207 | .name = "DGPRS", |
| 208 | .description = "GPRS Packet Service", |
| 209 | .enabled = 1, .loglevel = LOGL_DEBUG, |
| 210 | }, |
| 211 | [DNS] = { |
| 212 | .name = "DNS", |
| 213 | .description = "GPRS Network Service (NS)", |
| 214 | .enabled = 1, .loglevel = LOGL_INFO, |
| 215 | }, |
| 216 | [DBSSGP] = { |
| 217 | .name = "DBSSGP", |
| 218 | .description = "GPRS BSS Gateway Protocol (BSSGP)", |
| 219 | .enabled = 1, .loglevel = LOGL_DEBUG, |
| 220 | }, |
| 221 | }; |
| 222 | |
| 223 | static const struct log_info gprs_log_info = { |
| 224 | .filter_fn = gprs_log_filter_fn, |
| 225 | .cat = gprs_categories, |
| 226 | .num_cat = ARRAY_SIZE(gprs_categories), |
| 227 | }; |
| 228 | |
Harald Welte | 9f75c35 | 2010-04-30 20:26:32 +0200 | [diff] [blame] | 229 | int main(int argc, char **argv) |
| 230 | { |
| 231 | struct gsm_network dummy_network; |
Harald Welte | 9f75c35 | 2010-04-30 20:26:32 +0200 | [diff] [blame] | 232 | int rc; |
| 233 | |
| 234 | tall_bsc_ctx = talloc_named_const(NULL, 0, "nsip_proxy"); |
Harald Welte | 6df0c51 | 2010-05-12 18:40:01 +0000 | [diff] [blame] | 235 | tall_msgb_ctx = talloc_named_const(tall_bsc_ctx, 0, "msgb"); |
| 236 | |
| 237 | signal(SIGINT, &signal_handler); |
| 238 | signal(SIGABRT, &signal_handler); |
| 239 | signal(SIGUSR1, &signal_handler); |
| 240 | signal(SIGUSR2, &signal_handler); |
Holger Hans Peter Freyther | 67cd75f | 2011-05-12 16:02:07 +0200 | [diff] [blame] | 241 | osmo_init_ignore_signals(); |
Harald Welte | 9f75c35 | 2010-04-30 20:26:32 +0200 | [diff] [blame] | 242 | |
Harald Welte | 11461a6 | 2012-06-17 12:58:46 +0800 | [diff] [blame] | 243 | osmo_init_logging(&gprs_log_info); |
Harald Welte | 9f75c35 | 2010-04-30 20:26:32 +0200 | [diff] [blame] | 244 | |
Harald Welte | c31f480 | 2010-05-25 23:31:39 +0200 | [diff] [blame] | 245 | vty_info.copyright = openbsc_copyright; |
| 246 | vty_init(&vty_info); |
Harald Welte | 11461a6 | 2012-06-17 12:58:46 +0800 | [diff] [blame] | 247 | logging_vty_add_cmds(&gprs_log_info); |
Harald Welte | 7af4962 | 2010-05-19 14:04:23 +0200 | [diff] [blame] | 248 | gbproxy_vty_init(); |
Harald Welte | 1353f96 | 2010-05-16 19:20:24 +0200 | [diff] [blame] | 249 | |
Harald Welte | 768f287 | 2010-05-14 11:22:33 +0000 | [diff] [blame] | 250 | handle_options(argc, argv); |
| 251 | |
Harald Welte | f2b4cd7 | 2010-05-13 11:45:07 +0200 | [diff] [blame] | 252 | rate_ctr_init(tall_bsc_ctx); |
Harald Welte | 9f75c35 | 2010-04-30 20:26:32 +0200 | [diff] [blame] | 253 | |
Harald Welte | 55dc31e | 2014-08-24 17:54:49 +0200 | [diff] [blame] | 254 | rc = telnet_init(tall_bsc_ctx, &dummy_network, OSMO_VTY_PORT_GBPROXY); |
Harald Welte | dcccb18 | 2010-05-16 20:52:23 +0200 | [diff] [blame] | 255 | if (rc < 0) |
| 256 | exit(1); |
| 257 | |
Harald Welte | fdd8b3b | 2012-06-16 16:54:06 +0800 | [diff] [blame] | 258 | bssgp_nsi = gprs_ns_instantiate(&proxy_ns_cb, tall_bsc_ctx); |
Harald Welte | 0a4050c | 2010-05-11 10:01:17 +0200 | [diff] [blame] | 259 | if (!bssgp_nsi) { |
Harald Welte | 9f75c35 | 2010-04-30 20:26:32 +0200 | [diff] [blame] | 260 | LOGP(DGPRS, LOGL_ERROR, "Unable to instantiate NS\n"); |
| 261 | exit(1); |
| 262 | } |
Holger Hans Peter Freyther | 18739ea | 2014-08-04 11:10:09 +0200 | [diff] [blame] | 263 | gbproxy_init_config(&gbcfg); |
Harald Welte | 0a4050c | 2010-05-11 10:01:17 +0200 | [diff] [blame] | 264 | gbcfg.nsi = bssgp_nsi; |
Harald Welte | 1194b58 | 2010-05-12 15:55:23 +0000 | [diff] [blame] | 265 | gprs_ns_vty_init(bssgp_nsi); |
Harald Welte | 68d85d5 | 2012-06-16 17:45:59 +0800 | [diff] [blame] | 266 | gprs_ns_set_log_ss(DNS); |
Harald Welte | ce95b27 | 2012-06-17 13:04:02 +0800 | [diff] [blame] | 267 | bssgp_set_log_ss(DBSSGP); |
Holger Hans Peter Freyther | eece6277 | 2014-08-04 15:42:36 +0200 | [diff] [blame] | 268 | osmo_signal_register_handler(SS_L_NS, &gbprox_signal, &gbcfg); |
Harald Welte | 1194b58 | 2010-05-12 15:55:23 +0000 | [diff] [blame] | 269 | |
| 270 | rc = gbproxy_parse_config(config_file, &gbcfg); |
| 271 | if (rc < 0) { |
| 272 | LOGP(DGPRS, LOGL_FATAL, "Cannot parse config file\n"); |
| 273 | exit(2); |
| 274 | } |
| 275 | |
Harald Welte | e6599ee | 2012-06-17 12:25:53 +0800 | [diff] [blame] | 276 | if (!gprs_nsvc_by_nsei(gbcfg.nsi, gbcfg.nsip_sgsn_nsei)) { |
Harald Welte | 7af4962 | 2010-05-19 14:04:23 +0200 | [diff] [blame] | 277 | LOGP(DGPRS, LOGL_FATAL, "You cannot proxy to NSEI %u " |
| 278 | "without creating that NSEI before\n", |
| 279 | gbcfg.nsip_sgsn_nsei); |
| 280 | exit(2); |
| 281 | } |
Harald Welte | 9f75c35 | 2010-04-30 20:26:32 +0200 | [diff] [blame] | 282 | |
Harald Welte | ff3bde8 | 2010-05-19 15:09:09 +0200 | [diff] [blame] | 283 | rc = gprs_ns_nsip_listen(bssgp_nsi); |
Harald Welte | 7af4962 | 2010-05-19 14:04:23 +0200 | [diff] [blame] | 284 | if (rc < 0) { |
| 285 | LOGP(DGPRS, LOGL_FATAL, "Cannot bind/listen on NSIP socket\n"); |
| 286 | exit(2); |
| 287 | } |
Harald Welte | 1ccbf44 | 2010-05-14 11:53:08 +0000 | [diff] [blame] | 288 | |
Harald Welte | ff3bde8 | 2010-05-19 15:09:09 +0200 | [diff] [blame] | 289 | rc = gprs_ns_frgre_listen(bssgp_nsi); |
| 290 | if (rc < 0) { |
| 291 | LOGP(DGPRS, LOGL_FATAL, "Cannot bind/listen GRE " |
| 292 | "socket. Do you have CAP_NET_RAW?\n"); |
| 293 | exit(2); |
Harald Welte | 5540c4c | 2010-05-19 14:38:50 +0200 | [diff] [blame] | 294 | } |
| 295 | |
Harald Welte | 2c869ef | 2010-08-25 19:43:54 +0200 | [diff] [blame] | 296 | if (daemonize) { |
| 297 | rc = osmo_daemonize(); |
| 298 | if (rc < 0) { |
| 299 | perror("Error during daemonize"); |
| 300 | exit(1); |
| 301 | } |
| 302 | } |
| 303 | |
Harald Welte | 1ccbf44 | 2010-05-14 11:53:08 +0000 | [diff] [blame] | 304 | /* Reset all the persistent NS-VCs that we've read from the config */ |
| 305 | gbprox_reset_persistent_nsvcs(bssgp_nsi); |
| 306 | |
Harald Welte | 9f75c35 | 2010-04-30 20:26:32 +0200 | [diff] [blame] | 307 | while (1) { |
Pablo Neira Ayuso | 4db9299 | 2011-05-06 12:11:23 +0200 | [diff] [blame] | 308 | rc = osmo_select_main(0); |
Harald Welte | 9f75c35 | 2010-04-30 20:26:32 +0200 | [diff] [blame] | 309 | if (rc < 0) |
| 310 | exit(3); |
| 311 | } |
| 312 | |
| 313 | exit(0); |
| 314 | } |