mirror of
https://gitea.osmocom.org/cellular-infrastructure/osmo-mgw.git
synced 2025-11-03 05:23:43 +00:00
generalize rab_act for ps and cs
This commit is contained in:
@@ -14,3 +14,6 @@ typedef int (* iu_recv_cb_t )(struct msgb *msg, struct gprs_ra_id *ra_id,
|
||||
uint16_t *sai);
|
||||
|
||||
int iu_tx(struct msgb *msg, uint8_t sapi);
|
||||
|
||||
int iu_rab_act_cs(struct ue_conn_ctx *ue_ctx, uint32_t rtp_ip, uint16_t rtp_port);
|
||||
int iu_rab_act_ps(struct ue_conn_ctx *ue_ctx, uint32_t gtp_ip, uint32_t gtp_tei);
|
||||
|
||||
@@ -61,24 +61,37 @@ struct ue_conn_ctx *ue_conn_ctx_find(struct osmo_sua_link *link, uint32_t conn_i
|
||||
* RANAP handling
|
||||
***********************************************************************/
|
||||
|
||||
int gprs_iu_rab_act(struct sgsn_mm_ctx *mm, uint32_t gtp_ip, uint32_t gtp_tei)
|
||||
static int iu_rab_act(struct ue_conn_ctx *ue_ctx, struct msgb *msg)
|
||||
{
|
||||
struct ue_conn_ctx *uectx;
|
||||
struct osmo_scu_prim *prim;
|
||||
struct msgb *msg;
|
||||
|
||||
uectx = mm->iu.ue_ctx;
|
||||
|
||||
msg = ranap_new_msg_rab_assign_data(1, gtp_ip, gtp_tei);
|
||||
msg->l2h = msg->data;
|
||||
|
||||
/* wrap RANAP message in SCCP N-DATA.req */
|
||||
prim = (struct osmo_scu_prim *) msgb_push(msg, sizeof(*prim));
|
||||
prim->u.data.conn_id = uectx->conn_id;
|
||||
osmo_prim_init(&prim->oph, SCCP_SAP_USER,
|
||||
OSMO_SCU_PRIM_N_DATA,
|
||||
PRIM_OP_REQUEST, msg);
|
||||
osmo_sua_user_link_down(uectx->link, &prim->oph);
|
||||
prim->u.data.conn_id = ue_ctx->conn_id;
|
||||
osmo_prim_init(&prim->oph,
|
||||
SCCP_SAP_USER,
|
||||
OSMO_SCU_PRIM_N_DATA,
|
||||
PRIM_OP_REQUEST,
|
||||
msg);
|
||||
return osmo_sua_user_link_down(ue_ctx->link, &prim->oph);
|
||||
}
|
||||
|
||||
int iu_rab_act_cs(struct ue_conn_ctx *ue_ctx, uint32_t rtp_ip, uint16_t rtp_port)
|
||||
{
|
||||
struct msgb *msg;
|
||||
|
||||
msg = ranap_new_msg_rab_assign_voice(1, rtp_ip, rtp_port);
|
||||
msg->l2h = msg->data;
|
||||
iu_rab_act(ue_ctx, msg);
|
||||
}
|
||||
|
||||
int iu_rab_act_ps(struct ue_conn_ctx *ue_ctx, uint32_t gtp_ip, uint32_t gtp_tei)
|
||||
{
|
||||
struct msgb *msg;
|
||||
|
||||
msg = ranap_new_msg_rab_assign_data(1, gtp_ip, gtp_tei);
|
||||
msg->l2h = msg->data;
|
||||
iu_rab_act(ue_ctx, msg);
|
||||
}
|
||||
|
||||
int gprs_iu_rab_deact(struct sgsn_mm_ctx *mm)
|
||||
|
||||
@@ -47,6 +47,7 @@
|
||||
#include <openbsc/gprs_sgsn.h>
|
||||
#include <openbsc/gprs_gmm.h>
|
||||
#include <openbsc/gsm_subscriber.h>
|
||||
#include <openbsc/iu.h>
|
||||
|
||||
#include <gtp.h>
|
||||
#include <pdp.h>
|
||||
@@ -354,7 +355,7 @@ static int create_pdp_conf(struct pdp_t *pdp, void *cbp, int cause)
|
||||
} else {
|
||||
/* Activate a radio bearer */
|
||||
uint32_t ggsn_ip = 0xc0a80033; /* 192.168.0.51 */
|
||||
gprs_iu_rab_act(pctx->mm, ggsn_ip, pdp->teid_own);
|
||||
iu_rab_act_ps(pctx->mm->iu.ue_ctx, ggsn_ip, pdp->teid_own);
|
||||
}
|
||||
|
||||
/* Inform others about it */
|
||||
|
||||
Reference in New Issue
Block a user