mirror of https://github.com/pvnis/srsRAN_4G.git
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
55 lines
1.3 KiB
C
55 lines
1.3 KiB
C
4 years ago
|
/**
|
||
7 years ago
|
*
|
||
4 years ago
|
* \section COPYRIGHT
|
||
7 years ago
|
*
|
||
4 years ago
|
* Copyright 2013-2021 Software Radio Systems Limited
|
||
7 years ago
|
*
|
||
4 years ago
|
* 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.
|
||
7 years ago
|
*
|
||
|
*/
|
||
|
|
||
|
#ifndef RLCPCAP_H
|
||
|
#define RLCPCAP_H
|
||
|
|
||
4 years ago
|
#include "srsran/common/pcap.h"
|
||
|
#include "srsran/interfaces/rlc_interface_types.h"
|
||
5 years ago
|
#include <stdint.h>
|
||
7 years ago
|
|
||
4 years ago
|
namespace srsran {
|
||
7 years ago
|
|
||
|
class rlc_pcap
|
||
|
{
|
||
5 years ago
|
public:
|
||
4 years ago
|
rlc_pcap() {}
|
||
7 years ago
|
void enable(bool en);
|
||
4 years ago
|
void open(const char* filename, rlc_config_t config);
|
||
7 years ago
|
void close();
|
||
|
|
||
|
void set_ue_id(uint16_t ue_id);
|
||
|
|
||
4 years ago
|
void write_dl_ccch(uint8_t* pdu, uint32_t pdu_len_bytes);
|
||
|
void write_ul_ccch(uint8_t* pdu, uint32_t pdu_len_bytes);
|
||
5 years ago
|
|
||
7 years ago
|
private:
|
||
4 years ago
|
bool enable_write = false;
|
||
|
FILE* pcap_file = nullptr;
|
||
|
uint32_t ue_id = 0;
|
||
|
uint8_t mode = 0;
|
||
|
uint8_t sn_length = 0;
|
||
5 years ago
|
void pack_and_write(uint8_t* pdu,
|
||
|
uint32_t pdu_len_bytes,
|
||
|
uint8_t mode,
|
||
|
uint8_t direction,
|
||
|
uint8_t priority,
|
||
|
uint8_t seqnumberlength,
|
||
|
uint16_t ueid,
|
||
|
uint16_t channel_type,
|
||
|
uint16_t channel_id);
|
||
7 years ago
|
};
|
||
|
|
||
4 years ago
|
} // namespace srsran
|
||
7 years ago
|
|
||
|
#endif // RLCPCAP_H
|