mirror of
https://gitea.osmocom.org/cellular-infrastructure/osmo-mgw.git
synced 2025-11-02 13:03:33 +00:00
Compare commits
294 Commits
openbsc/0.
...
openbsc/0.
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3f78600346 | ||
|
|
76afa16d04 | ||
|
|
8b29180cad | ||
|
|
1af682adb9 | ||
|
|
f876c39887 | ||
|
|
e1145cf0f9 | ||
|
|
e972dba8dd | ||
|
|
9b5192b153 | ||
|
|
f4be327b4c | ||
|
|
63b0e44f65 | ||
|
|
456fccf697 | ||
|
|
b02fc1e9bb | ||
|
|
75e13a41dc | ||
|
|
647db848e3 | ||
|
|
ce1d742f27 | ||
|
|
af33e1d3a1 | ||
|
|
0a7c6a3549 | ||
|
|
883fbc9d04 | ||
|
|
dc030960fc | ||
|
|
3d119f1de4 | ||
|
|
e30d40de0e | ||
|
|
e7ea08379e | ||
|
|
1590727b64 | ||
|
|
c5e0851054 | ||
|
|
b862cef60d | ||
|
|
6a85c15eea | ||
|
|
b5a4edd09b | ||
|
|
d4d1d5e751 | ||
|
|
9e1952a901 | ||
|
|
164ee307b2 | ||
|
|
69665f8722 | ||
|
|
7d10983865 | ||
|
|
2a896070a7 | ||
|
|
036b25fb7f | ||
|
|
c7de8ef014 | ||
|
|
431ceada36 | ||
|
|
25eca0bfdc | ||
|
|
23446844a8 | ||
|
|
7b6ea56f41 | ||
|
|
baa1a2df20 | ||
|
|
ed0374ffeb | ||
|
|
ba36bf4c5d | ||
|
|
30a3d2f0fe | ||
|
|
4babba62b8 | ||
|
|
3749dc93a3 | ||
|
|
f2621e506d | ||
|
|
608ac2a8a4 | ||
|
|
bac7dcc367 | ||
|
|
75077955e9 | ||
|
|
25aa749f10 | ||
|
|
ff799f0912 | ||
|
|
0b19d55dd6 | ||
|
|
c7db4dce4a | ||
|
|
d5edc4f84d | ||
|
|
83d2d38a3c | ||
|
|
ea46b77f3e | ||
|
|
aa191adce6 | ||
|
|
1f8276e588 | ||
|
|
0434faedc9 | ||
|
|
184950e298 | ||
|
|
bdf764a025 | ||
|
|
adc2e87372 | ||
|
|
6fbd864a65 | ||
|
|
6ecb3cb599 | ||
|
|
b9b828b1e5 | ||
|
|
b5ae7288a9 | ||
|
|
1c201c6055 | ||
|
|
bfbdeec714 | ||
|
|
4d62d63151 | ||
|
|
4d2a68cf11 | ||
|
|
39c31dea2e | ||
|
|
01c13a3a45 | ||
|
|
11c1b6e014 | ||
|
|
977cd13741 | ||
|
|
0c282f5268 | ||
|
|
324c8052ae | ||
|
|
4173b174eb | ||
|
|
56260b648c | ||
|
|
cf77b3a2cf | ||
|
|
c121bb3188 | ||
|
|
006e3d87e0 | ||
|
|
48ea4e8aec | ||
|
|
6e300682df | ||
|
|
4485321219 | ||
|
|
7d0f60dce6 | ||
|
|
b348939d86 | ||
|
|
638da51a78 | ||
|
|
9d50a27695 | ||
|
|
8582535c82 | ||
|
|
960c4044e6 | ||
|
|
93599a2c2c | ||
|
|
d66777f9cf | ||
|
|
5ca825e431 | ||
|
|
1411c066cc | ||
|
|
10049bc3b7 | ||
|
|
3e9b2ec257 | ||
|
|
405824c057 | ||
|
|
25b70cea9d | ||
|
|
0e0a09c610 | ||
|
|
3a41b80bd7 | ||
|
|
2f25747e3f | ||
|
|
bce5675e5f | ||
|
|
c751cf92cb | ||
|
|
408208d887 | ||
|
|
5ea1bc77a3 | ||
|
|
7e7ee5f8c6 | ||
|
|
1bf6610ce7 | ||
|
|
ce55361e93 | ||
|
|
29de346b32 | ||
|
|
a769dcb889 | ||
|
|
cf2f158caa | ||
|
|
d267f4d685 | ||
|
|
0d904e004a | ||
|
|
01d315f19c | ||
|
|
3d4d79d890 | ||
|
|
d2361d970a | ||
|
|
f589221ed0 | ||
|
|
b3089e437d | ||
|
|
383d3c33e6 | ||
|
|
c5903a2b01 | ||
|
|
536a10b63b | ||
|
|
bc6c43f759 | ||
|
|
f7396eac2f | ||
|
|
07dec137de | ||
|
|
70ae5d3000 | ||
|
|
6d818839a9 | ||
|
|
8d0be259cb | ||
|
|
0d0c9ec5c5 | ||
|
|
c6483683eb | ||
|
|
b8a1f967c5 | ||
|
|
c0de14da8f | ||
|
|
e07b6a77e5 | ||
|
|
338e3b3b4b | ||
|
|
eff4094950 | ||
|
|
366c33185b | ||
|
|
0a1a312311 | ||
|
|
6c7680d726 | ||
|
|
1a2993adb7 | ||
|
|
9122c13933 | ||
|
|
874f9f1aa7 | ||
|
|
8a1b056bff | ||
|
|
9ad0362429 | ||
|
|
4dbcdad903 | ||
|
|
e94db49698 | ||
|
|
d4bdee79e9 | ||
|
|
f1033cc752 | ||
|
|
90d7f26f67 | ||
|
|
eedb45362d | ||
|
|
98da544992 | ||
|
|
88c06bcd64 | ||
|
|
cb306a689e | ||
|
|
30690adbc8 | ||
|
|
38e02c5125 | ||
|
|
769912c9e9 | ||
|
|
1e85af661c | ||
|
|
ed3a661d0b | ||
|
|
0bf15a8187 | ||
|
|
2e8e659586 | ||
|
|
952f752ffa | ||
|
|
2a60a11c48 | ||
|
|
de1674ab02 | ||
|
|
75172124e7 | ||
|
|
3dfe8a1705 | ||
|
|
e2f34d588c | ||
|
|
93fda87cf8 | ||
|
|
e0b5972d30 | ||
|
|
f3a317ceed | ||
|
|
e600eed7fa | ||
|
|
6b55f603e3 | ||
|
|
7456891439 | ||
|
|
cb3c2c95bf | ||
|
|
07fc097fc4 | ||
|
|
aff20717e4 | ||
|
|
511f9c3e4a | ||
|
|
d49eb74732 | ||
|
|
2ee7ecddeb | ||
|
|
94c2b0578b | ||
|
|
c15d0ac8dd | ||
|
|
d9173c3fce | ||
|
|
8936d00587 | ||
|
|
becc89a98e | ||
|
|
778695d0b4 | ||
|
|
221ff66327 | ||
|
|
bf0a7c97be | ||
|
|
34203bd487 | ||
|
|
9ceea68ba9 | ||
|
|
ca5d211113 | ||
|
|
31b245b91a | ||
|
|
cbaa880ae8 | ||
|
|
18fa70aa3a | ||
|
|
210565ed8c | ||
|
|
c11889f3dd | ||
|
|
f67d9a9bed | ||
|
|
644b0bf3da | ||
|
|
076af1c54b | ||
|
|
354c87cdfc | ||
|
|
8b902d74cf | ||
|
|
8c176cc6ab | ||
|
|
ffd6856249 | ||
|
|
7a7c2f8567 | ||
|
|
806d6549f8 | ||
|
|
6dc6910b79 | ||
|
|
6088f149b5 | ||
|
|
65924a5fe8 | ||
|
|
11620111f4 | ||
|
|
d08ad7d6d9 | ||
|
|
ebe22375a6 | ||
|
|
7aa4f0a263 | ||
|
|
fa0ec157af | ||
|
|
a5352a0174 | ||
|
|
47b5b3eeb2 | ||
|
|
5e95f45af0 | ||
|
|
5ff06af6f5 | ||
|
|
d5eb431c47 | ||
|
|
adcde9f8f5 | ||
|
|
47824541f0 | ||
|
|
ad2946ce03 | ||
|
|
d79da3baac | ||
|
|
721f0325b5 | ||
|
|
114a010c33 | ||
|
|
6fc4a98fc5 | ||
|
|
f3b31eb349 | ||
|
|
4dd84ff7c2 | ||
|
|
8c3d0695e4 | ||
|
|
d98136d25c | ||
|
|
a5050b14c9 | ||
|
|
86f240aded | ||
|
|
79c34ffb4f | ||
|
|
4c889a5c49 | ||
|
|
0818f31144 | ||
|
|
240a828ffd | ||
|
|
037065deee | ||
|
|
e422798866 | ||
|
|
bb53e3577a | ||
|
|
9fc70f365a | ||
|
|
6fcac63cc0 | ||
|
|
b561459dd6 | ||
|
|
6e7d137e79 | ||
|
|
3d610e63cc | ||
|
|
dd68fcaeee | ||
|
|
010c9551ff | ||
|
|
a73ca05db6 | ||
|
|
570ce24deb | ||
|
|
e555c2b545 | ||
|
|
57e0724ed4 | ||
|
|
4ab9d7c012 | ||
|
|
13fe21939c | ||
|
|
d13e0cd6db | ||
|
|
cfaabbb21e | ||
|
|
fe568f235f | ||
|
|
df49a983e2 | ||
|
|
b7b6cf5695 | ||
|
|
f42e908cea | ||
|
|
602559fd9f | ||
|
|
4552d8061a | ||
|
|
59043d8c94 | ||
|
|
9b5db287c6 | ||
|
|
1a6b83c919 | ||
|
|
bc6a54dadc | ||
|
|
d028807658 | ||
|
|
64c17fa598 | ||
|
|
3217fa2412 | ||
|
|
70f9205cd9 | ||
|
|
ae1d010220 | ||
|
|
fdf453c0a9 | ||
|
|
7b022eed2d | ||
|
|
45f9171175 | ||
|
|
25cf824edc | ||
|
|
153b13b02e | ||
|
|
8c00496e42 | ||
|
|
ad66a2d150 | ||
|
|
f383aa11a5 | ||
|
|
0c1bd61bb3 | ||
|
|
019f913ca3 | ||
|
|
c95175fb88 | ||
|
|
edcba4e307 | ||
|
|
b46d566559 | ||
|
|
d24566ac6e | ||
|
|
ce95b27b68 | ||
|
|
11461a6457 | ||
|
|
e6599ee180 | ||
|
|
b1fd9022eb | ||
|
|
faa70ff2c6 | ||
|
|
0d5e8e0b56 | ||
|
|
68d85d5610 | ||
|
|
fdd8b3b40d | ||
|
|
a6a20b4ff6 | ||
|
|
8645e101da | ||
|
|
ea34a4e3a7 | ||
|
|
704cb8680b | ||
|
|
67161f27d1 | ||
|
|
66d360661a | ||
|
|
f25b55ec71 | ||
|
|
c513ded578 |
1
debian/autoreconf
vendored
Normal file
1
debian/autoreconf
vendored
Normal file
@@ -0,0 +1 @@
|
||||
openbsc
|
||||
61
debian/changelog
vendored
Normal file
61
debian/changelog
vendored
Normal file
@@ -0,0 +1,61 @@
|
||||
openbsc (0.12.0+git26-7) unstable; urgency=low
|
||||
|
||||
* 64bit fix for the MGCP rewriting
|
||||
|
||||
-- Holger Hans Peter Freyther <holger@freyther.de> Wed, 07 Nov 2012 11:39:34 +0100
|
||||
|
||||
openbsc (0.12.0+git26-6) precise; urgency=low
|
||||
|
||||
* Added init script for osmocom-sgsn.
|
||||
|
||||
-- Eric Butler <eric@codebutler.com> Fri, 24 Aug 2012 21:04:32 -0700
|
||||
|
||||
openbsc (0.12.0+git26-5) precise; urgency=low
|
||||
|
||||
* Don't enable MNCC sock by default.
|
||||
* Automatically create important directories.
|
||||
* Fix init script 'stop' command.
|
||||
|
||||
-- Eric Butler <eric@codebutler.com> Fri, 24 Aug 2012 20:56:33 -0700
|
||||
|
||||
openbsc (0.12.0+git26-4) precise; urgency=low
|
||||
|
||||
* Specify HLR path and enable RTP proxy.
|
||||
|
||||
-- Eric Butler <eric@codebutler.com> Mon, 20 Aug 2012 00:21:07 -0700
|
||||
|
||||
openbsc (0.12.0+git26-3) precise; urgency=low
|
||||
|
||||
* Fix init script.
|
||||
|
||||
-- Eric Butler <eric@codebutler.com> Sun, 19 Aug 2012 16:05:44 -0700
|
||||
|
||||
openbsc (0.12.0+git26-2) precise; urgency=low
|
||||
|
||||
* Fix libdbi package dependency.
|
||||
|
||||
-- Eric Butler <eric@codebutler.com> Wed, 15 Aug 2012 00:35:37 -0700
|
||||
|
||||
openbsc (0.12.0+git26-1) precise; urgency=low
|
||||
|
||||
* Fix version issue.
|
||||
|
||||
-- Eric Butler <eric@codebutler.com> Tue, 14 Aug 2012 21:00:51 -0700
|
||||
|
||||
openbsc (0.12.0+git26) precise; urgency=low
|
||||
|
||||
* Updated ubuntu package.
|
||||
|
||||
-- Eric Butler <eric@codebutler.com> Tue, 14 Aug 2012 17:36:51 -0700
|
||||
|
||||
openbsc (0.9.13.115.eb113-1) natty; urgency=low
|
||||
|
||||
* New upstream release
|
||||
|
||||
-- Harald Welte <laforge@gnumonks.org> Wed, 11 May 2011 18:41:24 +0000
|
||||
|
||||
openbsc (0.9.4-1) unstable; urgency=low
|
||||
|
||||
* Initial release (Closes: #nnnn) <nnnn is the bug number of your ITP>
|
||||
|
||||
-- Harald Welte <laforge@gnumonks.org> Tue, 24 Aug 2010 13:34:24 +0200
|
||||
0
openbsc/debian/compat → debian/compat
vendored
0
openbsc/debian/compat → debian/compat
vendored
4
openbsc/debian/control → debian/control
vendored
4
openbsc/debian/control → debian/control
vendored
@@ -2,7 +2,7 @@ Source: openbsc
|
||||
Section: net
|
||||
Priority: optional
|
||||
Maintainer: Harald Welte <laforge@gnumonks.org>
|
||||
Build-Depends: debhelper (>= 7.0.0~), autotools-dev, pkg-config, libgtp, libosmocore-dev, libosmo-sccp-dev, libdbi0-dev
|
||||
Build-Depends: debhelper (>= 7.0.0~), autotools-dev, pkg-config, libgtp-dev, libosmocore-dev, libosmo-sccp-dev, libdbi0-dev, dh-autoreconf, libosmo-abis-dev, libdbd-sqlite3
|
||||
Standards-Version: 3.8.4
|
||||
Homepage: http://openbsc.osmocom.org/
|
||||
Vcs-Git: git://bs11-abis.gnumonks.org/openbsc.git
|
||||
@@ -15,7 +15,7 @@ Description: GSM Base Station Controller; BSC-only version of OpenBSC. Needs a
|
||||
|
||||
Package: osmocom-nitb
|
||||
Architecture: any
|
||||
Depends: ${shlibs:Depends}, ${misc:Depends}, libosmocore, libdbd-sqlite3, libdbi0
|
||||
Depends: ${shlibs:Depends}, ${misc:Depends}, libosmocore, libdbd-sqlite3, libdbi1
|
||||
Description: GSM Network-in-a-Box, implements BSC, MSC, SMSC, HLR, VLR
|
||||
|
||||
Package: osmocom-ipaccess-utils
|
||||
0
openbsc/debian/docs → debian/docs
vendored
0
openbsc/debian/docs → debian/docs
vendored
1
debian/osmocom-bsc.examples
vendored
Normal file
1
debian/osmocom-bsc.examples
vendored
Normal file
@@ -0,0 +1 @@
|
||||
openbsc/doc/examples/osmo-bsc_mgcp
|
||||
8
debian/osmocom-nitb.default
vendored
Normal file
8
debian/osmocom-nitb.default
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
CONFIG_FILE="/etc/osmocom/osmo-nitb.cfg"
|
||||
HLR_FILE="/var/lib/osmocom/hlr.sqlite3"
|
||||
|
||||
DAEMON_ARGS="-P"
|
||||
|
||||
# Uncomment if using LCR+Asterisk
|
||||
# DAEMON_ARGS="-m -P"
|
||||
|
||||
3
debian/osmocom-nitb.dirs
vendored
Normal file
3
debian/osmocom-nitb.dirs
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
/etc/osmocom
|
||||
/var/log/osmocom
|
||||
/var/lib/osmocom
|
||||
1
debian/osmocom-nitb.examples
vendored
Normal file
1
debian/osmocom-nitb.examples
vendored
Normal file
@@ -0,0 +1 @@
|
||||
openbsc/doc/examples/osmo-nitb
|
||||
@@ -15,18 +15,16 @@
|
||||
|
||||
# PATH should only include /usr/* if it runs after the mountnfs.sh script
|
||||
PATH=/sbin:/usr/sbin:/bin:/usr/bin
|
||||
DESC=osmo-nitb # Introduce a short description here
|
||||
NAME=osmo-nitb # Introduce the short server's name here
|
||||
DAEMON=/usr/sbin/osmo-nitb # Introduce the server's location here
|
||||
DAEMON_ARGS="-D" # Arguments to run the daemon with
|
||||
PIDFILE=/var/run/$NAME.pid
|
||||
SCRIPTNAME=/etc/init.d/$NAME
|
||||
NAME=osmo-nitb # Introduce the short server's name here
|
||||
DESC="Osmocom GSM Network-in-a-Box" # Introduce a short description here
|
||||
DAEMON=/usr/bin/osmo-nitb # Introduce the server's location here
|
||||
SCRIPTNAME=/etc/init.d/osmocom-nitb
|
||||
|
||||
# Exit if the package is not installed
|
||||
[ -x $DAEMON ] || exit 0
|
||||
|
||||
# Read configuration variable file if it is present
|
||||
[ -r /etc/default/$NAME ] && . /etc/default/$NAME
|
||||
[ -r /etc/default/osmocom-nitb ] && . /etc/default/osmocom-nitb
|
||||
|
||||
# Load the VERBOSE setting and other rcS variables
|
||||
. /lib/init/vars.sh
|
||||
@@ -35,7 +33,7 @@ SCRIPTNAME=/etc/init.d/$NAME
|
||||
# Depend on lsb-base (>= 3.0-6) to ensure that this file is present.
|
||||
. /lib/lsb/init-functions
|
||||
|
||||
DAEMON_ARGS="$DAEMON_ARGS -c $CONFIG_FILE"
|
||||
DAEMON_ARGS="$DAEMON_ARGS -D -c $CONFIG_FILE -l $HLR_FILE"
|
||||
|
||||
#
|
||||
# Function that starts the daemon/service
|
||||
@@ -46,9 +44,9 @@ do_start()
|
||||
# 0 if daemon has been started
|
||||
# 1 if daemon was already running
|
||||
# 2 if daemon could not be started
|
||||
start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $DAEMON --test > /dev/null \
|
||||
start-stop-daemon --start --quiet --exec $DAEMON --test > /dev/null \
|
||||
|| return 1
|
||||
start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $DAEMON -- \
|
||||
start-stop-daemon --start --quiet --exec $DAEMON -- \
|
||||
$DAEMON_ARGS \
|
||||
|| return 2
|
||||
# Add code here, if necessary, that waits for the process to be ready
|
||||
@@ -66,7 +64,7 @@ do_stop()
|
||||
# 1 if daemon was already stopped
|
||||
# 2 if daemon could not be stopped
|
||||
# other if a failure occurred
|
||||
start-stop-daemon --stop --quiet --retry=TERM/30/KILL/5 --pidfile $PIDFILE --name $NAME
|
||||
start-stop-daemon --stop --quiet --retry=TERM/30/KILL/5 --name $NAME
|
||||
RETVAL="$?"
|
||||
[ "$RETVAL" = 2 ] && return 2
|
||||
# Wait for children to finish too if this is a daemon that forks
|
||||
@@ -77,8 +75,6 @@ do_stop()
|
||||
# sleep for some time.
|
||||
start-stop-daemon --stop --quiet --oknodo --retry=0/30/KILL/5 --exec $DAEMON
|
||||
[ "$?" = 2 ] && return 2
|
||||
# Many daemons don't delete their pidfiles when they exit.
|
||||
rm -f $PIDFILE
|
||||
return "$RETVAL"
|
||||
}
|
||||
|
||||
@@ -91,7 +87,7 @@ do_reload() {
|
||||
# restarting (for example, when it is sent a SIGHUP),
|
||||
# then implement that here.
|
||||
#
|
||||
start-stop-daemon --stop --signal 1 --quiet --pidfile $PIDFILE --name $NAME
|
||||
start-stop-daemon --stop --signal 1 --quiet $PIDFILE --name $NAME
|
||||
return 0
|
||||
}
|
||||
|
||||
2
debian/osmocom-sgsn.default
vendored
Normal file
2
debian/osmocom-sgsn.default
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
CONFIG_FILE="/etc/osmocom/osmo-sgsn.cfg"
|
||||
|
||||
150
debian/osmocom-sgsn.init
vendored
Executable file
150
debian/osmocom-sgsn.init
vendored
Executable file
@@ -0,0 +1,150 @@
|
||||
#!/bin/sh
|
||||
### BEGIN INIT INFO
|
||||
# Provides: osmo-sgsn
|
||||
# Required-Start: $network $local_fs
|
||||
# Required-Stop:
|
||||
# Default-Start: 2 3 4 5
|
||||
# Default-Stop: 0 1 6
|
||||
# Short-Description: Osmocom Serving GPRS Support Node
|
||||
# Description: Osmocom Serving GPRS Support Node
|
||||
### END INIT INFO
|
||||
|
||||
# Author: Harald Welte <laforge@gnumonks.org>
|
||||
|
||||
# PATH should only include /usr/* if it runs after the mountnfs.sh script
|
||||
PATH=/sbin:/usr/sbin:/bin:/usr/bin
|
||||
NAME=osmo-sgsn # Introduce the short server's name here
|
||||
DESC="Osmocom Serving GPRS Support Node" # Introduce a short description here
|
||||
DAEMON=/usr/bin/osmo-sgsn # Introduce the server's location here
|
||||
SCRIPTNAME=/etc/init.d/osmocom-sgsn
|
||||
|
||||
# Exit if the package is not installed
|
||||
[ -x $DAEMON ] || exit 0
|
||||
|
||||
# Read configuration variable file if it is present
|
||||
[ -r /etc/default/osmocom-sgsn ] && . /etc/default/osmocom-sgsn
|
||||
|
||||
# Load the VERBOSE setting and other rcS variables
|
||||
. /lib/init/vars.sh
|
||||
|
||||
# Define LSB log_* functions.
|
||||
# Depend on lsb-base (>= 3.0-6) to ensure that this file is present.
|
||||
. /lib/lsb/init-functions
|
||||
|
||||
DAEMON_ARGS="$DAEMON_ARGS -D -c $CONFIG_FILE"
|
||||
|
||||
#
|
||||
# Function that starts the daemon/service
|
||||
#
|
||||
do_start()
|
||||
{
|
||||
# Return
|
||||
# 0 if daemon has been started
|
||||
# 1 if daemon was already running
|
||||
# 2 if daemon could not be started
|
||||
start-stop-daemon --start --quiet --exec $DAEMON --test > /dev/null \
|
||||
|| return 1
|
||||
start-stop-daemon --start --quiet --exec $DAEMON -- \
|
||||
$DAEMON_ARGS \
|
||||
|| return 2
|
||||
# Add code here, if necessary, that waits for the process to be ready
|
||||
# to handle requests from services started subsequently which depend
|
||||
# on this one. As a last resort, sleep for some time.
|
||||
}
|
||||
|
||||
#
|
||||
# Function that stops the daemon/service
|
||||
#
|
||||
do_stop()
|
||||
{
|
||||
# Return
|
||||
# 0 if daemon has been stopped
|
||||
# 1 if daemon was already stopped
|
||||
# 2 if daemon could not be stopped
|
||||
# other if a failure occurred
|
||||
start-stop-daemon --stop --quiet --retry=TERM/30/KILL/5 --name $NAME
|
||||
RETVAL="$?"
|
||||
[ "$RETVAL" = 2 ] && return 2
|
||||
# Wait for children to finish too if this is a daemon that forks
|
||||
# and if the daemon is only ever run from this initscript.
|
||||
# If the above conditions are not satisfied then add some other code
|
||||
# that waits for the process to drop all resources that could be
|
||||
# needed by services started subsequently. A last resort is to
|
||||
# sleep for some time.
|
||||
start-stop-daemon --stop --quiet --oknodo --retry=0/30/KILL/5 --exec $DAEMON
|
||||
[ "$?" = 2 ] && return 2
|
||||
return "$RETVAL"
|
||||
}
|
||||
|
||||
#
|
||||
# Function that sends a SIGHUP to the daemon/service
|
||||
#
|
||||
do_reload() {
|
||||
#
|
||||
# If the daemon can reload its configuration without
|
||||
# restarting (for example, when it is sent a SIGHUP),
|
||||
# then implement that here.
|
||||
#
|
||||
start-stop-daemon --stop --signal 1 --quiet $PIDFILE --name $NAME
|
||||
return 0
|
||||
}
|
||||
|
||||
case "$1" in
|
||||
start)
|
||||
[ "$VERBOSE" != no ] && log_daemon_msg "Starting $DESC " "$NAME"
|
||||
do_start
|
||||
case "$?" in
|
||||
0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;
|
||||
2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;
|
||||
esac
|
||||
;;
|
||||
stop)
|
||||
[ "$VERBOSE" != no ] && log_daemon_msg "Stopping $DESC" "$NAME"
|
||||
do_stop
|
||||
case "$?" in
|
||||
0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;
|
||||
2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;
|
||||
esac
|
||||
;;
|
||||
status)
|
||||
status_of_proc "$DAEMON" "$NAME" && exit 0 || exit $?
|
||||
;;
|
||||
#reload|force-reload)
|
||||
#
|
||||
# If do_reload() is not implemented then leave this commented out
|
||||
# and leave 'force-reload' as an alias for 'restart'.
|
||||
#
|
||||
#log_daemon_msg "Reloading $DESC" "$NAME"
|
||||
#do_reload
|
||||
#log_end_msg $?
|
||||
#;;
|
||||
restart|force-reload)
|
||||
#
|
||||
# If the "reload" option is implemented then remove the
|
||||
# 'force-reload' alias
|
||||
#
|
||||
log_daemon_msg "Restarting $DESC" "$NAME"
|
||||
do_stop
|
||||
case "$?" in
|
||||
0|1)
|
||||
do_start
|
||||
case "$?" in
|
||||
0) log_end_msg 0 ;;
|
||||
1) log_end_msg 1 ;; # Old process is still running
|
||||
*) log_end_msg 1 ;; # Failed to start
|
||||
esac
|
||||
;;
|
||||
*)
|
||||
# Failed to stop
|
||||
log_end_msg 1
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
*)
|
||||
#echo "Usage: $SCRIPTNAME {start|stop|restart|reload|force-reload}" >&2
|
||||
echo "Usage: $SCRIPTNAME {start|stop|status|restart|force-reload}" >&2
|
||||
exit 3
|
||||
;;
|
||||
esac
|
||||
|
||||
:
|
||||
27
openbsc/debian/rules → debian/rules
vendored
27
openbsc/debian/rules → debian/rules
vendored
@@ -13,19 +13,18 @@
|
||||
# Uncomment this to turn on verbose mode.
|
||||
#export DH_VERBOSE=1
|
||||
|
||||
# This has to be exported to make some magic below work.
|
||||
export DH_OPTIONS
|
||||
|
||||
# this requires debhelper 7.0.50 or above, which lenny doesn't have yet!
|
||||
#override_dh_auto_configure:
|
||||
# dh_auto_configure -- --enable-nat --enable-osmo-bsc
|
||||
|
||||
build: build-stamp
|
||||
build-stamp:
|
||||
dh build --before configure
|
||||
dh_auto_configure -- --enable-nat --enable-osmo-bsc
|
||||
dh build --after configure
|
||||
touch build-stamp
|
||||
DEBIAN := $(shell dpkg-parsechangelog | grep ^Version: | cut -d' ' -f2)
|
||||
DEBVERS := $(shell echo '$(DEBIAN)' | cut -d- -f1)
|
||||
VERSION := $(shell echo '$(DEBVERS)' | sed -e 's/[+-].*//' -e 's/~//g')
|
||||
|
||||
%:
|
||||
dh $@
|
||||
dh --sourcedirectory=openbsc --with autoreconf $@
|
||||
|
||||
# This is needed for debian stable (squeeze)
|
||||
override_dh_autoreconf:
|
||||
cd openbsc && autoreconf --install --force
|
||||
|
||||
override_dh_auto_configure:
|
||||
echo $(VERSION) > openbsc/.tarball-version
|
||||
dh_auto_configure --sourcedirectory=openbsc -- --enable-nat --enable-osmo-bsc
|
||||
|
||||
1
debian/source/format
vendored
Normal file
1
debian/source/format
vendored
Normal file
@@ -0,0 +1 @@
|
||||
3.0 (native)
|
||||
7
openbsc/.gitignore
vendored
7
openbsc/.gitignore
vendored
@@ -1,4 +1,5 @@
|
||||
*.o
|
||||
*.lo
|
||||
*.a
|
||||
.deps
|
||||
Makefile
|
||||
@@ -11,17 +12,22 @@ src/osmo-bsc_mgcp/osmo-bsc_mgcp
|
||||
src/osmo-bsc/osmo-bsc
|
||||
*.*~
|
||||
*.sw?
|
||||
.libs
|
||||
|
||||
#configure
|
||||
aclocal.m4
|
||||
autom4te.cache/
|
||||
config.log
|
||||
config.status
|
||||
config.guess
|
||||
config.sub
|
||||
configure
|
||||
depcomp
|
||||
install-sh
|
||||
missing
|
||||
stamp-h1
|
||||
libtool
|
||||
ltmain.sh
|
||||
|
||||
# git-version-gen magic
|
||||
.tarball-version
|
||||
@@ -52,6 +58,7 @@ tests/sccp/sccp_test
|
||||
tests/sms/sms_test
|
||||
tests/timer/timer_test
|
||||
tests/gprs/gprs_test
|
||||
tests/abis/abis_test
|
||||
|
||||
tests/atconfig
|
||||
tests/atlocal
|
||||
|
||||
@@ -19,32 +19,38 @@ dnl checks for libraries
|
||||
AC_SEARCH_LIBS(crypt, crypt,
|
||||
[LIBCRYPT="-lcrypt"; AC_DEFINE([VTY_CRYPT_PW], [], [Use crypt functionality of vty.])])
|
||||
|
||||
PKG_CHECK_MODULES(LIBOSMOCORE, libosmocore >= 0.5.3.60)
|
||||
PKG_CHECK_MODULES(LIBOSMOVTY, libosmovty >= 0.3.0)
|
||||
PKG_CHECK_MODULES(LIBOSMOGSM, libosmogsm >= 0.6.0)
|
||||
PKG_CHECK_MODULES(LIBOSMOABIS, libosmoabis >= 0.1.0)
|
||||
PKG_CHECK_MODULES(LIBOSMOGB, libosmogb >= 0.5.2)
|
||||
|
||||
# Enabke/disable the NAT?
|
||||
AC_ARG_ENABLE([nat], [AS_HELP_STRING([--enable-nat], [Build the BSC NAT. Requires SCCP])],
|
||||
[
|
||||
[osmo_ac_build_nat="$enableval"],[osmo_ac_build_nat="no"])
|
||||
if test "$osmo_ac_build_nat" = "yes" ; then
|
||||
PKG_CHECK_MODULES(LIBOSMOSCCP, libosmo-sccp >= 0.0.2)
|
||||
osmo_ac_build_nat="yes"
|
||||
],
|
||||
[
|
||||
osmo_ac_build_nat="no"
|
||||
])
|
||||
fi
|
||||
AM_CONDITIONAL(BUILD_NAT, test "x$osmo_ac_build_nat" = "xyes")
|
||||
AC_SUBST(osmo_ac_build_nat)
|
||||
|
||||
# Enable/disable the BSC?
|
||||
AC_ARG_ENABLE([osmo-bsc], [AS_HELP_STRING([--enable-osmo-bsc], [Build the Osmo BSC])],
|
||||
[
|
||||
PKG_CHECK_MODULES(LIBOSMOSCCP, libosmo-sccp >= 0.0.6)
|
||||
osmo_ac_build_bsc="yes"
|
||||
],
|
||||
[
|
||||
osmo_ac_build_bsc="no"
|
||||
])
|
||||
[osmo_ac_build_bsc="$enableval"])
|
||||
if test "$osmo_ac_build_bsc" = "yes" ; then
|
||||
PKG_CHECK_MODULES(LIBOSMOSCCP, libosmo-sccp >= 0.0.6)
|
||||
fi
|
||||
AM_CONDITIONAL(BUILD_BSC, test "x$osmo_ac_build_bsc" = "xyes")
|
||||
|
||||
PKG_CHECK_MODULES(LIBOSMOCORE, libosmocore >= 0.3.2)
|
||||
PKG_CHECK_MODULES(LIBOSMOVTY, libosmovty >= 0.3.0)
|
||||
PKG_CHECK_MODULES(LIBOSMOGSM, libosmogsm >= 0.3.0)
|
||||
PKG_CHECK_MODULES(LIBOSMOABIS, libosmoabis >= 0.1.0)
|
||||
# Enable/disable smpp support in the nitb?
|
||||
AC_ARG_ENABLE([smpp], [AS_HELP_STRING([--enable-smpp], [Build the SMPP interface])],
|
||||
[osmo_ac_build_smpp="$enableval"])
|
||||
if test "$osmo_ac_build_smpp" = "yes" ; then
|
||||
PKG_CHECK_MODULES(LIBSMPP34, libsmpp34 >= 1.10)
|
||||
AC_DEFINE(BUILD_SMPP, 1, [Define if we want to build SMPP])
|
||||
fi
|
||||
AM_CONDITIONAL(BUILD_SMPP, test "x$osmo_ac_build_smpp" = "xyes")
|
||||
|
||||
|
||||
found_libgtp=yes
|
||||
PKG_CHECK_MODULES(LIBGTP, libgtp, , found_libgtp=no)
|
||||
@@ -128,17 +134,17 @@ AC_OUTPUT(
|
||||
src/osmo-bsc_mgcp/Makefile
|
||||
src/ipaccess/Makefile
|
||||
src/utils/Makefile
|
||||
src/libgb/Makefile
|
||||
src/gprs/Makefile
|
||||
tests/Makefile
|
||||
tests/atlocal
|
||||
tests/debug/Makefile
|
||||
tests/gsm0408/Makefile
|
||||
tests/db/Makefile
|
||||
tests/channel/Makefile
|
||||
tests/bsc-nat/Makefile
|
||||
tests/mgcp/Makefile
|
||||
tests/gprs/Makefile
|
||||
tests/si/Makefile
|
||||
tests/abis/Makefile
|
||||
doc/Makefile
|
||||
doc/examples/Makefile
|
||||
Makefile)
|
||||
|
||||
57
openbsc/contrib/dump_all_docs.py
Executable file
57
openbsc/contrib/dump_all_docs.py
Executable file
@@ -0,0 +1,57 @@
|
||||
#!/usr/bin/env python
|
||||
|
||||
"""
|
||||
Start the process and dump the documentation to the doc dir. This is
|
||||
copied from the BTS directory and a fix might need to be applied there
|
||||
too.
|
||||
"""
|
||||
|
||||
import socket, subprocess, time,os
|
||||
|
||||
|
||||
def dump_doc(end, port, filename):
|
||||
sck = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
|
||||
sck.setblocking(1)
|
||||
sck.connect(("localhost", port))
|
||||
sck.recv(4096)
|
||||
|
||||
# Now send the command
|
||||
sck.send("show online-help\r")
|
||||
xml = ""
|
||||
while True:
|
||||
data = sck.recv(4096)
|
||||
xml = "%s%s" % (xml, data)
|
||||
if data.endswith(end):
|
||||
break
|
||||
|
||||
# Now write everything until the end to the file
|
||||
out = open(filename, 'w')
|
||||
out.write(xml[18:len(end)*-1])
|
||||
out.close()
|
||||
|
||||
|
||||
apps = [
|
||||
# The same could be done with an empty config file but this way
|
||||
# the example files are properly tested.
|
||||
(4242, "src/osmo-nitb/osmo-nitb", "doc/examples/osmo-nitb/nanobts/openbsc.cfg", "OpenBSC", "nitb"),
|
||||
(4242, "src/osmo-bsc/osmo-bsc", "doc/examples/osmo-bsc/osmo-bsc.cfg", "OsmoBSC", "bsc"),
|
||||
(4243, "src/osmo-bsc_mgcp/osmo-bsc_mgcp", "doc/examples/osmo-bsc_mgcp/mgcp.cfg", "OpenBSC MGCP", "mgcp"),
|
||||
(4244, "src/osmo-bsc_nat/osmo-bsc_nat", "doc/examples/osmo-bsc_nat/osmo-bsc_nat.cfg", "OsmoBSCNAT", "nat"),
|
||||
(4245, "src/gprs/osmo-sgsn", "doc/examples/osmo-sgsn/osmo-sgsn.cfg", "OsmoSGSN", "sgsn"),
|
||||
(4246, "src/gprs/osmo-gbproxy", "doc/examples/osmo-gbproxy/osmo-gbproxy.cfg", "OsmoGbProxy", "gbproxy"),
|
||||
]
|
||||
|
||||
# Dump the config of all our apps
|
||||
for app in apps:
|
||||
print "Starting app for %s" % app[4]
|
||||
|
||||
cmd = [app[1], "-c", app[2]]
|
||||
proc = subprocess.Popen(cmd, stdin=None, stdout=None)
|
||||
time.sleep(1)
|
||||
try:
|
||||
dump_doc('\r\n%s> ' % app[3], app[0], 'doc/%s_vty_reference.xml' % app[4])
|
||||
finally:
|
||||
# Clean-up
|
||||
proc.kill()
|
||||
proc.wait()
|
||||
|
||||
18
openbsc/contrib/hlr-remove-old.sql
Normal file
18
openbsc/contrib/hlr-remove-old.sql
Normal file
@@ -0,0 +1,18 @@
|
||||
-- Remove old data from the database
|
||||
DELETE FROM Subscriber
|
||||
WHERE id != 1 AND datetime('now', '-10 days') > updated AND authorized != 1;
|
||||
DELETE FROM Equipment
|
||||
WHERE datetime('now', '-10 days') > updated;
|
||||
DELETE FROM EquipmentWatch
|
||||
WHERE datetime('now', '-10 days') > updated;
|
||||
DELETE FROM SMS
|
||||
WHERE datetime('now', '-10 days') > created;
|
||||
DELETE FROM VLR
|
||||
WHERE datetime('now', '-10 days') > updated;
|
||||
DELETE FROM ApduBlobs
|
||||
WHERE datetime('now', '-10 days') > created;
|
||||
DELETE FROM Counters
|
||||
WHERE datetime('now', '-10 days') > timestamp;
|
||||
DELETE FROM RateCounters
|
||||
WHERE datetime('now', '-10 days') > timestamp;
|
||||
VACUUM;
|
||||
@@ -3,54 +3,15 @@ Simple UDP replay from the state files
|
||||
"
|
||||
|
||||
PackageLoader fileInPackage: #Sockets.
|
||||
FileStream fileIn: 'rtp_replay_shared.st'.
|
||||
|
||||
|
||||
Eval [
|
||||
| last_time last_image udp_send socket dest |
|
||||
| replay |
|
||||
|
||||
last_time := nil.
|
||||
last_image := nil.
|
||||
file := FileStream open: 'rtp_ssrc13529910.240.240.1_to_10.240.240.50.state'.
|
||||
|
||||
"Send the payload"
|
||||
dest := Sockets.SocketAddress byName: '127.0.0.1'.
|
||||
socket := Sockets.DatagramSocket new.
|
||||
udp_send := [:payload | | datagram |
|
||||
datagram := Sockets.Datagram data: payload contents address: dest port: 4000.
|
||||
socket nextPut: datagram
|
||||
].
|
||||
replay := RTPReplay on: 'rtp_ssrc6976010.240.240.1_to_10.240.240.50.state'.
|
||||
|
||||
[file atEnd] whileFalse: [
|
||||
| lineStream time data now_image |
|
||||
lineStream := file nextLine readStream.
|
||||
|
||||
"Read the time, skip the blank, parse the data"
|
||||
time := Number readFrom: lineStream.
|
||||
lineStream skip: 1.
|
||||
|
||||
data := WriteStream on: (ByteArray new: 30).
|
||||
[lineStream atEnd] whileFalse: [
|
||||
| hex |
|
||||
hex := lineStream next: 2.
|
||||
data nextPut: (Number readFrom: hex readStream radix: 16).
|
||||
].
|
||||
|
||||
last_time isNil
|
||||
ifTrue: [
|
||||
"First time, send it right now"
|
||||
last_time := time.
|
||||
last_image := Time millisecondClockValue.
|
||||
udp_send value: data.
|
||||
]
|
||||
ifFalse: [
|
||||
| wait_image new_image_time |
|
||||
|
||||
"How long to wait?"
|
||||
wait_image := last_image + ((time - last_time) * 1000).
|
||||
[ wait_image > Time millisecondClockValue ] whileTrue: [].
|
||||
|
||||
udp_send value: data.
|
||||
last_time := time.
|
||||
last_image := wait_image.
|
||||
]
|
||||
].
|
||||
Transcript nextPutAll: 'Going to stream now'; nl.
|
||||
replay streamAudio: '127.0.0.1' port: 4000.
|
||||
]
|
||||
|
||||
108
openbsc/contrib/rtp/rtp_replay_shared.st
Normal file
108
openbsc/contrib/rtp/rtp_replay_shared.st
Normal file
@@ -0,0 +1,108 @@
|
||||
"
|
||||
Simple UDP replay from the state files
|
||||
"
|
||||
|
||||
PackageLoader fileInPackage: #Sockets.
|
||||
|
||||
Object subclass: SDPUtils [
|
||||
"Look into using PetitParser."
|
||||
SDPUtils class >> findPort: aSDP [
|
||||
aSDP linesDo: [:line |
|
||||
(line startsWith: 'm=audio ') ifTrue: [
|
||||
| stream |
|
||||
stream := line readStream
|
||||
skip: 'm=audio ' size;
|
||||
yourself.
|
||||
^ Number readFrom: stream.
|
||||
]
|
||||
].
|
||||
|
||||
^ self error: 'Not found'.
|
||||
]
|
||||
|
||||
SDPUtils class >> findHost: aSDP [
|
||||
aSDP linesDo: [:line |
|
||||
(line startsWith: 'c=IN IP4 ') ifTrue: [
|
||||
| stream |
|
||||
^ stream := line readStream
|
||||
skip: 'c=IN IP4 ' size;
|
||||
upToEnd.
|
||||
]
|
||||
].
|
||||
|
||||
^ self error: 'Not found'.
|
||||
]
|
||||
]
|
||||
|
||||
Object subclass: RTPReplay [
|
||||
| filename socket |
|
||||
RTPReplay class >> on: aFile [
|
||||
^ self new
|
||||
initialize;
|
||||
file: aFile; yourself
|
||||
]
|
||||
|
||||
initialize [
|
||||
socket := Sockets.DatagramSocket new.
|
||||
]
|
||||
|
||||
file: aFile [
|
||||
filename := aFile
|
||||
]
|
||||
|
||||
localPort [
|
||||
^ socket port
|
||||
]
|
||||
|
||||
streamAudio: aHost port: aPort [
|
||||
| file last_time last_image udp_send dest |
|
||||
|
||||
last_time := nil.
|
||||
last_image := nil.
|
||||
file := FileStream open: filename.
|
||||
|
||||
"Send the payload"
|
||||
dest := Sockets.SocketAddress byName: aHost.
|
||||
udp_send := [:payload | | datagram |
|
||||
datagram := Sockets.Datagram data: payload contents address: dest port: aPort.
|
||||
socket nextPut: datagram
|
||||
].
|
||||
|
||||
[file atEnd] whileFalse: [
|
||||
| lineStream time data now_image |
|
||||
lineStream := file nextLine readStream.
|
||||
|
||||
"Read the time, skip the blank, parse the data"
|
||||
time := Number readFrom: lineStream.
|
||||
lineStream skip: 1.
|
||||
|
||||
data := WriteStream on: (ByteArray new: 30).
|
||||
[lineStream atEnd] whileFalse: [
|
||||
| hex |
|
||||
hex := lineStream next: 2.
|
||||
data nextPut: (Number readFrom: hex readStream radix: 16).
|
||||
].
|
||||
|
||||
last_time isNil
|
||||
ifTrue: [
|
||||
"First time, send it right now"
|
||||
last_time := time.
|
||||
last_image := Time millisecondClockValue.
|
||||
udp_send value: data.
|
||||
]
|
||||
ifFalse: [
|
||||
| wait_image new_image_time |
|
||||
|
||||
"How long to wait?"
|
||||
wait_image := last_image + ((time - last_time) * 1000).
|
||||
[ wait_image > Time millisecondClockValue ]
|
||||
whileTrue: [Processor yield].
|
||||
|
||||
udp_send value: data.
|
||||
last_time := time.
|
||||
last_image := wait_image.
|
||||
]
|
||||
]
|
||||
]
|
||||
]
|
||||
|
||||
87
openbsc/contrib/rtp/rtp_replay_sip.st
Normal file
87
openbsc/contrib/rtp/rtp_replay_sip.st
Normal file
@@ -0,0 +1,87 @@
|
||||
"""
|
||||
Create a SIP connection and then stream...
|
||||
"""
|
||||
|
||||
PackageLoader
|
||||
fileInPackage: #OsmoSIP.
|
||||
|
||||
"Load for the replay code"
|
||||
FileStream fileIn: 'rtp_replay_shared.st'.
|
||||
|
||||
|
||||
Osmo.SIPCall subclass: StreamCall [
|
||||
| sem stream |
|
||||
|
||||
createCall: aSDP [
|
||||
| sdp |
|
||||
stream := RTPReplay on: 'rtp_ssrc6976010.240.240.1_to_10.240.240.50.state'.
|
||||
sdp := aSDP % {stream localPort}.
|
||||
^ super createCall: sdp.
|
||||
]
|
||||
|
||||
sem: aSemaphore [
|
||||
sem := aSemaphore
|
||||
]
|
||||
|
||||
sessionNew [
|
||||
| host port |
|
||||
Transcript nextPutAll: 'The call has started'; nl.
|
||||
Transcript nextPutAll: sdp_result; nl.
|
||||
|
||||
host := SDPUtils findHost: sdp_result.
|
||||
port := SDPUtils findPort: sdp_result.
|
||||
|
||||
[
|
||||
stream streamAudio: host port: port.
|
||||
Transcript nextPutAll: 'Streaming has finished.'; nl.
|
||||
] fork.
|
||||
]
|
||||
|
||||
sessionFailed [
|
||||
sem signal
|
||||
]
|
||||
|
||||
sessionEnd [
|
||||
sem signal
|
||||
]
|
||||
]
|
||||
|
||||
Eval [
|
||||
| transport agent call sem sdp_fr sdp_amr |
|
||||
|
||||
|
||||
sdp_fr := (WriteStream on: String new)
|
||||
nextPutAll: 'v=0'; cr; nl;
|
||||
nextPutAll: 'o=twinkle 1739517580 1043400482 IN IP4 127.0.0.1'; cr; nl;
|
||||
nextPutAll: 's=-'; cr; nl;
|
||||
nextPutAll: 'c=IN IP4 127.0.0.1'; cr; nl;
|
||||
nextPutAll: 't=0 0'; cr; nl;
|
||||
nextPutAll: 'm=audio %1 RTP/AVP 0 101'; cr; nl;
|
||||
nextPutAll: 'a=rtpmap:0 PCMU/8000'; cr; nl;
|
||||
nextPutAll: 'a=rtpmap:101 telephone-event/8000'; cr; nl;
|
||||
nextPutAll: 'a=fmtp:101 0-15'; cr; nl;
|
||||
nextPutAll: 'a=ptime:20'; cr; nl;
|
||||
contents.
|
||||
|
||||
sem := Semaphore new.
|
||||
transport := Osmo.SIPUdpTransport
|
||||
startOn: '0.0.0.0' port: 5066.
|
||||
agent := Osmo.SIPUserAgent createOn: transport.
|
||||
transport start.
|
||||
|
||||
call := (StreamCall
|
||||
fromUser: 'sip:1000@sip.zecke.osmocom.org'
|
||||
host: '127.0.0.1'
|
||||
port: 5060
|
||||
to: 'sip:123456@127.0.0.1'
|
||||
on: agent)
|
||||
sem: sem; yourself.
|
||||
|
||||
call createCall: sdp_fr.
|
||||
|
||||
|
||||
"Wait for the stream to have ended"
|
||||
sem wait.
|
||||
|
||||
(Delay forSeconds: 4) wait.
|
||||
]
|
||||
9
openbsc/contrib/systemd/osmo-bsc-mgcp.service
Normal file
9
openbsc/contrib/systemd/osmo-bsc-mgcp.service
Normal file
@@ -0,0 +1,9 @@
|
||||
[Unit]
|
||||
Description=OpenBSC MGCP
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
Restart=always
|
||||
ExecStart=/usr/bin/osmo-bsc_mgcp -s -c /etc/osmocom/osmo-bsc-mgcp.cfg
|
||||
Restart=always
|
||||
RestartSec=2
|
||||
10
openbsc/contrib/systemd/osmo-bsc.service
Normal file
10
openbsc/contrib/systemd/osmo-bsc.service
Normal file
@@ -0,0 +1,10 @@
|
||||
[Unit]
|
||||
Description=OpenBSC BSC
|
||||
Requires=osmo-bsc-mgcp.service
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
Restart=always
|
||||
ExecStart=/usr/bin/osmo-bsc -c /etc/osmocom/osmo-bsc.cfg -s
|
||||
Restart=always
|
||||
RestartSec=2
|
||||
9
openbsc/contrib/systemd/osmo-nitb.service
Normal file
9
openbsc/contrib/systemd/osmo-nitb.service
Normal file
@@ -0,0 +1,9 @@
|
||||
[Unit]
|
||||
Description=OpenBSC Network In the Box (NITB)
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
Restart=always
|
||||
ExecStart=/usr/bin/osmo-nitb -s -C -c /etc/osmocom/osmo-nitb.cfg -l /var/lib/osmocom/hlr.sqlite3
|
||||
Restart=always
|
||||
RestartSec=2
|
||||
@@ -1,11 +0,0 @@
|
||||
openbsc (0.9.13.115.eb113-1) natty; urgency=low
|
||||
|
||||
* New upstream release
|
||||
|
||||
-- Harald Welte <laforge@gnumonks.org> Wed, 11 May 2011 18:41:24 +0000
|
||||
|
||||
openbsc (0.9.4-1) unstable; urgency=low
|
||||
|
||||
* Initial release (Closes: #nnnn) <nnnn is the bug number of your ITP>
|
||||
|
||||
-- Harald Welte <laforge@gnumonks.org> Tue, 24 Aug 2010 13:34:24 +0200
|
||||
@@ -1 +0,0 @@
|
||||
doc/examples/osmo-bsc_mgcp
|
||||
@@ -1,2 +0,0 @@
|
||||
# Configuration file
|
||||
CONFIG_FILE="/etc/osmocom/osmo-nitb.cfg"
|
||||
@@ -1 +0,0 @@
|
||||
doc/examples/osmo-nitb
|
||||
@@ -1,29 +0,0 @@
|
||||
Description: Upstream changes introduced in version 0.9.4-1
|
||||
This patch has been created by dpkg-source during the package build.
|
||||
Here's the last changelog entry, hopefully it gives details on why
|
||||
those changes were made:
|
||||
.
|
||||
openbsc (0.9.4-1) unstable; urgency=low
|
||||
.
|
||||
* Initial release (Closes: #nnnn) <nnnn is the bug number of your ITP>
|
||||
.
|
||||
The person named in the Author field signed this changelog entry.
|
||||
Author: Harald Welte <laforge@gnumonks.org>
|
||||
|
||||
---
|
||||
The information above should follow the Patch Tagging Guidelines, please
|
||||
checkout http://dep.debian.net/deps/dep3/ to learn about the format. Here
|
||||
are templates for supplementary fields that you might want to add:
|
||||
|
||||
Origin: <vendor|upstream|other>, <url of original patch>
|
||||
Bug: <url in upstream bugtracker>
|
||||
Bug-Debian: http://bugs.debian.org/<bugnumber>
|
||||
Bug-Ubuntu: https://launchpad.net/bugs/<bugnumber>
|
||||
Forwarded: <no|not-needed|url proving that it has been forwarded>
|
||||
Reviewed-By: <name and email of someone who approved the patch>
|
||||
Last-Update: <YYYY-MM-DD>
|
||||
|
||||
--- /dev/null
|
||||
+++ openbsc-0.9.4/.version
|
||||
@@ -0,0 +1 @@
|
||||
+0.9.4
|
||||
@@ -1 +0,0 @@
|
||||
debian-changes-0.9.4-1
|
||||
@@ -1 +0,0 @@
|
||||
3.0 (quilt)
|
||||
@@ -56,21 +56,21 @@ bsc_api.c:gsm0808_clear
|
||||
* Release the primary lchan with normal release, SACH deactivate
|
||||
|
||||
chan_alloc.c:lchan_release(chan, sacch_deactivate, reason)
|
||||
* Start release procedure. It is working in steps with callbacks
|
||||
coming from the abis_rsl.c code.
|
||||
* Release all SAPI's > 0, wait for them to be released
|
||||
* Send SACH Deactivate on SAPI=0
|
||||
* Finally Release the channel
|
||||
* Start the release procedure. It is working in steps with callbacks
|
||||
coming from the abis_rsl.c code.
|
||||
* Release all SAPI's > 0 as local end (The BTS should send a
|
||||
REL_CONF a message)
|
||||
* Send SACH Deactivate on SAPI=0 if required.
|
||||
* Start T3109 (stop it when the main signalling link is disconnected)
|
||||
or when the channel released. On timeout start the error handling.
|
||||
* abis_rsl.c schedules the RSL_MT_RF_CHAN_REL once all SAPI's are
|
||||
released and after T3111 has timed out or there is an error.
|
||||
|
||||
RX of RELease INDication:
|
||||
* Calls internal rsl_handle_release which might release the RF.
|
||||
* Informs chan_alloc.c about the release with
|
||||
rsl_lchan_rll_release.
|
||||
|
||||
RX of RELease CONFimem:
|
||||
RX of RELease CONFirmation:
|
||||
* Calls internal rsl_handle_release which might release the RF.
|
||||
* Informs chan_alloc.c about the release with
|
||||
rsl_lchan_rll_release.
|
||||
|
||||
* RX of RF_CHAN_REL_ACK
|
||||
* call lchan_free()
|
||||
|
||||
@@ -3,38 +3,6 @@
|
||||
!!
|
||||
password foo
|
||||
!
|
||||
log stderr
|
||||
logging color 1
|
||||
logging timestamp 0
|
||||
logging level all everything
|
||||
logging level rll notice
|
||||
logging level cc notice
|
||||
logging level mm notice
|
||||
logging level rr notice
|
||||
logging level rsl notice
|
||||
logging level nm info
|
||||
logging level mncc notice
|
||||
logging level sms notice
|
||||
logging level pag notice
|
||||
logging level meas notice
|
||||
logging level mi notice
|
||||
logging level mib notice
|
||||
logging level mux notice
|
||||
logging level inp notice
|
||||
logging level sccp notice
|
||||
logging level msc notice
|
||||
logging level mgcp notice
|
||||
logging level ho notice
|
||||
logging level db notice
|
||||
logging level ref notice
|
||||
logging level gprs debug
|
||||
logging level ns info
|
||||
logging level bssgp debug
|
||||
logging level llc debug
|
||||
logging level sndcp debug
|
||||
logging level nat notice
|
||||
logging level lglobal notice
|
||||
logging level llapdm notice
|
||||
!
|
||||
line vty
|
||||
no login
|
||||
@@ -129,5 +97,4 @@ msc
|
||||
ip.access rtp-base 4000
|
||||
timeout-ping 20
|
||||
timeout-pong 5
|
||||
mid-call-timeout 0
|
||||
dest 192.168.100.11 6666 0
|
||||
|
||||
@@ -9,7 +9,7 @@ line vty
|
||||
mgcp
|
||||
! local ip 213.167.134.14
|
||||
bts ip 172.16.252.43
|
||||
bind ip 213.167.134.141
|
||||
bind ip 127.0.0.1
|
||||
bind port 2427
|
||||
bind early 1
|
||||
rtp base 4000
|
||||
|
||||
3
openbsc/doc/examples/osmo-bsc_nat/osmo-bsc_nat.cfg
Normal file
3
openbsc/doc/examples/osmo-bsc_nat/osmo-bsc_nat.cfg
Normal file
@@ -0,0 +1,3 @@
|
||||
nat
|
||||
mgcp
|
||||
call agent ip 127.0.0.1
|
||||
@@ -20,5 +20,6 @@ ns
|
||||
timer tns-test 30
|
||||
timer tns-alive 3
|
||||
timer tns-alive-retries 10
|
||||
encapsulation framerelay-gre enabled 1
|
||||
encapsulation framerelay-gre enabled 0
|
||||
encapsulation framerelay-gre local-ip 0.0.0.0
|
||||
encapsulation udp local-port 23000
|
||||
@@ -30,7 +30,7 @@ network
|
||||
timer t3103 0
|
||||
timer t3105 0
|
||||
timer t3107 0
|
||||
timer t3109 0
|
||||
timer t3109 4
|
||||
timer t3111 0
|
||||
timer t3113 60
|
||||
timer t3115 0
|
||||
|
||||
@@ -31,7 +31,7 @@ network
|
||||
timer t3103 0
|
||||
timer t3105 0
|
||||
timer t3107 0
|
||||
timer t3109 0
|
||||
timer t3109 4
|
||||
timer t3111 0
|
||||
timer t3113 60
|
||||
timer t3115 0
|
||||
|
||||
@@ -30,7 +30,7 @@ network
|
||||
timer t3103 0
|
||||
timer t3105 0
|
||||
timer t3107 0
|
||||
timer t3109 0
|
||||
timer t3109 4
|
||||
timer t3111 0
|
||||
timer t3113 60
|
||||
timer t3115 0
|
||||
|
||||
@@ -30,7 +30,7 @@ network
|
||||
timer t3103 0
|
||||
timer t3105 0
|
||||
timer t3107 0
|
||||
timer t3109 0
|
||||
timer t3109 4
|
||||
timer t3111 0
|
||||
timer t3113 60
|
||||
timer t3115 0
|
||||
|
||||
@@ -13,7 +13,6 @@ network
|
||||
mobile network code 1
|
||||
short name OpenBSC
|
||||
long name OpenBSC
|
||||
auth policy accept-all
|
||||
timer t3101 10
|
||||
timer t3113 60
|
||||
bts 0
|
||||
|
||||
@@ -29,7 +29,7 @@ network
|
||||
timer t3103 0
|
||||
timer t3105 0
|
||||
timer t3107 0
|
||||
timer t3109 0
|
||||
timer t3109 4
|
||||
timer t3111 0
|
||||
timer t3113 60
|
||||
timer t3115 0
|
||||
|
||||
94
openbsc/doc/ipa-sccp.txt
Normal file
94
openbsc/doc/ipa-sccp.txt
Normal file
@@ -0,0 +1,94 @@
|
||||
|
||||
IPA SCCP message flow in the BSC
|
||||
|
||||
February, 2013 Holger Hans Peter Freyther
|
||||
|
||||
CONTENTS
|
||||
|
||||
1. SCCP inside the IPA header
|
||||
2. Supported SCCP message types
|
||||
3. Receiving SCCP messages
|
||||
4. Sending SCCP messages
|
||||
|
||||
|
||||
1. SCCP inside the IPA header
|
||||
|
||||
Many Soft-MSCs implement something that is called SCCP/lite. This means
|
||||
that SCCP messages are transported inside a small multiplexing protocol
|
||||
over TCP/IP. This is an alternative to a full SIGTRAN implementation.
|
||||
|
||||
The multiplexing protocol is the same as used with the sysmoBTS and the
|
||||
ip.access nanoBTS. It is a three byte header with two bytes for the length
|
||||
in network byte order and one byte for the type. The type to be used for
|
||||
SCCP is 0xFD.
|
||||
|
||||
struct ipa_header {
|
||||
uint16_t length_in_network_order;
|
||||
uint8_t type;
|
||||
} __attribute__((packed));
|
||||
|
||||
|
||||
|
||||
2. Supported SCCP message types
|
||||
|
||||
To implement GSM 08.08 only a subset of SCCP messages need to be implemented.
|
||||
For transporting paging and reset messages SCCP UDT messages are used. For
|
||||
the connections with a Mobile Station (MS) a SCCP connection is opened. This
|
||||
means that the SCCP CR, SCCP CC, SCCP CREF, SCCP RLC, SCCP RLSD, SCCP DT1
|
||||
and SCCP IT messages are supported.
|
||||
|
||||
|
||||
3. Receiving SCCP UDT messages
|
||||
|
||||
This is an illustration of the flow of messages. The IPA multiplexing protocol
|
||||
is used for various protocols. This means there is a central place where the
|
||||
multiplexing stream terminates. The stream is terminated in the osmo_bsc_msc.c
|
||||
file and the ipaccess_a_fd_cb method. For SCCP messages the SCCP dispatching
|
||||
sccp_system_incoming method is called. This function is implemented in the
|
||||
libosmo-sccp library.
|
||||
|
||||
To receive UDT messages osmo_bsc_sccp.c:osmo_bsc_sccp_init is using the
|
||||
sccp_set_read function to register a callback for UDT messages. The callback
|
||||
is msc_sccp_read and it is calling bsc_handle_udt that is implemented in the
|
||||
osmo_bsc_bssap.c. This function will handle the GSM 08.08 BSSAP messages.
|
||||
Currently only the reset acknowledge and the paging messages are handled.
|
||||
|
||||
The BSC currently does not accept incoming SCCP messages and is only opening
|
||||
SCCP connections to the MSC. When opening a connection the callbacks for state
|
||||
changes (connection confirmed, released, release complete) are set and a routine
|
||||
for handling incoming data. This registration is done in the osmo_bsc_sccp.c
|
||||
file and the bsc_create_new_connection method. The name of the callback is
|
||||
msc_outgoing_sccp_data and this will call bsc_handle_dt1 that is implemented
|
||||
in the osmo_bsc_bssap.c file. This will forward the messages to the right
|
||||
Mobile Station (MS).
|
||||
|
||||
|
||||
4. Sending SCCP messages
|
||||
|
||||
There are three parts to sending that will be explained below. The first part
|
||||
is to send an entire SCCP frame (which includes the GSM 08.08 data) to the
|
||||
MSC. This is done by first registering the low level sending. sccp_system_init
|
||||
is called with the function that is responsible for sending a message. The
|
||||
msc_sccp_write_ipa will call the msc_queue_write function with the data and
|
||||
the right MSC connection. Below the msc_queue_write the IPA header will be
|
||||
prepended to the msg and then send to the MSC.
|
||||
|
||||
The BSC supports multiple different A-link connections, the decision to pick
|
||||
the right MSC is done in this method. It is either done via the SCCP connection
|
||||
or the ctx pointer.
|
||||
|
||||
When the BSC is starting a BSS RESET message will be sent to the MSC. The reset
|
||||
is created in osmo_bsc_msc.c:initialize_if_needed and sccp_write is called with
|
||||
the GSM 08.08 data and the connection to use. The libosmo-sccp library will
|
||||
embed it into a SCCP UDT message and call the msc_sccp_write_ipa method.
|
||||
|
||||
When a new SCCP connection is to be created the bsc_create_new_connection
|
||||
in the osmo_bsc_sccp.c file. The sccp_connection_socket method will create
|
||||
the context for a SCCP connection. The state and data callback will be used
|
||||
to be notified about data and changes. Once the connection is configured the
|
||||
bsc_open_connection will be called that will ask the libosmo-sccp library to
|
||||
create a SCCP CR message using the sccp_connection_connect method. For active
|
||||
connections the sccp_connection_write method will be called.
|
||||
|
||||
|
||||
|
||||
@@ -7,6 +7,7 @@ problems:
|
||||
* therefore, we can have e.g. both the BSC and the OML interface send a
|
||||
SET ATTRIBUTE message, where the responses would end up at the wrong
|
||||
query.
|
||||
* The BTS has 10s to ACK/NACK a command. We do not run any timers.
|
||||
|
||||
the only possible solutions i can imagine:
|
||||
* have some kind of exclusive locking, where the OML interface gets blocked
|
||||
|
||||
48
openbsc/doc/paging.txt
Normal file
48
openbsc/doc/paging.txt
Normal file
@@ -0,0 +1,48 @@
|
||||
|
||||
GSM Paging implementation in OpenBSC
|
||||
|
||||
== Code structure ==
|
||||
|
||||
The code is implemented in the libbsc/paging.c file. The external
|
||||
interface is documented/specified in the include/openbsc/paging.h
|
||||
header file. The code is used by the NITB and BSC application.
|
||||
|
||||
|
||||
== Implementation ==
|
||||
|
||||
Paging can be initiated in two ways. The standard way is to page by
|
||||
LAC. Each BTS has its own list/queue of outstanding paging operation.
|
||||
When a subscriber is paged one "struct paging_request" per BTS will
|
||||
be allocated and added to the tail of the list. The BTS is supposed
|
||||
to be configured to not repeat the paging.
|
||||
|
||||
A paging_request will remain in the queue until a paging response or at
|
||||
the expiry of the T3113. Every 500 milliseconds a RSL paging command is
|
||||
send to the BTS. The 500 milliseconds is a throttling to not crash the
|
||||
ip.access nanoBTS. Once one paging_request has been handled it will be
|
||||
put at the end of the queue/list and the available slots for the BTS
|
||||
will be decreased.
|
||||
|
||||
The available slots will be updated based on the paging load information
|
||||
element of the CCCH Load indication. If no paging slots are considered
|
||||
to be available and no load indication is sent a timer is started. The
|
||||
current timeout is 500 milliseconds and at the expiry of the timer the
|
||||
available slots will be set to 20.
|
||||
|
||||
OpenBSC has the " paging free <-1-1024>" configuration option. In case
|
||||
there are less free channels than required no paging request will be
|
||||
sent to the BTS. Instead it will be attempted to send the paging request
|
||||
at the next timeout (500 milliseconds).
|
||||
|
||||
== Limitation ==
|
||||
|
||||
The paging throughput could be higher but this has lead to crashes on the
|
||||
ip.access nanoBTS in the past.
|
||||
|
||||
== Configuration ==
|
||||
|
||||
=== ip.access nanoBTS ===
|
||||
|
||||
The current CCCH Load indication threshold is 10% and the period is 1 second.
|
||||
The code can be found inside the src/libbsc/bts_ipaccess_nanobts.c inside the
|
||||
nanobts_attr_bts array.
|
||||
@@ -7,12 +7,13 @@ noinst_HEADERS = abis_nm.h abis_rsl.h db.h gsm_04_08.h gsm_data.h \
|
||||
system_information.h handover.h mgcp_internal.h \
|
||||
vty.h socket.h e1_config.h trau_upqueue.h token_auth.h \
|
||||
handover_decision.h rrlp.h control_if.h \
|
||||
crc24.h gprs_bssgp.h gprs_llc.h gprs_ns.h gprs_gmm.h \
|
||||
crc24.h gprs_llc.h gprs_gmm.h \
|
||||
gb_proxy.h gprs_sgsn.h gsm_04_08_gprs.h sgsn.h \
|
||||
gprs_ns_frgre.h auth.h osmo_msc.h bsc_msc.h bsc_nat.h \
|
||||
auth.h osmo_msc.h bsc_msc.h bsc_nat.h \
|
||||
osmo_bsc_rf.h osmo_bsc.h network_listen.h bsc_nat_sccp.h \
|
||||
osmo_msc_data.h osmo_bsc_grace.h sms_queue.h abis_om2000.h \
|
||||
bss.h gsm_data_shared.h control_cmd.h ipaccess.h mncc_int.h
|
||||
bss.h gsm_data_shared.h control_cmd.h ipaccess.h mncc_int.h \
|
||||
arfcn_range_encode.h
|
||||
|
||||
openbsc_HEADERS = gsm_04_08.h meas_rep.h bsc_api.h
|
||||
openbscdir = $(includedir)/openbsc
|
||||
|
||||
@@ -66,6 +66,18 @@ struct abis_nm_cfg {
|
||||
int (*sw_act_req)(struct msgb *);
|
||||
};
|
||||
|
||||
struct abis_nm_sw_descr {
|
||||
/* where does it start? how long is it? */
|
||||
const uint8_t *start;
|
||||
size_t len;
|
||||
|
||||
/* the parsed data */
|
||||
const uint8_t *file_id;
|
||||
uint16_t file_id_len;
|
||||
const uint8_t *file_ver;
|
||||
uint16_t file_ver_len;
|
||||
};
|
||||
|
||||
extern int abis_nm_rcvmsg(struct msgb *msg);
|
||||
|
||||
int abis_nm_tlv_parse(struct tlv_parsed *tp, struct gsm_bts *bts, const uint8_t *buf, int len);
|
||||
@@ -81,6 +93,9 @@ int abis_nm_conn_terr_sign(struct gsm_bts_trx *trx,
|
||||
int abis_nm_conn_terr_traf(struct gsm_bts_trx_ts *ts,
|
||||
uint8_t e1_port, uint8_t e1_timeslot,
|
||||
uint8_t e1_subslot);
|
||||
int abis_nm_get_attr(struct gsm_bts *bts, uint8_t obj_class,
|
||||
uint8_t bts_nr, uint8_t trx_nr, uint8_t ts_nr,
|
||||
uint8_t *attr, uint8_t attr_len);
|
||||
int abis_nm_set_bts_attr(struct gsm_bts *bts, uint8_t *attr, int attr_len);
|
||||
int abis_nm_set_radio_attr(struct gsm_bts_trx *trx, uint8_t *attr, int attr_len);
|
||||
int abis_nm_set_channel_attr(struct gsm_bts_trx_ts *ts, uint8_t chan_comb);
|
||||
@@ -164,4 +179,8 @@ int _abis_nm_sendmsg(struct msgb *msg);
|
||||
|
||||
void abis_nm_queue_send_next(struct gsm_bts *bts); /* for bs11_config. */
|
||||
|
||||
int abis_nm_parse_sw_config(const uint8_t *data, const size_t len,
|
||||
struct abis_nm_sw_descr *res, const int res_len);
|
||||
int abis_nm_select_newest_sw(const struct abis_nm_sw_descr *sw, const size_t len);
|
||||
|
||||
#endif /* _NM_H */
|
||||
|
||||
@@ -67,13 +67,13 @@ int rsl_ipacc_pdch_activate(struct gsm_bts_trx_ts *ts, int act);
|
||||
int abis_rsl_rcvmsg(struct msgb *msg);
|
||||
|
||||
uint64_t str_to_imsi(const char *imsi_str);
|
||||
int rsl_release_request(struct gsm_lchan *lchan, uint8_t link_id, uint8_t reason);
|
||||
int rsl_release_request(struct gsm_lchan *lchan, uint8_t link_id,
|
||||
enum rsl_rel_mode release_mode);
|
||||
|
||||
int rsl_lchan_set_state(struct gsm_lchan *lchan, int);
|
||||
|
||||
/* to be provided by external code */
|
||||
int rsl_deact_sacch(struct gsm_lchan *lchan);
|
||||
int rsl_lchan_rll_release(struct gsm_lchan *lchan, uint8_t link_id);
|
||||
|
||||
/* BCCH related code */
|
||||
int rsl_ccch_conf_to_bs_cc_chans(int ccch_conf);
|
||||
@@ -96,5 +96,12 @@ int rsl_nokia_si_end(struct gsm_bts_trx *trx);
|
||||
/* required for Nokia BTS power control */
|
||||
int rsl_bs_power_control(struct gsm_bts_trx *trx, uint8_t channel, uint8_t reduction);
|
||||
|
||||
|
||||
int rsl_release_sapis_from(struct gsm_lchan *lchan, int start,
|
||||
enum rsl_rel_mode release_mode);
|
||||
int rsl_start_t3109(struct gsm_lchan *lchan);
|
||||
|
||||
int rsl_direct_rf_release(struct gsm_lchan *lchan);
|
||||
|
||||
#endif /* RSL_MT_H */
|
||||
|
||||
|
||||
26
openbsc/include/openbsc/arfcn_range_encode.h
Normal file
26
openbsc/include/openbsc/arfcn_range_encode.h
Normal file
@@ -0,0 +1,26 @@
|
||||
#ifndef ARFCN_RANGE_ENCODE_H
|
||||
#define ARFCN_RANGE_ENCODE_H
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
enum {
|
||||
ARFCN_RANGE_INVALID = -1,
|
||||
ARFCN_RANGE_128 = 127,
|
||||
ARFCN_RANGE_256 = 255,
|
||||
ARFCN_RANGE_512 = 511,
|
||||
ARFCN_RANGE_1024 = 1023,
|
||||
};
|
||||
|
||||
#define RANGE_ENC_MAX_ARFCNS 29
|
||||
|
||||
int range_enc_determine_range(const int *arfcns, int size, int *f0_out);
|
||||
int range_enc_arfcns(const int rng, const int *arfcns, int sze, int *out, int idx);
|
||||
int range_enc_find_index(const int rng, const int *arfcns, int size);
|
||||
int range_enc_filter_arfcns(const int rng, int *arfcns, const int sze, const int f0, int *f0_included);
|
||||
|
||||
int range_enc_range128(uint8_t *chan_list, int f0, int *w);
|
||||
int range_enc_range256(uint8_t *chan_list, int f0, int *w);
|
||||
int range_enc_range512(uint8_t *chan_list, int f0, int *w);
|
||||
int range_enc_range1024(uint8_t *chan_list, int f0, int f0_incl, int *w);
|
||||
|
||||
#endif
|
||||
@@ -34,6 +34,13 @@ struct bsc_api {
|
||||
void (*classmark_chg)(struct gsm_subscriber_connection *conn,
|
||||
const uint8_t *cm2, uint8_t cm2_len,
|
||||
const uint8_t *cm3, uint8_t cm3_len);
|
||||
|
||||
/**
|
||||
* Configure the multirate setting on this channel. If it is
|
||||
* not implemented AMR5.9 will be used.
|
||||
*/
|
||||
void (*mr_config)(struct gsm_subscriber_connection *conn,
|
||||
struct gsm48_multi_rate_conf *conf);
|
||||
};
|
||||
|
||||
int bsc_api_init(struct gsm_network *network, struct bsc_api *api);
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* (C) 2010-2011 by Holger Hans Peter Freyther <zecke@selfish.org>
|
||||
* (C) 2010-2011 by On-Waves
|
||||
* (C) 2010-2012 by Holger Hans Peter Freyther <zecke@selfish.org>
|
||||
* (C) 2010-2012 by On-Waves
|
||||
* All Rights Reserved
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
@@ -287,6 +287,10 @@ struct bsc_nat {
|
||||
/* filter */
|
||||
char *acc_lst_name;
|
||||
|
||||
/* Barring of subscribers with a rb tree */
|
||||
struct rb_root imsi_black_list;
|
||||
char *imsi_black_list_fn;
|
||||
|
||||
/* number rewriting */
|
||||
char *num_rewr_name;
|
||||
struct llist_head num_rewr;
|
||||
@@ -314,6 +318,9 @@ struct bsc_nat {
|
||||
|
||||
/* statistics */
|
||||
struct bsc_nat_statistics stats;
|
||||
|
||||
/* control interface */
|
||||
struct ctrl_handle *ctrl;
|
||||
};
|
||||
|
||||
struct bsc_nat_ussd_con {
|
||||
@@ -324,6 +331,11 @@ struct bsc_nat_ussd_con {
|
||||
struct osmo_timer_list auth_timeout;
|
||||
};
|
||||
|
||||
struct bsc_nat_reject_cause {
|
||||
int lu_reject_cause;
|
||||
int cm_reject_cause;
|
||||
};
|
||||
|
||||
/* create and init the structures */
|
||||
struct bsc_config *bsc_config_alloc(struct bsc_nat *nat, const char *token);
|
||||
struct bsc_config *bsc_config_num(struct bsc_nat *nat, int num);
|
||||
@@ -357,9 +369,11 @@ int bsc_nat_find_paging(struct msgb *msg, const uint8_t **,int *len);
|
||||
* Content filtering.
|
||||
*/
|
||||
int bsc_nat_filter_sccp_cr(struct bsc_connection *bsc, struct msgb *msg,
|
||||
struct bsc_nat_parsed *, int *con_type, char **imsi);
|
||||
struct bsc_nat_parsed *, int *con_type, char **imsi,
|
||||
struct bsc_nat_reject_cause *cause);
|
||||
int bsc_nat_filter_dt(struct bsc_connection *bsc, struct msgb *msg,
|
||||
struct sccp_connections *con, struct bsc_nat_parsed *parsed);
|
||||
struct sccp_connections *con, struct bsc_nat_parsed *parsed,
|
||||
struct bsc_nat_reject_cause *cause);
|
||||
|
||||
/**
|
||||
* SCCP patching and handling
|
||||
@@ -438,4 +452,19 @@ struct bsc_nat_num_rewr_entry {
|
||||
|
||||
void bsc_nat_num_rewr_entry_adapt(void *ctx, struct llist_head *head, const struct osmo_config_list *);
|
||||
|
||||
struct bsc_nat_barr_entry {
|
||||
struct rb_node node;
|
||||
|
||||
char *imsi;
|
||||
int cm_reject_cause;
|
||||
int lu_reject_cause;
|
||||
};
|
||||
|
||||
int bsc_nat_barr_adapt(void *ctx, struct rb_root *rbtree, const struct osmo_config_list *);
|
||||
int bsc_nat_barr_find(struct rb_root *root, const char *imsi, int *cm, int *lu);
|
||||
|
||||
struct ctrl_handle *bsc_nat_controlif_setup(struct bsc_nat *nat, int port);
|
||||
void bsc_nat_ctrl_del_pending(struct bsc_cmd_list *pending);
|
||||
int bsc_nat_handle_ctrlif_msg(struct bsc_connection *bsc, struct msgb *msg);
|
||||
|
||||
#endif
|
||||
|
||||
@@ -15,4 +15,5 @@ extern int bts_model_rbs2k_init(void);
|
||||
extern int bts_model_nanobts_init(void);
|
||||
extern int bts_model_hslfemto_init(void);
|
||||
extern int bts_model_nokia_site_init(void);
|
||||
extern int bts_model_sysmobts_init(void);
|
||||
#endif
|
||||
|
||||
@@ -46,7 +46,7 @@ void lchan_free(struct gsm_lchan *lchan);
|
||||
void lchan_reset(struct gsm_lchan *lchan);
|
||||
|
||||
/* Release the given lchan */
|
||||
int lchan_release(struct gsm_lchan *lchan, int sacch_deact, int release_mode);
|
||||
int lchan_release(struct gsm_lchan *lchan, int sacch_deact, enum rsl_rel_mode release_mode);
|
||||
|
||||
struct load_counter {
|
||||
unsigned int total;
|
||||
|
||||
@@ -2,17 +2,21 @@
|
||||
#define _CONTROL_CMD_H
|
||||
|
||||
#include <osmocom/core/msgb.h>
|
||||
#include <osmocom/core/talloc.h>
|
||||
#include <osmocom/core/write_queue.h>
|
||||
|
||||
#include <osmocom/vty/vector.h>
|
||||
|
||||
#include <openbsc/vty.h>
|
||||
|
||||
#define CTRL_CMD_ERROR -1
|
||||
#define CTRL_CMD_HANDLED 0
|
||||
#define CTRL_CMD_REPLY 1
|
||||
|
||||
struct ctrl_handle;
|
||||
|
||||
enum ctrl_node_type {
|
||||
CTRL_NODE_ROOT, /* Root elements */
|
||||
CTRL_NODE_NET, /* Network specific (net.) */
|
||||
CTRL_NODE_BTS, /* BTS specific (net.btsN.) */
|
||||
CTRL_NODE_TRX, /* TRX specific (net.btsN.trxM.) */
|
||||
CTRL_NODE_TS, /* TS specific (net.btsN.trxM.tsI.) */
|
||||
@@ -75,15 +79,17 @@ int ctrl_cmd_exec(vector vline, struct ctrl_cmd *command, vector node, void *dat
|
||||
int ctrl_cmd_install(enum ctrl_node_type node, struct ctrl_cmd_element *cmd);
|
||||
int ctrl_cmd_handle(struct ctrl_cmd *cmd, void *data);
|
||||
int ctrl_cmd_send(struct osmo_wqueue *queue, struct ctrl_cmd *cmd);
|
||||
int ctrl_cmd_send_to_all(struct ctrl_handle *ctrl, struct ctrl_cmd *cmd);
|
||||
struct ctrl_cmd *ctrl_cmd_parse(void *ctx, struct msgb *msg);
|
||||
struct msgb *ctrl_cmd_make(struct ctrl_cmd *cmd);
|
||||
struct ctrl_cmd *ctrl_cmd_cpy(void *ctx, struct ctrl_cmd *cmd);
|
||||
struct ctrl_cmd *ctrl_cmd_create(void *ctx, enum ctrl_type);
|
||||
struct ctrl_cmd *ctrl_cmd_trap(struct ctrl_cmd *cmd);
|
||||
|
||||
#define CTRL_CMD_DEFINE_RANGE(cmdname, cmdstr, dtype, element, min, max) \
|
||||
static int get_##cmdname(struct ctrl_cmd *cmd, void *data) \
|
||||
static int get_##cmdname(struct ctrl_cmd *cmd, void *_data) \
|
||||
{ \
|
||||
dtype *node = data; \
|
||||
dtype *node = cmd->node; \
|
||||
cmd->reply = talloc_asprintf(cmd, "%i", node->element); \
|
||||
if (!cmd->reply) { \
|
||||
cmd->reply = "OOM"; \
|
||||
@@ -91,14 +97,14 @@ static int get_##cmdname(struct ctrl_cmd *cmd, void *data) \
|
||||
} \
|
||||
return CTRL_CMD_REPLY; \
|
||||
} \
|
||||
static int set_##cmdname(struct ctrl_cmd *cmd, void *data) \
|
||||
static int set_##cmdname(struct ctrl_cmd *cmd, void *_data) \
|
||||
{ \
|
||||
dtype *node = data; \
|
||||
dtype *node = cmd->node; \
|
||||
int tmp = atoi(cmd->value); \
|
||||
node->element = tmp; \
|
||||
return get_##cmdname(cmd, data); \
|
||||
return get_##cmdname(cmd, _data); \
|
||||
} \
|
||||
static int verify_##cmdname(struct ctrl_cmd *cmd, const char *value, void *data) \
|
||||
static int verify_##cmdname(struct ctrl_cmd *cmd, const char *value, void *_data) \
|
||||
{ \
|
||||
int tmp = atoi(value); \
|
||||
if ((tmp >= min)&&(tmp <= max)) { \
|
||||
@@ -115,8 +121,9 @@ struct ctrl_cmd_element cmd_##cmdname = { \
|
||||
}
|
||||
|
||||
#define CTRL_CMD_DEFINE_STRING(cmdname, cmdstr, dtype, element) \
|
||||
static int get_##cmdname(struct ctrl_cmd *cmd, dtype *data) \
|
||||
static int get_##cmdname(struct ctrl_cmd *cmd, void *_data) \
|
||||
{ \
|
||||
dtype *data = cmd->node; \
|
||||
cmd->reply = talloc_asprintf(cmd, "%s", data->element); \
|
||||
if (!cmd->reply) { \
|
||||
cmd->reply = "OOM"; \
|
||||
@@ -124,10 +131,11 @@ static int get_##cmdname(struct ctrl_cmd *cmd, dtype *data) \
|
||||
} \
|
||||
return CTRL_CMD_REPLY; \
|
||||
} \
|
||||
static int set_##cmdname(struct ctrl_cmd *cmd, dtype *data) \
|
||||
static int set_##cmdname(struct ctrl_cmd *cmd, void *_data) \
|
||||
{ \
|
||||
dtype *data = cmd->node; \
|
||||
bsc_replace_string(cmd->node, &data->element, cmd->value); \
|
||||
return get_##cmdname(cmd, data); \
|
||||
return get_##cmdname(cmd, _data); \
|
||||
} \
|
||||
struct ctrl_cmd_element cmd_##cmdname = { \
|
||||
.name = cmdstr, \
|
||||
@@ -150,6 +158,5 @@ struct ctrl_cmd_element cmd_##cmdname = { \
|
||||
}
|
||||
|
||||
struct gsm_network;
|
||||
int controlif_setup(struct gsm_network *gsmnet, uint16_t port);
|
||||
|
||||
#endif /* _CONTROL_CMD_H */
|
||||
|
||||
@@ -5,9 +5,17 @@
|
||||
#include <openbsc/control_cmd.h>
|
||||
#include <openbsc/gsm_data.h>
|
||||
|
||||
struct ctrl_handle {
|
||||
struct osmo_fd listen_fd;
|
||||
struct gsm_network *gsmnet;
|
||||
|
||||
/* List of control connections */
|
||||
struct llist_head ccon_list;
|
||||
};
|
||||
|
||||
int ctrl_cmd_send(struct osmo_wqueue *queue, struct ctrl_cmd *cmd);
|
||||
int ctrl_cmd_handle(struct ctrl_cmd *cmd, void *data);
|
||||
int controlif_setup(struct gsm_network *gsmnet, uint16_t port);
|
||||
struct ctrl_handle *controlif_setup(struct gsm_network *gsmnet, uint16_t port);
|
||||
|
||||
#endif /* _CONTROL_IF_H */
|
||||
|
||||
|
||||
@@ -41,6 +41,7 @@ struct gsm_subscriber *db_get_subscriber(struct gsm_network *net,
|
||||
enum gsm_subscriber_field field,
|
||||
const char *subscr);
|
||||
int db_sync_subscriber(struct gsm_subscriber *subscriber);
|
||||
int db_subscriber_expire(void *priv, void (*callback)(void *priv, long long unsigned int id));
|
||||
int db_subscriber_alloc_tmsi(struct gsm_subscriber *subscriber);
|
||||
int db_subscriber_alloc_exten(struct gsm_subscriber *subscriber);
|
||||
int db_subscriber_alloc_token(struct gsm_subscriber *subscriber, uint32_t* token);
|
||||
|
||||
@@ -16,7 +16,6 @@ enum {
|
||||
DRSL,
|
||||
DNM,
|
||||
DMNCC,
|
||||
DSMS,
|
||||
DPAG,
|
||||
DMEAS,
|
||||
DSCCP,
|
||||
@@ -32,6 +31,7 @@ enum {
|
||||
DSNDCP,
|
||||
DNAT,
|
||||
DCTRL,
|
||||
DSMPP,
|
||||
Debug_LastEntry,
|
||||
};
|
||||
|
||||
@@ -40,8 +40,6 @@ enum {
|
||||
#define BSC_CTX_SUBSCR 1
|
||||
#define BSC_CTX_BTS 2
|
||||
#define BSC_CTX_SCCP 3
|
||||
#define BSC_CTX_NSVC 4
|
||||
#define BSC_CTX_BVC 5
|
||||
|
||||
/* target */
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
#include <osmocom/core/msgb.h>
|
||||
|
||||
#include <openbsc/gprs_ns.h>
|
||||
#include <osmocom/gprs/gprs_ns.h>
|
||||
#include <osmocom/vty/command.h>
|
||||
|
||||
struct gbproxy_config {
|
||||
|
||||
@@ -1,250 +0,0 @@
|
||||
#ifndef _GPRS_BSSGP_H
|
||||
#define _GPRS_BSSGP_H
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
/*! \brief Fixed BVCI definitions (Section 5.4.1) */
|
||||
#define BVCI_SIGNALLING 0x0000
|
||||
#define BVCI_PTM 0x0001
|
||||
|
||||
/*! \brief BSSGP PDU types (Section 11.3.26 / Table 11.27) */
|
||||
enum bssgp_pdu_type {
|
||||
/* PDUs between RL and BSSGP SAPs */
|
||||
BSSGP_PDUT_DL_UNITDATA = 0x00,
|
||||
BSSGP_PDUT_UL_UNITDATA = 0x01,
|
||||
BSSGP_PDUT_RA_CAPABILITY = 0x02,
|
||||
BSSGP_PDUT_PTM_UNITDATA = 0x03,
|
||||
/* PDUs between GMM SAPs */
|
||||
BSSGP_PDUT_PAGING_PS = 0x06,
|
||||
BSSGP_PDUT_PAGING_CS = 0x07,
|
||||
BSSGP_PDUT_RA_CAPA_UDPATE = 0x08,
|
||||
BSSGP_PDUT_RA_CAPA_UPDATE_ACK = 0x09,
|
||||
BSSGP_PDUT_RADIO_STATUS = 0x0a,
|
||||
BSSGP_PDUT_SUSPEND = 0x0b,
|
||||
BSSGP_PDUT_SUSPEND_ACK = 0x0c,
|
||||
BSSGP_PDUT_SUSPEND_NACK = 0x0d,
|
||||
BSSGP_PDUT_RESUME = 0x0e,
|
||||
BSSGP_PDUT_RESUME_ACK = 0x0f,
|
||||
BSSGP_PDUT_RESUME_NACK = 0x10,
|
||||
/* PDus between NM SAPs */
|
||||
BSSGP_PDUT_BVC_BLOCK = 0x20,
|
||||
BSSGP_PDUT_BVC_BLOCK_ACK = 0x21,
|
||||
BSSGP_PDUT_BVC_RESET = 0x22,
|
||||
BSSGP_PDUT_BVC_RESET_ACK = 0x23,
|
||||
BSSGP_PDUT_BVC_UNBLOCK = 0x24,
|
||||
BSSGP_PDUT_BVC_UNBLOCK_ACK = 0x25,
|
||||
BSSGP_PDUT_FLOW_CONTROL_BVC = 0x26,
|
||||
BSSGP_PDUT_FLOW_CONTROL_BVC_ACK = 0x27,
|
||||
BSSGP_PDUT_FLOW_CONTROL_MS = 0x28,
|
||||
BSSGP_PDUT_FLOW_CONTROL_MS_ACK = 0x29,
|
||||
BSSGP_PDUT_FLUSH_LL = 0x2a,
|
||||
BSSGP_PDUT_FLUSH_LL_ACK = 0x2b,
|
||||
BSSGP_PDUT_LLC_DISCARD = 0x2c,
|
||||
BSSGP_PDUT_SGSN_INVOKE_TRACE = 0x40,
|
||||
BSSGP_PDUT_STATUS = 0x41,
|
||||
/* PDUs between PFM SAP's */
|
||||
BSSGP_PDUT_DOWNLOAD_BSS_PFC = 0x50,
|
||||
BSSGP_PDUT_CREATE_BSS_PFC = 0x51,
|
||||
BSSGP_PDUT_CREATE_BSS_PFC_ACK = 0x52,
|
||||
BSSGP_PDUT_CREATE_BSS_PFC_NACK = 0x53,
|
||||
BSSGP_PDUT_MODIFY_BSS_PFC = 0x54,
|
||||
BSSGP_PDUT_MODIFY_BSS_PFC_ACK = 0x55,
|
||||
BSSGP_PDUT_DELETE_BSS_PFC = 0x56,
|
||||
BSSGP_PDUT_DELETE_BSS_PFC_ACK = 0x57,
|
||||
};
|
||||
|
||||
/*! \brief BSSGP User-Data header (Section 10.2.1 and 10.2.2) */
|
||||
struct bssgp_ud_hdr {
|
||||
uint8_t pdu_type; /*!< BSSGP PDU type */
|
||||
uint32_t tlli; /*!< Temporary Link-Local Identifier */
|
||||
uint8_t qos_profile[3]; /*!< QoS profile */
|
||||
uint8_t data[0]; /* optional/conditional IEs as TLVs */
|
||||
} __attribute__((packed));
|
||||
|
||||
/*! \brief BSSGP normal header */
|
||||
struct bssgp_normal_hdr {
|
||||
uint8_t pdu_type; /*!< BSSGP PDU type */
|
||||
uint8_t data[0]; /*!< optional/conditional IEs as TLVs */
|
||||
};
|
||||
|
||||
/*! \brief BSSGP Information Element Identifiers */
|
||||
enum bssgp_iei_type {
|
||||
BSSGP_IE_ALIGNMENT = 0x00,
|
||||
BSSGP_IE_BMAX_DEFAULT_MS = 0x01,
|
||||
BSSGP_IE_BSS_AREA_ID = 0x02,
|
||||
BSSGP_IE_BUCKET_LEAK_RATE = 0x03,
|
||||
BSSGP_IE_BVCI = 0x04,
|
||||
BSSGP_IE_BVC_BUCKET_SIZE = 0x05,
|
||||
BSSGP_IE_BVC_MEASUREMENT = 0x06,
|
||||
BSSGP_IE_CAUSE = 0x07,
|
||||
BSSGP_IE_CELL_ID = 0x08,
|
||||
BSSGP_IE_CHAN_NEEDED = 0x09,
|
||||
BSSGP_IE_DRX_PARAMS = 0x0a,
|
||||
BSSGP_IE_EMLPP_PRIO = 0x0b,
|
||||
BSSGP_IE_FLUSH_ACTION = 0x0c,
|
||||
BSSGP_IE_IMSI = 0x0d,
|
||||
BSSGP_IE_LLC_PDU = 0x0e,
|
||||
BSSGP_IE_LLC_FRAMES_DISCARDED = 0x0f,
|
||||
BSSGP_IE_LOCATION_AREA = 0x10,
|
||||
BSSGP_IE_MOBILE_ID = 0x11,
|
||||
BSSGP_IE_MS_BUCKET_SIZE = 0x12,
|
||||
BSSGP_IE_MS_RADIO_ACCESS_CAP = 0x13,
|
||||
BSSGP_IE_OMC_ID = 0x14,
|
||||
BSSGP_IE_PDU_IN_ERROR = 0x15,
|
||||
BSSGP_IE_PDU_LIFETIME = 0x16,
|
||||
BSSGP_IE_PRIORITY = 0x17,
|
||||
BSSGP_IE_QOS_PROFILE = 0x18,
|
||||
BSSGP_IE_RADIO_CAUSE = 0x19,
|
||||
BSSGP_IE_RA_CAP_UPD_CAUSE = 0x1a,
|
||||
BSSGP_IE_ROUTEING_AREA = 0x1b,
|
||||
BSSGP_IE_R_DEFAULT_MS = 0x1c,
|
||||
BSSGP_IE_SUSPEND_REF_NR = 0x1d,
|
||||
BSSGP_IE_TAG = 0x1e,
|
||||
BSSGP_IE_TLLI = 0x1f,
|
||||
BSSGP_IE_TMSI = 0x20,
|
||||
BSSGP_IE_TRACE_REFERENC = 0x21,
|
||||
BSSGP_IE_TRACE_TYPE = 0x22,
|
||||
BSSGP_IE_TRANSACTION_ID = 0x23,
|
||||
BSSGP_IE_TRIGGER_ID = 0x24,
|
||||
BSSGP_IE_NUM_OCT_AFF = 0x25,
|
||||
BSSGP_IE_LSA_ID_LIST = 0x26,
|
||||
BSSGP_IE_LSA_INFORMATION = 0x27,
|
||||
BSSGP_IE_PACKET_FLOW_ID = 0x28,
|
||||
BSSGP_IE_PACKET_FLOW_TIMER = 0x29,
|
||||
BSSGP_IE_AGG_BSS_QOS_PROFILE = 0x3a,
|
||||
BSSGP_IE_FEATURE_BITMAP = 0x3b,
|
||||
BSSGP_IE_BUCKET_FULL_RATIO = 0x3c,
|
||||
BSSGP_IE_SERVICE_UTRAN_CCO = 0x3d,
|
||||
};
|
||||
|
||||
/*! \brief Cause coding (Section 11.3.8 / Table 11.10) */
|
||||
enum gprs_bssgp_cause {
|
||||
BSSGP_CAUSE_PROC_OVERLOAD = 0x00,
|
||||
BSSGP_CAUSE_EQUIP_FAIL = 0x01,
|
||||
BSSGP_CAUSE_TRASIT_NET_FAIL = 0x02,
|
||||
BSSGP_CAUSE_CAPA_GREATER_0KPBS = 0x03,
|
||||
BSSGP_CAUSE_UNKNOWN_MS = 0x04,
|
||||
BSSGP_CAUSE_UNKNOWN_BVCI = 0x05,
|
||||
BSSGP_CAUSE_CELL_TRAF_CONG = 0x06,
|
||||
BSSGP_CAUSE_SGSN_CONG = 0x07,
|
||||
BSSGP_CAUSE_OML_INTERV = 0x08,
|
||||
BSSGP_CAUSE_BVCI_BLOCKED = 0x09,
|
||||
BSSGP_CAUSE_PFC_CREATE_FAIL = 0x0a,
|
||||
BSSGP_CAUSE_SEM_INCORR_PDU = 0x20,
|
||||
BSSGP_CAUSE_INV_MAND_INF = 0x21,
|
||||
BSSGP_CAUSE_MISSING_MAND_IE = 0x22,
|
||||
BSSGP_CAUSE_MISSING_COND_IE = 0x23,
|
||||
BSSGP_CAUSE_UNEXP_COND_IE = 0x24,
|
||||
BSSGP_CAUSE_COND_IE_ERR = 0x25,
|
||||
BSSGP_CAUSE_PDU_INCOMP_STATE = 0x26,
|
||||
BSSGP_CAUSE_PROTO_ERR_UNSPEC = 0x27,
|
||||
BSSGP_CAUSE_PDU_INCOMP_FEAT = 0x28,
|
||||
};
|
||||
|
||||
/* Our implementation */
|
||||
|
||||
/* gprs_bssgp_util.c */
|
||||
extern struct gprs_ns_inst *bssgp_nsi;
|
||||
struct msgb *bssgp_msgb_alloc(void);
|
||||
const char *bssgp_cause_str(enum gprs_bssgp_cause cause);
|
||||
/* Transmit a simple response such as BLOCK/UNBLOCK/RESET ACK/NACK */
|
||||
int bssgp_tx_simple_bvci(uint8_t pdu_type, uint16_t nsei,
|
||||
uint16_t bvci, uint16_t ns_bvci);
|
||||
/* Chapter 10.4.14: Status */
|
||||
int bssgp_tx_status(uint8_t cause, uint16_t *bvci, struct msgb *orig_msg);
|
||||
|
||||
/* gprs_bssgp.c */
|
||||
|
||||
#define BVC_S_BLOCKED 0x0001
|
||||
|
||||
/* The per-BTS context that we keep on the SGSN side of the BSSGP link */
|
||||
struct bssgp_bvc_ctx {
|
||||
struct llist_head list;
|
||||
|
||||
struct gprs_ra_id ra_id; /*!< parsed RA ID of the remote BTS */
|
||||
uint16_t cell_id; /*!< Cell ID of the remote BTS */
|
||||
|
||||
/* NSEI and BVCI of underlying Gb link. Together they
|
||||
* uniquely identify a link to a BTS (5.4.4) */
|
||||
uint16_t bvci;
|
||||
uint16_t nsei;
|
||||
|
||||
uint32_t state;
|
||||
|
||||
struct rate_ctr_group *ctrg;
|
||||
|
||||
/* we might want to add this as a shortcut later, avoiding the NSVC
|
||||
* lookup for every packet, similar to a routing cache */
|
||||
//struct gprs_nsvc *nsvc;
|
||||
};
|
||||
extern struct llist_head bssgp_bvc_ctxts;
|
||||
/* Find a BTS Context based on parsed RA ID and Cell ID */
|
||||
struct bssgp_bvc_ctx *btsctx_by_raid_cid(const struct gprs_ra_id *raid, uint16_t cid);
|
||||
/* Find a BTS context based on BVCI+NSEI tuple */
|
||||
struct bssgp_bvc_ctx *btsctx_by_bvci_nsei(uint16_t bvci, uint16_t nsei);
|
||||
|
||||
#define BVC_F_BLOCKED 0x0001
|
||||
|
||||
enum bssgp_ctr {
|
||||
BSSGP_CTR_PKTS_IN,
|
||||
BSSGP_CTR_PKTS_OUT,
|
||||
BSSGP_CTR_BYTES_IN,
|
||||
BSSGP_CTR_BYTES_OUT,
|
||||
BSSGP_CTR_BLOCKED,
|
||||
BSSGP_CTR_DISCARDED,
|
||||
};
|
||||
|
||||
|
||||
#include <osmocom/gsm/tlv.h>
|
||||
|
||||
/* BSSGP-UL-UNITDATA.ind */
|
||||
int gprs_bssgp_rcvmsg(struct msgb *msg);
|
||||
|
||||
/* BSSGP-DL-UNITDATA.req */
|
||||
struct sgsn_mm_ctx;
|
||||
int gprs_bssgp_tx_dl_ud(struct msgb *msg, struct sgsn_mm_ctx *mmctx);
|
||||
|
||||
uint16_t bssgp_parse_cell_id(struct gprs_ra_id *raid, const uint8_t *buf);
|
||||
int bssgp_create_cell_id(uint8_t *buf, const struct gprs_ra_id *raid,
|
||||
uint16_t cid);
|
||||
|
||||
/* Wrapper around TLV parser to parse BSSGP IEs */
|
||||
static inline int bssgp_tlv_parse(struct tlv_parsed *tp, uint8_t *buf, int len)
|
||||
{
|
||||
return tlv_parse(tp, &tvlv_att_def, buf, len, 0, 0);
|
||||
}
|
||||
|
||||
/*! \brief BSSGP Paging mode */
|
||||
enum bssgp_paging_mode {
|
||||
BSSGP_PAGING_PS,
|
||||
BSSGP_PAGING_CS,
|
||||
};
|
||||
|
||||
/*! \brief BSSGP Paging scope */
|
||||
enum bssgp_paging_scope {
|
||||
BSSGP_PAGING_BSS_AREA, /*!< all cells in BSS */
|
||||
BSSGP_PAGING_LOCATION_AREA, /*!< all cells in LA */
|
||||
BSSGP_PAGING_ROUTEING_AREA, /*!< all cells in RA */
|
||||
BSSGP_PAGING_BVCI, /*!< one cell */
|
||||
};
|
||||
|
||||
/*! \brief BSSGP paging information */
|
||||
struct bssgp_paging_info {
|
||||
enum bssgp_paging_mode mode; /*!< CS or PS paging */
|
||||
enum bssgp_paging_scope scope; /*!< bssgp_paging_scope */
|
||||
struct gprs_ra_id raid; /*!< RA Identifier */
|
||||
uint16_t bvci; /*!< BVCI */
|
||||
char *imsi; /*!< IMSI, if any */
|
||||
uint32_t *ptmsi; /*!< P-TMSI, if any */
|
||||
uint16_t drx_params; /*!< DRX parameters */
|
||||
uint8_t qos[3]; /*!< QoS parameters */
|
||||
};
|
||||
|
||||
/* Send a single GMM-PAGING.req to a given NSEI/NS-BVCI */
|
||||
int gprs_bssgp_tx_paging(uint16_t nsei, uint16_t ns_bvci,
|
||||
struct bssgp_paging_info *pinfo);
|
||||
|
||||
/* gprs_bssgp_vty.c */
|
||||
int gprs_bssgp_vty_init(void);
|
||||
|
||||
#endif /* _GPRS_BSSGP_H */
|
||||
@@ -1,250 +0,0 @@
|
||||
#ifndef _GPRS_NS_H
|
||||
#define _GPRS_NS_H
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
/* GPRS Networks Service (NS) messages on the Gb interface
|
||||
* 3GPP TS 08.16 version 8.0.1 Release 1999 / ETSI TS 101 299 V8.0.1 (2002-05)
|
||||
* 3GPP TS 48.016 version 6.5.0 Release 6 / ETSI TS 148 016 V6.5.0 (2005-11) */
|
||||
|
||||
/*! \addtogroup libgb
|
||||
* @{
|
||||
*/
|
||||
|
||||
/*! \file gprs_ns.h */
|
||||
|
||||
/*! \brief Common header of GPRS NS */
|
||||
struct gprs_ns_hdr {
|
||||
uint8_t pdu_type; /*!< NS PDU type */
|
||||
uint8_t data[0]; /*!< variable-length payload */
|
||||
} __attribute__((packed));
|
||||
|
||||
/*! \brief NS PDU Type (TS 08.16, Section 10.3.7, Table 14) */
|
||||
enum ns_pdu_type {
|
||||
NS_PDUT_UNITDATA = 0x00,
|
||||
NS_PDUT_RESET = 0x02,
|
||||
NS_PDUT_RESET_ACK = 0x03,
|
||||
NS_PDUT_BLOCK = 0x04,
|
||||
NS_PDUT_BLOCK_ACK = 0x05,
|
||||
NS_PDUT_UNBLOCK = 0x06,
|
||||
NS_PDUT_UNBLOCK_ACK = 0x07,
|
||||
NS_PDUT_STATUS = 0x08,
|
||||
NS_PDUT_ALIVE = 0x0a,
|
||||
NS_PDUT_ALIVE_ACK = 0x0b,
|
||||
/* TS 48.016 Section 10.3.7, Table 10.3.7.1 */
|
||||
SNS_PDUT_ACK = 0x0c,
|
||||
SNS_PDUT_ADD = 0x0d,
|
||||
SNS_PDUT_CHANGE_WEIGHT = 0x0e,
|
||||
SNS_PDUT_CONFIG = 0x0f,
|
||||
SNS_PDUT_CONFIG_ACK = 0x10,
|
||||
SNS_PDUT_DELETE = 0x11,
|
||||
SNS_PDUT_SIZE = 0x12,
|
||||
SNS_PDUT_SIZE_ACK = 0x13,
|
||||
};
|
||||
|
||||
/*! \brief NS Control IE (TS 08.16, Section 10.3, Table 12) */
|
||||
enum ns_ctrl_ie {
|
||||
NS_IE_CAUSE = 0x00,
|
||||
NS_IE_VCI = 0x01,
|
||||
NS_IE_PDU = 0x02,
|
||||
NS_IE_BVCI = 0x03,
|
||||
NS_IE_NSEI = 0x04,
|
||||
/* TS 48.016 Section 10.3, Table 10.3.1 */
|
||||
NS_IE_IPv4_LIST = 0x05,
|
||||
NS_IE_IPv6_LIST = 0x06,
|
||||
NS_IE_MAX_NR_NSVC = 0x07,
|
||||
NS_IE_IPv4_EP_NR = 0x08,
|
||||
NS_IE_IPv6_EP_NR = 0x09,
|
||||
NS_IE_RESET_FLAG = 0x0a,
|
||||
NS_IE_IP_ADDR = 0x0b,
|
||||
};
|
||||
|
||||
/*! \brief NS Cause (TS 08.16, Section 10.3.2, Table 13) */
|
||||
enum ns_cause {
|
||||
NS_CAUSE_TRANSIT_FAIL = 0x00,
|
||||
NS_CAUSE_OM_INTERVENTION = 0x01,
|
||||
NS_CAUSE_EQUIP_FAIL = 0x02,
|
||||
NS_CAUSE_NSVC_BLOCKED = 0x03,
|
||||
NS_CAUSE_NSVC_UNKNOWN = 0x04,
|
||||
NS_CAUSE_BVCI_UNKNOWN = 0x05,
|
||||
NS_CAUSE_SEM_INCORR_PDU = 0x08,
|
||||
NS_CAUSE_PDU_INCOMP_PSTATE = 0x0a,
|
||||
NS_CAUSE_PROTO_ERR_UNSPEC = 0x0b,
|
||||
NS_CAUSE_INVAL_ESSENT_IE = 0x0c,
|
||||
NS_CAUSE_MISSING_ESSENT_IE = 0x0d,
|
||||
/* TS 48.016 Section 10.3.2, Table 10.3.2.1 */
|
||||
NS_CAUSE_INVAL_NR_IPv4_EP = 0x0e,
|
||||
NS_CAUSE_INVAL_NR_IPv6_EP = 0x0f,
|
||||
NS_CAUSE_INVAL_NR_NS_VC = 0x10,
|
||||
NS_CAUSE_INVAL_WEIGH = 0x11,
|
||||
NS_CAUSE_UNKN_IP_EP = 0x12,
|
||||
NS_CAUSE_UNKN_IP_ADDR = 0x13,
|
||||
NS_CAUSE_UNKN_IP_TEST_FAILED = 0x14,
|
||||
};
|
||||
|
||||
/* Our Implementation */
|
||||
#include <netinet/in.h>
|
||||
#include <osmocom/core/linuxlist.h>
|
||||
#include <osmocom/core/msgb.h>
|
||||
#include <osmocom/core/timer.h>
|
||||
#include <osmocom/core/select.h>
|
||||
|
||||
#define NS_TIMERS_COUNT 7
|
||||
#define NS_TIMERS "(tns-block|tns-block-retries|tns-reset|tns-reset-retries|tns-test|tns-alive|tns-alive-retries)"
|
||||
#define NS_TIMERS_HELP \
|
||||
"(un)blocking Timer (Tns-block) timeout\n" \
|
||||
"(un)blocking Timer (Tns-block) number of retries\n" \
|
||||
"Reset Timer (Tns-reset) timeout\n" \
|
||||
"Reset Timer (Tns-reset) number of retries\n" \
|
||||
"Test Timer (Tns-test) timeout\n" \
|
||||
"Alive Timer (Tns-alive) timeout\n" \
|
||||
"Alive Timer (Tns-alive) number of retries\n"
|
||||
|
||||
enum ns_timeout {
|
||||
NS_TOUT_TNS_BLOCK,
|
||||
NS_TOUT_TNS_BLOCK_RETRIES,
|
||||
NS_TOUT_TNS_RESET,
|
||||
NS_TOUT_TNS_RESET_RETRIES,
|
||||
NS_TOUT_TNS_TEST,
|
||||
NS_TOUT_TNS_ALIVE,
|
||||
NS_TOUT_TNS_ALIVE_RETRIES,
|
||||
};
|
||||
|
||||
#define NSE_S_BLOCKED 0x0001
|
||||
#define NSE_S_ALIVE 0x0002
|
||||
|
||||
/*! \brief Osmocom NS link layer types */
|
||||
enum gprs_ns_ll {
|
||||
GPRS_NS_LL_UDP, /*!< NS/UDP/IP */
|
||||
GPRS_NS_LL_E1, /*!< NS/E1 */
|
||||
GPRS_NS_LL_FR_GRE, /*!< NS/FR/GRE/IP */
|
||||
};
|
||||
|
||||
/*! \brief Osmoco NS events */
|
||||
enum gprs_ns_evt {
|
||||
GPRS_NS_EVT_UNIT_DATA,
|
||||
};
|
||||
|
||||
struct gprs_nsvc;
|
||||
/*! \brief Osmocom GPRS callback function type */
|
||||
typedef int gprs_ns_cb_t(enum gprs_ns_evt event, struct gprs_nsvc *nsvc,
|
||||
struct msgb *msg, uint16_t bvci);
|
||||
|
||||
/*! \brief An instance of the NS protocol stack */
|
||||
struct gprs_ns_inst {
|
||||
/*! \brief callback to the user for incoming UNIT DATA IND */
|
||||
gprs_ns_cb_t *cb;
|
||||
|
||||
/*! \brief linked lists of all NSVC in this instance */
|
||||
struct llist_head gprs_nsvcs;
|
||||
|
||||
/*! \brief a NSVC object that's needed to deal with packets for
|
||||
* unknown NSVC */
|
||||
struct gprs_nsvc *unknown_nsvc;
|
||||
|
||||
uint16_t timeout[NS_TIMERS_COUNT];
|
||||
|
||||
/*! \brief NS-over-IP specific bits */
|
||||
struct {
|
||||
struct osmo_fd fd;
|
||||
uint32_t local_ip;
|
||||
uint16_t local_port;
|
||||
} nsip;
|
||||
/*! \brief NS-over-FR-over-GRE-over-IP specific bits */
|
||||
struct {
|
||||
struct osmo_fd fd;
|
||||
uint32_t local_ip;
|
||||
unsigned int enabled:1;
|
||||
} frgre;
|
||||
};
|
||||
|
||||
enum nsvc_timer_mode {
|
||||
/* standard timers */
|
||||
NSVC_TIMER_TNS_TEST,
|
||||
NSVC_TIMER_TNS_ALIVE,
|
||||
NSVC_TIMER_TNS_RESET,
|
||||
_NSVC_TIMER_NR,
|
||||
};
|
||||
|
||||
/*! \brief Structure representing a single NS-VC */
|
||||
struct gprs_nsvc {
|
||||
/*! \brief list of NS-VCs within NS Instance */
|
||||
struct llist_head list;
|
||||
/*! \brief pointer to NS Instance */
|
||||
struct gprs_ns_inst *nsi;
|
||||
|
||||
uint16_t nsei; /*! \brief end-to-end significance */
|
||||
uint16_t nsvci; /*! \brief uniquely identifies NS-VC at SGSN */
|
||||
|
||||
uint32_t state;
|
||||
uint32_t remote_state;
|
||||
|
||||
struct osmo_timer_list timer;
|
||||
enum nsvc_timer_mode timer_mode;
|
||||
int alive_retries;
|
||||
|
||||
unsigned int remote_end_is_sgsn:1;
|
||||
unsigned int persistent:1;
|
||||
|
||||
struct rate_ctr_group *ctrg;
|
||||
|
||||
/*! \brief which link-layer are we based on? */
|
||||
enum gprs_ns_ll ll;
|
||||
|
||||
union {
|
||||
struct {
|
||||
struct sockaddr_in bts_addr;
|
||||
} ip;
|
||||
struct {
|
||||
struct sockaddr_in bts_addr;
|
||||
} frgre;
|
||||
};
|
||||
};
|
||||
|
||||
/* Create a new NS protocol instance */
|
||||
struct gprs_ns_inst *gprs_ns_instantiate(gprs_ns_cb_t *cb);
|
||||
|
||||
/* Destroy a NS protocol instance */
|
||||
void gprs_ns_destroy(struct gprs_ns_inst *nsi);
|
||||
|
||||
/* Listen for incoming GPRS packets via NS/UDP */
|
||||
int gprs_ns_nsip_listen(struct gprs_ns_inst *nsi);
|
||||
|
||||
struct sockaddr_in;
|
||||
|
||||
/* main function for higher layers (BSSGP) to send NS messages */
|
||||
int gprs_ns_sendmsg(struct gprs_ns_inst *nsi, struct msgb *msg);
|
||||
|
||||
int gprs_ns_tx_reset(struct gprs_nsvc *nsvc, uint8_t cause);
|
||||
int gprs_ns_tx_block(struct gprs_nsvc *nsvc, uint8_t cause);
|
||||
int gprs_ns_tx_unblock(struct gprs_nsvc *nsvc);
|
||||
|
||||
/* Listen for incoming GPRS packets via NS/FR/GRE */
|
||||
int gprs_ns_frgre_listen(struct gprs_ns_inst *nsi);
|
||||
|
||||
/* Establish a connection (from the BSS) to the SGSN */
|
||||
struct gprs_nsvc *nsip_connect(struct gprs_ns_inst *nsi,
|
||||
struct sockaddr_in *dest, uint16_t nsei,
|
||||
uint16_t nsvci);
|
||||
|
||||
struct gprs_nsvc *nsvc_create(struct gprs_ns_inst *nsi, uint16_t nsvci);
|
||||
void nsvc_delete(struct gprs_nsvc *nsvc);
|
||||
struct gprs_nsvc *nsvc_by_nsei(struct gprs_ns_inst *nsi, uint16_t nsei);
|
||||
struct gprs_nsvc *nsvc_by_nsvci(struct gprs_ns_inst *nsi, uint16_t nsvci);
|
||||
|
||||
/* Initiate a RESET procedure (including timer start, ...)*/
|
||||
void gprs_nsvc_reset(struct gprs_nsvc *nsvc, uint8_t cause);
|
||||
|
||||
/* Add NS-specific VTY stuff */
|
||||
int gprs_ns_vty_init(struct gprs_ns_inst *nsi);
|
||||
|
||||
#define NS_ALLOC_SIZE 2048
|
||||
#define NS_ALLOC_HEADROOM 20
|
||||
static inline struct msgb *gprs_ns_msgb_alloc(void)
|
||||
{
|
||||
return msgb_alloc_headroom(NS_ALLOC_SIZE, NS_ALLOC_HEADROOM, "GPRS/NS");
|
||||
}
|
||||
|
||||
/*! }@ */
|
||||
|
||||
#endif
|
||||
@@ -1,6 +0,0 @@
|
||||
#ifndef _GPRS_NS_FRGRE_H
|
||||
#define _GPRS_NS_FRGRE_H
|
||||
|
||||
int gprs_ns_frgre_sendmsg(struct gprs_nsvc *nsvc, struct msgb *msg);
|
||||
|
||||
#endif
|
||||
@@ -29,7 +29,7 @@ int gsm0411_rcv_sms(struct gsm_subscriber_connection *conn, struct msgb *msg);
|
||||
|
||||
struct gsm_sms *sms_alloc(void);
|
||||
void sms_free(struct gsm_sms *sms);
|
||||
struct gsm_sms *sms_from_text(struct gsm_subscriber *receiver, int dcs, const char *text);
|
||||
struct gsm_sms *sms_from_text(struct gsm_subscriber *receiver, struct gsm_subscriber *sender, int dcs, const char *text);
|
||||
|
||||
void _gsm411_sms_trans_free(struct gsm_trans *trans);
|
||||
int gsm411_send_sms_subscr(struct gsm_subscriber *subscr,
|
||||
|
||||
@@ -12,31 +12,6 @@
|
||||
|
||||
struct mncc_sock_state;
|
||||
|
||||
/* the data structure stored in msgb->cb for openbsc apps */
|
||||
struct openbsc_msgb_cb {
|
||||
unsigned char *bssgph;
|
||||
unsigned char *llch;
|
||||
|
||||
/* Cell Identifier */
|
||||
unsigned char *bssgp_cell_id;
|
||||
|
||||
/* Identifiers of a BTS, equal to 'struct bssgp_bts_ctx' */
|
||||
uint16_t nsei;
|
||||
uint16_t bvci;
|
||||
|
||||
/* Identifier of a MS (inside BTS), equal to 'struct sgsn_mm_ctx' */
|
||||
uint32_t tlli;
|
||||
} __attribute__((packed));
|
||||
#define OBSC_MSGB_CB(__msgb) ((struct openbsc_msgb_cb *)&((__msgb)->cb[0]))
|
||||
#define msgb_tlli(__x) OBSC_MSGB_CB(__x)->tlli
|
||||
#define msgb_nsei(__x) OBSC_MSGB_CB(__x)->nsei
|
||||
#define msgb_bvci(__x) OBSC_MSGB_CB(__x)->bvci
|
||||
#define msgb_gmmh(__x) (__x)->l3h
|
||||
#define msgb_bssgph(__x) OBSC_MSGB_CB(__x)->bssgph
|
||||
#define msgb_bssgp_len(__x) ((__x)->tail - (uint8_t *)msgb_bssgph(__x))
|
||||
#define msgb_bcid(__x) OBSC_MSGB_CB(__x)->bssgp_cell_id
|
||||
#define msgb_llch(__x) OBSC_MSGB_CB(__x)->llch
|
||||
|
||||
#define OBSC_LINKID_CB(__msgb) (__msgb)->cb[3]
|
||||
|
||||
enum gsm_security_event {
|
||||
@@ -215,7 +190,9 @@ enum gsm_auth_policy {
|
||||
};
|
||||
|
||||
#define GSM_T3101_DEFAULT 10
|
||||
#define GSM_T3105_DEFAULT 40
|
||||
#define GSM_T3113_DEFAULT 60
|
||||
#define GSM_T3122_DEFAULT 10
|
||||
|
||||
struct gsm_network {
|
||||
/* global parameters */
|
||||
@@ -271,6 +248,9 @@ struct gsm_network {
|
||||
int T3122;
|
||||
int T3141;
|
||||
|
||||
/* timer to expire old location updates */
|
||||
struct osmo_timer_list subscr_expire_timer;
|
||||
|
||||
/* Radio Resource Location Protocol (TS 04.31) */
|
||||
struct {
|
||||
enum rrlp_mode mode;
|
||||
@@ -290,14 +270,42 @@ struct gsm_network {
|
||||
/* subscriber related features */
|
||||
int keep_subscr;
|
||||
struct gsm_sms_queue *sms_queue;
|
||||
|
||||
/* control interface */
|
||||
struct ctrl_handle *ctrl;
|
||||
};
|
||||
|
||||
struct osmo_esme;
|
||||
|
||||
enum gsm_sms_source_id {
|
||||
SMS_SOURCE_UNKNOWN = 0,
|
||||
SMS_SOURCE_MS, /* received from MS */
|
||||
SMS_SOURCE_VTY, /* received from VTY */
|
||||
SMS_SOURCE_SMPP, /* received via SMPP */
|
||||
};
|
||||
|
||||
#define SMS_HDR_SIZE 128
|
||||
#define SMS_TEXT_SIZE 256
|
||||
|
||||
struct gsm_sms_addr {
|
||||
uint8_t ton;
|
||||
uint8_t npi;
|
||||
char addr[21+1];
|
||||
};
|
||||
|
||||
struct gsm_sms {
|
||||
unsigned long long id;
|
||||
struct gsm_subscriber *sender;
|
||||
struct gsm_subscriber *receiver;
|
||||
struct gsm_sms_addr src, dst;
|
||||
enum gsm_sms_source_id source;
|
||||
|
||||
struct {
|
||||
struct osmo_esme *esme;
|
||||
uint32_t sequence_nr;
|
||||
int transaction_mode;
|
||||
char msg_id[16];
|
||||
} smpp;
|
||||
|
||||
unsigned long validity_minutes;
|
||||
uint8_t reply_path_req;
|
||||
@@ -306,8 +314,6 @@ struct gsm_sms {
|
||||
uint8_t protocol_id;
|
||||
uint8_t data_coding_scheme;
|
||||
uint8_t msg_ref;
|
||||
char dest_addr[20+1]; /* DA LV is 12 bytes max, i.e. 10 bytes
|
||||
* BCD == 20 bytes string */
|
||||
uint8_t user_data_len;
|
||||
uint8_t user_data[SMS_TEXT_SIZE];
|
||||
|
||||
@@ -332,10 +338,12 @@ struct gsm_bts *gsm_bts_by_lac(struct gsm_network *net, unsigned int lac,
|
||||
extern void *tall_bsc_ctx;
|
||||
extern int ipacc_rtp_direct;
|
||||
|
||||
/* this actaully refers to the IPA transport, not the BTS model */
|
||||
static inline int is_ipaccess_bts(struct gsm_bts *bts)
|
||||
{
|
||||
switch (bts->type) {
|
||||
case GSM_BTS_TYPE_NANOBTS:
|
||||
case GSM_BTS_TYPE_OSMO_SYSMO:
|
||||
return 1;
|
||||
default:
|
||||
break;
|
||||
@@ -387,4 +395,7 @@ struct gsm_bts_trx *gsm_bts_trx_by_nr(struct gsm_bts *bts, int nr);
|
||||
/* generic E1 line operations for all ISDN-based BTS. */
|
||||
extern struct e1inp_line_ops bts_isdn_e1inp_line_ops;
|
||||
|
||||
extern const struct value_string bts_type_names[_NUM_GSM_BTS_TYPE+1];
|
||||
extern const struct value_string bts_type_descs[_NUM_GSM_BTS_TYPE+1];
|
||||
|
||||
#endif /* _GSM_DATA_H */
|
||||
|
||||
@@ -19,6 +19,10 @@
|
||||
|
||||
#include <osmocom/abis/e1_input.h>
|
||||
|
||||
#ifndef ROLE_BSC
|
||||
#include <osmocom/gsm/lapdm.h>
|
||||
#endif
|
||||
|
||||
struct osmo_bsc_data;
|
||||
|
||||
struct osmo_bsc_sccp_con;
|
||||
@@ -116,6 +120,7 @@ enum gsm_lchan_state {
|
||||
LCHAN_S_ACTIVE, /* channel is active and operational */
|
||||
LCHAN_S_REL_REQ, /* channel release has been requested */
|
||||
LCHAN_S_REL_ERR, /* channel is in an error state */
|
||||
LCHAN_S_BROKEN, /* channel is somehow unusable */
|
||||
LCHAN_S_INACTIVE, /* channel is set inactive */
|
||||
};
|
||||
|
||||
@@ -149,6 +154,27 @@ struct amr_multirate_conf {
|
||||
};
|
||||
/* /BTS ONLY */
|
||||
|
||||
enum lchan_csd_mode {
|
||||
LCHAN_CSD_M_NT,
|
||||
LCHAN_CSD_M_T_1200_75,
|
||||
LCHAN_CSD_M_T_600,
|
||||
LCHAN_CSD_M_T_1200,
|
||||
LCHAN_CSD_M_T_2400,
|
||||
LCHAN_CSD_M_T_9600,
|
||||
LCHAN_CSD_M_T_14400,
|
||||
LCHAN_CSD_M_T_29000,
|
||||
LCHAN_CSD_M_T_32000,
|
||||
};
|
||||
|
||||
/* State of the SAPIs in the lchan */
|
||||
enum lchan_sapi_state {
|
||||
LCHAN_SAPI_S_NONE,
|
||||
LCHAN_SAPI_S_REQ,
|
||||
LCHAN_SAPI_S_ASSIGNED,
|
||||
LCHAN_SAPI_S_REL,
|
||||
LCHAN_SAPI_S_ERROR,
|
||||
};
|
||||
|
||||
struct gsm_lchan {
|
||||
/* The TS that we're part of */
|
||||
struct gsm_bts_trx_ts *ts;
|
||||
@@ -160,6 +186,7 @@ struct gsm_lchan {
|
||||
enum rsl_cmod_spd rsl_cmode;
|
||||
/* If TCH, traffic channel mode */
|
||||
enum gsm48_chan_mode tch_mode;
|
||||
enum lchan_csd_mode csd_mode;
|
||||
/* State */
|
||||
enum gsm_lchan_state state;
|
||||
/* Power levels for MS and BTS */
|
||||
@@ -179,9 +206,6 @@ struct gsm_lchan {
|
||||
uint8_t sapis[8];
|
||||
int sacch_deact;
|
||||
|
||||
/** GSM 08.58 9.3.20 */
|
||||
int release_mode;
|
||||
|
||||
struct {
|
||||
uint32_t bound_ip;
|
||||
uint32_t connect_ip;
|
||||
@@ -202,9 +226,11 @@ struct gsm_lchan {
|
||||
|
||||
#ifdef ROLE_BSC
|
||||
struct osmo_timer_list T3101;
|
||||
struct osmo_timer_list T3109;
|
||||
struct osmo_timer_list T3111;
|
||||
struct osmo_timer_list error_timer;
|
||||
struct osmo_timer_list act_timer;
|
||||
uint8_t error_cause;
|
||||
|
||||
/* table of neighbor cell measurements */
|
||||
struct neigh_meas_proc neigh_meas[MAX_NEIGH_MEAS];
|
||||
@@ -218,6 +244,10 @@ struct gsm_lchan {
|
||||
|
||||
struct gsm_subscriber_connection *conn;
|
||||
#else
|
||||
/* Number of different GsmL1_Sapi_t used in osmo_bts_sysmo is 23.
|
||||
* Currently we don't share these headers so this is a magic number. */
|
||||
uint8_t sapis_dl[23];
|
||||
uint8_t sapis_ul[23];
|
||||
struct lapdm_channel lapdm_ch;
|
||||
struct llist_head dl_tch_queue;
|
||||
struct {
|
||||
@@ -255,6 +285,16 @@ struct gsm_lchan {
|
||||
/* BTS-side ciphering state (rx only, bi-directional, ...) */
|
||||
uint8_t ciph_state;
|
||||
uint8_t loopback;
|
||||
struct {
|
||||
uint8_t active;
|
||||
uint8_t ref;
|
||||
/* T3105: PHYS INF retransmission */
|
||||
struct osmo_timer_list t3105;
|
||||
/* counts up to Ny1 */
|
||||
unsigned int phys_info_count;
|
||||
} ho;
|
||||
/* S counter for link loss */
|
||||
int s;
|
||||
#endif
|
||||
};
|
||||
|
||||
@@ -354,6 +394,8 @@ enum gsm_bts_type {
|
||||
GSM_BTS_TYPE_RBS2000,
|
||||
GSM_BTS_TYPE_HSL_FEMTO,
|
||||
GSM_BTS_TYPE_NOKIA_SITE,
|
||||
GSM_BTS_TYPE_OSMO_SYSMO,
|
||||
_NUM_GSM_BTS_TYPE
|
||||
};
|
||||
|
||||
struct vty;
|
||||
@@ -425,17 +467,81 @@ struct gsm_bts_gprs_nsvc {
|
||||
struct gsm_abis_mo mo;
|
||||
};
|
||||
|
||||
enum gprs_rlc_par {
|
||||
RLC_T3142,
|
||||
RLC_T3169,
|
||||
RLC_T3191,
|
||||
RLC_T3193,
|
||||
RLC_T3195,
|
||||
RLC_N3101,
|
||||
RLC_N3103,
|
||||
RLC_N3105,
|
||||
CV_COUNTDOWN,
|
||||
T_DL_TBF_EXT, /* ms */
|
||||
T_UL_TBF_EXT, /* ms */
|
||||
_NUM_RLC_PAR
|
||||
};
|
||||
|
||||
enum gprs_cs {
|
||||
GPRS_CS1,
|
||||
GPRS_CS2,
|
||||
GPRS_CS3,
|
||||
GPRS_CS4,
|
||||
GPRS_MCS1,
|
||||
GPRS_MCS2,
|
||||
GPRS_MCS3,
|
||||
GPRS_MCS4,
|
||||
GPRS_MCS5,
|
||||
GPRS_MCS6,
|
||||
GPRS_MCS7,
|
||||
GPRS_MCS8,
|
||||
GPRS_MCS9,
|
||||
_NUM_GRPS_CS
|
||||
};
|
||||
|
||||
struct gprs_rlc_cfg {
|
||||
uint16_t parameter[_NUM_RLC_PAR];
|
||||
struct {
|
||||
uint16_t repeat_time; /* ms */
|
||||
uint8_t repeat_count;
|
||||
} paging;
|
||||
uint32_t cs_mask; /* bitmask of gprs_cs */
|
||||
uint8_t initial_cs;
|
||||
uint8_t initial_mcs;
|
||||
};
|
||||
|
||||
|
||||
enum neigh_list_manual_mode {
|
||||
NL_MODE_AUTOMATIC = 0,
|
||||
NL_MODE_MANUAL = 1,
|
||||
NL_MODE_MANUAL_SI5SEP = 2, /* SI2 and SI5 have separate neighbor lists */
|
||||
};
|
||||
|
||||
enum bts_loc_fix {
|
||||
BTS_LOC_FIX_INVALID = 0,
|
||||
BTS_LOC_FIX_2D = 1,
|
||||
BTS_LOC_FIX_3D = 2,
|
||||
};
|
||||
|
||||
extern const struct value_string bts_loc_fix_names[];
|
||||
|
||||
struct bts_location {
|
||||
struct llist_head list;
|
||||
time_t tstamp;
|
||||
enum bts_loc_fix valid;
|
||||
double lat;
|
||||
double lon;
|
||||
double height;
|
||||
};
|
||||
|
||||
/* One BTS */
|
||||
struct gsm_bts {
|
||||
/* list header in net->bts_list */
|
||||
struct llist_head list;
|
||||
|
||||
/* Geographical location of the BTS */
|
||||
struct llist_head loc_list;
|
||||
|
||||
/* number of ths BTS in network */
|
||||
uint8_t nr;
|
||||
/* human readable name / description */
|
||||
@@ -484,9 +590,11 @@ struct gsm_bts {
|
||||
sysinfo_buf_t si_buf[_MAX_SYSINFO_TYPE];
|
||||
|
||||
/* TimeZone hours, mins, and bts specific */
|
||||
int tzhr;
|
||||
int tzmn;
|
||||
int tz_bts_specific;
|
||||
struct {
|
||||
int hr;
|
||||
int mn;
|
||||
int override;
|
||||
} tz;
|
||||
|
||||
/* ip.accesss Unit ID's have Site/BTS/TRX layout */
|
||||
union {
|
||||
@@ -494,6 +602,7 @@ struct gsm_bts {
|
||||
uint16_t site_id;
|
||||
uint16_t bts_id;
|
||||
uint32_t flags;
|
||||
uint32_t rsl_ip;
|
||||
} ip_access;
|
||||
struct {
|
||||
struct {
|
||||
@@ -545,6 +654,7 @@ struct gsm_bts {
|
||||
struct gsm_abis_mo mo;
|
||||
uint16_t bvci;
|
||||
uint8_t timer[11];
|
||||
struct gprs_rlc_cfg rlc_cfg;
|
||||
} cell;
|
||||
struct gsm_bts_gprs_nsvc nsvc[2];
|
||||
uint8_t rac;
|
||||
@@ -592,6 +702,9 @@ struct gsm_bts {
|
||||
|
||||
/* do we use static (user-defined) system information messages? (bitmask) */
|
||||
uint32_t si_mode_static;
|
||||
|
||||
/* exclude the BTS from the global RF Lock handling */
|
||||
int excl_from_rf_lock;
|
||||
#endif /* ROLE_BSC */
|
||||
void *role;
|
||||
};
|
||||
@@ -602,6 +715,10 @@ struct gsm_bts_trx *gsm_bts_trx_alloc(struct gsm_bts *bts);
|
||||
|
||||
struct gsm_bts_trx *gsm_bts_trx_num(const struct gsm_bts *bts, int num);
|
||||
|
||||
|
||||
const struct value_string gsm_pchant_names[10];
|
||||
const struct value_string gsm_pchant_descs[10];
|
||||
const struct value_string gsm_lchant_names[6];
|
||||
const char *gsm_pchan_name(enum gsm_phys_chan_config c);
|
||||
enum gsm_phys_chan_config gsm_pchan_parse(const char *name);
|
||||
const char *gsm_lchant_name(enum gsm_chan_t c);
|
||||
|
||||
@@ -38,6 +38,7 @@ struct gsm_subscriber {
|
||||
char name[GSM_NAME_LENGTH];
|
||||
char extension[GSM_EXTENSION_LENGTH];
|
||||
int authorized;
|
||||
time_t expire_lu;
|
||||
|
||||
/* Temporary field which is not stored in the DB/HLR */
|
||||
uint32_t flags;
|
||||
@@ -98,6 +99,7 @@ char *subscr_name(struct gsm_subscriber *subscr);
|
||||
|
||||
int subscr_purge_inactive(struct gsm_network *net);
|
||||
void subscr_update_from_db(struct gsm_subscriber *subscr);
|
||||
void subscr_expire(struct gsm_network *net);
|
||||
|
||||
/* internal */
|
||||
struct gsm_subscriber *subscr_alloc(void);
|
||||
|
||||
@@ -11,4 +11,7 @@ int bsc_handover_start(struct gsm_lchan *old_lchan, struct gsm_bts *bts);
|
||||
/* clear any operation for this connection */
|
||||
void bsc_clear_handover(struct gsm_subscriber_connection *conn, int free_lchan);
|
||||
|
||||
/* Return the old lchan or NULL. This is meant for audio handling */
|
||||
struct gsm_lchan *bsc_handover_pending(struct gsm_lchan *new_lchan);
|
||||
|
||||
#endif /* _HANDOVER_H */
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
/* A Media Gateway Control Protocol Media Gateway: RFC 3435 */
|
||||
|
||||
/*
|
||||
* (C) 2009-2011 by Holger Hans Peter Freyther <zecke@selfish.org>
|
||||
* (C) 2009-2011 by On-Waves
|
||||
* (C) 2009-2012 by Holger Hans Peter Freyther <zecke@selfish.org>
|
||||
* (C) 2009-2012 by On-Waves
|
||||
* All Rights Reserved
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
@@ -83,6 +83,7 @@ typedef int (*mgcp_realloc)(struct mgcp_trunk_config *cfg, int endpoint);
|
||||
typedef int (*mgcp_change)(struct mgcp_trunk_config *cfg, int endpoint, int state);
|
||||
typedef int (*mgcp_policy)(struct mgcp_trunk_config *cfg, int endpoint, int state, const char *transactio_id);
|
||||
typedef int (*mgcp_reset)(struct mgcp_trunk_config *cfg);
|
||||
typedef int (*mgcp_rqnt)(struct mgcp_endpoint *endp, char tone);
|
||||
|
||||
#define PORT_ALLOC_STATIC 0
|
||||
#define PORT_ALLOC_DYNAMIC 1
|
||||
@@ -110,6 +111,7 @@ struct mgcp_trunk_config {
|
||||
int trunk_nr;
|
||||
int trunk_type;
|
||||
|
||||
char *audio_fmtp_extra;
|
||||
char *audio_name;
|
||||
int audio_payload;
|
||||
int audio_loop;
|
||||
@@ -148,6 +150,7 @@ struct mgcp_config {
|
||||
mgcp_policy policy_cb;
|
||||
mgcp_reset reset_cb;
|
||||
mgcp_realloc realloc_cb;
|
||||
mgcp_rqnt rqnt_cb;
|
||||
void *data;
|
||||
|
||||
uint32_t last_call_id;
|
||||
@@ -168,12 +171,12 @@ int mgcp_vty_init(void);
|
||||
int mgcp_endpoints_allocate(struct mgcp_trunk_config *cfg);
|
||||
void mgcp_free_endp(struct mgcp_endpoint *endp);
|
||||
int mgcp_reset_transcoder(struct mgcp_config *cfg);
|
||||
void mgcp_format_stats(struct mgcp_endpoint *endp, char *stats, size_t size);
|
||||
|
||||
/*
|
||||
* format helper functions
|
||||
*/
|
||||
struct msgb *mgcp_handle_message(struct mgcp_config *cfg, struct msgb *msg);
|
||||
struct msgb *mgcp_create_response_with_data(int code, const char *txt, const char *msg, const char *trans, const char *data);
|
||||
|
||||
/* adc helper */
|
||||
static inline int mgcp_timeslot_to_endpoint(int multiplex, int timeslot)
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
/* MGCP Private Data */
|
||||
|
||||
/*
|
||||
* (C) 2009-2011 by Holger Hans Peter Freyther <zecke@selfish.org>
|
||||
* (C) 2009-2011 by On-Waves
|
||||
* (C) 2009-2012 by Holger Hans Peter Freyther <zecke@selfish.org>
|
||||
* (C) 2009-2012 by On-Waves
|
||||
* All Rights Reserved
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
@@ -46,22 +46,30 @@ struct mgcp_rtp_state {
|
||||
|
||||
uint32_t orig_ssrc;
|
||||
uint32_t ssrc;
|
||||
uint16_t seq_no;
|
||||
int lost_no;
|
||||
|
||||
uint16_t base_seq;
|
||||
uint16_t max_seq;
|
||||
int seq_offset;
|
||||
int cycles;
|
||||
|
||||
uint32_t last_timestamp;
|
||||
int32_t timestamp_offset;
|
||||
uint32_t jitter;
|
||||
int32_t transit;
|
||||
};
|
||||
|
||||
struct mgcp_rtp_end {
|
||||
/* statistics */
|
||||
unsigned int packets;
|
||||
unsigned int octets;
|
||||
struct in_addr addr;
|
||||
|
||||
/* in network byte order */
|
||||
int rtp_port, rtcp_port;
|
||||
|
||||
/* per endpoint data */
|
||||
int payload_type;
|
||||
char *fmtp_extra;
|
||||
|
||||
/*
|
||||
* Each end has a socket...
|
||||
@@ -120,6 +128,10 @@ struct mgcp_endpoint {
|
||||
/* SSRC/seq/ts patching for loop */
|
||||
int allow_patch;
|
||||
|
||||
/* fields for re-transmission */
|
||||
char *last_trans;
|
||||
char *last_response;
|
||||
|
||||
/* tap for the endpoint */
|
||||
struct mgcp_rtp_tap taps[MGCP_TAP_COUNT];
|
||||
};
|
||||
@@ -147,5 +159,9 @@ static inline int endp_back_channel(int endpoint)
|
||||
struct mgcp_trunk_config *mgcp_trunk_alloc(struct mgcp_config *cfg, int index);
|
||||
struct mgcp_trunk_config *mgcp_trunk_num(struct mgcp_config *cfg, int index);
|
||||
|
||||
void mgcp_state_calc_loss(struct mgcp_rtp_state *s, struct mgcp_rtp_end *,
|
||||
uint32_t *expected, int *loss);
|
||||
uint32_t mgcp_state_calc_jitter(struct mgcp_rtp_state *);
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
@@ -5,6 +5,8 @@
|
||||
|
||||
#include "bsc_api.h"
|
||||
|
||||
#define BSS_SEND_USSD 1
|
||||
|
||||
struct sccp_connection;
|
||||
struct osmo_msc_data;
|
||||
struct bsc_msc_connection;
|
||||
@@ -32,14 +34,18 @@ struct bsc_api *osmo_bsc_api();
|
||||
|
||||
int bsc_queue_for_msc(struct osmo_bsc_sccp_con *conn, struct msgb *msg);
|
||||
int bsc_open_connection(struct osmo_bsc_sccp_con *sccp, struct msgb *msg);
|
||||
int bsc_create_new_connection(struct gsm_subscriber_connection *conn);
|
||||
int bsc_create_new_connection(struct gsm_subscriber_connection *conn,
|
||||
struct osmo_msc_data *msc);
|
||||
int bsc_delete_connection(struct osmo_bsc_sccp_con *sccp);
|
||||
|
||||
struct osmo_msc_data *bsc_find_msc(struct gsm_subscriber_connection *conn, struct msgb *);
|
||||
int bsc_scan_bts_msg(struct gsm_subscriber_connection *conn, struct msgb *msg);
|
||||
int bsc_scan_msc_msg(struct gsm_subscriber_connection *conn, struct msgb *msg);
|
||||
int bsc_send_welcome_ussd(struct gsm_subscriber_connection *conn);
|
||||
|
||||
int bsc_handle_udt(struct gsm_network *net, struct bsc_msc_connection *conn, struct msgb *msg, unsigned int length);
|
||||
int bsc_handle_udt(struct osmo_msc_data *msc, struct msgb *msg, unsigned int length);
|
||||
int bsc_handle_dt1(struct osmo_bsc_sccp_con *conn, struct msgb *msg, unsigned int len);
|
||||
|
||||
int bsc_ctrl_cmds_install();
|
||||
|
||||
#endif
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* (C) 2010 by Holger Hans Peter Freyther <zecke@selfish.org>
|
||||
* (C) 2010 by On-Waves
|
||||
* (C) 2010-2013 by Holger Hans Peter Freyther <zecke@selfish.org>
|
||||
* (C) 2010-2013 by On-Waves
|
||||
* All Rights Reserved
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
@@ -23,6 +23,9 @@
|
||||
|
||||
#include "gsm_data.h"
|
||||
|
||||
int bsc_grace_allow_new_connection(struct gsm_network *network);
|
||||
struct osmo_msc_data;
|
||||
|
||||
int bsc_grace_allow_new_connection(struct gsm_network *net, struct gsm_bts *bts);
|
||||
int bsc_grace_paging_request(struct gsm_subscriber *sub, int type, struct osmo_msc_data *msc);
|
||||
|
||||
#endif
|
||||
|
||||
@@ -1,9 +1,28 @@
|
||||
#ifndef OSMO_BSC_RF
|
||||
#define OSMO_BSC_RF
|
||||
|
||||
#include <openbsc/gsm_data.h>
|
||||
#include <osmocom/core/write_queue.h>
|
||||
#include <osmocom/core/timer.h>
|
||||
|
||||
enum osmo_bsc_rf_opstate {
|
||||
OSMO_BSC_RF_OPSTATE_INOPERATIONAL,
|
||||
OSMO_BSC_RF_OPSTATE_OPERATIONAL,
|
||||
};
|
||||
|
||||
enum osmo_bsc_rf_adminstate {
|
||||
OSMO_BSC_RF_ADMINSTATE_UNLOCKED,
|
||||
OSMO_BSC_RF_ADMINSTATE_LOCKED,
|
||||
};
|
||||
|
||||
enum osmo_bsc_rf_policy {
|
||||
OSMO_BSC_RF_POLICY_OFF,
|
||||
OSMO_BSC_RF_POLICY_ON,
|
||||
OSMO_BSC_RF_POLICY_GRACE,
|
||||
OSMO_BSC_RF_POLICY_UNKNOWN,
|
||||
};
|
||||
|
||||
|
||||
struct gsm_network;
|
||||
|
||||
struct osmo_bsc_rf {
|
||||
@@ -23,6 +42,9 @@ struct osmo_bsc_rf {
|
||||
|
||||
/* some handling for the automatic grace switch */
|
||||
struct osmo_timer_list grace_timeout;
|
||||
|
||||
/* auto RF switch-off due lack of MSC connection */
|
||||
struct osmo_timer_list auto_off_timer;
|
||||
};
|
||||
|
||||
struct osmo_bsc_rf_conn {
|
||||
@@ -30,6 +52,13 @@ struct osmo_bsc_rf_conn {
|
||||
struct osmo_bsc_rf *rf;
|
||||
};
|
||||
|
||||
const char *osmo_bsc_rf_get_opstate_name(enum osmo_bsc_rf_opstate opstate);
|
||||
const char *osmo_bsc_rf_get_adminstate_name(enum osmo_bsc_rf_adminstate adminstate);
|
||||
const char *osmo_bsc_rf_get_policy_name(enum osmo_bsc_rf_policy policy);
|
||||
enum osmo_bsc_rf_opstate osmo_bsc_rf_get_opstate_by_bts(struct gsm_bts *bts);
|
||||
enum osmo_bsc_rf_adminstate osmo_bsc_rf_get_adminstate_by_bts(struct gsm_bts *bts);
|
||||
enum osmo_bsc_rf_policy osmo_bsc_rf_get_policy_by_bts(struct gsm_bts *bts);
|
||||
struct osmo_bsc_rf *osmo_bsc_rf_create(const char *path, struct gsm_network *net);
|
||||
void osmo_bsc_rf_schedule_lock(struct osmo_bsc_rf *rf, char cmd);
|
||||
|
||||
#endif
|
||||
|
||||
@@ -26,6 +26,9 @@
|
||||
#include "bsc_msc.h"
|
||||
|
||||
#include <osmocom/core/timer.h>
|
||||
#include <osmocom/gsm/protocol/gsm_04_08.h>
|
||||
|
||||
#include <regex.h>
|
||||
|
||||
struct osmo_bsc_rf;
|
||||
struct gsm_network;
|
||||
@@ -35,12 +38,25 @@ struct gsm_audio_support {
|
||||
ver : 7;
|
||||
};
|
||||
|
||||
enum {
|
||||
MSC_CON_TYPE_NORMAL,
|
||||
MSC_CON_TYPE_LOCAL,
|
||||
};
|
||||
|
||||
struct osmo_msc_data {
|
||||
struct llist_head entry;
|
||||
|
||||
/* Back pointer */
|
||||
struct gsm_network *network;
|
||||
|
||||
int allow_emerg;
|
||||
int type;
|
||||
|
||||
/* local call routing */
|
||||
char *local_pref;
|
||||
regex_t local_pref_reg;
|
||||
|
||||
|
||||
/* Connection data */
|
||||
char *bsc_token;
|
||||
int ping_timeout;
|
||||
@@ -53,6 +69,7 @@ struct osmo_msc_data {
|
||||
int rtp_base;
|
||||
|
||||
/* audio codecs */
|
||||
struct gsm48_multi_rate_conf amr_conf;
|
||||
struct gsm_audio_support **audio_support;
|
||||
int audio_length;
|
||||
|
||||
@@ -82,6 +99,7 @@ struct osmo_bsc_data {
|
||||
int mid_call_timeout;
|
||||
char *rf_ctrl_name;
|
||||
struct osmo_bsc_rf *rf_ctrl;
|
||||
int auto_off_timeout;
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -56,6 +56,8 @@ struct gsm_paging_request {
|
||||
/* schedule paging request */
|
||||
int paging_request(struct gsm_network *network, struct gsm_subscriber *subscr,
|
||||
int type, gsm_cbfn *cbfn, void *data);
|
||||
int paging_request_bts(struct gsm_bts *bts, struct gsm_subscriber *subscr,
|
||||
int type, gsm_cbfn *cbfn, void *data);
|
||||
|
||||
/* stop paging requests */
|
||||
void paging_request_stop(struct gsm_bts *bts, struct gsm_subscriber *subscr,
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
#include <openbsc/gsm_04_08.h>
|
||||
|
||||
/* generate SI1 rest octets */
|
||||
int rest_octets_si1(uint8_t *data, uint8_t *nch_pos);
|
||||
int rest_octets_si1(uint8_t *data, uint8_t *nch_pos, int is1800_net);
|
||||
|
||||
struct gsm48_si_selection_params {
|
||||
uint16_t penalty_time:5,
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
#include <osmocom/core/msgb.h>
|
||||
|
||||
#include <openbsc/gprs_ns.h>
|
||||
#include <osmocom/gprs/gprs_ns.h>
|
||||
#include <openbsc/gprs_sgsn.h>
|
||||
|
||||
struct sgsn_config {
|
||||
|
||||
@@ -41,7 +41,6 @@ enum signal_subsystems {
|
||||
SS_SUBSCR,
|
||||
SS_SCALL,
|
||||
SS_CHALLOC,
|
||||
SS_NS,
|
||||
SS_IPAC_NWL,
|
||||
SS_RF,
|
||||
SS_MSC,
|
||||
@@ -186,6 +185,7 @@ struct nm_om2k_signal_data {
|
||||
|
||||
struct nm_nack_signal_data {
|
||||
struct msgb *msg;
|
||||
struct gsm_bts *bts;
|
||||
uint8_t mt;
|
||||
};
|
||||
|
||||
@@ -215,22 +215,11 @@ struct lchan_signal_data {
|
||||
struct gsm_meas_rep *mr;
|
||||
};
|
||||
|
||||
enum signal_ns {
|
||||
S_NS_RESET,
|
||||
S_NS_BLOCK,
|
||||
S_NS_UNBLOCK,
|
||||
S_NS_ALIVE_EXP, /* Tns-alive expired more than N times */
|
||||
};
|
||||
|
||||
struct ns_signal_data {
|
||||
struct gprs_nsvc *nsvc;
|
||||
uint8_t cause;
|
||||
};
|
||||
|
||||
/* MSC signals */
|
||||
enum signal_msc {
|
||||
S_MSC_LOST,
|
||||
S_MSC_CONNECTED,
|
||||
S_MSC_AUTHENTICATED,
|
||||
};
|
||||
|
||||
struct osmo_msc_data;
|
||||
@@ -238,16 +227,6 @@ struct msc_signal_data {
|
||||
struct osmo_msc_data *data;
|
||||
};
|
||||
|
||||
/* handover */
|
||||
enum signal_ho {
|
||||
S_HANDOVER_ACK,
|
||||
};
|
||||
|
||||
struct ho_signal_data {
|
||||
struct gsm_lchan *old_lchan;
|
||||
struct gsm_lchan *new_lchan;
|
||||
};
|
||||
|
||||
/* SS_CCCH signals */
|
||||
enum signal_ccch {
|
||||
S_CCCH_PAGING_LOAD,
|
||||
|
||||
@@ -6,6 +6,8 @@
|
||||
#include <osmocom/core/linuxlist.h>
|
||||
#include <openbsc/gsm_04_11.h>
|
||||
#include <openbsc/mncc.h>
|
||||
#include <osmocom/gsm/gsm0411_smc.h>
|
||||
#include <osmocom/gsm/gsm0411_smr.h>
|
||||
|
||||
/* One transaction */
|
||||
struct gsm_trans {
|
||||
@@ -46,12 +48,8 @@ struct gsm_trans {
|
||||
struct gsm_mncc msg; /* stores setup/disconnect/release message */
|
||||
} cc;
|
||||
struct {
|
||||
uint8_t link_id; /* RSL Link ID to be used for this trans */
|
||||
int is_mt; /* is this a MO (0) or MT (1) transfer */
|
||||
enum gsm411_cp_state cp_state;
|
||||
struct osmo_timer_list cp_timer;
|
||||
|
||||
enum gsm411_rp_state rp_state;
|
||||
struct gsm411_smc_inst smc_inst;
|
||||
struct gsm411_smr_inst smr_inst;
|
||||
|
||||
struct gsm_sms *sms;
|
||||
} sms;
|
||||
@@ -72,5 +70,6 @@ void trans_free(struct gsm_trans *trans);
|
||||
|
||||
int trans_assign_trans_id(struct gsm_subscriber *subscr,
|
||||
uint8_t protocol, uint8_t ti_flag);
|
||||
int trans_has_conn(const struct gsm_subscriber_connection *conn);
|
||||
|
||||
#endif
|
||||
|
||||
@@ -26,8 +26,6 @@ enum bsc_vty_node {
|
||||
MGCP_NODE,
|
||||
GBPROXY_NODE,
|
||||
SGSN_NODE,
|
||||
NS_NODE,
|
||||
BSSGP_NODE,
|
||||
OML_NODE,
|
||||
NAT_NODE,
|
||||
NAT_BSC_NODE,
|
||||
@@ -36,6 +34,9 @@ enum bsc_vty_node {
|
||||
TRUNK_NODE,
|
||||
PGROUP_NODE,
|
||||
MNCC_INT_NODE,
|
||||
BSC_NODE,
|
||||
SMPP_NODE,
|
||||
SMPP_ESME_NODE,
|
||||
};
|
||||
|
||||
extern int bsc_vty_is_config_node(struct vty *vty, int node);
|
||||
|
||||
@@ -2,7 +2,7 @@ INCLUDES = $(all_includes) -I$(top_srcdir)/include -I$(top_builddir)
|
||||
AM_CFLAGS=-Wall $(LIBOSMOCORE_CFLAGS) $(LIBOSMOGSM_CFLAGS) $(LIBOSMOGSM_CFLAGS) $(LIBOSMOVTY_CFLAGS) $(COVERAGE_CFLAGS)
|
||||
AM_LDFLAGS = $(LIBOSMOCORE_LIBS) $(LIBOSMOGSM_LIBS) $(COVERAGE_LDFLAGS)
|
||||
|
||||
SUBDIRS = libcommon libmgcp libbsc libmsc libtrau libctrl osmo-nitb osmo-bsc_mgcp utils ipaccess libgb gprs
|
||||
SUBDIRS = libcommon libmgcp libbsc libmsc libtrau libctrl osmo-nitb osmo-bsc_mgcp utils ipaccess gprs
|
||||
|
||||
# Conditional modules
|
||||
if BUILD_NAT
|
||||
|
||||
@@ -1,194 +0,0 @@
|
||||
/* C-Implementation of the Algorithm described in Appendix J of GSM TS 44.018,
|
||||
* (C) 2009 by Dirk Hakkesteegt <dirk@hakkesteegt.org>
|
||||
*
|
||||
* All Rights Reserved
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as published by
|
||||
* the Free Software Foundation; either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
/* Annex J.3 indicates that at least in one BA list, we can never have more
|
||||
* than 29 frequencies within the 16byte limit */
|
||||
#define MAX_ARRFCNS 29
|
||||
|
||||
/*****************************************************************************
|
||||
* NAME : smod
|
||||
* DESCRIPTION : n smod m indicates the offset remainder of the euclidian
|
||||
* division of n by m
|
||||
* INPUT : n, m
|
||||
* OUTPUT : n smod m
|
||||
* RETURNS :
|
||||
* Errorcodes :
|
||||
******************************************************************************/
|
||||
static int smod(int n, int m)
|
||||
{
|
||||
int result = n % m;
|
||||
if (result < 0)
|
||||
result += m;
|
||||
|
||||
if (result == 0)
|
||||
result = m;
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
/*****************************************************************************
|
||||
* NAME : mod
|
||||
* DESCRIPTION : n mod m indicates the remainder of the euclidian division of
|
||||
* n by m
|
||||
* INPUT : n, m
|
||||
* OUTPUT : n mod m
|
||||
* RETURNS :
|
||||
* Errorcodes :
|
||||
******************************************************************************/
|
||||
static int mod(int n, int m)
|
||||
{
|
||||
int result = n % m;
|
||||
if (result < 0)
|
||||
result += m;
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
/*****************************************************************************
|
||||
* NAME : greatest_power_of_2_le_to
|
||||
* DESCRIPTION : Calculates the greatest power of 2 that is lesser or equal
|
||||
* to the input value;
|
||||
* INPUT :
|
||||
* OUTPUT :
|
||||
* RETURNS :
|
||||
* Errorcodes :
|
||||
******************************************************************************/
|
||||
static int greatest_power_of_2_le_to(int input)
|
||||
{
|
||||
int check_val = 1;
|
||||
while (check_val <= input)
|
||||
check_val *= 2;
|
||||
|
||||
return check_val / 2;
|
||||
}
|
||||
|
||||
/*****************************************************************************
|
||||
* NAME : ENCODE_SUBTREE
|
||||
* DESCRIPTION : Recursive encoding routine based on 3GPP TS44.018 Annex J.4
|
||||
* INPUT : index: current position in the W list
|
||||
* set: the array to be encoded
|
||||
* range: the current range
|
||||
* set_size: number of elements in set
|
||||
* OUTPUT : W: the array of results
|
||||
* RETURNS :
|
||||
* Errorcodes :
|
||||
******************************************************************************/
|
||||
static void encode_subtree(int index, int *set, int range, int set_size, int *W)
|
||||
{
|
||||
int index_in_set = 0;
|
||||
int N, J, I, x;
|
||||
int subset[18];
|
||||
int subset_index, origin_value;
|
||||
|
||||
/* Check if this is a leaf */
|
||||
if (set_size == 0) {
|
||||
W[index] = 0;
|
||||
return;
|
||||
} else {
|
||||
if (set_size == 1) {
|
||||
W[index] = 1 + set[1];
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
for (I = 1; I <= set_size; I++) {
|
||||
N = 0;
|
||||
for (J = 1; J <= set_size; J++) {
|
||||
x = set[J] - set[I];
|
||||
x = mod(x, range);
|
||||
if (x <= (range-1)/2)
|
||||
N++;
|
||||
}
|
||||
if (N-1 == (set_size-1) / 2) {
|
||||
index_in_set = I;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
W[index] = set[index_in_set] + 1;
|
||||
|
||||
/* Left subset */
|
||||
subset[0] = 0;
|
||||
origin_value = mod((set[index_in_set] + (range-1) / 2 + 1), range);
|
||||
subset_index = 1;
|
||||
for (I = 1; I <= set_size; I++) {
|
||||
if (mod((set[I]-origin_value), range) < range/2) {
|
||||
subset[subset_index] = mod((set[I] - origin_value), range);
|
||||
subset_index++;
|
||||
subset[subset_index] = 0;
|
||||
}
|
||||
}
|
||||
encode_subtree(index + greatest_power_of_2_le_to(index),
|
||||
subset, range / 2, subset_index-1, W);
|
||||
|
||||
/* Right subset */
|
||||
subset[0] = 0;
|
||||
origin_value = mod((set[index_in_set] + 1), range);
|
||||
subset_index=1;
|
||||
for (I = 1; I<= set_size; I++) {
|
||||
if (mod((set[I]-origin_value), range) < range/2) {
|
||||
subset[subset_index] = mod((set[I] - origin_value), range);
|
||||
subset_index++;
|
||||
subset[subset_index] = 0;
|
||||
}
|
||||
}
|
||||
encode_subtree(index + 2*greatest_power_of_2_le_to(index),
|
||||
subset, (range-1)/2, subset_index-1, W);
|
||||
}
|
||||
|
||||
/*****************************************************************************
|
||||
* NAME : CalcARFCN
|
||||
* DESCRIPTION : Calculate the ARFCN list
|
||||
* INPUT : F: the list of input frequencies. MUST BE SORTED!
|
||||
* count: the number of elements in the F list
|
||||
* range: the encoding range (default: range 512)
|
||||
* OUTPUT : W: the list of W values
|
||||
* RETURNS :
|
||||
* Errorcodes :
|
||||
******************************************************************************/
|
||||
static void CalcARFCN(const unsigned int *F, int *W, unsigned int count, unsigned int range)
|
||||
{
|
||||
int i;
|
||||
int Fd[MAX_ARFCNS+1];
|
||||
|
||||
W[0] = F[0];
|
||||
for (i = 1; i < count; i++) {
|
||||
Fd[i] = F[i] - F[0] - 1;
|
||||
}
|
||||
encode_subtree(1, Fd, range-1, count-1, W);
|
||||
}
|
||||
|
||||
int bitvec2arfcn_list_range(uint8_t *range, struct bitvec *bv, uint16_t range)
|
||||
{
|
||||
unsigned int i, idx = 0;
|
||||
int F[MAX_ARFCNS+1];
|
||||
int W[MAX_ARFCNS+1];
|
||||
|
||||
/* build an array of integers from the bitmask */
|
||||
for (i = 0; i < bv->data_len*8; i++) {
|
||||
if (bitvec_get_bit_pos(bv, i))
|
||||
F[idx++] = i;
|
||||
}
|
||||
/* Perform the actual algorithm to calculate the 'W' values */
|
||||
CalcARFCN(F, W, idx, range);
|
||||
|
||||
/* FIXME: Encode the 'W' values into the actual format as used in 04.08 */
|
||||
|
||||
return -EIO;
|
||||
}
|
||||
@@ -1,8 +1,9 @@
|
||||
INCLUDES = $(all_includes) -I$(top_srcdir)/include -I$(top_builddir)
|
||||
AM_CFLAGS=-Wall -fno-strict-aliasing $(LIBOSMOCORE_CFLAGS) \
|
||||
$(LIBOSMOGSM_CFLAGS) $(LIBOSMOVTY_CFLAGS) \
|
||||
$(LIBOSMOABIS_CFLAGS) $(COVERAGE_CFLAGS)
|
||||
OSMO_LIBS = $(LIBOSMOCORE_LIBS) $(LIBOSMOGSM_LIBS) $(LIBOSMOVTY_LIBS)
|
||||
$(LIBOSMOABIS_CFLAGS) $(LIBOSMOGB_CFLAGS) $(COVERAGE_CFLAGS)
|
||||
OSMO_LIBS = $(LIBOSMOCORE_LIBS) $(LIBOSMOGSM_LIBS) $(LIBOSMOVTY_LIBS) \
|
||||
$(LIBOSMOGB_LIBS)
|
||||
|
||||
noinst_HEADERS = gprs_sndcp.h
|
||||
|
||||
@@ -13,13 +14,11 @@ bin_PROGRAMS = osmo-gbproxy
|
||||
endif
|
||||
|
||||
osmo_gbproxy_SOURCES = gb_proxy.c gb_proxy_main.c gb_proxy_vty.c
|
||||
osmo_gbproxy_LDADD = $(top_builddir)/src/libgb/libgb.a \
|
||||
$(top_builddir)/src/libcommon/libcommon.a \
|
||||
osmo_gbproxy_LDADD = $(top_builddir)/src/libcommon/libcommon.a \
|
||||
$(OSMO_LIBS)
|
||||
|
||||
osmo_sgsn_SOURCES = gprs_gmm.c gprs_sgsn.c gprs_sndcp.c gprs_sndcp_vty.c \
|
||||
sgsn_main.c sgsn_vty.c sgsn_libgtp.c \
|
||||
gprs_llc.c gprs_llc_vty.c crc24.c
|
||||
osmo_sgsn_LDADD = $(top_builddir)/src/libgb/libgb.a \
|
||||
$(top_builddir)/src/libcommon/libcommon.a \
|
||||
osmo_sgsn_LDADD = $(top_builddir)/src/libcommon/libcommon.a \
|
||||
-lgtp $(OSMO_LIBS)
|
||||
|
||||
@@ -32,10 +32,11 @@
|
||||
#include <osmocom/core/talloc.h>
|
||||
#include <osmocom/core/select.h>
|
||||
|
||||
#include <osmocom/gprs/gprs_ns.h>
|
||||
#include <osmocom/gprs/gprs_bssgp.h>
|
||||
|
||||
#include <openbsc/signal.h>
|
||||
#include <openbsc/debug.h>
|
||||
#include <openbsc/gprs_ns.h>
|
||||
#include <openbsc/gprs_bssgp.h>
|
||||
#include <openbsc/gb_proxy.h>
|
||||
|
||||
struct gbprox_peer {
|
||||
@@ -121,7 +122,7 @@ static void peer_free(struct gbprox_peer *peer)
|
||||
/* FIXME: this needs to go to libosmocore/msgb.c */
|
||||
static struct msgb *msgb_copy(const struct msgb *msg, const char *name)
|
||||
{
|
||||
struct openbsc_msgb_cb *old_cb, *new_cb;
|
||||
struct libgb_msgb_cb *old_cb, *new_cb;
|
||||
struct msgb *new_msg;
|
||||
|
||||
new_msg = msgb_alloc(msg->data_len, name);
|
||||
@@ -143,8 +144,8 @@ static struct msgb *msgb_copy(const struct msgb *msg, const char *name)
|
||||
new_msg->l4h = new_msg->_data + (msg->l4h - msg->_data);
|
||||
|
||||
/* copy GB specific data */
|
||||
old_cb = OBSC_MSGB_CB(msg);
|
||||
new_cb = OBSC_MSGB_CB(new_msg);
|
||||
old_cb = LIBGB_MSGB_CB(msg);
|
||||
new_cb = LIBGB_MSGB_CB(new_msg);
|
||||
|
||||
new_cb->bssgph = new_msg->_data + (old_cb->bssgph - msg->_data);
|
||||
new_cb->llch = new_msg->_data + (old_cb->llch - msg->_data);
|
||||
@@ -245,6 +246,11 @@ static int gbprox_relay2bvci(struct msgb *msg, uint16_t ptp_bvci,
|
||||
return gbprox_relay2peer(msg, peer, ns_bvci);
|
||||
}
|
||||
|
||||
int bssgp_prim_cb(struct osmo_prim_hdr *oph, void *ctx)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Receive an incoming signalling message from a BSS-side NS-VC */
|
||||
static int gbprox_rx_sig_from_bss(struct msgb *msg, struct gprs_nsvc *nsvc,
|
||||
uint16_t ns_bvci)
|
||||
@@ -300,7 +306,7 @@ static int gbprox_rx_sig_from_bss(struct msgb *msg, struct gprs_nsvc *nsvc,
|
||||
* don't want the SGSN to reset, as the signalling endpoint
|
||||
* is common for all point-to-point BVCs (and thus all BTS) */
|
||||
if (TLVP_PRESENT(&tp, BSSGP_IE_BVCI)) {
|
||||
uint16_t bvci = ntohs(*(uint16_t *)TLVP_VAL(&tp, BSSGP_IE_BVCI));
|
||||
uint16_t bvci = ntohs(tlvp_val16_unal(&tp, BSSGP_IE_BVCI));
|
||||
LOGP(DGPRS, LOGL_INFO, "NSEI=%u Rx BVC RESET (BVCI=%u)\n",
|
||||
nsvc->nsei, bvci);
|
||||
if (bvci == 0) {
|
||||
@@ -361,7 +367,7 @@ static int gbprox_rx_paging(struct msgb *msg, struct tlv_parsed *tp,
|
||||
LOGP(DGPRS, LOGL_INFO, "NSEI=%u(SGSN) BSSGP PAGING ",
|
||||
nsvc->nsei);
|
||||
if (TLVP_PRESENT(tp, BSSGP_IE_BVCI)) {
|
||||
uint16_t bvci = ntohs(*(uint16_t *)TLVP_VAL(tp, BSSGP_IE_BVCI));
|
||||
uint16_t bvci = ntohs(tlvp_val16_unal(tp, BSSGP_IE_BVCI));
|
||||
LOGPC(DGPRS, LOGL_INFO, "routing by BVCI to peer BVCI=%u\n",
|
||||
bvci);
|
||||
} else if (TLVP_PRESENT(tp, BSSGP_IE_ROUTEING_AREA)) {
|
||||
@@ -394,7 +400,7 @@ static int rx_reset_from_sgsn(struct msgb *msg, struct tlv_parsed *tp,
|
||||
return bssgp_tx_status(BSSGP_CAUSE_MISSING_MAND_IE,
|
||||
NULL, msg);
|
||||
}
|
||||
ptp_bvci = ntohs(*(uint16_t *)TLVP_VAL(tp, BSSGP_IE_BVCI));
|
||||
ptp_bvci = ntohs(tlvp_val16_unal(tp, BSSGP_IE_BVCI));
|
||||
|
||||
if (ptp_bvci >= 2) {
|
||||
/* A reset for a PTP BVC was received, forward it to its
|
||||
@@ -458,7 +464,7 @@ static int gbprox_rx_sig_from_sgsn(struct msgb *msg, struct gprs_nsvc *nsvc,
|
||||
/* simple case: BVCI IE is mandatory */
|
||||
if (!TLVP_PRESENT(&tp, BSSGP_IE_BVCI))
|
||||
goto err_mand_ie;
|
||||
bvci = ntohs(*(uint16_t *)TLVP_VAL(&tp, BSSGP_IE_BVCI));
|
||||
bvci = ntohs(tlvp_val16_unal(&tp, BSSGP_IE_BVCI));
|
||||
rc = gbprox_relay2bvci(msg, bvci, ns_bvci);
|
||||
break;
|
||||
case BSSGP_PDUT_PAGING_PS:
|
||||
@@ -478,10 +484,9 @@ static int gbprox_rx_sig_from_sgsn(struct msgb *msg, struct gprs_nsvc *nsvc,
|
||||
"cause=0x%02x(%s) ", *TLVP_VAL(&tp, BSSGP_IE_CAUSE),
|
||||
bssgp_cause_str(*TLVP_VAL(&tp, BSSGP_IE_CAUSE)));
|
||||
if (TLVP_PRESENT(&tp, BSSGP_IE_BVCI)) {
|
||||
uint16_t *bvci = (uint16_t *)
|
||||
TLVP_VAL(&tp, BSSGP_IE_BVCI);
|
||||
uint16_t bvci = tlvp_val16_unal(&tp, BSSGP_IE_BVCI);
|
||||
LOGPC(DGPRS, LOGL_NOTICE,
|
||||
"BVCI=%u\n", ntohs(*bvci));
|
||||
"BVCI=%u\n", ntohs(bvci));
|
||||
} else
|
||||
LOGPC(DGPRS, LOGL_NOTICE, "\n");
|
||||
break;
|
||||
@@ -502,7 +507,7 @@ static int gbprox_rx_sig_from_sgsn(struct msgb *msg, struct gprs_nsvc *nsvc,
|
||||
case BSSGP_PDUT_BVC_UNBLOCK_ACK:
|
||||
if (!TLVP_PRESENT(&tp, BSSGP_IE_BVCI))
|
||||
goto err_mand_ie;
|
||||
bvci = ntohs(*(uint16_t *)TLVP_VAL(&tp, BSSGP_IE_BVCI));
|
||||
bvci = ntohs(tlvp_val16_unal(&tp, BSSGP_IE_BVCI));
|
||||
if (bvci == 0) {
|
||||
LOGP(DGPRS, LOGL_NOTICE, "NSEI=%u(SGSN) BSSGP "
|
||||
"%sBLOCK_ACK for signalling BVCI ?!?\n", nsvc->nsei,
|
||||
@@ -595,7 +600,7 @@ int gbprox_signal(unsigned int subsys, unsigned int signal,
|
||||
struct gprs_nsvc *nsvc = nssd->nsvc;
|
||||
struct gbprox_peer *peer;
|
||||
|
||||
if (subsys != SS_NS)
|
||||
if (subsys != SS_L_NS)
|
||||
return 0;
|
||||
|
||||
if (signal == S_NS_RESET && nsvc->nsei == gbcfg.nsip_sgsn_nsei) {
|
||||
@@ -609,8 +614,8 @@ int gbprox_signal(unsigned int subsys, unsigned int signal,
|
||||
if (signal == S_NS_ALIVE_EXP && nsvc->remote_end_is_sgsn) {
|
||||
LOGP(DGPRS, LOGL_NOTICE, "Tns alive expired too often, "
|
||||
"re-starting RESET procedure\n");
|
||||
nsip_connect(nsvc->nsi, &nsvc->ip.bts_addr, nsvc->nsei,
|
||||
nsvc->nsvci);
|
||||
gprs_ns_nsip_connect(nsvc->nsi, &nsvc->ip.bts_addr,
|
||||
nsvc->nsei, nsvc->nsvci);
|
||||
}
|
||||
|
||||
if (!nsvc->remote_end_is_sgsn) {
|
||||
|
||||
@@ -37,10 +37,11 @@
|
||||
#include <osmocom/core/select.h>
|
||||
#include <osmocom/core/rate_ctr.h>
|
||||
|
||||
#include <osmocom/gprs/gprs_ns.h>
|
||||
#include <osmocom/gprs/gprs_bssgp.h>
|
||||
|
||||
#include <openbsc/signal.h>
|
||||
#include <openbsc/debug.h>
|
||||
#include <openbsc/gprs_ns.h>
|
||||
#include <openbsc/gprs_bssgp.h>
|
||||
#include <openbsc/vty.h>
|
||||
#include <openbsc/gb_proxy.h>
|
||||
|
||||
@@ -199,6 +200,31 @@ static struct vty_app_info vty_info = {
|
||||
.is_config_node = bsc_vty_is_config_node,
|
||||
};
|
||||
|
||||
/* default categories */
|
||||
static struct log_info_cat gprs_categories[] = {
|
||||
[DGPRS] = {
|
||||
.name = "DGPRS",
|
||||
.description = "GPRS Packet Service",
|
||||
.enabled = 1, .loglevel = LOGL_DEBUG,
|
||||
},
|
||||
[DNS] = {
|
||||
.name = "DNS",
|
||||
.description = "GPRS Network Service (NS)",
|
||||
.enabled = 1, .loglevel = LOGL_INFO,
|
||||
},
|
||||
[DBSSGP] = {
|
||||
.name = "DBSSGP",
|
||||
.description = "GPRS BSS Gateway Protocol (BSSGP)",
|
||||
.enabled = 1, .loglevel = LOGL_DEBUG,
|
||||
},
|
||||
};
|
||||
|
||||
static const struct log_info gprs_log_info = {
|
||||
.filter_fn = gprs_log_filter_fn,
|
||||
.cat = gprs_categories,
|
||||
.num_cat = ARRAY_SIZE(gprs_categories),
|
||||
};
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
struct gsm_network dummy_network;
|
||||
@@ -213,11 +239,11 @@ int main(int argc, char **argv)
|
||||
signal(SIGUSR2, &signal_handler);
|
||||
osmo_init_ignore_signals();
|
||||
|
||||
osmo_init_logging(&log_info);
|
||||
osmo_init_logging(&gprs_log_info);
|
||||
|
||||
vty_info.copyright = openbsc_copyright;
|
||||
vty_init(&vty_info);
|
||||
logging_vty_add_cmds(&log_info);
|
||||
logging_vty_add_cmds(&gprs_log_info);
|
||||
gbproxy_vty_init();
|
||||
|
||||
handle_options(argc, argv);
|
||||
@@ -228,14 +254,16 @@ int main(int argc, char **argv)
|
||||
if (rc < 0)
|
||||
exit(1);
|
||||
|
||||
bssgp_nsi = gprs_ns_instantiate(&proxy_ns_cb);
|
||||
bssgp_nsi = gprs_ns_instantiate(&proxy_ns_cb, tall_bsc_ctx);
|
||||
if (!bssgp_nsi) {
|
||||
LOGP(DGPRS, LOGL_ERROR, "Unable to instantiate NS\n");
|
||||
exit(1);
|
||||
}
|
||||
gbcfg.nsi = bssgp_nsi;
|
||||
gprs_ns_vty_init(bssgp_nsi);
|
||||
osmo_signal_register_handler(SS_NS, &gbprox_signal, NULL);
|
||||
gprs_ns_set_log_ss(DNS);
|
||||
bssgp_set_log_ss(DBSSGP);
|
||||
osmo_signal_register_handler(SS_L_NS, &gbprox_signal, NULL);
|
||||
|
||||
rc = gbproxy_parse_config(config_file, &gbcfg);
|
||||
if (rc < 0) {
|
||||
@@ -243,7 +271,7 @@ int main(int argc, char **argv)
|
||||
exit(2);
|
||||
}
|
||||
|
||||
if (!nsvc_by_nsei(gbcfg.nsi, gbcfg.nsip_sgsn_nsei)) {
|
||||
if (!gprs_nsvc_by_nsei(gbcfg.nsi, gbcfg.nsip_sgsn_nsei)) {
|
||||
LOGP(DGPRS, LOGL_FATAL, "You cannot proxy to NSEI %u "
|
||||
"without creating that NSEI before\n",
|
||||
gbcfg.nsip_sgsn_nsei);
|
||||
|
||||
@@ -24,9 +24,10 @@
|
||||
|
||||
#include <osmocom/core/talloc.h>
|
||||
|
||||
#include <osmocom/gprs/gprs_ns.h>
|
||||
|
||||
#include <openbsc/debug.h>
|
||||
#include <openbsc/gb_proxy.h>
|
||||
#include <openbsc/gprs_ns.h>
|
||||
#include <openbsc/vty.h>
|
||||
|
||||
#include <osmocom/vty/command.h>
|
||||
@@ -39,7 +40,7 @@ static struct gbproxy_config *g_cfg = NULL;
|
||||
*/
|
||||
static struct cmd_node gbproxy_node = {
|
||||
GBPROXY_NODE,
|
||||
"%s(gbproxy)#",
|
||||
"%s(config-gbproxy)# ",
|
||||
1,
|
||||
};
|
||||
|
||||
|
||||
@@ -38,6 +38,8 @@
|
||||
#include <osmocom/core/talloc.h>
|
||||
#include <osmocom/core/rate_ctr.h>
|
||||
|
||||
#include <osmocom/gprs/gprs_bssgp.h>
|
||||
|
||||
#include <openbsc/debug.h>
|
||||
#include <openbsc/gsm_data.h>
|
||||
#include <openbsc/gsm_subscriber.h>
|
||||
@@ -45,7 +47,6 @@
|
||||
#include <openbsc/gsm_04_08_gprs.h>
|
||||
#include <openbsc/paging.h>
|
||||
#include <openbsc/transaction.h>
|
||||
#include <openbsc/gprs_bssgp.h>
|
||||
#include <openbsc/gprs_llc.h>
|
||||
#include <openbsc/gprs_sgsn.h>
|
||||
#include <openbsc/gprs_gmm.h>
|
||||
@@ -603,6 +604,9 @@ static int gsm48_rx_gmm_id_resp(struct sgsn_mm_ctx *ctx, struct msgb *msg)
|
||||
ictx->p_tmsi, ctx->p_tmsi);
|
||||
gprs_llgmm_assign(ictx->llme, ictx->tlli,
|
||||
0xffffffff, GPRS_ALGO_GEA0, NULL);
|
||||
/* FIXME: this is a hard free, we don't
|
||||
* clean-up any PDP contexts on the
|
||||
* libgtp side */
|
||||
sgsn_mm_ctx_free(ictx);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -26,16 +26,40 @@
|
||||
#include <osmocom/core/linuxlist.h>
|
||||
#include <osmocom/core/timer.h>
|
||||
#include <osmocom/core/talloc.h>
|
||||
#include <osmocom/gprs/gprs_bssgp.h>
|
||||
|
||||
#include <openbsc/gsm_data.h>
|
||||
#include <openbsc/debug.h>
|
||||
#include <openbsc/gprs_sgsn.h>
|
||||
#include <openbsc/gprs_gmm.h>
|
||||
#include <openbsc/gprs_bssgp.h>
|
||||
#include <openbsc/gprs_llc.h>
|
||||
#include <openbsc/crc24.h>
|
||||
#include <openbsc/sgsn.h>
|
||||
|
||||
/* Entry function from upper level (LLC), asking us to transmit a BSSGP PDU
|
||||
* to a remote MS (identified by TLLI) at a BTS identified by its BVCI and NSEI */
|
||||
static int _bssgp_tx_dl_ud(struct msgb *msg, struct sgsn_mm_ctx *mmctx)
|
||||
{
|
||||
struct bssgp_dl_ud_par dup;
|
||||
const uint8_t qos_profile_default[3] = { 0x00, 0x00, 0x20 };
|
||||
|
||||
memset(&dup, 0, sizeof(dup));
|
||||
/* before we have received some identity from the MS, we might
|
||||
* not yet have a MMC context (e.g. XID negotiation of primarly
|
||||
* LLC connection fro GMM sapi). */
|
||||
if (mmctx) {
|
||||
dup.imsi = mmctx->imsi;
|
||||
dup.drx_parms = mmctx->drx_parms;
|
||||
dup.ms_ra_cap.len = mmctx->ms_radio_access_capa.len;
|
||||
dup.ms_ra_cap.v = mmctx->ms_radio_access_capa.buf;
|
||||
}
|
||||
memcpy(&dup.qos_profile, qos_profile_default,
|
||||
sizeof(qos_profile_default));
|
||||
|
||||
return bssgp_tx_dl_ud(msg, 1000, &dup);
|
||||
}
|
||||
|
||||
|
||||
/* Section 8.9.9 LLC layer parameter default values */
|
||||
static const struct gprs_llc_params llc_default_params[] = {
|
||||
[1] = {
|
||||
@@ -308,7 +332,7 @@ int gprs_llc_tx_u(struct msgb *msg, uint8_t sapi, int command,
|
||||
/* Identifiers passed down: (BVCI, NSEI) */
|
||||
|
||||
/* Send BSSGP-DL-UNITDATA.req */
|
||||
return gprs_bssgp_tx_dl_ud(msg, NULL);
|
||||
return _bssgp_tx_dl_ud(msg, NULL);
|
||||
}
|
||||
|
||||
/* Send XID response to LLE */
|
||||
@@ -420,7 +444,7 @@ int gprs_llc_tx_ui(struct msgb *msg, uint8_t sapi, int command,
|
||||
/* Identifiers passed down: (BVCI, NSEI) */
|
||||
|
||||
/* Send BSSGP-DL-UNITDATA.req */
|
||||
return gprs_bssgp_tx_dl_ud(msg, mmctx);
|
||||
return _bssgp_tx_dl_ud(msg, mmctx);
|
||||
}
|
||||
|
||||
/* According to 6.4.1.6 / Figure 11 */
|
||||
|
||||
@@ -25,11 +25,13 @@
|
||||
#include <osmocom/core/talloc.h>
|
||||
#include <osmocom/core/timer.h>
|
||||
#include <osmocom/core/rate_ctr.h>
|
||||
#include <osmocom/core/backtrace.h>
|
||||
#include <osmocom/gprs/gprs_ns.h>
|
||||
#include <osmocom/gprs/gprs_bssgp.h>
|
||||
|
||||
#include <openbsc/gsm_subscriber.h>
|
||||
#include <openbsc/debug.h>
|
||||
#include <openbsc/gprs_sgsn.h>
|
||||
#include <openbsc/gprs_ns.h>
|
||||
#include <openbsc/gprs_bssgp.h>
|
||||
#include <openbsc/sgsn.h>
|
||||
#include <openbsc/gsm_04_08_gprs.h>
|
||||
#include <openbsc/gprs_gmm.h>
|
||||
@@ -172,6 +174,8 @@ struct sgsn_mm_ctx *sgsn_mm_ctx_alloc(uint32_t tlli,
|
||||
return ctx;
|
||||
}
|
||||
|
||||
/* this is a hard _free_ function, it doesn't clean up the PDP contexts
|
||||
* in libgtp! */
|
||||
void sgsn_mm_ctx_free(struct sgsn_mm_ctx *mm)
|
||||
{
|
||||
struct sgsn_pdp_ctx *pdp, *pdp2;
|
||||
@@ -214,6 +218,7 @@ struct sgsn_pdp_ctx *sgsn_pdp_ctx_by_tid(const struct sgsn_mm_ctx *mm,
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* you don't want to use this directly, call sgsn_create_pdp_ctx() */
|
||||
struct sgsn_pdp_ctx *sgsn_pdp_ctx_alloc(struct sgsn_mm_ctx *mm,
|
||||
uint8_t nsapi)
|
||||
{
|
||||
@@ -236,11 +241,26 @@ struct sgsn_pdp_ctx *sgsn_pdp_ctx_alloc(struct sgsn_mm_ctx *mm,
|
||||
return pdp;
|
||||
}
|
||||
|
||||
#include <pdp.h>
|
||||
/* you probably want to call sgsn_delete_pdp_ctx() instead */
|
||||
void sgsn_pdp_ctx_free(struct sgsn_pdp_ctx *pdp)
|
||||
{
|
||||
rate_ctr_group_free(pdp->ctrg);
|
||||
llist_del(&pdp->list);
|
||||
llist_del(&pdp->g_list);
|
||||
|
||||
/* _if_ we still have a library handle, at least set it to NULL
|
||||
* to avoid any dereferences of the now-deleted PDP context from
|
||||
* sgsn_libgtp:cb_data_ind() */
|
||||
if (pdp->lib) {
|
||||
struct pdp_t *lib = pdp->lib;
|
||||
LOGP(DGPRS, LOGL_NOTICE, "freeing PDP context that still "
|
||||
"has a libgtp handle attached to it, this shouldn't "
|
||||
"happen!\n");
|
||||
osmo_generate_backtrace();
|
||||
lib->priv = NULL;
|
||||
}
|
||||
|
||||
talloc_free(pdp);
|
||||
}
|
||||
|
||||
@@ -358,6 +378,7 @@ static void drop_one_pdp(struct sgsn_pdp_ctx *pdp)
|
||||
/* FIXME: GPRS paging in case MS is SUSPENDED */
|
||||
LOGP(DGPRS, LOGL_NOTICE, "Hard-dropping PDP ctx due to GGSN "
|
||||
"recovery\n");
|
||||
/* FIXME: how to tell this to libgtp? */
|
||||
sgsn_pdp_ctx_free(pdp);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -27,10 +27,10 @@
|
||||
#include <osmocom/core/linuxlist.h>
|
||||
#include <osmocom/core/timer.h>
|
||||
#include <osmocom/core/talloc.h>
|
||||
#include <osmocom/gprs/gprs_bssgp.h>
|
||||
|
||||
#include <openbsc/gsm_data.h>
|
||||
#include <openbsc/debug.h>
|
||||
#include <openbsc/gprs_bssgp.h>
|
||||
#include <openbsc/gprs_llc.h>
|
||||
#include <openbsc/sgsn.h>
|
||||
|
||||
|
||||
@@ -36,13 +36,13 @@
|
||||
#include <osmocom/core/talloc.h>
|
||||
#include <osmocom/core/select.h>
|
||||
#include <osmocom/core/rate_ctr.h>
|
||||
#include <openbsc/gsm_04_08_gprs.h>
|
||||
#include <osmocom/gprs/gprs_bssgp.h>
|
||||
|
||||
#include <openbsc/gsm_04_08_gprs.h>
|
||||
#include <openbsc/signal.h>
|
||||
#include <openbsc/debug.h>
|
||||
#include <openbsc/sgsn.h>
|
||||
#include <openbsc/gprs_llc.h>
|
||||
#include <openbsc/gprs_bssgp.h>
|
||||
#include <openbsc/gprs_sgsn.h>
|
||||
#include <openbsc/gprs_gmm.h>
|
||||
|
||||
@@ -317,6 +317,10 @@ static int delete_pdp_conf(struct pdp_t *pdp, void *cbp, int cause)
|
||||
/* Confirm deactivation of PDP context to MS */
|
||||
rc = gsm48_tx_gsm_deact_pdp_acc(pctx);
|
||||
|
||||
/* unlink the now non-existing library handle from the pdp
|
||||
* context */
|
||||
pctx->lib = NULL;
|
||||
|
||||
sgsn_pdp_ctx_free(pctx);
|
||||
|
||||
return rc;
|
||||
@@ -422,10 +426,16 @@ static int cb_data_ind(struct pdp_t *lib, void *packet, unsigned int len)
|
||||
|
||||
pdp = lib->priv;
|
||||
if (!pdp) {
|
||||
DEBUGP(DGPRS, "GTP DATA IND from GGSN for unknown PDP\n");
|
||||
LOGP(DGPRS, LOGL_NOTICE,
|
||||
"GTP DATA IND from GGSN for unknown PDP\n");
|
||||
return -EIO;
|
||||
}
|
||||
mm = pdp->mm;
|
||||
if (!mm) {
|
||||
LOGP(DGPRS, LOGL_ERROR,
|
||||
"PDP context (imsi=%s) without MM context!\n", mm->imsi);
|
||||
return -EIO;
|
||||
}
|
||||
|
||||
msg = msgb_alloc_headroom(len+256, 128, "GTP->SNDCP");
|
||||
ud = msgb_put(msg, len);
|
||||
@@ -446,7 +456,7 @@ static int cb_data_ind(struct pdp_t *lib, void *packet, unsigned int len)
|
||||
pinfo.ptmsi = &mm->p_tmsi;
|
||||
pinfo.drx_params = mm->drx_parms;
|
||||
pinfo.qos[0] = 0; // FIXME
|
||||
rc = gprs_bssgp_tx_paging(mm->nsei, 0, &pinfo);
|
||||
rc = bssgp_tx_paging(mm->nsei, 0, &pinfo);
|
||||
rate_ctr_inc(&mm->ctrg->ctr[GMM_CTR_PAGING_PS]);
|
||||
/* FIXME: queue the packet we received from GTP */
|
||||
break;
|
||||
|
||||
@@ -38,6 +38,9 @@
|
||||
#include <osmocom/core/rate_ctr.h>
|
||||
#include <osmocom/core/logging.h>
|
||||
|
||||
#include <osmocom/gprs/gprs_ns.h>
|
||||
#include <osmocom/gprs/gprs_bssgp.h>
|
||||
|
||||
#include <osmocom/vty/telnet_interface.h>
|
||||
#include <osmocom/vty/logging.h>
|
||||
|
||||
@@ -45,9 +48,8 @@
|
||||
#include <openbsc/debug.h>
|
||||
#include <openbsc/vty.h>
|
||||
#include <openbsc/sgsn.h>
|
||||
#include <openbsc/gprs_ns.h>
|
||||
#include <openbsc/gprs_bssgp.h>
|
||||
#include <openbsc/gprs_llc.h>
|
||||
#include <openbsc/gprs_gmm.h>
|
||||
|
||||
#include <gtp.h>
|
||||
|
||||
@@ -86,7 +88,7 @@ static int sgsn_ns_cb(enum gprs_ns_evt event, struct gprs_nsvc *nsvc,
|
||||
switch (event) {
|
||||
case GPRS_NS_EVT_UNIT_DATA:
|
||||
/* hand the message into the BSSGP implementation */
|
||||
rc = gprs_bssgp_rcvmsg(msg);
|
||||
rc = bssgp_rcvmsg(msg);
|
||||
break;
|
||||
default:
|
||||
LOGP(DGPRS, LOGL_ERROR, "SGSN: Unknown event %u from NS\n", event);
|
||||
@@ -98,6 +100,34 @@ static int sgsn_ns_cb(enum gprs_ns_evt event, struct gprs_nsvc *nsvc,
|
||||
return rc;
|
||||
}
|
||||
|
||||
/* call-back function for the BSSGP protocol */
|
||||
int bssgp_prim_cb(struct osmo_prim_hdr *oph, void *ctx)
|
||||
{
|
||||
struct osmo_bssgp_prim *bp;
|
||||
bp = container_of(oph, struct osmo_bssgp_prim, oph);
|
||||
|
||||
switch (oph->sap) {
|
||||
case SAP_BSSGP_LL:
|
||||
switch (oph->primitive) {
|
||||
case PRIM_BSSGP_UL_UD:
|
||||
return gprs_llc_rcvmsg(oph->msg, bp->tp);
|
||||
}
|
||||
break;
|
||||
case SAP_BSSGP_GMM:
|
||||
switch (oph->primitive) {
|
||||
case PRIM_BSSGP_GMM_SUSPEND:
|
||||
return gprs_gmm_rx_suspend(bp->ra_id, bp->tlli);
|
||||
case PRIM_BSSGP_GMM_RESUME:
|
||||
return gprs_gmm_rx_resume(bp->ra_id, bp->tlli,
|
||||
bp->u.resume.suspend_ref);
|
||||
}
|
||||
break;
|
||||
case SAP_BSSGP_NM:
|
||||
break;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void signal_handler(int signal)
|
||||
{
|
||||
fprintf(stdout, "signal %u received\n", signal);
|
||||
@@ -197,6 +227,64 @@ static void handle_options(int argc, char **argv)
|
||||
}
|
||||
}
|
||||
|
||||
/* default categories */
|
||||
static struct log_info_cat gprs_categories[] = {
|
||||
[DMM] = {
|
||||
.name = "DMM",
|
||||
.description = "Layer3 Mobility Management (MM)",
|
||||
.color = "\033[1;33m",
|
||||
.enabled = 1, .loglevel = LOGL_NOTICE,
|
||||
},
|
||||
[DPAG] = {
|
||||
.name = "DPAG",
|
||||
.description = "Paging Subsystem",
|
||||
.color = "\033[1;38m",
|
||||
.enabled = 1, .loglevel = LOGL_NOTICE,
|
||||
},
|
||||
[DMEAS] = {
|
||||
.name = "DMEAS",
|
||||
.description = "Radio Measurement Processing",
|
||||
.enabled = 0, .loglevel = LOGL_NOTICE,
|
||||
},
|
||||
[DREF] = {
|
||||
.name = "DREF",
|
||||
.description = "Reference Counting",
|
||||
.enabled = 0, .loglevel = LOGL_NOTICE,
|
||||
},
|
||||
[DGPRS] = {
|
||||
.name = "DGPRS",
|
||||
.description = "GPRS Packet Service",
|
||||
.enabled = 1, .loglevel = LOGL_DEBUG,
|
||||
},
|
||||
[DNS] = {
|
||||
.name = "DNS",
|
||||
.description = "GPRS Network Service (NS)",
|
||||
.enabled = 1, .loglevel = LOGL_INFO,
|
||||
},
|
||||
[DBSSGP] = {
|
||||
.name = "DBSSGP",
|
||||
.description = "GPRS BSS Gateway Protocol (BSSGP)",
|
||||
.enabled = 1, .loglevel = LOGL_DEBUG,
|
||||
},
|
||||
[DLLC] = {
|
||||
.name = "DLLC",
|
||||
.description = "GPRS Logical Link Control Protocol (LLC)",
|
||||
.enabled = 1, .loglevel = LOGL_DEBUG,
|
||||
},
|
||||
[DSNDCP] = {
|
||||
.name = "DSNDCP",
|
||||
.description = "GPRS Sub-Network Dependent Control Protocol (SNDCP)",
|
||||
.enabled = 1, .loglevel = LOGL_DEBUG,
|
||||
},
|
||||
};
|
||||
|
||||
static const struct log_info gprs_log_info = {
|
||||
.filter_fn = gprs_log_filter_fn,
|
||||
.cat = gprs_categories,
|
||||
.num_cat = ARRAY_SIZE(gprs_categories),
|
||||
};
|
||||
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
struct gsm_network dummy_network;
|
||||
@@ -211,11 +299,11 @@ int main(int argc, char **argv)
|
||||
signal(SIGUSR2, &signal_handler);
|
||||
|
||||
osmo_init_ignore_signals();
|
||||
osmo_init_logging(&log_info);
|
||||
osmo_init_logging(&gprs_log_info);
|
||||
|
||||
vty_info.copyright = openbsc_copyright;
|
||||
vty_init(&vty_info);
|
||||
logging_vty_add_cmds(&log_info);
|
||||
logging_vty_add_cmds(&gprs_log_info);
|
||||
sgsn_vty_init();
|
||||
|
||||
handle_options(argc, argv);
|
||||
@@ -225,7 +313,10 @@ int main(int argc, char **argv)
|
||||
if (rc < 0)
|
||||
exit(1);
|
||||
|
||||
sgsn_nsi = gprs_ns_instantiate(&sgsn_ns_cb);
|
||||
gprs_ns_set_log_ss(DNS);
|
||||
bssgp_set_log_ss(DBSSGP);
|
||||
|
||||
sgsn_nsi = gprs_ns_instantiate(&sgsn_ns_cb, tall_bsc_ctx);
|
||||
if (!sgsn_nsi) {
|
||||
LOGP(DGPRS, LOGL_ERROR, "Unable to instantiate NS\n");
|
||||
exit(1);
|
||||
@@ -235,10 +326,10 @@ int main(int argc, char **argv)
|
||||
gprs_llc_init("/usr/local/lib/osmocom/crypt/");
|
||||
|
||||
gprs_ns_vty_init(bssgp_nsi);
|
||||
gprs_bssgp_vty_init();
|
||||
bssgp_vty_init();
|
||||
gprs_llc_vty_init();
|
||||
gprs_sndcp_vty_init();
|
||||
/* FIXME: register signal handler for SS_NS */
|
||||
/* FIXME: register signal handler for SS_L_NS */
|
||||
|
||||
rc = sgsn_parse_config(sgsn_inst.config_file, &sgsn_inst.cfg);
|
||||
if (rc < 0) {
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
|
||||
#include <openbsc/debug.h>
|
||||
#include <openbsc/sgsn.h>
|
||||
#include <openbsc/gprs_ns.h>
|
||||
#include <osmocom/gprs/gprs_ns.h>
|
||||
#include <openbsc/gprs_sgsn.h>
|
||||
#include <openbsc/vty.h>
|
||||
#include <openbsc/gsm_04_08_gprs.h>
|
||||
@@ -106,7 +106,7 @@ static char *gprs_pdpaddr2str(uint8_t *pdpa, uint8_t len)
|
||||
|
||||
static struct cmd_node sgsn_node = {
|
||||
SGSN_NODE,
|
||||
"%s(sgsn)#",
|
||||
"%s(config-sgsn)# ",
|
||||
1,
|
||||
};
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user