blob: 62fdf6f2d82e744525608c8931fab001115a4fe4 [file] [log] [blame]
Pau Espin Pedrol6dfb5fe2019-08-29 17:21:00 +02001#pragma once
2
3#include <osmocom/core/msgb.h>
4#include <osmocom/sgsn/gprs_sgsn.h>
5
6#ifdef BUILD_IU
7#include <osmocom/ranap/ranap_ies_defs.h>
8#include <osmocom/ranap/ranap_msg_factory.h>
9#include <osmocom/ranap/iu_client.h>
10
11void activate_pdp_rabs(struct sgsn_mm_ctx *ctx);
12int sgsn_ranap_iu_event(struct ranap_ue_conn_ctx *ctx, enum ranap_iu_event_type type, void *data);
13int iu_rab_act_ps(uint8_t rab_id, struct sgsn_pdp_ctx *pdp);
14
Alexander Couzenseb5aee52019-09-10 21:00:18 +020015/* free the Iu UE context */
16void sgsn_ranap_iu_free(struct sgsn_mm_ctx *ctx);
17
18/* send a Iu Release Command and free afterwards the UE context */
19void sgsn_ranap_iu_release_free(struct sgsn_mm_ctx *ctx,
20 const struct RANAP_Cause *cause);
21
Pau Espin Pedrol6dfb5fe2019-08-29 17:21:00 +020022int gsm0408_gprs_rcvmsg_iu(struct msgb *msg, struct gprs_ra_id *ra_id, uint16_t *sai);
Alexander Couzenseb5aee52019-09-10 21:00:18 +020023
24#else /* ifndef BUILD_IU */
25inline static void sgsn_ranap_iu_free(void *ctx) {};
26inline static void sgsn_ranap_iu_release_free(void *ctx, void *cause) {};
27#endif /* BUILD_IU*/
Pau Espin Pedrol6dfb5fe2019-08-29 17:21:00 +020028
29struct ranap_ue_conn_ctx;
30/* On RANAP, Returns pointer to he associated ranap_ue_conn_ctx in msg, filled
31 * in by osmo-iuh's iu_recv_cb().
32 * On Gb, returns NULL */
33#define MSG_IU_UE_CTX(msg) ((struct ranap_ue_conn_ctx *)(msg)->dst)
34#define MSG_IU_UE_CTX_SET(msg, val) (msg)->dst = (val)