blob: 86610622ff0362e479694dd66451cc48355aa382 [file] [log] [blame]
Holger Hans Peter Freytherbc1e52c2013-08-22 08:44:38 +02001/* (C) 2009-2010 by Harald Welte <laforge@gnumonks.org>
2 *
3 * All Rights Reserved
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU Affero General Public License as published by
7 * the Free Software Foundation; either version 3 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU Affero General Public License for more details.
14 *
15 * You should have received a copy of the GNU Affero General Public License
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
17 *
18 */
19#ifndef OPENBSC_CLONE_H
20#define OPENBSC_CLONE_H
21
22#ifdef __cplusplus
23extern "C" {
24#endif
25
Holger Hans Peter Freyther9d938382013-07-31 21:59:29 +020026#include <osmocom/gsm/protocol/gsm_04_08.h>
Maxc907b882018-02-13 12:53:55 +010027#include <osmocom/gsm/protocol/gsm_04_08_gprs.h>
Holger Hans Peter Freytherbc1e52c2013-08-22 08:44:38 +020028#include <stdint.h>
29
30enum gprs_llc_cmd {
31 GPRS_LLC_NULL,
32 GPRS_LLC_RR,
33 GPRS_LLC_ACK,
34 GPRS_LLC_RNR,
35 GPRS_LLC_SACK,
36 GPRS_LLC_DM,
37 GPRS_LLC_DISC,
38 GPRS_LLC_UA,
39 GPRS_LLC_SABM,
40 GPRS_LLC_FRMR,
41 GPRS_LLC_XID,
42 GPRS_LLC_UI,
43};
44
45struct gprs_llc_hdr_parsed {
46 uint8_t sapi;
47 uint8_t is_cmd:1,
48 ack_req:1,
49 is_encrypted:1;
50 uint32_t seq_rx;
51 uint32_t seq_tx;
52 uint32_t fcs;
53 uint32_t fcs_calc;
54 const uint8_t *data;
55 uint16_t data_len;
56 uint16_t crc_length;
57 enum gprs_llc_cmd cmd;
58};
59
60int gprs_llc_hdr_parse(struct gprs_llc_hdr_parsed *ghp, const uint8_t *llc_hdr, int len);
61
Holger Hans Peter Freyther9d938382013-07-31 21:59:29 +020062extern const struct tlv_definition gsm48_gmm_att_tlvdef;
63
Holger Hans Peter Freytherbc1e52c2013-08-22 08:44:38 +020064#ifdef __cplusplus
65}
66#endif
67
68#endif