Added GTPU PDU Session header parsing

master
David Rupprecht 3 years ago committed by David Rupprecht
parent 43915550cc
commit bd0e641633

@ -58,8 +58,11 @@ namespace srsran {
#define GTPU_MSG_END_MARKER 254 #define GTPU_MSG_END_MARKER 254
#define GTPU_MSG_DATA_PDU 255 #define GTPU_MSG_DATA_PDU 255
#define GTPU_EXT_NO_MORE_EXTENSION_HEADERS 0x00
#define GTPU_EXT_HEADER_PDCP_PDU_NUMBER 0b11000000 #define GTPU_EXT_HEADER_PDCP_PDU_NUMBER 0b11000000
#define GTPU_EXT_HEADER_PDU_SESSION_CONTAINER 0x85
#define GTPU_EXT_HEADER_PDU_SESSION_CONTAINER_LEN 4
struct gtpu_header_t { struct gtpu_header_t {
uint8_t flags = 0; uint8_t flags = 0;
uint8_t message_type = 0; uint8_t message_type = 0;

@ -112,17 +112,26 @@ bool gtpu_read_ext_header(srsran::byte_buffer_t* pdu,
return true; return true;
} }
if (header->next_ext_hdr_type == GTPU_EXT_HEADER_PDCP_PDU_NUMBER) { // TODO: Iterate over next headers until no more extension headers
pdu->msg += HEADER_PDCP_PDU_NUMBER_SIZE; switch (header->next_ext_hdr_type) {
pdu->N_bytes -= HEADER_PDCP_PDU_NUMBER_SIZE; case GTPU_EXT_HEADER_PDCP_PDU_NUMBER:
header->ext_buffer.resize(HEADER_PDCP_PDU_NUMBER_SIZE); pdu->msg += HEADER_PDCP_PDU_NUMBER_SIZE;
for (size_t i = 0; i < HEADER_PDCP_PDU_NUMBER_SIZE; ++i) { pdu->N_bytes -= HEADER_PDCP_PDU_NUMBER_SIZE;
header->ext_buffer[i] = **ptr; header->ext_buffer.resize(HEADER_PDCP_PDU_NUMBER_SIZE);
(*ptr)++; for (size_t i = 0; i < HEADER_PDCP_PDU_NUMBER_SIZE; ++i) {
} header->ext_buffer[i] = **ptr;
} else { (*ptr)++;
logger.error("gtpu_read_header - Unhandled GTP-U Extension Header Type: 0x%x", header->next_ext_hdr_type); }
return false; break;
case GTPU_EXT_HEADER_PDU_SESSION_CONTAINER:
pdu->msg += GTPU_EXT_HEADER_PDU_SESSION_CONTAINER_LEN;
pdu->N_bytes -= GTPU_EXT_HEADER_PDU_SESSION_CONTAINER_LEN;
logger.warning("skip parsing of GTPU_EXT_HEADER_PDU_SESSION_CONTAINER");
// TODO: Save Header Extension
break;
default:
logger.error("gtpu_read_header - Unhandled GTP-U Extension Header Type: 0x%x", header->next_ext_hdr_type);
return false;
} }
return true; return true;
} }

Loading…
Cancel
Save