Harald Welte
71b822b986
Add ARFCN range check for GSM 850 band
...
This should make OpenBSC work with a nanoBTS in GSM 850 band.
2010-05-26 17:14:42 +02:00
Harald Welte
c31f480f08
[VTY] use new struct vty_app_info in libvty
2010-05-25 23:40:38 +02:00
Harald Welte
4b037e4117
Migrate VTY code to libosmovty
2010-05-25 23:40:38 +02:00
Harald Welte
4f1e81543a
[GPRS] NS: Always generate LOG_INFO message when we block NS-VC
2010-05-25 22:17:30 +02:00
Harald Welte
9ac340ef06
[GPRS] Use new 'encapsulation udp local-port 23000' in osmo_sgsn.cfg
2010-05-25 11:20:53 +02:00
Holger Hans Peter Freyther
fa848d4923
gprs: Cast the lh to uint_8* and make the other method non-const
...
We are assigning the header to non const methods... so make
the param non-const.
2010-05-23 21:43:57 +08:00
Holger Hans Peter Freyther
3a6fdcd717
gprs: make gprs_llc_hdr_dump return void.
2010-05-23 21:35:25 +08:00
Holger Hans Peter Freyther
4752e0c3de
gprs_llc.c: memset the llhp struct to be sure it is initialized.
2010-05-23 21:33:57 +08:00
Holger Hans Peter Freyther
d6ca49633c
gb_proxy_vty.c: Remove variable that appears to be unused
...
There is no other in_addr inside this file and it appears
that we don't use the 'ia' right now and will not use it
in the near future.
2010-05-23 21:25:41 +08:00
Holger Hans Peter Freyther
2fbf12dbeb
gprs_ns_frgre.h: Create the header and include it
2010-05-23 21:23:44 +08:00
Holger Hans Peter Freyther
cf4e9c8f07
gprs_ns.c: Make make_socket known to the compiler
2010-05-23 21:19:55 +08:00
Holger Hans Peter Freyther
83e0b3f544
gprs: Fix warnings on funny casts for the return statement
...
Change gprs_nsvc_reset to return void instead of a int
as the gb_proxy.c currently ignores the reutnr value anyway.
Change the caller inside gprs_ns to return the newly allocated
nsvc instead of the return of gprs_nsvc_reset.
2010-05-23 21:18:01 +08:00
Holger Hans Peter Freyther
9e28ecc325
gprs_bssgp.c: Return something from non void methods.
...
In one use the rc variable we are assigning to, in the
others return 0 even if we have a FIXME there.
2010-05-23 21:12:15 +08:00
Holger Hans Peter Freyther
2e22a5d85d
gprs_bssgp.c: Cast const of TLVP_VAL away.
...
Fix a compiler warning, we cast the const away at various
other parts in the code as well. We should consider removing
the const from the TLV struct..
2010-05-23 21:11:19 +08:00
Holger Hans Peter Freyther
cbac76ee0e
gsm_04_11: Include bsc_api.h for the dtap signature.
2010-05-23 21:05:18 +08:00
Holger Hans Peter Freyther
8f443710eb
bs11_config.c: Forward declare BTS init function
2010-05-23 21:05:01 +08:00
Holger Hans Peter Freyther
d92f9aff80
debug: Make GPRS params non-const to avoid compiler warning
...
Make log_set_nsvc_filter, log_set_bvc_filter take a non-const
parameter as we are going to assign it to a non-const pointer.
2010-05-23 20:59:55 +08:00
Holger Hans Peter Freyther
972c1f33b9
gprs: Disable strict aliasing as we are breaking the rules right now
2010-05-23 20:51:03 +08:00
Holger Hans Peter Freyther
aef49cc510
bsc_init: Do not use magic numbers for GSM 12.21 states.
2010-05-22 22:10:53 +08:00
Harald Welte
268bed07c0
[GPRS] Gb proxy VTY: Make sure all lines are aligned properly
2010-05-19 17:42:20 +02:00
Harald Welte
7570c21424
[GPRS] Gb Proxy: print only one line for every BVCI
2010-05-19 17:06:16 +02:00
Harald Welte
6624cae775
[GPRS] NS: Better formatting of VTY output
2010-05-19 17:02:57 +02:00
Harald Welte
94ac58e04e
[GPRS] NS: properly parse FR DLCI on Rx
2010-05-19 16:48:12 +02:00
Harald Welte
e72c61cc6f
[GPRS] NS: Never respond to STATUS with STATUS to prevent loops!
2010-05-19 16:01:39 +02:00
Harald Welte
ea92ac3777
[GPRS] NS: SOCK_RAW sockets always provide the full IPv4 header on receive
2010-05-19 15:53:22 +02:00
Harald Welte
ffe191c477
[GPRS] NS/FR/GRE rcvmsg case: msgb_free() in error case
2010-05-19 15:46:49 +02:00
Harald Welte
6efc176722
[GPRS] Make SGSN more verbose when startup fails
2010-05-19 15:46:31 +02:00
Harald Welte
e4860d7c48
[GPRS] NS: Make sure we allocate NS packet with headroom for FR/GRE
2010-05-19 15:38:10 +02:00
Harald Welte
3c2a88dfe4
[GPRS] NS: FR/GRE: Use AF_INET, correctly encode FR DLCI and GRE payload type
2010-05-19 15:37:34 +02:00
Harald Welte
ff3bde8b49
[GPRS] NS: VTY: Move all local ip/port bind values into 'ns' node
...
This removes the requirement for gb_proxy and sgsn to have duplicate
vty parsing code
2010-05-19 15:09:09 +02:00
Harald Welte
5540c4cbd3
[GPRS] Add Frame Relay in GRE encapsulation for NS
2010-05-19 14:38:50 +02:00
Harald Welte
3a318ab971
socket: Add support for GRE sockets
2010-05-19 14:11:38 +02:00
Harald Welte
7af4962e07
[SGSN] Gb Proxy: Simplify configuration
...
Almost all parameters about the SGSNs NS-VC can be specified in the NS
protocol node. All that needs to remain in the gbproxy config node
is "nsip sgsn nsei XXX".
2010-05-19 14:04:23 +02:00
Harald Welte
ab1d5626ac
[GPRS] SGSN: use GGSN IP address from config file, disable TMSI allocation
2010-05-18 19:58:38 +02:00
Harald Welte
119c2baaa6
[GPRS] SGSN: actually isert a ggsn context when we allocate it
2010-05-18 18:39:00 +02:00
Harald Welte
51537eef50
[GPRS] SGSN: Make sure libgtp timer doesn't segfault
2010-05-18 18:28:13 +02:00
Harald Welte
b4a3129993
[GPRS] SGSN: No need to calculate difference for libgtp timer
...
The libgtp return value is already a timespan value, not a
wallclock time.
2010-05-18 18:24:53 +02:00
Harald Welte
cd4dd4d7ff
[GPRS] fix numerous compiler warnings
2010-05-18 17:20:49 +02:00
Harald Welte
6463c0799c
[GPRS] SGSN: TMSI allocation
2010-05-18 17:04:55 +02:00
Harald Welte
4e38ac7a8a
[GPRS] SGSN: Correctly set upper 4 bits of PDP address to 0
...
It's really strange. In GTP those 4 bits are 1, in 04.08 they are
zero. Otherwise the IE is exactly the same :/
2010-05-18 14:51:18 +02:00
Harald Welte
269ae75321
[GPRS] SGSN: exit() if we cannot bind to the GTP address
2010-05-18 14:44:31 +02:00
Harald Welte
3c0b9b9c2a
[GPRS] SGSN: Make sure the PCO from GGSN are passed to the MS
2010-05-18 14:36:11 +02:00
Harald Welte
77289c202f
[GPRS] SGSN: properly delete a PDP context after receiving PDP CTX DEACT REQ
2010-05-18 14:32:29 +02:00
Harald Welte
55e0df7c43
[GPRS] SGSN: Don't use GGSN-provided QoS as the MS doesn't like it
2010-05-18 13:20:08 +02:00
Harald Welte
322a5ee954
[GPRS] SGSN: ensure we mark libgtp filedescriptors as READ
2010-05-18 13:13:11 +02:00
Harald Welte
d764c064bb
[GPRS] LLC: Fix logic to detect unknown TLLI/SAPI
2010-05-18 12:45:08 +02:00
Harald Welte
6ffbaab90d
[GPRS] SGSN: properly initialzie pdp_list head of mm ctx
2010-05-18 12:44:45 +02:00
Harald Welte
b61f403dd3
[GPRS] LLC: print human-readable LLC command type
2010-05-18 12:31:50 +02:00
Harald Welte
2e918a87eb
[GPRS] LLC: Add VTY interface for LLC
2010-05-18 12:22:12 +02:00
Harald Welte
68b99a4a08
[GPRS] fix null pointer dereference in GMM
2010-05-18 12:05:42 +02:00
Harald Welte
803bd5ceb2
[GPRS] BSSG: Fix Vty printing of BVC
2010-05-18 12:00:55 +02:00
Harald Welte
b3911a071b
[GPRS] BSSGP: Use correct values for SIGNALLING and PTM BVCI
2010-05-18 11:57:08 +02:00
Harald Welte
a7c262ad96
[GPRS] Make sure libsgsn.a is only built when libgtp is available
2010-05-18 11:00:52 +02:00
Harald Welte
8acd88f369
[GPRS] SGSN: Include rate counters in MM Context
2010-05-18 10:57:45 +02:00
Harald Welte
6abf94e420
[GPRS] Properly connect GPRS SM with LIBGTP for PDP context activation
...
* store LLC SAPI as part of PDP ctx
* store NSEI + BVCI as part of MM ctx
* export gsm48_tx_gsm_act_pdp_acc() and call it from sgsn_libgtp.c
* create and use gsm48_tx_gsm_act_pdp_rej for error cases
* print SAPI as part of VTY show pdp
2010-05-18 10:35:06 +02:00
Harald Welte
d2a9ed2285
[GPRS] SGSN: Activate BSSGP VTY functions
2010-05-18 08:02:36 +02:00
Harald Welte
03800ba868
[GPRS] Build osmo-sgsn only if libgtp is available
2010-05-18 00:20:21 +02:00
Harald Welte
d9a55f67ac
[GPRS] BSSGP: Add VTY for configuration and inpection
...
This also includes log filtering based on NSEI/BVCI tuple
2010-05-17 23:41:43 +02:00
Harald Welte
b1b290862a
[GPRS] BSSGP: Introduce packet/byte counters
2010-05-17 23:30:01 +02:00
Harald Welte
5fa2f44fa0
[GPRS] VTY: Add BSSGP node
2010-05-17 23:20:56 +02:00
Harald Welte
5c90e5cfc6
[GPRS] BSSGP: expose more internal structures / API
2010-05-17 23:02:42 +02:00
Harald Welte
ada466f2a7
[GPRS] BSSGP: Rename bssgp_bts_ctx to bssgp_bvc_ctx
...
The Context really is about a BVC (BSSGP Virtual Connection). In
the case we operate BSSGP on the SGSN side, this corresponds to
a link to a BTS.
2010-05-17 22:59:29 +02:00
Harald Welte
d193cb327a
[GPRS] More work on a real SGSN
2010-05-17 22:58:03 +02:00
Harald Welte
8fc1a46f28
[SGSN] remove the mmctx->sgsn pointer
...
We never want to support multiple sgsn's within one process, so
there is no point in passing them around all the time.
2010-05-17 00:53:10 +02:00
Harald Welte
2720e7310d
[GPRS] Initial untested support for libgtp
...
libgtp of the OpenGGSN project will allow us to speak the GTPv0/v1
protocol of the interface between SGSN and GGSN.
This commit includes code for the main libgtp integration (file
descriptor, select loop, timer) as well as code to encode/send
a CREATE PDP CONTEXT request.
2010-05-17 00:44:57 +02:00
Harald Welte
7363e92cd3
[GPRS] NS: Receiving a STATUS message is a NOTICEable event
2010-05-16 23:17:16 +02:00
Holger Hans Peter Freyther
394520a8fd
[sccp] Add method to create a dt1 packet.
2010-05-17 04:08:57 +08:00
Holger Hans Peter Freyther
f53a9d5471
[sccp] Create a method to create RLSD messages.
2010-05-17 04:08:50 +08:00
Holger Hans Peter Freyther
410422fb90
[sccp] Create a SCCP CC creation routine.
2010-05-17 04:08:42 +08:00
Harald Welte
5bc61dc384
VTY: separate VTY logging commands and OpenBSC node exit code
2010-05-16 22:02:16 +02:00
Harald Welte
7d9f2230a9
VTY: rename vty_interface.c to bsc_vty.c
...
This should reflect the fact that it contains BSC-specific VTY
commands.
2010-05-16 21:49:35 +02:00
Harald Welte
4f10c25ea8
VTY: Move BSC specific openbsc_vty_print_statistics() to vty_interface.c
2010-05-16 21:47:13 +02:00
Harald Welte
dcccb1818d
VTY: decouple telnet_interface from 'struct gsmnet'
...
We want the VTY and telnet code to be independent from the BSC
application(s). As a side note, we also like to eliminate static
global variables for 'struct gsm_network' all over the code.
As such, telnet_init() is now passed along a "private" pointer,
which getst stored in telnet_connection.priv. This telnet_connection
is then stored in vty->priv, which in turn gets dereferenced if
anyone needs a reference to 'struct gsm_network' from the BSC vty
code.
Also:
* vty_init() now calls cmd_init()
* the ugliness that telnet_init() calls back into the application by means of
bsc_vty_init() function has been removed.
* telnet_init() now returns any errors, so the main program can exit
e.g. if the port is already in use.
2010-05-16 20:52:23 +02:00
Harald Welte
88907a2f92
telnet: cosmetic coding style changes
2010-05-16 19:30:28 +02:00
Harald Welte
9a87ad923d
telnet: remove dead code
2010-05-16 19:29:51 +02:00
Harald Welte
20474ad029
VTY: use argv_concat() instead of vty_argv_to_buffer + buffer_getstr()
2010-05-16 19:28:32 +02:00
Harald Welte
08e2bfa920
VTY: remove accidentially enabled TELNET option debugging
2010-05-16 19:26:51 +02:00
Harald Welte
1353f961ef
VTY: pass program name, version and copyright to vty_init()
...
This enables us to make the VTY completely independent of any
compile-time program-specific information, i.e. one step closer
to using VTY as a shared library from multiple programs.
2010-05-16 19:20:24 +02:00
Harald Welte
3071d6aa7d
VTY: remove dead code
2010-05-16 17:24:03 +02:00
Harald Welte
00fd8b0e03
vty: use install_node_ve() instead of separate ENABLE and VIEW node installs
2010-05-16 17:09:08 +02:00
Harald Welte
9564715c24
VTY: Context-sensitive help for logging related commands
2010-05-16 00:00:04 +02:00
Harald Welte
8be8c8fec9
[GPRS] NS: Allow filtering of log messages by NSVC / NSEI
2010-05-15 23:52:02 +02:00
Harald Welte
3bac9a84ce
VTY / logging: Fix subscriber context / imsi filtering
...
The debug.c code had its own private CTX_ definitions that were
not synchronized with debug.h:BSC_CTX_* definitions.
2010-05-15 23:50:56 +02:00
Harald Welte
52613a114a
[GPRS] NS: VTY: Don't nsvc_delete() on 'no nse...'
...
Rather than deleting the NSE from memory, we simply mark it as non-persistent.
This makes sure that there are no invalid references (e.g. from gbprox_peer)
to the gprs_nsvc structure, but at the same time ensures it will no longer
be stored as part of writing the config file.
2010-05-15 23:06:26 +02:00
Harald Welte
55c91e411e
[GPRS] NS: Introduce command to display a single NSE
2010-05-15 23:04:03 +02:00
Harald Welte
ff56d61dc9
[GPRS] NS: Always start NS-ALIVE procedure after RESET
...
So far, we only started the ALIVE procedure on RESET-ACK if the
remote end was the SGSN. This resulted in the BSS->Proxy connections
only being tested for alive-status from the BSS side, but not from
our side.
Also: export nsvc_by_nsvci() function as a public API function.
2010-05-15 23:02:24 +02:00
Holger Hans Peter Freyther
b7b9c1d4d3
gsm48: Add a generic MI from classmark+mi extraction.
...
This is a generic MI extraction for the MI if it is followed
after a classmark. For the Phase1 Phones the classmark2 is not
four bytes but it might be different. This code can be used
by the CM Service Request handling as well.
2010-05-16 01:51:30 +08:00
Holger Hans Peter Freyther
f6903dee89
gsm48: Add size checks to the paging response mi parsing.
...
We go from no size checks to some content checking. We should
refactor the whole classmark2 + mi parsing that is used throughout
the code into one place with proper size checking. This is the
start and requires a new libosmocore as well.
2010-05-16 01:51:14 +08:00
Holger Hans Peter Freyther
ea504e7bdc
[sccp] Make it optional to send data on a SCCP Connection Refuse
...
This can be used to send a Location Updating Reject down to the
BSC when it is clear that a subscriber is not allowed.
2010-05-15 05:35:48 +08:00
Holger Hans Peter Freyther
7bf332a480
[sccp] Export function to create SCCP Refuse message.
2010-05-15 05:35:20 +08:00
Holger Hans Peter Freyther
5d65806472
gsm48: Typo fix.
2010-05-15 05:34:09 +08:00
Harald Welte
2832606e5c
VTY: More interactive help
2010-05-14 20:05:17 +02:00
Harald Welte
9ef9108025
[GPRS] NS: Add 'nsvc nsei ... (block|unblock|reset)' command to VTY
2010-05-14 19:36:59 +02:00
Harald Welte
54f7424b78
[VTY] Introduce "end" command that works from any level in config
...
Using "end" you can always return to the "enable" level, and from
there the "show" commands are available. So no more need for
exit/exit/exit/exit/disable.
2010-05-14 19:11:04 +02:00
Harald Welte
93e90207f9
[BSC] ARFCN 0 is legal in E-GSM
2010-05-14 19:00:52 +02:00
Harald Welte
62ab20c5dd
[VTY] Remove OpenBSC specific node-exit handling from src/vty
...
The idea is to move the VTY code into libosmocore at some point,
and for that we need to eliminate OpenBSC specifics from it
2010-05-14 18:59:17 +02:00
Harald Welte
197dea95ff
VTY: Introduce common code to add 'description' to objects like BTS
...
There is now an option to add a human-readable description to objects
that are configured in the VTY.
2010-05-14 18:05:41 +02:00
Harald Welte
d94d6a02d5
DB: don't use reserved "index" word in SQL table field name
2010-05-14 17:38:47 +02:00
Harald Welte
1ccbf44d79
[GPRS] gb_proxy: Initiate RESET procedure on persistent NS-VC at startup
...
Some BSS that connect to the proxy do not continue to perform the
RESET procedure after a timeout. In order to resurrect them, we
simply start a RESET procedure.
2010-05-14 11:53:08 +00:00
Harald Welte
768f2871a5
[GPRS] Gb_proxy: Support common command line arguments
...
This allows us to use a user-specified configuration file
2010-05-14 11:22:33 +00:00
Harald Welte
2b36ae1a3d
[GPRS] BSSGP: Refuse blocking of signalling BVC; Ignore traffic on blocked BVC
2010-05-13 21:45:23 +02:00
Harald Welte
3a1bece69c
[GPRS] BSSGP: Make implementation more robust
...
We now actually are much more in line with what the specification
says. We track the blocked/unblocked state, we don't accept
signalling messages on PTP functional entities (and vice versa),
and we don't simply create a BVC context with messages other than
BVC-RESET.
2010-05-13 21:29:11 +02:00
Harald Welte
1b170d1145
[GPRS] LLC: Start using different log levels
2010-05-13 21:29:11 +02:00
Harald Welte
c6ecafe60c
[GPRS] LLC: Use DLLC instead of DGPRS
2010-05-13 21:29:11 +02:00
Harald Welte
b2e49186ef
[GPRS] Add debug sections for LLC and SNDCP
2010-05-13 21:29:11 +02:00
Harald Welte
f47dc0b58c
[GPRS] BSSGP: Elaborate more on FIXMEs
...
And fix mistake regarding FLUSH-LL / FLUSH-LL-ACK direction
2010-05-13 21:29:11 +02:00
Harald Welte
24c9fc1700
[GPRS] Rename gsm_04_08_gprs.c to gprs_gmm.c
...
GMM refers to GPRS Mobility Management.
2010-05-13 21:29:11 +02:00
Harald Welte
1ae09c7bd6
[GPRS] LLC: Improve implementation compliance to spec
...
Don't allocate a LLC Entity just because BSSGP passes any random
SAPI/TLLI up to us. We can only do this for XID and UI frames
of the GMM SAPI.
Furthermore, add more comments and debug messages.
2010-05-13 21:29:11 +02:00
Holger Hans Peter Freyther
e15ad48a82
ipaccess-config: Silence compiler warning.
2010-05-14 02:54:40 +08:00
Holger Hans Peter Freyther
6fc8791dbf
[misc] Silence compiler warning...
...
If someone tries to set the type to unknown he should know
what he is doing, just silence the warning.
2010-05-14 02:53:22 +08:00
Holger Hans Peter Freyther
42993c26e0
Forward declare make_socket.
2010-05-14 02:49:39 +08:00
Holger Hans Peter Freyther
b5be7ac39c
[mgcp] Make show mgcp available in both modes.
2010-05-14 02:45:52 +08:00
Holger Hans Peter Freyther
7373109abc
Merge branch 'master' into on-waves/mgcp
2010-05-14 02:42:15 +08:00
Holger Hans Peter Freyther
c1cb5eb38d
[mgcp] Clean up VTY code, the ranges are checked by the VTY code.
2010-05-14 02:39:51 +08:00
Holger Hans Peter Freyther
1384af6522
[mgcp] Use A.B.C.D for the ip addresses inside the vty config
...
Make the vty code parse the ip addresses for us and validate
them for us.
2010-05-14 02:39:42 +08:00
Holger Hans Peter Freyther
b3c206aa34
[mgcp] Improve the language of the comments.
2010-05-14 02:39:33 +08:00
Holger Hans Peter Freyther
b715d7f890
[mgcp] Include stdlib.h for abs.
2010-05-14 02:39:16 +08:00
Holger Hans Peter Freyther
cf5cc5bb5b
[vty] Add power measurements to the one line summary.
2010-05-14 02:09:23 +08:00
Holger Hans Peter Freyther
3d6a5d648e
[vty] Add a one line show lchan summary command.
2010-05-14 02:08:49 +08:00
Holger Hans Peter Freyther
029235ea96
[vty] Move "show lchan" into a parameterized method
...
I want to have a shorter lchan summary but with the same
config parameters. Change the current code to be a method
that takes a dump routine as parameter.
2010-05-14 02:03:16 +08:00
Holger Hans Peter Freyther
b8819bb845
[vty] Remove unfinished code from the VTY...
2010-05-14 02:01:48 +08:00
Holger Hans Peter Freyther
7b90d4a83b
rach: Allow to set the emergency call bit
...
Add the rach emergency call allowed (0|1) setting and implement
it by directly manipulating the t2 value. It is the third bit which
is set to 0 when emergency calls are enabled and to one if it is
only enabled for access classes 11 to 15.
2010-05-14 00:48:43 +08:00
Holger Hans Peter Freyther
3a0a463fa4
rach: Allow to set the emergency call bit
...
Add the rach emergency call allowed (0|1) setting and implement
it by directly manipulating the t2 value. It is the third bit which
is set to 0 when emergency calls are enabled and to one if it is
only enabled for access classes 11 to 15.
2010-05-14 00:48:09 +08:00
Harald Welte
3863e04918
[GPRS] NS: Remove 'unknown_nsvc' from list of NS-VCs
2010-05-13 14:20:56 +02:00
Harald Welte
4cf12e9350
[GPRS] Gb Proxy: More verbose logging
2010-05-13 14:14:56 +02:00
Harald Welte
9aa97fc137
[GPRS] NS: Fix segfault when receiving message from unknown NS-VC
...
In the previous code we used a static fake_nsvc structure in
case we needed to send a message to an unknown NSVC for which
we don't have a real 'struct nsvc'. However, since we now have
a rate_ctr_group hanging off the nsvc, the fake structure didn't
have that.
So now we keep a nsi->unknown_nsvc around to be used whenever
we need a nsvc but don't have a real one. The gprs_ns_vty.c
code explicitly does not list that NSVC in 'show ns'
2010-05-13 14:00:59 +02:00
Harald Welte
a6fd8f2339
[GPRS] NS: remove debug statement about l2len
2010-05-13 13:09:01 +02:00
Harald Welte
c191986691
[GPRS] NS: more rate counters for BLOCK / DEAD count
2010-05-13 12:55:20 +02:00
Harald Welte
73b2359fb0
[GPRS] NS: Show statistics on VTY only if requested
2010-05-13 12:32:30 +02:00
Harald Welte
e183345748
[GPRS] NS: properly assign msgb->l2h to count outgoing bytes correctly
2010-05-13 12:18:49 +02:00
Harald Welte
8e605b045e
[GPRS] NS: Fix wrong counter use and remove debug statement
2010-05-13 11:57:44 +02:00
Harald Welte
89deee9b99
Add missing file vty/utils.c
2010-05-13 11:53:52 +02:00
Harald Welte
66f793a770
[GPRS] SGSN: Add Signal handler and NS VTY support
2010-05-13 11:50:04 +02:00
Harald Welte
f2b4cd7b86
[GPRS] NS: Start to use rate_ctr_group code from libosmocore
...
Every NS-VC now has a set of counters for incoming and outgoing
number of packets and bytes.
We also split the VTY part of the gprs_ns.c implementation into gprs_ns_vty.c
to make sure the protocol can actually be used without the VTY code being
present.
2010-05-13 11:45:07 +02:00
Harald Welte
0ab535bfc3
[GPRS] Gb Proxy: Cosmetic fix of log message
2010-05-13 10:34:56 +02:00
Harald Welte
6df0c5187b
GPRS: Gb proxy memory leak debugging with SIGUSR
2010-05-12 20:53:42 +02:00
Harald Welte
8272c77231
GPRS: We have to do the msgb_free() in NS not Gb Proxy
...
As only NS-UNITDATA messages are ever passed into the Gb Proxy,
we need to do the msgb_free() at a much higher point in the calling
stack, i.e. inside the NS protocol layer. This means it is now
the same logic as in OpenBSC itself.
2010-05-12 20:53:42 +02:00
Harald Welte
22229d6841
Fix missing #include preventing compilation of vty_interface.c
2010-05-12 20:28:04 +02:00
Harald Welte
39d0bb5f7c
Gb Proxy: Proper msgb memory management
...
The old idea was to take a msgb from gbprox_rcvmsg() and then
modify it and finally send it all the way down to nsip_sendmsg()
to the remote peer.
However, this introduces memory management difficulties, as we then
have to distinguish three cases:
* msgb was sent to a remote peer
* we sent some error message and need to free the msgb
* we need to make n-1 copies in case of a BSSVC-RESET from the SGSN
So instead we now simply always copy the message if we pass it on.
All messages received by gbprox_rcvmsg() are msgb_free()d in the very
same routine
All messages allocated by tx2peer() or tx2sgsn() are freed after
nsip_sendmsg()
2010-05-12 20:22:55 +02:00
Harald Welte
ea4647d264
NS: Make all timers configurable from VTY
2010-05-12 20:22:55 +02:00
Harald Welte
995a2d36da
use new install_element_ve()
2010-05-12 20:22:55 +02:00
Holger Hans Peter Freyther
d6adf5e098
ipaccess: Make sure flashing of the secondary BTS is working
...
Use the TRX throughout the flash process.
2010-05-13 00:42:02 +08:00
Holger Hans Peter Freyther
64278ede35
sw_load: Specify the trx_nr for the software load
...
For the multi TRX setup we will need to specify the right trx->nr
to be able to flash the BTS. For the BS11 case we are ignoring the
additional argument.
2010-05-13 00:41:48 +08:00
Holger Hans Peter Freyther
52fd4e4395
ipaccess: Send the reset to the BASEBAND_TRANSC and supply TRX
...
Send the IPA Restart to a given BTS/TRX, change the signal callbacks
to carry the trx instead of the BTS so we have an easy access to the
right TRX and change the ipaccess-config to use that TRX. This is
fixing the restart with a multi TRX setup.
Even if we have the msg->trx, use the gsm_bts_trx_by_nr and get
the TRX from the fom header. This is because the OpenBSC and the
BTS numbering might not match for the multi TRX case.
2010-05-13 00:41:30 +08:00
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
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
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