aboutsummaryrefslogtreecommitdiffstats
path: root/src/llc.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/llc.cpp')
-rw-r--r--src/llc.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/llc.cpp b/src/llc.cpp
index b160961..9c5581f 100644
--- a/src/llc.cpp
+++ b/src/llc.cpp
@@ -160,3 +160,18 @@ bool gprs_llc::is_frame_expired(struct timeval *tv_now, struct timeval *tv)
return timercmp(tv_now, tv, >);
}
+
+bool gprs_llc::is_user_data_frame(uint8_t *data, size_t len)
+{
+ if (len < 2)
+ return false;
+
+ if ((data[0] & 0x0f) == 1 /* GPRS_SAPI_GMM */)
+ return false;
+
+ if ((data[0] & 0x0e) != 0xc0 /* LLC UI */)
+ /* It is not an LLC UI frame */
+ return false;
+
+ return true;
+}