srsLTE/lib/include/srslte/common/mac_pcap.h

38 lines
866 B
C
Raw Normal View History

/**
*
* \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.
*
*/
2018-03-31 10:04:04 -07:00
#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"
2021-02-03 01:26:04 -08:00
namespace srslte {
class mac_pcap : public mac_pcap_base
{
2019-01-17 03:42:01 -08:00
public:
2021-02-26 00:56:22 -08:00
mac_pcap();
~mac_pcap();
uint32_t open(std::string filename, uint32_t ue_id = 0);
uint32_t close();
2017-11-23 10:46:34 -08:00
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;
};
2018-03-31 10:04:04 -07:00
} // namespace srslte
#endif // SRSLTE_MAC_PCAP_H