2020-11-26 01:25:22 -08:00
|
|
|
/**
|
2017-05-18 03:11:31 -07:00
|
|
|
*
|
2020-11-26 01:25:22 -08:00
|
|
|
* \section COPYRIGHT
|
2017-05-18 03:11:31 -07:00
|
|
|
*
|
2020-11-26 01:25:22 -08:00
|
|
|
* Copyright 2013-2020 Software Radio Systems Limited
|
2017-05-18 03:11:31 -07:00
|
|
|
*
|
2020-11-26 01:25:22 -08:00
|
|
|
* 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.
|
2017-05-18 03:11:31 -07:00
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
2018-03-31 10:04:04 -07:00
|
|
|
#ifndef SRSLTE_MAC_PCAP_H
|
|
|
|
#define SRSLTE_MAC_PCAP_H
|
2017-05-18 03:11:31 -07:00
|
|
|
|
2020-12-30 08:52:53 -08:00
|
|
|
#include "srslte/common/common.h"
|
2021-02-26 02:18:57 -08:00
|
|
|
#include "srslte/common/mac_pcap_base.h"
|
|
|
|
#include "srslte/srslte.h"
|
2021-02-03 01:26:04 -08:00
|
|
|
|
2017-05-18 03:11:31 -07:00
|
|
|
namespace srslte {
|
2021-02-26 02:18:57 -08:00
|
|
|
class mac_pcap : public mac_pcap_base
|
2017-05-18 03:11:31 -07:00
|
|
|
{
|
2019-01-17 03:42:01 -08:00
|
|
|
public:
|
2021-02-26 00:56:22 -08:00
|
|
|
mac_pcap();
|
2019-06-07 13:14:24 -07:00
|
|
|
~mac_pcap();
|
2021-02-03 05:22:01 -08:00
|
|
|
uint32_t open(std::string filename, uint32_t ue_id = 0);
|
2020-12-30 08:52:53 -08:00
|
|
|
uint32_t close();
|
2017-11-23 10:46:34 -08:00
|
|
|
|
2017-05-18 03:11:31 -07:00
|
|
|
private:
|
2021-02-26 02:18:57 -08:00
|
|
|
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;
|
2017-05-18 03:11:31 -07:00
|
|
|
};
|
2018-03-31 10:04:04 -07:00
|
|
|
} // namespace srslte
|
2017-05-18 03:11:31 -07:00
|
|
|
|
2021-02-26 02:18:57 -08:00
|
|
|
#endif // SRSLTE_MAC_PCAP_H
|