libosmogsm  1.9.2
Osmocom GSM library
aes.h
Go to the documentation of this file.
1 
3 /*
4  * Copyright (c) 2003-2006, Jouni Malinen <j@w1.fi>
5  *
6  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License version 2 as
8  * published by the Free Software Foundation.
9  *
10  * Alternatively, this software may be distributed under the terms of BSD
11  * license.
12  *
13  * SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause
14  *
15  * See README and COPYING for more details.
16  */
17 
18 #pragma once
19 
20 #define AES_BLOCK_SIZE 16
21 
22 void * aes_encrypt_init(const u8 *key, size_t len);
23 void aes_encrypt(void *ctx, const u8 *plain, u8 *crypt);
24 void aes_encrypt_deinit(void *ctx);
25 void * aes_decrypt_init(const u8 *key, size_t len);
26 void aes_decrypt(void *ctx, const u8 *crypt, u8 *plain);
27 void aes_decrypt_deinit(void *ctx);
msgb::list
struct llist_head list
PRIM_DL_REL
PRIM_DL_REL
PRIM_DL_EST
PRIM_DL_EST
lapdm_channel_set_mode
int lapdm_channel_set_mode(struct lapdm_channel *lc, enum lapdm_mode mode)
Set the lapdm_mode of a LAPDm channel.
Definition: lapdm.c:1445
len
uint8_t len
Definition: gsm_04_11.h:2
osmo_prim_cb
int(* osmo_prim_cb)(struct osmo_prim_hdr *oph, void *ctx)
LAPDm_FMT_B4
@ LAPDm_FMT_B4
Definition: lapdm.c:111
lapdm_entity::last_tx_dequeue
int last_tx_dequeue
last entity that was dequeued
Definition: lapdm.h:54
l2_ph_data_ind
static int l2_ph_data_ind(struct msgb *msg, struct lapdm_entity *le, uint8_t chan_nr, uint8_t link_id, uint32_t fn)
Definition: lapdm.c:702
gsm_chan_t
gsm_chan_t
Definition: gsm_utils.h:235
RSL_IE_ACCESS_DELAY
@ RSL_IE_ACCESS_DELAY
Definition: gsm_08_58.h:313
ph_rach_ind_param::fn
uint32_t fn
GSM Frame Number at time of RA.
Definition: l1sap.h:64
LAPDm_CTRL_is_U
#define LAPDm_CTRL_is_U(ctrl)
Definition: lapdm.c:69
TE42
#define TE42(i)
Definition: aes_i.h:84
gsm48_req_ref
Definition: gsm_04_08.h:697
OSMO_PRIM_HDR
#define OSMO_PRIM_HDR(oph)
msgb_alloc_headroom
static struct msgb * msgb_alloc_headroom(uint16_t size, uint16_t headroom, const char *name)
LAPDm_FMT_Bbis
@ LAPDm_FMT_Bbis
Definition: lapdm.c:109
aes_encrypt
void aes_encrypt(void *ctx, const u8 *plain, u8 *crypt)
aes_encrypt - Encrypt one AES block @ctx: Context pointer from aes_encrypt_init() @plain: Plaintext d...
Definition: aes-internal-enc.c:114
LAPD_U_SABM
#define LAPD_U_SABM
Definition: lapdm.c:47
Td3
const u32 Td3[256]
link_id
uint8_t link_id
Definition: gsm_08_08.h:4
ROUND
#define ROUND(i, d, s)
rsl_tlv_parse
#define rsl_tlv_parse(dec, buf, len)
Parse RSL TLV structure using tlv_parse.
Definition: rsl.h:19
TE443
#define TE443(i)
Definition: aes_i.h:89
rijndaelEncrypt
static void rijndaelEncrypt(const u32 rk[], const u8 pt[16], u8 ct[16])
Definition: aes-internal-enc.c:33
lapdm_channel_set_flags
void lapdm_channel_set_flags(struct lapdm_channel *lc, unsigned int flags)
Set the flags of all LAPDm entities in a LAPDm channel.
Definition: lapdm.c:1500
LAPD_MODE_NETWORK
LAPD_MODE_NETWORK
RLL_CAUSE_SABM_INFO_NOTALL
#define RLL_CAUSE_SABM_INFO_NOTALL
Definition: gsm_08_58.h:591
rslms_rx_rll_udata_req
static int rslms_rx_rll_udata_req(struct msgb *msg, struct lapdm_datalink *dl)
Definition: lapdm.c:1018
lapd_msg_ctx::length
int length
RSL_MT_REL_CONF
@ RSL_MT_REL_CONF
Definition: gsm_08_58.h:175
PRIM_DL_SUSP
PRIM_DL_SUSP
LAPDM_ENT_F_POLLING_ONLY
#define LAPDM_ENT_F_POLLING_ONLY
Definition: lapdm.h:48
osmo_phsap_prim
primitive header for PH-SAP primitives
Definition: l1sap.h:158
LAPDM_MODE_MS
@ LAPDM_MODE_MS
behave like a MS (mobile phone)
Definition: lapdm.h:13
TE421
#define TE421(i)
Definition: aes_i.h:87
lapdm_entity::mode
enum lapdm_mode mode
are we in BTS mode or MS mode
Definition: lapdm.h:56
aes_decrypt_init
void * aes_decrypt_init(const u8 *key, size_t len)
rsl_rll_error
static int rsl_rll_error(uint8_t cause, struct lapdm_msg_ctx *mctx)
Definition: lapdm.c:543
abis_rsl_cchan_hdr::c
struct abis_rsl_common_hdr c
Definition: gsm_08_58.h:110
lapdm_entity::tx_power
uint8_t tx_power
Definition: lapdm.h:69
ph_rach_req_param::ra
uint8_t ra
Random Access.
Definition: l1sap.h:44
RSL_MT_SUSP_CONF
@ RSL_MT_SUSP_CONF
Definition: gsm_08_58.h:180
cause
uint8_t cause
Definition: gsm_04_08.h:808
PRIM_PH_RACH
@ PRIM_PH_RACH
PH-RANDOM_ACCESS.
Definition: l1sap.h:10
LAPDm_CTRL_S
#define LAPDm_CTRL_S(nr, s, p)
Definition: lapdm.c:64
osmo_phsap_prim::oph
struct osmo_prim_hdr oph
generic primitive header
Definition: l1sap.h:159
lapdm_channel::lapdm_dcch
struct lapdm_entity lapdm_dcch
Dedicated Control Channel.
Definition: lapdm.h:77
LAPDm_U_UI
#define LAPDm_U_UI
Definition: lapdm.c:83
n
write Write running configuration to or terminal n Write configuration to the copy running config startup Copy configuration n Copy running config to n Copy running config to startup write Write running configuration to or terminal n Write to terminal n
lapdm_msg_ctx::lapdm_fmt
int lapdm_fmt
Definition: lapdm.h:22
Te0
const u32 Te0[256]
Definition: aes-internal.c:74
RSL_MT_REL_REQ
@ RSL_MT_REL_REQ
Definition: gsm_08_58.h:174
lapdm_format
lapdm_format
Definition: lapdm.c:106
lapd_msg_ctx::n_send
uint8_t n_send
lapdm_channel_reset
void lapdm_channel_reset(struct lapdm_channel *lc)
Reset a LAPDm channel with all its entities.
Definition: lapdm.c:1487
osmo_prim_hdr
aes_encrypt_init
void * aes_encrypt_init(const u8 *key, size_t len)
aes_encrypt_init - Initialize AES for encryption @key: Encryption key @len: Key length in bytes (usua...
Definition: aes-internal-enc.c:101
lapdm_rx_not_permitted
static int lapdm_rx_not_permitted(const struct lapdm_entity *le, const struct lapd_msg_ctx *lctx)
Definition: lapdm.c:669
osmo_prim_init
static void osmo_prim_init(struct osmo_prim_hdr *oph, unsigned int sap, unsigned int primitive, enum osmo_prim_operation operation, struct msgb *msg)
msgb_put
static unsigned char * msgb_put(struct msgb *msgb, unsigned int len)
Te1
const u32 Te1[256]
utils.h
lapd_msg_ctx::sapi
uint8_t sapi
u32
uint32_t u32
Definition: common.h:25
lapd_recv_dlsap
int lapd_recv_dlsap(struct osmo_dlsap_prim *dp, struct lapd_msg_ctx *lctx)
PUTU32
#define PUTU32(ct, st)
Definition: aes_i.h:115
gsm_time
Definition: gsm_utils.h:41
RSL_MT_SUSP_REQ
@ RSL_MT_SUSP_REQ
Definition: gsm_08_58.h:179
rslms_sendmsg
static int rslms_sendmsg(struct msgb *msg, struct lapdm_entity *le)
Definition: lapdm.c:341
lapdm_msg_ctx::ta_ind
uint8_t ta_ind
Definition: lapdm.h:25
lapd_dl_exit
void lapd_dl_exit(struct lapd_datalink *dl)
RSL_MT_DATA_IND
@ RSL_MT_DATA_IND
Definition: gsm_08_58.h:169
LAPD_MODE_USER
LAPD_MODE_USER
LAPD_FORM_UKN
LAPD_FORM_UKN
LAPDm_CTRL_is_S
#define LAPDm_CTRL_is_S(ctrl)
Definition: lapdm.c:68
lapdm_msg_ctx::tx_power_ind
uint8_t tx_power_ind
Definition: lapdm.h:26
lapd_msg_ctx::format
uint8_t format
lapd_msg_ctx::s_u
uint8_t s_u
lapdm_channel_exit
void lapdm_channel_exit(struct lapdm_channel *lc)
Definition: lapdm.c:306
PRIM_OP_INDICATION
PRIM_OP_INDICATION
set_lapdm_context
static int set_lapdm_context(struct lapdm_datalink *dl, uint8_t chan_nr, uint8_t link_id, int n201, uint8_t sapi)
Definition: lapdm.c:948
msgb.h
RSL_IE_REQ_REFERENCE
@ RSL_IE_REQ_REFERENCE
Definition: gsm_08_58.h:315
includes.h
ph_rach_ind_param::acc_delay
uint8_t acc_delay
Delay in bit periods.
Definition: l1sap.h:63
TLVP_LEN
#define TLVP_LEN(x, y)
Definition: tlv.h:557
lapdm_entity::l3_ctx
void * l3_ctx
context for layer3 instance
Definition: lapdm.h:60
N201_Bbis
#define N201_Bbis
Definition: lapdm.c:89
msg
uint8_t msg[0]
Definition: gsm_08_08.h:729
PRIM_DL_UNIT_DATA
PRIM_DL_UNIT_DATA
lapd_set_mode
int lapd_set_mode(struct lapd_datalink *dl, enum lapd_mode mode)
gsm_fn2gsmtime
void gsm_fn2gsmtime(struct gsm_time *time, uint32_t fn)
Parse GSM Frame Number into struct gsm_time.
Definition: gsm_utils.c:866
PRIM_OP_REQUEST
PRIM_OP_REQUEST
aes_encrypt_deinit
void aes_encrypt_deinit(void *ctx)
aes_encrypt_deinit - Deinitialize AES encryption @ctx: Context pointer from aes_encrypt_init()
Definition: aes-internal-enc.c:120
lapdm_phsap_dequeue_prim
int lapdm_phsap_dequeue_prim(struct lapdm_entity *le, struct osmo_phsap_prim *pp)
dequeue a msg that's pending transmission via L1 and wrap it into a osmo_phsap_prim
Definition: lapdm.c:420
osmo_dlsap_prim::oph
struct osmo_prim_hdr oph
lapd_dl_reset
void lapd_dl_reset(struct lapd_datalink *dl)
N200_TR_FACCH_HR
#define N200_TR_FACCH_HR
Definition: lapdm.c:102
osmo_talloc_replace_string
static void osmo_talloc_replace_string(void *ctx, char **dst, const char *newstr)
DLLAPD
#define DLLAPD
Te2
const u32 Te2[256]
lapdm_entity::flags
unsigned int flags
Definition: lapdm.h:57
tx_ph_data_enqueue
static int tx_ph_data_enqueue(struct lapdm_datalink *dl, struct msgb *msg, uint8_t chan_nr, uint8_t link_id, uint8_t pad)
Definition: lapdm.c:353
rslms_rx_rll
static int rslms_rx_rll(struct msgb *msg, struct lapdm_channel *lc)
Definition: lapdm.c:1265
aes_encrypt_init
void * aes_encrypt_init(const u8 *key, size_t len)
aes_encrypt_init - Initialize AES for encryption @key: Encryption key @len: Key length in bytes (usua...
Definition: aes-internal-enc.c:101
GSM_LCHAN_TCH_H
@ GSM_LCHAN_TCH_H
Definition: gsm_utils.h:239
update_pending_frames
static int update_pending_frames(struct lapd_msg_ctx *lctx)
Definition: lapdm.c:649
osmo_phsap_prim::u
union osmo_phsap_prim::@20 u
request-specific data
RSL_MT_REL_IND
@ RSL_MT_REL_IND
Definition: gsm_08_58.h:176
lapdm_rslms_recvmsg
int lapdm_rslms_recvmsg(struct msgb *msg, struct lapdm_channel *lc)
Receive a RSLms Message buffers from Layer 3.
Definition: lapdm.c:1390
Td4s
const u8 Td4s[256]
Definition: aes-internal.c:745
PRIM_MPH_INFO
@ PRIM_MPH_INFO
MPH-INFO.
Definition: l1sap.h:14
ph_rach_ind_param::ra
uint16_t ra
Random Access.
Definition: l1sap.h:62
container_of
#define container_of(ptr, type, member)
msgb_tv16_push
static uint8_t * msgb_tv16_push(struct msgb *msg, uint8_t tag, uint16_t val)
push (prepend) a TV16 field to a Message buffers
Definition: tlv.h:453
req_ref
struct gsm48_req_ref req_ref
Definition: gsm_04_08.h:811
PRIM_PH_RTS
@ PRIM_PH_RTS
PH-RTS.
Definition: l1sap.h:13
lapdm_phsap_up
int lapdm_phsap_up(struct osmo_prim_hdr *oph, struct lapdm_entity *le)
Receive a PH-SAP primitive from L1.
Definition: lapdm.c:907
rsl_msg_name
const char * rsl_msg_name(uint8_t err)
Get human-readable string for RSL Message Type.
Definition: rsl.c:405
lapdm_entity_init
void lapdm_entity_init(struct lapdm_entity *le, enum lapdm_mode mode, int t200) OSMO_DEPRECATED("Use lapdm_entity_init3() instead")
initialize a LAPDm entity and all datalinks inside
Definition: lapdm.c:159
length
uint8_t length
Definition: gsm_08_08.h:3
abis_rsl_common_hdr
RSL common header.
Definition: gsm_08_58.h:75
GSM_MACBLOCK_PADDING
#define GSM_MACBLOCK_PADDING
Definition: gsm_04_08.h:2241
rslms_rx_rll_data_req
static int rslms_rx_rll_data_req(struct msgb *msg, struct lapdm_datalink *dl)
Definition: lapdm.c:1090
l2_ph_chan_conf
static int l2_ph_chan_conf(struct msgb *msg, struct lapdm_entity *le, uint32_t frame_nr)
Definition: lapdm.c:1241
GETU32
#define GETU32(pt)
Definition: aes_i.h:113
l2_ph_rach_ind
static int l2_ph_rach_ind(struct lapdm_entity *le, uint8_t ra, uint32_t fn, uint8_t acc_delay)
Definition: lapdm.c:875
lapdm_channel
the two lapdm_entities that form a GSM logical channel (ACCH + DCCH)
Definition: lapdm.h:73
DL_SAPI0
@ DL_SAPI0
SAPI 0.
Definition: lapdm.h:40
LOGDL
#define LOGDL(dl, level, fmt, args...)
osmo_dlsap_prim
osmo_dlsap_prim::rel_req
struct dl_rel_req_param rel_req
ph_data_param::link_id
uint8_t link_id
Link Identifier (Like RSL)
Definition: l1sap.h:76
RLL_CAUSE_FRM_UNIMPL
#define RLL_CAUSE_FRM_UNIMPL
Definition: gsm_08_58.h:589
osmo_prim_hdr::operation
enum osmo_prim_operation operation
rslms_rx_com_chan
static int rslms_rx_com_chan(struct msgb *msg, struct lapdm_channel *lc)
Definition: lapdm.c:1362
lapdm_channel_init3
int lapdm_channel_init3(struct lapdm_channel *lc, enum lapdm_mode mode, const int *t200_ms_dcch, const int *t200_ms_acch, enum gsm_chan_t chan_t, const char *name_pfx)
initialize a LAPDm channel and all its channels
Definition: lapdm.c:259
data
uint8_t data[0]
l2_ph_data_conf
static int l2_ph_data_conf(struct msgb *msg, struct lapdm_entity *le)
Definition: lapdm.c:455
os_free
#define os_free(x)
Definition: common.h:19
LAPDm_CTRL_S_BITS
#define LAPDm_CTRL_S_BITS(ctrl)
Definition: lapdm.c:74
LAPDM_ENT_F_EMPTY_FRAME
#define LAPDM_ENT_F_EMPTY_FRAME
Definition: lapdm.h:47
gsm_time::t3
uint8_t t3
Definition: gsm_utils.h:45
msgb
msgb_push
static unsigned char * msgb_push(struct msgb *msgb, unsigned int len)
aes_decrypt
void aes_decrypt(void *ctx, const u8 *crypt, u8 *plain)
LOGL_INFO
#define LOGL_INFO
GSM_LCHAN_TCH_F
@ GSM_LCHAN_TCH_F
Definition: gsm_utils.h:238
mode
uint8_t mode
Definition: gsm_04_08.h:690
rcon
const u32 rcon[10]
abis_rsl_rll_hdr
Definition: gsm_08_58.h:82
PRIM_PH_EMPTY_FRAME
@ PRIM_PH_EMPTY_FRAME
PH-EMPTY_FRAME.
Definition: l1sap.h:12
rijndaelKeySetupEnc
void rijndaelKeySetupEnc(u32 rk[], const u8 cipherKey[])
Expand the cipher key into the encryption key schedule.
Definition: aes-internal.c:789
flags
uint16_t flags
ph_rach_req_param::ta
uint8_t ta
Timing Advance.
Definition: l1sap.h:45
os_malloc
#define os_malloc(x)
Definition: common.h:18
rslms_rx_chan_rqd
static int rslms_rx_chan_rqd(struct lapdm_channel *lc, struct msgb *msg)
Definition: lapdm.c:1201
LAPDM_MODE_BTS
@ LAPDM_MODE_BTS
behave like a BTS (network)
Definition: lapdm.h:14
rsl_rll_push_l3
void rsl_rll_push_l3(struct msgb *msg, uint8_t msg_type, uint8_t chan_nr, uint8_t link_id, int transparent)
Wrap msgb in L3 Info IE and push a RSL RLL header.
Definition: rsl.c:548
rcons
const u8 rcons[]
Definition: aes-internal.c:779
N201_AB_SACCH
#define N201_AB_SACCH
Definition: lapdm.c:86
dl_rel_req_param::mode
uint8_t mode
N200_TR_FACCH_FR
#define N200_TR_FACCH_FR
Definition: lapdm.c:100
RSL_MT_RECON_REQ
@ RSL_MT_RECON_REQ
Definition: gsm_08_58.h:182
lapd_cr_ent::cmd
uint8_t cmd
lapd_ph_data_ind
int lapd_ph_data_ind(struct msgb *msg, struct lapd_msg_ctx *lctx)
lapd_dl_init2
void lapd_dl_init2(struct lapd_datalink *dl, uint8_t k, uint8_t v_range, int maxf, const char *name)
msgb_free
void msgb_free(struct msgb *m)
get_n200_dcch
static int get_n200_dcch(enum gsm_chan_t chan_t)
Definition: lapdm.c:207
aes.h
Te3
const u32 Te3[256]
N201_Bter_SACCH
#define N201_Bter_SACCH
Definition: lapdm.c:90
PRIM_MDL_ERROR
PRIM_MDL_ERROR
lapdm_pad_msgb
static void lapdm_pad_msgb(struct msgb *msg, uint8_t n201)
Definition: lapdm.c:325
Te4
const u32 Te4[256]
abis_rsl_cchan_hdr::data
uint8_t data[0]
message payload data
Definition: gsm_08_58.h:116
lapdm_channel_set_l1
void lapdm_channel_set_l1(struct lapdm_channel *lc, osmo_prim_cb cb, void *ctx)
Set the L1 callback and context of a LAPDm channel.
Definition: lapdm.c:1457
PRIM_PH_CONN
@ PRIM_PH_CONN
PH-CONNECT.
Definition: l1sap.h:11
LAPDm_ADDR_SAPI
#define LAPDm_ADDR_SAPI(addr)
Definition: lapdm.c:57
rsl_init_cchan_hdr
void rsl_init_cchan_hdr(struct abis_rsl_cchan_hdr *ch, uint8_t msg_type)
Initialize a RSL Common Channel header.
Definition: rsl.c:55
_NR_DL_SAPI
@ _NR_DL_SAPI
Definition: lapdm.h:42
lapdm_channel_set_l3
void lapdm_channel_set_l3(struct lapdm_channel *lc, lapdm_cb_t cb, void *ctx)
Set the L3 callback and context of a LAPDm channel.
Definition: lapdm.c:1466
lapdm_entity::l1_prim_cb
osmo_prim_cb l1_prim_cb
callback for sending prims to L1
Definition: lapdm.h:62
osmo_phsap_prim::data
struct ph_data_param data
Definition: l1sap.h:161
lapd_msg_ctx::p_f
uint8_t p_f
msgb_pull_to_l3
static unsigned char * msgb_pull_to_l3(struct msgb *msg)
gsm_time::t1
uint16_t t1
Definition: gsm_utils.h:43
gsm_utils.h
msgb_tlv_put
static uint8_t * msgb_tlv_put(struct msgb *msg, uint8_t tag, uint8_t len, const uint8_t *val)
put (append) a TLV field to a Message buffers
Definition: tlv.h:366
lapdm_entity::tx_pending
int tx_pending
currently a pending frame not confirmed by L1
Definition: lapdm.h:55
lapdm_msg_ctx::link_id
uint8_t link_id
Definition: lapdm.h:24
rsl_rll_simple
struct msgb * rsl_rll_simple(uint8_t msg_type, uint8_t chan_nr, uint8_t link_id, int transparent)
Create msgb with RSL RLL header.
Definition: rsl.c:569
RSL_MT_DATA_REQ
@ RSL_MT_DATA_REQ
Definition: gsm_08_58.h:168
Td2
const u32 Td2[256]
RSL_IE_RLM_CAUSE
@ RSL_IE_RLM_CAUSE
Definition: gsm_08_58.h:318
LAPDm_CTRL_U
#define LAPDm_CTRL_U(u, p)
Definition: lapdm.c:65
aes_encrypt_deinit
void aes_encrypt_deinit(void *ctx)
aes_encrypt_deinit - Deinitialize AES encryption @ctx: Context pointer from aes_encrypt_init()
Definition: aes-internal-enc.c:120
ABIS_RSL_MDISC_RLL
#define ABIS_RSL_MDISC_RLL
Definition: gsm_08_58.h:149
lapdm_entity::l1_ctx
void * l1_ctx
context for layer1 instance
Definition: lapdm.h:59
lapd_msg_ctx::n201
int n201
N200_TR_SDCCH
#define N200_TR_SDCCH
Definition: lapdm.c:99
lapdm_entity
a LAPDm Entity
Definition: lapdm.h:51
PRIM_DL_RECON
PRIM_DL_RECON
ph_data_param::fn
uint32_t fn
GSM Frame Number.
Definition: l1sap.h:78
gsm_04_08.h
LAPDm_MORE
#define LAPDm_MORE
Definition: lapdm.c:80
PRIM_TCH
@ PRIM_TCH
TCH.
Definition: l1sap.h:15
LAPDm_FMT_B
@ LAPDm_FMT_B
Definition: lapdm.c:108
LAPD_FORM_U
LAPD_FORM_U
N200_EST_REL
#define N200_EST_REL
Definition: lapdm.c:96
osmo_prim_hdr::msg
struct msgb * msg
name
const char * name
lapdm_datalink_for_sapi
struct lapdm_datalink * lapdm_datalink_for_sapi(struct lapdm_entity *le, uint8_t sapi)
Definition: lapdm.c:312
ph_rach_req_param::offset
uint16_t offset
Timing Offset.
Definition: l1sap.h:48
u8
uint8_t u8
Definition: common.h:27
TLVP_PRESENT
#define TLVP_PRESENT(x, y)
Definition: tlv.h:556
ph_data_param::chan_nr
uint8_t chan_nr
Channel Number (Like RSL)
Definition: l1sap.h:77
N201_B4
#define N201_B4
Definition: lapdm.c:93
RSL_MT_UNIT_DATA_REQ
@ RSL_MT_UNIT_DATA_REQ
Definition: gsm_08_58.h:177
GSM_LCHAN_SDCCH
@ GSM_LCHAN_SDCCH
Definition: gsm_utils.h:237
rslms_rx_rll_susp_req
static int rslms_rx_rll_susp_req(struct msgb *msg, struct lapdm_datalink *dl)
Definition: lapdm.c:1118
common.h
TE414
#define TE414(i)
Definition: aes_i.h:90
lapdm_msg_ctx::fn
uint32_t fn
Definition: lapdm.h:27
PRIM_TCH_RTS
@ PRIM_TCH_RTS
TCH.
Definition: l1sap.h:16
abis_rsl_rll_hdr::chan_nr
uint8_t chan_nr
Definition: gsm_08_58.h:86
osmo_ph_prim_names
const struct value_string osmo_ph_prim_names[]
Definition: lapdm.c:114
msgb_trim
static int msgb_trim(struct msgb *msg, int len)
N201_Bter_SDCCH
#define N201_Bter_SDCCH
Definition: lapdm.c:91
LAPDm_LPD_NORMAL
#define LAPDm_LPD_NORMAL
Definition: lapdm.c:50
LAPDm_CTRL_I_Ns
#define LAPDm_CTRL_I_Ns(ctrl)
Definition: lapdm.c:76
msgb_l2len
static unsigned int msgb_l2len(const struct msgb *msgb)
tall_lapd_ctx
void * tall_lapd_ctx
ph_rach_req_param::tx_power
uint8_t tx_power
Transmit Power.
Definition: l1sap.h:46
namebuf
static __thread char namebuf[255]
Td1
const u32 Td1[256]
lapdm_entity_exit
void lapdm_entity_exit(struct lapdm_entity *le)
flush and release all resoures in LAPDm entity
Definition: lapdm.c:290
lapd_msg_ctx::cr
uint8_t cr
timer.h
LAPD_FORM_I
LAPD_FORM_I
tx_dequeue_acch_msgb
static struct msgb * tx_dequeue_acch_msgb(struct lapdm_entity *le)
Definition: lapdm.c:394
N200_TR_SACCH
#define N200_TR_SACCH
Definition: lapdm.c:98
TE43
#define TE43(i)
Definition: aes_i.h:85
PRIM_DL_RES
PRIM_DL_RES
LAPDm_SAPI_SMS
#define LAPDm_SAPI_SMS
Definition: lapdm.c:53
AES_PRIV_SIZE
#define AES_PRIV_SIZE
Definition: aes_i.h:120
lapd_msg_ctx::n_recv
uint8_t n_recv
DL_SAPI3
@ DL_SAPI3
SAPI 1.
Definition: lapdm.h:41
llist_for_each_entry
#define llist_for_each_entry(pos, head, member)
LOGL_NOTICE
#define LOGL_NOTICE
RSL_MT_CHAN_RQD
@ RSL_MT_CHAN_RQD
Definition: gsm_08_58.h:187
Td0
const u32 Td0[256]
Definition: aes-internal.c:407
LAPDm_FMT_A
@ LAPDm_FMT_A
Definition: lapdm.c:107
abis_rsl_common_hdr::msg_type
uint8_t msg_type
message type (abis_rsl_msgtype)
Definition: gsm_08_58.h:77
lapdm_channel_init2
int lapdm_channel_init2(struct lapdm_channel *lc, enum lapdm_mode mode, const int *t200_ms_dcch, const int *t200_ms_acch, enum gsm_chan_t chan_t)
initialize a LAPDm channel and all its channels
Definition: lapdm.c:245
value_string
LAPDm_CTRL_Nr
#define LAPDm_CTRL_Nr(ctrl)
Definition: lapdm.c:77
lapdm_entity::l3_cb
lapdm_cb_t l3_cb
callback for sending stuff to L3
Definition: lapdm.h:63
send_rslms_rll_l3
static int send_rslms_rll_l3(uint8_t msg_type, struct lapdm_msg_ctx *mctx, struct msgb *msg)
Definition: lapdm.c:500
lapd_mode
lapd_mode
lapdm_msg_ctx::chan_nr
uint8_t chan_nr
Definition: lapdm.h:23
SAP_GSM_PH
@ SAP_GSM_PH
Definition: prim.h:9
ABIS_RSL_MDISC_COM_CHAN
#define ABIS_RSL_MDISC_COM_CHAN
Definition: gsm_08_58.h:153
LAPDm_EL
#define LAPDm_EL
Definition: lapdm.c:81
lapdm_entity::datalink
struct lapdm_datalink datalink[_NR_DL_SAPI]
the SAPIs of the LAPDm entity
Definition: lapdm.h:53
RSL_IE_L3_INFO
@ RSL_IE_L3_INFO
Definition: gsm_08_58.h:307
LAPDm_CTRL_I
#define LAPDm_CTRL_I(nr, ns, p)
Definition: lapdm.c:63
osmo_phsap_prim::rach_ind
struct ph_rach_ind_param rach_ind
Definition: l1sap.h:164
abis_rsl_rll_hdr::c
struct abis_rsl_common_hdr c
Definition: gsm_08_58.h:83
lapd_msg_ctx
RCON
#define RCON(i)
Definition: aes_i.h:72
rsl_is_transparent
static int rsl_is_transparent(uint8_t msg_type)
Definition: lapdm.c:485
aes_encrypt_deinit
void aes_encrypt_deinit(void *ctx)
aes_encrypt_deinit - Deinitialize AES encryption @ctx: Context pointer from aes_encrypt_init()
Definition: aes-internal-enc.c:120
ARRAY_SIZE
#define ARRAY_SIZE(x)
LAPDm_ADDR_SHORT_L2
#define LAPDm_ADDR_SHORT_L2(addr)
Definition: lapdm.c:60
OSMO_PRIM
#define OSMO_PRIM(prim, op)
osmo_dlsap_prim::u
union osmo_dlsap_prim::@2 u
RSL_CHAN_RACH
#define RSL_CHAN_RACH
Definition: gsm_08_58.h:463
RSL_IE_TIMING_ADVANCE
@ RSL_IE_TIMING_ADVANCE
Definition: gsm_08_58.h:320
lapd_msg_ctx::lpd
uint8_t lpd
abis_rsl_rll_hdr::link_id
uint8_t link_id
Definition: gsm_08_58.h:91
lapdm_entity_reset
void lapdm_entity_reset(struct lapdm_entity *le)
Reset an entire LAPDm entity and all its datalinks.
Definition: lapdm.c:1475
crypto.h
LAPD_FORM_S
LAPD_FORM_S
msgb_l3
#define msgb_l3(m)
lapd_msg_ctx::dl
struct lapd_datalink * dl
send_rll_simple
static int send_rll_simple(uint8_t msg_type, struct lapdm_msg_ctx *mctx)
Definition: lapdm.c:532
chan_nr
uint8_t chan_nr
Definition: gsm_04_08.h:248
LAPDm_ADDR_LPD
#define LAPDm_ADDR_LPD(addr)
Definition: lapdm.c:56
lapdm_entity_init2
void lapdm_entity_init2(struct lapdm_entity *le, enum lapdm_mode mode, const int *t200_ms, int n200) OSMO_DEPRECATED("Use lapdm_entity_init3() instead")
initialize a LAPDm entity and all datalinks inside
Definition: lapdm.c:177
LAPDm_CTRL_U_BITS
#define LAPDm_CTRL_U_BITS(ctrl)
Definition: lapdm.c:71
RSL_MT_EST_CONF
@ RSL_MT_EST_CONF
Definition: gsm_08_58.h:172
lapdm_channel::lapdm_acch
struct lapdm_entity lapdm_acch
Associated Control Channel.
Definition: lapdm.h:76
abis_rsl_common_hdr::msg_discr
uint8_t msg_discr
message discriminator (ABIS_RSL_MDISC_*)
Definition: gsm_08_58.h:76
aes_encrypt
void aes_encrypt(void *ctx, const u8 *plain, u8 *crypt)
aes_encrypt - Encrypt one AES block @ctx: Context pointer from aes_encrypt_init() @plain: Plaintext d...
Definition: aes-internal-enc.c:114
lapdm_channel::name
char * name
human-readable name
Definition: lapdm.h:75
TE432
#define TE432(i)
Definition: aes_i.h:88
aes_wrap.h
msgb_pull
static unsigned char * msgb_pull(struct msgb *msgb, unsigned int len)
RSL_MT_RES_REQ
@ RSL_MT_RES_REQ
Definition: gsm_08_58.h:181
gsm_time::t2
uint8_t t2
Definition: gsm_utils.h:44
tx_dequeue_dcch_msgb
static struct msgb * tx_dequeue_dcch_msgb(struct lapdm_entity *le)
Definition: lapdm.c:381
msgb_l2
#define msgb_l2(m)
aes_encrypt_init
void * aes_encrypt_init(const u8 *key, size_t len)
aes_encrypt_init - Initialize AES for encryption @key: Encryption key @len: Key length in bytes (usua...
Definition: aes-internal-enc.c:101
LOGP
#define LOGP(ss, level, fmt, args...)
rslms_rx_rll_rel_req
static int rslms_rx_rll_rel_req(struct msgb *msg, struct lapdm_datalink *dl)
Definition: lapdm.c:1175
ph_rach_req_param::is_combined_ccch
uint8_t is_combined_ccch
Are we using a combined CCCH?
Definition: l1sap.h:47
lapdm_entity_set_flags
void lapdm_entity_set_flags(struct lapdm_entity *le, unsigned int flags)
Set the flags of a LAPDm entity.
Definition: lapdm.c:1494
msgb_tv_push
static uint8_t * msgb_tv_push(struct msgb *msg, uint8_t tag, uint8_t val)
push (prepend) a TV field to a Message buffers
Definition: tlv.h:444
lapdm_entity_set_mode
int lapdm_entity_set_mode(struct lapdm_entity *le, enum lapdm_mode mode)
Set the lapdm_mode of a LAPDm entity.
Definition: lapdm.c:1419
LAPDm_LEN
#define LAPDm_LEN(len)
Definition: lapdm.c:79
osmo_phsap_prim::rach_req
struct ph_rach_req_param rach_req
Definition: l1sap.h:163
LAPDm_SAPI_NORMAL
#define LAPDm_SAPI_NORMAL
Definition: lapdm.c:52
TE41
#define TE41(i)
Definition: aes_i.h:83
lapdm_channel_init
void lapdm_channel_init(struct lapdm_channel *lc, enum lapdm_mode mode) OSMO_DEPRECATED_OUTSIDE("Use lapdm_channel_init3() instead")
initialize a LAPDm channel and all its channels
Definition: lapdm.c:229
rslms_rx_rll_res_req
static int rslms_rx_rll_res_req(struct msgb *msg, struct lapdm_datalink *dl)
Definition: lapdm.c:1138
rsl_rll_push_hdr
void rsl_rll_push_hdr(struct msgb *msg, uint8_t msg_type, uint8_t chan_nr, uint8_t link_id, int transparent)
Push a RSL RLL header onto an existing msgb.
Definition: rsl.c:526
rslms_rx_rll_est_req
static int rslms_rx_rll_est_req(struct msgb *msg, struct lapdm_datalink *dl)
Definition: lapdm.c:963
lapdm_send_ph_data_req
static int lapdm_send_ph_data_req(struct lapd_msg_ctx *lctx, struct msgb *msg)
Definition: lapdm.c:604
tlv.h
Td4
const u32 Td4[256]
LAPDm_ADDR_EA
#define LAPDm_ADDR_EA(addr)
Definition: lapdm.c:59
RSL_MT_ERROR_IND
@ RSL_MT_ERROR_IND
Definition: gsm_08_58.h:170
msg_type
uint8_t msg_type
Definition: gsm_04_08.h:808
gsm_08_58.h
logging.h
lapdm_entity::ta
uint8_t ta
Definition: lapdm.h:68
RSL_IE_MS_POWER
@ RSL_IE_MS_POWER
Definition: gsm_08_58.h:309
msgb_dequeue
struct msgb * msgb_dequeue(struct llist_head *queue)
PRIM_PH_DATA
@ PRIM_PH_DATA
PH-DATA.
Definition: l1sap.h:9
lapdm_entity_init3
void lapdm_entity_init3(struct lapdm_entity *le, enum lapdm_mode mode, const int *t200_ms, int n200, const char *name_pfx)
initialize a LAPDm entity and all datalinks inside
Definition: lapdm.c:190
LAPDm_ADDR_CR
#define LAPDm_ADDR_CR(addr)
Definition: lapdm.c:58
abis_rsl_rll_hdr::data
uint8_t data[0]
message payload data
Definition: gsm_08_58.h:94
LAPDm_FMT_Bter
@ LAPDm_FMT_Bter
Definition: lapdm.c:110
lapd_msg_ctx::more
uint8_t more
abis_rsl_cchan_hdr::chan_nr
uint8_t chan_nr
Definition: gsm_08_58.h:113
TE44
#define TE44(i)
Definition: aes_i.h:86
aes_decrypt_deinit
void aes_decrypt_deinit(void *ctx)
send_rslms_dlsap
static int send_rslms_dlsap(struct osmo_dlsap_prim *dp, struct lapd_msg_ctx *lctx)
Definition: lapdm.c:554
N201_AB_SDCCH
#define N201_AB_SDCCH
Definition: lapdm.c:87
aes_encrypt
void aes_encrypt(void *ctx, const u8 *plain, u8 *crypt)
aes_encrypt - Encrypt one AES block @ctx: Context pointer from aes_encrypt_init() @plain: Plaintext d...
Definition: aes-internal-enc.c:114
RSL_MT_EST_REQ
@ RSL_MT_EST_REQ
Definition: gsm_08_58.h:171
prim.h
LAPDm_CTRL_PF_BIT
#define LAPDm_CTRL_PF_BIT(ctrl)
Definition: lapdm.c:72
abis_rsl_cchan_hdr
Definition: gsm_08_58.h:109
RSL_IE_RELEASE_MODE
@ RSL_IE_RELEASE_MODE
Definition: gsm_08_58.h:316
lapdm_dl_init
static void lapdm_dl_init(struct lapdm_datalink *dl, struct lapdm_entity *entity, int t200_ms, uint32_t n200, const char *name)
Definition: lapdm.c:133
lapdm_msg_ctx
LAPDm message context.
Definition: lapdm.h:20
lapdm_mode
lapdm_mode
LAPDm mode/role.
Definition: lapdm.h:12
mdl_error_ind_param::cause
uint8_t cause
RSL_MT_CHAN_CONF
@ RSL_MT_CHAN_CONF
Definition: gsm_08_58.h:192
LAPDm_ADDR
#define LAPDm_ADDR(lpd, sapi, cr)
Definition: lapdm.c:54
msgb_tv_fixed_put
static uint8_t * msgb_tv_fixed_put(struct msgb *msg, uint8_t tag, unsigned int len, const uint8_t *val)
put (append) a TVfixed field to a Message buffers
Definition: tlv.h:382
N200
#define N200
Definition: lapdm.c:104
PRIM_DL_DATA
PRIM_DL_DATA
send_rslms_rll_l3_ui
static int send_rslms_rll_l3_ui(struct lapdm_msg_ctx *mctx, struct msgb *msg)
Definition: lapdm.c:513
msgb_enqueue
void msgb_enqueue(struct llist_head *queue, struct msgb *msg)
osmo_prim_hdr::primitive
unsigned int primitive
LOGL_ERROR
#define LOGL_ERROR
tlv_parsed
result of the TLV parser
Definition: tlv.h:532
RSL_MT_UNIT_DATA_IND
@ RSL_MT_UNIT_DATA_IND
Definition: gsm_08_58.h:178
rsl.h
osmo_dlsap_prim::error_ind
struct mdl_error_ind_param error_ind
lapdm_entity::lapdm_ch
struct lapdm_channel * lapdm_ch
pointer to lapdm_channel of which we're part
Definition: lapdm.h:66
aes_128_encrypt_block
int aes_128_encrypt_block(const u8 *key, const u8 *in, u8 *out)
aes_128_encrypt_block - Perform one AES 128-bit block operation @key: Key for AES @in: Input data (16...
Definition: aes-encblock.c:31
aes_i.h
msgb_tv_put
static uint8_t * msgb_tv_put(struct msgb *msg, uint8_t tag, uint8_t val)
put (append) a TV field to a Message buffers
Definition: tlv.h:374
PRIM_OP_CONFIRM
PRIM_OP_CONFIRM
osmo_prim_hdr::sap
unsigned int sap
LAPDm_CTRL_is_I
#define LAPDm_CTRL_is_I(ctrl)
Definition: lapdm.c:67
TLVP_VAL
#define TLVP_VAL(x, y)
Definition: tlv.h:558
lapdm_msg_ctx::dl
struct lapdm_datalink * dl
Definition: lapdm.h:21
lapdm.h
lapdm_cb_t
int(* lapdm_cb_t)(struct msgb *msg, struct lapdm_entity *le, void *ctx)
Definition: lapdm.h:45
os_memset
#define os_memset(x, y, z)
Definition: common.h:17
RSL_MT_EST_IND
@ RSL_MT_EST_IND
Definition: gsm_08_58.h:173