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

38 lines
826 B
C
Raw Normal View History

/**
*
* \section COPYRIGHT
*
2021-03-19 03:45:56 -07:00
* Copyright 2013-2021 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.
*
*/
2021-03-19 03:45:56 -07:00
#ifndef SRSRAN_MAC_PCAP_H
#define SRSRAN_MAC_PCAP_H
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 {
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:
2021-03-19 03:45:56 -07:00
void write_pdu(srsran::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;
};
2021-03-19 03:45:56 -07:00
} // namespace srsran
2021-03-19 03:45:56 -07:00
#endif // SRSRAN_MAC_PCAP_H