Harald Welte | 1fa60c8 | 2009-02-09 18:13:26 +0000 | [diff] [blame] | 1 | /* OpenBSC Abis interface to E1 */ |
| 2 | |
| 3 | /* (C) 2008-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 |
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 | 1fa60c8 | 2009-02-09 18:13:26 +0000 | [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 | 1fa60c8 | 2009-02-09 18:13:26 +0000 | [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 | 1fa60c8 | 2009-02-09 18:13:26 +0000 | [diff] [blame] | 19 | * |
| 20 | */ |
| 21 | |
| 22 | #include <stdio.h> |
| 23 | #include <unistd.h> |
| 24 | #include <stdlib.h> |
| 25 | #include <errno.h> |
| 26 | #include <string.h> |
| 27 | #include <time.h> |
| 28 | #include <sys/fcntl.h> |
Harald Welte | 1fa60c8 | 2009-02-09 18:13:26 +0000 | [diff] [blame] | 29 | #include <sys/socket.h> |
| 30 | #include <sys/ioctl.h> |
| 31 | #include <arpa/inet.h> |
| 32 | #include <mISDNif.h> |
| 33 | |
| 34 | //#define AF_COMPATIBILITY_FUNC |
| 35 | //#include <compat_af_isdn.h> |
Holger Freyther | 66e092b | 2009-03-31 12:13:50 +0000 | [diff] [blame] | 36 | #ifndef AF_ISDN |
Harald Welte | 1fa60c8 | 2009-02-09 18:13:26 +0000 | [diff] [blame] | 37 | #define AF_ISDN 34 |
| 38 | #define PF_ISDN AF_ISDN |
Holger Freyther | 66e092b | 2009-03-31 12:13:50 +0000 | [diff] [blame] | 39 | #endif |
Harald Welte | 1fa60c8 | 2009-02-09 18:13:26 +0000 | [diff] [blame] | 40 | |
Pablo Neira Ayuso | 136f453 | 2011-03-22 16:47:59 +0100 | [diff] [blame] | 41 | #include <osmocom/core/select.h> |
| 42 | #include <osmocom/core/msgb.h> |
Harald Welte | 1fa60c8 | 2009-02-09 18:13:26 +0000 | [diff] [blame] | 43 | #include <openbsc/debug.h> |
| 44 | #include <openbsc/gsm_data.h> |
| 45 | #include <openbsc/e1_input.h> |
| 46 | #include <openbsc/abis_nm.h> |
| 47 | #include <openbsc/abis_rsl.h> |
Pablo Neira Ayuso | 136f453 | 2011-03-22 16:47:59 +0100 | [diff] [blame] | 48 | #include <osmocom/core/linuxlist.h> |
Harald Welte | 1fa60c8 | 2009-02-09 18:13:26 +0000 | [diff] [blame] | 49 | #include <openbsc/subchan_demux.h> |
Harald Welte | 45b407a | 2009-05-23 15:51:12 +0000 | [diff] [blame] | 50 | #include <openbsc/trau_frame.h> |
Harald Welte | 1fa60c8 | 2009-02-09 18:13:26 +0000 | [diff] [blame] | 51 | #include <openbsc/trau_mux.h> |
Pablo Neira Ayuso | 136f453 | 2011-03-22 16:47:59 +0100 | [diff] [blame] | 52 | #include <osmocom/core/talloc.h> |
Harald Welte | 29b9cf8 | 2009-11-30 19:43:54 +0100 | [diff] [blame] | 53 | #include <openbsc/signal.h> |
Holger Hans Peter Freyther | 34e9749 | 2009-08-10 07:54:02 +0200 | [diff] [blame] | 54 | #include <openbsc/misdn.h> |
Harald Welte | 1fa60c8 | 2009-02-09 18:13:26 +0000 | [diff] [blame] | 55 | |
Harald Welte | c08e8be | 2011-03-04 13:53:51 +0100 | [diff] [blame] | 56 | #include "../../bscconfig.h" |
Harald Welte | ca17ef8 | 2011-02-05 15:13:27 +0100 | [diff] [blame] | 57 | |
Harald Welte | 1fa60c8 | 2009-02-09 18:13:26 +0000 | [diff] [blame] | 58 | #define NUM_E1_TS 32 |
| 59 | |
| 60 | /* list of all E1 drivers */ |
Harald Welte | 44d542e | 2009-03-10 18:24:35 +0000 | [diff] [blame] | 61 | LLIST_HEAD(e1inp_driver_list); |
Harald Welte | 1fa60c8 | 2009-02-09 18:13:26 +0000 | [diff] [blame] | 62 | |
| 63 | /* list of all E1 lines */ |
Harald Welte | 44d542e | 2009-03-10 18:24:35 +0000 | [diff] [blame] | 64 | LLIST_HEAD(e1inp_line_list); |
Harald Welte | 1fa60c8 | 2009-02-09 18:13:26 +0000 | [diff] [blame] | 65 | |
Harald Welte | 2cf161b | 2009-06-20 22:36:41 +0200 | [diff] [blame] | 66 | static void *tall_sigl_ctx; |
| 67 | |
Harald Welte | 1fa60c8 | 2009-02-09 18:13:26 +0000 | [diff] [blame] | 68 | /* |
| 69 | * pcap writing of the misdn load |
| 70 | * pcap format is from http://wiki.wireshark.org/Development/LibpcapFileFormat |
| 71 | */ |
| 72 | #define DLT_LINUX_LAPD 177 |
| 73 | #define PCAP_INPUT 0 |
| 74 | #define PCAP_OUTPUT 1 |
| 75 | |
| 76 | struct pcap_hdr { |
Holger Hans Peter Freyther | c42ad8b | 2011-04-18 17:04:00 +0200 | [diff] [blame] | 77 | uint32_t magic_number; |
| 78 | uint16_t version_major; |
| 79 | uint16_t version_minor; |
Harald Welte | 1fa60c8 | 2009-02-09 18:13:26 +0000 | [diff] [blame] | 80 | int32_t thiszone; |
Holger Hans Peter Freyther | c42ad8b | 2011-04-18 17:04:00 +0200 | [diff] [blame] | 81 | uint32_t sigfigs; |
| 82 | uint32_t snaplen; |
| 83 | uint32_t network; |
Harald Welte | 1fa60c8 | 2009-02-09 18:13:26 +0000 | [diff] [blame] | 84 | } __attribute__((packed)); |
| 85 | |
| 86 | struct pcaprec_hdr { |
Holger Hans Peter Freyther | c42ad8b | 2011-04-18 17:04:00 +0200 | [diff] [blame] | 87 | uint32_t ts_sec; |
| 88 | uint32_t ts_usec; |
| 89 | uint32_t incl_len; |
| 90 | uint32_t orig_len; |
Harald Welte | 1fa60c8 | 2009-02-09 18:13:26 +0000 | [diff] [blame] | 91 | } __attribute__((packed)); |
| 92 | |
| 93 | struct fake_linux_lapd_header { |
Holger Hans Peter Freyther | c42ad8b | 2011-04-18 17:04:00 +0200 | [diff] [blame] | 94 | uint16_t pkttype; |
| 95 | uint16_t hatype; |
| 96 | uint16_t halen; |
| 97 | uint64_t addr; |
Harald Welte | 1fa60c8 | 2009-02-09 18:13:26 +0000 | [diff] [blame] | 98 | int16_t protocol; |
| 99 | } __attribute__((packed)); |
| 100 | |
| 101 | struct lapd_header { |
Holger Hans Peter Freyther | c42ad8b | 2011-04-18 17:04:00 +0200 | [diff] [blame] | 102 | uint8_t ea1 : 1; |
| 103 | uint8_t cr : 1; |
| 104 | uint8_t sapi : 6; |
| 105 | uint8_t ea2 : 1; |
| 106 | uint8_t tei : 7; |
| 107 | uint8_t control_foo; /* fake UM's ... */ |
Harald Welte | 1fa60c8 | 2009-02-09 18:13:26 +0000 | [diff] [blame] | 108 | } __attribute__((packed)); |
| 109 | |
Pablo Neira Ayuso | c0d17f2 | 2011-05-07 12:12:48 +0200 | [diff] [blame] | 110 | osmo_static_assert(offsetof(struct fake_linux_lapd_header, hatype) == 2, hatype_offset); |
| 111 | osmo_static_assert(offsetof(struct fake_linux_lapd_header, halen) == 4, halen_offset); |
| 112 | osmo_static_assert(offsetof(struct fake_linux_lapd_header, addr) == 6, addr_offset); |
| 113 | osmo_static_assert(offsetof(struct fake_linux_lapd_header, protocol) == 14, proto_offset); |
| 114 | osmo_static_assert(sizeof(struct fake_linux_lapd_header) == 16, lapd_header_size); |
Harald Welte | 1fa60c8 | 2009-02-09 18:13:26 +0000 | [diff] [blame] | 115 | |
| 116 | |
| 117 | static int pcap_fd = -1; |
| 118 | |
Holger Freyther | 0469cf6 | 2009-03-31 12:14:16 +0000 | [diff] [blame] | 119 | void e1_set_pcap_fd(int fd) |
Harald Welte | 1fa60c8 | 2009-02-09 18:13:26 +0000 | [diff] [blame] | 120 | { |
| 121 | int ret; |
| 122 | struct pcap_hdr header = { |
| 123 | .magic_number = 0xa1b2c3d4, |
| 124 | .version_major = 2, |
| 125 | .version_minor = 4, |
| 126 | .thiszone = 0, |
| 127 | .sigfigs = 0, |
| 128 | .snaplen = 65535, |
| 129 | .network = DLT_LINUX_LAPD, |
| 130 | }; |
| 131 | |
| 132 | pcap_fd = fd; |
| 133 | ret = write(pcap_fd, &header, sizeof(header)); |
| 134 | } |
| 135 | |
| 136 | /* This currently only works for the D-Channel */ |
Holger Freyther | 0469cf6 | 2009-03-31 12:14:16 +0000 | [diff] [blame] | 137 | static void write_pcap_packet(int direction, int sapi, int tei, |
Harald Welte | 1fa60c8 | 2009-02-09 18:13:26 +0000 | [diff] [blame] | 138 | struct msgb *msg) { |
| 139 | if (pcap_fd < 0) |
| 140 | return; |
| 141 | |
| 142 | int ret; |
| 143 | time_t cur_time; |
| 144 | struct tm *tm; |
| 145 | |
| 146 | struct fake_linux_lapd_header header = { |
| 147 | .pkttype = 4, |
| 148 | .hatype = 0, |
| 149 | .halen = 0, |
| 150 | .addr = direction == PCAP_OUTPUT ? 0x0 : 0x1, |
| 151 | .protocol = ntohs(48), |
| 152 | }; |
| 153 | |
| 154 | struct lapd_header lapd_header = { |
| 155 | .ea1 = 0, |
| 156 | .cr = direction == PCAP_OUTPUT ? 1 : 0, |
Holger Freyther | 0469cf6 | 2009-03-31 12:14:16 +0000 | [diff] [blame] | 157 | .sapi = sapi & 0x3F, |
Harald Welte | 1fa60c8 | 2009-02-09 18:13:26 +0000 | [diff] [blame] | 158 | .ea2 = 1, |
Holger Freyther | 0469cf6 | 2009-03-31 12:14:16 +0000 | [diff] [blame] | 159 | .tei = tei & 0x7F, |
Harald Welte | 1fa60c8 | 2009-02-09 18:13:26 +0000 | [diff] [blame] | 160 | .control_foo = 0x03 /* UI */, |
| 161 | }; |
| 162 | |
| 163 | struct pcaprec_hdr payload_header = { |
| 164 | .ts_sec = 0, |
| 165 | .ts_usec = 0, |
Harald Welte | 95aa5c4 | 2011-02-12 14:00:23 +0100 | [diff] [blame] | 166 | .incl_len = msgb_l2len(msg) + sizeof(struct fake_linux_lapd_header) |
| 167 | + sizeof(struct lapd_header), |
| 168 | .orig_len = msgb_l2len(msg) + sizeof(struct fake_linux_lapd_header) |
| 169 | + sizeof(struct lapd_header), |
Harald Welte | 1fa60c8 | 2009-02-09 18:13:26 +0000 | [diff] [blame] | 170 | }; |
| 171 | |
| 172 | |
| 173 | cur_time = time(NULL); |
| 174 | tm = localtime(&cur_time); |
| 175 | payload_header.ts_sec = mktime(tm); |
| 176 | |
| 177 | ret = write(pcap_fd, &payload_header, sizeof(payload_header)); |
| 178 | ret = write(pcap_fd, &header, sizeof(header)); |
| 179 | ret = write(pcap_fd, &lapd_header, sizeof(lapd_header)); |
Harald Welte | 95aa5c4 | 2011-02-12 14:00:23 +0100 | [diff] [blame] | 180 | ret = write(pcap_fd, msg->l2h, msgb_l2len(msg)); |
Harald Welte | 1fa60c8 | 2009-02-09 18:13:26 +0000 | [diff] [blame] | 181 | } |
Harald Welte | 1fa60c8 | 2009-02-09 18:13:26 +0000 | [diff] [blame] | 182 | |
Harald Welte | d256d4f | 2009-03-10 19:44:48 +0000 | [diff] [blame] | 183 | static const char *sign_types[] = { |
| 184 | [E1INP_SIGN_NONE] = "None", |
| 185 | [E1INP_SIGN_OML] = "OML", |
| 186 | [E1INP_SIGN_RSL] = "RSL", |
| 187 | }; |
| 188 | const char *e1inp_signtype_name(enum e1inp_sign_type tp) |
| 189 | { |
| 190 | if (tp >= ARRAY_SIZE(sign_types)) |
| 191 | return "undefined"; |
| 192 | return sign_types[tp]; |
| 193 | } |
| 194 | |
| 195 | static const char *ts_types[] = { |
| 196 | [E1INP_TS_TYPE_NONE] = "None", |
| 197 | [E1INP_TS_TYPE_SIGN] = "Signalling", |
| 198 | [E1INP_TS_TYPE_TRAU] = "TRAU", |
| 199 | }; |
| 200 | |
| 201 | const char *e1inp_tstype_name(enum e1inp_ts_type tp) |
| 202 | { |
| 203 | if (tp >= ARRAY_SIZE(ts_types)) |
| 204 | return "undefined"; |
| 205 | return ts_types[tp]; |
| 206 | } |
| 207 | |
Harald Welte | 1fa60c8 | 2009-02-09 18:13:26 +0000 | [diff] [blame] | 208 | /* callback when a TRAU frame was received */ |
Holger Hans Peter Freyther | c42ad8b | 2011-04-18 17:04:00 +0200 | [diff] [blame] | 209 | static int subch_cb(struct subch_demux *dmx, int ch, uint8_t *data, int len, |
Harald Welte | 1fa60c8 | 2009-02-09 18:13:26 +0000 | [diff] [blame] | 210 | void *_priv) |
| 211 | { |
| 212 | struct e1inp_ts *e1i_ts = _priv; |
| 213 | struct gsm_e1_subslot src_ss; |
| 214 | |
| 215 | src_ss.e1_nr = e1i_ts->line->num; |
| 216 | src_ss.e1_ts = e1i_ts->num; |
| 217 | src_ss.e1_ts_ss = ch; |
| 218 | |
| 219 | return trau_mux_input(&src_ss, data, len); |
| 220 | } |
| 221 | |
| 222 | int abis_rsl_sendmsg(struct msgb *msg) |
| 223 | { |
| 224 | struct e1inp_sign_link *sign_link; |
| 225 | struct e1inp_driver *e1inp_driver; |
Harald Welte | f55b49f | 2009-05-23 06:20:41 +0000 | [diff] [blame] | 226 | struct e1inp_ts *e1i_ts; |
Harald Welte | 1fa60c8 | 2009-02-09 18:13:26 +0000 | [diff] [blame] | 227 | |
| 228 | msg->l2h = msg->data; |
| 229 | |
Harald Welte (local) | 5fe3318 | 2009-12-28 17:05:43 +0100 | [diff] [blame] | 230 | if (!msg->trx) { |
| 231 | LOGP(DRSL, LOGL_ERROR, "rsl_sendmsg: msg->trx == NULL: %s\n", |
Pablo Neira Ayuso | c0d17f2 | 2011-05-07 12:12:48 +0200 | [diff] [blame] | 232 | osmo_hexdump(msg->data, msg->len)); |
Harald Welte | eab3335 | 2009-06-27 03:09:08 +0200 | [diff] [blame] | 233 | talloc_free(msg); |
Harald Welte | 1fa60c8 | 2009-02-09 18:13:26 +0000 | [diff] [blame] | 234 | return -EINVAL; |
Harald Welte (local) | 5fe3318 | 2009-12-28 17:05:43 +0100 | [diff] [blame] | 235 | } else if (!msg->trx->rsl_link) { |
| 236 | LOGP(DRSL, LOGL_ERROR, "rsl_sendmsg: msg->trx->rsl_link == NULL: %s\n", |
Pablo Neira Ayuso | c0d17f2 | 2011-05-07 12:12:48 +0200 | [diff] [blame] | 237 | osmo_hexdump(msg->data, msg->len)); |
Harald Welte (local) | 5fe3318 | 2009-12-28 17:05:43 +0100 | [diff] [blame] | 238 | talloc_free(msg); |
| 239 | return -EIO; |
Harald Welte | 1fa60c8 | 2009-02-09 18:13:26 +0000 | [diff] [blame] | 240 | } |
| 241 | |
| 242 | sign_link = msg->trx->rsl_link; |
Harald Welte | f55b49f | 2009-05-23 06:20:41 +0000 | [diff] [blame] | 243 | e1i_ts = sign_link->ts; |
Pablo Neira Ayuso | bf540cb | 2011-05-06 12:11:06 +0200 | [diff] [blame] | 244 | if (!osmo_timer_pending(&e1i_ts->sign.tx_timer)) { |
Harald Welte | f55b49f | 2009-05-23 06:20:41 +0000 | [diff] [blame] | 245 | /* notify the driver we have something to write */ |
| 246 | e1inp_driver = sign_link->ts->line->driver; |
| 247 | e1inp_driver->want_write(e1i_ts); |
| 248 | } |
Harald Welte | 1fa60c8 | 2009-02-09 18:13:26 +0000 | [diff] [blame] | 249 | msgb_enqueue(&sign_link->tx_list, msg); |
| 250 | |
Holger Freyther | 0469cf6 | 2009-03-31 12:14:16 +0000 | [diff] [blame] | 251 | /* dump it */ |
| 252 | write_pcap_packet(PCAP_OUTPUT, sign_link->sapi, sign_link->tei, msg); |
| 253 | |
Harald Welte | 1fa60c8 | 2009-02-09 18:13:26 +0000 | [diff] [blame] | 254 | return 0; |
| 255 | } |
| 256 | |
Harald Welte | d88a387 | 2011-02-14 15:26:13 +0100 | [diff] [blame] | 257 | int _abis_nm_sendmsg(struct msgb *msg, int to_trx_oml) |
Harald Welte | 1fa60c8 | 2009-02-09 18:13:26 +0000 | [diff] [blame] | 258 | { |
| 259 | struct e1inp_sign_link *sign_link; |
| 260 | struct e1inp_driver *e1inp_driver; |
Harald Welte | f55b49f | 2009-05-23 06:20:41 +0000 | [diff] [blame] | 261 | struct e1inp_ts *e1i_ts; |
Harald Welte | 1fa60c8 | 2009-02-09 18:13:26 +0000 | [diff] [blame] | 262 | |
| 263 | msg->l2h = msg->data; |
| 264 | |
| 265 | if (!msg->trx || !msg->trx->bts || !msg->trx->bts->oml_link) { |
Harald Welte | f933de9 | 2011-02-05 20:18:18 +0100 | [diff] [blame] | 266 | LOGP(DNM, LOGL_ERROR, "nm_sendmsg: msg->trx == NULL\n"); |
Harald Welte | 1fa60c8 | 2009-02-09 18:13:26 +0000 | [diff] [blame] | 267 | return -EINVAL; |
| 268 | } |
Holger Freyther | fb3f519 | 2009-02-09 23:09:15 +0000 | [diff] [blame] | 269 | |
Harald Welte | 15ccc77 | 2011-02-13 19:36:18 +0100 | [diff] [blame] | 270 | /* Check for TRX-specific OML link first */ |
Harald Welte | d88a387 | 2011-02-14 15:26:13 +0100 | [diff] [blame] | 271 | if (to_trx_oml) { |
| 272 | if (!msg->trx->oml_link) |
| 273 | return -ENODEV; |
Harald Welte | 15ccc77 | 2011-02-13 19:36:18 +0100 | [diff] [blame] | 274 | sign_link = msg->trx->oml_link; |
Harald Welte | d88a387 | 2011-02-14 15:26:13 +0100 | [diff] [blame] | 275 | } else |
Harald Welte | 15ccc77 | 2011-02-13 19:36:18 +0100 | [diff] [blame] | 276 | sign_link = msg->trx->bts->oml_link; |
| 277 | |
Harald Welte | f55b49f | 2009-05-23 06:20:41 +0000 | [diff] [blame] | 278 | e1i_ts = sign_link->ts; |
Pablo Neira Ayuso | bf540cb | 2011-05-06 12:11:06 +0200 | [diff] [blame] | 279 | if (!osmo_timer_pending(&e1i_ts->sign.tx_timer)) { |
Harald Welte | f55b49f | 2009-05-23 06:20:41 +0000 | [diff] [blame] | 280 | /* notify the driver we have something to write */ |
| 281 | e1inp_driver = sign_link->ts->line->driver; |
| 282 | e1inp_driver->want_write(e1i_ts); |
| 283 | } |
Harald Welte | 1fa60c8 | 2009-02-09 18:13:26 +0000 | [diff] [blame] | 284 | msgb_enqueue(&sign_link->tx_list, msg); |
| 285 | |
Holger Freyther | 0469cf6 | 2009-03-31 12:14:16 +0000 | [diff] [blame] | 286 | /* dump it */ |
| 287 | write_pcap_packet(PCAP_OUTPUT, sign_link->sapi, sign_link->tei, msg); |
| 288 | |
Harald Welte | 1fa60c8 | 2009-02-09 18:13:26 +0000 | [diff] [blame] | 289 | return 0; |
| 290 | } |
| 291 | |
| 292 | /* Timeslot */ |
| 293 | |
| 294 | /* configure and initialize one e1inp_ts */ |
| 295 | int e1inp_ts_config(struct e1inp_ts *ts, struct e1inp_line *line, |
| 296 | enum e1inp_ts_type type) |
| 297 | { |
Harald Welte | 4258182 | 2009-08-08 16:12:58 +0200 | [diff] [blame] | 298 | if (ts->type == type && ts->line && line) |
| 299 | return 0; |
| 300 | |
Harald Welte | 1fa60c8 | 2009-02-09 18:13:26 +0000 | [diff] [blame] | 301 | ts->type = type; |
| 302 | ts->line = line; |
| 303 | |
| 304 | switch (type) { |
| 305 | case E1INP_TS_TYPE_SIGN: |
Holger Hans Peter Freyther | 91f587e | 2011-01-16 18:12:13 +0100 | [diff] [blame] | 306 | if (line && line->driver) |
Holger Hans Peter Freyther | d85642a | 2010-04-26 16:02:04 +0800 | [diff] [blame] | 307 | ts->sign.delay = line->driver->default_delay; |
| 308 | else |
| 309 | ts->sign.delay = 100000; |
Harald Welte | 1fa60c8 | 2009-02-09 18:13:26 +0000 | [diff] [blame] | 310 | INIT_LLIST_HEAD(&ts->sign.sign_links); |
| 311 | break; |
| 312 | case E1INP_TS_TYPE_TRAU: |
| 313 | subchan_mux_init(&ts->trau.mux); |
| 314 | ts->trau.demux.out_cb = subch_cb; |
| 315 | ts->trau.demux.data = ts; |
| 316 | subch_demux_init(&ts->trau.demux); |
| 317 | break; |
| 318 | default: |
Harald Welte | b1d4c8e | 2009-12-17 23:10:46 +0100 | [diff] [blame] | 319 | LOGP(DMI, LOGL_ERROR, "unsupported E1 timeslot type %u\n", |
Harald Welte | 1fa60c8 | 2009-02-09 18:13:26 +0000 | [diff] [blame] | 320 | ts->type); |
| 321 | return -EINVAL; |
| 322 | } |
| 323 | return 0; |
| 324 | } |
| 325 | |
Holger Hans Peter Freyther | c42ad8b | 2011-04-18 17:04:00 +0200 | [diff] [blame] | 326 | struct e1inp_line *e1inp_line_get(uint8_t e1_nr) |
Harald Welte | 1fa60c8 | 2009-02-09 18:13:26 +0000 | [diff] [blame] | 327 | { |
| 328 | struct e1inp_line *e1i_line; |
| 329 | |
| 330 | /* iterate over global list of e1 lines */ |
Harald Welte | 44d542e | 2009-03-10 18:24:35 +0000 | [diff] [blame] | 331 | llist_for_each_entry(e1i_line, &e1inp_line_list, list) { |
Harald Welte | 1fa60c8 | 2009-02-09 18:13:26 +0000 | [diff] [blame] | 332 | if (e1i_line->num == e1_nr) |
| 333 | return e1i_line; |
| 334 | } |
| 335 | return NULL; |
| 336 | } |
| 337 | |
Holger Hans Peter Freyther | c42ad8b | 2011-04-18 17:04:00 +0200 | [diff] [blame] | 338 | struct e1inp_line *e1inp_line_create(uint8_t e1_nr, const char *driver_name) |
Harald Welte | 3016d9f | 2011-02-05 13:54:41 +0100 | [diff] [blame] | 339 | { |
| 340 | struct e1inp_driver *driver; |
| 341 | struct e1inp_line *line; |
| 342 | int i; |
| 343 | |
| 344 | line = e1inp_line_get(e1_nr); |
Harald Welte | 07bb0da | 2011-02-05 15:57:42 +0100 | [diff] [blame] | 345 | if (line) { |
| 346 | LOGP(DINP, LOGL_ERROR, "E1 Line %u already exists\n", |
| 347 | e1_nr); |
Harald Welte | 3016d9f | 2011-02-05 13:54:41 +0100 | [diff] [blame] | 348 | return NULL; |
Harald Welte | 07bb0da | 2011-02-05 15:57:42 +0100 | [diff] [blame] | 349 | } |
Harald Welte | 3016d9f | 2011-02-05 13:54:41 +0100 | [diff] [blame] | 350 | |
| 351 | driver = e1inp_driver_find(driver_name); |
Harald Welte | 07bb0da | 2011-02-05 15:57:42 +0100 | [diff] [blame] | 352 | if (!driver) { |
| 353 | LOGP(DINP, LOGL_ERROR, "No such E1 driver '%s'\n", |
| 354 | driver_name); |
Harald Welte | 3016d9f | 2011-02-05 13:54:41 +0100 | [diff] [blame] | 355 | return NULL; |
Harald Welte | 07bb0da | 2011-02-05 15:57:42 +0100 | [diff] [blame] | 356 | } |
Harald Welte | 3016d9f | 2011-02-05 13:54:41 +0100 | [diff] [blame] | 357 | |
| 358 | line = talloc_zero(tall_bsc_ctx, struct e1inp_line); |
| 359 | if (!line) |
| 360 | return NULL; |
| 361 | |
| 362 | line->driver = driver; |
| 363 | |
| 364 | line->num = e1_nr; |
| 365 | for (i = 0; i < NUM_E1_TS; i++) { |
| 366 | line->ts[i].num = i+1; |
| 367 | line->ts[i].line = line; |
| 368 | } |
| 369 | llist_add_tail(&line->list, &e1inp_line_list); |
| 370 | |
| 371 | return line; |
| 372 | } |
| 373 | |
| 374 | #if 0 |
Holger Hans Peter Freyther | c42ad8b | 2011-04-18 17:04:00 +0200 | [diff] [blame] | 375 | struct e1inp_line *e1inp_line_get_create(uint8_t e1_nr) |
Harald Welte | 4258182 | 2009-08-08 16:12:58 +0200 | [diff] [blame] | 376 | { |
| 377 | struct e1inp_line *line; |
| 378 | int i; |
| 379 | |
| 380 | line = e1inp_line_get(e1_nr); |
| 381 | if (line) |
| 382 | return line; |
| 383 | |
| 384 | line = talloc_zero(tall_bsc_ctx, struct e1inp_line); |
| 385 | if (!line) |
| 386 | return NULL; |
| 387 | |
| 388 | line->num = e1_nr; |
| 389 | for (i = 0; i < NUM_E1_TS; i++) { |
| 390 | line->ts[i].num = i+1; |
| 391 | line->ts[i].line = line; |
| 392 | } |
| 393 | llist_add_tail(&line->list, &e1inp_line_list); |
| 394 | |
| 395 | return line; |
| 396 | } |
Harald Welte | 3016d9f | 2011-02-05 13:54:41 +0100 | [diff] [blame] | 397 | #endif |
Harald Welte | 4258182 | 2009-08-08 16:12:58 +0200 | [diff] [blame] | 398 | |
Holger Hans Peter Freyther | c42ad8b | 2011-04-18 17:04:00 +0200 | [diff] [blame] | 399 | static struct e1inp_ts *e1inp_ts_get(uint8_t e1_nr, uint8_t ts_nr) |
Harald Welte | 1fa60c8 | 2009-02-09 18:13:26 +0000 | [diff] [blame] | 400 | { |
| 401 | struct e1inp_line *e1i_line; |
| 402 | |
| 403 | e1i_line = e1inp_line_get(e1_nr); |
| 404 | if (!e1i_line) |
| 405 | return NULL; |
| 406 | |
| 407 | return &e1i_line->ts[ts_nr-1]; |
| 408 | } |
| 409 | |
Holger Hans Peter Freyther | c42ad8b | 2011-04-18 17:04:00 +0200 | [diff] [blame] | 410 | struct subch_mux *e1inp_get_mux(uint8_t e1_nr, uint8_t ts_nr) |
Harald Welte | 1fa60c8 | 2009-02-09 18:13:26 +0000 | [diff] [blame] | 411 | { |
| 412 | struct e1inp_ts *e1i_ts = e1inp_ts_get(e1_nr, ts_nr); |
| 413 | |
| 414 | if (!e1i_ts) |
| 415 | return NULL; |
| 416 | |
| 417 | return &e1i_ts->trau.mux; |
| 418 | } |
| 419 | |
| 420 | /* Signalling Link */ |
| 421 | |
| 422 | struct e1inp_sign_link *e1inp_lookup_sign_link(struct e1inp_ts *e1i, |
Holger Hans Peter Freyther | c42ad8b | 2011-04-18 17:04:00 +0200 | [diff] [blame] | 423 | uint8_t tei, uint8_t sapi) |
Harald Welte | 1fa60c8 | 2009-02-09 18:13:26 +0000 | [diff] [blame] | 424 | { |
| 425 | struct e1inp_sign_link *link; |
| 426 | |
| 427 | llist_for_each_entry(link, &e1i->sign.sign_links, list) { |
| 428 | if (link->sapi == sapi && link->tei == tei) |
| 429 | return link; |
| 430 | } |
| 431 | |
| 432 | return NULL; |
| 433 | } |
| 434 | |
| 435 | /* create a new signalling link in a E1 timeslot */ |
| 436 | |
| 437 | struct e1inp_sign_link * |
| 438 | e1inp_sign_link_create(struct e1inp_ts *ts, enum e1inp_sign_type type, |
Holger Hans Peter Freyther | c42ad8b | 2011-04-18 17:04:00 +0200 | [diff] [blame] | 439 | struct gsm_bts_trx *trx, uint8_t tei, |
| 440 | uint8_t sapi) |
Harald Welte | 1fa60c8 | 2009-02-09 18:13:26 +0000 | [diff] [blame] | 441 | { |
| 442 | struct e1inp_sign_link *link; |
| 443 | |
| 444 | if (ts->type != E1INP_TS_TYPE_SIGN) |
| 445 | return NULL; |
| 446 | |
Harald Welte | 470ec29 | 2009-06-26 20:25:23 +0200 | [diff] [blame] | 447 | link = talloc_zero(tall_sigl_ctx, struct e1inp_sign_link); |
Harald Welte | 1fa60c8 | 2009-02-09 18:13:26 +0000 | [diff] [blame] | 448 | if (!link) |
| 449 | return NULL; |
| 450 | |
Harald Welte | 1fa60c8 | 2009-02-09 18:13:26 +0000 | [diff] [blame] | 451 | link->ts = ts; |
| 452 | link->type = type; |
| 453 | INIT_LLIST_HEAD(&link->tx_list); |
| 454 | link->trx = trx; |
Holger Freyther | fb3f519 | 2009-02-09 23:09:15 +0000 | [diff] [blame] | 455 | link->tei = tei; |
| 456 | link->sapi = sapi; |
Harald Welte | 1fa60c8 | 2009-02-09 18:13:26 +0000 | [diff] [blame] | 457 | |
| 458 | llist_add_tail(&link->list, &ts->sign.sign_links); |
| 459 | |
| 460 | return link; |
| 461 | } |
| 462 | |
Harald Welte | 4258182 | 2009-08-08 16:12:58 +0200 | [diff] [blame] | 463 | void e1inp_sign_link_destroy(struct e1inp_sign_link *link) |
| 464 | { |
Holger Hans Peter Freyther | 4ac100e | 2010-04-11 14:13:10 +0200 | [diff] [blame] | 465 | struct msgb *msg; |
| 466 | |
Harald Welte | 4258182 | 2009-08-08 16:12:58 +0200 | [diff] [blame] | 467 | llist_del(&link->list); |
Holger Hans Peter Freyther | 4ac100e | 2010-04-11 14:13:10 +0200 | [diff] [blame] | 468 | while (!llist_empty(&link->tx_list)) { |
| 469 | msg = msgb_dequeue(&link->tx_list); |
| 470 | msgb_free(msg); |
| 471 | } |
| 472 | |
Holger Hans Peter Freyther | f51b900 | 2010-04-11 17:18:02 +0200 | [diff] [blame] | 473 | if (link->ts->type == E1INP_TS_TYPE_SIGN) |
Pablo Neira Ayuso | bf540cb | 2011-05-06 12:11:06 +0200 | [diff] [blame] | 474 | osmo_timer_del(&link->ts->sign.tx_timer); |
Holger Hans Peter Freyther | f51b900 | 2010-04-11 17:18:02 +0200 | [diff] [blame] | 475 | |
Harald Welte | 4258182 | 2009-08-08 16:12:58 +0200 | [diff] [blame] | 476 | talloc_free(link); |
| 477 | } |
| 478 | |
Harald Welte | 1fa60c8 | 2009-02-09 18:13:26 +0000 | [diff] [blame] | 479 | /* the E1 driver tells us he has received something on a TS */ |
| 480 | int e1inp_rx_ts(struct e1inp_ts *ts, struct msgb *msg, |
Holger Hans Peter Freyther | c42ad8b | 2011-04-18 17:04:00 +0200 | [diff] [blame] | 481 | uint8_t tei, uint8_t sapi) |
Harald Welte | 1fa60c8 | 2009-02-09 18:13:26 +0000 | [diff] [blame] | 482 | { |
| 483 | struct e1inp_sign_link *link; |
Harald Welte | 09cefee | 2011-02-12 12:29:21 +0100 | [diff] [blame] | 484 | struct gsm_bts *bts; |
Harald Welte | 1fa60c8 | 2009-02-09 18:13:26 +0000 | [diff] [blame] | 485 | int ret; |
| 486 | |
| 487 | switch (ts->type) { |
| 488 | case E1INP_TS_TYPE_SIGN: |
Harald Welte | 1fa60c8 | 2009-02-09 18:13:26 +0000 | [diff] [blame] | 489 | /* consult the list of signalling links */ |
Holger Freyther | 0469cf6 | 2009-03-31 12:14:16 +0000 | [diff] [blame] | 490 | write_pcap_packet(PCAP_INPUT, sapi, tei, msg); |
Harald Welte | 1fa60c8 | 2009-02-09 18:13:26 +0000 | [diff] [blame] | 491 | link = e1inp_lookup_sign_link(ts, tei, sapi); |
| 492 | if (!link) { |
Harald Welte | b1d4c8e | 2009-12-17 23:10:46 +0100 | [diff] [blame] | 493 | LOGP(DMI, LOGL_ERROR, "didn't find signalling link for " |
Harald Welte | 1fa60c8 | 2009-02-09 18:13:26 +0000 | [diff] [blame] | 494 | "tei %d, sapi %d\n", tei, sapi); |
| 495 | return -EINVAL; |
| 496 | } |
Holger Hans Peter Freyther | b61e3b2 | 2009-12-22 22:32:51 +0100 | [diff] [blame] | 497 | |
Harald Welte | dc5062b | 2010-03-26 21:28:59 +0800 | [diff] [blame] | 498 | log_set_context(BSC_CTX_BTS, link->trx->bts); |
Harald Welte | 1fa60c8 | 2009-02-09 18:13:26 +0000 | [diff] [blame] | 499 | switch (link->type) { |
| 500 | case E1INP_SIGN_OML: |
| 501 | msg->trx = link->trx; |
Harald Welte | 09cefee | 2011-02-12 12:29:21 +0100 | [diff] [blame] | 502 | bts = msg->trx->bts; |
| 503 | ret = bts->model->oml_rcvmsg(msg); |
Harald Welte | 1fa60c8 | 2009-02-09 18:13:26 +0000 | [diff] [blame] | 504 | break; |
| 505 | case E1INP_SIGN_RSL: |
| 506 | msg->trx = link->trx; |
| 507 | ret = abis_rsl_rcvmsg(msg); |
| 508 | break; |
| 509 | default: |
| 510 | ret = -EINVAL; |
Harald Welte | b1d4c8e | 2009-12-17 23:10:46 +0100 | [diff] [blame] | 511 | LOGP(DMI, LOGL_ERROR, "unknown link type %u\n", link->type); |
Harald Welte | 1fa60c8 | 2009-02-09 18:13:26 +0000 | [diff] [blame] | 512 | break; |
| 513 | } |
| 514 | break; |
| 515 | case E1INP_TS_TYPE_TRAU: |
Harald Welte | 9e78331 | 2009-02-17 19:02:29 +0000 | [diff] [blame] | 516 | ret = subch_demux_in(&ts->trau.demux, msg->l2h, msgb_l2len(msg)); |
Harald Welte | 1fa60c8 | 2009-02-09 18:13:26 +0000 | [diff] [blame] | 517 | break; |
| 518 | default: |
| 519 | ret = -EINVAL; |
Harald Welte | b1d4c8e | 2009-12-17 23:10:46 +0100 | [diff] [blame] | 520 | LOGP(DMI, LOGL_ERROR, "unknown TS type %u\n", ts->type); |
Harald Welte | 1fa60c8 | 2009-02-09 18:13:26 +0000 | [diff] [blame] | 521 | break; |
| 522 | } |
| 523 | |
| 524 | return ret; |
| 525 | } |
| 526 | |
| 527 | #define TSX_ALLOC_SIZE 4096 |
| 528 | |
| 529 | /* called by driver if it wants to transmit on a given TS */ |
| 530 | struct msgb *e1inp_tx_ts(struct e1inp_ts *e1i_ts, |
| 531 | struct e1inp_sign_link **sign_link) |
| 532 | { |
| 533 | struct e1inp_sign_link *link; |
| 534 | struct msgb *msg = NULL; |
| 535 | int len; |
| 536 | |
| 537 | switch (e1i_ts->type) { |
| 538 | case E1INP_TS_TYPE_SIGN: |
| 539 | /* FIXME: implement this round robin */ |
| 540 | llist_for_each_entry(link, &e1i_ts->sign.sign_links, list) { |
| 541 | msg = msgb_dequeue(&link->tx_list); |
| 542 | if (msg) { |
| 543 | if (sign_link) |
| 544 | *sign_link = link; |
| 545 | break; |
| 546 | } |
| 547 | } |
| 548 | break; |
| 549 | case E1INP_TS_TYPE_TRAU: |
Harald Welte | 966636f | 2009-06-26 19:39:35 +0200 | [diff] [blame] | 550 | msg = msgb_alloc(TSX_ALLOC_SIZE, "TRAU_TX"); |
Harald Welte | 1fa60c8 | 2009-02-09 18:13:26 +0000 | [diff] [blame] | 551 | if (!msg) |
| 552 | return NULL; |
| 553 | len = subchan_mux_out(&e1i_ts->trau.mux, msg->data, 40); |
| 554 | msgb_put(msg, 40); |
| 555 | break; |
| 556 | default: |
Harald Welte | b1d4c8e | 2009-12-17 23:10:46 +0100 | [diff] [blame] | 557 | LOGP(DMI, LOGL_ERROR, "unsupported E1 TS type %u\n", e1i_ts->type); |
Harald Welte | 1fa60c8 | 2009-02-09 18:13:26 +0000 | [diff] [blame] | 558 | return NULL; |
| 559 | } |
| 560 | return msg; |
| 561 | } |
| 562 | |
| 563 | /* called by driver in case some kind of link state event */ |
Holger Hans Peter Freyther | c42ad8b | 2011-04-18 17:04:00 +0200 | [diff] [blame] | 564 | int e1inp_event(struct e1inp_ts *ts, int evt, uint8_t tei, uint8_t sapi) |
Harald Welte | 1fa60c8 | 2009-02-09 18:13:26 +0000 | [diff] [blame] | 565 | { |
| 566 | struct e1inp_sign_link *link; |
Harald Welte | f338a03 | 2011-01-14 15:55:42 +0100 | [diff] [blame] | 567 | struct input_signal_data isd; |
Harald Welte | 1fa60c8 | 2009-02-09 18:13:26 +0000 | [diff] [blame] | 568 | |
| 569 | link = e1inp_lookup_sign_link(ts, tei, sapi); |
| 570 | if (!link) |
| 571 | return -EINVAL; |
| 572 | |
Harald Welte | f338a03 | 2011-01-14 15:55:42 +0100 | [diff] [blame] | 573 | isd.link_type = link->type; |
| 574 | isd.trx = link->trx; |
Harald Welte | bd3137c | 2011-02-13 19:44:21 +0100 | [diff] [blame] | 575 | isd.tei = tei; |
| 576 | isd.sapi = sapi; |
Harald Welte | f338a03 | 2011-01-14 15:55:42 +0100 | [diff] [blame] | 577 | |
| 578 | /* report further upwards */ |
Pablo Neira Ayuso | bbc5b99 | 2011-05-06 12:12:31 +0200 | [diff] [blame] | 579 | osmo_signal_dispatch(SS_INPUT, evt, &isd); |
Holger Freyther | ff9592f | 2009-03-09 16:17:14 +0000 | [diff] [blame] | 580 | return 0; |
Harald Welte | 1fa60c8 | 2009-02-09 18:13:26 +0000 | [diff] [blame] | 581 | } |
| 582 | |
| 583 | /* register a driver with the E1 core */ |
| 584 | int e1inp_driver_register(struct e1inp_driver *drv) |
| 585 | { |
Harald Welte | 44d542e | 2009-03-10 18:24:35 +0000 | [diff] [blame] | 586 | llist_add_tail(&drv->list, &e1inp_driver_list); |
Harald Welte | 1fa60c8 | 2009-02-09 18:13:26 +0000 | [diff] [blame] | 587 | return 0; |
| 588 | } |
| 589 | |
Harald Welte | 3016d9f | 2011-02-05 13:54:41 +0100 | [diff] [blame] | 590 | struct e1inp_driver *e1inp_driver_find(const char *name) |
| 591 | { |
| 592 | struct e1inp_driver *drv; |
| 593 | |
Harald Welte | 3016d9f | 2011-02-05 13:54:41 +0100 | [diff] [blame] | 594 | llist_for_each_entry(drv, &e1inp_driver_list, list) { |
| 595 | if (!strcasecmp(name, drv->name)) |
| 596 | return drv; |
| 597 | } |
| 598 | return NULL; |
| 599 | } |
| 600 | |
Harald Welte | 4258182 | 2009-08-08 16:12:58 +0200 | [diff] [blame] | 601 | int e1inp_line_update(struct e1inp_line *line) |
Harald Welte | 1fa60c8 | 2009-02-09 18:13:26 +0000 | [diff] [blame] | 602 | { |
Harald Welte | f27d043 | 2011-02-11 16:49:41 +0100 | [diff] [blame] | 603 | struct input_signal_data isd; |
| 604 | int rc; |
| 605 | |
Harald Welte | 5455243 | 2011-02-05 12:26:55 +0100 | [diff] [blame] | 606 | if (line->driver && line->driver->line_update) |
Harald Welte | f27d043 | 2011-02-11 16:49:41 +0100 | [diff] [blame] | 607 | rc = line->driver->line_update(line); |
Harald Welte | 5455243 | 2011-02-05 12:26:55 +0100 | [diff] [blame] | 608 | else |
Harald Welte | f27d043 | 2011-02-11 16:49:41 +0100 | [diff] [blame] | 609 | rc = 0; |
| 610 | |
| 611 | /* Send a signal to anyone who is interested in new lines being |
| 612 | * configured */ |
| 613 | memset(&isd, 0, sizeof(isd)); |
| 614 | isd.line = line; |
Pablo Neira Ayuso | bbc5b99 | 2011-05-06 12:12:31 +0200 | [diff] [blame] | 615 | osmo_signal_dispatch(SS_INPUT, S_INP_LINE_INIT, &isd); |
Harald Welte | f27d043 | 2011-02-11 16:49:41 +0100 | [diff] [blame] | 616 | |
| 617 | return rc; |
Harald Welte | 1fa60c8 | 2009-02-09 18:13:26 +0000 | [diff] [blame] | 618 | } |
Harald Welte | 7bfc267 | 2009-07-28 00:41:45 +0200 | [diff] [blame] | 619 | |
Harald Welte | 29b9cf8 | 2009-11-30 19:43:54 +0100 | [diff] [blame] | 620 | static int e1i_sig_cb(unsigned int subsys, unsigned int signal, |
| 621 | void *handler_data, void *signal_data) |
| 622 | { |
| 623 | if (subsys != SS_GLOBAL || |
| 624 | signal != S_GLOBAL_SHUTDOWN) |
| 625 | return 0; |
| 626 | |
| 627 | if (pcap_fd) { |
| 628 | close(pcap_fd); |
| 629 | pcap_fd = -1; |
| 630 | } |
| 631 | |
| 632 | return 0; |
| 633 | } |
| 634 | |
Harald Welte | 3016d9f | 2011-02-05 13:54:41 +0100 | [diff] [blame] | 635 | void e1inp_misdn_init(void); |
Harald Welte | 1dd68c3 | 2011-02-05 13:58:46 +0100 | [diff] [blame] | 636 | void e1inp_dahdi_init(void); |
Pablo Neira Ayuso | c68f754 | 2011-05-14 11:32:47 +0200 | [diff] [blame] | 637 | void e1inp_ipaccess_init(void); |
| 638 | void e1inp_hsl_init(void); |
Harald Welte | 3016d9f | 2011-02-05 13:54:41 +0100 | [diff] [blame] | 639 | |
| 640 | void e1inp_init(void) |
Harald Welte | 7bfc267 | 2009-07-28 00:41:45 +0200 | [diff] [blame] | 641 | { |
| 642 | tall_sigl_ctx = talloc_named_const(tall_bsc_ctx, 1, |
| 643 | "e1inp_sign_link"); |
Pablo Neira Ayuso | bbc5b99 | 2011-05-06 12:12:31 +0200 | [diff] [blame] | 644 | osmo_signal_register_handler(SS_GLOBAL, e1i_sig_cb, NULL); |
Harald Welte | 3016d9f | 2011-02-05 13:54:41 +0100 | [diff] [blame] | 645 | |
| 646 | e1inp_misdn_init(); |
Harald Welte | ca17ef8 | 2011-02-05 15:13:27 +0100 | [diff] [blame] | 647 | #ifdef HAVE_DAHDI_USER_H |
Harald Welte | 1dd68c3 | 2011-02-05 13:58:46 +0100 | [diff] [blame] | 648 | e1inp_dahdi_init(); |
Harald Welte | ca17ef8 | 2011-02-05 15:13:27 +0100 | [diff] [blame] | 649 | #endif |
Pablo Neira Ayuso | c68f754 | 2011-05-14 11:32:47 +0200 | [diff] [blame] | 650 | e1inp_ipaccess_init(); |
| 651 | e1inp_hsl_init(); |
Harald Welte | 7bfc267 | 2009-07-28 00:41:45 +0200 | [diff] [blame] | 652 | } |