blob: 0d04280bf56db55679c717a3a37c872605d2aced [file] [log] [blame]
Harald Welte75827d62010-05-18 11:07:34 +02001#ifndef _GPRS_GMM_H
2#define _GPRS_GMM_H
3
Pablo Neira Ayuso136f4532011-03-22 16:47:59 +01004#include <osmocom/core/msgb.h>
Neels Hofmeyr396f2e62017-09-04 15:13:25 +02005#include <osmocom/sgsn/gprs_sgsn.h>
Harald Welte807a5d82010-06-01 11:53:01 +02006
Max82040102016-07-06 11:59:18 +02007#include <stdbool.h>
8
Alexander Couzensd4788cd2018-05-02 22:32:19 +02009int gsm48_tx_gmm_auth_ciph_req(struct sgsn_mm_ctx *mm,
10 const struct osmo_auth_vector *vec,
11 uint8_t key_seq, bool force_standby);
Harald Welte77289c22010-05-18 14:32:29 +020012
Max82040102016-07-06 11:59:18 +020013int gsm0408_gprs_rcvmsg_gb(struct msgb *msg, struct gprs_llc_llme *llme,
14 bool drop_cipherable);
Pau Espin Pedrol6dfb5fe2019-08-29 17:21:00 +020015int gsm0408_rcv_gmm(struct sgsn_mm_ctx *mmctx, struct msgb *msg,
16 struct gprs_llc_llme *llme, bool drop_cipherable);
Pau Espin Pedrol35f0e662019-09-02 18:27:27 +020017int gsm48_gmm_sendmsg(struct msgb *msg, int command,
18 struct sgsn_mm_ctx *mm, bool encryptable);
Jacob Erlbeckabdf02b2014-10-31 12:20:49 +010019int gsm0408_gprs_force_reattach(struct sgsn_mm_ctx *mmctx);
Maxb997f842016-07-06 15:57:01 +020020int gsm0408_gprs_force_reattach_oldmsg(struct msgb *msg,
21 struct gprs_llc_llme *llme);
Jacob Erlbeck423f8bf2014-10-24 18:09:54 +020022void gsm0408_gprs_access_granted(struct sgsn_mm_ctx *mmctx);
Jacob Erlbeckaf3d5c52015-01-05 17:51:17 +010023void gsm0408_gprs_access_denied(struct sgsn_mm_ctx *mmctx, int gmm_cause);
24void gsm0408_gprs_access_cancelled(struct sgsn_mm_ctx *mmctx, int gmm_cause);
Jacob Erlbeck4adb1362014-12-02 09:47:26 +010025void gsm0408_gprs_authenticate(struct sgsn_mm_ctx *mmctx);
Harald Welte75827d62010-05-18 11:07:34 +020026
Harald Welte5bfe4992010-06-09 11:22:47 +020027int gprs_gmm_rx_suspend(struct gprs_ra_id *raid, uint32_t tlli);
28int gprs_gmm_rx_resume(struct gprs_ra_id *raid, uint32_t tlli,
29 uint8_t suspend_ref);
30
Pau Espin Pedrol05d5f282022-12-23 17:09:08 +010031int gsm0408_gprs_rcvmsg_gb(struct msgb *msg, struct gprs_llc_llme *llme,
32 bool drop_cipherable);
33/* Has to be called whenever any PDU (signaling, data, ...) has been received */
34void gprs_gb_recv_pdu(struct sgsn_mm_ctx *mmctx, const struct msgb *msg);
35
Jacob Erlbeck81ffb742015-01-23 11:33:51 +010036time_t gprs_max_time_to_idle(void);
37
Alexander Couzensd4788cd2018-05-02 22:32:19 +020038int gsm48_tx_gmm_id_req(struct sgsn_mm_ctx *mm, uint8_t id_type);
39int gsm48_tx_gmm_att_rej(struct sgsn_mm_ctx *mm,
40 uint8_t gmm_cause);
41int gsm48_tx_gmm_att_ack(struct sgsn_mm_ctx *mm);
42
Alexander Couzensf7198d72018-05-22 18:29:14 +020043int gprs_gmm_attach_req_ies(struct msgb *a, struct msgb *b);
44
Pau Espin Pedrol6dfb5fe2019-08-29 17:21:00 +020045int gsm48_gmm_authorize(struct sgsn_mm_ctx *ctx);
Alexander Couzens8007be42018-05-14 06:48:24 +020046/* TODO: move extract_subscr_* when gsm48_gmm_authorize() got removed */
47void extract_subscr_msisdn(struct sgsn_mm_ctx *ctx);
48void extract_subscr_hlr(struct sgsn_mm_ctx *ctx);
Pau Espin Pedrol8c7d2592018-07-09 20:44:17 +020049
Pau Espin Pedrol8333ef12019-08-29 19:26:12 +020050void msgid2mmctx(struct sgsn_mm_ctx *mm, const struct msgb *msg);
Pau Espin Pedrol35f0e662019-09-02 18:27:27 +020051void mmctx2msgid(struct msgb *msg, const struct sgsn_mm_ctx *mm);
Harald Welte75827d62010-05-18 11:07:34 +020052#endif /* _GPRS_GMM_H */