aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/tests/bsc-nat
AgeCommit message (Collapse)AuthorFilesLines
2010-10-27nat: Implement rewriting, have a very basic test for that featureHolger Hans Peter Freyther2-0/+107
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-12misc: Replace the idiom for replacing a string with a function callHolger Hans Peter Freyther1-1/+2
Remove a lot of code in favor of a new function that is freeing the old string and copying the new one. I should have gotten the context and the strings right.
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 Freyther2-3/+22
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 Freyther2-0/+62
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 Freyther2-4/+4
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 Freyther2-2/+5
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 Freyther2-29/+29
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 Freyther2-6/+5
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
2010-06-15[nat] Fix the regexp of the test and the command line.Holger Hans Peter Freyther1-3/+3
2010-06-15[nat] Implement IMSI filtering...Holger Hans Peter Freyther1-8/+104
2010-06-15nat: Start to add a test case.. with one CR message.Holger Hans Peter Freyther1-0/+19
2010-06-15nat: Store the creation time of a sccp connection.Holger Hans Peter Freyther1-1/+1
Generate it when creating the connection but also when reusing an existing connection.
2010-06-15nat: Change MGCP DLCX handling and send dummy MDCX to the BTS.Holger Hans Peter Freyther1-1/+13
When setting a new MSC timeslot to a SCCP connection check if any of the existing connections have this timeslot, if so we will send a DLCX down the stream to make sure it is closed there, when we will CRCX this new timeslot we will happily reallocate it. When the SCCP connection goes away, or we get a DLCX from the network, or the BSC is gone we will send a DLCX message down the stream as well. When we receive a CRCX from the network we will forward the CRCX as usual and send a dummy MDCX after it. For the DLCX and the dummy MDCX we send a custom MGCP message that will not provoke an answer. Even if the downstream MGCP GW will answer we will ignore it due the dummy transaction id that is not used anywhere else. This change should make sure that we close the dowstream endpoint all the time, even when the DLCX arrives after the SCCP connection is torndown.
2010-06-15[nat] Lookup by BSC Connection otherwise the point of reassigning the is ↵Holger Hans Peter Freyther1-5/+5
defeated When sending a MSG to the MSC try to find the to be used "src" reference by comparing the reference on the BSC and the BSC connection. Only this tuple needs to be unique. Actually only when looking at the SRC REF we need to compare the BSC as the dest reference should be unique but we are just making the check a bit stronger to make it look symmetric.
2010-06-15[nat] Add unit test to forward Proto Error messages back both ways.Holger Hans Peter Freyther1-0/+19
2010-06-15nat: Fix the test case by allocating a config.Holger Hans Peter Freyther1-0/+1
For the statistics we do need to have an allocated config, otherwise we will nicely crash.
2010-06-15nat: Return the SCCP Connection again...Holger Hans Peter Freyther1-2/+2
We will reset the multiplex in a DLCX message and then we can reset the multiplex as well...even if the MGCP connection is staying open. or at least this is a theory. The MSC likes to leave a connection open during CallControl when hanging up early enough in the process.
2010-06-15nat: Print the LAC that was searched for and not found.Holger Hans Peter Freyther1-3/+4
2010-06-15nat: Store the config in the connection instead of the lacHolger Hans Peter Freyther1-2/+4
This allows that we can print the Nr. next to the lac and it allows us to change the lac at runtime without reconnecting the BSC.
2010-06-15Revert "nat: Remember where the BTS is listening for things."Holger Hans Peter Freyther1-14/+0
Remove the code to parse port as we need to discover the BTS behind the nat and most likely it will have a different port than the one advertised by the BTS. This reverts commit c6a1fe773d16eb20d4cb1d3097761419436f4537.
2010-06-15nat: Test forwarding Inactivity Test messages.Holger Hans Peter Freyther1-0/+19
No change needed to the code.
2010-06-15nat: remove is called on already patched connections..Holger Hans Peter Freyther1-0/+4
Fix the test to search for the original message instead of the already patched one that should not find any items anyway. The remove is called on already patched connections so we need to match it with the patch reference count.
2010-06-15nat: Remember where the BTS is listening for things.Holger Hans Peter Freyther1-0/+14
Extract the port from the BSS's MGCP Gateway so we know where to forward the data to.
2010-06-15nat: Remove the broken empty line check, follow \n vs \r\n of inputHolger Hans Peter Freyther1-0/+10
Instead of checking the token for NULL we need to check if running was set to null. Look at the data of the token and check if the line was ending with a \r\n or \n and then when rewriting a line use that line ending as well. Add a new test for that.
2010-06-15nat: Make rewrite work on string, read to a string first, copy to msgbHolger Hans Peter Freyther1-7/+4
The MGCP protocol parsing is adding '\0' to make sure we do not parse beyond where we should parse. This does not mix with strtok or similiar routines. For now we will read the msg into a global array first, then copy it to the msgb for mgcp protocol handling and if we are required to forward it to the MGCP we have a untouched copy we will modify into our own msgb.
2010-06-15nat: Return MGCP messages to the call agentHolger Hans Peter Freyther1-0/+30
Attempt to find the message by transaction id, then patch the response and use the IP/PORT of the local network, update the ci with the one from the BSC. This is currently not tracking any state of the MGCP and will not handle two bsc's... this will need to happen later. With this in we should be feature complete and now enter the mode of making all of this work reliable and fixing thinko's and other bugs.
2010-06-15nat: Allow to send MGCP messages from the BSC to the networkHolger Hans Peter Freyther1-0/+12
2010-06-15nat: Test rewriting of MGCP messages to patch ip and portHolger Hans Peter Freyther2-0/+90
Add code to change the ip and port for audio data inside MGCP messages. This is needed because the BSS might be behind the NAT and can not reach the network directly and might be behind a nat so the announced sourceport is not the one as we see it.
2010-06-15nat: Add code to find a BSC connection by the given msc multiplexHolger Hans Peter Freyther1-2/+43
2010-06-15nat: In the case of losing the MSC, reset all endpointsHolger Hans Peter Freyther1-0/+2
When losing the SCCP connection make sure that we free all endpoints. The disconnection of the BSC should already make sure they are closed but this makes sure everything is properly reset.