Commit Graph

9 Commits

Author SHA1 Message Date
Alexander Couzens 8dfc24cb47 gprs_ns2: drop prefix of all internal exposed function
All functions which are exposed by gprs_ns2_internal.h should not contain
the public prefix gprs_. Internal function should only contain ns2_ prefix.

Change-Id: Icecc5a918902cd10efac72bbac20780d39aab272
2021-01-25 16:09:23 +01:00
Harald Welte f294974e05 ns2: Unify logging context via log macros
Let's avoid open-coding the printing of log context and rather rely on
log macros to prefix each log line with the relevant context.  This
helps log readability, log post processing whether by grep or more
sophisticated tools.

Change-Id: I946c0e77686d91efc5afb62031e1ac1033a9a586
2021-01-20 16:42:33 +00:00
Alexander Couzens 718e37e5cc gprs_ns2_message: remove wrong comment
It's a leftover from converting NS1 -> NS2 code

Change-Id: I934c7905f8396e74bb1f14d68097c03463816720
2021-01-20 16:42:33 +00:00
Daniel Willmann 89a00f352d ns2: Fix memory leak in IP-SNS
Don't allocate msg twice - it's not nice.

Change-Id: I3fa0076eb480a7bcadb74cc86760dc29b77ac600
Related: OS#4874
2021-01-17 14:20:28 +01:00
Harald Welte 798efea27e gprs_ns2: Use TLVP_PRES_LEN instead of TLVP_PRESENT
With TLVP_PRESENT we only check if a given TLV/IE is present,
but don't verify that it's length matches our expectation.  This can
lead to out-of-bounds reads, so let's always use TLVP_PRES_LEN.

Change-Id: I4c438bc82ea6a48243db568f96a234adf784dc0b
2020-12-04 18:20:15 +00:00
Daniel Willmann 751977be6f ns2: Add log filtering by NSE/NSEI, fix NSVC filter on receive
NSVC filtering was only implemented on sending messages, this also adds
log_set_context() calls to  ns2_recv_vc()
Filtering by NSE is implemented similar to NSVC.

Change-Id: I63c0e85f82f5d08c5a6f535da94b8648498439d2
Related: SYS#5232
2020-12-03 15:14:18 +01:00
Harald Welte b40cfdc54b gprs_ns2: Mark gprs_ns2_validate_* as static
They are all called indirectly via gprs_ns2_validate(), so mark them
as static.

Change-Id: I8425ed3da32019b86cf12d3c27132f07d931cf27
2020-09-18 23:14:36 +02:00
Harald Welte 5bef2cc4bd ns2: Improve/extend doxygen comments for new ns2 implementation
I was reading through the code and noticed many functions not
documented yet, or with incomplete documentation. Change that.

Change-Id: I85a2419604a9fd9ff3c4828a7463e222652f77bf
2020-09-18 23:14:36 +02:00
Alexander Couzens 6a161497cf Gb: add a second NS implementation
Reimplement NS with FSM.

Change-Id: I3525beef205588dfab9d3880a34115f1a2676e48
2020-09-15 11:54:41 +00:00