Fix SDAP, get QFI & PDUSession ID from CN

parent 4154e9e9
...@@ -484,12 +484,12 @@ static void *ue_tun_read_thread(void *_) ...@@ -484,12 +484,12 @@ static void *ue_tun_read_thread(void *_)
ctxt.rnti = rnti; ctxt.rnti = rnti;
bool dc = SDAP_HDR_UL_DATA_PDU; bool dc = SDAP_HDR_UL_DATA_PDU;
uint8_t qfi = 7; extern uint8_t nas_qfi;
int pdusession_id = 10; extern uint8_t nas_pduid;
sdap_data_req(&ctxt, SRB_FLAG_NO, rb_id, RLC_MUI_UNDEFINED, sdap_data_req(&ctxt, SRB_FLAG_NO, rb_id, RLC_MUI_UNDEFINED,
RLC_SDU_CONFIRM_NO, len, (unsigned char *)rx_buf, RLC_SDU_CONFIRM_NO, len, (unsigned char *)rx_buf,
PDCP_TRANSMISSION_MODE_DATA, NULL, NULL, qfi, dc, pdusession_id); PDCP_TRANSMISSION_MODE_DATA, NULL, NULL, nas_qfi, dc, nas_pduid);
} }
return NULL; return NULL;
......
...@@ -21,6 +21,9 @@ ...@@ -21,6 +21,9 @@
#include "nr_sdap.h" #include "nr_sdap.h"
uint8_t nas_qfi;
uint8_t nas_pduid;
bool sdap_data_req(protocol_ctxt_t *ctxt_p, bool sdap_data_req(protocol_ctxt_t *ctxt_p,
const srb_flag_t srb_flag, const srb_flag_t srb_flag,
const rb_id_t rb_id, const rb_id_t rb_id,
...@@ -84,3 +87,9 @@ void sdap_data_ind(rb_id_t pdcp_entity, ...@@ -84,3 +87,9 @@ void sdap_data_ind(rb_id_t pdcp_entity,
buf, buf,
size); size);
} }
void set_qfi_pduid(uint8_t qfi, uint8_t pduid){
nas_qfi = qfi;
nas_pduid = pduid;
return;
}
...@@ -62,4 +62,6 @@ void sdap_data_ind(rb_id_t pdcp_entity, ...@@ -62,4 +62,6 @@ void sdap_data_ind(rb_id_t pdcp_entity,
int size int size
); );
void set_qfi_pduid(uint8_t qfi, uint8_t pduid);
#endif #endif
...@@ -44,6 +44,7 @@ ...@@ -44,6 +44,7 @@
#include <openair3/NAS/COMMON/NR_NAS_defs.h> #include <openair3/NAS/COMMON/NR_NAS_defs.h>
#include <openair1/PHY/phy_extern_nr_ue.h> #include <openair1/PHY/phy_extern_nr_ue.h>
#include <openair1/SIMULATION/ETH_TRANSPORT/proto.h> #include <openair1/SIMULATION/ETH_TRANSPORT/proto.h>
#include "openair2/SDAP/nr_sdap/nr_sdap.h"
uint8_t *registration_request_buf; uint8_t *registration_request_buf;
uint32_t registration_request_len; uint32_t registration_request_len;
...@@ -915,7 +916,7 @@ void *nas_nrue_task(void *args_p) ...@@ -915,7 +916,7 @@ void *nas_nrue_task(void *args_p)
payload_container = pdu_buffer + offset; payload_container = pdu_buffer + offset;
} }
offset = 0; offset = 0;
uint8_t pdu_id = *(pdu_buffer+14);
while(offset < payload_container_length) { while(offset < payload_container_length) {
// Fixme: this is not good 'type' 0x29 searching in TLV like structure // Fixme: this is not good 'type' 0x29 searching in TLV like structure
// AND fix dirsty code copy hereafter of the same!!! // AND fix dirsty code copy hereafter of the same!!!
...@@ -929,9 +930,13 @@ void *nas_nrue_task(void *args_p) ...@@ -929,9 +930,13 @@ void *nas_nrue_task(void *args_p)
*(payload_container+offset+3), *(payload_container+offset+4), *(payload_container+offset+3), *(payload_container+offset+4),
*(payload_container+offset+5), *(payload_container+offset+6)); *(payload_container+offset+5), *(payload_container+offset+6));
nas_config(1,third_octet,fourth_octet,"oaitun_ue"); nas_config(1,third_octet,fourth_octet,"oaitun_ue");
break;
} }
} }
if (*(payload_container + offset) == 0x79) {
uint8_t qfi = *(payload_container+offset+3);
set_qfi_pduid(qfi, pdu_id);
break;
}
offset++; offset++;
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment