aboutsummaryrefslogtreecommitdiffstats
path: root/include
AgeCommit message (Collapse)AuthorFilesLines
2021-01-26gprs_bssgp_rim: add functions to convert a RIM-RI to a stringPhilipp Maier1-0/+2
RIM routing formation structs can contain different variants of address identifiers, so it is difficult for an API user to pick the _name() function to generate a human readable string. Lets add bssgp_rim_ri_name() and bssgp_rim_ri_name_buf() to make printing a routing identifier easier. Change-Id: Idca6bdccffe663aea71a0183ca3ea5bb5b59e702 Related: SYS#5103
2021-01-26gprs_bssgp_prim.h: Add missing includesPau Espin Pedrol1-0/+2
Includes for struct gprs_ra_id and osmo_eutran_tai were missing. Change-Id: I1c068b6841561003d4d7722daa6c2abb21363dda
2021-01-22gprs_bssgp_rim: add value strings for enum bssgp_rim_routing_info_discrPhilipp Maier1-0/+6
Change-Id: Idd06d2e3df0d60409a89a474018a9d97f7772090 Related: SYS#5103
2021-01-22gprs_bssgp_rim: add value strings for enum bssgp_ran_inf_app_idPhilipp Maier1-0/+6
Change-Id: I581d1176f82d6657d6136c32daa9c76dffb802a6 Related: SYS#5103
2021-01-22gprs_bssgp_rim: add value strings for enum bssgp_nacc_causePhilipp Maier1-0/+6
Change-Id: I3354699555569c2b0bd1b4313cffd32a0cbeffe9 Related: SYS#5103
2021-01-22gsm: Introduce osmo_{rai,cgi_ps}_cmp() APIsPau Espin Pedrol1-0/+2
Similar to what we already have for other data types, such as osmo_lai_cmp or osmo_cgi_cmp. Change-Id: I00e329bc5be8674b30267dec238e7656ddfc21db
2021-01-20vty/fsm_vty: Add vty_out_fsm2() + vty_out_fsm_inst2() with prefixHarald Welte1-0/+2
Callers other than "show fsm" / "show fsm-instances" may want to indent the output. Change-Id: I10e01ef91116369868cdb878a99634c8681728af
2021-01-19gprs_bssgp: add utilities to send and parse BSSGP rim PDUsPhilipp Maier2-0/+39
At the moment libosmogb offers no convinient way to send RIM PDUs. Also parsing an incoming RIM messages into destination, source routing info and RIM container is not available. Change-Id: I18134fd9938040d2facb6beee3732628b167ce8c Related: SYS#5103
2021-01-18bssgp_rim: move bssgp_parse_rim_ri and bssgp_create_rim_ri to gprs_bssgp_rimPhilipp Maier2-31/+30
The function bssgp_parse_rim_ri() and bssgp_create_rim_ri() are located in gprs_bssgp.c, since there is now a gprs_bssgp_rim.c module it makes more sense to put them there. Also adjust the code a bit so that its more intuitive to read. Change-Id: Icd667f41d5735de56cd9fb257670337c679dd258 Related: SYS#5103
2021-01-18bssgp_rim: add encoder/decoder for NACC related RIM containersPhilipp Maier2-0/+183
BSSGP RIM uses a number of nested containers to signal RIM application specific payload information in a generic way. Lets add the container structurs required for NACC. Depends: libosmocore If48f412c32e8e5a3e604a78d12b74787a4786374 Change-Id: Ibbc7fd67658e3040c12abb5706fe9d1f31894352 Related: SYS#5103
2021-01-13ctrl: ports.h: Add OSMO_CTRL_PORT_BSC_NEIGHPau Espin Pedrol1-0/+1
Hence 4248 becomes the well-known port for osmo-bsc's Neighbor Resolution Service. Related: SYS#4909 Change-Id: Ic77a8cff022c2f939a684ebd1f9f62a82e0de510
2021-01-11Intoduce Packet Switch CGIPau Espin Pedrol3-0/+17
This structure is needed in order to identify a given cell within the BSS during RIM transactions. The naming was made up by myself since I couldn't find any naming reference for this kind of data (RAI + CI). Since LAI + CI = CGI, then RAI + CI = CGI-PS osmo_rai_name2 family of functions get a "2" suffix due to already existing functions handling struct struct gprs_ra_id in gsm48.h Change-Id: If48f412c32e8e5a3e604a78d12b74787a4786374
2021-01-06gsm_08_18: add struct to parse RIM PDU IndicationsPhilipp Maier1-0/+22
3GPP TS 48.018, section 11.3.65 describes an IE to transfer some control flags via a RIM container. The IE is essentially just a bitfield, so it can be parsed by overlaying it with a C-struct. Lets add an appropiate struct to protocol/gsm_08_18.h Change-Id: I781ab838bd02ac1b13d384ce3f4259e26cedb61e Related: SYS#5103
2021-01-06ctrl: Allow handling CTRL get/set replies in user defined codePau Espin Pedrol1-0/+7
Prior to this patch, it was not possible to gather SET/GET reply information when implementing a CTRL client using libosmocontrol. This is specially important when using the GET command, since one wants to receive the queried value. CTRL traps can also be handled this way by extending this patch in the future if needed. Change-Id: Id3c4631cd32c13e78e11b6e8194b8c16307ec4f1
2021-01-06Add inter-thread queueHarald Welte2-0/+63
This adds an inter-thread queue "it_q" to libosmocore. With it_q, one can perform thread-safe enqueing of messages to another thread, who will receive the related messages triggered via an eventfd handled in the usual libosmocore select loop abstraction. Change-Id: Ie7d0c5fec715a2a577fae014b0b8a0e9c38418ef
2021-01-04gprs_bssgp: add handling for BSSGP RIM primitivesPhilipp Maier2-0/+4
Receive and forward RIM messages to bssgp_prim_cb() Change-Id: Idfd0a65872a2cc6089885afd8d31b0b029d85d47 Related: SYS#5103
2021-01-04gsmtap_util: SNR can be negative, use a signed integerVadim Yanitskiy1-4/+4
In 'struct gsmtap_hdr' field 'snr_db' is defined as a signed integer, however all functions that fill this structure accept an unsigned integer. This is wrong, because SNR can be negative. Let's use 'int8_t' instead of 'uint8_t'. Changing from unsigned to signed should be relatively safe compared to the opposite. Most of the callers I am aware of always do pass 0 anyway. Change-Id: I9f432be5c346d563bf518111c14ff04d4a63f592 Related: SYS#5073
2021-01-03gsm_08_58: add flexible array member to 'struct ipac_preproc_ave_cfg'Vadim Yanitskiy1-0/+2
Some averaging methods may have additional parameters, so let's make it easier to access them for the API user. Change-Id: I2f4ed56837dd479dbbd10c0a7df0ed7565d3946a Related: SYS#4918
2020-12-28Declare osmo_ctx_init() in talloc.hDaniel Willmann1-0/+2
This function is called automatically on the main thread, but needs to ba called explicitly in order to run the select loop on another thread. Make it available for applications through talloc.h Change-Id: Ie710ca9ad01d3fadb9f4ff344a55d6c01004727b
2020-12-22gprs_ns2: add new vty2Alexander Couzens2-0/+6
Change-Id: I163279cf57e84198dc8c53e1c109f5a9474670e9
2020-12-21fsm: Add osmo_fsm_inst_broadcast_children()Harald Welte1-0/+11
This is a helper function to broadcast an event to all of the siblings of a specified FSM instance. Change-Id: I2ce398741a8672d7b7c4058d056f46e2fe7353c1
2020-12-19gsm_08_58: fix wrong field order in 'struct ipac_preproc_pc_thresh'Vadim Yanitskiy1-2/+2
Thanks to the CLI of nanoBTS, I noticed that upper and lower RxQual thresholds are sent in wrong order. Only the little-endian variant needs to be fixed, the big-endian one looks good. Change-Id: If6ab2377bae6742f871589b529a349498775552f Related: SYS#4918
2020-12-17GPRS Cell Options (SI13): Add REL-4 CCN_ACTIVE bitPau Espin Pedrol1-1/+2
This is required in order to tell MS that osmo-pcu now supports Network Assisted Cell Change (NACC). Related: SYS#4909 Change-Id: I2aaa8c1107c977f711c2d7530034f57e36e3a237
2020-12-16gprs_bssgp: add IE parser/generator for RIM Routing InformationPhilipp Maier3-0/+44
The RIM Routing Information IE (see also 3GPP TS 48.018, section 11.3.70) is used to control the flow of BSSGP rim messages at the SGSN. Change-Id: I6f88a9aeeb50a612d32e9efd23040c9740bc4f11 Related: SYS#5103
2020-12-15gprs_ns2: add gprs_ns2_fr_bind_role() to retrieve the fr roleAlexander Couzens1-0/+1
Change-Id: I277b805e588ba68536789b4a64a428ea0b31728a
2020-12-15gprs_ns2: make nsvc argument constAlexander Couzens1-1/+1
The nsvc isn't change. It can be const Change-Id: Ie5052f02781d7fdc639456c6f02515a927cee1f3
2020-12-15gprs_ns2_sns: rework IP-SNS initial remoteAlexander Couzens1-3/+6
The IP-SNS requires at least one initial remote address of the SGSN. However it should be multiple initial remote address instead of a single in case the interface might fail. Rework the SNS to support multiple initial remote addresses. Change-Id: I71cdbfb53e361e6112fed5e2712236d797ef3ab2
2020-12-15gprs_ns2: add gprs_ns2_free_nsvcs() to free all NS-VC of a NSEAlexander Couzens1-0/+1
Change-Id: I909443b540dbf75146297f1d7f94940690be6c0d
2020-12-15gprs_ns2: rework gprs_ns2_fr_connect*()Alexander Couzens1-0/+4
Add gprs_ns2_fr_connect2() and change gprs_ns2_fr_connect() to be similar to gprs_ns2_ip_connect() and gprs_ns2_connect2(). This is an API break but there wasn't yet a release with NS2. Change-Id: I4e1374b0e979b3293302c5ed46a91a58f3a5a916
2020-12-15gprs_ns2: add member name to bindAlexander Couzens1-0/+7
Every bind will have a unique name. Add a name argument to all bind creating functions and require them to be unique. This is an API break but there wasn't yet a release with NS2. Change-Id: I8f1d66b7b3b12da12db8b5e6bd08c1beff085b3e
2020-12-15gprs_ns2: introduce NS dialectsAlexander Couzens1-5/+12
A NS dialect describes how the NS Entity interacts with different virtual circuits. E.g. ipaccess use reset/block on udp and is a dynamic connection. A single NS Entity can only support one dialect. This can be later used to protect a NS Entity against dynamic NS virtual circuits of a different type. It further allows a bind to support multiple dialects at the same time. Change-Id: Ia118bb6f994845d84db09de7a94856f5ca573404
2020-12-15protocol/gsm_08_58.h: add Osmocom specific EWMA AVG algoVadim Yanitskiy1-1/+3
Change-Id: Ib436fd8b81afdb06c6d936f6839f847a705d00e2 Related: SYS#4918
2020-12-15protocol/gsm_08_58.h: add ip.access Power Control structuresVadim Yanitskiy1-0/+44
Change-Id: I9430bcb79c269efb4f9527f565cf4e12e4444940 Related: SYS#4918
2020-12-09bssgp_bvc_fsm: Add basic BVC flow control rx/tx supportHarald Welte1-0/+5
The FSM doesn't actually implement the flow control logic, it only decodes / dispatches and encodes messages. Related: OS#4891 Change-Id: Ie59be6761177c43456898be9148727f15861a622
2020-12-09bssgp2: Encoding + Decoding functions for BVC and MS flow controlHarald Welte2-0/+47
Change-Id: I9c89bb1c03550930c07aad7ff8f67129ee7a6320 Related: OS#4891
2020-12-09gb: Add beginnings of a new BSSGP implementationHarald Welte3-0/+94
Similar to ns2 superseding ns, we now also intoduce a next generation of BSSGP related code to libosmogb. However, this is not aiming to be a full implementation yet, but simply those parts that we currently need from the revamped osmo-gbproxy. The gprs_bssgp2.[ch] differs in two ways from the old code: * it separates message encoding from message transmission * it supports more recent specs / IEs bssgp_bvc_fsm.c is a genric implementation of the BSSGP BVC RESET/BLOCK/UNBLOCK logic with support for both PTP and signaling, both on the SGSN side and the BSS side. Change-Id: Icbe8e4f03b68fd73b8eae95f6f6cccd4fa9af95a
2020-12-09logging: Introduce DLBSSGP logging constantHarald Welte2-2/+3
Historically, BSSGP uses a non-constant, user-configurable integer varieable for the logging sub-system. Let's replace this with a statically-allocated library logging constant. This is required if we want to use the subsystem number in e.g. static initialized for osmo_fsm.log_subsys. Change-Id: I506190aae9217c0956e4b5764d1a0c0772268e93
2020-12-08tlv.h: Add msgb_tvlv_put_{16,32}be()Harald Welte1-0/+15
Those routines are very useful when puzzling together BSSGP messages with 16-bit and 32bit sized IEs. Change-Id: I033f9a708c9d7ffad91336178231dc66233e1693
2020-12-08gsm_08_18.h: Add #defines for [extended] feature bitsHarald Welte1-0/+20
Change-Id: I7743cb901988c8fddd91127cfdca6e54b3d44ea8
2020-12-08bssgp: Add osmo_tlv_prot_def for BSSGPHarald Welte1-1/+14
Change-Id: I7e4226463f3c935134b5c2c737696fbfd1dd5815
2020-12-08tlv: Introduce enum with error codes for TLV parser functionsHarald Welte1-0/+10
Change-Id: I0b352792089c5c0c714712d2ea237beb92e1d73f
2020-12-08Introduce 'osmo_tlv_prot' abstraction for validation of TLV protocolsHarald Welte1-0/+50
This extends our existing TLV parser with the ability to * validate that mandatory IEs of a given message are present * validate that all present IEs are of required minimum length Introducing this generic layer will help us to reduce open-coded imperative verification across virtually all the protocols we implement, as well as add validation to those protocols where we don't properly perform related input validation yet. Change-Id: If1e1d9adfa141ca86001dbd62a6a339f9bf9a912
2020-12-07Include mnl.h iif --enable-libmnlPau Espin Pedrol1-1/+4
Change-Id: I06016e3a6e90b09b76634a00081d0d40a8e2f94b
2020-12-06log2.h: Avoid redefining __always_inlineHarald Welte1-3/+2
/build/deps/install/stow/libosmocore/include/osmocom/core/log2.h:10:0: error: "__always_inline" redefined [-Werror] #define __always_inline inline __attribute__((always_inline)) /usr/include/x86_64-linux-gnu/sys/cdefs.h:311:0: note: this is the location of the previous definition # define __always_inline __inline __attribute__ ((__always_inline__)) Change-Id: I738d2a72f835a29e30b8ba20456e5c4c9aa844c9
2020-12-06log2.h: Use uintXX_t instead of kernel specific typesHarald Welte1-2/+3
Change-Id: Ieb872551bdbe514f2c77f9aeb2b9ee42f6573909
2020-12-06hash/log2: Add generic implementations of fls() and fls64()Harald Welte1-0/+59
When importing the hashtable code in I8ef73a62fe9846ce45058eb21cf999dd3eed5741 I didn't import actual implementations of the fls() and fls64() implementations, as at least gcc-10 was smart enough to detect we only use it on constant types and hence the computation can happen at build time via const_ilog2() However, in our jenkins build verification' this doesn't appear to happen, as we get below errors: /build/deps/install/stow/libosmocore/include/osmocom/core/log2.h: In function ‘__ilog2_u32’: /build/deps/install/stow/libosmocore/include/osmocom/core/log2.h:20:9: error: implicit declaration of function ‘fls’ [-Werror=implicit-function-declaration] return fls(n) - 1; ^~~ /build/deps/install/stow/libosmocore/include/osmocom/core/log2.h: In function ‘__ilog2_u64’: /build/deps/install/stow/libosmocore/include/osmocom/core/log2.h:28:9: error: implicit declaration of function ‘fls64’ [-Werror=implicit-function-declaration] return fls64(n) - 1; ^~~~~ Let's provide some generic implementations for this case. If needed one could also introduce architecture-specific assembly implementations like in the Linux kernel, but so far we managed to keep libosmocore free of any assembly tweaks. Change-Id: Ifa4898eb66c8d949618edd47961b7a0330ed35b5
2020-12-06gsm_08_18.h: Add some PDU definitions still missingHarald Welte1-0/+19
In I7da8b25c9a89a7e3ae6c1680ba838e136d7d5293 I seem to have failed to realize that 3GPP TS 48.018 v15.0.0.0 Table 11.3.26 continues on yet another page. Let's add those missing PDU types definitions. Change-Id: I9173c35240ff78048b2b76a1155d90467ef16b2d
2020-12-05Use explicit type-casting in hlist_del() for C++ compatibilityHarald Welte1-2/+2
/usr/local/include/osmocom/core/linuxlist.h:479:12: error: invalid conversion from ‘void*’ to ‘hlist_node*’ [-fpermissive] 479 | n->next = LLIST_POISON1; Fixes: I8ef73a62fe9846ce45058eb21cf999dd3eed5741 Change-Id: I75b0a5fe097562007c53987d8d41811e9f35798d
2020-12-05core/linuxlist: do not use 'new' as a parameter nameVadim Yanitskiy1-4/+4
'new' is a reserved keyword in C++, so including this header from a C++ project (like osmo-pcu) breaks compilation. Let's rename it in the same way as it's already done in this file: add '_'. Change-Id: I7f7d9143edca75ce932601386a8766b0a62c0e24 Fixes: I8ef73a62fe9846ce45058eb21cf999dd3eed5741
2020-12-05Add hlist and hashtable from Linux kernelHarald Welte5-0/+617
For more than a decade we've used the linuxlist.h for double-linked lists. Let's also add the hlist (double-linked lists with single pointer sized head, and the hashtable that builds on top of it. This reflects the versions included in Linux 5.8 with some modifications to make them build in userspace (remove RCU versions, adjust for userspace include files and types, convert to doxygen). Change-Id: I8ef73a62fe9846ce45058eb21cf999dd3eed5741