aboutsummaryrefslogtreecommitdiffstats
path: root/include
AgeCommit message (Collapse)AuthorFilesLines
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
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 Pedrol2-0/+34
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 Maier3-0/+36
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
2021-02-12bssgp_bvc_fsm: Consistent namingDaniel Willmann1-3/+3
bssgp_bvc_get_features_* are fsm "methods" and the name should indicate that just lika all other function names in bssgp_bvc_fsm.h Change-Id: I30fbbe36cdabf9635eaf4dfb1e93c8ce0f667b39
2021-02-12bssgp2_enc_status: Truncate STATUS message to maximum PDU lengthDaniel Willmann1-1/+1
Related: OS#4889 Change-Id: Ic39d918c56399ceb0431299ce938e3bf276f678a
2021-02-12bssgp_bvc_fsm: Set/get maximum BSSGP PDU lengthDaniel Willmann1-0/+3
Add functions to get/set the maximum supported BSSGP PDU size by the NS layer. IPv4 and IPv6 should not matter since we can just enable IP fragmentation and send NS PDUs up to 2**16 + bytes. Frame relay does not support fragmentation and this is the reason we need to be aware of the maximum PDU size. Luckily with 1600 bytes the MTU in frame relay can hold a regular IP packet including NS/BSSGP overhead. On the NS layer this corresponds to the size of an NS SDU in NS-UNITDATA (3GPP TS 48.016 Ch. 9.2.10) Change-Id: I9bb82ead27366b7370c9ff968e03ca2113ec11f0 Related: OS#4889
2021-02-12gprs_ns2: add signalling & data weights for UDP bindsAlexander Couzens1-0/+2
Allow to assign a signalling and data weight to UDP binds. Those weights will be used when doing dynamic configuration over IP-SNS. This is only the first part which only uses the assigned weights when doing a new SNS configuration. The outgoing change weight procedure will be supported in a later patch when the SNS fsm supports outgoing procedures. Related: SYS#5354 Change-Id: I5133e4229377d44772a9af28628a2bc420fea34b
2021-02-08Fix struct bitfields on big endian systemsPau Espin Pedrol2-0/+81
Changes done by contrib/struct_endianess.py. Change-Id: Ia9cb1ef2ba2bfff9ef713c7d1cf388931dae1c46
2021-02-06tlv: clarify documentation for msgb_tv{16,32}_put()Vadim Yanitskiy1-2/+2
Change-Id: Ie439822e0587012e108f67ba4e73771dc684b95b
2021-02-06tlv: add msgb_tv32_put(), similar to msgb_tv16_put()Vadim Yanitskiy1-0/+10
Change-Id: I11301b20038aa5d90d46d968f7eda3d53b560022
2021-02-04gsm48: add compare function for struct gprs_ra_idPhilipp Maier1-0/+1
Comparing struct gprs_ra_id using memcmp can be error prone, so lets add a compare function to compare two struct gprs_ra_id values reliably. Change-Id: I4d7558c04d9d01761516526086be5104bb2eeada Related: SYS#5103
2021-02-02frame_relay: Add status call-backs for link + DLC status changesHarald Welte1-2/+9
Change-Id: Iec19db4e48642c3fcb0aa11fa7787b8323fd0e5a Related: Os#4999
2021-02-01gsm_7bit_encode_n(): fix integer overflow in gsm_septets2octets()Vadim Yanitskiy1-1/+4
Using 'uint8_t' for the length argument is definitely a bad idea. Because of this, packing more than 255 septets would not work as expected. Deprecate the old function and use 'size_t' instead. Change-Id: Ib1aac538afeb0a5c76a1df472d555139a496e12e
2021-02-01sim: fix gcc 4.9.2 + -std=gnu11 errorOliver Smith1-1/+1
Remove "(const struct osim_card_sw)" infront of OSIM_CARD_SW_LAST, so debian 8's gcc 4.9.2 doesn't fail anymore with the following error each time the macro is used: card_fs_sim.c:105:1: error: initializer element is not constant I verified with docker that there aren't any other build errors with gcc 4.9.2. Fixes: OS#4991 Change-Id: I9d3abbf9812dc09201eff0e9f7542cddedb6848b
2021-02-01ns2: Fix typos in commentsHarald Welte1-5/+5
Change-Id: I155fd697e229621561f7d00204421ac941101d77
2021-01-29gprs_bssgp: agregate RIM related code in gprs_bssgp_rim.cPhilipp Maier2-33/+34
gprs_bssgp and gprs_bssgp_util.c also contains code related to send and receive RIM PDUs via BSSGP and also code to encode and decode RAN INFORMATION PDUs. Lets move this to gprs_bssgp_rim.c Change-Id: Icda279452962b06e552cb1361d2a27b7dc8a6b04 Related: SYS#5103
2021-01-29gsm: bts_features: Introduce BTS_FEAT_CCNPau Espin Pedrol1-0/+1
This feature is used by BSC to gain knowledge on whether a given BTS supports GPRS Cell Change Notification (CCN) related procedures on PDCH, and as a result enable or not by default the CCN_ACTIVE bit in SI13 to announce the support it is allowed to use the feature. Related: SYS#4909 Change-Id: I61991266b95d0c13d51b47906cc07846e9cf1390