aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/src/nat/bsc_nat.c
AgeCommit message (Collapse)AuthorFilesLines
2010-06-15[nat] Slightly improve logging..Holger Hans Peter Freyther1-1/+2
If we find the connection of a different BSC at least log the BSCs that had duplicated references. We should also dump the src ref and such but i am not doing this right now.
2010-06-15nat: Increase the right counter on calls.Holger Hans Peter Freyther1-1/+1
2010-06-15nat: Print the LAC that was searched for and not found.Holger Hans Peter Freyther1-2/+4
2010-06-15nat: Mention when we do not find a BSC for a given token.Holger Hans Peter Freyther1-1/+3
This might help to identify what is wrong with the config of the BSC. Also using the result of TLVP_VAL as a char pointer looks suspicious...
2010-06-15nat: Print the IP address of the BSC that does not respond to the query.Holger Hans Peter Freyther1-1/+6
2010-06-15nat: Make the MSC configurable.Holger Hans Peter Freyther1-1/+1
2010-06-15nat: Move MSC ip address into the config..Holger Hans Peter Freyther1-7/+15
The address can still be specified on the cli and it will overwrite the config in the config file.
2010-06-15[statistics] Count the times we lost the connection to the MSC.Holger Hans Peter Freyther1-0/+2
2010-06-15[statistics] Provide basic statistics for the NATHolger Hans Peter Freyther1-0/+7
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-06-15nat: Handle unknown RLSD by send a RLC back to the network.Holger Hans Peter Freyther1-1/+31
2010-06-15nat: Rename variable to make it use msc in the nameHolger Hans Peter Freyther1-2/+2
2010-06-15nat: Attempt to have a single BSC write methodHolger Hans Peter Freyther1-19/+19
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-06-15nat: Rename bsc_write to bsc_send_dataHolger Hans Peter Freyther1-8/+8
2010-06-15nat: Send the reset after we have received the init ackHolger Hans Peter Freyther1-5/+7
Sending the reset right away will upset the MSC and we need to wait for the first contact.
2010-06-15nat: Fix the reset message and prepend the IPA headerHolger Hans Peter Freyther1-0/+1
2010-06-15nat: Send a GSM0808 message to the MSC when we are reconnectingHolger Hans Peter Freyther1-0/+28
The rest of the code should filter the reset ack msg. This should make the MSC give up all resources it had allocated for us.
2010-06-15nat: Redo a merge with master that got lost on the cherry-pickHolger Hans Peter Freyther1-9/+8
2010-06-15nat: Send a RLSD to the network for connections belonging to the BSCHolger Hans Peter Freyther1-1/+27
Sending a RLSD with SCCP failure makes the MSC free all the resources (MGCP, audio channels), right now we are ignoring the RLC we get from the network and print a unhandled message.
2010-06-15nat: Print a MSG when receiving unknown SCCP messages.Holger Hans Peter Freyther1-0/+3
2010-06-15nat: 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-06-15nat: Close the filedescriptor when ignoring the request.Holger Hans Peter Freyther1-0/+1
2010-06-15nat: Patch IT messages as well..Holger Hans Peter Freyther1-0/+2
We need to patch the source/dest reference inside the messages as well otherwise we will see failures in the SCCP connection on long calls.
2010-06-15nat: Close all endpoints used by a BSC when the BSC is goneHolger Hans Peter Freyther1-0/+3
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-06-15nat: Logging improvement for the nat.Holger Hans Peter Freyther1-1/+2
Print some more information, e.g. when a BSC is connected and authenticated, print the SCCP ref number.
2010-06-15nat: Check the authentication bit later...Holger Hans Peter Freyther1-6/+12
When moving it up here the code started to reject the identity responses of the bsc and we would never authenticate. Move it back down.
2010-06-15nat: Return MGCP messages to the call agentHolger Hans Peter Freyther1-0/+3
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-06-15nat: Handle CRCX/MDCX/DLCX at the natHolger Hans Peter Freyther1-31/+0
* 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-06-15nat: First go at handling MGCP inside the natHolger Hans Peter Freyther1-0/+6
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-06-15nat: 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-06-15nat: bsc_mgcp_clear is called from within the remove functionHolger Hans Peter Freyther1-4/+1
No need to call it twice... All endpoints should be properly freed as part of the SCCP disconnection.
2010-06-15[nat] Send a RSIP down to the BSC after it connectsHolger Hans Peter Freyther1-0/+41
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-06-15nat: Add MGCP code and parsing to the nat code..Holger Hans Peter Freyther1-1/+3
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-06-15nat: Look at the assignment command and remember on which timeslot the data isHolger Hans Peter Freyther1-1/+11
This information will be needed when we are trying to forward MGCP connections to and from the BSC through the IPA protocol.
2010-06-15sccp: Move the destruction of the sccp connection to a new placeHolger Hans Peter Freyther1-2/+1
2010-06-15nat: Return the SCCP connection, change order of patching and updatingHolger Hans Peter Freyther1-12/+18
* 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-06-15nat: Fail more early in the case of not being authenticatedHolger Hans Peter Freyther1-5/+7
This is also fixing a possible memory leak.
2010-06-15nat: Move paging by lac handling code into the utils fileHolger Hans Peter Freyther1-28/+5
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-06-15nat: Keep track of both sides of the connectionHolger Hans Peter Freyther1-0/+4
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-06-15nat: Assign the connection inside the new helper function.Holger Hans Peter Freyther1-1/+0
2010-06-15nat: Move creation of the structs to a separate fileHolger Hans Peter Freyther1-39/+1
This way one can create the bsc_nat structure in unit tests..
2010-06-15nat: Move SCCP patching to a new file, log updatesHolger Hans Peter Freyther1-124/+9
Move patching and reassigning of messages to a new file which will making testing this functionality more easy.
2010-06-15nat: Handle MSC disconnect by closing all NAT connectionsHolger Hans Peter Freyther1-2/+16
When we disconnect from the MSC handle it by pushing the problem to our connected clients. We will simply close all connections, reject all new BSC connections and attempt to reconnect to the MSC.
2010-06-15msc: Create a real interface for BSC MSC and start handling reconnectsHolger Hans Peter Freyther1-10/+18
Create a BSC<->MSC interface and use it for the BSC MSC IP and the BSC NAT to reduce code duplication on handling reconnects to the MSC and cleaning up the local state. The code is only partially tested and will contain bugs. Currently both the BSC and the NAT will just exit on connection loss and this way have the current behavior.
2010-06-15nat: Add a warning for an important todo item on connection lossHolger Hans Peter Freyther1-0/+1
In case we disconnect with some pending operations we will need to signal the MSC that something is wrong. This could be by sending a RLSD directly, or a clear command. Another part of the fix is to respond with a RLC on unknown RLSD messages.
2010-06-15nat: Clear all pending messages in case the BSC disconnectedHolger Hans Peter Freyther1-0/+1
Throw away all messages we have scheduled but never delivered to the BSC.
2010-06-15nat: Switch downstream over to the write queueHolger Hans Peter Freyther1-20/+46
2010-06-15nat: Stop using the input/ipaccess.c method as it will write directlyHolger Hans Peter Freyther1-2/+28
We want to write everything through the write queue, it seemed the easiest to copy the bytes here and feed the data into the bsc_write method.
2010-06-15nat: Make it clear where we want to send these methodsHolger Hans Peter Freyther1-1/+1
2010-06-15nat: Move one more area to the bsc_write methodHolger Hans Peter Freyther1-11/+10
2010-06-15nat: Move BSC msg sending to a new method.Holger Hans Peter Freyther1-3/+8
Move all writes into one place so we can switch to the write queue more easily in the future.