aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/include
AgeCommit message (Collapse)AuthorFilesLines
2013-11-05shared: Introduce/Add procedure pending to the MOHolger Hans Peter Freyther1-0/+1
GSM 12.21 specifies that "No elementary procedure shall be initiated to an object instance which has not yet replied to a previously initiated elementary procedure with a response, an ACK or a NACK within a layer 3 time-out. The layer 3 timeout for ACK, NACK and responses shall have a default value of 10 seconds." We are using this flag in the BTS to enforce/safe-guard this situation.
2013-11-01bsc: Move gsm48_tx_mm_serv_ack/rej to gsm_04_08_utils.cJacob Erlbeck1-0/+3
These functions are currently located in libmsc/gsm_04_08.c together with other symbols that (transitively) depend on many external symbols (and thus libraries) that aren't otherwise needed by e.g. osmo-bsc. Since gsm48_tx_mm_serv_ack() will be needed by osmo-bsc, these functions are moved to avoid the dependency on gsm_04_08.o. Sponsored-by: On-Waves ehf
2013-10-31Revert "bsc/ussd: Send faked CM Service Accept before sending USSD"Holger Hans Peter Freyther1-3/+0
This reverts commit 61bd965b04e4f00eaf4196eebb4ec6269926d551. No, we should not link to dbi.. and these libraries..
2013-10-31bsc/ussd: Send faked CM Service Accept before sending USSDJacob Erlbeck1-0/+3
The MS do not show the USSD messages yet. This patch modifies the implementation to insert a CM Service Accept before the ussdNotify to finish the establishment of the MM connection according to 3GPP TS 04.10/3.2.1. This fix has been tested with a Blackberry phone that has shown an ussd_grace_txt after rf_locked has been set to '1'. Without this patch, that message wasn't shown. The phone has sent a CC Setup and other messages before processing the channel release message sent by the BSC, but these messages have not been forwarded to the MSC (as expected). Ticket: OW#957 Sponsored-by: On-Waves ehf
2013-10-30vty: Use vty_install_default() instead of bsc_install_default()Jacob Erlbeck1-4/+0
Remove ournode_exit_cmd, ournode_end_cmd, and bsc_install_default() since this functionality is provided by the current libosmocore. Replace calls to bsc_install_default() by call to vty_install_default() with the following semantic patch: @rule1@ expression N; @@ - bsc_install_default(N); + vty_install_default(N); Ticket: OW#952 Sponsored-by: On-Waves ehf
2013-10-25bts: Add a flag to remember the kind of activation/releaseHolger Hans Peter Freyther1-0/+2
When the PCU is activating a channel we don't want to tell the BSC using RSL. Add a flag so we can keep track of who asked for the activation/release of the channel.
2013-10-24gbproxy: Add test for NSEI and NSVCI changesJacob Erlbeck1-0/+1
This checks the behavior of the gbproxy when the BSS peer changes the NSEI and the NSVCI. It also tests BVC_RESET and other UNITDATA messages after these changes between BSS and SGSN and vice versa (via the gbproxy). Ticket: OW#874 Sponsored-by: On-Waves ehf
2013-10-24gbproxy/vty: Enhance delete-gbproxy-peer commandJacob Erlbeck1-1/+2
This adds the option to delete all BVC peers and/or NS_VC with a given NSEI with a single command. Static (configured) NS-VC are not affected. In addition, all connections for this NSEI that can be deleted by this command can be listed without deleting them by appending 'dry-run' to the command. Sponsored-by: On-Waves ehf
2013-10-24gbproxy: Add a command to delete peers from the GBProxyHolger Hans Peter Freyther1-0/+1
This just deletes the peer entry based on NSEI and BVCI. The NS-VC are not touched.
2013-10-19gbproxy: Test invalid BVCI from SGSNJacob Erlbeck1-0/+1
This adds a test with a UNITDATA SGSN message that is addressed to an invalid (unknown) BVCI. The test shows, that the message is echoed to the SGSN. Sponsored-by: On-Waves ehf
2013-10-19gbproxy: Add global and per peer countersJacob Erlbeck1-1/+1
This adds counters that are incremented when errors are detected. It also modifies the VTY command 'show gbproxy' so that 'show gbproxy stats' shows the counters. Sponsored-by: On-Waves ehf
2013-10-15gbproxy: Replace NS-VC references by NSEIJacob Erlbeck1-1/+1
Currently in most places in gb_proxy.c a reference to a NS-VC object is used where the peer is meant instead. The patch changes this by using the NSEI instead in these cases. Sponsored-by: On-Waves ehf
2013-10-15gbproxy: Add test program to test gbproxy message handlingJacob Erlbeck1-0/+1
This program tests the gbproxy implementation by passing NS messages to a modified gbproxy that dumps the resulting messages, signals, and state. It focusses on testing abnormal situations like port changes. Ticket: OW#874 Sponsored-by: On-Waves ehf
2013-10-13db: Remove the struct gsm_network from the database layerHolger Hans Peter Freyther2-4/+4
The database code should not know about the network. Move the setting of the network pointer into the subscriber layer.
2013-10-06osmo-bts: Kill the different ROLE_BSC as e1inp_sign_link is used nowHolger Hans Peter Freyther1-4/+1
2013-09-19nat: Fix make distcheck for the natHolger Hans Peter Freyther1-1/+1
The jenkins runs make distcheck in the default configuration and not with the nat enabled. DISTCHECK_CONFIGURE_FLAGS="--enable-nat" make distcheck
2013-09-19bsc/mminfo: Patch timezone and DST in MM Info messagesJacob Erlbeck1-0/+1
This adds in-place patching of the time information in the MM INFORMATION message. The timezone in the 'Local time zone' and the 'Universal time and local time zone' information elements and the offset in the 'Network Daylight Saving Time' information element are optionally set. The new values are determined by the 'timezone' vty command in the config_net_bts node. That command is extended by an optional DST offset parameter. Tests are provided for the vty part and for the plain bsc_scan_msc_msg() function. Sponsored-by: On-Waves ehf Ticket: OW#978
2013-09-11ctrl: Remember last 'rf_locked' control commandJacob Erlbeck1-0/+2
This stores the last SET rf_locked control command along with a timestamp. The 'show network' vty command is extended to show this information. Ticket: OW#659
2013-09-11ussd: Send USSD on call setup on MSC errorsJacob Erlbeck2-2/+15
Send an USSD message to the mobile station requesting a connection for a call or a SMS when the link to the MSC is down or in the grace period. The messages can be set (and this feature activated) by setting bsc/missing-msc-text resp. msc/bsc-grace-text via the vty. The generation of both messages has been tested manually. Ticket: OW#957
2013-09-03nat: Remember the original dest local reference in the parsed structHolger Hans Peter Freyther1-0/+3
In case of the RLSD coming from the MSC we are patching the address in-situ but for local calls set con = NULL. We then answered the RLSD with the wrong reference and the MSC kept on trying.
2013-09-03bsc_msc: Add a name field to the MSC Connection to differentiate linksHolger Hans Peter Freyther1-0/+2
Assign a static name to a MSC Connection and use it. In case there are multiple connections we can now more easily identify them. This is only used for the NAT right now, the BSC could start to name the various MSC connections too.
2013-09-02vty: Use generic 'end' and 'exit' commandsJacob Erlbeck1-0/+2
Add bsc_install_default() and replace all install_default() This patch adds bsc_install_default() which calls install_default() and add 'exit' and 'end'. All other calls to install_default() are replaced by calls to bsc_install_default(). Since 'exit' and 'end' are now added automatically to each node, the explicit registrations of these commands are removed by this patch, too. The related tests succeed now without work-arounds (except for the 'config' node itself which is part of libosmocore).
2013-09-02nat: Attempt to follow the MODULE_METHOD pattern for methodsHolger Hans Peter Freyther1-2/+2
Rename methods to be like bsc_ussd_ACTION.
2013-08-28bsc/ussd: Optionally send USSD message on MSC disconnectionJacob Erlbeck1-0/+3
Send an USSD message on each MS connection if the connection to the MSC has been lost. Add a vty config command 'bsc-msc-loss-txt' in 'config-msc' to set the notification string and to enable the feature. Ticket: OW#957
2013-08-27libmgcp: add enum mgcp_rolePablo Neira Ayuso1-1/+9
This enum indicates if the mgcp is running on the BSC or the BSC-NAT.
2013-07-31nat: Implement a post-routing for the NAT softwareHolger Hans Peter Freyther1-0/+2
* The post-routing is applied after the first re-writing. To do this the new number is copied back into the called data structure. * Add a testcase that goes from 0172 to 0049 and then back to 0049 using the post rule with a table lookup.
2013-07-31nat: Allow to use the prefix lookup to rewrite numbersHolger Hans Peter Freyther2-1/+10
* Increase the rewritten rule to five digits (this is the easiest for the unit test). This will add another 40kb to the runtime size. * Create a unit test that tests adding and removing the prefix rules. * Use the regexp match to replace from one package
2013-07-31nat: Introduce a prefix lookup tree (trie) for number rewritingHolger Hans Peter Freyther2-1/+45
* It is a trie. The max depth of the trie is the length of the longest prefix. The lookup is O(lookuped_prefix), but as the prefix length is limited, the lookup time is constant. * Each node can hold the entire prefix, has place for the rewrite rule with up to three digits. * A trie with 20k entries will take about 3MB ram. * Filling the trie 100 times takes ~800ms on my i7 laptop * 10.000.000 lookups take 315ms.. (for the same prefix). * 93/99 lines are tested, 6/6 functions are tested, 49 of 54 branches are tested. Only memory allocation failures are not covered * A late addition is to handle the '+' sign and to increase the number of chars in the rewrite prefix. The timing/line coverage has not been updated after this change.
2013-07-27expiration: Allow to disable the periodic location updating procedureHolger Hans Peter Freyther1-0/+2
Disable the periodic LU using "no periodic location update" VTY command. In that case set the expire_lu to 0 which will then be translated to a NULL in the database layer. This leads to a bit of copy and paste in the db_sync_subscriber method but I don't see how we could easily use 'datetime(%i, 'unixepoch')' and 'NULL' at the same time. Change the query to find expired queries to check for NOT NULL and the time being in the past. This means if there are still old subscribers in the database they might not be expired. One would need to execute a query like "UPATE Subscriber SET expire_lu = 0 WHERE expire_lu is null". The same applies when disabling the periodic LU. One would need to update the database by hand. Manual tests executed/passed: 1.) periodic LU enabled: * use gst LUTest.st to do a LU * UPDATE Subscriber SET expire_lu=datetime('now'); * observe the subscriber being expired (it was) 2.) periodic LU disabled: * use gst LUTest.st to do a LU * verify that the expire_lu is NULL in the database
2013-07-27expiration: Speculative fixes for the periodic expiring handlingHolger Hans Peter Freyther2-0/+4
We were expiring subscribers during active calls. This is because the T3212 is stopped under certain conditions but we didn't stop that timer at all. Remember if T3212 timer was stopped due something done by NITB and update the expiration time at the end of the radio connection, as the phone should restart it when returning to MM Idle. It is a bit difficult to decide when we should set the flag. E.g. in a CM Service Request we don't know if we accept the service and during a LU we already send MM messages before we accept or reject the subscriber. The easiest is to set the flag when receiving a paging response on known subscribers and at the end of the authentication process. Do not expire a subscriber that has an active connection that is marked with the flag, e.g. we would still expire a subscriber that is being paged. Manual tests executed/passed: * gst LUTest.st verified that a expiration date was set * gst SMSTest.st (doing another LU but forcing a timeout on the SMS sending). Verified that the expire_lu was updated.
2013-07-21sgsn: Add "auth-policy" VTY command to enable/disable ACLHarald Welte1-0/+1
2013-07-21sgsn: add a minimalistic ACLHarald Welte1-0/+2
This adds a minimalistic ACL by which certain, individual roaming IMSIs can be authorized to use the SGSN. So you can selectively bypass the 'MCC+MNC == first 5 digits of IMSI' checking for a couple of IMSIs
2013-07-11Fix: Handle CM service request on already secured channel correctlyAndreas Eversberg1-0/+1
A CM service request must be acknowledged also, when encryption is already enabled. Without encryption enabled, the security status is GSM_SECURITY_NOTAVAIL, which causes a CM service acknowledge. On initial CM service request, the security status is GSM_SECURITY_SUCCEED, if encryption is enabled. This will not lead to an acknowledge, because the cyphering command implies an acknowlege. An additional CM service request requires an acknowledge, so I added a new security status: GSM_SECURITY_ALREADY
2013-07-08libmgcp: add enum mgcp_type and use itPablo Neira Ayuso1-1/+6
This patch replaces the field 'is_transcoded' in the mgcp_endpoint structure by the enum mgcp_type, that can be further extended with new types.
2013-07-04sgsn: Fix lengths of MS Network Capability and MS Radio Access Capability ↵Alexander Chemeris1-2/+2
elements. Original code was inconsistent about lengths and could lead to out of bounds write. Lengths were also inconsistent with the TS 24.008. Fixes: Coverity CID 1040714.
2013-07-03hsl: Remove the support for the HSL bts from OpenBSCHolger Hans Peter Freyther2-5/+0
The support has been implemented for an old model, we were told that newer versions would be made incompatible with OpenBSC. Ther are various warnings in the code and coverity has found some new ones. Just remove the code as we don't know of anyone using this code.
2013-06-21GPRS LLC: Add non-standard method of sequence number recoveryHarald Welte1-0/+4
In some situations (like MS reboot without prior DETACH or SGSN reboot without prior MS detach), the LLC sequence numbers for UI mode could be different on both sides. The LLC spec unfortunately doesn't permit us to send something like a FRMR in this case, but instructs us to silently discard the frame. At that time the remote LLC entity will re-transmit the frame with the same seqeunce number over and over again, which we will drop again and again. The mthod used now will keep track of the last received UI sequence number. If that number is retransmitted for three times in a row, then we accept this sequence number and recover from that point on.
2013-04-29nat: Include LAC/CI as TV values at the end of the 'status' messageHolger Hans Peter Freyther1-1/+2
Extend the status message and send LAC/CI as part of the status message. It is using TV to allow sending more fields in the feature. We only need to encode the data and this is why there is no tlv description yet.
2013-04-29smpp: Attempt to fix a memory leak of the msgbHolger Hans Peter Freyther1-0/+3
The smpp_pdu_rx method does not free the msgb. Introduce an annotation (currently defined to nothing) to indicate what will happen to a msgb.
2013-04-22nat: Move the callstats to a new header file due sccp usageHolger Hans Peter Freyther2-28/+55
The bsc_nat.h is included by common_vty.c so we may not used sccp_types.h in the bsc_nat.h header file. Move the callstats to a new file and include it where it is needed.
2013-04-17ctrl: Provide a reply in case the range check failedHolger Hans Peter Freyther1-0/+1
2013-04-17ctrl: Make the commands static to not pollute the namespaceHolger Hans Peter Freyther1-3/+3
We do not need to access these commands from another compilation unit and can just make it static.
2013-04-16nat: Extract the LAC/CI from the Complete Layer3 InformationHolger Hans Peter Freyther2-0/+6
Find the Cell Identifier from the Complete Layer3 Information and store it for future reference. We could begin to verify that the LAC/CI used really belongs to the BSC.
2013-04-16nat: Rename "struct sccp_connections" to "struct nat_sccp_connection"Holger Hans Peter Freyther2-15/+15
The name sccp_connection is used in the osmo-sccp code, sccp_connections was used in the NAT for tracking a sccp_connection. Rename it so it is obvious that the struct belongs to the nat. The rename was done with sed: $ sed -i s,"struct sccp_connections","struct nat_sccp_connection",g \ include/openbsc/*.h src/osmo-bsc_nat/* tests/*/*
2013-04-16nat: We want the remote to respond to our DLCX requestHolger Hans Peter Freyther2-0/+32
We want to send a TRAP with the MGCP statistics from the NAT and the connected BSC. The BSC endpoint can be either released because of a DLCX from the MGCP CallAgent or the SCCP Connection release on the A-link. This is why we need to queue the statistics when the deleting the endpoint on the BSC. The processing is continued once the response arrives. This code assumes that the response of the DLCX will be sent by the remote side. The current amount of outstanding responses can be seen on the VTY. This assumption is based on the fact that the BSC has already responded to the CRCX and maybe to the MDCX. The MGCP RFC is bended to prefix the transaction identifier with "nat-" to easily detect the response and hand it to the handler. This will then parse the response and generate the TRAP. The current version is v1. We assume that the transaction space is big enough and we will not re-assign the transaction identifier too early.
2013-04-16nat: Make it possible to send MGCP messages through the IPA multiplexHolger Hans Peter Freyther1-0/+4
Instead of handling MGCP through the UDP socket, read and write messages through the ipa connection to the MSC.
2013-04-05sysmobts: Add the necessary data structure and init for the SAPI queueHolger Hans Peter Freyther1-0/+1
The sysmobts is now having a SAPI queue with all pending SAPI operations on the BTS. Add the llist_head to the lchan and make sure it is initialized by the shared code.
2013-03-17Add VTY option to set GPRS network-control-order to enable MS measurementsAndreas Eversberg1-0/+1
In order to enable GPRS downlink measurements at mobile, the network-control-order must be set to nc1.
2013-03-12IPA: Allow RSL connection to different IP address as OMLHarald Welte1-0/+1
This patch adds a new VTY command "ip.access rsl-ip A.B.C.D" at the BTS level. If you set this IP address, the BTS will be instructed to establish the RSL link to the indiciated IP address, rather than using the same as for the OML link (default). Use "ip.access rsl-ip 0" to disable the feature.
2013-03-11BTS: Add S counter for link loss criterion to lchan structureAndreas Eversberg1-0/+2