blob: f9dc79a20f8f27751919f493792436ddb47d512d [file] [log] [blame]
Holger Hans Peter Freyther3485feb2010-11-09 23:28:33 +01001/* GSM 08.08 BSSMAP handling */
2/* (C) 2009-2010 by Holger Hans Peter Freyther <zecke@selfish.org>
3 * (C) 2009-2010 by On-Waves
4 * All Rights Reserved
5 *
6 * This program is free software; you can redistribute it and/or modify
Harald Welte9af6ddf2011-01-01 15:25:50 +01007 * it under the terms of the GNU Affero General Public License as published by
8 * the Free Software Foundation; either version 3 of the License, or
Holger Hans Peter Freyther3485feb2010-11-09 23:28:33 +01009 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
Harald Welte9af6ddf2011-01-01 15:25:50 +010014 * GNU Affero General Public License for more details.
Holger Hans Peter Freyther3485feb2010-11-09 23:28:33 +010015 *
Harald Welte9af6ddf2011-01-01 15:25:50 +010016 * You should have received a copy of the GNU Affero General Public License
17 * along with this program. If not, see <http://www.gnu.org/licenses/>.
Holger Hans Peter Freyther3485feb2010-11-09 23:28:33 +010018 *
19 */
20
21#include <openbsc/osmo_bsc.h>
Holger Hans Peter Freyther890dfc52010-11-10 09:24:37 +010022#include <openbsc/osmo_bsc_grace.h>
Holger Hans Peter Freyther50c579b2010-11-10 10:07:30 +010023#include <openbsc/osmo_msc_data.h>
Holger Hans Peter Freyther3485feb2010-11-09 23:28:33 +010024#include <openbsc/debug.h>
Holger Hans Peter Freyther9c838ae2010-11-15 09:16:09 +010025#include <openbsc/gsm_subscriber.h>
Holger Hans Peter Freyther50c579b2010-11-10 10:07:30 +010026#include <openbsc/mgcp.h>
Holger Hans Peter Freyther9c838ae2010-11-15 09:16:09 +010027#include <openbsc/paging.h>
Holger Hans Peter Freyther3485feb2010-11-09 23:28:33 +010028
Pablo Neira Ayuso136f4532011-03-22 16:47:59 +010029#include <osmocom/core/gsm0808.h>
30#include <osmocom/core/protocol/gsm_08_08.h>
Holger Hans Peter Freyther3485feb2010-11-09 23:28:33 +010031
Holger Hans Peter Freyther890dfc52010-11-10 09:24:37 +010032#include <arpa/inet.h>
33
34static uint16_t read_data16(const uint8_t *data)
35{
36 uint16_t res;
37
38 memcpy(&res, data, sizeof(res));
39 return res;
40}
41
Holger Hans Peter Freyther50c579b2010-11-10 10:07:30 +010042/*
43 * helpers for the assignment command
44 */
45enum gsm0808_permitted_speech audio_support_to_gsm88(struct gsm_audio_support *audio)
46{
47 if (audio->hr) {
48 switch (audio->ver) {
49 case 1:
50 return GSM0808_PERM_HR1;
51 break;
52 case 2:
53 return GSM0808_PERM_HR2;
54 break;
55 case 3:
56 return GSM0808_PERM_HR3;
57 break;
58 default:
59 LOGP(DMSC, LOGL_ERROR, "Wrong speech mode: %d\n", audio->ver);
60 return GSM0808_PERM_FR1;
61 }
62 } else {
63 switch (audio->ver) {
64 case 1:
65 return GSM0808_PERM_FR1;
66 break;
67 case 2:
68 return GSM0808_PERM_FR2;
69 break;
70 case 3:
71 return GSM0808_PERM_FR3;
72 break;
73 default:
74 LOGP(DMSC, LOGL_ERROR, "Wrong speech mode: %d\n", audio->ver);
75 return GSM0808_PERM_HR1;
76 }
77 }
78}
79
80enum gsm48_chan_mode gsm88_to_chan_mode(enum gsm0808_permitted_speech speech)
81{
82 switch (speech) {
83 case GSM0808_PERM_HR1:
84 case GSM0808_PERM_FR1:
85 return GSM48_CMODE_SPEECH_V1;
86 break;
87 case GSM0808_PERM_HR2:
88 case GSM0808_PERM_FR2:
89 return GSM48_CMODE_SPEECH_EFR;
90 break;
91 case GSM0808_PERM_HR3:
92 case GSM0808_PERM_FR3:
93 return GSM48_CMODE_SPEECH_AMR;
94 break;
95 }
96
97 LOGP(DMSC, LOGL_FATAL, "Should not be reached.\n");
98 return GSM48_CMODE_SPEECH_AMR;
99}
100
Holger Hans Peter Freyther890dfc52010-11-10 09:24:37 +0100101static int bssmap_handle_reset_ack(struct gsm_network *net,
102 struct msgb *msg, unsigned int length)
103{
104 LOGP(DMSC, LOGL_NOTICE, "Reset ACK from MSC\n");
105 return 0;
106}
107
108/* GSM 08.08 ยง 3.2.1.19 */
109static int bssmap_handle_paging(struct gsm_network *net,
110 struct msgb *msg, unsigned int payload_length)
111{
Holger Hans Peter Freyther9c838ae2010-11-15 09:16:09 +0100112 struct gsm_subscriber *subscr;
Holger Hans Peter Freyther890dfc52010-11-10 09:24:37 +0100113 struct tlv_parsed tp;
114 char mi_string[GSM48_MI_SIZE];
115 uint32_t tmsi = GSM_RESERVED_TMSI;
116 unsigned int lac = GSM_LAC_RESERVED_ALL_BTS;
117 uint8_t data_length;
118 const uint8_t *data;
119 uint8_t chan_needed = RSL_CHANNEED_ANY;
120
121 tlv_parse(&tp, gsm0808_att_tlvdef(), msg->l4h + 1, payload_length - 1, 0, 0);
122
123 if (!TLVP_PRESENT(&tp, GSM0808_IE_IMSI)) {
124 LOGP(DMSC, LOGL_ERROR, "Mandantory IMSI not present.\n");
125 return -1;
126 } else if ((TLVP_VAL(&tp, GSM0808_IE_IMSI)[0] & GSM_MI_TYPE_MASK) != GSM_MI_TYPE_IMSI) {
127 LOGP(DMSC, LOGL_ERROR, "Wrong content in the IMSI\n");
128 return -1;
129 }
130
131 if (!TLVP_PRESENT(&tp, GSM0808_IE_CELL_IDENTIFIER_LIST)) {
132 LOGP(DMSC, LOGL_ERROR, "Mandantory CELL IDENTIFIER LIST not present.\n");
133 return -1;
134 }
135
136 if (TLVP_PRESENT(&tp, GSM0808_IE_TMSI)) {
137 gsm48_mi_to_string(mi_string, sizeof(mi_string),
138 TLVP_VAL(&tp, GSM0808_IE_TMSI), TLVP_LEN(&tp, GSM0808_IE_TMSI));
139 tmsi = strtoul(mi_string, NULL, 10);
140 }
141
142
143 /*
144 * parse the IMSI
145 */
146 gsm48_mi_to_string(mi_string, sizeof(mi_string),
147 TLVP_VAL(&tp, GSM0808_IE_IMSI), TLVP_LEN(&tp, GSM0808_IE_IMSI));
148
149 /*
150 * parse the cell identifier list
151 */
152 data_length = TLVP_LEN(&tp, GSM0808_IE_CELL_IDENTIFIER_LIST);
153 data = TLVP_VAL(&tp, GSM0808_IE_CELL_IDENTIFIER_LIST);
154
155 /*
156 * Support paging to all network or one BTS at one LAC
157 */
158 if (data_length == 3 && data[0] == CELL_IDENT_LAC) {
159 lac = ntohs(read_data16(&data[1]));
160 } else if (data_length > 1 || (data[0] & 0x0f) != CELL_IDENT_BSS) {
161 LOGP(DMSC, LOGL_ERROR, "Unsupported Cell Identifier List: %s\n", hexdump(data, data_length));
162 return -1;
163 }
164
165 if (TLVP_PRESENT(&tp, GSM0808_IE_CHANNEL_NEEDED) && TLVP_LEN(&tp, GSM0808_IE_CHANNEL_NEEDED) == 1)
166 chan_needed = TLVP_VAL(&tp, GSM0808_IE_CHANNEL_NEEDED)[0] & 0x03;
167
168 if (TLVP_PRESENT(&tp, GSM0808_IE_EMLPP_PRIORITY)) {
169 LOGP(DMSC, LOGL_ERROR, "eMLPP is not handled\n");
170 }
171
Holger Hans Peter Freyther9c838ae2010-11-15 09:16:09 +0100172 subscr = subscr_get_or_create(net, mi_string);
173 if (!subscr) {
174 LOGP(DMSC, LOGL_ERROR, "Failed to allocate a subscriber for %s\n", mi_string);
175 return -1;
176 }
177
178 subscr->lac = lac;
179 subscr->tmsi = tmsi;
180
Holger Hans Peter Freyther890dfc52010-11-10 09:24:37 +0100181 LOGP(DMSC, LOGL_DEBUG, "Paging request from MSC IMSI: '%s' TMSI: '0x%x/%u' LAC: 0x%x\n", mi_string, tmsi, tmsi, lac);
Holger Hans Peter Freyther9c838ae2010-11-15 09:16:09 +0100182 paging_request(net, subscr, chan_needed, NULL, NULL);
183 return 0;
Holger Hans Peter Freyther890dfc52010-11-10 09:24:37 +0100184}
185
Holger Hans Peter Freytherf1f57a82010-11-10 09:34:47 +0100186/*
187 * GSM 08.08 ยง 3.1.9.1 and 3.2.1.21...
188 * release our gsm_subscriber_connection and send message
189 */
190static int bssmap_handle_clear_command(struct osmo_bsc_sccp_con *conn,
191 struct msgb *msg, unsigned int payload_length)
192{
193 struct msgb *resp;
194
195 /* TODO: handle the cause of this package */
196
197 if (conn->conn) {
198 LOGP(DMSC, LOGL_DEBUG, "Releasing all transactions on %p\n", conn);
199 gsm0808_clear(conn->conn);
200 subscr_con_free(conn->conn);
201 conn->conn = NULL;
202 }
203
204 /* send the clear complete message */
205 resp = gsm0808_create_clear_complete();
206 if (!resp) {
207 LOGP(DMSC, LOGL_ERROR, "Sending clear complete failed.\n");
208 return -1;
209 }
210
211 bsc_queue_for_msc(conn, resp);
212 return 0;
213}
214
Holger Hans Peter Freytherfae3c652010-11-10 09:44:34 +0100215/*
216 * GSM 08.08 ยง 3.4.7 cipher mode handling. We will have to pick
217 * the cipher to be used for this. In case we are already using
218 * a cipher we will have to send cipher mode reject to the MSC,
219 * otherwise we will have to pick something that we and the MS
220 * is supporting. Currently we are doing it in a rather static
221 * way by picking one ecnryption or no encrytpion.
222 */
223static int bssmap_handle_cipher_mode(struct osmo_bsc_sccp_con *conn,
224 struct msgb *msg, unsigned int payload_length)
225{
226 uint16_t len;
227 struct gsm_network *network = NULL;
228 const uint8_t *data;
229 struct tlv_parsed tp;
230 struct msgb *resp;
231 int reject_cause = -1;
232 int include_imeisv = 1;
233
234 if (!conn->conn) {
235 LOGP(DMSC, LOGL_ERROR, "No lchan/msc_data in cipher mode command.\n");
236 goto reject;
237 }
238
239 if (conn->ciphering_handled) {
240 LOGP(DMSC, LOGL_ERROR, "Already seen ciphering command. Protocol Error.\n");
241 goto reject;
242 }
243
244 conn->ciphering_handled = 1;
245
246 tlv_parse(&tp, gsm0808_att_tlvdef(), msg->l4h + 1, payload_length - 1, 0, 0);
247 if (!TLVP_PRESENT(&tp, GSM0808_IE_ENCRYPTION_INFORMATION)) {
248 LOGP(DMSC, LOGL_ERROR, "IE Encryption Information missing.\n");
249 goto reject;
250 }
251
252 /*
253 * check if our global setting is allowed
254 * - Currently we check for A5/0 and A5/1
255 * - Copy the key if that is necessary
256 * - Otherwise reject
257 */
258 len = TLVP_LEN(&tp, GSM0808_IE_ENCRYPTION_INFORMATION);
259 if (len < 1) {
260 LOGP(DMSC, LOGL_ERROR, "IE Encryption Information is too short.\n");
261 goto reject;
262 }
263
264 network = conn->conn->bts->network;
265 data = TLVP_VAL(&tp, GSM0808_IE_ENCRYPTION_INFORMATION);
266
267 if (TLVP_PRESENT(&tp, GSM0808_IE_CIPHER_RESPONSE_MODE))
268 include_imeisv = TLVP_VAL(&tp, GSM0808_IE_CIPHER_RESPONSE_MODE)[0] & 0x1;
269
270 if (network->a5_encryption == 0 && (data[0] & 0x1) == 0x1) {
271 gsm0808_cipher_mode(conn->conn, 0, NULL, 0, include_imeisv);
272 } else if (network->a5_encryption != 0 && (data[0] & 0x2) == 0x2) {
273 gsm0808_cipher_mode(conn->conn, 1, &data[1], len - 1, include_imeisv);
274 } else {
275 LOGP(DMSC, LOGL_ERROR, "Can not select encryption...\n");
276 goto reject;
277 }
278
279reject:
280 resp = gsm0808_create_cipher_reject(reject_cause);
281 if (!resp) {
282 LOGP(DMSC, LOGL_ERROR, "Sending the cipher reject failed.\n");
283 return -1;
284 }
285
286 bsc_queue_for_msc(conn, resp);
287 return -1;
288}
289
Holger Hans Peter Freyther50c579b2010-11-10 10:07:30 +0100290/*
291 * Handle the assignment request message.
292 *
293 * See ยง3.2.1.1 for the message type
294 */
295static int bssmap_handle_assignm_req(struct osmo_bsc_sccp_con *conn,
296 struct msgb *msg, unsigned int length)
297{
298 struct msgb *resp;
299 struct gsm_network *network;
300 struct tlv_parsed tp;
301 uint8_t *data;
302 uint16_t cic;
303 uint8_t timeslot;
304 uint8_t multiplex;
305 enum gsm48_chan_mode chan_mode = GSM48_CMODE_SIGN;
306 int i, supported, port, full_rate = -1;
307
308 if (!conn->conn) {
309 LOGP(DMSC, LOGL_ERROR, "No lchan/msc_data in cipher mode command.\n");
310 return -1;
311 }
312
313 network = conn->conn->bts->network;
314 tlv_parse(&tp, gsm0808_att_tlvdef(), msg->l4h + 1, length - 1, 0, 0);
315
316 if (!TLVP_PRESENT(&tp, GSM0808_IE_CHANNEL_TYPE)) {
317 LOGP(DMSC, LOGL_ERROR, "Mandantory channel type not present.\n");
318 goto reject;
319 }
320
321 if (!TLVP_PRESENT(&tp, GSM0808_IE_CIRCUIT_IDENTITY_CODE)) {
322 LOGP(DMSC, LOGL_ERROR, "Identity code missing. Audio routing will not work.\n");
323 goto reject;
324 }
325
326 cic = ntohs(read_data16(TLVP_VAL(&tp, GSM0808_IE_CIRCUIT_IDENTITY_CODE)));
327 timeslot = cic & 0x1f;
328 multiplex = (cic & ~0x1f) >> 5;
329
330 /*
331 * Currently we only support a limited subset of all
332 * possible channel types. The limitation ends by not using
333 * multi-slot, limiting the channel coding, speech...
334 */
335 if (TLVP_LEN(&tp, GSM0808_IE_CHANNEL_TYPE) < 3) {
336 LOGP(DMSC, LOGL_ERROR, "ChannelType len !=3 not supported: %d\n",
337 TLVP_LEN(&tp, GSM0808_IE_CHANNEL_TYPE));
338 goto reject;
339 }
340
341 /*
342 * Try to figure out if we support the proposed speech codecs. For
343 * now we will always pick the full rate codecs.
344 */
345
346 data = (uint8_t *) TLVP_VAL(&tp, GSM0808_IE_CHANNEL_TYPE);
347 if ((data[0] & 0xf) != 0x1) {
348 LOGP(DMSC, LOGL_ERROR, "ChannelType != speech: %d\n", data[0]);
349 goto reject;
350 }
351
352 if (data[1] != GSM0808_SPEECH_FULL_PREF && data[1] != GSM0808_SPEECH_HALF_PREF) {
353 LOGP(DMSC, LOGL_ERROR, "ChannelType full not allowed: %d\n", data[1]);
354 goto reject;
355 }
356
357 /*
358 * go through the list of preferred codecs of our gsm network
359 * and try to find it among the permitted codecs. If we found
360 * it we will send chan_mode to the right mode and break the
361 * inner loop. The outer loop will exit due chan_mode having
362 * the correct value.
363 */
364 full_rate = 0;
365 for (supported = 0;
366 chan_mode == GSM48_CMODE_SIGN && supported < network->msc_data->audio_length;
367 ++supported) {
368
369 int perm_val = audio_support_to_gsm88(network->msc_data->audio_support[supported]);
370 for (i = 2; i < TLVP_LEN(&tp, GSM0808_IE_CHANNEL_TYPE); ++i) {
371 if ((data[i] & 0x7f) == perm_val) {
372 chan_mode = gsm88_to_chan_mode(perm_val);
373 full_rate = (data[i] & 0x4) == 0;
374 break;
375 } else if ((data[i] & 0x80) == 0x00) {
376 break;
377 }
378 }
379 }
380
381 if (chan_mode == GSM48_CMODE_SIGN) {
382 LOGP(DMSC, LOGL_ERROR, "No supported audio type found.\n");
383 goto reject;
384 }
385
386 /* map it to a MGCP Endpoint and a RTP port */
387 port = mgcp_timeslot_to_endpoint(multiplex, timeslot);
388 conn->rtp_port = rtp_calculate_port(port,
389 network->msc_data->rtp_base);
390
391 return gsm0808_assign_req(conn->conn, chan_mode, full_rate);
392
393reject:
394 resp = gsm0808_create_assignment_failure(GSM0808_CAUSE_NO_RADIO_RESOURCE_AVAILABLE, NULL);
395 if (!resp) {
396 LOGP(DMSC, LOGL_ERROR, "Channel allocation failure.\n");
397 return -1;
398 }
399
400 bsc_queue_for_msc(conn, resp);
401 return -1;
402}
403
Holger Hans Peter Freyther890dfc52010-11-10 09:24:37 +0100404static int bssmap_rcvmsg_udt(struct gsm_network *net,
405 struct msgb *msg, unsigned int length)
406{
407 int ret = 0;
408
409 if (length < 1) {
410 LOGP(DMSC, LOGL_ERROR, "Not enough room: %d\n", length);
411 return -1;
412 }
413
414 switch (msg->l4h[0]) {
415 case BSS_MAP_MSG_RESET_ACKNOWLEDGE:
416 ret = bssmap_handle_reset_ack(net, msg, length);
417 break;
418 case BSS_MAP_MSG_PAGING:
419 if (bsc_grace_allow_new_connection(net))
420 ret = bssmap_handle_paging(net, msg, length);
421 break;
422 }
423
424 return ret;
425}
426
427static int bssmap_rcvmsg_dt1(struct osmo_bsc_sccp_con *conn,
428 struct msgb *msg, unsigned int length)
429{
Holger Hans Peter Freytherf1f57a82010-11-10 09:34:47 +0100430 int ret = 0;
431
432 if (length < 1) {
433 LOGP(DMSC, LOGL_ERROR, "Not enough room: %d\n", length);
434 return -1;
435 }
436
437 switch (msg->l4h[0]) {
438 case BSS_MAP_MSG_CLEAR_CMD:
439 ret = bssmap_handle_clear_command(conn, msg, length);
440 break;
Holger Hans Peter Freytherfae3c652010-11-10 09:44:34 +0100441 case BSS_MAP_MSG_CIPHER_MODE_CMD:
442 ret = bssmap_handle_cipher_mode(conn, msg, length);
443 break;
Holger Hans Peter Freyther50c579b2010-11-10 10:07:30 +0100444 case BSS_MAP_MSG_ASSIGMENT_RQST:
445 ret = bssmap_handle_assignm_req(conn, msg, length);
446 break;
Holger Hans Peter Freytherf1f57a82010-11-10 09:34:47 +0100447 default:
448 LOGP(DMSC, LOGL_DEBUG, "Unimplemented msg type: %d\n", msg->l4h[0]);
449 break;
450 }
451
452 return ret;
Holger Hans Peter Freyther890dfc52010-11-10 09:24:37 +0100453}
454
455static int dtap_rcvmsg(struct osmo_bsc_sccp_con *conn,
456 struct msgb *msg, unsigned int length)
457{
Holger Hans Peter Freytherdbc698a2010-11-10 10:17:05 +0100458 struct dtap_header *header;
459 struct msgb *gsm48;
460 uint8_t *data;
461
462 if (!conn->conn) {
463 LOGP(DMSC, LOGL_ERROR, "No subscriber connection available\n");
464 return -1;
465 }
466
467 header = (struct dtap_header *) msg->l3h;
468 if (sizeof(*header) >= length) {
469 LOGP(DMSC, LOGL_ERROR, "The DTAP header does not fit. Wanted: %u got: %u\n", sizeof(*header), length);
470 LOGP(DMSC, LOGL_ERROR, "hex: %s\n", hexdump(msg->l3h, length));
471 return -1;
472 }
473
474 if (header->length > length - sizeof(*header)) {
475 LOGP(DMSC, LOGL_ERROR, "The DTAP l4 information does not fit: header: %u length: %u\n", header->length, length);
476 LOGP(DMSC, LOGL_ERROR, "hex: %s\n", hexdump(msg->l3h, length));
477 return -1;
478 }
479
480 LOGP(DMSC, LOGL_DEBUG, "DTAP message: SAPI: %u CHAN: %u\n", header->link_id & 0x07, header->link_id & 0xC0);
481
482 /* forward the data */
483 gsm48 = gsm48_msgb_alloc();
484 if (!gsm48) {
485 LOGP(DMSC, LOGL_ERROR, "Allocation of the message failed.\n");
486 return -1;
487 }
488
489 gsm48->l3h = gsm48->data;
490 data = msgb_put(gsm48, length - sizeof(*header));
491 memcpy(data, msg->l3h + sizeof(*header), length - sizeof(*header));
492
493 /* pass it to the filter for extra actions */
494 bsc_scan_msc_msg(conn->conn, gsm48);
495 return gsm0808_submit_dtap(conn->conn, gsm48, header->link_id, 1);
Holger Hans Peter Freyther890dfc52010-11-10 09:24:37 +0100496}
497
Holger Hans Peter Freyther3485feb2010-11-09 23:28:33 +0100498int bsc_handle_udt(struct gsm_network *network,
499 struct bsc_msc_connection *conn,
500 struct msgb *msgb, unsigned int length)
501{
502 struct bssmap_header *bs;
503
504 LOGP(DMSC, LOGL_DEBUG, "Incoming SCCP message ftom MSC: %s\n",
505 hexdump(msgb->l3h, length));
506
507 if (length < sizeof(*bs)) {
508 LOGP(DMSC, LOGL_ERROR, "The header is too short.\n");
509 return -1;
510 }
511
512 bs = (struct bssmap_header *) msgb->l3h;
513 if (bs->length < length - sizeof(*bs))
514 return -1;
515
516 switch (bs->type) {
517 case BSSAP_MSG_BSS_MANAGEMENT:
Holger Hans Peter Freyther890dfc52010-11-10 09:24:37 +0100518 msgb->l4h = &msgb->l3h[sizeof(*bs)];
519 bssmap_rcvmsg_udt(network, msgb, length - sizeof(*bs));
Holger Hans Peter Freyther3485feb2010-11-09 23:28:33 +0100520 break;
521 default:
522 LOGP(DMSC, LOGL_ERROR, "Unimplemented msg type: %d\n", bs->type);
523 }
524
525 return 0;
526}
527
528int bsc_handle_dt1(struct osmo_bsc_sccp_con *conn,
529 struct msgb *msg, unsigned int len)
530{
Holger Hans Peter Freyther890dfc52010-11-10 09:24:37 +0100531 if (len < sizeof(struct bssmap_header)) {
532 LOGP(DMSC, LOGL_ERROR, "The header is too short.\n");
533 }
534
535 switch (msg->l3h[0]) {
536 case BSSAP_MSG_BSS_MANAGEMENT:
537 msg->l4h = &msg->l3h[sizeof(struct bssmap_header)];
538 bssmap_rcvmsg_dt1(conn, msg, len - sizeof(struct bssmap_header));
539 break;
540 case BSSAP_MSG_DTAP:
541 dtap_rcvmsg(conn, msg, len);
542 break;
543 default:
544 LOGP(DMSC, LOGL_DEBUG, "Unimplemented msg type: %d\n", msg->l3h[0]);
545 }
546
Holger Hans Peter Freyther3485feb2010-11-09 23:28:33 +0100547 return -1;
548}