aboutsummaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)AuthorFilesLines
2010-06-15nat: Test forwarding Inactivity Test messages.Holger Hans Peter Freyther1-0/+19
No change needed to the code.
2010-06-15nat: Close all endpoints used by a BSC when the BSC is goneHolger Hans Peter Freyther3-0/+22
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: Remember a pending delete on an endpoint and carry it out laterHolger Hans Peter Freyther2-0/+10
2010-06-15nat: remove is called on already patched connections..Holger Hans Peter Freyther2-5/+5
Fix the test to search for the original message instead of the already patched one that should not find any items anyway. The remove is called on already patched connections so we need to match it with the patch reference count.
2010-06-15nat: Print the SCCP ref's as hex numbersHolger Hans Peter Freyther1-1/+1
This allows to more easily compare the numbers with traces seen in wireshark.
2010-06-15nat: Avoid crashing when we have no pending transactionHolger Hans Peter Freyther1-0/+3
2010-06-15nat: Logging improvement for the nat.Holger Hans Peter Freyther4-3/+7
Print some more information, e.g. when a BSC is connected and authenticated, print the SCCP ref number.
2010-06-15nat: Print the MSC multiplex as wellHolger Hans Peter Freyther1-2/+4
2010-06-15nat: Remember where the BTS is listening for things.Holger Hans Peter Freyther3-1/+31
Extract the port from the BSS's MGCP Gateway so we know where to forward the data to.
2010-06-15nat: No need to match \r\n when parsing the C: NHolger Hans Peter Freyther1-1/+1
2010-06-15nat: Remove the broken empty line check, follow \n vs \r\n of inputHolger Hans Peter Freyther2-9/+23
Instead of checking the token for NULL we need to check if running was set to null. Look at the data of the token and check if the line was ending with a \r\n or \n and then when rewriting a line use that line ending as well. Add a new test for that.
2010-06-15nat: Use a ptr that was allocated by tallocHolger Hans Peter Freyther1-1/+1
The endp is part of an array allocated by talloc and simple array members do not qualify as a context start address.
2010-06-15nat: Make rewrite work on string, read to a string first, copy to msgbHolger Hans Peter Freyther3-24/+25
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-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 Freyther4-0/+116
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: Allow to send MGCP messages from the BSC to the networkHolger Hans Peter Freyther2-0/+15
2010-06-15nat: Handle CRCX/MDCX/DLCX at the natHolger Hans Peter Freyther4-33/+146
* 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: Test rewriting of MGCP messages to patch ip and portHolger Hans Peter Freyther4-0/+152
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-06-15nat: Add code to find a BSC connection by the given msc multiplexHolger Hans Peter Freyther3-2/+62
2010-06-15bsc-msc: Flush the write queue when we have lost the connectionHolger Hans Peter Freyther1-0/+1
2010-06-15nat: First go at handling MGCP inside the natHolger Hans Peter Freyther3-0/+117
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 Freyther4-0/+14
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 Freyther2-1/+43
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 Freyther3-1/+13
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 Freyther7-3/+132
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 Freyther4-7/+14
2010-06-15nat: Return the SCCP connection, change order of patching and updatingHolger Hans Peter Freyther4-50/+44
* 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-15misc: Do not prepend 0x when using %p in printf.Holger Hans Peter Freyther2-9/+9
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: Add test case and data for paging by lac test.Holger Hans Peter Freyther2-1/+55
2010-06-15nat: Some more input validation... on the paging command.Holger Hans Peter Freyther1-0/+5
2010-06-15nat: Documentation fix... use nat for the parameterHolger Hans Peter Freyther1-1/+1
2010-06-15nat: Verify that the configured LACs are unique across the natHolger Hans Peter Freyther1-0/+9
2010-06-15nat: Move paging by lac handling code into the utils fileHolger Hans Peter Freyther4-29/+49
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: Add a test case for the connection trackingHolger Hans Peter Freyther3-4/+221
This test case tests connectiont tracking by sending a CR, getting a CC, sending a DTAP, receiving a DTAP, receiving a RLSD, sending a RLC. It verifies that the messages are properly patched specially the references at the BSC.
2010-06-15nat: Fix the lookup of connections to and from the BSCHolger Hans Peter Freyther1-11/+43
When sending a message to the MSC in the case of DT1 messages we only have the address of the MSC, so we need to go with that, otherwise (e.g. in case of a CR, RLC) we do have the source address and need to patch it. When forwarding a message to the BSC we do receive a msg that should contain the patched address, we need to unpatch it...
2010-06-15nat: Keep track of both sides of the connectionHolger Hans Peter Freyther3-0/+34
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 Freyther2-1/+1
2010-06-15nat: Actually add the connection to the SCCP list of active connectionsHolger Hans Peter Freyther1-4/+15
Add the connection to the list of active connections. Otherwise we are not able to find the connection.
2010-06-15filter: Move logging level down to INFOHolger Hans Peter Freyther1-3/+3
2010-06-15nat: Compare the IPA size with the actual size of the data...Holger Hans Peter Freyther1-0/+7
One sanity check that was needed in my test case..
2010-06-15nat: Move creation of the structs to a separate fileHolger Hans Peter Freyther3-39/+69
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 Freyther3-124/+168
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 Freyther3-25/+111
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-15bsc_msc: Connect in a non blocking way to the MSCHolger Hans Peter Freyther1-2/+81
The latency of setting up of the TCP connection can be quite high, it is better to connect in a non blocking way. This code is working by setting the socket nonblocking and temporarily replacing the bfd callback with the connect handling. Once the OS has connected our socket we switch back to normal operation.
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