libosmogsm  0.10.2.279.178b
Osmocom GSM library
gsm0808.h
Go to the documentation of this file.
1 
4 /*
5  * (C) 2009,2010 by Holger Hans Peter Freyther <zecke@selfish.org>
6  * (C) 2009,2010 by On-Waves
7  * All Rights Reserved
8  *
9  * This program is free software; you can redistribute it and/or modify
10  * it under the terms of the GNU General Public License as published by
11  * the Free Software Foundation; either version 2 of the License, or
12  * (at your option) any later version.
13  *
14  * This program is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17  * GNU General Public License for more details.
18  *
19  * You should have received a copy of the GNU General Public License along
20  * with this program; if not, write to the Free Software Foundation, Inc.,
21  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
22  *
23  */
24 #pragma once
25 
26 #include "tlv.h"
28 #include <osmocom/gsm/gsm23003.h>
29 
30 struct sockaddr_storage;
31 
32 struct msgb;
34 
35 struct msgb *gsm0808_create_layer3(struct msgb *msg_l3, uint16_t nc,
36  uint16_t cc, int lac, uint16_t _ci)
37  OSMO_DEPRECATED("Use gsm0808_create_layer3_2() instead, to not lose leading zeros in the MNC");
38 struct msgb *gsm0808_create_layer3_aoip(const struct msgb *msg_l3, uint16_t nc,
39  uint16_t cc, int lac, uint16_t _ci,
40  const struct gsm0808_speech_codec_list *scl)
41  OSMO_DEPRECATED("Use gsm0808_create_layer3_2() instead, to not lose leading zeros in the MNC");
42 struct msgb *gsm0808_create_layer3_2(const struct msgb *msg_l3, const struct osmo_cell_global_id *cell,
43  const struct gsm0808_speech_codec_list *scl);
44 struct msgb *gsm0808_create_reset(void);
45 struct msgb *gsm0808_create_reset_ack(void);
46 struct msgb *gsm0808_create_clear_command(uint8_t reason);
48 struct msgb *gsm0808_create_cipher(const struct gsm0808_encrypt_info *ei,
49  const uint8_t *cipher_response_mode);
50 struct msgb *gsm0808_create_cipher_complete(struct msgb *layer3, uint8_t alg_id);
51 struct msgb *gsm0808_create_cipher_reject(uint8_t cause);
52 struct msgb *gsm0808_create_classmark_update(const uint8_t *cm2, uint8_t cm2_len,
53  const uint8_t *cm3, uint8_t cm3_len);
54 struct msgb *gsm0808_create_sapi_reject(uint8_t link_id);
55 struct msgb *gsm0808_create_ass(const struct gsm0808_channel_type *ct,
56  const uint16_t *cic,
57  const struct sockaddr_storage *ss,
58  const struct gsm0808_speech_codec_list *scl,
59  const uint32_t *ci);
60 struct msgb *gsm0808_create_ass_compl(uint8_t rr_cause, uint8_t chosen_channel,
61  uint8_t encr_alg_id, uint8_t speech_mode,
62  const struct sockaddr_storage *ss,
63  const struct gsm0808_speech_codec *sc,
64  const struct gsm0808_speech_codec_list
65  *scl);
66 struct msgb *gsm0808_create_assignment_completed(uint8_t rr_cause,
67  uint8_t chosen_channel,
68  uint8_t encr_alg_id,
69  uint8_t speech_mode);
70 struct msgb *gsm0808_create_ass_fail(uint8_t cause, const uint8_t *rr_cause,
71  const struct gsm0808_speech_codec_list
72  *scl);
73 struct msgb *gsm0808_create_assignment_failure(uint8_t cause, uint8_t *rr_cause);
74 struct msgb *gsm0808_create_clear_rqst(uint8_t cause);
75 struct msgb *gsm0808_create_paging2(const char *imsi, const uint32_t *tmsi,
76  const struct gsm0808_cell_id_list2 *cil,
77  const uint8_t *chan_needed);
78 struct msgb *gsm0808_create_paging(const char *imsi, const uint32_t *tmsi,
79  const struct gsm0808_cell_id_list *cil,
80  const uint8_t *chan_needed)
81  OSMO_DEPRECATED("use gsm0808_create_paging2 instead");
82 
83 struct msgb *gsm0808_create_dtap(struct msgb *msg, uint8_t link_id);
84 void gsm0808_prepend_dtap_header(struct msgb *msg, uint8_t link_id);
85 
86 const struct tlv_definition *gsm0808_att_tlvdef(void);
87 
88 const char *gsm0808_bssmap_name(uint8_t msg_type);
89 const char *gsm0808_bssap_name(uint8_t msg_type);
90 const char *gsm0808_cause_name(uint8_t cause);
91 
uint8_t msg_type
Definition: gsm_04_08.h:504
struct msgb * gsm0808_create_assignment_completed(uint8_t rr_cause, uint8_t chosen_channel, uint8_t encr_alg_id, uint8_t speech_mode)
Create BSSMAP Assignment Completed message.
Definition: gsm0808.c:456
struct msgb * gsm0808_create_reset_ack(void)
Create BSSMAP RESET ACK message.
Definition: gsm0808.c:155
struct msgb * gsm0808_create_assignment_failure(uint8_t cause, uint8_t *rr_cause)
Create BSSMAP Assignment Failure message.
Definition: gsm0808.c:503
Parsed representation of a Cell Identifier List IE (3GPP TS 48.008 3.2.2.27).
Definition: gsm0808_utils.h:52
struct msgb * gsm0808_create_paging(const char *imsi, const uint32_t *tmsi, const struct gsm0808_cell_id_list *cil, const uint8_t *chan_needed) OSMO_DEPRECATED("use gsm0808_create_paging2 instead")
DEPRECATED: Use gsm0808_create_paging2 instead.
Definition: gsm0808.c:593
struct msgb * gsm0808_create_sapi_reject(uint8_t link_id)
Create BSSMAP SAPI N Reject message.
Definition: gsm0808.c:313
struct msgb * gsm0808_create_paging2(const char *imsi, const uint32_t *tmsi, const struct gsm0808_cell_id_list2 *cil, const uint8_t *chan_needed)
Create BSSMAP PAGING message.
Definition: gsm0808.c:534
struct msgb * gsm0808_create_reset(void)
Create BSSMAP RESET message.
Definition: gsm0808.c:138
uint8_t cause
Definition: gsm_04_08.h:504
struct msgb * gsm0808_create_ass_fail(uint8_t cause, const uint8_t *rr_cause, const struct gsm0808_speech_codec_list *scl)
Create BSSMAP Assignment Failure message.
Definition: gsm0808.c:470
struct msgb * gsm0808_create_cipher_reject(uint8_t cause)
Create BSSMAP Cipher Mode Reject message.
Definition: gsm0808.c:270
uint8_t link_id
Definition: gsm_08_08.h:453
struct msgb * gsm0808_create_classmark_update(const uint8_t *cm2, uint8_t cm2_len, const uint8_t *cm3, uint8_t cm3_len)
Create BSSMAP Classmark Update message.
Definition: gsm0808.c:291
struct msgb * gsm0808_create_dtap(struct msgb *msg, uint8_t link_id)
Create BSSMAP DTAP message.
Definition: gsm0808.c:627
Definition: gsm_08_08.h:481
const char * gsm0808_bssmap_name(uint8_t msg_type)
Return string name of BSSMAP Message Type.
Definition: gsm0808.c:888
uint8_t rr_cause
Definition: gsm_04_08.h:502
struct msgb * gsm0808_create_cipher(const struct gsm0808_encrypt_info *ei, const uint8_t *cipher_response_mode)
Create BSSMAP Cipher Mode Command message.
Definition: gsm0808.c:205
struct msgb to not lose leading zeros in the MNC
Definition: gsm0808.h:37
uint8_t sc
Definition: gsm_04_08.h:502
struct msgb * gsm0808_create_layer3_aoip(const struct msgb *msg_l3, uint16_t nc, uint16_t cc, int lac, uint16_t _ci, const struct gsm0808_speech_codec_list *scl) OSMO_DEPRECATED("Use gsm0808_create_layer3_2() instead
Create "Complete L3 Info" for AoIP, legacy implementation.
Definition: gsm0808.c:49
struct msgb * gsm0808_create_ass(const struct gsm0808_channel_type *ct, const uint16_t *cic, const struct sockaddr_storage *ss, const struct gsm0808_speech_codec_list *scl, const uint32_t *ci)
Create BSSMAP Assignment Request message.
Definition: gsm0808.c:336
const struct tlv_definition * gsm0808_att_tlvdef(void)
Definition: gsm0808.c:782
Definition: gsm23003.h:28
const char * gsm0808_bssap_name(uint8_t msg_type)
Return string name of BSSAP Message Type.
Definition: gsm0808.c:900
uint8_t cm3
Definition: gsm_04_08.h:104
struct gsm48_classmark2 cm2
Definition: gsm_04_08.h:503
struct msgb * gsm0808_create_ass_compl(uint8_t rr_cause, uint8_t chosen_channel, uint8_t encr_alg_id, uint8_t speech_mode, const struct sockaddr_storage *ss, const struct gsm0808_speech_codec *sc, const struct gsm0808_speech_codec_list *scl)
Create BSSMAP Assignment Completed message.
Definition: gsm0808.c:401
struct msgb * gsm0808_create_clear_complete(void)
Create BSSMAP Clear Complete message.
Definition: gsm0808.c:170
struct msgb * gsm0808_create_clear_rqst(uint8_t cause)
Create BSSMAP Clear Request message.
Definition: gsm0808.c:512
struct msgb * gsm0808_create_clear_command(uint8_t reason)
Create BSSMAP Clear Command message.
Definition: gsm0808.c:187
Definition: gsm_08_08.h:488
struct msgb * gsm0808_create_layer3_2(const struct msgb *msg_l3, const struct osmo_cell_global_id *cell, const struct gsm0808_speech_codec_list *scl)
Create "Complete L3 Info" for AoIP.
Definition: gsm0808.c:72
const char * gsm0808_cause_name(uint8_t cause)
Return string name of BSSMAP Cause name.
Definition: gsm0808.c:987
struct msgb * gsm0808_create_layer3(struct msgb *msg_l3, uint16_t nc, uint16_t cc, int lac, uint16_t _ci) OSMO_DEPRECATED("Use gsm0808_create_layer3_2() instead
Create "Complete L3 Info" for A, legacy implementation.
Definition: gsm0808.c:120
Definition: gsm_08_08.h:498
uint8_t cm2_len
Definition: gsm_04_08.h:502
Definition of All 256 IE / TLV.
Definition: tlv.h:419
uint16_t lac
Definition: gsm_04_08.h:503
uint8_t alg_id
Definition: gsm_04_08.h:502
void gsm0808_prepend_dtap_header(struct msgb *msg, uint8_t link_id)
Prepend a DTAP header to given Message Buffer.
Definition: gsm0808.c:615
struct msgb * gsm0808_create_cipher_complete(struct msgb *layer3, uint8_t alg_id)
Create BSSMAP Cipher Mode Complete message.
Definition: gsm0808.c:242
DEPRECATED: This definition of the cell identifier list is insufficient.
Definition: gsm_08_08.h:512
Definition: gsm_08_08.h:449