aboutsummaryrefslogtreecommitdiffstats
path: root/include
AgeCommit message (Collapse)AuthorFilesLines
2021-08-06vty/ports: move pcap server/client portsOliver Smith1-2/+4
Resolve conflict with other Osmocom software by moving ports: osmo-pcap-client 4237 -> 4227 osmo-pcap-server 4238 -> 4228 Remove wrong previous comments that claimed 4240 and 4241 were used. Related: OS#5203 Related: osmo-pcap I3b18b1fbbca2799f868f28104e2f5d513f93d46c Change-Id: I098f211370bba61995ce424ab64029bdd4c49e2d
2021-08-06vty/ports: prepare formatting for a long defineOliver Smith1-22/+22
Add one more tab between the define and the port number, to prepare for longer defines in the next patch. Related: OS#5203 Change-Id: I46655e33651814f41a1fea93406a83334d2fc529
2021-07-28utils: Fix c++ warn in OSMO_STRBUF_APPENDPau Espin Pedrol1-1/+1
It's really a false positive since _sb_l is compared and granted to be psotivie by the time we compare, so we don't really care, but c++ is not happy about it. """ /osmocom/core/utils.h:227:40: error: comparison of integer expressions of different signedness: ‘int’ and ‘size_t’ {aka ‘long unsigned int’} [-Werror=sign-compare] 227 | if (_sb_l < 0 || _sb_l > _sb_remain) \ | ~~~~~~^~~~~~~~~~~~ """ Change-Id: I90e7374aa959468670f1c0ea65a427398d423ddb
2021-07-27command: fix sourcecode formattingPhilipp Maier1-1/+1
Change-Id: Icc75c3b45821c24360e0fdb4a29077994e73ae05
2021-07-07linuxlist: add macro to get last element of a listPhilipp Maier1-0/+6
It is not be obvious on the first look that ->prev actually points to the last element of a list, lets add a macro for that to make the API easier to use Change-Id: Icf455bf6ba9d60bd311af17c9e80febaa42cacc9 Related: SYS#4971
2021-06-30bts_feature: Introduce feature to confiure dyn ts as sdcch8Pau Espin Pedrol1-0/+1
This feature signals support to configure Osmocom Dynamic Timeslot type as SDCCH8, on top of historically supported TCH/H and TCH/F. The idea is that when unneeded, the TS is configured as PDCH, and as soon as there's need for an SDCCH and there's none available, the TS is dynamically reconfigured to SDCCH8. Once all logical channels in the dynamic TS are released and hence becomes free, the BSC will reconfigure it to PDCH. Related: SYS#5309 Change-Id: Ifc0ca8916bd3e93e5a60a7dd7391d2588fdb5532
2021-06-30Rename osmo dyn ts enumsPau Espin Pedrol2-2/+6
They will gain support to be activated as SDCCH/8 soon too. Since new name would start to be too large, use a more generic naming for it. Related: OS#5309 Change-Id: I56dcfe4d17899630b17f80145c3ced72f1e91e68
2021-06-28cosmetic: gsm_12_21.h: Fix trailing whitespacePau Espin Pedrol1-2/+2
Change-Id: Ifdcdcfe30c41da233899101e1057bfca7d645a66
2021-06-25bts_features: add feature for BCCH carrier power reduction modeVadim Yanitskiy1-0/+1
Change-Id: I69283b3f35988fc7a1a1dcf1a1ad3b67f08ec716 Related: SYS#4919
2021-06-25gsm0808: add Kc128 to Handover RequestNeels Hofmeyr1-1/+6
Change-Id: Ieb6e43eef9e57281d54d4b7c63664668df5aef3e
2021-06-21add Kc128 to gsm0808 Create Ciphering CommandNeels Hofmeyr2-0/+22
Prepare for A5/4 support in osmo-msc. Add new function gsm0808_create_cipher2() which takes a struct as argument instead of individual fields. This is akin to e.g. gsm0808_create_handover_request() below in the file, and allows backwards compatibly extending the argument list without needing a new function signature every time. Add struct gsm0808_cipher_mode_command, as argument list for gsm0808_create_cipher2(), with kc128 included. Encode the Kc128 IE in gsm0808_create_cipher2(). Implement gsm0808_create_cipher() by calling gsm0808_create_cipher2(). Change-Id: Ib3906085e0c6e5a496a9f755f0f786238a86ca34
2021-06-18vty: make function cmd_range_match() publicPhilipp Maier1-0/+2
Certain control interface commands also may require to verfy a range in their verify function. cmd_range_match() from the VTY does exactly that and the range can be specified as string, the same way as we would specify it in the VTY. Change-Id: I53fc207677f52b1dc748b01d58424839cdba807c related: SYS#5369
2021-06-18osmo_select_shutdown_request(): allow finishing pending writes on SIGTERMNeels Hofmeyr1-0/+3
Allow telling osmo_select_main* to only service pending writes (shutdown mode). Introduce API fuctions to indicate a shutdown request, and find out whether shutdown is complete. Some osmo programs have a curious sleep of few seconds upon receiving SIGTERM. The idea presumably was to finish off pending writes before halting the program. But a sleep() on program exit is annoying, especially when there usually are no pending writes, and when osmo-bsc is launched numerous times for tests. Change-Id: Ib94d4316924103459577087c2214188679db2227
2021-06-13msgb_alloc_headroom: Change size args to be uint16_tPau Espin Pedrol1-2/+2
Underlaying APIs (msgb_alloc) use a uint16_t as a type, which means until now passing a value > 2^16 would succeed providing a msgb with less space than requested. Since those are static inline, there's no symbols used by apps, so we should be safe enough changing the type to be uint16_t, since change would only be applied at re-compile time. Change-Id: I83c8222484e4856c68134a1a9d8cf96eb91af1b8
2021-06-11bts_feature: Introduce feature to speak to PCUPau 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
2021-06-11ipaccess: 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
2021-06-08kdf: add key derivation functionsEric2-0/+22
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 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
2021-06-03gsm_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
2021-06-01stat,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
2021-06-01sim: 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
2021-05-19add RSL_CMOD_CRT_OSMO_TCH_VAMOS_Bm, RSL_CMOD_CRT_OSMO_TCH_VAMOS_LmNeels Hofmeyr1-0/+2
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 constPau 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 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 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 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-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