Commit Graph

563 Commits

Author SHA1 Message Date
Vadim Yanitskiy fb05bb4a60 msc/gsm_04_11.h: drop unused sms_next_rp_msg_ref()
Change-Id: I53b27629177b3342c4f5b34c80d52cbb6dc8476b
2018-11-21 20:52:36 +07:00
Max 366390d81a Add counters for BSSMAP cipher mode messages
Count COMPLETE and REJECT messages. Besides general troubleshooting
that's also useful for TTCN-3 tests to check that OsmoMSC processed
those messages as expected.

Change-Id: I5822b2b38b64f1a691b26c926a8e2bece21dc624
Related: OS#3187
2018-11-02 22:06:09 +00:00
Philipp Maier 9ca7b31cbf gsm_04_08_cc: Add global guard timer for MNCC
The external MNCC handler may hang indefinitely in cases where the remote
end of the MNCC ceases to work properly. Add a global guard timer to
make sure the call reaches ACTIVE state.

Change-Id: I7375d1e17cd746aac4eadfe1e587e82cf1630d3d
Related: OS#3599
2018-10-24 10:27:39 +02:00
Neels Hofmeyr 68cf957bfd fix Classmark Update without VLR subscriber
This recent patch moves Classmark storage to the VLR subscriber, and introduced
a segfault when a Classmark Update is received during IMSI detach:

commit 986fe7ed18
change-id I27081bf6e9e017923b2d02607f7ea06beddad82a
Mon Sep 17 01:12:13 2018 +0200
"store classmark in vlr_subscr, not conn"

It assumed that we would never accept any Classmark Update messages unless we
also have a valid subscriber for it. Well, that is proven wrong by the
ttcn3-msc-test TC_imsi_detach_by_imsi(), which brings osmo-msc to its knees.

Fix: in case of no valid vlr_subscr being present, store Classmark in the conn
temporarily, and copy any received Classmark to VLR subscriber as soon as it
gets associated with the conn (if at all).

Change-Id: Ib2a2ae6bf86e8f29fc6751a8b5cdb7187cd70290
2018-09-18 16:13:58 +02:00
Neels Hofmeyr 3117b701c8 A5/n Ciph: request Classmark Update if missing
When the VLR requests a Ciphering Mode with vlr_ops.set_ciph_mode(), and if we
need a ciph algo flag from a Classmark information that is not yet known
(usually CM 2 during LU), send a BSSMAP Classmark Request to get it.

To manage the intermission of the Classmark Request, add
- msc_classmark_request_then_cipher_mode_cmd(),
- state SUBSCR_CONN_S_WAIT_CLASSMARK_UPDATE,
- event SUBSCR_CONN_E_CLASSMARK_UPDATE.

From state AUTH_CIPH, switch to state WAIT_CLASSMARK_UPDATE. Once the BSSMAP
Classmark Response, is received, switch back to SUBSCR_CONN_S_AUTH_CIPH and
re-initiate Ciphering Mode.

To be able to re-enter the Ciphering Mode algo decision, factor it out into
msc_geran_set_cipher_mode().

Rationale:

In the following commit, essentially we stopped supporting A5/3 ciphering:

commit 71330720b6
"MSC: Intersect configured A5 algorithms with MS-supported ones"
Change-Id: Id124923ee52a357cb7d3e04d33f585214774f3a3

A5/3 was no longer supported because from that commit on, we strictly checked
the MS-supported ciphers, but we did not have Classmark 2 available during
Location Updating.

This patch changes that: when Classmark 2 is missing, actively request it by a
BSSMAP Classmark Request; continue Ciphering only after the Response. Always
request missing Classmark, even if a lesser cipher were configured available.

If the Classmark Update response fails to come in, cause an attach failure.
Instead, we could attempt to use a lesser cipher that is also enabled. That is
left as a future feature, should that become relevant. I think it's unlikely.

Technically, we could now end up requesting a Classmark Updating both during LU
(vlr_lu_fsm) and CM Service/Paging Response (proc_arq_fsm), but in practice the
only time we lack a Classmark is: during Location Updating with A5/3 enabled.
A5/1 support is indicated in CM1 which is always available, and A5/3 support is
indicated in CM2, which is always available during CM Service Request as well
as Paging Response. So this patch has practical relevance only for Location
Updating. For networks that permit only A5/3, this patch fixes Location
Updating. For networks that support A5/3 and A5/1, so far we always used A5/1
during LU, and after this patch we request CM2 and likely use A5/3 instead.

In msc_vlr_test_gsm_ciph, verify that requesting Classmark 2 for A5/3 works
during LU. Also verify that the lack of a Classmark Response results in attach
failure.

In msc_vlr_test_gsm_ciph, a hacky unit test fakes a situation where a CM2 is
missing during proc_arq_fsm and proves that that code path works, even though
the practical relevance is currently zero. It would only become interesting if
ciphering algorithms A5/4 and higher became relevant, because support of those
would be indicated in Classmark 3, which would always require a Classmark
Request.

Related: OS#3043
Depends: I4a2e1d3923e33912579c4180aa1ff8e8f5abb7e7 (libosmocore)
Change-Id: I73c7cb6a86624695bd9c0f59abb72e2fdc655131
2018-09-17 02:08:07 +02:00
Neels Hofmeyr 986fe7ed18 store classmark in vlr_subscr, not conn
Store all Classmark information in the VLR.

So, we now always know the Classmark 1 (mandatory IE for LU). This is visible
in the msc_vlr_tests -- they no longer indicate "assuming A5/1 is supported"
because classmark 1 is missing, because we now know the Classmark 1.

Rationale:

During Location Updating, we receive Classmark 1; during CM Service Request and
Paging Response, we receive Classmark 2. So far we stored these only for the
duration of the conn, so as soon as a LU is complete, we would forget CM1.

In other words, for anything else than a LU Request, we had no Classmark 1
available at all.

During Ciphering Mode Command, we rely on Classmark 1 to determine whether A5/1
is supported. That is moot if we don't even have a Classmark 1 for any CM
Service Request or Paging Response initiated connections.

The only reason that A5/1 worked is that we assume A5/1 to work if Classmark 1
is missing. To add to the confusion, if a phone indicated that it did *not*
support A5/1 in the Classmark 1, according to spec we're supposed to not
service it at all. A code comment however says that we instead want to heed the
flag -- which so far was only present in a Location Updating initiated
connection. Now we can make this decision without assuming things.

This got my attention while hacking on sending a BSSMAP Classmark Request from
the MSC if it finds missing Classmark information, and was surprised to see it
it lacking CM1 to decide about A5/1.

Change-Id: I27081bf6e9e017923b2d02607f7ea06beddad82a
2018-09-17 01:12:13 +02:00
Neels Hofmeyr c36e61e3dc use __FILE__, not __BASE_FILE__
The intention was to use the file's basename, but __BASE_FILE__ means "the root
file that is being parsed and contains #include statements".

If we had a function using __BASE_FILE__ and that was defined in an #included
file, __BASE_FILE__ would indicate the first file where the #include is, and
not the file where the function is defined. __BASE_FILE__ works for us because
we don't ever include function definitions that log something, so __BASE_FILE__
always coincides with __FILE__ for our logging; but still __BASE_FILE__ is
semantically the wrong constant.

Related: OS#2740
Change-Id: I1c8122c909938daaf782468c1c5b0262d555c3ce
2018-08-20 12:41:36 +02:00
Philipp Maier 8ad3dacebb mgcp: use codec information returned with ASSIGNMENT COMPL.
When the assignment completes a choosen codec is returned. At the
moment we do not use this information.

- add struct members for codec info (both, RAN and CN)
- parse codec info in BSSMAP ASSIGNMENT COMPLETE
- use codec info on mgcp

Since the MNCC API is not complete yet, we currently only use the
codec info only on the internal MNCC yet.

Change-Id: I9d5b1cd016d9a058b22a367d0e5e9f2ef447931a
Related: OS#2728
2018-08-07 16:51:30 +00:00
Vadim Yanitskiy 1b8913090e RRLP: migrate and share mode definitions from msc_vty.c
Change-Id: I9560e6eab0ad1b5d57ca732741fc0b6f61f1a4a2
2018-08-05 11:33:20 +00:00
Vadim Yanitskiy d01b594092 RRLP: properly name the init function
We don't actually deal with DSO loading here...

Change-Id: I24d0c9ad52f07f08176ad129878b48a591a3af6c
2018-08-05 11:33:20 +00:00
Harald Welte 1ea6baf1ec Remove local libgsupclient; Use libosmo-gsup-client from osmo-hlr
osmo-hlr has recently (as of Change-Id
Iad227bb477d64da30dd6bfbbe1bd0c0a55be9474) a working shared library
implementation of libosmo-gsup-client.

We can remove the local implementation in osmo-msc and use the
system-installed shared library instead.

Change-Id: I6f542945403cf2e3ddac419186b09ec0e2d43b69
2018-08-05 11:20:21 +02:00
Vadim Yanitskiy 0622ef5308 libmsc/gsm_09_11.c: clean up the local GSM 04.80 API
Since we don't process SS/USSD requests in OsmoMSC anymore, there
are some useless GSM 04.80 functions remained from the past.

In particular, this change does the following:

  - removes both gsm0480_send_{ussd_response|return_error}
    functions because they are not used anymore;

  - changes symbol prefix from 'gsm0480_' to 'msc_', in order to
    avoid possible conflicts with the libosmogsm's GSM 04.80 API;

  - cleans up useless includes;

Change-Id: I2990d8627bce0ce6afb1dcf6b11bb194292380d3
2018-08-05 07:15:01 +00:00
Vadim Yanitskiy 0d2e9bedd5 msc/rrlp.h: use #pragma once include guard
Change-Id: Ie68b2092a0a9ceae3519ab9059ac2c1e3d8d7450
2018-08-04 01:17:44 +07:00
Vadim Yanitskiy 29e893028e msc/signal.h: use #pragma once include guard
Change-Id: I114026808abeff72a3f4f3cb1b84680c116409d4
2018-08-04 01:01:12 +07:00
Harald Welte a44b970592 migrate to oap_client in libosmogsm
libosmogsm in libosmocore.git from Change-Id
Ie36729996abd30b84d1c30a09f62ebc6a9794950 onwards contains oap_client.c,
so we don't need our local copy here in this repo anymore.

Change-Id: Ib6496c35d0ce6eb531e97129dc45a9f68e503b34
Requires: libosmocore.git Change-Id Ie36729996abd30b84d1c30a09f62ebc6a9794950
2018-07-31 17:21:24 +00:00
Vadim Yanitskiy ad64e2a8c7 libmsc/gsm_09_11.c: introduce counter for active sessions
Change-Id: Ia17e7c747fffb5267d3ca5bc4193c1be4a57ef3a
2018-07-30 21:28:01 +02:00
Vadim Yanitskiy 8e25cc5298 libmsc/gsm_09_11.c: introduce rate counters for NC_SS sessions
This change introduces some new rate counters for call-independent
SS/USSD connections. As OsmoMSC doesn't handle the messages itself,
and only responsible for dispatching messages between both
A and GSUP interfaces, the following is taken into account:

  - MS-initiated and network-initiated requests to establish
    a NC SS/USSD session (transaction) - "nc_ss:m{o|t}_requests";

  - successfully established MS-initiated and network-initiated
    SS/USSD sessions (transactions) - "nc_ss:m{o|t}_established".

Change-Id: I23c9475abc9951d82f3342fdc5aaa367836f7741
2018-07-30 21:28:01 +02:00
Vadim Yanitskiy f2f83b07f3 libmsc/gsm_09_11.c: implement network-initiated sessions
This change introduces a possibility to establish network-initiated
SS/USSD transactions with a subscriber in either IDLE, or DEDICATED
state. In the first case, a new transaction is established using
Paging procedure. If a subscriber already has an active connection,
a separate new transaction is established.

TTCN-3 test case: I073893c6e11be27e9e36f98f11c1491d0c173985
Change-Id: Ief14f8914ef013bd6efd7be842f81fbf053f02e2
2018-07-30 21:28:01 +02:00
Vadim Yanitskiy 8a6ef55ec5 libmsc/gsm_09_11.c: forward SS/USSD messages to HLR over GSUP
In order to be able to support external SS/USSD gateway, we should
not terminate the GSM 04.80 messages at OsmoMSC. Instead, we need
to follow the GSM TS 09.11 specification, and forward all messages
unhandled by OsmoMSC to OsmoHLR over GSUP protocol.

This change implements forwarding of MO SS/USSD messages. The
forwarding assumes transcoding between GSM 04.80 messages and
GSUP messages. The payload of Facility IE is carried 'as is'.

As a side-effect, this will disable the osmo-msc internal handler
implementing the "*#100#" for obtaining the subscribers own phone
number.  In order to re-gain this functionality, you will need a
modern osmo-hlr (Change-Id I1d09fab810a6bb9ab02904de72dbc9e8a414f9f9)
and the following line in your osmo-hlr.cfg:
 hlr
  ussd route prefix *#100# internal own-msisdn

TTCN-3 test case: I01de73aced6057328a121577a5a83bc2615fb2d4
Change-Id: Ide5f7e350b537db80cd8326fc59c8bf2e01cb68c
2018-07-30 15:35:14 +00:00
Vadim Yanitskiy 8a0e2588e2 libvlr/vlr.c: forward unhandled GSUP messages towards MSC
Some internal sub-systems, such as SS/USSD or SMS implementation,
may also need to use GSUP connection with HLR. Previously, it was
only available within the libvlr code, and nowhere else.

Let's introduce the generic GSUP message router, which will
receive messages unhandled by VLR itself, and route them to
a handler depending on the message type.

Change-Id: Ib8146ce5788c8f249dcaa39d61bd0388574bf892
2018-07-29 16:22:06 +02:00
Harald Welte 27989d41dc libmsc: move L3 call-control to separate C file (gsm_04_08_cc.c)
The CC sub-layer is fairly self-contained, so let's move it to
a separate C source file.  The old gsm_04_08.c file now only
contains the 04.07 / DTAP core and MM sub-layer handling.

I did this initially as an experiment to see how self-contained
our CC implementation really is.  Given this rather straight-forward
patch builds fine, CC really is self-contained (yay!).

Change-Id: Idb8dd7a8d9d8b4a28c492f12da3cc3305b695cca
2018-07-25 18:53:57 +00:00
Vadim Yanitskiy 5df4e4ddde libmsc/gsm_04_80.c: make the API abstract from ss_request struct
There is no need to pass a pointer to a ss_request struct when
calling the gsm0480_send_ussd_* functions, because they only
use both transaction ID and InvokeID from there, which may
be passed directly.

This change allows one to use this API without parsing the
whole GSM 04.80 message, or when parsing is failed. Moreover,
if InvokeID is not available, one can pass any incorrect,
(e.g. negative) value, so the universal NULL tag will be used.
Finally, setting a TI flag is also up to the caller.

Change-Id: I13d5abbfdcf8238ebaf0566c420f09cd9255b648
2018-06-12 23:31:34 +07:00
Vadim Yanitskiy f5b9e6cdf6 libmsc/gsm_04_08.c: expose gsm48_tx_simple()
This function could be also used by other parts of code, e.g.
by gsm_04_11.c or by gsm_09_11.c, during initialization of
a new transaction. No need to hide it.

Change-Id: I9a9d17fca4901163dae10d76455aa4cf54497156
2018-06-12 23:07:26 +07:00
Vadim Yanitskiy 5b860faf4e Use proper naming for GSM TS 09.11 implementation
During a long time, we had both file and symbol names, actually
related to Supplementary Services, with the 'ussd' abbreviation.
This is not absolutely wrong, but isn't correct at the same time.

USSD is a kind of Supplementary Services, this is only a part
of them. There are also 'structured' Supplementary Services,
which can be call related or call independent.

The "Signalling interworking for supplementary services" is
defined by GSM TS 09.11, and this is exactly what MSC should
implement. Let's use the specification number for naming, as
we do e.g. in the GSM 04.11 (SMS) implementation.

Change-Id: Ic1eaceddb58132318e4e941be542da34b8ebefe1
2018-06-12 06:14:36 +07:00
Vadim Yanitskiy 846efcba95 libmsc: properly name the MSC_CONN_USE token for SS
Previously the MSC_CONN_USE token for Supplementary Services was
called 'MSC_CONN_USE_TRANS_USSD'. Non-call related Supplementary
Services is not only about USSD, so let's rename it.

Change-Id: I5b3517c87a32fa64dea6b0c912f2b76c5c25a112
2018-06-10 22:22:49 +07:00
Vadim Yanitskiy 635f98cf31 libmsc/ussd.c: FIX: properly indicate errors
There are error and problem codes defined by GSM TS 04.80:

  - Error codes are used when a message is structured correctly,
    but something is wrong in context of the current operation.
    Usually they are carried by 'Return Error' component.

  - Problem codes are used when something is wrong with the
    message structure, or with carried values. They are
    carried by 'Reject' component.

    There are three groups of them (see table 3.13):

      - General Problem Codes (table 3.14),
      - Invoke Problem Codes (table 3.15),
      - Return Result Problem Codes (table 3.16),
      - Return Error Problem Codes (table 3.17).

    The first group is general purpose, and can be sent in
    response to any kind of message, excluding 'Reject' itself.
    Other ones are bound to specific component types, such as
    'Invoke', 'Return Result' and 'Return Error'.

For some reason, a 'Reject' component with the general problem
code 'GSM_0480_GEN_PROB_CODE_UNRECOGNISED' was always used in
OsmoMSC. Even when the message structure is correct.

Let's properly indicate errors in the following way:

  - 'Reject' with GSM_0480_GEN_PROB_CODE_UNRECOGNISED
    when the gsm0480_decode_ss_request() fails to decode
    a message. It can only return 0 or 1, so it's hard to
    guess which exact part of message caused the error.

  - 'Return Error' with GSM0480_ERR_CODE_ILLEGAL_SS_OPERATION
    when the operation code is not related to USSD.

  - 'Return Error' with GSM0480_ERR_CODE_UNEXPECTED_DATA_VALUE
    when the requested USSD code is unhandled (not supported).

There is a TTCN-3 testcase for this:

https://gerrit.osmocom.org/9470/

Change-Id: I800e7ec98dc9d0bca2d45a8b8255d60253d63e14
2018-06-08 17:13:44 +07:00
Stefan Sperling defc3c8caf implement periodic Location Update expiry in the VLR
Remove subscribers which fail to send periodic Location Updates from the
list of subscribers known to the VLR. This complements the IMSI detach
procedure: periodic LU expiry triggers an implicit IMSI detach.

Expired subscribers are purged from a periodic timer which iterates
over all subscribers once per minute.

Subscribers with an active connection do not expire. This is controlled
by the subscriber conn FSM which sets a subscriber's the LU expiry timeout
value to GSM_SUBSCRIBER_NO_EXPIRATION while a connection is active.

Add support for fake time with osmo_clock_gettime() to msc_vlr tests.

This functionality existed in OpenBSC but was lost during the nitb split.
This code took some inspiration from the OpenBSC implementation.

Related: OS#1976
Change-Id: Iebdee8b12d22acfcfb265ee41e71cfc8d9eb3ba9
2018-05-23 14:55:00 +02:00
Philipp Maier f913e5f575 a_reset: cleanup + remove dead code
a_reset.c/h was originally developed to be used in both, bsc and
msc without changes. Unfortunately no suitable library has been
found for a_reset.c/h so the file ended up as duplicated code in
both split brances. Eventually we decided to specialize the
generalized code again, which means some of the functions needed
only by osmo-bsc are removed.

- Remove dead code
- Fix timer identification number (T16)
- use fi->priv to hold context info
- Minor cosmetic fixes

Change-Id: I8e489eb494d358d130e51cb2167929edeaa12e92
Depends: libosmocore I36d221c973d3890721ef1d376fb9be82c4311378
Related: OS#3103
2018-05-17 20:14:01 +00:00
Pau Espin 4cf452fbd8 Remove unused GSM_PAGING_OOM
Change-Id: Ie5883953f48d11ec498f47c30ab4201bb956368c
2018-04-24 11:35:37 +02:00
Neels Hofmeyr 21adb2bcd1 cosmetic: use enum ranap_nsap_addr_enc instead of int
The only reason to use int instead of the enum was the lack of header
iu_client.h when not building with Iu support. Rather use the configure result
properly, include the header when Iu support is built and use the proper enum.

Omit the entire iu sub-struct when building without Iu.

Add LIBOSMORANAP_CFLAGS to libvlr, in order to find the iu_client.h header (now
also included from gsm_data.h).

Rationale: Instead of using a questionable typecast from int* to enum*, we can
now use the enum member directly without needing to silence compiler warnings.

Change-Id: Ic9f8bf53f4b605c166e84cd7edd90c10fe7d7a1f
2018-04-16 01:50:46 +02:00
Neels Hofmeyr 158095960b refactor VLR FSM result handling
Instead of keeping separate enums for FSM results and translating between those
and the actual 04.08 reject causes that will ultimately reach the MS, just pass
enum gsm48_reject_value cause codes around everywhere.

Collapse some VLR *_timeout() and *_cancel() api to just *_cancel() with a
gsm48 cause arg.

(Hopefully) improve a few reject causes, but otherwise just aim for more
transparent decisions on which cause value is used, for future fixes of
returned causes.

Depends: I6661f139e68a498fb1bef10c266c2f064b72774a (libosmocore)
Change-Id: I27bf8d68737ff1f8dc6d11fb1eac3d391aab0cb1
2018-04-12 19:40:00 +00:00
Neels Hofmeyr 4068ab278b properly receive BSSMAP Clear Complete and Iu Release Complete
When sending a BSSMAP Clear or Iu Release, do not immediately discard the conn,
but wait until a BSSMAP Clear Complete / Iu Release Complete has been received.

Hence we will no longer show in the log that an incoming Release/Clear Complete
belongs to an unknown subscriber, but will still be around to properly log the
release.

Related: OS#3122
Change-Id: Ie4c6aaba3866d6e5b98004e8870a215e8cf8ffc1
2018-04-11 21:39:44 +00:00
Neels Hofmeyr e3d3dc6ea2 refactor subscr_conn and subscr_conn_fsm de-/alloc
Refactor:

1. Glue the gsm_subscriber_connection alloc to the subscr_conn_fsm.
2. Add separate AUTH_CIPH state to the FSM.
3. Use conn->use_count to trigger conn release.
4. Add separate RELEASING state to the FSM.
5. Add rate counters for each of the three Complete Layer 3 types.

Details:

1. Glue the gsm_subscriber_connection alloc to the subscr_conn_fsm.

Historically, a gsm_subscriber_connection was allocated in libbsc land, and
only upon Complete Layer 3 did libmsc add the fsm instance. After splitting
openbsc.git into a separate osmo-msc, this is no longer necessary, hence:

Closely tie gsm_subscriber_connection allocation to the subscr_conn_fsm
instance: talloc the conn as a child of the FSM instance, and discard the conn
as soon as the FSM terminates.

2. Add separate AUTH_CIPH state to the FSM.

Decoding the Complete Layer 3 message is distinctly separate from waiting for
the VLR FSMs to conclude. Use the NEW state as "we don't know if this is a
valid message yet", and the AUTH_CIPH state as "evaluating, don't release".

A profound effect of this: should we for any odd reason fail to leave the FSM's
NEW state, the conn will be released right at the end of msc_compl_l3(),
without needing to trigger release in each code path.

3. Use conn->use_count to trigger conn release.

Before, the FSM itself would hold a use count on the conn, and hence we would
need to ask it whether it is ready to release the conn yet by dispatching
events, to achieve a use_count decrement.

Instead, unite the FSM instance and conn, and do not hold a use count by the
FSM. Hence, trigger an FSM "UNUSED" event only when the use_count reaches zero.
As long as use counts are done correctly, the FSM will terminate correctly.

These exceptions:

- The new AUTH_CIPH state explicitly ignores UNUSED events, since we expect the
  use count to reach zero while evaluating Authentication and Ciphering. (I
  experimented with holding a use count by AUTH_CIPH onenter() and releasing by
  onleave(), but the use count and thus the conn are released before the next
  state can initiate transactions that would increment the use count again.
  Same thing for the VLR FSMs holding a use count, they should be done before
  we advance to the next state. The easiest is to simply expect zero use count
  during the AUTH_CIPH state.)

- A CM Service Request means that even though the MSC would be through with all
  it wants to do, we shall still wait for a request to follow from the MS.
  Hence the FSM holds a use count on itself while a CM Service is pending.

- While waiting for a Release/Clear Complete, the FSM holds a use count on
  itself.

4. Add separate RELEASING state to the FSM.

If we decide to release for other reasons than a use count reaching zero, we
still need to be able to wait for the msc_dtap() use count on the conn to
release.

(An upcoming patch will further use the RELEASING state to properly wait for
Clear Complete / Release Complete messages.)

5. Add rate counters for each of the three Complete Layer 3 types.

Besides LU, also count CM Service Request and Paging Response
acceptance/rejections. Without these counters, only very few of the auth+ciph
outcomes actually show in the counters.

Related: OS#3122
Change-Id: I55feb379e176a96a831e105b86202b17a0ffe889
2018-04-11 21:39:44 +00:00
Vadim Yanitskiy 12d221f8cc libmsc/gsm_04_80.c: drop unused 'in_msg' argument
It isn't used, so no need to pass it.

Change-Id: I4248ebf8626d3f7f0bf273fd20cc4f64e979938b
2018-04-09 18:57:33 +00:00
Vadim Yanitskiy 01c0549af3 ussd.h: cosmetic: use '#pragma once' include guard
Change-Id: I0e78aa946b8e6bc7c31534751b2ee5c867bfd490
2018-04-09 18:57:33 +00:00
Vadim Yanitskiy b7d4065648 ussd.h: cosmetic: remove useless comment
We usually put comments for functions in *.c files, while header
files are usually plain listings of the API without comments.

Change-Id: I6b0d1d9e1a1b1ffb71cb9905e74f6fad2333bb65
2018-04-09 18:57:33 +00:00
Harald Welte 39b5548808 Permit any Sender MSISDN when sending SMS from VTY
In the old days, OsmoNITB couldn't process any SMS that wasn't between
two subscribers on the same NITB.

We've long re-worked the internals in order to process SMS with
arbitrary sender MSISDN (e.g. from SMPP). However, the VTY command
"subscriber ... sms" was never updated, it seems.

Change-Id: I62b17e0a67989484415f0df2c8cb4ff1f94dbf2b
Closes: OS#3151
2018-04-09 19:19:33 +02:00
Harald Welte 0e2fa5dcb5 DTAP: Ensure proper DLCI is used in MSC-originated DTAP
The DLCI field of the DTAP header indicates the SAPI as well as the
data link (main DCCH or SACCH).  We must make sure to use the correct
DLCI when sending DTAP to the BSC.

We achieve this by
* storing the DLCI in the msgb->cb while parsing the DTAP header
* storing the received DLCI (from msgb->cb) in the transaction for
  mobile-originated transactions
* using the trans->dlci to sent msgb->cb when transmitting L3
* filling the DTAP DLCI value from msgb->cb when transmitting DTAP

For MSC-originated transactions, we choose a DLCI value corresponding
to the service (SAPI=0 for CC, SAPI=3 for SMS) and store that in
trans->dlci.

Closes: OS#3150
Change-Id: If511b20f52575054cab1346d99a8cb68d827fdbf
2018-04-09 16:41:10 +02:00
Neels Hofmeyr 93c7463fce unify allocation of gsm_subscriber_connection
The current msc_subscr_con_allocate() was in fact only used by msc_vlr_tests,
while both a_iface_bssap.c and iucs.c did their own duplicate code of
allocating the gsm_subscriber_connection struct. Unify.

Drop the old msc_subscr_con_allocate(), instead add msc_subscr_conn_alloc().
The new function also takes via_ran and lac arguments directly.

The conn allocation will soon be closely tied to the subscr_conn_fsm instance
allocation, so place the new function definition alongside the other
subscr_conn_fsm API, and match its naming ("conn").

Related: OS#3122
Change-Id: Ia57b42a149a43f9c370b1310e2e1f512183993ea
2018-04-05 01:10:32 +02:00
Neels Hofmeyr 16c42b5fba subscr_conn: store complete_layer3_type in conn, not FSM event arg
Instead of jumping through hoops to pass the Complete Layer 3 operation that
created this conn via FSM event dispatch parameters, put it right in the
gsm_subscriber_connection struct, where it always belonged.

Move definition of the enum complete_layer3_type to gsm_data.h, where
gsm_subscriber_connection is defined.

Introduce msc_subscr_conn_update_id() to set the complete_layer3_type of the
conn as soon as a Complete Layer 3 message is received.

In msc_subscr_conn_update_id(), already include an mi_string argument to
prepare for an upcoming patch where the FSM will be allocated much earlier when
the Mobile Identity is not known yet, and we'll also update the fi->id here.

The odd logging change in the msc_vlr_tests output uncovers a wrong use of the
osmo_fsm_inst_dispatch() data argument for SUBSCR_CONN_E_CN_CLOSE events: if a
child FSM signals unsuccessful result, instead of the failure cause, it passed
the complete_layer3_type, as requested upon FSM allocation, which was then
misinterpreted as a failure cause. Now a child FSM failure will pass NULL
instead, while other SUBSCR_CONN_E_CN_CLOSE events may still pass a valid cause
value.

Related: OS#3122
Change-Id: Iae30dd57a8861c4eaaf56999f872d4e635ba97fb
2018-04-03 02:13:16 +02:00
Neels Hofmeyr 1ba0df26dc cosmetic: rename subscr_conn_from to complete_layer3_type
'subscr_conn_from' could mean anything: from what, RAN type? BSS identifier? MM
action? Clearly name it as the Complete Layer 3 kind it represents.

Related: OS#3122
Change-Id: I6263a80e6db01c2ca48df6c58b05e2fd19347057
2018-04-03 02:13:09 +02:00
Neels Hofmeyr 4d3a66b3f8 cosmetic: rename gsm_subscriber_connection->conn_fsm to ->fi
Match osmo-bsc's naming of the subscriber connection's FSM instance; 'conn->fi'
makes more sense anyway than 'conn->conn_fsm'.

BTW, an upcoming commit will do away with the legacy from libbsc/libmsc duality
and firmly glue the conn allocation to the fi.

Related: OS#3122
Change-Id: If442f2ba78d9722b1065ec30c9a13f372b6a8caa
2018-04-03 02:13:04 +02:00
Neels Hofmeyr 80d1101153 drop some dead definitions (gsm_data.h, gsup_client.c)
Change-Id: Icad01d0ad8fa68293160bc56543b9c3dcafc50bb
2018-04-02 23:59:50 +02:00
Neels Hofmeyr 9d74425e27 dissolve libcommon: drop gsm_data.c, move code to libmsc
classmark_is_r99() is only used in gsm_04_08.c, move there as static.
rrlp_mode_* is only used in msc_vty.c, move there as static.
Move ran_type_names[] to msc_ifaces.c.

Change-Id: I5381c72af6841829fbc65940fd7d6f4d5cf583df
2018-03-22 17:06:51 +01:00
Neels Hofmeyr c01e90933f dissolve libcommon: move talloc ctx into msc_main.c, drop talloc_ctx.c
Drop tall_bsc_ctx; in mncc_sock_init(), talloc the mncc_sock_state from
gsm_network.

In tests or utils, move from using an extern tall_bsc_ctx to a local root
context pointer.

Change-Id: I92c252be1d1e7634f1653de47d37c99d77d9501c
2018-03-22 17:06:05 +01:00
Neels Hofmeyr 6a8b9c70fc dissolve libcommon: drop debug.c
Apply more concise logging categories in each main scope. The bulk goes to
msc_main.c, obviously, while tests and utils get a slimmed down bunch of
logging categories.

Change-Id: I969a0662ba273f3721b6820d02151b7a5b8014b8
2018-03-22 17:05:42 +01:00
Neels Hofmeyr 7c075a2f74 dissolve libcommon,libcommon-cs: clean up vty definitions
From openbsc.git, we still have osmo-msc's VTY definitions spread across
various places. Combine:

- Move the go_parent_cb() and is_config_node() to msc_main.c, drop
  common_vty.c.
- Move all of vty_interface_layer3.c into msc_vty.c.
- Move all of common_cs_vty.c into msc_vty.c.
- Move bsc_vty_init_extra() into msc_vty_init().
- Drop some unused definitions

No functional nor cosmetic changes have been made in the moved code, plain
copy-paste moving (even though the unidiff might look like edits in some
places). I might have adjusted some blank lines though.

Change-Id: Ia818c00ab613a19a34080b160d763b55c19f76b1
2018-03-22 16:52:27 +01:00
Neels Hofmeyr d6a769b51c trans_free: tear down conn when last transaction is done
In trans_free(), call subscr_conn_release_when_unused(), so that we are sure to
clean up after the last transaction is done.

This fixes an error where a conn lingered after a CC failure, because that code
path forgot to trigger cleanup.

Rationale: so far we were triggering the release check after each DTAP dispatch
(compl_l3 and "normal" DTAP), which is sufficient for properly closed
transactions. We also need a check for when a timeout clears an erratic trans.

Adjust test expectation of test_call_mo_to_unknown_timeout to show that the
error is now fixed.

msc_vlr_test_reject_concurrency now sees an additional release checking event
when the SMS transaction is done, which is expected and does not affect the
test otherwise.

Related: OS#2779
Change-Id: I46ff2e9b09b67e4e0d79cccf8c04936f17281fcb
2018-03-22 04:35:28 +00:00
Neels Hofmeyr e9e2f5cde6 cosmetic: rename conn_fsm "bump" event to "release_when_unused"
The naming of "bump" was short and made sense to me at the time of writing, but
it is keeping pretty much everyone else at a distance, no-one intuitively gets
what it is supposed to mean.

Clarify by renaming to "release_when_unused".

Adjust test expectations.

Change-Id: I4dcc55f536f63b13a3da29fff1df5fe16751f83a
2018-03-15 14:24:57 +00:00
Philipp Maier a2353c69cc mcgp: let the MGW allocate the MGCP endpoint
osmo-msc still uses endpoints that are allocated locally by the
MGCP-Client. Since osmo-mgw now supports the more comfortable,
dynamic variant we should make use of it.

- Replace the endpoint numer allocation by the client with a
  wildcarded CRCX. Use the endpoint that is assigned by the
  MGW.

Related: OS#2710
Change-Id: Iee3e446b6689626516f01c521abe3d4603cd3e13
2018-03-14 21:08:30 +00:00
Stefan Sperling 3a74128ccc restore sending of optional MM info messages
Since commit 2483f1b050 the function
gsm48_tx_mm_info() was not called anymore. No MM info messages were
transmitted to phones even if MM info messages were enabled via VTY.

With this commit, we call gsm48_tx_mm_info() after successfully
processing an IMSI ATTACH location update.

Change-Id: Ice5963d84253eb8c803cd2dfa8b25a4db5382827
Related: OS#2850
2018-03-13 21:13:27 +01:00
Neels Hofmeyr fa10eda6d7 vlr_ciph_result: fix use after free of imeisv
Define the struct vlr_ciph_result member .imeisv not as a char* but a char[] of
appropriate length, to avoid the need to point to external memory.

Thus fix a use-after-free in msc_cipher_mode_compl(), which defined the
imeisv[] buffer in a sub-scope within that function, so that the .imeisv
pointer was already invalid when fed to vlr_subscr_rx_ciph_res().

Did you notice that the commit summary rhymes?

Closes: OS#3053
Change-Id: I90cfb952a7dec6d104200872164ebadb25d0260d
2018-03-13 01:29:04 +01:00
Neels Hofmeyr 379d5799f0 implement support for 3-digit MNC with leading zeros
Add 3-digit flags and use the new RAI and LAI API from libosmocore throughout
the code base to be able to handle an MNC < 100 that has three digits (leading
zeros).

Depends: Id2240f7f518494c9df6c8bda52c0d5092f90f221 (libosmocore),
         Ib7176b1d65a03b76f41f94bc9d3293a8a07d24c6 (libosmocore)
Change-Id: I82f0016d9512ee8722a3489a3cb4b6c704a271fc
2018-02-28 19:30:14 +01:00
Neels Hofmeyr 7f48420923 cosmetic: gsm_network_init(): imply default 001-01 PLMN
All callers pass mcc=1, mnc=1, so just have it as default.
(Prepare for net->country_code etc to be replaced by net->plmn)

Change-Id: Ibcd1cc38f170895305ae176a5574384c74a33939
2018-02-27 13:01:42 +01:00
Daniel Willmann 4e825b6a68 libmsc: Add a function to return a unique ID of the subscriber conn
The ID will include the type of connection (GERAN_A, UTRAN_IU) followed
by the SCCP conn_id.
This can be used for the fsm instance ID before we know the IMSI.

Change-Id: I4b875772e3994ad3458ee60dbf880604486d9afd
2018-02-16 08:09:33 +00:00
Daniel Willmann 6fbd3bf732 iucs: Add a function to return the connection ID for the IU SCCP conn
Change-Id: Ica4a7f463fcf1bd67fe082296cecea8d10f2fc5b
2018-02-16 08:09:32 +00:00
Harald Welte c0e425dbd0 remove dead code (gsm_parse_reg)
Change-Id: I47b0260561a9c2bad65c50c8164873e4c23d61b7
2018-02-14 09:04:56 +01:00
Harald Welte 098aa71e83 remove unused "auth policy" VTY command
This is yet another unsused bit from the OsmoNITB legacy.

Related: OS#2528
Change-Id: I825e659da529257e5edec94d9d59f0e10c1b4c63
2018-02-14 09:04:56 +01:00
Harald Welte 2346619c1a remove unused "authorized-regexp" VTY command
This is another left-over VTY command from the OsmoNITB days.

If such functionality is desired, it must be implemented in OsmoHLR,
but not here.

Related: OS#2528
Change-Id: Icf0897c47388e49ba7886b55acc728a6f7d213fe
2018-02-14 09:04:52 +01:00
Harald Welte 27b40c601c remove unused VTY command "location updating reject cause"
OsmoMSC is using whatever reject cause is apropriate in the given
situation.  This user-configurable reject cause only had relevance
in OsmoNITB, and hence it is an unused parameter that can be removed
in OsmoMSC.

Related: OS#2528
Change-Id: Ie1f39e706477aaf42051877b52d4b3ae1c5f138e
2018-02-14 08:29:24 +01:00
Harald Welte 7421a6e4b7 remove unused dyn_ts_allow_tch_f VTY option
This belongs into the BSC and has no relevance in the MSC, as the MSC
has no clue about dynamic timeslots.

Related: OS#2528
Change-Id: Iaa41d22db81120572d4cd2c0c4c75d258947a42f
2018-02-14 00:28:10 +01:00
Harald Welte 9199f8b60d dead code removal
Related: OS#2528
Change-Id: I89157c446d66e11adbe3cad587eb34ec40271c12
2018-02-14 00:28:07 +01:00
Harald Welte d5db170261 remove bsc_api.h and all users - they're all dead code
Related: OS#2528
Change-Id: I332aa8697c98a0d7b3db65f98711275da3d381d7
2018-02-14 00:28:02 +01:00
Harald Welte c93ce02042 gsm_data: remove unused gsm_subscriber_connection members
The mncc_rtp_create_pending and mncc_rtp_connect_pending members
were unused, let's remove them.

Related: OS#2528
Change-Id: I417e23ec53323ddd8e1e5d18952566fe8fd6ac24
2018-02-14 00:27:52 +01:00
Harald Welte 69c54a8b3c Add VTY command to configure destination MSISDN for emergency calls
As in GSM/3GPP networks emergency calls carry no explicit destination
number/address, add a VTY commadn to patch in some destination handler
in the EMERGENCY SETUP before delivering to [internal or external] MNCC.

Change-Id: I7c9f43ba312fadda2b9a9483b3cf50e4abca9599
2018-02-09 22:30:39 +01:00
Harald Welte 1f477442dd Introduce new BSSAP logging category/subsystem
Having all BSSAP related logs in the "DMSC" category is overly
generic, and dosn't provide useful granularity.

Change-Id: Id1e52dad03840dfd026fb23f3845a8771c8cc308
2018-02-09 02:22:22 +01:00
Harald Welte 6de46595f2 a_iface_bssap.c: Use LOGPCONN() whenever possible
Change-Id: Ic1c9d14b892154d51165598338d23a924a772265
2018-02-09 02:22:22 +01:00
Harald Welte 54a10efea0 Don't answer to BSC-originated RESET with another RESET
If the BSC is contacting us for the first time and sending a BSSMAP
RESET, then we should simply ACK that and transition into the
"connected" state, where connection-oriented and connectionless
procedures are permitted.

This patch is a bit large for such a seemingly simple behavioural
change, but the existing data model didn't permit a more
straight-forward implementation.

Change-Id: Ie67e7ed20a6c42afe99bafef96d85a4e083dd057
Closes: OS#2914
2018-02-09 02:20:51 +01:00
Harald Welte b6777fb055 a_reset: Add additional "a_reset_alloc" argument
Using this argument we can create the state machine in the
"already connected" state, i.e. without starting an outbound
RESET procedure.

Change-Id: Ibf569d57300965cd47084fa0bff54aa67679e2a1
2018-02-09 02:20:51 +01:00
Max 770fbd2024 GSUP: check osmo_gsup_encode() result
Check and handle gracefully any error which might appear in
osmo_gsup_encode() - mark corresponding functions with
warn_unused_result attribute to make sure this failure is always checked
against.

Change-Id: I4551212011fb0bd898c020a183756ed7a9afb9e5
Related: OS#2864
2018-02-08 09:29:50 +00:00
Max d83b17b3c7 Constify msc_subscr_conn_is_accepted() parameter
Related: OS#2864
Change-Id: I8af50a8847a5b438cf2ef660399d4c8bbac86a71
2018-02-07 12:04:56 +01:00
Philipp Maier 621ba032bd mgcp: use osmo-mgw to switch rtp streams
in the current implementation we still use osmo-bsc_mgcp, which
has many problems and is also obsoleted by osmo-mgw.

integrate osmo-mgw and re-implement the current switching using
an osmo fsm.

Depends: osmo-mgw Iab6a6038e7610c62f34e642cd49c93d11151252c
Depends: osmo-iuh I3c1a0455c5f25cae41ee19229d6daf299e023062
Closes: OS#2605
Change-Id: Ieea9630358b3963261fa1993cf1f3b563ff23538
2018-02-05 22:28:43 +00:00
Philipp Maier 64dbc5464c a_iface: correct data type for a.conn_id in gsm_subscriber_connection
conn_id is modeled as int, but should be uint32_t.

- change conn_id from int to uint32_t

Change-Id: Ibf14d7c9a547c4eeb873975e7dcddef223e7df46
Related: OS#2769
2018-02-05 22:20:20 +00:00
Harald Welte c2007855ce Implement checks for duplicate uplink UL L3 message
According to TS 24.007 Section 11.2.3.2.3, it is possible that uplink L3
messages are duplicated in some scenarios, particularly during
assignment/handover procedure.

To avoid L3 entities from seeing duplicated messages, there's a modulo-2
or modulo-4 message sequence counter, based on which the MSC can detect
and suppress such duplicate messages.

It appears that even our unit tests were wrong in that regard so far.
Rather than manually adjusting each and every message, let's make sure
that the sequence number generation always increments as expected, and
that during matching of incoming messages, sequence numbers are masked
out.

Note: the tests will only pass from libosmocore Change-Id
Iec875a77f5458322dfbef174f5abfc0e8c09d464 onwards, due to
gsm48_hdr_msg_type() being broken in earlier versions.

Change-Id: Id15e399ab7e1b05dcd426b292886fa19d36082b1
Closes: #2908
2018-02-03 20:30:03 +00:00
Max cd31f7a34f Remove unused code
The socket.* is unused leftover from pre-split time.

Fixes: CID57645
Change-Id: Ibf3b539fcbd7f311caa2291af23b8f18ebc6c2e0
2018-01-30 18:12:52 +01:00
Harald Welte 327c2f5beb Change GSUP re-connect interval to 1s
This leads to faster recovery in case of link loss.

It also makes the TTCN-3 test suite run much faster, as each test case
will inherently terminate the GSUP connection.

Change-Id: I16821a26f2c6ff4d0a76926c9212127ab6f6fedf
2018-01-28 00:14:25 +00:00
Harald Welte 7b222aa106 Permit a set of multiple different A5 ciphers
So far, the administrator had to pick one particular cipher which
would then be used throughout all subscribers/phones. This is a bit
impractical, as e.g. not all phones support A5/3.  Extend the VTY
command syntax in a backwards-compatible way to permit for multiple
ciphers.

NOTE: Like the previous code, OsmoMSC does *not yet check* whether
the configured cipher is compatible with the MS capabilities as
reported in CLASSMARK!  The network hence might choose an algorithm
not supported by the phone.  Fixing this is subject to another patch.

Closes: OS#2460
Change-Id: I79a4e2892eb5fbecc3d84e11dceffb7149db264b
2018-01-28 00:09:42 +00:00
Harald Welte 71c51df07d Shift ciphering algorithm selection from VLR to MSC
The VLR code seems to have the assumption that there is one particular
algorithm to be used, as opposed to one of a set of algorithms.

What's missing is basically to decide when/where to pick the best
algorithm within the capabilities of the phone (classmark) and the
network configuration (net->a5_encryption_mask).  So far, libvlr has no
notion of classmark.  Rather, libmsc has.

Why does the VLR care about the particular algorithm at all?  The VLR
should probably simply decide if it should use encryption or not, and if
so, the MSC will figure which algorithm to use.

Change-Id: I5ed80ca2086560a5975a758ec568a034a9a8ab89
2018-01-28 00:09:41 +00:00
Stefan Sperling 14e051776f Delete expired SMS automatically.
Delete expired SMS whenever we are done processing an SMS-related signal.
In order to minimize additional latency only one SMS is removed at a time.

Change-Id: I56cbe716e52b679c4b94f6cbb4a171306975be2e
Related: OS#2354
2018-01-25 20:30:40 +00:00
Stefan Sperling 87cba1f105 Add a VTY command which deletes all expired SMS.
We already delete SMS which have been sent successfully. However, there
are plans to accept SMS for any subscriber in order to fix the problem
described in https://osmocom.org/issues/2354 ("SMSC: Store&Forward not
working for subscribed but unregistered MS").

This means we may end up storing SMS which never get sent, e.g. because
the B subscriber doesn't actually exist. This could lead to a higher
degree of SMS database growth over time, and therefore we need a way
to keep database size under control.

As a first step, introduce a DB function which removes an expired SMS,
and add a VTY command which removes all expired SMS from the DB.

Later commits will build upon this to remove expired SMS automatically.

The SMS expiry time period is currently hard-coded to 2 weeks.
We could make this configurable in the future if desired.

Change-Id: Icd6093b7b5d8db84b19a0aa47c68182566113ee2
Related: OS#2354
2018-01-25 16:16:15 +00:00
Harald Welte 703f2ec6f4 debug: Remove dead log categories
Change-Id: Ibdfc39ead4f0c5e3a74321e9d2c9720ae1603541
Related: OS#2528
2018-01-25 00:38:11 +01:00
Harald Welte 45f234c634 remove dead ctrl.h header file
Change-Id: I3ea0d98580085982ec0f20165c0ddcfd439e7419
Related: OS#2528
2018-01-25 00:38:09 +01:00
Harald Welte b752cc5ffc signal.h: Remove unused/dead signal definitions
Change-Id: Iba5be82e11fa1d5e5514bc86d8ec23cda24ae4c9
Related: OS#2528
2018-01-25 00:38:08 +01:00
Harald Welte 4bd35d4460 remove dead header files bsc_msc.h, bsc_msc_data.h and bsc_rll.h
Related: OS#2528
Change-Id: I13cc4513689af1d594952dd628738b1240560bb7
2018-01-25 00:38:06 +01:00
Harald Welte 51c65e8230 remove dead code in auth.h / auth.c
Change-Id: I57e3b79a95a35c4783dc3775a88d15f13cbec13e
Related: OS#2528
2018-01-25 00:38:05 +01:00
Harald Welte 6ffc95cb25 remove unused ipaccess.h
Change-Id: Ibee159a119a1cce2b3fcbdabf3491673aed4ea95
Related: OS#2528
2018-01-25 00:38:03 +01:00
Harald Welte d35038d229 Massive removal of unused code/structs/headers
osmo-msc still had large amounts of dead code that came along from
openbsc.git.  This commit removes a lot of it, mostly stuff relevant
only to the BSC side of things (or even GPRS).

Change-Id: I247def85da2dc3ec461389fb74414a0d964e7e3c
Related: OS#2528
2018-01-25 00:18:05 +01:00
Harald Welte a3ab1de7dc remove traces of bsc_subscriber
Change-Id: I8672f0a76cb47595444a7ddbc4f34fc4ddaeb375
2018-01-24 23:29:51 +01:00
Harald Welte 4ab0a490ae debug: Remove code for filters that don't exist in OsmoMSC
We don't have BSC or GPRS related logging filters here.
This is a leftover from the NITB->MSC split

Change-Id: I05f991d1f5b7f89545521a73d79619bee4111094
2018-01-24 23:29:51 +01:00
Harald Welte a5e51ec7d7 remove unused paging.h and osmo_bsc_grace.h
Change-Id: I6af40f65f0634e49939906a3e50a41e0be246794
2018-01-24 23:29:51 +01:00
Harald Welte a1c5de45c1 Remove traces of meas_feed
Measurement reporting (and the relate feed) are functions of the BSC,
not the MSC.  This code should never have been inherited from OsmoNITB
to OsmoMSC in the first place, let's remove it.

Change-Id: I0d57ac214e574e267fa9752daf76566197b9aa64
2018-01-24 14:04:46 +00:00
Max 923a23900e VLR: constify GSUP-related function parameters
Change-Id: If3852e096210713cb5297f6b42ed66dbb98c4a50
2018-01-24 13:55:03 +01:00
Harald Welte 5718429ec9 MNCC: Add input validation
There appears to have been no input validation whatsoever on MNCC
messages.  Hence it was very easy for an external MNCC handler to
crash OsmoMSC, such as in OS#2853

Change-Id: Idaf3b8e409c84564b1eb26d01a19c605f89b14f4
Closes: OS#2853
2018-01-23 17:03:05 +00:00
Stefan Sperling 6ba2d5a9f7 Delete SMS from the database once they were sent successfully
Currently the SMS database keeps accumulating entries for each SMS.
These entries are never deleted automatically. With this change, we
start deleting SMS which have successfully been sent to subscriber B.

Change-Id: I3749855fe25d9d4e37ec96b0c2bffbc692b66a78
2018-01-18 18:55:26 +01:00
Vadim Yanitskiy 6e19d1b2d5 msc/gsm_04_80.h: use '#pragma once' instead of includes
This is a common include guard way for Osmocom projects.

Change-Id: I5a12a742719d4deba0b9dfa8bb330c1986a727f6
2018-01-10 22:17:37 +06:00
Vadim Yanitskiy 0774a539da msc/gsm_04_80.h: cosmetic: whitespace fix
Change-Id: Ia3632c75cf2d2ce79b42b3b55ef50a72ab1bb94c
2018-01-10 22:17:31 +06:00
Vadim Yanitskiy 7c93591b2c msc/gsm_04_80.h: clean up useless declarations
This change removes a few USSD specific declarations, which are
not actually used now, and probably accidentally migrated from
legacy OpenBSC.

Change-Id: Id57a24b92790d3ce0f9c7343d060f511e2b979c7
2018-01-10 18:09:16 +06:00
Max dcc193d3a6 Add control command to expire subscriber
It's equivalent of existing vty command: common part is extracted into
shared helper function.

Change-Id: I267886b7c79ed6d9c2f34a2e60d2972b7f4f4036
2018-01-05 10:10:35 +00:00
Max a263bb215b VLR: log subscriber update
* move log helpers to generic header
* log subscriber update

It's handy for troubleshooting issues with subscriber update via GSUP
from HLR.

Change-Id: I1958aeeb3ea99831c7e2c5ee9a6b59834baf4520
2017-12-31 11:01:46 +00:00
Max 7772c7de55 VLR: remove unused parameter
The expire_lu is never used but is printed for every subscriber. Let's
remove it to avoid confusion.

Change-Id: I6f7ad1670836384d1e6a58f47a13464fdbbf8509
2017-12-29 18:12:37 +01:00
Neels Hofmeyr facd57ac56 fix: properly cancel all Paging on IMSI Detach
It's not clear cut which code is responsible for canceling pending requests,
since the requests list is kept in vlr_subscr, but sending out Paging does
certainly not belong in the VLR. Place the requests cleanup in gsm_04_08.c.

Add to test_ms_timeout_paging() in msc_vlr_test_ms_timeout.c to verify that a
pending paging is canceled on IMSI Detach.

Change-Id: Ib8874a9d92f02b0826525b55518332f6899688fd
2017-12-20 23:07:10 +01:00
Neels Hofmeyr 2ff5bcdc38 fix paging: add timeout to discard unsuccessful paging
Currently, if there is no reply from the BSS / RNC, a subscriber will remain as
"already paged" forever, and is never going to be paged again. Even on IMSI
Detach, the pending request will keep a ref count on the vlr_subscr.

Add a paging timeout, as gsm_network->paging_timeout and in the VTY on the
'msc' node as 'paging timeout (default|<1-65535>'. (There is a 'network' /
'T3113' in OsmoBSC, but to not confuse the two, give this a different name.)

Add test_ms_timeout_paging() test to verify the timeout works.

I hit this while testing Paging across multiple hNodeB, when a UE lost
connection to the hNodeB. I noticed that no matter how long I wait, no Paging
is sent out anymore, and found this embarrassing issue. Good grief...

The choice of 10 seconds is taken from https://osmocom.org/issues/2756

Change-Id: I2db6f1e2ad341cf9c2cc7a21ec2fca0bae5b2db5
2017-12-20 23:07:10 +01:00
Neels Hofmeyr c1d69256f6 cosmetic: rename sccp_rx_udt and sccp_rx_dt to a_*
These rx functions are only used for the A interface, hence the names should
not suggest general SCCP rx (which Iu also has).

Change-Id: I6815c3d4dea4c2abfdff1cf0239ada6a9254f351
2017-12-20 16:14:50 +00:00
Neels Hofmeyr 76a10f569f drop unused T* timers (BSC land, not MSC)
Change-Id: If27899c90b7c79f25cd5fd5e2429cb3012d69744
2017-12-18 18:02:21 +01:00
Neels Hofmeyr 2ef2da54ab cosmetic prep: tell vlr_ops.set_ciph_mode() whether UMTS AKA is used
In case of UMTS AKA, the Kc for ciphering must be derived from the 3G auth
tokens. tuple->vec.kc was calculated from the GSM algorithm and is not
necessarily a match for the UMTS AKA tokens.

To decide (in an upcoming patch) whether to use UMTS AKA derived Kc or the Kc
from the auth vector, the set_ciph_mode() from vlr_ops needs to know whether
UMTS AKA is being used. This could possibly derived from the msc_conn_ref, but
all flags are already available in the vlr_lu_fsm and vlr_access_req_fsm. Hence
add a umts_aka flag to the set_ciph_mode() callback invocation. The VLR FSMs
thus decide whether UMTS AKA or GSM AKA is to be used during Ciphering Mode
Command, which makes more sense than re-implementing the same decision process
in the MSC.

I considered placing the Kc derivation in vlr_set_ciph_mode() and only tell the
MSC's set_ciph_mode() implementation the precise keys it should use, but the
RAN particulars, and whether a Kc is used at all, rather belong with the MSC.

Related: OS#2745
Prepares: If04e405426c55a81341747a9b450a69188525d5c
Change-Id: I983c48347faf4ee1b405d8174b4e006c904157cf
2017-12-18 05:18:11 +01:00
Neels Hofmeyr e3d72d7827 cosmetic prep: publish vlr_use_umts_aka() decision
During Set Ciphering Mode on GERAN, it is required to know whether UMTS AKA is
used to decide which Kc to pick. Change static function is_umts_auth() into
public vlr_use_umts_aka(), so future patches can re-use it.

Prepares: If04e405426c55a81341747a9b450a69188525d5c
Change-Id: I85d784c62ecbabdb6186a3dae4dcd554e7921041
2017-12-18 05:18:11 +01:00
Neels Hofmeyr 703638e79a cosmetic: move translation of vlr_ciph into msc_vlr_set_ciph_mode()
a_iface_tx_cipher_mode() is a bit too far away from the VLR to be handling its
ciphering enums. Instead, construct the gsm0808_encrypt_info in the
msc_vlr_set_ciph_mode() callback.

Greatly simplify the sanity checking code: a_iface_tx_cipher_mode() no longer
needs to re-verify the presence of the gsm0808_encrypt_info contents.

Change-Id: Id46f9a513b555d0a481f7124c9984c2b5b196b3e
2017-12-18 05:18:11 +01:00
Neels Hofmeyr cf30913c8e fix BSSMAP Cipher Mode Cmd: properly set permitted algorithms
The bit shifting is performed in gsm0808_enc_encrypt_info(), and must not be
done when populating the gsm0808_encrypt_info struct.

Provide vlr_ciph_to_gsm0808_alg_id() to translate the enum vlr_ciph to the
GSM0808_* constants we need to put in the gsm0808_encrypt_info struct instead.

Related: OS#2745
Change-Id: If75f95e8a5cc8b9979610ce6d746c1f0073ee39a
2017-12-18 03:48:24 +01:00
Neels Hofmeyr fb21d9dde6 compiler warning: drop double 'const' in a_iface_tx_cipher_mode()
Change-Id: I3b8baa9a259704e719ce7f12776f2d2125ebdef0
2017-12-14 03:51:34 +01:00
Philipp Maier fe6acd6189 mncc: re-add lchan members to structs
The lchan related struct members do not serve any useful purpose
in the msc code, since the lchan concept is not in the scope of
osmo-msc. However, if removed te struct size will change which
will lead into shortened protocol messages as well. This is
is detected by osmo-sip-connector and eventually leads into
a reject ofthe shortended protocol messages.

Re add the missing struct members in order to maintain
compatibility

This commit reverts the changes made to mncc.h by commit:
e2f24d53e4

Change-Id: Ia02373a36df7605507ee3de49173a9fd6547b726
2017-12-05 18:42:48 +00:00
Neels Hofmeyr 6166f29412 subscr_conn: introduce usage tokens for ref error tracking
When hunting a conn use count bug, it was very hard to figure out who's (not)
using the conn. To ease tracking down this bug and future bugs, explicitly name
what a conn is being reserved for, and track in a bit mask.

Show in the DREF logs what uses and un-uses a conn. See the test expectation
updates, which nicely show how that clarifies the state of the conn in the
logs.

On errors, log them, but don't fail hard: if one conn use/un-use fails, we
don't want to crash the entire MSC before we have to.

Change-Id: I259aa0eec41efebb4c8221275219433eafaa549b
2017-11-27 15:40:01 +01:00
Neels Hofmeyr 1a5bcd5c3b sub_pres_vlr_fsm_start: fix heap use after free
When sub_pres_vlr_fsm_start() is called, it dispatches an event which may in
some cases already cause tear down and free of the parent FSM instance, after
which storing the returned instance pointer in that parent's metadata will use
freed memory. Instead, pass the target pointer to remember the instance at to
sub_pres_vlr_fsm_start() and assign the pointer *before* firing the event.

Explain so in a new comment.

I haven't checked whether that pointer is actually used at all -- this is the
easiest way to fix the use-after-free without getting sucked into semantic
questions.

Change-Id: Ibdc0b64cd12ba3e2b9737e3517d8484e67abcf04
2017-11-20 13:49:32 +00:00
Neels Hofmeyr c6bf27466c rate_ctr: don't use . as separator
Use ':' as separator, so that no mangled rate_ctr descriptions are allocated.

When '.' is used, the rate_ctr mangling code creates tallocs of mangled counter
descriptors, and hence affects the amount of expected talloc contexts in
msc_vlr_tests.c.

Change-Id: Ib1db8e3dc6c833174f1b0b1ca051b0861f477408
2017-11-20 13:49:32 +00:00
Neels Hofmeyr 33f534136c cosmetic: vlr: rename auth_tuple_max_use_count to _reuse_
The name auth_tuple_max_use_count suggests that if I want to use each auth
tuple exactly once, I need to set it to 1. Curiously, so far you need to set
to intended uses - 1.

Reflect this in its name by renaming to auth_tuple_max_reuse_count.

I first considered to not rename but change the if-conditions so that == 1
means each tuple is used once, and upon struct vlr allocation, set the default
to 1. That would also logically entail that setting to 0 means to re-use
vectors infinitely often, like now a value < 0 does. That means, when
allocating a vlr struct zeroed out, we would by default have the most
dangerous/unsafe configuration. It's no problem to set a default to 1 upon
allocation, but by renaming the variable instead, we get safer alloc-zero
behavior and don't need to change any conditionals in the code (even though the
patch ends up considerably larger from all the renaming).

Change-Id: I0b036cae1536d5d6fb2304f837ed1a6c3713be55
2017-10-31 02:02:43 +01:00
Max 61cacb0aaa Remove pkg-config file
It's an artefact of split which is unused anyway.

Change-Id: I15c0b4457c108c7791b0f30b79660d9e6d09b269
2017-10-16 15:29:26 +02:00
Harald Welte 5c76e0aa1a remove further files and autotest/autoconf bits irrelevant to osmo-msc
Change-Id: I68e879e7474cbd3dd053f23bc4d5d22dc2748c5b
2017-10-03 09:44:23 +08:00
Max a8b1aac5bc Remove unused osmo_bsc_rf.h header
Change-Id: I7a668665b571d00a6a34629626ddbfb60b6c09cc
2017-09-15 14:18:35 +02:00
Max e591d479dd Remove BTS-specific attributes
Remove *bts_model_* functions as they are only useful to BSC.

Change-Id: Ic80d11d6f8167b49a94fc9c6edbc5ff9fbe36587
2017-09-15 14:15:52 +02:00
Max f953d8bbb2 Remove SI-related code
Get rid of unused data structures and functions related to SI handling.

Change-Id: I048885e85a9f97b8b071f3a3f1c362b54a44720e
2017-09-15 13:52:52 +02:00
Max 43b01b0514 Remove rest_octets.h
The MSC should not fiddle with low-level SI details like rest octets
anyway. Unfortunately simply removing the header is impossible as it
causes massive fallout due to missing includes. Fixed it as well.

The only other parameter which required removal is cell_ro_sel_par which
is not referenced anywhere in the code anyway.

Change-Id: Ibff77330de056fad4288cd4c48d016aad8105354
2017-09-15 11:31:03 +02:00
Philipp Maier 4502f5ff58 a_iface: fix memory leaks
Fix multiple memory leaske in A/BSSMAP code

Change-Id: I90703c96e6a266a1cfa60b184139375aeb9ae32d
2017-09-11 10:14:00 +02:00
Neels Hofmeyr 6c8afe148b use separated libosmo-mgcp-client, apply rename to mgcp_client_*
After osmo-mgw changes I8e0b2d2a399b77086a36606f5e427271c6242df1 and
I99f7faab637cfcc22ece64a1dbcbe590f2042187, apply linking of new
libosmo-mgcp-client and renames to drop the "gw" from mgcp_client_*.

Also rename the gsm_network.mgcpgw to mgw, to indicate that the MGCP client is
used to contact the MGW (Media Gateway).

Depends: I8e0b2d2a399b77086a36606f5e427271c6242df1 (osmo-mgw)
         I99f7faab637cfcc22ece64a1dbcbe590f2042187 (osmo-mgw)
Change-Id: I093ad02ca0e532f659447c785e09678b3e6f220d
2017-09-08 23:47:37 +00:00
Neels Hofmeyr 9084396467 rename include/openbsc to include/osmocom/msc
Change-Id: I1f96a1285bbd1b4607614856bca935d5c26e2da9
2017-09-06 16:41:25 +02:00
Neels Hofmeyr bac227653a split off osmo-msc: remove files, apply build, rename
Change-Id: Icf025e5ea8d180613b3114282951c9afa67af9a7
2017-08-29 12:51:19 +00:00
Neels Hofmeyr 979cd26f35 move to osmo-mgw.git: osmo-bsc_mgcp and libmgcp as libosmo-legacy-mgcp
Rewire build and includes to libosmo-legacy-mgcp.

Drop osmo-bsc_mgcp and related python tests, now found in osmo-mgw.git.

libosmo-legacy-mgcp is installed from osmo-mgw, hence add the dependency to
jenkins.sh (so far using the pre_release branch).

Change-Id: Ic99d681759edce11564da62500c2aac5cf5fffe2
2017-08-29 12:51:19 +00:00
Neels Hofmeyr 00e82d61ab move libiu to osmo-iuh/libosmo-ranap
Remove libiu here, use the functions from libosmo-ranap instead, by applying
the ranap_ / RANAP_ prefix.

Corresponding change-id in osmo-iuh.git is I6a3f7ad15be03fb94689b4af6ccfa828c25f45c0

To be able to run the msc_vlr tests for RAN_UTRAN_IU without Iu client headers
available, add iu_dummy.h, containing mere function signatures that match
iu_dummy.c and a mostly empty struct ranap_ue_conn_ctx.

Make sure we can build with and without --enable-iu: include osmo-iuh headers
only with --enable-iu.

Change-Id: Ib8c4fcdb4766c5e575618b95ce16dce51063206b
2017-08-29 12:51:18 +00:00
Philipp Maier fbf6610dc1 Implement AoIP, port to M3UA SIGTRAN (large addition and refactoring)
This was originally a long series of commits converging to the final result
seen in this patch. It does not make much sense to review the smaller steps'
trial and error, we need to review this entire change as a whole.

Implement AoIP in osmo-msc and osmo-bsc.

Change over to the new libosmo-sigtran API with support for proper
SCCP/M3UA/SCTP stacking, as mandated by 3GPP specifications for the IuCS and
IuPS interfaces.

From here on, a separate osmo-stp process is required for SCCP routing between
OsmoBSC / OsmoHNBGW <-> OsmoMSC / OsmoSGSN

jenkins.sh: build from libosmo-sccp and osmo-iuh master branches now for new
M3UA SIGTRAN.

Patch-by: pmaier, nhofmeyr, laforge
Change-Id: I5ae4e05ee7c57cad341ea5e86af37c1f6b0ffa77
2017-08-29 12:51:18 +00:00
Keith Whyte c601adcb89 libmsc: Use actual delivery time in delivery reports.
Set the time on the status report to the time the message was delivered, as
this may not be the same as the time when we are delivering the report to the
originating MS.

Change-Id: I9056429d40bf02731f004b7833f1de45a0d1add8
2017-08-27 02:33:50 +02:00
Harald Welte 586e6819eb Migrate from gprs_apn_to_str() to libosmocore osmo_apn_to_str()
In 2015, Jacob moved/copied related functions to libosmocore, but
for some reason didn't remove the copies here.  Let's follow-up on
that and remove duplicated code.

The libosmocore commit introducing osmo_apn_to_str() was
8114294bf29ac6e44822c0ae43d4b0819f11b022

Change-Id: I7315ffcbed8a54cca2056f313bb7783ad82d0ee9
2017-08-27 02:33:49 +02:00
Pau Espin e93fad8043 mgcp_osmux: Remove unused parameter
Change-Id: Icb1e7cb15fe04642578f5292124ebc1eac9c9aa3
2017-08-27 02:33:49 +02:00
Alexander Chemeris 3d18dda61a libcommon: Fix log output for bts>0.
Fixes regression probably introduced in c696cc28.

For bts>0 logging doesn't show bts number correctly when printing lchan
identification string - it will always show it as "bts=0". The reason for
this is that the identification string is cached before bts->nr value is
set to a proper value.

This patch sets bts->nr as part of the first step of the bts structure
initialization, before caching happens thus making sure the cached
identification string is cached with the correct values.

Change-Id: I61c18a7f021fcb1ec00d34a745f4e3ab03416c2d
2017-08-27 02:33:49 +02:00
Pablo Neira Ayuso adae859eeb libmsc: add support for SMPP delivery receipts
If the mobile phone requests a status report via SMS, send a DELIVER_SM
with esm_class = Delivery Receipt to ESME to indicate that the SMS has
been already delivered to its destination.

    MS        GSM 03.40           SMSC       SMPP 3.4               ESME
     |                             |                                |
     |       SMS-DELIVER           |                                |
     |<----------------------------|                                |
     |     GSM 04.11 RP-ACK        |                                |
     |---------------------------->|                                |
     |                             |           DELIVER-SM           |
     |                             |  esm_class = Delivery Receipt  |
     |                             |------------------------------->|
     |                             |         DELIVER-SM-RESP        |
     |                             |<-------------------------------|
     |                             |                                |

This patch implements "Appendix B. Delivery Receipt Format" as specified
in the SMPP 3.4 specs. This string is conveyed in the SMS message as
data, and it is only meaningful to the ESME, for logging purposes. The
"submit date" and "done date" are not yet set, and other fields are just
sent with dummy values, so they are left to be finished as future work.

The new SMPP TLV tag TLVID_user_message_reference is added to the SMPP
messages inconditionally now since this information is required by
delivery-reports to associate the status-report with the original SMS.

Change-Id: Ic1a9023074bfa938099377980b6aff9b262fab2a
2017-08-27 02:33:49 +02:00
Harald Welte 5d1fa89819 GSM timers: User reasonable defaults; don't save if equal default
A number of the GSM timers (including T3109) had no reasonable
default values if not specified in the VTY / config file.  Together
with unconditional writing to the config file, this created
config files with a persistent setting for important timers as '0'.

To make things worse, many of our example cofig files suffered from the
same problem.

Let's avoid this from happening by
* having reasonable defaults if nothing specified in the config file
* conditionally savingg timers only if they differ from default
* reject any timer values that state zero during start-up (see previous
  commit)

Change-Id: Iaac0bfca423852b61d8b9eb1438157ef00d0d8c8
Closes: OS#2380
2017-08-27 02:33:48 +02:00
Harald Welte eac38c3fa8 Support for TS 04.14 conformance test commands
Change-Id: Ib27edbfc8ccdedf00589ec715ced7bed435fa94c
2017-08-27 02:33:48 +02:00
Holger Hans Peter Freyther 9d6f0625f7 sgsn: Fill the cch_pdp with a value coming from the tlv structure
For some GGSNs we need to insert the PDP Charging Characteristics
that were returned. We receive these values from GSUP and will
fill them into the tlv structure when finding the ggsn context.

Change-Id: I1725bfd2403d29ce3550bfcd6fcc1498426ef906
2017-08-27 02:33:48 +02:00
Neels Hofmeyr 4df72051f9 mgcp: hack RAB success from nano3G: patch first RTP payload
The ip.access nano3G needs the first RTP payload's first two bytes to read hex
'e400', or it will reject the RAB assignment. Add flag
patched_first_rtp_payload to mgcp_rtp_state to detect the first RTP payload on
a stream, and overwrite its first bytes with e400. This should probably be
configurable, but seems to not harm other femto cells (as long as we patch only
the first RTP payload in each stream). Only do this when sending to the BTS
side.

Related: OS#2459
Change-Id: I5eff04dcb0936e21690e427ae5e49228cd459bd4
2017-08-23 14:34:38 +02:00
Neels Hofmeyr 84da6b1edb Implement IuCS (large refactoring and addition)
osmo-nitb becomes osmo-msc
add DIUCS debug log constant
add iucs.[hc]
add msc vty, remove nitb vty
add libiudummy, to avoid linking Iu deps in tests
Use new msc_tx_dtap() instead of gsm0808_submit_dtap()
libmgcp: add mgcpgw client API
bridge calls via mgcpgw

Enable MSC specific CTRL commands, bsc_base_ctrl_cmds_install() still needs to
be split up.

Change-Id: I5b5b6a9678b458affa86800afb1ec726e66eed88
2017-08-08 19:17:53 +02:00
Neels Hofmeyr 4283675311 sgsn init: pass sgsn_config pointer to sgsn_vty_init(), not sgsn_parse_config
In an upcoming commit, sgsn_vty_init() will require access to the global sgsn
config struct to initialize a generic VTY command with the proper config
destination address, see Change-Id I5b5b6a9678b458affa86800afb1ec726e66eed88.

Change-Id: Ie6b6e5422987586531a898e0c5b867623dbecb0f
2017-08-08 19:17:53 +02:00
Neels Hofmeyr e2f24d53e4 mscsplit: various preparations to separate MSC from BSC
Disable large parts of the code that depend on BSC presence. The code sections
disabled by #if BEFORE_MSCSPLIT shall be modified or dropped in the course of
adding the A-interface.

Don't set msg->lchan nor msg->dst.
Don't use lchan in libmsc.
Decouple lac from bts.

Prepare entry/exit point for MSC -> BSC and MSC -> RNC communication:
Add msc_ifaces.[hc], a_iface.c, with a general msc_tx_dtap() to redirect to
different interfaces depending on the actual subscriber connection.
While iu_tx() is going to be functional fairly soon, the a_tx() is going to be
just a dummy for some time (see comment).
Add Iu specific fields in gsm_subscriber_connection: the UE connection pointer
and an indicator for the Integrity Protection status on Iu (to be fully
implemented in later commits).
Add lac member to gsm_subscriber_connection, to allow decoupling from
bts->location_area_code. The conn->lac will actually be set in iu.c in an
upcoming commit ("add iucs.[hc]").

move to libcommon-cs: gsm48_extract_mi(), gsm48_paging_extract_mi().

libmsc: duplicate gsm0808 / gsm48 functions (towards BSC).
In osmo-nitb, libmsc would directly call the functions on the BSC level, not
always via the bsc_api. When separating libmsc from libbsc, some functions are
missing from the linkage.
Hence duplicate these functions to libmsc, add an msc_ prefix for clarity, also
add a _tx to gsm0808_cipher_mode():
* add msc_gsm0808_tx_cipher_mode() (dummy/stub)
* add msc_gsm48_tx_mm_serv_ack()
* add msc_gsm48_tx_mm_serv_rej()
Call these from libmsc instead of
* gsm0808_cipher_mode()
* gsm48_tx_mm_serv_ack()
* gsm48_tx_mm_serv_rej()
Also add a comment related to msc_gsm0808_tx_cipher_mode() in two places.

Remove internal RTP streaming code; OsmoNITB supported that, but for OsmoMSC,
this will be done with an external MGCP gateway.

Remove LCHAN_MODIFY from internal MNCC state machine.

Temporarily disable all paging to be able to link libmsc without libbsc.
Skip the paging part of channel_test because the paging is now disabled.
Employ fake paging shims in order for msc_vlr_tests to still work.

msc_compl_l3(): publish in .h, tweak return value.  Use new libmsc enum values
for return val, to avoid dependency on libbsc headers.  Make callable from
other scopes: publish in osmo_msc.h and remove 'static' in osmo_msc.c

add gsm_encr to subscr_conn
move subscr_request to gsm_subscriber.h
subscr_request_channel() -> subscr_request_conn()
move to libmsc: osmo_stats_vty_add_cmds()
gsm_04_08: remove apply_codec_restrictions()
gsm0408_test: use NULL for root ctx
move to libbsc: gsm_bts_neighbor()
move to libbsc: lchan_next_meas_rep()
move vty config for t3212 to network level (periodic lu)
remove unneccessary linking from some tests
remove handle_abisip_signal()
abis_rsl.c: don't use libvlr from libbsc

gsm_subscriber_connection: put the LAC here, so that it is available without
accessing conn->bts. In bsc_api.c, place this lac in conn for the sake of
transition: Iu and A will use this new field to pass the LAC around, but in a
completely separate OsmoBSC this is not actually needed. It can be removed
again from osmo-bsc.git when the time has come.

Siemens MRPCI: completely drop sending the MRPCI messages for now, they shall
be added in osmo-bsc once the A-Interface code has settled. See OS#2389.

Related: OS#1845 OS#2257 OS#2389
Change-Id: Id3705236350d5f69e447046b0a764bbabc3d493c
2017-08-08 19:17:53 +02:00
Neels Hofmeyr 54a706cf92 vlr: LU FSM: enable Retrieve_IMEISV_If_Required
Change-Id: I121b95ad6d5ecb7603815eece2b43008de487a8a
2017-08-07 16:52:25 +02:00
Harald Welte 2483f1b050 Use libvlr in libmsc (large refactoring)
Original libvlr code is by Harald Welte <laforge@gnumonks.org>,
polished and tweaked by Neels Hofmeyr <nhofmeyr@sysmocom.de>.

This is a long series of trial-and-error development collapsed in one patch.
This may be split in smaller commits if reviewers prefer that. If we can keep
it as one, we have saved ourselves the additional separation work.

SMS:

The SQL based lookup of SMS for attached subscribers no longer works since the
SQL database no longer has the subscriber data. Replace with a round-robin on
the SMS recipient MSISDNs paired with a VLR subscriber RAM lookup whether the
subscriber is currently attached.

If there are many SMS for not-attached subscribers in the SMS database, this
will become inefficient: a DB hit returns a pending SMS, the RAM lookup will
reveal that the subscriber is not attached, after which the DB is hit for the
next SMS. It would become more efficient e.g. by having an MSISDN based hash
list for the VLR subscribers and by marking non-attached SMS recipients in the
SMS database so that they can be excluded with the SQL query already.

There is a sanity limit to do at most 100 db hits per attempt to find a pending
SMS. So if there are more than 100 stored SMS waiting for their recipients to
actually attach to the MSC, it may take more than one SMS queue trigger to
deliver SMS for subscribers that are actually attached.

This is not very beautiful, but is merely intended to carry us over to a time
when we have a proper separate SMSC entity.

Introduce gsm_subscriber_connection ref-counting in libmsc.

Remove/Disable VTY and CTRL commands to create subscribers, which is now a task
of the OsmoHLR. Adjust the python tests accordingly.

Remove VTY cmd subscriber-keep-in-ram.

Use OSMO_GSUP_PORT = 4222 instead of 2222. See
I4222e21686c823985be8ff1f16b1182be8ad6175.

So far use the LAC from conn->bts, will be replaced by conn->lac in
Id3705236350d5f69e447046b0a764bbabc3d493c.

Related: OS#1592 OS#1974
Change-Id: I639544a6cdda77a3aafc4e3446a55393f60e4050
2017-07-23 04:08:43 +02:00
Harald Welte b8b85a1b2e Add libvlr implementation
Original libvlr code is by Harald Welte <laforge@gnumonks.org>,
polished and tweaked by Neels Hofmeyr <nhofmeyr@sysmocom.de>.

This is a long series of trial-and-error development collapsed in one patch.
This may be split in smaller commits if reviewers prefer that. If we can keep
it as one, we have saved ourselves the additional separation work.

Related: OS#1592
Change-Id: Ie303c98f8c18e40c87c1b68474b35de332033622
2017-07-21 18:32:03 +02:00
Neels Hofmeyr f2ba81303e gsup_client: allow passing a unit id to identify with HLR
Before, each GSUP client would contact the HLR with an identical unit id, i.e.
"SGSN-00-00-00-00-00-00", with the result that some messages were sucked off by
the wrong client.

Pass explicit unit name from each gsup client user, so that OsmoMSC is "MSC"
and OsmoSGSN is "SGSN". Hence the HLR can properly route the messages.

Todo: also set some values instead of the zeros.

Unrelated cosmetic change while editing the arguments: gsup_client_create()'s
definition's oap client config arg name mismatched the one used in the
declaration. Use oapc_config in both.

Change-Id: I0a60681ab4a4d73e26fe8f0637447db4b6fe6eb2
2017-07-13 02:17:31 +00:00
Neels Hofmeyr 29b9206e80 move openbsc/* to repos root
This is the first step in creating this repository from the legacy openbsc.git.

Like all other Osmocom repositories, keep the autoconf and automake files in
the repository root. openbsc.git has been the sole exception, which ends now.

Change-Id: I9c6f2a448d9cb1cc088cf1cf6918b69d7e69b4e7
2017-07-12 23:17:10 +00:00
Harald Welte 13e10daa33 move openbsc into its own subdirectory 2009-06-10 05:40:52 +08:00
Harald Welte f7c43524cf * add support for storing classmark1/2/3 per subscriber
* add support for parsing measurement results (both BTS and MS side)
2009-06-09 20:24:21 +00:00
Harald Welte d3ff51dfe3 don't prefix every line with timestamp, this saves some screen real estate 2009-06-09 20:21:57 +00:00
Holger Freyther 6d9f77acd0 openbscdefines.h: Add header file to control visibility of symbols
Add the hooks/configure detection to compile everything with
-fvisibility=hidden and then make certain symbols visible. This
will be used to make parts of the API public.
There are no users yet but we should have some soon.
2009-06-08 10:32:54 +00:00
Holger Freyther 7c19f74084 lchan: Handle the abnormal case of channel getting closed
The abnormal case is that lchan_free ist getting called due
a RSL_MT_CHAN_REL_ACK in the RSL but the refcount of this
channel is not zero. This means that some "logical operation"
is still going on that needs to be cancelled.
Instead of always queuing up all operations in the
struct gsm_lchan use the signal framework to inform higher
layers about this abnormal case.

In gsm_04_08.c a signal handler is installed and in the
abnormal case the location updating request operation is
freed.
2009-06-06 13:54:35 +00:00
Holger Freyther c7b86f9011 Revert "[db] Keep track of the current gsm_network"
This was a stupid decision. We will have to assign the
network at some other place. The problem will be a problem
when we have two gsm_networks in one process and the same
subscriber is traveling in both networks.
2009-06-06 13:54:20 +00:00
Harald Welte 8b697c74c7 BS11: add nm_state for EnveBTES, PA and BBSIG physical objects 2009-06-05 19:18:45 +00:00
Holger Freyther c3d4b2d441 [subscr] Remove the struct gsm_bts pointer from subscriber
The pointer was initially added to support to open a lchan
by using the gsm_subscriber structure. We would have restored
the struct gsm_bts from the db when loading the subscriber.

Instead we will dynamically resolve the gsm_bts and might end
up paging multiple bts in the same (stored/old) location area
until it answers.
2009-06-04 14:27:39 +00:00
Holger Freyther 862cfff609 gsm_subscriber.h: Remove trailing whitespace...
Cosmetic changed
2009-06-04 14:15:33 +00:00
Holger Freyther 213b20bec0 [subscriber] Change id to long long unsigned int (Andreas Eversberg)
Changes the subscriber id type defintion from "long unsigned int" to "long
long unsigned int". Without, printf with '%llu' caused a crash.
2009-06-02 03:24:54 +00:00
Holger Freyther 4f584c3d4b [lchan] Log increase/decrease of channel use count (Andreas Eversberg)
This is part of patch 22 and will log changes in the usecount
of the lchan.
2009-06-02 02:55:07 +00:00
Harald Welte 7b26bcb1b5 * give Siemens ObjClass reasonable names rather than A3/A5/A6
* add nm_state objects for RACK and CCLK
* add obj_class human-readable printing for all vendor obj_classes
* add human-readable printing of administrative state
* add enum for cell_alloc numbers
2009-05-28 11:39:21 +00:00
Harald Welte 40f828936f show and edit subscribers from the vty interface 2009-05-23 17:31:39 +00:00
Harald Welte 78f2f508e6 Add user-configurable BSIC setting 2009-05-23 16:56:52 +00:00
Harald Welte 110c0ab6c5 * replace some more hex bytes in init msgs by #defines
* when using patch_tables(), use the ARFCN of the BTS, not the cmdline argument
2009-05-23 16:27:05 +00:00
Harald Welte 45b407ad25 With this patch, the TRAU muxing code supports not just bridging only.
A new function trau_recv_lchan() is used to link a channel to a call reference
of a transaction. (Transactions are used in later patches.) TRAU frames will
then be forwarded to the application with the given call reference (in later
patches). Also the application can send TRAU frames by using trau_send_lchan().

A new list is introduced in trau_mux.c. (upqueue_entry) All subslots
that must be sent to application are listed here.

Received TRAU frames are written in the upqueue of application
interface, if a call reference is found in the upqueue-list. If an entry
is found the ss_entry list, the TRAU frames are bridged as before. The
frames have a message type (msg_type), a call reference (callref) and a
trau frame (data). The length of trau frame is defined by the content of
the c-bits inside the frame.

There is no support for ip.access yet, as they don't use the traditional
TRAU frame format. Harald must add this in order to use application interface
with ip-access. The bridging with ip-access works as before.
(Andreas Eversberg)
2009-05-23 15:51:12 +00:00
Harald Welte be99149e72 add new function gsm_bts_by_lac() to search for BTS based on location area 2009-05-23 13:56:40 +00:00
Harald Welte c125a680ef A new debug flag is introduced: "DMNCC". MNCC is the Mobile Network Call
Control. This is required for later patches, that extract the call
control from gsm_04_08.c. (Andreas Eversberg)
2009-05-23 06:42:38 +00:00
Harald Welte a4d49e96ab Some messages have one or two length-value information elements. The is
no IE type included in the message. These information elements are
mandatory, so their actual IE type is known. The improved parse_tlv()
function allows to parse zero, one, or two length-value elements.
(Andreas Eversberg)
2009-05-23 06:39:58 +00:00
Harald Welte f55b49fef3 To slow down transmission of many ABIS frames at a time, a delay timer
is used for the E1's time slot. This timer replaces the "usleep()"
function, so the process will not block the execution of libbsc. The
timer is started after a frame is transmitted. If another frame is in
the transmit queue, the frame will only be queued until the timer times
out. If the timer is not running or times out, the frame is transmitted
and the timer is restarted.

The problem with partly provisioned TRX (locks show on LMT) is solved.
The adjustment for the inter frame delay of 50 miliseconds is for
further study.
(Andreas Eversberg)
2009-05-23 06:20:41 +00:00
Harald Welte 703af9887d fix some more compiler warnings 2009-05-23 06:14:44 +00:00
Harald Welte 04d3c9224f An application that has own events and file descriptors, must poll
select function ob libbsc. A "polling" flag is used to enable polling.
In this case select() will not sleep until file descriptor events occurr
or nearest timer expires. Also a return value will indicate if there was
an event that has been handled. If there was an event, the application
decides to poll again and don't wait.

In case for bsc_hack, the polling flag is not set. select will sleep as
usual.

(Andreas Eversberg)
2009-05-23 06:07:04 +00:00
Harald Welte 7572745816 Add missing "extern" prefix (Andreas Eversberg) 2009-05-23 05:26:29 +00:00
Harald Welte be68f6fc6c Change the variable "new" to "_new" in order to include it from C++ code.
The define "container_of" will cast pointer before assigning. Compilers
with stricter options require this. (Andreas Eversberg)
2009-05-23 05:24:48 +00:00
Harald Welte ff117a8d11 * rename the timer functions to avoid name collisions with libmisdn.
* the return value of bsc_update_timers() is required for applications to find out if a timer was fired
(Andreas Eversberg)
2009-05-23 05:22:08 +00:00
Harald Welte 12247c6713 Fix compilation issues on OS X - mainly #include file changes (Lars Immisch) 2009-05-21 07:23:02 +00:00
Harald Welte ef061951e6 dump CCLK accuracy/type as part of bs11_config query 2009-05-17 12:43:42 +00:00
Harald Welte cf5b3597ed add verbose reporting of RR STATUS cause 2009-05-01 18:28:42 +00:00
Harald Welte 0db97b253d abis_nm: print some information about failure event report type / severity 2009-05-01 17:22:47 +00:00
Harald Welte f9a8cc3cba send a signal for every software activation or failure event report 2009-05-01 15:39:49 +00:00
Harald Welte edb3778542 * Add support for multiple ip.access nanoBTS at one BSC
* keep track of site_id/bts_id in struct gsm_bts
 * dynamically match incoming OML/RSL over TCP connections by BTS Unit ID
 * introduce new debug category DINP (separate from DMI for hexdumps)
 * remove ia_config() as it is no longer needed
 * 
* ensure that signalling links / E1 line information is correctly printed
* when bootstrapping RSL or OML, tell us for which BTS it is being doen
* separate bootstrap_bts() out from bootstrap_network()
* statically configure two ip.access BTS, one with unit id's 1800/0/0 and 1801/0/0
2009-05-01 14:59:07 +00:00
Harald Welte 25de99170f add new 'ipaccess-config' program to set Unit ID and primary OML NVRAM parameters of ip.access BTS 2009-04-30 15:53:07 +00:00
Harald Welte 193fefc683 functionality to set nanoBTS NVRAM attributes and to restart BTS 2009-04-30 15:16:27 +00:00
Harald Welte 3bfbb84021 Add some more ip.access specific OML attributes/messages. In this case it is
about configuring the primary OML link IP address in the NVRAM of the device.
2009-04-29 22:58:38 +00:00
Harald Welte e69f5fb411 Add bs11_config commands to set the PLL mode from E1_LOCKED to STANDALONE
and vice-versa.  This has not yet been tested yet.
2009-04-28 16:31:38 +00:00
Holger Freyther b5c00f5587 [misdn] Add option to automatically release layer2 on exit
Patch by Andreas Eversberg to automatically release
layer2 on exit of the application. Made the naming of
the variables consistent (only release_l2 and not both
release_l2 and l2_release).
2009-04-22 22:08:07 +00:00
Holger Freyther dda22c18b5 [bsc_hack] Allow to select the cardnr defaulting to number 0
Patch from Andreas Eversberg to allow to select the ISDN
card number. The default remains the same.
2009-04-22 22:07:31 +00:00
Holger Freyther bcdebbfcab [bsc_hack] House keeping, remove dead code
This callback is not used from within the paging layer. We do
have a different set of callbacks in place. Remove it here.
2009-04-19 06:39:29 +00:00
Holger Freyther 36650b872f [db] Keep track of the current gsm_network 2009-04-19 06:35:16 +00:00
Holger Freyther a1f92f0a43 [subscriber] Introduce subscr_put_channel
Introduce subscr_put_channel to release a channel and to
allow gsm_subscriber.c to hand this channel to any suitable
pending requests.
2009-04-12 05:37:52 +00:00
Holger Freyther 4a49e77ff4 [subscriber] Update the current_bts field on imsi detach and LOC accept
When sending LOCATION UPDATING REQUEST Accept or when getting
a IMSI Detach update the gsm_bts of the gsm_subscriber.
2009-04-12 05:37:29 +00:00
Holger Freyther 0469cf608b [e1] Enable dumping of LAPD frames again
Kill mi_set_pcap_fd from the header, introduce e1_set_pcap_fd
and call it from bsc_hack.c. Hook into abis_rsl_sendmsg and
_abis_nm_sendmsg for sending and e1inp_rx_ts for reading. It compiles
and should not cause a regression.
2009-03-31 12:14:16 +00:00
Harald Welte 7e310b12ff Store incoming SMS into SQL database
* gsm_util now uses caller-allocated data (rather than callee-allocated)
* correctly parse destination address
* parse (but not transcode) non-default encodings of SMS
* reject SMS to unknown destination number
* resolve target subscriber id and store incoming SMS (without header) in 'sms' table

What we're now missing is the sending part, i.e. a regular task iterating over
all pending SMS and trying to deliver them.  Also, check for pending SMS once
we get a LOCATION UPDATE.
2009-03-30 20:56:32 +00:00
Harald Welte 273feca77f Fix 'delete-trx1' command of bs11_config (we can now delete TRX1) 2009-03-28 16:53:25 +00:00
Holger Freyther 1047940dce [misc] Make distcheck work again 2009-03-11 03:29:43 +00:00
Harald Welte c63e51daac * correctly handle VTY_READ/VTY_WRITE events and select loop integration of VTY 2009-03-10 19:46:16 +00:00
Harald Welte d256d4f19c * make sure we can obtain signalling type and timslot type names
* make sure every e1 timeslot has a valid backpointer to its line
2009-03-10 19:44:48 +00:00
Harald Welte 4d87f24e6f export nm_*_name() functions to get operational and availability state to strings 2009-03-10 19:43:44 +00:00
Harald Welte 44d542eba5 export list of e1 drivers and e1 lines 2009-03-10 18:24:35 +00:00
Harald Welte 404cdd8951 make telnet interface use VTY code 2009-03-10 12:21:45 +00:00
Harald Welte 68628e8479 add VTY dumping functions for OpenBSC 2009-03-10 12:17:57 +00:00
Harald Welte 955049f191 import VTY code from zebra/quagga (from my cardshell project) 2009-03-10 12:16:51 +00:00
Harald Welte 32201c1aea move is_ipaccess_bts() and parse_btstype9) to gsm_data.c 2009-03-10 12:15:10 +00:00
Harald Welte a27d8d2a91 add USSD protocol discriminator 2009-03-10 12:13:42 +00:00
Holger Freyther ff9592fa10 [misc] Fix compile warnings... 2009-03-09 16:17:14 +00:00
Harald Welte ddab3c78c5 introduce new 'mode' parameter to RSL ACTIVATE CHANNEL 2009-02-28 13:19:15 +00:00
Harald Welte 4a543e81cf * more RSL and 04.08 constant defines
* initialize some data structures before using them in RSL
* DATA_REQ is a transparent message
* more elaborate DEBUGP statements here and there
* don't call 04.08 with zero-length RSL DATA INDICATION
* reject 04.08 CC HOLD and RETRIEVE, as we don't support them yet
2009-02-28 13:17:55 +00:00
Harald Welte 02b0e093a1 make sure all channels in one BTS use the same TSC (training sequence code) 2009-02-28 13:11:07 +00:00
Harald Welte 3cc4bf517f make hexdump return a 'char *' rather than printing by itself 2009-02-28 13:08:01 +00:00
Holger Freyther 59da07bd0e [sms] Add test case for the 7-bit coding/decoding...
we don't pass it yet.
2009-02-23 00:50:38 +00:00
Holger Freyther 5775f46403 [misc] Fix make distcheck again... 2009-02-23 00:50:28 +00:00
Harald Welte 6154898753 fix paging response parsing for phase1 phones (classmar2 can be less than 4 bytes in length) 2009-02-22 21:26:29 +00:00
Harald Welte 2f74aa413b * location updating types
* struct for imsi detach
2009-02-22 21:14:04 +00:00
Harald Welte 5659d666fb add missing SET BS11 ATTRIBUTE NACK MT 2009-02-21 20:45:39 +00:00
Harald Welte b6c92ae782 * set OML TEI and E1 timeslot in one command
* introduce new 'oml-tei' command of bs11_config
2009-02-21 20:15:32 +00:00
Harald Welte 099d6100e6 fix various compiler warnings while building bs11_config 2009-02-21 12:59:58 +00:00
Harald Welte 7bc4cbc45c tlv_parser now operates on 'const' input buffer 2009-02-21 12:59:22 +00:00
Holger Freyther 3281f6e233 [build] Create a libbsc.a as noinst_LIBRARY, link bsc_hack and tests against it
Link the tests against the libbsc.a to avoid most of the breakage
when creating new symbols.
2009-02-20 18:33:00 +00:00
Harald Welte 23a686347d add gst_ts_name() function to obtain human-readable channel name 2009-02-19 17:06:42 +00:00
Harald Welte f1e6f96654 don't pass subchannel data to the TRAU decoder if we're not synchronized yet 2009-02-19 17:05:13 +00:00
Harald Welte 26aa6a1166 trau mux updates
* add function to map two lchans to each other
* make sure to evic old trau mux mappings before creating a new one
2009-02-19 15:14:23 +00:00
Harald Welte 78fc0d40a6 add various BS11 management related abis_nm functions 2009-02-19 02:50:57 +00:00
Harald Welte 0313394a88 * support BS11 specific IE types in abis_nm
* make bs11_config compile again 
* now that we have a proper TLV parser, use it to parse the status response on the serial port
2009-02-18 19:51:53 +00:00
Harald Welte 7eb1f621e0 "the big fix", of the E1 subchannel [de]multiplexer. I don't even remember how
many bugs I fixed during the last couple of hours.  It was never working at
any time before.
2009-02-18 03:40:58 +00:00
Harald Welte da78376396 * ensure TCH/F are activated signalling-only
* add function for RSL CHANNEL MODIFY REQUEST
* add missing channel activation function to header file
2009-02-18 03:29:53 +00:00
Harald Welte 8e4ae95e0b #defines for GSM48 channel modes 2009-02-18 03:28:01 +00:00
Harald Welte b480f41b57 add DMUX debug prefix 2009-02-18 03:27:39 +00:00
Holger Freyther 76c9569021 [utils] Create gsm_utils for 7bit encoding and decoding... 2009-02-17 20:31:30 +00:00
Harald Welte 49f48b8b77 various CC updates:
* correctly lchan_put the second lchan of a call at teardown
* map the RTP streams of ip.access onto each other
* fix bug that prevented a CONNECt message to ever reach the 'B' side
2009-02-17 15:29:33 +00:00
Harald Welte 167df88aae * increased debug verbosity for ip.access BIDND_ACK processing
* emit a signel when the BIND is acknowledged
2009-02-17 14:35:45 +00:00
Harald Welte 677c21f4ab add parsing for ip.access vendor specific NM messages 2009-02-17 13:22:23 +00:00
Harald Welte 7ccf77810b slightly more complete GSM 04.08 CC, we can now
* initiate phone calls from one MS
* look-up the subscriber based on dialled extension
* page the called subscriber
* send the SETUP to the called subscriber, including CLIP/CLIR
* get ALERTING notification back to caller
* relay DISCONNECT from either side to the other
This is still far from being complete, but it at least works for the most common case
2009-02-17 01:43:01 +00:00
Harald Welte 75a1fa834c switch paging code to use a timer again, since not all BTS send reliable CCCH load indications 2009-02-17 01:39:41 +00:00
Harald Welte 0932d1e2b4 forgot the header files in last commit. sigh. 2009-02-16 22:53:52 +00:00
Harald Welte e1b1338c88 add IEI values for GSM 04.11 2009-02-16 22:32:17 +00:00
Harald Welte 595ad7b762 modify the signal handler/dispatch code (sorry zecke, no offense, I just had some different ideas)
* introduce new notion of subsystem in addition to signal number
* no need for bitmasks of 'areas' (aka subsystems)
* pass subsystem/signal_nr/... per argument rather than by data structure
2009-02-16 22:05:44 +00:00
Harald Welte 7509926614 * introduce TLV parser definitions for RSL IE's
* introduce functions for ip.access specific RSL commands
2009-02-16 21:12:08 +00:00
Harald Welte e021254b64 introduce msgb_l2len() function 2009-02-16 21:09:34 +00:00
Holger Freyther 9b177760bb [sms] Send a notification on incoming SMS
Further tests of the signal class. Send a notification
on incoming SMS.
2009-02-16 19:07:18 +00:00
Harald Welte 0a23990be8 introduce msgb_l3len() function 2009-02-15 17:18:37 +00:00
Harald Welte d4c9bf3c5a * add bs_power and ms_power attributes to each channel and use them in channel activation 2009-02-15 16:56:18 +00:00
Harald Welte cd99387bd2 * use more constants to name the various BTS/TRX/... attributes
* set BS power reduction up to 30dB reduction.  we want to be quiet!
2009-02-15 16:16:28 +00:00
Harald Welte 4f361fcb68 * add commond header file for ipaccess protocol
* query for more attributes during ipaccess-find
2009-02-15 15:32:53 +00:00
Harald Welte 5c1e458376 Add support for ip.access RSL link on port 3003 2009-02-15 11:57:29 +00:00
Harald Welte 8c1d0e41a7 * add bsc_hack commandline argument to select BTS type
* add event-based OML bring-up for nanoBTS
2009-02-15 03:38:12 +00:00
Harald Welte e0590df524 * extend TLV parser to use a list of TLV type descriptions
* implement TLV type descriptions for NM
* add operational/administrative/availability state keeping logic to abis_nm
* explicitly print all NACK's in abis_nm
* make sure we produce [not just for BS-11] valid channel attributes
2009-02-15 03:34:15 +00:00
Holger Freyther e4b3fa3633 [signal] Move the area into the struct signal_data...
Remove the parameter and move the signal kind into the
signal struct. Make register/deregister fully symmetric.
2009-02-14 22:51:10 +00:00
Holger Freyther 2b2d2e350e [signal] Add generic signal registration and dispatch...
This will be used for generic registration and dispatching
of any kind of event. We will have different areas (like
with the debug interface) and each layer can define their
own struct for the event message... This is not tested yet
2009-02-14 22:51:00 +00:00
Harald Welte bbcc7a5bb8 introduce gsm_nm_state object in all our nm-relevant data structures 2009-02-14 19:45:44 +00:00
Harald Welte 2fa79349aa implement type1TV or type 2 detection 2009-02-14 19:07:10 +00:00
Harald Welte 22af0db588 * add comments for SET BTS ATTR and SET RADIO CARRIER ATTR
* use OPSTART on objects whose operational state is Disabled
2009-02-14 15:41:08 +00:00
Harald Welte 5fd8a545c8 preliminary ip.access BTS support, as of now only OML singalling works 2009-02-13 02:43:36 +00:00
Harald Welte 34a9968baf * more extensive A-bis OML support 2009-02-13 02:41:40 +00:00
Harald Welte 7584aeac42 * add more GSM 04.08 IEIs
* implement function for CHANNEL MODE MODIFY
* don't use hard-coded SETUP message but construct it with tlv functions
2009-02-11 11:44:12 +00:00
Harald Welte 45f83a10d8 include already-exported lchan2chan_nr() function in header file 2009-02-11 11:43:19 +00:00
Holger Freyther b1ffbb62ee [paging] Send paging requests as response to the PAGING LOAD indicator
Kill the paging timer and send paging upon paging load notifications.
2009-02-11 01:49:15 +00:00