Holger Hans Peter Freyther
d1effd835f
nat: Provide a USSD access list to check for which to play HLR.
2010-10-25 21:04:45 +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
74dc303134
nat: Introduce a new connection type for Supplementary Services
...
If we have a CM Service Request we will look into the message
to see if it is a Supplementary Service Activation.
2010-10-25 21:04:44 +02:00
Holger Hans Peter Freyther
a3967579f8
nat: Move the DTAP unpacking into a new method
...
DTAP unpacking will be used by the USSD checking code
2010-10-21 12:23:27 +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
7e8da1379e
nat: Add a method to add a proper message to the queue.
...
This will be used by the USSD module to forward the data
without creating another copy of the data.
2010-10-19 16:40:34 +02:00
Holger Hans Peter Freyther
3d38742d1c
nat: Find a connection by the real ref
2010-10-19 16:40:17 +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
4d44fc56e7
nat: Make the queue routine work on any write_queue
2010-10-13 23:55:52 +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
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
2f1a984d4f
nat: Add statistics to the access-list in the NAT
...
Count how many times we match a BSC or NAT deny. This will
give us the number of how often something should be filtered.
2010-09-25 16:15:23 +08:00
Holger Hans Peter Freyther
249d69a26c
nat: Use the write_queue inside the CFG.
2010-09-20 02:51:29 +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
85902a4d4a
nat: We have 1 to 31 available to the BSC.
2010-09-01 09:31:46 +08:00
Holger Hans Peter Freyther
f7c86c5b4d
nat: Replace the MGCP Endpoint if that is required
...
Add code to replace the Endpoint number for the mgcp.
2010-08-30 13:44:32 +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
Holger Hans Peter Freyther
5b2726e6b5
nat: Keep the state (CRCX,MDCX,DLCX) of the operation..
...
This will allow to have additional debug information and to
use the state inside the forwarding code.
2010-08-06 09:07:07 +08:00
Holger Hans Peter Freyther
4634013cde
mgcp: Make the CI uint32_t all the way to avoid mismatch
2010-08-06 08:29:37 +08: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
6b7710739a
nat: Rename ip-tos to ip-dscp and provide an alias...
2010-07-27 19:21:53 +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
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
d77c8171aa
nat: Allow to specify multiple entries in the access-list...
...
Inside the access-list we have a list of entries that have
either one allow or one deny rule... we do not allow to remove
a single rule but one has to remove the whole list, in that case
talloc will handle cleaning all entries.
Right now the matching is O(n*m) as we traverse the list
(multiple times) and run the regexp multiple times. One
way to make it faster would be to concat all regexps into
one.
2010-06-15 20:24:21 +08:00
Holger Hans Peter Freyther
29c67039fe
nat: Shorten the access-list struct and method names (still way too long)
2010-06-15 20:24:21 +08:00
Holger Hans Peter Freyther
e4900a074a
[nat] Implement the removal of an access-list.
2010-06-15 20:24:21 +08:00
Holger Hans Peter Freyther
8affef5059
[nat] Introduce the concept of access-list
...
One can set one access-list to one BSC and one
access-list to one NAT. The matching of IMSIs
remains the same for now, also applying the
white/blacklist. Access lists can not be deleted
for now and no perf opt is done (e.g. one could
cache the result of the last lookup in the bsc
struct).
2010-06-15 20:24:21 +08:00
Holger Hans Peter Freyther
078321aaae
[nat] Add ip-tos option to the nat.
...
This is applied to all incoming BSC connections.
2010-06-15 20:24:21 +08:00
Holger Hans Peter Freyther
b71c23bb0a
[nat] Make the refusal more complicated to support more MSCs
...
We will need to confirm the connection, then we can send the
GSM48 message, then we need to close the connection... the
embedding in the refusal method was way too easy..
2010-06-15 20:24:20 +08:00
Holger Hans Peter Freyther
fa20c94456
[nat] Make create_sccp_src_ref return the SCCP Connection.
...
Right now it was not possible to just find a connection, by returning
the connection that is created we will have direct access to it. It
will be used by the local connection handling.
2010-06-15 20:24:20 +08:00
Holger Hans Peter Freyther
e1fb5670cd
[nat] Remove parameter that is never accessed directly
...
The msgb needs to be around when we access the parsed structure
but that needs to be guranteed by the caller handing out the parsed
structure.
2010-06-15 20:24:20 +08:00
Holger Hans Peter Freyther
c58da4b374
[nat] Add the notion of a "local" connection.
...
A local connection is only between the MUX and the real BSC. We will
not forward anything to the MSC. This will be needed for the IMSI
filtering as sending a CREF is not liked by every BSC...
2010-06-15 20:24:20 +08:00
Holger Hans Peter Freyther
234d31218f
[nat] Use and print the connection type of a SCCP connection.
2010-06-15 20:24:20 +08:00
Holger Hans Peter Freyther
19c0a84fb8
[nat] Set the connection type/reason as out parameter
...
We are analyzing each CR message and it is nice to know the
reason these connections were created. Change the nat method.
2010-06-15 20:24:20 +08:00
Holger Hans Peter Freyther
f1012a432c
[nat] Remove the imsi allow option on the nat level.
...
For now we have:
1.) bsc imsi deny to deny at the BSC level
2.) bsc imsi allow to allow a SIM at the BSC level
3.) nat imsi deny to deny at the global level
2010-06-15 20:24:19 +08:00
Holger Hans Peter Freyther
e635dab52f
[nat] Add a token to the nat config and handle ID GET
...
This allows to chain a nat with a nat by answering to the
id get code and sending the token.
2010-06-15 20:24:19 +08:00
Holger Hans Peter Freyther
b606101011
[nat] Allow to set the description for the bsc.
...
This will allow to add description to each BSC.
2010-06-15 20:24:19 +08:00
Holger Hans Peter Freyther
12dc89ad37
[nat] Make the string -> regexp parsing public
...
This way it can be used from within a test case to test
the regexps..
2010-06-15 20:24:18 +08:00
Holger Hans Peter Freyther
b4af5c9b57
nat: Introduce a nat filter that is working on the CR message.
...
Currently there is no implementation but the refusal code is
in place and will send a refusal back to the BSC.
2010-06-15 20:24:18 +08:00
Holger Hans Peter Freyther
c14e09bb2d
nat: Store the creation time of a sccp connection.
...
Generate it when creating the connection but also when
reusing an existing connection.
2010-06-15 20:24:18 +08:00
Holger Hans Peter Freyther
aad82ce7ea
nat: Print the MSC status with a new vty command.
2010-06-15 20:24:18 +08:00
Holger Hans Peter Freyther
da35a8da7f
nat: Make ping/pong timeout configurable.
2010-06-15 20:24:17 +08:00
Holger Hans Peter Freyther
906c15ec53
nat: Send a IPA PING down the stream and wait for the pong.
...
We will send a ping every 20 seconds and if we have no pong
within 5 seconds we will close down the BSC connection and
wait for a reconnect. We will start this after having
authenticated the BSC and we stop the timer when destructing
the BSC connection.
2010-06-15 20:24:17 +08:00
Holger Hans Peter Freyther
2f9dcf0670
nat: Add a command to close a given BSC Connection
...
This can be used to clear stale connections for a given BSC
or to force a reconnect of the BSC.
2010-06-15 20:24:17 +08:00