summaryrefslogtreecommitdiffstats
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* stats: Use a global index for stat item valuesJacob Erlbeck2015-10-281-24/+47
| | | | | | | | | | | | | | | Currently each stat item has a separate index value which basically counts each single value added to the item and which can be used by a reporter to get all new values that have not been reported yet. The drawback is, that such an index must be stored for each stat item. This commit introduces a global index which is incremented for each new stat item value. This index is then stored together with the item value. So a single stored index per reporter is sufficient to make sure that only new values are reported. Sponsored-by: On-Waves ehf
* ns: Add statistics for some eventsJacob Erlbeck2015-10-282-1/+39
| | | | | | | | | | | | The following counters are added to the ns.nsvc counter group: lost.alive The number of missing ALIVE ACK messages lost.reset The number of missing RESET ACK messages The following items are added to the ns.nsvc stat item group: alive.delay The time in ms between sending ALIVE and receiving the next ALIVE ACK Sponsored-by: On-Waves ehf
* stats: Add vty_out_stat_item_groupJacob Erlbeck2015-10-281-0/+22
| | | | | | This functions dumps a whole stat item group to the VTY. Sponsored-by: On-Waves ehf
* stats: Add stat_item for value monitoringJacob Erlbeck2015-10-282-1/+216
| | | | | | | | | | | | | | This commit adds instrumentation function to gather measurement and statistical values similar to counter groups. Multiple values can be stored per item, which can be retrieved in FIFO order. Getting values from the item does not modify its state to allow for multiple independant backends (e.g. VTY and statd). When a new value is set, the oldest value gets silently overwritten. Lost values are skipped when getting values from the item. Sponsored-by: On-Waves ehf
* utils: add 'returns' doc to osmo_hexparse().Neels Hofmeyr2015-09-231-0/+1
|
* build: have a disable-static build succeedJan Engelhardt2015-09-161-2/+6
| | | | | | | | | | | | | When using configure --disable-static, no libosmogsm.a will be created, and the tests fail to link because symbols like _a5_3 and _a5_4 are not exported through the only remaining libosmogsm.so. A method to overcome this is an intermediate private non-distributed library, examples of which are present in e.g. libabc, kmod and systemd. With this, disable-static can now be the default and practical compile time be halved.
* Prepare new upstream releaseHolger Hans Peter Freyther2015-08-231-1/+1
|
* Introduce gsm48_mi_type_name() functionHarald Welte2015-08-182-0/+15
|
* Add G-RNTI derived TLLI types defined in 23.003Harald Welte2015-08-181-1/+5
|
* vty: Change API to have node installation be done by intHolger Hans Peter Freyther2015-08-051-4/+4
| | | | | | | | | | | | | | | | We are mixing enums and hope that no short-enums are used. This is leading to a lot compiler warnings generated by clang. Change the API to work with integers. Porting: The go_parent_cb implementations in the applications need to be fixed. The API change leads to a compile time warning. Fixes: abis_om2000_vty.c:46:2: warning: implicit conversion from enumeration type 'enum bsc_vty_node' to different enumeration type 'enum node_type' [-Wenum-conversion] OM2K_NODE, ^~~~~~~~~
* release: Prepare the 0.8.2 releaseHolger Hans Peter Freyther2015-08-011-1/+1
| | | | | I have kind of used 0.8.1 by accident already so let us move to 0.8.2 now.
* bssgp: Fix IMSI buffer size (Coverity)Jacob Erlbeck2015-06-191-2/+4
| | | | | | | | | | | | | Currently the size of the IMSI pointer is used instead of the size of the talloc'ed buffer. This commit changes the call to gsm48_mi_to_string to use the same value that has been used with talloc_zero_size(). The length is changed to 17 since that value is used for GSM_IMSI_LENGTH in openbsc. Fixes: Coverity CID 1040663 Sponsored-by: On-Waves ehf
* ipa: Add libosmogsm.map entry for ipa_ccm_idtag_parse_offJacob Erlbeck2015-06-041-0/+1
| | | | | | | | | Addresses: CCLD utils/utils_test utils_test.o: In function `test_idtag_parsing': git/libosmocore/tests/utils/utils_test.c:64: undefined reference to `ipa_ccm_idtag_parse_off' Sponsored-by: On-Waves ehf
* ipa: Properly parse LV stream of a ID_GET requestHolger Hans Peter Freyther2015-06-021-3/+13
| | | | | | | | For some reason the structure is closer to be a LV (length and value). The value is actually a tag but it is counted inside the length. Introduce an overload of the parse function to provide an offset for the length. This will be taken from the returned length.
* Add APN utility function to libosmogsmHarald Welte2015-05-253-1/+42
| | | | | | The current functions are used to 'qualify' an APN from the user-supplied APN name (name identifier) towards the fully-qualified APN name which is used in the .grps DNS zone.
* build: Fix out-of-tree buildsAndreas Rottmann2015-05-171-1/+1
| | | | | | | | | | | | | | Fixes: In file included from ../../../include/osmocom/core/msgb.h:25:0, from ../../../include/osmocom/sim/sim.h:4, from ../../../src/sim/reader_pcsc.c:30: ../../../include/osmocom/core/bits.h:6:35: fatal error: osmocom/core/bit16gen.h: No such file or directory #include <osmocom/core/bit16gen.h> In file included from ../../include/osmocom/core/msgb.h:25:0, from ../../utils/osmo-sim-test.c:26: ../../include/osmocom/core/bits.h:6:35: fatal error: osmocom/core/bit16gen.h: No such file or directory #include <osmocom/core/bit16gen.h>
* bssgp: Fix bssgp_tx_fc_bvc parameter typeJacob Erlbeck2015-05-061-1/+1
| | | | | | | | | | | | Currently large values for Bmax default MS get sliced since a uint16_t is used as the type of the corresponding parameter of bssgp_tx_fc_bvc. GSM 48.018, 11.3.2 which in turn refers to 11.3.5 specifies a maximum of 6MB (0xffff * 100). This commit changes the type to uint32_t to cover the full value range. Sponsored-by: On-Waves ehf
* bssgp: Fix call to llist_entry in fc_queue_timer_cfgJacob Erlbeck2015-04-301-1/+1
| | | | | | | | | | | | | Currently the DL sometimes hangs and sometimes a lot of messages (still not able to send PDU) are logged. This is caused by an invalid timer delay computation, setting msecs either to 0 or to some big value. This is due to an '&' operator at the wrong place, accessing some parts in fc instead of the first element of the list. This commit fixes that issue. Sponsored-by: On-Waves ehf
* bssgp: Fix encoding of BVC_FLOW_CONTROLJacob Erlbeck2015-04-291-5/+5
| | | | | | | | | Currently all 2 byte IE of the message are transmitted in the little endian byte ordering. This commit adds htons to the encoding expressions. Sponsored-by: On-Waves ehf
* bssgp: Fix output of the VTY 'show bssgp stats' commandJacob Erlbeck2015-04-291-2/+3
| | | | | | | | The output is terminated by a '\n' instead of VTY_NEWLINE. This is fixed by the commit. Sponsored-by: On-Waves ehf
* sim: Use extern for these structs to generate a linkageHolger Hans Peter Freyther2015-04-111-1/+1
| | | | | | | | | | Fixes: duplicate symbol _ts102221_fcp_vals in: .libs/core.o .libs/card_fs_usim.o duplicate symbol _pcsc_reader_ops in: .libs/reader.o .libs/card_fs_usim.o
* macaddr: Use the BSD code for Darwin as wellHolger Hans Peter Freyther2015-04-111-1/+1
| | | | It simply compiles, no other testing has been done.
* utils: Disable the weak symbol for darwinHolger Hans Peter Freyther2015-04-111-1/+5
| | | | | | | | We should consider simply removing the alias as we have had several ABI changes since introducint the alias utils.c:223:23: error: only weak aliases are supported on darwin __attribute__((weak, alias("osmo_hexdump_nospc")));
* gprs: Add assertion for msg != NULL to bssgp_msgb_alloc (Coverity)Jacob Erlbeck2015-04-101-0/+4
| | | | | | | | | | | | | Currently out-of-memory is not handled by bssgp_msgb_alloc, leading to SEGV failures if msgb_alloc_headroom returns NULL. This commit adds an OSMO_ASSERT to catch this case, which improves the situation only slightly. But bssgp_msgb_alloc is used in many places without checking the return value, so just adding a conditional early NULL return would not fix the issue either. Fixes: Coverity CID 1293377 Sponsored-by: On-Waves ehf
* msgb: Check the return value of msgb_alloc (Coverity)Jacob Erlbeck2015-04-102-0/+6
| | | | | | | | | | | In some places, the return value of msgb_alloc/msgb_alloc_headroom is not checked before it is dereferenced. This commit adds NULL checks to return with -ENOMEM from the calling functions if the alloc function has failed. Fixes: Coverity CID 1249692, 1293376 Sponsored-by: On-Waves ehf
* ns: Log when sending fails (Coverity)Jacob Erlbeck2015-04-072-0/+20
| | | | | | | | | | | | | | | | Currently the return value of the gprs_ns_tx family of functions is often ignored. This is not a serious issue, since the successful delivery of the messages is neither guaranteed nor acknowledged by the network layer anyway. Nevertheless this commit adds logging (level INFO) to gprs_ns_tx and gprs_ns_msgb_alloc. The definition of the latter has been moved from the header file to gprs_ns.c. Fixes: Coverity CID 1040678, 1040679, 1040680, 1040681, 1040682, 1040683, 1040684, 1040686, 1040687, 1040688, 1111545, 1240203, 1240204 Sponsored-by: On-Waves ehf
* bssgp: Ensure non-NULL bctx before calling bssgp_rx_ptp (Coverity)Jacob Erlbeck2015-04-071-1/+6
| | | | | | | | | | | | | | Currently bssgp_rx_ptp might be called with bctx being NULL, when the NS BVCI is neither BVCI_SIGNALLING nor BVCI_PTM, but the message is a BVC_RESET or it contains an BVCI IE != BVCI_SIGNALLING where the BVCI is not known. This patch ensures that bssgp_rx_ptp will only be called with a non-NULL bctx. A log message will be issued, if the bctx is NULL when this was not expected. Fixes: Coverity CID 1040674 Sponsored-by: On-Waves ehf
* bssgp: Always expect dup != NULL in bssgp_tx_dl_ud (Coverity)Jacob Erlbeck2015-04-071-25/+24
| | | | | | | | | | | | | | Currently the implementation of bssgp_tx_dl_ud conditionally adds some optional IE if dup != NULL. Later on is dereferences dup to access qos_profile and fc, but this without checking dup in advance. This may lead to an segmentation violation fault. This commit changes the value range of the function to only accept dup != NULL. An assertion will fail otherwise. All other explicit checks for non-NULL are removed. Fixes: Coverity CID 1040673 Sponsored-by: On-Waves ehf
* ctrl: Avoid accessing cmd_desc->command out of boundsHolger Hans Peter Freyther2015-04-051-1/+1
| | | | | | | | We check that the amount of commands is not more than we have but we don't check it the other way. It appears that the vector is allowed to be bigger than the amount of commands. So we match a prefix of a longer command depending on the installation order.
* gsm: Add A5/3-4 cipher supportMax2015-03-281-3/+68
| | | | | Signed-off-by: Max <max.suraev@fairwaves.co> Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
* vty: Fix writing the logging of categoryMichael McTernan2015-03-201-1/+1
| | | | | Fix copy and paste issue introduced by Holger in 2d6ad13d8daf860595e6d4025861e122ce574871.
* libctrl: Include config.h so we can include netinet/tcp.hHolger Hans Peter Freyther2015-03-181-0/+2
| | | | | | | | | | In e15ac060e7ae78d4c3569d7fc9071bcf49807e05 we tried to fix the nuttx build but we never included "netinet/tcp.h" after it and the compiler warned about the unused "on" parameter which we didn't notice because of the other warnings... Include config.h so we can see if there is a tcp.h and then include it.
* msgfile: Fix warning on BSDs stdioHolger Hans Peter Freyther2015-03-181-0/+2
| | | | | | msgfile.c:116:16: warning: implicit declaration of function 'getline' is invalid in C99 [-Wimplicit-function-declaration] while (getline(&line, &n, file) != -1) {
* gsm0808: Remove duplicate initializationHolger Hans Peter Freyther2015-03-181-1/+0
| | | | | | | | | | | | | | | These types were compatible so simply remove one. Fixes: gsm0808.c:323:37: warning: initializer overrides prior initialization CC gsm0480.lo of this subobject CC abis_nm.lo [-Winitializer-overrides] [GSM0808_IE_LSA_INFORMATION] = { TLV_TYPE_TLV }, ^~~~~~~~~~~~ gsm0808.c:316:36: note: previous initialization is here [GSM0808_IE_LSA_INFORMATION] = { TLV_TYPE_TLV }, ^~~~~~~~~~~~
* bssgp: Handle BSSGP STATUS messagesJacob Erlbeck2015-03-181-16/+62
| | | | | | | | | | | | | | | | | | | Currently incoming BSSGP STATUS messages are just logged and no other action is taken. This makes it impossible for higher layers to react to failures which are indicated by corresponding STATUS messages unless a timeout is triggered as a result of that failure later on. This commit adds a bssgp_rx_status() function and calls it on incoming STATUS messages. That function logs a message, increments the new BSSGP_CTR_STATUS counter if the bctx context exists and invokes an NM_STATUS status indication. The latter will allow the application to handle failures immediately. Since all STATUS messages should be handled, the function is already called in bssgp_rcvmsg and the message is no longer handled in (and will not reach) bssgp_rx_sign and bssgp_rx_ptp. Ticket: OW#1414 Sponsored-by: On-Waves ehf
* bssgp: Don't reply with STATUS when receiving a PtP STATUS messageJacob Erlbeck2015-03-181-0/+2
| | | | | | | | | | | | | Currently each incoming PtP BSSGP STATUS message is handled as 'not yet implemented' and a BSSGP STATUS message (cause BSSGP_CAUSE_PROTO_ERR_UNSPEC) is sent back to the peer. This will cause endless messages loops if both peers use this BSSGP stack implementation. This does not apply to signalling messages. This commit changes the implementation of bssgp_rx_ptp() to just do logging in this case. Sponsored-by: On-Waves ehf
* logging: Implement subsecond resolution of extended timestampsJacob Erlbeck2015-03-181-4/+7
| | | | | | | | | | | | | Currently when using 'logging print extended-timestamp 1', the subsecond part (milliseconds) of the printed timestamp is always 0. This makes it difficult to correlate log entries with PCAP file entries if there are many of them per second. This patch changes _output in logging.c to use gettimeofday() instead of time() when extended timestamps are enabled and replaces the '000' by the milliseconds computed from tv_usec. Sponsored-by: On-Waves ehf
* vty: Fix typo in the state creationHolger Hans Peter Freyther2015-01-271-1/+1
| | | | | This got introduced in 2d6ad13d8daf860595e6d4025861e122ce574871 and I thought that our vty tests would have caught such mistakes.
* Prepare a new libosmocore releaseHolger Hans Peter Freyther2015-01-182-2/+2
|
* ctrl: Link to libraries we use symbols fromHolger Hans Peter Freyther2015-01-181-1/+4
| | | | | | | | | | | | | | Fixes: dpkg-shlibdeps: warning: symbol vector_free used by debian/libosmoctrl0/usr/lib/libosmoctrl.so.0.0.0 found in none of the libraries dpkg-shlibdeps: warning: symbol vector_set used by debian/libosmoctrl0/usr/lib/libosmoctrl.so.0.0.0 found in none of the libraries dpkg-shlibdeps: warning: symbol vector_set_index used by debian/libosmoctrl0/usr/lib/libosmoctrl.so.0.0.0 found in none of the libraries dpkg-shlibdeps: warning: symbol tall_vty_vec_ctx used by debian/libosmoctrl0/usr/lib/libosmoctrl.so.0.0.0 found in none of the libraries dpkg-shlibdeps: warning: symbol ipa_msg_recv_buffered used by debian/libosmoctrl0/usr/lib/libosmoctrl.so.0.0.0 found in none of the libraries dpkg-shlibdeps: warning: symbol cmd_free_strvec used by debian/libosmoctrl0/usr/lib/libosmoctrl.so.0.0.0 found in none of the libraries dpkg-shlibdeps: warning: symbol vector_lookup used by debian/libosmoctrl0/usr/lib/libosmoctrl.so.0.0.0 found in none of the libraries dpkg-shlibdeps: warning: symbol vector_lookup_ensure used by debian/libosmoctrl0/usr/lib/libosmoctrl.so.0.0.0 found in none of the libraries dpkg-shlibdeps: warning: symbol cmd_make_strvec used by debian/libosmoctrl0/usr/lib/libosmoctrl.so.0.0.0 found in none of the libraries dpkg-shlibdeps: warning: symbol vector_init used by debian/libosmoctrl0/usr/lib/libosmoctrl.so.0.0.0 found in none of the libraries
* sim: Link to libosmocore and libosmogsmHolger Hans Peter Freyther2015-01-181-2/+5
| | | | | | | | | | | | | | | | | The big LIBOSMOCORE_CFLAGS and LIBOSMOCORE_LIBS macros are not defined when building linosmocore. Use the .la files directly Fixes: dpkg-shlibdeps: warning: symbol osmo_hexdump used by debian/libosmosim0/usr/lib/libosmosim.so.0.0.0 found in none of the libraries dpkg-shlibdeps: warning: symbol gsm48_parse_ra used by debian/libosmosim0/usr/lib/libosmosim.so.0.0.0 found in none of the libraries dpkg-shlibdeps: warning: symbol _talloc_zero used by debian/libosmosim0/usr/lib/libosmosim.so.0.0.0 found in none of the libraries dpkg-shlibdeps: warning: symbol _talloc_memdup used by debian/libosmosim0/usr/lib/libosmosim.so.0.0.0 found in none of the libraries dpkg-shlibdeps: warning: symbol talloc_strndup used by debian/libosmosim0/usr/lib/libosmosim.so.0.0.0 found in none of the libraries dpkg-shlibdeps: warning: symbol msgb_length used by debian/libosmosim0/usr/lib/libosmosim.so.0.0.0 found in none of the libraries dpkg-shlibdeps: warning: symbol msgb_alloc used by debian/libosmosim0/usr/lib/libosmosim.so.0.0.0 found in none of the libraries dpkg-shlibdeps: warning: symbol msgb_free used by debian/libosmosim0/usr/lib/libosmosim.so.0.0.0 found in none of the libraries dpkg-shlibdeps: warning: symbol talloc_strdup used by debian/libosmosim0/usr/lib/libosmosim.so.0.0.0 found in none of the libraries dpkg-shlibdeps: warning: symbol talloc_free used by debian/libosmosim0/usr/lib/libosmosim.so.0.0.0 found in none of the libraries
* Supplementary Services (de)activation, interrogation addedTobias Engel2015-01-012-25/+102
| | | | | | | | | | | | | These patches enhance the Supplementary Service (SS) processing from only being able to handle USSD to other SS, specifically activation, deactivation and interrogation of those SS. Registration is not yet implemented. include/osmocom/gsm/protocol/gsm_09_02.h has been added with needed values for SS. Modified by Harald Welte to keep the old ussd-only functiosn for API/ABI stability.
* fixupHarald Welte2014-12-301-0/+4
|
* add gsm0341_test to generate SMSCB hex stringsHarald Welte2014-12-293-1/+59
| | | | Those hex strings can then be copy+pasted into the OSmoNITB VTY
* log: "logging level everything" is a badly named option.Holger Hans Peter Freyther2014-12-281-1/+1
| | | | | | | | | | We tried to fix it but it isn't that easy. The original fix was cd6ed82d1ff48f47ad9e33e6322df62896a76ed5 but we had to revert it as "everything" is present/used in existing config files. If we ever change the ABI we can make everything be something that is > 0. For now use a wording that makes it obvious that people should not use "everything".
* libosmo-gsm: Add PCHAN/LCHAN types for CBCHHarald Welte2014-12-281-0/+2
|
* ipa: Return -errno instead of -1 in ipa_sendJacob Erlbeck2014-12-221-1/+1
| | | | | | | | | | | | | Currently, the ipa_send function returns -1 in one execution branch to indicate an error and -EIO in another. This is not consistent and can lead to a misinterpretation of the error code, since -1 is -EPERM and in general, EPERM is not returned by write(2). This patch changes the return code to -errno instead of -1 for the case that write(2) fails for same reason. So -rc is always a sensible error value if there is a failure. Sponsored-by: On-Waves ehf
* logging: Call color only once and use the resultHolger Hans Peter Freyther2014-12-051-1/+1
| | | | | | First we check if a color is defined and then we call it again and use the result. Avoid the second call and use the result of the previous call.
* logging: Make it possible to print category/subsys and timestampsHolger Hans Peter Freyther2014-12-052-4/+95
| | | | | | | | | | | | We want to see from which category/subsystem a certain log message is coming from and use a different timestamp format as well. Add two new bitfields. This doesn't change the size of the structure and on 32bit we still have 27bits left. The extended timestamp will take preference over the current and default timestamp format. Fixes: SYS#602
* gtp: Add a global region for the gtp library of OpenGGSNHolger Hans Peter Freyther2014-12-041-0/+5
| | | | | We want to use libosmocore/libosmovty in the GGSN sourcecode and reserve a global region here.