aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc
AgeCommit message (Collapse)AuthorFilesLines
2013-07-27misc: Fix compilation warningsHolger Hans Peter Freyther7-20/+11
bsc_api.c:417:3: warning: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 7 has type ‘unsigned int’ [-Wformat] bsc_api.c: In function ‘handle_ass_fail’: bsc_api.c:458:3: warning: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 7 has type ‘unsigned int’ [-Wformat] db.c: In function ‘db_sync_subscriber’: db.c:785:3: warning: format ‘%i’ expects argument of type ‘int’, but argument 8 has type ‘time_t’ [-Wformat] osmo_msc.c: In function ‘msc_release_connection’: osmo_msc.c:145:20: warning: unused variable ‘trans’ [-Wunused-variable] smpp_smsc.c: In function ‘link_accept_cb’: smpp_smsc.c:891:24: warning: assignment from incompatible pointer type [enabled by default] smpp_smsc.c:271:1: warning: ‘esme_by_system_id’ defined but not used [-Wunused-function] smpp_openbsc.c: In function ‘smpp_openbsc_init’: smpp_openbsc.c:545:2: warning: implicit declaration of function ‘smpp_vty_init’ [-Wimplicit-function-declaration] osmo_bsc_ctrl.c: In function ‘verify_bts_loc’: osmo_bsc_ctrl.c:340:19: warning: variable ‘height’ set but not used [-Wunused-but-set-variable smpp_mirror.c: In function ‘main’: smpp_mirror.c:297:2: warning: implicit declaration of function ‘osmo_init_logging’ [-Wimplicit-function-declaration]
2013-07-21sgsn: spelling fixes inside commentsHarald Welte2-3/+3
2013-07-21SMPP: complete the VTY help/documentationHarald Welte1-9/+33
As discovered by osmotestconfig.py, a number of SMPP related VTY commands were missing their help/documentation text.
2013-07-21remove 'bind early' from osmo-bsc_mgcp example configHarald Welte1-1/+0
(discovered by osmotestconfig.py)
2013-07-21sgsn: Add "auth-policy" VTY command to enable/disable ACLHarald Welte3-1/+20
2013-07-21sgsn: add a minimalistic ACLHarald Welte4-2/+84
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-18oml: Add a missing break switch for NM_OC_BS11Holger Hans Peter Freyther1-0/+1
It appears to me that for NM_OC_BS11 mo was either NULL or the one mo value from NM_OC_BS11_RACK. The break inside the nested switch case didn't break from the outer one. Fixes Coverity: CID 1040728
2013-07-14smpp: Close the file descriptor when we can't accept the SMSC connHolger Hans Peter Freyther1-1/+4
When we failed to allocate the memory or failed to register the fd we would have leaked the file descriptor. Close the fd and avoid the leak.
2013-07-14smpp: Add the classic check for osmo_fd_registerHolger Hans Peter Freyther1-1/+5
In case the osmo_fd_register will fail we will need to free the memory we have allocated. Fixes: Coverity CID 1042375
2013-07-14smpp: Fix possible NULL dereference of the emse->aclHolger Hans Peter Freyther1-2/+2
The esme->acl is treated like it can be NULL in other places of the code. Assume it can be NULL during this check as well. Dereference after null check (FORWARD_NULL) 9. var_deref_op: Dereferencing null pointer "esme->acl". Fixes: Coverity CID 1042374
2013-07-14smpp: Checking an array for NULL will always be falseHolger Hans Peter Freyther2-2/+2
The if (submit->short_message) and if (smsc->system_id) will always be true. Fixes: Coverity CID 1042371, CID 1042372
2013-07-14ipaccess: The proxy code checked the array but not the elementHolger Hans Peter Freyther1-1/+1
Array compared against 0 (NO_EFFECT) array_null: Comparing an array to null is not useful: "ipbc->bsc_rsl_conn". Fixes: Coverity CID 1040718
2013-07-14ipaccess: Fix a resource leak in case the stat is failingHolger Hans Peter Freyther1-0/+1
Close the file when the stat is failing. Fixes: Coverity CID 1040711
2013-07-14nitb: The subscr->imsi is an array will never be NULLHolger Hans Peter Freyther2-4/+2
Array compared against 0 (NO_EFFECT) array_null: Comparing an array to null is not useful: "subscr->imsi" Fixes: Coverity CID 1040716
2013-07-13Fix license header at smpp_openbsc.c and smpp_smsc.cHarald Welte2-22/+24
As Holger pointed out, they contained a GPLv2+ disclaimer rather than the AGPLv3+ which we use for OpenBSC. This is not an incompaibility, but was done unintentionally. The code was always mean to be under AGPLv3+. Nevertheless, anyone using those two files in a version up to this commit have the right to use it under GPLv2+ as well. This is not applicable for any versions after this commit.
2013-07-11smpp_openbsc: Fix parsing of 03.38 data coding scheme in MO caseHarald Welte1-15/+28
2013-07-11Fix: Handle CM service request on already secured channel correctlyAndreas Eversberg2-1/+3
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 Ayuso3-13/+36
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-06mncc: Remove what we believe to be a tautology from the MNCC codeHolger Hans Peter Freyther1-14/+16
Coverity pointed out that we use trans->subscr after a NULL check, it is our believe that every transaction will have a subscriber. Remove the check and add an assert before we are dispatching things. Fixes: Coverity CID 1040740, CID 1040739
2013-07-05nat: The con variable is not assigned at this pointHolger Hans Peter Freyther1-5/+0
Coverity pointed out that this code is logically dead. Quickly judging the code we will forward the RSLD message anyway. Remove the code for now and next time I work on the NAT/USSD bridge I will have a look at the flow of the RLSD messages. Fixes: Coverity CID 1042327
2013-07-05nat: number could point to an address on the stack that can be reusedHolger Hans Peter Freyther1-1/+1
The number = int_number assignment will make the number point to the stack and as the int_number goes out of scope at the end of the if statement other code could re-use this stack for other memory. Fixes: Coverity CID 1042325
2013-07-05nat: Address coverity warning about uninitialized addrHolger Hans Peter Freyther1-0/+1
Use memset on the addr to initialize the entire structure. Fixes: Coverity CID 1042324
2013-07-05nat: Please coverity and initialize the saveptr to NULLHolger Hans Peter Freyther1-1/+1
Coverity complains about the saveptr used in the strtok_r. This is not a bug because we pass a string as part of the first call to strtok_r but it is easier to just initialize it. Addresses: Coverity CID 1042323
2013-07-04nitb: Add a missing NULL check for searching the subscriberHolger Hans Peter Freyther1-1/+8
"subscriber " SUBSCR_TYPES " ID sms pending-send could fail with an invalid ID/IMSI for the subscriber. Fixes: Coverity CID 1040715
2013-07-04db: Fix an issue with the memsetHolger Hans Peter Freyther1-1/+1
We want to memset the entire area of the atuple and not just the first four/eight bytes of the data. Fixes: Coverity CID 1040708
2013-07-04gsm_subscriber: Fix compiler warning of the printf stringHolger Hans Peter Freyther1-1/+1
This fixes both a GCC and a Coverity warning: GCC: gsm_subscriber.c: In function ‘subscr_expire_callback’: gsm_subscriber.c:389:2: warning: format ‘%i’ expects argument of type ‘int’, but argument 8 has type ‘long long unsigned int’ [-Wformat] Coverity: CID 1040712
2013-07-04nat: The second call didn't really add anything to the test.Holger Hans Peter Freyther1-3/+0
Avoid: Coverity CID 1042323
2013-07-04ipaccess-config: Add missing break to parsing the -L optionHolger Hans Peter Freyther1-0/+1
Fixes: Coverity CID 1040738
2013-07-04ipaccess-config: Fix a resource leak in an error pathHolger Hans Peter Freyther1-0/+1
Fixes: Coverity CID 1040710, CID 1040711
2013-07-04sgsn: Fix the unimplemented/uninstalled show ggsn commandHolger Hans Peter Freyther1-7/+0
This is fixing a GCC and Coverity warning. GCC: sgsn_vty.c: At top level: sgsn_vty.c:308:1: warning: ‘show_ggsn_cmd’ defined but not used [-Wunused-variable] Coverity: CID 1040727
2013-07-04sgsn_vty: Fix uninitialized variable in the gprs_apn2str methodHolger Hans Peter Freyther1-1/+1
This is fixing a GCC and Coverity warning: GCC: sgsn_vty.c: In function ‘vty_dump_pdp’: sgsn_vty.c:64:5: warning: ‘i’ may be used uninitialized in this function [-Wmaybe-uninitialized] sgsn_vty.c:49:15: note: ‘i’ was declared here Coverity: CID 1040706
2013-07-04sgsn: Fix logically dead code in regard to the osmo_fd_registerHolger Hans Peter Freyther1-4/+9
The code was written like checking the return value of the osmo_fd_register but the rc variable was not assigned for the subsequent calls. Fixes: Coverity CID 1040741
2013-07-04sgsn: Fix lengths of MS Network Capability and MS Radio Access Capability ↵Alexander Chemeris2-6/+5
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 Freyther14-498/+6
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-07-03nat: Fix compiler warning and cast uint16_t to uint8_tHolger Hans Peter Freyther1-2/+2
2013-07-03mgcp: Make sure the save pointer is initialized with NULL.Holger Hans Peter Freyther1-1/+1
Coverity is not happy about it but it doesn't appear to be a real issue as the data will not be NULL on the first call. Addresses: Coverity CID 1040704
2013-07-03ipaccess-find: Address a warning by coverity of unitialized memoryHolger Hans Peter Freyther1-0/+1
Use a memset on the sockaddr_in to make coverity happy. Fixes: CID 1040705
2013-07-03isdnsync: Remove a double close of the isdn deviceHolger Hans Peter Freyther1-1/+0
The fd is already closed above the if statement and Coverity detected this as a double close. Fixes: Coverity CID 1040703
2013-06-30nanobts: Do not crash on an invalid TRX numberHolger Hans Peter Freyther1-1/+1
In case the specified trx number is not configured, do not crash but return NULL from the function. The libosmo-abis library should close the connection for us then.
2013-06-24tests: Add a custom test runner to test the VTY functionality.Holger Hans Peter Freyther2-1/+112
Begin with the NAT code. It is not clear yet if we will have one file with all the tests or will have a sub directory with *.py files. In the long run the base class will move to the osmo-python-tests module.
2013-06-24misc: Ignore compiled python code and another test caseHolger Hans Peter Freyther1-0/+2
2013-06-24Introduced support for external python testsKaterina Barone-Adesi7-63/+145
The test scripts warn about missing documentation, untested configs, check common errors, and stub out testing individual VTY commands. The scripts have been moved to the another osmocom repository, python/osmo-python-tests The features were requested by zecke.
2013-06-24ctrlif: Flush/Clear write_queue when closing the control socketHarald Welte1-0/+1
2013-06-24bsc_vty: Print human-readable string version of NM ADM STATEHarald Welte1-2/+3
2013-06-21GPRS LLC: Add non-standard method of sequence number recoveryHarald Welte2-1/+21
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-06-19osmo-bsc VTY: fix saving of codec-listHarald Welte1-1/+1
the codec-list parser expects only spaces between the elements of the list, while the 'save' code is putting ", " between the elements
2013-06-12smpp: Only write the systemd-id if it is not emptyHolger Hans Peter Freyther1-1/+1
system_id is a char array, which makes the NULL check a tautology, so we should check with strlen if the string is empty or not. This is fixing the "write" command of VTY that would otherwise create a config file that can not be parsed.
2013-06-12Makefile.am: Use AM_CPPFLAGSAlexander Huemer24-24/+24
Since automake 1.13 INCLUDES is depricates and causes a warning
2013-05-29vty: Print the state of all GPRS OML objects in show btsHolger Hans Peter Freyther1-0/+8
For debugging GB-proxy/IPA issues it is nice to see the state of the OML objects.
2013-05-28SMPP: Add new 'dcs_transparent' ESME settingHarald Welte3-9/+58
If an ESME has the dcs_transparent config flag, then the TP-DCS of MO-SMS is transparently passed to SMPP and not converted to SMPP specific data_coding values. This is needed in cases where ESMEs actually care about the exact TP-DCS, as the conversion from TP-DCS to SMPP data_coding is not bijective.