From 0a4e256fec4d3378ebf40d8e40f443b4a8c51399 Mon Sep 17 00:00:00 2001 From: Pedro Alvarez Date: Thu, 7 Dec 2017 19:07:13 +0000 Subject: [PATCH] Stripping GTP-U header at the S-GW and writting it to the TUN SGi interface. First over-the-air ping between the SP-GW and the UE. --- srsepc/src/spgw/spgw.cc | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/srsepc/src/spgw/spgw.cc b/srsepc/src/spgw/spgw.cc index 02e5dfd18..a69ff04d5 100644 --- a/srsepc/src/spgw/spgw.cc +++ b/srsepc/src/spgw/spgw.cc @@ -365,6 +365,19 @@ void spgw::handle_s1u_pdu(srslte::byte_buffer_t *msg) { m_spgw_log->console("Received PDU from S1-U. Bytes=%d\n",msg->N_bytes); + srslte::gtpu_header_t header; + srslte::gtpu_read_header(msg, &header); + + m_spgw_log->console("TEID 0x%x. Bytes=%d\n", header.teid, msg->N_bytes); + int n = write(m_sgi_if, msg->msg, msg->N_bytes); + if(n<0) + { + m_spgw_log->error("Could not write to TUN interface.\n",n); + } + else + { + m_spgw_log->console("Forwarded packet to TUN interface\n"); + } return; } uint64_t