aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/src/osmo-bsc_nat/bsc_nat_utils.c
AgeCommit message (Collapse)AuthorFilesLines
2016-04-12NAT: allow allocating BSC in arbitrary orderMax1-2/+5
Check for existing BSC before allocating new one. Track number of remaining BSCs on deallocation. Explicitly use BSC number in allocation function.
2015-11-02stats: Set class_id in rate_ctr group descriptionsJacob Erlbeck1-0/+2
This commit adds the class_id initialiser to all rate_ctr_group_desc definitions. Sponsored-by: On-Waves ehf
2015-07-01nat: Factor out the config by token searchHolger Hans Peter Freyther1-0/+18
In the upcoming authentication improvements it is nice to separate the finding of the config from the post-allow handling of it.
2015-05-03filter: Move the con_type into the filter_stateHolger Hans Peter Freyther1-15/+15
2015-05-03filter: Remove nat from bsc_nat_acc_lst and replace with msgHolger Hans Peter Freyther1-2/+2
2015-05-03filter: Move the access list management aroundHolger Hans Peter Freyther1-88/+0
2015-05-03filter: Move the method definition to the filter moduleHolger Hans Peter Freyther1-0/+1
Move the filter methods to the filter module. This is still only usable for the NAT and the _dt/_cr filter routines need to move back to the bsc_nat in the long run.
2014-08-29nat: Introduce a config free for the test and fix valgrind issuesHolger Hans Peter Freyther1-0/+28
The talloc_free on the nat lead to the freeing of the bsc_config which lead to freeing of the rate_ctr_group. The rate_ctr_group remained in a global list and the next creation of a bsc_config would access dead memory. Fix it. The free routine is only meant to be used by the test, for the real nat we would need to make sure that all connections and other state that refers to the cfg is removed/closed first. Fix various memleaks in the test while we are at it. There are still some to fix. ==7195== Invalid write of size 4 ==7195== at 0x4043171: rate_ctr_group_alloc (linuxlist.h:65) ==7195== by 0x804D893: bsc_config_alloc (bsc_nat_utils.c:174) ==7195== by 0x804B5D2: main (bsc_nat_test.c:954) ==7195== Address 0x4311cbc is 52 bytes inside a block of size 208 free'd ==7195== at 0x4029D28: free (in /usr/lib/valgrind/vgpreload_memcheck-x86-linux.so) ==7195== by 0x4048D98: _talloc_free (talloc.c:609) ==7195== by 0x4052806: talloc_free (talloc.c:578) ==7195== by 0x804B58A: main (bsc_nat_test.c:940)
2014-08-29nat: Remove the entry from the list before we destroy itHolger Hans Peter Freyther1-0/+1
2014-08-20adopt recent IPA related symbol renameHarald Welte1-1/+2
... which happened during recent migration of IPA functionality from libosmo-abis into libosmocore.
2014-01-20nat: Introduce reject cause to bsc_nat_acc_lst_entryHolger Hans Peter Freyther1-0/+2
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-07-31nat: Implement a post-routing for the NAT softwareHolger Hans Peter Freyther1-0/+1
* 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-04-16nat: Extract the LAC/CI from the Complete Layer3 InformationHolger Hans Peter Freyther1-0/+62
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-2/+2
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: We want the remote to respond to our DLCX requestHolger Hans Peter Freyther1-0/+1
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-01-07nat: Move the IMSI/TMSI filtering to a new and dedicated fileHolger Hans Peter Freyther1-281/+0
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-589/+0
Move the code around to make it more clear what the routines should do.
2012-01-18nat: Internationalize the TP-DA if it starts with a 00Holger Hans Peter Freyther1-1/+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 Freyther1-35/+114
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-11nat: Add the line break after the '.openbsc/0.10.1Holger Hans Peter Freyther1-1/+1
2012-01-10nat: Implement clearing of TP-SRR flags from TPDUsHolger Hans Peter Freyther1-4/+39
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: Use the link_id from the original message in the new DTAP messageHolger Hans Peter Freyther1-1/+3
SMS went from SAPI=3 to SAPI=0 and nobody notices on the NAT->MSC direction.
2012-01-10nat: Compare the DTAP L3 size with the size of the msgb - dtap headerHolger Hans Peter Freyther1-2/+4
2012-01-10nat: Fix comment and mask for looking at TP-MTIHolger Hans Peter Freyther1-2/+3
2012-01-10nat: SMS rewrite matching, empty list means match everythingHolger Hans Peter Freyther1-1/+1
2012-01-10nat: SMS comment updatesHolger Hans Peter Freyther1-1/+2
2012-01-10nat: Move SMS creation into a new method, no functional changeHolger Hans Peter Freyther1-34/+49
2012-01-10nat: Access data_ptr after we have checked the lengthHolger Hans Peter Freyther1-4/+4
2012-01-10nat: Move the finding of the number to a new methodHolger Hans Peter Freyther1-44/+62
2011-08-22misc: Move the bsc_parse_reg to libcommom and name it gsm_parse_regHolger Hans Peter Freyther1-25/+0
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-abisopenbsc/0.9.15Pablo Neira Ayuso1-3/+3
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-07-13nat: Use libctrl and add command forwarding to osmo-bscDaniel Willmann1-0/+1
Passes commands beginning with "bsc.<num>" to the bsc that is responsible for LAC <num>.
2011-06-01nat: Look into the TPDU/SMS-SUBMIT and use the TP-DestAddress for matchesHolger Hans Peter Freyther1-0/+60
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-4/+133
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: Move the common new message generation code into the base methodHolger Hans Peter Freyther1-26/+28
2011-06-01nat: Prepare to patch more than the CC Setup messageHolger Hans Peter Freyther1-24/+31
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-24/+92
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-31nat: Allow to rewrite any non international numberHolger Hans Peter Freyther1-2/+0
Remove the arteficial limitation of the number format of an unknown number.
2011-05-31nat: Refactor the number patching code into a new methodHolger Hans Peter Freyther1-45/+56
Separate the code to patch the code and the code to find a new number based on the old number. This will allow to add multiple targets for number changing.
2011-05-07src: rename msg_entr* to osmo_config_*Pablo Neira Ayuso1-1/+1
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-06src: use namespace prefix osmo_counter*Pablo Neira Ayuso1-6/+6
Summary of changes: s/struct counter/struct osmo_counter/g s/counter_inc/osmo_counter_inc/g s/counter_get/osmo_counter_get/g s/counter_reset/osmo_counter_reset/g s/counter_alloc/osmo_counter_alloc/g s/counter_free/osmo_counter_free
2011-05-06src: use namespace prefix osmo_wqueue*Pablo Neira Ayuso1-4/+4
Summary of changes: s/struct write_queue/struct osmo_wqueue/g s/write_queue_init/osmo_wqueue_init/g s/write_queue_clear/osmo_wqueue_clear/g s/write_queue_enqueue/osmo_wqueue_enqueue/g s/write_queue_bfd_cb/osmo_wqueue_bfd_cb/g
2011-05-06src: use namespace prefix osmo_fd* and osmo_select*Pablo Neira Ayuso1-1/+1
Summary of changes: s/struct bsc_fd/struct osmo_fd/g s/bsc_register_fd/osmo_fd_register/g s/bsc_unregister_fd/osmo_fd_unregister/g s/bsc_select_main/osmo_select_main/g
2011-05-02nat: Create a Paging Group that BSCs can refer toHolger Hans Peter Freyther1-8/+49
Introduce a paging group that a BSC can refer to and is used during the LAC lookup. This way paging can be flooded through the network and just filtered at the last element in the core.
2011-05-02nat: Introduce the concept of a paging group and use itHolger Hans Peter Freyther1-0/+24
A paging group is a list of LACs, different BSCs can point to a paging group and use it for the LAC lookup.
2011-05-02nat: Rewrite the paging handling.Holger Hans Peter Freyther1-26/+10
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-26bsc: Allow to have a list of MSCs/MUXs to connect toHolger Hans Peter Freyther1-5/+15
Be able to configure a list of destinations (duplicates allowed) that will be tried in a round robin fashion. The change is in the bsc_msc_connection to operate on a list. We achieve the round robin nature with the same trick used in the paging code to delete and append the current entry. The nat code was updated to compile but one can only configure one destination.
2011-04-13nat: And out the skip_indicator/transaction id from the gsm48 headerHolger Hans Peter Freyther1-8/+11
We need to and out the protocol discriminator as call control might have use transactions. This has only failed for the USSD filter so far as this must deal with transactions.
2011-04-04nat: Bail out if the regexp fails to compile and avoid a crashHolger Hans Peter Freyther1-2/+13
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-23Fix build of bsc-nat and GPRS code after include path changeHarald Welte1-2/+2
The last patch changed the osmocore include paths, this fixes some build problems caused by it