aboutsummaryrefslogtreecommitdiffstats
path: root/src/llc.h
diff options
context:
space:
mode:
authorJacob Erlbeck <jerlbeck@sysmocom.de>2015-06-15 14:32:33 +0200
committerJacob Erlbeck <jerlbeck@sysmocom.de>2015-06-22 10:39:06 +0200
commitb671dbfe94789d849880b8c6f2a036f7db04b037 (patch)
tree1007114ec5bd8cb6d4a5fee7e4e3c8c85d9066bf /src/llc.h
parent1e50a3dadef7823b6f50bd387f84f324029a217d (diff)
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
Diffstat (limited to 'src/llc.h')
-rw-r--r--src/llc.h10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/llc.h b/src/llc.h
index 065589db..887e210c 100644
--- a/src/llc.h
+++ b/src/llc.h
@@ -24,6 +24,7 @@ extern "C" {
#include <stdint.h>
#include <string.h>
+#include <time.h>
#define LLC_MAX_LEN 1543
@@ -63,6 +64,11 @@ struct gprs_llc {
* I store the LLC frames that come from the SGSN.
*/
struct gprs_llc_queue {
+ struct MetaInfo {
+ struct timeval recv_time;
+ struct timeval expire_time;
+ };
+
static void calc_pdu_lifetime(BTS *bts, const uint16_t pdu_delay_csec,
struct timeval *tv);
static bool is_frame_expired(const struct timeval *now,
@@ -71,8 +77,8 @@ struct gprs_llc_queue {
void init();
- void enqueue(struct msgb *llc_msg);
- struct msgb *dequeue();
+ void enqueue(struct msgb *llc_msg, const MetaInfo *info = 0);
+ struct msgb *dequeue(const MetaInfo **info = 0);
void clear(BTS *bts);
size_t size() const;
size_t octets() const;