aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/tests/bsc-nat/bsc_nat_test.c
AgeCommit message (Collapse)AuthorFilesLines
2012-01-10nat: Reduce copy and paste in the test, create a verify_msgHolger Hans Peter Freyther1-50/+23
2012-01-06nat: Log test output stdout using printf in prep for GNU autotestHolger Hans Peter Freyther1-78/+97
2011-08-22misc: Move the bsc_parse_reg to libcommom and name it gsm_parse_regHolger Hans Peter Freyther1-3/+3
Move the regexp parsing code from the NAT to libcommon as it will be used by the NAT and BSC code. This also adds the #include <regex.h> include to gsm_data. This header should be split up.
2011-06-01nat: Look into the TPDU/SMS-SUBMIT and use the TP-DestAddress for matchesHolger Hans Peter Freyther1-9/+17
Match the used SMSC and the destination of the SMS and change the SMSC address if both are matched.
2011-06-01nat: Patch the destination SMS address of a messageHolger Hans Peter Freyther1-3/+47
Use the same filtering infrasturcture to patch the SMSC address in a CP-DATA/RP-DATA message. Add a very simple testcase for this code.
2011-06-01nat: Prepare to patch more than the CC Setup messageHolger Hans Peter Freyther1-4/+4
Refactor the code to allow having different handlers. The goal is to be able to patch some SMS messages too.
2011-06-01nat: Allow to have a regexp to match the MSISDNHolger Hans Peter Freyther1-1/+3
The idea that MCC and MNC is enough to classify a subscriber turns out to be wrong. Certain operatos license a number range of IMSIs to others. When we see a '^' in the MCC field we treat it as a regexp. The code now turns the MCC/MNC into a regexp for the IMSI. It is not using extended POSIX regexp to match the behavior of the access list.
2011-05-12misc: Use the osmo_init code for signals and loggingHolger Hans Peter Freyther1-6/+2
Use the libosmocore code to ignore certain signals by default (e.g. SIGHUP, SIGPIPE) and use the new code to create a default stderr logging target and initialize it properly.
2011-05-07src: rename msg_entr* to osmo_config_*Pablo Neira Ayuso1-2/+2
Summary of changes: s/msg_entry_parse/osmo_config_list_parse/g s/msg_entry/osmo_config_entry/g s/msg_entries/osmo_config_list/g
2011-05-07src: use namespace prefix osmo_* for misc utilsPablo Neira Ayuso1-4/+4
Summary of changes: s/bcd2char/osmo_bcd2char/g s/char2bcd/osmo_char2bcd/g s/hexparse/osmo_hexparse/g s/hexdump/osmo_hexdump/g s/hexdump_nospc/osmo_hexdump_nospc/g s/ubit_dump/osmo_ubit_dump/g s/static_assert/osmo_static_assert/g
2011-05-02nat: Rewrite the paging handling.Holger Hans Peter Freyther1-20/+3
The current code tries to find _one_ bsc for a paging message and then continues. The new code will try to find multiple BSCs for each LAC. This is done in preparation of having two BSCs handle the same LAC. This code right now is O(m*n) but it will be worse once paging groups are landed. The code to test the function was reduced to just test the lac lookup code as the other part can not be tested in a standalone setup anymore.
2011-04-04nat: Bail out if the regexp fails to compile and avoid a crashHolger Hans Peter Freyther1-6/+9
If the regexp fails to compile the internal dfa is NULL and a regexec will crash nicely. Fail and free the string if the regexp fails to compile.
2011-03-26tests: fix bsc-nat testPablo Neira Ayuso1-2/+2
In 136f453dd2492b95004461a33c90b11732f33bd8, I forgot to update the new header path in the test/bsc-nat files (this happened to me because I forgot to configured openBSC without --enable-nat).
2011-02-28mgcp: Introduce a mgcp_trunk_config enum for endpoint configsHolger Hans Peter Freyther1-2/+2
We want to support real trunks in the MGCP code and we need to have some better book keeping for those. Move the code around.
2011-02-27nat: Fix some corruption in the test caseHolger Hans Peter Freyther1-0/+2
2011-02-27nat: Change number of multiplexes to the max-endpointsHolger Hans Peter Freyther1-3/+4
2011-02-26nat: Allocate endpoints from multiple multiplexes.Holger Hans Peter Freyther1-0/+45
This code allocates endpoints from multiple multiplexes but will always leave 0x0 and 0x1f unassigned in the multiplex.
2011-02-26nat: Verify that we are not assigning 0x1f as endpoint.Holger Hans Peter Freyther1-5/+5
On a classic BSC we have 32 channels but one is reserved for signalling. Make sure that we are not assigning 0x1f as we assume that this is the signalling channel. This means that from 32 possible voice channels we are only going to use 30 as we are already not using the 0x0.
2011-02-26nat: Allocate the endpoint status dynamicallyHolger Hans Peter Freyther1-2/+2
Allocate the status for an endpoint dynamically. We will support BSCs with different amount of multiplexes and need to have this flexibility in the future. Add the proper null checks to the current users of this code.
2011-02-25nat: Update the tests to make them going againHolger Hans Peter Freyther1-0/+3
We now need to have access to a mgcp_cfg and the change to the setup number patching needs new data. We now set the number to international type.
2011-02-11[BSC] Move the BTS-type specific code from bcs_init.c to bts_*.cHarald Welte1-8/+0
bsc_init.c was a big mess even only for two supported BTS models, so before adding more BTS types, this needs a cleanup. All the BTS specific code from bsc_init.c has now moved into bts_{siemens_bs11,ipaccess_nanobts}.c This has required that input_event() and nm_state_event() get both converted to proper libosmocore signals instead of referencing external symbols.
2011-01-01License change: We are now AGPLv3+ instead of GPLv2+Harald Welte1-5/+4
The reason for this is quite simple: We want to make sure anyone running a customized version of OpenBSC to operate a network will have to release all custom modifiations to the source code.
2010-10-28nat: Add test case for matching phone numbers0.9.10Holger Hans Peter Freyther1-0/+62
Add the test case for matching '*' and for not matching at all
2010-10-27nat: Implement rewriting, have a very basic test for that featureHolger Hans Peter Freyther1-0/+82
2010-10-21nat: Copy the IMSI, then free it or move the context to the connectionHolger Hans Peter Freyther1-1/+3
Extract the IMSI from the first message as well and safe it in the connection structure. The problem is that we do not have this structure at this point, so we will allocate the imsi as child of the bsc_connection and then move/steal it.
2010-10-19nat: Change the order of the DENY/ALLOW rule for the BSC.Holger Hans Peter Freyther1-1/+18
Currently it is not is not easily possible to disable everyone and then only allow certain SIMs. By changing the order we can do: access-list imsi-deny only-something ^[0-9]*$ access-list imsi-allow only-something ^123[0-9]*$ and still keep the usecase of only forbidding certain SIMs on certain LACs. Adjust test case, test that the other cases are still functional.
2010-10-08nat: Allow a BSC to have multiple LACsHolger Hans Peter Freyther1-8/+18
Make it possible that one BSC is serving multiple cells. Introduce a list of lacs, add functions to manipulate the lists. The current test cases for paging by lac continue to work.
2010-09-20nat: Test for a bug inside the TLV definition for GSM 08.08Holger Hans Peter Freyther1-2/+21
The 0x1 inside a CIC IE could indicate a new IE... add test data and test case to verify that the patching works correctly.
2010-09-20nat: Test the endpoint finding a bit better...Holger Hans Peter Freyther1-3/+5
2010-09-15nat: Parse the id response, extract the IMSI, compare itHolger Hans Peter Freyther1-0/+54
Add a test case and also add a basic check that we got some size checks correct. The next step is to act on the result.
2010-09-15nat: Update the test for the new <0,0,1 semantic of the filter functionHolger Hans Peter Freyther1-5/+5
A test case with a TMSI is missing, this would be needed for better coverage of the filter test case.
2010-08-30nat: Replace the MGCP Endpoint if that is requiredHolger Hans Peter Freyther1-1/+1
Add code to replace the Endpoint number for the mgcp.
2010-08-29nat: Attempt to assign the BSC Timeslot based on a free listHolger Hans Peter Freyther1-4/+9
Do attempt to not reassign an endpoint immediately but go to the next free one.
2010-08-29nat: Make the code work in terms of endpoints instead of timeslot/multiplexHolger Hans Peter Freyther1-12/+5
We are going to have more than one trunk, so all code hardcoding the multiplex to zero must go. Avoid this kind of problem by saving the MGCP endpoint number and comparing that.
2010-08-03Use new include paths of libosmo-sccp 0.0.2Harald Welte1-1/+1
2010-07-31nat: Fix compilation with nat not being enabled.Holger Hans Peter Freyther1-0/+1
common_vty.c was including bsc_nat.h which tried to get the sccp/sccp_types.h which is not required to be installed. Move all structs using/embedding SCCP structures into the bsc_nat_sccp.h and include. This should fix the compilation.
2010-07-31sccp: Use the external libosmo-sccp as sccp implementationHolger Hans Peter Freyther1-0/+3
Add --enable-nat and --enable-osmo-bsc to build applications requiring the Osmo SCCP library to be installed. We are not using autodiscover as this is out of fashion.
2010-07-23nat: u_int16_t -> uint16_tHolger Hans Peter Freyther1-1/+1
2010-07-23nat: u_int8_t -> uint8_tHolger Hans Peter Freyther1-15/+15
2010-07-05nat: Fix the testcase and init the logging infrastructureHolger Hans Peter Freyther1-0/+1
2010-06-17bsc_api: Move gsm48_rcvmsg into the BSC API and dispatch.Holger Hans Peter Freyther1-4/+0
The next step in the way to the BSC API. We have a clear a new connection was opened signal now... and the MSC could use it...
2010-06-15nat: Make the test compile, no bssap.c, use log_targetHolger Hans Peter Freyther1-4/+4
2010-06-15nat: Allow to specify multiple entries in the access-list...Holger Hans Peter Freyther1-3/+10
Inside the access-list we have a list of entries that have either one allow or one deny rule... we do not allow to remove a single rule but one has to remove the whole list, in that case talloc will handle cleaning all entries. Right now the matching is O(n*m) as we traverse the list (multiple times) and run the regexp multiple times. One way to make it faster would be to concat all regexps into one.
2010-06-15nat: Shorten the access-list struct and method names (still way too long)Holger Hans Peter Freyther1-3/+3
2010-06-15[nat] Introduce the concept of access-listHolger Hans Peter Freyther1-3/+9
One can set one access-list to one BSC and one access-list to one NAT. The matching of IMSIs remains the same for now, also applying the white/blacklist. Access lists can not be deleted for now and no perf opt is done (e.g. one could cache the result of the last lookup in the bsc struct).
2010-06-15[nat] Make create_sccp_src_ref return the SCCP Connection.Holger Hans Peter Freyther1-3/+7
Right now it was not possible to just find a connection, by returning the connection that is created we will have direct access to it. It will be used by the local connection handling.
2010-06-15[nat] Remove parameter that is never accessed directlyHolger Hans Peter Freyther1-1/+1
The msgb needs to be around when we access the parsed structure but that needs to be guranteed by the caller handing out the parsed structure.
2010-06-15[nat] Set the connection type/reason as out parameterHolger Hans Peter Freyther1-2/+15
We are analyzing each CR message and it is nice to know the reason these connections were created. Change the nat method.
2010-06-15[nat] Parse the PAGING RESPONSE inside a CR message as well.Holger Hans Peter Freyther1-0/+16
Now we are parsing a CM Service Request, Location Updating Request and the Paging Response. For all other messages we claim to not support it and force a refuse.
2010-06-15[nat] Remove the imsi allow option on the nat level.Holger Hans Peter Freyther1-5/+0
For now we have: 1.) bsc imsi deny to deny at the BSC level 2.) bsc imsi allow to allow a SIM at the BSC level 3.) nat imsi deny to deny at the global level