mirror of
https://gitea.osmocom.org/cellular-infrastructure/osmo-mgw.git
synced 2025-11-03 05:23:43 +00:00
Move event callback to gprs_gmm
This commit is contained in:
@@ -38,9 +38,11 @@
|
|||||||
#include <osmocom/core/signal.h>
|
#include <osmocom/core/signal.h>
|
||||||
#include <osmocom/core/talloc.h>
|
#include <osmocom/core/talloc.h>
|
||||||
#include <osmocom/core/rate_ctr.h>
|
#include <osmocom/core/rate_ctr.h>
|
||||||
|
#include <osmocom/crypt/auth.h>
|
||||||
#include <osmocom/gsm/apn.h>
|
#include <osmocom/gsm/apn.h>
|
||||||
|
|
||||||
#include <osmocom/gprs/gprs_bssgp.h>
|
#include <osmocom/gprs/gprs_bssgp.h>
|
||||||
|
#include <osmocom/ranap/ranap_ies_defs.h>
|
||||||
|
|
||||||
#include <openbsc/debug.h>
|
#include <openbsc/debug.h>
|
||||||
#include <openbsc/gsm_data.h>
|
#include <openbsc/gsm_data.h>
|
||||||
@@ -98,6 +100,38 @@ static const struct tlv_definition gsm48_sm_att_tlvdef = {
|
|||||||
|
|
||||||
static int gsm48_gmm_authorize(struct sgsn_mm_ctx *ctx);
|
static int gsm48_gmm_authorize(struct sgsn_mm_ctx *ctx);
|
||||||
|
|
||||||
|
int sgsn_ranap_rab_ass_resp(struct sgsn_mm_ctx *ctx, RANAP_RAB_SetupOrModifiedItemIEs_t *setup_ies);
|
||||||
|
int sgsn_ranap_iu_event(struct ue_conn_ctx *ctx, int type, void *data)
|
||||||
|
{
|
||||||
|
struct sgsn_mm_ctx *mm;
|
||||||
|
int rc = -1;
|
||||||
|
|
||||||
|
mm = sgsn_mm_ctx_by_ue_ctx(ctx);
|
||||||
|
if (!mm) {
|
||||||
|
LOGP(DRANAP, LOGL_NOTICE, "Cannot find mm ctx for IU event %i!\n", type);
|
||||||
|
return rc;
|
||||||
|
}
|
||||||
|
|
||||||
|
switch (type) {
|
||||||
|
case IU_EVENT_RAB_ASSIGN:
|
||||||
|
rc = sgsn_ranap_rab_ass_resp(mm, (RANAP_RAB_SetupOrModifiedItemIEs_t *)data);
|
||||||
|
break;
|
||||||
|
case IU_EVENT_IU_RELEASE:
|
||||||
|
/* Clean up ue_conn_ctx here */
|
||||||
|
LOGMMCTXP(LOGL_INFO, mm, "IU release\n", type);
|
||||||
|
break;
|
||||||
|
case IU_EVENT_SECURITY_MODE_COMPLETE:
|
||||||
|
/* Continue authentication here */
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
LOGP(DRANAP, LOGL_NOTICE, "Unknown event received: %i\n", type);
|
||||||
|
rc = -1;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
return rc;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/* Our implementation, should be kept in SGSN */
|
/* Our implementation, should be kept in SGSN */
|
||||||
|
|
||||||
static void mmctx_timer_cb(void *_mm);
|
static void mmctx_timer_cb(void *_mm);
|
||||||
|
|||||||
@@ -37,6 +37,7 @@
|
|||||||
#include <osmocom/core/talloc.h>
|
#include <osmocom/core/talloc.h>
|
||||||
#include <osmocom/core/select.h>
|
#include <osmocom/core/select.h>
|
||||||
#include <osmocom/core/rate_ctr.h>
|
#include <osmocom/core/rate_ctr.h>
|
||||||
|
#include <osmocom/crypt/auth.h>
|
||||||
#include <osmocom/gprs/gprs_bssgp.h>
|
#include <osmocom/gprs/gprs_bssgp.h>
|
||||||
|
|
||||||
#include <openbsc/gsm_04_08_gprs.h>
|
#include <openbsc/gsm_04_08_gprs.h>
|
||||||
@@ -393,22 +394,18 @@ reject:
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Callback for RAB assignment response */
|
/* Callback for RAB assignment response */
|
||||||
int sgsn_ranap_rab_ass_resp(struct ue_conn_ctx *ctx, RANAP_RAB_SetupOrModifiedItemIEs_t *setup_ies)
|
int sgsn_ranap_rab_ass_resp(struct sgsn_mm_ctx *ctx, RANAP_RAB_SetupOrModifiedItemIEs_t *setup_ies)
|
||||||
{
|
{
|
||||||
uint8_t rab_id;
|
uint8_t rab_id;
|
||||||
struct sgsn_mm_ctx *mm;
|
|
||||||
struct sgsn_pdp_ctx *pdp = NULL;
|
struct sgsn_pdp_ctx *pdp = NULL;
|
||||||
uint32_t gtp_tei;
|
uint32_t gtp_tei;
|
||||||
RANAP_RAB_SetupOrModifiedItem_t *item = &setup_ies->raB_SetupOrModifiedItem;
|
RANAP_RAB_SetupOrModifiedItem_t *item = &setup_ies->raB_SetupOrModifiedItem;
|
||||||
|
|
||||||
rab_id = item->rAB_ID.buf[0];
|
rab_id = item->rAB_ID.buf[0];
|
||||||
|
|
||||||
mm = sgsn_mm_ctx_by_ue_ctx(ctx);
|
|
||||||
/* XXX: Error handling */
|
|
||||||
|
|
||||||
if (item->iuTransportAssociation->present == RANAP_IuTransportAssociation_PR_gTP_TEI) {
|
if (item->iuTransportAssociation->present == RANAP_IuTransportAssociation_PR_gTP_TEI) {
|
||||||
gtp_tei = asn1str_to_u32(&item->iuTransportAssociation->choice.gTP_TEI);
|
gtp_tei = asn1str_to_u32(&item->iuTransportAssociation->choice.gTP_TEI);
|
||||||
pdp = sgsn_pdp_ctx_by_tei(mm, gtp_tei);
|
pdp = sgsn_pdp_ctx_by_tei(ctx, gtp_tei);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!pdp) {
|
if (!pdp) {
|
||||||
@@ -429,29 +426,6 @@ int sgsn_ranap_rab_ass_resp(struct ue_conn_ctx *ctx, RANAP_RAB_SetupOrModifiedIt
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int sgsn_ranap_iu_event(struct ue_conn_ctx *ctx, int type, void *data)
|
|
||||||
{
|
|
||||||
int rc = -1;
|
|
||||||
|
|
||||||
switch (type) {
|
|
||||||
case IU_EVENT_RAB_ASSIGN:
|
|
||||||
rc = sgsn_ranap_rab_ass_resp(ctx, (RANAP_RAB_SetupOrModifiedItemIEs_t *)data);
|
|
||||||
break;
|
|
||||||
case IU_EVENT_IU_RELEASE:
|
|
||||||
/* Clean up ue_conn_ctx here */
|
|
||||||
break;
|
|
||||||
case IU_EVENT_SECURITY_MODE_COMPLETE:
|
|
||||||
/* Continue authentication here */
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
LOGP(DRANAP, LOGL_NOTICE, "Unknown event received: %i\n", type);
|
|
||||||
rc = -1;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
return rc;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/* Confirmation of a PDP Context Delete */
|
/* Confirmation of a PDP Context Delete */
|
||||||
static int delete_pdp_conf(struct pdp_t *pdp, void *cbp, int cause)
|
static int delete_pdp_conf(struct pdp_t *pdp, void *cbp, int cause)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user