Commit Graph

542 Commits

Author SHA1 Message Date
Holger Hans Peter Freyther 66105fd3dc ctrl: Implement a global result for rf_locked
Create a one stop command to give a statement for the
entire network. This can be used to check the policy
and the state of the entire network.
2015-02-10 23:03:25 +01:00
Holger Hans Peter Freyther ca4151984c ctrl: Add a command to check how many bts are configured
This can be used to query how many bts are configured to
check if all of them are locked or not.
2015-02-10 21:55:37 +01:00
Holger Hans Peter Freyther 9c20a5f45c sgsn: Add easy APN commands with just the name
For most configurations we don't address multiple GGSNs but
only want to enforce a list of APNs. In the future we might
add a special global GGSN context but not right now.

Fixes: SYS#593
2015-02-06 16:44:58 +01:00
Jacob Erlbeck ca69b0f68d Revert "gprs: Block other GSUP procedures during PURGE_MS"
This reverts commit f81cacc681.

Since the PURGE MS retry mechanism had been removed, this feature
is not used anymore. It just makes the code more complex.

Conflicts:
	openbsc/include/openbsc/gprs_sgsn.h
	openbsc/src/gprs/gprs_subscriber.c
	openbsc/tests/sgsn/sgsn_test.c
2015-02-06 13:22:24 +01:00
Jacob Erlbeck 277b71e0d8 sgsn: Select GGSN based on APN
Currently the APN IE in the Activate PDP Contex Request and the PDP
data that is stored with the subscriber is ignored completely.

This commit adds the sgsn_mm_ctx_find_ggsn_ctx that checks the APN IE
against the subscriber's PDP data entries if both are present. If
there is no match, the request is rejected.

If an APN IE has not been included but PDP data entries are present,
the function checks all of these entries against the static 'apn'
configuration to find a suitable entry.

If an APN has not been determined so far and any APN is allowed, the
configuration is checked with an empty APN string, to allow for
default configurations based on the IMSI prefix only.

If nothing of this succeeded but the request wasn't rejected either,
and there is no 'apn' configuration at all or if any APN is allowed
but a default configuration ist not present, the GGSN with id 0 is
used (if present).

Otherwise the request is rejected ('missing APN').

Ticket: OW#1334
Sponsored-by: On-Waves ehf
2015-02-06 13:00:29 +01:00
Jacob Erlbeck cb1db8b6d5 sgsn: Add functions to handle APN contexts
This commit adds the exported functions apn_ctx_find_alloc,
apn_ctx_free, apn_ctx_by_name, and apn_ctx_match to manage and
retrieve APN to GGSN mappings.

The following VTY commands are added to 'config-sgsn':

 - apn APN ggsn <0-255>
 - apn APN imsi-prefix PREFIX ggsn <0-255>

which maps an APN gateway string to an SGSN id. The SGSN must be
configured in advance. When matching an APN string, entries with a
leading '*' are used for suffix matching, otherwise an exact match is
done.  When a prefix is given, it is matched against the IMSI. If
several entries match, a longer matching IMSI prefix has precedence.
If there are several matching entries with the same PREFIX, the entry
with longest matching APN is returned.

Ticket: OW#1334
Sponsored-by: On-Waves ehf
2015-02-06 09:56:17 +01:00
Jacob Erlbeck 0e8add601d sgsn: Add PDP info to subscriber data
Currently the PDP info that is transmitted via GSUP is just parsed
and then discarded.

This commit adds a new data structure sgsn_subscriber_pdp_data and
maintains a list of those in sgsn_subscriber_data. The PDP data is
copied from an incoming GSUP UpdateLocationResult message. If that
message contains the PDPInfoComplete flag, the list is cleared before
new entries are added.  The 'show subscriber cache' output now also
shows the PDP data entries.

Note that the InsertSubscriberData message is still not supported.

[hfreyther: Added talloc_free in gprs_subscr_pdp_data_clear]

Sponsored-by: On-Waves ehf
2015-02-06 09:55:39 +01:00
Holger Hans Peter Freyther 4e13a8f9f9 bsc/nitb: Allow to set the GPRS mode through the ctrl command
Create a control command to read and modify the gprs mode. Use
the get_string_value to indicate if the value was found or not.
This is useful for the ctrl interface where I didn't want to
replicate "none", "gprs" and "egprs". Share code to verify that
a BTS supports the mode.

Related: SYS#591
2015-01-31 22:38:48 +01:00
Holger Hans Peter Freyther b8c204cb92 ctrl/bsc: Fix copy and paste error and update text
30f1f37638 introduced new channel
combinations but had a copy and paste error in the description.
The jenkins system didn't run the external tests so this issue
and others were not noticed until now.

Fix the copy and paste and update the test result.
2015-01-31 19:42:42 +01:00
Holger Hans Peter Freyther 8657326093 meas: Install the scenario command and test it 2015-01-31 12:49:41 +01:00
Jacob Erlbeck 4b2d02d037 sgsn/test: Fix memory leak in test_subscriber_gsup
Currently the MM context is not deleted when a GSUP location
cancellation message is processed, because the real
sgsn_update_subscriber_data function has been wrapped to a dummy
implementation.

This commit adds an explicit call to sgsn_mm_ctx_cleanup_free which
also unassigns the LLME, so the call to gprs_llgmm_assign is removed.

It also adds an assertion to check that there are no talloc'ed blocks
left in tall_bsc_ctx.

Addresses:
== 372 bytes in 1 blocks are possibly lost in loss record 7 of 9
==    at 0x402A17C: malloc (in /usr/lib/valgrind/vgpreload_memcheck-x86-linux.so)
==    by 0x4059FB8: _talloc_zero (talloc.c:354)
==    by 0x8055B82: sgsn_mm_ctx_alloc (gprs_sgsn.c:167)
==    by 0x804A336: alloc_mm_ctx (sgsn_test.c:140)
==    by 0x804B24D: test_subscriber_gsup (sgsn_test.c:503)
==    by 0x804EC99: main (sgsn_test.c:1853)

Sponsored-by: On-Waves ehf
2015-01-30 21:33:29 +01:00
Jacob Erlbeck baf0f94a7d sgsn/test: Add checks for subscr->error_cause
This commits adds a few asserts that check the value of
subscr->error_cause after a GSUP message has been received.

Sponsored-by: On-Waves ehf
2015-01-30 21:32:47 +01:00
Jacob Erlbeck 9ff82892da gprs: Use 'Network failure' as default cause
This commit adds a check after a GSUP message has been decoded
whether it is an error message and does not contain a cause value.
If his is the case, the cause value is set to 'Network failure', so
that this cause if effectively the default value for error messages.

Sponsored-by: On-Waves ehf
2015-01-30 21:32:26 +01:00
Jacob Erlbeck 85ba655788 gprs/test: Fix GSUP Purge MS response messages
Currently the message types for these message types are wrong.

This patch inserts the correct message types.

Sponsored-by: On-Waves ehf
2015-01-30 21:29:58 +01:00
Jacob Erlbeck 466cedd052 sgsn/test: Add tests for PurgeMs responses
Currently there are not any test cases for PurgeMS GSUP messages in
test_subscriber_gsup.

This commit adds tests for incoming PurgeMSResult and -Error
messages.

Sponsored-by: On-Waves ehf
2015-01-30 21:28:17 +01:00
Jacob Erlbeck 8000e0ea50 gprs: Support cancellation type
The cancellation type that is part of the UpdateCancellation message
is currently ignored.

This patch adds the missing glue between the existing GSUP and GMM
support. If the type is not present or has the value updateProcedure
the subcriber and MM context are siliently removed. Otherwise, a
message with cause 'implicitly detached' is sent to the MS. Since the
real cause is not known (the specification neither added a cause IE
nor defined a static cause value), the MS may get the real cause in
the following AttachRej.

Added VTY commands:

- update-subscriber imsi IMSI cancel update-procedure
- update-subscriber imsi IMSI cancel subscription-withdraw

the old form without the cause is no longer supported.

Sponsored-by: On-Waves ehf
2015-01-30 21:27:07 +01:00
Jacob Erlbeck e988ae471d gprs: Don't use subscr->keep_in_ram in normal operation
Currently the keep_in_ram flag is explicitely reset in
gprs_subscr_cleanup to cover the case, that the VTY 'create'
sub-command has been used to create the subscriber entry.

This commit completely removes keep_in_ram handling from
gprs_subscriber.c and adds a VTY 'destroy' sub-command to reset the
flag and remove the entry. So 'create' and 'destroy' can be used to
manager sticky entries that are kept even when a location
cancellation is done.

Added VTY command:

- update-subscriber imsi IMSI destroy

Sponsored-by: On-Waves ehf
2015-01-28 20:42:58 +01:00
Jacob Erlbeck e671d254cb sgsn: Add sgsn_mm_ctx_cleanup_free for safe shutdown
Currently the MM context cleanup code is distributed over several
functions. sgsn_mm_ctx_free not only frees data structure but also
eventually stops the timer and does the subscriber clean-up.
mm_ctx_cleanup_free (gprs_gmm.c) cleans up the PDP contexts and
unassign the TLLI.

This commit moves the cleanup code from both functions into a new
unifying function sgsn_mm_ctx_cleanup_free that cares about the
clean-up of all related sub-systems.

Sponsored-by: On-Waves ehf
2015-01-28 20:42:52 +01:00
Jacob Erlbeck 555b2e5ac1 sgsn: Don't allow mmctx == NULL in sgsn_update_subscriber_data
Currently, sgsn_update_subscriber_data can be called with mmctx ==
NULL and will find and associate the right context (if present) based
on the subscriber's IMSI. This will not happen in regular use
any more, since sgsn_update_subscriber_data will only be called when
subscribers are used (auth mode 'remote') and in this case
gprs_subscr_get_or_create_by_mmctx will already be called by
sgsn_auth_request. Therefore, MM context and subscriber are always
associated except for some test cases and experimental VTY usage.
The current implementation of sgsn_update_subscriber_data also causes
additional complexity for the deletion on MM contexts to avoid a
ipossible double-free MM contexts.

This commit removes the MM context <-> subscriber association code
from sgsn_update_subscriber_data. That function must always be called
with mmctx != NULL, now. To avoid problems with VTY and test usage,
the calling subscriber function now only call
sgsn_update_subscriber_data when mmctx != NULL, since the purpose of
that function is to update that state of an existing MM context after
subscriber data has been changed.

Sponsored-by: On-Waves ehf
2015-01-28 20:42:52 +01:00
Jacob Erlbeck 3e4e58f349 gprs: Rename gprs_subscr_delete to gprs_subscr_cleanup
The old name is somewhat misleading. The function is rather preparing
the subscriber for a subsequent subscr_free, that is possibly invoked
by a subscr_put. It detaches the subscriber from the MM context and
optionally invokes a PURGE_MS procedure. Therefore the _cleanup
suffix is chosen (see mm_ctx_cleanup_free).

Sponsored-by: On-Waves ehf
2015-01-27 08:31:03 +01:00
Jacob Erlbeck 37139e5933 gprs: Do not put the subscr in gprs_subscr_delete
Currently gprs_subscr_delete implicitely calls subscr_put, which
makes the code more complex than necessary (additional subscr_get) in
a few places. It also makes it more difficult to see, whether get/put
are balanced within a function. In addition, the functions are not
named consistently (gprs_subscr_delete vs.
gprs_subscr_put_and_cancel).

This commit changes the semantics of gprs_subscr_delete and
indirectly of gprs_subscr_put_and_cancel to not call subscr_put on
their argument, but to leave that for the caller to do it
explicitely.

It renames gprs_subscr_put_and_cancel to gprs_subscr_cancel to
reflect that change in the name, too.

Sponsored-by: On-Waves ehf
2015-01-26 09:10:06 +01:00
Holger Hans Peter Freyther 1d778fdce3 sgsn: Remove the "permanent" subscriber cache
The subscriber cache would help in case:

  * GPRS DETACH, GPRS ATTACH. In that case we might still
  have some cached authentication tuples we avoid another
  sendAuthenticationInfo request.

  * After a detach the cache expiry would make sure to
  eventually send a purgeMS to the HLR (which might be
  ignored).

At the same time to make the cache work we will need to
make sure to start and stop timers. In case we don't
start we might accumulate subscribers. I am afraid that
the above two benefits do not outweight the complexity
of this implementation.
2015-01-26 09:09:12 +01:00
Jacob Erlbeck 81ffb740f7 sgsn: Remove inactive LLME/MM after inactivity timeout
Currently old LLMEs and MM contexts that haven't been explicitly
detached or cancelled are not removed until another request with the
same IMSI is made. These stale entries may accumulate over time and
severely compromise the operation of the SGSN.

This patch implements age based LLME expiry, when the maximum age has
been reached, the corresponding MM context is cancelled. If such an MM
context doesn't exist, the LLME is unassigned directly.

The implementation works as follows.
 - llme->age_timestamp is reset on each received PTP LLC message
 - sgsn_llme_check_cb is invoked periodically (each 30s)
 - sgsn_llme_check_cb sets the age_timestamp to the current time if
   it has been reset
 - sgsn_llme_check_cb computes the age and expires the LLME if
   it exceeds gprs_max_time_to_idle()

Ticket: OW#1364
Sponsored-by: On-Waves ehf

[hfreyther: Fix typo in comment LMME -> LLME]
2015-01-26 08:51:50 +01:00
Jacob Erlbeck 79af67d7c0 gprs: Add GPRS timer conversion functions
Currently, all GPRS timer values are hard-coded. To make these values
configurable in seconds and to show them, conversion functions from
and to seconds are needed.

This patch adds gprs_tmr_to_secs and gprs_secs_to_tmr_floor. Due to
the limited number of bits used to encode GPRS timer values, only a
few durations can be represented. gprs_secs_to_tmr_floor therefore
always returns the timer value that represents either the exact
number (if an exact representation exists) or the next lower number
for that an exact representation exists.

Sponsored-by: On-Waves ehf
2015-01-26 08:41:52 +01:00
Jacob Erlbeck d91934357f sgsn: Restructure the 'update-subscriber' command
This patch drops the following commands:

 - update-subscriber imsi IMSI insert authorized <0-1>
 - update-subscriber imsi IMSI commit

since they are already covered by the 'update-location-result'
sub-command, except that this command doesn't create an new entry if
none is found with the given IMSI.

It adds the following command:

 - update-subscriber imsi IMSI create

which can be used to create a new entry.

Sponsored-by: On-Waves ehf
2015-01-20 16:14:01 +01:00
Jacob Erlbeck 6be9ffa3b8 sgsn/test: Make assert_substr safer (Coverity)
Currently, if assert_subscr were called with subscr == NULL, the
later call to subscr_put might fail, as Coverity has complained. In
addition, the call to subscr_put would free the subscr object if it
were in the cache with a refcount of 0 at the time assert_substr was
called.

This patch adds a check for the subscr being non-NULL and reorders
the checks, so that the subscr_put comes last.

Fixes: Coverity CID 1264590

Sponsored-by: On-Waves ehf
2015-01-20 16:13:09 +01:00
Jacob Erlbeck 87c7ffccea gprs: Support the full cancellation procedure
Currently no GSUP LocationCancellationResult message is sent back to
the peer (HLR), if the procedure succeeded at the SGSN's side.

This patch adds the missing message and put the whole request
handling of this procedure into a separate function.

Ticket: OW#1338
Sponsored-by: On-Waves ehf
2015-01-20 16:12:52 +01:00
Jacob Erlbeck 4dedb27d7e gprs: Don't create a subscr entry on InsertSubscriberData
Currently gprs_subscr_rx_gsup_message creates a subscriber entry if
such an entry doesn't exist for the IMSI within an
InsertSubscriberData GSUP message. This behaviour is not compliant to
GSM 09.02, 20.3.3.2 (Subscriber data management/SGSN) where it is
defined, that an error ("Unidentified subscriber") shall be returned.

This patch removes the case distinction, so that an existing
subscriber entry is required for all incoming GSUP messages.

Sponsored-by: On-Waves ehf
2015-01-20 16:12:45 +01:00
Jacob Erlbeck 9999fd9026 gprs: Add replies for all GSUP requests
Currently, an incoming GSUP request message isn't answered at all if
it is not handled due to an error or missing implementation.

This patch adds GSUP error replies for these requests (and only for
requests). It also adds tests for these cases.

Note that several of these tests check for
GMM_CAUSE_MSGT_NOTEXIST_NOTIMPL, which will have to be changed, when
the features are implemented.

Sponsored-by: On-Waves ehf
2015-01-20 16:12:39 +01:00
Jacob Erlbeck f81cacc681 gprs: Block other GSUP procedures during PURGE_MS
GSM 09.02, 19.4.1.4 mandates that no other MAP procedures shall be
started until the PURGE_MS procedure has been completed.

This patch implements this by adding corresponding state and checks
to gprs_subscr_purge, gprs_subscr_location_update, and
gprs_subscr_update_auth_info. If an Update Location or a Send Auth
Info Req procedure is not started because of blocking, the retry
mechanism is aborted to shorten the blocking time. The outstanding
Purge MS procedure itself is not aborted.

Sponsored-by: On-Waves ehf
2015-01-20 16:12:33 +01:00
Jacob Erlbeck 65fa3f73a1 gprs: Use PURGE MS messages
When a subscriber entry is going to be deleted by SGSN and when the
subscriber info has been obtained from a remote peer via GSUP, the
peer should be informed before the entry is really deleted. For this
purpose, MAP defines the PURGE MS procedure (see GSM 09.02, 19.1.4).

This patch adds support for the PURGE_MS_REQ/_ERR/_RES messages and
invokes the procedure when the subscriber entry is going to be
removed. This only applies if GSUP is being used, the Update
Location procedure has been completed successfully, and the
subscriber has not been cancelled. The removal of the entry is
delayed until a PURGE_MS_RES or PURGE_MS_ERR message is received.

Note that GSM 09.02, 19.1.4.4 implies that the subscriber data is not
to be removed when the procedure fails which is not the way the
feature has been implemented.

Note that handling 'P-TMSI freezing' is not implemented.

Ticket: OW#1338
Sponsored-by: On-Waves ehf
2015-01-18 18:33:31 +01:00
Jacob Erlbeck 69d271376c gprs: Implement PURGE_MS GSUP messages
This commit implements the encoding and decoding of the messages

  - Purge MS Request
  - Purge MS Error
  - Purge MS Result

and adds corresponding tests.

Sponsored-by: On-Waves ehf
2015-01-18 18:33:13 +01:00
Jacob Erlbeck 058bc26e1b sgsn/test: Add checks and reports to detect subscr leakage
This commit adds talloc reports to log remaining NULL chunks after the
terminates. It also adds explicit checks for empty subscriber lists.

Sponsored-by: On-Waves ehf
2015-01-18 18:29:13 +01:00
Jacob Erlbeck c157ee7d2c sgsn/test: Add test that intercepts gprs_gsup_client_send
This test replaces gprs_gsup_client_send by a custom function, that
emulates a GSUP remote peer by calling gprs_subscr_rx_gsup_message
with responses for all requests. It then executes a full
Attach/Detach cycle.

Sponsored-by: On-Waves ehf
2015-01-18 18:28:20 +01:00
Jacob Erlbeck 0f47b8fae7 gprs: Add expiry timeout for subscriber entries
Set the expiry delay after the subscriber has been deleted (e.g. by
freeing the MM context). If cancelled, the subscriber will be deleted
immediately and no timeout will be set. If the expiry time is set to
SGSN_TIMEOUT_NEVER, no timer will be started and the subscriber entry
will be kept until it is cancelled.

The following VTY command is added to the sgsn node:

  - subscriber-expiry-time <0-999999>    set expiry time in seconds
  - no subscriber-expiry-time            set to SGSN_TIMEOUT_NEVER

The default is an expiry time of 0 seconds, which means that the
subscriber entries are wiped out immediately after an MM context is
destroyed.

Note that unused MM contexts are not expired yet. Therefore the
subscriber will only be expired after a successful MM detach.

Sponsored-by: On-Waves ehf
2015-01-18 18:27:19 +01:00
Jacob Erlbeck b8fb1409d1 sgsn/test: Refactor subscriber test
The code sequence that checks, whether a subscriber is still
reachable for a given IMSI, is repeated several times.

This patch puts this code sequence into a single function and adds a
check for the IMSI after the entry has been found. In addition,
some comments are extended.

Sponsored-by: On-Waves ehf
2015-01-18 18:26:35 +01:00
Jacob Erlbeck e1beb6f51d sgsn/test: Fix subscriber cleanup
Currently the subscribers are not really deleted by
cleanup_subscr_by_imsi, but kept in RAM instead.

This patch fixes this and adds a test to verify, that the subscriber
is really deleted afterwards.

Sponsored-by: On-Waves ehf
2015-01-18 18:26:14 +01:00
Jacob Erlbeck d3cde1ecf4 gprs/test: Move subscr cleanup code into a separate function
Refactor several occurences of the same subscriber cleanup code into
a seperate cleanup_subscr_by_imsi function.

Sponsored-by: On-Waves ehf
2015-01-18 18:26:03 +01:00
Jacob Erlbeck bce2061b43 gprs: Let GSUP parser functions return GMM causes on errors
Currently the GSUP message handling function in gprs_subscriber.c and
the functions in gprs_gsup_messages.c are not consistent with respect
to the return codes if an error happens. Albeit all error return
codes are negative, the semantics of the absolute value are not
clearly defined. In addition, some return codes are not passed to the
calling function.

This path changes these functions to always return a negated GMM
cause value in case of errors. Return values of called parser
functions are not longer ignored.

Sponsored-by: On-Waves ehf
2015-01-18 18:22:47 +01:00
Jacob Erlbeck af3d5c508c sgsn: Pass subscriber error causes to the GMM layer
This patch extends gsm0408_gprs_access_denied and
gsm0408_gprs_access_cancelled to accept GMM cause codes. These are
then passed to the MS, unless gsm0408_gprs_access_cancelled is called
with cause 0 (no error -> updateProcedure).

Since gsm0408_gprs_access_denied uses GMM_CAUSE_GPRS_NOTALLOWED if
the cause is not set, and the subscriber's error_cause is never set
(and thus always 0), the SGSN's behaviour does not change with this
patch.

Sponsored-by: On-Waves ehf

Conflicts:
	openbsc/include/openbsc/gprs_sgsn.h

[hfreyther: Conflict due the removal of the unused
authenticate flag]
2015-01-18 18:14:49 +01:00
Jacob Erlbeck afcf23001e gprs: Move protocol value_strings to gsm_04_08_gprs.c
Currently the mapping between GSM 04.08 (GPRS) protocol specific
numbers and their textual description was put into gprs_gmm.c and not
exported.

This commit moves the mappings to a new file gsm_04_08_gprs.c,
renames some of them, and exports them via gsm_04_08_gprs.h.

The following identifiers are renamed to match the corresponding type
names:

  - gmm_cause_names -> gsm48_gmm_cause_names
  - gsm_cause_names -> gsm48_gsm_cause_names

Sponsored-by: On-Waves ehf
2015-01-18 18:13:06 +01:00
Jacob Erlbeck 7660ffa29f sgsn/test: Extend tests to simulate lost GSUP requests
This patch extends test_gmm_attach to optionally resend Attach
Requests until the SGSN responds to it instead of calling
OSMO_ASSERT at a few places. The test_gmm_attach_subscr_gsup_auth
test optionally uses this feature. It is called once in either mode.

Sponsored-by: On-Waves ehf
2015-01-18 17:23:59 +01:00
Jacob Erlbeck 3d722450de sgsn/test: Add GMM test for a GSUP based attach procedure
This test calls test_gmm_attach() where the mocked subscriber
functions insert GSUP messages instead of manipulating the
subscriber structure directly.

Sponsored-by: On-Waves ehf
2015-01-18 13:27:02 +01:00
Jacob Erlbeck e21e184d84 sgsn/test: Add wrapper for gprs_subscr_rx_gsup_message
Currently, several lines of boiler plate are needed around a call to
gprs_subscr_rx_gsup_message.

This patch puts all of this (including the call to
gprs_subscr_rx_gsup_message) into a separate function.

Sponsored-by: On-Waves ehf
2015-01-18 13:25:24 +01:00
Jacob Erlbeck 771573c535 sgsn: Add global require_update_location flag
This flag is used to determine, whether the Update Location procedure
shall be invoked. This is currently only set, when the 'remote'
authorization policy is set. When the flag is set, sgsn_auth_update
will not never be called directly by sgsn_auth_request, if an Attach
Request procedure is pending, even if the remote connection fails for
some reason.

Sponsored-by: On-Waves ehf
2015-01-18 13:23:13 +01:00
Jacob Erlbeck 9d4f46c975 sgsn: Replace subscr.authenticate by global require_authentication flag
Currently the flag 'authenticate' is managed per subscriber.

This patch replaces that flag by a global cfg.require_authentication
flag that enables/disables the use of the Auth & Ciph procedure for
every subscriber. The flag is set by the VTY, if and only if the
authorization policy is 'remote'.

The VTY command

  - update-subscriber imsi IMSI insert authenticate <0-1>

is removed.

Sponsored-by: On-Waves ehf
2015-01-18 13:18:35 +01:00
Jacob Erlbeck 39f040d62b sgsn: Integrate the GSUP client into the SGSN
This commit adds GSUP client configuration (via VTY), connection set
up, and real message sending.

The following configuration commands are added:

 - gsup remote-ip A.B.C.D            set server IP address
 - gsup remote-port PORT             set server TCP port

Ticket: OW#1338
Sponsored-by: On-Waves ehf
2015-01-18 13:17:50 +01:00
Jacob Erlbeck 0572ee045d gprs/test: Add tests for invalid GSUP messages
Currently, the tests only use valid GSUP messages. This does not
check the robustness of the parser.

This commit adds a test for truncated messages and another for
modified messages.

Thanks to Holger for the basic truncation test.

Sponsored-by: On-Waves ehf
2015-01-18 13:17:09 +01:00
Jacob Erlbeck f0b06d82cd sgsn/test: Fix msgb freeing in mocked bssgp_tx_dl_ud
Currently the mocked bssgp_tx_dl_ud function used for testing in
sgsn_test.c does not free the msg as it is done by the original
function. This leads to a msgb leak in the test.

This patch fixes the test code accordingly and uncomments the
assertion that checks for left-over msgbs.

Sponsored-by: On-Waves ehf
2015-01-18 13:17:09 +01:00
Jacob Erlbeck 07de92e2c0 sgsn/test: Add checks and reports to detect msgb leakage
This commit adds talloc reports to log remaining chunks after the
testing has been finished. It also adds a (currently disabled) check,
that no msgbs are allocated after running the tests.

Sponsored-by: On-Waves ehf
2015-01-18 13:17:08 +01:00