Commit Graph

551 Commits

Author SHA1 Message Date
Holger Hans Peter Freyther 3730de4d87 sgsn: Convert cch_pdp to host order for libgtp
libgtp is calling gtpie_tv2 which will convert this uint16_t from host
to network order. So far libosmogsm and the sgsn treated the charging
characteristics as opaque data. So when moving from byte array to the
uint16_t do the swapping.

Change-Id: I977aec2e2f8d57802e45f591754e5733562d5c2a
2017-08-27 02:33:48 +02:00
Harald Welte 3b61a3812a remove code disabling T3109 if configured to 0
We no longer permit timers with a 0 value, so this case can never
happen.  Also, if it should happen, I'd rather have a timter expiring
immediately (and breaking something) than not being started in the
first place.

Change-Id: Ibfcdd3ddc0155caee89c501498329bde247621a0
2017-08-27 02:33:48 +02:00
Harald Welte 50546a9adb bsc_vty: Don't allow timers of zero (0)
It typically doesn't make sense to configure any of the GSM RR timer
to 0 (Seconds).  In fact, accidentially configuring any of the timers
to zero might have severe side effects, such as "stuck channels"
described in https://osmocom.org/issues/2380

Change-Id: I517828f2f0c80ec01cb63648db2626f17a67fe57
2017-08-27 02:33:48 +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 1f7fe3c813 bsc_vty: Add VTY command to test CTRL TRAP feature
Using this new command (introduced in OsmoBSC + OsmoNITB), you can
simulate the generation of TRAP events for testin purposes.

start the control interface monitor as an example client program:
	./openbsc/contrib/bsc_control.py -m -d localhost -p 4249

then start OsmoBSC or OsmoNITB, telnet to the VTY and enter 'enable'
mode and issue the following (example) command:
	ctrl-interface generate-trap my.foo.var 2342

As a result, on the bsc_control.py you will see:
	Got message: TRAP 0 my.foo.var 2342

Change-Id: Ib1d2ec38290dc94797c1b365d9b733e5215ab7d1
2017-08-27 02:33:48 +02:00
Harald Welte 63dde0a44a gtphob: check for missing result of rate_ctr_group_alloc()
In case the counter group allocation fails, we must handle this
gracefully and fail the allocation of the parent object, too.

The recent change (Id I7dad4a4d52fe05f6b990359841b4408df5990e21) seems
to have missed one instance, so let's follow-up.

Change-Id: I1ee9e3d26dcc18e7f979fd9a786162cbcc50942c
Related: OS#2361
2017-08-27 02:33:48 +02:00
Harald Welte 852456db5f gsm_bts_trx_set_system_infos(): Disable non-existing SI
If we previously had a given SI present/active, we must send a
zero-length BCCH FILLING for that SI type to the BTS to stop it from
further transmitting this SI.

Change-Id: I33e356e2fa3a69efac9080813e3e9ef4e6438ed1
Closes: OS#2368
2017-08-27 02:33:48 +02:00
Harald Welte 942175ccd0 RSL: Allow disabling of BCCH/SACCH filling for given SI type
If we want to instruct the BTS to stop sending a given SI, we must be
able to send the respective BCCH INFO / SACCH FILLING with a header but
without any L3 data IE.  This patch enables the related functions to do
this whenever their data argument points to NULL.

Change-Id: I88b85614951a108574f05db3b706884afe7e87a9
2017-08-27 02:33:48 +02:00
Harald Welte 9b5ace86a1 Fix regression causing loss of static system-information messages
In commit 8b1a2f8cd7 we started to
initialize bts->si_valid to 0.  This means we are skipping the manually
configured static system information.

Instead, we have to initialize bts->si_valid to bts->si_mode_static,
i.e. start with those that are static and not to be auto-generated.

Found while developing
http://git.osmocom.org/osmo-ttcn3-hacks/tree/sysinfo

Change-Id: Iab9cc93cf6d54560a72cc393cc3721a8d10e04bf
Closes: #2367
2017-08-27 02:33:48 +02:00
Harald Welte 3ee3b85bb1 check for missing result of rate_ctr_group_alloc()
In case the counter group allocation fails, we must handle this
gracefully and fail the allocation of the parent object, too.

RelateD: OS#2361
Change-Id: I7dad4a4d52fe05f6b990359841b4408df5990e21
2017-08-27 02:33:48 +02:00
Harald Welte e168c122d3 libbsc: Add VTY command to re-send the SYSTEM INFORMATION to BTS
This is useful if you are updating some configuration parameters which
affect the content of the SYSTEM INFORMATION messages.  Currently, we
only send them at the time the RSL connection is established (i.e. when
the BTS is initialized), so if you change something, you need to bring
down and re-start the BTS.

Using the newly-introduced "bts <0-255> resend-system-information"
command, you can re-generate + re-send SYSTEM INFORMATION without
bringing the BTS down, i.e. without any radio carrier downtime.

Change-Id: I326df47de98f6d36c9a4d2d5475225d1e62bafb5
2017-08-27 02:33:48 +02:00
Harald Welte 5a218c02d9 bsc_api: Fix copy+paste error in printing name of RR STATUS PDU
Change-Id: I0ef78ef046e4850346569f750693e12938b50ab5
2017-08-27 02:33:48 +02:00
Benoit Bolsee e7cf5e7513 transaction: reject calls from unidentified subscribers
A valid subscriber is indespensible when allocating a new
transaction. Return NULL if no subscriber is supplied. This
will cause unidentified subscribers to be rejected.

Note: Under normal conditions, the problem does not occour,
but it is still possible that a misbehaving MS might trigger
the problem by sending a SETUP command before authenticating
the subscriber. (unencrypted networks)

Change-Id: Ia8739b6e329ab02c0064270d02ad1d6ee245520d
2017-08-27 02:33:48 +02:00
Max b9d13bf227 Fix BTS attribute requests
* fix BTS numbers: use 0 to indicate given BTS and 0xFF to indicate all
  BTS' as it's explained in 3GPP TS 52.021 §9.3.
* only request attributes from supported (OsmoBTS) types

Change-Id: I8f43055c38000248033a8ff9ddaf0910d68d794b
Related: OS#2317
2017-08-27 02:33:48 +02:00
Harald Welte 943077755d Add VTY commands for experimentation with TS 04.14 commands
TS 04.14 (TS 44.014) specifies a series of commands specific to
conformance testing.  Let's add some VTY commands to play (at least
initially) with closing and opening voice loops in the MS.

Change-Id: I38b1ee9dbf26f5689c38cb83b1b3c5e9eaad7678
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
Alexander Chemeris a7388d7d0f libmsc: Fix VTY output for handover counters.
Handover countrs belong to BSC, but we mistakenly take values from MSC counters.

Change-Id: I9512330f2e91d2f526751c5228e6e8e0fe17d579
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
Benoit Bolsee 38bb344a47 04.08: find a portable way to obtain the timezone offset
Portable GMT offset calculation to display correct
time on GSM.

Change-Id: I673f17af2550c9708c4771e4ea4eafbbfafbb824
2017-08-27 02:33:48 +02:00
Benoit Bolsee d34ed5768c smpp: fix return cause
Return cause 38 when default SMPP route is unavailable. This
is better than cause 1.

Change-Id: If3241d50a78fa611981e55fef6ae4c72b0a2a167
2017-08-27 02:33:47 +02:00
Pau Espin 95606647ef smpp_smsc.c: Log on sending deliver_sm message
Change-Id: Ie16294df6d5bc0065f8d2b49320ead61f535f271
2017-08-27 02:33:47 +02:00
Neels Hofmeyr 78ada64be7 04.08: log protocol discriminators and message types by name
On incoming 04.08 messages, we log only the protocol discriminator in
decimal. Enhance: log pdisc and message type in hex, and also log the
protocol and message type as human readable string.

Also adjust the msc_vlr tests' log statements for wrapped rx/tx functions
of dtap from/to the MS.

Adjust the expected output of msc_vlr_tests.

Change-Id: Ida205d217e304337d816b14fd15e2ee435e7397d
Depends: libosmocore change-id I0fca8e95ed5c2148b1a7440eff3fc9c7583898df
2017-08-23 14:35:31 +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
Neels Hofmeyr ef9126c4dc vlr: place comments on if (0) cases
Change-Id: I56c1e61dedeac01a4e24452feee6616782783d8f
2017-08-07 16:52:23 +02:00
Harald Welte 46f4f14024 SGSN: Don't indicate GERAN in Iu mode PDP CTX ACT REQ to GGSN
Change-Id: Ifd9ff4342de342475609bad0257a23c50290e23b
2017-07-23 04:30:44 +02:00
Neels Hofmeyr ecd8c048fc IuPS: explicitly check RAN type; move comment
Change-Id: I054d72590dfb2012f6f8506d3a5f8fd2953194e1
2017-07-23 04:30:44 +02:00
Neels Hofmeyr ed739b9dac IuPS: don't require an MM context for Iu Release
Change-Id: I8b4d08b3ee8add1f1d54efb13985eabe0c9d31f3
2017-07-23 04:30:44 +02:00
Neels Hofmeyr 5322912630 SI3: indicate R99+ MSC to GSM MS to enable UMTS AKA
Change-Id: I796e1f4281628061f4522c43c549de9e751bc045
2017-07-23 04:30:44 +02:00
Neels Hofmeyr 853883d1f6 osmo-nitb: change default db name to sms.db
libvlr now delegates subscriber management to osmo-hlr, so the database no
longer represents a HLR. It basically only stores SMS, so reflect that fact in
the default database name.

Change-Id: I3289d68d3eb63aff940b48a25b584d5e83cd0197
2017-07-23 04:30:44 +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 3355fd674f logging: auth request: use hexdump without spaces for RAND, AUTN
Change-Id: Ie16bb2c01e770914f411bfb34b523c56ea9fab81
2017-07-13 02:17:39 +00: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 cbafa255cc GPRS/IuPS: remove all 3G authentication dev hacks
UMTS auth works now with the external OsmoHLR.

Change-Id: Ie42945bb687b077fd0ee430c2711d19782151610
2017-07-13 02:17:23 +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
Harald Welte bd8f7e399b fix typo CHANNL->CHANNEL 2009-06-09 20:17:12 +00:00
Harald Welte d0fbab515d some more comments 2009-06-09 20:04:44 +00:00
Holger Freyther 91754473ca db.c: tmsi may be empty so put it into '' to make that obvoius (Andreas Eversberg)
during attachment, the "tmsi" field of the subscriber may be an empty
string, so the string must be quoted in the sql request, or the sql
request fails due to incorrect syntax.

also i added "extension" field to debug output.
2009-06-09 08:52:41 +00:00
Holger Freyther d51524f654 gsm_04_08.c: Kill duplication pointed out by Andreas Eversberg
Introduce the internal gsm0408_authorize that will determine
if we allow the user into our network. If allowed a new tmsi
will be allocated, the subscr_update will be called, the loc_operation
released, and the accept sent. Otherwise just return 0.

The code was copied from mm_rx_id_resp.
2009-06-09 08:27:07 +00:00
Holger Freyther 7a12faa195 gsm_04_08.c: Call subscr_update everytime we let someone in (Andreas Eversberg)
If location update is requested, but subscriber is not yet authorised
within mm_rx_loc_upd_req() function, the subscr_update() is not called,
because subscriber information is not complete.
During mm_rx_id_resp() the subscriber informations is may be complete,
so authorize subscriber succeeds and database must be updated.
2009-06-09 08:26:58 +00:00
Holger Freyther 578001b151 bsc_hack.c: Fix the -l db option (Andreas Eversberg)
Add ':' to indicate an argument will follow -l.
2009-06-09 08:26:48 +00:00
Holger Freyther 3cf00fb954 Add the isdnsync program which enable layer1 and layer2 on a card
this small tool is used to enable layer 1 and 2 on a given isdn card.
the card can be used to retrieve clock signal from a network. layer 2
(PTP) is required to keep layer 1 without interruption. this tool works
on e1 and s0 cards. to use the clock signal with other cards,
interconnection with a clock-slave-card is required.

(Andreas Eversberg)
2009-06-08 10:33:06 +00:00
Holger Freyther eaf0469a8b gsm_04_08.c: Some spoofing protection against two location updating requests
Do not allow two location updating requests on the same lchan. Such
an event is certainly spoofed and can confuse the internal logic of
the application. Prevent that.
2009-06-06 13:54:44 +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 9d12ea0e47 fix CONN FAIL and IPAC_DISCONNECT_IND log printing 2009-06-05 20:28:48 +00:00
Harald Welte d2a7f5a7b2 print reject cause of MM STATUS message 2009-06-05 20:08:20 +00:00
Harald Welte 60d68f1974 missing newline in log message about measurement result 2009-06-05 20:07:43 +00:00
Harald Welte 30b66d79cd fix printing of measurement results 2009-06-05 19:57:24 +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 eb443983ae [debug] Move subscr_get_by_tmsi below the debug statement (Andreas Eversberg)
subscr_get_by_tmsi might log as well and then the order of
debugging it not as clear as it could be.
2009-06-04 13:58:42 +00:00
Holger Freyther 2e99605b7e [misc] Search for the crypt symbol to conditionally enable crypt in VTY
It will define -DVTY_CRYPT_PW= if crypt is found. If -lcrypt is
needed, $(LIB_CRYPT) will be -lcrypt.

Compiles on OS X and Linux and reenables crypt.

Patch by: Lars Immisch
2009-06-02 04:04:36 +00:00
Holger Freyther 8521e5f050 [l2] Do not always release the layer2 when closing the socket (Andreas Eversberg)
Tells mISDN not to release layer 2 on closing socket, when not
requested. If mISDN was told to release layer 2 once, it will continue
to release layer 2 on every shutdown of OpenBSC.
2009-06-02 03:25:24 +00:00
Holger Freyther b8be6543cd [e1] Correctly initialize the e1link (Andreas Eversberg)
During bootstrap of BS11, the e1links are initialized. This must also be
done when BS11 is already bootstrapped (when restarting OpenBSC). It is
required to correctly multiplex the audio traffic between channels.
Without it, all time slots refer to card 0, slot 0, subslot 0, which
causes crashes when handling TRAU frames..
2009-06-02 03:25:14 +00:00
Holger Freyther 79f4ae6cc3 [debug] Change DEBUGPC statements to contain \n (Andreas Eversberg)
Some debug outputs now correctly use end-of-line characters.
2009-06-02 03:25:04 +00:00
Holger Freyther f7b2a0ec7f [rsl] Change logging of handling reason 0x18 in rsl_rx_conn_fail (Andreas Eversberg)
Release the channel when it is not used, otherwise claim it
is still in use...
2009-06-02 02:55:17 +00:00
Holger Freyther c21cfbc4aa [subcriber] Fix the subscriber use counting in gsm_04_08.c (Andreas Eversberg)
This patch will fix subscriber usage countinig.
It may happen, that the subscriber count will not be 0 after releasing
of a call. (This problem is solved with the application patch (27),
which will replace static call transaction by a dynamic transaction
list, and use subscriber for each transaction created.)
2009-06-02 02:54:57 +00:00
Holger Freyther 3e0ef7ccbe [subscriber] Log changes in the usage of a subscriber (Andreas Eversberg)
Log changes of the use count of a gsm_subscriber.
2009-06-02 02:54:48 +00:00
Holger Freyther 6d5200b217 [subscriber] Update the lac entry in subscr_update (by Andreas Eversberg)
This is coming from patch 16 and is one of the two changes. When
invoking subscr_update update the lac entry as well.
2009-06-02 02:54:38 +00:00
Holger Freyther 3770b763bc debug: Fix the definition on DMM (Andreas Eversberg)
Now MM can be specified on the command line with the debug option.
2009-06-02 02:35:12 +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 fe609d85c3 some more comments on the abis attributes 2009-05-23 18:14:31 +00:00
Harald Welte 060f6dfced make sure even our predefined structures use HARDCODED_BSIC as initial value 2009-05-23 17:50:53 +00:00
Harald Welte 40f828936f show and edit subscribers from the vty interface 2009-05-23 17:31:39 +00:00
Harald Welte be4b730196 mark two functions as static, fix typo in vty message 2009-05-23 16:59:33 +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 c1d2aaecb5 RSL should not be called RSSL in the debug definition (Andreas Eversberg) 2009-05-23 06:43:35 +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 e7b452a7a0 add FIXME comment about the fact that we're paging in the wrong BTS 2009-05-23 06:34:37 +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 75d34a8b3d fix two compiler warnings 2009-05-23 06:11:13 +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 7d14476a6e Correct handlong of data link status change (Andreas Eversberg) 2009-05-23 05:40:49 +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 d6cab81175 vty: disable password encryption, remove dependency to lcrypt 2009-05-21 07:31:48 +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 7a2a71e255 revert commit #481: we actually still need that stupid usleep() to reliably bootstrap nanoBTS :( 2009-05-01 21:54:11 +00:00
Harald Welte c9e0218990 Fix "CM Service Request" parsing for Phase 1 devices. This means MO calls from phase1 should work now. 2009-05-01 19:07:53 +00:00
Harald Welte 440fed08ec implement parsing and printing of RSL measurement results 2009-05-01 18:43:47 +00:00
Harald Welte cf5b3597ed add verbose reporting of RR STATUS cause 2009-05-01 18:28:42 +00:00
Harald Welte 3cf7c3ff89 don't print rf resource indication messages, they clutter up the logs 2009-05-01 18:28:00 +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 90f64767c4 print OML bts_nr rather than bts->nr 2009-05-01 17:22:09 +00:00
Harald Welte 6dab055752 print cause for channel activate NACK 2009-05-01 17:21:37 +00:00
Harald Welte e81899cc00 fix printing of ip.access disconnect cause 2009-05-01 16:01:00 +00:00
Harald Welte 70f9b3dcf8 remove any sleeping from the ip.access input code 2009-05-01 16:00:44 +00:00