aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/include/openbsc/bsc_nat.h
AgeCommit message (Collapse)AuthorFilesLines
2010-05-12nat: Store the creation time of a sccp connection.Holger Hans Peter Freyther1-0/+3
Generate it when creating the connection but also when reusing an existing connection.
2010-05-11nat: Print the MSC status with a new vty command.Holger Hans Peter Freyther1-0/+1
2010-05-05nat: Make ping/pong timeout configurable.Holger Hans Peter Freyther1-0/+5
2010-05-02nat: Send a IPA PING down the stream and wait for the pong.Holger Hans Peter Freyther1-0/+4
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-04-27nat: Add a command to close a given BSC ConnectionHolger Hans Peter Freyther1-0/+1
This can be used to clear stale connections for a given BSC or to force a reconnect of the BSC.
2010-04-23nat: Only close connections that were fully connectedHolger Hans Peter Freyther1-0/+1
Remember that we have seen a CC and have a valid destination local reference now and only send a fake RLC to the MSC when we had connections in this state.
2010-04-22nat: Only send DLCX when we have send a CRCX to the BSC on this endpointHolger Hans Peter Freyther1-0/+1
2010-04-22nat: Change MGCP DLCX handling and send dummy MDCX to the BTS.Holger Hans Peter Freyther1-5/+3
When setting a new MSC timeslot to a SCCP connection check if any of the existing connections have this timeslot, if so we will send a DLCX down the stream to make sure it is closed there, when we will CRCX this new timeslot we will happily reallocate it. When the SCCP connection goes away, or we get a DLCX from the network, or the BSC is gone we will send a DLCX message down the stream as well. When we receive a CRCX from the network we will forward the CRCX as usual and send a dummy MDCX after it. For the DLCX and the dummy MDCX we send a custom MGCP message that will not provoke an answer. Even if the downstream MGCP GW will answer we will ignore it due the dummy transaction id that is not used anywhere else. This change should make sure that we close the dowstream endpoint all the time, even when the DLCX arrives after the SCCP connection is torndown.
2010-04-21[nat] Add option to forbid the paging to the BSC.Holger Hans Peter Freyther1-0/+2
This can be done for testing purposes and to allow making a BTS crash that can not handle paging requests properly.
2010-04-21[nat] Lookup by BSC Connection otherwise the point of reassigning the is ↵Holger Hans Peter Freyther1-1/+1
defeated When sending a MSG to the MSC try to find the to be used "src" reference by comparing the reference on the BSC and the BSC connection. Only this tuple needs to be unique. Actually only when looking at the SRC REF we need to compare the BSC as the dest reference should be unique but we are just making the check a bit stronger to make it look symmetric.
2010-04-18nat: Return the SCCP Connection again...Holger Hans Peter Freyther1-1/+1
We will reset the multiplex in a DLCX message and then we can reset the multiplex as well...even if the MGCP connection is staying open. or at least this is a theory. The MSC likes to leave a connection open during CallControl when hanging up early enough in the process.
2010-04-17nat: Print the LAC that was searched for and not found.Holger Hans Peter Freyther1-1/+1
2010-04-17nat: Make the MSC configurable.Holger Hans Peter Freyther1-0/+1
2010-04-17nat: Move MSC ip address into the config..Holger Hans Peter Freyther1-0/+2
The address can still be specified on the cli and it will overwrite the config in the config file.
2010-04-13nat: Add config option to filter/handle certain imsi'es.Holger Hans Peter Freyther1-0/+15
2010-04-13[statistics] Provide basic statistics for the NATHolger Hans Peter Freyther1-0/+39
Count number of SCCP connections, number of BSC reconnects, number of calls. For most of them we have a per BSC and a global count. Right now all structs using the counters survive until the end of the application so we do not need to free them.
2010-04-08nat: Attempt to have a single BSC write methodHolger Hans Peter Freyther1-1/+3
This method currently prepends the IPA header and sends the data. In the future we might be able to use SCTP for it. We have to remove the IPA header from the static messages for that to work. This code is untested.
2010-04-07nat: Send the reset after we have received the init ackHolger Hans Peter Freyther1-0/+3
Sending the reset right away will upset the MSC and we need to wait for the first contact.
2010-04-06nat: Store the config in the connection instead of the lacHolger Hans Peter Freyther1-2/+2
This allows that we can print the Nr. next to the lac and it allows us to change the lac at runtime without reconnecting the BSC.
2010-04-06Revert "nat: Remember where the BTS is listening for things."Holger Hans Peter Freyther1-1/+0
Remove the code to parse port as we need to discover the BTS behind the nat and most likely it will have a different port than the one advertised by the BTS. This reverts commit c6a1fe773d16eb20d4cb1d3097761419436f4537.
2010-04-05nat: Close all endpoints used by a BSC when the BSC is goneHolger Hans Peter Freyther1-0/+1
Cleanup all endpoints that belonged to a given BSC. This is one part of the cleanup, the other is to bring down the SCCP link properly.
2010-04-05nat: Remember a pending delete on an endpoint and carry it out laterHolger Hans Peter Freyther1-0/+2
2010-04-05nat: Remember where the BTS is listening for things.Holger Hans Peter Freyther1-0/+1
Extract the port from the BSS's MGCP Gateway so we know where to forward the data to.
2010-04-04nat: Make rewrite work on string, read to a string first, copy to msgbHolger Hans Peter Freyther1-2/+3
The MGCP protocol parsing is adding '\0' to make sure we do not parse beyond where we should parse. This does not mix with strtok or similiar routines. For now we will read the msg into a global array first, then copy it to the msgb for mgcp protocol handling and if we are required to forward it to the MGCP we have a untouched copy we will modify into our own msgb.
2010-04-01nat: Return MGCP messages to the call agentHolger Hans Peter Freyther1-0/+4
Attempt to find the message by transaction id, then patch the response and use the IP/PORT of the local network, update the ci with the one from the BSC. This is currently not tracking any state of the MGCP and will not handle two bsc's... this will need to happen later. With this in we should be feature complete and now enter the mode of making all of this work reliable and fixing thinko's and other bugs.
2010-04-01nat: Handle CRCX/MDCX/DLCX at the natHolger Hans Peter Freyther1-0/+15
* Forward a rewritten msg to the BSS. We change the IP and port to point to the NAT instead of the core network. We also keep track of the BSC and the transacition id. * Handle the case where we have not found a SCCP connection and need to send a response ourselves.
2010-04-01nat: Test rewriting of MGCP messages to patch ip and portHolger Hans Peter Freyther1-0/+1
Add code to change the ip and port for audio data inside MGCP messages. This is needed because the BSS might be behind the NAT and can not reach the network directly and might be behind a nat so the announced sourceport is not the one as we see it.
2010-04-01nat: Add code to find a BSC connection by the given msc multiplexHolger Hans Peter Freyther1-0/+2
2010-03-31nat: First go at handling MGCP inside the natHolger Hans Peter Freyther1-0/+2
Listen on the MGCP gateway port and let our protocol stack handle everything for now. We will need to have some more control over things though.
2010-03-31nat: In the case of losing the MSC, reset all endpointsHolger Hans Peter Freyther1-0/+1
When losing the SCCP connection make sure that we free all endpoints. The disconnection of the BSC should already make sure they are closed but this makes sure everything is properly reset.
2010-03-31[nat] Send a RSIP down to the BSC after it connectsHolger Hans Peter Freyther1-1/+2
Make sure the MGCP attached to the BSC is resetting all endpoints whenever the BSC is connecting to us as we assume that all endpoints are available.
2010-03-30nat: Add MGCP code and parsing to the nat code..Holger Hans Peter Freyther1-0/+7
For the nat we will have NAT and MGCP in the same process and this commit starts with that. We are linking in the MGCP code and one can embed MGCP config snippets...
2010-03-30nat: Look at the assignment command and remember on which timeslot the data isHolger Hans Peter Freyther1-0/+10
This information will be needed when we are trying to forward MGCP connections to and from the BSC through the IPA protocol.
2010-03-30sccp: Move the destruction of the sccp connection to a new placeHolger Hans Peter Freyther1-0/+1
2010-03-30nat: Return the SCCP connection, change order of patching and updatingHolger Hans Peter Freyther1-3/+3
* Return the SCCP connection. This will be needed to store the assigned timeslot in there. * Update code to work with this change * This uncovered a bug in the CC handling, at the time the BSC was passed it was still a null pointer and the code would have failed.
2010-03-30nat: Documentation fix... use nat for the parameterHolger Hans Peter Freyther1-1/+1
2010-03-30nat: Move paging by lac handling code into the utils fileHolger Hans Peter Freyther1-0/+1
Moving it here means we can more easily test this code, there is one behaviour change with the code that we only support paging messages with one LAC and will silently ignore the others.
2010-03-29nat: Keep track of both sides of the connectionHolger Hans Peter Freyther1-0/+2
On a CC message we will need to remeber where the source local reference of the network belonged so we can properly identify the connection when receiving UDT messages.
2010-03-29nat: Move creation of the structs to a separate fileHolger Hans Peter Freyther1-0/+2
This way one can create the bsc_nat structure in unit tests..
2010-03-29nat: Move SCCP patching to a new file, log updatesHolger Hans Peter Freyther1-0/+8
Move patching and reassigning of messages to a new file which will making testing this functionality more easy.
2010-03-26nat: Start using a write_queue for the BSC connectionHolger Hans Peter Freyther1-1/+2
We are still writing to the BSC directly and don't make real use of this feature right now but we will need to do it.
2010-03-24Correct the company name. It should be On-Waves (ehf)Holger Hans Peter Freyther1-1/+1
2010-03-24Merge remote branch 'origin/master' into on-waves/bsc-masterHolger Hans Peter Freyther1-3/+3
* Move to libosmocore * Move to new debugging architecture * Register the BTS types * Has only been compile tested Conflicts: openbsc/include/openbsc/Makefile.am openbsc/include/openbsc/gsm_data.h openbsc/include/openbsc/ipaccess.h openbsc/include/openbsc/mgcp.h openbsc/include/openbsc/msgb.h openbsc/include/openbsc/tlv.h openbsc/src/Makefile.am openbsc/src/abis_rsl.c openbsc/src/bsc_init.c openbsc/src/bsc_mgcp.c openbsc/src/chan_alloc.c openbsc/src/debug.c openbsc/src/gsm_subscriber_base.c openbsc/src/msgb.c openbsc/src/rest_octets.c openbsc/src/sccp/sccp.c openbsc/src/vty/command.c openbsc/src/vty_interface.c openbsc/tests/Makefile.am
2010-02-09[nat] Implement token based identification.Holger Hans Peter Freyther1-0/+5
Based on the token the NAT/MUX is capable of figuring out which LAC this BSC is supposed to satisfy. This will be needed for messages like paging that can be done by LAC.
2010-02-08[nat] Add VTY support to the BSC nat applicationHolger Hans Peter Freyther1-0/+40
* Create struct bsc_nat and move the various lists into this structure * Create the VTY code * Call the VTY init and parsing code * Create functions to create the types.. * Add some stuff into the bsc_connection to be used for the NAT with proper config files. E.g. to close the connection if the BSC does not respond to a given command.
2010-02-07[nat] Move the structs to the header fileHolger Hans Peter Freyther1-0/+30
This way the VTY code can use the structures to implement the show functionality.
2010-01-30[nat] Specify the direction of the messageHolger Hans Peter Freyther1-5/+3
Do not run into the situation where we need to filter in one direction but it should not be filtered..
2010-01-30[nat] Prepare more sophisicated filtering and patchingHolger Hans Peter Freyther1-1/+45
Introduce a bsc_nat_parse method to parse a IP Access method into various parts. Write out the IPA Proto, in case SCCP is used, store the msg type, pointers to the source/dest local reference and other information. Use the result of bsc_nat_parse inside the bsc_nat_filter method to decide if the message should be dropped or not. In the future the bsc_nat_parse result will be used for patching SCCP references and other parts of the message. The filter language should be able to filter the msg type of SCCP messages and gain the "NOT" word in the filter language.
2010-01-21[nat] Add a bsc_filter.c which will carry out the analysis and filteringHolger Hans Peter Freyther1-0/+33
The first part is to analyze the IP Access Header and only forward SCCP messages for now. In the future we might want to do MGCP signalling through this protocol and connection as well and need to update this then.