aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/src/nat/bsc_nat_utils.c
AgeCommit message (Collapse)AuthorFilesLines
2011-03-03Rename bsc_nat -> osmo-bsc_nat and bsc_mgcp -> osmo-bsc_mgcpHarald Welte1-893/+0
This now enforces a unique structure: All of our main daemon programs start with an "osmo-" prefix.
2011-02-27nat: Fix some corruption in the test caseHolger Hans Peter Freyther1-0/+5
2011-02-27nat: Change number of multiplexes to the max-endpointsHolger Hans Peter Freyther1-1/+1
2011-02-26nat: Allocate the endpoint status dynamicallyHolger Hans Peter Freyther1-0/+1
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-18nat: If the number starts with 00 turn it into a international numberHolger Hans Peter Freyther1-1/+6
Switch the type to international and skip the '00' of the phone number. This should fix some issues with gateway MSCs.
2011-02-18nat: Add extra size check for the number and fail if it does not fitHolger Hans Peter Freyther1-0/+6
If the replaced number is too long for the phone number we will have to stop processing here.
2011-01-07ipa: Only use one IPA number for Osmo extensionsHolger Hans Peter Freyther1-1/+1
Instead of using more numbers from the proto range we will use the 0xee and then have a mini header with our new proto id in there. For a start rename the use types to _OLD.
2011-01-01License change: We are now AGPLv3+ instead of GPLv2+Harald Welte1-6/+5
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: Fix a thinko in allowing '*' as a wildcard...Holger Hans Peter Freyther1-2/+2
We need to match everything BUT the wildcard and then do the normal strcmp...
2010-10-27nat: Look at the number type to figure out if we want to rewrite itHolger Hans Peter Freyther1-1/+3
2010-10-27nat: Explain that we do not want to have a + in the replacement ruleHolger Hans Peter Freyther1-0/+6
2010-10-27nat: Add '*' as wildcard for the IMSI matching.Holger Hans Peter Freyther1-2/+2
In case any rule has a '*' we will always match this rule.
2010-10-27nat: Implement rewriting, have a very basic test for that featureHolger Hans Peter Freyther1-2/+141
2010-10-27nat: Add hook for rewriting a setup messageHolger Hans Peter Freyther1-0/+7
Create a new function, hand the data to this function, take back a possible modified msgb and invalidate parsed at this point.
2010-10-25nat: Implement accepting a USSD Provider connection, do authenticationHolger Hans Peter Freyther1-0/+1
2010-10-25nat: Make the imsi checking function public.Holger Hans Peter Freyther1-2/+2
We will use this method in the USSD module to check if the IMSI should be handled for USSD queries.
2010-10-25nat: Introduce a new connection type for Supplementary ServicesHolger Hans Peter Freyther1-2/+9
If we have a CM Service Request we will look into the message to see if it is a Supplementary Service Activation.
2010-10-21nat: Move the DTAP unpacking into a new methodHolger Hans Peter Freyther1-13/+21
DTAP unpacking will be used by the USSD checking code
2010-10-21nat: Copy the IMSI, then free it or move the context to the connectionHolger Hans Peter Freyther1-7/+19
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-21nat: Store the IMSI inside the SCCP Connection dataHolger Hans Peter Freyther1-0/+1
Store the IMSI for the connections that we are tracking, it will be freed when the normnal SCCP connection is freed.
2010-10-19nat: Change the order of the DENY/ALLOW rule for the BSC.Holger Hans Peter Freyther1-6/+7
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-19nat: Add a method to add a proper message to the queue.Holger Hans Peter Freyther1-0/+4
This will be used by the USSD module to forward the data without creating another copy of the data.
2010-10-13nat: Make the write_queue write callback a public functionHolger Hans Peter Freyther1-0/+13
2010-10-13nat: Make the queue routine work on any write_queueHolger Hans Peter Freyther1-1/+6
2010-10-13ipaccess: Put our extensions to the protocol into the same enumHolger Hans Peter Freyther1-1/+1
Rename NAT_IPAC_PROTO_MGCP to IPAC_PROTO_MGCP and place it in the enum. We need to be prepared to change this number if IPA is ever going to use it for something else.
2010-10-12misc: Replace the idiom for replacing a string with a function callHolger Hans Peter Freyther1-3/+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-4/+48
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-10-06nat: Use the right access list for the stats (found by clang)Holger Hans Peter Freyther1-1/+1
2010-10-03nat: Provide statistics about amount of different messages.Holger Hans Peter Freyther1-1/+18
Provide simple statistics on how many LUs, Paging Responses etc. we are seeing in the network.
2010-09-25nat: Keep track of how many connections we rejectHolger Hans Peter Freyther1-0/+3
Keep track of how many connections we reject due the IMSI filter itself or due not being able to parse the message.
2010-09-25nat: Add statistics to the access-list in the NATHolger Hans Peter Freyther1-0/+22
Count how many times we match a BSC or NAT deny. This will give us the number of how often something should be filtered.
2010-09-15nat: Remove debug left oversHolger Hans Peter Freyther1-1/+0
2010-09-15nat: And the sequence number away, making it work more reliableHolger Hans Peter Freyther1-4/+8
2010-09-15nat: Parse the id response, extract the IMSI, compare itHolger Hans Peter Freyther1-1/+58
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: Start inspecting every message coming from the BSC for the IMSIHolger Hans Peter Freyther1-0/+9
Return early in case the IMSI was already checked, if not we need to look at the connection and check if the message could contain a imsi we want/need to filter.
2010-09-15nat: Remember if we have check the imsi.Holger Hans Peter Freyther1-2/+2
Return -1 if the IMSI should be filtered, 0 if the IMSI could not be checked and 1 if the IMSI was checked and allowed to pass. In the future this will be used to inspect every message coming by.
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-23nat: u_int8_t -> uint8_tHolger Hans Peter Freyther1-4/+4
2010-07-05nat: Create a method to determine if any MSC is connected.Holger Hans Peter Freyther1-0/+6
In the future we will have multiple MSC connections so we will need to figure if any of them is active.
2010-06-17nat: Add spaces to the desc to align it properly on the vty outputHolger Hans Peter Freyther1-5/+5
2010-06-17nat: Count the number of dropped SCCP and MGCP calls as well.Holger Hans Peter Freyther1-0/+2
Count the number of dropped calls and lost SCCP connections due the loss of a connection to the BSC...
2010-06-17nat: Switch per BSC counters to the rate ctr.Holger Hans Peter Freyther1-4/+20
This is switching the simple statistics to the rate counter and is updating all users...
2010-06-15nat: Do not use the bssap.h include as it does not exist in this branch.Holger Hans Peter Freyther1-1/+2
2010-06-15nat: Add both entries to the tail to keep the order they are insertedHolger Hans Peter Freyther1-2/+2
2010-06-15nat: Allow to specify multiple entries in the access-list...Holger Hans Peter Freyther1-9/+48
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-11/+11
2010-06-15[nat] Implement the removal of an access-list.Holger Hans Peter Freyther1-0/+6
2010-06-15[nat] Introduce the concept of access-listHolger Hans Peter Freyther1-6/+47
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 the refusal more complicated to support more MSCsHolger Hans Peter Freyther1-0/+1
We will need to confirm the connection, then we can send the GSM48 message, then we need to close the connection... the embedding in the refusal method was way too easy..