libosmogsm
1.7.0.61-0d9b6.202211030053
Osmocom GSM library
|
static const struct l2downstate l2downstatelist[]
@ PRIM_DL_REL
DL-RLEEASE.
Definition: lapd_core.h:25
@ PRIM_DL_EST
DL-ESTABLISH.
Definition: lapd_core.h:24
@ LAPD_STATE_TIMER_RECOV
Definition: lapd_core.h:84
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
uint8_t len
Definition: gsm_04_11.h:2
int(* osmo_prim_cb)(struct osmo_prim_hdr *oph, void *ctx)
static int lapd_rx_s(struct msgb *msg, struct lapd_msg_ctx *lctx)
Definition: lapd_core.c:1295
uint8_t resp
Definition: lapd_core.h:117
@ LAPDm_FMT_B4
Definition: lapdm.c:110
#define MDL_CAUSE_UFRM_INC_PARAM
Definition: lapd_core.h:40
int last_tx_dequeue
last entity that was dequeued
Definition: lapdm.h:53
gsm_chan_t
Definition: gsm_utils.h:226
@ RSL_IE_ACCESS_DELAY
Definition: gsm_08_58.h:313
uint32_t fn
GSM Frame Number at time of RA.
Definition: l1sap.h:64
#define LAPDm_CTRL_is_U(ctrl)
Definition: lapdm.c:68
#define TE42(i)
Definition: aes_i.h:84
Definition: gsm_04_08.h:697
int send_out
how much was sent from send_buffer
Definition: lapd_core.h:159
#define OSMO_PRIM_HDR(oph)
void * tall_lapd_ctx
Definition: lapd_core.c:254
static struct msgb * msgb_alloc_headroom(uint16_t size, uint16_t headroom, const char *name)
@ LAPDm_FMT_Bbis
Definition: lapdm.c:108
#define LAPD_U_UI
Definition: lapd_core.c:89
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
#define LAPD_U_SABM
Definition: lapdm.c:47
uint8_t link_id
Definition: gsm_08_08.h:4
#define rsl_tlv_parse(dec, buf, len)
Parse RSL TLV structure using tlv_parse.
Definition: rsl.h:19
#define TE443(i)
Definition: aes_i.h:89
static void rijndaelEncrypt(const u32 rk[], const u8 pt[16], u8 ct[16])
Definition: aes-internal-enc.c:33
int use_sabme
use SABME instead of SABM
Definition: lapd_core.h:137
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
behave like network
Definition: lapd_core.h:71
#define RLL_CAUSE_SABM_INFO_NOTALL
Definition: gsm_08_58.h:576
static int rslms_rx_rll_udata_req(struct msgb *msg, struct lapdm_datalink *dl)
Definition: lapdm.c:1024
int length
Definition: lapd_core.h:111
@ RSL_MT_REL_CONF
Definition: gsm_08_58.h:175
int more
Definition: lapd_core.h:122
@ PRIM_DL_SUSP
DL-SUSPEND.
Definition: lapd_core.h:26
#define LAPDM_ENT_F_POLLING_ONLY
Definition: lapdm.h:47
#define LAPD_HEADROOM
Definition: lapd_core.c:103
primitive header for PH-SAP primitives
Definition: l1sap.h:158
@ LAPDM_MODE_MS
behave like a MS (mobile phone)
Definition: lapdm.h:13
#define TE421(i)
Definition: aes_i.h:87
enum lapdm_mode mode
are we in BTS mode or MS mode
Definition: lapdm.h:55
void * aes_decrypt_init(const u8 *key, size_t len)
static int rsl_rll_error(uint8_t cause, struct lapdm_msg_ctx *mctx)
Definition: lapdm.c:542
const char * get_value_string(const struct value_string *vs, uint32_t val)
struct abis_rsl_common_hdr c
Definition: gsm_08_58.h:110
uint8_t tx_power
Definition: lapdm.h:68
uint8_t ra
Random Access.
Definition: l1sap.h:44
@ RSL_MT_SUSP_CONF
Definition: gsm_08_58.h:180
uint8_t cause
Definition: gsm_04_08.h:768
@ PRIM_PH_RACH
PH-RANDOM_ACCESS.
Definition: l1sap.h:10
#define LAPDm_CTRL_S(nr, s, p)
Definition: lapdm.c:63
struct osmo_prim_hdr oph
generic primitive header
Definition: l1sap.h:159
struct lapdm_entity lapdm_dcch
Dedicated Control Channel.
Definition: lapdm.h:76
#define LAPDm_U_UI
Definition: lapdm.c:82
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
#define MDL_CAUSE_UNSOL_DM_RESP
Definition: lapd_core.h:36
int lapdm_fmt
Definition: lapdm.h:22
Definition: lapd_core.c:2139
static int lapd_res_req(struct osmo_dlsap_prim *dp, struct lapd_msg_ctx *lctx)
Definition: lapd_core.c:1994
const u32 Te0[256]
Definition: aes-internal.c:74
@ RSL_MT_REL_REQ
Definition: gsm_08_58.h:174
lapdm_format
Definition: lapdm.c:105
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
uint8_t n_send
Definition: lapd_core.h:107
void lapdm_channel_reset(struct lapdm_channel *lc)
Reset a LAPDm channel with all its entities.
Definition: lapdm.c:1487
enum lapd_mode mode
current mode of link
Definition: lapd_core.h:136
static int lapd_rx_u_frmr(struct msgb *msg, struct lapd_msg_ctx *lctx)
Definition: lapd_core.c:1253
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
Definition: lapd_core.h:80
struct lapd_cr_ent rem2loc
Definition: lapd_core.h:134
static int lapdm_rx_not_permitted(const struct lapdm_entity *le, const struct lapd_msg_ctx *lctx)
Definition: lapdm.c:668
static unsigned char * msgb_put(struct msgb *msgb, unsigned int len)
static void osmo_prim_init(struct osmo_prim_hdr *oph, unsigned int sap, unsigned int primitive, enum osmo_prim_operation operation, struct msgb *msg)
static int lapd_data_req(struct osmo_dlsap_prim *dp, struct lapd_msg_ctx *lctx)
Definition: lapd_core.c:1800
int n200
Definition: lapd_core.h:139
uint8_t sapi
Definition: lapd_core.h:101
uint32_t u32
Definition: common.h:25
#define MDL_CAUSE_IFRM_INC_MBITS
Definition: lapd_core.h:42
struct osmo_timer_list t200
T200 timer.
Definition: lapd_core.h:153
int lapd_recv_dlsap(struct osmo_dlsap_prim *dp, struct lapd_msg_ctx *lctx)
Definition: lapd_core.c:2198
#define MDL_CAUSE_SABM_MF
Definition: lapd_core.h:45
#define PUTU32(ct, st)
Definition: aes_i.h:115
static void lapd_t203_cb(void *data)
Definition: lapd_core.c:712
Definition: gsm_utils.h:40
@ RSL_MT_SUSP_REQ
Definition: gsm_08_58.h:179
#define SBIT(a)
Definition: lapd_core.c:106
static int rslms_sendmsg(struct msgb *msg, struct lapdm_entity *le)
Definition: lapdm.c:340
int seq_err_cond
condition of sequence error
Definition: lapd_core.h:148
uint8_t ta_ind
Definition: lapdm.h:25
void lapd_dl_exit(struct lapd_datalink *dl)
Definition: lapd_core.c:358
@ RSL_MT_DATA_IND
Definition: gsm_08_58.h:169
@ LAPD_MODE_USER
behave like user
Definition: lapd_core.h:70
@ LAPD_FORM_UKN
Definition: lapd_core.h:89
#define LAPDm_CTRL_is_S(ctrl)
Definition: lapdm.c:67
uint8_t tx_power_ind
Definition: lapdm.h:26
uint8_t format
Definition: lapd_core.h:105
uint8_t s_u
Definition: lapd_core.h:109
void lapdm_channel_exit(struct lapdm_channel *lc)
Definition: lapdm.c:305
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
static int lapd_rx_u_disc(struct msgb *msg, struct lapd_msg_ctx *lctx)
Definition: lapd_core.c:1082
struct llist_head tx_queue
frames to L1
Definition: lapd_core.h:156
@ RSL_IE_REQ_REFERENCE
Definition: gsm_08_58.h:315
struct lapdm_msg_ctx mctx
context of established connection
Definition: lapdm.h:32
uint8_t acc_delay
Delay in bit periods.
Definition: l1sap.h:63
struct lapd_cr_ent loc2rem
filled-in once we set the lapd_mode above
Definition: lapd_core.h:133
@ LAPD_STATE_ASS_TEI_WAIT
Definition: lapd_core.h:78
#define TLVP_LEN(x, y)
Definition: tlv.h:547
void * l3_ctx
context for layer3 instance
Definition: lapdm.h:59
#define N201_Bbis
Definition: lapdm.c:88
uint8_t msg[0]
Definition: gsm_08_08.h:529
@ PRIM_DL_UNIT_DATA
DL-UNIT-DATA.
Definition: lapd_core.h:22
struct lapd_datalink::@24 cr
int lapd_set_mode(struct lapd_datalink *dl, enum lapd_mode mode)
Set the lapdm_mode of a LAPDm entity.
Definition: lapd_core.c:374
void gsm_fn2gsmtime(struct gsm_time *time, uint32_t fn)
Parse GSM Frame Number into struct gsm_time.
Definition: gsm_utils.c:865
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
static void lapd_dl_newstate(struct lapd_datalink *dl, uint32_t state)
Definition: lapd_core.c:233
static int lapd_send_rnr(struct lapd_msg_ctx *lctx, uint8_t f_bit, uint8_t cmd)
Definition: lapd_core.c:497
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
struct osmo_prim_hdr oph
generic primitive header
Definition: lapd_core.h:61
#define N200_TR_FACCH_HR
Definition: lapdm.c:101
void lapd_dl_reset(struct lapd_datalink *dl)
Definition: lapd_core.c:337
static void osmo_talloc_replace_string(void *ctx, char **dst, const char *newstr)
unsigned int flags
Definition: lapdm.h:56
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
static int rslms_rx_rll(struct msgb *msg, struct lapdm_channel *lc)
Definition: lapdm.c:1265
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
#define LAPD_S_RR
Definition: lapd_core.c:94
#define LAPD_U_DM
Definition: lapd_core.c:88
@ GSM_LCHAN_TCH_H
Definition: gsm_utils.h:230
struct msgb * lapd_msgb_alloc(int length, const char *name)
Definition: lapd_core.c:116
#define MDL_CAUSE_FRM_UNIMPL
Definition: lapd_core.h:44
static int update_pending_frames(struct lapd_msg_ctx *lctx)
Definition: lapdm.c:648
#define MDL_CAUSE_T200_EXPIRED
Definition: lapd_core.h:33
int maxf
maximum frame size (after defragmentation)
Definition: lapd_core.h:141
@ RSL_MT_REL_IND
Definition: gsm_08_58.h:176
int lapdm_rslms_recvmsg(struct msgb *msg, struct lapdm_channel *lc)
Receive a RSLms Message buffers from Layer 3.
Definition: lapdm.c:1390
#define INIT_LLIST_HEAD(ptr)
const u8 Td4s[256]
Definition: aes-internal.c:745
@ PRIM_MPH_INFO
MPH-INFO.
Definition: l1sap.h:14
uint16_t ra
Random Access.
Definition: l1sap.h:62
#define container_of(ptr, type, member)
struct osmo_timer_list t203
T203 timer.
Definition: lapd_core.h:154
static uint8_t sub_mod(uint8_t x, uint8_t y, uint8_t m)
Definition: lapd_core.c:139
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
struct gsm48_req_ref req_ref
Definition: gsm_04_08.h:771
@ PRIM_PH_RTS
PH-RTS.
Definition: l1sap.h:13
int lapdm_phsap_up(struct osmo_prim_hdr *oph, struct lapdm_entity *le)
Receive a PH-SAP primitive from L1.
Definition: lapdm.c:890
const char * rsl_msg_name(uint8_t err)
Get human-readable string for RSL Message Type.
Definition: rsl.c:405
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
const char * name
Definition: lapd_core.c:2142
uint8_t length
Definition: gsm_08_08.h:3
RSL common header.
Definition: gsm_08_58.h:75
#define GSM_MACBLOCK_PADDING
Definition: gsm_04_08.h:2123
int(* send_dlsap)(struct osmo_dlsap_prim *dp, struct lapd_msg_ctx *lctx)
Definition: lapd_core.h:127
static int rslms_rx_rll_data_req(struct msgb *msg, struct lapdm_datalink *dl)
Definition: lapdm.c:1090
static int l2_ph_chan_conf(struct msgb *msg, struct lapdm_entity *le, uint32_t frame_nr)
Definition: lapdm.c:1241
#define GETU32(pt)
Definition: aes_i.h:113
static int l2_ph_rach_ind(struct lapdm_entity *le, uint8_t ra, uint32_t fn, uint8_t acc_delay)
Definition: lapdm.c:858
the two lapdm_entities that form a GSM logical channel (ACCH + DCCH)
Definition: lapdm.h:72
@ DL_SAPI0
SAPI 0.
Definition: lapdm.h:39
#define LOGDL(dl, level, fmt, args...)
Definition: lapd_core.h:17
primitive header for LAPD DL-SAP primitives
Definition: lapd_core.h:60
struct dl_rel_req_param rel_req
Definition: lapd_core.h:64
uint8_t link_id
Link Identifier (Like RSL)
Definition: l1sap.h:76
static int lapd_send_resend(struct lapd_datalink *dl)
Definition: lapd_core.c:541
#define RLL_CAUSE_FRM_UNIMPL
Definition: gsm_08_58.h:574
enum osmo_prim_operation operation
static int rslms_rx_com_chan(struct msgb *msg, struct lapdm_channel *lc)
Definition: lapdm.c:1362
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
uint8_t range_hist
range of history buffer 2..2^n
Definition: lapd_core.h:161
uint8_t own_busy
receiver busy on our side
Definition: lapd_core.h:149
static int l2_ph_data_conf(struct msgb *msg, struct lapdm_entity *le)
Definition: lapdm.c:454
#define os_free(x)
Definition: common.h:19
#define LAPDm_CTRL_S_BITS(ctrl)
Definition: lapdm.c:73
#define LAPDM_ENT_F_EMPTY_FRAME
Definition: lapdm.h:46
uint8_t t3
Definition: gsm_utils.h:44
static unsigned char * msgb_push(struct msgb *msgb, unsigned int len)
uint32_t state
LAPD state (lapd_state)
Definition: lapd_core.h:147
void aes_decrypt(void *ctx, const u8 *crypt, u8 *plain)
struct msgb * cont_res
buffer to store content resolution data on network side, to detect multiple phones on same channel
Definition: lapd_core.h:163
@ GSM_LCHAN_TCH_F
Definition: gsm_utils.h:229
uint8_t mode
Definition: gsm_04_08.h:690
Definition: gsm_08_58.h:82
@ PRIM_PH_EMPTY_FRAME
PH-EMPTY_FRAME.
Definition: l1sap.h:12
void rijndaelKeySetupEnc(u32 rk[], const u8 cipherKey[])
Expand the cipher key into the encryption key schedule.
Definition: aes-internal.c:789
uint8_t ta
Timing Advance.
Definition: l1sap.h:45
#define MDL_CAUSE_SFRM_INC_PARAM
Definition: lapd_core.h:41
#define os_malloc(x)
Definition: common.h:18
static unsigned int msgb_l3len(const struct msgb *msgb)
union osmo_phsap_prim::@22 u
request-specific data
static int rslms_rx_chan_rqd(struct lapdm_channel *lc, struct msgb *msg)
Definition: lapdm.c:1201
int t203_usec
retry timer (default 10 secs)
Definition: lapd_core.h:152
@ LAPDM_MODE_BTS
behave like a BTS (network)
Definition: lapdm.h:14
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
LAPD datalink.
Definition: lapd_core.h:126
const u8 rcons[]
Definition: aes-internal.c:779
#define N201_AB_SACCH
Definition: lapdm.c:85
uint8_t mode
release mode
Definition: lapd_core.h:56
#define N200_TR_FACCH_FR
Definition: lapdm.c:99
@ RSL_MT_RECON_REQ
Definition: gsm_08_58.h:182
uint8_t cmd
Definition: lapd_core.h:116
#define LAPD_U_SABM
Definition: lapd_core.c:86
int lapd_ph_data_ind(struct msgb *msg, struct lapd_msg_ctx *lctx)
Definition: lapd_core.c:1696
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:262
@ LAPD_STATE_TEI_UNASS
Definition: lapd_core.h:77
@ LAPD_STATE_NULL
Definition: lapd_core.h:76
void msgb_free(struct msgb *m)
static int get_n200_dcch(enum gsm_chan_t chan_t)
Definition: lapdm.c:206
@ PRIM_MDL_ERROR
MDL-ERROR.
Definition: lapd_core.h:29
static void lapdm_pad_msgb(struct msgb *msg, uint8_t n201)
Definition: lapdm.c:324
uint8_t data[0]
message payload data
Definition: gsm_08_58.h:116
#define LAPD_S_REJ
Definition: lapd_core.c:96
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
#define LAPD_U_DISC
Definition: lapd_core.c:90
@ PRIM_PH_CONN
PH-CONNECT.
Definition: l1sap.h:11
uint8_t peer_busy
receiver busy on remote side
Definition: lapd_core.h:150
#define CR_USER2NET_RESP
Definition: lapd_core.c:99
static int lapd_est_req(struct osmo_dlsap_prim *dp, struct lapd_msg_ctx *lctx)
Definition: lapd_core.c:1742
#define LAPDm_ADDR_SAPI(addr)
Definition: lapdm.c:57
#define LAPD_U_FRMR
Definition: lapd_core.c:92
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
Definition: lapdm.h:41
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
osmo_prim_cb l1_prim_cb
callback for sending prims to L1
Definition: lapdm.h:61
struct ph_data_param data
Definition: l1sap.h:161
uint8_t p_f
Definition: lapd_core.h:106
#define MDL_CAUSE_UNSOL_DM_RESP_MF
Definition: lapd_core.h:37
static unsigned char * msgb_pull_to_l3(struct msgb *msg)
uint16_t t1
Definition: gsm_utils.h:42
int n200_est_rel
number of retranmissions
Definition: lapd_core.h:139
void osmo_timer_schedule(struct osmo_timer_list *timer, int seconds, int microseconds)
Definition: lapd_core.h:120
static int lapd_rx_u_sabm(struct msgb *msg, struct lapd_msg_ctx *lctx)
Definition: lapd_core.c:814
#define LAPD_S_RNR
Definition: lapd_core.c:95
int(* send_ph_data_req)(struct lapd_msg_ctx *lctx, struct msgb *msg)
Definition: lapd_core.h:129
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
int tx_pending
currently a pending frame not confirmed by L1
Definition: lapdm.h:54
uint8_t link_id
Definition: lapdm.h:24
static int lapd_rx_u_dm(struct msgb *msg, struct lapd_msg_ctx *lctx)
Definition: lapd_core.c:961
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
Definition: gsm_08_58.h:168
@ RSL_IE_RLM_CAUSE
Definition: gsm_08_58.h:318
#define LAPDm_CTRL_U(u, p)
Definition: lapdm.c:64
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
#define ABIS_RSL_MDISC_RLL
Definition: gsm_08_58.h:149
void * l1_ctx
context for layer1 instance
Definition: lapdm.h:58
#define MDL_CAUSE_UNSOL_SPRV_RESP
Definition: lapd_core.h:38
int n201
Definition: lapd_core.h:98
static int lapd_send_dm(struct lapd_msg_ctx *lctx)
Definition: lapd_core.c:454
#define N200_TR_SDCCH
Definition: lapdm.c:98
int t203_sec
Definition: lapd_core.h:152
a LAPDm Entity
Definition: lapdm.h:50
#define CR_NET2USER_CMD
Definition: lapd_core.c:100
void lapd_dl_set_name(struct lapd_datalink *dl, const char *name)
Definition: lapd_core.c:329
@ LAPD_STATE_EST_TEI_WAIT
Definition: lapd_core.h:79
uint8_t k
maximum number of unacknowledged frames
Definition: lapd_core.h:142
@ PRIM_DL_RECON
DL-RECONNECT.
Definition: lapd_core.h:28
#define MDL_CAUSE_IFRM_INC_LEN
Definition: lapd_core.h:43
#define LAPD_U_SABME
Definition: lapd_core.c:87
#define LAPDm_MORE
Definition: lapdm.c:79
uint8_t v_recv
seq nr of next I frame expected to be received
Definition: lapd_core.h:146
@ PRIM_TCH
TCH.
Definition: l1sap.h:15
@ LAPDm_FMT_B
Definition: lapdm.c:107
struct msgb * msg
Definition: lapd_core.h:121
LAPDm datalink like TS 04.06 / Section 3.5.2.
Definition: lapdm.h:30
@ LAPD_FORM_U
Definition: lapd_core.h:92
#define N200_EST_REL
Definition: lapdm.c:95
struct lapd_msg_ctx lctx
LAPD context.
Definition: lapd_core.h:140
struct lapdm_datalink * lapdm_datalink_for_sapi(struct lapdm_entity *le, uint8_t sapi)
Definition: lapdm.c:311
struct gad_raw_head h
type = GAD_TYPE_ELL_POINT
Definition: gsm_23_032.h:2
static int lapd_rx_u(struct msgb *msg, struct lapd_msg_ctx *lctx)
Definition: lapd_core.c:1269
uint16_t offset
Timing Offset.
Definition: l1sap.h:48
uint8_t u8
Definition: common.h:27
#define TLVP_PRESENT(x, y)
Definition: tlv.h:546
uint8_t chan_nr
Channel Number (Like RSL)
Definition: l1sap.h:77
#define N201_B4
Definition: lapdm.c:92
@ RSL_MT_UNIT_DATA_REQ
Definition: gsm_08_58.h:177
static void lapd_start_t200(struct lapd_datalink *dl)
Definition: lapd_core.c:200
@ GSM_LCHAN_SDCCH
Definition: gsm_utils.h:228
struct msgb * send_buffer
current frame transmitting
Definition: lapd_core.h:158
static int rslms_rx_rll_susp_req(struct msgb *msg, struct lapdm_datalink *dl)
Definition: lapdm.c:1118
static uint8_t inc_mod(uint8_t x, uint8_t m)
Definition: lapd_core.c:129
#define TE414(i)
Definition: aes_i.h:90
@ PRIM_TCH_RTS
TCH.
Definition: l1sap.h:16
uint8_t chan_nr
Definition: gsm_08_58.h:86
const struct value_string osmo_ph_prim_names[]
Definition: lapdm.c:113
static int msgb_trim(struct msgb *msg, int len)
int(* update_pending_frames)(struct lapd_msg_ctx *lctx)
Definition: lapd_core.h:130
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:324
#define LAPDm_LPD_NORMAL
Definition: lapdm.c:50
#define LAPDm_CTRL_I_Ns(ctrl)
Definition: lapdm.c:75
static int lapd_reestablish(struct lapd_datalink *dl)
Definition: lapd_core.c:573
static unsigned int msgb_l2len(const struct msgb *msgb)
static int mdl_error(uint8_t cause, struct lapd_msg_ctx *lctx)
Definition: lapd_core.c:416
void * tall_lapd_ctx
Definition: lapd_core.c:254
static int lapd_rx_u_ui(struct msgb *msg, struct lapd_msg_ctx *lctx)
Definition: lapd_core.c:1043
void osmo_timer_setup(struct osmo_timer_list *timer, void(*cb)(void *data), void *data)
uint8_t tx_power
Transmit Power.
Definition: l1sap.h:46
#define ALL_STATES
Definition: lapd_core.c:107
static __thread char namebuf[255]
void lapdm_entity_exit(struct lapdm_entity *le)
flush and release all resoures in LAPDm entity
Definition: lapdm.c:289
#define OSMO_VALUE_STRING(x)
uint8_t cr
Definition: lapd_core.h:100
static void lapd_stop_t203(struct lapd_datalink *dl)
Definition: lapd_core.c:225
int t200_sec
Definition: lapd_core.h:151
uint8_t retrans_ctr
re-transmission counter
Definition: lapd_core.h:155
static void lapd_dl_flush_hist(struct lapd_datalink *dl)
Definition: lapd_core.c:157
static int lapd_send_ua(struct lapd_msg_ctx *lctx, uint8_t len, uint8_t *data)
Definition: lapd_core.c:430
@ LAPD_FORM_I
Definition: lapd_core.h:90
static struct msgb * tx_dequeue_acch_msgb(struct lapdm_entity *le)
Definition: lapdm.c:393
#define N200_TR_SACCH
Definition: lapdm.c:97
static void lapd_dl_flush_tx(struct lapd_datalink *dl)
Definition: lapd_core.c:172
#define TE43(i)
Definition: aes_i.h:85
@ PRIM_DL_RES
DL-RESUME.
Definition: lapd_core.h:27
#define LAPDm_SAPI_SMS
Definition: lapdm.c:53
#define AES_PRIV_SIZE
Definition: aes_i.h:120
uint8_t n_recv
Definition: lapd_core.h:108
@ DL_SAPI3
SAPI 1.
Definition: lapdm.h:40
#define CR_USER2NET_CMD
Definition: lapd_core.c:98
static int lapd_send_rr(struct lapd_msg_ctx *lctx, uint8_t f_bit, uint8_t cmd)
Definition: lapd_core.c:475
#define llist_for_each_entry(pos, head, member)
@ RSL_MT_CHAN_RQD
Definition: gsm_08_58.h:187
const u32 Td0[256]
Definition: aes-internal.c:407
static void lapd_t200_cb(void *data)
Definition: lapd_core.c:587
@ LAPDm_FMT_A
Definition: lapdm.c:106
int op
Definition: lapd_core.c:2141
static void llist_add(struct llist_head *_new, struct llist_head *head)
uint8_t msg_type
message type (abis_rsl_msgtype)
Definition: gsm_08_58.h:77
struct llist_head send_queue
frames from L3
Definition: lapd_core.h:157
#define MDL_CAUSE_FRMR
Definition: lapd_core.h:47
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
@ LAPD_STATE_DISC_SENT
Definition: lapd_core.h:82
#define LAPDm_CTRL_Nr(ctrl)
Definition: lapdm.c:76
lapdm_cb_t l3_cb
callback for sending stuff to L3
Definition: lapdm.h:62
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/role.
Definition: lapd_core.h:69
uint8_t chan_nr
Definition: lapdm.h:23
static int lapd_udata_req(struct osmo_dlsap_prim *dp, struct lapd_msg_ctx *lctx)
Definition: lapd_core.c:1721
@ SAP_GSM_PH
Definition: prim.h:9
#define ABIS_RSL_MDISC_COM_CHAN
Definition: gsm_08_58.h:153
#define LAPDm_EL
Definition: lapdm.c:80
struct lapdm_datalink datalink[_NR_DL_SAPI]
the SAPIs of the LAPDm entity
Definition: lapdm.h:52
@ RSL_IE_L3_INFO
Definition: gsm_08_58.h:307
#define LAPDm_CTRL_I(nr, ns, p)
Definition: lapdm.c:62
static const char * lapd_state_name(enum lapd_state state)
Definition: lapd_core.c:195
struct lapd_history * tx_hist
tx history structure array
Definition: lapd_core.h:160
struct ph_rach_ind_param rach_ind
Definition: l1sap.h:164
struct abis_rsl_common_hdr c
Definition: gsm_08_58.h:83
LAPD message context.
Definition: lapd_core.h:96
#define RCON(i)
Definition: aes_i.h:72
static int rsl_is_transparent(uint8_t msg_type)
Definition: lapdm.c:484
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
#define OSMO_PRIM(prim, op)
int t200_usec
retry timer (default 1 sec)
Definition: lapd_core.h:151
struct lapd_datalink dl
Definition: lapdm.h:31
#define RSL_CHAN_RACH
Definition: gsm_08_58.h:463
@ RSL_IE_TIMING_ADVANCE
Definition: gsm_08_58.h:320
uint8_t lpd
Definition: lapd_core.h:103
static int lapd_rel_req(struct osmo_dlsap_prim *dp, struct lapd_msg_ctx *lctx)
Definition: lapd_core.c:2062
uint8_t link_id
Definition: gsm_08_58.h:91
void lapdm_entity_reset(struct lapdm_entity *le)
Reset an entire LAPDm entity and all its datalinks.
Definition: lapdm.c:1475
uint8_t v_send
seq nr of next I frame to be transmitted
Definition: lapd_core.h:144
int osmo_timer_pending(const struct osmo_timer_list *timer)
void osmo_timer_del(struct osmo_timer_list *timer)
int prim
Definition: lapd_core.c:2141
@ LAPD_FORM_S
Definition: lapd_core.h:91
struct lapd_datalink * dl
Definition: lapd_core.h:97
static int send_rll_simple(uint8_t msg_type, struct lapdm_msg_ctx *mctx)
Definition: lapdm.c:531
uint8_t chan_nr
Definition: gsm_04_08.h:248
#define LAPDm_ADDR_LPD(addr)
Definition: lapdm.c:56
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
#define LAPDm_CTRL_U_BITS(ctrl)
Definition: lapdm.c:70
@ RSL_MT_EST_CONF
Definition: gsm_08_58.h:172
static void lapd_acknowledge(struct lapd_msg_ctx *lctx)
Definition: lapd_core.c:742
#define MDL_CAUSE_UNSOL_UA_RESP
Definition: lapd_core.h:35
int reestablish
enable reestablish support
Definition: lapd_core.h:138
struct lapdm_entity lapdm_acch
Associated Control Channel.
Definition: lapdm.h:75
static int send_dl_simple(uint8_t prim, uint8_t op, struct lapd_msg_ctx *lctx)
Definition: lapd_core.c:409
static int send_dl_l3(uint8_t prim, uint8_t op, struct lapd_msg_ctx *lctx, struct msgb *msg)
Definition: lapd_core.c:398
uint8_t msg_discr
message discriminator (ABIS_RSL_MDISC_*)
Definition: gsm_08_58.h:76
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
char * name
human-readable name
Definition: lapdm.h:74
static int lapd_susp_req(struct osmo_dlsap_prim *dp, struct lapd_msg_ctx *lctx)
Definition: lapd_core.c:1967
#define TE432(i)
Definition: aes_i.h:88
static unsigned char * msgb_pull(struct msgb *msgb, unsigned int len)
const struct value_string lapd_state_names[]
Definition: lapd_core.c:182
#define MDL_CAUSE_SEQ_ERR
Definition: lapd_core.h:39
@ RSL_MT_RES_REQ
Definition: gsm_08_58.h:181
uint8_t t2
Definition: gsm_utils.h:43
int(* rout)(struct osmo_dlsap_prim *dp, struct lapd_msg_ctx *lctx)
Definition: lapd_core.c:2143
static struct msgb * tx_dequeue_dcch_msgb(struct lapdm_entity *le)
Definition: lapdm.c:380
static int lapd_rel_req_idle(struct osmo_dlsap_prim *dp, struct lapd_msg_ctx *lctx)
Definition: lapd_core.c:2126
#define LAPD_U_UA
Definition: lapd_core.c:91
struct msgb * rcv_buffer
buffer to assemble the received message
Definition: lapd_core.h:162
static int lapd_send_rej(struct lapd_msg_ctx *lctx, uint8_t f_bit)
Definition: lapd_core.c:519
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
#define LOGP(ss, level, fmt, args...)
static uint8_t do_mod(uint8_t x, uint8_t m)
Definition: lapd_core.c:124
static int rslms_rx_rll_rel_req(struct msgb *msg, struct lapdm_datalink *dl)
Definition: lapdm.c:1175
uint8_t is_combined_ccch
Are we using a combined CCCH?
Definition: l1sap.h:47
void lapdm_entity_set_flags(struct lapdm_entity *le, unsigned int flags)
Set the flags of a LAPDm entity.
Definition: lapdm.c:1494
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
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
#define LAPDm_LEN(len)
Definition: lapdm.c:78
struct ph_rach_req_param rach_req
Definition: l1sap.h:163
#define LAPDm_SAPI_NORMAL
Definition: lapdm.c:52
#define TE41(i)
Definition: aes_i.h:83
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
static int rslms_rx_rll_res_req(struct msgb *msg, struct lapdm_datalink *dl)
Definition: lapdm.c:1138
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
static int rslms_rx_rll_est_req(struct msgb *msg, struct lapdm_datalink *dl)
Definition: lapdm.c:969
static int lapdm_send_ph_data_req(struct lapd_msg_ctx *lctx, struct msgb *msg)
Definition: lapdm.c:603
#define CR_NET2USER_RESP
Definition: lapd_core.c:101
#define LAPDm_ADDR_EA(addr)
Definition: lapdm.c:59
char * name
user-provided name
Definition: lapd_core.h:164
union osmo_dlsap_prim::@23 u
request-specific data
@ RSL_MT_ERROR_IND
Definition: gsm_08_58.h:170
uint8_t msg_type
Definition: gsm_04_08.h:768
uint8_t ta
Definition: lapdm.h:67
@ RSL_IE_MS_POWER
Definition: gsm_08_58.h:309
struct msgb * msgb_dequeue(struct llist_head *queue)
@ PRIM_PH_DATA
PH-DATA.
Definition: l1sap.h:9
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
#define LAPDm_ADDR_CR(addr)
Definition: lapdm.c:58
uint8_t data[0]
message payload data
Definition: gsm_08_58.h:94
#define MDL_CAUSE_SABM_INFO_NOTALL
Definition: lapd_core.h:46
@ LAPDm_FMT_Bter
Definition: lapdm.c:109
uint8_t more
Definition: lapd_core.h:112
uint8_t chan_nr
Definition: gsm_08_58.h:113
#define TE44(i)
Definition: aes_i.h:86
void aes_decrypt_deinit(void *ctx)
static int send_rslms_dlsap(struct osmo_dlsap_prim *dp, struct lapd_msg_ctx *lctx)
Definition: lapdm.c:553
@ LAPD_STATE_SABM_SENT
Definition: lapd_core.h:81
#define N201_AB_SDCCH
Definition: lapdm.c:86
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
uint8_t v_range
range of sequence numbers
Definition: lapd_core.h:143
@ RSL_MT_EST_REQ
Definition: gsm_08_58.h:171
#define LAPDm_CTRL_PF_BIT(ctrl)
Definition: lapdm.c:71
Definition: gsm_08_58.h:109
@ RSL_IE_RELEASE_MODE
Definition: gsm_08_58.h:316
static int lapd_rx_u_ua(struct msgb *msg, struct lapd_msg_ctx *lctx)
Definition: lapd_core.c:1160
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
static void lapd_stop_t200(struct lapd_datalink *dl)
Definition: lapd_core.c:217
LAPDm message context.
Definition: lapdm.h:20
lapdm_mode
LAPDm mode/role.
Definition: lapdm.h:12
uint8_t cause
generic cause value
Definition: lapd_core.h:51
@ RSL_MT_CHAN_CONF
Definition: gsm_08_58.h:192
static void lapd_start_t203(struct lapd_datalink *dl)
Definition: lapd_core.c:209
#define LAPDm_ADDR(lpd, sapi, cr)
Definition: lapdm.c:54
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
#define N200
Definition: lapdm.c:103
@ PRIM_DL_DATA
DL-DATA.
Definition: lapd_core.h:23
static int send_rslms_rll_l3_ui(struct lapdm_msg_ctx *mctx, struct msgb *msg)
Definition: lapdm.c:512
void msgb_enqueue(struct llist_head *queue, struct msgb *msg)
static void lapd_dl_flush_send(struct lapd_datalink *dl)
Definition: lapd_core.c:144
#define L2DOWNSLLEN
Definition: lapd_core.c:2195
static int lapd_rx_i(struct msgb *msg, struct lapd_msg_ctx *lctx)
Definition: lapd_core.c:1506
result of the TLV parser
Definition: tlv.h:522
@ RSL_MT_UNIT_DATA_IND
Definition: gsm_08_58.h:178
struct mdl_error_ind_param error_ind
Definition: lapd_core.h:63
struct lapdm_channel * lapdm_ch
pointer to lapdm_channel of which we're part
Definition: lapdm.h:65
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
uint8_t v_ack
last frame ACKed by peer
Definition: lapd_core.h:145
@ LAPD_STATE_MF_EST
Definition: lapd_core.h:83
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 (Figure B.2/Q.921)
Definition: lapd_core.h:75
uint32_t states
Definition: lapd_core.c:2140
#define LAPD_TAILROOM
Definition: lapd_core.c:104
#define LAPDm_CTRL_is_I(ctrl)
Definition: lapdm.c:66
#define TLVP_VAL(x, y)
Definition: tlv.h:548
struct lapdm_entity * entity
LAPDm entity we are part of.
Definition: lapdm.h:34
static uint8_t add_mod(uint8_t x, uint8_t y, uint8_t m)
Definition: lapd_core.c:134
struct lapdm_datalink * dl
Definition: lapdm.h:21
static int lapd_send_i(struct lapd_msg_ctx *lctx, int line)
Definition: lapd_core.c:1823
int(* lapdm_cb_t)(struct msgb *msg, struct lapdm_entity *le, void *ctx)
Definition: lapdm.h:44
#define os_memset(x, y, z)
Definition: common.h:17
@ RSL_MT_EST_IND
Definition: gsm_08_58.h:173