aboutsummaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)AuthorFilesLines
2013-08-09Add new USSD shortcut to display IMSIjolly/ussdAndreas Eversberg1-19/+41
2013-08-09Fix: Use gsm_7bit_encode_ussd function to encode USSD responseAndreas Eversberg1-1/+1
The New function offers the actual octet that is needed to correctly compose USSD response.
2013-08-03Merge branch 'laforge/smpp-fixes'Holger Hans Peter Freyther1-10/+43
These commits have been deployed by sysmocom and it should qualify as some form of smoke testing. Let's see how things go from here. The by IMSI alertion has not been used, the rest should have been executed by the system.
2013-08-03SMPP: use VTY setting for E212/E164 in ALERT NOTIFICATIONHarald Welte1-24/+25
There's a VTY option by which for every ESME the user can specify if the E.212 or E.164 number should be used in DELIVER-SM. The ALERT notifications generate by subscriber LU have so far always contained the E.212 (IMSI) rather than E.164 (MSISDN) which is a bit inconsistent. Rather than copying code, we create a new function that implements ALERTing all ESMEs.
2013-08-03SMPP: convert a SMMA to a SMPP ALERT NOTIFICATIONHarald Welte1-0/+28
2013-08-03SMPP: don't get stuck in case of SMS memory exceededHarald Welte1-0/+4
If the MS memory for SMS is exceeded and we get an RP-layer error, we need to report that back to the (transaction-mode) ESME. Otherwise the ESME will wait forever after sending a SUBMIT-SM without ever receiving a response to it. Thanks to Holger for catching this.
2013-07-31Merge branch 'zecke/features/big-rewrite'Holger Hans Peter Freyther21-39/+843
2013-07-31nat: Use the DCC region for number rewriting and increase debug outputHolger Hans Peter Freyther1-8/+27
2013-07-31nat: Implement a post-routing for the NAT softwareHolger Hans Peter Freyther7-19/+141
* 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: Fix some memory leaks in the testcases.Holger Hans Peter Freyther1-0/+5
The test cases did not free some of the resources it allocated. Improve the situation a bit. There is still data allocated that is not freed at exit.
2013-07-31nat: Allow to use the prefix lookup to rewrite numbersHolger Hans Peter Freyther10-9/+203
* 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 Freyther13-3/+450
* 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-31nat: Add a no number-rewrite command and call it through a VTY testHolger Hans Peter Freyther2-4/+21
The test is just testing the invocation but does not verify that the side effect of this call. It is good enought for now.
2013-07-31gprs_gmm: Avoid assertion in the sending code during routing area updateHolger Hans Peter Freyther1-1/+1
Use old and new tlli as specified by the caller. WIP <000f> sgsn_libgtp.c:321 Received DELETE PDP CTX CONF, cause=128(Request accepted) <0013> gprs_sndcp.c:320 SNSM-DEACTIVATE.ind (lle=0x8095d08, TLLI=e3ddd574, SAPI=11, NSAPI=5) <0011> gprs_bssgp.c:376 BSSGP TLLI=0xe3ddd574 Rx UPLINK-UNITDATA <0012> gprs_llc.c:551 LLC SAPI=1 C FCS=0xb85a96CMD=UI DATA <0011> gprs_bssgp.c:376 BSSGP TLLI=0xe3ddd574 Rx UPLINK-UNITDATA <0012> gprs_llc.c:551 LLC SAPI=1 C FCS=0xbe5a96CMD=UI DATA <0002> gprs_gmm.c:214 Starting MM timer 3350 while old timer 3350 pending <0012> gprs_llc.c:417 LLC TX: unknown TLLI 0xe3ddd574, creating LLME on the fly Assert failed msgb_tlli(msg) == mmctx->llme->tlli || msgb_tlli(msg) == mmctx->llme->old_tlli || tlli_foreign2local(msgb_tlli(msg)) == mmctx->llme->tlli || tlli_foreign2local(msgb_tlli(msg)) == mmctx->llme->old_tlli gprs_llc.c:123 backtrace() returned 18 addresses /home/ich/install/openbsc/lib/libosmocore.so.4(osmo_generate_backtrace+0x16) [0xb7bb6a36] /home/ich/source/gsm/openbsc/openbsc/src/gprs/osmo-sgsn() [0x805224a] /home/ich/source/gsm/openbsc/openbsc/src/gprs/osmo-sgsn() [0x804a2f6] /home/ich/source/gsm/openbsc/openbsc/src/gprs/osmo-sgsn() [0x804b687] /home/ich/source/gsm/openbsc/openbsc/src/gprs/osmo-sgsn() [0x804bc35] /home/ich/source/gsm/openbsc/openbsc/src/gprs/osmo-sgsn() [0x804bd4e] /home/ich/source/gsm/openbsc/openbsc/src/gprs/osmo-sgsn() [0x804d20c] /home/ich/source/gsm/openbsc/openbsc/src/gprs/osmo-sgsn() [0x8052be4] /home/ich/source/gsm/openbsc/openbsc/src/gprs/osmo-sgsn(bssgp_prim_cb+0x55) [0x804f5a4] /home/ich/install/openbsc/lib/libosmogb.so.2(bssgp_rcvmsg+0x3b8) [0xb7b626b8] /home/ich/source/gsm/openbsc/openbsc/src/gprs/osmo-sgsn() [0x804f4f1] /home/ich/install/openbsc/lib/libosmogb.so.2(gprs_ns_rcvmsg+0x8c7) [0xb7b5ecf7] /home/ich/install/openbsc/lib/libosmogb.so.2(+0x4311) [0xb7b5f311] /home/ich/install/openbsc/lib/libosmocore.so.4(osmo_select_main+0x192) [0xb7bb2ed2] /home/ich/source/gsm/openbsc/openbsc/src/gprs/osmo-sgsn() [0x804fbcd] /lib/i386-linux-gnu/i686/cmov/libc.so.6(__libc_start_main+0xf5) [0xb796a8f5] /home/ich/source/gsm/openbsc/openbsc/src/gprs/osmo-sgsn() [0x8049db1] Program received signal SIGABRT, Aborted. 0xb7fde424 in __kernel_vsyscall () (gdb) bt #0 0xb7fde424 in __kernel_vsyscall () #1 0xb797f83f in __GI_raise (sig=sig@entry=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:56 #2 0xb7982cf3 in __GI_abort () at abort.c:90 #3 0x0805224f in _bssgp_tx_dl_ud (mmctx=0x80932d0, msg=0x80963a8) at gprs_llc.c:120 #4 gprs_llc_tx_ui (msg=0x80963a8, sapi=1 '\001', command=0, mmctx=0x80932d0) at gprs_llc.c:496 #5 0x0804a2f6 in gsm48_gmm_sendmsg (msg=0x80963a8, command=0, mm=0x80932d0) at gprs_gmm.c:241 #6 0x0804b687 in gsm48_tx_gmm_ra_upd_ack (mm=0x80932d0) at gprs_gmm.c:851 #7 0x0804bc35 in gsm48_rx_gmm_ra_upd_req (mmctx=0x80932d0, msg=0x8091ce8, llme=0x8095630) at gprs_gmm.c:1004 #8 0x0804bd4e in gsm0408_rcv_gmm (mmctx=0x80932d0, msg=0x8091ce8, llme=0x8095630) at gprs_gmm.c:1036 #9 0x0804d20c in gsm0408_gprs_rcvmsg (msg=msg@entry=0x8091ce8, llme=0x8095630) at gprs_gmm.c:1566 #10 0x08052be4 in gprs_llc_rcvmsg (msg=0x8091ce8, tv=0xbfffdcb0) at gprs_llc.c:882 #11 0x0804f5a4 in bssgp_prim_cb (oph=oph@entry=0xbfffdc8c, ctx=ctx@entry=0x0) at sgsn_main.c:114 #12 0xb7b626b8 in bssgp_rx_ul_ud (tp=0xbfffdcb0, msg=0x8091ce8, ctx=<optimized out>) at gprs_bssgp.c:398 #13 bssgp_rx_ptp (bctx=0x8091a08, tp=0xbfffdcb0, msg=0x8091ce8) at gprs_bssgp.c:820 #14 bssgp_rcvmsg (msg=0x8091ce8) at gprs_bssgp.c:1016 #15 0x0804f4f1 in sgsn_ns_cb (event=GPRS_NS_EVT_UNIT_DATA, nsvc=0x8090740, msg=0x8091ce8, bvci=1801) at sgsn_main.c:92 #16 0xb7b5ecf7 in gprs_ns_rx_unitdata (msg=0x8091ce8, nsvc=0x8090740) at gprs_ns.c:616 #17 gprs_ns_rcvmsg (nsi=nsi@entry=0x807fd38, msg=msg@entry=0x8091ce8, saddr=saddr@entry=0xbfffedc0, ll=ll@entry=GPRS_NS_LL_UDP) at gprs_ns.c:841 #18 0xb7b5f311 in handle_nsip_read (bfd=0x807fd58) at gprs_ns.c:991 #19 nsip_fd_cb (bfd=0x807fd58, what=1) at gprs_ns.c:1024 #20 0xb7bb2ed2 in osmo_select_main (polling=0) at select.c:158 #21 0x0804fbcd in main (argc=3, argv=0xbffff234) at sgsn_main.c:369 (gdb) frame 5 #5 0x0804a2f6 in gsm48_gmm_sendmsg (msg=0x80963a8, command=0, mm=0x80932d0) at gprs_gmm.c:241 241 return gprs_llc_tx_ui(msg, GPRS_SAPI_GMM, command, mm); (gdb) p msgb_tlli(msg) $1 = 3822966132 (gdb) frame 4 #4 gprs_llc_tx_ui (msg=0x80963a8, sapi=1 '\001', command=0, mmctx=0x80932d0) at gprs_llc.c:496 496 return _bssgp_tx_dl_ud(msg, mmctx); (gdb) p mmctx $2 = (void *) 0x80932d0 (gdb) frame 3 #3 0x0805224f in _bssgp_tx_dl_ud (mmctx=0x80932d0, msg=0x80963a8) at gprs_llc.c:120 120 OSMO_ASSERT(msgb_tlli(msg) == mmctx->llme->tlli (gdb) p mmctx $3 = (struct sgsn_mm_ctx *) 0x80932d0 (gdb) p *mmctx $4 = {list = {next = 0x8092e28, prev = 0x805c318 <sgsn_mm_ctxts>}, imsi = "901700000003094\000", mm_state = GMM_REGISTERED_NORMAL, p_tmsi = 296043751, p_tmsi_old = 2075232571, p_tmsi_sig = 0, imei = "353943044782210\000", msisdn = '\000' <repeats 14 times>, ra = {mnc = 70, mcc = 901, lac = 1, rac = 0 '\000'}, cell_id = 0, cell_id_age = 0, sac = 0, sac_age = 0, new_sgsn_addr = 0, ciph_algo = GPRS_ALGO_GEA0, ms_radio_access_capa = {len = 11 '\v', buf = "4\307\003*\240B|\255\341\030\v", '\000' <repeats 38 times>}, ms_network_capa = { len = 2 '\002', buf = "\345\200\000\000\000\000\000"}, drx_parms = 3329, mnrg = 0, ngaf = 0, ppf = 0, recovery = 0, radio_prio_sms = 0 '\000', pdp_list = {next = 0x8093390, prev = 0x8093390}, llme = 0x8095630, tlli = 3822966132, tlli_new = 3517269223, nsei = 1801, bvci = 1801, ctrg = 0x8096048, timer = {node = {rb_parent_color = 3082574944, rb_right = 0x0, rb_left = 0x0}, list = {next = 0x80933b8, prev = 0x80933b8}, timeout = { tv_sec = 1375260414, tv_usec = 864196}, active = 1, cb = 0x804bfd0 <mmctx_timer_cb>, data = 0x80932d0}, T = 3350, num_T_exp = 0, t3350_mode = GMM_T3350_MODE_RAU, t3370_id_type = 1 '\001'} (gdb) p msgb_tlli(msg) No symbol "msgb_tlli" in current context. (gdb) frame 5 #5 0x0804a2f6 in gsm48_gmm_sendmsg (msg=0x80963a8, command=0, mm=0x80932d0) at gprs_gmm.c:241 241 return gprs_llc_tx_ui(msg, GPRS_SAPI_GMM, command, mm); (gdb) frame 6 #6 0x0804b687 in gsm48_tx_gmm_ra_upd_ack (mm=0x80932d0) at gprs_gmm.c:851 851 return gsm48_gmm_sendmsg(msg, 0, mm); (gdb) p msgb_tlli(msg) $5 = 3822966132 (gdb) p mmctx->tlli No symbol "mmctx" in current context. (gdb) p mm->tlli $6 = 3822966132 (gdb) p mm->tlli_new $7 = 3517269223 (gdb) p mm->llme->tlli $8 = 3517269223 (gdb) p mm->llme->tlli_old There is no member named tlli_old. (gdb) p mm->llme->old_tlli $9 = 4222716219 (gdb) bt #0 0xb7fde424 in __kernel_vsyscall () #1 0xb797f83f in __GI_raise (sig=sig@entry=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:56 #2 0xb7982cf3 in __GI_abort () at abort.c:90 #3 0x0805224f in _bssgp_tx_dl_ud (mmctx=0x80932d0, msg=0x80963a8) at gprs_llc.c:120 #4 gprs_llc_tx_ui (msg=0x80963a8, sapi=1 '\001', command=0, mmctx=0x80932d0) at gprs_llc.c:496 #5 0x0804a2f6 in gsm48_gmm_sendmsg (msg=0x80963a8, command=0, mm=0x80932d0) at gprs_gmm.c:241 #6 0x0804b687 in gsm48_tx_gmm_ra_upd_ack (mm=0x80932d0) at gprs_gmm.c:851 #7 0x0804bc35 in gsm48_rx_gmm_ra_upd_req (mmctx=0x80932d0, msg=0x8091ce8, llme=0x8095630) at gprs_gmm.c:1004 #8 0x0804bd4e in gsm0408_rcv_gmm (mmctx=0x80932d0, msg=0x8091ce8, llme=0x8095630) at gprs_gmm.c:1036 #9 0x0804d20c in gsm0408_gprs_rcvmsg (msg=msg@entry=0x8091ce8, llme=0x8095630) at gprs_gmm.c:1566 #10 0x08052be4 in gprs_llc_rcvmsg (msg=0x8091ce8, tv=0xbfffdcb0) at gprs_llc.c:882 #11 0x0804f5a4 in bssgp_prim_cb (oph=oph@entry=0xbfffdc8c, ctx=ctx@entry=0x0) at sgsn_main.c:114 #12 0xb7b626b8 in bssgp_rx_ul_ud (tp=0xbfffdcb0, msg=0x8091ce8, ctx=<optimized out>) at gprs_bssgp.c:398 #13 bssgp_rx_ptp (bctx=0x8091a08, tp=0xbfffdcb0, msg=0x8091ce8) at gprs_bssgp.c:820 #14 bssgp_rcvmsg (msg=0x8091ce8) at gprs_bssgp.c:1016 #15 0x0804f4f1 in sgsn_ns_cb (event=GPRS_NS_EVT_UNIT_DATA, nsvc=0x8090740, msg=0x8091ce8, bvci=1801) at sgsn_main.c:92 #16 0xb7b5ecf7 in gprs_ns_rx_unitdata (msg=0x8091ce8, nsvc=0x8090740) at gprs_ns.c:616 #17 gprs_ns_rcvmsg (nsi=nsi@entry=0x807fd38, msg=msg@entry=0x8091ce8, saddr=saddr@entry=0xbfffedc0, ll=ll@entry=GPRS_NS_LL_UDP) at gprs_ns.c:841 #18 0xb7b5f311 in handle_nsip_read (bfd=0x807fd58) at gprs_ns.c:991 #19 nsip_fd_cb (bfd=0x807fd58, what=1) at gprs_ns.c:1024 #20 0xb7bb2ed2 in osmo_select_main (polling=0) at select.c:158 #21 0x0804fbcd in main (argc=3, argv=0xbffff234) at sgsn_main.c:369 (gdb) frame 3 #3 0x0805224f in _bssgp_tx_dl_ud (mmctx=0x80932d0, msg=0x80963a8) at gprs_llc.c:120 120 OSMO_ASSERT(msgb_tlli(msg) == mmctx->llme->tlli (gdb) p msgb_tlli(msg) No symbol "msgb_tlli" in current context. (gdb) frame 4 #4 gprs_llc_tx_ui (msg=0x80963a8, sapi=1 '\001', command=0, mmctx=0x80932d0) at gprs_llc.c:496 496 return _bssgp_tx_dl_ud(msg, mmctx); (gdb) p msgb_tlli(msg) No symbol "msgb_tlli" in current context. (gdb) frame 5 #5 0x0804a2f6 in gsm48_gmm_sendmsg (msg=0x80963a8, command=0, mm=0x80932d0) at gprs_gmm.c:241 241 return gprs_llc_tx_ui(msg, GPRS_SAPI_GMM, command, mm); (gdb) p msgb_tlli(msg) $10 = 3822966132 (gdb) p mm->tlli $11 = 3822966132 (gdb) p mm->tlli_new $12 = 3517269223 (gdb) p mm->tlli_new $13 = 3517269223 (gdb) p mm->llme->tlli $14 = 3517269223 (gdb) p mm->llme->tlli_old There is no member named tlli_old. (gdb) p mm->llme->old_tlli $15 = 4222716219 (gdb) p mm->llme->state $16 = GPRS_LLMS_ASSIGNED (gdb) q
2013-07-31gprs_llc: Assert that we send frames with either tlli or old_tlliHolger Hans Peter Freyther1-15/+21
In case we have access to the context verify that the selected msgb_tlli is either the old_tlli or the tlli in either local or foreign format. It is wrong to use any other TLLI.
2013-07-31gprs_llc: Work on finding the right LLE/LLME in case of routing area updateHolger Hans Peter Freyther1-65/+94
Attempt to solve what f0901f0067e363c0ced6254db1b45a9771640412 tried to solve without breaking the case of someone with a foreign TLLI from a different network. Lookup with the foreign TLLI converted to a local one in case we did not find the TLLI and only then create a LLE/LLME on the fly for the RX path.
2013-07-31gprs_llc: Lookup lle based on the real TLLIHolger Hans Peter Freyther1-3/+1
During the GPRS Attach procedure we might have a foreign tlli and in the RX create a LLME on the fly for this tlli. The GMM GPRS Attach handling code will then assign a new TLLI and keep the foreign tlli as the llme->old_tlli. When the GMM is sending the identity request the msgb_tlli will point to the foreign tlli. The GPRS LLC code will then try to find that foreign tlli but due the conversion this will not be found. Instead a new ad-hoc LLE/LLME will be created on the fly for each message (this means there are duplicate LLE/LLMEs in the list). Make the code more strict and remove the tlli_foreign2local change from the look-up routine. This will make the GPRS LLC code find the right LLE/LLME and the N(U) will be handled correctly. This partially reverts: f0901f0067e363c0ced6254db1b45a9771640412 Addresses: <0012> gprs_llc.c:773 LLC RX: unknown TLLI 0xadf11820, creating LLME on the fly ... <0012> gprs_llc.c:357 LLC TX: unknown TLLI 0xedf11820, creating LLME on the fly Reproducable: Use pcu_emu (gprs attach) and observe with wireshark.
2013-07-31gprs_sgsn: In case of a Activate PDP Context timeout we should free pdpHolger Hans Peter Freyther1-0/+9
In case of a failure this method didn't set the pctx->lib back to NULL. In case of a timeout the callback will be made with pdp=NULL and this would lead to leaking the PDP context. Check for the case of having a pctx->lib != pdp and free it. This resolves: <000f> gprs_sgsn.c:259 freeing PDP context that still has a libgtp handle attached to it, this shouldn't happen!
2013-07-28gprs: Fix a typo in the commentHolger Hans Peter Freyther1-1/+1
2013-07-27tests: TestCase.assertGreater is not available on Python 2.5Holger Hans Peter Freyther1-2/+2
The jenkins build node has Python 2.5.X installed and the assertGreater method is not available. Use assert_ until we can use newer versions of Python.
2013-07-27expiration: Allow to disable the periodic location updating procedureHolger Hans Peter Freyther5-28/+101
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 Freyther6-17/+66
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-27expiration: Print the "expire_lu" time in show subscriberHolger Hans Peter Freyther1-0/+9
This can help with debugging subscriber expiration issues.
2013-07-27smpp: Move the coding/mode detection into a utils fileHolger Hans Peter Freyther13-37/+174
Make sure to not ever have issues with this code again, move the utility code to a new file and create a basic testcase. The method currently has 100% line and branch coverage. My initial patched missed the smpp_utils.c file and I re-did the copying (and verifying the branch coverage)
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