forked from acouzens/open5gs
update it
This commit is contained in:
parent
b89779a301
commit
c44dc0a4c4
|
@ -73,8 +73,8 @@ status_t gtp_xact_final(void)
|
|||
return CORE_OK;
|
||||
}
|
||||
|
||||
gtp_xact_t *gtp_xact_local_create(net_sock_t *sock, gtp_node_t *gnode,
|
||||
c_uint8_t type, c_uint32_t teid, pkbuf_t *pkbuf)
|
||||
gtp_xact_t *gtp_xact_local_create(net_sock_t *sock,
|
||||
gtp_node_t *gnode, gtp_header_t *hdesc, pkbuf_t *pkbuf)
|
||||
{
|
||||
status_t rv;
|
||||
char buf[INET_ADDRSTRLEN];
|
||||
|
@ -110,7 +110,7 @@ gtp_xact_t *gtp_xact_local_create(net_sock_t *sock, gtp_node_t *gnode,
|
|||
list_append(xact->org == GTP_LOCAL_ORIGINATOR ?
|
||||
&xact->gnode->local_list : &xact->gnode->remote_list, xact);
|
||||
|
||||
rv = gtp_xact_update_tx(xact, type, teid, pkbuf);
|
||||
rv = gtp_xact_update_tx(xact, hdesc, pkbuf);
|
||||
d_assert(rv == CORE_OK, return NULL, "Update Tx failed");
|
||||
|
||||
d_trace(3, "[%d] %s Create peer %s:%d\n",
|
||||
|
@ -184,7 +184,7 @@ void gtp_xact_delete_all(gtp_node_t *gnode)
|
|||
}
|
||||
|
||||
status_t gtp_xact_update_tx(gtp_xact_t *xact,
|
||||
c_uint8_t type, c_uint32_t teid, pkbuf_t *pkbuf)
|
||||
gtp_header_t *hdesc, pkbuf_t *pkbuf)
|
||||
{
|
||||
char buf[INET_ADDRSTRLEN];
|
||||
gtp_xact_stage_t stage;
|
||||
|
@ -193,15 +193,16 @@ status_t gtp_xact_update_tx(gtp_xact_t *xact,
|
|||
d_assert(xact, return CORE_ERROR, "Null param");
|
||||
d_assert(xact->sock, return CORE_ERROR, "Null param");
|
||||
d_assert(xact->gnode, return CORE_ERROR, "Null param");
|
||||
d_assert(hdesc, return CORE_ERROR, "Null param");
|
||||
d_assert(pkbuf, return CORE_ERROR, "Null param");
|
||||
|
||||
d_trace(3, "[%d] %s UPD TX-%d peer %s:%d\n",
|
||||
xact->xid,
|
||||
xact->org == GTP_LOCAL_ORIGINATOR ? "LOCAL " : "REMOTE",
|
||||
type,
|
||||
hdesc->type,
|
||||
INET_NTOP(&xact->gnode->addr, buf), xact->gnode->port);
|
||||
|
||||
stage = gtp_xact_get_stage(type, xact->xid);
|
||||
stage = gtp_xact_get_stage(hdesc->type, xact->xid);
|
||||
if (xact->org == GTP_LOCAL_ORIGINATOR)
|
||||
{
|
||||
switch(stage)
|
||||
|
@ -211,7 +212,7 @@ status_t gtp_xact_update_tx(gtp_xact_t *xact,
|
|||
"[%d] %s invalid step %d for type %d peer %s:%d\n",
|
||||
xact->xid,
|
||||
xact->org == GTP_LOCAL_ORIGINATOR ? "LOCAL " : "REMOTE",
|
||||
xact->step, type,
|
||||
xact->step, hdesc->type,
|
||||
INET_NTOP(&xact->gnode->addr, buf), xact->gnode->port);
|
||||
break;
|
||||
|
||||
|
@ -223,7 +224,7 @@ status_t gtp_xact_update_tx(gtp_xact_t *xact,
|
|||
"[%d] %s invalid step %d for type %d peer %s:%d\n",
|
||||
xact->xid,
|
||||
xact->org == GTP_LOCAL_ORIGINATOR ? "LOCAL " : "REMOTE",
|
||||
xact->step, type,
|
||||
xact->step, hdesc->type,
|
||||
INET_NTOP(&xact->gnode->addr, buf), xact->gnode->port);
|
||||
break;
|
||||
|
||||
|
@ -244,7 +245,7 @@ status_t gtp_xact_update_tx(gtp_xact_t *xact,
|
|||
"[%d] %s invalid step %d for type %d peer %s:%d\n",
|
||||
xact->xid,
|
||||
xact->org == GTP_LOCAL_ORIGINATOR ? "LOCAL " : "REMOTE",
|
||||
xact->step, type,
|
||||
xact->step, hdesc->type,
|
||||
INET_NTOP(&xact->gnode->addr, buf), xact->gnode->port);
|
||||
break;
|
||||
|
||||
|
@ -263,9 +264,9 @@ status_t gtp_xact_update_tx(gtp_xact_t *xact,
|
|||
memset(h, 0, sizeof(gtp_header_t));
|
||||
h->version = 2;
|
||||
h->teid_presence = 1;
|
||||
h->type = type;
|
||||
h->type = hdesc->type;
|
||||
h->length = htons(pkbuf->len - 4);
|
||||
h->teid = htonl(teid);
|
||||
h->teid = htonl(hdesc->teid);
|
||||
h->sqn = GTP_XID_TO_SQN(xact->xid);
|
||||
|
||||
/* Save Message type and packet of this step */
|
||||
|
|
|
@ -52,15 +52,14 @@ CORE_DECLARE(status_t) gtp_xact_init(tm_service_t *tm_service,
|
|||
c_uintptr_t response_event, c_uintptr_t duplicated_event);
|
||||
CORE_DECLARE(status_t) gtp_xact_final(void);
|
||||
|
||||
CORE_DECLARE(gtp_xact_t *) gtp_xact_local_create(
|
||||
net_sock_t *sock, gtp_node_t *gnode,
|
||||
c_uint8_t type, c_uint32_t teid, pkbuf_t *pkbuf);
|
||||
CORE_DECLARE(gtp_xact_t *) gtp_xact_local_create(net_sock_t *sock,
|
||||
gtp_node_t *gnode, gtp_header_t *hdesc, pkbuf_t *pkbuf);
|
||||
CORE_DECLARE(gtp_xact_t *) gtp_xact_remote_create(
|
||||
net_sock_t *sock, gtp_node_t *gnode, c_uint32_t sqn);
|
||||
CORE_DECLARE(void) gtp_xact_delete_all(gtp_node_t *gnode);
|
||||
|
||||
CORE_DECLARE(status_t) gtp_xact_update_tx(gtp_xact_t *xact,
|
||||
c_uint8_t type, c_uint32_t teid, pkbuf_t *pkbuf);
|
||||
gtp_header_t *hdesc, pkbuf_t *pkbuf);
|
||||
CORE_DECLARE(status_t) gtp_xact_update_rx(gtp_xact_t *xact, c_uint8_t type);
|
||||
|
||||
CORE_DECLARE(status_t) gtp_xact_commit(gtp_xact_t *xact);
|
||||
|
|
|
@ -8,7 +8,8 @@
|
|||
#include "types.h"
|
||||
#include "mme_context.h"
|
||||
|
||||
status_t mme_s11_build_create_session_request(pkbuf_t **pkbuf, mme_sess_t *sess)
|
||||
status_t mme_s11_build_create_session_request(
|
||||
pkbuf_t **pkbuf, c_uint8_t type, mme_sess_t *sess)
|
||||
{
|
||||
status_t rv;
|
||||
pdn_t *pdn = NULL;
|
||||
|
@ -145,7 +146,7 @@ status_t mme_s11_build_create_session_request(pkbuf_t **pkbuf, mme_sess_t *sess)
|
|||
req->charging_characteristics.data = (c_uint8_t *)"\x54\x00";
|
||||
req->charging_characteristics.len = 2;
|
||||
|
||||
gtp_message.h.type = GTP_CREATE_SESSION_REQUEST_TYPE;
|
||||
gtp_message.h.type = type;
|
||||
rv = gtp_build_msg(pkbuf, >p_message);
|
||||
d_assert(rv == CORE_OK, return CORE_ERROR, "gtp build failed");
|
||||
|
||||
|
@ -153,7 +154,7 @@ status_t mme_s11_build_create_session_request(pkbuf_t **pkbuf, mme_sess_t *sess)
|
|||
}
|
||||
|
||||
status_t mme_s11_build_modify_bearer_request(
|
||||
pkbuf_t **pkbuf, mme_bearer_t *bearer)
|
||||
pkbuf_t **pkbuf, c_uint8_t type, mme_bearer_t *bearer)
|
||||
{
|
||||
status_t rv;
|
||||
gtp_message_t gtp_message;
|
||||
|
@ -184,14 +185,15 @@ status_t mme_s11_build_modify_bearer_request(
|
|||
req->bearer_contexts_to_be_modified.s1_u_enodeb_f_teid.len =
|
||||
GTP_F_TEID_IPV4_LEN;
|
||||
|
||||
gtp_message.h.type = GTP_MODIFY_BEARER_REQUEST_TYPE;
|
||||
gtp_message.h.type = type;
|
||||
rv = gtp_build_msg(pkbuf, >p_message);
|
||||
d_assert(rv == CORE_OK, return CORE_ERROR, "gtp build failed");
|
||||
|
||||
return CORE_OK;
|
||||
}
|
||||
|
||||
status_t mme_s11_build_delete_session_request(pkbuf_t **pkbuf, mme_sess_t *sess)
|
||||
status_t mme_s11_build_delete_session_request(
|
||||
pkbuf_t **pkbuf, c_uint8_t type, mme_sess_t *sess)
|
||||
{
|
||||
status_t rv;
|
||||
mme_ue_t *mme_ue = NULL;
|
||||
|
@ -230,14 +232,15 @@ status_t mme_s11_build_delete_session_request(pkbuf_t **pkbuf, mme_sess_t *sess)
|
|||
req->indication_flags.data = &indication;
|
||||
req->indication_flags.len = sizeof(gtp_indication_t);
|
||||
|
||||
gtp_message.h.type = GTP_DELETE_SESSION_REQUEST_TYPE;
|
||||
gtp_message.h.type = type;
|
||||
rv = gtp_build_msg(pkbuf, >p_message);
|
||||
d_assert(rv == CORE_OK, return CORE_ERROR, "gtp build failed");
|
||||
|
||||
return CORE_OK;
|
||||
}
|
||||
|
||||
status_t mme_s11_build_release_access_bearers_request(pkbuf_t **pkbuf)
|
||||
status_t mme_s11_build_release_access_bearers_request(
|
||||
pkbuf_t **pkbuf, c_uint8_t type)
|
||||
{
|
||||
status_t rv;
|
||||
gtp_message_t gtp_message;
|
||||
|
@ -249,15 +252,15 @@ status_t mme_s11_build_release_access_bearers_request(pkbuf_t **pkbuf)
|
|||
req->originating_node.presence = 1;
|
||||
req->originating_node.u8 = GTP_NODE_TYPE_MME;
|
||||
|
||||
gtp_message.h.type = GTP_RELEASE_ACCESS_BEARERS_REQUEST_TYPE;
|
||||
gtp_message.h.type = type;
|
||||
rv = gtp_build_msg(pkbuf, >p_message);
|
||||
d_assert(rv == CORE_OK, return CORE_ERROR, "gtp build failed");
|
||||
|
||||
return CORE_OK;
|
||||
}
|
||||
|
||||
status_t mme_s11_build_downlink_data_notification_ack(pkbuf_t **pkbuf,
|
||||
mme_sess_t *sess)
|
||||
status_t mme_s11_build_downlink_data_notification_ack(
|
||||
pkbuf_t **pkbuf, c_uint8_t type, mme_sess_t *sess)
|
||||
{
|
||||
status_t rv;
|
||||
mme_ue_t *mme_ue = NULL;
|
||||
|
@ -280,7 +283,7 @@ status_t mme_s11_build_downlink_data_notification_ack(pkbuf_t **pkbuf,
|
|||
ack->cause.data = &cause;
|
||||
ack->cause.len = sizeof(cause);
|
||||
|
||||
gtp_message.h.type = GTP_DOWNLINK_DATA_NOTIFICATION_ACKNOWLEDGE_TYPE;
|
||||
gtp_message.h.type = type;
|
||||
rv = gtp_build_msg(pkbuf, >p_message);
|
||||
d_assert(rv == CORE_OK, return CORE_ERROR, "gtp build failed");
|
||||
|
||||
|
|
|
@ -8,15 +8,15 @@ extern "C" {
|
|||
#endif /* __cplusplus */
|
||||
|
||||
CORE_DECLARE(status_t) mme_s11_build_create_session_request(
|
||||
pkbuf_t **pkbuf, mme_sess_t *sess);
|
||||
pkbuf_t **pkbuf, c_uint8_t type, mme_sess_t *sess);
|
||||
CORE_DECLARE(status_t) mme_s11_build_modify_bearer_request(
|
||||
pkbuf_t **pkbuf, mme_bearer_t *bearer);
|
||||
pkbuf_t **pkbuf, c_uint8_t type, mme_bearer_t *bearer);
|
||||
CORE_DECLARE(status_t) mme_s11_build_delete_session_request(
|
||||
pkbuf_t **pkbuf, mme_sess_t *sess);
|
||||
pkbuf_t **pkbuf, c_uint8_t type, mme_sess_t *sess);
|
||||
CORE_DECLARE(status_t) mme_s11_build_release_access_bearers_request(
|
||||
pkbuf_t **pkbuf);
|
||||
pkbuf_t **pkbuf, c_uint8_t type);
|
||||
CORE_DECLARE(status_t) mme_s11_build_downlink_data_notification_ack(
|
||||
pkbuf_t **pkbuf, mme_sess_t *sess);
|
||||
pkbuf_t **pkbuf, c_uint8_t type, mme_sess_t *sess);
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif /* __cplusplus */
|
||||
|
|
|
@ -16,6 +16,7 @@
|
|||
void mme_s11_handle_create_session_request(mme_sess_t *sess)
|
||||
{
|
||||
status_t rv;
|
||||
gtp_header_t h;
|
||||
pkbuf_t *pkbuf = NULL;
|
||||
gtp_xact_t *xact = NULL;
|
||||
|
||||
|
@ -25,12 +26,16 @@ void mme_s11_handle_create_session_request(mme_sess_t *sess)
|
|||
if (!sess->sgw) sess->sgw = mme_sgw_first();
|
||||
d_assert(sess->sgw, return, "Null param");
|
||||
|
||||
rv = mme_s11_build_create_session_request(&pkbuf, sess);
|
||||
memset(&h, 0, sizeof(gtp_header_t));
|
||||
h.type = GTP_CREATE_SESSION_REQUEST_TYPE;
|
||||
h.teid = sess->sgw_s11_teid;
|
||||
|
||||
rv = mme_s11_build_create_session_request(&pkbuf, h.type, sess);
|
||||
d_assert(rv == CORE_OK, return,
|
||||
"S11 build error");
|
||||
|
||||
xact = gtp_xact_local_create(mme_self()->s11_sock, (gtp_node_t *)sess->sgw,
|
||||
GTP_CREATE_SESSION_REQUEST_TYPE, sess->sgw_s11_teid, pkbuf);
|
||||
&h, pkbuf);
|
||||
d_assert(xact, return, "Null param");
|
||||
|
||||
rv = gtp_xact_commit(xact);
|
||||
|
@ -118,14 +123,18 @@ void mme_s11_handle_delete_all_sessions_request_in_ue(mme_ue_t *mme_ue)
|
|||
sess = mme_sess_first(mme_ue);
|
||||
while (sess != NULL)
|
||||
{
|
||||
gtp_header_t h;
|
||||
gtp_xact_t *xact = NULL;
|
||||
|
||||
rv = mme_s11_build_delete_session_request(&s11buf, sess);
|
||||
memset(&h, 0, sizeof(gtp_header_t));
|
||||
h.type = GTP_DELETE_SESSION_REQUEST_TYPE;
|
||||
h.teid = sess->sgw_s11_teid;
|
||||
|
||||
rv = mme_s11_build_delete_session_request(&s11buf, h.type, sess);
|
||||
d_assert(rv == CORE_OK, return, "S11 build error");
|
||||
|
||||
xact = gtp_xact_local_create(
|
||||
mme_self()->s11_sock, (gtp_node_t *)sess->sgw,
|
||||
GTP_DELETE_SESSION_REQUEST_TYPE, sess->sgw_s11_teid, s11buf);
|
||||
mme_self()->s11_sock, (gtp_node_t *)sess->sgw, &h, s11buf);
|
||||
d_assert(xact, return, "Null param");
|
||||
|
||||
rv = gtp_xact_commit(xact);
|
||||
|
@ -195,6 +204,7 @@ void mme_s11_handle_downlink_data_notification(
|
|||
gtp_downlink_data_notification_t *noti)
|
||||
{
|
||||
status_t rv;
|
||||
gtp_header_t h;
|
||||
pkbuf_t *s11buf = NULL;
|
||||
|
||||
d_assert(xact, return, "Null param");
|
||||
|
@ -205,12 +215,14 @@ void mme_s11_handle_downlink_data_notification(
|
|||
"MME[%d] <-- SGW[%d]\n", sess->mme_s11_teid, sess->sgw_s11_teid);
|
||||
|
||||
/* Build Downlink data notification ack */
|
||||
rv = mme_s11_build_downlink_data_notification_ack(&s11buf, sess);
|
||||
memset(&h, 0, sizeof(gtp_header_t));
|
||||
h.type = GTP_DOWNLINK_DATA_NOTIFICATION_ACKNOWLEDGE_TYPE;
|
||||
h.teid = sess->sgw_s11_teid;
|
||||
|
||||
rv = mme_s11_build_downlink_data_notification_ack(&s11buf, h.type, sess);
|
||||
d_assert(rv == CORE_OK, return, "S11 build error");
|
||||
|
||||
rv = gtp_xact_update_tx(xact,
|
||||
GTP_DOWNLINK_DATA_NOTIFICATION_ACKNOWLEDGE_TYPE,
|
||||
sess->sgw_s11_teid, s11buf);
|
||||
rv = gtp_xact_update_tx(xact, &h, s11buf);
|
||||
d_assert(rv == CORE_OK, return, "xact_update_tx error");
|
||||
|
||||
rv = gtp_xact_commit(xact);
|
||||
|
|
|
@ -394,6 +394,7 @@ void s1ap_handle_initial_context_setup_response(
|
|||
i++)
|
||||
{
|
||||
status_t rv;
|
||||
gtp_header_t h;
|
||||
gtp_xact_t *xact = NULL;
|
||||
mme_sess_t *sess = NULL;
|
||||
pkbuf_t *pkbuf = NULL;
|
||||
|
@ -416,12 +417,15 @@ void s1ap_handle_initial_context_setup_response(
|
|||
memcpy(&bearer->enb_s1u_addr, e_rab->transportLayerAddress.buf,
|
||||
sizeof(bearer->enb_s1u_addr));
|
||||
|
||||
rv = mme_s11_build_modify_bearer_request(&pkbuf, bearer);
|
||||
memset(&h, 0, sizeof(gtp_header_t));
|
||||
h.type = GTP_MODIFY_BEARER_REQUEST_TYPE;
|
||||
h.teid = sess->sgw_s11_teid;
|
||||
|
||||
rv = mme_s11_build_modify_bearer_request(&pkbuf, h.type, bearer);
|
||||
d_assert(rv == CORE_OK, return, "S11 build error");
|
||||
|
||||
xact = gtp_xact_local_create(
|
||||
mme_self()->s11_sock, (gtp_node_t *)sess->sgw,
|
||||
GTP_MODIFY_BEARER_REQUEST_TYPE, sess->sgw_s11_teid, pkbuf);
|
||||
mme_self()->s11_sock, (gtp_node_t *)sess->sgw, &h, pkbuf);
|
||||
d_assert(xact, return, "Null param");
|
||||
|
||||
rv = gtp_xact_commit(xact);
|
||||
|
@ -456,7 +460,6 @@ void s1ap_handle_ue_context_release_request(
|
|||
cause = ies->cause.choice.radioNetwork;
|
||||
if (cause == S1ap_CauseRadioNetwork_user_inactivity)
|
||||
{
|
||||
pkbuf_t *pkbuf = NULL;
|
||||
mme_ue_t *mme_ue = enb_ue->mme_ue;
|
||||
status_t rv;
|
||||
|
||||
|
@ -465,16 +468,21 @@ void s1ap_handle_ue_context_release_request(
|
|||
mme_sess_t *sess = mme_sess_first(mme_ue);
|
||||
while (sess != NULL)
|
||||
{
|
||||
gtp_header_t h;
|
||||
pkbuf_t *pkbuf = NULL;
|
||||
gtp_xact_t *xact = NULL;
|
||||
|
||||
memset(&h, 0, sizeof(gtp_header_t));
|
||||
h.type = GTP_RELEASE_ACCESS_BEARERS_REQUEST_TYPE;
|
||||
h.teid = sess->sgw_s11_teid;
|
||||
|
||||
rv = mme_s11_build_release_access_bearers_request(
|
||||
&pkbuf);
|
||||
&pkbuf, h.type);
|
||||
d_assert(rv == CORE_OK, return, "S11 build error");
|
||||
|
||||
xact = gtp_xact_local_create(
|
||||
mme_self()->s11_sock, (gtp_node_t *)sess->sgw,
|
||||
GTP_RELEASE_ACCESS_BEARERS_REQUEST_TYPE,
|
||||
sess->sgw_s11_teid, pkbuf);
|
||||
&h, pkbuf);
|
||||
d_assert(xact, return, "Null param");
|
||||
|
||||
rv = gtp_xact_commit(xact);
|
||||
|
|
|
@ -97,10 +97,12 @@ void pgw_gx_handle_cca_initial_request(
|
|||
GTP_F_TEID_IPV4_LEN;
|
||||
|
||||
gtp_message.h.type = GTP_CREATE_SESSION_RESPONSE_TYPE;
|
||||
gtp_message.h.teid = sess->sgw_s5c_teid;
|
||||
|
||||
rv = gtp_build_msg(&pkbuf, >p_message);
|
||||
d_assert(rv == CORE_OK, return, "gtp build failed");
|
||||
|
||||
rv = gtp_xact_update_tx(xact, gtp_message.h.type, sess->sgw_s5c_teid, pkbuf);
|
||||
rv = gtp_xact_update_tx(xact, >p_message.h, pkbuf);
|
||||
d_assert(rv == CORE_OK, return, "gtp_xact_update_tx error");
|
||||
|
||||
rv = gtp_xact_commit(xact);
|
||||
|
@ -161,11 +163,13 @@ void pgw_gx_handle_cca_termination_request(
|
|||
|
||||
/* build */
|
||||
gtp_message.h.type = GTP_DELETE_SESSION_RESPONSE_TYPE;
|
||||
gtp_message.h.teid = sgw_s5c_teid;
|
||||
|
||||
rv = gtp_build_msg(&pkbuf, >p_message);
|
||||
d_assert(rv == CORE_OK, return, "gtp build failed");
|
||||
|
||||
/* send */
|
||||
rv = gtp_xact_update_tx(xact, gtp_message.h.type, sgw_s5c_teid, pkbuf);
|
||||
rv = gtp_xact_update_tx(xact, >p_message.h, pkbuf);
|
||||
d_assert(rv == CORE_OK, return, "gtp_xact_update_tx error");
|
||||
|
||||
rv = gtp_xact_commit(xact);
|
||||
|
|
|
@ -74,11 +74,13 @@ void sgw_handle_create_session_request(gtp_xact_t *s11_xact,
|
|||
GTP_F_TEID_IPV4_LEN;
|
||||
|
||||
gtp_message->h.type = GTP_CREATE_SESSION_REQUEST_TYPE;
|
||||
gtp_message->h.teid = sess->pgw_s5c_teid;
|
||||
|
||||
rv = gtp_build_msg(&pkbuf, gtp_message);
|
||||
d_assert(rv == CORE_OK, return, "gtp build failed");
|
||||
|
||||
s5c_xact = gtp_xact_local_create(sgw_self()->s5c_sock,
|
||||
&sgw_self()->s5c_node, gtp_message->h.type, 0, pkbuf);
|
||||
&sgw_self()->s5c_node, >p_message->h, pkbuf);
|
||||
d_assert(s5c_xact, return, "Null param");
|
||||
|
||||
gtp_xact_associate(s11_xact, s5c_xact);
|
||||
|
@ -176,11 +178,12 @@ void sgw_handle_create_session_response(gtp_xact_t *s5c_xact,
|
|||
d_assert(rv == CORE_OK, return, "xact_commit error");
|
||||
|
||||
gtp_message->h.type = GTP_CREATE_SESSION_RESPONSE_TYPE;
|
||||
gtp_message->h.teid = sess->mme_s11_teid;
|
||||
|
||||
rv = gtp_build_msg(&pkbuf, gtp_message);
|
||||
d_assert(rv == CORE_OK, return, "gtp build failed");
|
||||
|
||||
rv = gtp_xact_update_tx(s11_xact,
|
||||
gtp_message->h.type, sess->mme_s11_teid, pkbuf);
|
||||
rv = gtp_xact_update_tx(s11_xact, >p_message->h, pkbuf);
|
||||
d_assert(rv == CORE_OK, return, "gtp_xact_update_tx error");
|
||||
|
||||
rv = gtp_xact_commit(s11_xact);
|
||||
|
@ -241,11 +244,12 @@ CORE_DECLARE(void) sgw_handle_modify_bearer_request(gtp_xact_t *s11_xact,
|
|||
rsp->cause.len = sizeof(cause);
|
||||
|
||||
gtp_message.h.type = GTP_MODIFY_BEARER_RESPONSE_TYPE;
|
||||
gtp_message.h.teid = sess->mme_s11_teid;
|
||||
|
||||
rv = gtp_build_msg(&pkbuf, >p_message);
|
||||
d_assert(rv == CORE_OK, return, "gtp build failed");
|
||||
|
||||
rv = gtp_xact_update_tx(s11_xact,
|
||||
gtp_message.h.type, sess->mme_s11_teid, pkbuf);
|
||||
rv = gtp_xact_update_tx(s11_xact, >p_message.h, pkbuf);
|
||||
d_assert(rv == CORE_OK, return, "gtp_xact_update_tx error");
|
||||
|
||||
rv = gtp_xact_commit(s11_xact);
|
||||
|
@ -267,12 +271,14 @@ void sgw_handle_delete_session_request(gtp_xact_t *s11_xact,
|
|||
d_assert(gtp_message, return, "Null param");
|
||||
|
||||
gtp_message->h.type = GTP_DELETE_SESSION_REQUEST_TYPE;
|
||||
gtp_message->h.teid = sess->pgw_s5c_teid;
|
||||
|
||||
rv = gtp_build_msg(&pkbuf, gtp_message);
|
||||
d_assert(rv == CORE_OK, return, "gtp build failed");
|
||||
|
||||
s5c_xact = gtp_xact_local_create(
|
||||
sgw_self()->s5c_sock, &sgw_self()->s5c_node,
|
||||
gtp_message->h.type, sess->pgw_s5c_teid, pkbuf);
|
||||
>p_message->h, pkbuf);
|
||||
d_assert(s5c_xact, return, "Null param");
|
||||
|
||||
gtp_xact_associate(s11_xact, s5c_xact);
|
||||
|
@ -335,11 +341,12 @@ void sgw_handle_delete_session_response(gtp_xact_t *s5c_xact,
|
|||
d_assert(rv == CORE_OK, return, "xact_commit error");
|
||||
|
||||
gtp_message->h.type = GTP_DELETE_SESSION_RESPONSE_TYPE;
|
||||
gtp_message->h.teid = mme_s11_teid;
|
||||
|
||||
rv = gtp_build_msg(&pkbuf, gtp_message);
|
||||
d_assert(rv == CORE_OK, return, "gtp build failed");
|
||||
|
||||
rv = gtp_xact_update_tx(s11_xact,
|
||||
gtp_message->h.type, mme_s11_teid, pkbuf);
|
||||
rv = gtp_xact_update_tx(s11_xact, >p_message->h, pkbuf);
|
||||
d_assert(rv == CORE_OK, return, "gtp_xact_update_tx error");
|
||||
|
||||
rv = gtp_xact_commit(s11_xact);
|
||||
|
@ -385,11 +392,12 @@ void sgw_handle_release_access_bearers_request(gtp_xact_t *s11_xact,
|
|||
rsp->cause.len = sizeof(cause);
|
||||
|
||||
gtp_message.h.type = GTP_RELEASE_ACCESS_BEARERS_RESPONSE_TYPE;
|
||||
gtp_message.h.teid = sess->mme_s11_teid;
|
||||
|
||||
rv = gtp_build_msg(&pkbuf, >p_message);
|
||||
d_assert(rv == CORE_OK, return, "gtp build failed");
|
||||
|
||||
rv = gtp_xact_update_tx(s11_xact,
|
||||
gtp_message.h.type, sess->mme_s11_teid, pkbuf);
|
||||
rv = gtp_xact_update_tx(s11_xact, >p_message.h, pkbuf);
|
||||
d_assert(rv == CORE_OK, return, "gtp_xact_update_tx error");
|
||||
|
||||
rv = gtp_xact_commit(s11_xact);
|
||||
|
@ -415,7 +423,6 @@ void sgw_handle_lo_dldata_notification(sgw_bearer_t *bearer)
|
|||
sess = bearer->sess;
|
||||
d_assert(sess, return, "Null param");
|
||||
|
||||
|
||||
/* Build downlink notification message */
|
||||
noti = >p_message.downlink_data_notification;
|
||||
memset(>p_message, 0, sizeof(gtp_message_t));
|
||||
|
@ -429,11 +436,13 @@ void sgw_handle_lo_dldata_notification(sgw_bearer_t *bearer)
|
|||
noti->allocation_retention_priority.len = sizeof(arp);
|
||||
|
||||
gtp_message.h.type = GTP_DOWNLINK_DATA_NOTIFICATION_TYPE;
|
||||
gtp_message.h.teid = sess->mme_s11_teid;
|
||||
|
||||
rv = gtp_build_msg(&pkbuf, >p_message);
|
||||
d_assert(rv == CORE_OK, return, "gtp build failed");
|
||||
|
||||
xact = gtp_xact_local_create(sgw_self()->s11_sock, &sgw_self()->s11_node,
|
||||
GTP_DOWNLINK_DATA_NOTIFICATION_TYPE, sess->mme_s11_teid, pkbuf);
|
||||
>p_message.h, pkbuf);
|
||||
d_assert(xact, return, "Null param");
|
||||
|
||||
rv = gtp_xact_commit(xact);
|
||||
|
|
Loading…
Reference in New Issue