Commit Graph

5 Commits

Author SHA1 Message Date
Jacob Erlbeck 257b630216 llc: Add move_and_merge method to llc_queue
This methods takes all LLC frames from the old LLC queue and moves
them into the current. If both queues are ordered chronologically
(recv_time), the resulting queue is also ordered.

Sponsored-by: On-Waves ehf
2015-08-21 19:02:18 +02:00
Jacob Erlbeck 34cf156b80 llc/test: Use a portable way to set timeval variables
Using complex initialiser lists doesn't seem to work well with Debian
Squeeze.

This commit changes the initialisation to use separate assignments
instead.

Fixes: Jenkins #601, #602
Addresses:
  CXX    LlcTest.o
  ../../tests/llc/LlcTest.cpp: In function 'void test_llc_meta()':
  ../../tests/llc/LlcTest.cpp:137: error: expected primary-expression
  before '.' token
  ../../tests/llc/LlcTest.cpp:137: warning: extended initializer
  lists only available with -std=c++0x or -std=gnu++0x

Sponsored-by: On-Waves ehf
2015-06-29 10:28:36 +02:00
Jacob Erlbeck b671dbfe94 llc: Move storage of timestamps into gprs_llc_queue
Currently the receive and expiry timestamps are prepended to the LLC
msgb before it is passed to gprs_llc_queue::enqueue(). Since this meta
information should not be counted as LLC octets, the gprs_llc_queue
needs to known about this (unless the correction was done in the LLC
layer).

This commit moves the meta information storage code into
gprs_llc_queue.  The meta data is now stored in the control block
(cb) area of the msgb.

Note that the info pointer that is returned from the dequeue method
is only valid if that method returns a (non-NULL) msgb. It must not
be used after that msgb has been modified or freed.

Sponsored-by: On-Waves ehf
2015-06-22 10:39:06 +02:00
Jacob Erlbeck 07eb655244 llc: Keep track of the number of stored LLC octets
To get the number of LLC octets that are stored in the queue, this
commit adds a m_queue_octets member along with a octets() method.
This value is updated similarly to m_queue_size on each modifying
method call.

Sponsored-by: On-Waves ehf
2015-06-22 10:39:06 +02:00
Jacob Erlbeck 626369c2fb llc/test: Add test program for LLC related tests
Sponsored-by: On-Waves ehf
2015-06-22 10:39:06 +02:00