mirror of
https://gitea.osmocom.org/cellular-infrastructure/osmo-mgw.git
synced 2025-10-23 08:12:01 +00:00
sgsn: Get gtp ip and teid from pdp context in gprs_iu_rab_act()
This commit is contained in:
committed by
Neels Hofmeyr
parent
92223cc32e
commit
4371ff8cce
@@ -26,4 +26,4 @@ int iu_init(void *ctx, const char *listen_addr, uint16_t listen_port,
|
||||
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 sgsn_pdp_ctx *pdp, uint32_t gtp_ip, uint32_t gtp_tei);
|
||||
int iu_rab_act_ps(struct sgsn_pdp_ctx *pdp);
|
||||
|
@@ -91,7 +91,7 @@ const struct value_string gtp_cause_strs[] = {
|
||||
{ 0, NULL }
|
||||
};
|
||||
|
||||
int gprs_iu_rab_act(struct sgsn_pdp_ctx *mm, uint32_t gtp_ip, uint32_t gtp_tei);
|
||||
int gprs_iu_rab_act(struct sgsn_pdp_ctx *pdp);
|
||||
|
||||
/* Generate the GTP IMSI IE according to 09.60 Section 7.9.2 */
|
||||
static uint64_t imsi_str2gtp(char *str)
|
||||
@@ -357,10 +357,7 @@ static int create_pdp_conf(struct pdp_t *pdp, void *cbp, int cause)
|
||||
return send_act_pdp_cont_acc(pctx);
|
||||
} else {
|
||||
/* Activate a radio bearer */
|
||||
uint32_t ggsn_ip;
|
||||
memcpy(&ggsn_ip, pdp->gsnru.v, pdp->gsnru.l);
|
||||
ggsn_ip = htonl(ggsn_ip);
|
||||
iu_rab_act_ps(pctx, ggsn_ip, pdp->teid_own);
|
||||
iu_rab_act_ps(pctx);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@@ -21,6 +21,8 @@
|
||||
#include <openbsc/iu.h>
|
||||
#include <openbsc/debug.h>
|
||||
|
||||
#include <pdp.h>
|
||||
|
||||
#include <osmocom/ranap/ranap_ies_defs.h>
|
||||
#include <osmocom/ranap/ranap_common.h>
|
||||
#include <osmocom/ranap/ranap_common_cn.h>
|
||||
@@ -91,17 +93,23 @@ int iu_rab_act_cs(struct ue_conn_ctx *ue_ctx, uint32_t rtp_ip, uint16_t rtp_port
|
||||
return iu_rab_act(ue_ctx, msg);
|
||||
}
|
||||
|
||||
int iu_rab_act_ps(struct sgsn_pdp_ctx *pdp, uint32_t gtp_ip, uint32_t gtp_tei)
|
||||
int iu_rab_act_ps(struct sgsn_pdp_ctx *pdp)
|
||||
{
|
||||
struct msgb *msg;
|
||||
struct sgsn_mm_ctx *mm = pdp->mm;
|
||||
struct ue_conn_ctx *uectx;
|
||||
uint32_t ggsn_ip;
|
||||
|
||||
uectx = mm->iu.ue_ctx;
|
||||
uectx->pdp = pdp;
|
||||
|
||||
|
||||
/* Get the IP address for ggsn user plane */
|
||||
memcpy(&ggsn_ip, pdp->lib->gsnru.v, pdp->lib->gsnru.l);
|
||||
ggsn_ip = htonl(ggsn_ip);
|
||||
|
||||
/* FIXME: Generate unique RAB ID per UE */
|
||||
msg = ranap_new_msg_rab_assign_data(1, gtp_ip, gtp_tei);
|
||||
msg = ranap_new_msg_rab_assign_data(1, ggsn_ip, pdp->lib->teid_own);
|
||||
msg->l2h = msg->data;
|
||||
return iu_rab_act(uectx, msg);
|
||||
}
|
||||
|
Reference in New Issue
Block a user