|
|
|
@ -138,12 +138,10 @@ bool mme_gtpc::send_create_session_request(uint64_t imsi)
|
|
|
|
|
m_mme_gtpc_log->info("Sending Create Session Request.\n");
|
|
|
|
|
m_mme_gtpc_log->console("Sending Create Session Request.\n");
|
|
|
|
|
struct srslte::gtpc_pdu cs_req_pdu;
|
|
|
|
|
struct srslte::gtpc_create_session_request* cs_req = &cs_req_pdu.choice.create_session_request;
|
|
|
|
|
|
|
|
|
|
struct srslte::gtpc_pdu cs_resp_pdu;
|
|
|
|
|
|
|
|
|
|
// Initialize GTP-C message to zero
|
|
|
|
|
bzero(&cs_req_pdu, sizeof(struct srslte::gtpc_pdu));
|
|
|
|
|
std::memset(&cs_req_pdu, 0, sizeof(cs_req_pdu));
|
|
|
|
|
|
|
|
|
|
struct srslte::gtpc_create_session_request* cs_req = &cs_req_pdu.choice.create_session_request;
|
|
|
|
|
|
|
|
|
|
// Setup GTP-C Header. TODO: Length, sequence and other fields need to be added.
|
|
|
|
|
cs_req_pdu.header.piggyback = false;
|
|
|
|
@ -155,7 +153,6 @@ bool mme_gtpc::send_create_session_request(uint64_t imsi)
|
|
|
|
|
cs_req->imsi = imsi;
|
|
|
|
|
// Control TEID allocated
|
|
|
|
|
cs_req->sender_f_teid.teid = get_new_ctrl_teid();
|
|
|
|
|
cs_req->sender_f_teid.ipv4 = m_mme_gtpc_ip;
|
|
|
|
|
|
|
|
|
|
m_mme_gtpc_log->info("Next MME control TEID: %d\n", m_next_ctrl_teid);
|
|
|
|
|
m_mme_gtpc_log->info("Allocated MME control TEID: %d\n", cs_req->sender_f_teid.teid);
|
|
|
|
@ -194,7 +191,7 @@ bool mme_gtpc::send_create_session_request(uint64_t imsi)
|
|
|
|
|
|
|
|
|
|
// Save GTP-C context
|
|
|
|
|
gtpc_ctx_t gtpc_ctx;
|
|
|
|
|
bzero(>pc_ctx, sizeof(gtpc_ctx_t));
|
|
|
|
|
std::memset(>pc_ctx, 0, sizeof(gtpc_ctx_t));
|
|
|
|
|
gtpc_ctx.mme_ctr_fteid = cs_req->sender_f_teid;
|
|
|
|
|
m_imsi_to_gtpc_ctx.insert(std::pair<uint64_t, gtpc_ctx_t>(imsi, gtpc_ctx));
|
|
|
|
|
|
|
|
|
@ -293,6 +290,7 @@ bool mme_gtpc::send_modify_bearer_request(uint64_t imsi, uint16_t erab_to_modify
|
|
|
|
|
{
|
|
|
|
|
m_mme_gtpc_log->info("Sending GTP-C Modify bearer request\n");
|
|
|
|
|
srslte::gtpc_pdu mb_req_pdu;
|
|
|
|
|
std::memset(&mb_req_pdu, 0, sizeof(mb_req_pdu));
|
|
|
|
|
|
|
|
|
|
std::map<uint64_t, gtpc_ctx_t>::iterator it = m_imsi_to_gtpc_ctx.find(imsi);
|
|
|
|
|
if (it == m_imsi_to_gtpc_ctx.end()) {
|
|
|
|
@ -341,6 +339,7 @@ bool mme_gtpc::send_delete_session_request(uint64_t imsi)
|
|
|
|
|
{
|
|
|
|
|
m_mme_gtpc_log->info("Sending GTP-C Delete Session Request request. IMSI %" PRIu64 "\n", imsi);
|
|
|
|
|
srslte::gtpc_pdu del_req_pdu;
|
|
|
|
|
std::memset(&del_req_pdu, 0, sizeof(del_req_pdu));
|
|
|
|
|
srslte::gtp_fteid_t sgw_ctr_fteid;
|
|
|
|
|
srslte::gtp_fteid_t mme_ctr_fteid;
|
|
|
|
|
|
|
|
|
@ -381,6 +380,7 @@ void mme_gtpc::send_release_access_bearers_request(uint64_t imsi)
|
|
|
|
|
// The GTP-C connection will not be torn down, just the user plane bearers.
|
|
|
|
|
m_mme_gtpc_log->info("Sending GTP-C Release Access Bearers Request\n");
|
|
|
|
|
srslte::gtpc_pdu rel_req_pdu;
|
|
|
|
|
std::memset(&rel_req_pdu, 0, sizeof(rel_req_pdu));
|
|
|
|
|
srslte::gtp_fteid_t sgw_ctr_fteid;
|
|
|
|
|
|
|
|
|
|
// Get S-GW Ctr TEID
|
|
|
|
@ -432,7 +432,7 @@ void mme_gtpc::send_downlink_data_notification_acknowledge(uint64_t imsi, enum s
|
|
|
|
|
m_mme_gtpc_log->debug("Sending GTP-C Data Notification Acknowledge. Cause %d\n", cause);
|
|
|
|
|
srslte::gtpc_pdu not_ack_pdu;
|
|
|
|
|
srslte::gtp_fteid_t sgw_ctr_fteid;
|
|
|
|
|
bzero(¬_ack_pdu, sizeof(srslte::gtpc_pdu));
|
|
|
|
|
std::memset(¬_ack_pdu, 0, sizeof(not_ack_pdu));
|
|
|
|
|
|
|
|
|
|
// get s-gw ctr teid
|
|
|
|
|
std::map<uint64_t, gtpc_ctx_t>::iterator it_ctx = m_imsi_to_gtpc_ctx.find(imsi);
|
|
|
|
@ -462,7 +462,7 @@ bool mme_gtpc::send_downlink_data_notification_failure_indication(uint64_t imsi,
|
|
|
|
|
m_mme_gtpc_log->debug("Sending GTP-C Data Notification Failure Indication. Cause %d\n", cause);
|
|
|
|
|
srslte::gtpc_pdu not_fail_pdu;
|
|
|
|
|
srslte::gtp_fteid_t sgw_ctr_fteid;
|
|
|
|
|
bzero(¬_fail_pdu, sizeof(srslte::gtpc_pdu));
|
|
|
|
|
std::memset(¬_fail_pdu, 0, sizeof(not_fail_pdu));
|
|
|
|
|
|
|
|
|
|
// get s-gw ctr teid
|
|
|
|
|
std::map<uint64_t, gtpc_ctx_t>::iterator it_ctx = m_imsi_to_gtpc_ctx.find(imsi);
|
|
|
|
|