path: root/openbsc/include/openbsc
AgeCommit message (Collapse)AuthorFilesLines
2014-08-24move gsm_bts_num() to gsm_data_shared.[ch]Harald Welte2-3/+2
this way we can drop a copy of this function from osmo-bts.
2014-08-22gbproxy: Add gbprox_clear_patch_filter() (Coverity)Jacob Erlbeck1-0/+1
Add a separate function to clear the IMSI filter to be used instead of gbprox_set_patch_filter(cfg, NULL, ...). Albeit it fixes a Coverity issue (Unchecked return value), it is a false positive, since the return value is always 0 in these cases. Nevertheless it is more obvious what happens when an explicit clear function is called. Using NULL as filter argument of gbprox_set_patch_filter still clears the filter. Fixes: Coverity CID 1231255 Sponsored-by: On-Waves ehf
2014-08-21fix missing '\' at end of line in Makefile.amHarald Welte1-1/+1
... causing header files to be missing from 'make dist'. this was introduced in ba874b82be0ad1752b46009ba403f9b7bf24492d
2014-08-21move libctrl from openbsc to libosmoctrl (libosmocore.git)Harald Welte5-222/+6
2014-08-18ipaccess-proxy: avoid namespace collision with libosmo-abisHarald Welte1-2/+0
2014-08-13gbproxy: Pass tlli_info aroundJacob Erlbeck1-3/+5
This patch modifies the code to pass a pointer to the tlli_info around once it has been acquired. To achieve this, gbprox_register_tlli() and gbprox_update_state() are modified to return it (if it has been found or created), and gbprox_patch_llc(), gbprox_patch_bssgp(), and gbprox_update_state_after() are modified to take it as parameter. Add a new function gbprox_touch_tlli() to update timestamp and list ordering for existing tlli_infos. The motivation behind this patch is to make the tlli_info available to the patching code and to avoid repeated searches for the same TLLI. Sponsored-by: On-Waves ehf
2014-08-13gbproxy: Don't call time() in TLLI related functionsJacob Erlbeck1-1/+1
Currently time() is called at several places to control TLLI aging. Beside calling time() more often than necessary, the decision which timesource is to be used is coded into the TLLI handling, and testing complex aging scenarios is cumbersome. This patch passes the current time as a parameter instead. The call to time() is moved to gbprox_process_bssgp_message(). Sponsored-by: On-Waves ehf
2014-08-13gbproxy: Test and fix IMSI/TMSI matchingJacob Erlbeck1-0/+2
This adds a test for gbprox_set_patch_filter() and gbprox_check_imsi(). It also fixes the masking of the type field when IMSIs are checked by using GSM_MI_TYPE_MASK (0x07) instead of 0x0f. Sponsored-by: On-Waves ehf
2014-08-13gbproxy: Track TLLI even when the IMSI is not knownJacob Erlbeck1-0/+2
Currently only TLLIs for which it is known that they may be patched are put into the TLLI list. This patch changes this to add TLLIs even when the IMSI is not yet known. A enable_patching flag is added to the gbproxy_tlli_info structure to control patching. Note that this puts every active TLLI into the list where accesses are O(N) currently. Sponsored-by: On-Waves ehf
2014-08-09sysmobts: Add variable for N(S) + 1 needed for the sysmobtsHolger Hans Peter Freyther1-0/+1
We could use the upper three bits of the ciph_state to store the sequence number but make the code understandable first.
2014-08-08bsc: Add a ctrl command to send a ussdNotify for a callHolger Hans Peter Freyther2-0/+5
Send a non-call related SS message for an active call indentified by the CIC of that call. As an ugly hack the order of the SS release and the invocation are changed. That was necessary for the E71 on a TCH. The time between notify and release was just too short. The right would be to wait for the returnResultLast but this would involve keeping more local state. Let's see how far we get here. It might be necessary to change the order in the other call sites as well.
2014-08-05gbproxy/test: Test TLLI expiryHolger Hans Peter Freyther1-0/+8
This adds a unit test for gbprox_register_tlli() and gbprox_remove_stale_tllis(). The dump_peers() function is extended by a cfg parameter to support a non-global gbproxy_config. Done with Jacob
2014-08-04gbproxy: Kill the global gbprox_global_patch_state structHolger Hans Peter Freyther1-1/+9
Move this patching state into the gbproxy_config as well. Done by Jacob
2014-08-04gbproxy: Remove global state from the gbproxyHolger Hans Peter Freyther1-6/+7
Global state prevents us from writing simple units tests for single routines. Go through the code and add pointers to the gbproxy configuration. Only the vty and the test code remain using the global gbproxy instance.
2014-08-04gprs: The methods moved to gprs_utils.h remove them hereHolger Hans Peter Freyther1-3/+0
Stop declaring the apn routines in here. Done with Jacob
2014-08-04gprs: Add testcases for the APN string/octet conversion and fix itHolger Hans Peter Freyther1-1/+1
Create a testcase for the gprs_str_to_apn and gprs_apn_to_str routines. While writing the testcase we noticed it is possible to write more bytes than should have been allowed. This is fixed by checking that the max_len is at least 1 (needed to write the first length octet) and to do the size check before writing to the output. Modify the signature of gprs_str_to_apn to put the length/size next to the parameter that requires a size. Done with Jacob
2014-08-04gprs: Create a gprs_utils file and move to be shared code in thereHolger Hans Peter Freyther2-1/+34
We intend to move some of these routines to libosmocore but to avoid a feature symbol clash we are prefixing these routines with gprs_. Done with Jacob
2014-08-04gbproxy: Use gbproxy_ for all structuresHolger Hans Peter Freyther1-8/+8
The application is called gbproxy but the structures and functions were inconsistently named as either gbprox or gbproxy. Rename all structures to use gbproxy. Done with Jacob
2014-08-04gbproxy: The dump routines are only used by the test, move it thereHolger Hans Peter Freyther1-2/+0
Done with Jacob
2014-08-04gbproxy: Have a clear namespace for the public functionsHolger Hans Peter Freyther1-2/+1
Done with Jacob
2014-08-04gbproxy: Remove the global rate counter and place it in the configHolger Hans Peter Freyther1-1/+3
Move the global data into the struct and use it. gbprox_reset will first free data and then re-initialize the structure. This code is used by the unit test. Done with Jacob
2014-08-04gbproxy: Correct the method name. We work on TLLIsHolger Hans Peter Freyther1-1/+1
Done with Jacob
2014-08-04gbproxy: Move the VTY code into the vty file and create public APIHolger Hans Peter Freyther1-5/+53
Create public accessors to the core of the peer to allow to simplify the test and separate concerns. Done with Jacob.
2014-08-04dyn PDCH: Cleanup of rsl_chan_activate_lchan() and usersAndreas Eversberg1-1/+1
Timing advance is stored inside lchan structure, so it is removed from arguments. This is useful, if other actions are required prior calling rsl_chan_activate_lchan. (like deactivating PDCH first) The "shifted TA value" that is required by BS11 is now calculated inside rsl_chan_activate_lchan and not by each user. [Rebased by Holger. So some hunks were skipped as the patch depended on Jolly's HO code]
2014-07-30openbsc: Add new fields for the osmo-bts softwareHolger Hans Peter Freyther1-0/+12
For the osmo-bts software we want to be able to slowly change the output power. The state is kept inside the trx structure.
2014-07-24bts: Remember the last AMR mode that we receivedHolger Hans Peter Freyther1-0/+1
Not every air message contains the AMR mode so we need to remember it to not confuse receiving equipment like AudioCodes Media Gateways.
2014-07-22gprs/vty: Add commands to manage the TLLI listJacob Erlbeck1-0/+2
These commands manage the TLLI list used to decide whether an APN shall be patched or not. Note that this list is (currently) only maintained if IMSI matching is used. VTY commands (enable node): show gbproxy tllis show all TLLI entries delete-gbproxy-tlli NSEI stale purge all stale entries delete-gbproxy-tlli NSEI imsi IMSI purge entry with the IMSI given delete-gbproxy-tlli NSEI tlli TLLI purge entry with the TLLI given Sponsored-by: On-Waves ehf
2014-07-22gprs: Track IMSI/TLLI to control APN patchingJacob Erlbeck1-0/+5
This patch adds IMSI/TLLI connection tracking and uses it to control APN patching based on the IMSI. TLLI entries can expire based on age and/or by limiting the TLLI list size. VTY config-gbproxy: no core-access-point-name disable APN patching core-access-point-name none remove APN if present core-access-point-name APN replace APN if present core-access-point-name none match-imsi RE remove if IMSI matches core-access-point-name APN match-imsi RE replace if IMSI matches tlli-list max-age SECONDS expire after SECONDS no tlli-list max-age don't expire by age tlli-list max-length N keep N entries only no tlli-list max-length don't limit list length RE is an extended regular expression, e.g. ^12345|^23456 Ticket: OW#1192 Sponsored-by: On-Waves ehf
2014-07-22gprs: Add APN patch support for LLC/GSM messagesJacob Erlbeck1-0/+6
Patch the APN in every 'Activate PDP Context Request' message to the value given by the 'core-access-point-name' command. If the command is given without an APN, the whole APN IE will be removed. If the command is being prefixed by a 'no', the APN IE remains unmodified. The patch mode 'llc-gsm' is added to selectively enable the patching of LLC session management messages. This is enabled implicitely by the patch mode 'llc'. Note that the patch mode should not be set to a value not enabling the patching of LLC GSM messages ('llc-gsm', 'llc', and 'default' are sufficient to patch 'Activate PDP Context Request' messages). Ticket: OW#1192 Sponsored-by: On-Waves ehf
2014-07-22gprs: Add MCC/MNC patch support for LLC/GMM messagesJacob Erlbeck1-0/+10
This patch extends the BSSGP patch code to also patch LLC information elements along with MCC/MNC patching support for the following messages: - Attach Request - Attach Accept - Routing Area Update Request - Routing Area Update Accept - P-TMSI reallocation command Note that encrypted packets will not be patched. Ticket: OW#1185 Sponsored-by: On-Waves ehf
2014-07-22gprs: Implement BSSGP MCC/MNC patchingJacob Erlbeck1-0/+4
This adds a feature to patch the BSSGP MNC/MCC fields of messages going to and coming from the SGSN. To enable this feature, the gbproxy's VTY commands 'core-mobile-country-code' and/or 'core-mobile-network-code' must be used. All packets to the SGSN are patched to match the configured values. Packets received from the SGSN are patched to the corresponding values as last seen from the BSS side. Note that this will probably not work with a gbproxy used for several BSS simultaneously. Note also, that MCC/MNC contained in a LLC IE will not be patched. Ticket: OW#1185 Sponsored-by: On-Waves ehf
2014-07-22mgcp: Change API to remove memory management from the nameHolger Hans Peter Freyther1-1/+2
Jacob pointed out that "free_endp" refers to the memory of the endpoint being freed. What we want is actually a way to release an endpoint (and the resource it allocated) or in the case of the testcase/testapp initialize the data structure correctly. Introduce two names for that.
2014-07-22mgcp: Document transcoding semantic and follow itHolger Hans Peter Freyther1-0/+6
Transcoding from GSM to PCMA can lead to the MGCP MGW sending two PCMA packages with the same sequence number and timestamp. Once with the encoded audio and once completely empty. This is because "state->dst_packet_duration" is 0 in most cases (unless a ptime is forced) and we attempt to encode audio even if there are not enough samples. The encode_audio return will return 0 in that case which is not trated as an error by the mgcp network code. Handle rc == 0 specially and document the semantic.
2014-07-22mgcp: Make the internal state of the transcoder accessibleHolger Hans Peter Freyther1-0/+53
For the unit tests we need to look at the internal state.
2014-07-07rtp: Share the rtp header between the proxy and the mgcp codeHolger Hans Peter Freyther2-1/+39
2014-07-07gprs/test: Remove verbose parameter of gbprox_dump_* functionsJacob Erlbeck1-2/+2
This parameter is not used (the methods are always called with an argument of 1 in the third position). Thus the parameter is removed completely. Sponsored-by: On-Waves ehf
2014-06-05mgcp: Set net_end audio params in recvonly modeJacob Erlbeck1-0/+1
Currently, if there is no SDP data in the MGCP message received from the net, the fields containing audio encoding information are not set in net_end. So in recvonly mode transcoding would not be set up correctly. This patch changes the implementation of the code handling CRCX and MDCX to use the codec signalled in the MGCP local connection options (field 'a:') if there isn't any SDP data. This is only halfway negotiation, because the codec is used blindly and not matched against the supported ones. Sponsored-by: On-Waves ehf
2014-06-05mgcp: Move transcoding to libmgcpJacob Erlbeck2-1/+37
This patch moves the files relevant to transcoding from src/osmo-bsc_mgcp to src/libmgcp and src/include/openbsc. Makefiles and include directives are being updated accordingly. Sponsored-by: On-Waves ehf
2014-06-05mgcp: Add packet size (ptime) conversionJacob Erlbeck2-2/+6
The current transcoder implemenation always does a 1:1 recoding concerning the duration of a packet. So RTP timestamps and sequence numbers are not modified. This is not sufficient in some cases, e.g. when the BTS does only allow for a single fixed ptime. This patch decouples encoding from decoding and moves the decoded samples to the state structure so that samples can be combined or drain according to the packaging of incoming and outgoing packets. This patch incorporates parts of Holger's experimental fixes in 0e669e05^..9eba68f9. Ticket: OW#1111 Sponsored-by: On-Waves ehf
2014-06-05mgcp: Add a function to get media info for MGCP responsesJacob Erlbeck2-0/+13
This patch adds the get_net_downlink_format_cb() callback to provide payload_type, subtype_name, and fmtp_extra suitable for use in a MGCP response sent to the network. Per default, the BTS side values are returned since these must be honoured by the net peer when sending audio to the media gateway (unless transcoding is done). Sponsored-by: On-Waves ehf
2014-06-05mgcp: Add audio info fields to struct mgcp_rtp_endJacob Erlbeck1-0/+3
This patch adds the fields channels, subtype_name, and audio_name to the struct. The field audio_name contains the full string that has been used for the last part of a SDP a=rtpmap line. The others contain decoded parts of that string. If no a=rtpmap line has been given (e.g. because dynamic payload types are not used), values are assigned when the payload type matches one of the predefined ones (GSM, G729, PCMA). The patch also moves the audio_name parsing code to a dedicated set_audio_info() function. Sponsored-by: On-Waves ehf
2014-06-05mgcp: Add callbacks for payload processingJacob Erlbeck2-0/+19
This patch adds the callbacks rtp_processing_cb and setup_rtp_processing_cb to mgcp_config to support arbitrary RTP payload processing. Sponsored-by: On-Waves ehf
2014-06-04gprs: Separate LLC parsing from LLC state handlingJacob Erlbeck1-0/+41
Currently LLC parsing is part of gprs_llc.c which needs large parts of the SGSN code parsing to fulfill its link dependencies. This patch moves the functions that just do plain parsing, dumping, and FCS computation to a different file to avoid these dependencies if LLC stateful processing is not needed. It also exposes struct gprs_llc_hdr_parsed and enum gprs_llc_cmd publically. Sponsored-by: On-Waves ehf
2014-05-26mgcp: Use #pragma once instead of a possible clashing #ifdefHolger Hans Peter Freyther1-3/+1
The filename is mgcp_internal.h but the define refers to MGCP_DATA. Avoid having a potential clash by using the #pragma once option.
2014-05-22mgcp: add voice muxer supportPablo Neira Ayuso5-2/+53
This patch adds the voice muxer. You can use this to batch RTP traffic to reduce bandwidth comsuption. Basically, osmux transforms RTP flows to a compact batch format, that is later on decompacted to its original form. Port UDP/1984 is used for the muxer traffic between osmo-bsc_nat and osmo-bsc_mgcp (in the BSC side). This feature depends on libosmo-netif, which contains the osmux core support. Osmux is requested on-demand via the MGCP CRCX/MDCX messages (using the vendor-specific extension X-Osmux: on) coming from the BSC-NAT, so you can selectively enable osmux per BSC from one the bsc-nat.cfg file, so we have a centralized point to enable/disable osmux. First thing you need to do is to accept requests to use Osmux, this can be done from VTY interface of osmo-bsc_nat and osmo-bsc_mgcp by adding the following line: mgcp ... osmux on osmux batch-factor 4 This just initializes the osmux engine. You still have to specify what BSC uses osmux from osmo-bsc_nat configuration file: ... bsc 1 osmux on bsc 2 ... bsc 3 osmux on In this case, bsc 1 and 3 should use osmux if possible, bsc 2 does not have osmux enabled. Thus, you can selectively enable osmux depending on the BSC, and we have a centralized point for configuration from the bsc-nat to enable osmux on demand, as suggested by Holger. At this moment, this patch contains heavy debug logging for each RTP packet that can be removed later to save cycles. The RTP ssrc/seqnum/timestamp is randomly allocated for each MDCX that is received to configure an endpoint.
2014-05-15ctrl: Use CTRL_CMD_DEFINE_STRUCT in CTRL_CMD_DEFINE_RANGEHolger Hans Peter Freyther1-6/+1
Jacob pointed out that I didn't convert CTRL_CMD_DEFINE_RANGE. This patch is doing it now.
2014-05-15ctrl: Reduce code duplication and add a define to create the structHolger Hans Peter Freyther1-13/+10
This has been pointed out by Jacob and removes two more duplicates of the struct. For the unused CTRL_CMD_DEFINE_STRING macro there will be no verify command.
2014-05-15ctrl: Remove the param parameter as it was never used/implementedHolger Hans Peter Freyther1-4/+0
2014-05-15ctrl: Introduce a macro for read-only attributes and use itHolger Hans Peter Freyther1-0/+14
Certain attributes are read-only. Add a macro to make it more easy to define those.
2014-05-09bsc: Fix compilation on FreeBSDNikola Kolev1-0/+2
FreeBSD uses POSIX netinet/in.h for representing socket addresses data types. [Holger removed the #ifdef and changed the order of includes to have specific ones first and system includes later]