aboutsummaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)AuthorFilesLines
2021-09-24gsm0503_coding: use ahs tables when encoding ahs codec id2021q1Philipp Maier1-1/+1
The encoder function gsm0503_tch_ahs_encode uses gsm0503_afs_ic_ubit when encoding the CMR or FT (depends on the frame number). This is not correct. It should use gsm0503_ahs_ic_ubit instead. Change-Id: Id250b2102ac79ff222bd3ad9d1abc4b60abdd12b Related: SYS#5549
2021-04-29osmo_timer_pending: Make arg constPau Espin Pedrol2-2/+2
Change-Id: I250c25c3ac61ac364335f81d8ba50cb32fd6976e
2021-04-29ns2: change the 'priority' setting name to 'socket-priority'Harald Welte1-2/+2
This has been changed based on feedback from Pau Espin in osmo-mgw, and for consistency we also adjust it here. No backwards compat needed as it was just introduced yesterday. Change-Id: I88989dc17c8996609b895c43012f8cca98aa81dc
2021-04-29ipa_ccm_make_id_resp: Make it work at allHarald Welte1-1/+1
This could never possibly have worked. When iterating over the different IEs to encode, we must of course use the tag of the current iterator item, and not the hard-coded value of the second tag in the list. Change-Id: I148799c5bdb95f70118691c1150330ebac4fdf21
2021-04-29Fix ipa_ccm_make_id_resp_from_req to work at allHarald Welte1-3/+8
The parser was so horribly broken, it could not ever have possibly worked. Change-Id: Ibed0ff7f8d36504ef783f2653c9982d4e25e874f
2021-04-29Fix ipa_ccm_make_id_resp_from_reqHarald Welte1-2/+2
In 2018, I4723361e1094b358310541a7dc4c5c921c778a15 introuced a check against an integer unterflow. However, the fheck got the logic wrong, with the result of breaking the function completely: It would always only detect the first tag within the IPA request and then take the branch that assumes an integer underflow. Change-Id: I344975d0bda565ff196a1c0c69305cd349b98a19
2021-04-29ns2: Allow setting the socket priority for a UDP bindHarald Welte5-4/+57
Change-Id: Ifdfa086ce1c8d62b256abb3454b70cf53da9dcdb
2021-04-29gprs_ns: Fix another DSCP vs. TOS mistake in old NS codeHarald Welte1-9/+4
DSCP is a 6-bit value stored in the upper 8 bit of what was used to be known as TOS. Let's use the newly introduced OSMO_SOCK_F_DSCP() to prevent having to worry about this in higher level code. Change-Id: I6b9848fd0752d99d3df5346313618d5847d64fb8 Related: OS#5136
2021-04-29ns2: migrate from osmo_sock_set_dscp() to OSMO_SOCK_F_DSCP()Harald Welte2-21/+4
The latter is much more compact than the former. Change-Id: I2a24c0cbb17fad8ed84297267dcd63730efbc014
2021-04-29gprs_ns2_frgre: Ensure DSCP is sin premitted value rangeHarald Welte1-0/+3
gors_ns2_udp has this check, but gprs_ns2_frgre was missing it. Change-Id: I9bb9c6bdfe81fa6f02b11a02550ac9a54d3bfeaf
2021-04-29gprs_ns2: Fix yet another DSCP vs. TOS mix-upHarald Welte1-3/+5
This is a follow-up to I64fee56b04d0ecd128bf661699d5071817ea96ec, due to code duplication there was another code path that manually set the IP_TOS socekt option that I missed in the first patch. Related: OS#5136 Change-Id: I4bb22d0f67984077706b694eb7e75327b41b6fcf
2021-04-28fix default_timeout type of osmo_tdef_fsm_inst_state_chg default_timeoutNeels Hofmeyr3-2/+3
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-28socket: IPv6 support for osmo_sock_set_dscp()Harald Welte1-7/+36
IPv6 has the analogous to DSCP: The "traffic class" field. See https://tools.ietf.org/html/draft-itojun-ipv6-tclass-api-03 Change-Id: Ib31b977f67d60aa7f30ca4ab6eceba3d1d5eeee1 Related: SYS#5427
2021-04-28socket: QoS support for all our socket init functionsHarald Welte2-1/+30
Every socket function that can be passed a 'flags' argument now supports the following two additional macros that can be or-ed in with the flags: * OSMO_SOCK_F_DSCP(x) -- specify the IP DSCP of the socket * OSMO_SOCK_F_PRIO(x) -- specify the priority of the socket The existing osmo_sock_set_{dscp,priority}() functions are useful, but you cannot call them in between the socket creation and the connect() operation when using our socket helpers. This means that the first packet sent will have the default DSCP/priority, and only later packets would have the desired values. When using the functionality introduced by this patch, we can ensure that even the very first packet of e.g. a TCP or SCTP connect() will have the correct DSCP/priority applied. Change-Id: If22988735fe05e51226c6b091a5348dcf1208cdf Related: SYS#5427
2021-04-28socket: reduce code duplication, introduce socket_helper_tail()Harald Welte1-39/+38
Common bits shared by various functions (currently setting non-blocking) should not be copy+pasted around. Change-Id: I95056940ddc26b65f63eedaeaab6882edaef6317
2021-04-27socket: Introduce osmo_sock_set_priority() helper functionHarald Welte2-0/+9
In some situations we want to set the SO_PRIORITY socket option to determine the in-kernel priority of packets generated by this socket. Change-Id: I89abffcd125e6d073338a5c6437b9433220e1823 Related: SYS#5427
2021-04-27ns2: Fix setting the DSCP value.Harald Welte2-3/+5
DSCP is a 6-bit value (0..63) stored in the upper 6 bits of what was formerly known as TOS bits. We must * make sure the user can only specify 0..63 * shift the value by two bits when using the IP_TOS socket option We achieve the latter by using the recently-added osmo_sock_set_dscp() helper. Change-Id: I64fee56b04d0ecd128bf661699d5071817ea96ec Closes: OS#5136
2021-04-27socket: Introduce osmo_sock_set_dscp() to set socket DSCP valueHarald Welte2-0/+28
At least on Linux, sockets have a IP_TOS socket option that can be configured to set the TOS. However, TOS (of RFC791) was replaced by the DSCP (of RFC2474) in 1998. As the DCSP bits are only the upper 6 bits of the TOS bits, let's introduce a helper to get, mask and set the DSCP values in the TOS bits. Related: OS#5136, SYS#5427 Change-Id: Ia4ba389a5b7e3e9d5f17a742a900d6fd68c08e40
2021-04-25ns2: Dump frame relay state to VTY during "show ns"Harald Welte3-0/+39
When doing a "show ns", let's also dump the state of the frame relay network, with all its links and DLCs (if any). Change-Id: I798af3e97dc014b6e0fcde86560a1809852f7510 Related: OS#4877
2021-04-25frame_relay: Export osmo_fr_network_free()Harald Welte2-0/+2
The function already existed, it was just not declared and not exported. Change-Id: I3f2a7e2fd1a4eda6bbed8510cf82951d73bb3f84
2021-04-25sim: Remove 'printf' from library codeHarald Welte2-7/+0
Those were really meant as an early debugging aid and should not have survived this long. Change-Id: I4e9a80ced15686734d4485c232c5936f566cfd76
2021-04-25sim: Obtain card ATR when opening the cardHarald Welte3-0/+35
Change-Id: I42e387535c40f371b06f384af0ca5dc1e42ed00e
2021-04-22gsm48_mr_cfg_from_gsm0808_sc_cfg(): drop bitmask without effectNeels Hofmeyr1-1/+1
GSM0808_SC_CFG_AMR_4_75_5_90_7_40_12_20 has value 0x0002, so the '& 0xff' had exactly no effect. Change-Id: Ia25ac20539e8ac70fb5f70c1191bd58825151c68
2021-04-21gsm0808: Introduce gsm0808_old_bss_to_new_bss_info_att_tlvdefPau Espin Pedrol4-1/+29
Introduce TLV attribute definition for "Old BSS to New BSS Information" container. Related: SYS#5337 Change-Id: I0e55e947b6fef6dad0cf1a6c16b781bef4cc76c5
2021-04-20RR: add missing Extended TSC Set IENeels Hofmeyr2-0/+2
Defined in 48.018 10.5.2.82. This will be used by Channel Mode Modify for VAMOS. Related: SYS#4895 SYS#5315 Change-Id: I9bad6e7121af43dfa9706635e58279ce672a4e14
2021-04-20RR: add VAMOS channel modesNeels Hofmeyr4-0/+55
Also add functions to convert between VAMOS and non-VAMOS speech modes. Related: SYS#4895 SYS#5315 Change-Id: Ie0ea592da5610ae70290106d004e549cf3212a89
2021-04-19cosmetic: fix typo in commentPau Espin Pedrol1-1/+1
Change-Id: I43cb7b88a4e867836a67928e361253ce0f02a329
2021-04-19gsm: Support Sending Last EUTRAN PLMN Id in Handover RequiredPau Espin Pedrol3-0/+9
Related: SYS#5337 Change-Id: I6280ce1abc283f1491bc6f391b2dd952df33a16b
2021-04-19protocol/gsm_08_58.h: add asymmetric CSD data ratesVadim Yanitskiy1-0/+7
The new values are present in 3GPP TS 48.058, V16.0.0 (2020-09). Change-Id: Icf4c83fa443b8410f4362c119b0a85419036b9cd
2021-04-19protocol/gsm_08_58.h: add more 'Channel rate and type' valuesVadim Yanitskiy1-4/+9
The new values are present in 3GPP TS 48.058, V16.0.0 (2020-09). Change-Id: I0aaea1549e6de01c374d6b46353312e6246078e0
2021-04-19protocol/gsm_08_58.h: add RSL_CMOD_SP_{GSM4,GSM5,GSM6}Vadim Yanitskiy1-0/+3
The new values are present in 3GPP TS 48.058, V16.0.0 (2020-09): * RSL_CMOD_SP_GSM4 - OFR AMR-WB or OHR AMR-WB, * RSL_CMOD_SP_GSM5 - FR AMR-WB, * RSL_CMOD_SP_GSM6 - OHR AMR. Change-Id: I40eca759380c8895d7923b2b4259d37a50978160
2021-04-18gprs_ns2: add functions for SNS add/del/change-weight messagesAlexander Couzens2-0/+135
Related: OS#5036 Change-Id: Ib9492e213e82c18c7dcce6ba7d64e897b4c74796
2021-04-18gprs_ns2: SNS: allow transition missing transition GPRS_SNS_ST_UNCONFIGUREDAlexander Couzens1-1/+2
A transistion from GPRS_SNS_ST_UNCONFIGURED -> GPRS_SNS_ST_UNCONFIGURED. Related: OS#5036 Change-Id: I125e7e5a08ea6aff6e0308a18b5c0a6d0392ad32
2021-04-14cosmetic: Fix trailing whitespacePau Espin Pedrol1-1/+1
Change-Id: Ib79b0e0c728a7f4de0b3884785c73ab2d0d44f4e
2021-04-14cosmetic: tlv_parser: fix typo in func descriptionPau Espin Pedrol1-1/+1
Change-Id: I27f28376a88f00d86a0f65595f61f6026f7e0fd4
2021-04-14gsm_08_08.h: Add extra field elements defined in other sectionsPau Espin Pedrol1-1/+4
The Signalling Field Element Coding list defined in 3.2.3 is used in "Old BSS to New BSS Information" and "New BSS to old BSS Information" IEs. However, the former IE (Old->New Info) defines 2 extra Field Elements in 3.2.2.58 (3GPP TS 48.008 version 16.0.0 Release 16) not present in 3.2.3. Related: SYS#5337 Change-Id: I4db3f7974887e4c798a30c5b51a19472ceeee27d
2021-04-13gprs_ns2: fix nsvc block and unblock vty commandAlexander Couzens1-2/+2
e7dfeac8dcb3 introduced a regression in the block/unblock check as it was using the priv->initiate_block instead of priv->om_blocked. The initiate_block tracks who is responsible to unblock the NSVC. Fixes: e7dfeac8dcb3 ("gprs_ns2_vty: print a response to vty `nsvc <nsvci> (block|unblock|reset)") Change-Id: I516faea223e30b120a297faed10636daa554be8a
2021-04-12vty/logging: logp: properly handle library specific sub-systemsVadim Yanitskiy2-0/+20
The library specific sub-systems are kind of special, because their position in the 'osmo_log_info' may vary depending on the number of application specific sub-systems. This is why their associated constant values (like DLGLOBAL) are negative, and this is what the LOGP() macro expects as the first argument. Before this change, invoking 'logp' command with any library specific logging sub-system would result in getting messages printed with the fall-back DLGLOBAL sub-systems. Change-Id: If86563e169fe1243adfa7b09c9d65d9f88c8a99e
2021-04-09add osmo_bts_features_names: short BTS feature stringsNeels Hofmeyr3-1/+32
This will be used by osmo-bts-omldummy to parse features strings from the cmdline. Note that osmo_bts_feature_name() already exists to return the longer descriptive value_strings from osmo_bts_features_descs (_descs!). Luckily that misses the plural 'features' in the name, so that I can still add a properly named osmo_bts_features_name() function that only returns the name, matching the common pattern used in osmocom code. Related: SYS#4895 Change-Id: I699cd27512887d64d824be680303e70fff3677c1
2021-04-08deprecate osmo_bts_feature_name(), add osmo_bts_features_desc()Neels Hofmeyr1-1/+5
The function osmo_bts_feature_name() is ill-named for two reasons: - it returns descriptive text instead of just a string representation of the name. - The enum is named "osmo_bts_features", so the function name lacks the "s" for "features". Rationale: An upcoming patch adds a function to return just the name, properly called osmo_bts_features_name(), so deprecate the weirdly named one first. Change-Id: I9dfdb5e81037b6000effbd340af4e5db0dcfd69c
2021-04-07stats: have_value is a bool, not intOliver Smith1-1/+1
Change-Id: Id92c63f4e54ec1bf3411205be1bd268e1d184b03
2021-04-07stats: log error when missing stats values (v2)Oliver Smith3-0/+10
Related: SYS#4877 Change-Id: I5140d967c2f1d36dadf93b03e52b9bbd42e2a3a6
2021-04-07stats_test: restore stat_item_get_next assertsOliver Smith1-18/+18
This is a partial revert of b27b352e ("stats: Use a global index for stat item values"). Now that osmo_stat_item_get_next correctly returns how many values have been skipped, we can use the accurate asserts on its return value again. Fix the initial values of next_id_a,b (1 instead of 0), so we don't get a skipped value on the first read. This is needed, because b27b352e refactored osmo_stat_item_get_next to have the next id as parameter instead of the last read one, and the initial value was not adjusted in the tests. Related: OS#5088 Change-Id: I9d4cda2487a62f52361c24058363dfa90e502c63
2021-04-07stat_item: make value ids item specificOliver Smith4-44/+44
Fix counting of values missed because of FIFO overflow in osmo_stat_item_get_next(), by assigning a new item value id effectively as item->value[n + 1].id = item->value[n].id + 1, instead of increasing a global_value_id that is shared between all items and groups. With global_value_id, the count of values missed was wrong for one item, as soon as a new value was added to another item. This partially reverts b27b352e ("stats: Use a global index for stat item values") from 2015, right after stats was added to libosmocore. It was supposed to make multiple readers (reporters) possible, which could read independently from stat_item (and later added comments explain it like that). But this remained unused, stats has implemented multiple reporters by reading all stat_items once and sending the same data to all enabled reporters. The patch caused last_value_index in struct osmo_stat_item to always remain at -1. Replace this unused last_value_index with stats_next_id, so stats can store the item-specific next_id in the struct again. It appears that stats is the only direct user of osmo_stat_item, but if there are others, they can bring their own item-specific next_id: functions in stat_item.c still accept a next_id argument. Related: OS#5088 Change-Id: Ie65dcdf52c8fc3d916e20d7f0455f6223be6b64f
2021-04-07vty/logging: ensure consistent '%' prefix for warningsVadim Yanitskiy2-7/+7
Change-Id: I2b2bab61e46668c3b4b0ccad88d02b6d00a83544
2021-04-07vty/logging: use consistent quiting in warning messagesVadim Yanitskiy1-4/+4
Change-Id: Ifded63a38caac26e174fc6cb69dead7bc83db344
2021-04-07gprs_ns2_vty: print a response to vty `nsvc <nsvci> (block|unblock|reset)Alexander Couzens2-2/+34
The vty wasn't printing anything to the user if it was a success or not Change-Id: Idbb83ea319bbdc94177febdd66e79c49fce7fdd2
2021-04-07gprs_ns2: sns: remove the initial SNS NSVC if it's not partAlexander Couzens1-0/+4
A SNS configuration can be done over a NSVC, however this initial NSVC doesn't need to be part of the configuration. Those NSVC need to be removed when the configuration is done. This wrong behaviour can be seen in the vty `show ns` on NSEI 00001: UDP, ALIVE FSM Instance Name: 'GPRS-NS2-SNS-BSS(NSE00001-SNS)[0x55c72c09b420]', ID: 'NSE00001-SNS' Log-Level: 'DEBUG', State: 'CONFIGURED' Maximum number of remote NS-VCs: 8192, IPv4 Endpoints: 8192, IPv6 Endpoints: 8192 Local IPv4 Endpoints: 10.0.0.1:23000, Signalling Weight: 1, Data Weight: 1 Remote IPv4 Endpoints: 10.0.2.2:23000, Signalling Weight: 1, Data Weight: 0 10.0.2.2:23001, Signalling Weight: 0, Data Weight: 1 3 NS-VC: NSVCI none: UNBLOCKED DYNAMIC data_weight=1 sig_weight=0 udp)[10.0.0.1]:23000<>[10.0.2.2]:23000 NSVCI none: UNBLOCKED DYNAMIC data_weight=0 sig_weight=1 udp)[10.0.0.1]:23000<>[10.0.2.2]:23001 NSVCI none: UNCONFIGURED DYNAMIC data_weight=1 sig_weight=1 udp)[10.0.0.1]:23000<>[10.0.2.2]:8888 The UNCONFIGURED NSVC should not be present in when SNS is in CONFIGURED. Related: SYS#5416 Change-Id: I4045ac6c033ae084743b17a16eef4fcff76589b9
2021-04-06gprs_ns2: sns: ensure the sns->alive state is correctAlexander Couzens1-0/+12
The SNS fsms also track the NSE however since the NSVC starts now in ALIVE for SNS the SNS must check when synchronize the alive state when entering the ST_CONFIGURED. Related: SYS#5416 Change-Id: Ib6a1cc1fd84959e69c07b72ef780642205d2cd18
2021-04-06gprs_ns2: nsvc_fsm: reorder notification st_alive_on_enter()Alexander Couzens1-1/+1
The start_procedure() can't be called after ns2_nse_notify_unblocked() because ns2_nse_notify_unblocked() might free the nsvc. Otherwise the fsm will do use-after-free on the NSVC memory. Related: SYS#5416 Change-Id: If97dfd123eefd71fc6c3fe886a243a21784aeeb4