Harald Welte | 5fd8a54 | 2009-02-13 02:43:36 +0000 | [diff] [blame] | 1 | /* OpenBSC Abis input driver for ip.access */ |
| 2 | |
| 3 | /* (C) 2009 by Harald Welte <laforge@gnumonks.org> |
| 4 | * |
| 5 | * All Rights Reserved |
| 6 | * |
| 7 | * This program is free software; you can redistribute it and/or modify |
| 8 | * it under the terms of the GNU General Public License as published by |
| 9 | * the Free Software Foundation; either version 2 of the License, or |
| 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 |
| 15 | * GNU General Public License for more details. |
| 16 | * |
| 17 | * You should have received a copy of the GNU General Public License along |
| 18 | * with this program; if not, write to the Free Software Foundation, Inc., |
| 19 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. |
| 20 | * |
| 21 | */ |
| 22 | |
| 23 | #include <stdio.h> |
| 24 | #include <unistd.h> |
| 25 | #include <stdlib.h> |
| 26 | #include <errno.h> |
| 27 | #include <string.h> |
| 28 | #include <time.h> |
| 29 | #include <sys/fcntl.h> |
| 30 | #include <sys/types.h> |
| 31 | #include <sys/socket.h> |
| 32 | #include <sys/ioctl.h> |
| 33 | #include <arpa/inet.h> |
| 34 | |
| 35 | #include <openbsc/select.h> |
| 36 | #include <openbsc/msgb.h> |
| 37 | #include <openbsc/debug.h> |
| 38 | #include <openbsc/gsm_data.h> |
| 39 | #include <openbsc/abis_nm.h> |
| 40 | #include <openbsc/abis_rsl.h> |
| 41 | #include <openbsc/subchan_demux.h> |
| 42 | #include <openbsc/e1_input.h> |
Harald Welte | 4f361fc | 2009-02-15 15:32:53 +0000 | [diff] [blame] | 43 | #include <openbsc/ipaccess.h> |
Harald Welte | 5fd8a54 | 2009-02-13 02:43:36 +0000 | [diff] [blame] | 44 | |
| 45 | /* data structure for one E1 interface with A-bis */ |
| 46 | struct ia_e1_handle { |
| 47 | struct bsc_fd listen_fd; |
Harald Welte | 5c1e458 | 2009-02-15 11:57:29 +0000 | [diff] [blame] | 48 | struct bsc_fd rsl_listen_fd; |
Harald Welte | 5fd8a54 | 2009-02-13 02:43:36 +0000 | [diff] [blame] | 49 | }; |
| 50 | |
| 51 | #define TS1_ALLOC_SIZE 300 |
| 52 | |
Harald Welte | 4f361fc | 2009-02-15 15:32:53 +0000 | [diff] [blame] | 53 | static const u_int8_t pong[] = { 0, 1, IPAC_PROTO_IPACCESS, IPAC_MSGT_PONG }; |
| 54 | static const u_int8_t id_ack[] = { 0, 1, IPAC_PROTO_IPACCESS, IPAC_MSGT_ID_ACK }; |
Harald Welte | 5fd8a54 | 2009-02-13 02:43:36 +0000 | [diff] [blame] | 55 | |
| 56 | static int ipaccess_rcvmsg(struct msgb *msg, int fd) |
| 57 | { |
| 58 | u_int8_t msg_type = *(msg->l2h); |
| 59 | |
Harald Welte | 5fd8a54 | 2009-02-13 02:43:36 +0000 | [diff] [blame] | 60 | switch (msg_type) { |
Harald Welte | 4f361fc | 2009-02-15 15:32:53 +0000 | [diff] [blame] | 61 | case IPAC_MSGT_PING: |
Harald Welte | 5fd8a54 | 2009-02-13 02:43:36 +0000 | [diff] [blame] | 62 | write(fd, pong, sizeof(pong)); |
| 63 | break; |
Harald Welte | 4f361fc | 2009-02-15 15:32:53 +0000 | [diff] [blame] | 64 | case IPAC_MSGT_PONG: |
Harald Welte | 5fd8a54 | 2009-02-13 02:43:36 +0000 | [diff] [blame] | 65 | DEBUGP(DMI, "PONG!\n"); |
| 66 | break; |
Harald Welte | 4f361fc | 2009-02-15 15:32:53 +0000 | [diff] [blame] | 67 | case IPAC_MSGT_ID_RESP: |
Harald Welte | 5fd8a54 | 2009-02-13 02:43:36 +0000 | [diff] [blame] | 68 | DEBUGP(DMI, "ID_RESP\n"); |
| 69 | break; |
Harald Welte | 4f361fc | 2009-02-15 15:32:53 +0000 | [diff] [blame] | 70 | case IPAC_MSGT_ID_ACK: |
Harald Welte | 7782c14 | 2009-02-15 03:39:51 +0000 | [diff] [blame] | 71 | DEBUGP(DMI, "ID_ACK? -> ACK!\n"); |
Harald Welte | 5fd8a54 | 2009-02-13 02:43:36 +0000 | [diff] [blame] | 72 | write(fd, id_ack, sizeof(id_ack)); |
| 73 | break; |
| 74 | } |
| 75 | |
| 76 | msgb_free(msg); |
| 77 | return 0; |
| 78 | } |
| 79 | |
Harald Welte | 7782c14 | 2009-02-15 03:39:51 +0000 | [diff] [blame] | 80 | /* FIXME: this is per BTS */ |
| 81 | static int oml_up = 0; |
Harald Welte | 5c1e458 | 2009-02-15 11:57:29 +0000 | [diff] [blame] | 82 | static int rsl_up = 0; |
Harald Welte | 7782c14 | 2009-02-15 03:39:51 +0000 | [diff] [blame] | 83 | |
Harald Welte | 5fd8a54 | 2009-02-13 02:43:36 +0000 | [diff] [blame] | 84 | static int handle_ts1_read(struct bsc_fd *bfd) |
| 85 | { |
| 86 | struct e1inp_line *line = bfd->data; |
| 87 | unsigned int ts_nr = bfd->priv_nr; |
| 88 | struct e1inp_ts *e1i_ts = &line->ts[ts_nr-1]; |
| 89 | struct e1inp_sign_link *link; |
| 90 | struct msgb *msg = msgb_alloc(TS1_ALLOC_SIZE); |
| 91 | struct ipaccess_head *hh; |
| 92 | int ret; |
| 93 | |
| 94 | if (!msg) |
| 95 | return -ENOMEM; |
| 96 | |
| 97 | /* first read our 3-byte header */ |
| 98 | hh = (struct ipaccess_head *) msg->data; |
| 99 | ret = recv(bfd->fd, msg->data, 3, 0); |
| 100 | if (ret < 0) { |
| 101 | fprintf(stderr, "recv error %s\n", strerror(errno)); |
| 102 | return ret; |
| 103 | } |
| 104 | if (ret == 0) { |
| 105 | fprintf(stderr, "BTS disappeared, dead socket\n"); |
Harald Welte | 4f361fc | 2009-02-15 15:32:53 +0000 | [diff] [blame] | 106 | e1inp_event(e1i_ts, EVT_E1_TEI_DN, 0, IPAC_PROTO_RSL); |
| 107 | e1inp_event(e1i_ts, EVT_E1_TEI_DN, 0, IPAC_PROTO_OML); |
Harald Welte | 5fd8a54 | 2009-02-13 02:43:36 +0000 | [diff] [blame] | 108 | bsc_unregister_fd(bfd); |
| 109 | close(bfd->fd); |
| 110 | bfd->fd = -1; |
| 111 | } |
| 112 | msgb_put(msg, ret); |
| 113 | |
| 114 | /* then read te length as specified in header */ |
| 115 | msg->l2h = msg->data + sizeof(*hh); |
| 116 | ret = recv(bfd->fd, msg->l2h, hh->len, 0); |
| 117 | if (ret < hh->len) { |
| 118 | fprintf(stderr, "short read!\n"); |
Harald Welte | 5c1e458 | 2009-02-15 11:57:29 +0000 | [diff] [blame] | 119 | msgb_free(msg); |
| 120 | return -EIO; |
Harald Welte | 5fd8a54 | 2009-02-13 02:43:36 +0000 | [diff] [blame] | 121 | } |
| 122 | msgb_put(msg, ret); |
Harald Welte | 5fd8a54 | 2009-02-13 02:43:36 +0000 | [diff] [blame] | 123 | |
Harald Welte | 4f361fc | 2009-02-15 15:32:53 +0000 | [diff] [blame] | 124 | if (hh->proto == IPAC_PROTO_IPACCESS) |
Harald Welte | 5fd8a54 | 2009-02-13 02:43:36 +0000 | [diff] [blame] | 125 | return ipaccess_rcvmsg(msg, bfd->fd); |
| 126 | |
| 127 | if (debug_mask & DMI) { |
Harald Welte | 5c1e458 | 2009-02-15 11:57:29 +0000 | [diff] [blame] | 128 | fprintf(stdout, "RX %u: ", ts_nr); |
Harald Welte | 5fd8a54 | 2009-02-13 02:43:36 +0000 | [diff] [blame] | 129 | hexdump(msgb_l2(msg), ret); |
| 130 | } |
| 131 | |
| 132 | link = e1inp_lookup_sign_link(e1i_ts, 0, hh->proto); |
| 133 | if (!link) { |
| 134 | printf("no matching signalling link for hh->proto=0x%02x\n", hh->proto); |
| 135 | msgb_free(msg); |
| 136 | return -EIO; |
| 137 | } |
| 138 | msg->trx = link->trx; |
| 139 | |
| 140 | switch (hh->proto) { |
Harald Welte | 4f361fc | 2009-02-15 15:32:53 +0000 | [diff] [blame] | 141 | case IPAC_PROTO_RSL: |
Harald Welte | 5c1e458 | 2009-02-15 11:57:29 +0000 | [diff] [blame] | 142 | if (!rsl_up) { |
Harald Welte | 4f361fc | 2009-02-15 15:32:53 +0000 | [diff] [blame] | 143 | e1inp_event(e1i_ts, EVT_E1_TEI_UP, 0, IPAC_PROTO_RSL); |
Harald Welte | 5c1e458 | 2009-02-15 11:57:29 +0000 | [diff] [blame] | 144 | rsl_up = 1; |
| 145 | } |
Harald Welte | 5fd8a54 | 2009-02-13 02:43:36 +0000 | [diff] [blame] | 146 | ret = abis_rsl_rcvmsg(msg); |
| 147 | break; |
Harald Welte | 4f361fc | 2009-02-15 15:32:53 +0000 | [diff] [blame] | 148 | case IPAC_PROTO_OML: |
Harald Welte | 7782c14 | 2009-02-15 03:39:51 +0000 | [diff] [blame] | 149 | if (!oml_up) { |
Harald Welte | 4f361fc | 2009-02-15 15:32:53 +0000 | [diff] [blame] | 150 | e1inp_event(e1i_ts, EVT_E1_TEI_UP, 0, IPAC_PROTO_OML); |
Harald Welte | 7782c14 | 2009-02-15 03:39:51 +0000 | [diff] [blame] | 151 | oml_up = 1; |
| 152 | } |
Harald Welte | 5fd8a54 | 2009-02-13 02:43:36 +0000 | [diff] [blame] | 153 | ret = abis_nm_rcvmsg(msg); |
| 154 | break; |
| 155 | default: |
Harald Welte | 7782c14 | 2009-02-15 03:39:51 +0000 | [diff] [blame] | 156 | DEBUGP(DMI, "Unknown IP.access protocol proto=0x%02x\n", hh->proto); |
Harald Welte | 5fd8a54 | 2009-02-13 02:43:36 +0000 | [diff] [blame] | 157 | msgb_free(msg); |
| 158 | break; |
| 159 | } |
| 160 | return ret; |
| 161 | } |
| 162 | |
| 163 | static int handle_ts1_write(struct bsc_fd *bfd) |
| 164 | { |
| 165 | struct e1inp_line *line = bfd->data; |
| 166 | unsigned int ts_nr = bfd->priv_nr; |
| 167 | struct e1inp_ts *e1i_ts = &line->ts[ts_nr-1]; |
| 168 | struct e1inp_sign_link *sign_link; |
| 169 | struct msgb *msg; |
| 170 | struct ipaccess_head *hh; |
| 171 | u_int8_t *l2_data; |
| 172 | int ret; |
| 173 | |
| 174 | /* get the next msg for this timeslot */ |
| 175 | msg = e1inp_tx_ts(e1i_ts, &sign_link); |
| 176 | if (!msg) { |
| 177 | bfd->when &= ~BSC_FD_WRITE; |
| 178 | return 0; |
| 179 | } |
| 180 | |
| 181 | l2_data = msg->data; |
| 182 | |
| 183 | /* prepend the mISDNhead */ |
| 184 | hh = (struct ipaccess_head *) msgb_push(msg, sizeof(*hh)); |
| 185 | hh->zero = 0; |
| 186 | hh->len = msg->len - sizeof(*hh); |
| 187 | |
| 188 | switch (sign_link->type) { |
| 189 | case E1INP_SIGN_OML: |
Harald Welte | 4f361fc | 2009-02-15 15:32:53 +0000 | [diff] [blame] | 190 | hh->proto = IPAC_PROTO_OML; |
Harald Welte | 5fd8a54 | 2009-02-13 02:43:36 +0000 | [diff] [blame] | 191 | break; |
| 192 | case E1INP_SIGN_RSL: |
Harald Welte | 4f361fc | 2009-02-15 15:32:53 +0000 | [diff] [blame] | 193 | hh->proto = IPAC_PROTO_RSL; |
Harald Welte | 5fd8a54 | 2009-02-13 02:43:36 +0000 | [diff] [blame] | 194 | break; |
| 195 | default: |
| 196 | msgb_free(msg); |
| 197 | return -EINVAL; |
| 198 | } |
| 199 | |
| 200 | if (debug_mask & DMI) { |
Harald Welte | 5c1e458 | 2009-02-15 11:57:29 +0000 | [diff] [blame] | 201 | fprintf(stdout, "TX %u: ", ts_nr); |
Harald Welte | 5fd8a54 | 2009-02-13 02:43:36 +0000 | [diff] [blame] | 202 | hexdump(l2_data, hh->len); |
| 203 | } |
| 204 | |
| 205 | ret = send(bfd->fd, msg->data, msg->len, 0); |
| 206 | msgb_free(msg); |
Harald Welte | 7782c14 | 2009-02-15 03:39:51 +0000 | [diff] [blame] | 207 | usleep(100000); |
Harald Welte | 5fd8a54 | 2009-02-13 02:43:36 +0000 | [diff] [blame] | 208 | |
| 209 | return ret; |
| 210 | } |
| 211 | |
| 212 | |
| 213 | /* callback from select.c in case one of the fd's can be read/written */ |
| 214 | static int ipaccess_fd_cb(struct bsc_fd *bfd, unsigned int what) |
| 215 | { |
| 216 | struct e1inp_line *line = bfd->data; |
| 217 | unsigned int ts_nr = bfd->priv_nr; |
| 218 | unsigned int idx = ts_nr-1; |
| 219 | struct e1inp_ts *e1i_ts = &line->ts[idx]; |
| 220 | int rc = 0; |
| 221 | |
| 222 | switch (e1i_ts->type) { |
| 223 | case E1INP_TS_TYPE_SIGN: |
| 224 | if (what & BSC_FD_READ) |
| 225 | rc = handle_ts1_read(bfd); |
| 226 | if (what & BSC_FD_WRITE) |
| 227 | rc = handle_ts1_write(bfd); |
| 228 | break; |
| 229 | #if 0 |
| 230 | case E1INP_TS_TYPE_TRAU: |
| 231 | if (what & BSC_FD_READ) |
| 232 | rc = handle_tsX_read(bfd); |
| 233 | /* We never include the mISDN B-Channel FD into the |
| 234 | * writeset, since it doesn't support poll() based |
| 235 | * write flow control */ |
| 236 | break; |
| 237 | #endif |
| 238 | default: |
| 239 | fprintf(stderr, "unknown E1 TS type %u\n", e1i_ts->type); |
| 240 | break; |
| 241 | } |
| 242 | |
| 243 | return rc; |
| 244 | } |
| 245 | |
| 246 | |
| 247 | static int ts_want_write(struct e1inp_ts *e1i_ts) |
| 248 | { |
| 249 | /* We never include the mISDN B-Channel FD into the |
| 250 | * writeset, since it doesn't support poll() based |
| 251 | * write flow control */ |
| 252 | if (e1i_ts->type == E1INP_TS_TYPE_TRAU) |
| 253 | return 0; |
| 254 | |
| 255 | e1i_ts->driver.ipaccess.fd.when |= BSC_FD_WRITE; |
| 256 | |
| 257 | return 0; |
| 258 | } |
| 259 | |
| 260 | struct e1inp_driver ipaccess_driver = { |
| 261 | .name = "ip.access", |
| 262 | .want_write = ts_want_write, |
| 263 | }; |
| 264 | |
| 265 | static int ia_e1_setup(struct e1inp_line *line) |
| 266 | { |
| 267 | return 0; |
| 268 | } |
| 269 | |
| 270 | static int listen_fd_cb(struct bsc_fd *listen_bfd, unsigned int what) |
| 271 | { |
| 272 | struct e1inp_line *line = listen_bfd->data; |
| 273 | int ret; |
| 274 | |
| 275 | if (what & BSC_FD_READ) { |
| 276 | int idx = 0; |
| 277 | struct e1inp_ts *e1i_ts = &line->ts[idx]; |
| 278 | struct bsc_fd *bfd = &e1i_ts->driver.ipaccess.fd; |
| 279 | struct sockaddr_in sa; |
| 280 | socklen_t sa_len = sizeof(sa); |
| 281 | |
| 282 | if (bfd->fd) { |
Harald Welte | 5c1e458 | 2009-02-15 11:57:29 +0000 | [diff] [blame] | 283 | printf("dumping old OML fd\n"); |
Harald Welte | 5fd8a54 | 2009-02-13 02:43:36 +0000 | [diff] [blame] | 284 | if (bfd->fd != -1) { |
| 285 | bsc_unregister_fd(bfd); |
| 286 | close(bfd->fd); |
| 287 | } |
| 288 | } |
| 289 | bfd->fd = accept(listen_bfd->fd, (struct sockaddr *) &sa, &sa_len); |
| 290 | if (bfd->fd < 0) { |
| 291 | perror("accept"); |
| 292 | return bfd->fd; |
| 293 | } |
Harald Welte | 5c1e458 | 2009-02-15 11:57:29 +0000 | [diff] [blame] | 294 | printf("accept()ed new OML fd\n"); |
Harald Welte | 5fd8a54 | 2009-02-13 02:43:36 +0000 | [diff] [blame] | 295 | bfd->data = line; |
| 296 | bfd->priv_nr = 1; |
| 297 | bfd->cb = ipaccess_fd_cb; |
| 298 | bfd->when = BSC_FD_READ; |
| 299 | ret = bsc_register_fd(bfd); |
| 300 | if (ret < 0) { |
| 301 | fprintf(stderr, "could not register FD\n"); |
| 302 | return ret; |
| 303 | } |
| 304 | } |
| 305 | return 0; |
| 306 | } |
| 307 | |
Harald Welte | 5c1e458 | 2009-02-15 11:57:29 +0000 | [diff] [blame] | 308 | static int rsl_listen_fd_cb(struct bsc_fd *listen_bfd, unsigned int what) |
| 309 | { |
| 310 | struct e1inp_line *line = listen_bfd->data; |
| 311 | int ret; |
| 312 | |
| 313 | if (what & BSC_FD_READ) { |
| 314 | int idx = 1; |
| 315 | struct e1inp_ts *e1i_ts = &line->ts[idx]; |
| 316 | struct bsc_fd *bfd = &e1i_ts->driver.ipaccess.fd; |
| 317 | struct sockaddr_in sa; |
| 318 | socklen_t sa_len = sizeof(sa); |
| 319 | |
| 320 | if (bfd->fd) { |
| 321 | printf("dumping old RSL fd\n"); |
| 322 | if (bfd->fd != -1) { |
| 323 | bsc_unregister_fd(bfd); |
| 324 | close(bfd->fd); |
| 325 | } |
| 326 | } |
| 327 | bfd->fd = accept(listen_bfd->fd, (struct sockaddr *) &sa, &sa_len); |
| 328 | if (bfd->fd < 0) { |
| 329 | perror("accept"); |
| 330 | return bfd->fd; |
| 331 | } |
| 332 | printf("accept()ed new RSL fd\n"); |
| 333 | bfd->data = line; |
| 334 | bfd->priv_nr = 2; |
| 335 | bfd->cb = ipaccess_fd_cb; |
| 336 | bfd->when = BSC_FD_READ; |
| 337 | ret = bsc_register_fd(bfd); |
| 338 | if (ret < 0) { |
| 339 | fprintf(stderr, "could not register FD\n"); |
| 340 | return ret; |
| 341 | } |
| 342 | } |
| 343 | return 0; |
| 344 | } |
| 345 | |
| 346 | static int make_sock(struct bsc_fd *bfd, u_int16_t port, |
| 347 | struct e1inp_line *line, |
| 348 | int (*cb)(struct bsc_fd *fd, unsigned int what)) |
Harald Welte | 5fd8a54 | 2009-02-13 02:43:36 +0000 | [diff] [blame] | 349 | { |
| 350 | struct sockaddr_in addr; |
Harald Welte | 5c1e458 | 2009-02-15 11:57:29 +0000 | [diff] [blame] | 351 | int ret, on = 1; |
| 352 | |
| 353 | bfd->fd = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); |
| 354 | bfd->cb = cb; |
| 355 | bfd->when = BSC_FD_READ; |
| 356 | bfd->data = line; |
| 357 | |
| 358 | memset(&addr, 0, sizeof(addr)); |
| 359 | addr.sin_family = AF_INET; |
| 360 | addr.sin_port = htons(port); |
| 361 | addr.sin_addr.s_addr = INADDR_ANY; |
| 362 | |
| 363 | setsockopt(bfd->fd, SOL_SOCKET, SO_REUSEADDR, &on, sizeof(on)); |
| 364 | |
| 365 | ret = bind(bfd->fd, (struct sockaddr *) &addr, sizeof(addr)); |
| 366 | if (ret < 0) { |
| 367 | fprintf(stderr, "could not bind l2 socket %s\n", |
| 368 | strerror(errno)); |
| 369 | return -EIO; |
| 370 | } |
| 371 | |
| 372 | ret = listen(bfd->fd, 1); |
| 373 | if (ret < 0) { |
| 374 | perror("listen"); |
| 375 | return ret; |
| 376 | } |
| 377 | |
| 378 | ret = bsc_register_fd(bfd); |
| 379 | if (ret < 0) { |
| 380 | perror("register_listen_fd"); |
| 381 | return ret; |
| 382 | } |
| 383 | return 0; |
| 384 | } |
| 385 | |
| 386 | int ipaccess_setup(struct e1inp_line *line) |
| 387 | { |
Harald Welte | 5fd8a54 | 2009-02-13 02:43:36 +0000 | [diff] [blame] | 388 | struct ia_e1_handle *e1h; |
Harald Welte | 5c1e458 | 2009-02-15 11:57:29 +0000 | [diff] [blame] | 389 | int ret; |
Harald Welte | 5fd8a54 | 2009-02-13 02:43:36 +0000 | [diff] [blame] | 390 | |
| 391 | /* register the driver with the core */ |
| 392 | /* FIXME: do this in the plugin initializer function */ |
| 393 | ret = e1inp_driver_register(&ipaccess_driver); |
| 394 | if (ret) |
| 395 | return ret; |
| 396 | |
| 397 | /* create the actual line instance */ |
| 398 | /* FIXME: do this independent of driver registration */ |
| 399 | e1h = malloc(sizeof(*e1h)); |
| 400 | memset(e1h, 0, sizeof(*e1h)); |
| 401 | |
| 402 | line->driver = &ipaccess_driver; |
| 403 | line->driver_data = e1h; |
| 404 | |
Harald Welte | 5c1e458 | 2009-02-15 11:57:29 +0000 | [diff] [blame] | 405 | /* Listen for OML connections */ |
| 406 | ret = make_sock(&e1h->listen_fd, 3002, line, listen_fd_cb); |
Harald Welte | 5fd8a54 | 2009-02-13 02:43:36 +0000 | [diff] [blame] | 407 | |
Harald Welte | 5c1e458 | 2009-02-15 11:57:29 +0000 | [diff] [blame] | 408 | /* Listen for RSL connections */ |
| 409 | ret = make_sock(&e1h->rsl_listen_fd, 3003, line, rsl_listen_fd_cb); |
Harald Welte | 5fd8a54 | 2009-02-13 02:43:36 +0000 | [diff] [blame] | 410 | |
| 411 | ret = ia_e1_setup(line); |
| 412 | if (ret) |
| 413 | return ret; |
| 414 | |
| 415 | return e1inp_line_register(line); |
| 416 | } |