diff options
author | Neels Hofmeyr <neels@hofmeyr.de> | 2017-07-04 23:08:44 +0200 |
---|---|---|
committer | Neels Hofmeyr <neels@hofmeyr.de> | 2017-08-27 03:52:43 +0200 |
commit | 218e4b4aa0fc6de842ff820dec8e97d1f083268a (patch) | |
tree | 268a6e509270b1c80a36dd1a526da41a9b01a8e0 /openbsc/contrib/gprs/gprs-verify-nu.lua | |
parent | 5ea6bfce56d6ae7be6d85e05b5e4eaebc94d1005 (diff) |
move openbsc/* to repos root
This is the first step in creating this repository from the legacy openbsc.git.
Like all other Osmocom repositories, keep the autoconf and automake files in
the repository root. openbsc.git has been the sole exception, which ends now.
Change-Id: I9c6f2a448d9cb1cc088cf1cf6918b69d7e69b4e7
Diffstat (limited to 'openbsc/contrib/gprs/gprs-verify-nu.lua')
-rw-r--r-- | openbsc/contrib/gprs/gprs-verify-nu.lua | 59 |
1 files changed, 0 insertions, 59 deletions
diff --git a/openbsc/contrib/gprs/gprs-verify-nu.lua b/openbsc/contrib/gprs/gprs-verify-nu.lua deleted file mode 100644 index e44fdd16f..000000000 --- a/openbsc/contrib/gprs/gprs-verify-nu.lua +++ /dev/null @@ -1,59 +0,0 @@ --- This script verifies that the N(U) is increasing... --- -do - local nu_state_src = {} - - local function init_listener() - -- handle the port as NS over IP - local udp_port_table = DissectorTable.get("udp.port") - local gprs_ns_dis = Dissector.get("gprs_ns") - udp_port_table:add(23000,gprs_ns_dis) - - -- we want to look here... - local llc_sapi_get = Field.new("llcgprs.sapib") - local llc_nu_get = Field.new("llcgprs.nu") - local bssgp_tlli_get = Field.new("bssgp.tlli") - - local tap = Listener.new("ip", "udp.port == 23000") - function tap.packet(pinfo,tvb,ip) - local llc_sapi = llc_sapi_get() - local llc_nu = llc_nu_get() - local bssgp_tlli = bssgp_tlli_get() - - if not llc_sapi or not llc_nu or not bssgp_tlli then - return - end - - local ip_src = tostring(ip.ip_src) - local bssgp_tlli = tostring(bssgp_tlli) - local llc_nu = tostring(llc_nu) - local llc_sapi = tostring(llc_sapi) - - local src_key = ip_src .. "-" .. bssgp_tlli .. "-" .. llc_sapi - local last_nu = nu_state_src[src_key] - if not last_nu then - -- print("Establishing mapping for " .. src_key) - nu_state_src[src_key] = llc_nu - return - end - - local function tohex(number) - return string.format("0x%x", tonumber(number)) - end - - nu_state_src[src_key] = llc_nu - if tonumber(last_nu) + 1 ~= tonumber(llc_nu) then - print("JUMP in N(U) on TLLI " .. tohex(bssgp_tlli) .. " and SAPI: " .. llc_sapi .. " src: " .. ip_src) - print("\t last: " .. last_nu .. " now: " .. llc_nu) - end - end - - function tap.draw() - end - - function tap.reset() - end - end - init_listener() -end - |