aboutsummaryrefslogtreecommitdiffstats
path: root/src/llc.cpp
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <holger@moiji-mobile.com>2013-11-13 16:56:15 +0100
committerHolger Hans Peter Freyther <holger@moiji-mobile.com>2013-11-13 17:08:07 +0100
commite23102602c94dc7fdd7cc6d383e7f6c576aa01ed (patch)
tree688e2172e335a6b1e1787e835a3d0339adee60a6 /src/llc.cpp
parentb3d5ee2934f930e611cd4447b90dce6723340062 (diff)
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.
Diffstat (limited to 'src/llc.cpp')
-rw-r--r--src/llc.cpp12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/llc.cpp b/src/llc.cpp
index 1787daa6..3a50bc78 100644
--- a/src/llc.cpp
+++ b/src/llc.cpp
@@ -32,7 +32,7 @@ extern "C" {
void gprs_llc::reset()
{
index = 0;
- length = 0;
+ m_length = 0;
}
void gprs_llc::reset_frame_space()
@@ -48,11 +48,15 @@ void gprs_llc::enqueue(struct msgb *llc_msg)
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)