aboutsummaryrefslogtreecommitdiffstats
path: root/src
AgeCommit message (Collapse)AuthorFilesLines
2022-12-14gsm0808: remove unneeded assignment in enc_speech_codec()Vadim Yanitskiy1-1/+1
Change-Id: Ifc6d109e27cdada0d08d2a8fc1c354f3de04f15c
2022-12-14gsm0808: cosmetic: switch is not a functionVadim Yanitskiy1-1/+1
Change-Id: I2f58711675c5c9511c4f4fe4bf0d6e6f7dd093b1
2022-12-05rate_ctr: convert to timerfdMax1-12/+46
Use timerfd to schedule 1-second periodic timer once instead rescheduling every second in timer callback. Related: OS#5671 Change-Id: I2525fd691caa380a862d305cfcb4fa3cc50b70d0
2022-12-04telnet_init_dynif: don't allow negative portMax1-0/+3
Binding to a negative port should not be allowed. Using signed value for unsigned parameter is a mistake to begin with. Change-Id: I24f957641f2d8e230ccceb331a719496df0fdb1f
2022-12-04telnet_init_dynif: propagate errorMax1-1/+1
Return actual error from osmo_sock_init_ofd() to the caller. Change-Id: Ib09f4315b3868ec031ecbced8a63069e7c2de7da
2022-12-04vty: fix doc typoMax1-1/+1
Change-Id: I9f1112fc27dfe967b4a007648ddda1050e9bd9fa
2022-11-28osmo_tdef_get(): clarify API doc on val_if_not_presentNeels Hofmeyr1-1/+3
Change-Id: I2301aad86d6d165a3b51c6849bcd8fe02972e0a3
2022-11-26LAPD: move tx_hist code into static functionsMax1-20/+22
Related: OS#4074 Change-Id: Ibf3b08c8d874416796b94ba3a672a02d614313b1
2022-11-24gsm: constify several readonly paramsPau Espin Pedrol2-2/+2
Change-Id: Ib11bfe57f546a5618f70152b9b75115808e54bf6
2022-11-10*/Makefile.am: do not mix up AM_CFLAGS with AM_CPPFLAGSVadim Yanitskiy5-10/+11
Change-Id: I2c1d5f9c61714f487fbbe60603b2682f2c0a4c6b
2022-11-09Fix typos in copyright statements.Harald Welte3-3/+3
Change-Id: I783c56bb1d216ce3a47a19da230ee5f50aca2ab3
2022-11-04bits: fix typoPhilipp Maier1-2/+2
Change-Id: I3d6c30ffffdfe981f50cb755104b033b62e6b0c0
2022-11-03Support building with -Werror=strict-prototypes / -Werror=old-style-definitionHarald Welte8-12/+12
Unfortunately "-std=c99" is not sufficient to make gcc ignore code that uses constructs of earlier C standards, which were abandoned in C99. See https://lwn.net/ml/fedora-devel/Y1kvF35WozzGBpc8@redhat.com/ for some related discussion. Change-Id: I84fd99442d0cc400fa562fa33623c142649230e2
2022-10-27gb/vty: Show if NSVC is blocked locally by O&M/vty or by remotearehbein3-15/+19
Related: OS#5085 Change-Id: I0e8a12c3e54b701c9e697d50de1c9cb0bcc817e0
2022-10-26gsm0502: gsm0502_fn_remap(): use GSM_TDMA_FN_SUB() macroVadim Yanitskiy1-4/+1
Change-Id: Id77644d945ad195733d4bf68c0d1c5b450b16e58
2022-10-25msgb: introduce extended copy functionsMax1-10/+44
Those are similar to existing *msgb_alloc*() functions but allows to change the size of destination msgb provided it fits the data from source msgb. Change-Id: I36d4c16241d19f0f73c325be4d0e0bdef6813615 Signed-off-by: Max <msuraev@sysmocom.de>
2022-10-20{gsm,gb}/Makefile.am: drop undefined $GCC_FVISIBILITY_HIDDENVadim Yanitskiy2-2/+2
Change-Id: I142cf38e8954720ed66b0c242a5527c96626dcaa
2022-10-19doc: correct typo in ticket referenceMax1-1/+1
The OS#4993 has nothing to do with AF_PACKET/ENOBUFS, the proper ticket is OS#4995 as referenced later in the same file. Change-Id: Icf13b351dc74508fc312c535d68b13b7ce9b7e1e
2022-10-11LAPD: use bool for T200 reset flagsMax1-2/+4
Related: OS#4074 Change-Id: I2d1a3dd7938b079a3525c84647f82b7bc6cdfdd6
2022-10-11LAPD: log unknown format valueMax1-1/+1
Change-Id: I9efd433ed128ae1d9df45591b1a93e10f8a3372c
2022-10-11cosmetic: make linter happy with LAPD codeMax1-4/+2
The weird formatting not only makes it hard to read but caused linter to fail in the follow-up patch. Change-Id: Ie4e56b4796c1b8f270a692453faccf102c963db5
2022-10-06Fix Typo in gsm0808_msgt_names[]Keith Whyte1-1/+1
Change-Id: I91585d81efd6e18f4b8f9eaeaaaa50412253d93b
2022-10-06Fix LCLS-CONNECT-CONTROL generationKeith Whyte1-1/+1
gsm0808_create_lcls_conn_ctrl() was adding the LCLS-Configuration IE twice. Correct is LCLS-Configuration followed by LCLS-Connection-Status-Control (TS 48.008 3.2.1.91) Change-Id: I455ac7695ad33ef9073bea7d1711508717732607
2022-10-04socket: Introduce API osmo_sockaddr_is_anyPau Espin Pedrol1-0/+20
Change-Id: I2810a889fc14052d0e0be6a2b500ad4e5088ffa9
2022-09-28gb: add bssgp2_enc_flush_ll encode FLUSH-LLAlexander Couzens2-0/+30
Change-Id: I76dc3b08a63cfd78c9f7657fb58c2ddfa9b4b7e2
2022-09-15vty: Allow using hex representations in cmd numeric rangesPau Espin Pedrol1-6/+55
Ranges can now be specified in hexadecimal notation. In this case, only hexadecimal values are accepted (prefixed with "0x"). In order to allow using a hexadecimal value as an input argument, the command must specify the range in hexadecimal form. This way all existing commands (decimal) won't get an hexadecimal value unless they are further extended in the future, avoiding hard to notice breakage due to use of stroul() without using base=0 or even worse, using atoi() directly (which only understands decimal and provides no error checking mechanism). A command argument can be expanded to accept both decimal and hex in a range by means of specifying both, example: "mycmd (<0-255>|<0x0-0xff>)". Related: OS#5631 Change-Id: Ia2b7fbbf5502c28374c21dbff548232680da27d4
2022-08-18use_count: Return if uc is NULLDaniel Willmann1-0/+2
The documentation for osmo_use_count_get_put states the return value is "Negative on range violations or USE_LIST == NULL, the use_cb()'s return value, or 0 on success" However, the code in _osmo_use_count_get_put doesn't check if uc is NULL - instead it would crash in osmo_use_count_find() where it is dereferenced. Add a check for uc and return -EINVAL if it is NULL. Change-Id: I792563696860a3100e95cafdd5fe57511819ef56 Related: SYS#5895
2022-08-17Revert "Add function to guess AF_UNSPEC address"neels1-34/+2
This reverts commit a4063efa7deb6632c228037c47effca22ad0f781. Reason for revert: It is not possible to guess the IP address family from uninitialized memory. This function simply glorifies random noise into an IPv6 address. It makes no sense to have it. Change-Id: Ifadd614604cf9d0c2ed1a405493c1c3fcb37ae23
2022-08-17Revert "Add osmo_sockaddr_strs_to_str()"neels1-43/+0
This reverts commit e145e28a91eeca65d34d7b82caa2190fa89492b4. Reason for revert: The function osmo_sockaddr_strs_to_str() should not be part of the osmo_sockaddr_str API. The implementation of this should live in the function multiaddr_snprintf() added in patch Icef53fe4b6e51563d97a1bc48001d67679b3b6e9 and should not use dynamic allocation. Change-Id: I263dfd68313b896c5b474025fbca13c22ce41cdc
2022-08-14Add osmo_sockaddr_strs_to_str()Max1-0/+43
This will come in handy for working with multihomes sockets like SCTP. Related: OS#5581 Change-Id: Ic0d7c08f669994e37a2314555ecac85d28c42c89
2022-08-09gsm: bts_features: Add missing entries to osmo_bts_features_namesPau Espin Pedrol1-0/+2
Those features were present in osmo_bts_features_descs but not in osmo_bts_features_names. Change-Id: Ic8162e7ab6b657de694e3825e694e9b18c540271
2022-08-09Add function to guess AF_UNSPEC addressMax1-2/+34
Sometimes we receive generic "struct sockaddr" with unspecified (AF_UNSPEC) address family. It's handy to try to guess the proper address (there're just 2 variants ATM in most practical applications). Use the added function to relax input checks in osmo_sockaddr_str_from_in*() Related: OS#5581 Change-Id: I1c90c56ce832f53b65e0d18d3cea94621c02a69a
2022-08-09gsm: rsl: Define new osmocom extension TLV IE to pass Osmux CIDPau Espin Pedrol1-0/+1
This is similar to what we already do between BSC<->MSC to pass Osmux CID (GSM0808_IE_OSMO_OSMUX_CID). We now want to support Osmux between BSC and Osmocom BTS, hence add an extension IE which will be used in ipaccess CRCX messages to tell the BTS to use Osmux. Change-Id: I580fe99c01bc0a844d877994ec6cd954310e265d
2022-08-09gsm: Add BTS feature for OsmuxPau Espin Pedrol1-0/+1
This feature is used by the BTS to signal to the BSC that it supports using Osmux instead of RTP on the BTS<->BSC(MGW) data plane. Related: SYS#5987 Change-Id: Ie79bfb6d0a7a8fe2842d2596b3244e7b74a0d5b6
2022-08-06gprs_ns2: add vty `nse <0-65535> restart sns`Alexander Couzens1-0/+26
Allow to restart SNS procedure and initiate a SNS-SIZE procedure with Reset. SGSN side SNS restart will stop answer on ALIVE and is sending NS STATUS invalid protocol state. BSS side SNS restart will send a SNS Size procedure to reset the state. Change-Id: Icb55d8449908d348ab10572eebcf971737fba00d
2022-08-06cbsp: Fix decoding of Fail ListPau Espin Pedrol1-2/+2
The decoding pointer was not increased correctly, ending up in reading by 1 byte offset for each item in the list. Change-Id: I16ed9bd65109a7ce32ff43c5789b4544479838e7
2022-08-06cbsp: Guard against malformed msgb without l1h,l2h being passedPau Espin Pedrol1-0/+1
Change-Id: Ie8854c780cfd96e67df10c1fc38c6b99ec07422f
2022-08-06cbsp: Return error if decoding any of the cell id lists failPau Espin Pedrol1-67/+152
Change-Id: I5934167f927df0547cb57687e2717489fd1f3719
2022-08-05gsm0808_enc_aoip_trasp_addr: add length checkOliver Smith1-8/+17
Instead of running into OSMO_ASSERT in msgb_put(), return early if the msgb is too small. As suggested by Pau in [1]. I would have returned -EMSGSIZE, but the function returns uint8_t. [1]: https://gerrit.osmocom.org/c/osmo-bsc-nat/+/28582/2#message-a183c463ea20a8d958465ce45a83e62c46214cf6 Change-Id: I632986b99d841abff0f14c6da65f030175f5c4a1
2022-08-05{gb,sim,usb}: ensure -no-undefined is present in *_la_LDFLAGSVadim Yanitskiy3-3/+13
Make sure that there is no undefined references in shared libraries. Inspired by GitHub PR#6 [1] by Michael Dickens. Tweaked by me. Change-Id: I7ddd6c75935b0f25d78a948f1577656d77a204e3 Related: [1] https://github.com/osmocom/libosmocore/pull/6
2022-08-04logging: add a new category DLCSN1 for libosmo-csn1Vadim Yanitskiy1-0/+6
This new category is going to be used by CSN.1 codec in libosmo-csn1. Change-Id: Ie8c0effb764547a0f9cc8c6825e11a6617501e95
2022-07-29fsm: osmo_fsm_{event,inst,state}_name(): make *fi pointer constVadim Yanitskiy1-3/+3
Change-Id: I98cde213deb5a3bf39eb9f5e5451f40223632844
2022-07-22gb/gprs_ns: call osmo_timer_del() unconditionallyVadim Yanitskiy1-4/+2
osmo_timer_del() does check if a timer is active internally. Change-Id: I3fdfcde33bc6f8a88680ad3f1dde2b6ff8846020
2022-07-20sim/class_tables: Add GET IDENTITY, SUSPEND UICC, EXCHANGE CAPABILITIESHarald Welte1-1/+4
This brings the tables up-to-date with Release 16 of both ETSI 102 221 + 3GPP TS 31.102 specifications. Change-Id: I7100f326f45f1f8742363eace0531a4ef3f049c0
2022-07-19fsm: fix state_chg(): pass microseconds to osmo_timer_schedule()Vadim Yanitskiy1-2/+5
As was demonstrated in [1], osmo_fsm_inst_state_chg_ms() is broken. The problem is in state_chg(): this function is passing *milli*seconds to osmo_timer_schedule(), while it expects *micro*seconds. Change-Id: Ib0b6c3bdb56e4279df9e5ba7db16841645c452aa Related: [1] I5a35730a8448292b075aefafed897353678250f9 Fixes: I35b330e460e80bb67376c77e997e464439ac5397 Fixes: OS#5622
2022-07-04gb: fix uninitialized ptr access in bssgp_encode_rim_pdu()Vadim Yanitskiy1-4/+4
Jumping to label 'error' before allocating memory and storing an address to pointer 'rim_cont_buf' would result in passing garbage to talloc_free(). Found with clang 14. Change-Id: I9420615b64d3755fd9131e8561c516c39f83a15b
2022-07-03gsm48_ie: fix parsing of Bearer capability IE without octet 3aMychaela Falconia1-0/+17
The testcase in gsm0408_test is still failing because the encoder produces a different result (with octet 3a present). There is no way to tell the encoder to use the implicit coding, and in general this is not that critical, so we can live with that. Change-Id: I722c168f01bffa915cb155eac234a796549d3762
2022-07-03gsm48_ie: fix coding style: while is not a functionVadim Yanitskiy1-3/+3
Change-Id: Id28bf61c5e1dfb6da1c89a5502eb869b67fed6c6
2022-07-01cbsp: avoid potential msgb write overflow in osmo_cbsp_recv_bufferedPau Espin Pedrol1-0/+4
>>> CID 273001: Insecure data handling (TAINTED_SCALAR) >>> Passing tainted expression "needed" to "recv", which uses it as an offset. 1444 rc = recv(fd, msg->tail, needed, 0); Fixes: Coverity CID#273001 Change-Id: I17c558254f9c7907b56d61c53c2f597e8e4566cf
2022-06-29iuup: Explicitly mark default case as unexpected with assertPau Espin Pedrol1-0/+2
That code path should not happen since this function is only called for data frames coming with IUUP_FSM_EVT_IUUP_DATA_IND. Control frames should come with specific events like IUUP_FSM_EVT_IUUP_CONFIG_REQ. Hence, let's add an assert to make sure we early exit if that ever happens (it shouldn't), instead of carrying on reading uninitialized var "dt". Fixes: Coverity CID#272996 Change-Id: Iaeba59bc9ebfe817dbb7528572dc669c010ef14d