aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/src/osmo-bsc_nat
AgeCommit message (Collapse)AuthorFilesLines
2018-01-30osmo-bsc_nat: Fix use-after-free issue in ctrl forwarding codedaniel/bsc-nat-rebaseDaniel Willmann1-1/+2
Ticket: SYS#3208
2018-01-30osmo-bsc_nat: Add a description for the MSCDaniel Willmann2-1/+13
Change-Id: I84b713487117108f0978b86bd86d8fe98dc6fb93
2018-01-30osmo-bsc_nat: Return -EBADF if ussd_read_cb closes the connectionDaniel Willmann1-1/+1
Ticket: SYS#3208 Change-Id: I07fd9146fbe0658761d1f5d6739a9402e4163edd
2018-01-30osmo-bsc_nat: Change warning into commentDaniel Willmann1-1/+1
Change-Id: If24db994ee737d249f62b61d39f8b7c3cead5550
2018-01-30bsc_nat: Remove warning for MSC-natDaniel Willmann1-3/+0
Change-Id: I17af0f103bf15c08d5ca51a34dc8c23690e03b9c
2018-01-30osmo-bsc_nat: Free mgcp_configs on shutdownDaniel Willmann1-2/+4
Change-Id: I5e9a2704146ea331eceed86064092bb26dbe3735
2018-01-30osmo-bsc_nat: Reenable osmux supportDaniel Willmann2-7/+6
Change-Id: Ib98b65767884d615aac5c537dc58f2cdf5ff4bfa
2018-01-30osmo-bsc_nat: Add missing newline in log statementDaniel Willmann1-1/+1
Change-Id: Id92e9c39e824bb2da71291753f35610267e9a03e
2018-01-30osmo-bsc_nat: Implement MSC-side nat of SCCP connectionDaniel Willmann5-13/+38
Change-Id: I8a7d6095b76bd9072b287a4fa2b29cc0537e1a5b
2018-01-30osmo-bsc_nat: Change nat_sccp_conection ref namesDaniel Willmann4-43/+43
For the multi-msc support we also need to NAT the SCCP refs from the MSC so clarify which real/patched ref belongs to which side of the connection. Change-Id: Idb964542b2172f0f293fa1b7e334d016e9e09461
2018-01-30osmo-bsc_nat: Fix detection of stale connections in MGCPDaniel Willmann1-1/+1
Change-Id: Ieea0314f922c56325749f18f148f1e518bd2d1af
2018-01-30mgcp: Treat ConnID as hexDaniel Willmann1-1/+1
Change-Id: I53ce632d641bbf16919e3b44812e712ef6f54a45
2018-01-30bsc_nat: Fix return value in bsc_read_cb when connection was closedDaniel Willmann1-1/+1
osmo_fd will otherwise call the write_cb if data was enqueued for writing - possibly reading from/writing to free()d data. Change-Id: Ic11c710a7ef61272fee9a952a42052948e3d38fe
2018-01-30bsc_nat: Fix selection of mgcp_config in bsc_mgcp_forward()Daniel Willmann1-5/+6
Change-Id: I1060688459a860c90aa4a4f21aa4583a82480a69
2018-01-30libmgcp: Pass the pointer to the mgcp list on init, don't copy itDaniel Willmann3-6/+5
Change-Id: I2d51589670bb602422ec98521eec620948752e36
2018-01-30osmo-bsc_nat: Add missing return code for VTYDaniel Willmann1-0/+1
Change-Id: I12b421e970317c604ac8cc2f3c94ff5fdbc3f048
2018-01-30osmo-bsc_nat: Make bsc_mgcp_find_con aware of multiple MGCP configsDaniel Willmann1-4/+5
Change-Id: I508562d48e2a0733ea53fe7adaae828286f791a2
2018-01-30osmo-bsc_nat: Handle multiple mgcp configs in SCCP connDaniel Willmann2-2/+6
Change-Id: Ifb6efa8339b749ab588a5ea37f0b48bc8086ae46
2018-01-30osmo-bsc_nat: Handle multiple mgcp configs in MGCP NAT codeDaniel Willmann1-41/+61
Change-Id: Icbf2951cfc550f75580e95a05804e479c59ec1df
2018-01-30osmo-bsc_nat: Modify nat init to work with multiple mgcp_configsDaniel Willmann3-58/+68
Change-Id: I53ac858952ee15f897160b3a32483c5c91b862f6
2018-01-30Add warnings in places missing supportDaniel Willmann4-9/+27
Change-Id: Ic3de69792b2cd8e19cd140402bc1f5fbf9a00021
2018-01-30osmo-bsc_nat: Disable sending MGCP to MSC via IPA multiplexDaniel Willmann1-1/+2
Change-Id: If40b0bd51773b1658f744063be418c024a781e11
2018-01-30osmo-bsc_nat: Change the way bsc_nat_msc_is_connected() worksDaniel Willmann3-12/+18
The function now takes a struct msc_config and returns true if that MSC is connected. The vty command show msc connection now shows a line per connected MSC. In bsc_nat.c where osmo-bsc_nat previously hung up on a BSC connection if the (one) MSC was not connected it now checks for the default MSC connection. Change-Id: I95fbe1b8ad6621aba9b4bd6b581abfde0cb31fd0 Ticket: SYS#3208 Sponsored-by: On-Waves ehf.
2018-01-30osmo-bsc_nat: Have a default MSC for messages from BSCDaniel Willmann3-3/+26
Change-Id: I343e6d9d17bcde6dbdf8f48b7b51e998a296680c Ticket: SYS#3208 Sponsored-by: On-Waves ehf.
2018-01-30osmo-bsc_nat: Implement access lists for MSC connsDaniel Willmann3-1/+56
Change-Id: Iedcf492ff8bb86e7ac68d8909634525e7b0648ea Ticket: SYS#3208 Sponsored-by: On-Waves ehf.
2018-01-25osmo-bsc_nat: Change some functions to work with multiple MSC connsDaniel Willmann2-2/+11
Change-Id: Iab6f23f6f010f34876e37852cafa53e3a641478e Ticket: SYS#3208 Sponsored-by: On-Waves ehf.
2018-01-25osmo-bsc_nat: Support multiple MSCs in VTY/configDaniel Willmann3-67/+117
Change-Id: I2e9009b52c6ecc17fc2da8402736412b9093ce19 Ticket: SYS#3208 Sponsored-by: On-Waves ehf.
2018-01-25osmo-bsc_nat: Add functions to alloc/find/free MSC configDaniel Willmann1-0/+59
Change-Id: I5879d4d9ee0e1a0a6424ee3e9b214afb07319071 Ticket: SYS#3208 Sponsored-by: On-Waves ehf.
2018-01-25osmo-bsc_nat: Add infrastructure for multiple MSC connectionsDaniel Willmann1-0/+6
Add some common defines and structs Change-Id: I9cdfc5b32f2500f47be8caaa281bcca3231db5ea Ticket: SYS#3208 Sponsored-by: On-Waves ehf.
2018-01-25osmo-bsc_nat: Remove MSC IP cmdline option. This no longer makes sense for ↵Daniel Willmann1-8/+0
multiple MSCs Change-Id: I6f348dd5c7bdb2530081a1d609d03a6b0d13d0b2 Ticket: SYS#3208 Sponsored-by: On-Waves ehf.
2017-11-01vty: skip installing cmds now always installed by defaultNeels Hofmeyr1-3/+0
vty_install_default() and install_default() will soon be deprecated. Depends: I5021c64a787b63314e0f2f1cba0b8fc7bff4f09b Change-Id: I4951982fc78ae167d8e16a672d7af44d703721a9
2017-06-09don't re-implement osmo_talloc_replace_string()Harald Welte3-16/+16
osmo_talloc_replace_string() was introducd into libosmocore in 2014, see commit f3c7e85d05f7b2b7bf093162b776f71b2bc6420d There's no reason for us to re-implement this as bsc_replace_string here. Change-Id: I6d2fcaabbc74730f6f491a2b2d5c784ccafc6602
2017-05-10src: use osmo_timer_setup()Pablo Neira Ayuso3-12/+7
Use new function available in libosmocore to set up timers. Compile tested only. Change-Id: Ibcfd915688e97d370a888888a83a7c95cbe16819
2017-04-12nat: Fix initial buffer size parameter for getlinePau Espin Pedrol1-1/+1
According to man, lineptr must be set to null AND n to 0. Change-Id: I36683884106b97ef697264716de13813c00da9bc
2017-04-12nat: Use equal func in bsc_sccpPau Espin Pedrol1-6/+4
It is defined in the file and used twice in there, so let's use it for all of them which makes code smaller and more clear. Change-Id: I9fac7cabedff74f8f6293ad8b54420229b80aa71
2017-02-08vty: remove ignored logging parametersMax2-3/+3
Since ce9fec3e896571835ac5bfd2980d6836f2b29f0d libosmocore ignores parameters to log_vty_command_* functions. Hence parameter of logging_vty_add_cmds() is ignored too. As we depend on much later libosmocore version anyway, we can simplify code somewhat by removing parameters which will be ignored anyway. Change-Id: I62f752fd88f1d8fefa563648f9864c7c31f87991
2017-01-25CTRL: remove boilerplateMax1-11/+1
Use CTRL_CMD_DEFINE_RO(), CTRL_CMD_DEFINE_WO() and CTRL_CMD_DEFINE_WO_NOVRF() where appropriate to get rid of boilerplate code. Change-Id: I5bcea0b4f4b8f535bef2b423f2013b8b4a218b5b
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-11-24move to libcommon-cs: gsm48_create_mm_serv_rej(), gsm48_create_loc_upd_rej()Neels Hofmeyr1-1/+1
Used by libbsc, libmsc as well as osmo-bsc and osmo-bsc_nat. Moving gsm48_create* to libcommon-cs affects linking of osmo-bsc_nat, resulting in undefined references to gsm48_extract_mi() and gsm48_paging_extract_mi(); fix that by placing libfilter.a left of libbsc.a upon linker invocation. Change-Id: I212c2567b56191022b683674c1c4daf842839946
2016-11-24move to libcommon-cs: net init 3: actual moveNeels Hofmeyr1-0/+1
Reincarnate gsm_network_init() as the parts not specific to libbsc. Move from bsc_network_init() those bits that are not BSC specific (and useful for upcoming osmo-cscn). Add libcommon-cs to all linkages that use gsm_network_init(). Note: the only requirement to allow linking gsm_network_init() without libbsc is to keep the call to gsm_net_update_ctype() out of libcommon-cs. The other items are kept out of libcommon-cs because it makes sense semantically. But the separation is not strong in that the BSC specific data members are of course still omnipresent in struct gsm_network. If bsc_network_init() is not called, these are not initialized properly -- for now no users of uninitialized members exist. So this is just a first step towards a sensible split of the BSC and MSC gsm_network structs. The long term aim should be to have entirely separate structs with some common general items. Change-Id: If06316b97002390dc9a434686750cb96193ea63b
2016-11-10fix use after free in bsc_config_freeNeels Hofmeyr1-1/+1
talloc_free the cfg only after asserting num_bsc count sanity. This caused a failure in the 'bsc-nat' test with -fsanitize build. Should fix the Osmocom_Sanitizer build on jenkins.osmocom.org https://jenkins.osmocom.org/jenkins/job/Osmocom_Sanitizer/ Change-Id: Ic20aacaccffcaa58ccec6d24c884727dc1bc50e6
2016-10-13msgb ctx: use new msgb_talloc_ctx_init(), don't access talloc_msgb_ctxNeels Hofmeyr1-2/+1
Drop extern definitions of talloc_msgb_ctx and use msgb_talloc_ctx_init() instead. In sgsn_test.c, use a local variable msgb_ctx to do the talloc report from the return value of msgb_talloc_ctx_init(). Change-Id: I2f9ace855f0ecbdc9adf5d75bcb1a3d666570de4
2016-09-30log CTRL bind only onceNeels Hofmeyr1-2/+0
After libosmocore 38d232ee5d2ceb045d9ad6d3a23afcb4972523f7 which outputs 'CTRL at <ip> <port>' from ctrl_interface_setup_dynip(), there's no need to log the CTRL bind here anymore. Change-Id: I1a874efe365a1ecf8ec37b058215b95b9a635ec2
2016-09-27log VTY telnet bind only onceNeels Hofmeyr1-2/+0
After libosmocore 55dc2edc89c1a85187ef8aafc09f7d922383231f which outputs 'telnet at <ip> <port>' from telnet_init_dynif(), there's no need to log the telnet VTY bind here anymore. Change-Id: I97a730b28759df1d549a5049f47a3da1c16a3447
2016-09-26mscsplit: bsc_vty_init(): decouple from global bsc_gsmnetNeels Hofmeyr1-1/+1
Add an explicit gsm_network pointer instead of using the bsc_gsmnet global. This allows passing a gsm_network struct from the main() scope, which helps to decouple libmsc from libbsc. Change-Id: I9e2c0d9c18d4cebb5efb71565ad84df2bc2e0251
2016-09-15Consistenly format variables in */Makefile.am filesAlexander Huemer1-15/+53
Change-Id: Ifa21513c007072314097b7bec188579972dc1694
2016-07-11osmux: Add negotiation state so race conditions can't disable osmuxDaniel Willmann1-2/+3
Without this commit it is possible that osmux is disabled again on links with high jitter. This happens when an MGCP response without X-Osmux header is received before the NAT receives an Osmux dummy frame from the other side. Ticket: SYS#2628, SYS#2627 Sponsored-by: On-Waves ehf Change-Id: Id624b0279aee5e2412059a10296ce7896e2d4628
2016-05-25filter/nat: Fix the context for the imsi assignmentHolger Hans Peter Freyther1-1/+1
In c09f8a3b7fb94ccef41e33c32bfe2bff1ffe0e44 as part of a cleanup I accidently changed the talloc context from "con" to "bsc". The issue occurred at an earlier commit when assigning req.ctx to the "wrong" context. The allocation needs to be scoped by the struct nat_sccp_connection and not the connection from BSC to NAT. Before we have a nat_sccp_connection we scope the copied imsi to the bsc_connection and then steal it, but for the identity resp we will always have a nat_sccp_connection and can already use the right context. Change-Id: I53789aad2809e19338ad3b2deb72c4757e7bd524 Related: OS#1733 Reviewed-on: https://gerrit.osmocom.org/102 Tested-by: Jenkins Builder Reviewed-by: Harald Welte <laforge@gnumonks.org> Reviewed-by: daniel <dwillmann@sysmocom.de> Reviewed-by: Holger Freyther <holger@freyther.de>
2016-04-29move utils.h functions to libosmocoreHarald Welte1-2/+1
This needs the corresponding commit in libosmocore which imports the related functions
2016-04-29use new libosmocore gsm_23_003.h for IMEI/IMSI lengthHarald Welte1-1/+1
... rather than our private definitions everwhere. As an added benefit, gprs_gsup_messages.h is now free of any header dependencies within openbsc.