aboutsummaryrefslogtreecommitdiffstats
path: root/include/osmocom
AgeCommit message (Collapse)AuthorFilesLines
2015-07-03Add mnc_t for 3 digit mncs.mmcternan/bb_maintMichael McTernan2-4/+29
Signed-off-by: Michael McTernan <mike.mcternan@wavemobile.com>
2014-03-26src/socket: Adding unix domain socket supportÁlvaro Neira Ayuso1-0/+6
Added some function for adding the unix domain socket support. Signed-off-by: Alvaro Neira Ayuso <anayuso@sysmocom.de>
2014-03-26gsm/lapdm: Prevent LAPD tx_queue from filling up in polling modeDaniel Willmann1-0/+1
If LAPDm receives an I-Frame while there already is an I-Frame in the tx_queue the code generates an additional RR (to acknowledge the received I-Frame). Instead, N(R) of the I-Frame in the tx_queue should be updated to ACK the data.
2014-03-26lapdm: Make lapdm_datalink_for_sapi publicDaniel Willmann1-0/+2
This API allows you to get the lapdm_datalink for a SAPI. It's needed in the lapdm_test, so make it public.
2014-03-12sms: Fix typo in a macros name: GSM340_SMS_RESSERVED -> GSM340_SMS_RESERVED.Alexander Chemeris1-1/+1
2014-03-10ladpm: Fix msgb handling and SAPI=3 establishment delayJacob Erlbeck1-0/+15
Currently it takes 3s to establish a SAPI 3 SACCH connection with osmo-bts. This is due to the fact, that a broken SABME request is sent first and and is ignored by the MS. Then, after a T200 timeout (2s) the SABME command is sent again (this time correctly) and answered by the MS. The first SABME message is broken (it has a length field of 3 and ends with 3 bytes from the tail of the original RSL message), because of it is expected throughout lapdm.c that msg buffers containing RSL have msg->l2h == msg->data. Some abis input drivers fulfill this but IPA doesn't, thus the 3 bytes of the IPA header are still part of the msg and confuse length computation. Since internal fields of the msg are modified directly, this is difficult to see. This patch adds a new function msgb_pull_to_l3() that explicitely skips over all headers prepending L3 and therefore resets l1h and l2h. This function is then used instead of msgb_pull_l2h() which only worked correctly when msg->l2h == msg->data. In addition, code manipulating msg->tail and msg->len directly has been replaced by calls to msgb_trim(). Note that this patch does not fix all issues of this case in the LADP related code. Ticket: SYS#192 Sponsored-by: On-Waves ehf
2014-03-04msgb: Add msgb_hexdump() functionJacob Erlbeck1-0/+1
This function works like osmo_hexdump() and returns a static buffer containing hex bytes along with markers for the layers. Note that it uses osmo_hexdump() internally, thus a call to msgb_hexdump() invalidates the buffer that has been returned by an earlier call to osmo_hexdump(). In short: don't mix them in a single call printf(). Sponsored-by: On-Waves ehf
2014-01-09sms: Fix gsm_7bit legacy functions return valueJacob Erlbeck1-0/+3
The legacy 7bit conversion functions (those without the '_n_' in the name) gave wrong return values on 64 bit platforms due to unproper signed/unsigned conversions and the usage of SIZE_MAX. This patch fixes this by using a smaller max size (see GSM_7BIT_LEGACY_MAX_BUFFER_SIZE, currently set to 64k) for the legacy wrappers and by using unsigned int for max_septets. In addition, there are tests now that check the return values of legacy encoding and decoding. Sponsored-by: On-Waves ehf
2014-01-02abis: Use the right return value for abis_nm_pchan4chcombHolger Hans Peter Freyther1-1/+1
abis_nm_pchan4chcomb will return a pchan for a given channel combination but returned a value of the channel combination. Fix it to return the physical channel combination. Fixes: Coverity CID 1040767
2013-12-07Refactor COMP128v23 implementation and add test suitMax1-2/+2
2013-11-03implement COMP128 version 2 and 3 A3/A8 algorithmKevin Redon1-0/+23
simple copy into C from reversed code from www.hackingprojects.net
2013-10-24gb: Fix NS RESET/RESET_ACK abnormal casesJacob Erlbeck1-0/+5
This changes the implementations for the reception of RESET and RESET_ACK to be compatible with 3GPP TS 08.16, 7.3.1: - Just send a RESET_ACK with correct values back to the SGSN when a RESET with an invalid NSVCI or NSEI has been received. - Check RESET_ACK for matching NSEI and NSVCI. - Ignore unexpected RESET_ACKs. In addition, use RESET_ACK from a BSS to update the BSS source address based on the NSVCI to be tolerant with changing UDP source addresses/ports. Sponsored-by: On-Waves ehf
2013-10-15gb: Fix gprs_ns_rx_reset to not create NS-VC duplicatesJacob Erlbeck1-0/+3
Under special circumstances (see below) receiving a NS-RESET leads to duplicated NS-VC entries. This happens when the source port of a NS-VC changes to a new one that has already been used by another NS-VC. This patch changes gprs_ns_rx_reset() to check for this case and to use the existing NS-VC object. The NS-VC object that was associated with the source address before is detached from this source but kept in the NS-VC list so that it can be reattached when a correspondent NS-RESET is received later on. Meanwhile it will have a cleared link layer address which will not match a real link info. A new counter NS_CTR_REPLACED is incremented each time when the NS-VC object is replacing another one. A new signal S_NS_REPLACED is added which gets dispatched in this case, too. Another new counter NS_CTR_NSEI_CHG is incremented each time when the NSEI of a NS-VC object (with fixed NSVCI) changes. Ticket: OW#874 Sponsored-by: On-Waves ehf
2013-10-15gb: Add functions to access the LL part of the NS-VC objectsJacob Erlbeck1-1/+7
Adds the functions gprs_ns_ll_copy() and gprs_ns_ll_clear(). Renames gprs_ns_format_peer() to gprs_ns_ll_str(). All of these functions uniformly access the link layer part within the NS-VC objects. Sponsored-by: On-Waves ehf
2013-10-11tests/gb: Show invoked signals in test outputJacob Erlbeck1-0/+3
Register an osmo signal handler to print a short notice about every SS_L_NS signal that is generated while processing the tests. Sponsored-by: On-Waves ehf
2013-10-10vty: Make vty_event dispatch signals and use it in the testcaseHolger Hans Peter Freyther2-0/+15
The testcase didn't work on Ubuntu 12.04 because vty_create will directly call vty_event (e.g. not through the plt). This means that the approach to override vty_event in the testcase failed. Use the signal interface of libosmocore and make the testcase use it. The signals can be generally useful as well.
2013-10-08gb: Separate nsvc creation from NS message processingJacob Erlbeck1-0/+9
This patch refactors gprs_ns_rcvmsg() by moving the parts relevant to the NS messages into the new functions gprs_ns_vc_create() (nsvc object creation) and gprs_ns_process_msg() (main NS automaton). These do not contain code that directly depends on the link layer (they call other functions that still do). This reduces the gprs_ns_rcvmsg() function to calling these two functions and optionally setting up the link layer specific fields of the nsvc. Sponsored-by: On-Waves ehf
2013-10-08msgb: Add may_alias attribute to struct libgb_msgb_cbJacob Erlbeck1-1/+1
This explicitely allows aliasing of this struct to avoid the warning shown below. Note, that this warning isn't show when '-fno-strict-aliasing' is used. Addresses: gb/gprs_ns_test.c:85:54: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
2013-09-16gsm48: Added 'Network Daylight Saving Time' info elementJacob Erlbeck1-0/+1
This information element has been added to the MM Information message in GSM24.008. This patch adds it to the tlv_definition to keep the TLV parser from breaking. Ticket: OW#978
2013-09-08vty: Add vty_install_default() and use for the vty nodesJacob Erlbeck1-0/+5
This adds the vty_install_default() function that is basically the install_default() function plus the registration of the commands 'exit' and 'end'. The latter is only provided in subnodes of ENABLED_NODE and CONFIG_NONE. The VTY test program is extended to check these commands. Ticket: OW#952
2013-09-04misc: Include time.h for time_t on FreeBSDHolger Hans Peter Freyther1-0/+2
Fix the build after I changed the order of header files in the SMS test.
2013-09-04sms: Implement encoding the address as alphanumeric typeHolger Hans Peter Freyther1-0/+32
The number of digits is the number of used octets times two (two digits per octet). The result has been successfully dissected by wireshark. It has not been tested with real phones.
2013-08-15core: Remove defined() check for OSMO_DEPRECATEJacob Erlbeck1-11/+5
This reverts commit bf991bc0f3006eddf45d494ee7e476a75dbaf36e and fixes the bug instead. It's just sufficient to remove the defined() test, since identifiers that aren't macros are just considered as 0 when used with #if. (see cpp info page, section 4.2.2 'If' in cpp-4.6.info)
2013-08-14core: Fix-up the OSMO_DEPRECATED for older compilersHolger Hans Peter Freyther1-3/+9
The code started to use #if defined(...) but the value was always for GCC/Clang. The only difference was that for older compilers the value of the definition was 0. Conditionally define these macros.
2013-08-14core: Support clang with OSME_DEPRECATEDJacob Erlbeck1-4/+15
Separate feature checking from implementation. Supported are clang and gcc.
2013-08-14core: Move OSMO_DEPRECATED to new core/defs.h fileJacob Erlbeck2-13/+40
Add a new core/defs.h file for definitions that can be used from within header files without including prototypes and extern declarations. It's primarily meant for macro definitions and basic typedefs. Move the definition of OSMO_DEPRECATED there and use compiler version info to avoid compiler errors.
2013-08-12sms: Disable deprecated messageJacob Erlbeck1-6/+20
This is a workaround to make the FreeBSD8.4 and Debian6.0 target build again. The deprecated attribute doesn't have arguments.
2013-08-12sms: Added result buffer size parameter to 7bit conv funsJacob Erlbeck1-7/+52
The 7bit<->8bit encoding/decoding functions didn't check whether there is still enough space in the destination buffer. Therefore a buffer size parameter has been added to each of the functions which is used to truncate the output if the buffer is too small. In addition, the return value of the decoding functions has been changed to number of characters written (excluding \0), so this value is always equal to strlen(decoded). The old functions are still available as wrapper functions.
2013-08-08Add special 7-bit encoding and decoding functions for USSD codingAndreas Eversberg1-0/+2
Handling 7-bit coding is a little different for USSD, as TS 03.38 states: To avoid the situation where the receiving entity confuses 7 binary zero pad bits as the @ character, the carriage return or <CR> character shall be used for padding in this situation [...]. If <CR> is intended to be the last character and the message (including the wanted <CR>) ends on an octet boundary, then another <CR> must be added together with a padding bit 0. The receiving entity will perform the carriage return function twice, but this will not result in misoperation as the definition of <CR> [...] is identical to the definition of <CR><CR>. The receiving entity shall remove the final <CR> character where the message ends on an octet boundary with <CR> as the last character. Jacob has verified the fix with fakeBTS and the wireshark dissector. Fixes: OW#947 Reviewed-by: Jacob Erlbeck <jerlbeck@sysmocom.de>
2013-08-08encoding: Provide an overload for the gsm_7bit_encode and a simple testHolger Hans Peter Freyther1-0/+1
This is required for encoding the SMS header using the alpha numeric rules. Reviewed-by: Jacob Erlbeck <jerlbeck@sysmocom.de>
2013-08-07gsm: Try to clarify why we have gsm_septet_encode in the header fileHolger Hans Peter Freyther1-0/+1
These functions are not meant to be used by applications and are only here for the unit tests. Try to document that.
2013-07-06utils.h: we need to include utils.h for osmo_generate_backtrace()Harald Welte1-0/+2
this causes compiler warnings in user code ever since commit 55cf02221f0654a3f48888f3b13766b671a120f0
2013-07-06libosmogb: Add function to close NS instance without destroying itHolger Hans Peter Freyther1-1/+4
2013-07-06Fix RR cause valuesAndreas Eversberg1-3/+3
2013-07-06Add chan_nr to RACH info at L1SAP interfaceAndreas Eversberg1-0/+1
The chan_nr is required to locate timeslot and subslot of access bursts during handover procedure.
2013-07-06Add RSSI to l1sapAndreas Eversberg1-0/+2
2013-07-06Add MPH and TCH primitives to layer 1 SAPAndreas Eversberg1-3/+72
In order to control layer 1 via primitives, MPH primitives are required. There is only one (MPH-INFO) primitive defined in TS 04.04 for all control and measurement functions. A type identifier inside this primitive is used to differentiate between different functions. The TCH primitives are used to carry traffic. TCH primitives carry voice or data traffic, whereas PH-DATA primitives carry FACCH data. PH_RTS and TCH_RTS (ready-to-send) primitives are used to poll requests from upper layers.
2013-07-06Remove osmo_phsap_prim from lapdm.h and move to a seperate header fileAndreas Eversberg2-49/+54
2013-07-01misc: Fix compiler warnings about the static_assert macro with gcc 4.8Holger Hans Peter Freyther1-1/+1
The modified macro is still working on a gcc 4.7 and gcc 4.8 after the removal of the typedef and addition of the unused attribute. include/osmocom/core/msgb.h: In function ‘msgb_alloc_headroom’: include/osmocom/core/utils.h:40:51: warning: typedef ‘dummyheadroom_bigger’ locally defined but not used [-Wunused-local-typedefs] #define osmo_static_assert(exp, name) typedef int dummy##name [(exp) ? 1 : -1]; ^ include/osmocom/core/msgb.h:386:2: note: in expansion of macro ‘osmo_static_assert’ osmo_static_assert(size > headroom, headroom_bigger); ^
2013-06-29introduce gsm0808_create_reset_ack()Harald Welte1-0/+1
2013-05-23gsm_04_08.h: GSM48_MT_RR_VGCS_UPL_GRANT value correctedBhaskar1-1/+1
2013-05-23gsm_04_08.h: Fix GSM48_CMODE_DATA_3k6 as per 3GPP TS 04.08 / 10.5.2.6.Bhaskar1-1/+1
2013-05-23gsm_utils: refer to ETSI TS 05.08 instead of TS 08.05Bhaskar1-1/+1
2013-03-25gprs_ns: Allow to set the DSCP for the UDP socket.Holger Hans Peter Freyther1-0/+1
Allow to tag the NS service with a custom DSCP.
2013-03-25utils: Use fprintf to print the assertion and generate a backtraceKaterina Barone-Adesi1-1/+2
This is changing the semantic of the assert. The regression tests now either need to check the stderr result, the exit status or print a message when all tests are completed. This is not that bad as the osmo_generate_backtrace is printing to the stdout right now.
2013-03-18logging: add new log_targets_reopen() functionHarald Welte1-0/+1
This function will re-open all existing log files in the application, praticularly useful for SIGHUP handlers in case of logrotate
2013-03-13add new gsm/meas_rep.h file for shared/common measurement report stuffHarald Welte1-0/+29
2013-03-13Add smpp34_osmocom.h for Osmocom SMPP vendor additions0.6.0Harald Welte1-0/+48
2013-03-13gsm_septets2octets(): Input parameter should be constHarald Welte1-1/+1
2013-03-09utils: Introduce OSMO_ASSERT in the utils and use it in the unit testsKaterina Barone-Adesi1-0/+7
The tests should unconditionally assert, regardless of debug settings. This uses the OSMO_ prefix as it's in the global namespace.