Commit Graph

34 Commits

Author SHA1 Message Date
Harald Welte a6a20b4ff6 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 8645e101da libgb: move GPRS specific msgb CB definitions to separate header 2012-06-16 16:09:52 +08:00
Harald Welte ea34a4e3a7 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 a8a09df6a6 misc: Remove sys/types.h includes from the files
These are not needed any more. We used them for u_int
types but we now use uint which comes from stdint.h
2011-04-18 17:31:39 +02:00
Pablo Neira Ayuso 136f453dd2 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 f3956cbb20 [gb_proxy] vty: display the BVC BLOCKED status in 'show gbproxy' 2011-02-06 17:44:14 +01:00
Harald Welte fb9e06f310 [gb_proxy] make sure bssgp cell id is copied correctly
When we copy a msgb, we need to make sure the msgb_cb->bssgp_cell_id
pointer points to data in the new message, not in the old message.

Thanks to Dieter Spaar for spotting this.
2011-02-06 17:17:05 +01:00
Harald Welte c471d3d8a2 [gb proxy] treat BVCI=1 consistently like signalling
1 is reserved for point-to-multipoint data, i.e. not a point-to-point BVCI.
2011-02-06 17:13:12 +01:00
Harald Welte 5e106d7765 [gb_proxy] Convert a NS-BLOCK from BSS into BVC-RESET to SGSN
As we only have one NS-VC between gb_proxy and SGSN, we cannot
forward a NS-BLOCK from the BSS to the SGSN, as it would affect
all other BSS's, too.

Thus, we check if we have an unblocked PTP-BVC in the NSVC to the BSS,
and then issue a BVC-BLOCK towards the SGSN.

This should prevent any further PDU's from the SGSN to be sent to
this BSS.
2011-02-06 16:33:29 +01:00
Harald Welte 36f98d9c53 [gb_proxy] Track the state of blocked/unblocked BVC in the proxy
This allows us to reject any additional messages sent by the SGSN
after the BVC was blocked (+ acknowledged to be blocked)
2011-02-06 13:09:29 +01:00
Harald Welte 9af6ddfcec 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
Holger Hans Peter Freyther 85531cc60d misc: Once again go from "On Waves" to "On-Waves"..
Try to get the company name of our sponsor right...
2010-10-06 20:38:36 +08:00
Holger Hans Peter Freyther 62d97986a3 GPRS: Copy the content of the msgb instead of creating one that points to the other
Right now the memcpy with the data will copy data to itself as
the new_msg->data and msg->data are the same due the previous
copying of the header which included copying the list entry..

We allocate a message as big as the current one, then we have to
set all pointers by looking of how far they are away from the
msg->_data and add that to the new pointers.

Also copy the OpenBSC/GPRS specific CB data, also do the same
for calculating the offset to the data... At the end we should
end up with a copy...
2010-06-09 21:40:44 +08:00
Holger Hans Peter Freyther 62eaf54e7a GPRS: Fix crash when the peer can not be found...
Use UINT_MAX (or -1) if the peer can not be found.
2010-06-09 21:40:44 +08:00
Harald Welte 4b037e4117 Migrate VTY code to libosmovty 2010-05-25 23:40:38 +02: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 e4860d7c48 [GPRS] NS: Make sure we allocate NS packet with headroom for FR/GRE 2010-05-19 15:38:10 +02:00
Harald Welte 5540c4cbd3 [GPRS] Add Frame Relay in GRE encapsulation for NS 2010-05-19 14:38:50 +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 4cf12e9350 [GPRS] Gb Proxy: More verbose logging 2010-05-13 14:14:56 +02:00
Harald Welte 0ab535bfc3 [GPRS] Gb Proxy: Cosmetic fix of log message 2010-05-13 10:34:56 +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 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 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 72953b884d [gprs] Gb proxy: log level consolidation 2010-05-12 00:20:41 +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 e9ea26935e [gprs] gb_proxy: more verbose debugging 2010-05-11 20:20:13 +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 7fc9822a74 [gprs] Gb proxy: cosmetic cleanup 2010-05-11 10:15:42 +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 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
Harald Welte e236596bf4 [gprs] Move all GPRS related code to src/gprs subdirectory 2010-05-04 07:41:59 +02:00