libosmogsm  0.10.2
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 struct sockaddr_storage;
29 
30 struct msgb;
31 
32 struct msgb *gsm0808_create_layer3(struct msgb *msg_l3, uint16_t nc,
33  uint16_t cc, int lac, uint16_t _ci);
34 struct msgb *gsm0808_create_layer3_aoip(const struct msgb *msg_l3, uint16_t nc,
35  uint16_t cc, int lac, uint16_t _ci,
36  const struct gsm0808_speech_codec_list
37  *scl);
38 struct msgb *gsm0808_create_reset(void);
39 struct msgb *gsm0808_create_reset_ack(void);
40 struct msgb *gsm0808_create_clear_command(uint8_t reason);
41 struct msgb *gsm0808_create_clear_complete(void);
42 struct msgb *gsm0808_create_cipher(const struct gsm0808_encrypt_info *ei,
43  const uint8_t *cipher_response_mode);
44 struct msgb *gsm0808_create_cipher_complete(struct msgb *layer3, uint8_t alg_id);
45 struct msgb *gsm0808_create_cipher_reject(uint8_t cause);
46 struct msgb *gsm0808_create_classmark_update(const uint8_t *cm2, uint8_t cm2_len,
47  const uint8_t *cm3, uint8_t cm3_len);
48 struct msgb *gsm0808_create_sapi_reject(uint8_t link_id);
49 struct msgb *gsm0808_create_ass(const struct gsm0808_channel_type *ct,
50  const uint16_t *cic,
51  const struct sockaddr_storage *ss,
52  const struct gsm0808_speech_codec_list *scl,
53  const uint32_t *ci);
54 struct msgb *gsm0808_create_ass_compl(uint8_t rr_cause, uint8_t chosen_channel,
55  uint8_t encr_alg_id, uint8_t speech_mode,
56  const struct sockaddr_storage *ss,
57  const struct gsm0808_speech_codec *sc,
58  const struct gsm0808_speech_codec_list
59  *scl);
61  uint8_t chosen_channel,
62  uint8_t encr_alg_id,
63  uint8_t speech_mode);
64 struct msgb *gsm0808_create_ass_fail(uint8_t cause, const uint8_t *rr_cause,
65  const struct gsm0808_speech_codec_list
66  *scl);
67 struct msgb *gsm0808_create_assignment_failure(uint8_t cause, uint8_t *rr_cause);
68 struct msgb *gsm0808_create_clear_rqst(uint8_t cause);
69 struct msgb *gsm0808_create_paging(const char *imsi, const uint32_t *tmsi,
70  const struct gsm0808_cell_id_list *cil,
71  const uint8_t *chan_needed);
72 
73 struct msgb *gsm0808_create_dtap(struct msgb *msg, uint8_t link_id);
74 void gsm0808_prepend_dtap_header(struct msgb *msg, uint8_t link_id);
75 
76 const struct tlv_definition *gsm0808_att_tlvdef(void);
77 
78 const char *gsm0808_bssmap_name(uint8_t msg_type);
79 const char *gsm0808_bssap_name(uint8_t msg_type);
80 
uint8_t msg_type
Definition: gsm_04_08.h:93
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:419
struct msgb * gsm0808_create_reset_ack(void)
Create BSSMAP RESET ACK message.
Definition: gsm0808.c:119
struct msgb * gsm0808_create_assignment_failure(uint8_t cause, uint8_t *rr_cause)
Create BSSMAP Assignment Failure message.
Definition: gsm0808.c:466
struct msgb * gsm0808_create_paging(const char *imsi, const uint32_t *tmsi, const struct gsm0808_cell_id_list *cil, const uint8_t *chan_needed)
Create BSSMAP PAGING message.
Definition: gsm0808.c:497
struct msgb * gsm0808_create_sapi_reject(uint8_t link_id)
Create BSSMAP SAPI N Reject message.
Definition: gsm0808.c:276
struct msgb * gsm0808_create_reset(void)
Create BSSMAP RESET message.
Definition: gsm0808.c:102
uint8_t cause
Definition: gsm_04_08.h:93
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:433
struct msgb * gsm0808_create_cipher_reject(uint8_t cause)
Create BSSMAP Cipher Mode Reject message.
Definition: gsm0808.c:234
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:254
struct msgb * gsm0808_create_dtap(struct msgb *msg, uint8_t link_id)
Create BSSMAP DTAP message.
Definition: gsm0808.c:564
Definition: gsm_08_08.h:475
const char * gsm0808_bssmap_name(uint8_t msg_type)
Return string name of BSSMAP Message Type.
Definition: gsm0808.c:825
uint8_t rr_cause
Definition: gsm_04_08.h:91
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:169
uint8_t sc
Definition: gsm_04_08.h:91
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)
Create "Complete L3 Info" for AoIP.
Definition: gsm0808.c:46
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:299
const struct tlv_definition * gsm0808_att_tlvdef(void)
Definition: gsm0808.c:719
const char * gsm0808_bssap_name(uint8_t msg_type)
Return string name of BSSAP Message Type.
Definition: gsm0808.c:837
uint8_t cm3
Definition: gsm_04_08.h:103
struct gsm48_classmark2 cm2
Definition: gsm_04_08.h:92
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:364
struct msgb * gsm0808_create_clear_complete(void)
Create BSSMAP Clear Complete message.
Definition: gsm0808.c:134
struct msgb * gsm0808_create_clear_rqst(uint8_t cause)
Create BSSMAP Clear Request message.
Definition: gsm0808.c:475
struct msgb * gsm0808_create_clear_command(uint8_t reason)
Create BSSMAP Clear Command message.
Definition: gsm0808.c:151
Definition: gsm_08_08.h:482
struct msgb * gsm0808_create_layer3(struct msgb *msg_l3, uint16_t nc, uint16_t cc, int lac, uint16_t _ci)
Create "Complete L3 Info" for A.
Definition: gsm0808.c:94
Definition: gsm_08_08.h:492
uint8_t cm2_len
Definition: gsm_04_08.h:91
Definition of All 256 IE / TLV.
Definition: tlv.h:408
uint16_t lac
Definition: gsm_04_08.h:92
uint8_t alg_id
Definition: gsm_04_08.h:91
void gsm0808_prepend_dtap_header(struct msgb *msg, uint8_t link_id)
Prepend a DTAP header to given Message Buffer.
Definition: gsm0808.c:552
struct msgb * gsm0808_create_cipher_complete(struct msgb *layer3, uint8_t alg_id)
Create BSSMAP Cipher Mode Complete message.
Definition: gsm0808.c:206
Definition: gsm_08_08.h:501
Definition: gsm_08_08.h:443