Commit Graph

144 Commits

Author SHA1 Message Date
Harald Welte de4599cc35 libgb: make sure all BSSGP functions have bssgp_ prefix
We change the minority of functions employing the gprs_bssgp_ prefix to
match with the majority without gprs_ in front.
2012-06-17 13:05:48 +08:00
Harald Welte 8eda90d950 libgb/gprs: don't use log_info from libcommon anymore 2012-06-17 12:58:46 +08:00
Harald Welte f543036719 libgb: prefix all NS related functions with gprs_ 2012-06-17 12:38:07 +08:00
Harald Welte 15a36434e9 libgb: don't call directly into GMM / LLC layer
Instead of direct function calls to individual functions, we now
generate primitives (osmo_prim) and send them to one
application-provided function "bssgp_prim_cb()"
2012-06-17 12:17:22 +08:00
Harald Welte 8ef54d112c libgb: remove dependency of BSSGP to include sgsn/gmm internal structs 2012-06-17 09:31:16 +08:00
Harald Welte cca4963c58 libgb: Remove dependency to openbsc/debug.h 2012-06-16 17:53:38 +08:00
Harald Welte 4f5883bc6e libgb: remove dependencies to openbsc/vty.h and openbsc/gsm_data.h
Rather than using openbsc internal data/functions, we now use only
internal and libosmocore-provided ones.
2012-06-16 16:59:50 +08:00
Harald Welte 4fcdd76073 libgb: Use library SS_L_NS instead lf local SS_NS
which removes some further dependencies of libgb to openbsc internal
code and data.
2012-06-16 16:40:42 +08:00
Harald Welte 605ac5d1e7 libgb: move GPRS specific msgb CB definitions to separate header 2012-06-16 16:09:52 +08:00
Harald Welte 73952e3ab4 split libgb into a separate library for outside use
This also removes the dependency to osmo_sock() inside libcommon and
replaces it with osmo_sock_* from libosmocore
2012-06-16 15:14:00 +08:00
Holger Hans Peter Freyther 52746469ff misc: Use msgb_free for freeing the messages 2012-03-01 20:30:32 +01:00
Holger Hans Peter Freyther 58e6d96d68 abis: gsm_data_shared.h includes libosmo-abis header, add abis to cflags
gsm_data_shared.h includes e1_input.h of libosmo-abis, add the
LIBOSMOABIS_CFLAGS to Makefile.am, remove AM_LDFLAGS at the same
time as we only build .a archives.
2012-01-15 17:52:02 +01:00
Alexander Huemer 322f60aeb6 fix two mistakes in AM_LDFLAGS 2011-11-25 09:43:45 +01:00
Harald Welte 85fc31416b BSSGP: Add functions required for true BSS-side BSSGP implementation
The BSS-side of BSSGP requires quite a number of additional functions
for sending unidirectional messages that a SGSN never sends.

This is a first step into completing the BSSGP implementation and making
it ready to be used from osmo-bts and other BTS-side GPRS
implementations.
2011-11-25 08:58:40 +01:00
Harald Welte 2861007a40 GPRS: add new bssgp_create_cell_id(), opposite of bssgp_parse_cell_id() 2011-11-24 21:33:16 +01:00
Harald Welte a9f23c8291 GPRS NS: Add some doxygen API documentation 2011-11-24 21:33:16 +01:00
Holger Hans Peter Freyther 887934e28d gb_proxy: Make sure each parameter has some sort of documentation 2011-11-06 21:41:51 +01:00
Harald Welte 086fe32234 bssgp: make comments more explicit, include 'Rx' in received messages 2011-08-19 16:45:19 +02:00
Harald Welte d83d1b6a03 gprs_bssgp_util.c: orig_msg == NULL is not supported
we need it for deriving the NSEI anyway.

Detected by Smatch
2011-07-16 13:45:10 +02:00
Pablo Neira Ayuso 2b88a2a957 src: use namespace prefix osmo_signal*
Summary of changes:

s/signal_cbfn/osmo_signal_cbfn/g
s/register_signal_handler/osmo_signal_register_handler/g
s/unregister_signal_handler/osmo_signal_unregister_handler/g
s/dispatch_signal/osmo_signal_dispatch/g
2011-05-06 12:12:31 +02:00
Pablo Neira Ayuso bfadfb771d src: use namespace prefix osmo_fd* and osmo_select*
Summary of changes:

s/struct bsc_fd/struct osmo_fd/g
s/bsc_register_fd/osmo_fd_register/g
s/bsc_unregister_fd/osmo_fd_unregister/g
s/bsc_select_main/osmo_select_main/g
2011-05-06 12:11:23 +02:00
Pablo Neira Ayuso 2b15952a37 src: use namespace prefix osmo_timer* for timer functions
Summary of changes:

s/struct timer_list/struct osmo_timer_list/g
s/bsc_add_timer/osmo_timer_add/g
s/bsc_schedule_timer/osmo_timer_schedule/g
s/bsc_del_timer/osmo_timer_del/g
s/bsc_timer_pending/osmo_timer_pending/g
s/bsc_nearest_timer/osmo_timers_nearest/g
s/bsc_prepare_timers/osmo_timers_prepare/g
s/bsc_update_timers/osmo_timers_update/g
s/bsc_timer_check/osmo_timers_check/g
2011-05-06 12:11:06 +02:00
Pablo Neira Ayuso c0d04310f3 libcommon: socket: extend make_sock() prototype
This patch extends the make_sock() prototype so you can fully set
the fields priv_nr and data of the bsc_fd structure.

This is the first step to get rid of the internal make_sock()
implementation that ipaccess-proxy uses.

This patch includes a minor cleanup to pass INADDR_ANY instead
of zero, if you do not want to bind the socket to one specific
address.
2011-04-05 18:33:24 +02:00
Pablo Neira Ayuso 167281ec50 src: include new file osmocom/vty/misc.h for vty_out_rate_ctr_group()
This uses the new include file for vty_out_rate_ctr_group() which
available in libosmocore.
2011-03-28 20:01:03 +02:00
Pablo Neira Ayuso ff663237b5 src: use new library libosmogsm and new path to headers in libosmocore
libosmogsm is a new library that is distributed in the libosmocore.
Now, openbsc depends on it. This patch gets openbsc with this
change.

This patch also rewrites all include path to the new
osmocom/[gsm|core]

Signed-off-by: Pablo Neira Ayuso <pablo@gnumonks.org>
2011-03-23 18:17:56 +01:00
Harald Welte 85e109711d prefix sub-directories containing libraries with 'lib'
... and make sure tests work again after restructuring
2011-03-04 13:23:09 +01:00
Harald Welte 393becc8b8 Move 'Gb' protocol stack into its own src/gb subdirectory 2011-03-03 23:45:28 +01:00
Harald Welte 43ae94efcb LOGGING: make sure to make the 'logging filter' compatible with vty log cfg
Recent libosmocore introdues a way how log targets can be configured from
the VTY.

This commit makes the 'log filter (imsi|nsvc|bvc)' compatible with it.
2011-02-18 21:10:05 +01:00
Harald Welte e4cbb3f0f2 License change: We are now AGPLv3+ instead of GPLv2+
The reason for this is quite simple: We want to make sure anyone
running a customized version of OpenBSC to operate a network will
have to release all custom modifiations to the source code.
2011-01-01 15:39:34 +01:00
Dieter Spaar d2b13fceed Add mandatory routeing area IE to SUSPEND-NACK 2010-12-12 15:46:00 +01:00
Harald Welte f47df64a3b [GPRS NS] Fix memory leak in gprs_ns_sendmsg() error path
When gprs_ns_sendmsg() succeeds in sending the message, we free()d the
msgb after transmitting it on the socket.  However, if the NS-VC is
blocked or some other error condition exists, we returned an error
code but didn't free the msgb.

This resulted in an error leak which is now being addressed.
2010-08-09 21:15:40 +08:00
Harald Welte b73631455b [gprs] BSSGP: Fix null pointer dereference
Zecke has found this using "make CC="clang --analyze"
2010-07-23 22:00:45 +02:00
Harald Welte 0e43007f78 [SGSN] BSSGP: Print TLLI as hex value like everwhere else 2010-06-30 09:01:35 +02:00
Sylvain Munaut b00d1add75 [gprs] bssgp: Fix LLC PDU length encoding in BSSGP.
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2010-06-10 15:15:42 +02:00
Harald Welte 781b3e6905 [GPSR] SGSN: Keep traffic counters for each PDP context 2010-06-10 15:12:38 +02:00
Harald Welte 68b4f037e0 [GPRS] BSSGP/SGSN: Implement Gb-Interface Paging
We now have a function that generates BSSGP PS and CS paging request.

It is called from the libgtp code when we receive a GTP packet from
the GGSN for a MM context that is in SUSPEND state.  We then issue
a PS paging request to the Cell with the BVCI where the last RA update
was being performed.

TODO: We still don't enqueue the GTP packet (and transmit it on paging
complete), and we don't rate-limit the paging requests, i.e. every GTP packet
will trigger another paging request.

We probably also need some kind of logic that marks the phone as UNREGISTERED
if it doesn't respond to paging requests for some time.
2010-06-10 15:12:38 +02:00
Harald Welte 313cccf733 [GPRS] SGSN: Pass BSSGP SUSPEND/RESUME up to GMM and alter MMCTX state 2010-06-09 21:40:45 +08:00
Holger Hans Peter Freyther 8e2e78ecc2 GPRS: Fix compiler warning that will also lead to a crash at runtime. 2010-06-09 21:40:36 +08:00
Harald Welte cfb545aebb [GPRS] BSSGP: Fix formatting of BSSGP TX STATUS 2010-06-03 21:30:57 +02:00
Harald Welte 02f7325b9f [GPRS] Major LLC / TLLI handling fixes
* separate the LLME and LLE state in the LLC layer
* introduce gprs_llgmm_assign() function for LLGMM-ASSIGN.req primitive
* change QoS profile to match 'real' SGSN
* Update the new TLLI when assigning a P-TMSI

The result now is that the LLC layer is notified of TLLI changes, which in turn
means it doesn't allocate a new LLE structure every TLLI change, which again
in turn means that the UI frame sequence number does not reset to zero.

As a result, MS should no longer ignore frames based on wrong UI sequence number.
2010-06-01 11:57:13 +02:00
Harald Welte 2f94683320 [GPRS] Include IMSI and DRX params in BSSGP DL-UD
When we send a downlink unit-data request via BSSGP, there is a lot
of information that needs to be copied from the mm context, such as
the IMSI, DRX parametes, MS radio access parameters, ...

This is a quite strange layering violation, since we now need to pass
a pointer to the MM ctx from GMM through LLC into BSSGP :(
2010-05-31 22:12:30 +02:00
Harald Welte 1792532820 [GPRS] BSSGP: Fix way too long TLLI debug line 2010-05-31 20:18:35 +02:00
Harald Welte e9686b6428 [GPRS] BSSGP: More verbose debug log / error reporting 2010-05-31 18:07:17 +02:00
Harald Welte 2677ea547c [GPRS] BSSGP: When we receive a BLOCK, we should not respond with UNBLOCK-ACK 2010-05-31 17:16:36 +02:00
Harald Welte 9681ce359d [GPRS] NS: Fix GRE keepalive response in FR-GRE encapsulation 2010-05-31 11:02:57 +02:00
Harald Welte a8aa4df813 [GPRS] BSSGP: Acknowledge all SUSPEND and RESUME requests
This is of course not the correct way of dealing with it, but for
now it should make the Ericsson Mobile Plafrom based phones happy
(they insist to do a suspend/resume cycle before pdp ctx act)
2010-05-30 22:00:53 +02:00
Harald Welte bd33f3d0ef [GPRS] NS: correctly pass the NS payload length to the TLV parser 2010-05-30 17:19:38 +02:00
Harald Welte f15497c1a3 [GPRS] NS: Don't hand Frame Relay LMI packets into the NS code 2010-05-28 16:12:57 +02:00
Harald Welte 57a9cf2797 [GPRS] NS: Respond to GRE keepalive messages
GRE has the strange notion of keepalive messages being encapsulated IPv4
packets adressed back to the sender.  Since we actually really only care
about frame relay, this is a bit strange.  However, we'll do some sanity
checks and send it back through our GRE socket...
2010-05-28 16:06:53 +02:00
Harald Welte 188bda621a [GPRS] NS: Frame Relay DLCI for PVC from 16-1007
0 		Reserved for ANSI Annex D and CCITT Annex A link management
1 - 15 		Reserved
16 - 1007 	Any PVC
1008 - 1018 	Reserved
1019 - 1022 	Reserved for LMI multicast
1023 		Reserved for LMI link management
2010-05-28 14:11:49 +02:00