enb,s1ap: print filename when writing S1AP PCAP

master
Andre Puschmann 3 years ago
parent e8a464228d
commit b127327684

@ -14,25 +14,23 @@
#define SRSRAN_S1AP_PCAP_H
#include "srsran/common/pcap.h"
#include <string>
namespace srsran {
class s1ap_pcap
{
public:
s1ap_pcap()
{
enable_write = false;
pcap_file = NULL;
}
s1ap_pcap() = default;
void enable();
void open(const char* filename);
void open(const char* filename_);
void close();
void write_s1ap(uint8_t* pdu, uint32_t pdu_len_bytes);
private:
bool enable_write;
FILE* pcap_file;
bool enable_write = false;
std::string filename;
FILE* pcap_file = nullptr;
};
} // namespace srsran

@ -21,14 +21,15 @@ void s1ap_pcap::enable()
{
enable_write = true;
}
void s1ap_pcap::open(const char* filename)
void s1ap_pcap::open(const char* filename_)
{
pcap_file = DLT_PCAP_Open(S1AP_LTE_DLT, filename);
filename = filename_;
pcap_file = DLT_PCAP_Open(S1AP_LTE_DLT, filename.c_str());
enable_write = true;
}
void s1ap_pcap::close()
{
fprintf(stdout, "Saving S1AP PCAP file\n");
fprintf(stdout, "Saving S1AP PCAP file (DLT=%d) to %s\n", S1AP_LTE_DLT, filename.c_str());
DLT_PCAP_Close(pcap_file);
}

Loading…
Cancel
Save