|
|
|
/**
|
|
|
|
*
|
|
|
|
* \section COPYRIGHT
|
|
|
|
*
|
|
|
|
* Copyright 2013-2020 Software Radio Systems Limited
|
|
|
|
*
|
|
|
|
* By using this file, you agree to the terms and conditions set
|
|
|
|
* forth in the LICENSE file which can be found at the top level of
|
|
|
|
* the distribution.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef SRSLTE_MAC_PCAP_H
|
|
|
|
#define SRSLTE_MAC_PCAP_H
|
|
|
|
|
|
|
|
#include "srslte/common/common.h"
|
|
|
|
#include "srslte/common/mac_pcap_base.h"
|
|
|
|
#include "srslte/srslte.h"
|
|
|
|
|
|
|
|
namespace srslte {
|
|
|
|
class mac_pcap : public mac_pcap_base
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
mac_pcap();
|
|
|
|
~mac_pcap();
|
|
|
|
uint32_t open(std::string filename, uint32_t ue_id = 0);
|
|
|
|
uint32_t close();
|
|
|
|
|
|
|
|
private:
|
|
|
|
void write_pdu(srslte::mac_pcap_base::pcap_pdu_t& pdu);
|
|
|
|
FILE* pcap_file = nullptr;
|
|
|
|
uint32_t dlt = 0; // The DLT used for the PCAP file
|
|
|
|
std::string filename;
|
|
|
|
void run_thread() final;
|
|
|
|
};
|
|
|
|
} // namespace srslte
|
|
|
|
|
|
|
|
#endif // SRSLTE_MAC_PCAP_H
|