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
|
|
|
*
|
2021-03-19 03:45:56 -07:00
|
|
|
* Copyright 2013-2021 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
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
2021-03-19 03:45:56 -07:00
|
|
|
#ifndef SRSRAN_MAC_PCAP_H
|
|
|
|
#define SRSRAN_MAC_PCAP_H
|
2017-05-18 03:11:31 -07:00
|
|
|
|
2021-03-19 03:45:56 -07:00
|
|
|
#include "srsran/common/common.h"
|
|
|
|
#include "srsran/common/mac_pcap_base.h"
|
|
|
|
#include "srsran/srsran.h"
|
2021-02-03 01:26:04 -08:00
|
|
|
|
2021-03-19 03:45:56 -07:00
|
|
|
namespace srsran {
|
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-03-19 03:45:56 -07:00
|
|
|
void write_pdu(srsran::mac_pcap_base::pcap_pdu_t& pdu);
|
2021-02-26 05:32:57 -08:00
|
|
|
|
2021-02-26 02:18:57 -08:00
|
|
|
FILE* pcap_file = nullptr;
|
|
|
|
uint32_t dlt = 0; // The DLT used for the PCAP file
|
|
|
|
std::string filename;
|
2017-05-18 03:11:31 -07:00
|
|
|
};
|
2021-03-19 03:45:56 -07:00
|
|
|
} // namespace srsran
|
2017-05-18 03:11:31 -07:00
|
|
|
|
2021-03-19 03:45:56 -07:00
|
|
|
#endif // SRSRAN_MAC_PCAP_H
|