added _t to unique_byte_buffer type

master
Francisco Paisana 6 years ago committed by Andre Puschmann
parent bc01a5ecda
commit 3bedc93ba5

@ -231,14 +231,15 @@ inline void byte_buffer_deleter::operator()(byte_buffer_t* buf) const
}
}
inline unique_byte_buffer allocate_unique_buffer(byte_buffer_pool& pool, bool blocking = false)
inline unique_byte_buffer_t allocate_unique_buffer(byte_buffer_pool& pool, bool blocking = false)
{
return std::move(unique_byte_buffer(pool.allocate(nullptr, blocking), byte_buffer_deleter(&pool)));
return std::move(unique_byte_buffer_t(pool.allocate(nullptr, blocking), byte_buffer_deleter(&pool)));
}
inline unique_byte_buffer allocate_unique_buffer(byte_buffer_pool& pool, const char* debug_name, bool blocking = false)
inline unique_byte_buffer_t
allocate_unique_buffer(byte_buffer_pool& pool, const char* debug_name, bool blocking = false)
{
return std::move(unique_byte_buffer(pool.allocate(debug_name, blocking), byte_buffer_deleter(&pool)));
return std::move(unique_byte_buffer_t(pool.allocate(debug_name, blocking), byte_buffer_deleter(&pool)));
}
} // namespace srsue

@ -277,7 +277,7 @@ public:
byte_buffer_pool* pool;
};
typedef std::unique_ptr<byte_buffer_t, byte_buffer_deleter> unique_byte_buffer;
typedef std::unique_ptr<byte_buffer_t, byte_buffer_deleter> unique_byte_buffer_t;
} // namespace srslte

@ -179,7 +179,7 @@ class rlc_interface_pdcp
public:
/* PDCP calls RLC to push an RLC SDU. SDU gets placed into the RLC buffer and MAC pulls
* RLC PDUs according to TB size. */
virtual void write_sdu(uint16_t rnti, uint32_t lcid, srslte::unique_byte_buffer sdu) = 0;
virtual void write_sdu(uint16_t rnti, uint32_t lcid, srslte::unique_byte_buffer_t sdu) = 0;
virtual bool rb_is_um(uint16_t rnti, uint32_t lcid) = 0;
};
@ -199,7 +199,7 @@ public:
class pdcp_interface_gtpu
{
public:
virtual void write_sdu(uint16_t rnti, uint32_t lcid, srslte::unique_byte_buffer sdu) = 0;
virtual void write_sdu(uint16_t rnti, uint32_t lcid, srslte::unique_byte_buffer_t sdu) = 0;
};
// PDCP interface for RRC
@ -209,7 +209,7 @@ public:
virtual void reset(uint16_t rnti) = 0;
virtual void add_user(uint16_t rnti) = 0;
virtual void rem_user(uint16_t rnti) = 0;
virtual void write_sdu(uint16_t rnti, uint32_t lcid, srslte::unique_byte_buffer sdu) = 0;
virtual void write_sdu(uint16_t rnti, uint32_t lcid, srslte::unique_byte_buffer_t sdu) = 0;
virtual void add_bearer(uint16_t rnti, uint32_t lcid, srslte::srslte_pdcp_config_t cnfg) = 0;
virtual void config_security(uint16_t rnti,
uint32_t lcid,
@ -227,7 +227,7 @@ class pdcp_interface_rlc
{
public:
/* RLC calls PDCP to push a PDCP PDU. */
virtual void write_pdu(uint16_t rnti, uint32_t lcid, srslte::unique_byte_buffer sdu) = 0;
virtual void write_pdu(uint16_t rnti, uint32_t lcid, srslte::unique_byte_buffer_t sdu) = 0;
};
// RRC interface for RLC
@ -255,14 +255,14 @@ public:
class rrc_interface_pdcp
{
public:
virtual void write_pdu(uint16_t rnti, uint32_t lcid, srslte::unique_byte_buffer pdu) = 0;
virtual void write_pdu(uint16_t rnti, uint32_t lcid, srslte::unique_byte_buffer_t pdu) = 0;
};
// RRC interface for S1AP
class rrc_interface_s1ap
{
public:
virtual void write_dl_info(uint16_t rnti, srslte::unique_byte_buffer sdu) = 0;
virtual void write_dl_info(uint16_t rnti, srslte::unique_byte_buffer_t sdu) = 0;
virtual void release_complete(uint16_t rnti) = 0;
virtual bool setup_ue_ctxt(uint16_t rnti, LIBLTE_S1AP_MESSAGE_INITIALCONTEXTSETUPREQUEST_STRUCT *msg) = 0;
virtual bool setup_ue_erabs(uint16_t rnti, LIBLTE_S1AP_MESSAGE_E_RABSETUPREQUEST_STRUCT *msg) = 0;
@ -274,7 +274,7 @@ public:
class gtpu_interface_pdcp
{
public:
virtual void write_pdu(uint16_t rnti, uint32_t lcid, srslte::unique_byte_buffer pdu) = 0;
virtual void write_pdu(uint16_t rnti, uint32_t lcid, srslte::unique_byte_buffer_t pdu) = 0;
};
// GTPU interface for RRC
@ -291,13 +291,13 @@ class s1ap_interface_rrc
{
public:
virtual void
initial_ue(uint16_t rnti, LIBLTE_S1AP_RRC_ESTABLISHMENT_CAUSE_ENUM cause, srslte::unique_byte_buffer pdu) = 0;
initial_ue(uint16_t rnti, LIBLTE_S1AP_RRC_ESTABLISHMENT_CAUSE_ENUM cause, srslte::unique_byte_buffer_t pdu) = 0;
virtual void initial_ue(uint16_t rnti,
LIBLTE_S1AP_RRC_ESTABLISHMENT_CAUSE_ENUM cause,
srslte::unique_byte_buffer pdu,
srslte::unique_byte_buffer_t pdu,
uint32_t m_tmsi,
uint8_t mmec) = 0;
virtual void write_pdu(uint16_t rnti, srslte::unique_byte_buffer pdu) = 0;
virtual void write_pdu(uint16_t rnti, srslte::unique_byte_buffer_t pdu) = 0;
virtual bool user_exists(uint16_t rnti) = 0;
virtual bool user_release(uint16_t rnti, LIBLTE_S1AP_CAUSERADIONETWORK_ENUM cause_radio) = 0;
virtual void ue_ctxt_setup_complete(uint16_t rnti, LIBLTE_S1AP_MESSAGE_INITIALCONTEXTSETUPRESPONSE_STRUCT *res) = 0;

@ -114,8 +114,8 @@ public:
class gw_interface_pdcp
{
public:
virtual void write_pdu(uint32_t lcid, srslte::unique_byte_buffer pdu) = 0;
virtual void write_pdu_mch(uint32_t lcid, srslte::unique_byte_buffer pdu) = 0;
virtual void write_pdu(uint32_t lcid, srslte::unique_byte_buffer_t pdu) = 0;
virtual void write_pdu_mch(uint32_t lcid, srslte::unique_byte_buffer_t pdu) = 0;
};
// NAS interface for RRC
@ -132,7 +132,7 @@ public:
virtual void set_barring(barring_t barring) = 0;
virtual void paging(asn1::rrc::s_tmsi_s* ue_identiy) = 0;
virtual bool is_attached() = 0;
virtual void write_pdu(uint32_t lcid, srslte::unique_byte_buffer pdu) = 0;
virtual void write_pdu(uint32_t lcid, srslte::unique_byte_buffer_t pdu) = 0;
virtual uint32_t get_k_enb_count() = 0;
virtual bool get_k_asme(uint8_t *k_asme_, uint32_t n) = 0;
virtual uint32_t get_ipv4_addr() = 0;
@ -189,14 +189,14 @@ public:
const static int MAX_FOUND_PLMNS = 16;
virtual void write_sdu(srslte::unique_byte_buffer sdu) = 0;
virtual void write_sdu(srslte::unique_byte_buffer_t sdu) = 0;
virtual uint16_t get_mcc() = 0;
virtual uint16_t get_mnc() = 0;
virtual void enable_capabilities() = 0;
virtual int plmn_search(found_plmn_t found_plmns[MAX_FOUND_PLMNS]) = 0;
virtual void plmn_select(asn1::rrc::plmn_id_s plmn_id) = 0;
virtual bool connection_request(asn1::rrc::establishment_cause_e cause,
srslte::unique_byte_buffer dedicatedInfoNAS) = 0;
srslte::unique_byte_buffer_t dedicatedInfoNAS) = 0;
virtual void set_ue_idenity(asn1::rrc::s_tmsi_s s_tmsi) = 0;
virtual bool is_connected() = 0;
virtual std::string get_rb_name(uint32_t lcid) = 0;
@ -206,11 +206,11 @@ public:
class rrc_interface_pdcp
{
public:
virtual void write_pdu(uint32_t lcid, srslte::unique_byte_buffer pdu) = 0;
virtual void write_pdu_bcch_bch(srslte::unique_byte_buffer pdu) = 0;
virtual void write_pdu_bcch_dlsch(srslte::unique_byte_buffer pdu) = 0;
virtual void write_pdu_pcch(srslte::unique_byte_buffer pdu) = 0;
virtual void write_pdu_mch(uint32_t lcid, srslte::unique_byte_buffer pdu) = 0;
virtual void write_pdu(uint32_t lcid, srslte::unique_byte_buffer_t pdu) = 0;
virtual void write_pdu_bcch_bch(srslte::unique_byte_buffer_t pdu) = 0;
virtual void write_pdu_bcch_dlsch(srslte::unique_byte_buffer_t pdu) = 0;
virtual void write_pdu_pcch(srslte::unique_byte_buffer_t pdu) = 0;
virtual void write_pdu_mch(uint32_t lcid, srslte::unique_byte_buffer_t pdu) = 0;
virtual std::string get_rb_name(uint32_t lcid) = 0;
};
@ -226,7 +226,7 @@ public:
class pdcp_interface_gw
{
public:
virtual void write_sdu(uint32_t lcid, srslte::unique_byte_buffer sdu, bool blocking) = 0;
virtual void write_sdu(uint32_t lcid, srslte::unique_byte_buffer_t sdu, bool blocking) = 0;
virtual bool is_lcid_enabled(uint32_t lcid) = 0;
};
@ -236,7 +236,7 @@ class pdcp_interface_rrc
public:
virtual void reestablish() = 0;
virtual void reset() = 0;
virtual void write_sdu(uint32_t lcid, srslte::unique_byte_buffer sdu, bool blocking = true) = 0;
virtual void write_sdu(uint32_t lcid, srslte::unique_byte_buffer_t sdu, bool blocking = true) = 0;
virtual void add_bearer(uint32_t lcid, srslte::srslte_pdcp_config_t cnfg = srslte::srslte_pdcp_config_t()) = 0;
virtual void change_lcid(uint32_t old_lcid, uint32_t new_lcid) = 0;
virtual void config_security(uint32_t lcid,
@ -261,11 +261,11 @@ class pdcp_interface_rlc
{
public:
/* RLC calls PDCP to push a PDCP PDU. */
virtual void write_pdu(uint32_t lcid, srslte::unique_byte_buffer sdu) = 0;
virtual void write_pdu_bcch_bch(srslte::unique_byte_buffer sdu) = 0;
virtual void write_pdu_bcch_dlsch(srslte::unique_byte_buffer sdu) = 0;
virtual void write_pdu_pcch(srslte::unique_byte_buffer sdu) = 0;
virtual void write_pdu_mch(uint32_t lcid, srslte::unique_byte_buffer sdu) = 0;
virtual void write_pdu(uint32_t lcid, srslte::unique_byte_buffer_t sdu) = 0;
virtual void write_pdu_bcch_bch(srslte::unique_byte_buffer_t sdu) = 0;
virtual void write_pdu_bcch_dlsch(srslte::unique_byte_buffer_t sdu) = 0;
virtual void write_pdu_pcch(srslte::unique_byte_buffer_t sdu) = 0;
virtual void write_pdu_mch(uint32_t lcid, srslte::unique_byte_buffer_t sdu) = 0;
};
// RLC interface for RRC
@ -290,7 +290,7 @@ class rlc_interface_pdcp
public:
/* PDCP calls RLC to push an RLC SDU. SDU gets placed into the RLC buffer and MAC pulls
* RLC PDUs according to TB size. */
virtual void write_sdu(uint32_t lcid, srslte::unique_byte_buffer sdu, bool blocking = true) = 0;
virtual void write_sdu(uint32_t lcid, srslte::unique_byte_buffer_t sdu, bool blocking = true) = 0;
virtual bool rb_is_um(uint32_t lcid) = 0;
};

@ -51,8 +51,8 @@ public:
// RRC interface
void reestablish();
void reset();
void write_sdu(uint32_t lcid, unique_byte_buffer sdu, bool blocking = true);
void write_sdu_mch(uint32_t lcid, unique_byte_buffer sdu);
void write_sdu(uint32_t lcid, unique_byte_buffer_t sdu, bool blocking = true);
void write_sdu_mch(uint32_t lcid, unique_byte_buffer_t sdu);
void add_bearer(uint32_t lcid, srslte_pdcp_config_t cnfg = srslte_pdcp_config_t());
void add_bearer_mrb(uint32_t lcid, srslte_pdcp_config_t cnfg = srslte_pdcp_config_t());
void del_bearer(uint32_t lcid);
@ -74,11 +74,11 @@ public:
uint32_t get_ul_count(uint32_t lcid);
// RLC interface
void write_pdu(uint32_t lcid, unique_byte_buffer sdu);
void write_pdu_mch(uint32_t lcid, unique_byte_buffer sdu);
void write_pdu_bcch_bch(unique_byte_buffer sdu);
void write_pdu_bcch_dlsch(unique_byte_buffer sdu);
void write_pdu_pcch(unique_byte_buffer sdu);
void write_pdu(uint32_t lcid, unique_byte_buffer_t sdu);
void write_pdu_mch(uint32_t lcid, unique_byte_buffer_t sdu);
void write_pdu_bcch_bch(unique_byte_buffer_t sdu);
void write_pdu_bcch_dlsch(unique_byte_buffer_t sdu);
void write_pdu_pcch(unique_byte_buffer_t sdu);
private:
srsue::rlc_interface_pdcp *rlc;

@ -72,7 +72,7 @@ public:
bool is_active();
// RRC interface
void write_sdu(unique_byte_buffer sdu, bool blocking);
void write_sdu(unique_byte_buffer_t sdu, bool blocking);
void config_security(uint8_t *k_rrc_enc_,
uint8_t *k_rrc_int_,
uint8_t *k_up_enc_,
@ -84,7 +84,7 @@ public:
uint32_t get_ul_count();
// RLC interface
void write_pdu(unique_byte_buffer pdu);
void write_pdu(unique_byte_buffer_t pdu);
private:
byte_buffer_pool *pool;

@ -50,7 +50,7 @@ public:
virtual bool is_active() = 0;
// RRC interface
virtual void write_sdu(unique_byte_buffer sdu, bool blocking) = 0;
virtual void write_sdu(unique_byte_buffer_t sdu, bool blocking) = 0;
virtual void config_security(uint8_t *k_rrc_enc_,
uint8_t *k_rrc_int_,
uint8_t *k_up_enc_,
@ -62,7 +62,7 @@ public:
virtual uint32_t get_ul_count() = 0;
// RLC interface
virtual void write_pdu(unique_byte_buffer pdu) = 0;
virtual void write_pdu(unique_byte_buffer_t pdu) = 0;
};
} // namespace srslte

@ -56,8 +56,8 @@ public:
void get_metrics(rlc_metrics_t &m);
// PDCP interface
void write_sdu(uint32_t lcid, unique_byte_buffer sdu, bool blocking = true);
void write_sdu_mch(uint32_t lcid, unique_byte_buffer sdu);
void write_sdu(uint32_t lcid, unique_byte_buffer_t sdu, bool blocking = true);
void write_sdu_mch(uint32_t lcid, unique_byte_buffer_t sdu);
bool rb_is_um(uint32_t lcid);
// MAC interface

@ -39,7 +39,7 @@ namespace srslte {
struct rlc_amd_rx_pdu_t{
rlc_amd_pdu_header_t header;
unique_byte_buffer buf;
unique_byte_buffer_t buf;
};
struct rlc_amd_rx_pdu_segments_t{
@ -48,7 +48,7 @@ struct rlc_amd_rx_pdu_segments_t{
struct rlc_amd_tx_pdu_t{
rlc_amd_pdu_header_t header;
unique_byte_buffer buf;
unique_byte_buffer_t buf;
uint32_t retx_count;
bool is_acked;
};
@ -81,7 +81,7 @@ public:
uint32_t get_bearer();
// PDCP interface
void write_sdu(unique_byte_buffer sdu, bool blocking = true);
void write_sdu(unique_byte_buffer_t sdu, bool blocking = true);
// MAC interface
bool has_data();
@ -109,7 +109,7 @@ private:
void reestablish();
void stop();
void write_sdu(unique_byte_buffer sdu, bool blocking);
void write_sdu(unique_byte_buffer_t sdu, bool blocking);
int read_pdu(uint8_t *payload, uint32_t nof_bytes);
bool has_data();
@ -156,7 +156,7 @@ private:
// TX SDU buffers
rlc_tx_queue tx_sdu_queue;
unique_byte_buffer tx_sdu;
unique_byte_buffer_t tx_sdu;
;
bool tx_enabled;
@ -246,7 +246,7 @@ private:
srslte_rlc_am_config_t cfg;
// RX SDU buffers
unique_byte_buffer rx_sdu;
unique_byte_buffer_t rx_sdu;
/****************************************************************************
* State variables and counters

@ -161,7 +161,7 @@ public:
virtual void reset_metrics() = 0;
// PDCP interface
virtual void write_sdu(unique_byte_buffer sdu, bool blocking) = 0;
virtual void write_sdu(unique_byte_buffer_t sdu, bool blocking) = 0;
// MAC interface
virtual bool has_data() = 0;

@ -54,7 +54,7 @@ public:
void reset_metrics();
// PDCP interface
void write_sdu(unique_byte_buffer sdu, bool blocking);
void write_sdu(unique_byte_buffer_t sdu, bool blocking);
// MAC interface
bool has_data();

@ -36,7 +36,7 @@
namespace srslte {
class rlc_tx_queue : public block_queue<unique_byte_buffer>::call_mutexed_itf
class rlc_tx_queue : public block_queue<unique_byte_buffer_t>::call_mutexed_itf
{
public:
rlc_tx_queue(int capacity = 128) : queue(capacity) {
@ -44,8 +44,8 @@ public:
queue.set_mutexed_itf(this);
}
// increase/decrease unread_bytes inside push/pop mutexed operations
void pushing(const unique_byte_buffer& msg) final { unread_bytes += msg->N_bytes; }
void popping(const unique_byte_buffer& msg) final
void pushing(const unique_byte_buffer_t& msg) final { unread_bytes += msg->N_bytes; }
void popping(const unique_byte_buffer_t& msg) final
{
if (unread_bytes > msg->N_bytes) {
unread_bytes -= msg->N_bytes;
@ -53,13 +53,13 @@ public:
unread_bytes = 0;
}
}
void write(unique_byte_buffer msg) { queue.push(std::move(msg)); }
void write(unique_byte_buffer_t msg) { queue.push(std::move(msg)); }
std::pair<bool, unique_byte_buffer> try_write(unique_byte_buffer&& msg) { return queue.try_push(std::move(msg)); }
std::pair<bool, unique_byte_buffer_t> try_write(unique_byte_buffer_t&& msg) { return queue.try_push(std::move(msg)); }
unique_byte_buffer read() { return queue.wait_pop(); }
unique_byte_buffer_t read() { return queue.wait_pop(); }
bool try_read(unique_byte_buffer* msg) { return queue.try_pop(msg); }
bool try_read(unique_byte_buffer_t* msg) { return queue.try_pop(msg); }
void resize(uint32_t capacity)
{
@ -78,7 +78,7 @@ public:
uint32_t size_tail_bytes()
{
if (!queue.empty()) {
const unique_byte_buffer& m = queue.front();
const unique_byte_buffer_t& m = queue.front();
if (m.get()) {
return m->N_bytes;
}
@ -96,7 +96,7 @@ public:
}
private:
block_queue<unique_byte_buffer> queue;
block_queue<unique_byte_buffer_t> queue;
uint32_t unread_bytes;
};

@ -36,7 +36,7 @@ namespace srslte {
struct rlc_umd_pdu_t{
rlc_umd_pdu_header_t header;
unique_byte_buffer buf;
unique_byte_buffer_t buf;
};
class rlc_um
@ -60,7 +60,7 @@ public:
uint32_t get_bearer();
// PDCP interface
void write_sdu(unique_byte_buffer sdu, bool blocking = true);
void write_sdu(unique_byte_buffer_t sdu, bool blocking = true);
// MAC interface
bool has_data();
@ -87,8 +87,8 @@ private:
void stop();
void reestablish();
void empty_queue();
void write_sdu(unique_byte_buffer sdu);
void try_write_sdu(unique_byte_buffer sdu);
void write_sdu(unique_byte_buffer_t sdu);
void try_write_sdu(unique_byte_buffer_t sdu);
uint32_t get_num_tx_bytes();
void reset_metrics();
bool has_data();
@ -107,7 +107,7 @@ private:
// TX SDU buffers
rlc_tx_queue tx_sdu_queue;
unique_byte_buffer tx_sdu;
unique_byte_buffer_t tx_sdu;
/****************************************************************************
* State variables and counters
@ -168,7 +168,7 @@ private:
std::map<uint32_t, rlc_umd_pdu_t> rx_window;
// RX SDU buffers
unique_byte_buffer rx_sdu;
unique_byte_buffer_t rx_sdu;
uint32_t vr_ur_in_rx_sdu;
// Rx state variables and counter

@ -117,7 +117,7 @@ bool pdcp::is_lcid_enabled(uint32_t lcid)
return ret;
}
void pdcp::write_sdu(uint32_t lcid, unique_byte_buffer sdu, bool blocking)
void pdcp::write_sdu(uint32_t lcid, unique_byte_buffer_t sdu, bool blocking)
{
pthread_rwlock_rdlock(&rwlock);
if (valid_lcid(lcid)) {
@ -128,7 +128,7 @@ void pdcp::write_sdu(uint32_t lcid, unique_byte_buffer sdu, bool blocking)
pthread_rwlock_unlock(&rwlock);
}
void pdcp::write_sdu_mch(uint32_t lcid, unique_byte_buffer sdu)
void pdcp::write_sdu_mch(uint32_t lcid, unique_byte_buffer_t sdu)
{
pthread_rwlock_rdlock(&rwlock);
if (valid_mch_lcid(lcid)){
@ -276,7 +276,7 @@ uint32_t pdcp::get_ul_count(uint32_t lcid)
/*******************************************************************************
RLC interface
*******************************************************************************/
void pdcp::write_pdu(uint32_t lcid, unique_byte_buffer pdu)
void pdcp::write_pdu(uint32_t lcid, unique_byte_buffer_t pdu)
{
pthread_rwlock_rdlock(&rwlock);
if (valid_lcid(lcid)) {
@ -287,22 +287,22 @@ void pdcp::write_pdu(uint32_t lcid, unique_byte_buffer pdu)
pthread_rwlock_unlock(&rwlock);
}
void pdcp::write_pdu_bcch_bch(unique_byte_buffer sdu)
void pdcp::write_pdu_bcch_bch(unique_byte_buffer_t sdu)
{
rrc->write_pdu_bcch_bch(std::move(sdu));
}
void pdcp::write_pdu_bcch_dlsch(unique_byte_buffer sdu)
void pdcp::write_pdu_bcch_dlsch(unique_byte_buffer_t sdu)
{
rrc->write_pdu_bcch_dlsch(std::move(sdu));
}
void pdcp::write_pdu_pcch(unique_byte_buffer sdu)
void pdcp::write_pdu_pcch(unique_byte_buffer_t sdu)
{
rrc->write_pdu_pcch(std::move(sdu));
}
void pdcp::write_pdu_mch(uint32_t lcid, unique_byte_buffer sdu)
void pdcp::write_pdu_mch(uint32_t lcid, unique_byte_buffer_t sdu)
{
if (0 == lcid) {
rrc->write_pdu_mch(lcid, std::move(sdu));

@ -112,7 +112,7 @@ bool pdcp_entity::is_active()
}
// GW/RRC interface
void pdcp_entity::write_sdu(unique_byte_buffer sdu, bool blocking)
void pdcp_entity::write_sdu(unique_byte_buffer_t sdu, bool blocking)
{
log->info_hex(sdu->msg, sdu->N_bytes,
"TX %s SDU, SN: %d, do_integrity = %s, do_encryption = %s",
@ -178,7 +178,7 @@ void pdcp_entity::enable_encryption()
}
// RLC interface
void pdcp_entity::write_pdu(unique_byte_buffer pdu)
void pdcp_entity::write_pdu(unique_byte_buffer_t pdu)
{
log->info_hex(pdu->msg, pdu->N_bytes, "RX %s PDU, do_integrity = %s, do_encryption = %s",
rrc->get_rb_name(lcid).c_str(), (do_integrity) ? "true" : "false", (do_encryption) ? "true" : "false");

@ -199,7 +199,7 @@ void rlc::empty_queue()
PDCP interface
*******************************************************************************/
void rlc::write_sdu(uint32_t lcid, unique_byte_buffer sdu, bool blocking)
void rlc::write_sdu(uint32_t lcid, unique_byte_buffer_t sdu, bool blocking)
{
// FIXME: rework build PDU logic to allow large SDUs (without concatenation)
if (sdu->N_bytes > RLC_MAX_SDU_SIZE) {
@ -216,7 +216,7 @@ void rlc::write_sdu(uint32_t lcid, unique_byte_buffer sdu, bool blocking)
pthread_rwlock_unlock(&rwlock);
}
void rlc::write_sdu_mch(uint32_t lcid, unique_byte_buffer sdu)
void rlc::write_sdu_mch(uint32_t lcid, unique_byte_buffer_t sdu)
{
pthread_rwlock_rdlock(&rwlock);
if (valid_lcid_mrb(lcid)) {
@ -331,7 +331,7 @@ void rlc::write_pdu(uint32_t lcid, uint8_t *payload, uint32_t nof_bytes)
void rlc::write_pdu_bcch_bch(uint8_t *payload, uint32_t nof_bytes)
{
rlc_log->info_hex(payload, nof_bytes, "BCCH BCH message received.");
unique_byte_buffer buf = allocate_unique_buffer(*pool);
unique_byte_buffer_t buf = allocate_unique_buffer(*pool);
if (buf != NULL) {
memcpy(buf->msg, payload, nof_bytes);
buf->N_bytes = nof_bytes;
@ -346,7 +346,7 @@ void rlc::write_pdu_bcch_bch(uint8_t *payload, uint32_t nof_bytes)
void rlc::write_pdu_bcch_dlsch(uint8_t *payload, uint32_t nof_bytes)
{
rlc_log->info_hex(payload, nof_bytes, "BCCH TXSCH message received.");
unique_byte_buffer buf = allocate_unique_buffer(*pool);
unique_byte_buffer_t buf = allocate_unique_buffer(*pool);
if (buf != NULL) {
memcpy(buf->msg, payload, nof_bytes);
buf->N_bytes = nof_bytes;
@ -361,7 +361,7 @@ void rlc::write_pdu_bcch_dlsch(uint8_t *payload, uint32_t nof_bytes)
void rlc::write_pdu_pcch(uint8_t *payload, uint32_t nof_bytes)
{
rlc_log->info_hex(payload, nof_bytes, "PCCH message received.");
unique_byte_buffer buf = allocate_unique_buffer(*pool);
unique_byte_buffer_t buf = allocate_unique_buffer(*pool);
if (buf != NULL) {
memcpy(buf->msg, payload, nof_bytes);
buf->N_bytes = nof_bytes;

@ -128,7 +128,7 @@ void rlc_am::reset_metrics()
* PDCP interface
***************************************************************************/
void rlc_am::write_sdu(unique_byte_buffer sdu, bool blocking)
void rlc_am::write_sdu(unique_byte_buffer_t sdu, bool blocking)
{
tx.write_sdu(std::move(sdu), blocking);
}
@ -270,7 +270,7 @@ void rlc_am::rlc_am_tx::empty_queue()
// deallocate all SDUs in transmit queue
while(tx_sdu_queue.size() > 0) {
unique_byte_buffer buf = tx_sdu_queue.read();
unique_byte_buffer_t buf = tx_sdu_queue.read();
}
// deallocate SDU that is currently processed
@ -352,7 +352,7 @@ uint32_t rlc_am::rlc_am_tx::get_buffer_state()
return n_bytes;
}
void rlc_am::rlc_am_tx::write_sdu(unique_byte_buffer sdu, bool blocking)
void rlc_am::rlc_am_tx::write_sdu(unique_byte_buffer_t sdu, bool blocking)
{
if (!tx_enabled) {
return;
@ -367,7 +367,7 @@ void rlc_am::rlc_am_tx::write_sdu(unique_byte_buffer sdu, bool blocking)
// non-blocking write
uint8_t* msg_ptr = sdu->msg;
uint32_t nof_bytes = sdu->N_bytes;
std::pair<bool, unique_byte_buffer> ret = tx_sdu_queue.try_write(std::move(sdu));
std::pair<bool, unique_byte_buffer_t> ret = tx_sdu_queue.try_write(std::move(sdu));
if (ret.first) {
log->info_hex(
msg_ptr, nof_bytes, "%s Tx SDU (%d B, tx_sdu_queue_len=%d)", RB_NAME, nof_bytes, tx_sdu_queue.size());
@ -783,7 +783,7 @@ int rlc_am::rlc_am_tx::build_data_pdu(uint8_t *payload, uint32_t nof_bytes)
return 0;
}
unique_byte_buffer pdu = srslte::allocate_unique_buffer(*pool, true);
unique_byte_buffer_t pdu = srslte::allocate_unique_buffer(*pool, true);
if (pdu == NULL) {
#ifdef RLC_AM_BUFFER_DEBUG
log->console("Fatal Error: Could not allocate PDU in build_data_pdu()\n");
@ -1739,7 +1739,7 @@ bool rlc_am::rlc_am_rx::add_segment_and_check(rlc_amd_rx_pdu_segments_t *pdu, rl
log->debug("Finished header reconstruction of %zd segments\n", pdu->segments.size());
// Copy data
unique_byte_buffer full_pdu = srslte::allocate_unique_buffer(*pool, true);
unique_byte_buffer_t full_pdu = srslte::allocate_unique_buffer(*pool, true);
if (full_pdu == NULL) {
#ifdef RLC_AM_BUFFER_DEBUG
log->console("Fatal Error: Could not allocate PDU in add_segment_and_check()\n");

@ -63,7 +63,7 @@ bool rlc_tm::configure(srslte_rlc_config_t cnfg)
void rlc_tm::empty_queue()
{
// Drop all messages in TX queue
unique_byte_buffer buf;
unique_byte_buffer_t buf;
while (ul_queue.try_read(&buf)) {
}
ul_queue.reset();
@ -91,7 +91,7 @@ uint32_t rlc_tm::get_bearer()
}
// PDCP interface
void rlc_tm::write_sdu(unique_byte_buffer sdu, bool blocking)
void rlc_tm::write_sdu(unique_byte_buffer_t sdu, bool blocking)
{
if (!tx_enabled) {
return;
@ -104,7 +104,7 @@ void rlc_tm::write_sdu(unique_byte_buffer sdu, bool blocking)
} else {
uint8_t* msg_ptr = sdu->msg;
uint32_t nof_bytes = sdu->N_bytes;
std::pair<bool, unique_byte_buffer> ret = ul_queue.try_write(std::move(sdu));
std::pair<bool, unique_byte_buffer_t> ret = ul_queue.try_write(std::move(sdu));
if (ret.first) {
log->info_hex(msg_ptr,
nof_bytes,
@ -160,7 +160,7 @@ int rlc_tm::read_pdu(uint8_t *payload, uint32_t nof_bytes)
log->error("TX %s PDU size larger than MAC opportunity (%d > %d)\n", rrc->get_rb_name(lcid).c_str(), pdu_size, nof_bytes);
return -1;
}
unique_byte_buffer buf;
unique_byte_buffer_t buf;
if (ul_queue.try_read(&buf)) {
pdu_size = buf->N_bytes;
memcpy(payload, buf->msg, buf->N_bytes);
@ -183,7 +183,7 @@ int rlc_tm::read_pdu(uint8_t *payload, uint32_t nof_bytes)
void rlc_tm::write_pdu(uint8_t *payload, uint32_t nof_bytes)
{
unique_byte_buffer buf = allocate_unique_buffer(*pool);
unique_byte_buffer_t buf = allocate_unique_buffer(*pool);
if (buf) {
memcpy(buf->msg, payload, nof_bytes);
buf->N_bytes = nof_bytes;

@ -140,7 +140,7 @@ uint32_t rlc_um::get_bearer()
/****************************************************************************
* PDCP interface
***************************************************************************/
void rlc_um::write_sdu(unique_byte_buffer sdu, bool blocking)
void rlc_um::write_sdu(unique_byte_buffer_t sdu, bool blocking)
{
if (blocking) {
tx.write_sdu(std::move(sdu));
@ -271,7 +271,7 @@ void rlc_um::rlc_um_tx::empty_queue()
// deallocate all SDUs in transmit queue
while(tx_sdu_queue.size() > 0) {
unique_byte_buffer buf = tx_sdu_queue.read();
unique_byte_buffer_t buf = tx_sdu_queue.read();
}
// deallocate SDU that is currently processed
@ -323,7 +323,7 @@ uint32_t rlc_um::rlc_um_tx::get_buffer_state()
return n_bytes;
}
void rlc_um::rlc_um_tx::write_sdu(unique_byte_buffer sdu)
void rlc_um::rlc_um_tx::write_sdu(unique_byte_buffer_t sdu)
{
if (!tx_enabled) {
return;
@ -337,7 +337,7 @@ void rlc_um::rlc_um_tx::write_sdu(unique_byte_buffer sdu)
}
}
void rlc_um::rlc_um_tx::try_write_sdu(unique_byte_buffer sdu)
void rlc_um::rlc_um_tx::try_write_sdu(unique_byte_buffer_t sdu)
{
if (!tx_enabled) {
sdu.reset();
@ -347,7 +347,7 @@ void rlc_um::rlc_um_tx::try_write_sdu(unique_byte_buffer sdu)
if (sdu) {
uint8_t* msg_ptr = sdu->msg;
uint32_t nof_bytes = sdu->N_bytes;
std::pair<bool, unique_byte_buffer> ret = tx_sdu_queue.try_write(std::move(sdu));
std::pair<bool, unique_byte_buffer_t> ret = tx_sdu_queue.try_write(std::move(sdu));
if (ret.first) {
log->info_hex(
msg_ptr, nof_bytes, "%s Tx SDU (%d B, tx_sdu_queue_len=%d)", get_rb_name(), nof_bytes, tx_sdu_queue.size());
@ -381,7 +381,7 @@ int rlc_um::rlc_um_tx::build_data_pdu(uint8_t *payload, uint32_t nof_bytes)
return 0;
}
unique_byte_buffer pdu = allocate_unique_buffer(*pool);
unique_byte_buffer_t pdu = allocate_unique_buffer(*pool);
if(!pdu || pdu->N_bytes != 0) {
log->error("Failed to allocate PDU buffer\n");
pthread_mutex_unlock(&mutex);

@ -36,7 +36,7 @@ void* write_thread(void *a) {
byte_buffer_pool* pool = byte_buffer_pool::get_instance();
for(uint32_t i=0;i<NMSGS;i++)
{
unique_byte_buffer b = srslte::allocate_unique_buffer(*pool, true);
unique_byte_buffer_t b = srslte::allocate_unique_buffer(*pool, true);
memcpy(b->msg, &i, 4);
b->N_bytes = 4;
args->q->write(std::move(b));
@ -47,7 +47,7 @@ void* write_thread(void *a) {
int main(int argc, char **argv) {
bool result;
rlc_tx_queue q;
unique_byte_buffer b;
unique_byte_buffer_t b;
pthread_t thread;
args_t args;
u_int32_t r;

@ -67,21 +67,21 @@ public:
}
// PDCP interface
void write_pdu(uint32_t lcid, unique_byte_buffer sdu)
void write_pdu(uint32_t lcid, unique_byte_buffer_t sdu)
{
assert(lcid == 1);
sdus[n_sdus++] = std::move(sdu);
}
void write_pdu_bcch_bch(unique_byte_buffer sdu) {}
void write_pdu_bcch_dlsch(unique_byte_buffer sdu) {}
void write_pdu_pcch(unique_byte_buffer sdu) {}
void write_pdu_mch(uint32_t lcid, srslte::unique_byte_buffer pdu) {}
void write_pdu_bcch_bch(unique_byte_buffer_t sdu) {}
void write_pdu_bcch_dlsch(unique_byte_buffer_t sdu) {}
void write_pdu_pcch(unique_byte_buffer_t sdu) {}
void write_pdu_mch(uint32_t lcid, srslte::unique_byte_buffer_t pdu) {}
// RRC interface
void max_retx_attempted(){}
std::string get_rb_name(uint32_t lcid) { return std::string(""); }
unique_byte_buffer sdus[10];
unique_byte_buffer_t sdus[10];
int n_sdus;
rlc_pcap *pcap;
};
@ -108,7 +108,7 @@ private:
running = true;
while(running) {
byte_buffer_pool* pool = byte_buffer_pool::get_instance();
unique_byte_buffer pdu = srslte::allocate_unique_buffer(*pool, "rlc_tester::run_thread", true);
unique_byte_buffer_t pdu = srslte::allocate_unique_buffer(*pool, "rlc_tester::run_thread", true);
if (!pdu) {
printf("Error: Could not allocate PDU in rlc_tester::run_thread\n\n\n");
// backoff for a bit
@ -170,7 +170,7 @@ bool basic_test()
// Push 5 SDUs into RLC1
byte_buffer_pool* pool = byte_buffer_pool::get_instance();
unique_byte_buffer sdu_bufs[NBUFS];
unique_byte_buffer_t sdu_bufs[NBUFS];
for(int i=0;i<NBUFS;i++)
{
sdu_bufs[i] = srslte::allocate_unique_buffer(*pool, true);
@ -267,7 +267,7 @@ bool concat_test()
// Push 5 SDUs into RLC1
byte_buffer_pool* pool = byte_buffer_pool::get_instance();
unique_byte_buffer sdu_bufs[NBUFS];
unique_byte_buffer_t sdu_bufs[NBUFS];
for(int i=0;i<NBUFS;i++)
{
sdu_bufs[i] = srslte::allocate_unique_buffer(*pool, true);
@ -349,7 +349,7 @@ bool segment_test(bool in_seq_rx)
// Push 5 SDUs into RLC1
byte_buffer_pool* pool = byte_buffer_pool::get_instance();
unique_byte_buffer sdu_bufs[NBUFS];
unique_byte_buffer_t sdu_bufs[NBUFS];
for(int i=0;i<NBUFS;i++)
{
sdu_bufs[i] = srslte::allocate_unique_buffer(*pool, true);
@ -459,7 +459,7 @@ bool retx_test()
// Push 5 SDUs into RLC1
byte_buffer_pool* pool = byte_buffer_pool::get_instance();
unique_byte_buffer sdu_bufs[NBUFS];
unique_byte_buffer_t sdu_bufs[NBUFS];
for(int i=0;i<NBUFS;i++)
{
sdu_bufs[i] = srslte::allocate_unique_buffer(*pool, true);
@ -568,7 +568,7 @@ bool resegment_test_1()
// Push 5 SDUs into RLC1
byte_buffer_pool* pool = byte_buffer_pool::get_instance();
unique_byte_buffer sdu_bufs[NBUFS];
unique_byte_buffer_t sdu_bufs[NBUFS];
for(int i=0;i<NBUFS;i++)
{
sdu_bufs[i] = srslte::allocate_unique_buffer(*pool, true);
@ -690,7 +690,7 @@ bool resegment_test_2()
// Push 5 SDUs into RLC1
byte_buffer_pool* pool = byte_buffer_pool::get_instance();
unique_byte_buffer sdu_bufs[NBUFS];
unique_byte_buffer_t sdu_bufs[NBUFS];
for(int i=0;i<NBUFS;i++)
{
sdu_bufs[i] = srslte::allocate_unique_buffer(*pool, true);
@ -809,7 +809,7 @@ bool resegment_test_3()
// Push 5 SDUs into RLC1
byte_buffer_pool* pool = byte_buffer_pool::get_instance();
unique_byte_buffer sdu_bufs[NBUFS];
unique_byte_buffer_t sdu_bufs[NBUFS];
for(int i=0;i<NBUFS;i++)
{
sdu_bufs[i] = srslte::allocate_unique_buffer(*pool, true);
@ -923,7 +923,7 @@ bool resegment_test_4()
// Push 5 SDUs into RLC1
byte_buffer_pool* pool = byte_buffer_pool::get_instance();
unique_byte_buffer sdu_bufs[NBUFS];
unique_byte_buffer_t sdu_bufs[NBUFS];
for(int i=0;i<NBUFS;i++)
{
sdu_bufs[i] = srslte::allocate_unique_buffer(*pool, true);
@ -1037,7 +1037,7 @@ bool resegment_test_5()
// Push 5 SDUs into RLC1
byte_buffer_pool* pool = byte_buffer_pool::get_instance();
unique_byte_buffer sdu_bufs[NBUFS];
unique_byte_buffer_t sdu_bufs[NBUFS];
for(int i=0;i<NBUFS;i++)
{
sdu_bufs[i] = srslte::allocate_unique_buffer(*pool, true);
@ -1153,7 +1153,7 @@ bool resegment_test_6()
// Push SDUs into RLC1
byte_buffer_pool* pool = byte_buffer_pool::get_instance();
unique_byte_buffer sdu_bufs[9];
unique_byte_buffer_t sdu_bufs[9];
for(int i=0;i<3;i++)
{
sdu_bufs[i] = srslte::allocate_unique_buffer(*pool, true);
@ -1304,7 +1304,7 @@ bool resegment_test_7()
// Push 2 SDUs into RLC1
byte_buffer_pool* pool = byte_buffer_pool::get_instance();
unique_byte_buffer sdu_bufs[N_SDU_BUFS];
unique_byte_buffer_t sdu_bufs[N_SDU_BUFS];
for(uint32_t i=0;i<N_SDU_BUFS;i++)
{
sdu_bufs[i] = srslte::allocate_unique_buffer(*pool, true);
@ -1493,7 +1493,7 @@ bool resegment_test_8()
// Push 2 SDUs into RLC1
byte_buffer_pool* pool = byte_buffer_pool::get_instance();
unique_byte_buffer sdu_bufs[N_SDU_BUFS];
unique_byte_buffer_t sdu_bufs[N_SDU_BUFS];
for(uint32_t i=0;i<N_SDU_BUFS;i++)
{
sdu_bufs[i] = srslte::allocate_unique_buffer(*pool, true);
@ -1649,7 +1649,7 @@ bool reset_test()
// Push 1 SDU of size 10 into RLC1
byte_buffer_pool* pool = byte_buffer_pool::get_instance();
unique_byte_buffer sdu_buf = srslte::allocate_unique_buffer(*pool, true);
unique_byte_buffer_t sdu_buf = srslte::allocate_unique_buffer(*pool, true);
sdu_buf->msg[0] = 1; // Write the index into the buffer
sdu_buf->N_bytes = 100;
rlc1.write_sdu(std::move(sdu_buf));

@ -147,7 +147,7 @@ private:
void run_tti(rlc_interface_mac *tx_rlc, rlc_interface_mac *rx_rlc, bool is_dl)
{
byte_buffer_pool* pool = byte_buffer_pool::get_instance();
unique_byte_buffer pdu = srslte::allocate_unique_buffer(*pool, __PRETTY_FUNCTION__, true);
unique_byte_buffer_t pdu = srslte::allocate_unique_buffer(*pool, __PRETTY_FUNCTION__, true);
if (!pdu) {
printf("Fatal Error: Could not allocate PDU in mac_reader::run_thread\n");
exit(-1);
@ -229,7 +229,7 @@ public:
}
// PDCP interface
void write_pdu(uint32_t rx_lcid, unique_byte_buffer sdu)
void write_pdu(uint32_t rx_lcid, unique_byte_buffer_t sdu)
{
assert(rx_lcid == lcid);
if (sdu->N_bytes != args.sdu_size) {
@ -239,10 +239,10 @@ public:
rx_pdus++;
}
void write_pdu_bcch_bch(unique_byte_buffer sdu) {}
void write_pdu_bcch_dlsch(unique_byte_buffer sdu) {}
void write_pdu_pcch(unique_byte_buffer sdu) {}
void write_pdu_mch(uint32_t lcid, srslte::unique_byte_buffer sdu) {}
void write_pdu_bcch_bch(unique_byte_buffer_t sdu) {}
void write_pdu_bcch_dlsch(unique_byte_buffer_t sdu) {}
void write_pdu_pcch(unique_byte_buffer_t sdu) {}
void write_pdu_mch(uint32_t lcid, srslte::unique_byte_buffer_t sdu) {}
// RRC interface
void max_retx_attempted(){}
@ -255,7 +255,7 @@ private:
uint8_t sn = 0;
byte_buffer_pool* pool = byte_buffer_pool::get_instance();
while(run_enable) {
unique_byte_buffer pdu = srslte::allocate_unique_buffer(*pool, "rlc_tester::run_thread", true);
unique_byte_buffer_t pdu = srslte::allocate_unique_buffer(*pool, "rlc_tester::run_thread", true);
if (pdu == NULL) {
printf("Error: Could not allocate PDU in rlc_tester::run_thread\n\n\n");
// backoff for a bit

@ -68,7 +68,7 @@ public:
}
// PDCP interface
void write_pdu(uint32_t lcid, unique_byte_buffer sdu)
void write_pdu(uint32_t lcid, unique_byte_buffer_t sdu)
{
if (lcid != 3 && sdu->N_bytes != expected_sdu_len) {
printf("Received PDU with size %d, expected %d. Exiting.\n", sdu->N_bytes, expected_sdu_len);
@ -76,10 +76,10 @@ public:
}
sdus[n_sdus++] = std::move(sdu);
}
void write_pdu_bcch_bch(unique_byte_buffer sdu) {}
void write_pdu_bcch_dlsch(unique_byte_buffer sdu) {}
void write_pdu_pcch(unique_byte_buffer sdu) {}
void write_pdu_mch(uint32_t lcid, srslte::unique_byte_buffer sdu)
void write_pdu_bcch_bch(unique_byte_buffer_t sdu) {}
void write_pdu_bcch_dlsch(unique_byte_buffer_t sdu) {}
void write_pdu_pcch(unique_byte_buffer_t sdu) {}
void write_pdu_mch(uint32_t lcid, srslte::unique_byte_buffer_t sdu)
{
sdus[n_sdus++] = std::move(sdu);
}
@ -89,7 +89,7 @@ public:
std::string get_rb_name(uint32_t lcid) { return std::string(""); }
void set_expected_sdu_len(uint32_t len) { expected_sdu_len = len; }
unique_byte_buffer sdus[MAX_NBUFS];
unique_byte_buffer_t sdus[MAX_NBUFS];
int n_sdus;
uint32_t expected_sdu_len;
};
@ -129,7 +129,7 @@ int basic_test()
// Push 5 SDUs into RLC1
byte_buffer_pool* pool = byte_buffer_pool::get_instance();
unique_byte_buffer sdu_bufs[NBUFS];
unique_byte_buffer_t sdu_bufs[NBUFS];
for(int i=0;i<NBUFS;i++)
{
sdu_bufs[i] = srslte::allocate_unique_buffer(*pool, true);
@ -203,7 +203,7 @@ int loss_test()
// Push 5 SDUs into RLC1
byte_buffer_pool* pool = byte_buffer_pool::get_instance();
unique_byte_buffer sdu_bufs[NBUFS];
unique_byte_buffer_t sdu_bufs[NBUFS];
for(int i=0;i<NBUFS;i++)
{
sdu_bufs[i] = srslte::allocate_unique_buffer(*pool, true);
@ -269,7 +269,7 @@ int basic_mbsfn_test()
// Push 5 SDUs into RLC1
byte_buffer_pool* pool = byte_buffer_pool::get_instance();
unique_byte_buffer sdu_bufs[NBUFS * 2];
unique_byte_buffer_t sdu_bufs[NBUFS * 2];
for(int i=0;i<NBUFS;i++)
{
sdu_bufs[i] = srslte::allocate_unique_buffer(*pool, true);
@ -360,7 +360,7 @@ int reassmble_test()
const int n_sdu_first_batch = 17;
byte_buffer_pool* pool = byte_buffer_pool::get_instance();
unique_byte_buffer sdu_bufs[n_sdus];
unique_byte_buffer_t sdu_bufs[n_sdus];
for(int i=0;i<n_sdu_first_batch;i++) {
sdu_bufs[i] = srslte::allocate_unique_buffer(*pool, true);
for (int k = 0; k < sdu_len; ++k) {
@ -478,7 +478,7 @@ int reassmble_test2()
const int n_sdu_first_batch = 17;
byte_buffer_pool* pool = byte_buffer_pool::get_instance();
unique_byte_buffer sdu_bufs[n_sdus];
unique_byte_buffer_t sdu_bufs[n_sdus];
for(int i=0;i<n_sdu_first_batch;i++) {
sdu_bufs[i] = srslte::allocate_unique_buffer(*pool, true);
for (int k = 0; k < sdu_len; ++k) {

@ -53,7 +53,7 @@ public:
void rem_user(uint16_t rnti);
// gtpu_interface_pdcp
void write_pdu(uint16_t rnti, uint32_t lcid, srslte::unique_byte_buffer pdu);
void write_pdu(uint16_t rnti, uint32_t lcid, srslte::unique_byte_buffer_t pdu);
private:
static const int THREAD_PRIO = 65;

@ -39,14 +39,14 @@ public:
void stop();
// pdcp_interface_rlc
void write_pdu(uint16_t rnti, uint32_t lcid, srslte::unique_byte_buffer sdu);
void write_pdu_mch(uint32_t lcid, srslte::unique_byte_buffer sdu) {}
void write_pdu(uint16_t rnti, uint32_t lcid, srslte::unique_byte_buffer_t sdu);
void write_pdu_mch(uint32_t lcid, srslte::unique_byte_buffer_t sdu) {}
// pdcp_interface_rrc
void reset(uint16_t rnti);
void add_user(uint16_t rnti);
void rem_user(uint16_t rnti);
void write_sdu(uint16_t rnti, uint32_t lcid, srslte::unique_byte_buffer sdu);
void write_sdu(uint16_t rnti, uint32_t lcid, srslte::unique_byte_buffer_t sdu);
void add_bearer(uint16_t rnti, uint32_t lcid, srslte::srslte_pdcp_config_t cnfg);
void config_security(uint16_t rnti,
uint32_t lcid,
@ -65,7 +65,7 @@ private:
uint16_t rnti;
srsenb::rlc_interface_pdcp *rlc;
// rlc_interface_pdcp
void write_sdu(uint32_t lcid, srslte::unique_byte_buffer sdu, bool blocking);
void write_sdu(uint32_t lcid, srslte::unique_byte_buffer_t sdu, bool blocking);
bool rb_is_um(uint32_t lcid);
};
@ -75,8 +75,8 @@ private:
uint16_t rnti;
srsenb::gtpu_interface_pdcp *gtpu;
// gw_interface_pdcp
void write_pdu(uint32_t lcid, srslte::unique_byte_buffer pdu);
void write_pdu_mch(uint32_t lcid, srslte::unique_byte_buffer sdu) {}
void write_pdu(uint32_t lcid, srslte::unique_byte_buffer_t pdu);
void write_pdu_mch(uint32_t lcid, srslte::unique_byte_buffer_t sdu) {}
};
class user_interface_rrc : public srsue::rrc_interface_pdcp
@ -85,11 +85,11 @@ private:
uint16_t rnti;
srsenb::rrc_interface_pdcp *rrc;
// rrc_interface_pdcp
void write_pdu(uint32_t lcid, srslte::unique_byte_buffer pdu);
void write_pdu_bcch_bch(srslte::unique_byte_buffer pdu);
void write_pdu_bcch_dlsch(srslte::unique_byte_buffer pdu);
void write_pdu_pcch(srslte::unique_byte_buffer pdu);
void write_pdu_mch(uint32_t lcid, srslte::unique_byte_buffer pdu) {}
void write_pdu(uint32_t lcid, srslte::unique_byte_buffer_t pdu);
void write_pdu_bcch_bch(srslte::unique_byte_buffer_t pdu);
void write_pdu_bcch_dlsch(srslte::unique_byte_buffer_t pdu);
void write_pdu_pcch(srslte::unique_byte_buffer_t pdu);
void write_pdu_mch(uint32_t lcid, srslte::unique_byte_buffer_t pdu) {}
std::string get_rb_name(uint32_t lcid);
};

@ -55,7 +55,7 @@ public:
void add_bearer_mrb(uint16_t rnti, uint32_t lcid);
// rlc_interface_pdcp
void write_sdu(uint16_t rnti, uint32_t lcid, srslte::unique_byte_buffer sdu);
void write_sdu(uint16_t rnti, uint32_t lcid, srslte::unique_byte_buffer_t sdu);
bool rb_is_um(uint16_t rnti, uint32_t lcid);
std::string get_rb_name(uint32_t lcid);
@ -72,11 +72,11 @@ private:
public srsue::ue_interface
{
public:
void write_pdu(uint32_t lcid, srslte::unique_byte_buffer sdu);
void write_pdu_bcch_bch(srslte::unique_byte_buffer sdu);
void write_pdu_bcch_dlsch(srslte::unique_byte_buffer sdu);
void write_pdu_pcch(srslte::unique_byte_buffer sdu);
void write_pdu_mch(uint32_t lcid, srslte::unique_byte_buffer sdu) {}
void write_pdu(uint32_t lcid, srslte::unique_byte_buffer_t sdu);
void write_pdu_bcch_bch(srslte::unique_byte_buffer_t sdu);
void write_pdu_bcch_dlsch(srslte::unique_byte_buffer_t sdu);
void write_pdu_pcch(srslte::unique_byte_buffer_t sdu);
void write_pdu_mch(uint32_t lcid, srslte::unique_byte_buffer_t sdu) {}
void max_retx_attempted();
std::string get_rb_name(uint32_t lcid);
uint16_t rnti;

@ -153,7 +153,7 @@ public:
void max_retx_attempted(uint16_t rnti);
// rrc_interface_s1ap
void write_dl_info(uint16_t rnti, srslte::unique_byte_buffer sdu);
void write_dl_info(uint16_t rnti, srslte::unique_byte_buffer_t sdu);
void release_complete(uint16_t rnti);
bool setup_ue_ctxt(uint16_t rnti, LIBLTE_S1AP_MESSAGE_INITIALCONTEXTSETUPREQUEST_STRUCT *msg);
bool setup_ue_erabs(uint16_t rnti, LIBLTE_S1AP_MESSAGE_E_RABSETUPREQUEST_STRUCT *msg);
@ -161,7 +161,7 @@ public:
void add_paging_id(uint32_t ueid, LIBLTE_S1AP_UEPAGINGID_STRUCT UEPagingID);
// rrc_interface_pdcp
void write_pdu(uint16_t rnti, uint32_t lcid, srslte::unique_byte_buffer pdu);
void write_pdu(uint16_t rnti, uint32_t lcid, srslte::unique_byte_buffer_t pdu);
void parse_sibs();
uint32_t get_nof_users();
@ -207,17 +207,17 @@ public:
void send_connection_reject();
void send_connection_release();
void send_connection_reest_rej();
void send_connection_reconf(srslte::unique_byte_buffer sdu);
void send_connection_reconf(srslte::unique_byte_buffer_t sdu);
void send_connection_reconf_new_bearer(LIBLTE_S1AP_E_RABTOBESETUPLISTBEARERSUREQ_STRUCT *e);
void send_connection_reconf_upd(srslte::unique_byte_buffer pdu);
void send_connection_reconf_upd(srslte::unique_byte_buffer_t pdu);
void send_security_mode_command();
void send_ue_cap_enquiry();
void parse_ul_dcch(uint32_t lcid, srslte::unique_byte_buffer pdu);
void parse_ul_dcch(uint32_t lcid, srslte::unique_byte_buffer_t pdu);
void handle_rrc_con_req(asn1::rrc::rrc_conn_request_s* msg);
void handle_rrc_con_reest_req(asn1::rrc::rrc_conn_reest_request_r8_ies_s* msg);
void handle_rrc_con_setup_complete(asn1::rrc::rrc_conn_setup_complete_s* msg, srslte::unique_byte_buffer pdu);
void handle_rrc_reconf_complete(asn1::rrc::rrc_conn_recfg_complete_s* msg, srslte::unique_byte_buffer pdu);
void handle_rrc_con_setup_complete(asn1::rrc::rrc_conn_setup_complete_s* msg, srslte::unique_byte_buffer_t pdu);
void handle_rrc_reconf_complete(asn1::rrc::rrc_conn_recfg_complete_s* msg, srslte::unique_byte_buffer_t pdu);
void handle_security_mode_complete(asn1::rrc::security_mode_complete_s* msg);
void handle_security_mode_failure(asn1::rrc::security_mode_fail_s* msg);
bool handle_ue_cap_info(asn1::rrc::ue_cap_info_s* msg);
@ -246,8 +246,8 @@ public:
bool select_security_algorithms();
void send_dl_ccch(asn1::rrc::dl_ccch_msg_s* dl_ccch_msg);
void send_dl_dcch(asn1::rrc::dl_dcch_msg_s* dl_dcch_msg,
srslte::unique_byte_buffer pdu = srslte::unique_byte_buffer());
void send_dl_dcch(asn1::rrc::dl_dcch_msg_s* dl_dcch_msg,
srslte::unique_byte_buffer_t pdu = srslte::unique_byte_buffer_t());
uint16_t rnti;
rrc* parent;
@ -316,7 +316,7 @@ private:
activity_monitor act_monitor;
std::vector<srslte::unique_byte_buffer> sib_buffer;
std::vector<srslte::unique_byte_buffer_t> sib_buffer;
// user connect notifier
connect_notifier *cnotifier;
@ -328,8 +328,8 @@ private:
void configure_mbsfn_sibs(asn1::rrc::sib_type2_s* sib2, asn1::rrc::sib_type13_r9_s* sib13);
void config_mac();
void parse_ul_dcch(uint16_t rnti, uint32_t lcid, srslte::unique_byte_buffer pdu);
void parse_ul_ccch(uint16_t rnti, srslte::unique_byte_buffer pdu);
void parse_ul_dcch(uint16_t rnti, uint32_t lcid, srslte::unique_byte_buffer_t pdu);
void parse_ul_ccch(uint16_t rnti, srslte::unique_byte_buffer_t pdu);
void configure_security(uint16_t rnti,
uint32_t lcid,
uint8_t *k_rrc_enc,
@ -354,7 +354,7 @@ private:
typedef struct{
uint16_t rnti;
uint32_t lcid;
srslte::unique_byte_buffer pdu;
srslte::unique_byte_buffer_t pdu;
}rrc_pdu;
const static uint32_t LCID_EXIT = 0xffff0000;

@ -68,13 +68,13 @@ public:
void run_thread();
// RRC interface
void initial_ue(uint16_t rnti, LIBLTE_S1AP_RRC_ESTABLISHMENT_CAUSE_ENUM cause, srslte::unique_byte_buffer pdu);
void initial_ue(uint16_t rnti, LIBLTE_S1AP_RRC_ESTABLISHMENT_CAUSE_ENUM cause, srslte::unique_byte_buffer_t pdu);
void initial_ue(uint16_t rnti,
LIBLTE_S1AP_RRC_ESTABLISHMENT_CAUSE_ENUM cause,
srslte::unique_byte_buffer pdu,
srslte::unique_byte_buffer_t pdu,
uint32_t m_tmsi,
uint8_t mmec);
void write_pdu(uint16_t rnti, srslte::unique_byte_buffer pdu);
void write_pdu(uint16_t rnti, srslte::unique_byte_buffer_t pdu);
bool user_exists(uint16_t rnti);
bool user_release(uint16_t rnti, LIBLTE_S1AP_CAUSERADIONETWORK_ENUM cause_radio);
void ue_ctxt_setup_complete(uint16_t rnti, LIBLTE_S1AP_MESSAGE_INITIALCONTEXTSETUPRESPONSE_STRUCT *res);
@ -131,11 +131,11 @@ private:
bool send_initialuemessage(uint16_t rnti,
LIBLTE_S1AP_RRC_ESTABLISHMENT_CAUSE_ENUM cause,
srslte::unique_byte_buffer pdu,
srslte::unique_byte_buffer_t pdu,
bool has_tmsi,
uint32_t m_tmsi = 0,
uint8_t mmec = 0);
bool send_ulnastransport(uint16_t rnti, srslte::unique_byte_buffer pdu);
bool send_ulnastransport(uint16_t rnti, srslte::unique_byte_buffer_t pdu);
bool send_uectxtreleaserequest(uint16_t rnti, LIBLTE_S1AP_CAUSE_STRUCT *cause);
bool send_uectxtreleasecomplete(uint16_t rnti, uint32_t mme_ue_id, uint32_t enb_ue_id);
bool send_initial_ctxt_setup_response(uint16_t rnti, LIBLTE_S1AP_MESSAGE_INITIALCONTEXTSETUPRESPONSE_STRUCT *res_);

@ -111,7 +111,7 @@ void gtpu::stop()
}
// gtpu_interface_pdcp
void gtpu::write_pdu(uint16_t rnti, uint32_t lcid, srslte::unique_byte_buffer pdu)
void gtpu::write_pdu(uint16_t rnti, uint32_t lcid, srslte::unique_byte_buffer_t pdu)
{
gtpu_log->info_hex(pdu->msg, pdu->N_bytes, "TX PDU, RNTI: 0x%x, LCID: %d, n_bytes=%d", rnti, lcid, pdu->N_bytes);
gtpu_header_t header;
@ -191,7 +191,7 @@ void gtpu::rem_user(uint16_t rnti)
void gtpu::run_thread()
{
unique_byte_buffer pdu = allocate_unique_buffer(*pool);
unique_byte_buffer_t pdu = allocate_unique_buffer(*pool);
if (!pdu.get()) {
gtpu_log->error("Fatal Error: Couldn't allocate buffer in gtpu::run_thread().\n");
@ -274,7 +274,7 @@ void gtpu::echo_response(in_addr_t addr, in_port_t port, uint16_t seq)
gtpu_log->info("TX GTPU Echo Response, Seq: %d\n", seq);
gtpu_header_t header;
unique_byte_buffer pdu = allocate_unique_buffer(*pool);
unique_byte_buffer_t pdu = allocate_unique_buffer(*pool);
//header
header.flags = GTPU_FLAGS_VERSION_V1 | GTPU_FLAGS_GTP_PROTOCOL | GTPU_FLAGS_SEQUENCE;
@ -369,7 +369,7 @@ void gtpu::mch_thread::run_thread()
return;
}
unique_byte_buffer pdu = allocate_unique_buffer(*pool);
unique_byte_buffer_t pdu = allocate_unique_buffer(*pool);
int n;
socklen_t addrlen;
sockaddr_in src_addr;

@ -130,7 +130,7 @@ void pdcp::enable_encryption(uint16_t rnti, uint32_t lcid)
pthread_rwlock_unlock(&rwlock);
}
void pdcp::write_pdu(uint16_t rnti, uint32_t lcid, srslte::unique_byte_buffer sdu)
void pdcp::write_pdu(uint16_t rnti, uint32_t lcid, srslte::unique_byte_buffer_t sdu)
{
pthread_rwlock_rdlock(&rwlock);
if (users.count(rnti)) {
@ -139,7 +139,7 @@ void pdcp::write_pdu(uint16_t rnti, uint32_t lcid, srslte::unique_byte_buffer sd
pthread_rwlock_unlock(&rwlock);
}
void pdcp::write_sdu(uint16_t rnti, uint32_t lcid, srslte::unique_byte_buffer sdu)
void pdcp::write_sdu(uint16_t rnti, uint32_t lcid, srslte::unique_byte_buffer_t sdu)
{
pthread_rwlock_rdlock(&rwlock);
if (users.count(rnti)) {
@ -152,12 +152,12 @@ void pdcp::write_sdu(uint16_t rnti, uint32_t lcid, srslte::unique_byte_buffer sd
pthread_rwlock_unlock(&rwlock);
}
void pdcp::user_interface_gtpu::write_pdu(uint32_t lcid, srslte::unique_byte_buffer pdu)
void pdcp::user_interface_gtpu::write_pdu(uint32_t lcid, srslte::unique_byte_buffer_t pdu)
{
gtpu->write_pdu(rnti, lcid, std::move(pdu));
}
void pdcp::user_interface_rlc::write_sdu(uint32_t lcid, srslte::unique_byte_buffer sdu, bool blocking)
void pdcp::user_interface_rlc::write_sdu(uint32_t lcid, srslte::unique_byte_buffer_t sdu, bool blocking)
{
rlc->write_sdu(rnti, lcid, std::move(sdu));
}
@ -166,22 +166,22 @@ bool pdcp::user_interface_rlc::rb_is_um(uint32_t lcid) {
return rlc->rb_is_um(rnti, lcid);
}
void pdcp::user_interface_rrc::write_pdu(uint32_t lcid, srslte::unique_byte_buffer pdu)
void pdcp::user_interface_rrc::write_pdu(uint32_t lcid, srslte::unique_byte_buffer_t pdu)
{
rrc->write_pdu(rnti, lcid, std::move(pdu));
}
void pdcp::user_interface_rrc::write_pdu_bcch_bch(srslte::unique_byte_buffer pdu)
void pdcp::user_interface_rrc::write_pdu_bcch_bch(srslte::unique_byte_buffer_t pdu)
{
ERROR("Error: Received BCCH from ue=%d\n", rnti);
}
void pdcp::user_interface_rrc::write_pdu_bcch_dlsch(srslte::unique_byte_buffer pdu)
void pdcp::user_interface_rrc::write_pdu_bcch_dlsch(srslte::unique_byte_buffer_t pdu)
{
ERROR("Error: Received BCCH from ue=%d\n", rnti);
}
void pdcp::user_interface_rrc::write_pdu_pcch(srslte::unique_byte_buffer pdu)
void pdcp::user_interface_rrc::write_pdu_pcch(srslte::unique_byte_buffer_t pdu)
{
ERROR("Error: Received PCCH from ue=%d\n", rnti);
}

@ -177,7 +177,7 @@ void rlc::read_pdu_bcch_dlsch(uint32_t sib_index, uint8_t *payload)
rrc->read_pdu_bcch_dlsch(sib_index, payload);
}
void rlc::write_sdu(uint16_t rnti, uint32_t lcid, srslte::unique_byte_buffer sdu)
void rlc::write_sdu(uint16_t rnti, uint32_t lcid, srslte::unique_byte_buffer_t sdu)
{
uint32_t tx_queue;
@ -215,22 +215,22 @@ void rlc::user_interface::max_retx_attempted()
rrc->max_retx_attempted(rnti);
}
void rlc::user_interface::write_pdu(uint32_t lcid, srslte::unique_byte_buffer sdu)
void rlc::user_interface::write_pdu(uint32_t lcid, srslte::unique_byte_buffer_t sdu)
{
pdcp->write_pdu(rnti, lcid, std::move(sdu));
}
void rlc::user_interface::write_pdu_bcch_bch(srslte::unique_byte_buffer sdu)
void rlc::user_interface::write_pdu_bcch_bch(srslte::unique_byte_buffer_t sdu)
{
ERROR("Error: Received BCCH from ue=%d\n", rnti);
}
void rlc::user_interface::write_pdu_bcch_dlsch(srslte::unique_byte_buffer sdu)
void rlc::user_interface::write_pdu_bcch_dlsch(srslte::unique_byte_buffer_t sdu)
{
ERROR("Error: Received BCCH from ue=%d\n", rnti);
}
void rlc::user_interface::write_pdu_pcch(srslte::unique_byte_buffer sdu)
void rlc::user_interface::write_pdu_pcch(srslte::unique_byte_buffer_t sdu)
{
ERROR("Error: Received PCCH from ue=%d\n", rnti);
}

@ -236,7 +236,7 @@ void rrc::upd_user(uint16_t new_rnti, uint16_t old_rnti)
/*******************************************************************************
PDCP interface
*******************************************************************************/
void rrc::write_pdu(uint16_t rnti, uint32_t lcid, srslte::unique_byte_buffer pdu)
void rrc::write_pdu(uint16_t rnti, uint32_t lcid, srslte::unique_byte_buffer_t pdu)
{
rrc_pdu p = {rnti, lcid, std::move(pdu)};
rx_pdu_queue.push(std::move(p));
@ -245,7 +245,7 @@ void rrc::write_pdu(uint16_t rnti, uint32_t lcid, srslte::unique_byte_buffer pdu
/*******************************************************************************
S1AP interface
*******************************************************************************/
void rrc::write_dl_info(uint16_t rnti, srslte::unique_byte_buffer sdu)
void rrc::write_dl_info(uint16_t rnti, srslte::unique_byte_buffer_t sdu)
{
dl_dcch_msg_s dl_dcch_msg;
dl_dcch_msg.msg.set_c1();
@ -517,7 +517,7 @@ void rrc::read_pdu_pcch(uint8_t* payload, uint32_t buffer_size)
from either a public function or the internal thread
*******************************************************************************/
void rrc::parse_ul_ccch(uint16_t rnti, srslte::unique_byte_buffer pdu)
void rrc::parse_ul_ccch(uint16_t rnti, srslte::unique_byte_buffer_t pdu)
{
uint16_t old_rnti = 0;
@ -583,7 +583,7 @@ void rrc::parse_ul_ccch(uint16_t rnti, srslte::unique_byte_buffer pdu)
}
}
void rrc::parse_ul_dcch(uint16_t rnti, uint32_t lcid, srslte::unique_byte_buffer pdu)
void rrc::parse_ul_dcch(uint16_t rnti, uint32_t lcid, srslte::unique_byte_buffer_t pdu)
{
if (pdu) {
if (users.count(rnti)) {
@ -726,7 +726,7 @@ uint32_t rrc::generate_sibs()
// Pack payload for all messages
for (uint32_t msg_index = 0; msg_index < nof_messages; msg_index++) {
srslte::unique_byte_buffer sib = srslte::allocate_unique_buffer(*pool);
srslte::unique_byte_buffer_t sib = srslte::allocate_unique_buffer(*pool);
asn1::bit_ref bref(sib->msg, sib->get_tailroom());
asn1::bit_ref bref0 = bref;
msg[msg_index].pack(bref);
@ -1032,7 +1032,7 @@ bool rrc::ue::is_timeout()
return false;
}
void rrc::ue::parse_ul_dcch(uint32_t lcid, srslte::unique_byte_buffer pdu)
void rrc::ue::parse_ul_dcch(uint32_t lcid, srslte::unique_byte_buffer_t pdu)
{
set_activity();
@ -1130,7 +1130,7 @@ void rrc::ue::handle_rrc_con_reest_req(rrc_conn_reest_request_r8_ies_s* msg)
}
void rrc::ue::handle_rrc_con_setup_complete(rrc_conn_setup_complete_s* msg, srslte::unique_byte_buffer pdu)
void rrc::ue::handle_rrc_con_setup_complete(rrc_conn_setup_complete_s* msg, srslte::unique_byte_buffer_t pdu)
{
parent->rrc_log->info("RRCConnectionSetupComplete transaction ID: %d\n", msg->rrc_transaction_id);
rrc_conn_setup_complete_r8_ies_s* msg_r8 = &msg->crit_exts.c1().rrc_conn_setup_complete_r8();
@ -1153,7 +1153,7 @@ void rrc::ue::handle_rrc_con_setup_complete(rrc_conn_setup_complete_s* msg, srsl
state = RRC_STATE_WAIT_FOR_CON_RECONF_COMPLETE;
}
void rrc::ue::handle_rrc_reconf_complete(rrc_conn_recfg_complete_s* msg, srslte::unique_byte_buffer pdu)
void rrc::ue::handle_rrc_reconf_complete(rrc_conn_recfg_complete_s* msg, srslte::unique_byte_buffer_t pdu)
{
parent->rrc_log->info("RRCReconfigurationComplete transaction ID: %d\n", msg->rrc_transaction_id);
@ -1599,7 +1599,7 @@ int rrc::ue::get_drbid_config(drb_to_add_mod_s* drb, int drb_id)
return 0;
}
void rrc::ue::send_connection_reconf_upd(srslte::unique_byte_buffer pdu)
void rrc::ue::send_connection_reconf_upd(srslte::unique_byte_buffer_t pdu)
{
dl_dcch_msg_s dl_dcch_msg;
rrc_conn_recfg_s* rrc_conn_recfg = &dl_dcch_msg.msg.set_c1().set_rrc_conn_recfg();
@ -1650,7 +1650,7 @@ void rrc::ue::send_connection_reconf_upd(srslte::unique_byte_buffer pdu)
}
void rrc::ue::send_connection_reconf(srslte::unique_byte_buffer pdu)
void rrc::ue::send_connection_reconf(srslte::unique_byte_buffer_t pdu)
{
dl_dcch_msg_s dl_dcch_msg;
dl_dcch_msg.msg.set_c1().set_rrc_conn_recfg().crit_exts.set_c1().set_rrc_conn_recfg_r8();
@ -1785,7 +1785,7 @@ void rrc::ue::send_connection_reconf(srslte::unique_byte_buffer pdu)
void rrc::ue::send_connection_reconf_new_bearer(LIBLTE_S1AP_E_RABTOBESETUPLISTBEARERSUREQ_STRUCT *e)
{
srslte::unique_byte_buffer pdu = srslte::allocate_unique_buffer(*pool);
srslte::unique_byte_buffer_t pdu = srslte::allocate_unique_buffer(*pool);
dl_dcch_msg_s dl_dcch_msg;
dl_dcch_msg.msg.set_c1().set_rrc_conn_recfg().crit_exts.set_c1().set_rrc_conn_recfg_r8();
@ -1972,7 +1972,7 @@ bool rrc::ue::select_security_algorithms()
void rrc::ue::send_dl_ccch(dl_ccch_msg_s* dl_ccch_msg)
{
// Allocate a new PDU buffer, pack the message and send to PDCP
srslte::unique_byte_buffer pdu = srslte::allocate_unique_buffer(*pool);
srslte::unique_byte_buffer_t pdu = srslte::allocate_unique_buffer(*pool);
if (pdu) {
asn1::bit_ref bref(pdu->msg, pdu->get_tailroom());
dl_ccch_msg->pack(bref);
@ -1988,7 +1988,7 @@ void rrc::ue::send_dl_ccch(dl_ccch_msg_s* dl_ccch_msg)
}
}
void rrc::ue::send_dl_dcch(dl_dcch_msg_s* dl_dcch_msg, srslte::unique_byte_buffer pdu)
void rrc::ue::send_dl_dcch(dl_dcch_msg_s* dl_dcch_msg, srslte::unique_byte_buffer_t pdu)
{
if (!pdu) {
pdu = srslte::allocate_unique_buffer(*pool);

@ -87,7 +87,7 @@ void s1ap::get_metrics(s1ap_metrics_t &m)
void s1ap::run_thread()
{
srslte::unique_byte_buffer pdu = srslte::allocate_unique_buffer(*pool, "s1ap::run_thread");
srslte::unique_byte_buffer_t pdu = srslte::allocate_unique_buffer(*pool, "s1ap::run_thread");
if (!pdu) {
s1ap_log->error("Fatal Error: Couldn't allocate buffer in s1ap::run_thread().\n");
return;
@ -174,7 +174,7 @@ void s1ap::build_tai_cgi()
/*******************************************************************************
/* RRC interface
********************************************************************************/
void s1ap::initial_ue(uint16_t rnti, LIBLTE_S1AP_RRC_ESTABLISHMENT_CAUSE_ENUM cause, srslte::unique_byte_buffer pdu)
void s1ap::initial_ue(uint16_t rnti, LIBLTE_S1AP_RRC_ESTABLISHMENT_CAUSE_ENUM cause, srslte::unique_byte_buffer_t pdu)
{
ue_ctxt_map[rnti].eNB_UE_S1AP_ID = next_eNB_UE_S1AP_ID++;
ue_ctxt_map[rnti].stream_id = 1;
@ -185,7 +185,7 @@ void s1ap::initial_ue(uint16_t rnti, LIBLTE_S1AP_RRC_ESTABLISHMENT_CAUSE_ENUM ca
void s1ap::initial_ue(uint16_t rnti,
LIBLTE_S1AP_RRC_ESTABLISHMENT_CAUSE_ENUM cause,
srslte::unique_byte_buffer pdu,
srslte::unique_byte_buffer_t pdu,
uint32_t m_tmsi,
uint8_t mmec)
{
@ -196,7 +196,7 @@ void s1ap::initial_ue(uint16_t rnti,
send_initialuemessage(rnti, cause, std::move(pdu), true, m_tmsi, mmec);
}
void s1ap::write_pdu(uint16_t rnti, srslte::unique_byte_buffer pdu)
void s1ap::write_pdu(uint16_t rnti, srslte::unique_byte_buffer_t pdu)
{
s1ap_log->info_hex(pdu->msg, pdu->N_bytes, "Received RRC SDU");
@ -479,7 +479,7 @@ bool s1ap::handle_dlnastransport(LIBLTE_S1AP_MESSAGE_DOWNLINKNASTRANSPORT_STRUCT
s1ap_log->warning("Not handling SubscriberProfileIDforRFP\n");
}
srslte::unique_byte_buffer pdu = srslte::allocate_unique_buffer(*pool);
srslte::unique_byte_buffer_t pdu = srslte::allocate_unique_buffer(*pool);
if (pdu) {
memcpy(pdu->msg, msg->NAS_PDU.buffer, msg->NAS_PDU.n_octets);
pdu->N_bytes = msg->NAS_PDU.n_octets;
@ -620,7 +620,7 @@ bool s1ap::handle_s1setupfailure(LIBLTE_S1AP_MESSAGE_S1SETUPFAILURE_STRUCT *msg)
bool s1ap::send_initialuemessage(uint16_t rnti,
LIBLTE_S1AP_RRC_ESTABLISHMENT_CAUSE_ENUM cause,
srslte::unique_byte_buffer pdu,
srslte::unique_byte_buffer_t pdu,
bool has_tmsi,
uint32_t m_tmsi,
uint8_t mmec)
@ -692,7 +692,7 @@ bool s1ap::send_initialuemessage(uint16_t rnti,
return true;
}
bool s1ap::send_ulnastransport(uint16_t rnti, srslte::unique_byte_buffer pdu)
bool s1ap::send_ulnastransport(uint16_t rnti, srslte::unique_byte_buffer_t pdu)
{
if(!mme_connected) {
return false;
@ -825,7 +825,7 @@ bool s1ap::send_initial_ctxt_setup_response(uint16_t rnti, LIBLTE_S1AP_MESSAGE_I
if(!mme_connected) {
return false;
}
srslte::unique_byte_buffer buf = srslte::allocate_unique_buffer(*pool);
srslte::unique_byte_buffer_t buf = srslte::allocate_unique_buffer(*pool);
if (!buf) {
s1ap_log->error("Fatal Error: Couldn't allocate buffer in s1ap::send_initial_ctxt_setup_response().\n");
return false;
@ -877,7 +877,7 @@ bool s1ap::send_erab_setup_response(uint16_t rnti, LIBLTE_S1AP_MESSAGE_E_RABSETU
if(!mme_connected) {
return false;
}
srslte::unique_byte_buffer buf = srslte::allocate_unique_buffer(*pool);
srslte::unique_byte_buffer_t buf = srslte::allocate_unique_buffer(*pool);
if (!buf) {
s1ap_log->error("Fatal Error: Couldn't allocate buffer in s1ap::send_erab_setup_response().\n");
return false;
@ -929,7 +929,7 @@ bool s1ap::send_initial_ctxt_setup_failure(uint16_t rnti)
if(!mme_connected) {
return false;
}
srslte::unique_byte_buffer buf = srslte::allocate_unique_buffer(*pool);
srslte::unique_byte_buffer_t buf = srslte::allocate_unique_buffer(*pool);
if (!buf) {
s1ap_log->error("Fatal Error: Couldn't allocate buffer in s1ap::send_initial_ctxt_setup_failure().\n");
return false;

@ -49,8 +49,8 @@ public:
void set_tundevname(const std::string & devname);
// PDCP interface
void write_pdu(uint32_t lcid, srslte::unique_byte_buffer pdu);
void write_pdu_mch(uint32_t lcid, srslte::unique_byte_buffer pdu);
void write_pdu(uint32_t lcid, srslte::unique_byte_buffer_t pdu);
void write_pdu_mch(uint32_t lcid, srslte::unique_byte_buffer_t pdu);
// NAS interface
srslte::error_t setup_if_addr(uint8_t pdn_type, uint32_t ip_addr, uint8_t* ipv6_if_addr, char *err_str);

@ -82,7 +82,7 @@ public:
// RRC interface
void paging(asn1::rrc::s_tmsi_s* ue_identiy);
void set_barring(barring_t barring);
void write_pdu(uint32_t lcid, srslte::unique_byte_buffer pdu);
void write_pdu(uint32_t lcid, srslte::unique_byte_buffer_t pdu);
uint32_t get_k_enb_count();
bool is_attached();
bool get_k_asme(uint8_t *k_asme_, uint32_t n);
@ -171,17 +171,17 @@ private:
void select_plmn();
// Parsers
void parse_attach_accept(uint32_t lcid, srslte::unique_byte_buffer pdu);
void parse_attach_reject(uint32_t lcid, srslte::unique_byte_buffer pdu);
void parse_authentication_request(uint32_t lcid, srslte::unique_byte_buffer pdu, const uint8_t sec_hdr_type);
void parse_authentication_reject(uint32_t lcid, srslte::unique_byte_buffer pdu);
void parse_identity_request(uint32_t lcid, srslte::unique_byte_buffer pdu);
void parse_security_mode_command(uint32_t lcid, srslte::unique_byte_buffer pdu);
void parse_service_reject(uint32_t lcid, srslte::unique_byte_buffer pdu);
void parse_esm_information_request(uint32_t lcid, srslte::unique_byte_buffer pdu);
void parse_emm_information(uint32_t lcid, srslte::unique_byte_buffer pdu);
void parse_detach_request(uint32_t lcid, srslte::unique_byte_buffer pdu);
void parse_emm_status(uint32_t lcid, srslte::unique_byte_buffer pdu);
void parse_attach_accept(uint32_t lcid, srslte::unique_byte_buffer_t pdu);
void parse_attach_reject(uint32_t lcid, srslte::unique_byte_buffer_t pdu);
void parse_authentication_request(uint32_t lcid, srslte::unique_byte_buffer_t pdu, const uint8_t sec_hdr_type);
void parse_authentication_reject(uint32_t lcid, srslte::unique_byte_buffer_t pdu);
void parse_identity_request(uint32_t lcid, srslte::unique_byte_buffer_t pdu);
void parse_security_mode_command(uint32_t lcid, srslte::unique_byte_buffer_t pdu);
void parse_service_reject(uint32_t lcid, srslte::unique_byte_buffer_t pdu);
void parse_esm_information_request(uint32_t lcid, srslte::unique_byte_buffer_t pdu);
void parse_emm_information(uint32_t lcid, srslte::unique_byte_buffer_t pdu);
void parse_detach_request(uint32_t lcid, srslte::unique_byte_buffer_t pdu);
void parse_emm_status(uint32_t lcid, srslte::unique_byte_buffer_t pdu);
// Packet generators
void gen_attach_request(srslte::byte_buffer_t* msg);

@ -313,13 +313,13 @@ public:
bool mbms_service_start(uint32_t serv, uint32_t port);
// NAS interface
void write_sdu(srslte::unique_byte_buffer sdu);
void write_sdu(srslte::unique_byte_buffer_t sdu);
void enable_capabilities();
uint16_t get_mcc();
uint16_t get_mnc();
int plmn_search(found_plmn_t found_plmns[MAX_FOUND_PLMNS]);
void plmn_select(asn1::rrc::plmn_id_s plmn_id);
bool connection_request(asn1::rrc::establishment_cause_e cause, srslte::unique_byte_buffer dedicated_info_nas);
bool connection_request(asn1::rrc::establishment_cause_e cause, srslte::unique_byte_buffer_t dedicated_info_nas);
void set_ue_idenity(asn1::rrc::s_tmsi_s s_tmsi);
// PHY interface
@ -338,11 +338,11 @@ public:
bool have_drb();
// PDCP interface
void write_pdu(uint32_t lcid, srslte::unique_byte_buffer pdu);
void write_pdu_bcch_bch(srslte::unique_byte_buffer pdu);
void write_pdu_bcch_dlsch(srslte::unique_byte_buffer pdu);
void write_pdu_pcch(srslte::unique_byte_buffer pdu);
void write_pdu_mch(uint32_t lcid, srslte::unique_byte_buffer pdu);
void write_pdu(uint32_t lcid, srslte::unique_byte_buffer_t pdu);
void write_pdu_bcch_bch(srslte::unique_byte_buffer_t pdu);
void write_pdu_bcch_dlsch(srslte::unique_byte_buffer_t pdu);
void write_pdu_pcch(srslte::unique_byte_buffer_t pdu);
void write_pdu_mch(uint32_t lcid, srslte::unique_byte_buffer_t pdu);
private:
@ -352,7 +352,7 @@ private:
PCCH,
STOP
} command;
srslte::unique_byte_buffer pdu;
srslte::unique_byte_buffer_t pdu;
uint16_t lcid;
} cmd_msg_t;
@ -360,7 +360,7 @@ private:
srslte::block_queue<cmd_msg_t> cmd_q;
void run_thread();
void process_pcch(srslte::unique_byte_buffer pdu);
void process_pcch(srslte::unique_byte_buffer_t pdu);
srslte::byte_buffer_pool *pool;
srslte::log *rrc_log;
@ -372,7 +372,7 @@ private:
usim_interface_rrc *usim;
gw_interface_rrc *gw;
srslte::unique_byte_buffer dedicated_info_nas;
srslte::unique_byte_buffer_t dedicated_info_nas;
void send_ul_ccch_msg(const asn1::rrc::ul_ccch_msg_s& msg);
void send_ul_dcch_msg(uint32_t lcid, const asn1::rrc::ul_dcch_msg_s& msg);
@ -625,17 +625,17 @@ private:
void send_con_request(asn1::rrc::establishment_cause_e cause);
void send_con_restablish_request(asn1::rrc::reest_cause_e cause);
void send_con_restablish_complete();
void send_con_setup_complete(srslte::unique_byte_buffer nas_msg);
void send_ul_info_transfer(srslte::unique_byte_buffer nas_msg);
void send_con_setup_complete(srslte::unique_byte_buffer_t nas_msg);
void send_ul_info_transfer(srslte::unique_byte_buffer_t nas_msg);
void send_security_mode_complete();
void send_rrc_con_reconfig_complete();
void send_rrc_ue_cap_info();
// Parsers
void process_pdu(uint32_t lcid, srslte::unique_byte_buffer pdu);
void parse_dl_ccch(srslte::unique_byte_buffer pdu);
void parse_dl_dcch(uint32_t lcid, srslte::unique_byte_buffer pdu);
void parse_dl_info_transfer(uint32_t lcid, srslte::unique_byte_buffer pdu);
void process_pdu(uint32_t lcid, srslte::unique_byte_buffer_t pdu);
void parse_dl_ccch(srslte::unique_byte_buffer_t pdu);
void parse_dl_dcch(uint32_t lcid, srslte::unique_byte_buffer_t pdu);
void parse_dl_info_transfer(uint32_t lcid, srslte::unique_byte_buffer_t pdu);
// Helpers
bool con_reconfig(asn1::rrc::rrc_conn_recfg_s* reconfig);

@ -162,7 +162,7 @@ void gw::set_tundevname(const std::string & devname)
/*******************************************************************************
PDCP interface
*******************************************************************************/
void gw::write_pdu(uint32_t lcid, srslte::unique_byte_buffer pdu)
void gw::write_pdu(uint32_t lcid, srslte::unique_byte_buffer_t pdu)
{
gw_log->info_hex(pdu->msg, pdu->N_bytes, "RX PDU. Stack latency: %ld us\n", pdu->get_latency_us());
dl_tput_bytes += pdu->N_bytes;
@ -183,7 +183,7 @@ void gw::write_pdu(uint32_t lcid, srslte::unique_byte_buffer pdu)
}
}
void gw::write_pdu_mch(uint32_t lcid, srslte::unique_byte_buffer pdu)
void gw::write_pdu_mch(uint32_t lcid, srslte::unique_byte_buffer_t pdu)
{
if(pdu->N_bytes>2)
{
@ -251,7 +251,7 @@ void gw::run_thread()
uint32 idx = 0;
int32 N_bytes = 0;
srslte::unique_byte_buffer pdu = srslte::allocate_unique_buffer(*pool, true);
srslte::unique_byte_buffer_t pdu = srslte::allocate_unique_buffer(*pool, true);
if (!pdu) {
gw_log->error("Fatal Error: Couldn't allocate PDU in run_thread().\n");
return;

@ -257,7 +257,7 @@ bool nas::rrc_connect() {
}
// Generate service request or attach request message
unique_byte_buffer dedicatedInfoNAS = srslte::allocate_unique_buffer(*pool, true);
unique_byte_buffer_t dedicatedInfoNAS = srslte::allocate_unique_buffer(*pool, true);
if (!dedicatedInfoNAS) {
nas_log->error("Fatal Error: Couldn't allocate PDU in rrc_connect().\n");
return false;
@ -334,7 +334,7 @@ void nas::select_plmn() {
}
}
void nas::write_pdu(uint32_t lcid, unique_byte_buffer pdu)
void nas::write_pdu(uint32_t lcid, unique_byte_buffer_t pdu)
{
uint8 pd = 0;
uint8 msg_type = 0;
@ -625,7 +625,7 @@ bool nas::check_cap_replay(LIBLTE_MME_UE_SECURITY_CAPABILITIES_STRUCT *caps)
* Parsers
******************************************************************************/
void nas::parse_attach_accept(uint32_t lcid, unique_byte_buffer pdu)
void nas::parse_attach_accept(uint32_t lcid, unique_byte_buffer_t pdu)
{
if (!pdu) {
@ -866,7 +866,7 @@ void nas::parse_attach_accept(uint32_t lcid, unique_byte_buffer pdu)
}
}
void nas::parse_attach_reject(uint32_t lcid, unique_byte_buffer pdu)
void nas::parse_attach_reject(uint32_t lcid, unique_byte_buffer_t pdu)
{
LIBLTE_MME_ATTACH_REJECT_MSG_STRUCT attach_rej;
ZERO_OBJECT(attach_rej);
@ -878,7 +878,7 @@ void nas::parse_attach_reject(uint32_t lcid, unique_byte_buffer pdu)
// FIXME: Command RRC to release?
}
void nas::parse_authentication_request(uint32_t lcid, unique_byte_buffer pdu, const uint8_t sec_hdr_type)
void nas::parse_authentication_request(uint32_t lcid, unique_byte_buffer_t pdu, const uint8_t sec_hdr_type)
{
LIBLTE_MME_AUTHENTICATION_REQUEST_MSG_STRUCT auth_req;
bzero(&auth_req, sizeof(LIBLTE_MME_AUTHENTICATION_REQUEST_MSG_STRUCT));
@ -924,14 +924,14 @@ void nas::parse_authentication_request(uint32_t lcid, unique_byte_buffer pdu, co
}
}
void nas::parse_authentication_reject(uint32_t lcid, unique_byte_buffer pdu)
void nas::parse_authentication_reject(uint32_t lcid, unique_byte_buffer_t pdu)
{
nas_log->warning("Received Authentication Reject\n");
state = EMM_STATE_DEREGISTERED;
// FIXME: Command RRC to release?
}
void nas::parse_identity_request(uint32_t lcid, unique_byte_buffer pdu)
void nas::parse_identity_request(uint32_t lcid, unique_byte_buffer_t pdu)
{
LIBLTE_MME_ID_REQUEST_MSG_STRUCT id_req;
ZERO_OBJECT(id_req);
@ -949,7 +949,7 @@ void nas::parse_identity_request(uint32_t lcid, unique_byte_buffer pdu)
send_identity_response(lcid, id_req.id_type);
}
void nas::parse_security_mode_command(uint32_t lcid, unique_byte_buffer pdu)
void nas::parse_security_mode_command(uint32_t lcid, unique_byte_buffer_t pdu)
{
if (!pdu) {
nas_log->error("Invalid PDU\n");
@ -1067,7 +1067,7 @@ void nas::parse_security_mode_command(uint32_t lcid, unique_byte_buffer pdu)
ctxt.tx_count++;
}
void nas::parse_service_reject(uint32_t lcid, unique_byte_buffer pdu)
void nas::parse_service_reject(uint32_t lcid, unique_byte_buffer_t pdu)
{
LIBLTE_MME_SERVICE_REJECT_MSG_STRUCT service_reject;
if (liblte_mme_unpack_service_reject_msg((LIBLTE_BYTE_MSG_STRUCT*)pdu.get(), &service_reject)) {
@ -1087,7 +1087,7 @@ exit:
ctxt.rx_count++;
}
void nas::parse_esm_information_request(uint32_t lcid, unique_byte_buffer pdu)
void nas::parse_esm_information_request(uint32_t lcid, unique_byte_buffer_t pdu)
{
LIBLTE_MME_ESM_INFORMATION_REQUEST_MSG_STRUCT esm_info_req;
liblte_mme_unpack_esm_information_request_msg((LIBLTE_BYTE_MSG_STRUCT*)pdu.get(), &esm_info_req);
@ -1099,7 +1099,7 @@ void nas::parse_esm_information_request(uint32_t lcid, unique_byte_buffer pdu)
send_esm_information_response(esm_info_req.proc_transaction_id);
}
void nas::parse_emm_information(uint32_t lcid, unique_byte_buffer pdu)
void nas::parse_emm_information(uint32_t lcid, unique_byte_buffer_t pdu)
{
liblte_mme_unpack_emm_information_msg((LIBLTE_BYTE_MSG_STRUCT*)pdu.get(), &emm_info);
std::string str = emm_info_str(&emm_info);
@ -1108,7 +1108,7 @@ void nas::parse_emm_information(uint32_t lcid, unique_byte_buffer pdu)
ctxt.rx_count++;
}
void nas::parse_detach_request(uint32_t lcid, unique_byte_buffer pdu)
void nas::parse_detach_request(uint32_t lcid, unique_byte_buffer_t pdu)
{
LIBLTE_MME_DETACH_REQUEST_MSG_STRUCT detach_request;
liblte_mme_unpack_detach_request_msg((LIBLTE_BYTE_MSG_STRUCT*)pdu.get(), &detach_request);
@ -1124,7 +1124,7 @@ void nas::parse_detach_request(uint32_t lcid, unique_byte_buffer pdu)
}
}
void nas::parse_emm_status(uint32_t lcid, unique_byte_buffer pdu)
void nas::parse_emm_status(uint32_t lcid, unique_byte_buffer_t pdu)
{
LIBLTE_MME_EMM_STATUS_MSG_STRUCT emm_status;
liblte_mme_unpack_emm_status_msg((LIBLTE_BYTE_MSG_STRUCT*)pdu.get(), &emm_status);
@ -1323,7 +1323,7 @@ void nas::gen_pdn_connectivity_request(LIBLTE_BYTE_MSG_STRUCT *msg) {
}
void nas::send_security_mode_reject(uint8_t cause) {
unique_byte_buffer msg = srslte::allocate_unique_buffer(*pool, true);
unique_byte_buffer_t msg = srslte::allocate_unique_buffer(*pool, true);
if (!msg) {
nas_log->error("Fatal Error: Couldn't allocate PDU in send_security_mode_reject().\n");
return;
@ -1341,7 +1341,7 @@ void nas::send_security_mode_reject(uint8_t cause) {
void nas::send_detach_request(bool switch_off)
{
unique_byte_buffer pdu = srslte::allocate_unique_buffer(*pool, true);
unique_byte_buffer_t pdu = srslte::allocate_unique_buffer(*pool, true);
if (!pdu) {
nas_log->error("Fatal Error: Couldn't allocate PDU in %s().\n", __FUNCTION__);
return;
@ -1413,7 +1413,7 @@ void nas::send_detach_request(bool switch_off)
void nas::send_detach_accept()
{
unique_byte_buffer pdu = srslte::allocate_unique_buffer(*pool, true);
unique_byte_buffer_t pdu = srslte::allocate_unique_buffer(*pool, true);
if (!pdu) {
nas_log->error("Fatal Error: Couldn't allocate PDU in %s().\n", __FUNCTION__);
return;
@ -1449,7 +1449,7 @@ void nas::send_detach_accept()
void nas::send_authentication_response(const uint8_t* res, const size_t res_len, const uint8_t sec_hdr_type) {
unique_byte_buffer pdu = srslte::allocate_unique_buffer(*pool, true);
unique_byte_buffer_t pdu = srslte::allocate_unique_buffer(*pool, true);
if (!pdu) {
nas_log->error("Fatal Error: Couldn't allocate PDU in send_authentication_response().\n");
return;
@ -1485,7 +1485,7 @@ void nas::send_authentication_response(const uint8_t* res, const size_t res_len,
void nas::send_authentication_failure(const uint8_t cause, const uint8_t* auth_fail_param) {
unique_byte_buffer msg = srslte::allocate_unique_buffer(*pool, true);
unique_byte_buffer_t msg = srslte::allocate_unique_buffer(*pool, true);
if (!msg) {
nas_log->error("Fatal Error: Couldn't allocate PDU in send_authentication_failure().\n");
return;
@ -1529,7 +1529,7 @@ void nas::send_identity_response(uint32_t lcid, uint8 id_type)
return;
}
unique_byte_buffer pdu = srslte::allocate_unique_buffer(*pool, true);
unique_byte_buffer_t pdu = srslte::allocate_unique_buffer(*pool, true);
if (!pdu) {
nas_log->error("Fatal Error: Couldn't allocate PDU in send_identity_response().\n");
return;
@ -1546,7 +1546,7 @@ void nas::send_identity_response(uint32_t lcid, uint8 id_type)
}
void nas::send_service_request() {
unique_byte_buffer msg = srslte::allocate_unique_buffer(*pool, true);
unique_byte_buffer_t msg = srslte::allocate_unique_buffer(*pool, true);
if (!msg) {
nas_log->error("Fatal Error: Couldn't allocate PDU in send_service_request().\n");
return;
@ -1671,7 +1671,7 @@ void nas::send_esm_information_response(const uint8 proc_transaction_id) {
esm_info_resp.protocol_cnfg_opts_present = false;
}
unique_byte_buffer pdu = srslte::allocate_unique_buffer(*pool, true);
unique_byte_buffer_t pdu = srslte::allocate_unique_buffer(*pool, true);
if (!pdu) {
nas_log->error("Fatal Error: Couldn't allocate PDU in send_attach_request().\n");
return;

@ -423,7 +423,7 @@ void rrc::plmn_select(asn1::rrc::plmn_id_s plmn_id)
* it. Sends connectionRequest message and returns if message transmitted successfully.
* It does not wait until completition of Connection Establishment procedure
*/
bool rrc::connection_request(asn1::rrc::establishment_cause_e cause, srslte::unique_byte_buffer dedicated_info_nas)
bool rrc::connection_request(asn1::rrc::establishment_cause_e cause, srslte::unique_byte_buffer_t dedicated_info_nas)
{
if (!plmn_is_selected) {
@ -1430,7 +1430,7 @@ void rrc::send_con_restablish_complete() {
send_ul_dcch_msg(RB_ID_SRB1, ul_dcch_msg);
}
void rrc::send_con_setup_complete(srslte::unique_byte_buffer nas_msg)
void rrc::send_con_setup_complete(srslte::unique_byte_buffer_t nas_msg)
{
rrc_log->debug("Preparing RRC Connection Setup Complete\n");
@ -1448,7 +1448,7 @@ void rrc::send_con_setup_complete(srslte::unique_byte_buffer nas_msg)
send_ul_dcch_msg(RB_ID_SRB1, ul_dcch_msg);
}
void rrc::send_ul_info_transfer(unique_byte_buffer nas_msg)
void rrc::send_ul_info_transfer(unique_byte_buffer_t nas_msg)
{
uint32_t lcid = rlc->has_bearer(RB_ID_SRB2) ? RB_ID_SRB2 : RB_ID_SRB1;
@ -1657,7 +1657,7 @@ bool rrc::con_reconfig(asn1::rrc::rrc_conn_recfg_s* reconfig)
send_rrc_con_reconfig_complete();
unique_byte_buffer nas_sdu;
unique_byte_buffer_t nas_sdu;
for (uint32_t i = 0; i < reconfig_r8->ded_info_nas_list.size(); i++) {
nas_sdu = srslte::allocate_unique_buffer(*pool);
if (nas_sdu.get()) {
@ -1765,13 +1765,13 @@ void rrc::stop_timers()
*
*
*******************************************************************************/
void rrc::write_pdu_bcch_bch(unique_byte_buffer pdu)
void rrc::write_pdu_bcch_bch(unique_byte_buffer_t pdu)
{
// Do we need to do something with BCH?
rrc_log->info_hex(pdu->msg, pdu->N_bytes, "BCCH BCH message received.");
}
void rrc::write_pdu_bcch_dlsch(unique_byte_buffer pdu)
void rrc::write_pdu_bcch_dlsch(unique_byte_buffer_t pdu)
{
// Stop BCCH search after successful reception of 1 BCCH block
mac->bcch_stop_rx();
@ -1924,7 +1924,7 @@ void rrc::handle_sib13()
*
*
*******************************************************************************/
void rrc::write_pdu_pcch(unique_byte_buffer pdu)
void rrc::write_pdu_pcch(unique_byte_buffer_t pdu)
{
cmd_msg_t msg;
msg.pdu = std::move(pdu);
@ -1932,7 +1932,7 @@ void rrc::write_pdu_pcch(unique_byte_buffer pdu)
cmd_q.push(std::move(msg));
}
void rrc::process_pcch(unique_byte_buffer pdu)
void rrc::process_pcch(unique_byte_buffer_t pdu)
{
if (pdu->N_bytes > 0 && pdu->N_bytes < SRSLTE_MAX_BUFFER_SIZE_BITS) {
pcch_msg_s pcch_msg;
@ -1988,7 +1988,7 @@ void rrc::process_pcch(unique_byte_buffer pdu)
}
}
void rrc::write_pdu_mch(uint32_t lcid, srslte::unique_byte_buffer pdu)
void rrc::write_pdu_mch(uint32_t lcid, srslte::unique_byte_buffer_t pdu)
{
if (pdu->N_bytes > 0 && pdu->N_bytes < SRSLTE_MAX_BUFFER_SIZE_BITS) {
//TODO: handle MCCH notifications and update MCCH
@ -2022,7 +2022,7 @@ void rrc::write_pdu_mch(uint32_t lcid, srslte::unique_byte_buffer pdu)
void rrc::send_ul_ccch_msg(const asn1::rrc::ul_ccch_msg_s& msg)
{
// Reset and reuse sdu buffer if provided
unique_byte_buffer pdcp_buf = srslte::allocate_unique_buffer(*pool, true);
unique_byte_buffer_t pdcp_buf = srslte::allocate_unique_buffer(*pool, true);
if (not pdcp_buf.get()) {
rrc_log->error("Fatal Error: Couldn't allocate PDU in byte_align_and_pack().\n");
return;
@ -2054,7 +2054,7 @@ void rrc::send_ul_ccch_msg(const asn1::rrc::ul_ccch_msg_s& msg)
void rrc::send_ul_dcch_msg(uint32_t lcid, const asn1::rrc::ul_dcch_msg_s& msg)
{
// Reset and reuse sdu buffer if provided
unique_byte_buffer pdcp_buf = srslte::allocate_unique_buffer(*pool, true);
unique_byte_buffer_t pdcp_buf = srslte::allocate_unique_buffer(*pool, true);
if (not pdcp_buf.get()) {
rrc_log->error("Fatal Error: Couldn't allocate PDU in byte_align_and_pack().\n");
return;
@ -2071,7 +2071,7 @@ void rrc::send_ul_dcch_msg(uint32_t lcid, const asn1::rrc::ul_dcch_msg_s& msg)
pdcp->write_sdu(lcid, std::move(pdcp_buf));
}
void rrc::write_sdu(srslte::unique_byte_buffer sdu)
void rrc::write_sdu(srslte::unique_byte_buffer_t sdu)
{
if (state == RRC_STATE_IDLE) {
@ -2081,7 +2081,7 @@ void rrc::write_sdu(srslte::unique_byte_buffer sdu)
send_ul_info_transfer(std::move(sdu));
}
void rrc::write_pdu(uint32_t lcid, unique_byte_buffer pdu)
void rrc::write_pdu(uint32_t lcid, unique_byte_buffer_t pdu)
{
// If the message contains a ConnectionSetup, acknowledge the transmission to avoid blocking of paging procedure
if (lcid == 0) {
@ -2111,7 +2111,7 @@ void rrc::write_pdu(uint32_t lcid, unique_byte_buffer pdu)
cmd_q.push(std::move(msg));
}
void rrc::process_pdu(uint32_t lcid, srslte::unique_byte_buffer pdu)
void rrc::process_pdu(uint32_t lcid, srslte::unique_byte_buffer_t pdu)
{
switch (lcid) {
case RB_ID_SRB0:
@ -2127,7 +2127,7 @@ void rrc::process_pdu(uint32_t lcid, srslte::unique_byte_buffer pdu)
}
}
void rrc::parse_dl_ccch(unique_byte_buffer pdu)
void rrc::parse_dl_ccch(unique_byte_buffer_t pdu)
{
asn1::bit_ref bref(pdu->msg, pdu->N_bytes);
asn1::rrc::dl_ccch_msg_s dl_ccch_msg;
@ -2178,7 +2178,7 @@ void rrc::parse_dl_ccch(unique_byte_buffer pdu)
}
}
void rrc::parse_dl_dcch(uint32_t lcid, unique_byte_buffer pdu)
void rrc::parse_dl_dcch(uint32_t lcid, unique_byte_buffer_t pdu)
{
asn1::bit_ref bref(pdu->msg, pdu->N_bytes);
asn1::rrc::dl_dcch_msg_s dl_dcch_msg;

@ -70,13 +70,13 @@ namespace srslte {
class pdcp_dummy : public rrc_interface_pdcp, public pdcp_interface_gw
{
public:
void write_pdu(uint32_t lcid, unique_byte_buffer pdu) {}
void write_pdu_bcch_bch(unique_byte_buffer pdu) {}
void write_pdu_bcch_dlsch(unique_byte_buffer pdu) {}
void write_pdu_pcch(unique_byte_buffer pdu) {}
void write_pdu_mch(uint32_t lcid, srslte::unique_byte_buffer sdu) {}
void write_pdu(uint32_t lcid, unique_byte_buffer_t pdu) {}
void write_pdu_bcch_bch(unique_byte_buffer_t pdu) {}
void write_pdu_bcch_dlsch(unique_byte_buffer_t pdu) {}
void write_pdu_pcch(unique_byte_buffer_t pdu) {}
void write_pdu_mch(uint32_t lcid, srslte::unique_byte_buffer_t sdu) {}
std::string get_rb_name(uint32_t lcid) { return std::string("lcid"); }
void write_sdu(uint32_t lcid, srslte::unique_byte_buffer sdu, bool blocking) {}
void write_sdu(uint32_t lcid, srslte::unique_byte_buffer_t sdu, bool blocking) {}
bool is_lcid_enabled(uint32_t lcid) { return false; }
};
@ -89,7 +89,7 @@ public:
mnc_to_bytes(mnc, plmns.plmn_id.mnc);
plmns.tac = 0xffff;
}
void write_sdu(unique_byte_buffer sdu)
void write_sdu(unique_byte_buffer_t sdu)
{
last_sdu_len = sdu->N_bytes;
//printf("NAS generated SDU (len=%d):\n", sdu->N_bytes);
@ -105,7 +105,7 @@ public:
};
void plmn_select(plmn_id_s plmn_id){};
void set_ue_idenity(s_tmsi_s s_tmsi) {}
bool connection_request(establishment_cause_e cause, srslte::unique_byte_buffer sdu)
bool connection_request(establishment_cause_e cause, srslte::unique_byte_buffer_t sdu)
{
printf("NAS generated SDU (len=%d):\n", sdu->N_bytes);
last_sdu_len = sdu->N_bytes;
@ -126,8 +126,8 @@ private:
class gw_dummy : public gw_interface_nas, public gw_interface_pdcp
{
error_t setup_if_addr(uint8_t pdn_type, uint32_t ip_addr, uint8_t *ipv6_if_id, char *err_str) { return ERROR_NONE; }
void write_pdu(uint32_t lcid, unique_byte_buffer pdu) {}
void write_pdu_mch(uint32_t lcid, srslte::unique_byte_buffer sdu) {}
void write_pdu(uint32_t lcid, unique_byte_buffer_t pdu) {}
void write_pdu_mch(uint32_t lcid, srslte::unique_byte_buffer_t sdu) {}
};
}
@ -171,7 +171,7 @@ int security_command_test()
// push auth request PDU to NAS to generate security context
byte_buffer_pool* pool = byte_buffer_pool::get_instance();
unique_byte_buffer tmp = srslte::allocate_unique_buffer(*pool, true);
unique_byte_buffer_t tmp = srslte::allocate_unique_buffer(*pool, true);
memcpy(tmp->msg, auth_request_pdu, sizeof(auth_request_pdu));
tmp->N_bytes = sizeof(auth_request_pdu);
nas.write_pdu(LCID, std::move(tmp));
@ -250,7 +250,7 @@ int mme_attach_request_test()
// finally push attach accept
byte_buffer_pool* pool = byte_buffer_pool::get_instance();
unique_byte_buffer tmp = srslte::allocate_unique_buffer(*pool, true);
unique_byte_buffer_t tmp = srslte::allocate_unique_buffer(*pool, true);
memcpy(tmp->msg, attach_accept_pdu, sizeof(attach_accept_pdu));
tmp->N_bytes = sizeof(attach_accept_pdu);
nas.write_pdu(LCID, std::move(tmp));
@ -311,7 +311,7 @@ int esm_info_request_test()
nas.init(&usim, &rrc_dummy, &gw, &nas_log, cfg);
// push ESM info request PDU to NAS to generate response
unique_byte_buffer tmp = srslte::allocate_unique_buffer(*pool, true);
unique_byte_buffer_t tmp = srslte::allocate_unique_buffer(*pool, true);
memcpy(tmp->msg, esm_info_req_pdu, sizeof(esm_info_req_pdu));
tmp->N_bytes = sizeof(esm_info_req_pdu);
nas.write_pdu(LCID, std::move(tmp));

Loading…
Cancel
Save