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_DATA_PDU 255
#define GTPU_EXT_NO_MORE_EXTENSION_HEADERS 0x00
#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 {
uint8_t flags = 0;
uint8_t message_type = 0;

@ -112,7 +112,9 @@ bool gtpu_read_ext_header(srsran::byte_buffer_t* pdu,
return true;
}
if (header->next_ext_hdr_type == GTPU_EXT_HEADER_PDCP_PDU_NUMBER) {
// TODO: Iterate over next headers until no more extension headers
switch (header->next_ext_hdr_type) {
case GTPU_EXT_HEADER_PDCP_PDU_NUMBER:
pdu->msg += HEADER_PDCP_PDU_NUMBER_SIZE;
pdu->N_bytes -= HEADER_PDCP_PDU_NUMBER_SIZE;
header->ext_buffer.resize(HEADER_PDCP_PDU_NUMBER_SIZE);
@ -120,7 +122,14 @@ bool gtpu_read_ext_header(srsran::byte_buffer_t* pdu,
header->ext_buffer[i] = **ptr;
(*ptr)++;
}
} else {
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;
}

Loading…
Cancel
Save