2017-07-09 20:09:18 +00:00
|
|
|
#pragma once
|
|
|
|
|
2018-07-24 15:42:14 +00:00
|
|
|
#include <stdint.h>
|
drop IMSI filter and libfilter completely
Filtering by IMSI in osmo-bsc is a legacy use case with questionable
usefulness. Remove.
Do not keep deprecated VTY commands: those could be dangerous, since
(presumably non-existing) users might assume that the filtering would still be
in place. Rather fail to start osmo-bsc for config with an IMSI ACL.
The IMSI filtering did, if present, provide the logging with an IMSI to print
for the bsc_subscriber. TMSIs should have ended up in logging likewise, which
has never been implemented. The proper way to learn the IMSI would be by the
Common Id message from the MSC. Furthermore, the upcoming MSC pooling feature
will extract the mobile identity again, and will hence make sure that both IMSI
and TMSI identities, as available, end up in the bsc_subscriber and will be
logged again.
So long, IMSI ACL, and thanks for all the fish.
Change-Id: I89727af5387e8360362e995fdee959883c37d89a
2020-05-14 23:41:35 +00:00
|
|
|
#include <osmocom/core/msgb.h>
|
2018-07-24 15:42:14 +00:00
|
|
|
|
2022-03-13 11:15:22 +00:00
|
|
|
enum handover_scope;
|
|
|
|
|
2018-07-24 15:42:14 +00:00
|
|
|
struct amr_mode;
|
|
|
|
struct amr_multirate_conf;
|
|
|
|
struct bsc_subscr;
|
|
|
|
struct gsm48_chan_desc;
|
|
|
|
struct gsm48_pag_resp;
|
|
|
|
struct gsm_lchan;
|
|
|
|
struct gsm_meas_rep;
|
|
|
|
struct gsm_network;
|
|
|
|
struct gsm_subscriber_connection;
|
|
|
|
|
2017-07-09 20:09:18 +00:00
|
|
|
void gsm_net_update_ctype(struct gsm_network *network);
|
|
|
|
enum gsm_chan_t get_ctype_by_chreq(struct gsm_network *network, uint8_t ra);
|
|
|
|
int get_reason_by_chreq(uint8_t ra, int neci);
|
|
|
|
int gsm48_send_rr_release(struct gsm_lchan *lchan);
|
|
|
|
int send_siemens_mrpci(struct gsm_lchan *lchan,
|
|
|
|
uint8_t *classmark2_lv);
|
2018-09-13 03:19:32 +00:00
|
|
|
int gsm48_send_rr_classmark_enquiry(struct gsm_lchan *lchan);
|
2017-07-09 20:09:18 +00:00
|
|
|
int gsm48_send_rr_ciph_mode(struct gsm_lchan *lchan, int want_imeisv);
|
AMR config cleanup step 3: generate AMR LV on msg composition
Firstly, do not store the encoded AMR length-value bits in gsm_lchan->*
before an activation/modify has actually succeeded.
And secondly, do not store the AMR LV structure in struct gsm_lchan at
all, but only generate the TLV exactly when a message is being composed.
In gsm48_multirate_config(), generate the LV directly to a msgb instead
of a static buffer first. gsm0408_test.c expected output verifies that
the generated LV bytes remain unchanged.
In lchan_mr_config(), introduce a target mr_conf argument, so that Chan
Act and Mode Modify may generate the filtered AMR config to different
locations (lchan->{activate,modify}.mr_conf_filtered).
Only after receiving an ACK for Activate/Modify, set
lchan->current_mr_conf from lchan->{activate,modify}.mr_conf_filtered.
Use the properly scoped lchan->activate.mr_conf_filtered for Chan Act,
lchan->modify.mr_conf_filtered for Mode Modify and
new_lchan->current_mr_conf for Handover Command as appropriate.
Related: SYS#5315 OS#4940 OS#3787 OS#3833
Change-Id: Ie57f9d0e3912632903d9740291225bfd1634ed47
2021-04-29 17:58:52 +00:00
|
|
|
int gsm48_multirate_config(struct msgb *msg,
|
|
|
|
const struct gsm48_multi_rate_conf *mr_conf,
|
2018-10-22 12:21:57 +00:00
|
|
|
const struct amr_mode *modes, unsigned int num_modes);
|
2022-03-13 14:49:54 +00:00
|
|
|
struct msgb *gsm48_make_ho_cmd(const struct gsm_lchan *new_lchan,
|
2022-03-13 15:20:15 +00:00
|
|
|
enum handover_scope ho_scope, bool async,
|
2022-03-13 14:49:54 +00:00
|
|
|
uint8_t power_command, uint8_t ho_ref);
|
2017-07-09 20:09:18 +00:00
|
|
|
int gsm48_send_rr_ass_cmd(struct gsm_lchan *dest_lchan, struct gsm_lchan *lchan, uint8_t power_command);
|
2019-09-02 12:13:51 +00:00
|
|
|
int gsm48_send_rr_app_info(struct gsm_lchan *lchan, uint8_t apdu_id, uint8_t apdu_flags,
|
|
|
|
const uint8_t *apdu_data, ssize_t apdu_data_len);
|
2017-07-09 20:09:18 +00:00
|
|
|
int gsm48_lchan_modify(struct gsm_lchan *lchan, uint8_t mode);
|
|
|
|
int gsm48_rx_rr_modif_ack(struct msgb *msg);
|
|
|
|
int gsm48_parse_meas_rep(struct gsm_meas_rep *rep, struct msgb *msg);
|
|
|
|
|
2018-02-13 22:48:24 +00:00
|
|
|
struct msgb *gsm48_create_mm_serv_rej(enum gsm48_reject_value value);
|
|
|
|
struct msgb *gsm48_create_loc_upd_rej(uint8_t cause);
|
|
|
|
|
2018-03-17 20:40:32 +00:00
|
|
|
struct msgb *gsm48_create_rr_status(uint8_t cause);
|
|
|
|
int gsm48_tx_rr_status(struct gsm_subscriber_connection *conn, uint8_t cause);
|
|
|
|
|
2017-07-09 20:09:18 +00:00
|
|
|
#define GSM48_ALLOC_SIZE 2048
|
|
|
|
#define GSM48_ALLOC_HEADROOM 256
|
|
|
|
|
|
|
|
static inline struct msgb *gsm48_msgb_alloc_name(const char *name)
|
|
|
|
{
|
|
|
|
return msgb_alloc_headroom(GSM48_ALLOC_SIZE, GSM48_ALLOC_HEADROOM,
|
|
|
|
name);
|
|
|
|
}
|
2018-06-08 16:46:04 +00:00
|
|
|
|
|
|
|
uint64_t str_to_imsi(const char *imsi_str);
|
2018-07-24 14:12:45 +00:00
|
|
|
|
large refactoring: use FSMs for lchans; add inter-BSC HO
Add FSMs:
- timeslot_fsm: handle dynamic timeslots and OML+RSL availability.
- lchan_fsm: handle an individual lchan activation, RTP stream and release,
signal the appropriate calling FSMs on success, failure, release.
- mgw_endpoint_fsm: handle one entire endpoint with several CI.
- assignment_fsm: BSSMAP Assignment Request.
- handover_fsm: all of intra, inter-MO and inter-MT handover.
Above FSMs absorb large parts of the gscon FSM. The gscon FSM was surpassing
the maximum amount events (32), and it is more logical to treat assignment,
handover and MGW procedures in separate FSMs.
- Add logging macros for each FSM type:
- LOG_TS()
- LOG_LCHAN()
- LOG_MGWEP(), LOG_CI()
- LOG_ASSIGNMENT()
- LOG_HO()
These log with the osmo_fsm_inst where present.
New style decision: logging without a final newline char is awkward,
especially for gsmtap logging and when other logs interleave LOGPC() calls;
we have various cases where the final \n goes missing, and also this invokes
the log category checking N times instead of once.
So I decided to make these macros *always* append a newline, but only if
there is no final newline yet. I hope that the compiler optimizes the
strlen() of the constant format strings away. Thus I can log with or without
typing "\n" and always get an \n termination anyway.
General:
- replace osmo_timers, state enums and program-wide osmo_signal_dispatch()
with dedicated FSM timeouts, states and events.
- introduce a common way to handle Tnnn timers: gsm_timers.h/.c: struct T_def.
These can be used (with some macro magic) to define a state's timeout once,
and not make mistakes for each osmo_fsm_inst_state_chg().
Details:
bsc_subscr_conn_fsm.c:
- move most states of this FSM to lchan_fsm, assignment_fsm, handover_fsm and
mgw_endpoint_fsm.
- There is exactly one state for an ongoing Assignment, with all details
handled in conn->assignment.fi. The state relies on the assignment_fsm's
timeout.
- There is one state for an ongoing Handover; except for an incoming Handover
from a remote BSS, the gscon remains in ST_INIT until the new lchan and conn
are both established.
- move bssmap_add_lcls_status() to osmo_bsc_lcls.c
abis_rsl.c:
- move all dynamic timeslot logic away into timeslot_fsm. Only keep plain send/receive functions in
abis_rsl.c
- reduce some rsl functions to merely send a message, rename to "_tx_".
- rsl_ipacc_mdcx(): add '_tx_' in the name; move parts that change the lchan state out into the
lchan_fsm, the lchan->abis_ip.* are now set there prior to invoking this function.
- move all timers and error/release handling away into various FSMs.
- tweak ipa_smod_s_for_lchan() and ipa_rtp_pt_for_lchan() to not require an
lchan passed, but just mode,type that they require. Rename to
ipacc_speech_mode*() and ipacc_payload_type().
- add rsl_forward_layer3_info, used for inter-BSC HO MO, to just send the RR
message received during BSSMAP Handover Command.
- move various logging to LOG_LCHAN() in order to log with the lchan FSM instance.
One drawback is that the lchan FSM is limited to one logging category, i.e. this moves some logging
from DRR to DRSL. It might actually make sense to combine those categories.
- lose LOGP...LOGPC logging cascades: they are bad for gsmtap logging and for performance.
- handle_classmark_chg(): change logging, move cm2 len check out of the cm3 condition (I hope that's
correct).
- gsm48_send_ho_cmd(): split off gsm48_make_ho_cmd() which doesn't send right away, so that during
inter-bsc HO we can make an RR Handover Command to send via the MSC to the remote BSS.
assignment_fsm.c:
- the Chan Mode Modify in case of re-using the same lchan is not implemented
yet, because this was also missing in the previous implementation (OS#3357).
osmo_bsc_api.c:
- simplify bsc_mr_config() and move to lchan_fsm.c, the only caller; rename to
lchan_mr_config(). (bsc_mr_config() used to copy the values to mr_bts_lv
twice, once by member assignment and then again with a memcpy.)
- During handover, we used to copy the MR config from the old lchan. Since we
may handover between FR and HR, rather set the MR Config anew every time, so
that FR rates are always available on FR lchans, and never on HR lchans.
Depends: I03ee7ce840ecfa0b6a33358e7385528aabd4873f (libosmocore),
I1f2918418c38918c5ac70acaa51a47adfca12b5e (libosmocore)
Change-Id: I82e3f918295daa83274a4cf803f046979f284366
2018-05-14 16:14:15 +00:00
|
|
|
int gsm48_sendmsg(struct msgb *msg);
|
2018-07-24 14:12:45 +00:00
|
|
|
int gsm0408_rcvmsg(struct msgb *msg, uint8_t link_id);
|