aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc
AgeCommit message (Collapse)AuthorFilesLines
2015-05-25sgsn: Integrate c-ares with the osmocom event loopHolger Hans Peter Freyther4-6/+196
c-ares is an asynchronous DNS resolver and we need it to resolve the GGSN address. This is integrating the library into our infrastructure. We will create and maintain a list of registered FDs (c-ares is currently only using one of them) and (re-)schedule the timer after events occurred.
2015-05-25sgsn: Create a copy of the msgb for later usageHolger Hans Peter Freyther1-3/+35
When needing to do an asynchronous DNS query we need to keep the TLV data around. So create a wrapper that takes a copy of it and frees it after the call. I can change the code to add an out parameter to decide if the msgb should be freed or not. Pick network failure in case the msgb could not be cloned in the hope the MS will retry then.
2015-05-25sgsn: Re-factor the activate PDP code for future changesHolger Hans Peter Freyther1-24/+39
A real SGSN will dynamically resolve the APN name into the GGSN IP Address. This means that after we have collected all information we need to start to resolve the GGSN and then can continue.
2015-05-25sgsn: Deal with no static ggsn being configured at allHolger Hans Peter Freyther1-0/+7
In case no static ggsn is configured the code would crash with the assumption that there is always such a GGSN.
2015-05-25sgsn: If there is a subscr don't allow an empty listHolger Hans Peter Freyther2-6/+6
This is a left-over from the initial system where no PDP was provided by the system. For now if there is a subscr attached and no PDP context provisioned. He is not allowed to have a data connection. Update the testcase to create the pdp list entry more early with a wildcard and then change it to a specific match.
2015-05-24sgsn: Extract the hlr Number into the mm contextHolger Hans Peter Freyther4-5/+48
Include the hlr-Number of the subscriber in the CDR. This is useful for debugging and understanding which equipment was used during the test. In contrast to the MSISDN the '+' is emitted as the number must be in international format already.
2015-05-24gsup: Copy the hlr-Number and use it during purgeHolger Hans Peter Freyther3-0/+23
Copy the hlr-Number into the sgsn_data and use it during the purgeMS. There is no unit test that looks at the data we send so I manually verified this by looking at the output. Below is the output of the test that purges the subscriber. <000f> gprs_subscriber.c:170 SUBSCR(123456789012345) Sending GSUP, will send: 0c 01 08 21 43 65 87 09 21 43 f5 09 07 91 83 61 26 31 23 f3
2015-05-24gsup: Decode/Encode the hlr-Number in the GSUP messageHolger Hans Peter Freyther3-0/+13
Implement it similar to the msisdn_enc/msisdn_enc_len and extend the testcase to include it as well.
2015-05-24gsup: Add the HLR-Number as type and use it for UpdateLocation ResHolger Hans Peter Freyther1-0/+24
The HLR-Number can be passed from the MAP Proxy to the SGSN and can then be used for the CDR module or passed during the purgeMS operation.
2015-05-22sgsn: Change the selection mode to verifiedHolger Hans Peter Freyther1-2/+2
We have verified/selected the APN. Either based on the subscriber data, a global APN match. But at least this SGSN has looked at what the MS has asked for and then selected a matching GGSN.
2015-05-22sgsn: Reserved bits should be set to 1Holger Hans Peter Freyther1-1/+1
Bits 3 to 8 are spare bits and should be set to 1 in etsi specifications. Do that.
2015-05-17Replace ad-hoc function with generic one from libosmocoreMax1-12/+2
Signed-off-by: Max <max.suraev@fairwaves.co>
2015-05-17sgsn: Clear LAC/RAC value for the routing area identityHolger Hans Peter Freyther1-1/+5
Clear LAC/RAC with pre-defined value in the RAI. 3GPP 29.060 v7.17.0 section 7.3.1 page 23: "The SGSN may include the Routeing Area Identity (RAI) of the SGSN where the MS is registered. The MCC and MNC components shall be populated with the MCC and MNC, respectively, of the SGSN where the MS is registered. The LAC and RAC components shall be populated by the SGSN with the value of 'FFFE' and 'FF', respectively.”
2015-05-17sgsn: Give the IMEI to the GGSN for analysisHolger Hans Peter Freyther1-0/+6
Most SGSNs pass the IMEI(SV). We currently only enquire about the IMEI and then pad the 'SV' with 1111b (thanks to the encoding routine). Sadly it insists on always writing the length which means we have to memmove the data around by a single octet. Manually verified using the pcu-emu and looking at the trace using wireshark.
2015-05-17sgsn: Encode the ULI for the PDP context creation ackHolger Hans Peter Freyther1-1/+6
Give the GGSN another opportunity to determine which tarif to apply for the SGSN/subscriber. This code assumes tha the RAN is a GERAN system but the assumption has been made in other places as well.
2015-05-17sgsn: Always include the routing area identityHolger Hans Peter Freyther1-0/+5
For PDP context creation we always want to include the RAI for the current mmctx. This might help commercial GGSNs to determine which charging to apply.
2015-05-17cdr: Remember the charging id supplied by the GGSNHolger Hans Peter Freyther2-3/+6
The charging_id is provided by the GGSN. Copy it into the CDR part of the data structure so it will remain present until after the pdp context has been deleted.
2015-05-06sgsn: Add VTY configuration for the CDR moduleHolger Hans Peter Freyther2-0/+64
Make it possible to set a filename to use for the CDR. By default no CDR will be generated. Forbid to set the interval of 0 seconds as this will cause a lot of work. Add a very basic VTY test.
2015-05-06sgsn: Create an initial and limited CDR moduleHolger Hans Peter Freyther6-1/+281
This is consuming the new signals and allows to install several different CDR/observing/event/audit modules in the future. For getting the bytes in/out the code would have had to undo what the rate counter is doing and at the same time adding a "total" to the ratecounter didn't look like a good idea, the same went for making it a plain counter. Begin writing the values one by one and open/closing a new FILE for every log messages. This is not efficient but easily deals with external truncation/rotation of the file (no fstat for and checking the links and size). As usual we will wait and see if this is an issue. Add some new members to our PDP context structure to see what it is about.
2015-05-06sgsn: Add various signals consumed by CDR or other client codeHolger Hans Peter Freyther4-2/+80
2015-05-06sgsn: Extract the MSISDN from the subscr data structureHolger Hans Peter Freyther2-0/+38
In case there is a subscr attached to the MM context and there is an encoded MSISDN we will attempt to decode it and in case of an international number prepend a '+'. Assume that the array size of gsm_mmcc_called->number is as big as ctx->msisdn for the strncpy.
2015-05-06sgsn: Make the free function internalHolger Hans Peter Freyther2-2/+1
All calls should and do go through the sgsn_mm_ctx_cleanup_free function.
2015-05-05sgsn: Show the QoS that has been assignedHolger Hans Peter Freyther1-1/+2
2015-05-05sgsn: Dump the E164 (encoded) assigned to the subscriberHolger Hans Peter Freyther1-0/+5
2015-05-05sgsn: Handle different levels of QoSHolger Hans Peter Freyther1-5/+12
If QoS is only three bytes it does not include the allocation/ retention policy. Otherwise it does. Copy it depending on that. We should have a macro for the clamping to reduce code duplication. The insanity does come from the MAP data and this seems to be the easiest in terms of complexity. It is an array of bytes that is transported from MAPProxy to the SGSN and then simply forwarded. The case of more than three bytes is neither unit nor manually tested so far.
2015-05-05sgsn: Store subscribed QoS and attempt to use itHolger Hans Peter Freyther5-4/+41
sgsn_create_pdp_ctx should use the subscribed QoS. When selecting the PDP context we inject the QoS to be used into the TLV structure and use it during the request. Assume a "qos-Subscribed" structure only with three bytes and prepend the Allocation/Retention policy to the request.
2015-05-05sgsn: Copy the msisdn to the sgsn_data and use it in PDP activationHolger Hans Peter Freyther4-2/+36
The MSISDN should be present for "security" reasons in the first activation of a PDP context. Take the encoded MSISDN, store it for future use and then put it into the PDP activation request. The MM Context contains a field for a decoded MSISDN already. As we need to forward the data to the GGSN I want to avoid having to store TON and NPI in another place. Simply store the data in the encoded form.
2015-05-05gsup: Extract the QoS fieldHolger Hans Peter Freyther3-1/+15
Add roundtrip test for the new QoS IE. It will be consumed in later commits.
2015-05-05gsup: Extract the new MSISDN stringHolger Hans Peter Freyther3-0/+17
Extract the new MSISDN IE from the GSUP message and verify that it is read/written to the message.
2015-05-05gsup: Specify the QoS service for the PDP infoHolger Hans Peter Freyther1-0/+22
QoS is a mess. In MAP there is qos-Subscribed which is then extended using ext-QoS-Subscribed, ext2-QoS-Subscribed, ext3-QoS-Subscribed and maybe even ext4-QoS-Subscribed by now. The MAP ASN1 files defined how these need to be "linearized". Instead of copying this I have decided to include the two semantics with/without the Allocation/Retention policy using the size of the data.
2015-05-05gsup: Document passing MSISDN as part of the responseHolger Hans Peter Freyther1-0/+23
When asking the GGSN to create/open a PDP context one needs to send a MSISDN. The MSISDN can only be provided through the GSUP interface.
2015-05-03bsc: Send a LU Reject in case it has been filteredHolger Hans Peter Freyther1-8/+42
In case we filter the request and it was a Location Updating Procedure we should reject it.
2015-05-03bsc: Add access list filtering to the BSCHolger Hans Peter Freyther4-4/+63
2015-05-03bsc: Add access lists to the MSC and the BSCHolger Hans Peter Freyther6-2/+84
It is a bit arbitary to decide which one is the global and which one is the local one. We might change it around. I don't think we want to introduce it based on BTS.
2015-05-03filter: Move the con_type into the filter_stateHolger Hans Peter Freyther11-52/+54
2015-05-03filter: Move from DNAT to DFILTER categoryHolger Hans Peter Freyther3-12/+18
2015-05-03filter: Remove bsc_connection from the filter APIHolger Hans Peter Freyther3-37/+37
Remove the last occurence of NAT datastructures in the filtering module and add the ctx to the filter request structure.
2015-05-03filter: Remove nat_sccp_connection from public APIHolger Hans Peter Freyther7-27/+35
2015-05-03filter: Remove the bsc_connection from the internal functionsHolger Hans Peter Freyther1-6/+6
2015-05-03filter: Put all the parameters in a struct to avoid order issuesHolger Hans Peter Freyther1-19/+31
With the "local" and "global" list name we might pick the wrong argument. Avoid it by passing them as a struct.
2015-05-03filter: Remove NAT knowledge from auth_imsiHolger Hans Peter Freyther1-8/+17
Push back the parameters we need to pass. auth_imsi doesn't know anything about the nat now.
2015-05-03filter: Separate SCCP/BSSAP extraction and gsm48 codeHolger Hans Peter Freyther6-57/+130
For the BSC we will have the gsm48_hdr and don't need to find data within SCCP. For legacy reasons we need to initialize con_type, imsi, reject causes early on and need to do the same in the filter method.
2015-05-03filter: More renaming and remove of "NAT" from itHolger Hans Peter Freyther5-41/+41
2015-05-03filter: Rename BSC to LOCAL and NAT to GLOBALHolger Hans Peter Freyther3-6/+6
2015-05-03filter: Remove nat from bsc_nat_acc_lst and replace with msgHolger Hans Peter Freyther9-63/+63
2015-05-03filter: Cease out "struct bsc_nat" from the APIHolger Hans Peter Freyther7-26/+24
This means we need to require a talloc context and simply operate on the list. I had considered creating a structure to hold the list head but I didn't find any other members so omitted it for now.
2015-05-03filter: Move VTY code into the filter moduleHolger Hans Peter Freyther4-111/+149
2015-05-03filter: Move the access list management aroundHolger Hans Peter Freyther6-97/+128
2015-05-03filter: Move the method definition to the filter moduleHolger Hans Peter Freyther9-59/+80
Move the filter methods to the filter module. This is still only usable for the NAT and the _dt/_cr filter routines need to move back to the bsc_nat in the long run.
2015-05-03filter: Move the gsm 04.08 filter to a common placeHolger Hans Peter Freyther6-4/+16
For customer requirements we want to be able to do filtering on the BSC as well. The same messages need to be scanned and the same access-lists will be looked at. In the future we might even split traffic based on the IMSI. Begin with moving the code to a new top level directory and then renaming and removing the nat dependency.