Commit Graph

1298 Commits

Author SHA1 Message Date
Holger Hans Peter Freyther ebead597ff ipaccess: Refactor... unite some code 2010-05-13 00:40:40 +08:00
Holger Hans Peter Freyther 9958f477b4 ipaccess: Use the right trx when performing the test 2010-05-13 00:39:30 +08:00
Holger Hans Peter Freyther 505f20d7c4 ipaccess: Use the current TRX to set the OML address. 2010-05-13 00:39:18 +08:00
Holger Hans Peter Freyther 5fbf5f4f8d ipaccess: Wait for the BASEBAND_TRANSCEIVER and then bootstrap OML
Currently we are connecting to the BTS and once the OML is established
we are bootstrapping the OML. This does not work for a multi TRX setup
as we will need to use a trx_nr != 0 for it.

Change the code to wait for a message (in this case NM OC_BASEBAND_TRANSC)
to detect the trx_nr used by the BTS and then use that TRX to bootstrap
the network.

I have tested setting the unit id on a single and multi trx system for
the first and second trx.
2010-05-13 00:38:49 +08:00
Holger Hans Peter Freyther aa0db809e2 abis: Pass the abis_om_obj_inst in the nm_state_event.. 2010-05-13 00:37:48 +08:00
Harald Welte b4d5b17a8d Ensure all 'view' commands are availalbe from 'enable' too 2010-05-12 18:28:00 +02:00
Harald Welte 50a6dfee37 Make sure all commands of SHOW_NODE to ENABLE_NODE 2010-05-12 18:28:00 +02:00
Harald Welte d9c69cc7fe Gb Proxy: Cosmetic fix of VTY file writing 2010-05-12 18:28:00 +02:00
Harald Welte 1194b584be NS: Add support for persistent NS-VC configuration
With persistent NS-VC configuration (configured through VTY),
we can respond properly to BSS with a somewhat strange NS
implementation Such as the BSplus.  It enables us to respond
with a proper NS-RESET (including NSVCI/NSEI) when receiving
a NS-ALIVE or other PDU for a BLOCKED/DEAD NS-VC after our
end of the connection is rebooted.
2010-05-12 18:28:00 +02:00
Harald Welte f6d67c04ee NS: Send UNBLOCK signal when we get UNBLOCK_ACK from peer 2010-05-12 18:28:00 +02:00
Harald Welte d4eaf80acc Display NSEI instead of NSVCI for all debug msgs 2010-05-12 18:28:00 +02:00
Harald Welte 8c2440e182 NS: Send STATUS or RESET when receiving NS_ALIVE on unknown NSVC 2010-05-12 18:28:00 +02:00
Harald Welte b778d2cf16 NS / GB Proxy: Add Signal in case Tns-Alive expires too often
The Gb Proxy can then restart the RESET procedure.
2010-05-12 18:28:00 +02:00
Harald Welte 811c4979e6 NS: Debug NS timer expiry 2010-05-12 18:28:00 +02:00
Harald Welte bca900dab2 NS: Add more LOG_DEBGU messages and retransmit NS-ALIVE 2010-05-12 18:28:00 +02:00
Harald Welte 34caeb36ab NS: More INFO messages about what we actually transmit 2010-05-12 18:28:00 +02:00
Harald Welte cad8301dbe NS: don't memcmp sockaddr_in but compare ip and port individually
this seems to work more portably (ppc/32bit big endian)
2010-05-12 18:28:00 +02:00
Harald Welte 9bdb3ba322 [gprs] NS: more state transitions, error reporting via Tx STATUS PDU 2010-05-12 11:50:11 +02:00
Holger Hans Peter Freyther 7d45ea41f4 [ipaccess] Attempt to fix setting unit ids with a multi trx setup
Add a --trx/-t NR option to set the TRX nr to be used when calling
set unit id and NVRAM. This was not tested and might or might not
work.
2010-05-12 15:58:24 +08:00
Holger Hans Peter Freyther d91b73769a gsm0408: Use counter_inc to increment the counter. 2010-05-12 15:57:53 +08:00
Harald Welte 72953b884d [gprs] Gb proxy: log level consolidation 2010-05-12 00:20:41 +02:00
Harald Welte fcc4cc9f65 [gprs] NS: elevate events from LOGL_DEBUG to LOGL_INFO 2010-05-12 00:16:57 +02:00
Harald Welte 1174c08068 [gprs] gb_proxy: Snoop Cell ID from BSSGP RESET
If a PTP BVC is BVC-RESET by the BSS, the PDU contains the
Cell Identifier.  We can snoop this into our gbprox_peer structure
for better visualization of each peer in they vty.
2010-05-12 00:07:29 +02:00
Harald Welte 615e956328 [gprs] NS/BSSGP: Make all timers configurable from VTY 2010-05-11 23:50:21 +02:00
Harald Welte 8f0ed55b52 VTY: More context sensitive help messages 2010-05-11 21:53:49 +02:00
Harald Welte e9ea26935e [gprs] gb_proxy: more verbose debugging 2010-05-11 20:20:13 +02:00
Harald Welte 7c209ebb86 [gprs] NS: update the remote peer IP addr/port on NS RESET 2010-05-11 18:40:45 +02:00
Harald Welte ef1226e827 [gprs] NS: include port number in log statement 2010-05-11 18:38:36 +02:00
Harald Welte e69b2814e2 [gprs] use TCP port 4246 for the gb_proxy vty telnet 2010-05-11 18:32:37 +02:00
Harald Welte e5117da715 [gprs] gb-proxy: We might receive a NS-RESET for a NS-VC that we already know
In this case, don't blindly allocate a new NS-VC but rather use the NSEI
to lookup the 'struct gprs_nsvc' for it.
2010-05-11 18:30:37 +02:00
Harald Welte f69c059a0e [gprs] gb_proxy: Fix detecting the SGSN-facing ns-vc by its NSEI
make sure we mark the NS connection as 'SGSN-facing' if the NSEI matches
2010-05-11 18:29:44 +02:00
Harald Welte d7c02ad9df [gprs] NS: Make sure we include "Rx" in the log statement for NS RESET 2010-05-11 18:18:31 +02:00
Harald Welte 6f65696459 logging: Add 'show logging vty' command to display current log config
As the logging config is getting more and more complex, it is good
if it can be displayed interactively.

WARNING: This needs libosmocore 0.1.6 or later!
2010-05-11 11:24:27 +02:00
Harald Welte f171a6e4fc debug/logging: more verbose descriptions 2010-05-11 10:51:30 +02:00
Harald Welte cd7c1beb6b logging: Add interactive help
If you press ? on the vty, you now get some more explanation about
the logging categories and their meaning.
2010-05-11 10:41:34 +02:00
Harald Welte 6fab236cbb logging: use 'logging level all' instead of 'logging set log level'
'logging level' can already parse a human-readable level such as
'debug' or 'notice'.  By setting the global mask within the same
command we can also parse it there.
2010-05-11 10:23:45 +02:00
Harald Welte 7fc9822a74 [gprs] Gb proxy: cosmetic cleanup 2010-05-11 10:15:42 +02:00
Harald Welte 1389ac7d2a [gprs] NS: cleanup / fix compiler warnings 2010-05-11 10:15:26 +02:00
Harald Welte a7a3194da8 [gprs] BSSGP: cosmetic cleanup 2010-05-11 10:12:44 +02:00
Harald Welte 0a4050c63b [gprs] gb_proxy: Send proper BSSGP STATUS msg in error case
In order to reuse the existing bssgp_tx_* functions without pulling
in the dependencies of gprs_bssgp.c, we have to move those functions
to gprs_bssgp_util.c

Furthermore, we can remove gbprox_nsi and replace it with bssgp_nsi,
and we can do proper processing of BVC-RESET messages coming from
the SGSN on the signalling BVC.  In that case we need to send RESET
messages to all the BSS.
2010-05-11 10:03:34 +02:00
Harald Welte c1c1dd260a [gprs] gb_proxy: Forward NS-RESET/NS-BLOCK/NS-UNBLOCK from SGSN to BTSs 2010-05-11 06:34:24 +02:00
Harald Welte 99e3248192 [gprs] NS: Add signals in the event of BLOCK/UNBLOCK/RESET
The signals will be sent upon reception of NS-BLOCK/UNBLOCK/RESET PDUs

We also export functions to generate/send BLOCK/UNBLOCK and RESET.
2010-05-11 06:33:17 +02:00
Harald Welte 6b72cdf854 [gprs] Add new 'NS' and 'BSSGP' logging categories 2010-05-11 05:54:22 +02:00
Harald Welte 85801d0294 [gprs] gb_proxy: More VTY 'show' information
The 'show gbproxy' now actually shows information about the Gb proxy
BTS peers, whereas 'show ns' shows information about existing NS links.
2010-05-11 05:49:43 +02:00
Holger Hans Peter Freyther c6ec0406c8 misc: Use $(top_srcdir) for source, $(top_builddir) for libs
We should not use ../ for adding sources or libraries as the
user might have a srcdir != builddir setup.
2010-05-04 14:36:07 +08:00
Harald Welte 5d6e378c35 update README with URL of the homepage 2010-05-04 08:10:18 +02:00
Harald Welte c9a341b248 move ipaccess tools into their own subdirectory
They will now be built fully inside src/ipaccess, using their
own Makefile.am
2010-05-04 07:47:54 +02:00
Harald Welte e236596bf4 [gprs] Move all GPRS related code to src/gprs subdirectory 2010-05-04 07:41:59 +02:00
Harald Welte ce662943f3 [gprs] Add GPRS header files to noinst_HEADERS 2010-05-04 07:41:13 +02:00
Harald Welte 1c77c6e4c2 [gprs] gb_proxy: Fix message looping bug
We don't want to loop back the BSS messages to the BSS itself.
2010-05-04 07:20:45 +02:00
Harald Welte 24b31313e8 [gprs] NS: If we are the BSS side, UNBLOCK the connection after it is ALIVE
After RESET / RESET-ACK and ALIVE / ALIVE-ACK, the connection needs to
be unblocked from the BSS side to the SGSN.
2010-05-04 07:20:45 +02:00
Harald Welte 90de93e122 [gprs] NS: Start ALIVE Procedure after receiving RESET_ACK 2010-05-04 07:20:45 +02:00
Harald Welte 199d9df0bb [gprs] NS: improved timer handling for RESET 2010-05-04 07:20:45 +02:00
Harald Welte 05b320a4e3 [gprs] NS: replace nsvc->timer_is_tns_alive with nsvc->timer_mode
This will allow to use the timer in more than 2 modes
2010-05-04 07:20:45 +02:00
Harald Welte 96f71f28eb [gprs] gb_proxy: fix NSEI value printed in some debug statements 2010-05-04 07:20:45 +02:00
Harald Welte 44c4830d5b [gprs] gb_proxy: locally acknowledge BVC RESET for BVCI=0
If a BSS resets BVCI=0, we don't want to reset the SGSN, as BVCI=0
is shared signalling between all BSS.
2010-05-04 07:20:45 +02:00
Harald Welte 69619e3970 [gprs] gb_proxy: Strip NS header before relaying message
We don't want two NS headers, do we?
2010-05-04 07:20:44 +02:00
Harald Welte 672f5c4dfd [gprs] gb_proxy: Fix proxying of BSS messages to SGSN
We don't keep a superfluous gbprox_peer for the SGSN anymore.
2010-05-04 07:20:44 +02:00
Harald Welte 239cf056f0 [gprs] Unify log messages of the NS protocol implementation 2010-05-04 07:20:44 +02:00
Harald Welte ca3620a707 [gprs] gb_proxy: use new msgb_bssgph() and msgb_bssgp_len() macros
The proxy code still operated on msg->l3h, which is no longer the
BSSGP header now.
2010-05-04 07:20:44 +02:00
Harald Welte 5658a1a766 [gprs] LLC: Echo back the XID parameters that the MS requested
In order to finish PDP context activation and start the transfer
of SNDCP N-PDUs, we simply confirm to the MS whatever XID parameters
it requests.  This of course has to be implemented with a proper
XID handshake at some other point.
2010-05-04 07:20:44 +02:00
Harald Welte 10997d0b9b [gprs] LLC: API to send XID responses to XID commands 2010-05-04 07:20:44 +02:00
Harald Welte 86fda90d03 [gprs] Include a valid QoS attribute in ACT PDP CTX ACCEPT
At least a Motorola ROKR E6 now accepts the PDP context activation
and proceeds to XID on LL3.
2010-05-04 07:20:44 +02:00
Harald Welte 421cba4b08 [gprs] SGSN SM: Provide IPv4 PDP address in PDP CTX ACT ACCEPT
The message looks now fine (from wireshark point of view).  However,
we cannot simply echo back the QoS parameters, as the meaning in
uplink and downlink connection is not the same.
2010-05-04 07:20:44 +02:00
Harald Welte ba850c529e [gprs] cosmetic updates in header file 2010-05-04 07:20:44 +02:00
Harald Welte ba02110918 [gprs] use old (uplink) message when parsing the routeing area 2010-05-04 07:20:44 +02:00
Harald Welte 721961cf50 [gprs] correctly calculate the length of the BSSGP PDUs 2010-05-04 07:20:44 +02:00
Harald Welte d6c7416c32 [gprs] correctly set the NS instance that BSSGP should use 2010-05-04 07:20:44 +02:00
Harald Welte 0c3eae0011 [gprs] GMM: print more details about PDP context activation request 2010-05-04 07:20:44 +02:00
Harald Welte d60570991f [gprs] header file ordering (cosmetic) 2010-05-04 07:20:43 +02:00
Harald Welte 9f1f3ad7bb [gprs] GMM: update MM context RA ID / TLLI when appropriate 2010-05-04 07:20:43 +02:00
Harald Welte 11d7c105f8 [gprs] pass BSSGP UL-UNITDATA Cell ID up into GMM layer
BSSGP stores a pointer to the Cell Identifier IE in msgb->cb, which
is later used by the GMM layer to identify the cell that has sent a
given message.

This now also means that the gsm_04_08_gprs.c code is free of any
legacy references to msg->trx or struct gsm_bts.
2010-05-04 07:20:43 +02:00
Harald Welte eaa614cb9e [gprs] Use stdint.h types (uintXX_t instead of u_intXX_t)
libosmocore already uses them, it's time (at least for new code)
in openbsc to do the same.
2010-05-04 07:20:43 +02:00
Harald Welte e6afd60779 [gprs] SGSN: Expect all Identifiers to be stored at highest level
We now expect the highest level (actual SGSN GMM code) to know
all identifiers for every element in the protocol stack, i.e.
TLLI, SAPI, BVCI and NSEI.  The layer-inetrnal state is looked
up based on those identifiers.

The reason for this is to ensure only the highest level state
needs to be persistent, while everything else can be regenerated
dynamically (e.g. in a SGSN restart)
2010-05-04 07:20:43 +02:00
Harald Welte fd3fa1d4e0 [gprs] Ensure msgb->l3h points to Layer3 (04.08)
In the old code
	l3h = BSSGP, l4h = LLC, cb[gmmh] = 04.08
Now, this has been changed to
	cb[bssgph] = BSSGP, cb[llch] = LLC, l3h = 04.08

This way, GSM general 04.08 and GPRS 04.08 code can expect a
GSM 04.08 header at msgb->l3h
2010-05-04 07:20:43 +02:00
Harald Welte 345223ee9e [gprs] convert ns_cause_str to value_string 2010-05-04 07:20:43 +02:00
Harald Welte dbab1c79e7 [gprs] BSSGP: convert cause strings to value_string 2010-05-04 07:20:43 +02:00
Harald Welte a26655426d [gprs] LLC: Introduce the allocation and lookup of LLC Entities (LLE) 2010-05-04 07:20:43 +02:00
Harald Welte 6557cd0517 [gprs] introduce BSSGP concept of BTS contextx
A BTS context represents the mapping betewen (RA-ID, Cell-ID) and
(BVCI, NSEI) as well as the per-BVC local state.
2010-05-04 07:20:43 +02:00
Harald Welte 288be16587 [gprs] Build the SGSN stand-alone and not as part of bsc_hack
Instead of continuing to add more and more functionality to the
bsc_hack binary, we should have the new SGSN code run as a separate
executable.

After this commit we now build a 'osmo_sgsn' executable, using its
own osmo_sgsn.cfg config file.

However, the SGSN is not yet functional, mainly due to the fact that
the BSSGP and GMM code are written with the assumption that there
is a msgb->trx->bts and the according 'sturct gsm_bts' data model
around - which clearly is no longer the case outside of bsc_hack.
2010-05-04 07:20:43 +02:00
Harald Welte a67cbd6f06 [gpprs] Add VTY node for SGSN 2010-05-04 07:20:43 +02:00
Harald Welte f533e13c14 [gprs] add some Iu specific SGSN MM state fields 2010-05-04 07:20:42 +02:00
Harald Welte 169a00403f [gprs] Makefile reorganization
We don't need to explicitly link telnet_interface.c and vty_interface_cmds.c
as they're now part of libvty.a
2010-05-04 07:20:42 +02:00
Harald Welte 70f38d2a3b [gprs] gb_proxy: Actually create our gbprox_peers
also extend the logging verbosity and fix some compiler warnings
2010-05-04 07:20:42 +02:00
Harald Welte 79fc392751 move gsm48_parse_ra() and gprs_tlli_type() to libosmocore 2010-05-04 07:20:42 +02:00
Harald Welte b77c697c0b [gprs] fully integrate VTY configuration into Gb proxy
The Gb-proxy is now fully configured by config file / VTY
2010-05-04 07:20:42 +02:00
Harald Welte 799e0c92c6 gb_proxy: Add initial VTY configuration code 2010-05-04 07:20:42 +02:00
Harald Welte a977b3d1ee gbproxy: add VTY node 2010-05-04 07:20:42 +02:00
Harald Welte 7b8255c52d gb_proxy: listen on UDP port 23000, use AF_INET 2010-05-04 07:20:42 +02:00
Harald Welte 9f75c35eb3 GPRS: Introduce a GPRS Gb Proxy
The ida of the Gb proxy is to aggregate Gb links with a number of BSS
and then present all the BSSGP-VC's together inside one NS-VC to the
actual SGSN.

The code is not yet expected to be complete.
2010-05-04 07:20:42 +02:00
Harald Welte 44f1c27460 gprs: remove msgb->nsvc pointer and replace it with NSEI and BVCI
According to TS 08.16, the BSSGP layer needs to specify NSEI and BVCI when
executing the NS UNITDATA REQUEST primitive of the underlying NS layer.

Rather than passing around a pointer to the 'struct gprs_nsvc', we now
have NSEI and BVCI as members of 'struct obsc_msgb_cb' and set them
when BSSGP hands a message down to NS.

NS then does a lookup of the 'gprs_nsvc' based on the NSEI parameter.
2010-05-04 07:20:42 +02:00
Harald Welte 06aa111fda gprs: Use new msgb->cb[] for storing a pointer to the NS-VC through which it was received 2010-05-04 07:20:42 +02:00
Harald Welte b7bd65ea01 signal.h: Don't include gsm_subscriber but rather declare it 2010-05-04 07:20:42 +02:00
Harald Welte cb99163249 GPRS: Modularize the NS implementation
* move UDP listener code for NSIP from input/ipaccess.c and into gprs_ns.c
* add PDU type, IE and CAUSE values for later IP based 3GPP TS 48.016
* support multiple NS-VCs and their lookup based on NSVC and sockaddr_in
* maintain the remote_state (blocked/alive) for each NSVC
* introduce the concept of GPRS_NS instances, move all global vars to instance
* remove hardcoded calls to gprs_bssgp_rcvmsg() and replace it by callback

WARNING: This is not finished code.  While it will compile, it will not work
yet, as BSSGP needs to be converted to properly indicate the NSVC to which it
needs to send data.
2010-05-04 07:20:42 +02:00
Harald Welte 943c5bc595 gprs: Update gprs-sgsn branch to use new msgb->cb layout
The explicit 'tlli, gmmh' members of struct msgb are gone from
current libosmocore and have been replaced by the more generic
'control buffer' mechanism.
2010-05-04 07:20:41 +02:00
Harald Welte 2977d67d48 GPRS: add DGPRS to new debug api 2010-05-04 07:20:41 +02:00
Harald Welte 5434d7ec8d GPRS: remove hard-coded IP address for NSIP responses from SGSN->BTS 2010-05-04 07:20:41 +02:00
Harald Welte ab88a62f66 some more GPRS related comments 2010-05-04 07:20:41 +02:00
Harald Welte 9b455bf801 Create new 'gprs-sgsn' branch on top of 'gprs-conf'
This branch contains the partial SGSN/GGSN implementation that
was originally developed as part of the gprs branch.
2010-05-04 07:20:41 +02:00
Harald Welte 3c69a4cdbe make gsm48_msgb_alloc() a static inline function
This resolves some dependency problems (i.e. osmo_sgsn not needing
to link gsm_04_08_utils.o which has RSL dependencies)
2010-05-04 07:17:32 +02:00
Harald Welte bde050e8f8 multi-trx config: Don't configure CCCH on 2nd TRX ;) 2010-05-04 07:15:01 +02:00
Harald Welte 72267f01fd move gsm48_construct_ra() to libosmocore 2010-05-01 14:27:12 +02:00
Harald Welte 0b484a4fb1 Makefile cleanup
move vty_interface_cmds.c and telnet_interface.c into libvty
rather than explicitly linking the C files for every program
2010-05-01 14:02:25 +02:00
Harald Welte 9624364b4e 'struct gprs_ra_id' is now defined in libosmocore 2010-05-01 14:01:23 +02:00
Harald Welte f32cc4bee5 VTY: ensure all cmd_elements are declared 'static'
While doing 'nm' on a VTY-using object file I noticed that all
cmd_elements are global symbols, which is not good.

Unfortuantely there are some vty-internal cmd_elements that need
to span across object files, so I had to introduce gDEFUN()
and gALIAS().  The old macros now all declare static structures.
2010-05-01 12:07:41 +02:00
Harald Welte 0809d79ef8 define 'struct openbsc_msgb_cb' and accessor macro OBSC_MSGB_CB() 2010-04-30 14:36:25 +02:00
Harald Welte e9dd9b0475 gsm_04_11.c: Use msgb->l4h instead of sms->smsh, as the latter is gone 2010-04-30 14:27:05 +02:00
Harald Welte 52e8da6ea1 remove any reference to 'struct gsm_bts_link' 2010-04-30 14:04:01 +02:00
Holger Hans Peter Freyther 8f12fe818b [mgcp] Remove talloc.h header. 2010-04-30 13:35:31 +08:00
Holger Hans Peter Freyther a581136f73 [misc] Remove spaces, fix indention. 2010-04-30 13:34:15 +08:00
Holger Hans Peter Freyther a4b446b459 [vty] Free the matched at the end of the routine.
Remove the return from the case labels and cleanup at
the end matched array at the end of the routine.
2010-04-30 13:29:34 +08:00
Holger Hans Peter Freyther f1af306c94 [vty] Plug memory leak on auto completion.
I assume the original code crashed with a double free as we
have a cleanup at the end of the method. Return from the routine
like the case label below. This is fixing a memory leak I am
experimenting.
2010-04-30 13:29:34 +08:00
Holger Hans Peter Freyther 1700c933f2 [vty] Allow to create a buffer in a given context.
Stop using the global vty context for all allocations
and allow to embed the buffer into a given context, and
allocate sub buffers with the context of its parent.
2010-04-30 13:29:34 +08:00
Holger Hans Peter Freyther 9e282de7c8 [vty] Move some allocations into the context of the vty. 2010-04-30 13:29:34 +08:00
Holger Hans Peter Freyther 22ca95cf9a [vty] Remove FIXME as it appears to do the right thing. 2010-04-30 13:29:33 +08:00
Sylvain Munaut 50f81b022f bsc_init: Fix ccch description in SI messages
The previous code just hardcoded RSL_BCCH_CCCH_CONF_1_C, but
we need to inspect the timeslot config to know what to use.

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2010-04-28 22:08:36 +02:00
Holger Hans Peter Freyther f51b9006a1 e1_input: Stop the timer when deleting the signalling link on the TS
Stop the tx_timer when deleting the link on top of that ts. Otherwise
bad things might happen. E.g. when scheduling a write on OML and then
the OML link vanishes...

This is a slight layering violation as there could be more than
one signalling link on the timeslot (at least in theory) so the
queue and the timer should move to the e1inp_sign_link.
2010-04-25 23:13:26 +08:00
Holger Hans Peter Freyther 4ac100ec24 [e1_input] When destroying a link clear all pending messages 2010-04-25 23:13:08 +08:00
Holger Hans Peter Freyther 95c229006e [vty] Allow to set the RACH NM attributes on a per BTS basis
Be able to tune the RACH settings of the BTS via the vty interface,
by default they are initialized to -1 which means we will use the
content of the static array (BTS default) and can be changed via
the VTY interface. I have verified the setting on the nanoBTS with
wireshark and I have tested writing the config file.
2010-04-25 23:08:39 +08:00
Holger Hans Peter Freyther d941edaca2 Merge branch 'on-waves/sccp' 2010-04-25 23:07:24 +08:00
Holger Hans Peter Freyther 277f035dee [sccp] Move from DEBUGP to LOGP in sccp.c 2010-04-25 23:05:00 +08:00
Holger Hans Peter Freyther 2cdda72b3c [sccp] Parse the error message and add a unit test for it. 2010-04-25 23:04:38 +08:00
Holger Hans Peter Freyther 637b4f6b7f Merge branch 'on-waves/mgcp' 2010-04-25 23:03:30 +08:00
Holger Hans Peter Freyther 32d4e50d46 [mgcp] Possible memleak fix for the allowed reallocation case
When allowing to reallocate an allocated endpoint we will need
to free it first. When freeing we will free the call id and other
ids that we would have leaked otherwise.
2010-04-25 23:02:55 +08:00
Holger Hans Peter Freyther dc41755fc7 [mgcp] Add a change callback and send a dummy packet on MDCX.
Send a dummy packet to make sure our Gateway will discover us
and can send the ringtone to us.
2010-04-25 23:02:43 +08:00
Holger Hans Peter Freyther aa9d3ce97a [mgcp] Ignore every dummy packet...
This routine should operate on different packets and the
dummy load is smaller than a legitimate RTP header so it
is unlikely we will filture out genuine traffic.

The reason is the dummy load might be send more than once.
2010-04-25 23:02:27 +08:00
Holger Hans Peter Freyther e3d16bb775 [mgcp] Protocol extension to not generate answers.
For the NAT we want to send requests in a send and forget
way and we are not interested in seeing the answers, so tell
the gateway to not answer them.
2010-04-25 23:02:17 +08:00
Holger Hans Peter Freyther 74076934fb [mgcp] Print a Deleted endpoint message again. 2010-04-25 23:02:05 +08:00
Holger Hans Peter Freyther b844b876ad [mgcp] Add a dummy send method...
This can be used by higher level code to send one dummy
message from the audio port to the network. This can be
used to make the remote discover the nated port of this
endpoint.
2010-04-25 23:01:55 +08:00
Harald Welte 38e9c82114 RSL: inmplement ip.access paging load indication 'below threshold'
This is an ip.access specific 08.58 oddity.  It reports 0xffff
available paging buffers if the paging load is below the 12.21
CCCH LOAD INDICATION THRESHOLD.

We use 50, since that is what it reports if the threshold == 0.
2010-04-19 10:29:16 +02:00
Harald Welte 39608dc045 GPRS: Fix calculation of 'Extension Length' in GPRS Cell Options
The actual 'Extension Length' field in the 'GPRS Cell Options' IE
is coded the length - 1, not the full length.  Without this fix,
the code has an off-by-one error.
2010-04-18 22:48:46 +02:00
Harald Welte 5fda90816f GPRS: Indicate the SGSN is Release 99 as this is the first with EDGE 2010-04-18 22:48:41 +02:00
Harald Welte 1803818092 update openbsc.cfg examples for new gprs syntax 2010-04-18 21:33:00 +02:00
Harald Welte 439bb828f9 GPRS: Enable EGPRS coding schemes in Cell Attributes if 'gprs mode egprs' 2010-04-18 21:25:56 +02:00
Harald Welte a06fea020d GPRS: actually enable indicating EDGE capability in SI13 2010-04-18 21:25:56 +02:00
Harald Welte 4511d891dd GPRS: change 'gprs enabled <0-1>' to 'gprs mode (none|gprs|egprs)'
This causes some config file breakage but sounds like a much cleaner
approach than to have two separate config variables for this.
2010-04-18 21:25:56 +02:00
Harald Welte da0586a838 GPRS: Add Support for the GPRS Cell Option Extension Info IE
Extension Information is part of the GPRS Cell Options IE, as
specified in Chapter 12.24 of TS 04.60.  It is needed for
indicating EDGE capabilities of the BTS to the MS.

This simply adds the code to encode this IE as part of SI13,
but does not actually use the code yet.
2010-04-18 21:25:56 +02:00
Harald Welte 2c57232489 add an example config file for nanoBTS multi-trx case 2010-04-18 21:25:18 +02:00
Harald Welte ad9f7830fb update the openbts.cfg.nanobts example 2010-04-18 21:08:26 +02:00
Harald Welte 57ba7e3093 GPRS: BVCI 0 and 1 are not permitted.
According to TS 08.18, BVCI=0 is for the SIGNALLING entity,
and BVCI=1 is for the PTM entity.  Both should not be used
by the PTP entity that we're configuring here.
2010-04-18 14:00:26 +02:00
Harald Welte 6ba3bcbbc6 BVCI 0 is not within the permitted range 2010-04-18 13:59:53 +02:00
Holger Hans Peter Freyther bb110f91e8 [statistics] Keep track of OML/RSL failures of the BTS. 2010-04-17 06:48:43 +02:00
Holger Hans Peter Freyther 3ba36d5b57 [statistics] Keep track of rf failures and rll release failures
Add two new counters to count the RF Failures and the RLL Release
failure and make them available via the vty interface.
2010-04-17 06:48:29 +02:00
Holger Hans Peter Freyther bda581963d Merge branch 'on-waves/mgcp' 2010-04-17 06:46:06 +02:00
Holger Hans Peter Freyther 8d9833ef83 [mgcp] Fix vty file generation for the BSC nat and other cases
The current setting was not properly written out, this commit is
fixing it. This includes indention, empty bts ip, wrong command
for endpoints and the wrong number (+1 as zero is allocated but
unused).
2010-04-17 06:45:08 +02:00
Holger Hans Peter Freyther 2ba40afc36 Add rf_locked to the configuration writing. 2010-04-17 06:42:48 +02:00
Holger Hans Peter Freyther e0ec326867 [vty] Separate BSC and MSC statistics. Make it easy to print them.
Move the statistics command into the MSC part and move the
BSC statistics printing into a subroutine.
2010-04-15 11:28:14 +02:00
Holger Hans Peter Freyther 2d425059af [mgcp] Only write audio_name/payload when it is actually set. 2010-04-15 11:26:35 +02:00
Holger Hans Peter Freyther 135f797a37 [bsc_init] When the RSL/OML connection drops, free all lchans
Free all allocated channels on the TRX that failed, go through
lchan_free to signal higher layers and then force a reset of
the channel. Make the TRX and TS unusable by setting the operational
set to 0 (not really defined) which should be reset once the
RSL is coming up again.
2010-04-15 11:24:53 +02:00
Holger Hans Peter Freyther f8eff2e4b5 [ipa] Fix the reporting of link down...
Now bsc_init.c is able to handle the link down messages.
2010-04-15 11:19:08 +02:00
Holger Hans Peter Freyther 70402a4e4d [ipa] Handle losing the RSL/OML connection..
This is addressing multiple issues regarding the loss of the
OML/RSL link to the BTS.

1.) When we lose the OML link, close down all RSL connections
on all TRXs (only tested with one TRX) and free the e1inp_line
allocated for the OML connection.
2.) When we lose the RSL link on any TRX and we know to which
lines this connection belongs, we will close down the OML connection
as we have a problem to just reactivate one RSL link.
3.) When we lose the RSL link on any TRX and we do not know
where it belongs to we will free the bfd we have allocated in the
rsl listen/accept method and we properly close the socket (i could
not test this one properly). This is made under the assumption
the BTS has not responded to the ID request.
4.) When we already have a bts->oml_link we will throw it away
and use the new link (it should not happen) and the same applies
to the rsl link.
2010-04-15 11:17:24 +02:00
Sylvain Munaut b54dda4cef ipaccess: Send RTP Payload IE for CRCX & MDCX
For GSM V1 FR, the payload type is fixed to 3 in the RFC.
But for the other codecs, the payload type is dynamically assigned
between 96 and 127. Here, we use a static mapping internal to OpenBSC.

This patch is needed to make a rather old 139 unit (with sw version
120a002_v149b42d0) work with something else than FR codec. I also tested
this patch on a newer 139 (with sw version 120a352_v267b22d0) to make
sure it didn't add a regression. More testing with newer EDGE units
should be done by whoever has some of theses.

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2010-04-12 19:58:57 +02:00
Sylvain Munaut b998d7b219 abis_nm: Fix ACTIVATE SW parameters
The previous code only sent the FILE_ID tag data part,
but according to the GSM 12.21 spec, section 8.3.6, the
full SW Description 'object' must be sent so that includes
the NM_ATT_SW_DESCR tag, the whole FILE_ID and the whole
FILE_VERSION (including tags & length fields).

Note that functionnaly on a nanoBTS 139 I couldn't see any
difference ... whatever I send in there it works ...

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2010-04-12 19:58:57 +02:00
Holger Hans Peter Freyther 63cb447fd5 Revert "ipa: Reduce the throttling of the IPA msges"
Reducing the throttling to this value created a regression with
bringing up RSL on the nanoBTS 900. We do seem to have a bug/issue
in the bsc_init code and might send a command too early without this
longer wait period and then the state transition does not happen.

For now it is agreed that reverting is the best thing to do.

Debugged-by: Sylvain Munaut <246tnt@gmail.com>

This reverts commit f5284ae1cf.
2010-04-11 10:14:16 +02:00
Holger Hans Peter Freyther 5eec9d91d8 [rsl] Set the right state when asking for the activation.
Set the state to activation to avoid a warning about the
getting a CHAN ACK without waiting for it. We set it in
the code to make sure it is set after all error checking
to avoid inconsistent state as the state is only set back
to NONE/ACT due replies from the BTS.
2010-04-10 00:16:04 +02:00
Holger Hans Peter Freyther 63d18b51a7 [rsl] Set the release state from within the lchan class
Currently our GSM04.11 code is closing the link for SAPI=3
and this would mean that the whole channel would be scheduled
for close... where we only want to close everything when freeing
the lchan or handling an error.
2010-04-10 00:14:55 +02:00
Holger Hans Peter Freyther 74419497fc [rsl] Introduce a method to set the state of the lchan
Setting the state through a dedicated method allows us to
track the state transitions and check if they are done in
a proper way.
2010-04-10 00:13:53 +02:00
Holger Hans Peter Freyther ccfd572647 [rsl] Remove method that is not called by anything. 2010-04-10 00:11:17 +02:00
Holger Hans Peter Freyther 07ba16fe03 [vty] Remove unused variables due them only being used in the layer3
I moved the extra code to the layer3 VTY implementation but didn't
remove the variables while doign so, silent compiler warnings.
2010-04-10 00:08:59 +02:00
Holger Hans Peter Freyther e1ffc08f72 [vty] Forward declare the extra init function the base is calling 2010-04-10 00:08:28 +02:00
Holger Hans Peter Freyther ef8117883b [paging] Include chan_alloc.h to silence a compiler warning
paging.c:259: warning: implicit declaration of function ‘trx_is_usable’
2010-04-10 00:06:17 +02:00
Holger Hans Peter Freyther ae80f9291a Return anything from append_lsa_params. 2010-04-10 00:05:16 +02:00
Holger Hans Peter Freyther 1469600b0d [paging] Start with a smaller paging limit...
The value 20 is just a random number and it really depends
on the number of TRX on a bts to be a sane or insane limit.
2010-04-10 00:01:03 +02:00
Holger Hans Peter Freyther c50b836540 [paging] Move code to use LOGP and print some more information 2010-04-10 00:00:51 +02:00
Holger Hans Peter Freyther 754e801826 [paging] Simplify the last request and treat llist as a queue
The current code was overly complex. It tried to iterate over
the list in a round robin and we had to keep track of the last
element, see if we remove that one, check if the list becomes
empty... This can all replaced by treating the double linked
list as a queue. We take the item at the front, do something
on it and then and then put it back to the list at the end.
2010-04-10 00:00:15 +02:00
Holger Hans Peter Freyther 19722d4411 paging: Avoid integer underflow on ipaccess
On the nanoBTS we do not receive any load indication for the
paging channel and we just decrement our available slots and
the unsigned int wraps to the maximum value. Together with a
not yet understood bug this makes us go amock.

For the nanoBTS and even the Siemens BS11 resetting the load
to 20 after two seconds should be just fine. For the nanoBTS
we would need to reset the 20 a lot more earlier but we need
to take a look at how often we run low.
2010-04-09 23:59:52 +02:00
Holger Hans Peter Freyther 5615b982c2 [mgcp] Improve the endpoint display on the vty..
Make sure one understands the two values for number of
incoming packets..
2010-04-09 23:53:08 +02:00
Holger Hans Peter Freyther aff596b8e1 [mgcp] Print the IP addr of the BTS we have detected. 2010-04-09 23:53:00 +02:00
Holger Hans Peter Freyther 07d838a3bf [paging] Do not use request after it was was destroyed..
Increment the counter before we call the remove request
which is freeing the request...
2010-04-08 17:10:37 +02:00
Holger Hans Peter Freyther d4e7888ae3 [paging] Increase the time used to send paging messages to the BTS
Send a Paging Request to the BTS every two seconds. This way it is
unlikely that a phone will try to respond to two paging requests as
it is currently happening.
2010-04-07 23:14:36 +02:00
Holger Hans Peter Freyther 6c8c0ddbe2 [ipa] When including MGCP our messages might be bigger than 300 byte
The length field of the IPA header allows to have 16bit numbers
and I just ran into the 300 byte limit with MGCP messages. Make it
three times the size and see how long this is going to be enough.
2010-04-07 23:10:38 +02:00
Holger Hans Peter Freyther 19bab73d79 [rsl] Speculative crash fix in the RSL rcv message
The theory is that the BTS is almost dead and sends out
a incomplete message and we crash with that. I have not
been able to completely verify that.
2010-04-07 23:09:21 +02:00
Holger Hans Peter Freyther c19a65baae Merge branch 'master' into on-waves/mgcp 2010-04-07 23:03:27 +02:00
Holger Hans Peter Freyther 1ea8dbec90 [mgcp] Fix navigation in the vty hierachy (make exit work)
Make exit from the MGCP node work properly.
2010-04-07 23:01:08 +02:00
Holger Hans Peter Freyther 500ff97c21 Fix compiler warning about void return in non void method. 2010-04-07 23:00:23 +02:00
Holger Hans Peter Freyther 441273766a [mgcp] Add the logging commands for the MGCP command. 2010-04-07 22:55:17 +02:00
Holger Hans Peter Freyther 014136da47 Merge branch 'on-waves/sccp' 2010-04-07 22:54:12 +02:00
Holger Hans Peter Freyther 91b5a31a2c Merge branch 'on-waves/mgcp' 2010-04-07 22:54:07 +02:00
Holger Hans Peter Freyther 575b89585f [mgcp] Print the errno/strerror when we can not receive from our socket 2010-04-07 22:52:40 +02:00
Holger Hans Peter Freyther 408cc4ace9 [mgcp] Add an option to allow using reallocing an endpoint
For some mode of operation it can be acceptable to reallocate
an already allocated endpoint. This can be the case when we
only deal with one call agent that is keeping track of the
endpoint but slightly confused.
2010-04-07 22:52:25 +02:00
Holger Hans Peter Freyther b4b135efbf [mgcp] Count incoming RTP packets from the BTS and remote 2010-04-07 22:51:59 +02:00
Holger Hans Peter Freyther 54fa799129 vty: Fix the byteorder... of the bound_ip
We are storing the bound_ip in host byteorder but when
using ntohl we need to convert it back to to network
byte order.
2010-04-07 22:51:37 +02:00
Holger Hans Peter Freyther 3c71232b11 [vty] Move the VTY logging commands to a new file
Currently vty_interface.c is used for the BSC config, in case of
the MGCP Gateway or the BSC Nat process these logging commands are
not available. Move the commands to a new vty_interface_cmds.c file
to allow to share basic commands across different programs.
2010-04-06 12:20:34 +02:00
Holger Hans Peter Freyther b4c7b274a1 [mgcp] Reset the the address when freeing the endp as well 2010-04-06 12:13:19 +02:00
Holger Hans Peter Freyther 7279d24232 [mgcp] Do not patch RTP payload when type is set to -1.
For the nat we might or might not want to patch it, do not
patch if we have no valid rtp payload type.
2010-04-06 12:12:52 +02:00
Holger Hans Peter Freyther ef8253c495 [mgcp] Use a different port to more easily differentiate 2010-04-05 22:04:23 +02:00
Holger Hans Peter Freyther 6c0729fe70 [mgcp] Print the BTS IP addr of the endpoint. 2010-04-05 22:04:15 +02:00
Holger Hans Peter Freyther e125d40f66 [mgcp] Start to look into the MGCP messages and extract the CI
we will need the call identifier for the MDCX and DLCX message
for now we were just assuming it would increment, use som python
to extract the CI from a possible response, also switch back to
a blocking read to test the BSC nat.
2010-04-05 22:04:07 +02:00
Holger Hans Peter Freyther 58df0ea9a0 [mgcp] Fix the transaction id of the AUEP request 2010-04-05 22:03:41 +02:00
Holger Hans Peter Freyther 8b120f0ef9 [mgcp] Look at the bts addr set at the endpoint
This will allow to discover the ports of a bts when we only know
the addr and have multiple bts's to handle.
2010-04-05 22:03:04 +02:00
Holger Hans Peter Freyther f2f1591ce7 [mgcp] Export header parsing via mgcp internal
This will be used by the NAT code to implement custom protocol
handling on top of that.
2010-04-05 22:02:54 +02:00
Holger Hans Peter Freyther f36a11a35d [mgcp] Do not operate on the ->data pointer, use ->l2h instead
This would have been broken once we attempt to parse encapsulated
MGCP messages.
2010-04-05 22:02:47 +02:00
Holger Hans Peter Freyther c77efdf057 [mgcp] Degrade verbosity to debug 2010-04-05 22:02:38 +02:00
Holger Hans Peter Freyther b79994c952 [mgcp] Add a new config option to set the call agent ip addr
In the case of the nat we only want to communicate with one
upstream call agent and this can now be configured.
2010-04-05 22:02:29 +02:00
Holger Hans Peter Freyther 616d222518 [mgcp] Add a helper function to convert from GSM0808 ts/mux to MGCP endpoint
Move the conversion of GSM0808 timeslot and multiplex from
the bssap.c into the mgcp.h so it can be reused by multiple
users. The weird math comes from the mapping of the MSC...
2010-04-05 22:02:16 +02:00
Holger Hans Peter Freyther 64e4e77558 [mgcp] Handle the RSIP with resetting all endpoints
We could change that the message came from a special ip
address/port to secure this service in general but we don't
do that right now.
2010-04-05 22:01:52 +02:00
Holger Hans Peter Freyther 9bdcc9ca75 [mgcp] Add some parsing for RSIP messages coming in
This will just call a callback and leave all the handling
to the application.
2010-04-05 22:01:44 +02:00
Holger Hans Peter Freyther e7d2ae69c9 [mgcp] Remove unused method from the mgcp
This was removed when sending the RSIP was
removed from the code.
2010-04-05 22:01:36 +02:00
Holger Hans Peter Freyther 52a66aa27e [mgcp] Switch from DEBUG to LOGP in the mgcp_main.c 2010-04-05 22:01:28 +02:00
Holger Hans Peter Freyther 13d67b7ea3 [mgcp] Remove the sending of RSIP
This message is ignored by the call agent and we were
sending this on the first request which we maybe should
not ignore...
2010-04-05 22:01:20 +02:00