Commit Graph

172 Commits

Author SHA1 Message Date
Holger Hans Peter Freyther 54f5352e07 nat: Close SCCP connections when the USSD Provider is closed.
Send a RLSD down to the BSC in case the USSD Provider is gone. It
is not sending a Clear Command and ut depends if the BS+ will
like this kind of behavior. At least the data on the NAT will
be freed soon afterwards due the RLC message.
2010-10-27 11:01:55 +02:00
Holger Hans Peter Freyther 07dfc70276 nat: Make clear where the RLSD is send to
Add a _msc to the method as we will send a RLSD to the
MSC and will add a method to send it down to the BSC
as well.
2010-10-27 10:54:11 +02:00
Holger Hans Peter Freyther 4c401e7a1a nat: Forward extra state and the message to the USSD provider
Forward the SCCP state and the data to the USSD provider,
also mark the connection as local.
2010-10-25 21:06:03 +02:00
Holger Hans Peter Freyther c16c2dc5d3 nat: Implement accepting a USSD Provider connection, do authentication 2010-10-25 21:06:03 +02:00
Holger Hans Peter Freyther 17870cf533 nat: Create a USSD module to filter out USSDs... 2010-10-25 21:04:45 +02:00
Holger Hans Peter Freyther 749497eeb3 nat: Copy the IMSI, then free it or move the context to the connection
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-21 12:22:50 +02:00
Holger Hans Peter Freyther a25d579ab9 nat: Convert the ip to host order to allow to bind to other ips 2010-10-19 17:48:13 +02:00
Holger Hans Peter Freyther f961de1108 nat: Use the make_sock routine to listen for incoming connections. 2010-10-19 16:40:04 +02:00
Holger Hans Peter Freyther a09b966cd4 nat: Use strncmp on the string in case it is not null terminated 2010-10-19 16:39:01 +02:00
Holger Hans Peter Freyther 69cfa179ef nat: Make the write_queue write callback a public function 2010-10-13 23:56:01 +02:00
Holger Hans Peter Freyther 19c530c5e7 ipaccess: Put our extensions to the protocol into the same enum
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-13 23:55:32 +02:00
Holger Hans Peter Freyther 0bd60f3317 nat: Allow a BSC to have multiple LACs
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-08 22:21:46 +08:00
Holger Hans Peter Freyther 0c41b6933e nat: Possible crash fix, only filter non local connections
For local connections con_msc is not set and sending a RLSD
to the network would have ended up in a segfault.
2010-10-06 00:48:36 +08:00
Holger Hans Peter Freyther e8e41e611f nat: Work around trying to forward a msg to a msc that does not exist
Instead of segfaulting warn the user that the MSC Connection does
not exist...
2010-10-06 00:24:28 +08:00
Holger Hans Peter Freyther 463dc62ae4 nat: Provide statistics about amount of different messages.
Provide simple statistics on how many LUs, Paging Responses
etc. we are seeing in the network.
2010-10-03 19:41:42 +08:00
Holger Hans Peter Freyther ee8849649b nat: Keep track of how many connections we reject
Keep track of how many connections we reject due the IMSI
filter itself or due not being able to parse the message.
2010-09-25 17:58:22 +08:00
Holger Hans Peter Freyther 568b9682e0 nat: Fix the filter when searching for a identity response
The filter code will return < 0 for error, 0 for unknown
subscriber, 1 for subscriber checked. Use the same if construct
as for the CR message. This should fix passing LU when it
starts with a TMSI of a different network.
2010-09-24 04:52:38 +08:00
Holger Hans Peter Freyther adb6e1cce1 janitor: Move the * to the variable name 2010-09-18 06:44:24 +08:00
Holger Hans Peter Freyther eea5a1bcd6 nat: Fix a crash when a BSC disconnects while a rejected IMSI
When we reject the IMSI we do not have the msc_con set on the
SCCP connection, but we do have a remote_ref. So the nat_send_rlsd
will end up with a crash due the msc_con being zero. Fix the
crash by only sending a released to the MSC when the connection
is not local.
2010-09-16 06:41:09 +08:00
Holger Hans Peter Freyther 4fcce9ea19 nat; Start to use gcc attribute to say that parameter may not be zero
This is an attempt to hint the compiler that it should check
the parameters and warn when something is null. Sadly it does
not work as expected.
2010-09-16 06:33:27 +08:00
Holger Hans Peter Freyther 09ecda49d7 nat: Check if the connection was filtered before the msc connection
This way we avoid seeing many warnings that we will not forward
data to the MSC. For the con_local connections that is actually
the idea, we will not forward them to the MSC.
2010-09-15 18:58:37 +08:00
Holger Hans Peter Freyther ac2763b47e nat: Attempt to disconnect a connection when IMSI filtering happens
Attempt to disconnect the connection and make both sides happy
about this. Right now it only handles the LU and should be extended
to the CM Service Request.
2010-09-15 18:58:36 +08:00
Holger Hans Peter Freyther 74e0a1b91c nat: Start inspecting every message coming from the BSC for the IMSI
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-15 18:58:36 +08:00
Holger Hans Peter Freyther 909e61fddc nat: Remember if we have check the imsi.
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-09-15 18:58:35 +08:00
Holger Hans Peter Freyther 3837f99e89 nat: Keep the fiter status in the return message. 2010-09-15 18:58:35 +08:00
Holger Hans Peter Freyther 27640fc255 nat: Improve the log message in case we have SCCP data without a connection
Describe which kind of data we have and where it was coming from
as this makes debugging a bit easier.
2010-09-15 18:58:35 +08:00
Holger Hans Peter Freyther 5f54075a8b vty: Use \r\n in the copyright messages
We should use VTY_NEWLINE but our strings are static, always
use \r\n as unix terminals can handle that as well.
2010-09-11 13:32:30 +08:00
Holger Hans Peter Freyther d368a71398 nat: Use ':' to separate the message and strerror 2010-09-05 08:51:12 +08:00
Holger Hans Peter Freyther 81506b4095 vty: Add the config node code to everyone. 2010-09-04 11:00:01 +08:00
Holger Hans Peter Freyther 45fd07dc33 nat: Attempt to assign the BSC Timeslot based on a free list
Do attempt to not reassign an endpoint immediately but go
to the next free one.
2010-08-29 16:35:26 +08:00
Harald Welte 2c869efcd3 Introduce '-D' commandline option to daemonize processes
This uses the osmo_daemonize() function of libosmocore >= 0.1.18,
and is now implemented for bac_nat, osmo-bsc, bsc_hack, osmo-gbproxy
and bsc_mgcp.  This means only osmo-sgsn is missing, which currently
has no option parsing at all.
2010-08-25 19:43:54 +02:00
Holger Hans Peter Freyther da340638fd nat: Do not report paging to every BTS... 2010-08-06 20:15:40 +08:00
Holger Hans Peter Freyther d5e6c2374b nat: Use the mgcp_config_alloc to have defaults initialized
Initialize the net_base properly and benefit from future
config changes but also reset certain defauls that we do
not want at the nat.
2010-08-05 19:17:25 +08:00
Holger Hans Peter Freyther a99c5b9d0f nat: Count the number of connects to the MSC. 2010-08-04 02:31:55 +08:00
Harald Welte d5db12c160 Use new include paths of libosmo-sccp 0.0.2 2010-08-03 15:11:51 +02:00
Holger Hans Peter Freyther c2b31ed9cd nat: Fix compilation with nat not being enabled.
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-31 05:20:31 +08:00
Holger Hans Peter Freyther 30e1ae923d sccp: Use the external libosmo-sccp as sccp implementation
Add --enable-nat and --enable-osmo-bsc to build applications
requiring the Osmo SCCP library to be installed. We are not
using autodiscover as this is out of fashion.
2010-07-31 04:09:38 +08:00
Holger Hans Peter Freyther 6b7710739a nat: Rename ip-tos to ip-dscp and provide an alias... 2010-07-27 19:21:53 +08:00
Holger Hans Peter Freyther 8d7b10ef58 nat: Clang reported two places with garbage data
Initialize the variables to NULL to fix it.
2010-07-23 19:43:12 +08:00
Holger Hans Peter Freyther dbd16fe59a nat: u_int8_t -> uint8_t 2010-07-23 19:08:55 +08:00
Holger Hans Peter Freyther d1d45b3b89 nat: Remove the first_contact variable. 2010-07-05 14:47:15 +08:00
Holger Hans Peter Freyther 20ee312d5c nat: Create a method to determine if any MSC is connected.
In the future we will have multiple MSC connections so we will
need to figure if any of them is active.
2010-07-05 14:39:44 +08:00
Holger Hans Peter Freyther bec411b9db nat: Store the msc_con in the data of the bsc_fd
* Stop using nat->msc_con in the read_cb but use the data.
2010-07-05 14:30:21 +08:00
Holger Hans Peter Freyther db65bbd515 nat: Make queue_for_msc use the msc_con parameter, pass in the right msc_con
* Return msg'es to the right MSC Con. Right now it is nat->msc_con.
* When forwarding from BSC to MSC, use the msc_con inside the
  sccp_connections. This means we will only forward data with a
  connection to the BSC.
2010-07-05 14:30:14 +08:00
Holger Hans Peter Freyther 3a77e61033 nat: Keep track of the MSC handling the connection.
In the future we might have multiple MSCs connected
and need to dispatch it to the right one.
2010-07-05 13:33:18 +08:00
Holger Hans Peter Freyther 8330c1c386 nat: Count the number of dropped SCCP and MGCP calls as well.
Count the number of dropped calls and lost SCCP connections
due the loss of a connection to the BSC...
2010-06-17 18:29:42 +08:00
Holger Hans Peter Freyther b2c38ebb1f nat: Switch per BSC counters to the rate ctr.
This is switching the simple statistics to the rate counter
and is updating all users...
2010-06-17 18:18:12 +08:00
Holger Hans Peter Freyther 9764331062 bsc_api: Move gsm48_rcvmsg into the BSC API and dispatch.
The next step in the way to the BSC API. We have a clear a
new connection was opened signal now... and the MSC could
use it...
2010-06-17 16:41:25 +08:00
Holger Hans Peter Freyther 1398f13a64 nat: Attempt to update the VTY usage to the latest version
* Install the show commands to be available in the enable mode as well
* Provide a copyright header..
2010-06-15 20:31:35 +08:00
Holger Hans Peter Freyther 69d801e23a nat: Do not use the bssap.h include as it does not exist in this branch. 2010-06-15 20:24:21 +08:00