Holger Hans Peter Freyther | d11290b | 2013-10-26 17:32:04 +0200 | [diff] [blame] | 1 | /* decoding |
| 2 | * |
| 3 | * Copyright (C) 2012 Ivan Klyuchnikov |
| 4 | * Copyright (C) 2012 Andreas Eversberg <jolly@eversberg.eu> |
| 5 | * |
| 6 | * This program is free software; you can redistribute it and/or |
| 7 | * modify it under the terms of the GNU General Public License |
| 8 | * as published by the Free Software Foundation; either version 2 |
| 9 | * of the License, or (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 |
| 14 | * GNU General Public License for more details. |
| 15 | * |
| 16 | * You should have received a copy of the GNU General Public License |
| 17 | * along with this program; if not, write to the Free Software |
| 18 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
| 19 | */ |
| 20 | #pragma once |
| 21 | |
Holger Hans Peter Freyther | fcbc702 | 2013-10-26 17:38:37 +0200 | [diff] [blame] | 22 | #include <gsm_rlcmac.h> |
Jacob Erlbeck | 4abc686 | 2015-12-08 15:14:05 +0100 | [diff] [blame] | 23 | #include "rlc.h" |
Holger Hans Peter Freyther | fcbc702 | 2013-10-26 17:38:37 +0200 | [diff] [blame] | 24 | |
Holger Hans Peter Freyther | d11290b | 2013-10-26 17:32:04 +0200 | [diff] [blame] | 25 | #include <stdint.h> |
| 26 | |
| 27 | class Decoding { |
| 28 | public: |
Jacob Erlbeck | 4abc686 | 2015-12-08 15:14:05 +0100 | [diff] [blame] | 29 | struct RlcData { |
| 30 | uint8_t offset; |
| 31 | uint8_t length; |
| 32 | bool is_complete; |
| 33 | }; |
| 34 | |
Jacob Erlbeck | 4abc686 | 2015-12-08 15:14:05 +0100 | [diff] [blame] | 35 | static int rlc_data_from_ul_data( |
Jacob Erlbeck | f2ba4cb | 2016-01-07 18:59:28 +0100 | [diff] [blame] | 36 | const struct gprs_rlc_data_block_info *rdbi, |
Jacob Erlbeck | 4abc686 | 2015-12-08 15:14:05 +0100 | [diff] [blame] | 37 | GprsCodingScheme cs, const uint8_t *data, RlcData *chunks, |
| 38 | unsigned int chunks_size, uint32_t *tlli); |
Holger Hans Peter Freyther | fcbc702 | 2013-10-26 17:38:37 +0200 | [diff] [blame] | 39 | static uint8_t get_ms_class_by_capability(MS_Radio_Access_capability_t *cap); |
Jacob Erlbeck | c3c5804 | 2015-09-28 17:55:32 +0200 | [diff] [blame] | 40 | static uint8_t get_egprs_ms_class_by_capability(MS_Radio_Access_capability_t *cap); |
Holger Hans Peter Freyther | df6b4f5 | 2013-11-24 17:05:48 +0100 | [diff] [blame] | 41 | |
| 42 | static void extract_rbb(const uint8_t *rbb, char *extracted_rbb); |
Jacob Erlbeck | 4abc686 | 2015-12-08 15:14:05 +0100 | [diff] [blame] | 43 | |
Jacob Erlbeck | f2ba4cb | 2016-01-07 18:59:28 +0100 | [diff] [blame] | 44 | static int rlc_parse_ul_data_header(struct gprs_rlc_data_info *rlc, |
Jacob Erlbeck | 4abc686 | 2015-12-08 15:14:05 +0100 | [diff] [blame] | 45 | const uint8_t *data, GprsCodingScheme cs); |
| 46 | static unsigned int rlc_copy_to_aligned_buffer( |
Jacob Erlbeck | f2ba4cb | 2016-01-07 18:59:28 +0100 | [diff] [blame] | 47 | const struct gprs_rlc_data_info *rlc, |
Jacob Erlbeck | 4abc686 | 2015-12-08 15:14:05 +0100 | [diff] [blame] | 48 | unsigned int data_block_idx, |
| 49 | const uint8_t *src, uint8_t *buffer); |
| 50 | static const uint8_t *rlc_get_data_aligned( |
Jacob Erlbeck | f2ba4cb | 2016-01-07 18:59:28 +0100 | [diff] [blame] | 51 | const struct gprs_rlc_data_info *rlc, |
Jacob Erlbeck | 4abc686 | 2015-12-08 15:14:05 +0100 | [diff] [blame] | 52 | unsigned int data_block_idx, |
| 53 | const uint8_t *src, uint8_t *buffer); |
Holger Hans Peter Freyther | d11290b | 2013-10-26 17:32:04 +0200 | [diff] [blame] | 54 | }; |