llc_queue::{dequeue,enqueue}() refactor

As seen in OS#4420, setting the MetaInfo.recv_time outside of
llc_queue before calling llc_queue::enqueue() and later on using that
value in llc_queue itself at dequeue time is not a good idea, since it
can provoke errors if the recv_time was not set correctly.
For instance, LlcTest was not setting the value for recv_time on some
test, which ended up with a huge millisec value when substracting now()
from it:
"""
llc.cpp:215:29: runtime error: signed integer overflow: 1582738663 * 1000 cannot be represented in type 'long int'
"""
This issue only appeared when started building on a raspberrypi4.

Let's better set/store the MetaInfo.recv_time internally during
llc_queue::enqueue(). Then, enqueue() only needs the
MetaInfo.expire_time, so let's change its arg list to only receive that
to avoid confusions.

Take the chance to move the llc_queue APIs to use osmo_gettimeofday,
since we need to fake the time now that the API itself sets that time.

Also take the chance during this refactor to disallow passing null
pointer by default since no user needs that.

Finally, update the LlcTest accordingly with all API/behavior changes.

Related: OS#4420
Change-Id: Ief6b1464dc779ff22adc2b02da7a006cd772ebce
diff --git a/src/llc.cpp b/src/llc.cpp
index b155063..4cd0cc4 100644
--- a/src/llc.cpp
+++ b/src/llc.cpp
@@ -103,18 +103,19 @@
 	m_avg_queue_delay = 0;
 }
 
-void gprs_llc_queue::enqueue(struct msgb *llc_msg, const MetaInfo *info)
+
+void gprs_llc_queue::enqueue(struct msgb *llc_msg, const struct timeval *expire_time)
 {
-	static const MetaInfo def_meta = {{0}};
 	MetaInfo *meta_storage;
 
-	osmo_static_assert(sizeof(*info) <= sizeof(llc_msg->cb), info_does_not_fit);
+	osmo_static_assert(sizeof(*meta_storage) <= sizeof(llc_msg->cb), info_does_not_fit);
 
 	m_queue_size += 1;
 	m_queue_octets += msgb_length(llc_msg);
 
 	meta_storage = (MetaInfo *)&llc_msg->cb[0];
-	*meta_storage = info ? *info : def_meta;
+	osmo_gettimeofday(&meta_storage->recv_time, NULL);
+	meta_storage->expire_time = *expire_time;
 
 	msgb_enqueue(&m_queue, llc_msg);
 }
@@ -208,7 +209,7 @@
 	m_queue_octets -= msgb_length(msg);
 
 	/* take the second time */
-	gettimeofday(&tv_now, NULL);
+	osmo_gettimeofday(&tv_now, NULL);
 	tv = (struct timeval *)&msg->data[sizeof(*tv)];
 	timersub(&tv_now, &meta_storage->recv_time, &tv_result);
 
@@ -234,7 +235,7 @@
 
 	/* calculate timestamp of timeout */
 	struct timeval now, csec;
-	gettimeofday(&now, NULL);
+	osmo_gettimeofday(&now, NULL);
 	csec.tv_usec = (delay_csec % 100) * 10000;
 	csec.tv_sec = delay_csec / 100;