libosmogsm  1.7.0
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);
l2downstatelist
static const struct l2downstate l2downstatelist[]
msgb::list
struct llist_head list
PRIM_DL_REL
@ PRIM_DL_REL
DL-RLEEASE.
Definition: lapd_core.h:25
PRIM_DL_EST
@ PRIM_DL_EST
DL-ESTABLISH.
Definition: lapd_core.h:24
LAPD_STATE_TIMER_RECOV
@ LAPD_STATE_TIMER_RECOV
Definition: lapd_core.h:84
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)
lapd_rx_s
static int lapd_rx_s(struct msgb *msg, struct lapd_msg_ctx *lctx)
Definition: lapd_core.c:1295
lapd_cr_ent::resp
uint8_t resp
Definition: lapd_core.h:117
LAPDm_FMT_B4
@ LAPDm_FMT_B4
Definition: lapdm.c:110
MDL_CAUSE_UFRM_INC_PARAM
#define MDL_CAUSE_UFRM_INC_PARAM
Definition: lapd_core.h:40
lapdm_entity::last_tx_dequeue
int last_tx_dequeue
last entity that was dequeued
Definition: lapdm.h:53
msgb::l3h
unsigned char * l3h
gsm_chan_t
gsm_chan_t
Definition: gsm_utils.h:226
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:68
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)
tall_lapd_ctx
void * tall_lapd_ctx
Definition: lapd_core.c:253
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:108
LAPD_U_UI
#define LAPD_U_UI
Definition: lapd_core.c:88
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
behave like network
Definition: lapd_core.h:71
RLL_CAUSE_SABM_INFO_NOTALL
#define RLL_CAUSE_SABM_INFO_NOTALL
Definition: gsm_08_58.h:575
rslms_rx_rll_udata_req
static int rslms_rx_rll_udata_req(struct msgb *msg, struct lapdm_datalink *dl)
Definition: lapdm.c:1024
lapd_msg_ctx::length
int length
Definition: lapd_core.h:111
RSL_MT_REL_CONF
@ RSL_MT_REL_CONF
Definition: gsm_08_58.h:175
lapd_history::more
int more
Definition: lapd_core.h:122
PRIM_DL_SUSP
@ PRIM_DL_SUSP
DL-SUSPEND.
Definition: lapd_core.h:26
LAPDM_ENT_F_POLLING_ONLY
#define LAPDM_ENT_F_POLLING_ONLY
Definition: lapdm.h:47
LAPD_HEADROOM
#define LAPD_HEADROOM
Definition: lapd_core.c:102
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:55
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:542
get_value_string
const char * get_value_string(const struct value_string *vs, uint32_t val)
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:68
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:768
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:63
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:76
LAPDm_U_UI
#define LAPDm_U_UI
Definition: lapdm.c:82
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
MDL_CAUSE_UNSOL_DM_RESP
#define MDL_CAUSE_UNSOL_DM_RESP
Definition: lapd_core.h:36
lapdm_msg_ctx::lapdm_fmt
int lapdm_fmt
Definition: lapdm.h:22
l2downstate
Definition: lapd_core.c:2139
lapd_res_req
static int lapd_res_req(struct osmo_dlsap_prim *dp, struct lapd_msg_ctx *lctx)
Definition: lapd_core.c:1994
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:105
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)
Definition: lapdm.c:701
lapd_msg_ctx::n_send
uint8_t n_send
Definition: lapd_core.h:107
OSMO_ASSERT
#define OSMO_ASSERT(exp)
lapdm_channel_reset
void lapdm_channel_reset(struct lapdm_channel *lc)
Reset a LAPDm channel with all its entities.
Definition: lapdm.c:1487
lapd_rx_u_frmr
static int lapd_rx_u_frmr(struct msgb *msg, struct lapd_msg_ctx *lctx)
Definition: lapd_core.c:1253
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
LAPD_STATE_IDLE
@ LAPD_STATE_IDLE
Definition: lapd_core.h:80
lapdm_rx_not_permitted
static int lapdm_rx_not_permitted(const struct lapdm_entity *le, const struct lapd_msg_ctx *lctx)
Definition: lapdm.c:668
msgb_put
static unsigned char * msgb_put(struct msgb *msgb, unsigned int len)
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)
lapd_data_req
static int lapd_data_req(struct osmo_dlsap_prim *dp, struct lapd_msg_ctx *lctx)
Definition: lapd_core.c:1800
Te1
const u32 Te1[256]
utils.h
lapd_msg_ctx::sapi
uint8_t sapi
Definition: lapd_core.h:101
u32
uint32_t u32
Definition: common.h:25
msgb::data
unsigned char * data
MDL_CAUSE_IFRM_INC_MBITS
#define MDL_CAUSE_IFRM_INC_MBITS
Definition: lapd_core.h:42
lapd_recv_dlsap
int lapd_recv_dlsap(struct osmo_dlsap_prim *dp, struct lapd_msg_ctx *lctx)
Definition: lapd_core.c:2198
MDL_CAUSE_SABM_MF
#define MDL_CAUSE_SABM_MF
Definition: lapd_core.h:45
PUTU32
#define PUTU32(ct, st)
Definition: aes_i.h:115
lapd_t203_cb
static void lapd_t203_cb(void *data)
Definition: lapd_core.c:711
gsm_time
Definition: gsm_utils.h:40
RSL_MT_SUSP_REQ
@ RSL_MT_SUSP_REQ
Definition: gsm_08_58.h:179
SBIT
#define SBIT(a)
Definition: lapd_core.c:105
rslms_sendmsg
static int rslms_sendmsg(struct msgb *msg, struct lapdm_entity *le)
Definition: lapdm.c:340
lapdm_msg_ctx::ta_ind
uint8_t ta_ind
Definition: lapdm.h:25
lapd_dl_exit
void lapd_dl_exit(struct lapd_datalink *dl)
Definition: lapd_core.c:357
RSL_MT_DATA_IND
@ RSL_MT_DATA_IND
Definition: gsm_08_58.h:169
LAPD_MODE_USER
@ LAPD_MODE_USER
behave like user
Definition: lapd_core.h:70
LAPD_FORM_UKN
@ LAPD_FORM_UKN
Definition: lapd_core.h:89
LAPDm_CTRL_is_S
#define LAPDm_CTRL_is_S(ctrl)
Definition: lapdm.c:67
lapdm_msg_ctx::tx_power_ind
uint8_t tx_power_ind
Definition: lapdm.h:26
lapd_msg_ctx::format
uint8_t format
Definition: lapd_core.h:105
lapd_msg_ctx::s_u
uint8_t s_u
Definition: lapd_core.h:109
lapdm_channel_exit
void lapdm_channel_exit(struct lapdm_channel *lc)
Definition: lapdm.c:305
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:954
lapd_rx_u_disc
static int lapd_rx_u_disc(struct msgb *msg, struct lapd_msg_ctx *lctx)
Definition: lapd_core.c:1082
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
LAPD_STATE_ASS_TEI_WAIT
@ LAPD_STATE_ASS_TEI_WAIT
Definition: lapd_core.h:78
TLVP_LEN
#define TLVP_LEN(x, y)
Definition: tlv.h:547
lapdm_entity::l3_ctx
void * l3_ctx
context for layer3 instance
Definition: lapdm.h:59
N201_Bbis
#define N201_Bbis
Definition: lapdm.c:88
msg
uint8_t msg[0]
Definition: gsm_08_08.h:529
PRIM_DL_UNIT_DATA
@ PRIM_DL_UNIT_DATA
DL-UNIT-DATA.
Definition: lapd_core.h:22
lapd_set_mode
int lapd_set_mode(struct lapd_datalink *dl, enum lapd_mode mode)
Set the lapdm_mode of a LAPDm entity.
Definition: lapd_core.c:373
gsm_fn2gsmtime
void gsm_fn2gsmtime(struct gsm_time *time, uint32_t fn)
Parse GSM Frame Number into struct gsm_time.
Definition: gsm_utils.c:865
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
lapd_dl_newstate
static void lapd_dl_newstate(struct lapd_datalink *dl, uint32_t state)
Definition: lapd_core.c:232
lapd_send_rnr
static int lapd_send_rnr(struct lapd_msg_ctx *lctx, uint8_t f_bit, uint8_t cmd)
Definition: lapd_core.c:496
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:419
osmo_dlsap_prim::oph
struct osmo_prim_hdr oph
generic primitive header
Definition: lapd_core.h:61
N200_TR_FACCH_HR
#define N200_TR_FACCH_HR
Definition: lapdm.c:101
lapd_dl_reset
void lapd_dl_reset(struct lapd_datalink *dl)
Definition: lapd_core.c:336
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:56
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:352
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
LAPD_S_RR
#define LAPD_S_RR
Definition: lapd_core.c:93
LAPD_U_DM
#define LAPD_U_DM
Definition: lapd_core.c:87
GSM_LCHAN_TCH_H
@ GSM_LCHAN_TCH_H
Definition: gsm_utils.h:230
lapd_msgb_alloc
struct msgb * lapd_msgb_alloc(int length, const char *name)
Definition: lapd_core.c:115
MDL_CAUSE_FRM_UNIMPL
#define MDL_CAUSE_FRM_UNIMPL
Definition: lapd_core.h:44
update_pending_frames
static int update_pending_frames(struct lapd_msg_ctx *lctx)
Definition: lapdm.c:648
MDL_CAUSE_T200_EXPIRED
#define MDL_CAUSE_T200_EXPIRED
Definition: lapd_core.h:33
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
INIT_LLIST_HEAD
#define INIT_LLIST_HEAD(ptr)
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::len
uint16_t len
sub_mod
static uint8_t sub_mod(uint8_t x, uint8_t y, uint8_t m)
Definition: lapd_core.c:138
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:771
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:890
rsl_msg_name
const char * rsl_msg_name(uint8_t err)
Get human-readable string for RSL Message Type.
Definition: rsl.c:404
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:158
l2downstate::name
const char * name
Definition: lapd_core.c:2142
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:2123
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:858
lapdm_channel
the two lapdm_entities that form a GSM logical channel (ACCH + DCCH)
Definition: lapdm.h:72
DL_SAPI0
@ DL_SAPI0
SAPI 0.
Definition: lapdm.h:39
LOGDL
#define LOGDL(dl, level, fmt, args...)
Definition: lapd_core.h:17
osmo_dlsap_prim
primitive header for LAPD DL-SAP primitives
Definition: lapd_core.h:60
osmo_dlsap_prim::rel_req
struct dl_rel_req_param rel_req
Definition: lapd_core.h:64
ph_data_param::link_id
uint8_t link_id
Link Identifier (Like RSL)
Definition: l1sap.h:76
lapd_send_resend
static int lapd_send_resend(struct lapd_datalink *dl)
Definition: lapd_core.c:540
RLL_CAUSE_FRM_UNIMPL
#define RLL_CAUSE_FRM_UNIMPL
Definition: gsm_08_58.h:573
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:258
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:454
os_free
#define os_free(x)
Definition: common.h:19
LAPDm_CTRL_S_BITS
#define LAPDm_CTRL_S_BITS(ctrl)
Definition: lapdm.c:73
LAPDM_ENT_F_EMPTY_FRAME
#define LAPDM_ENT_F_EMPTY_FRAME
Definition: lapdm.h:46
gsm_time::t3
uint8_t t3
Definition: gsm_utils.h:44
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:229
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
MDL_CAUSE_SFRM_INC_PARAM
#define MDL_CAUSE_SFRM_INC_PARAM
Definition: lapd_core.h:41
os_malloc
#define os_malloc(x)
Definition: common.h:18
msgb_l3len
static unsigned int msgb_l3len(const struct msgb *msgb)
osmo_phsap_prim::u
union osmo_phsap_prim::@22 u
request-specific data
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:547
rcons
const u8 rcons[]
Definition: aes-internal.c:779
N201_AB_SACCH
#define N201_AB_SACCH
Definition: lapdm.c:85
dl_rel_req_param::mode
uint8_t mode
release mode
Definition: lapd_core.h:56
N200_TR_FACCH_FR
#define N200_TR_FACCH_FR
Definition: lapdm.c:99
RSL_MT_RECON_REQ
@ RSL_MT_RECON_REQ
Definition: gsm_08_58.h:182
lapd_cr_ent::cmd
uint8_t cmd
Definition: lapd_core.h:116
LAPD_U_SABM
#define LAPD_U_SABM
Definition: lapd_core.c:85
lapd_ph_data_ind
int lapd_ph_data_ind(struct msgb *msg, struct lapd_msg_ctx *lctx)
Definition: lapd_core.c:1696
lapd_dl_init2
void lapd_dl_init2(struct lapd_datalink *dl, uint8_t k, uint8_t v_range, int maxf, const char *name)
Initialize LAPD datalink instance and allocate history.
Definition: lapd_core.c:261
LAPD_STATE_TEI_UNASS
@ LAPD_STATE_TEI_UNASS
Definition: lapd_core.h:77
LAPD_STATE_NULL
@ LAPD_STATE_NULL
Definition: lapd_core.h:76
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:206
aes.h
Te3
const u32 Te3[256]
PRIM_MDL_ERROR
@ PRIM_MDL_ERROR
MDL-ERROR.
Definition: lapd_core.h:29
lapdm_pad_msgb
static void lapdm_pad_msgb(struct msgb *msg, uint8_t n201)
Definition: lapdm.c:324
Te4
const u32 Te4[256]
abis_rsl_cchan_hdr::data
uint8_t data[0]
message payload data
Definition: gsm_08_58.h:116
LAPD_S_REJ
#define LAPD_S_REJ
Definition: lapd_core.c:95
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
LAPD_U_DISC
#define LAPD_U_DISC
Definition: lapd_core.c:89
PRIM_PH_CONN
@ PRIM_PH_CONN
PH-CONNECT.
Definition: l1sap.h:11
CR_USER2NET_RESP
#define CR_USER2NET_RESP
Definition: lapd_core.c:98
lapd_est_req
static int lapd_est_req(struct osmo_dlsap_prim *dp, struct lapd_msg_ctx *lctx)
Definition: lapd_core.c:1742
LAPDm_ADDR_SAPI
#define LAPDm_ADDR_SAPI(addr)
Definition: lapdm.c:57
LAPD_U_FRMR
#define LAPD_U_FRMR
Definition: lapd_core.c:91
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:41
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:61
osmo_phsap_prim::data
struct ph_data_param data
Definition: l1sap.h:161
lapd_msg_ctx::p_f
uint8_t p_f
Definition: lapd_core.h:106
MDL_CAUSE_UNSOL_DM_RESP_MF
#define MDL_CAUSE_UNSOL_DM_RESP_MF
Definition: lapd_core.h:37
msgb_pull_to_l3
static unsigned char * msgb_pull_to_l3(struct msgb *msg)
gsm_time::t1
uint16_t t1
Definition: gsm_utils.h:42
osmo_timer_schedule
void osmo_timer_schedule(struct osmo_timer_list *timer, int seconds, int microseconds)
lapd_history
Definition: lapd_core.h:120
gsm_utils.h
lapd_rx_u_sabm
static int lapd_rx_u_sabm(struct msgb *msg, struct lapd_msg_ctx *lctx)
Definition: lapd_core.c:814
LAPD_S_RNR
#define LAPD_S_RNR
Definition: lapd_core.c:94
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:54
lapdm_msg_ctx::link_id
uint8_t link_id
Definition: lapdm.h:24
lapd_rx_u_dm
static int lapd_rx_u_dm(struct msgb *msg, struct lapd_msg_ctx *lctx)
Definition: lapd_core.c:961
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:568
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:64
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:58
MDL_CAUSE_UNSOL_SPRV_RESP
#define MDL_CAUSE_UNSOL_SPRV_RESP
Definition: lapd_core.h:38
lapd_msg_ctx::n201
int n201
Definition: lapd_core.h:98
lapd_send_dm
static int lapd_send_dm(struct lapd_msg_ctx *lctx)
Definition: lapd_core.c:453
N200_TR_SDCCH
#define N200_TR_SDCCH
Definition: lapdm.c:98
lapdm_entity
a LAPDm Entity
Definition: lapdm.h:50
CR_NET2USER_CMD
#define CR_NET2USER_CMD
Definition: lapd_core.c:99
lapd_dl_set_name
void lapd_dl_set_name(struct lapd_datalink *dl, const char *name)
Definition: lapd_core.c:328
LAPD_STATE_EST_TEI_WAIT
@ LAPD_STATE_EST_TEI_WAIT
Definition: lapd_core.h:79
PRIM_DL_RECON
@ PRIM_DL_RECON
DL-RECONNECT.
Definition: lapd_core.h:28
MDL_CAUSE_IFRM_INC_LEN
#define MDL_CAUSE_IFRM_INC_LEN
Definition: lapd_core.h:43
LAPD_U_SABME
#define LAPD_U_SABME
Definition: lapd_core.c:86
gsm_04_08.h
LAPDm_MORE
#define LAPDm_MORE
Definition: lapdm.c:79
PRIM_TCH
@ PRIM_TCH
TCH.
Definition: l1sap.h:15
LAPDm_FMT_B
@ LAPDm_FMT_B
Definition: lapdm.c:107
lapd_history::msg
struct msgb * msg
Definition: lapd_core.h:121
talloc.h
LAPD_FORM_U
@ LAPD_FORM_U
Definition: lapd_core.h:92
N200_EST_REL
#define N200_EST_REL
Definition: lapdm.c:95
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:311
h
struct gad_raw_head h
type = GAD_TYPE_ELL_POINT
Definition: gsm_23_032.h:2
lapd_rx_u
static int lapd_rx_u(struct msgb *msg, struct lapd_msg_ctx *lctx)
Definition: lapd_core.c:1269
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:546
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:92
RSL_MT_UNIT_DATA_REQ
@ RSL_MT_UNIT_DATA_REQ
Definition: gsm_08_58.h:177
lapd_start_t200
static void lapd_start_t200(struct lapd_datalink *dl)
Definition: lapd_core.c:199
GSM_LCHAN_SDCCH
@ GSM_LCHAN_SDCCH
Definition: gsm_utils.h:228
rslms_rx_rll_susp_req
static int rslms_rx_rll_susp_req(struct msgb *msg, struct lapdm_datalink *dl)
Definition: lapdm.c:1118
inc_mod
static uint8_t inc_mod(uint8_t x, uint8_t m)
Definition: lapd_core.c:128
common.h
TE414
#define TE414(i)
Definition: aes_i.h:90
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:113
msgb_trim
static int msgb_trim(struct msgb *msg, int len)
lapd_dl_init
void lapd_dl_init(struct lapd_datalink *dl, uint8_t k, uint8_t v_range, int maxf) OSMO_DEPRECATED("Use lapd_dl_init2() instead")
Initialize LAPD datalink instance and allocate history.
Definition: lapd_core.c:323
LAPDm_LPD_NORMAL
#define LAPDm_LPD_NORMAL
Definition: lapdm.c:50
LAPDm_CTRL_I_Ns
#define LAPDm_CTRL_I_Ns(ctrl)
Definition: lapdm.c:75
lapd_reestablish
static int lapd_reestablish(struct lapd_datalink *dl)
Definition: lapd_core.c:572
msgb_l2len
static unsigned int msgb_l2len(const struct msgb *msgb)
mdl_error
static int mdl_error(uint8_t cause, struct lapd_msg_ctx *lctx)
Definition: lapd_core.c:415
tall_lapd_ctx
void * tall_lapd_ctx
Definition: lapd_core.c:253
lapd_rx_u_ui
static int lapd_rx_u_ui(struct msgb *msg, struct lapd_msg_ctx *lctx)
Definition: lapd_core.c:1043
osmo_timer_setup
void osmo_timer_setup(struct osmo_timer_list *timer, void(*cb)(void *data), void *data)
ph_rach_req_param::tx_power
uint8_t tx_power
Transmit Power.
Definition: l1sap.h:46
ALL_STATES
#define ALL_STATES
Definition: lapd_core.c:106
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:289
OSMO_VALUE_STRING
#define OSMO_VALUE_STRING(x)
lapd_msg_ctx::cr
uint8_t cr
Definition: lapd_core.h:100
timer.h
lapd_stop_t203
static void lapd_stop_t203(struct lapd_datalink *dl)
Definition: lapd_core.c:224
lapd_dl_flush_hist
static void lapd_dl_flush_hist(struct lapd_datalink *dl)
Definition: lapd_core.c:156
lapd_send_ua
static int lapd_send_ua(struct lapd_msg_ctx *lctx, uint8_t len, uint8_t *data)
Definition: lapd_core.c:429
LAPD_FORM_I
@ LAPD_FORM_I
Definition: lapd_core.h:90
tx_dequeue_acch_msgb
static struct msgb * tx_dequeue_acch_msgb(struct lapdm_entity *le)
Definition: lapdm.c:393
N200_TR_SACCH
#define N200_TR_SACCH
Definition: lapdm.c:97
lapd_dl_flush_tx
static void lapd_dl_flush_tx(struct lapd_datalink *dl)
Definition: lapd_core.c:171
TE43
#define TE43(i)
Definition: aes_i.h:85
PRIM_DL_RES
@ PRIM_DL_RES
DL-RESUME.
Definition: lapd_core.h:27
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
Definition: lapd_core.h:108
DL_SAPI3
@ DL_SAPI3
SAPI 1.
Definition: lapdm.h:40
CR_USER2NET_CMD
#define CR_USER2NET_CMD
Definition: lapd_core.c:97
lapd_send_rr
static int lapd_send_rr(struct lapd_msg_ctx *lctx, uint8_t f_bit, uint8_t cmd)
Definition: lapd_core.c:474
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
lapd_t200_cb
static void lapd_t200_cb(void *data)
Definition: lapd_core.c:586
LAPDm_FMT_A
@ LAPDm_FMT_A
Definition: lapdm.c:106
l2downstate::op
int op
Definition: lapd_core.c:2141
llist_add
static void llist_add(struct llist_head *_new, struct llist_head *head)
abis_rsl_common_hdr::msg_type
uint8_t msg_type
message type (abis_rsl_msgtype)
Definition: gsm_08_58.h:77
MDL_CAUSE_FRMR
#define MDL_CAUSE_FRMR
Definition: lapd_core.h:47
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:244
value_string
LAPD_STATE_DISC_SENT
@ LAPD_STATE_DISC_SENT
Definition: lapd_core.h:82
LAPDm_CTRL_Nr
#define LAPDm_CTRL_Nr(ctrl)
Definition: lapdm.c:76
lapdm_entity::l3_cb
lapdm_cb_t l3_cb
callback for sending stuff to L3
Definition: lapdm.h:62
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:499
lapd_mode
lapd_mode
LAPD mode/role.
Definition: lapd_core.h:69
lapdm_msg_ctx::chan_nr
uint8_t chan_nr
Definition: lapdm.h:23
lapd_udata_req
static int lapd_udata_req(struct osmo_dlsap_prim *dp, struct lapd_msg_ctx *lctx)
Definition: lapd_core.c:1721
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:80
lapdm_entity::datalink
struct lapdm_datalink datalink[_NR_DL_SAPI]
the SAPIs of the LAPDm entity
Definition: lapdm.h:52
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:62
lapd_state_name
static const char * lapd_state_name(enum lapd_state state)
Definition: lapd_core.c:194
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
LAPD message context.
Definition: lapd_core.h:96
RCON
#define RCON(i)
Definition: aes_i.h:72
rsl_is_transparent
static int rsl_is_transparent(uint8_t msg_type)
Definition: lapdm.c:484
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)
OSMO_PRIM
#define OSMO_PRIM(prim, op)
RSL_CHAN_RACH
#define RSL_CHAN_RACH
Definition: gsm_08_58.h:462
RSL_IE_TIMING_ADVANCE
@ RSL_IE_TIMING_ADVANCE
Definition: gsm_08_58.h:320
lapd_msg_ctx::lpd
uint8_t lpd
Definition: lapd_core.h:103
lapd_rel_req
static int lapd_rel_req(struct osmo_dlsap_prim *dp, struct lapd_msg_ctx *lctx)
Definition: lapd_core.c:2062
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
osmo_timer_pending
int osmo_timer_pending(const struct osmo_timer_list *timer)
osmo_timer_del
void osmo_timer_del(struct osmo_timer_list *timer)
l2downstate::prim
int prim
Definition: lapd_core.c:2141
LAPD_FORM_S
@ LAPD_FORM_S
Definition: lapd_core.h:91
msgb_l3
#define msgb_l3(m)
lapd_msg_ctx::dl
struct lapd_datalink * dl
Definition: lapd_core.h:97
send_rll_simple
static int send_rll_simple(uint8_t msg_type, struct lapdm_msg_ctx *mctx)
Definition: lapdm.c:531
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:176
LAPDm_CTRL_U_BITS
#define LAPDm_CTRL_U_BITS(ctrl)
Definition: lapdm.c:70
RSL_MT_EST_CONF
@ RSL_MT_EST_CONF
Definition: gsm_08_58.h:172
lapd_acknowledge
static void lapd_acknowledge(struct lapd_msg_ctx *lctx)
Definition: lapd_core.c:741
MDL_CAUSE_UNSOL_UA_RESP
#define MDL_CAUSE_UNSOL_UA_RESP
Definition: lapd_core.h:35
lapdm_channel::lapdm_acch
struct lapdm_entity lapdm_acch
Associated Control Channel.
Definition: lapdm.h:75
send_dl_simple
static int send_dl_simple(uint8_t prim, uint8_t op, struct lapd_msg_ctx *lctx)
Definition: lapd_core.c:408
send_dl_l3
static int send_dl_l3(uint8_t prim, uint8_t op, struct lapd_msg_ctx *lctx, struct msgb *msg)
Definition: lapd_core.c:397
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:74
lapd_susp_req
static int lapd_susp_req(struct osmo_dlsap_prim *dp, struct lapd_msg_ctx *lctx)
Definition: lapd_core.c:1967
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)
lapd_state_names
const struct value_string lapd_state_names[]
Definition: lapd_core.c:181
MDL_CAUSE_SEQ_ERR
#define MDL_CAUSE_SEQ_ERR
Definition: lapd_core.h:39
RSL_MT_RES_REQ
@ RSL_MT_RES_REQ
Definition: gsm_08_58.h:181
gsm_time::t2
uint8_t t2
Definition: gsm_utils.h:43
l2downstate::rout
int(* rout)(struct osmo_dlsap_prim *dp, struct lapd_msg_ctx *lctx)
Definition: lapd_core.c:2143
tx_dequeue_dcch_msgb
static struct msgb * tx_dequeue_dcch_msgb(struct lapdm_entity *le)
Definition: lapdm.c:380
lapd_rel_req_idle
static int lapd_rel_req_idle(struct osmo_dlsap_prim *dp, struct lapd_msg_ctx *lctx)
Definition: lapd_core.c:2126
LAPD_U_UA
#define LAPD_U_UA
Definition: lapd_core.c:90
msgb_l2
#define msgb_l2(m)
lapd_send_rej
static int lapd_send_rej(struct lapd_msg_ctx *lctx, uint8_t f_bit)
Definition: lapd_core.c:518
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...)
do_mod
static uint8_t do_mod(uint8_t x, uint8_t m)
Definition: lapd_core.c:123
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:78
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:228
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:525
rslms_rx_rll_est_req
static int rslms_rx_rll_est_req(struct msgb *msg, struct lapdm_datalink *dl)
Definition: lapdm.c:969
lapdm_send_ph_data_req
static int lapdm_send_ph_data_req(struct lapd_msg_ctx *lctx, struct msgb *msg)
Definition: lapdm.c:603
tlv.h
Td4
const u32 Td4[256]
CR_NET2USER_RESP
#define CR_NET2USER_RESP
Definition: lapd_core.c:100
LAPDm_ADDR_EA
#define LAPDm_ADDR_EA(addr)
Definition: lapdm.c:59
osmo_dlsap_prim::u
union osmo_dlsap_prim::@23 u
request-specific data
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:768
gsm_08_58.h
logging.h
lapdm_entity::ta
uint8_t ta
Definition: lapdm.h:67
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:189
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
MDL_CAUSE_SABM_INFO_NOTALL
#define MDL_CAUSE_SABM_INFO_NOTALL
Definition: lapd_core.h:46
LAPDm_FMT_Bter
@ LAPDm_FMT_Bter
Definition: lapdm.c:109
lapd_msg_ctx::more
uint8_t more
Definition: lapd_core.h:112
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:553
LAPD_STATE_SABM_SENT
@ LAPD_STATE_SABM_SENT
Definition: lapd_core.h:81
N201_AB_SDCCH
#define N201_AB_SDCCH
Definition: lapdm.c:86
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:71
abis_rsl_cchan_hdr
Definition: gsm_08_58.h:109
RSL_IE_RELEASE_MODE
@ RSL_IE_RELEASE_MODE
Definition: gsm_08_58.h:316
lapd_rx_u_ua
static int lapd_rx_u_ua(struct msgb *msg, struct lapd_msg_ctx *lctx)
Definition: lapd_core.c:1160
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:132
lapd_stop_t200
static void lapd_stop_t200(struct lapd_datalink *dl)
Definition: lapd_core.c:216
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
generic cause value
Definition: lapd_core.h:51
RSL_MT_CHAN_CONF
@ RSL_MT_CHAN_CONF
Definition: gsm_08_58.h:192
lapd_start_t203
static void lapd_start_t203(struct lapd_datalink *dl)
Definition: lapd_core.c:208
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:103
PRIM_DL_DATA
@ PRIM_DL_DATA
DL-DATA.
Definition: lapd_core.h:23
LOGL_DEBUG
#define LOGL_DEBUG
send_rslms_rll_l3_ui
static int send_rslms_rll_l3_ui(struct lapdm_msg_ctx *mctx, struct msgb *msg)
Definition: lapdm.c:512
msgb_enqueue
void msgb_enqueue(struct llist_head *queue, struct msgb *msg)
lapd_dl_flush_send
static void lapd_dl_flush_send(struct lapd_datalink *dl)
Definition: lapd_core.c:143
osmo_prim_hdr::primitive
unsigned int primitive
L2DOWNSLLEN
#define L2DOWNSLLEN
Definition: lapd_core.c:2195
lapd_rx_i
static int lapd_rx_i(struct msgb *msg, struct lapd_msg_ctx *lctx)
Definition: lapd_core.c:1506
LOGL_ERROR
#define LOGL_ERROR
tlv_parsed
result of the TLV parser
Definition: tlv.h:522
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
Definition: lapd_core.h:63
lapdm_entity::lapdm_ch
struct lapdm_channel * lapdm_ch
pointer to lapdm_channel of which we're part
Definition: lapdm.h:65
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
LAPD_STATE_MF_EST
@ LAPD_STATE_MF_EST
Definition: lapd_core.h:83
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
lapd_state
lapd_state
LAPD state (Figure B.2/Q.921)
Definition: lapd_core.h:75
l2downstate::states
uint32_t states
Definition: lapd_core.c:2140
PRIM_OP_CONFIRM
PRIM_OP_CONFIRM
lapd_core.h
LAPD_TAILROOM
#define LAPD_TAILROOM
Definition: lapd_core.c:103
osmo_prim_hdr::sap
unsigned int sap
LAPDm_CTRL_is_I
#define LAPDm_CTRL_is_I(ctrl)
Definition: lapdm.c:66
TLVP_VAL
#define TLVP_VAL(x, y)
Definition: tlv.h:548
add_mod
static uint8_t add_mod(uint8_t x, uint8_t y, uint8_t m)
Definition: lapd_core.c:133
lapdm_msg_ctx::dl
struct lapdm_datalink * dl
Definition: lapdm.h:21
lapd_send_i
static int lapd_send_i(struct lapd_msg_ctx *lctx, int line)
Definition: lapd_core.c:1823
lapdm.h
lapdm_cb_t
int(* lapdm_cb_t)(struct msgb *msg, struct lapdm_entity *le, void *ctx)
Definition: lapdm.h:44
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