llc: Move some more secrets from the TBF into the LLC
Introduce a method to append data to a TBF and then reset the
read pointer when the frame has been sent.
diff --git a/src/llc.cpp b/src/llc.cpp
index 1787daa..3a50bc7 100644
--- a/src/llc.cpp
+++ b/src/llc.cpp
@@ -32,7 +32,7 @@
void gprs_llc::reset()
{
index = 0;
- length = 0;
+ m_length = 0;
}
void gprs_llc::reset_frame_space()
@@ -48,11 +48,15 @@
void gprs_llc::put_frame(const uint8_t *data, size_t len)
{
/* only put frames when we are empty */
- OSMO_ASSERT(index == 0 && length == 0);
+ OSMO_ASSERT(index == 0 && m_length == 0);
+ append_frame(data, len);
+}
+void gprs_llc::append_frame(const uint8_t *data, size_t len)
+{
/* TODO: bounds check */
- memcpy(frame, data, len);
- length = len;
+ memcpy(frame + index, data, len);
+ m_length += len;
}
void gprs_llc::clear(BTS *bts)