llc: Count timedout and silently dropped frames

A DL tbf can be discarded and then the already queued LLCs will
be silently dropped. Count this event.
diff --git a/src/bts.cpp b/src/bts.cpp
index 3f9b24a..07e97de 100644
--- a/src/bts.cpp
+++ b/src/bts.cpp
@@ -57,6 +57,8 @@
 	{ "sba.allocated",		"SBA Allocated        "},
 	{ "sba.freed",			"SBA Freed            "},
 	{ "sba.timedout",		"SBA Timeout          "},
+	{ "llc.timeout",		"Timedout Frames      "},
+	{ "llc.dropped",		"Dropped Frames       "},
 };
 
 static const struct rate_ctr_group_desc bts_ctrg_desc = {
diff --git a/src/bts.h b/src/bts.h
index 3ffd219..259be20 100644
--- a/src/bts.h
+++ b/src/bts.h
@@ -157,6 +157,8 @@
 		CTR_SBA_ALLOCATED,
 		CTR_SBA_FREED,
 		CTR_SBA_TIMEDOUT,
+		CTR_LLC_FRAME_TIMEDOUT,
+		CTR_LLC_FRAME_DROPPED,
 	};
 
 	BTS();
@@ -198,6 +200,8 @@
 	void sba_allocated();
 	void sba_freed();
 	void sba_timedout();
+	void timedout_frame();
+	void dropped_frame();
 
 	/*
 	 * Below for C interface for the VTY
@@ -256,6 +260,8 @@
 CREATE_COUNT_INLINE(sba_allocated, CTR_SBA_ALLOCATED)
 CREATE_COUNT_INLINE(sba_freed, CTR_SBA_FREED)
 CREATE_COUNT_INLINE(sba_timedout, CTR_SBA_TIMEDOUT)
+CREATE_COUNT_INLINE(timedout_frame, CTR_LLC_FRAME_TIMEDOUT);
+CREATE_COUNT_INLINE(dropped_frame, CTR_LLC_FRAME_DROPPED);
 
 #undef CREATE_COUNT_INLINE
 
diff --git a/src/tbf.cpp b/src/tbf.cpp
index cdd8098..1fa7c6e 100644
--- a/src/tbf.cpp
+++ b/src/tbf.cpp
@@ -324,8 +324,10 @@
 			"be sure not to free in this state. PLEASE FIX!\n");
 	tbf->stop_timer();
 	#warning "TODO: Could/Should generate  bssgp_tx_llc_discarded"
-	while ((msg = msgb_dequeue(&tbf->llc_queue)))
+	while ((msg = msgb_dequeue(&tbf->llc_queue))) {
+		tbf->bts->dropped_frame();
 		msgb_free(msg);
+	}
 	tbf_unlink_pdch(tbf);
 	llist_del(&tbf->list);
 
@@ -714,6 +716,7 @@
 			LOGP(DRLCMACDL, LOGL_NOTICE, "Discarding LLC PDU of "
 				"DL TBF=%d, because lifetime limit reached\n",
 				tfi);
+			bts->timedout_frame();
 			frames++;
 			octets += msg->len;
 			msgb_free(msg);