|
|
|
@ -22,10 +22,14 @@ void nas_pcap::enable()
|
|
|
|
|
enable_write = true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
uint32_t nas_pcap::open(std::string filename_, uint32_t ue_id_)
|
|
|
|
|
uint32_t nas_pcap::open(std::string filename_, uint32_t ue_id_, srsran_rat_t rat_type)
|
|
|
|
|
{
|
|
|
|
|
filename = filename_;
|
|
|
|
|
pcap_file = LTE_PCAP_Open(NAS_LTE_DLT, filename.c_str());
|
|
|
|
|
filename = filename_;
|
|
|
|
|
if (rat_type == srsran_rat_t::nr) {
|
|
|
|
|
pcap_file = DLT_PCAP_Open(NAS_5G_DLT, filename.c_str());
|
|
|
|
|
} else {
|
|
|
|
|
pcap_file = DLT_PCAP_Open(NAS_LTE_DLT, filename.c_str());
|
|
|
|
|
}
|
|
|
|
|
if (pcap_file == nullptr) {
|
|
|
|
|
return SRSRAN_ERROR;
|
|
|
|
|
}
|
|
|
|
@ -37,7 +41,7 @@ uint32_t nas_pcap::open(std::string filename_, uint32_t ue_id_)
|
|
|
|
|
void nas_pcap::close()
|
|
|
|
|
{
|
|
|
|
|
fprintf(stdout, "Saving NAS PCAP file (DLT=%d) to %s \n", NAS_LTE_DLT, filename.c_str());
|
|
|
|
|
LTE_PCAP_Close(pcap_file);
|
|
|
|
|
DLT_PCAP_Close(pcap_file);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void nas_pcap::write_nas(uint8_t* pdu, uint32_t pdu_len_bytes)
|
|
|
|
|