path: root/include/osmocom
AgeCommit message (Collapse)AuthorFilesLines
38 hoursbts_feature: Introduce feature to speak to PCUHEADmasterPau Espin Pedrol1-0/+1
This feature provides the BSC with information on whether the BTS talks the IPAC_PROTO_EXT_PCU osmocom extension over the underlying IPA multiplex of the OML link. Related: SYS#5303 Change-Id: Id62421f7f5540875ac877a187757f2cf0556bd02
38 hoursipaccess: Add new osmo extension IPAC_PROTO_EXT_PCUPau Espin Pedrol1-0/+1
This new extension protocol is used to forward Osmocom PCUIF messages BSC<->BTS<->PCU. It will be sent re-using the IPA multiplex of the OML link between BSC and BTS. BTS is responsible for forwarding the message over the unix socket to the PCU. Related: SYS#5303 Change-Id: I68b04def49946b6915dbd4e476999f249751cd28
5 dayskdf: add key derivation functionsEric1-0/+21
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
8 daysstat,rate_ctr: Allow setting group name and use it at report timePau Espin Pedrol2-0/+6
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
10 daysgsm_08_58.h: add mask for Osmocom specific VAMOS C-bitsVadim Yanitskiy1-0/+1
Applying and reverting this mask allows one to quickly convert between VAMOS and non-VAMOS variants of Bm/Lm C-bits. Change-Id: Ia0bd8695a3f12331b696fe69117189cdd48b584d Related: SYS#4895, OS#4941, SYS#5315, OS#4940
11 daysstat,rate_ctr: Introduce new API to get counter at given indexPau Espin Pedrol2-3/+5
Having this API and forcing apps to use it will allow easily adding new members to the group structure without having so much impact in users of this struct. Related: SYS#5456 Change-Id: Iebbf401f11e36645f8964d389460918eb9e0910e
12 dayssim: Add osim_card_{reset,close}() APIHarald Welte1-0/+4
This is required to reset and close a card under software control after opening it with osim_card_open() Change-Id: Ie9ec66db4d54fdb1331f4ae05ca3ca4274912e9d
2021-05-26gsm_08_58.h: add Osmocom specific Bm/Lm CBITs for VAMOSVadim Yanitskiy1-0/+8
Change-Id: If33c1695922d110c0d2c60d5c0136caf2587194e Related: SYS#4895, OS#4941, SYS#5315, OS#4940
These indicate VAMOS mode to osmo-bts during channel activation and channel mode modification. Change-Id: Ib4ea11c870683a58f0bbc8c9cd942faceba8c4d9
2021-05-19add RSL_IE_OSMO_TRAINING_SEQUENCENeels Hofmeyr1-0/+1
This IE is explained in the Abis manual in osmo-bts commit Ie583bd5969fdb45f772af198033e58d7c4077306 http://git.osmocom.org/osmo-bts/commit/?id=823cd529649b667af20bfa4e383255a8ed5931f1 Change-Id: I573c26b1431ee789e42f6fa620947b003c384dc0
2021-05-18vty: Introduce API vty_read_config_filepPau Espin Pedrol1-1/+2
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-05-17vty: Implement missing public API host_config_file()Pau Espin Pedrol1-1/+1
The API was defined in the header file but not implemented. Change-Id: I69de9864fa7cd421557b9fc630beefea6d90b4cc
2021-05-06Revert "gb: Fix naming and export symbol bssgp_enc_rim_pdu"Pau Espin Pedrol1-1/+1
This reverts commit 43ad616e4b66913eedc54f136addcc961b6402f8. _enc_ functions are for some ies while the _encode_ and _decode_ are for the full pdu. so the old name is correct. Change-Id: Ib0b4a6fd7f8c96e4647a373541e3cccb324c6a11
2021-05-06gb: Fix naming and export symbol bssgp_enc_rim_pduPau Espin Pedrol1-1/+1
The symbol was not in the list of exported symbols. Take the chance that it was not used anywhere outside libosmocore to rename it in order to follow similar naming as other existing APIs. Change-Id: I534db7d8bc5ceb19a2a6866f07d5f5c70e456c5c
2021-04-29osmo_timer_pending: Make arg const2021q1Pau Espin Pedrol1-1/+1
Change-Id: I250c25c3ac61ac364335f81d8ba50cb32fd6976e
2021-04-29ns2: Allow setting the socket priority for a UDP bindHarald Welte1-0/+1
Change-Id: Ifdfa086ce1c8d62b256abb3454b70cf53da9dcdb
2021-04-28fix default_timeout type of osmo_tdef_fsm_inst_state_chg default_timeoutNeels Hofmeyr1-1/+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-28socket: QoS support for all our socket init functionsHarald Welte1-0/+9
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-27socket: Introduce osmo_sock_set_priority() helper functionHarald Welte1-0/+1
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-27socket: Introduce osmo_sock_set_dscp() to set socket DSCP valueHarald Welte1-0/+2
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 Welte1-0/+2
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 Welte1-0/+1
The function already existed, it was just not declared and not exported. Change-Id: I3f2a7e2fd1a4eda6bbed8510cf82951d73bb3f84
2021-04-25sim: Obtain card ATR when opening the cardHarald Welte1-0/+11
Change-Id: I42e387535c40f371b06f384af0ca5dc1e42ed00e
2021-04-21gsm0808: Introduce gsm0808_old_bss_to_new_bss_info_att_tlvdefPau Espin Pedrol1-0/+1
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 Hofmeyr1-0/+1
Defined in 48.018 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 Hofmeyr2-0/+7
Also add functions to convert between VAMOS and non-VAMOS speech modes. Related: SYS#4895 SYS#5315 Change-Id: Ie0ea592da5610ae70290106d004e549cf3212a89
2021-04-19gsm: Support Sending Last EUTRAN PLMN Id in Handover RequiredPau Espin Pedrol1-0/+3
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-14cosmetic: Fix trailing whitespacePau Espin Pedrol1-1/+1
Change-Id: Ib79b0e0c728a7f4de0b3884785c73ab2d0d44f4e
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 (3GPP TS 48.008 version 16.0.0 Release 16) not present in 3.2.3. Related: SYS#5337 Change-Id: I4db3f7974887e4c798a30c5b51a19472ceeee27d
2021-04-09add osmo_bts_features_names: short BTS feature stringsNeels Hofmeyr1-0/+5
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-07stat_item: make value ids item specificOliver Smith1-4/+8
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-06stat_item: make next_id argument name consistentOliver Smith1-3/+3
Let osmo_stat_item_get_next, osmo_stat_item_discard, osmo_stat_item_discard_all consistently refer to their next_id arg as such (and not idx or next_idx). It refers to an ID (item->values[i].id), not an index (item->values[i]), and it is always the next one, never the current one. Do the same change for _index/_idx variables in stats.c, which are used as arguments to these functions. Replace rd_ with next_id_ in stats_test.c, too. Related: OS#5088 Change-Id: I5dd566b08dff7174d1790f49abd2d6ac020e120e
2021-03-27add BTS_FEAT_VAMOSNeels Hofmeyr1-0/+1
Change-Id: Ic3bd1b8075f76d1f35499faa68fad70698ee9a00
2021-03-24gprs_ns2: rework logging of Rx and Tx NS PDUAlexander Couzens1-1/+3
Introduce 2 new logging sub systems for signal and unit data. Unify log messages so all log messages look similiar. Log also Rx PDUs. Ensure dropped Tx packets (BLOCK/RESET on SNS) contain *Tx*. Change-Id: I34b8fde2955ecc010d1dcd9512e1bba9211e2c0d
2021-03-24gprs_ns2: Introduce gprs_ns2_create_nse2() for SGSN side SNSHarald Welte1-0/+3
gprs_ns2_create_nse() doesn't allow the caller to specify if the BSS or the SGSN role of IP-SNS shall be implemented. Add gprs_ns2_create_nse2() to fix that. Change-Id: I6db8c36f7c69b592d7d0fbcf323804f7e9912be2 Related: OS#3373
2021-03-18tlv: Fix length returned by t{l16,16l}v_putDaniel Willmann1-2/+2
Every other function returns a pointer to the first byte after the tlv that was just written. tl16v seems to be a copy and paste error from tlv16 above and t16lv seems to count the 16-bit tag twice. The new tests verify that the return value of *_put(buf, tag, len, val) points to buf + *_GROSS_LEN(len). Change-Id: I268a7e11fb5dce67ce1bd7974ab86c4d2bd002f7
2021-03-05TODO-RELEASE: Request increasing _LAST_OSMOVTY_NODE next releaseHarald Welte1-0/+7
We've used up all but one "library reserved" VTY nodes at this point, and we should definitely add some more reserved nodes in the next libosmovty ABI version / release. Change-Id: Idfe1e7d97f3f29fc219e80dcb6ce6bb768733adf
2021-03-01gprs_bssgp: add support for SGSN oriented RESETAlexander Couzens1-0/+2
To support SGSN oriented RESET introduce a role flag to track what's running the gprs_bssgp (local side). Related: OS#3879 Change-Id: Ibcbaffa94cbdc4296a8a7c372304ac11d50d9559
2021-02-20logging: Deprecate API log_set_print_filenamePau Espin Pedrol1-1/+1
Let's flag the API as deprecated so that people start using log_set_print_filename2() API instead, which has less ackward behavior implications like changing the print status of category-hex. Related: OS#5034 Change-Id: If9b6b322989536a12094e6105c3aabc84d8be24a
2021-02-19logging: Allow prefixing thread ID to each log linePau Espin Pedrol1-0/+3
Related: OS#5032 Change-Id: I38fc93ab0182b4edbd639c7ed0f31ce51964ee18
2021-02-19gprs_ns2: rework IP-SNS bindsAlexander Couzens1-0/+2
Introduce a `ip-sns-bind BINDID` vty command within a `nse` vty object. The ip-sns-bind defines the binds which will be used by the dynamic configuration with IP-SNS. This is only the first part which only uses the binds when doing a new SNS configuration. The outgoing add procedure will be supported in a later patch when the SNS fsm supports outgoing procedures. This is a behaviour change of the API and must be synchronized with the osmo-pcu. Otherwise SNS won't work with osmo-pcu. Related: SYS#5354 Change-Id: I9ab8092bf286e7d90e92f5702a5404425e959c84
2021-02-18gsm: Introduce API osmo_gsm48_rest_octets_si13_decodePau Espin Pedrol1-1/+2
Related: SYS#5358 Change-Id: I74fb0a3afc1ac4aadbfc609b882d929401f790eb
2021-02-17Introduce osmo_gettid() APIPau Espin Pedrol1-0/+33
This API wraps conventional gettid() linux-specific API, which even in Linux itself is sometimes not properly supported/announced. This API also allows future porting to other platforms if needed, and so far falls back to getpid() if no gettid(9 can be found. Code ported from osmo-trx.git, see commit 7a07de1efd4eb7cc11c33d3ad25cb2df70aa1ef1. Related: OS#5027 Change-Id: Id7534beeb22fcd50813dab76dd68818e2ff87ec2
2021-02-16gsm_08_58, gsm_44_004: add struct for l1 informationPhilipp Maier2-0/+35
Libosmocore currently does not offer any structs to encode and decode the l1 information on RSL level and the sacch l1 header on the air interface level. Both structs are identical but the field order in the first octet is reversed. Change-Id: I23c1890b89d5a0574eb05dace9f64cc59d6f6df7
2021-02-16gprs_ns2: inform the NS user (BSSGP) about the MTU of a NSEAlexander Couzens2-0/+8
The BSSGP layer needs to know the MTU of the NS UNIDATA payload. The MTU can be 0 if the NSE doesn't contain any NSVC. Every status indication will contain the mtu value. The MTU in the status indication contains the maximum transfer unit of a BSSGP message. From NS side the maximum SDU. Related: OS#4889 Change-Id: I5016b295db6185ec131d83089cf6c806e34ef1b6
2021-02-13gsm: Fix bitfield order in dtap_headerPau Espin Pedrol1-3/+3
This bitfield was added later and all osmocom code still uses the old field contain 1 byte "link_id". There's only one known user of the new bitfield which only uses it to log the SAPI name in osmocom, so no logical breakage is expected with this change (other than fixing a log line). While at it, fix a typo in comment describing related enum. Related: SYS#4909 Fixes: 392f607f2d42eb2839ccfc4c1b9e2c7cfaf3bcc2 Change-Id: I84866f03ee642aa7f1da273c93a16a38234cfa67