aboutsummaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)AuthorFilesLines
2014-04-04gprs: Fix compiler warnings in gprs_sndcp.cHolger Hans Peter Freyther1-4/+2
CC gprs_sndcp.o gprs_sndcp.c: In function ‘defrag_input’: gprs_sndcp.c:188:25: warning: variable ‘scomph’ set but not used [-Wunused-but-set-variable] struct sndcp_comp_hdr *scomph = NULL; ^ gprs_sndcp.c: In function ‘sndcp_llunitdata_ind’: gprs_sndcp.c:512:11: warning: variable ‘npdu_num’ set but not used [-Wunused-but-set-variable] uint16_t npdu_num; ^ gprs_sndcp.c: At top level: gprs_sndcp.c:565:12: warning: ‘sndcp_ll_reset_ind’ defined but not used [-Wunused-function] static int sndcp_ll_reset_ind(struct gprs_sndcp_entity *se) ^ gprs_sndcp.c:573:12: warning: ‘sndcp_ll_status_ind’ defined but not used [-Wunused-function] static int sndcp_ll_status_ind() ^
2014-04-04gprs: Reduce the number of compiler warnings in gprs_gmm.cHolger Hans Peter Freyther2-11/+18
CC gprs_gmm.o gprs_gmm.c: In function ‘gsm48_tx_gmm_att_ack’: gprs_gmm.c:350:11: warning: unused variable ‘ptsig’ [-Wunused-variable] uint8_t *ptsig, *mid; ^ gprs_gmm.c: In function ‘gsm48_rx_gmm_auth_ciph_resp’: gprs_gmm.c:524:6: warning: variable ‘rc’ set but not used [-Wunused-but-set-variable] int rc; ^ gprs_gmm.c: In function ‘gsm48_rx_gmm_att_req’: gprs_gmm.c:703:9: warning: implicit declaration of function ‘sgsn_acl_lookup’ [-Wimplicit-function-declaration] !sgsn_acl_lookup(mi_string))) { ^ gprs_gmm.c:632:40: warning: variable ‘old_ra_info’ set but not used [-Wunused-but-set-variable] uint8_t *cur = gh->data, *msnc, *mi, *old_ra_info, *ms_ra_acc_cap; ^ gprs_gmm.c: In function ‘gsm48_rx_gmm_ra_upd_req’: gprs_gmm.c:915:6: warning: variable ‘rc’ set but not used [-Wunused-but-set-variable] int rc; ^ gprs_gmm.c:910:11: warning: variable ‘ms_ra_acc_cap’ set but not used [-Wunused-but-set-variable] uint8_t *ms_ra_acc_cap; ^ gprs_gmm.c: At top level: gprs_gmm.c:458:12: warning: ‘gsm48_tx_gmm_auth_ciph_req’ defined but not used [-Wunused-function] static int gsm48_tx_gmm_auth_ciph_req(struct sgsn_mm_ctx *mm, uint8_t *rand, ^ gprs_gmm.c:501:12: warning: ‘gsm48_tx_gmm_auth_ciph_rej’ defined but not used [-Wunused-function] static int gsm48_tx_gmm_auth_ciph_rej(struct sgsn_mm_ctx *mm) ^ gprs_gmm.c:1169:13: warning: ‘msgb_put_pdp_addr_ipv4’ defined but not used [-Wunused-function] static void msgb_put_pdp_addr_ipv4(struct msgb *msg, uint32_t ipaddr) ^ gprs_gmm.c:1180:13: warning: ‘msgb_put_pdp_addr_ppp’ defined but not used [-Wunused-function] static void msgb_put_pdp_addr_ppp(struct msgb *msg)
2014-04-04rsl: Add missing breaks in the codeHolger Hans Peter Freyther1-0/+6
Given that the method is only called for a traffic channels the missing breaks didn't hurt. Fixes: Coverity CID 1040731, CID 1040732, CID 1040733, CID 1040734
2014-04-04sgsn: Comparing array to NULL is not usefulHolger Hans Peter Freyther1-1/+1
.v is a unsigned char array with up-to 255 elements. We do not need to add a null check here. Fixes: Coverity CID 1040719
2014-04-04bsc/msc: Extension can never be NULL use strlen insteadHolger Hans Peter Freyther2-2/+2
Fixes: Coverity CID 1040717
2014-04-04msc: Name is never NULL use strlen to check if it is emptyHolger Hans Peter Freyther1-1/+1
Fixes: Coverity CID 1040716
2014-04-04abis: Check for failure of ftellHolger Hans Peter Freyther1-0/+5
In case ftell -1 will be returned. Coverity complained that the pos we pass to fseek might be negative. In case the ftell fails we are at the last line for sure. Fixes: Coverity CID 1040721
2014-04-03ipa: Be consistent in checking conn->cfg (Coverity)Jacob Erlbeck1-1/+1
Coverity complains about checking connection->cfg in bsc_close_connection() at one place but not at the second. This patch fixes this by adding a check before accessing cfg when generating the 'partial message' log message. Fixes: Coverity CID 1195180 Sponsored-by: On-Waves ehf
2014-04-03nat: Mention the the BSC the SCCP connection was onHolger Hans Peter Freyther1-3/+5
The log message lacked a lot of context. A SCCP connection is created on behalf of a configured BSC. This way we should be able to always list this information.
2014-04-03gbproxy/debian: Add a start script for the GBproxyHolger Hans Peter Freyther1-0/+151
Fixes: OW#1164
2014-04-03nat/debian: Create an init script for the nat applicationHolger Hans Peter Freyther1-0/+153
2014-04-01ipa: Use enhanced ipa_msg_recv_buffered() to cope with partioned IPA messagesJacob Erlbeck9-10/+50
The old ipa_msg_recv() implementation didn't support partial receive, so IPA connections got disconnected when this happened. This patch adds the handling of the temporary message buffers and uses ipa_msg_recv_buffered(). It has been successfully tested by jerlbeck with osmo-nitb and osmo-bsc. Ticket: OW#768 Sponsored-by: On-Waves ehf
2014-03-26ctrl/abis: When the max_power_reduction changes, send it to the BTSHolger Hans Peter Freyther3-1/+31
In case the max_power_reduction changes, issue a new Set Radio Carrier Attributes command. OML 12.21 allows to not include the ARFCN list and the semantic I picked/understand is that a partial update is possible. Fixes: SYS#267
2014-03-23sgsn/ctrl: Add ctrl interface, implement listing subscribersHolger Hans Peter Freyther6-4/+191
Add the control interface with no hierachy right now and implement the first command to list IMSI + Context Address of active sessions. sgsn_cmd_handle could share more code with bsc variant. Fixes: SYS#264, SYS#265
2014-03-23ctrl: Move the lookup into a separate file in preparation for GPRSHolger Hans Peter Freyther9-157/+200
For GPRS the look-up via bts/trx does not make any sense and would introduce bad depdencies for the SGSN. Move the look-up code to a new file and introduce new setup methods.
2014-03-23nitb/ctrl: Implement a command to list all active subscribersHolger Hans Peter Freyther4-0/+70
This is only useful for small networks. List the IMSI and MSISDN of all active subscribers. Fixes: SYS#266
2014-03-23nitb/ctrl: Implement creating and deleting subscribersHolger Hans Peter Freyther4-1/+141
Sadly there is no proper foreign key relationship on the tables that related to the Subscriber. This means we can't use a DELETE with Cascade and need to delete everything by hand. To make things worse maybe the SMS/Paging code is still using the subscriber making the operation more dangerous. I had added NULL checks for sender_id/receiver_id at 30C3 so we should not crash in this situation. Fixes: SYS#274
2014-03-23nitb/ctrl: Add command to add/modify a subscriber to the databaseHolger Hans Peter Freyther5-2/+146
The test has been manually verified. Executing the select for the subscribers showed: sqlite> select * from Subscriber; 1|2014-03-23 12:12:46|2014-03-23 12:19:09|2620345||445567|1||0| This created a subscriber with the right IMSI, MSISDN and has it authorized. Fixes: SYS#275
2014-03-23nitb/ctrl: Add ctrl command to set the TRX max_power_reductionHolger Hans Peter Freyther2-0/+42
In case the BTS is connected the new attribute should be set through OML. This is left as a todo item. Addresses: SYS#267
2014-03-21systemd: Add service for the osmo-sgsnHolger Hans Peter Freyther1-0/+8
Fixes: SYS#175
2014-03-21systemd: Saying these services restart once should be enoughHolger Hans Peter Freyther2-2/+0
2014-03-20Merge branch 'jolly/mncc'Holger Hans Peter Freyther8-23/+46
Merge the interface changes to the MNCC protocol
2014-03-20mncc: Add support for half rate V1 frames to MNCC/RTP interfaceAndreas Eversberg2-2/+18
2014-03-20mncc: Use helper function to check if an MNCC frame is data (speech/traffic)Andreas Eversberg3-16/+17
Rename method mncc_rcv_tchf() to mncc_rcv_data(), because the check applies to all types of data frames, not only TCH/F data.
2014-03-20mncc: Complete definitions for all speech traffic frames at MNCC interfaceAndreas Eversberg4-5/+11
The new definitions are: half rate and AMR Change of definition name for bad frame, because it applies to all types of traffic, not only TCH/F. Increase MNCC interface version to 4. Version 3 is skipped, because it was used by older version of Linux-Call-Router which is incompatible with the current version of the MNCC interface.
2014-03-20mgcp: The valid payload types start at 0. Fix the VTYHolger Hans Peter Freyther1-4/+4
2014-03-13systemd: Remove the second occurance of Restart=alwaysHolger Hans Peter Freyther1-1/+0
2014-03-11trau: Fix linking on FreeBSD by using LIBRAY_DLNikola1-1/+1
2014-03-09sms: Rename gsm340_gen_tpdu() to gsm340_gen_sms_deliver_tpdu()Alexander Chemeris1-5/+5
Rename gsm340_gen_tpdu() to gsm340_gen_sms_deliver_tpdu() to show that it generates SMS-DELIVER TPDU and is not a generic function.
2014-03-09db,sms: Rename db_sms_mark_sent() to db_sms_mark_delivered()Alexander Chemeris3-4/+4
In MT-SMS the message is being delivered. Make the naming follow that. The schema still refers to "sent" while it should be "delivered" too.
2014-03-09db: Add more tests for retrieving subscribers from a DB.Alexander Chemeris1-2/+36
2014-03-07db: Remove the german from the log messageAlexander Chemeris1-1/+1
2014-03-06Merge branch 'daniel/smpp-fixes'Holger Hans Peter Freyther3-19/+179
2014-03-06nitb/smpp: Add simple test runner for the issues found by danielHolger Hans Peter Freyther2-1/+140
Send the two strings that caused the read handling to misbehave. Verify that we handle this correctly by still being able to issue a VTY command. The CPU load issue could not be verified like this.
2014-03-06smpp_smsc: Fix integer overflow in read return value and msgb_alloc()Daniel Willmann1-6/+6
The size parameter of msgb_alloc is uint16_t so any length value above 65535 will allocate a msgb with incorrect size. This patch changes the type of rdlen and rc to ssize_t (the return value of read) and guards against the read length being larger than UINT16_MAX. To reproduce the issue run: echo -en "\x00\x01\x00\x01\x01" |socat stdin tcp:localhost:2775
2014-03-06smpp_smsc: Check that the size is large enough to hold actual dataDaniel Willmann1-0/+6
The first 4 bytes are the length including the length field. For length < 4 the subsequent msgb_put(msg, sizeof(uint32_t)) will fail, resulting in an abort. The code also expects (in smpp_msgb_cmdid()) the existence of 4 more bytes for the SMPP command ID. This patch checks that the length received is large enough to hold all 8 bytes in the msgb and drops the connection if that's not the case. The issue is reproducible with: echo -e "\x00\x00\x00\x02\x00" |socat stdin tcp:localhost:2775
2014-03-06smpp_smsc: Fix socket read() error handlingDaniel Willmann1-16/+31
Read returning -1 is an error here so make sure to print the actual reason and close the socket. Before this patch we just looped over the fd with read returning -1 every time. EINTR is handled to not cause an error and we don't need to check EAGAIN/EWOULDBLOCK since the callback is only called in case there is something to read. To avoid copy&paste issues the check is implemented as a macro and the log message moved into a separate if.
2014-03-06nitb: Add a test for "show network" in the python testsuite.Ciaby2-3/+11
Make sure that bsc_gsmnet->bsc_data->rf_ctrl is initialized for NITB. In commit a9fae1ae66df57f76a0aedbd0b56228959d37d56 the conditions for the rf_ctrl was removed but it was still needed for the NITB. Fixes regression from: a9fae1ae66df57f76a0aedbd0b56228959d37d56 bsc: rf_ctrl will always be created, remove the NULL checks
2014-03-06Merge branch 'zecke/features/extended-control'Holger Hans Peter Freyther9-24/+380
2014-03-06nat: Add CTRL command test case for the new control commandsHolger Hans Peter Freyther3-3/+50
2014-03-04nat: Introduce command to remove an access-list-nameHolger Hans Peter Freyther1-0/+5
2014-03-04nat: Implement setting the access-control-name through CTRL interfaceHolger Hans Peter Freyther1-19/+99
For operation we want to switch the access-list of a BSC at runtime in a programatic way. Sponsored-by: On-Waves ehf
2014-03-04bsc: Include the MCC/MNC in the location trapHolger Hans Peter Freyther1-1/+5
It is of interest to know the MCC/MNC that is broadcasted at the specific position. Sponsored-by: On-Waves ehf
2014-03-04libbsc: Add command to set MNC/MCC and apply it if something changedHolger Hans Peter Freyther2-1/+104
Change the splitting of the ctrl_test_runner.py. Make sure that we get one element and all the rest.
2014-03-04libbsc: Add ctrl command to apply the configurationHolger Hans Peter Freyther1-0/+31
Right now this only works for IP based BTS like the sysmoBTS and by dropping the OML link.
2014-03-04libbsc: Add ctrl command for MNC, MCC, short-name and long-nameHolger Hans Peter Freyther5-1/+87
Add the framework for adding more setting commands.
2014-02-24sms: Address the TODO and schedule the next SMS for an active subscriberHolger Hans Peter Freyther1-6/+45
When one SMS has been delivered check if a second SMS can be scheduled to that subscriber. If nothing can be scheduled kick the normal SMS queue as one slot has become free now. Otherwise send the SMS and create a pending entry.
2014-02-24sms: Do not interfere with the SMS queue from within gsm_04_11Holger Hans Peter Freyther2-17/+6
It was possible that two SMS would be delivered at the same time which violates GSM 04.11. We should solely rely on the sms queue to schedule more SMS to the subscriber.
2014-02-22bsc: Add vty command to send location trap through VTYHolger Hans Peter Freyther3-6/+38
I have manually tested this by entering the VTY command and observing the CTRL interface using wireshark. Ticket: OW#1129
2014-02-21SMPP: UCS2 data_coding is 0x08, not 0x80!Harald Welte1-1/+1
As can clearly be seen from SMPP Spec v3.4 Chapter 5.2.19, a SUBMIT-SM with data_coding == 0x08 is UCS2, not with 0x80. Thanks to ciaby@rhizomatica.org for reporting the bug.