aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/src/osmo-bsc_nat/bsc_nat_rewrite.c
AgeCommit message (Collapse)AuthorFilesLines
2017-01-23cosmetic: use osmo_strlcpy() everywhereNeels Hofmeyr1-4/+5
Shorten some code and make obvious to the reader that the string copy is done in a safe way. Change-Id: I900726cf06d34128db22a3d3d911ee0d1423b1bd
2016-03-1504.08: apply new bitmask functions, fix bitmask useNeels Hofmeyr1-2/+2
Replace hardcoded protocol discriminator and message type bitmasks with function calls recently introduced in libosmocore. Note that the release 98 bitmasks slightly differ from the release 99 bitmasks. This patch uses the "default" gsm48_hdr_msg_type invocation, thus it depends on libosmocore whether 98 or 99 bitmasks are used. In some places, use of the bitmask was erratic. Fix these implicitly by employing the bitmask functions: * silent_call.c: silent_call_reroute(): add missing bitmask for MM. * bsc_msg_filter.c: bsc_msg_filter_initial(): RR vs. MM messages. * osmo_bsc_filter.c: bsc_find_msc() and bsc_scan_bts_msg(): RR vs. MM messages. * bsc_nat_rewrite.c: bsc_nat_rewrite_msg(): SMS vs. CC messages. * bsc_ussd.c: no bitmask is applicable for the message types used here. * gb_proxy.c: gbproxy_imsi_acquisition(): missing bit mask for pdisc. In gprs_gb_parse.c: gprs_gb_parse_dtap(), add a log notice for unexpected message types.
2014-08-20adopt recent IPA related symbol renameHarald Welte1-1/+2
... which happened during recent migration of IPA functionality from libosmo-abis into libosmocore.
2013-07-31nat: Use the DCC region for number rewriting and increase debug outputHolger Hans Peter Freyther1-8/+27
2013-07-31nat: Implement a post-routing for the NAT softwareHolger Hans Peter Freyther1-19/+41
* 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: Allow to use the prefix lookup to rewrite numbersHolger Hans Peter Freyther1-7/+38
* 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-05nat: number could point to an address on the stack that can be reusedHolger Hans Peter Freyther1-1/+1
The number = int_number assignment will make the number point to the stack and as the int_number goes out of scope at the end of the if statement other code could re-use this stack for other memory. Fixes: Coverity CID 1042325
2013-04-16nat: Allow to re-write international numbers in the CC Setup messagesHolger Hans Peter Freyther1-7/+19
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-01-07nat: Fix a typo in the log message for out of memoryHolger Hans Peter Freyther1-1/+1
2013-01-07nat: Extract the message re-writing from the utils to a dedicated fileHolger Hans Peter Freyther1-0/+628
Move the code around to make it more clear what the routines should do.