aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/tests/bsc-nat
AgeCommit message (Collapse)AuthorFilesLines
2014-01-20nat: Introduce reject cause to bsc_nat_acc_lst_entryHolger Hans Peter Freyther1-1/+102
The filtering architecture already allowed to specify a reject reason but this has not been used for the access-lists. Extend the access-list to include a reject reason and extend the test case to honor it.
2013-12-05mgcp/nat: Take payload type from SDP dataJacob Erlbeck1-1/+1
So far the payload type used in RTP streams has been taken from the trunk configuration in NAT mode. This patch changes the implementation to use the payload type announced in the SDP part of MGCP messages and responses. SDP descriptions more than one m=audio line are not yet supported properly (always the last one is taken). Ticket: OW#466 Sponsored-by: On-Waves ehf
2013-12-05mgcp: Add tests for payload types in MGCP messagesJacob Erlbeck2-1/+20
These tests mainly check whether the SDP parsing works properly by looking at the payload type detected. Sponsored-by: On-Waves ehf
2013-09-19nat: Fix make distcheck for the natHolger Hans Peter Freyther1-4/+4
The jenkins runs make distcheck in the default configuration and not with the nat enabled. DISTCHECK_CONFIGURE_FLAGS="--enable-nat" make distcheck
2013-07-31nat: Implement a post-routing for the NAT softwareHolger Hans Peter Freyther2-0/+62
* 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 Freyther3-1/+54
* 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-04nat: The second call didn't really add anything to the test.Holger Hans Peter Freyther1-3/+0
Avoid: Coverity CID 1042323
2013-06-12Makefile.am: Use AM_CPPFLAGSAlexander Huemer1-1/+1
Since automake 1.13 INCLUDES is depricates and causes a warning
2013-04-16nat: Extract the LAC/CI from the Complete Layer3 InformationHolger Hans Peter Freyther2-0/+36
Find the Cell Identifier from the Complete Layer3 Information and store it for future reference. We could begin to verify that the LAC/CI used really belongs to the BSC.
2013-04-16nat: Rename "struct sccp_connections" to "struct nat_sccp_connection"Holger Hans Peter Freyther1-7/+7
The name sccp_connection is used in the osmo-sccp code, sccp_connections was used in the NAT for tracking a sccp_connection. Rename it so it is obvious that the struct belongs to the nat. The rename was done with sed: $ sed -i s,"struct sccp_connections","struct nat_sccp_connection",g \ include/openbsc/*.h src/osmo-bsc_nat/* tests/*/*
2013-04-16nat: Allow to re-write international numbers in the CC Setup messagesHolger Hans Peter Freyther2-2/+75
Prepend the international number with a '+' and then do the normal re-writing on it. There are a couple of ways to handle this: \+([0-9]), \+[0-9][0-9]([0-9]), \+49([0-9]) Add a test case for the international re-write based on an already internationalized number.
2013-04-16nat: We want the remote to respond to our DLCX requestHolger Hans Peter Freyther2-0/+2
We want to send a TRAP with the MGCP statistics from the NAT and the connected BSC. The BSC endpoint can be either released because of a DLCX from the MGCP CallAgent or the SCCP Connection release on the A-link. This is why we need to queue the statistics when the deleting the endpoint on the BSC. The processing is continued once the response arrives. This code assumes that the response of the DLCX will be sent by the remote side. The current amount of outstanding responses can be seen on the VTY. This assumption is based on the fact that the BSC has already responded to the CRCX and maybe to the MDCX. The MGCP RFC is bended to prefix the transaction identifier with "nat-" to easily detect the response and hand it to the handler. This will then parse the response and generate the TRAP. The current version is v1. We assume that the transaction space is big enough and we will not re-assign the transaction identifier too early.
2013-04-16nat: Make it possible to send MGCP messages through the IPA multiplexHolger Hans Peter Freyther1-0/+6
Instead of handling MGCP through the UDP socket, read and write messages through the ipa connection to the MSC.
2013-01-07nat: Introduce a global IMSI barr list using red-black treesHolger Hans Peter Freyther5-1/+95
2013-01-07nat: Allow the filter to select the reject causeHolger Hans Peter Freyther1-5/+10
In preparation for another kind of black-list allow the filter code to decide how the connection should be rejected. Introduce a new struct that will carry the reject causes for certain operations.
2013-01-07nat: Move the IMSI/TMSI filtering to a new and dedicated fileHolger Hans Peter Freyther1-0/+1
Move all routines related to filtering to a separate file.
2013-01-07nat: Extract the message re-writing from the utils to a dedicated fileHolger Hans Peter Freyther1-0/+1
Move the code around to make it more clear what the routines should do.
2012-11-07nat: Inject a a=fmtp:%d to force the right AMR codeHolger Hans Peter Freyther1-3/+3
This assumes that AMR is used and/or the mode-set is ignored for other codecs by the remote end.
2012-03-26nat: Add another test case for TP-SRR clearing and number rewriteHolger Hans Peter Freyther2-3/+42
2012-01-18nat: Internationalize the TP-DA if it starts with a 00Holger Hans Peter Freyther1-4/+4
Internationalize the number like we do it for Call Control. Update the test result to match this new behavior.
2012-01-18nat: Prepare to rewrite the TP-DA number of a SMS submit.Holger Hans Peter Freyther3-2/+56
Introduce number rewriting of SMS-SUBMIT. Introduce a new list, move code around to help with finding a new number, somehow the number encoding for TP-DA is borked, 03.40 references 04.11 but the length appears to be strlen(number) without taken the type field into account.
2012-01-18nat: Print the sizes and the offending data in case of a failureHolger Hans Peter Freyther1-1/+5
2012-01-15nat: Add the bsc_data.c file to the EXTRA_DISTHolger Hans Peter Freyther1-1/+1
2012-01-10nat: Implement clearing of TP-SRR flags from TPDUsHolger Hans Peter Freyther3-3/+67
Match IMSI and destination address against a set of entries, if it is matching the header will be modified and no sender report will be requested. Change the test case to request the sender report and then verify that this bit is reset to 0.
2012-01-10nat: Reduce copy and paste in the test, create a verify_msgHolger Hans Peter Freyther1-50/+23
2012-01-10nat: Use the link_id from the original message in the new DTAP messageHolger Hans Peter Freyther1-1/+1
SMS went from SAPI=3 to SAPI=0 and nobody notices on the NAT->MSC direction.
2012-01-06tests: Introduce running tests with GNU autotest in OpenBSCHolger Hans Peter Freyther2-1/+22
The quality of the tests is of different value but it is good to get started and improve from here.
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-08-19src: port openBSC over libosmo-abis0.9.15Pablo Neira Ayuso1-3/+4
This is a big patch that ports openBSC over libosmo-abis. Sorry, the changes that are included here are all dependent of libosmo-abis, splitting them into smaller pieces would leave the repository in some intermediate state, which is not desired. The main changes are: - The directory libabis/ has been removed as it now lives in libosmo-abis. - new configuration file format for nanoBTS and HSL femto, we need to define the virtual e1_line and attach it to the OML link. - all the existing BTS drivers (nanoBTS, hsl femto, Nokia site, BS11 and rbs2000) now use the new libosmo-abis framework. - use r232 input driver available in libosmo-abis for bs11_config. - use ipa_msg_recv instead of old ipaccess_read_msg function. - delete definition of gsm_e1_subslot and input_signal_data. These structures now lives in libosmo-abis. Most of this patch are deletions of libabis/ which has been moved to libosmo-abis. This patch also modifies openBSC to use all the new definitions available in libosmocore and libosmo-abis. In order to do that, we have replaced the following: - DINP, DMI, DMIB and DMUX by their respective DL* correspondences. - SS_GLOBAL by SS_L_GLOBAL - SS_INPUT by SS_L_INPUT - S_GLOBAL_SHUTDOWN by S_L_GLOBAL_SHUTDOWN - SS_INPUT by SS_L_INPUT - S_INP_* by S_L_INP_* sub-signals - E1INP_NODE by L_E1INP_NODE vty node This patch has been tested with: - one nanoBTS - the HSL femto with the examples available under libosmo-abis - BS11 with both dahdi and misdn drivers.
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 Freyther2-3/+69
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 Ayuso2-4/+4
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-03-04Fix build of bsc-nat testHarald Welte1-8/+10
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 Freyther2-4/+7
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.