Harald Welte | 75827d6 | 2010-05-18 11:07:34 +0200 | [diff] [blame] | 1 | #ifndef _GPRS_GMM_H |
| 2 | #define _GPRS_GMM_H |
| 3 | |
Max | 8204010 | 2016-07-06 11:59:18 +0200 | [diff] [blame] | 4 | #include <stdbool.h> |
| 5 | |
Pau Espin Pedrol | 58101ea | 2023-01-09 12:29:27 +0100 | [diff] [blame] | 6 | #include <osmocom/core/msgb.h> |
| 7 | #include <osmocom/gsm/gsm48.h> |
| 8 | #include <osmocom/crypt/auth.h> |
| 9 | |
| 10 | struct sgsn_mm_ctx; |
| 11 | struct gprs_llc_llme; |
| 12 | |
Alexander Couzens | d4788cd | 2018-05-02 22:32:19 +0200 | [diff] [blame] | 13 | int gsm48_tx_gmm_auth_ciph_req(struct sgsn_mm_ctx *mm, |
| 14 | const struct osmo_auth_vector *vec, |
| 15 | uint8_t key_seq, bool force_standby); |
Harald Welte | 77289c2 | 2010-05-18 14:32:29 +0200 | [diff] [blame] | 16 | |
Max | 8204010 | 2016-07-06 11:59:18 +0200 | [diff] [blame] | 17 | int gsm0408_gprs_rcvmsg_gb(struct msgb *msg, struct gprs_llc_llme *llme, |
| 18 | bool drop_cipherable); |
Pau Espin Pedrol | 6dfb5fe | 2019-08-29 17:21:00 +0200 | [diff] [blame] | 19 | int gsm0408_rcv_gmm(struct sgsn_mm_ctx *mmctx, struct msgb *msg, |
| 20 | struct gprs_llc_llme *llme, bool drop_cipherable); |
Pau Espin Pedrol | 35f0e66 | 2019-09-02 18:27:27 +0200 | [diff] [blame] | 21 | int gsm48_gmm_sendmsg(struct msgb *msg, int command, |
| 22 | struct sgsn_mm_ctx *mm, bool encryptable); |
Jacob Erlbeck | abdf02b | 2014-10-31 12:20:49 +0100 | [diff] [blame] | 23 | int gsm0408_gprs_force_reattach(struct sgsn_mm_ctx *mmctx); |
Max | b997f84 | 2016-07-06 15:57:01 +0200 | [diff] [blame] | 24 | int gsm0408_gprs_force_reattach_oldmsg(struct msgb *msg, |
| 25 | struct gprs_llc_llme *llme); |
Jacob Erlbeck | 423f8bf | 2014-10-24 18:09:54 +0200 | [diff] [blame] | 26 | void gsm0408_gprs_access_granted(struct sgsn_mm_ctx *mmctx); |
Jacob Erlbeck | af3d5c5 | 2015-01-05 17:51:17 +0100 | [diff] [blame] | 27 | void gsm0408_gprs_access_denied(struct sgsn_mm_ctx *mmctx, int gmm_cause); |
| 28 | void gsm0408_gprs_access_cancelled(struct sgsn_mm_ctx *mmctx, int gmm_cause); |
Jacob Erlbeck | 4adb136 | 2014-12-02 09:47:26 +0100 | [diff] [blame] | 29 | void gsm0408_gprs_authenticate(struct sgsn_mm_ctx *mmctx); |
Harald Welte | 75827d6 | 2010-05-18 11:07:34 +0200 | [diff] [blame] | 30 | |
Harald Welte | 5bfe499 | 2010-06-09 11:22:47 +0200 | [diff] [blame] | 31 | int gprs_gmm_rx_suspend(struct gprs_ra_id *raid, uint32_t tlli); |
| 32 | int gprs_gmm_rx_resume(struct gprs_ra_id *raid, uint32_t tlli, |
| 33 | uint8_t suspend_ref); |
| 34 | |
Pau Espin Pedrol | 05d5f28 | 2022-12-23 17:09:08 +0100 | [diff] [blame] | 35 | int gsm0408_gprs_rcvmsg_gb(struct msgb *msg, struct gprs_llc_llme *llme, |
| 36 | bool drop_cipherable); |
| 37 | /* Has to be called whenever any PDU (signaling, data, ...) has been received */ |
| 38 | void gprs_gb_recv_pdu(struct sgsn_mm_ctx *mmctx, const struct msgb *msg); |
| 39 | |
Jacob Erlbeck | 81ffb74 | 2015-01-23 11:33:51 +0100 | [diff] [blame] | 40 | time_t gprs_max_time_to_idle(void); |
| 41 | |
Alexander Couzens | d4788cd | 2018-05-02 22:32:19 +0200 | [diff] [blame] | 42 | int gsm48_tx_gmm_id_req(struct sgsn_mm_ctx *mm, uint8_t id_type); |
| 43 | int gsm48_tx_gmm_att_rej(struct sgsn_mm_ctx *mm, |
| 44 | uint8_t gmm_cause); |
| 45 | int gsm48_tx_gmm_att_ack(struct sgsn_mm_ctx *mm); |
| 46 | |
Alexander Couzens | f7198d7 | 2018-05-22 18:29:14 +0200 | [diff] [blame] | 47 | int gprs_gmm_attach_req_ies(struct msgb *a, struct msgb *b); |
| 48 | |
Pau Espin Pedrol | 6dfb5fe | 2019-08-29 17:21:00 +0200 | [diff] [blame] | 49 | int gsm48_gmm_authorize(struct sgsn_mm_ctx *ctx); |
Alexander Couzens | 8007be4 | 2018-05-14 06:48:24 +0200 | [diff] [blame] | 50 | /* TODO: move extract_subscr_* when gsm48_gmm_authorize() got removed */ |
| 51 | void extract_subscr_msisdn(struct sgsn_mm_ctx *ctx); |
| 52 | void extract_subscr_hlr(struct sgsn_mm_ctx *ctx); |
Pau Espin Pedrol | 8c7d259 | 2018-07-09 20:44:17 +0200 | [diff] [blame] | 53 | |
Pau Espin Pedrol | 8333ef1 | 2019-08-29 19:26:12 +0200 | [diff] [blame] | 54 | void msgid2mmctx(struct sgsn_mm_ctx *mm, const struct msgb *msg); |
Pau Espin Pedrol | 35f0e66 | 2019-09-02 18:27:27 +0200 | [diff] [blame] | 55 | void mmctx2msgid(struct msgb *msg, const struct sgsn_mm_ctx *mm); |
Harald Welte | 75827d6 | 2010-05-18 11:07:34 +0200 | [diff] [blame] | 56 | #endif /* _GPRS_GMM_H */ |