aboutsummaryrefslogtreecommitdiffstats
path: root/TODO-RELEASE
AgeCommit message (Collapse)AuthorFilesLines
2024-03-28sockaddr_str: add conversion to,from osmo_sockaddrNeels Hofmeyr1-0/+1
Add functions to pass struct osmo_sockaddr to the osmo_sockaddr_str_{to,from}* API directly. So far the interface to osmo_sockaddr_str_ is: osmo_sockaddr_str_from_sockaddr(&my_sa_str, &my_osa->u.sas); I'm working a lot with osmo_sockaddr at the moment, and the cumulated time of forgetting to add 'u.sas' and having another compilation cycle because of those is justifying this additional API. Change-Id: I0df84b4bb8cb5d8434b735fa3a38e7f95be43e91
2024-02-27gsup.h: define newly added PCO IEAlexander Couzens1-0/+1
PCO - Protocol Configuration Options 3GPP TS 24.008 / 10.5.6.3. The PCO will be used by the osmo-epdg to pass PCO internally. The PCO will be passed towards to the PGW in the Session Request. Related: OS#6369 Related: osmo-gsm-manuals.git Change-Id Id912ead4e1205f84a40af6505a5ddf050d1e086d Change-Id: I0f9de90c7c67fe194b441a9d118eba70f09afb5e
2024-02-23osmo_io: Change struct osmo_io_ops to contain struct, not unionHarald Welte1-0/+2
As we introduce more modes, and each mode aliases call-back function pointers to those of another mode, we have more and more error cases where we (for exampele) access read_cb, but in reality the user has populated recvfrom_cb. Let's use a struct, meaning that call-backs of one mode no longer alias to the same memory locations of call-backs fro another mode. This allows us to properly check if the user actually provided the right callbacks for the given mode of the iofd. This breaks ABI, but luckily not API. So a simple recompile of higher-layer library + application code will work. Change-Id: I9d302df8d00369e7b30437a52deb205f75882be3
2024-01-20gsup: Convert PDP-Type IE to PDP-Address IEPau Espin Pedrol1-0/+1
The previous PDP-Type IE should have been a PDP-Address from the start, since having only PDP-Type with no address is only a specific case (dynamic addressing). This becomes clear by looking at other similar protocols like: * MAP: APN-Configuration IE has servedPartyIP-IP{v4,v6}-Address IEs * Diameter S6b, 3GPP TS 29.272 7.3.35 APN-Configuration contains Served-Party-IP-Address AVPs * Diameter SWx, 3GPP TS 29.273 APN-Configuration. * GTPv1C Ts 29.060 7.7.29 PDP Context containing PDP Address. Since PDP-Type on its own really makes no sense, being it a special case of PDP-Address, let's keep the IE by renaming it (keeping old name too for API backward compat) and extend it to support lengths > 2 bytes. Old implementation of libosmogsm gsup actually ignored lengths > 2 bytes, so we are safe acting against older implementations here, both on the sending and receiving side on the wire. The big drawback of this commit is that it breaks ABI compatibility due to adding "struct osmo_sockaddr pdp_address[2];" to struct osmo_gsup_pdp_info, which in turn affects shift of fields in struct osmo_gsup_message. Unfortunately, there's not much that can be done to improve the situation when adding the missing field, due to existing API having the same struct for all messages. Ideally we'd have 1 union with structs per message type inside, this way the ABI break would be far less pronounced. The GSUP test output change is becaue we now accept some of the len>2 cases for PDP-Type/Address IE which were being rejected since a couple commits ago. libosmogsm gsup code is now disabled in EMBEDDED mode, since it nows depends on core/socket.h (struct osmo_sockaddr) which is not available in EMBEDDED, and hence fails during build: """ In file included from /build/include/osmocom/gsm/gsup.h:45, from /build/src/gsm/gsup_sms.c:28: /build/include/osmocom/core/socket.h:15:10: fatal error: arpa/inet.h: No such file or directory 15 | #include <arpa/inet.h> | ^~~~~~~~~~~~~ """ Related: OS#6091 Change-Id: I775ff9c3be165d9f30d6ab55d03f99b6104eadd6
2024-01-20gsup: Deprecate field pdp_type in favour of pdp_type_nr and pdp_type_orgPau Espin Pedrol1-0/+1
Having both fields in an uin16_t integer makes it difficult and confusing for users for no good reason. Let's have separate fields for each of them. The new fields are defined so that they are ABI compatible with previous uin16 field. Change-Id: Ie31c6080c90e468c01186259f2c42621e39b5cc6
2024-01-09isdn: initial implementation of the V.110 TAVadim Yanitskiy1-0/+1
ITU-T recommendation V.110 defines Terminal Adaptor (TA) functions for the connection of Terminal Equipment (TE) having standard V-series interfaces to the ISDN. This patch brings "software" implementation of the TA to libosmoisdn. The primary user for this soft-TA is the mobile-side implementation of CSD (Circuit Switched Data) in osmocom-bb. CSD is heavily based on V.110, which is not surprising given that GSM is a "wireless ISDN". Nevertheless, this code will likely also be useful in the context of retro-networking. Similarly to the existing V.110 code in libosmoisdn, the present implementation aims to be functional and correct, rather than efficient in any way. It also has several limitations, which are not critical for the CSD use case, but eventually may be a problem for other use cases in the context of retro-networking. Therefore, the V.110 TA API should be considered _unstable_, and may be subject to change in the future. +-------+ +------+ B-channel +------+ +-------+ | TE1 |------| TA |~~~~~~~~~~~~~~~| TA |------| TE2 | +-------+ +------+ +------+ +-------+ TE (also known as DTE) is basically a computer, having a V-series (usually RS-232) connection to TA (also known as DCE). The TA acts like a regular analog modem, except that it is not performing any kind of modulation or demodulation itself. The TE-TA interface is implemented by the user supplied callback functions, configured during the allocation of a TA instance: * .rx_cb() - receive call-back of the application, * .tx_cb() - transmit call-back of the application, * .status_update_cb() - status line update call-back. In addition to that, the application (TE) can interact with the V.24 status lines (circuits) using the following API: * osmo_v110_ta_{get,set}_status(), * osmo_v110_ta_{get,set}_circuit(). The Rx and Tx between TE and TA is always driven by the TA itself, as a result of an interaction with the lower layer implementing the B-channel interface. There is currently no buffering and thus no way for TE to initiate transmission or pull data on its own. The TA-TA (B-channel) interface is implemented by the following functions, which are meant to be called by the lower layer transmitting and receiving V.110 frames over certain medium: * osmo_v110_ta_frame_in() - indicate a received V.110 frame, * osmo_v110_ta_frame_out() - pull a V.110 frame for transmission, * osmo_v110_ta_[de]sync_ind() - indicate a synchronization event. The lower layer is responsible for finding the synchronization pattern (if needed), aligning to the frame boundaries, and doing the V.110 frame coding. The D-channel signalling is behind the scope of this module. Initial (Work-in-Progress) implementation by Harald Welte, completed and co-authored by Vadim Yanitskiy. Change-Id: I5716bd6fd0201ee7a7a29e72f775972cd374082f Related: OS#4396
2024-01-09core: osmo_tdef_fsm_inst_state_chg(): allow millisecond precisionVadim Yanitskiy1-0/+1
This API predates commit 7b74551b9, which added support for millisecond granularity to osmo_fsm. Let's do the same for the tdef FSM wrapper API, allowing the millisecond precision without rounding-up to seconds. Of course, this patch changes behavior of the existing API, but having more precise state timeouts is not going to make the API user experience worse. The old behavior of using seconds is for kept for: * OSMO_TDEF_CUSTOM -- still treated as if it was OSMO_TDEF_S. * \param[in] default_timeout -- still expected to be in seconds. Change-Id: I4c4ee89e7e32e86f74cd215f5cbfa44ace5426c1 Related: 7b74551b9 "fsm: Allow millisecond granularity in osmo_fsm built-in timer"
2023-12-11socket: Introduce API osmo_sock_sctp_get_peer_addr_info()pespin/multiaddrPau Espin Pedrol1-0/+1
This is a convenience helper to reetrieve the whole set of remote addresses and call getsockopt() on them, making it easy for users to analyse the full set of remote addresses of a socket simply providing an fd. Related: SYS#6636 Change-Id: I3e1c84526b006baff435bbbca49dc6cf7d201cf5
2023-12-07socket: Introduce API osmo_sock_multiaddr_get_name_buf()Pau Espin Pedrol1-1/+1
An extra osmo_multiaddr_ip_and_port_snprintf() API is introduced which is used by osmo_sock_multiaddr_get_name_buf() but which will also be used by other app uers willing to use osmo_sock_multiaddr_get_ip_and_port() according to its needs (eg. only printing the local side). Related: SYS#6636 Change-Id: I48950754ed6f61ee5ffa04a447fab8903f10acc0
2023-12-07socket: Introduce API osmo_sock_multiaddr_get_ip_and_port()Pau Espin Pedrol1-0/+1
This API will be used internally by osmo_sock_multiaddr_get_name_buf() in a follow-up patch. This API can also be used directly by user who wish to obtain a list of local/remote IP addresses and port from an SCTP socket. Related: SYS#6636 Related: OS#5581 Change-Id: I19d560ab4aadec18a4c0f94115675ec1d7ab14d7
2023-11-27LAPDm: Add an extra queue for UI framesAndreas Eversberg1-0/+1
The extra queue is used to transmit the UI frame only when there is no frame in the regular TX queue. This allows to give LAPD frames prioity over UI frame. Related: OS#4074 Change-Id: I00c8ee73be8b7c564a4dee3fca3e893484f567da
2023-11-27LAPDm: Add support for RTS based pollingAndreas Eversberg1-0/+1
The lower layer must set the 'POLLING_ONLY' flag and provide frame number when polling a frame. If T200 is pending, it is started with a timeout frame number in advance to given frame number. The lower layer must call lapdm_t200_fn() after a frame has been received or if a frame has not been received. Also it must be called after a TCH frame has been received. LAPDm uses this to check the T200 timeout condition. A new function is used to set the frame number based timeout values. Related: OS#4074 Change-Id: I6ebe83f829d7751ea9de1d90eb478c7a628db64c
2023-11-27LAPD: Add support for RTS based polling and T200Andreas Eversberg1-0/+1
The T200 timer is started when the current frame is polled at PH-READY-TO-SEND event. A flag is used to enable this feature. The user of LAPD core must track frame numbers to check the timeout condition. Then it must call the external timeout function. Related: OS#4074 Change-Id: Ib961b5a44911b99b0487641533301749c0286995
2023-10-13gsmtap: Hide implementation of gsmtap_instarehbein1-1/+2
- Use forward decl. of struct gsmtap_inst in header - Remove 'static inline' attributes from gsmtap_inst_fd() declaration, move function definition to gsmtap_util.c and mark it as deprecated - Add gsmtap_inst_fd2() as replacement for gsmtap_inst_fd() Related: OS#6213 Change-Id: Ibe1a51205a6df764571b6d074e365825555609a5
2023-10-03socket: Introduce APIs osmo_sock_multiaddr_{add,del}_local_addr()Pau Espin Pedrol1-0/+1
These APIs are used to bind or unbind an active socket adding or removing addresses from the existing set. Related: OS#6077 Change-Id: Ifc6e7d643c2a0c53f479bfd0d5c36d08c0c01953
2023-09-12Bump version: 1.8.0.252-13c29 → 1.9.01.9.0Pau Espin Pedrol1-12/+0
Change-Id: I6f8eccbccb73c6c094f13f2d4bdee931cf5b9010
2023-09-08socket: Remove OSMO_SOCK_F_SCTP_ASCONF_SUPPORTED, add ↵Pau Espin Pedrol1-1/+2
osmo_sock_init2_multiaddr2() The OSMO_SOCK_F_SCTP_ASCONF_SUPPORTED flag was added recently to enable use of ASCONF in osmo_sock_inti2_multiaddr. Since we didn't release yet, we are still in time to get rid of this flag. It turns out that we'll want to add more features which must be set before SCTP INIT (connect()) time, like setsockopt SCTP_INITMSG, which in turn contains a struct with several parameters. Hence, adding flags for all those makes no sense. Instead, add a new API which allows passing an extensible struct which allows much more fine-grained setup from the caller. The new struct "pars" parameter is non-const on purpose, in order to be able to extend the struct in the future if we wish to get/obtain some data from the socket. Related: SYS#6501 Related: SYS#6558 Change-Id: I1f6fd09a79b0a2bd794e5669d933be25bbf1eeaa
2023-08-11tlv: Introduce API msgb_tv32_push()Pau Espin Pedrol1-0/+1
msgb_tv32_put() already exists, but msgb_tv32_push doesn't. The tv16 counterparts are already present, and having to pass 32bit integers is also quite common, so let's add an API for it. Change-Id: I68d5693a18d55ce8d0647359044157d7e5bfae50
2023-06-02libosmogsm: Add support for TUAK authentication algorithmHarald Welte1-0/+1
The TUAK algorithm is specified in 3GPP TS 35.231, 232 and 233 and intended as an alternative to MILENAGE. It's based around the cryptographic function of KeccakP1600, which is part of SHA-3. This patch adds support for TUAK to the libosmogsm authentication core API via 'struct osmo_auth_impl'. Unit tests covering the test cases from the 3GPP specification are added (and are all passing). Change-Id: Ib905b8d8bdf248e8299bf50666ee1bca8298433d
2023-06-02libosmogsm: Factor out the C2 derivation functionHarald Welte1-0/+1
3GPP specifies the C2 derivation function (generating GSM SRES from UMTS XRES) independent of the MILENAGE algorithm. So instead of open-coding it in milenage.c:gsm_milenage(), let's create a separate public function osmo_auth_c2() similar to the already-existing osmo_auth_c3() function. gsm_milenage() can then simply use that function. Change-Id: I0e7cd55f5578f891cb6cc1b0442920ba5beddae4
2023-06-02libosmogsm: Support authentication with 256-bit K and/or OP/OPcHarald Welte1-0/+2
3GPP TS 33.102 Section 6.3.7 states that K can be 128 or 256 bits, while our 'struct osmo_sub_auth_data' had a fixed-size 128bit field. This means we cannot use our auth_core for algorithms with larger key sizes, such as TUAK. Let's introduce osmo_sub_auth_data2 for larger (and variable) sized K and OP[c]. K and OP[c] can even have different sizes in TUAK, where OP[c] is always 256bit, but K can be 128 or 256 bits. So we need separate length fields for K and OP[c]. I'm adding backwards-compatibility API wrappers, so old applications just continue to work as they always did. However, I'm not adding compatibility wrappers for the plug-in API that can be used to register additional authentication implementations at runtime. We don't know of any user of that API outside of libosmocore, so the function signatures of the 'struct osmo_auth_impl' are modified in an incompatible way. Change-Id: Ie775fedba4a3fa12314c0f7c8a369662ef6a40df
2023-05-23gsm0503_tch_hr_decode2(): new function, emits TS101318 formatMychaela N. Falconia1-0/+2
The original design of gsm0503_tch_hr_{en,de}code() functions contains a mistake in that a pseudo-RFC5993 format was chosen for HR codec frame input and output, instead of "pure" (agnostic to outer RTP encoding) form of 14 bytes. We would like to change this design so that we can feed pure 14-byte HR codec frames to the channel coding function and get such frames back from the channel decoding function - however, we cannot break libosmocoding API for existing users. In the decoding direction, create a new function that emits TS 101 318 format, and turn the legacy gsm0503_tch_hr_decode() API into a wrapper function for backward compatibility. Related: OS#5688 Change-Id: If28ddb20789e8993b7558ca08020478615b4c708
2023-05-10Add osmo_io with initial poll backendHarald Welte1-0/+1
* make backend configurable for later * segmentation callback for chunked streams * logging target for osmo_io * support partial writes Change-Id: I50d73cf550d6ce8154bf827bf47408131cf5b0a0 Related: SYS#5094, OS#5751
2023-05-06vty: move struct vty_parent_node to private APINeels Hofmeyr1-1/+2
Change-Id: Id2070f03b09feea966c5342361d409551e557d38
2023-03-22Fix parsing of TLV_TYPE_SINGLE_TVPau Espin Pedrol1-1/+2
The decoding path of TLV_TYPE_SINGLE_TV is wrong, since it is not shifting right the tag before using it. On the other hand, the encoding path (tlv_encode_one) is doing that, so it is clear there's a bug. It seems that in order to workaround the bug some IEs in gsm_04_08.h (TS 24.008 and TS 44.018) were defined incorrectly (eg 0x80) while the spec clearly assigns eg. "8" to it, and makes sure no full byte IEI collides. Some other IEIs like GSM48_IE_GMM_CIPH_CKSN which are also of the same type were already correctly defined as 0x08. Change-Id: I799e35dc8d4d153fa63bf50563a5482cdf4de2d7
2023-02-20Move libosmogsm TS 44.060 declarations under include/osmocom/gsm/Pau Espin Pedrol1-0/+1
Currently there's a big mess where include dir osmocom/gprs/ is used by both libosmogsm and libosmogb. Most of the header files under osmocom/gprs/ are actually all the headers of libosmogb (there's no osmocom/gb/ dir). But a couple files are actually RLC/MAC (TS 44.060) related are are also stored in there. Those files have no relation/use in Gb, and are actually interused with GSM (eg System Information 13 Rest Octets). Hence, it makes sense to have the RLC/MAC related parts inside osmocom/gsm/ as they should be in libosmogsm (and they actually are, see gprs_rlc.h function implemented in src/gsm/gsm48_rest_octets.c). The fact that some libosmogsm headers were placed in osmocom/gprs instead of osmocom/gsm already created some issues, like libosmocore.spec.in putting "%_includedir/%name/osmocom/gprs/" under libosmogb, which is wrong. As a first step to fix the mess, we move the 2 RLC/MAC headers currently under osmocom/gprs/{gprs_rlc,protocol/gsm_04_60}.h under a single header gsm/protocol/gsm_44_060.h The two old headers are left existing for backward compatibility and now simply include the new libosmogsm header, plus a warning asking users to switch to the new header so we can eventually get rid of them. This means libosmogb depends on libosmogsm, which is fine and was already the case beforehand (libosmogb using functions like gsm48_encode_ra() and linking against it in src/gb/Makefile.am). Change-Id: I70cc21bf25a7081070738abacb409ed19094c3b2
2023-02-07Bump version: 1.7.0.119-b31a-dirty → 1.8.01.8.0osmith/1.8.1Pau Espin Pedrol1-5/+0
Change-Id: I5e953cedc041371a9c192f58348b673a787f542e
2023-01-25Introduce tundev APIPau Espin Pedrol1-0/+1
The data structre is held private so that it can be easily extended in the future. Change-Id: I6f8324da9ba49b9249682e2ec5b45297f18dd8c2
2023-01-25Introduce netdev APIPau Espin Pedrol1-0/+1
This module provides several operations on network devices (interfaces), like monitoring changes, setting addresses, routes, link state, etc. It also supports managing network interfaces on several different netns concurrently. These functionalitites will be used by the tun module included in a follow-up patch. Change-Id: I7a00c0445a89e088676a4897061b65196d9197f1
2023-01-24Introduce netns APIPau Espin Pedrol1-0/+1
Write a new API and implementation to manage network namespace related operations. This will be used by the upcoming tundev module. Change-Id: I0f2fba2fa42250a07211a7b7f479498f27c529da
2023-01-17socket.h: Introduce API osmo_sockaddr_netmask_to_prefixlen()Pau Espin Pedrol1-1/+1
Implementation is imported from osmo-ggsn.git 97f60e3dca581797007524e0006ca9fafad59713 in46a_netmasklen() and adapter to work with an osmo_sockaddr. This will be used by osmocom-bb's "modem" app. Change-Id: I75e75e251c6776801fffdde745aebedf21c68799
2022-10-16logging.h: Allocate DLM2PA and DLM2UA for libosmo-sigtranHarald Welte1-1/+2
Change-Id: I106b7586bfe8ee03c052b6f8b33da4c466e05abd
2022-10-04socket: Introduce API osmo_sockaddr_is_anyPau Espin Pedrol1-0/+1
Change-Id: I2810a889fc14052d0e0be6a2b500ad4e5088ffa9
2022-06-28Bump version: 1.6.0.132-0239-dirty → 1.7.01.7.0Pau Espin Pedrol1-6/+0
Change-Id: Idb0d20aa4336a69cb100e140fb1fa9e7ac25b984
2022-06-09cbsp: Add enum and value string for CausePau Espin Pedrol1-0/+1
Change-Id: I35592bb4fff2e7b442d0e0cd537b66687862baf2
2022-05-25iuup: Rework API to support RFCI IDs != RFCI indexPau Espin Pedrol1-0/+1
The initially merged IuUP API and implementation assumed that RFCI with ID was always in the position of its ID inside the list of RFCIs. This was the case for messages sent by ip.access nano3g as well as our own osmocom implementation. However it was noticed that other nodes from other vendors actually use other order, as allowed by the IuUP message format. Hence, we need to break the assumption and provide explicit ID information in the list. NOTICE: This commit breaks API and ABI compatibility with older versions of libosmogsm, but not with any previous release of libosmocore since the API is only available in master so far (it was added in 9fe1f9fb0b3197cdecaa55017d3afd7355e59c36). Similary, it's only user (osmo-mgw) only uses the API in master, so there's no API breakage with older releases. Related: SYS#5969 Change-Id: Ib21cee2e30bf83dff4e167f79541796007af9845
2022-04-26gsm: Introduce helper rach_tx_integer_raw2val()Pau Espin Pedrol1-0/+1
Change-Id: I6ef085ee92b2064cb46fa5ec3ae98a0ca59ad599
2022-03-30bssgp_bvc_fsm: Add a hook to notify when a reset was acknowledgedDaniel Willmann1-0/+1
There are cases where we want to be notified of a successful BVC reset, e.g. for a signalling because we can then start resetting the PtP-BVCs. With this hook it's now possible to do that. Change-Id: If240dd13f0f674693018c93390386b2c8afb97af Related: SYS#5908
2022-02-28BSSAP: HO Request Ack: add missing Codec List (BSS Supported)Neels Hofmeyr1-0/+1
Related: SYS#5839 Related: I3c0576505a3ceb3cd5cc31dc69c5bc4a86a4ea08 (osmo-bsc) Change-Id: Iab0a7b4d81592157fc111d1adb9e9f4cb53a94e9
2022-02-16gsm: [ABI BREAK] Support CellId SAI, change CellId CGI-PS id numberPau Espin Pedrol1-0/+1
Those are available in 3GPP TS 48.008 version 16.0.0 Release 16, section 3.2.2.17 Cell Identifier. It can be seen that we have a collision between the osmocom non-standard format and the SAI standard one. This is because CGI-PS is not really a TS 48.008 Cell Identifier, but only specified in TS 48.018 and has no ID number assigned. The CGI-PS was added there because the whole osmo-bsc neighbour configuration works with CellIds to manage neighbours, so it felt natural to extend the APIs to also provide means to use CGI-PS format (TS 48.018 even refers 48.008 existance and mentions there's no explicit ID). At the time this Cell Identifier was added, the firstly available number (11) was taken, which was of course a really bad idea since newer versions of the spec can at some point use it, which is the case if one checks for instance TS 48.008 Release 16 SAI Cell Id. There no perfect way to fix this bad decision at the time, but the CGI-PS is only used in osmo-bsc and only for RIM related purposes, so by changing the ID of CELL_IDENT_WHOLE_GLOBAL_PS, we only break RIM under some specific CIs being used, and when an osmo-bsc is built against older libosmocore and then used at runtime against a newer libosmocore (which should be rare). Hence, the downside is acceptable, and by moving the new ID number to be ouside of the spec proto TS 48.008 range (4 bits), we make sure we don't have the same problem again in the future. Related: SYS#5838 Fixes: ca33a71ca8eeaee98b1b53d5394b147a4ff0b429 Change-Id: Id25e563febdb7640174540136225f399515a0089
2021-11-16Bump version: 1.5.1.282-ab5e-dirty → 1.6.01.6.0Pau Espin Pedrol1-14/+0
Change-Id: Ia3ac0a36b9e898996f596c6d2787e03cd59bfc11
2021-09-30refactor stat_item: report only changed valuesNeels Hofmeyr1-0/+1
Change the functionality of skipping unchanged values: instead of looking up whether new values have been set on a stat item, rather remember the last reported value and skip reporting identical values. stats_test.c shows that previously, a stat item reported a value of 10 again, even though the previous report had already sent a value of 10. That's just because the value 10 was explicitly set again, internally. From a perspective of preserving all data points, it could make sense to send consecutive identical values. But since we already collapse all data points per reporting period into a max, that is pointless. Related: SYS#5542 Change-Id: I8f4cf34dfed17e0879716fa2cbeee137c158978b
2021-09-30refactor stat_item: get rid of FIFO and "skipped" errorNeels Hofmeyr1-1/+5
Intead of attempting to store all distinct values of a reporting period, just store min, max, last as well as a sum and N of each reporting period. This gets rid of error messages like DLSTATS ERROR stat_item.c:285 num_bts:oml_connected: 44 stats values skipped while at the same time more accurately reporting the max value for each reporting period. (So far stats_item only reports the max value; keep that part unchanged, as shown in stats_test.c.) With the other so far unused values (min, sum), we are ready to also report the minimum value as well as an average value per reporting period in the future, if/when our stats reporter allows for it. Store the complete record of the previous reporting period. So far we only compare the 'max' value, but like this we are ready to also see changes in min, last and average value between reporting periods. This patch breaks API by removing: - struct members osmo_stats_item.stats_next_id, .last_offs and .values[] - struct osmo_stats_item_value - osmo_stat_item_get_next() - osmo_stat_item_discard() - osmo_stat_item_discard_all() and by making struct osmo_stats_item opaque. In libosmocore, we do have a policy of never breaking API. But since the above should never be accessed by users of the osmo_stats_item API -- or if they are, would no longer yield useful results, we decided to make an exception in this case. The alternative would be to introduce a new osmo_stats_item2 API and maintaining an unused legacy osmo_stats_item forever, but we decided that the effort is not worth it. There are no known users of the removed items. Related: SYS#5542 Change-Id: I137992a5479fc39bbceb6c6c2af9c227bd33b39b
2021-08-20stats: send real last value if no new values comeOliver Smith1-0/+1
Background: * Individual values can be added to osmo_stat_item.values at any time. * Stats are reported at a fixed interval (see vty 'stats interval'), e.g. every 10 seconds. * In order to report a new stat value, we use the maximum of all osmo_stat_item.values added since the last report. * By default, we do not send new stat values if they did not change (see vty 'config-stats' -> 'flush-period' default of 0). Fix the following bug: * If 'flush-period' is 0, and no new osmo_stat_item.values are coming in, the last value that gets reported is not necessarily the last entry in osmo_stat_item.values. * For attached reporters (statsd), it could then be that the given stat stays at the wrong value for a long stretch of time (think of several hours/days/forever). Explanation of how the test shows that it is fixed: * stats get reported (value is irrelevant) * osmo_stat_item gets a new value: 20 * osmo_stat_item gets a new value: 10 * stats get reported (value: 20, the maximum of both new values) * osmo_stat_item gets no new values * stats get reported (value: 10, this is new because of the bug fix, the real last value in osmo_stat_item, different from the 20 sent earlier, without the fix it would not send anything here and the last sent value would be 20) * osmo_stat_item gets no new values * stats get reported (nothing gets sent, since the real last value was already sent and 'flush-period' is 0) Fixes: OS#5215 Change-Id: Ibeefd0e3d1dbe4be454ff05a21df4848b2abfabe
2021-06-08kdf: add key derivation functionsEric1-0/+1
generic sha code from git://w1.fi/hostap.git commit 5ea93947ca67ba83529798b806a15b247cdb2e93 which also happens to be the source of our milenage code. Related: SYS#5324 Change-Id: Ibf2e49edada944d91ceba62bd0d6b6ce69261fcd
2021-06-05stat,rate_ctr: Allow setting group name and use it at report timePau Espin Pedrol1-0/+1
This patch adds a new field "name" to the rate_ctr and osmo_stat_item_group structs, together with an API to set it. This new field allows for easy identification of specific group instances when several of them exists, rather than using a sometimes random/increasing index value. If set, this name (string) is used instead of the index by the stats reporter. The name, if set, is also printed during "show stats" VTY commands. It's up to the user or application to set up unique or meaningful names to fullfill one's needs. WARNING: this commit breaks ABI and possibly creates unexpected behavior when run with non-rebuilt apps which use the modified structs directly to get the coutners, or if use the static inline API rate_ctr_inc2(). Existing users of these structs should migrate to use new APIs introduced in follow-up commits instead of accessing the field directly. Related: SYS#5456 Change-Id: I0dc510783dd9ae8436dae8005a7b3330e80d36f3
2021-06-01sim: Add osim_card_{reset,close}() APIHarald Welte1-0/+1
This is required to reset and close a card under software control after opening it with osim_card_open() Change-Id: Ie9ec66db4d54fdb1331f4ae05ca3ca4274912e9d
2021-05-18vty: Introduce API vty_read_config_filepPau Espin Pedrol1-0/+1
This new API doesn't use host_config_set(), and allows passing a FILE* from any source, not only a filesystem path. Related: SYS#5369 Change-Id: I720ac04386261628c0798a1bfcaa91e2490a86c3
2021-04-28fix default_timeout type of osmo_tdef_fsm_inst_state_chg default_timeoutNeels Hofmeyr1-0/+1
The api doc indicates the possibility to pass -1, and calling osmo_tdef_get() actually casts the arg to a signed long. To end the confusion, change default_timeout from unsigned long to long. Change-Id: I51b9172603984839448346c9836e43c8c802fcf8
2021-04-25sim: Obtain card ATR when opening the cardHarald Welte1-0/+1
Change-Id: I42e387535c40f371b06f384af0ca5dc1e42ed00e