mirror of
https://gitea.osmocom.org/cellular-infrastructure/osmo-mgw.git
synced 2025-11-02 13:03:33 +00:00
Compare commits
254 Commits
fairwaves/
...
sysmocom/i
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6950d14c5b | ||
|
|
cf2ca648e9 | ||
|
|
62ee416d95 | ||
|
|
e42a2ab158 | ||
|
|
9336cede84 | ||
|
|
8c6732909b | ||
|
|
960d28087e | ||
|
|
a27b295100 | ||
|
|
9015d4db52 | ||
|
|
3cda077541 | ||
|
|
c3da27fa98 | ||
|
|
bfc190e0fc | ||
|
|
f959ad8991 | ||
|
|
f3bcdd272b | ||
|
|
1d125c902f | ||
|
|
35ebbbea7a | ||
|
|
a95927c1de | ||
|
|
03ded61060 | ||
|
|
26d0326157 | ||
|
|
885a11b33e | ||
|
|
99f2477653 | ||
|
|
a9791df3b9 | ||
|
|
d9202b342c | ||
|
|
c902bd4032 | ||
|
|
ad21c3b8e3 | ||
|
|
28fdbdcd53 | ||
|
|
903ad2e135 | ||
|
|
04bfcdd6c2 | ||
|
|
3a9c52a5dc | ||
|
|
c6580c5b2c | ||
|
|
fb845bb1df | ||
|
|
6f4e83beb0 | ||
|
|
214302b306 | ||
|
|
defe78f1e1 | ||
|
|
061787878c | ||
|
|
00007897d4 | ||
|
|
5c4386c692 | ||
|
|
fc68c83ddb | ||
|
|
74101106a1 | ||
|
|
db916bfd8d | ||
|
|
a54358879f | ||
|
|
a54b47b048 | ||
|
|
3b922064a4 | ||
|
|
5b3fd465d1 | ||
|
|
0991c684d3 | ||
|
|
dc4b14b269 | ||
|
|
687270de3a | ||
|
|
96f88fda06 | ||
|
|
2ae1f5b7e0 | ||
|
|
63b99ced83 | ||
|
|
0b8e6dd2df | ||
|
|
9f2eaf8f56 | ||
|
|
afce55a4bc | ||
|
|
f3a1ca5d04 | ||
|
|
c7fcdeb18e | ||
|
|
3aa8b30bb3 | ||
|
|
208250558f | ||
|
|
bdb3f26668 | ||
|
|
69d3c26e43 | ||
|
|
3f18cfce85 | ||
|
|
658d1c3e14 | ||
|
|
6d1df9ad96 | ||
|
|
9bc1ddc849 | ||
|
|
90e2c751e9 | ||
|
|
15f6c9f1e8 | ||
|
|
5d5a25bc5a | ||
|
|
95c9f29634 | ||
|
|
30753e4a28 | ||
|
|
8fe0feb21b | ||
|
|
444a516f18 | ||
|
|
0f3bce4aef | ||
|
|
edafdc14f3 | ||
|
|
54fc3a1318 | ||
|
|
baefda5d64 | ||
|
|
8dfe9690c5 | ||
|
|
fafb074268 | ||
|
|
a3dfdcb308 | ||
|
|
bae2594424 | ||
|
|
5e007d9445 | ||
|
|
42024336fe | ||
|
|
bb81326719 | ||
|
|
276192d27c | ||
|
|
c4b9b4edbb | ||
|
|
b70dfa610d | ||
|
|
4b940126a3 | ||
|
|
debb0e3868 | ||
|
|
d025a3cfbb | ||
|
|
4b3b13e10c | ||
|
|
fa48a98e71 | ||
|
|
9fd87ecd11 | ||
|
|
8e5c63f032 | ||
|
|
2cd36e87ae | ||
|
|
0bc6c11cbf | ||
|
|
182adecb98 | ||
|
|
3d0a500f2d | ||
|
|
a5c9cea22c | ||
|
|
f45dc35321 | ||
|
|
2f6c4b6479 | ||
|
|
2385074cba | ||
|
|
d8b0b61ca8 | ||
|
|
19f0735752 | ||
|
|
ffd9968d3a | ||
|
|
deb227b98e | ||
|
|
5e611021b0 | ||
|
|
d04db9d907 | ||
|
|
3c94c2c597 | ||
|
|
372a3bd346 | ||
|
|
51bf76ef47 | ||
|
|
aa60582036 | ||
|
|
6b2623d944 | ||
|
|
8b1272a6d3 | ||
|
|
080921a551 | ||
|
|
8e7f4c6f21 | ||
|
|
4a9b871de5 | ||
|
|
93f6fa5a81 | ||
|
|
f1777ee843 | ||
|
|
9e8e0e6a29 | ||
|
|
cf3d2a1fad | ||
|
|
e4baf402cb | ||
|
|
53d782fc38 | ||
|
|
33a343858d | ||
|
|
15b1fce69c | ||
|
|
2f8117d214 | ||
|
|
8927bb46d5 | ||
|
|
d52b1c4342 | ||
|
|
5d9004bc9b | ||
|
|
a4198d1922 | ||
|
|
544a203f67 | ||
|
|
b40df4c09e | ||
|
|
5c1c0bad89 | ||
|
|
1e361301d1 | ||
|
|
9e8322ca0c | ||
|
|
9bd121b75b | ||
|
|
fa029f08c2 | ||
|
|
db9c064dd4 | ||
|
|
a0da2dbe9e | ||
|
|
7df5705251 | ||
|
|
da7424cc54 | ||
|
|
8146cfa782 | ||
|
|
330898afb7 | ||
|
|
77544a65b5 | ||
|
|
4e5ddfa91a | ||
|
|
cba441f3de | ||
|
|
3acbc817f6 | ||
|
|
bcb98b1754 | ||
|
|
2a7426d7cb | ||
|
|
b9bb2a4f54 | ||
|
|
098c14800f | ||
|
|
a46c651a4a | ||
|
|
4cc1f72cb7 | ||
|
|
4f143e52b6 | ||
|
|
e3407f8884 | ||
|
|
7d1b6b1c79 | ||
|
|
656d7cd0b4 | ||
|
|
553d2a8ceb | ||
|
|
23f22b1183 | ||
|
|
090aabe052 | ||
|
|
be37fbd85d | ||
|
|
3cc0836b1a | ||
|
|
8cd32937da | ||
|
|
377a9f5dea | ||
|
|
b8df4d5318 | ||
|
|
daa0652d3f | ||
|
|
f7436b22b3 | ||
|
|
711333c113 | ||
|
|
91f04dfe3a | ||
|
|
4371ff8cce | ||
|
|
92223cc32e | ||
|
|
2f5cc8abe0 | ||
|
|
ba47b525ff | ||
|
|
cf1707af7f | ||
|
|
d6d0d8b86f | ||
|
|
38137e84f7 | ||
|
|
82724653e7 | ||
|
|
da8d9bc355 | ||
|
|
c59e52a6aa | ||
|
|
24c4af1d82 | ||
|
|
f918920d65 | ||
|
|
292f1ce533 | ||
|
|
23e7f28c5c | ||
|
|
243c7cb044 | ||
|
|
cf2591f6fc | ||
|
|
6a2d8985bf | ||
|
|
c6794eed1d | ||
|
|
7a70a4f52a | ||
|
|
c6172a320b | ||
|
|
5280ed558c | ||
|
|
b36b910366 | ||
|
|
b47e52c958 | ||
|
|
267f6c7e0d | ||
|
|
5e47b1a1d3 | ||
|
|
b9e5403ef4 | ||
|
|
b6769b99de | ||
|
|
39daffd7a5 | ||
|
|
71d1e17e5e | ||
|
|
2c9e65051c | ||
|
|
a2ce4aa615 | ||
|
|
ee1541d504 | ||
|
|
9dcae17866 | ||
|
|
c2c5176328 | ||
|
|
a2c182df6d | ||
|
|
070f673b12 | ||
|
|
e2a10dbe35 | ||
|
|
bf30ec26e5 | ||
|
|
dcbc852125 | ||
|
|
48e091ea2b | ||
|
|
712074cb17 | ||
|
|
a34aedf7f9 | ||
|
|
2e5c13129d | ||
|
|
da5b3fcd32 | ||
|
|
5291ee5c16 | ||
|
|
5773987881 | ||
|
|
836b904e77 | ||
|
|
444d50b77f | ||
|
|
b3b8ccfa54 | ||
|
|
231aa60ce4 | ||
|
|
8b713f817d | ||
|
|
ce3b41fdb6 | ||
|
|
0f93bb80e4 | ||
|
|
477a054c2c | ||
|
|
52ddce4378 | ||
|
|
2945fd4611 | ||
|
|
2449c0ce58 | ||
|
|
5d145b5477 | ||
|
|
45b13244f0 | ||
|
|
cb91aa7e6c | ||
|
|
7ef6d9893f | ||
|
|
6aeee0a0d9 | ||
|
|
17d061bd8e | ||
|
|
ef3548c0a1 | ||
|
|
add0953692 | ||
|
|
ca3977c8fe | ||
|
|
a234287d09 | ||
|
|
8440c9f04b | ||
|
|
2cb732aeb9 | ||
|
|
a7551e033e | ||
|
|
08ed1d73f2 | ||
|
|
af9bfac58d | ||
|
|
ac9951e54a | ||
|
|
75cdeaf1e3 | ||
|
|
41f8f047bc | ||
|
|
195d2dc724 | ||
|
|
315abfd46b | ||
|
|
648b9db47f | ||
|
|
8291623054 | ||
|
|
5331cf8dbd | ||
|
|
cf8e56cd1e | ||
|
|
e157174447 | ||
|
|
493534bf56 | ||
|
|
342f59d92e | ||
|
|
aefb0c45e9 | ||
|
|
692f31446e | ||
|
|
2cde90e904 | ||
|
|
f6672ab8b0 |
@@ -1,3 +0,0 @@
|
||||
[gerrit]
|
||||
host=gerrit.osmocom.org
|
||||
project=openbsc
|
||||
12
.mailmap
12
.mailmap
@@ -1,12 +0,0 @@
|
||||
Harald Welte <laforge@gnumonks.org>
|
||||
Harald Welte <laforge@gnumonks.org> <laflocal@hanuman.gnumonks.org>
|
||||
Harald Welte <laforge@gnumonks.org> <laflocal@goeller.de.gnumonks.org>
|
||||
Holger Hans Peter Freyther <holger@moiji-mobile.com> <zecke@selfish.org>
|
||||
Holger Hans Peter Freyther <holger@moiji-mobile.com> <ich@tamarin.(none)>
|
||||
Holger Hans Peter Freyther <holgre@moiji-mobile.com> <holger@freyther.de>
|
||||
Andreas Eversberg <jolly@eversberg.eu>
|
||||
Andreas Eversberg <jolly@eversberg.eu> <Andreas.Eversberg@versatel.de>
|
||||
Andreas Eversberg <jolly@eversberg.eu> <root@nuedel.(none)>
|
||||
Pablo Neira Ayuso <pablo@soleta.eu> <pablo@gnumonks.org>
|
||||
Max Suraev <msuraev@sysmocom.de>
|
||||
Tom Tsou <tom.tsou@ettus.com> <tom@tsou.cc>
|
||||
@@ -2,50 +2,56 @@
|
||||
|
||||
set -ex
|
||||
|
||||
base="$PWD"
|
||||
deps="$base/deps"
|
||||
inst="$deps/install"
|
||||
export deps inst
|
||||
rm -rf deps/install
|
||||
mkdir deps || true
|
||||
export LD_LIBRARY_PATH=$PWD/deps/install/lib
|
||||
cd deps
|
||||
osmo-deps.sh libosmocore
|
||||
|
||||
mkdir "$deps" || true
|
||||
rm -rf "$inst"
|
||||
|
||||
osmo-build-dep.sh libosmocore "" ac_cv_path_DOXYGEN=false
|
||||
|
||||
export PKG_CONFIG_PATH="$inst/lib/pkgconfig:$PKG_CONFIG_PATH"
|
||||
export LD_LIBRARY_PATH="$inst/lib"
|
||||
|
||||
if [ "x$IU" = "x--enable-iu" ]; then
|
||||
netif_branch="sysmocom/sctp"
|
||||
sccp_branch="sysmocom/iu"
|
||||
fi
|
||||
|
||||
osmo-build-dep.sh libosmo-abis
|
||||
osmo-build-dep.sh libosmo-netif $netif_branch
|
||||
osmo-build-dep.sh libosmo-sccp $sccp_branch
|
||||
PARALLEL_MAKE="" osmo-build-dep.sh libsmpp34
|
||||
osmo-build-dep.sh openggsn
|
||||
|
||||
if [ "x$IU" = "x--enable-iu" ]; then
|
||||
osmo-build-dep.sh libasn1c
|
||||
#osmo-build-dep.sh asn1c aper-prefix # only needed for make regen in osmo-iuh
|
||||
osmo-build-dep.sh osmo-iuh
|
||||
fi
|
||||
|
||||
set +x
|
||||
echo
|
||||
echo
|
||||
echo
|
||||
echo " =============================== openbsc ==============================="
|
||||
echo
|
||||
set -x
|
||||
|
||||
cd "$base"
|
||||
cd openbsc
|
||||
cd libosmocore
|
||||
autoreconf --install --force
|
||||
./configure --enable-osmo-bsc --enable-nat $SMPP $MGCP $IU --enable-vty-tests --enable-external-tests
|
||||
$MAKE $PARALLEL_MAKE
|
||||
LD_LIBRARY_PATH="$inst/lib" $MAKE check \
|
||||
|| cat-testlogs.sh
|
||||
LD_LIBRARY_PATH="$inst/lib" $MAKE distcheck \
|
||||
|| cat-testlogs.sh
|
||||
./configure --prefix=$PWD/../install
|
||||
$MAKE $PARALLEL_MAKE install
|
||||
|
||||
|
||||
cd ../
|
||||
osmo-deps.sh libosmo-abis
|
||||
cd libosmo-abis
|
||||
autoreconf --install --force
|
||||
PKG_CONFIG_PATH=$PWD/../install/lib/pkgconfig ./configure --prefix=$PWD/../install
|
||||
PKG_CONFIG_PATH=$PWD/..//install/lib/pkgconfig $MAKE $PARALLEL_MAKE install
|
||||
|
||||
cd ../
|
||||
osmo-deps.sh libosmo-netif
|
||||
cd libosmo-netif
|
||||
autoreconf --install --force
|
||||
PKG_CONFIG_PATH=$PWD/../install/lib/pkgconfig ./configure --prefix=$PWD/../install
|
||||
PKG_CONFIG_PATH=$PWD/..//install/lib/pkgconfig $MAKE $PARALLEL_MAKE install
|
||||
|
||||
cd ../
|
||||
osmo-deps.sh libosmo-sccp
|
||||
cd libosmo-sccp
|
||||
autoreconf --install --force
|
||||
PKG_CONFIG_PATH=$PWD/../install/lib/pkgconfig ./configure --prefix=$PWD/../install
|
||||
PKG_CONFIG_PATH=$PWD/..//install/lib/pkgconfig $MAKE $PARALLEL_MAKE install
|
||||
|
||||
cd ../
|
||||
osmo-deps.sh libsmpp34
|
||||
cd libsmpp34
|
||||
autoreconf --install --force
|
||||
./configure --prefix=$PWD/../install
|
||||
$MAKE install
|
||||
|
||||
cd ../
|
||||
osmo-deps.sh openggsn
|
||||
cd openggsn
|
||||
autoreconf --install --force
|
||||
PKG_CONFIG_PATH=$PWD/../install/lib/pkgconfig ./configure --prefix=$PWD/../install
|
||||
PKG_CONFIG_PATH=$PWD/..//install/lib/pkgconfig $MAKE $PARALLEL_MAKE install
|
||||
|
||||
cd ../../openbsc
|
||||
autoreconf --install --force
|
||||
PKG_CONFIG_PATH=$PWD/../deps/install/lib/pkgconfig ./configure --enable-osmo-bsc --enable-nat $SMPP $MGCP --enable-vty-tests --enable-external-tests
|
||||
PKG_CONFIG_PATH=$PWD/../deps/install/lib/pkgconfig $MAKE $PARALLEL_MAKE
|
||||
PKG_CONFIG_PATH=$PWD/../deps/install/lib/pkgconfig LD_LIBRARY_PATH=$PWD/../deps/install/lib $MAKE check
|
||||
PKG_CONFIG_PATH=$PWD/../deps/install/lib/pkgconfig LD_LIBRARY_PATH=$PWD/../deps/install/lib $MAKE distcheck
|
||||
|
||||
36
debian/changelog
vendored
36
debian/changelog
vendored
@@ -1,38 +1,4 @@
|
||||
openbsc (0.15.1-fw.4) UNRELEASED; urgency=medium
|
||||
|
||||
* ussd: Avoid crashing when no connection is present in the transaction
|
||||
|
||||
-- Ivan Klyuchnikov <kluchnikovi@gmail.com> Tue, 16 May 2017 19:40:00 +0200
|
||||
|
||||
openbsc (0.15.1-fw.3) UNRELEASED; urgency=medium
|
||||
|
||||
* Added openbsc-dev package.
|
||||
* New release of openbsc for fairwaves build.
|
||||
|
||||
-- Ivan Klyuchnikov <kluchnikovi@gmail.com> Wed, 15 Feb 2017 21:11:04 +0200
|
||||
|
||||
openbsc (0.15.1-fw.2) UNRELEASED; urgency=medium
|
||||
|
||||
* Fixed rebase issues.
|
||||
* New release of openbsc for fairwaves build.
|
||||
|
||||
-- Ivan Klyuchnikov <kluchnikovi@gmail.com> Wed, 15 Feb 2017 17:03:24 +0200
|
||||
|
||||
openbsc (0.15.1-fw.1) UNRELEASED; urgency=medium
|
||||
|
||||
* New release of openbsc for fairwaves build.
|
||||
|
||||
-- Ivan Klyuchnikov <kluchnikovi@gmail.com> Tue, 14 Feb 2017 15:12:30 +0200
|
||||
|
||||
openbsc (0.15.1) UNRELEASED; urgency=medium
|
||||
|
||||
* Move forward toward a new release.
|
||||
* Prevent SGSN starting with 'auth-policy remote' when no 'gsup remote-*' are configured.
|
||||
Note: such configs are broken without extra workarounds anyway.
|
||||
|
||||
-- Holger Hans Peter Freyther <holger@moiji-mobile.com> Tue, 24 May 2016 23:14:31 +0200
|
||||
|
||||
openbsc (0.14.0) unstable; urgency=low
|
||||
openbsc (0.14.0) UNRELEASED; urgency=low
|
||||
|
||||
* New upstream tag and additional patches.
|
||||
|
||||
|
||||
2
debian/compat
vendored
2
debian/compat
vendored
@@ -1 +1 @@
|
||||
9
|
||||
7
|
||||
|
||||
156
debian/control
vendored
156
debian/control
vendored
@@ -1,91 +1,121 @@
|
||||
Source: openbsc
|
||||
Maintainer: Harald Welte <laforge@gnumonks.org>
|
||||
Section: net
|
||||
Priority: optional
|
||||
Build-Depends: debhelper (>= 9),
|
||||
autotools-dev,
|
||||
autoconf-archive,
|
||||
pkg-config,
|
||||
libosmocore-dev,
|
||||
libosmo-sccp-dev,
|
||||
libdbi0-dev,
|
||||
dh-autoreconf,
|
||||
libosmo-abis-dev,
|
||||
libosmo-netif-dev,
|
||||
libdbd-sqlite3,
|
||||
libpcap-dev,
|
||||
libssl-dev,
|
||||
libc-ares-dev,
|
||||
libsmpp34-dev,
|
||||
libcdk5-dev,
|
||||
libsqlite3-dev,
|
||||
libosip2-dev,
|
||||
libsofia-sip-ua-dev
|
||||
Standards-Version: 3.9.8
|
||||
Maintainer: Harald Welte <laforge@gnumonks.org>
|
||||
Build-Depends: debhelper (>= 7.0.0~), autotools-dev, pkg-config, libgtp0-dev, libosmocore-dev, libosmo-sccp-dev, libdbi0-dev, dh-autoreconf, libosmo-abis-dev, libosmo-netif-dev, libdbd-sqlite3, libpcap-dev, libssl-dev, libc-ares-dev, libsmpp34-dev
|
||||
Standards-Version: 3.8.4
|
||||
Homepage: http://openbsc.osmocom.org/
|
||||
Vcs-Git: git://bs11-abis.gnumonks.org/openbsc.git
|
||||
Vcs-Browser: http://openbsc.osmocom.org/trac/browser
|
||||
Homepage: https://projects.osmocom.org/projects/openbsc
|
||||
|
||||
Package: osmocom-bsc
|
||||
Architecture: any
|
||||
Depends: ${shlibs:Depends}, ${misc:Depends}
|
||||
Description: GSM Base Station Controller; BSC-only version of OpenBSC. Needs a real MSC!
|
||||
Classical BSC which requires MSC to operate.
|
||||
|
||||
Package: osmocom-nitb
|
||||
Architecture: any
|
||||
Depends: ${shlibs:Depends},
|
||||
${misc:Depends},
|
||||
libdbd-sqlite3
|
||||
Depends: ${shlibs:Depends}, ${misc:Depends}, libdbd-sqlite3
|
||||
Description: GSM Network-in-a-Box, implements BSC, MSC, SMSC, HLR, VLR
|
||||
This is the Network-in-a-Box version of OpenBSC. It has all the GSM network
|
||||
components bundled together. When using osmocom-nitb, there is no need for a
|
||||
Mobile Switching Center (MSC) which is needed when using osmocom-bsc.
|
||||
All the GSM network components bundled together.
|
||||
|
||||
Package: openbsc-dev
|
||||
Architecture: all
|
||||
Depends: ${misc:Depends}
|
||||
Description: Header file needed by tools tightly integrated
|
||||
Some other programs depend on gsm_data_shared.h and gsm_data_shared.c
|
||||
from OpenBSC. This package installs these files to your file system so
|
||||
that the other packages can build-depend on this package.
|
||||
.
|
||||
The directory structure is copied after the structure in the repository
|
||||
and the header and .c file are installed into /usr/src/osmocom/openbsc/.
|
||||
|
||||
Package: osmocom-meas-utils
|
||||
Package: osmocom-ipaccess-utils
|
||||
Architecture: any
|
||||
Depends: ${shlibs:Depends},
|
||||
${misc:Depends},
|
||||
libcdk5,
|
||||
sqlite3
|
||||
Description: Measurement utilities for the OpenBSC
|
||||
Measurement utilities for the OpenBSC.
|
||||
Depends: ${shlibs:Depends}, ${misc:Depends}
|
||||
Description: Command line utilities for ip.access nanoBTS
|
||||
Utilities specific for ip.access unit.
|
||||
|
||||
Package: osmocom-bs11-utils
|
||||
Architecture: any
|
||||
Depends: ${shlibs:Depends}, ${misc:Depends}
|
||||
Description: Command line utilities for Siemens BS-11 BTS
|
||||
Utilities specific for BS-11 unit.
|
||||
|
||||
Package: osmocom-sgsn
|
||||
Architecture: any
|
||||
Depends: ${shlibs:Depends}, ${misc:Depends}
|
||||
Description: Osmocom Serving GPRS Support Node
|
||||
SGSN implementation.
|
||||
|
||||
Package: osmocom-gbproxy
|
||||
Architecture: any
|
||||
Depends: ${shlibs:Depends}, ${misc:Depends}
|
||||
Description: Osmocom GPRS Gb Interface Proxy
|
||||
Proxy for Gb interface.
|
||||
|
||||
Package: osmocom-bsc-nat
|
||||
Architecture: any
|
||||
Depends: ${shlibs:Depends}, ${misc:Depends}
|
||||
Description: Osmocom Base Station Controller Network Address Translation
|
||||
Network address translation for BSC.
|
||||
|
||||
Package: osmo-gtphub
|
||||
Architecture: any
|
||||
Depends: ${shlibs:Depends}, ${misc:Depends}
|
||||
Description: Osmocom GTP Hub
|
||||
Proxy for comms between multiple SGSNs and GGSNs.
|
||||
|
||||
Package: osmocom-bsc-dbg
|
||||
Architecture: any
|
||||
Section: debug
|
||||
Priority: extra
|
||||
Depends: osmocom-bsc (= ${binary:Version}), ${misc:Depends}
|
||||
Description: Debug symbols for the OpenBSC BSC
|
||||
Make debugging possible
|
||||
|
||||
Package: osmocom-nitb-dbg
|
||||
Architecture: any
|
||||
Section: debug
|
||||
Priority: extra
|
||||
Depends: osmocom-nitb (= ${binary:Version}),
|
||||
${misc:Depends}
|
||||
Depends: osmocom-nitb (= ${binary:Version}), ${misc:Depends}
|
||||
Description: Debug symbols for the OpenBSC NITB
|
||||
Make debugging possible
|
||||
|
||||
Package: osmocom-meas-utils-dbg
|
||||
Package: osmocom-ipaccess-utils-dbg
|
||||
Architecture: any
|
||||
Section: debug
|
||||
Priority: extra
|
||||
Depends: osmocom-meas-utils (= ${binary:Version}),
|
||||
${misc:Depends}
|
||||
Description: Debug symbols for the OpenBSC measurement utilities
|
||||
Depends: osmocom-ipaccess-utils (= ${binary:Version}), ${misc:Depends}
|
||||
Description: Debug symbols for the OpenBSC ip.access utils
|
||||
Make debugging possible
|
||||
|
||||
Package: osmocom-proxy
|
||||
Architecture: any
|
||||
Depends: ${shlibs:Depends},
|
||||
${misc:Depends}
|
||||
Description: GSM Network-in-a-Box, implements BSC, MSC, SMSC, HLR, VLR
|
||||
reg and ussd proxies
|
||||
|
||||
Package: osmocom-proxy-dbg
|
||||
Package: osmocom-bs11-utils-dbg
|
||||
Architecture: any
|
||||
Section: debug
|
||||
Priority: extra
|
||||
Depends: osmocom-nitb (= ${binary:Version}),
|
||||
${misc:Depends}
|
||||
Description: Debug symbols for the OpenBSC Proxies
|
||||
Depends: osmocom-bs11-utils (= ${binary:Version}), ${misc:Depends}
|
||||
Description: Debug symbols for the OpenBSC BS11 utils
|
||||
Make debugging possible
|
||||
|
||||
Package: osmocom-sgsn-dbg
|
||||
Architecture: any
|
||||
Section: debug
|
||||
Priority: extra
|
||||
Depends: osmocom-sgsn (= ${binary:Version}), ${misc:Depends}
|
||||
Description: Debug symbols for the OpenBSC Serving GPRS Support Node
|
||||
Make debugging possible
|
||||
|
||||
Package: osmocom-gbproxy-dbg
|
||||
Architecture: any
|
||||
Section: debug
|
||||
Priority: extra
|
||||
Depends: osmocom-gbproxy (= ${binary:Version}), ${misc:Depends}
|
||||
Description: Debug symbols for the OpenBSC GPRS GBProxy
|
||||
Make debugging possible
|
||||
|
||||
Package: osmocom-bsc-nat-dbg
|
||||
Architecture: any
|
||||
Section: debug
|
||||
Priority: extra
|
||||
Depends: osmocom-bsc-nat (= ${binary:Version}), ${misc:Depends}
|
||||
Description: Debug symbols for the OpenBSC Network Address Translation
|
||||
Make debugging possible
|
||||
|
||||
Package: osmo-gtphub-dbg
|
||||
Architecture: any
|
||||
Section: debug
|
||||
Priority: extra
|
||||
Depends: osmo-gtphub (= ${binary:Version}), ${misc:Depends}
|
||||
Description: Debug symbols for Osmocom GTP Hub
|
||||
Make debugging possible
|
||||
|
||||
158
debian/copyright
vendored
158
debian/copyright
vendored
@@ -1,137 +1,47 @@
|
||||
Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
|
||||
Upstream-Name: OpenBSC
|
||||
Source: http://openbsc.osmocom.org/
|
||||
This work was packaged for Debian by:
|
||||
|
||||
Files: *
|
||||
Copyright: 2008-2015 Harald Welte <laforge@gnumonks.org>
|
||||
2008-2015 Holger Hans Peter Freyther <zecke@selfish.org>
|
||||
2009-2015 On-Waves
|
||||
2008 Jan Luebbe <jluebbe@debian.org>
|
||||
2008,2010-2011 Daniel Willmann <daniel@totalueberwachung.de>
|
||||
2009,2011,2013 Andreas Eversberg <Andreas.Eversberg@versatel.de>
|
||||
2009,2011 Dieter Spaar <spaar@mirider.augusta.de>
|
||||
2009 Mike Haben <michael.haben@btinternet.com>
|
||||
2010 Sylvain Munaut <246tnt@gmail.com>
|
||||
2012-2013 Pablo Neira Ayuso <pablo@gnumonks.org>
|
||||
2013-2015 Sysmocom s.f.m.c. GmbH (Jacob Erlbeck)
|
||||
2014 Alexander Chemeris <Alexander.Chemeris@fairwaves.co>
|
||||
License: AGPL-3+
|
||||
Comment: Contributions by Stefan Schmidt <stefan@datenfreihafen.org> as well
|
||||
Harald Welte <laforge@gnumonks.org> on Tue, 24 Aug 2010 10:55:04 +0200
|
||||
|
||||
Files: wireshark/0001-abis_oml.patch
|
||||
wireshark/0002-ericsson_rbs2409.patch
|
||||
wireshark/0003-lucent-hnb.patch
|
||||
wireshark/0005-rsl-hsl.patch
|
||||
Copyright: 1998 Gerald Combs <gerald@wireshark.org>
|
||||
2007,2011 Anders Broman <anders.broman@ericsson.com>
|
||||
2009 Holger Hans Peter Freyther <zecke@selfish.org>
|
||||
2009-2011 Harald Welte <laforge@gnumonks.org>
|
||||
License: GPL-2+
|
||||
It was downloaded from:
|
||||
|
||||
Files: openbsc/include/mISDNif.h
|
||||
Copyright: 2008 Karsten Keil <kkeil@novell.com>
|
||||
License: LGPL-2.1
|
||||
git://bs11-abis.gnumonks.org/openbsc.git
|
||||
|
||||
Files: openbsc/src/libmgcp/g711common.h
|
||||
Copyright: 2009 Abramo Bagnara <abramo@alsa-project.org>
|
||||
License: GPL-2+
|
||||
Upstream Authors:
|
||||
|
||||
Files: openbsc/git-version-gen
|
||||
Copyright: 2007-2010 Free Software Foundation
|
||||
License: GPL-3+
|
||||
Harald Welte <laforge@gnumonks.org>
|
||||
Dieter Spaar <spaar@mirider.augusta.de>
|
||||
Holger Hans Peter Freyther <zecke@selfish.org>
|
||||
Sylvain Munaut <tnt@246tNt.com>
|
||||
Daniel Willmann <daniel@totalueberwachung.de>
|
||||
Jan Luebbe <jluebbe@debian.org>
|
||||
Mike Haben <michael.haben@btinternet.com>
|
||||
Andreas Eversberg <Andreas.Eversberg@versatel.de>
|
||||
|
||||
Files: openbsc/osmoappdesc.py
|
||||
openbsc/tests/smpp_test_runner.py
|
||||
openbsc/tests/ctrl_test_runner.py
|
||||
openbsc/tests/vty_test_runner.py
|
||||
Copyright: 2013 Katerina Barone-Adesi <kat.obsc@gmail.com>
|
||||
2013 Jacob Erlbeck <jerlbeck@sysmocom.de>
|
||||
2013-2014 Holger Hans Peter Freyther <zecke@selfish.org>
|
||||
License: GPL-3+
|
||||
Copyright:
|
||||
|
||||
Files: openbsc/src/libbsc/bsc_ctrl_lookup.c
|
||||
Copyright: 2010-2011 Daniel Willmann <daniel@totalueberwachung.de>
|
||||
2010-2011 On-Waves
|
||||
License: GPL-2+
|
||||
Copyright (C) 2008-2010 Harald Welte <laforge@gnumonks.org>
|
||||
Copyright (C) 2008-2009 Dieter Spaar <spaar@mirider.augusta.de>
|
||||
Copyright (C) 2008-2010 Holger Hans Peter Freyther <zecke@selfish.org>
|
||||
Copyright (C) 2009-2010 Sylvain Munaut <tnt@246tNt.com>
|
||||
Copyright (C) 2009-2010 On-Waves
|
||||
Copyright (C) 2008 Daniel Willmann <daniel@totalueberwachung.de>
|
||||
Copyright (C) 2008 Jan Luebbe <jluebbe@debian.org>
|
||||
Copyright (C) 2009 by Mike Haben <michael.haben@btinternet.com>
|
||||
Copyright (C) 2009 Andreas Eversberg <Andreas.Eversberg@versatel.de>
|
||||
|
||||
Files: openbsc/src/libmsc/mncc_sock.c
|
||||
openbsc/src/libmsc/mncc_builtin.c
|
||||
Copyright: 2008-2010 Harald Welte <laforge@gnumonks.org>
|
||||
2009 Andreas Eversberg <Andreas.Eversberg@versatel.de>
|
||||
2012 Holger Hans Peter Freyther <zecke@selfish.org>
|
||||
License: GPL-2+
|
||||
License:
|
||||
|
||||
Files: debian/*
|
||||
Copyright: 2012-2015 Holger Hans Peter Freyther <zecke@selfish.org>
|
||||
2016 Ruben Undheim <ruben.undheim@gmail.com>
|
||||
License: GPL-2+
|
||||
GNU General Public License, Version 2 or later
|
||||
|
||||
The Debian packaging is:
|
||||
|
||||
License: AGPL-3+
|
||||
This package 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 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/>.
|
||||
Copyright (C) 2010 Harald Welte <laforge@gnumonks.org>
|
||||
|
||||
# Please chose a license for your packaging work. If the program you package
|
||||
# uses a mainstream license, using the same license is the safest choice.
|
||||
# Please avoid to pick license terms that are more restrictive than the
|
||||
# packaged work, as it may make Debian's contributions unacceptable upstream.
|
||||
# If you just want it to be GPL version 3, leave the following lines in.
|
||||
|
||||
License: GPL-2+
|
||||
This package is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 2 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 General Public License
|
||||
for more details.
|
||||
.
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
.
|
||||
On Debian systems, the complete text of the GNU General Public
|
||||
License version 2 can be found in "/usr/share/common-licenses/GPL-2".
|
||||
|
||||
|
||||
License: GPL-3+
|
||||
This package is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU 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 General Public License
|
||||
for more details.
|
||||
.
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
.
|
||||
On Debian systems, the complete text of the GNU General Public
|
||||
License version 3 can be found in "/usr/share/common-licenses/GPL-3".
|
||||
|
||||
|
||||
License: LGPL-2.1
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; version
|
||||
2.1 of the License.
|
||||
.
|
||||
This library 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
|
||||
Lesser General Public License for more details.
|
||||
.
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; if not, see <http://www.gnu.org/licenses/>.
|
||||
.
|
||||
On Debian systems, the complete text of the GNU Lesser General
|
||||
Public License version 2.1 can be found in
|
||||
"/usr/share/common-licenses/LGPL-2.1".
|
||||
and is licensed under the GPL version 3,
|
||||
see "/usr/share/common-licenses/GPL-3".
|
||||
|
||||
3
debian/openbsc-dev.install
vendored
3
debian/openbsc-dev.install
vendored
@@ -1,3 +0,0 @@
|
||||
openbsc/include/openbsc/gsm_data_shared.h usr/src/osmocom/openbsc/openbsc/include/openbsc/
|
||||
openbsc/include/openbsc/common_cs.h usr/src/osmocom/openbsc/openbsc/include/openbsc/
|
||||
openbsc/src/libcommon/gsm_data_shared.c usr/src/osmocom/openbsc/openbsc/src/libcommon/
|
||||
4
debian/osmocom-meas-utils.install
vendored
4
debian/osmocom-meas-utils.install
vendored
@@ -1,4 +0,0 @@
|
||||
/usr/bin/osmo-meas-udp2db
|
||||
/usr/bin/osmo-meas-pcap2db
|
||||
/usr/bin/meas_vis
|
||||
/usr/bin/meas_json
|
||||
9
debian/osmocom-proxy.install
vendored
9
debian/osmocom-proxy.install
vendored
@@ -1,9 +0,0 @@
|
||||
usr/bin/reg-proxy
|
||||
etc/sv/reg-proxy
|
||||
etc/service/reg-proxy
|
||||
etc/reg-proxy.config
|
||||
|
||||
usr/bin/ussd-proxy
|
||||
etc/sv/ussd-proxy
|
||||
etc/service/ussd-proxy
|
||||
etc/ussd-proxy.config
|
||||
26
debian/rules
vendored
26
debian/rules
vendored
@@ -1,4 +1,14 @@
|
||||
#!/usr/bin/make -f
|
||||
# -*- makefile -*-
|
||||
# Sample debian/rules that uses debhelper.
|
||||
#
|
||||
# This file was originally written by Joey Hess and Craig Small.
|
||||
# As a special exception, when this file is copied by dh-make into a
|
||||
# dh-make output file, you may use that output file without restriction.
|
||||
# This special exception was added by Craig Small in version 0.37 of dh-make.
|
||||
#
|
||||
# Modified to make a template file for a multi-binary package with separated
|
||||
# build-arch and build-indep targets by Bill Allombert 2001
|
||||
|
||||
# Uncomment this to turn on verbose mode.
|
||||
#export DH_VERBOSE=1
|
||||
@@ -7,20 +17,26 @@ 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')
|
||||
|
||||
export DEB_BUILD_MAINT_OPTIONS = hardening=+all
|
||||
export DEB_BUILD_HARDENING=1
|
||||
|
||||
%:
|
||||
dh $@ --sourcedirectory=openbsc --with autoreconf
|
||||
dh --sourcedirectory=openbsc --with autoreconf $@
|
||||
|
||||
# This is needed for debian stable (squeeze)
|
||||
override_dh_autoreconf:
|
||||
cd openbsc && autoreconf --install --force
|
||||
|
||||
override_dh_strip:
|
||||
dh_strip -posmocom-bsc --dbg-package=osmocom-bsc-dbg
|
||||
dh_strip -posmocom-nitb --dbg-package=osmocom-nitb-dbg
|
||||
dh_strip -posmocom-meas-utils --dbg-package=osmocom-meas-utils-dbg
|
||||
dh_strip -posmocom-proxy --dbg-package=osmocom-proxy-dbg
|
||||
dh_strip -posmocom-ipaccess-utils --dbg-package=osmocom-ipaccess-utils-dbg
|
||||
dh_strip -posmocom-bs11-utils --dbg-package=osmocom-bs11-utils-dbg
|
||||
dh_strip -posmocom-sgsn --dbg-package=osmocom-sgsn-dbg
|
||||
dh_strip -posmocom-gbproxy --dbg-package=osmocom-gbproxy-dbg
|
||||
dh_strip -posmocom-bsc-nat --dbg-package=osmocom-bsc-nat-dbg
|
||||
dh_strip -posmo-gtphub --dbg-package=osmo-gtphub-dbg
|
||||
|
||||
override_dh_auto_configure:
|
||||
echo $(VERSION) > openbsc/.tarball-version
|
||||
dh_auto_configure --sourcedirectory=openbsc -- --enable-smpp --enable-ussd-proxy
|
||||
dh_auto_configure --sourcedirectory=openbsc -- --enable-nat --enable-osmo-bsc --enable-smpp
|
||||
|
||||
|
||||
@@ -1,3 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
COMMAND_LINE="-S 172.31.0.16 -s 5040 -D 172.31.0.10 -d 5040"
|
||||
@@ -1 +0,0 @@
|
||||
../sv/reg-proxy
|
||||
@@ -1 +0,0 @@
|
||||
../sv/ussd-proxy/
|
||||
@@ -1,4 +0,0 @@
|
||||
#!/bin/sh
|
||||
LOG_FOLDER=/var/log/reg-proxy
|
||||
mkdir -p $LOG_FOLDER
|
||||
exec svlogd -tt $LOG_FOLDER
|
||||
@@ -1,6 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
. /etc/reg-proxy.config
|
||||
exec 2>&1
|
||||
echo "reg-proxy restart" | /usr/bin/ts >> /var/log/runsv.log
|
||||
exec reg-proxy $COMMAND_LINE
|
||||
@@ -1,4 +0,0 @@
|
||||
#!/bin/sh
|
||||
LOG_FOLDER=/var/log/ussd-proxy
|
||||
mkdir -p $LOG_FOLDER
|
||||
exec svlogd -tt $LOG_FOLDER
|
||||
@@ -1,6 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
. /etc/ussd-proxy.config
|
||||
exec 2>&1
|
||||
echo "ussd-proxy restart" | /usr/bin/ts >> /var/log/runsv.log
|
||||
exec ussd-proxy $COMMAND_LINE
|
||||
@@ -1,3 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
COMMAND_LINE="-t sip:172.31.0.6:5060 -u sip:172.31.0.29:5090 -l8"
|
||||
8
openbsc/.gitignore
vendored
8
openbsc/.gitignore
vendored
@@ -55,7 +55,7 @@ src/gprs/osmo-sgsn
|
||||
src/gprs/osmo-gbproxy
|
||||
src/gprs/osmo-gtphub
|
||||
src/osmo-bsc_nat/osmo-bsc_nat
|
||||
src/libcommon/gsup_test_client
|
||||
src/osmo-cscn/osmo-cscn
|
||||
|
||||
#tests
|
||||
tests/testsuite.dir
|
||||
@@ -82,11 +82,6 @@ tests/subscr/subscr_test
|
||||
tests/oap/oap_test
|
||||
tests/gtphub/gtphub_test
|
||||
tests/mm_auth/mm_auth_test
|
||||
tests/xid/xid_test
|
||||
tests/sndcp_xid/sndcp_xid_test
|
||||
tests/slhc/slhc_test
|
||||
tests/v42bis/v42bis_test
|
||||
tests/nanobts_omlattr/nanobts_omlattr_test
|
||||
|
||||
tests/atconfig
|
||||
tests/atlocal
|
||||
@@ -94,7 +89,6 @@ tests/package.m4
|
||||
tests/testsuite
|
||||
tests/testsuite.log
|
||||
|
||||
gsn_restart
|
||||
src/openbsc.cfg*
|
||||
writtenconfig/
|
||||
gtphub_restart_count
|
||||
|
||||
@@ -1,19 +1,7 @@
|
||||
AUTOMAKE_OPTIONS = foreign dist-bzip2 1.6
|
||||
|
||||
## FIXME: automake >= 1.13 or autoconf >= 2.70 provide better suited AC_CONFIG_MACRO_DIRS for configure.ac
|
||||
## remove line below when OE toolchain is updated to version which include those
|
||||
ACLOCAL_AMFLAGS = -I m4
|
||||
AM_CPPFLAGS = \
|
||||
$(all_includes) \
|
||||
-I$(top_srcdir)/include \
|
||||
$(NULL)
|
||||
|
||||
SUBDIRS = \
|
||||
doc \
|
||||
include \
|
||||
src \
|
||||
tests \
|
||||
$(NULL)
|
||||
AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include
|
||||
SUBDIRS = doc include src tests
|
||||
|
||||
pkgconfigdir = $(libdir)/pkgconfig
|
||||
pkgconfig_DATA = openbsc.pc
|
||||
|
||||
@@ -3,9 +3,6 @@ AC_INIT([openbsc],
|
||||
m4_esyscmd([./git-version-gen .tarball-version]),
|
||||
[openbsc@lists.osmocom.org])
|
||||
|
||||
dnl *This* is the root dir, even if an install-sh exists in ../ or ../../
|
||||
AC_CONFIG_AUX_DIR([.])
|
||||
|
||||
AM_INIT_AUTOMAKE([dist-bzip2])
|
||||
AC_CONFIG_TESTDIR(tests)
|
||||
|
||||
@@ -18,31 +15,22 @@ AC_PROG_CC
|
||||
AC_PROG_INSTALL
|
||||
AC_PROG_RANLIB
|
||||
|
||||
dnl check for pkg-config (explained in detail in libosmocore/configure.ac)
|
||||
AC_PATH_PROG(PKG_CONFIG_INSTALLED, pkg-config, no)
|
||||
if test "x$PKG_CONFIG_INSTALLED" = "xno"; then
|
||||
AC_MSG_WARN([You need to install pkg-config])
|
||||
fi
|
||||
PKG_PROG_PKG_CONFIG([0.20])
|
||||
|
||||
dnl check for AX_CHECK_COMPILE_FLAG
|
||||
m4_ifdef([AX_CHECK_COMPILE_FLAG], [], [
|
||||
AC_MSG_ERROR([Please install autoconf-archive; re-run 'autoreconf -fi' for it to take effect.])
|
||||
])
|
||||
|
||||
dnl checks for libraries
|
||||
AC_SEARCH_LIBS([dlopen], [dl dld], [LIBRARY_DL="$LIBS";LIBS=""])
|
||||
AC_SUBST(LIBRARY_DL)
|
||||
|
||||
|
||||
PKG_CHECK_MODULES(LIBOSMOCORE, libosmocore >= 0.9.5)
|
||||
PKG_CHECK_MODULES(LIBOSMOCORE, libosmocore >= 0.6.4)
|
||||
PKG_CHECK_MODULES(LIBOSMOVTY, libosmovty >= 0.3.0)
|
||||
PKG_CHECK_MODULES(LIBOSMOCTRL, libosmoctrl)
|
||||
PKG_CHECK_MODULES(LIBOSMOGSM, libosmogsm >= 0.9.5)
|
||||
PKG_CHECK_MODULES(LIBOSMOGSM, libosmogsm >= 0.7.0)
|
||||
PKG_CHECK_MODULES(LIBOSMOABIS, libosmoabis >= 0.2.0)
|
||||
PKG_CHECK_MODULES(LIBOSMOGB, libosmogb >= 0.6.4)
|
||||
PKG_CHECK_MODULES(LIBOSMONETIF, libosmo-netif >= 0.0.1)
|
||||
PKG_CHECK_MODULES(LIBCRYPTO, libcrypto >= 0.9.5)
|
||||
PKG_CHECK_MODULES(LIBASN1C, libasn1c)
|
||||
PKG_CHECK_MODULES(LIBOSMORANAP, libosmo-ranap)
|
||||
PKG_CHECK_MODULES(LIBOSMOSIGTRAN, libosmo-sigtran)
|
||||
|
||||
# Enabke/disable the NAT?
|
||||
AC_ARG_ENABLE([nat], [AS_HELP_STRING([--enable-nat], [Build the BSC NAT. Requires SCCP])],
|
||||
@@ -62,7 +50,7 @@ fi
|
||||
AM_CONDITIONAL(BUILD_BSC, test "x$osmo_ac_build_bsc" = "xyes")
|
||||
AC_SUBST(osmo_ac_build_bsc)
|
||||
|
||||
# Enable/disable smpp support in the nitb?
|
||||
# Enable/disable smpp support in the cscn?
|
||||
AC_ARG_ENABLE([smpp], [AS_HELP_STRING([--enable-smpp], [Build the SMPP interface])],
|
||||
[osmo_ac_build_smpp="$enableval"],[osmo_ac_build_smpp="no"])
|
||||
if test "$osmo_ac_build_smpp" = "yes" ; then
|
||||
@@ -78,7 +66,7 @@ AC_ARG_ENABLE([mgcp-transcoding], [AS_HELP_STRING([--enable-mgcp-transcoding], [
|
||||
AC_ARG_WITH([g729], [AS_HELP_STRING([--with-g729], [Enable G.729 encoding/decoding.])], [osmo_ac_with_g729="$withval"],[osmo_ac_with_g729="no"])
|
||||
|
||||
if test "$osmo_ac_mgcp_transcoding" = "yes" ; then
|
||||
AC_SEARCH_LIBS([gsm_create], [gsm], [LIBRARY_GSM="$LIBS";LIBS=""], [AC_MSG_ERROR([--enable-mgcp-transcoding: cannot find usable libgsm])])
|
||||
AC_SEARCH_LIBS([gsm_create], [gsm], [LIBRARY_GSM="$LIBS";LIBS=""])
|
||||
AC_SUBST(LIBRARY_GSM)
|
||||
if test "$osmo_ac_with_g729" = "yes" ; then
|
||||
PKG_CHECK_MODULES(LIBBCG729, libbcg729 >= 0.1, [AC_DEFINE([HAVE_BCG729], [1], [Use bgc729 decoder/encoder])])
|
||||
@@ -88,18 +76,6 @@ fi
|
||||
AM_CONDITIONAL(BUILD_MGCP_TRANSCODING, test "x$osmo_ac_mgcp_transcoding" = "xyes")
|
||||
AC_SUBST(osmo_ac_mgcp_transcoding)
|
||||
|
||||
# Enable/disable 3G aka IuPS + IuCS support?
|
||||
AC_ARG_ENABLE([iu], [AS_HELP_STRING([--enable-iu], [Build 3G support, aka IuPS and IuCS interfaces])],
|
||||
[osmo_ac_iu="$enableval"],[osmo_ac_iu="no"])
|
||||
if test "x$osmo_ac_iu" = "xyes" ; then
|
||||
PKG_CHECK_MODULES(LIBASN1C, libasn1c) # TODO version?
|
||||
PKG_CHECK_MODULES(LIBOSMORANAP, libosmo-ranap) # TODO version?
|
||||
PKG_CHECK_MODULES(LIBOSMOSIGTRAN, libosmo-sigtran) # TODO version?
|
||||
AC_DEFINE(BUILD_IU, 1, [Define if we want to build IuPS and IuCS interfaces support])
|
||||
fi
|
||||
AM_CONDITIONAL(BUILD_IU, test "x$osmo_ac_iu" = "xyes")
|
||||
AC_SUBST(osmo_ac_iu)
|
||||
|
||||
|
||||
found_libgtp=yes
|
||||
PKG_CHECK_MODULES(LIBGTP, libgtp >= 0.92, , found_libgtp=no)
|
||||
@@ -145,13 +121,6 @@ AC_COMPILE_IFELSE([AC_LANG_SOURCE([char foo;])],
|
||||
CFLAGS="$saved_CFLAGS"
|
||||
AC_SUBST(SYMBOL_VISIBILITY)
|
||||
|
||||
AX_CHECK_COMPILE_FLAG([-Werror=implicit], [CFLAGS="$CFLAGS -Werror=implicit"])
|
||||
AX_CHECK_COMPILE_FLAG([-Werror=maybe-uninitialized], [CFLAGS="$CFLAGS -Werror=maybe-uninitialized"])
|
||||
AX_CHECK_COMPILE_FLAG([-Werror=memset-transposed-args], [CFLAGS="$CFLAGS -Werror=memset-transposed-args"])
|
||||
AX_CHECK_COMPILE_FLAG([-Werror=null-dereference], [CFLAGS="$CFLAGS -Werror=null-dereference"])
|
||||
AX_CHECK_COMPILE_FLAG([-Werror=sizeof-array-argument], [CFLAGS="$CFLAGS -Werror=sizeof-array-argument"])
|
||||
AX_CHECK_COMPILE_FLAG([-Werror=sizeof-pointer-memaccess], [CFLAGS="$CFLAGS -Werror=sizeof-pointer-memaccess"])
|
||||
|
||||
# Coverage build taken from WebKit's configure.in
|
||||
AC_MSG_CHECKING([whether to enable code coverage support])
|
||||
AC_ARG_ENABLE(coverage,
|
||||
@@ -211,18 +180,6 @@ AC_MSG_CHECKING([whether to enable VTY/CTRL tests])
|
||||
AC_MSG_RESULT([$enable_ext_tests])
|
||||
AM_CONDITIONAL(ENABLE_EXT_TESTS, test "x$enable_ext_tests" = "xyes")
|
||||
|
||||
|
||||
# Enable/disable ussd_proxy utility
|
||||
AC_ARG_ENABLE([ussd_proxy], [AS_HELP_STRING([--enable-ussd-proxy], [Build the USSD MAP SUP to SIP proxy])],
|
||||
[osmo_ac_build_ussd_proxy="$enableval"],[osmo_ac_build_ussd_proxy="no"])
|
||||
if test "$osmo_ac_build_ussd_proxy" = "yes" ; then
|
||||
PKG_CHECK_MODULES(LIBSOFIA_SIP_UA, sofia-sip-ua >= 1.10)
|
||||
AC_DEFINE(BUILD_USSD_PROXY, 1, [Define if we want to build ussd_proxy])
|
||||
fi
|
||||
AM_CONDITIONAL(BUILD_USSD_PROXY, test "x$osmo_ac_build_ussd_proxy" = "xyes")
|
||||
AC_SUBST(osmo_ac_build_smpp)
|
||||
|
||||
|
||||
dnl Generate the output
|
||||
AM_CONFIG_HEADER(bscconfig.h)
|
||||
|
||||
@@ -238,18 +195,17 @@ AC_OUTPUT(
|
||||
src/libcommon/Makefile
|
||||
src/libfilter/Makefile
|
||||
src/libiu/Makefile
|
||||
src/libcommon-cs/Makefile
|
||||
src/osmo-nitb/Makefile
|
||||
src/libxsc/Makefile
|
||||
src/osmo-cscn/Makefile
|
||||
src/osmo-bsc/Makefile
|
||||
src/osmo-bsc_nat/Makefile
|
||||
src/osmo-bsc_mgcp/Makefile
|
||||
src/ipaccess/Makefile
|
||||
src/utils/Makefile
|
||||
src/gprs/Makefile
|
||||
src/reg-proxy/Makefile
|
||||
src/ussd-proxy/Makefile
|
||||
tests/Makefile
|
||||
tests/atlocal
|
||||
tests/libiudummy/Makefile
|
||||
tests/gsm0408/Makefile
|
||||
tests/db/Makefile
|
||||
tests/channel/Makefile
|
||||
@@ -267,12 +223,6 @@ AC_OUTPUT(
|
||||
tests/oap/Makefile
|
||||
tests/gtphub/Makefile
|
||||
tests/mm_auth/Makefile
|
||||
tests/xid/Makefile
|
||||
tests/sndcp_xid/Makefile
|
||||
tests/slhc/Makefile
|
||||
tests/v42bis/Makefile
|
||||
tests/nanobts_omlattr/Makefile
|
||||
tests/ussd/Makefile
|
||||
doc/Makefile
|
||||
doc/examples/Makefile
|
||||
Makefile)
|
||||
|
||||
@@ -1,99 +1,104 @@
|
||||
#!/usr/bin/python
|
||||
# -*- mode: python-mode; py-indent-tabs-mode: nil -*-
|
||||
|
||||
import sys,os
|
||||
from optparse import OptionParser
|
||||
from ipa import Ctrl
|
||||
import socket
|
||||
import struct
|
||||
|
||||
verbose = False
|
||||
|
||||
def prefix_ipa_ctrl_header(data):
|
||||
return struct.pack(">HBB", len(data)+1, 0xee, 0) + data
|
||||
|
||||
def remove_ipa_ctrl_header(data):
|
||||
if (len(data) < 4):
|
||||
raise BaseException("Answer too short!")
|
||||
(plen, ipa_proto, osmo_proto) = struct.unpack(">HBB", data[:4])
|
||||
if (plen + 3 > len(data)):
|
||||
print "Warning: Wrong payload length (expected %i, got %i)" % (plen, len(data) - 3)
|
||||
if (ipa_proto != 0xee or osmo_proto != 0):
|
||||
raise BaseException("Wrong protocol in answer!")
|
||||
|
||||
return data[4:plen+3], data[plen+3:]
|
||||
|
||||
def connect(host, port):
|
||||
if verbose:
|
||||
print "Connecting to host %s:%i" % (host, port)
|
||||
if verbose:
|
||||
print "Connecting to host %s:%i" % (host, port)
|
||||
|
||||
sck = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
|
||||
sck.setblocking(1)
|
||||
sck.connect((host, port))
|
||||
return sck
|
||||
sck = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
|
||||
sck.setblocking(1)
|
||||
sck.connect((host, port))
|
||||
return sck
|
||||
|
||||
def do_set_get(sck, var, value = None):
|
||||
(r, c) = Ctrl().cmd(var, value)
|
||||
sck.send(c)
|
||||
answer = Ctrl().rem_header(sck.recv(4096))
|
||||
return (answer,) + Ctrl().verify(answer, r, var, value)
|
||||
def send(sck, data):
|
||||
if verbose:
|
||||
print "Sending \"%s\"" %(data)
|
||||
data = prefix_ipa_ctrl_header(data)
|
||||
sck.send(data)
|
||||
|
||||
def set_var(sck, var, val):
|
||||
(a, _, _) = do_set_get(sck, var, val)
|
||||
return a
|
||||
def do_set(var, value, id, sck):
|
||||
setmsg = "SET %s %s %s" %(options.id, var, value)
|
||||
send(sck, setmsg)
|
||||
|
||||
def get_var(sck, var):
|
||||
(_, _, v) = do_set_get(sck, var)
|
||||
return v
|
||||
def do_get(var, id, sck):
|
||||
getmsg = "GET %s %s" %(options.id, var)
|
||||
send(sck, getmsg)
|
||||
|
||||
def _leftovers(sck, fl):
|
||||
"""
|
||||
Read outstanding data if any according to flags
|
||||
"""
|
||||
try:
|
||||
data = sck.recv(1024, fl)
|
||||
except socket.error as (s_errno, strerror):
|
||||
return False
|
||||
if len(data) != 0:
|
||||
tail = data
|
||||
while True:
|
||||
(head, tail) = Ctrl().split_combined(tail)
|
||||
print "Got message:", Ctrl().rem_header(head)
|
||||
if len(tail) == 0:
|
||||
break
|
||||
return True
|
||||
return False
|
||||
parser = OptionParser("Usage: %prog [options] var [value]")
|
||||
parser.add_option("-d", "--host", dest="host",
|
||||
help="connect to HOST", metavar="HOST")
|
||||
parser.add_option("-p", "--port", dest="port", type="int",
|
||||
help="use PORT", metavar="PORT", default=4249)
|
||||
parser.add_option("-g", "--get", action="store_true",
|
||||
dest="cmd_get", help="perform GET operation")
|
||||
parser.add_option("-s", "--set", action="store_true",
|
||||
dest="cmd_set", help="perform SET operation")
|
||||
parser.add_option("-i", "--id", dest="id", default="1",
|
||||
help="set id manually", metavar="ID")
|
||||
parser.add_option("-v", "--verbose", action="store_true",
|
||||
dest="verbose", help="be verbose", default=False)
|
||||
parser.add_option("-m", "--monitor", action="store_true",
|
||||
dest="monitor", help="monitor the connection for traps", default=False)
|
||||
|
||||
if __name__ == '__main__':
|
||||
parser = OptionParser("Usage: %prog [options] var [value]")
|
||||
parser.add_option("-d", "--host", dest="host",
|
||||
help="connect to HOST", metavar="HOST")
|
||||
parser.add_option("-p", "--port", dest="port", type="int",
|
||||
help="use PORT", metavar="PORT", default=4249)
|
||||
parser.add_option("-g", "--get", action="store_true",
|
||||
dest="cmd_get", help="perform GET operation")
|
||||
parser.add_option("-s", "--set", action="store_true",
|
||||
dest="cmd_set", help="perform SET operation")
|
||||
parser.add_option("-v", "--verbose", action="store_true",
|
||||
dest="verbose", help="be verbose", default=False)
|
||||
parser.add_option("-m", "--monitor", action="store_true",
|
||||
dest="monitor", help="monitor the connection for traps", default=False)
|
||||
(options, args) = parser.parse_args()
|
||||
|
||||
(options, args) = parser.parse_args()
|
||||
verbose = options.verbose
|
||||
|
||||
verbose = options.verbose
|
||||
if options.cmd_set and options.cmd_get:
|
||||
parser.error("Get and set options are mutually exclusive!")
|
||||
|
||||
if options.cmd_set and options.cmd_get:
|
||||
parser.error("Get and set options are mutually exclusive!")
|
||||
if not (options.cmd_get or options.cmd_set or options.monitor):
|
||||
parser.error("One of -m, -g, or -s must be set")
|
||||
|
||||
if not (options.cmd_get or options.cmd_set or options.monitor):
|
||||
parser.error("One of -m, -g, or -s must be set")
|
||||
if not (options.host):
|
||||
parser.error("Destination host and port required!")
|
||||
|
||||
if not (options.host):
|
||||
parser.error("Destination host and port required!")
|
||||
sock = connect(options.host, options.port)
|
||||
|
||||
sock = connect(options.host, options.port)
|
||||
if options.cmd_set:
|
||||
if len(args) < 2:
|
||||
parser.error("Set requires var and value arguments")
|
||||
do_set(args[0], ' '.join(args[1:]), options.id, sock)
|
||||
|
||||
if options.cmd_set:
|
||||
if len(args) < 2:
|
||||
parser.error("Set requires var and value arguments")
|
||||
_leftovers(sock, socket.MSG_DONTWAIT)
|
||||
print "Got message:", set_var(sock, args[0], ' '.join(args[1:]))
|
||||
if options.cmd_get:
|
||||
if len(args) != 1:
|
||||
parser.error("Get requires the var argument")
|
||||
do_get(args[0], options.id, sock)
|
||||
|
||||
if options.cmd_get:
|
||||
if len(args) != 1:
|
||||
parser.error("Get requires the var argument")
|
||||
_leftovers(sock, socket.MSG_DONTWAIT)
|
||||
(a, _, _) = do_set_get(sock, args[0])
|
||||
print "Got message:", a
|
||||
data = sock.recv(1024)
|
||||
while (len(data)>0):
|
||||
(answer, data) = remove_ipa_ctrl_header(data)
|
||||
print "Got message:", answer
|
||||
|
||||
if options.monitor:
|
||||
while True:
|
||||
if not _leftovers(sock, 0):
|
||||
print "Connection is gone."
|
||||
break
|
||||
sock.close()
|
||||
if options.monitor:
|
||||
while (True):
|
||||
data = sock.recv(1024)
|
||||
if len(data) == 0:
|
||||
print "Connection is gone."
|
||||
break
|
||||
|
||||
while (len(data)>0):
|
||||
(answer, data) = remove_ipa_ctrl_header(data)
|
||||
print "Got message:", answer
|
||||
|
||||
sock.close()
|
||||
|
||||
@@ -1,147 +0,0 @@
|
||||
#!/usr/bin/python2
|
||||
|
||||
mod_license = '''
|
||||
/*
|
||||
* Copyright (C) 2016 sysmocom s.f.m.c. GmbH
|
||||
*
|
||||
* All Rights Reserved
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU 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 General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along
|
||||
* with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*/
|
||||
'''
|
||||
|
||||
import sys, argparse, random, logging, tornado.ioloop, tornado.web, tornado.tcpclient, tornado.httpclient, eventsource, bsc_control
|
||||
from eventsource import listener, request
|
||||
|
||||
'''
|
||||
N. B: this is not an example of building proper REST API or building secure web application.
|
||||
It's only purpose is to illustrate conversion of Osmocom's Control Interface to web-friendly API.
|
||||
Exposing this to Internet while connected to production network might lead to all sorts of mischief and mayhem
|
||||
from NSA' TAO breaking into your network to zombie apocalypse. Do NOT do that.
|
||||
'''
|
||||
|
||||
token = None
|
||||
stream = None
|
||||
url = None
|
||||
|
||||
'''
|
||||
Returns json according to following schema - see http://json-schema.org/documentation.html for details:
|
||||
{
|
||||
"title": "Ctrl Schema",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"variable": {
|
||||
"type": "string"
|
||||
},
|
||||
"varlue": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"required": ["interface", "variable", "value"]
|
||||
}
|
||||
Example validation from command-line:
|
||||
json validate --schema-file=schema.json --document-file=data.json
|
||||
The interface is represented as string because it might look different for IPv4 vs v6.
|
||||
'''
|
||||
|
||||
def read_header(data):
|
||||
t_length = bsc_control.ipa_ctrl_header(data)
|
||||
if (t_length):
|
||||
stream.read_bytes(t_length - 1, callback = read_trap)
|
||||
else:
|
||||
print >> sys.stderr, "protocol error: length missing in %s!" % data
|
||||
|
||||
@tornado.gen.coroutine
|
||||
def read_trap(data):
|
||||
(t, z, v, p) = data.split()
|
||||
if (t != 'TRAP' or int(z) != 0):
|
||||
print >> sys.stderr, "protocol error: TRAP != %s or 0! = %d" % (t, int(z))
|
||||
else:
|
||||
yield tornado.httpclient.AsyncHTTPClient().fetch(tornado.httpclient.HTTPRequest(url = "%s/%s/%s" % (url, "ping", token),
|
||||
method = 'POST',
|
||||
headers = {'Content-Type': 'application/json'},
|
||||
body = tornado.escape.json_encode({ 'variable' : v, 'value' : p })))
|
||||
stream.read_bytes(4, callback = read_header)
|
||||
|
||||
@tornado.gen.coroutine
|
||||
def trap_setup(host, port, target_host, target_port, tk):
|
||||
global stream
|
||||
global url
|
||||
global token
|
||||
token = tk
|
||||
url = "http://%s:%s/sse" % (host, port)
|
||||
stream = yield tornado.tcpclient.TCPClient().connect(target_host, target_port)
|
||||
stream.read_bytes(4, callback = read_header)
|
||||
|
||||
def get_v(s, v):
|
||||
return { 'variable' : v, 'value' : bsc_control.get_var(s, tornado.escape.native_str(v)) }
|
||||
|
||||
class CtrlHandler(tornado.web.RequestHandler):
|
||||
def initialize(self):
|
||||
self.skt = bsc_control.connect(self.settings['ctrl_host'], self.settings['ctrl_port'])
|
||||
|
||||
def get(self, v):
|
||||
self.write(get_v(self.skt, v))
|
||||
|
||||
def post(self):
|
||||
self.write(get_v(self.skt, self.get_argument("variable")))
|
||||
|
||||
class SetCtrl(CtrlHandler):
|
||||
def get(self, var, val):
|
||||
bsc_control.set_var(self.skt, tornado.escape.native_str(var), tornado.escape.native_str(val))
|
||||
super(SetCtrl, self).get(tornado.escape.native_str(var))
|
||||
|
||||
def post(self):
|
||||
bsc_control.set_var(self.skt, tornado.escape.native_str(self.get_argument("variable")), tornado.escape.native_str(self.get_argument("value")))
|
||||
super(SetCtrl, self).post()
|
||||
|
||||
class Slash(tornado.web.RequestHandler):
|
||||
def get(self):
|
||||
self.write('<html><head><title>%s</title></head><body>Using Tornado framework v%s'
|
||||
'<form action="/get" method="POST">'
|
||||
'<input type="text" name="variable">'
|
||||
'<input type="submit" value="GET">'
|
||||
'</form>'
|
||||
'<form action="/set" method="POST">'
|
||||
'<input type="text" name="variable">'
|
||||
'<input type="text" name="value">'
|
||||
'<input type="submit" value="SET">'
|
||||
'</form>'
|
||||
'</body></html>' % ("Osmocom Control Interface Proxy", tornado.version))
|
||||
|
||||
if __name__ == '__main__':
|
||||
p = argparse.ArgumentParser(description='Osmocom Control Interface proxy.')
|
||||
p.add_argument('-c', '--control-port', type = int, default = 4252, help = "Target Control Interface port")
|
||||
p.add_argument('-a', '--control-host', default = 'localhost', help = "Target Control Interface adress")
|
||||
p.add_argument('-b', '--host', default = 'localhost', help = "Adress to bind proxy's web interface")
|
||||
p.add_argument('-p', '--port', type = int, default = 6969, help = "Port to bind proxy's web interface")
|
||||
p.add_argument('-d', '--debug', action='store_true', help = "Activate debugging (default off)")
|
||||
p.add_argument('-t', '--token', default = 'osmocom', help = "Token to be used by SSE client in URL e. g. http://127.0.0.1:8888/poll/osmocom where 'osmocom' is default token value")
|
||||
p.add_argument('-k', '--keepalive', type = int, default = 5000, help = "Timeout betwwen keepalive messages, in milliseconds, defaults to 5000")
|
||||
args = p.parse_args()
|
||||
random.seed()
|
||||
tornado.netutil.Resolver.configure('tornado.netutil.ThreadedResolver') # Use non-blocking resolver
|
||||
logging.basicConfig()
|
||||
application = tornado.web.Application([
|
||||
(r"/", Slash),
|
||||
(r"/get", CtrlHandler),
|
||||
(r"/get/(.*)", CtrlHandler),
|
||||
(r"/set", SetCtrl),
|
||||
(r"/set/(.*)/(.*)", SetCtrl),
|
||||
(r"/sse/(.*)/(.*)", listener.EventSourceHandler, dict(event_class = listener.JSONIdEvent, keepalive = args.keepalive)),
|
||||
], debug = args.debug, ctrl_host = args.control_host, ctrl_port = args.control_port)
|
||||
application.listen(address = args.host, port = args.port)
|
||||
trap_setup(args.host, args.port, application.settings['ctrl_host'], application.settings['ctrl_port'], args.token)
|
||||
tornado.ioloop.IOLoop.instance().start()
|
||||
@@ -1,278 +0,0 @@
|
||||
#!/usr/bin/python3
|
||||
# -*- mode: python-mode; py-indent-tabs-mode: nil -*-
|
||||
"""
|
||||
/*
|
||||
* Copyright (C) 2016 sysmocom s.f.m.c. GmbH
|
||||
*
|
||||
* All Rights Reserved
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU 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 General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along
|
||||
* with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*/
|
||||
"""
|
||||
|
||||
import struct, random, sys
|
||||
|
||||
class IPA(object):
|
||||
"""
|
||||
Stateless IPA protocol multiplexer: add/remove/parse (extended) header
|
||||
"""
|
||||
version = "0.0.5"
|
||||
TCP_PORT_OML = 3002
|
||||
TCP_PORT_RSL = 3003
|
||||
# OpenBSC extensions: OSMO, MGCP_OLD
|
||||
PROTO = dict(RSL=0x00, CCM=0xFE, SCCP=0xFD, OML=0xFF, OSMO=0xEE, MGCP_OLD=0xFC)
|
||||
# ...OML Router Control, GSUP GPRS extension, Osmocom Authn Protocol
|
||||
EXT = dict(CTRL=0, MGCP=1, LAC=2, SMSC=3, ORC=4, GSUP=5, OAP=6)
|
||||
# OpenBSC extension: SCCP_OLD
|
||||
MSGT = dict(PING=0x00, PONG=0x01, ID_GET=0x04, ID_RESP=0x05, ID_ACK=0x06, SCCP_OLD=0xFF)
|
||||
_IDTAG = dict(SERNR=0, UNITNAME=1, LOCATION=2, TYPE=3, EQUIPVERS=4, SWVERSION=5, IPADDR=6, MACADDR=7, UNIT=8)
|
||||
CTRL_GET = 'GET'
|
||||
CTRL_SET = 'SET'
|
||||
CTRL_REP = 'REPLY'
|
||||
CTRL_ERR = 'ERR'
|
||||
CTRL_TRAP = 'TRAP'
|
||||
|
||||
def _l(self, d, p):
|
||||
"""
|
||||
Reverse dictionary lookup: return key for a given value
|
||||
"""
|
||||
if p is None:
|
||||
return 'UNKNOWN'
|
||||
return list(d.keys())[list(d.values()).index(p)]
|
||||
|
||||
def _tag(self, t, v):
|
||||
"""
|
||||
Create TAG as TLV data
|
||||
"""
|
||||
return struct.pack(">HB", len(v) + 1, t) + v
|
||||
|
||||
def proto(self, p):
|
||||
"""
|
||||
Lookup protocol name
|
||||
"""
|
||||
return self._l(self.PROTO, p)
|
||||
|
||||
def ext(self, p):
|
||||
"""
|
||||
Lookup protocol extension name
|
||||
"""
|
||||
return self._l(self.EXT, p)
|
||||
|
||||
def msgt(self, p):
|
||||
"""
|
||||
Lookup message type name
|
||||
"""
|
||||
return self._l(self.MSGT, p)
|
||||
|
||||
def idtag(self, p):
|
||||
"""
|
||||
Lookup ID tag name
|
||||
"""
|
||||
return self._l(self._IDTAG, p)
|
||||
|
||||
def ext_name(self, proto, exten):
|
||||
"""
|
||||
Return proper extension byte name depending on the protocol used
|
||||
"""
|
||||
if self.PROTO['CCM'] == proto:
|
||||
return self.msgt(exten)
|
||||
if self.PROTO['OSMO'] == proto:
|
||||
return self.ext(exten)
|
||||
return None
|
||||
|
||||
def add_header(self, data, proto, ext=None):
|
||||
"""
|
||||
Add IPA header (with extension if necessary), data must be represented as bytes
|
||||
"""
|
||||
if ext is None:
|
||||
return struct.pack(">HB", len(data) + 1, proto) + data
|
||||
return struct.pack(">HBB", len(data) + 1, proto, ext) + data
|
||||
|
||||
def del_header(self, data):
|
||||
"""
|
||||
Strip IPA protocol header correctly removing extension if present
|
||||
Returns data length, IPA protocol, extension (or None if not defined for a give protocol) and the data without header
|
||||
"""
|
||||
if not len(data):
|
||||
return None, None, None, None
|
||||
(dlen, proto) = struct.unpack('>HB', data[:3])
|
||||
if self.PROTO['OSMO'] == proto or self.PROTO['CCM'] == proto: # there's extension which we have to unpack
|
||||
return struct.unpack('>HBB', data[:4]) + (data[4:], ) # length, protocol, extension, data
|
||||
return dlen, proto, None, data[3:] # length, protocol, _, data
|
||||
|
||||
def split_combined(self, data):
|
||||
"""
|
||||
Split the data which contains multiple concatenated IPA messages into tuple (first, rest) where rest contains remaining messages, first is the single IPA message
|
||||
"""
|
||||
(length, _, _, _) = self.del_header(data)
|
||||
return data[:(length + 3)], data[(length + 3):]
|
||||
|
||||
def tag_serial(self, data):
|
||||
"""
|
||||
Make TAG for serial number
|
||||
"""
|
||||
return self._tag(self._IDTAG['SERNR'], data)
|
||||
|
||||
def tag_name(self, data):
|
||||
"""
|
||||
Make TAG for unit name
|
||||
"""
|
||||
return self._tag(self._IDTAG['UNITNAME'], data)
|
||||
|
||||
def tag_loc(self, data):
|
||||
"""
|
||||
Make TAG for location
|
||||
"""
|
||||
return self._tag(self._IDTAG['LOCATION'], data)
|
||||
|
||||
def tag_type(self, data):
|
||||
"""
|
||||
Make TAG for unit type
|
||||
"""
|
||||
return self._tag(self._IDTAG['TYPE'], data)
|
||||
|
||||
def tag_equip(self, data):
|
||||
"""
|
||||
Make TAG for equipment version
|
||||
"""
|
||||
return self._tag(self._IDTAG['EQUIPVERS'], data)
|
||||
|
||||
def tag_sw(self, data):
|
||||
"""
|
||||
Make TAG for software version
|
||||
"""
|
||||
return self._tag(self._IDTAG['SWVERSION'], data)
|
||||
|
||||
def tag_ip(self, data):
|
||||
"""
|
||||
Make TAG for IP address
|
||||
"""
|
||||
return self._tag(self._IDTAG['IPADDR'], data)
|
||||
|
||||
def tag_mac(self, data):
|
||||
"""
|
||||
Make TAG for MAC address
|
||||
"""
|
||||
return self._tag(self._IDTAG['MACADDR'], data)
|
||||
|
||||
def tag_unit(self, data):
|
||||
"""
|
||||
Make TAG for unit ID
|
||||
"""
|
||||
return self._tag(self._IDTAG['UNIT'], data)
|
||||
|
||||
def identity(self, unit=b'', mac=b'', location=b'', utype=b'', equip=b'', sw=b'', name=b'', serial=b''):
|
||||
"""
|
||||
Make IPA IDENTITY tag list, by default returns empty concatenated bytes of tag list
|
||||
"""
|
||||
return self.tag_unit(unit) + self.tag_mac(mac) + self.tag_loc(location) + self.tag_type(utype) + self.tag_equip(equip) + self.tag_sw(sw) + self.tag_name(name) + self.tag_serial(serial)
|
||||
|
||||
def ping(self):
|
||||
"""
|
||||
Make PING message
|
||||
"""
|
||||
return self.add_header(b'', self.PROTO['CCM'], self.MSGT['PING'])
|
||||
|
||||
def pong(self):
|
||||
"""
|
||||
Make PONG message
|
||||
"""
|
||||
return self.add_header(b'', self.PROTO['CCM'], self.MSGT['PONG'])
|
||||
|
||||
def id_ack(self):
|
||||
"""
|
||||
Make ID_ACK CCM message
|
||||
"""
|
||||
return self.add_header(b'', self.PROTO['CCM'], self.MSGT['ID_ACK'])
|
||||
|
||||
def id_get(self):
|
||||
"""
|
||||
Make ID_GET CCM message
|
||||
"""
|
||||
return self.add_header(self.identity(), self.PROTO['CCM'], self.MSGT['ID_GET'])
|
||||
|
||||
def id_resp(self, data):
|
||||
"""
|
||||
Make ID_RESP CCM message
|
||||
"""
|
||||
return self.add_header(data, self.PROTO['CCM'], self.MSGT['ID_RESP'])
|
||||
|
||||
class Ctrl(IPA):
|
||||
"""
|
||||
Osmocom CTRL protocol implemented on top of IPA multiplexer
|
||||
"""
|
||||
def __init__(self):
|
||||
random.seed()
|
||||
|
||||
def add_header(self, data):
|
||||
"""
|
||||
Add CTRL header
|
||||
"""
|
||||
return super(Ctrl, self).add_header(data.encode('utf-8'), IPA.PROTO['OSMO'], IPA.EXT['CTRL'])
|
||||
|
||||
def rem_header(self, data):
|
||||
"""
|
||||
Remove CTRL header, check for appropriate protocol and extension
|
||||
"""
|
||||
(_, proto, ext, d) = super(Ctrl, self).del_header(data)
|
||||
if self.PROTO['OSMO'] != proto or self.EXT['CTRL'] != ext:
|
||||
return None
|
||||
return d
|
||||
|
||||
def parse(self, data, op=None):
|
||||
"""
|
||||
Parse Ctrl string returning (var, value) pair
|
||||
var could be None in case of ERROR message
|
||||
value could be None in case of GET message
|
||||
"""
|
||||
(s, i, v) = data.split(' ', 2)
|
||||
if s == self.CTRL_ERR:
|
||||
return None, v
|
||||
if s == self.CTRL_GET:
|
||||
return v, None
|
||||
(s, i, var, val) = data.split(' ', 3)
|
||||
if s == self.CTRL_TRAP and i != '0':
|
||||
return None, '%s with non-zero id %s' % (s, i)
|
||||
if op is not None and i != op:
|
||||
if s == self.CTRL_GET + '_' + self.CTRL_REP or s == self.CTRL_SET + '_' + self.CTRL_REP:
|
||||
return None, '%s with unexpected id %s' % (s, i)
|
||||
return var, val
|
||||
|
||||
def trap(self, var, val):
|
||||
"""
|
||||
Make TRAP message with given (vak, val) pair
|
||||
"""
|
||||
return self.add_header("%s 0 %s %s" % (self.CTRL_TRAP, var, val))
|
||||
|
||||
def cmd(self, var, val=None):
|
||||
"""
|
||||
Make SET/GET command message: returns (r, m) tuple where r is random operation id and m is assembled message
|
||||
"""
|
||||
r = random.randint(1, sys.maxsize)
|
||||
if val is not None:
|
||||
return r, self.add_header("%s %s %s %s" % (self.CTRL_SET, r, var, val))
|
||||
return r, self.add_header("%s %s %s" % (self.CTRL_GET, r, var))
|
||||
|
||||
def verify(self, reply, r, var, val=None):
|
||||
"""
|
||||
Verify reply to SET/GET command: returns (b, v) tuple where v is True/False verification result and v is the variable value
|
||||
"""
|
||||
(k, v) = self.parse(reply)
|
||||
if k != var or (val is not None and v != val):
|
||||
return False, v
|
||||
return True, v
|
||||
|
||||
if __name__ == '__main__':
|
||||
print("IPA multiplexer v%s loaded." % IPA.version)
|
||||
@@ -1,373 +0,0 @@
|
||||
#!/usr/bin/python3
|
||||
# -*- mode: python-mode; py-indent-tabs-mode: nil -*-
|
||||
"""
|
||||
/*
|
||||
* Copyright (C) 2016 sysmocom s.f.m.c. GmbH
|
||||
*
|
||||
* All Rights Reserved
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU 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 General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along
|
||||
* with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*/
|
||||
"""
|
||||
|
||||
from ipa import Ctrl, IPA
|
||||
from twisted.internet.protocol import ReconnectingClientFactory
|
||||
from twisted.internet import reactor
|
||||
from twisted.protocols import basic
|
||||
import argparse
|
||||
|
||||
class IPACommon(basic.Int16StringReceiver):
|
||||
"""
|
||||
Generic IPA protocol handler: include some routines for simpler subprotocols.
|
||||
It's not intended as full implementation of all subprotocols, rather common ground and example code.
|
||||
"""
|
||||
def dbg(self, line):
|
||||
"""
|
||||
Debug print helper
|
||||
"""
|
||||
if self.factory.debug:
|
||||
print(line)
|
||||
|
||||
def osmo_CTRL(self, data):
|
||||
"""
|
||||
OSMO CTRL protocol
|
||||
Placeholder, see corresponding derived class
|
||||
"""
|
||||
pass
|
||||
|
||||
def osmo_MGCP(self, data):
|
||||
"""
|
||||
OSMO MGCP extension
|
||||
"""
|
||||
self.dbg('OSMO MGCP received %s' % data)
|
||||
|
||||
def osmo_LAC(self, data):
|
||||
"""
|
||||
OSMO LAC extension
|
||||
"""
|
||||
self.dbg('OSMO LAC received %s' % data)
|
||||
|
||||
def osmo_SMSC(self, data):
|
||||
"""
|
||||
OSMO SMSC extension
|
||||
"""
|
||||
self.dbg('OSMO SMSC received %s' % data)
|
||||
|
||||
def osmo_ORC(self, data):
|
||||
"""
|
||||
OSMO ORC extension
|
||||
"""
|
||||
self.dbg('OSMO ORC received %s' % data)
|
||||
|
||||
def osmo_GSUP(self, data):
|
||||
"""
|
||||
OSMO GSUP extension
|
||||
"""
|
||||
self.dbg('OSMO GSUP received %s' % data)
|
||||
|
||||
def osmo_OAP(self, data):
|
||||
"""
|
||||
OSMO OAP extension
|
||||
"""
|
||||
self.dbg('OSMO OAP received %s' % data)
|
||||
|
||||
def osmo_UNKNOWN(self, data):
|
||||
"""
|
||||
OSMO defaul extension handler
|
||||
"""
|
||||
self.dbg('OSMO unknown extension received %s' % data)
|
||||
|
||||
def handle_RSL(self, data, proto, extension):
|
||||
"""
|
||||
RSL protocol handler
|
||||
"""
|
||||
self.dbg('IPA RSL received message with extension %s' % extension)
|
||||
|
||||
def handle_CCM(self, data, proto, msgt):
|
||||
"""
|
||||
CCM (IPA Connection Management)
|
||||
Placeholder, see corresponding derived class
|
||||
"""
|
||||
pass
|
||||
|
||||
def handle_SCCP(self, data, proto, extension):
|
||||
"""
|
||||
SCCP protocol handler
|
||||
"""
|
||||
self.dbg('IPA SCCP received message with extension %s' % extension)
|
||||
|
||||
def handle_OML(self, data, proto, extension):
|
||||
"""
|
||||
OML protocol handler
|
||||
"""
|
||||
self.dbg('IPA OML received message with extension %s' % extension)
|
||||
|
||||
def handle_OSMO(self, data, proto, extension):
|
||||
"""
|
||||
Dispatcher point for OSMO subprotocols based on extension name, lambda default should never happen
|
||||
"""
|
||||
method = getattr(self, 'osmo_' + IPA().ext(extension), lambda: "extension dispatch failure")
|
||||
method(data)
|
||||
|
||||
def handle_MGCP(self, data, proto, extension):
|
||||
"""
|
||||
MGCP protocol handler
|
||||
"""
|
||||
self.dbg('IPA MGCP received message with attribute %s' % extension)
|
||||
|
||||
def handle_UNKNOWN(self, data, proto, extension):
|
||||
"""
|
||||
Default protocol handler
|
||||
"""
|
||||
self.dbg('IPA received message for %s (%s) protocol with attribute %s' % (IPA().proto(proto), proto, extension))
|
||||
|
||||
def process_chunk(self, data):
|
||||
"""
|
||||
Generic message dispatcher for IPA (sub)protocols based on protocol name, lambda default should never happen
|
||||
"""
|
||||
(_, proto, extension, content) = IPA().del_header(data)
|
||||
if content is not None:
|
||||
self.dbg('IPA received %s::%s [%d/%d] %s' % (IPA().proto(proto), IPA().ext_name(proto, extension), len(data), len(content), content))
|
||||
method = getattr(self, 'handle_' + IPA().proto(proto), lambda: "protocol dispatch failure")
|
||||
method(content, proto, extension)
|
||||
|
||||
def dataReceived(self, data):
|
||||
"""
|
||||
Override for dataReceived from Int16StringReceiver because of inherently incompatible interpretation of length
|
||||
If default handler is used than we would always get off-by-1 error (Int16StringReceiver use equivalent of l + 2)
|
||||
"""
|
||||
if len(data):
|
||||
(head, tail) = IPA().split_combined(data)
|
||||
self.process_chunk(head)
|
||||
self.dataReceived(tail)
|
||||
|
||||
def connectionMade(self):
|
||||
"""
|
||||
We have to resetDelay() here to drop internal state to default values to make reconnection logic work
|
||||
Make sure to call this via super() if overriding to keep reconnection logic intact
|
||||
"""
|
||||
self.dbg('IPA connection made!')
|
||||
self.factory.resetDelay()
|
||||
|
||||
|
||||
class CCM(IPACommon):
|
||||
"""
|
||||
Implementation of CCM protocol for IPA multiplex
|
||||
"""
|
||||
def ack(self):
|
||||
self.transport.write(IPA().id_ack())
|
||||
|
||||
def ping(self):
|
||||
self.transport.write(IPA().ping())
|
||||
|
||||
def pong(self):
|
||||
self.transport.write(IPA().pong())
|
||||
|
||||
def handle_CCM(self, data, proto, msgt):
|
||||
"""
|
||||
CCM (IPA Connection Management)
|
||||
Only basic logic necessary for tests is implemented (ping-pong, id ack etc)
|
||||
"""
|
||||
if msgt == IPA.MSGT['ID_GET']:
|
||||
self.transport.getHandle().sendall(IPA().id_resp(self.factory.ccm_id))
|
||||
# if we call
|
||||
# self.transport.write(IPA().id_resp(self.factory.test_id))
|
||||
# instead, than we would have to also call
|
||||
# reactor.callLater(1, self.ack)
|
||||
# instead of self.ack()
|
||||
# otherwise the writes will be glued together - hence the necessity for ugly hack with 1s timeout
|
||||
# Note: this still might work depending on the IPA implementation details on the other side
|
||||
self.ack()
|
||||
# schedule PING in 4s
|
||||
reactor.callLater(4, self.ping)
|
||||
if msgt == IPA.MSGT['PING']:
|
||||
self.pong()
|
||||
|
||||
|
||||
class CTRL(IPACommon):
|
||||
"""
|
||||
Implementation of Osmocom control protocol for IPA multiplex
|
||||
"""
|
||||
def ctrl_SET(self, data, op_id, v):
|
||||
"""
|
||||
Handle CTRL SET command
|
||||
"""
|
||||
self.dbg('CTRL SET [%s] %s' % (op_id, v))
|
||||
|
||||
def ctrl_SET_REPLY(self, data, op_id, v):
|
||||
"""
|
||||
Handle CTRL SET reply
|
||||
"""
|
||||
self.dbg('CTRL SET REPLY [%s] %s' % (op_id, v))
|
||||
|
||||
def ctrl_GET(self, data, op_id, v):
|
||||
"""
|
||||
Handle CTRL GET command
|
||||
"""
|
||||
self.dbg('CTRL GET [%s] %s' % (op_id, v))
|
||||
|
||||
def ctrl_GET_REPLY(self, data, op_id, v):
|
||||
"""
|
||||
Handle CTRL GET reply
|
||||
"""
|
||||
self.dbg('CTRL GET REPLY [%s] %s' % (op_id, v))
|
||||
|
||||
def ctrl_TRAP(self, data, op_id, v):
|
||||
"""
|
||||
Handle CTRL TRAP command
|
||||
"""
|
||||
self.dbg('CTRL TRAP [%s] %s' % (op_id, v))
|
||||
|
||||
def ctrl_ERROR(self, data, op_id, v):
|
||||
"""
|
||||
Handle CTRL ERROR reply
|
||||
"""
|
||||
self.dbg('CTRL ERROR [%s] %s' % (op_id, v))
|
||||
|
||||
def osmo_CTRL(self, data):
|
||||
"""
|
||||
OSMO CTRL message dispatcher, lambda default should never happen
|
||||
For basic tests only, appropriate handling routines should be replaced: see CtrlServer for example
|
||||
"""
|
||||
self.dbg('OSMO CTRL received %s::%s' % Ctrl().parse(data.decode('utf-8')))
|
||||
(cmd, op_id, v) = data.decode('utf-8').split(' ', 2)
|
||||
method = getattr(self, 'ctrl_' + cmd, lambda: "CTRL unknown command")
|
||||
method(data, op_id, v)
|
||||
|
||||
|
||||
class IPAServer(CCM):
|
||||
"""
|
||||
Test implementation of IPA server
|
||||
Demonstrate CCM opearation by overriding necessary bits from CCM
|
||||
"""
|
||||
def connectionMade(self):
|
||||
"""
|
||||
Keep reconnection logic working by calling routine from CCM
|
||||
Initiate CCM upon connection
|
||||
"""
|
||||
print('IPA server connection made!')
|
||||
super(IPAServer, self).connectionMade()
|
||||
self.transport.write(IPA().id_get())
|
||||
|
||||
|
||||
class CtrlServer(CTRL):
|
||||
"""
|
||||
Test implementation of CTRL server
|
||||
Demonstarte CTRL handling by overriding simpler routines from CTRL
|
||||
"""
|
||||
def connectionMade(self):
|
||||
"""
|
||||
Keep reconnection logic working by calling routine from CTRL
|
||||
Send TRAP upon connection
|
||||
Note: we can't use sendString() because of it's incompatibility with IPA interpretation of length prefix
|
||||
"""
|
||||
print('CTRL server connection made!')
|
||||
super(CtrlServer, self).connectionMade()
|
||||
self.transport.write(Ctrl().trap('LOL', 'what'))
|
||||
self.transport.write(Ctrl().trap('rulez', 'XXX'))
|
||||
|
||||
def reply(self, r):
|
||||
self.transport.write(Ctrl().add_header(r))
|
||||
|
||||
def ctrl_SET(self, data, op_id, v):
|
||||
"""
|
||||
CTRL SET command: always succeed
|
||||
"""
|
||||
print('SET [%s] %s' % (op_id, v))
|
||||
self.reply('SET_REPLY %s %s' % (op_id, v))
|
||||
|
||||
def ctrl_GET(self, data, op_id, v):
|
||||
"""
|
||||
CTRL GET command: always fail
|
||||
"""
|
||||
print('GET [%s] %s' % (op_id, v))
|
||||
self.reply('ERROR %s No variable found' % op_id)
|
||||
|
||||
|
||||
class IPAFactory(ReconnectingClientFactory):
|
||||
"""
|
||||
Generic IPA Client Factory which can be used to store state for various subprotocols and manage connections
|
||||
Note: so far we do not really need separate Factory for acting as a server due to protocol simplicity
|
||||
"""
|
||||
protocol = IPACommon
|
||||
debug = False
|
||||
ccm_id = IPA().identity(unit=b'1515/0/1', mac=b'b0:0b:fa:ce:de:ad:be:ef', utype=b'sysmoBTS', name=b'StingRay', location=b'hell', sw=IPA.version.encode('utf-8'))
|
||||
|
||||
def __init__(self, proto=None, debug=False, ccm_id=None):
|
||||
if proto:
|
||||
self.protocol = proto
|
||||
if debug:
|
||||
self.debug = debug
|
||||
if ccm_id:
|
||||
self.ccm_id = ccm_id
|
||||
|
||||
def clientConnectionFailed(self, connector, reason):
|
||||
"""
|
||||
Only necessary for as debugging aid - if we can somehow set parent's class noisy attribute then we can omit this method
|
||||
"""
|
||||
if self.debug:
|
||||
print('IPAFactory connection failed:', reason.getErrorMessage())
|
||||
ReconnectingClientFactory.clientConnectionFailed(self, connector, reason)
|
||||
|
||||
def clientConnectionLost(self, connector, reason):
|
||||
"""
|
||||
Only necessary for as debugging aid - if we can somehow set parent's class noisy attribute then we can omit this method
|
||||
"""
|
||||
if self.debug:
|
||||
print('IPAFactory connection lost:', reason.getErrorMessage())
|
||||
ReconnectingClientFactory.clientConnectionLost(self, connector, reason)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
p = argparse.ArgumentParser("Twisted IPA (module v%s) app" % IPA.version)
|
||||
p.add_argument('-v', '--version', action='version', version='%(prog)s v0.3')
|
||||
p.add_argument('-p', '--port', type=int, default=4250, help="Port to use for CTRL interface")
|
||||
p.add_argument('-d', '--host', default='localhost', help="Adress to use for CTRL interface")
|
||||
cs = p.add_mutually_exclusive_group()
|
||||
cs.add_argument("-c", "--client", action='store_true', help="asume client role")
|
||||
cs.add_argument("-s", "--server", action='store_true', help="asume server role")
|
||||
ic = p.add_mutually_exclusive_group()
|
||||
ic.add_argument("--ipa", action='store_true', help="use IPA protocol")
|
||||
ic.add_argument("--ctrl", action='store_true', help="use CTRL protocol")
|
||||
args = p.parse_args()
|
||||
test = False
|
||||
if args.ctrl:
|
||||
if args.client:
|
||||
# Start osmo-bsc to receive TRAP messages when osmo-bts-* connects to it
|
||||
print('CTRL client, connecting to %s:%d' % (args.host, args.port))
|
||||
reactor.connectTCP(args.host, args.port, IPAFactory(CTRL, debug=True))
|
||||
test = True
|
||||
if args.server:
|
||||
# Use bsc_control.py to issue set/get commands
|
||||
print('CTRL server, listening on port %d' % args.port)
|
||||
reactor.listenTCP(args.port, IPAFactory(CtrlServer, debug=True))
|
||||
test = True
|
||||
if args.ipa:
|
||||
if args.client:
|
||||
# Start osmo-nitb which would initiate A-bis/IP session
|
||||
print('IPA client, connecting to %s ports %d and %d' % (args.host, IPA.TCP_PORT_OML, IPA.TCP_PORT_RSL))
|
||||
reactor.connectTCP(args.host, IPA.TCP_PORT_OML, IPAFactory(CCM, debug=True))
|
||||
reactor.connectTCP(args.host, IPA.TCP_PORT_RSL, IPAFactory(CCM, debug=True))
|
||||
test = True
|
||||
if args.server:
|
||||
# Start osmo-bts-* which would attempt to connect to us
|
||||
print('IPA server, listening on ports %d and %d' % (IPA.TCP_PORT_OML, IPA.TCP_PORT_RSL))
|
||||
reactor.listenTCP(IPA.TCP_PORT_RSL, IPAFactory(IPAServer, debug=True))
|
||||
reactor.listenTCP(IPA.TCP_PORT_OML, IPAFactory(IPAServer, debug=True))
|
||||
test = True
|
||||
if test:
|
||||
reactor.run()
|
||||
else:
|
||||
print("Please specify which protocol in which role you'd like to test.")
|
||||
@@ -1,3 +1 @@
|
||||
SUBDIRS = \
|
||||
examples \
|
||||
$(NULL)
|
||||
SUBDIRS = examples
|
||||
|
||||
608
openbsc/doc/call-graphs-MSC-BSC-HNBGW.txt
Normal file
608
openbsc/doc/call-graphs-MSC-BSC-HNBGW.txt
Normal file
@@ -0,0 +1,608 @@
|
||||
gprs_iu_tx
|
||||
|
||||
-- WORK IN PROGRESS --
|
||||
|
||||
This is an incomplete collection of call graphs between MSC and Osmo-BSC,
|
||||
partly including Osmo-BTS. These traces helped understanding the separation of
|
||||
the BSC part from Osmo-NITB. The aim: obtain a clearly separated "A" interface
|
||||
towards the BSC, and have an Iu-CS interface to operate with HNB-GW and hNodeB.
|
||||
The working title for the result is Osmo-CSCN (Circuit Switched Core Network),
|
||||
combining an MSC with various other core network components, but without the
|
||||
BSC parts.
|
||||
|
||||
|
||||
Some Specs and Overview
|
||||
|
||||
0408: Radio interface
|
||||
0411: PP-SMS on Radio interface
|
||||
0802: A Interface MSC<->BSS (BSS = BSC + BTS)
|
||||
0804: A Interface L1 MSC<->BSS
|
||||
0806: A Interface L2 MSC<->BSS
|
||||
0808: A Interface L3 MSC<->BSS
|
||||
0808: Figure 1: A MSC<->BSS
|
||||
0820: RA (Rate Adaption) MSC<->BSS
|
||||
|
||||
0851,0852: A-bis general BSC<->BTS
|
||||
1221: A-bis NM BSC<->BTS
|
||||
1201: Figure 9: A-bis BSC<->BTS
|
||||
|
||||
MS <-> BTS <-> BSC <-> MSC <-> cn
|
||||
| | | | |
|
||||
|<-------0408=DTAP----->| |
|
||||
|<-------0411---------->| |
|
||||
| | |<--0808>| |
|
||||
| | |<BSSMAP>| |
|
||||
| | | | |
|
||||
| Abis | A |
|
||||
|
||||
MS <-> hNodeB <-> HNB-GW <-> MSC <-> cn
|
||||
| | | | |
|
||||
|<-0408->|<--Iu--->|<-Iu-cs->| |
|
||||
|<-0411->| | | |
|
||||
| | | | |
|
||||
|
||||
Entry/Exit points
|
||||
|
||||
Osmo-BSC <--A--> MSC or Osmo-CSCN
|
||||
format: BSSAP/SCCP (where BSSAP = DTAP + BSSMAP)
|
||||
Osmo-BSC
|
||||
read from MSC: sccp_system_incoming_ctx()
|
||||
write to MSC: sccp_connection_write() <-- osmo-bsc/osmo_bsc_sccp.c:bsc_queue_for_msc()
|
||||
MSC:
|
||||
third party
|
||||
Osmo-CSCN:
|
||||
read: does not exist yet
|
||||
write: does not exist yet
|
||||
|
||||
HNB-GW <--Iu-CS--> Osmo-CSCN
|
||||
format: CC+MM/RANAP/SUA
|
||||
HNB-GW:
|
||||
read: does not exist yet
|
||||
write: does not exist yet
|
||||
Osmo-CSCN:
|
||||
read: does not exist yet
|
||||
write: does not exist yet
|
||||
|
||||
Osmo-BTS <-Abis-> Osmo-BSC
|
||||
Osmo-BSC:
|
||||
read: libbsc/abis_rsl.c:abis_rsl_rcvmsg(msg)
|
||||
write: libosmo-abis/src/e1_input.c:abis_sendmsg() (e1inp_sign_link*)msg->dst;
|
||||
|
||||
Osmo-BTS <-Abis-> Osmo-NITB
|
||||
Osmo-NITB:
|
||||
read:
|
||||
osmo_signal_dispatch():
|
||||
from on_dso_load_token() libmsc/token_auth.c
|
||||
SS_SUBSCR: token_subscr_cb() libmsc/token_auth.c
|
||||
SS_SMS: token_sms_cb() libmsc/token_auth.c
|
||||
from subscr_sig_cb() libmsc/rrlp.c
|
||||
SS_SUBSCR: subscr_sig_cb() libmsc/rrlp.c
|
||||
SS_PAGING: paging_sig_cb() libmsc/rrlp.c
|
||||
from on_dso_load_ho_dec() libbsc/handover_decision.c
|
||||
SS_LCHAN: ho_dec_sig_cb() libbsc/handover_decision.c
|
||||
from e1inp_init() libosmo-abis/src/e1_input.c
|
||||
SS_L_GLOBAL: e1i_sig_cb() libosmo-abis/src/e1_input.c
|
||||
|
||||
bts_model_bs11_init();
|
||||
bts_model_rbs2k_init();
|
||||
bts_model_nanobts_init();
|
||||
bts_model_nokia_site_init();
|
||||
bts_model_sysmobts_init();
|
||||
|
||||
bsc_bootstrap_network():
|
||||
osmo_signal_register_handler(SS_NM, nm_sig_cb, NULL);
|
||||
osmo_signal_register_handler(SS_L_INPUT, inp_sig_cb, NULL);
|
||||
|
||||
|
||||
Call Trees
|
||||
|
||||
- A Interface
|
||||
|
||||
Osmo-BSC sends to MSC:
|
||||
|
||||
sccp_connection_write(conn->sccp, msg);
|
||||
^ bsc_queue_for_msc()
|
||||
^
|
||||
| osmo-bsc/osmo_bsc_api.c:
|
||||
| bsc_clear_request()
|
||||
| queue_msg_or_return() osmo-bsc/osmo_bsc_api.c
|
||||
| ^ bsc_sapi_n_reject()
|
||||
| | ^send_sapi_reject()
|
||||
| | ^ gsm0808_submit_dtap() libbsc/bsc_api.c
|
||||
| | | ^ gsm48_conn_sendmsg() libmsc/gsm_04_08.c
|
||||
| | | | ^ gsm48_cc_tx_notify_ss() libmsc/gsm_04_08.c
|
||||
| | | | | mm_tx_identity_req() libmsc/gsm_04_08.c
|
||||
| | | | | gsm48_tx_mm_info() libmsc/gsm_04_08.c
|
||||
| | | | | gsm48_tx_mm_auth_req()
|
||||
| | | | | gsm48_send_rr_app_info()
|
||||
| | | | | gsm48_cc_tx_status()
|
||||
| | | | | gsm48_tx_simple()
|
||||
| | | | | ^ gsm48_tx_mm_auth_rej()
|
||||
| | | | | gsm48_cc_tx_setup()
|
||||
| | | | | gsm48_cc_tx_call_proc()
|
||||
| | | | | gsm48_cc_tx_alerting()
|
||||
| | | | | gsm48_cc_tx_progress()
|
||||
| | | | | gsm48_cc_tx_connect()
|
||||
| | | | | gsm48_cc_tx_connect_ack()
|
||||
| | | | | gsm48_cc_tx_disconnect()
|
||||
| | | | | gsm48_cc_tx_release()
|
||||
| | | | | gsm48_cc_tx_release_compl()
|
||||
| | | | | gsm48_cc_tx_facility()
|
||||
| | | | | gsm48_cc_tx_hold_ack()
|
||||
| | | | | gsm48_cc_tx_hold_rej()
|
||||
| | | | | gsm48_cc_tx_retrieve_ack()
|
||||
| | | | | gsm48_cc_tx_retrieve_rej()
|
||||
| | | | | gsm48_cc_tx_start_dtmf_ack()
|
||||
| | | | | gsm48_cc_tx_start_dtmf_rej()
|
||||
| | | | | gsm48_cc_tx_stop_dtmf_ack()
|
||||
| | | | | gsm48_cc_tx_modify()
|
||||
| | | | | gsm48_cc_tx_modify_complete()
|
||||
| | | | | gsm48_cc_tx_modify_reject()
|
||||
| | | | | gsm48_cc_tx_notify()
|
||||
| | | | | gsm48_cc_tx_userinfo()
|
||||
| | | |
|
||||
| | | | gsm0480_send_ussd_response() libmsc/gsm_04_80.c
|
||||
| | | | gsm0480_send_ussd_reject() libmsc/gsm_04_80.c
|
||||
| | | | gsm0480_send_ussdNotify() libmsc/gsm_04_80.c
|
||||
| | | | ^ bsc_send_ussd_no_srv() osmo-bsc/osmo_bsc_api.c
|
||||
| | | | gsm0480_send_releaseComplete() libmsc/gsm_04_80.c
|
||||
| | | | ^ bsc_send_ussd_no_srv() osmo-bsc/osmo_bsc_api.c
|
||||
| | | |
|
||||
| | | | gsm411_sendmsg() libmsc/gsm_04_11.c
|
||||
| | | |
|
||||
| | | | bsc_maybe_lu_reject() osmo-bsc/osmo_bsc_api.c
|
||||
| | | | ^ complete_layer3()
|
||||
| | | | | bsc_dtap()
|
||||
| | | |
|
||||
| | | | dtap_rcvmsg() osmo-bsc/osmo_bsc_bssap.c
|
||||
| | | |
|
||||
| | | | gsm48_tx_mm_serv_ack() libbsc/gsm_04_08_utils.c
|
||||
| | | | ^ _gsm48_rx_mm_serv_req_sec_cb()
|
||||
| | | | | bsc_send_ussd_no_srv() osmo-bsc/osmo_bsc_api.c
|
||||
| | | |
|
||||
| | | | gsm48_tx_mm_serv_rej() libbsc/gsm_04_08_utils.c
|
||||
| | |
|
||||
| | | bsc_rll_req.cb = rll_ind_cb() from rll_establish() from gsm0808_submit_dtap()
|
||||
| | | ^ complete_rllr() libbsc/bsc_rll.c
|
||||
| | | | ^ timer_cb() libbsc/bsc_rll.c
|
||||
| | | | | rll_indication() libbsc/bsc_rll.c
|
||||
| | | | | rll_lchan_signal() libbsc/bsc_rll.c
|
||||
| |
|
||||
| | bsc_cipher_mode_compl()
|
||||
| | ^ bsc_api.cipher_mode_compl()
|
||||
| | | dispatch_dtap() (2)
|
||||
| | | with GSM48_MT_RR_CIPH_M_COMPL
|
||||
| |
|
||||
| | bsc_dtap()
|
||||
| | ^ cb from osmo-bsc/osmo_bsc_api.c
|
||||
| | bsc_api.dtap()
|
||||
| | ^ libbsc/bsc_api.c:
|
||||
| | | dispatch_dtap() (2)
|
||||
| | | case GSM48_MT_RR_APP_INFO
|
||||
| | | case unknown 04.08 RR
|
||||
| |
|
||||
| | bsc_assign_compl()
|
||||
| | ^ osmo-bsc/osmo_bsc_api.c
|
||||
| | bsc_api.assign_compl()
|
||||
| | ^ libbsc/bsc_api.c:
|
||||
| | | dispatch_dtap() (2)
|
||||
| | | case GSM48_MT_RR_CHAN_MODE_MODIF_ACK
|
||||
| | | handle_ass_compl()
|
||||
| | | ^ dispatch_dtap() (2)
|
||||
| | | | case GSM48_MT_RR_ASS_COMPL
|
||||
| |
|
||||
| | bsc_assign_fail()
|
||||
| |
|
||||
| | bsc_cm_update()
|
||||
|
|
||||
| osmo-bsc/osmo_bsc_bssap.c:
|
||||
| bssmap_handle_clear_command()
|
||||
| bssmap_handle_cipher_mode()
|
||||
| bssmap_handle_assignm_req()
|
||||
|
|
||||
|
||||
|
||||
Osmo-BSC receives from MSC:
|
||||
sccp_system_incoming_ctx() (libosmo-sccp)
|
||||
| L2 type:
|
||||
v SCCP_MSG_TYPE_CR: _sccp_handle_connection_request(msgb, ctx);
|
||||
SCCP_MSG_TYPE_RLSD: _sccp_handle_connection_released(msgb);
|
||||
SCCP_MSG_TYPE_CREF: _sccp_handle_connection_refused(msgb);
|
||||
SCCP_MSG_TYPE_CC: _sccp_handle_connection_confirm(msgb);
|
||||
SCCP_MSG_TYPE_RLC: _sccp_handle_connection_release_complete(msgb);
|
||||
|
||||
SCCP_MSG_TYPE_DT1: _sccp_handle_connection_dt1(msgb);
|
||||
Note: a dt1 target entry was created during one of:
|
||||
- bsc_open_connection() (SCCP connections are established by the BSC, exclusively)
|
||||
sccp_connection_connect()
|
||||
_sccp_send_connection_request()
|
||||
llist_add_tail(&connection->list, &sccp_connections);
|
||||
- sccp_system_incoming_ctx()
|
||||
SCCP_MSG_TYPE_CR:
|
||||
_sccp_handle_connection_request(struct msgb *msgb, void *ctx)
|
||||
cb->accept_cb() = msc_sccp_accept()
|
||||
|
||||
SCCP_MSG_TYPE_UDT: _sccp_handle_read(msgb) --read_cb--> osmo-bsc/osmo_bsc_sccp.c:msc_sccp_read()
|
||||
msc_sccp_read()
|
||||
| bsc_handle_udt() ./openbsc/openbsc/src/osmo-bsc/osmo_bsc_bssap.c:494
|
||||
v bssmap_rcvmsg_udt() ./openbsc/openbsc/src/osmo-bsc/osmo_bsc_bssap.c:387
|
||||
gsm0808_bssmap_name() ./libosmocore/src/gsm/gsm0808.c:535
|
||||
bssmap_handle_reset_ack() ./openbsc/openbsc/src/osmo-bsc/osmo_bsc_bssap.c:91
|
||||
LOGP()
|
||||
bssmap_handle_paging() ./openbsc/openbsc/src/osmo-bsc/osmo_bsc_bssap.c:99
|
||||
GSM0808_IE_IMSI
|
||||
GSM0808_IE_CELL_IDENTIFIER_LIST
|
||||
GSM0808_IE_TMSI
|
||||
CELL_IDENT_LAC
|
||||
CELL_IDENT_BSS
|
||||
GSM0808_IE_CHANNEL_NEEDED
|
||||
GSM0808_IE_EMLPP_PRIORITY
|
||||
subscr_get_or_create() ./openbsc/openbsc/src/libcommon/gsm_subscriber_base.c:101
|
||||
subscr_group
|
||||
LOGL_INFO
|
||||
bsc_grace_paging_request() ./openbsc/openbsc/src/osmo-bsc/osmo_bsc_grace.c:87
|
||||
normal_paging() ./openbsc/openbsc/src/osmo-bsc/osmo_bsc_grace.c:37
|
||||
if (msc->core_lac != -1)
|
||||
paging_request_bts() ./openbsc/openbsc/src/libbsc/paging.c:307
|
||||
trx_is_usable() ./openbsc/openbsc/src/libbsc/chan_alloc.c:49
|
||||
if is_ipaccess_bts() and nm_is_running(): 0
|
||||
else: 1
|
||||
paging_init_if_needed() ./openbsc/openbsc/src/libbsc/paging.c:224
|
||||
LAUNCH TIMER:
|
||||
bts->paging.work_timer.cb = paging_worker;
|
||||
paging_worker() ./openbsc/openbsc/src/libbsc/paging.c:217
|
||||
paging_handle_pending_requests() ./openbsc/openbsc/src/libbsc/paging.c:169 (R):
|
||||
paging_give_credit() ./openbsc/openbsc/src/libbsc/paging.c:107 (R):
|
||||
recurse paging_handle_pending_requests()
|
||||
can_send_pag_req() ./openbsc/openbsc/src/libbsc/paging.c:116
|
||||
page_ms() ./openbsc/openbsc/src/libbsc/paging.c:69
|
||||
gsm0808_page() ./openbsc/openbsc/src/libbsc/bsc_api.c:415
|
||||
rsl_paging_cmd() ./openbsc/openbsc/src/libbsc/abis_rsl.c:751
|
||||
abis_rsl_dchan_hdr
|
||||
RSL_MT_PAGING_CMD
|
||||
RSL_CHAN_PCH_AGCH
|
||||
init_dchan_hdr() ./openbsc/openbsc/src/libbsc/abis_rsl.c:99
|
||||
mdisc_by_msgtype() ./openbsc/openbsc/src/libbsc/abis_rsl.c:80
|
||||
ABIS_RSL_MDISC_RLL
|
||||
ABIS_RSL_MDISC_TRX
|
||||
ABIS_RSL_MDISC_COM_CHAN
|
||||
ABIS_RSL_MDISC_DED_CHAN
|
||||
ABIS_RSL_MDISC_LOC
|
||||
RSL_IE_CHAN_NR
|
||||
RSL_IE_PAGING_GROUP
|
||||
RSL_IE_MS_IDENTITY
|
||||
RSL_IE_CHAN_NEEDED
|
||||
abis_rsl_sendmsg() ./libosmo-abis/src/e1_input.c:258
|
||||
_paging_request() ./openbsc/openbsc/src/libbsc/paging.c:279
|
||||
llist_add_tail(&req->entry, &bts_entry->pending_requests);
|
||||
paging_schedule_if_needed() ./openbsc/openbsc/src/libbsc/paging.c:96
|
||||
if (msc->core_lac == -1)
|
||||
paging_request()
|
||||
gsm_bts_by_lac() ./openbsc/openbsc/src/libcommon/gsm_data.c:135
|
||||
paging_request_bts() ./openbsc/openbsc/src/libbsc/paging.c:307
|
||||
(see above)
|
||||
if err
|
||||
paging_request_stop()
|
||||
(see below)
|
||||
locked_paging() ./openbsc/openbsc/src/osmo-bsc/osmo_bsc_grace.c:54
|
||||
paging_request_bts() ./openbsc/openbsc/src/libbsc/paging.c:307
|
||||
(see above)
|
||||
|
||||
|
||||
- A-bis Interface
|
||||
|
||||
Osmo-BSC to BTS:
|
||||
abis_sendmsg()
|
||||
^
|
||||
| libosmo-abis/src/e1_input.c:abis_rsl_sendmsg()
|
||||
| ^
|
||||
| | libbsc/abis_rsl.c: 23 callers
|
||||
| | rsl_bcch_info()
|
||||
| | rsl_sacch_filling()
|
||||
| | rsl_sacch_info_modify()
|
||||
| | rsl_chan_bs_power_ctrl()
|
||||
| | rsl_chan_ms_power_ctrl()
|
||||
| | rsl_chan_activate_lchan()
|
||||
| | rsl_chan_mode_modify_req()
|
||||
| | rsl_encryption_cmd()
|
||||
| | rsl_deact_sacch()
|
||||
| | rsl_rf_chan_release()
|
||||
| | rsl_paging_cmd()
|
||||
| | rsl_imm_assign_cmd()
|
||||
| | rsl_siemens_mrpci()
|
||||
| | rsl_data_request()
|
||||
| | rsl_establish_request()
|
||||
| | rsl_release_request()
|
||||
| | rsl_ipacc_crcx()
|
||||
| | rsl_ipacc_mdcx()
|
||||
| | rsl_ipacc_pdch_activate()
|
||||
| | rsl_sms_cb_command()
|
||||
| | rsl_nokia_si_begin()
|
||||
| | rsl_nokia_si_end()
|
||||
| | rsl_bs_power_control()
|
||||
|
|
||||
| libbsc/bts_nokia_site.c:nokia_abis_nm_queue_send_next()
|
||||
|
|
||||
| libbsc/abis_nm.c:_abis_nm_sendmsg()
|
||||
| ^ abis_nm_sendmsg()
|
||||
| | abis_nm_sendmsg_direct()
|
||||
|
|
||||
| osmo-bts/src/common/abis.c:abis_oml_sendmsg()
|
||||
| osmo-bts/src/common/abis.c:abis_bts_rsl_sendmsg()
|
||||
|
||||
|
||||
|
||||
libbsc/e1_config.c:bts_isdn_e1inp_line_ops.sign_link =
|
||||
libbsc/e1_config.c:bts_isdn_sign_link(struct msgb *msg)
|
||||
case E1INP_SIGN_RSL:
|
||||
libbsc/abis_rsl.c:abis_rsl_rcvmsg(msg) (1)
|
||||
case E1INP_SIGN_OML:
|
||||
ret = bts->model->oml_rcvmsg(msg);
|
||||
|
||||
libbsc/bts_ipaccess_nanobts.c:ipaccess_e1inp_line_ops.sign_link =
|
||||
ipaccess_sign_link(struct msgb *msg)
|
||||
case E1INP_SIGN_RSL:
|
||||
libbsc/abis_rsl.c:abis_rsl_rcvmsg(msg) (1)
|
||||
case E1INP_SIGN_OML:
|
||||
libbsc/abis_nm.c:abis_nm_rcvmsg(msg);
|
||||
|
||||
|
||||
(1)
|
||||
libbsc/abis_rsl.c:abis_rsl_rcvmsg(msg)
|
||||
case ABIS_RSL_MDISC_RLL:
|
||||
libbsc/abis_rsl.c:abis_rsl_rx_rll(msg)
|
||||
case DATA_IND, EST_IND:
|
||||
libbsc/bsc_api.c:gsm0408_rcvmsg(struct msgb *msg, uint8_t link_id)
|
||||
msg->lchan->ts->trx->bts->network->bsc_api;
|
||||
if (lchan->conn)
|
||||
libbsc/bsc_api.c:dispatch_dtap() (2)
|
||||
else
|
||||
lchan->conn = subscr_con_allocate(msg->lchan);
|
||||
rc = api->compl_l3(lchan->conn, msg, 0); (3)
|
||||
|
||||
case ABIS_RSL_MDISC_DED_CHAN:
|
||||
rc = abis_rsl_rx_dchan(msg);
|
||||
|
||||
case ABIS_RSL_MDISC_COM_CHAN:
|
||||
rc = abis_rsl_rx_cchan(msg);
|
||||
|
||||
case ABIS_RSL_MDISC_TRX:
|
||||
rc = abis_rsl_rx_trx(msg);
|
||||
|
||||
case ABIS_RSL_MDISC_IPACCESS:
|
||||
rc = abis_rsl_rx_ipacc(msg);
|
||||
break;
|
||||
|
||||
case ABIS_RSL_MDISC_LOC:
|
||||
LOGP(DRSL, LOGL_NOTICE, "unimplemented RSL msg disc 0x%02x\n",
|
||||
|
||||
|
||||
(2)
|
||||
libbsc/bsc_api.c:dispatch_dtap()
|
||||
struct bsc_api *api = msg->lchan->ts->trx->bts->network->bsc_api;
|
||||
|
||||
default:
|
||||
if (api->dtap)
|
||||
api->dtap(conn, link_id, msg); (5)
|
||||
|
||||
case GSM48_PDISC_RR:
|
||||
case GSM48_MT_RR_HANDO_COMPL:
|
||||
handle_rr_ho_compl(msg);
|
||||
|
||||
case GSM48_MT_RR_HANDO_FAIL:
|
||||
handle_rr_ho_fail(msg);
|
||||
|
||||
case GSM48_MT_RR_CIPH_M_COMPL:
|
||||
if (api->cipher_mode_compl)
|
||||
api->cipher_mode_compl(conn, msg, (4)
|
||||
conn->lchan->encr.alg_id);
|
||||
|
||||
case GSM48_MT_RR_ASS_COMPL:
|
||||
handle_ass_compl(conn, msg);
|
||||
|
||||
case GSM48_MT_RR_ASS_FAIL:
|
||||
handle_ass_fail(conn, msg);
|
||||
|
||||
case GSM48_MT_RR_CHAN_MODE_MODIF_ACK:
|
||||
rc = gsm48_rx_rr_modif_ack(msg);
|
||||
if (rc < 0) {
|
||||
api->assign_fail(conn, GSM0808_CAUSE_NO_RADIO_RESOURCE_AVAILABLE)
|
||||
else
|
||||
api->assign_compl()
|
||||
|
||||
case GSM48_MT_RR_CLSM_CHG:
|
||||
handle_classmark_chg(conn, msg);
|
||||
|
||||
case GSM48_MT_RR_APP_INFO:
|
||||
if (api->dtap)
|
||||
api->dtap(conn, link_id, msg); (5)
|
||||
|
||||
default:
|
||||
if (api->dtap)
|
||||
api->dtap(conn, link_id, msg); (5)
|
||||
|
||||
case GSM48_MT_RR_GPRS_SUSP_REQ:
|
||||
DEBUGP(DRR, "GRPS SUSPEND REQUEST\n");
|
||||
|
||||
case GSM48_MT_RR_STATUS:
|
||||
LOGP(DRR, LOGL_NOTICE, "RR STATUS (cause: %s)\n",
|
||||
|
||||
case GSM48_MT_RR_MEAS_REP:
|
||||
LOGP(DMEAS, LOGL_ERROR, "DIRECT GSM48 MEASUREMENT REPORT ?!? ");
|
||||
|
||||
|
||||
(3)[0]
|
||||
msc_bsc_api().compl_l3 =
|
||||
libmsc/osmo_msc.c: msc_compl_l3(struct gsm_subscriber_connection *conn, struct msgb *msg,
|
||||
libmsc/gsm0408.c: gsm0408_dispatch() (6)
|
||||
|
||||
(3)[1]
|
||||
osmo_bsc_api().compl_l3 =
|
||||
osmo-bsc/osmo_bsc_api.c:bsc_compl_l3()
|
||||
msc = bsc_find_msc(conn, msg);
|
||||
complete_layer3(conn, msg, msc)
|
||||
bsc_filter_initial(msc->network->bsc_data, msc, conn, msg,
|
||||
&imsi, &con_type, &lu_cause);
|
||||
bsc_create_new_connection(conn, msc, send_ping);
|
||||
sccp->state_cb = msc_outgoing_sccp_state()
|
||||
sccp->data_cb = msc_outgoing_sccp_data()
|
||||
bsc_con->send_ping = send_ping()
|
||||
bsc_con->sccp_it_timeout.cb = sccp_it_timeout()
|
||||
bsc_con->sccp_cc_timeout.cb = sccp_cc_timeout()
|
||||
bsc_scan_bts_msg(conn, msg); (7)
|
||||
resp = gsm0808_create_layer3(msg, network_code, country_code, lac, ci);
|
||||
|
||||
(5)[0]
|
||||
msc_bsc_api().dtap =
|
||||
libmsc/osmo_msc.c: msc_dtap(conn, link_id, msg)
|
||||
gsm0408_dispatch(conn, msg) (6)
|
||||
|
||||
(5)[1]
|
||||
osmo_bsc_api().dtap =
|
||||
osmo-bsc/osmo_bsc_api.c: bsc_dtap(conn, link_id, msg)
|
||||
if (handle_cc_setup(conn, msg) >= 1) return;
|
||||
if (bsc_filter_data(conn, msg, &lu_cause) < 0)
|
||||
bsc_maybe_lu_reject()
|
||||
return;
|
||||
bsc_scan_bts_msg(conn, msg); (7)
|
||||
resp = gsm0808_create_dtap(msg, link_id);
|
||||
queue_msg_or_return(resp);
|
||||
|
||||
(7)
|
||||
bsc_scan_bts_msg() <osmo-bsc/osmo_bsc_filter.c:212>:
|
||||
if GSM48_PDISC_MM, GSM48_MT_MM_LOC_UPD_REQUEST
|
||||
handle_lu_request() <osmo-bsc/osmo_bsc_filter.c:29>:
|
||||
gsm48_generate_lai()
|
||||
if GSM48_PDISC_RR, GSM48_MT_RR_PAG_RESP
|
||||
handle_page_resp() <osmo-bsc/osmo_bsc_filter.c:97>:
|
||||
extract_sub() <osmo-bsc/osmo_bsc_filter.c:57>
|
||||
paging_request_stop() <libbsc/paging.c:390>:
|
||||
log_set_context()
|
||||
_paging_request_stop() <libbsc/paging.c:359>:
|
||||
paging_init_if_needed() <libbsc/paging.c:224>:
|
||||
paging_worker() <libbsc/paging.c:217>:
|
||||
paging_handle_pending_requests() <libbsc/paging.c:169> (R):
|
||||
cb()
|
||||
paging_give_credit() <libbsc/paging.c:107> (R):
|
||||
paging_handle_pending_requests() <libbsc/paging.c:169> (recursive: see 37)
|
||||
can_send_pag_req() <libbsc/paging.c:116>:
|
||||
page_ms() <libbsc/paging.c:69>:
|
||||
gsm0808_page() <libbsc/bsc_api.c:415>:
|
||||
rsl_paging_cmd() <libbsc/abis_rsl.c:751>:
|
||||
abis_rsl_dchan_hdr = RSL_IE_CHAN_NR
|
||||
mdisc_by_msgtype() <libbsc/abis_rsl.c:80>:
|
||||
ABIS_RSL_MDISC_RLL
|
||||
ABIS_RSL_MDISC_TRX
|
||||
ABIS_RSL_MDISC_COM_CHAN
|
||||
ABIS_RSL_MDISC_DED_CHAN
|
||||
ABIS_RSL_MDISC_LOC
|
||||
msgb_tv_put(msg, RSL_IE_PAGING_GROUP, paging_group);
|
||||
msgb_tlv_put(msg, RSL_IE_MS_IDENTITY, len-2, ms_ident+2);
|
||||
msgb_tv_put(msg, RSL_IE_CHAN_NEEDED, chan_needed);
|
||||
rsl_link
|
||||
abis_rsl_sendmsg()
|
||||
cbfn() (8)
|
||||
paging_remove_request() <libbsc/paging.c:60>:
|
||||
subscr_put() <libcommon/gsm_subscriber_base.c:89>
|
||||
subscr_put() <libcommon/gsm_subscriber_base.c:89>
|
||||
|
||||
(8)[0]
|
||||
libmsc/gsm_04_08.c:mncc_tx_to_cc()
|
||||
req->cbfn =
|
||||
libmsc/gsm_04_08.c:setup_trig_pag_evt
|
||||
|
||||
(8)[1]
|
||||
libmsc/gsm_04_11.c:gsm411_send_sms_subscr()
|
||||
req->cbfn =
|
||||
libmsc/gsm_04_11.c:paging_cb_send_sms
|
||||
|
||||
(9)
|
||||
bsc_scan_msc_msg() ./osmo-bsc/osmo_bsc_filter.c:330
|
||||
gsm48_hdr
|
||||
send_welcome_ussd() ./osmo-bsc/osmo_bsc_filter.c:229
|
||||
LOGP()
|
||||
DMSC
|
||||
LOGL_DEBUG
|
||||
ussd_welcome_txt
|
||||
BSS_SEND_USSD
|
||||
GSM48_MT_MM_INFO
|
||||
bsc_patch_mm_info() ./osmo-bsc/osmo_bsc_filter.c:255
|
||||
uint8_t
|
||||
tzbsd
|
||||
dst
|
||||
tlv_parse()
|
||||
gsm48_mm_att_tlvdef
|
||||
override
|
||||
hr
|
||||
mn
|
||||
TLVP_PRESENT()
|
||||
GSM48_IE_UTC
|
||||
LOGP()
|
||||
DMSC
|
||||
LOGL_DEBUG
|
||||
TLVP_VAL()
|
||||
GSM48_IE_NET_TIME_TZ
|
||||
GSM48_IE_NET_DST
|
||||
|
||||
|
||||
(6)
|
||||
libmsc/gsm0408.c: gsm0408_dispatch() (MSC rx from BSC)
|
||||
if (silent_call_reroute(conn, msg))
|
||||
return silent_call_rx(conn, msg);
|
||||
|
||||
case gsm48_pdisc_cc:
|
||||
rc = gsm0408_rcv_cc(conn, msg);
|
||||
|
||||
case gsm48_pdisc_mm:
|
||||
rc = gsm0408_rcv_mm(conn, msg);
|
||||
|
||||
case gsm48_pdisc_rr:
|
||||
rc = gsm0408_rcv_rr(conn, msg);
|
||||
|
||||
case gsm48_pdisc_sms:
|
||||
rc = gsm0411_rcv_sms(conn, msg);
|
||||
|
||||
case gsm48_pdisc_nc_ss:
|
||||
rc = handle_rcv_ussd(conn, msg);
|
||||
|
||||
case gsm48_pdisc_mm_gprs:
|
||||
case gsm48_pdisc_sm_gprs:
|
||||
logp(drll, logl_notice, "unimplemented "
|
||||
|
||||
msc_bsc_api().assign_compl =
|
||||
msc_assign_compl()
|
||||
nothing
|
||||
|
||||
(4)[0]
|
||||
libmsc/osmo_msc.c:msc_bsc_api().cipher_mode_compl =
|
||||
msc_ciph_m_compl(conn, msg, alg_id)
|
||||
conn->sec_operation->cb(GSM_HOOK_RR_SECURITY, GSM_SECURITY_SUCCEEDED,
|
||||
NULL, conn, conn->sec_operation->cb_data)
|
||||
release_security_operation(conn);
|
||||
msc_release_connection(conn)
|
||||
bsc_api.c:gsm0808_clear(conn)
|
||||
libbsc/handover_logic.c:bsc_clear_handover(conn, 1)
|
||||
libbsc/chan_alloc.c:lchan_release(ho->new_lchan, 0, RSL_REL_LOCAL_END);
|
||||
libbsc/chan_alloc.c:lchan_release(conn->secondary_lchan, 0, RSL_REL_LOCAL_END),
|
||||
(conn->lchan, 1, RSL_REL_NORMAL)
|
||||
bsc_api.c:subscr_con_free(conn)
|
||||
libcommon/gsm_subscriber_base.c:subscr_put(conn->subscr);
|
||||
|
||||
(4)[1]
|
||||
osmo-bsc/osmo_bsc_api.c:osmo_bsc_api().cipher_mode_compl =
|
||||
bsc_cipher_mode_compl()
|
||||
queue_msg_or_return() osmo-bsc/osmo_bsc_api.c
|
||||
bsc_queue_for_msc()
|
||||
|
||||
|
||||
libbsc/abis_nm.c:abis_nm_rcvmsg(msg);
|
||||
case ABIS_OM_MDISC_FOM:
|
||||
rc = abis_nm_rcvmsg_fom(msg);
|
||||
|
||||
case ABIS_OM_MDISC_MANUF:
|
||||
rc = abis_nm_rcvmsg_manuf(msg);
|
||||
|
||||
case ABIS_OM_MDISC_MMI:
|
||||
case ABIS_OM_MDISC_TRAU:
|
||||
LOGP(DNM, LOGL_ERROR, "unimplemented ABIS OML message discriminator 0x%x\n",
|
||||
|
||||
21
openbsc/doc/control-interface.txt
Normal file
21
openbsc/doc/control-interface.txt
Normal file
@@ -0,0 +1,21 @@
|
||||
The protocol for the control interface is wrapped inside the ip.access header
|
||||
with the IPAC_PROTO_OSMO protocol ID (0xee). Inside the ip.access header is
|
||||
a struct ipaccess_head_ext with protocol ID 0x00 which indicates the control
|
||||
interface.
|
||||
|
||||
After that the actual protocol is text based:
|
||||
|
||||
* Getting the value of a variable
|
||||
-> GET <id> <var>
|
||||
<- GET_REPLY <id> <var> <val>
|
||||
or ERROR <id> <reason>
|
||||
|
||||
* Setting the value of a variable
|
||||
-> SET <id> <var> <val>
|
||||
<- SET_REPLY <id> <var> <val>
|
||||
or ERROR <id> <reason>
|
||||
|
||||
* A value changes which triggers a trap
|
||||
<- TRAP <var> <val>
|
||||
|
||||
<id> needs to be unique within a connection. '0' is not allowed
|
||||
@@ -1,3 +1,4 @@
|
||||
|
||||
CFG_FILES = find $(srcdir) -name '*.cfg*' | sed -e 's,^$(srcdir),,'
|
||||
|
||||
dist-hook:
|
||||
|
||||
@@ -40,6 +40,7 @@ network
|
||||
timer t3119 0
|
||||
timer t3122 0
|
||||
timer t3141 0
|
||||
dtx-used 0
|
||||
subscriber-keep-in-ram 0
|
||||
bts 0
|
||||
type nanobts
|
||||
@@ -54,8 +55,6 @@ network
|
||||
channel allocator ascending
|
||||
rach tx integer 9
|
||||
rach max transmission 7
|
||||
dtx uplink force
|
||||
dtx downlink
|
||||
ip.access unit_id 0 0
|
||||
oml ip.access stream_id 255 line 0
|
||||
neighbor-list mode manual-si5
|
||||
|
||||
36
openbsc/doc/examples/osmo-cscn/osmo-cscn.cfg
Normal file
36
openbsc/doc/examples/osmo-cscn/osmo-cscn.cfg
Normal file
@@ -0,0 +1,36 @@
|
||||
!
|
||||
! OsmoCSCN configuration saved from vty
|
||||
!
|
||||
line vty
|
||||
no login
|
||||
!
|
||||
network
|
||||
network country code 1
|
||||
mobile network code 1
|
||||
short name OsmoCSCN
|
||||
long name OsmoCSCN
|
||||
auth policy closed
|
||||
location updating reject cause 13
|
||||
encryption a5 0
|
||||
rrlp mode none
|
||||
mm info 1
|
||||
handover 0
|
||||
handover window rxlev averaging 10
|
||||
handover window rxqual averaging 1
|
||||
handover window rxlev neighbor averaging 10
|
||||
handover power budget interval 6
|
||||
handover power budget hysteresis 3
|
||||
handover maximum distance 9999
|
||||
timer t3101 10
|
||||
timer t3103 0
|
||||
timer t3105 0
|
||||
timer t3107 0
|
||||
timer t3109 4
|
||||
timer t3111 0
|
||||
timer t3113 60
|
||||
timer t3115 0
|
||||
timer t3117 0
|
||||
timer t3119 0
|
||||
timer t3141 0
|
||||
cscn
|
||||
subscriber-create-on-demand
|
||||
@@ -37,6 +37,7 @@ network
|
||||
timer t3119 0
|
||||
timer t3122 0
|
||||
timer t3141 0
|
||||
dtx-used 0
|
||||
subscriber-keep-in-ram 0
|
||||
bts 0
|
||||
type rbs2000
|
||||
|
||||
@@ -1,77 +0,0 @@
|
||||
!
|
||||
! OpenBSC configuration saved from vty
|
||||
! !
|
||||
password foo
|
||||
!
|
||||
line vty
|
||||
no login
|
||||
!
|
||||
e1_input
|
||||
e1_line 0 driver ipa
|
||||
network
|
||||
network country code 1
|
||||
mobile network code 1
|
||||
short name OpenBSC
|
||||
long name OpenBSC
|
||||
auth policy closed
|
||||
location updating reject cause 13
|
||||
encryption a5 0
|
||||
neci 1
|
||||
rrlp mode none
|
||||
mm info 1
|
||||
handover 0
|
||||
handover window rxlev averaging 10
|
||||
handover window rxqual averaging 1
|
||||
handover window rxlev neighbor averaging 10
|
||||
handover power budget interval 6
|
||||
handover power budget hysteresis 3
|
||||
handover maximum distance 9999
|
||||
timer t3101 10
|
||||
timer t3103 0
|
||||
timer t3105 0
|
||||
timer t3107 0
|
||||
timer t3109 4
|
||||
timer t3111 0
|
||||
timer t3113 60
|
||||
timer t3115 0
|
||||
timer t3117 0
|
||||
timer t3119 0
|
||||
timer t3141 0
|
||||
bts 0
|
||||
type sysmobts
|
||||
band DCS1800
|
||||
cell_identity 0
|
||||
location_area_code 1
|
||||
training_sequence_code 7
|
||||
base_station_id_code 63
|
||||
ms max power 15
|
||||
cell reselection hysteresis 4
|
||||
rxlev access min 0
|
||||
channel allocator ascending
|
||||
rach tx integer 9
|
||||
rach max transmission 7
|
||||
ip.access unit_id 1801 0
|
||||
oml ip.access stream_id 255 line 0
|
||||
gprs mode none
|
||||
trx 0
|
||||
rf_locked 0
|
||||
arfcn 514
|
||||
nominal power 23
|
||||
max_power_red 20
|
||||
rsl e1 tei 0
|
||||
timeslot 0
|
||||
phys_chan_config CCCH+SDCCH4
|
||||
timeslot 1
|
||||
phys_chan_config SDCCH8
|
||||
timeslot 2
|
||||
phys_chan_config TCH/F
|
||||
timeslot 3
|
||||
phys_chan_config TCH/F
|
||||
timeslot 4
|
||||
phys_chan_config TCH/F
|
||||
timeslot 5
|
||||
phys_chan_config TCH/F
|
||||
timeslot 6
|
||||
phys_chan_config TCH/F
|
||||
timeslot 7
|
||||
phys_chan_config TCH/F
|
||||
@@ -1,5 +1,7 @@
|
||||
digraph G {
|
||||
net [label="gsm_network"]
|
||||
subconns [label="subscr_conns"]
|
||||
btslist [label="bts_list"]
|
||||
bts [label="gsm_bts"]
|
||||
trx [label="gsm_bts_trx"]
|
||||
ts [label="gsm_bts_trx_ts"]
|
||||
@@ -9,7 +11,8 @@ digraph G {
|
||||
sccpcon [label="osmo_bsc_sccp_con"]
|
||||
subgrp [label="gsm_subscriber_group"]
|
||||
|
||||
net -> bts
|
||||
net -> btslist
|
||||
btslist -> bts [label="llist"]
|
||||
bts -> trx
|
||||
trx -> ts
|
||||
ts -> lchan
|
||||
@@ -21,6 +24,8 @@ digraph G {
|
||||
|
||||
lchan -> subcon
|
||||
|
||||
net -> subconns
|
||||
subconns -> subcon [label="llist"]
|
||||
subcon -> sub
|
||||
subcon -> sccpcon
|
||||
subcon -> lchan
|
||||
15
openbsc/doc/libmsc-data-structures.dot
Normal file
15
openbsc/doc/libmsc-data-structures.dot
Normal file
@@ -0,0 +1,15 @@
|
||||
digraph G {
|
||||
net [label="gsm_network"]
|
||||
subconns [label="subscr_conns"]
|
||||
sub [label="gsm_subscriber"]
|
||||
subcon [label="gsm_subscriber_conn"]
|
||||
subgrp [label="gsm_subscriber_group"]
|
||||
|
||||
net -> subconns
|
||||
subconns -> subcon [label="llist"]
|
||||
subcon -> sub
|
||||
subcon -> net
|
||||
|
||||
sub -> subgrp
|
||||
subgrp -> net
|
||||
}
|
||||
250
openbsc/doc/osmocom-authn-protocol.txt
Normal file
250
openbsc/doc/osmocom-authn-protocol.txt
Normal file
@@ -0,0 +1,250 @@
|
||||
|
||||
Osmocom Authentication Protocol (OAP)
|
||||
|
||||
1. General
|
||||
|
||||
The Osmocom Authentication Protocol employs mutual authentication to register a
|
||||
client with a server over an IPA connection. Milenage is used as the
|
||||
authentication algorithm, where client and server have a shared secret.
|
||||
|
||||
For example, an SGSN, as OAP client, may use its SGSN ID to register with a MAP
|
||||
proxy, an OAP server.
|
||||
|
||||
1.1. Connection
|
||||
|
||||
The protocol expects that a reliable, ordered, packet boundaries preserving
|
||||
connection is used (e.g. IPA over TCP).
|
||||
|
||||
1.2. Using IPA
|
||||
|
||||
By default, the following identifiers should be used:
|
||||
- IPA protocol: 0xee (OSMO)
|
||||
- IPA OSMO protocol extension: 0x06 (OAP)
|
||||
|
||||
2. Procedures
|
||||
|
||||
Ideal communication sequence:
|
||||
|
||||
Client Server
|
||||
| |
|
||||
| Register (ID) |
|
||||
|----------------------------------->|
|
||||
| |
|
||||
| Challenge (RAND+AUTN) |
|
||||
|<-----------------------------------|
|
||||
| |
|
||||
| Challenge Result (XRES) |
|
||||
|----------------------------------->|
|
||||
| |
|
||||
| Register Result |
|
||||
|<-----------------------------------|
|
||||
|
||||
Variation "test setup":
|
||||
|
||||
Client Server
|
||||
| |
|
||||
| Register (ID) |
|
||||
|----------------------------------->|
|
||||
| |
|
||||
| Register Result |
|
||||
|<-----------------------------------|
|
||||
|
||||
Variation "invalid sequence nr":
|
||||
|
||||
Client Server
|
||||
| |
|
||||
| Register (ID) |
|
||||
|----------------------------------->|
|
||||
| |
|
||||
| Challenge (RAND+AUTN) |
|
||||
|<-----------------------------------|
|
||||
| |
|
||||
| Sync Request (AUTS) |
|
||||
|----------------------------------->|
|
||||
| |
|
||||
| Challenge (RAND'+AUTN') |
|
||||
|<-----------------------------------|
|
||||
| |
|
||||
| Challenge Result (XRES) |
|
||||
|----------------------------------->|
|
||||
| |
|
||||
| Register Result |
|
||||
|<-----------------------------------|
|
||||
|
||||
2.1. Register
|
||||
|
||||
The client sends a REGISTER_REQ message containing an identifier number.
|
||||
|
||||
2.2. Challenge
|
||||
|
||||
The OAP server (optionally) sends back a CHALLENGE_REQ, containing random bytes
|
||||
and a milenage authentication token generated from these random bytes, using a
|
||||
shared secret, to authenticate itself to the OAP client. The server may omit
|
||||
this challenge entirely, based on its configuration, and immediately reply with
|
||||
a Register Result response. If the client cannot be registered (e.g. id is
|
||||
invalid), the server sends a REGISTER_ERR response.
|
||||
|
||||
2.3. Challenge Result
|
||||
|
||||
When the client has received a Challenge, it may verify the server's
|
||||
authenticity and validity of the sequence number (included in AUTN), and, if
|
||||
valid, reply with a CHALLENGE_RES message. This shall contain an XRES
|
||||
authentication token generated by milenage from the same random bytes received
|
||||
from the server and the same shared secet. If the client decides to cancel the
|
||||
registration (e.g. invalid AUTN), it shall not reply to the CHALLENGE_REQ; a
|
||||
CHALLENGE_ERR message may be sent, but is not mandatory. For example, the
|
||||
client may directly start with a new REGISTER_REQ message.
|
||||
|
||||
2.4. Sync Request
|
||||
|
||||
When the client has received a Challenge but sees an invalid sequence number
|
||||
(embedded in AUTN, according to the milenage algorithm), the client may send a
|
||||
SYNC_REQ message containing an AUTS synchronisation token.
|
||||
|
||||
2.5. Sync Result
|
||||
|
||||
If the server has received a valid Sync Request, it shall answer by directly
|
||||
sending another Challenge (see 2.2.). If an invalid Sync Request is received,
|
||||
the server shall reply with a REGISTER_ERR message.
|
||||
|
||||
2.6. Register Result
|
||||
|
||||
The server sends a REGISTER_RES message to indicate that registration has been
|
||||
successful. If the server cannot register the client (e.g. invalid challenge
|
||||
response), it shall send a REGISTER_ERR message.
|
||||
|
||||
3. Message Format
|
||||
|
||||
3.1. General
|
||||
|
||||
Every message is based on the following message format
|
||||
|
||||
IEI Info Element Type Pres. Format Length
|
||||
Message type 4.2.1 M V 1
|
||||
|
||||
The receiver shall be able to receive IEs in any order. Unknown IEs shall be
|
||||
ignored.
|
||||
|
||||
3.2.1. Register Request
|
||||
|
||||
Client -> Server
|
||||
|
||||
IEI Info Element Type Pres. Format Length
|
||||
Message type 4.2.1 M V 1
|
||||
30 Client ID big endian int (2 oct) M TLV 4
|
||||
|
||||
3.2.2. Register Error
|
||||
|
||||
Server -> Client
|
||||
|
||||
IEI Info Element Type Pres. Format Length
|
||||
Message type 4.2.1 M V 1
|
||||
02 Cause GMM cause, M TLV 3
|
||||
04.08: 10.5.5.14
|
||||
|
||||
3.2.6. Register Result
|
||||
|
||||
Server -> Client
|
||||
|
||||
IEI Info Element Type Pres. Format Length
|
||||
Message type 4.2.1 M V 1
|
||||
|
||||
3.2.3. Challenge
|
||||
|
||||
Server -> Client
|
||||
|
||||
IEI Info Element Type Pres. Format Length
|
||||
Message type 4.2.1 M V 1
|
||||
20 RAND octet string (16) M TLV 18
|
||||
23 AUTN octet string (16) M TLV 18
|
||||
|
||||
3.2.4. Challenge Error
|
||||
|
||||
Client -> Server
|
||||
|
||||
IEI Info Element Type Pres. Format Length
|
||||
Message type 4.2.1 M V 1
|
||||
02 Cause GMM cause, M TLV 3
|
||||
04.08: 10.5.5.14
|
||||
|
||||
3.2.5. Challenge Result
|
||||
|
||||
Client -> Server
|
||||
|
||||
IEI Info Element Type Pres. Format Length
|
||||
Message type 4.2.1 M V 1
|
||||
21 XRES octet string (8) M TLV 10
|
||||
|
||||
3.2.3. Sync Request
|
||||
|
||||
Client -> Server
|
||||
|
||||
IEI Info Element Type Pres. Format Length
|
||||
Message type 4.2.1 M V 1
|
||||
20 AUTS octet string (16) M TLV 18
|
||||
|
||||
3.2.4. Sync Error
|
||||
|
||||
Server -> Client
|
||||
|
||||
IEI Info Element Type Pres. Format Length
|
||||
Message type 4.2.1 M V 1
|
||||
02 Cause GMM cause, M TLV 3
|
||||
04.08: 10.5.5.14
|
||||
|
||||
4. Information Elements
|
||||
|
||||
4.1. General
|
||||
|
||||
[...]
|
||||
|
||||
4.2.1. Message Type
|
||||
|
||||
+---------------------------------------------------+
|
||||
| 8 7 6 5 4 3 2 1 |
|
||||
| |
|
||||
| 0 0 0 0 0 1 0 0 - Register Request |
|
||||
| 0 0 0 0 0 1 0 1 - Register Error |
|
||||
| 0 0 0 0 0 1 1 0 - Register Result |
|
||||
| |
|
||||
| 0 0 0 0 1 0 0 0 - Challenge Request |
|
||||
| 0 0 0 0 1 0 0 1 - Challenge Error |
|
||||
| 0 0 0 0 1 0 1 0 - Challenge Result |
|
||||
| |
|
||||
| 0 0 0 0 1 1 0 0 - Sync Request |
|
||||
| 0 0 0 0 1 1 0 1 - Sync Error (not used) |
|
||||
| 0 0 0 0 1 1 1 0 - Sync Result (not used) |
|
||||
| |
|
||||
+---------------------------------------------------+
|
||||
|
||||
4.2.2. IE Identifier (informational)
|
||||
|
||||
These are the standard values for the IEI.
|
||||
|
||||
+---------------------------------------------------------+
|
||||
| IEI Info Element Type |
|
||||
| |
|
||||
| 0x02 Cause GMM cause, 04.08: 10.5.5.14 |
|
||||
| 0x20 RAND octet string |
|
||||
| 0x23 AUTN octet string |
|
||||
| 0x24 XRES octet string |
|
||||
| 0x25 AUTS octet string |
|
||||
| 0x30 Client ID big endian int (2 octets) |
|
||||
+---------------------------------------------------------+
|
||||
|
||||
4.2.3. Client ID
|
||||
|
||||
8 7 6 5 4 3 2 1
|
||||
+-----------------------------------------------------+
|
||||
| | Client ID IEI | octet 1
|
||||
+-----------------------------------------------------+
|
||||
| Length of Client ID IE contents (2) | octet 2
|
||||
+-----------------------------------------------------+
|
||||
| Client ID number, most significant byte | octet 3
|
||||
+-----------------------------------------------------+
|
||||
| Client ID number, least significant byte | octet 4
|
||||
+-----------------------------------------------------+
|
||||
|
||||
The Client ID number shall be interpreted as an unsigned 16bit integer, where 0
|
||||
indicates an invalid / unset ID.
|
||||
|
||||
468
openbsc/doc/sgsn-remote-protocol.txt
Normal file
468
openbsc/doc/sgsn-remote-protocol.txt
Normal file
@@ -0,0 +1,468 @@
|
||||
|
||||
GPRS Subscriber Update Protocol
|
||||
|
||||
1. General
|
||||
|
||||
This document describes the remote protocol that is used by the SGSN to update
|
||||
and manage the local subscriber list. The protocol and the messages are
|
||||
designed after the corresponding MAP messages (see GSM 09.02) with the
|
||||
following differences:
|
||||
|
||||
- The encoding uses TLV structures instead of ASN.1 encodings
|
||||
- Segmentation is not used
|
||||
|
||||
See the specification of the Gr interface (GSM 03.60).
|
||||
|
||||
2. Connection
|
||||
|
||||
The protocol expects that a reliable, ordered, packet boundaries preserving
|
||||
connection is used (e.g. IPA over TCP). The remote peer is either a service
|
||||
that understands the protocol natively or a wrapper service that maps the
|
||||
messages to/from real MAP messages that can be used to directly communicate
|
||||
with an HLR.
|
||||
|
||||
2.1. Using IPA
|
||||
|
||||
By default, the following identifiers should be used:
|
||||
- IPA protocol: 0xee (OSMO)
|
||||
- IPA OSMO protocol extension: 0x05
|
||||
|
||||
2. Procedures
|
||||
|
||||
2.1. Authentication management
|
||||
|
||||
The SGSN sends a SEND_AUTHENTICATION_INFO_REQ message containing the MS's IMSI
|
||||
to the peer. On errors, especially if authentication info is not availabe for
|
||||
that IMSI, the peer returns a SEND_AUTHENTICATION_INFO_ERR message. Otherwise
|
||||
the peer returns a SEND_AUTHENTICATION_INFO_RES message. If this message
|
||||
contains at least one authentication tuple, the SGSN replaces all tuples that
|
||||
are assigned to the subscriber. If the message doesn't contain any tuple the
|
||||
SGSN may reject the Attach Request. (see GSM 09.02, 25.5.6)
|
||||
|
||||
2.2. Location Updating
|
||||
|
||||
The SGSN sends a UPDATE_LOCATION_REQ to the peer. If the request is denied by
|
||||
the network, the peer returns an UPDATE_LOCATION_ERR message to the SGSN.
|
||||
Otherwise the peer returns an UPDATE_LOCATION_RES message containing all
|
||||
information fields that shall be inserted into the subscriber record. If
|
||||
the 'PDP info complete' information element is set in the message, the SGSN
|
||||
clears existing PDP information fields in the subscriber record first.
|
||||
(see GSM 09.02, 19.1.1.8)
|
||||
|
||||
[...]
|
||||
|
||||
3. Message Format
|
||||
|
||||
3.1. General
|
||||
|
||||
Every message is based on the following message format
|
||||
|
||||
IEI Info Element Type Pres. Format Length
|
||||
Message type 4.2.1 M V 1
|
||||
01 IMSI 4.2.9 M TLV 2-10
|
||||
|
||||
If a numeric range is indicated in the 'presence' column, multiple information
|
||||
elements with the same tag may be used in sequence. The information elements
|
||||
shall be sent in the given order. Nevertheless after the generic part the
|
||||
receiver shall be able to received them in any order. Unknown IE shall be
|
||||
ignored.
|
||||
|
||||
3.2.1. Send Authentication Info Request
|
||||
|
||||
SGSN -> Network peer
|
||||
|
||||
IEI Info Element Type Pres. Format Length
|
||||
Message type 4.2.1 M V 1
|
||||
01 IMSI 4.2.9 M TLV 2-10
|
||||
|
||||
3.2.2. Send Authentication Info Error
|
||||
|
||||
Network peer -> SGSN
|
||||
|
||||
IEI Info Element Type Pres. Format Length
|
||||
Message type 4.2.1 M V 1
|
||||
01 IMSI 4.2.9 M TLV 2-10
|
||||
02 Cause GMM cause, M TLV 3
|
||||
04.08: 10.5.5.14
|
||||
|
||||
3.2.3. Send Authentication Info Response
|
||||
|
||||
Network peer -> SGSN
|
||||
|
||||
IEI Info Element Type Pres. Format Length
|
||||
Message type 4.2.1 M V 1
|
||||
01 IMSI 4.2.9 M TLV 2-10
|
||||
03 Auth tuple 4.2.5 0-5 TLV 36
|
||||
|
||||
3.2.4. Update Location Request
|
||||
|
||||
SGSN -> Network peer
|
||||
|
||||
IEI Info Element Type Pres. Format Length
|
||||
Message type 4.2.1 M V 1
|
||||
01 IMSI 4.2.9 M TLV 2-10
|
||||
|
||||
3.2.5. Update Location Error
|
||||
|
||||
Network peer -> SGSN
|
||||
|
||||
IEI Info Element Type Pres. Format Length
|
||||
Message type 4.2.1 M V 1
|
||||
01 IMSI 4.2.9 M TLV 2-10
|
||||
02 Cause GMM cause, M TLV 3
|
||||
04.08: 10.5.5.14
|
||||
|
||||
3.2.6. Update Location Result
|
||||
|
||||
Network peer -> SGSN
|
||||
|
||||
IEI Info Element Type Pres. Format Length
|
||||
Message type 4.2.1 M V 1
|
||||
01 IMSI 4.2.9 M TLV 2-10
|
||||
08 MSISDN 4.2.10 O TLV 0-9
|
||||
09 HLR Number 4.2.12 O TLV 0-9
|
||||
04 PDP info complete 4.2.8 O TLV 2
|
||||
05 PDP info 4.2.3 1-10 TLV
|
||||
|
||||
If the PDP info complete IE is present, the old PDP info list shall be cleared.
|
||||
|
||||
3.2.7. Location Cancellation Request
|
||||
|
||||
Network peer -> SGSN
|
||||
|
||||
IEI Info Element Type Pres. Format Length
|
||||
Message type 4.2.1 M V 1
|
||||
01 IMSI 4.2.9 M TLV 2-10
|
||||
06 Cancellation type 4.2.6 M TLV 3
|
||||
|
||||
3.2.8. Location Cancellation Result
|
||||
|
||||
SGSN -> Network peer
|
||||
|
||||
IEI Info Element Type Pres. Format Length
|
||||
Message type 4.2.1 M V 1
|
||||
01 IMSI 4.2.9 M TLV 2-10
|
||||
|
||||
3.2.9. Purge MS Request
|
||||
|
||||
SGSN -> Network peer
|
||||
|
||||
IEI Info Element Type Pres. Format Length
|
||||
Message type 4.2.1 M V 1
|
||||
01 IMSI 4.2.9 M TLV 2-10
|
||||
09 HLR Number 4.2.12 M TLV 0-9
|
||||
|
||||
3.2.10. Purge MS Error
|
||||
|
||||
Network peer -> SGSN
|
||||
|
||||
IEI Info Element Type Pres. Format Length
|
||||
Message type 4.2.1 M V 1
|
||||
01 IMSI 4.2.9 M TLV 2-10
|
||||
02 Cause GMM cause, M TLV 3
|
||||
04.08: 10.5.5.14
|
||||
|
||||
3.2.11. Purge MS Result
|
||||
|
||||
Network peer -> SGSN
|
||||
|
||||
IEI Info Element Type Pres. Format Length
|
||||
Message type 4.2.1 M V 1
|
||||
01 IMSI 4.2.9 M TLV 2-10
|
||||
07 Freeze P-TMSI 4.2.8 O TLV 2
|
||||
|
||||
3.2.12. Insert Subscriber Data Request
|
||||
|
||||
Network peer -> SGSN
|
||||
|
||||
IEI Info Element Type Pres. Format Length
|
||||
Message type 4.2.1 M V 1
|
||||
01 IMSI 4.2.9 M TLV 2-10
|
||||
04 PDP info complete 4.2.8 O TLV 2
|
||||
05 PDP info 4.2.3 0-10 TLV
|
||||
|
||||
If the PDP info complete IE is present, the old PDP info list shall be cleared.
|
||||
|
||||
3.2.13. Insert Subscriber Data Error
|
||||
|
||||
SGSN -> Network peer
|
||||
|
||||
IEI Info Element Type Pres. Format Length
|
||||
Message type 4.2.1 M V 1
|
||||
01 IMSI 4.2.9 M TLV 2-10
|
||||
02 Cause GMM cause, M TLV 3
|
||||
04.08: 10.5.5.14
|
||||
|
||||
3.2.14. Insert Subscriber Data Result
|
||||
|
||||
SGSN -> Network peer
|
||||
|
||||
IEI Info Element Type Pres. Format Length
|
||||
Message type 4.2.1 M V 1
|
||||
01 IMSI 4.2.9 M TLV 2-10
|
||||
|
||||
3.2.15. Delete Subscriber Data Request
|
||||
|
||||
Network peer -> SGSN
|
||||
|
||||
IEI Info Element Type Pres. Format Length
|
||||
Message type 4.2.1 M V 1
|
||||
01 IMSI 4.2.9 M TLV 2-10
|
||||
10 PDP context id 4.2.3 0-10 TLV
|
||||
(no conditional IE)
|
||||
|
||||
3.2.16. Delete Subscriber Data Error
|
||||
|
||||
SGSN -> Network peer
|
||||
|
||||
IEI Info Element Type Pres. Format Length
|
||||
Message type 4.2.1 M V 1
|
||||
01 IMSI 4.2.9 M TLV 2-10
|
||||
02 Cause GMM cause, M TLV 3
|
||||
04.08: 10.5.5.14
|
||||
|
||||
3.2.17. Delete Subscriber Data Result
|
||||
|
||||
Network peer -> SGSN
|
||||
|
||||
IEI Info Element Type Pres. Format Length
|
||||
Message type 4.2.1 M V 1
|
||||
01 IMSI 4.2.9 M TLV 2-10
|
||||
|
||||
4. Information Elements
|
||||
|
||||
4.1. General
|
||||
|
||||
[...]
|
||||
|
||||
4.2.1. Message Type
|
||||
|
||||
+---------------------------------------------------+
|
||||
| 8 7 6 5 4 3 2 1 |
|
||||
| |
|
||||
| 0 0 0 0 0 1 0 0 - Update Location Request |
|
||||
| 0 0 0 0 0 1 0 1 - Update Location Error |
|
||||
| 0 0 0 0 0 1 1 0 - Update Location Result |
|
||||
| |
|
||||
| 0 0 0 0 1 0 0 0 - Send Auth Info Request |
|
||||
| 0 0 0 0 1 0 0 1 - Send Auth Info Error |
|
||||
| 0 0 0 0 1 0 1 0 - Send Auth Info Result |
|
||||
| |
|
||||
| 0 0 0 0 1 1 0 0 - Purge MS Request |
|
||||
| 0 0 0 0 1 1 0 1 - Purge MS Error |
|
||||
| 0 0 0 0 1 1 1 0 - Purge MS Result |
|
||||
| |
|
||||
| 0 0 0 1 0 0 0 0 - Insert Subscr. Data Request |
|
||||
| 0 0 0 1 0 0 0 1 - Insert Subscr. Data Error |
|
||||
| 0 0 0 1 0 0 1 0 - Insert Subscr. Data Result |
|
||||
| |
|
||||
| 0 0 0 1 0 1 0 0 - Delete Subscr. Data Request |
|
||||
| 0 0 0 1 0 1 0 1 - Delete Subscr. Data Error |
|
||||
| 0 0 0 1 0 1 1 0 - Delete Subscr. Data Result |
|
||||
| |
|
||||
| 0 0 0 1 1 1 0 0 - Location Cancellation Request |
|
||||
| 0 0 0 1 1 1 0 1 - Location Cancellation Error |
|
||||
| 0 0 0 1 1 1 1 0 - Location Cancellation Result |
|
||||
| |
|
||||
+---------------------------------------------------+
|
||||
|
||||
4.2.2. IP Address
|
||||
|
||||
The value part is encoded like in the Packet data protocol address IE defined
|
||||
in GSM 04.08, 10.5.6.4. PDP type organization must be set to 'IETF allocated
|
||||
address'.
|
||||
|
||||
4.2.3. PDP Info
|
||||
|
||||
This is a container for information elements describing a single PDP.
|
||||
|
||||
IEI Info Element Type Pres. Format Length
|
||||
PDP Info IEI M V 1
|
||||
Length of PDP Info IE length, no ext M V 1
|
||||
10 PDP context id big endian int, 1-N C TLV 3
|
||||
11 PDP type 4.2.4 C TLV 4
|
||||
12 Access point name 04.08, 10.5.6.1 C TLV 3-102
|
||||
13 Quality of Service 4.2.11 O TLV 1-20
|
||||
|
||||
The conditional IE are mandantory unless mentioned otherwise.
|
||||
|
||||
4.2.4. PDP Type
|
||||
|
||||
The PDP type value consists of 2 octets that are encoded like octet 4-5 of the
|
||||
End User Address defined in GSM 09.60, 7.9.18.
|
||||
|
||||
8 7 6 5 4 3 2 1
|
||||
+-----------------------------------------------------+
|
||||
| | PDP type IEI | octet 1
|
||||
+-----------------------------------------------------+
|
||||
| Length of PDP type IE contents (2) | octet 2
|
||||
+-----------------------------------------------------+
|
||||
| Spare | PDP type org. | octet 3
|
||||
+-----------------------------------------------------+
|
||||
| PDP type number | octet 4
|
||||
+-----------------------------------------------------+
|
||||
|
||||
The spare bits are left undefined. While 09.60 defines them as '1 1 1 1', there
|
||||
are MAP traces where these bits are set to '0 0 0 0'. So the receiver shall
|
||||
ignore these bits.
|
||||
|
||||
Examples:
|
||||
|
||||
IPv4: PDP type org: 1 (IETF), PDP type number: 0x21
|
||||
IPv6: PDP type org: 1 (IETF), PDP type number: 0x57
|
||||
|
||||
4.2.5. Auth tuple
|
||||
|
||||
This is a container for information elements describing a single authentication
|
||||
tuple.
|
||||
|
||||
IEI Info Element Type Pres. Format Length
|
||||
Auth. Tuple IEI M V 1
|
||||
Length of Ath Tuple IE length, no ext M V 1
|
||||
20 RAND octet string (16) M TLV 18
|
||||
21 SRES octet string (4) M TLV 6
|
||||
22 Kc octet string (8) M TLV 10
|
||||
|
||||
4.2.6. Cancellation Type
|
||||
|
||||
8 7 6 5 4 3 2 1
|
||||
+-----------------------------------------------------+
|
||||
| | Cancellation type IEI | octet 1
|
||||
+-----------------------------------------------------+
|
||||
| Length of Cancellation Type IE contents (1) | octet 2
|
||||
+-----------------------------------------------------+
|
||||
| Cancellation type number | octet 4
|
||||
+-----------------------------------------------------+
|
||||
|
||||
Where the cancellation type number is:
|
||||
|
||||
+---------------------------------------------------+
|
||||
| 8 7 6 5 4 3 2 1 |
|
||||
| |
|
||||
| 0 0 0 0 0 0 0 0 - Update Procedure |
|
||||
| 0 0 0 0 0 0 0 1 - Subscription Withdraw |
|
||||
+---------------------------------------------------+
|
||||
|
||||
4.2.7. IE Identifier (informational)
|
||||
|
||||
These are the standard values for the IEI. See the message definitions for the
|
||||
IEI that shall be used for the encoding.
|
||||
|
||||
+---------------------------------------------------------+
|
||||
| IEI Info Element Type |
|
||||
| |
|
||||
| 0x01 IMSI Mobile identity, 04.08: 10.5.1.4 |
|
||||
| 0x02 Cause GMM cause, 04.08: 10.5.5.14 |
|
||||
| 0x03 Auth tuple 4.2.5 |
|
||||
| 0x04 PDP info compl 4.2.8 |
|
||||
| 0x05 PDP info 4.2.3 |
|
||||
| 0x06 Cancel type 4.2.6 |
|
||||
| 0x07 Freeze P-TMSI 4.2.8 |
|
||||
| 0x08 MSISDN ISDN-AddressString/octet, 4.2.10 |
|
||||
| 0x09 HLR Number 4.2.12 |
|
||||
| 0x10 PDP context id big endian int |
|
||||
| 0x11 PDP type 4.2.4 |
|
||||
| 0x12 APN 04.08, 10.5.6.1 |
|
||||
| 0x13 QoS 4.2.11 |
|
||||
| 0x20 RAND octet string |
|
||||
| 0x21 SRES octet string |
|
||||
| 0x22 Kc octet string |
|
||||
+---------------------------------------------------------+
|
||||
|
||||
|
||||
4.2.8 Empty field
|
||||
|
||||
This is used for flags, if and only if this IE is present, the flag is set.
|
||||
The semantics depend on the IEI and the context.
|
||||
|
||||
8 7 6 5 4 3 2 1
|
||||
+-----------------------------------------------------+
|
||||
| | IEI | octet 1
|
||||
+-----------------------------------------------------+
|
||||
| Length of IE contents (0) | octet 2
|
||||
+-----------------------------------------------------+
|
||||
|
||||
4.2.9. IMSI
|
||||
|
||||
The IMSI is encoded like in octet 4-N of the Called Party BCD Number defined in GSM 04.08, 10.5.4.7.
|
||||
|
||||
8 7 6 5 4 3 2 1
|
||||
+-----------------------------------------------------+
|
||||
| | IMSI IEI | octet 1
|
||||
+-----------------------------------------------------+
|
||||
| Length of IMSI IE contents | octet 2
|
||||
+-----------------------------------------------------+
|
||||
| Number digit 2 | Number digit 1 | octet 3
|
||||
+-----------------------------------------------------+
|
||||
| Number digit 4 | Number digit 3 | octet 4
|
||||
+-----------------------------------------------------+
|
||||
: : :
|
||||
+-----------------------------------------------------+
|
||||
| see note 1) | octet 2+(N+1)div2
|
||||
+-----------------------------------------------------+
|
||||
|
||||
Note 1) Either '1 1 1 1 | Number digit N' (N odd) or
|
||||
'Number digit N | Number digit N-1' (N even),
|
||||
where N is the number of digits.
|
||||
|
||||
4.2.10. ISDN-AddressString / MSISDN / Called Party BCD Number
|
||||
|
||||
The MSISDN is encoded as an ISDN-AddressString in GSM 09.02 and Called Party
|
||||
BCD Number in GSM 04.08. It will be stored by the SGSN and then passed as is
|
||||
to the GGSN during the activation of the primary PDP Context.
|
||||
|
||||
8 7 6 5 4 3 2 1
|
||||
+-----------------------------------------------------+
|
||||
| | IEI | octet 1
|
||||
+-----------------------------------------------------+
|
||||
| Length of IE contents | octet 2
|
||||
+-----------------------------------------------------+
|
||||
| ext | Type of num | Numbering plan | octet 2
|
||||
+-----------------------------------------------------+
|
||||
| Number digit 2 | Number digit 1 | octet 3
|
||||
+-----------------------------------------------------+
|
||||
| Number digit 4 | Number digit 3 | octet 4
|
||||
+-----------------------------------------------------+
|
||||
: : :
|
||||
+-----------------------------------------------------+
|
||||
|
||||
|
||||
4.2.11 Quality of Service Subscribed Service
|
||||
|
||||
This encodes the subscribed QoS of a subscriber. It will be used by the
|
||||
SGSN during the PDP Context activation. If the length of the QoS data
|
||||
is 3 (three) octets it is assumed that these are octets 3-5 of the TS
|
||||
3GPP TS 24.008 Quality of Service Octets. If it is more than three then
|
||||
then it is assumed that the first octet is the Allocation/Retention
|
||||
Priority and the reset are encoded as octets 3-N of 24.008.
|
||||
|
||||
|
||||
8 7 6 5 4 3 2 1
|
||||
+-----------------------------------------------------+
|
||||
| | IEI | octet 1
|
||||
+-----------------------------------------------------+
|
||||
| Length of IE contents | octet 2
|
||||
+-----------------------------------------------------+
|
||||
: : :
|
||||
+-----------------------------------------------------+
|
||||
|
||||
4.2.12. HLR Number encoded as GSM 09.02 ISDN-AddressString
|
||||
|
||||
The HLR Number is encoded as an ISDN-AddressString in GSM 09.02. It
|
||||
will be stored by the SGSN can be used by the CDR module to keep a
|
||||
record.
|
||||
|
||||
8 7 6 5 4 3 2 1
|
||||
+-----------------------------------------------------+
|
||||
| | IEI | octet 1
|
||||
+-----------------------------------------------------+
|
||||
| Length of IE contents | octet 2
|
||||
+-----------------------------------------------------+
|
||||
| ext | Type of num | Numbering plan | octet 2
|
||||
+-----------------------------------------------------+
|
||||
| Number digit 2 | Number digit 1 | octet 3
|
||||
+-----------------------------------------------------+
|
||||
| Number digit 4 | Number digit 3 | octet 4
|
||||
+-----------------------------------------------------+
|
||||
: : :
|
||||
+-----------------------------------------------------+
|
||||
@@ -1,8 +1,3 @@
|
||||
SUBDIRS = \
|
||||
openbsc \
|
||||
$(NULL)
|
||||
SUBDIRS = openbsc
|
||||
|
||||
noinst_HEADERS = \
|
||||
mISDNif.h \
|
||||
compat_af_isdn.h \
|
||||
$(NULL)
|
||||
noinst_HEADERS = mISDNif.h compat_af_isdn.h
|
||||
|
||||
@@ -1,96 +1,26 @@
|
||||
noinst_HEADERS = \
|
||||
abis_nm.h \
|
||||
abis_om2000.h \
|
||||
abis_rsl.h \
|
||||
arfcn_range_encode.h \
|
||||
auth.h \
|
||||
bsc_msc.h \
|
||||
bsc_msg_filter.h \
|
||||
bsc_nat.h \
|
||||
bsc_nat_callstats.h \
|
||||
bsc_nat_sccp.h \
|
||||
bsc_rll.h \
|
||||
bss.h \
|
||||
bts_ipaccess_nanobts_omlattr.h \
|
||||
chan_alloc.h \
|
||||
common_bsc.h \
|
||||
common_cs.h \
|
||||
crc24.h \
|
||||
ctrl.h \
|
||||
db.h \
|
||||
debug.h \
|
||||
e1_config.h \
|
||||
gb_proxy.h \
|
||||
gprs_gb_parse.h \
|
||||
gprs_gmm.h \
|
||||
gprs_llc.h \
|
||||
gprs_llc_xid.h \
|
||||
gprs_sgsn.h \
|
||||
gprs_sndcp.h \
|
||||
gprs_sndcp_comp.h \
|
||||
gprs_sndcp_dcomp.h \
|
||||
gprs_sndcp_pcomp.h \
|
||||
gprs_sndcp_xid.h \
|
||||
gprs_utils.h \
|
||||
gsm_04_08.h \
|
||||
gsm_04_11.h \
|
||||
gsm_04_80.h \
|
||||
gsm_data.h \
|
||||
gsm_data_shared.h \
|
||||
gsm_subscriber.h \
|
||||
gsup_client.h \
|
||||
gtphub.h \
|
||||
handover.h \
|
||||
handover_decision.h \
|
||||
ipaccess.h \
|
||||
iu.h \
|
||||
meas_feed.h \
|
||||
meas_rep.h \
|
||||
mgcp.h \
|
||||
mgcp_internal.h \
|
||||
mgcp_transcode.h \
|
||||
misdn.h \
|
||||
mncc.h \
|
||||
mncc_int.h \
|
||||
nat_rewrite_trie.h \
|
||||
network_listen.h \
|
||||
oap_client.h \
|
||||
openbscdefines.h \
|
||||
osmo_bsc.h \
|
||||
osmo_bsc_grace.h \
|
||||
osmo_bsc_rf.h \
|
||||
osmo_msc.h \
|
||||
osmo_msc_data.h \
|
||||
osmux.h \
|
||||
paging.h \
|
||||
rest_octets.h \
|
||||
rrlp.h \
|
||||
rs232.h \
|
||||
rtp_proxy.h \
|
||||
sgsn.h \
|
||||
signal.h \
|
||||
silent_call.h \
|
||||
slhc.h \
|
||||
smpp.h \
|
||||
sms_queue.h \
|
||||
socket.h \
|
||||
system_information.h \
|
||||
token_auth.h \
|
||||
transaction.h \
|
||||
trau_mux.h \
|
||||
trau_upqueue.h \
|
||||
ussd.h \
|
||||
vty.h \
|
||||
v42bis.h \
|
||||
v42bis_private.h \
|
||||
$(NULL)
|
||||
noinst_HEADERS = abis_nm.h abis_rsl.h db.h gsm_04_08.h gsm_data.h \
|
||||
gsm_subscriber.h gsm_04_11.h debug.h signal.h \
|
||||
misdn.h chan_alloc.h paging.h ctrl.h \
|
||||
trau_mux.h rs232.h openbscdefines.h rtp_proxy.h \
|
||||
bsc_rll.h mncc.h transaction.h ussd.h gsm_04_80.h \
|
||||
silent_call.h mgcp.h meas_rep.h rest_octets.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 \
|
||||
crc24.h gprs_llc.h gprs_gmm.h \
|
||||
gb_proxy.h gprs_sgsn.h gsm_04_08_gprs.h sgsn.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 ipaccess.h mncc_int.h \
|
||||
arfcn_range_encode.h nat_rewrite_trie.h bsc_nat_callstats.h \
|
||||
osmux.h mgcp_transcode.h gprs_utils.h \
|
||||
gprs_gb_parse.h smpp.h meas_feed.h \
|
||||
gprs_gsup_client.h bsc_msg_filter.h \
|
||||
oap.h oap_messages.h \
|
||||
gtphub.h \
|
||||
msc_api.h msc_ifaces.h iu.h iu_cs.h \
|
||||
xsc.h
|
||||
|
||||
openbsc_HEADERS = \
|
||||
bsc_api.h \
|
||||
gsm_04_08.h \
|
||||
meas_rep.h \
|
||||
$(NULL)
|
||||
|
||||
openbscdir = \
|
||||
$(includedir)/openbsc \
|
||||
$(NULL)
|
||||
openbsc_HEADERS = gsm_04_08.h meas_rep.h bsc_api.h
|
||||
openbscdir = $(includedir)/openbsc
|
||||
|
||||
@@ -26,8 +26,6 @@
|
||||
#include <osmocom/gsm/abis_nm.h>
|
||||
#include <osmocom/gsm/protocol/gsm_12_21.h>
|
||||
|
||||
#include <openbsc/gsm_data.h>
|
||||
|
||||
struct cell_global_id {
|
||||
uint16_t mcc;
|
||||
uint16_t mnc;
|
||||
|
||||
@@ -41,6 +41,13 @@ enum om2k_mo_state {
|
||||
OM2K_MO_S_DISABLED,
|
||||
};
|
||||
|
||||
struct abis_om2k_mo {
|
||||
uint8_t class;
|
||||
uint8_t bts;
|
||||
uint8_t assoc_so;
|
||||
uint8_t inst;
|
||||
} __attribute__ ((packed));
|
||||
|
||||
/* on-wire format for IS conn group */
|
||||
struct om2k_is_conn_grp {
|
||||
uint16_t icp1;
|
||||
@@ -56,39 +63,6 @@ struct is_conn_group {
|
||||
uint8_t ci;
|
||||
};
|
||||
|
||||
/* on-wire format for CON Path */
|
||||
struct om2k_con_path {
|
||||
uint16_t ccp;
|
||||
uint8_t ci;
|
||||
uint8_t tag;
|
||||
uint8_t tei;
|
||||
} __attribute__ ((packed));
|
||||
|
||||
/* internal data format for CON group */
|
||||
struct con_group {
|
||||
/* links list of CON groups in BTS */
|
||||
struct llist_head list;
|
||||
struct gsm_bts *bts;
|
||||
/* CON Group ID */
|
||||
uint8_t cg;
|
||||
/* list of CON paths in this group */
|
||||
struct llist_head paths;
|
||||
};
|
||||
|
||||
/* internal data format for CON path */
|
||||
struct con_path {
|
||||
/* links with con_group.paths */
|
||||
struct llist_head list;
|
||||
/* CON Connection Point */
|
||||
uint16_t ccp;
|
||||
/* Contiguity Index */
|
||||
uint8_t ci;
|
||||
/* Tag */
|
||||
uint8_t tag;
|
||||
/* TEI */
|
||||
uint8_t tei;
|
||||
};
|
||||
|
||||
extern const struct abis_om2k_mo om2k_mo_cf;
|
||||
extern const struct abis_om2k_mo om2k_mo_is;
|
||||
extern const struct abis_om2k_mo om2k_mo_con;
|
||||
@@ -110,17 +84,12 @@ int abis_om2k_tx_disable_req(struct gsm_bts *bts, const struct abis_om2k_mo *mo)
|
||||
int abis_om2k_tx_test_req(struct gsm_bts *bts, const struct abis_om2k_mo *mo);
|
||||
int abis_om2k_tx_op_info(struct gsm_bts *bts, const struct abis_om2k_mo *mo,
|
||||
uint8_t operational);
|
||||
int abis_om2k_tx_cap_req(struct gsm_bts *bts, const struct abis_om2k_mo *mo);
|
||||
int abis_om2k_tx_is_conf_req(struct gsm_bts *bts);
|
||||
int abis_om2k_tx_tf_conf_req(struct gsm_bts *bts);
|
||||
int abis_om2k_tx_rx_conf_req(struct gsm_bts_trx *trx);
|
||||
int abis_om2k_tx_tx_conf_req(struct gsm_bts_trx *trx);
|
||||
int abis_om2k_tx_ts_conf_req(struct gsm_bts_trx_ts *ts);
|
||||
|
||||
struct osmo_fsm_inst *om2k_bts_fsm_start(struct gsm_bts *bts);
|
||||
void abis_om2k_bts_init(struct gsm_bts *bts);
|
||||
void abis_om2k_trx_init(struct gsm_bts_trx *trx);
|
||||
|
||||
int abis_om2k_vty_init(void);
|
||||
|
||||
struct vty;
|
||||
|
||||
@@ -23,7 +23,6 @@
|
||||
#define _RSL_H
|
||||
|
||||
#include <osmocom/gsm/protocol/gsm_08_58.h>
|
||||
#include <osmocom/gsm/gsm_utils.h>
|
||||
|
||||
#include <osmocom/core/msgb.h>
|
||||
|
||||
@@ -107,9 +106,5 @@ int rsl_start_t3109(struct gsm_lchan *lchan);
|
||||
|
||||
int rsl_direct_rf_release(struct gsm_lchan *lchan);
|
||||
|
||||
void dyn_ts_init(struct gsm_bts_trx_ts *ts);
|
||||
int dyn_ts_switchover_start(struct gsm_bts_trx_ts *ts,
|
||||
enum gsm_phys_chan_config to_pchan);
|
||||
|
||||
#endif /* RSL_MT_H */
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
enum gsm48_range {
|
||||
enum {
|
||||
ARFCN_RANGE_INVALID = -1,
|
||||
ARFCN_RANGE_128 = 127,
|
||||
ARFCN_RANGE_256 = 255,
|
||||
@@ -14,8 +14,8 @@ enum gsm48_range {
|
||||
#define RANGE_ENC_MAX_ARFCNS 29
|
||||
|
||||
int range_enc_determine_range(const int *arfcns, int size, int *f0_out);
|
||||
int range_enc_arfcns(enum gsm48_range rng, const int *arfcns, int sze, int *out, int idx);
|
||||
int range_enc_find_index(enum gsm48_range rng, const int *arfcns, int size);
|
||||
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(int *arfcns, const int sze, const int f0, int *f0_included);
|
||||
|
||||
int range_enc_range128(uint8_t *chan_list, int f0, int *w);
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
#define _AUTH_H
|
||||
|
||||
#include <osmocom/core/utils.h>
|
||||
#include <openbsc/gsm_data.h>
|
||||
|
||||
struct gsm_auth_tuple;
|
||||
struct gsm_subscriber;
|
||||
@@ -21,8 +20,7 @@ static inline const char *auth_action_str(enum auth_action a)
|
||||
return get_value_string(auth_action_names, a);
|
||||
}
|
||||
|
||||
int auth_get_tuple_for_subscr(enum gsm_auth_policy auth_policy,
|
||||
struct gsm_auth_tuple *atuple,
|
||||
int auth_get_tuple_for_subscr(struct gsm_auth_tuple *atuple,
|
||||
struct gsm_subscriber *subscr, int key_seq);
|
||||
|
||||
#endif /* _AUTH_H */
|
||||
|
||||
@@ -1,12 +1,13 @@
|
||||
#ifndef _BSS_H_
|
||||
#define _BSS_H_
|
||||
|
||||
#include <openbsc/gsm_data.h>
|
||||
#include <openbsc/xsc.h>
|
||||
|
||||
struct gsm_network;
|
||||
struct msgb;
|
||||
|
||||
/* start and stop network */
|
||||
extern int bsc_network_alloc(mncc_recv_cb_t mncc_recv);
|
||||
extern int bsc_network_init(mncc_recv_cb_t mncc_recv);
|
||||
extern int bsc_network_configure(const char *cfg_file);
|
||||
extern int bsc_shutdown_net(struct gsm_network *net);
|
||||
|
||||
|
||||
@@ -1,9 +0,0 @@
|
||||
#pragma once
|
||||
|
||||
#include <stdint.h>
|
||||
#include <openbsc/common_cs.h>
|
||||
|
||||
struct gsm_network *bsc_network_init(void *ctx,
|
||||
uint16_t country_code,
|
||||
uint16_t network_code,
|
||||
mncc_recv_cb_t mncc_recv);
|
||||
@@ -1,27 +0,0 @@
|
||||
#pragma once
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
struct msgb;
|
||||
struct gsm_network;
|
||||
|
||||
typedef int (*mncc_recv_cb_t)(struct gsm_network *, struct msgb *);
|
||||
|
||||
struct vty;
|
||||
|
||||
#define MAX_A5_KEY_LEN (128/8)
|
||||
|
||||
struct gsm_encr {
|
||||
uint8_t alg_id;
|
||||
uint8_t key_len;
|
||||
uint8_t key[MAX_A5_KEY_LEN];
|
||||
};
|
||||
|
||||
struct gsm_network *gsm_network_init(void *ctx,
|
||||
uint16_t country_code,
|
||||
uint16_t network_code,
|
||||
mncc_recv_cb_t mncc_recv);
|
||||
|
||||
int common_cs_vty_init(struct gsm_network *network,
|
||||
int (* config_write_net )(struct vty *));
|
||||
struct gsm_network *gsmnet_from_vty(struct vty *v);
|
||||
@@ -20,8 +20,6 @@
|
||||
#ifndef _DB_H
|
||||
#define _DB_H
|
||||
|
||||
#include <stdbool.h>
|
||||
|
||||
#include "gsm_subscriber.h"
|
||||
|
||||
struct gsm_equipment;
|
||||
@@ -37,15 +35,13 @@ int db_prepare(void);
|
||||
int db_fini(void);
|
||||
|
||||
/* subscriber management */
|
||||
struct gsm_subscriber *db_create_subscriber(const char *imsi, uint64_t smin,
|
||||
uint64_t smax, bool alloc_exten);
|
||||
struct gsm_subscriber *db_create_subscriber(const char *imsi);
|
||||
struct gsm_subscriber *db_get_subscriber(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, uint64_t smin,
|
||||
uint64_t smax);
|
||||
int db_subscriber_alloc_exten(struct gsm_subscriber *subscriber);
|
||||
int db_subscriber_alloc_token(struct gsm_subscriber *subscriber, uint32_t* token);
|
||||
int db_subscriber_assoc_imei(struct gsm_subscriber *subscriber, char *imei);
|
||||
int db_subscriber_delete(struct gsm_subscriber *subscriber);
|
||||
|
||||
@@ -29,17 +29,14 @@ enum {
|
||||
DBSSGP,
|
||||
DLLC,
|
||||
DSNDCP,
|
||||
DSLHC,
|
||||
DNAT,
|
||||
DCTRL,
|
||||
DSMPP,
|
||||
DFILTER,
|
||||
DGTPHUB,
|
||||
DRANAP,
|
||||
DSUA,
|
||||
DV42BIS,
|
||||
DSUP,
|
||||
DSS,
|
||||
DRANAP,
|
||||
DIUCS,
|
||||
Debug_LastEntry,
|
||||
};
|
||||
|
||||
|
||||
@@ -208,7 +208,7 @@ struct gbproxy_link_info *gbproxy_update_link_state_ul(
|
||||
struct gbproxy_link_info *gbproxy_update_link_state_dl(
|
||||
struct gbproxy_peer *peer, time_t now,
|
||||
struct gprs_gb_parse_context *parse_ctx);
|
||||
int gbproxy_update_link_state_after(
|
||||
void gbproxy_update_link_state_after(
|
||||
struct gbproxy_peer *peer, struct gbproxy_link_info *link_info,
|
||||
time_t now, struct gprs_gb_parse_context *parse_ctx);
|
||||
int gbproxy_remove_stale_link_infos(struct gbproxy_peer *peer, time_t now);
|
||||
|
||||
@@ -4,21 +4,17 @@
|
||||
#include <osmocom/core/msgb.h>
|
||||
#include <openbsc/gprs_sgsn.h>
|
||||
|
||||
#include <stdbool.h>
|
||||
|
||||
int gsm48_tx_gsm_deact_pdp_req(struct sgsn_pdp_ctx *pdp, uint8_t sm_cause);
|
||||
int gsm48_tx_gsm_act_pdp_rej(struct sgsn_mm_ctx *mm, uint8_t tid,
|
||||
uint8_t cause, uint8_t pco_len, uint8_t *pco_v);
|
||||
int gsm48_tx_gsm_act_pdp_acc(struct sgsn_pdp_ctx *pdp);
|
||||
int gsm48_tx_gsm_deact_pdp_acc(struct sgsn_pdp_ctx *pdp);
|
||||
|
||||
int gsm0408_gprs_rcvmsg_gb(struct msgb *msg, struct gprs_llc_llme *llme,
|
||||
bool drop_cipherable);
|
||||
int gsm0408_gprs_rcvmsg_gb(struct msgb *msg, struct gprs_llc_llme *llme);
|
||||
int gsm0408_gprs_rcvmsg_iu(struct msgb *msg, struct gprs_ra_id *ra_id,
|
||||
uint16_t *sai);
|
||||
int gsm0408_gprs_force_reattach(struct sgsn_mm_ctx *mmctx);
|
||||
int gsm0408_gprs_force_reattach_oldmsg(struct msgb *msg,
|
||||
struct gprs_llc_llme *llme);
|
||||
int gsm0408_gprs_force_reattach_oldmsg(struct msgb *msg);
|
||||
void gsm0408_gprs_access_granted(struct sgsn_mm_ctx *mmctx);
|
||||
void gsm0408_gprs_access_denied(struct sgsn_mm_ctx *mmctx, int gmm_cause);
|
||||
void gsm0408_gprs_access_cancelled(struct sgsn_mm_ctx *mmctx, int gmm_cause);
|
||||
@@ -30,6 +26,4 @@ int gprs_gmm_rx_resume(struct gprs_ra_id *raid, uint32_t tlli,
|
||||
|
||||
time_t gprs_max_time_to_idle(void);
|
||||
|
||||
int iu_rab_act_ps(uint8_t rab_id, struct sgsn_pdp_ctx *pdp, bool use_x213_nsap);
|
||||
|
||||
#endif /* _GPRS_GMM_H */
|
||||
|
||||
@@ -23,39 +23,37 @@
|
||||
|
||||
#include <osmocom/core/timer.h>
|
||||
|
||||
#include <openbsc/oap_client.h>
|
||||
#include <openbsc/oap.h>
|
||||
|
||||
#define GSUP_CLIENT_RECONNECT_INTERVAL 10
|
||||
#define GSUP_CLIENT_PING_INTERVAL 20
|
||||
#define GPRS_GSUP_RECONNECT_INTERVAL 10
|
||||
#define GPRS_GSUP_PING_INTERVAL 20
|
||||
|
||||
struct msgb;
|
||||
struct ipa_client_conn;
|
||||
struct gsup_client;
|
||||
struct gprs_gsup_client;
|
||||
|
||||
/* Expects message in msg->l2h */
|
||||
typedef int (*gsup_client_read_cb_t)(struct gsup_client *gsupc,
|
||||
struct msgb *msg);
|
||||
typedef int (*gprs_gsup_read_cb_t)(struct gprs_gsup_client *gsupc, struct msgb *msg);
|
||||
|
||||
struct gsup_client {
|
||||
struct ipa_client_conn *link;
|
||||
gsup_client_read_cb_t read_cb;
|
||||
void *data;
|
||||
struct gprs_gsup_client {
|
||||
struct ipa_client_conn *link;
|
||||
gprs_gsup_read_cb_t read_cb;
|
||||
void *data;
|
||||
|
||||
struct oap_client_state oap_state;
|
||||
struct oap_state oap_state;
|
||||
|
||||
struct osmo_timer_list ping_timer;
|
||||
struct osmo_timer_list connect_timer;
|
||||
int is_connected;
|
||||
int got_ipa_pong;
|
||||
struct gsm_network *net;
|
||||
struct osmo_timer_list ping_timer;
|
||||
struct osmo_timer_list connect_timer;
|
||||
int is_connected;
|
||||
int got_ipa_pong;
|
||||
};
|
||||
|
||||
struct gsup_client *gsup_client_create(const char *ip_addr,
|
||||
unsigned int tcp_port,
|
||||
gsup_client_read_cb_t read_cb,
|
||||
struct oap_client_config *oap_config);
|
||||
struct gprs_gsup_client *gprs_gsup_client_create(const char *ip_addr,
|
||||
unsigned int tcp_port,
|
||||
gprs_gsup_read_cb_t read_cb,
|
||||
struct oap_config *oap_config);
|
||||
|
||||
void gsup_client_destroy(struct gsup_client *gsupc);
|
||||
int gsup_client_send(struct gsup_client *gsupc, struct msgb *msg);
|
||||
struct msgb *gsup_client_msgb_alloc(void);
|
||||
void gprs_gsup_client_destroy(struct gprs_gsup_client *gsupc);
|
||||
int gprs_gsup_client_send(struct gprs_gsup_client *gsupc, struct msgb *msg);
|
||||
struct msgb *gprs_gsup_msgb_alloc(void);
|
||||
|
||||
@@ -2,9 +2,7 @@
|
||||
#define _GPRS_LLC_H
|
||||
|
||||
#include <stdint.h>
|
||||
#include <stdbool.h>
|
||||
#include <openbsc/gprs_sgsn.h>
|
||||
#include <openbsc/gprs_llc_xid.h>
|
||||
|
||||
/* Section 4.7 LLC Layer Structure */
|
||||
enum gprs_llc_sapi {
|
||||
@@ -46,8 +44,6 @@ enum gprs_llc_xid_type {
|
||||
GPRS_LLC_XID_T_RESET = 12,
|
||||
};
|
||||
|
||||
extern const struct value_string gprs_llc_xid_type_names[];
|
||||
|
||||
/* TS 04.64 Section 7.1.2 Table 7: LLC layer primitives (GMM/SNDCP/SMS/TOM) */
|
||||
/* TS 04.65 Section 5.1.2 Table 2: Service primitives used by SNDCP */
|
||||
enum gprs_llc_primitive {
|
||||
@@ -159,32 +155,13 @@ struct gprs_llc_llme {
|
||||
|
||||
/* Crypto parameters */
|
||||
enum gprs_ciph_algo algo;
|
||||
uint8_t kc[16];
|
||||
uint8_t cksn;
|
||||
/* 3GPP TS 44.064 § 8.9.2: */
|
||||
uint32_t iov_ui;
|
||||
uint8_t kc[8];
|
||||
|
||||
/* over which BSSGP BTS ctx do we need to transmit */
|
||||
uint16_t bvci;
|
||||
uint16_t nsei;
|
||||
struct gprs_llc_lle lle[NUM_SAPIS];
|
||||
|
||||
/* Copy of the XID fields we have sent with the last
|
||||
* network originated XID-Request. Since the phone
|
||||
* may strip the optional fields in the confirmation
|
||||
* we need to remeber those fields in order to be
|
||||
* able to create the compression entity. */
|
||||
struct llist_head *xid;
|
||||
|
||||
/* Compression entities */
|
||||
struct {
|
||||
/* In these two list_heads we will store the
|
||||
* data and protocol compression entities,
|
||||
* together with their compression states */
|
||||
struct llist_head *proto;
|
||||
struct llist_head *data;
|
||||
} comp;
|
||||
|
||||
/* Internal management */
|
||||
uint32_t age_timestamp;
|
||||
};
|
||||
@@ -231,21 +208,16 @@ int gprs_llc_rcvmsg(struct msgb *msg, struct tlv_parsed *tv);
|
||||
|
||||
/* LL-UNITDATA.req */
|
||||
int gprs_llc_tx_ui(struct msgb *msg, uint8_t sapi, int command,
|
||||
struct sgsn_mm_ctx *mmctx, bool encryptable);
|
||||
void *mmctx);
|
||||
|
||||
/* Chapter 7.2.1.2 LLGMM-RESET.req */
|
||||
int gprs_llgmm_reset(struct gprs_llc_llme *llme);
|
||||
int gprs_llgmm_reset_oldmsg(struct msgb* oldmsg, uint8_t sapi,
|
||||
struct gprs_llc_llme *llme);
|
||||
|
||||
/* Set of LL-XID negotiation (See also: TS 101 351, Section 7.2.2.4) */
|
||||
int gprs_ll_xid_req(struct gprs_llc_lle *lle,
|
||||
struct gprs_llc_xid_field *l3_xid_field);
|
||||
int gprs_llgmm_reset_oldmsg(struct msgb* oldmsg, uint8_t sapi);
|
||||
|
||||
/* 04.64 Chapter 7.2.1.1 LLGMM-ASSIGN */
|
||||
int gprs_llgmm_assign(struct gprs_llc_llme *llme,
|
||||
uint32_t old_tlli, uint32_t new_tlli);
|
||||
int gprs_llgmm_unassign(struct gprs_llc_llme *llme);
|
||||
uint32_t old_tlli, uint32_t new_tlli,
|
||||
enum gprs_ciph_algo alg, const uint8_t *kc);
|
||||
|
||||
int gprs_llc_init(const char *cipher_plugin_path);
|
||||
int gprs_llc_vty_init(void);
|
||||
@@ -267,12 +239,11 @@ static inline int gprs_llc_is_retransmit(uint16_t nu, uint16_t vur)
|
||||
}
|
||||
|
||||
/* LLC low level functions */
|
||||
void gprs_llme_copy_key(struct sgsn_mm_ctx *mm, struct gprs_llc_llme *llme);
|
||||
|
||||
/* parse a GPRS LLC header, also check for invalid frames */
|
||||
int gprs_llc_hdr_parse(struct gprs_llc_hdr_parsed *ghp,
|
||||
uint8_t *llc_hdr, int len);
|
||||
void gprs_llc_hdr_dump(struct gprs_llc_hdr_parsed *gph, struct gprs_llc_lle *lle);
|
||||
void gprs_llc_hdr_dump(struct gprs_llc_hdr_parsed *gph);
|
||||
int gprs_llc_fcs(uint8_t *data, unsigned int len);
|
||||
|
||||
|
||||
|
||||
@@ -1,57 +0,0 @@
|
||||
/* GPRS LLC XID field encoding/decoding as per 3GPP TS 44.064 */
|
||||
|
||||
/* (C) 2016 by sysmocom s.f.m.c. GmbH <info@sysmocom.de>
|
||||
* All Rights Reserved
|
||||
*
|
||||
* Author: Philipp Maier
|
||||
*
|
||||
* 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/>.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <stdint.h>
|
||||
#include <osmocom/core/linuxlist.h>
|
||||
|
||||
/* 3GPP TS 44.064 6.4.1.6 Exchange Identification (XID)
|
||||
command/response parameter field */
|
||||
struct gprs_llc_xid_field {
|
||||
struct llist_head list;
|
||||
uint8_t type; /* See also Table 6: LLC layer parameter
|
||||
negotiation */
|
||||
uint8_t *data; /* Payload data (memory is owned by the
|
||||
* creator of the struct) */
|
||||
unsigned int data_len; /* Payload length */
|
||||
};
|
||||
|
||||
/* Transform a list with XID fields into a XID message (dst) */
|
||||
int gprs_llc_compile_xid(uint8_t *dst, int dst_maxlen,
|
||||
const struct llist_head *xid_fields);
|
||||
|
||||
/* Transform a XID message (dst) into a list of XID fields */
|
||||
struct llist_head *gprs_llc_parse_xid(const void *ctx, const uint8_t *src,
|
||||
int src_len);
|
||||
|
||||
/* Create a duplicate of an XID-Field */
|
||||
struct gprs_llc_xid_field *gprs_llc_dup_xid_field(const void *ctx,
|
||||
const struct gprs_llc_xid_field *xid_field);
|
||||
|
||||
/* Copy an llist with xid fields */
|
||||
struct llist_head *gprs_llc_copy_xid(const void *ctx,
|
||||
const struct llist_head *xid_fields);
|
||||
|
||||
/* Dump a list with XID fields (Debug) */
|
||||
void gprs_llc_dump_xid_fields(const struct llist_head *xid_fields,
|
||||
unsigned int logl);
|
||||
|
||||
@@ -36,9 +36,9 @@ enum gprs_pmm_state {
|
||||
PMM_DETACHED,
|
||||
PMM_CONNECTED,
|
||||
PMM_IDLE,
|
||||
MM_IDLE,
|
||||
MM_READY,
|
||||
MM_STANDBY,
|
||||
MM_IDLE = PMM_DETACHED,
|
||||
MM_READY = PMM_CONNECTED,
|
||||
MM_STANDBY = PMM_IDLE,
|
||||
};
|
||||
|
||||
enum gprs_mm_ctr {
|
||||
@@ -126,8 +126,8 @@ struct sgsn_mm_ctx {
|
||||
enum sgsn_ran_type ran_type;
|
||||
|
||||
char imsi[GSM23003_IMSI_MAX_DIGITS+1];
|
||||
enum gprs_gmm_state gmm_state;
|
||||
enum gprs_pmm_state pmm_state; /* Iu: page when in PMM-IDLE mode */
|
||||
enum gprs_gmm_state mm_state;
|
||||
enum gprs_pmm_state pmm_state;
|
||||
uint32_t p_tmsi;
|
||||
uint32_t p_tmsi_old; /* old P-TMSI before new is confirmed */
|
||||
uint32_t p_tmsi_sig;
|
||||
@@ -169,8 +169,6 @@ struct sgsn_mm_ctx {
|
||||
/* Iu: CK, IK, KSI */
|
||||
/* CKSN */
|
||||
enum gprs_ciph_algo ciph_algo;
|
||||
/* Auth & Ciphering Request reference from 3GPP TS 24.008 § 10.5.5.19: */
|
||||
uint8_t ac_ref_nr_used;
|
||||
|
||||
struct {
|
||||
uint8_t len;
|
||||
@@ -244,7 +242,7 @@ struct sgsn_mm_ctx *sgsn_mm_ctx_by_tlli_and_ptmsi(uint32_t tlli,
|
||||
const struct gprs_ra_id *raid);
|
||||
|
||||
/* Allocate a new SGSN MM context */
|
||||
struct sgsn_mm_ctx *sgsn_mm_ctx_alloc_gb(uint32_t tlli,
|
||||
struct sgsn_mm_ctx *sgsn_mm_ctx_alloc(uint32_t tlli,
|
||||
const struct gprs_ra_id *raid);
|
||||
struct sgsn_mm_ctx *sgsn_mm_ctx_alloc_iu(void *uectx);
|
||||
|
||||
@@ -295,7 +293,12 @@ struct sgsn_pdp_ctx {
|
||||
//uint32_t qos_profile_req;
|
||||
//uint32_t qos_profile_neg;
|
||||
uint8_t radio_prio;
|
||||
uint32_t tx_npdu_nr;
|
||||
uint32_t rx_npdu_nr;
|
||||
uint32_t tx_gtp_snd;
|
||||
uint32_t rx_gtp_snu;
|
||||
//uint32_t charging_id;
|
||||
int reordering_reqd;
|
||||
|
||||
struct osmo_timer_list timer;
|
||||
unsigned int T; /* Txxxx number */
|
||||
@@ -366,6 +369,9 @@ int drop_all_pdp_for_ggsn(struct sgsn_ggsn_ctx *ggsn);
|
||||
|
||||
char *gprs_pdpaddr2str(uint8_t *pdpa, uint8_t len);
|
||||
|
||||
/* Force re-attachment based on msgb meta data */
|
||||
int sgsn_force_reattach_oldmsg(struct msgb *oldmsg);
|
||||
|
||||
/*
|
||||
* ctrl interface related work
|
||||
*/
|
||||
@@ -462,6 +468,4 @@ int gprs_sndcp_vty_init(void);
|
||||
struct sgsn_instance;
|
||||
int sgsn_gtp_init(struct sgsn_instance *sgi);
|
||||
|
||||
void sgsn_rate_ctr_init();
|
||||
|
||||
#endif /* _GPRS_SGSN_H */
|
||||
|
||||
@@ -1,82 +0,0 @@
|
||||
/* GPRS SNDCP header compression entity management tools */
|
||||
|
||||
/* (C) 2016 by sysmocom s.f.m.c. GmbH <info@sysmocom.de>
|
||||
* All Rights Reserved
|
||||
*
|
||||
* Author: Philipp Maier
|
||||
*
|
||||
* 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/>.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <stdint.h>
|
||||
#include <osmocom/core/linuxlist.h>
|
||||
#include <openbsc/gprs_sndcp_xid.h>
|
||||
|
||||
/* Header / Data compression entity */
|
||||
struct gprs_sndcp_comp {
|
||||
struct llist_head list;
|
||||
|
||||
/* Serves as an ID in case we want to delete this entity later */
|
||||
unsigned int entity; /* see also: 6.5.1.1.3 and 6.6.1.1.3 */
|
||||
|
||||
/* Specifies to which NSAPIs the compression entity is assigned */
|
||||
uint8_t nsapi_len; /* Number of applicable NSAPIs (default 0) */
|
||||
uint8_t nsapi[MAX_NSAPI]; /* Applicable NSAPIs (default 0) */
|
||||
|
||||
/* Assigned pcomp values */
|
||||
uint8_t comp_len; /* Number of contained PCOMP / DCOMP values */
|
||||
uint8_t comp[MAX_COMP]; /* see also: 6.5.1.1.5 and 6.6.1.1.5 */
|
||||
|
||||
/* Algorithm parameters */
|
||||
int algo; /* Algorithm type (see gprs_sndcp_xid.h) */
|
||||
int compclass; /* See gprs_sndcp_xid.h/c */
|
||||
void *state; /* Algorithm status and parameters */
|
||||
};
|
||||
|
||||
#define MAX_COMP 16 /* Maximum number of possible pcomp/dcomp values */
|
||||
#define MAX_NSAPI 11 /* Maximum number usable NSAPIs */
|
||||
|
||||
/* Allocate a compression enitiy list */
|
||||
struct llist_head *gprs_sndcp_comp_alloc(const void *ctx);
|
||||
|
||||
/* Free a compression entitiy list */
|
||||
void gprs_sndcp_comp_free(struct llist_head *comp_entities);
|
||||
|
||||
/* Delete a compression entity */
|
||||
void gprs_sndcp_comp_delete(struct llist_head *comp_entities, unsigned int entity);
|
||||
|
||||
/* Create and Add a new compression entity
|
||||
* (returns a pointer to the compression entity that has just been created) */
|
||||
struct gprs_sndcp_comp *gprs_sndcp_comp_add(const void *ctx,
|
||||
struct llist_head *comp_entities,
|
||||
const struct gprs_sndcp_comp_field
|
||||
*comp_field);
|
||||
|
||||
/* Find which compression entity handles the specified pcomp/dcomp */
|
||||
struct gprs_sndcp_comp *gprs_sndcp_comp_by_comp(const struct llist_head
|
||||
*comp_entities, uint8_t comp);
|
||||
|
||||
/* Find which compression entity handles the specified nsapi */
|
||||
struct gprs_sndcp_comp *gprs_sndcp_comp_by_nsapi(const struct llist_head
|
||||
*comp_entities, uint8_t nsapi);
|
||||
|
||||
/* Find a comp_index for a given pcomp/dcomp value */
|
||||
uint8_t gprs_sndcp_comp_get_idx(const struct gprs_sndcp_comp *comp_entity,
|
||||
uint8_t comp);
|
||||
|
||||
/* Find a pcomp/dcomp value for a given comp_index */
|
||||
uint8_t gprs_sndcp_comp_get_comp(const struct gprs_sndcp_comp *comp_entity,
|
||||
uint8_t comp_index);
|
||||
@@ -1,53 +0,0 @@
|
||||
/* GPRS SNDCP data compression handler */
|
||||
|
||||
/* (C) 2016 by sysmocom s.f.m.c. GmbH <info@sysmocom.de>
|
||||
* All Rights Reserved
|
||||
*
|
||||
* Author: Philipp Maier
|
||||
*
|
||||
* 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/>.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <stdint.h>
|
||||
#include <osmocom/core/linuxlist.h>
|
||||
#include <openbsc/gprs_sndcp_comp.h>
|
||||
|
||||
/* Note: The decompressed packet may have a maximum size of:
|
||||
* Return value * MAX_DATADECOMPR_FAC */
|
||||
#define MAX_DATADECOMPR_FAC 10
|
||||
|
||||
/* Note: In unacknowledged mode (SN_UNITDATA), the comression state is reset
|
||||
* for every NPDU. The compressor needs a reasonably large payload to operate
|
||||
* effectively (yield positive compression gain). For packets shorter than 100
|
||||
* byte, no positive compression gain can be expected so we will skip the
|
||||
* compression for short packets. */
|
||||
#define MIN_COMPR_PAYLOAD 100
|
||||
|
||||
/* Initalize data compression */
|
||||
int gprs_sndcp_dcomp_init(const void *ctx, struct gprs_sndcp_comp *comp_entity,
|
||||
const struct gprs_sndcp_comp_field *comp_field);
|
||||
|
||||
/* Terminate data compression */
|
||||
void gprs_sndcp_dcomp_term(struct gprs_sndcp_comp *comp_entity);
|
||||
|
||||
/* Expand packet */
|
||||
int gprs_sndcp_dcomp_expand(uint8_t *data, unsigned int len, uint8_t pcomp,
|
||||
const struct llist_head *comp_entities);
|
||||
|
||||
/* Compress packet */
|
||||
int gprs_sndcp_dcomp_compress(uint8_t *data, unsigned int len, uint8_t *pcomp,
|
||||
const struct llist_head *comp_entities,
|
||||
uint8_t nsapi);
|
||||
@@ -1,46 +0,0 @@
|
||||
/* GPRS SNDCP header compression handler */
|
||||
|
||||
/* (C) 2016 by sysmocom s.f.m.c. GmbH <info@sysmocom.de>
|
||||
* All Rights Reserved
|
||||
*
|
||||
* Author: Philipp Maier
|
||||
*
|
||||
* 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/>.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <stdint.h>
|
||||
#include <osmocom/core/linuxlist.h>
|
||||
#include <openbsc/gprs_sndcp_comp.h>
|
||||
|
||||
/* Note: The decompressed packet may have a maximum size of:
|
||||
* Return value + MAX_DECOMPR_INCR */
|
||||
#define MAX_HDRDECOMPR_INCR 64
|
||||
|
||||
/* Initalize header compression */
|
||||
int gprs_sndcp_pcomp_init(const void *ctx, struct gprs_sndcp_comp *comp_entity,
|
||||
const struct gprs_sndcp_comp_field *comp_field);
|
||||
|
||||
/* Terminate header compression */
|
||||
void gprs_sndcp_pcomp_term(struct gprs_sndcp_comp *comp_entity);
|
||||
|
||||
/* Expand packet header */
|
||||
int gprs_sndcp_pcomp_expand(uint8_t *data, unsigned int len, uint8_t pcomp,
|
||||
const struct llist_head *comp_entities);
|
||||
|
||||
/* Compress packet header */
|
||||
int gprs_sndcp_pcomp_compress(uint8_t *data, unsigned int len, uint8_t *pcomp,
|
||||
const struct llist_head *comp_entities,
|
||||
uint8_t nsapi);
|
||||
@@ -1,218 +0,0 @@
|
||||
/* GPRS SNDCP XID field encoding/decoding as per 3GPP TS 44.065 */
|
||||
|
||||
/* (C) 2016 by sysmocom s.f.m.c. GmbH <info@sysmocom.de>
|
||||
* All Rights Reserved
|
||||
*
|
||||
* Author: Philipp Maier
|
||||
*
|
||||
* 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/>.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <stdint.h>
|
||||
#include <osmocom/core/linuxlist.h>
|
||||
|
||||
#define DEFAULT_SNDCP_VERSION 0 /* See 3GPP TS 44.065, clause 8 */
|
||||
#define MAX_ENTITIES 32 /* 3GPP TS 44.065 reserves 5 bit
|
||||
* for compression enitity number */
|
||||
|
||||
#define MAX_COMP 16 /* Maximum number of possible pcomp/dcomp values */
|
||||
#define MAX_NSAPI 11 /* Maximum number usable NSAPIs */
|
||||
#define MAX_ROHC 16 /* Maximum number of ROHC compression profiles */
|
||||
|
||||
/* According to: 3GPP TS 44.065, 6.5.1.1 Format of the protocol control
|
||||
* information compression field (Figure 7) and 3GPP TS 44.065,
|
||||
* 6.6.1.1 Format of the data compression field (Figure 9) */
|
||||
struct gprs_sndcp_comp_field {
|
||||
struct llist_head list;
|
||||
|
||||
/* Propose bit (P), see also: 6.5.1.1.2 and 6.6.1.1.2 */
|
||||
unsigned int p;
|
||||
|
||||
/* Entity number, see also: 6.5.1.1.3 and 6.6.1.1.3 */
|
||||
unsigned int entity;
|
||||
|
||||
/* Algorithm identifier, see also: 6.5.1.1.4 and 6.6.1.1.4 */
|
||||
int algo;
|
||||
|
||||
/* Number of contained PCOMP / DCOMP values */
|
||||
uint8_t comp_len;
|
||||
|
||||
/* PCOMP / DCOMP values, see also: 6.5.1.1.5 and 6.6.1.1.5 */
|
||||
uint8_t comp[MAX_COMP];
|
||||
|
||||
/* Note: Only one of the following struct pointers may,
|
||||
be used. Unused pointers must be set to NULL! */
|
||||
struct gprs_sndcp_pcomp_rfc1144_params *rfc1144_params;
|
||||
struct gprs_sndcp_pcomp_rfc2507_params *rfc2507_params;
|
||||
struct gprs_sndcp_pcomp_rohc_params *rohc_params;
|
||||
struct gprs_sndcp_dcomp_v42bis_params *v42bis_params;
|
||||
struct gprs_sndcp_dcomp_v44_params *v44_params;
|
||||
};
|
||||
|
||||
/* According to: 3GPP TS 44.065, 6.5.1.1.4 Algorithm identifier */
|
||||
enum gprs_sndcp_hdr_comp_algo {
|
||||
RFC_1144, /* TCP/IP header compression, see also 6.5.2 */
|
||||
RFC_2507, /* TCP/UDP/IP header compression, see also: 6.5.3 */
|
||||
ROHC /* Robust Header Compression, see also 6.5.4 */
|
||||
};
|
||||
|
||||
/* According to: 3GPP TS 44.065, 6.5.1.1.4 Algorithm identifier */
|
||||
enum gprs_sndcp_data_comp_algo {
|
||||
V42BIS, /* V.42bis data compression, see also 6.6.2 */
|
||||
V44 /* V44 data compression, see also: 6.6.3 */
|
||||
};
|
||||
|
||||
/* According to: 3GPP TS 44.065, 8 SNDCP XID parameters */
|
||||
enum gprs_sndcp_xid_param_types {
|
||||
SNDCP_XID_VERSION_NUMBER,
|
||||
SNDCP_XID_DATA_COMPRESSION, /* See also: subclause 6.6.1 */
|
||||
SNDCP_XID_PROTOCOL_COMPRESSION, /* See also: subclause 6.5.1 */
|
||||
};
|
||||
|
||||
/* According to: 3GPP TS 44.065, 6.5.2.1 Parameters (Table 5) */
|
||||
struct gprs_sndcp_pcomp_rfc1144_params {
|
||||
uint8_t nsapi_len; /* Number of applicable NSAPIs
|
||||
* (default 0) */
|
||||
uint8_t nsapi[MAX_NSAPI]; /* Applicable NSAPIs (default 0) */
|
||||
int s01; /* (default 15) */
|
||||
};
|
||||
|
||||
/* According to: 3GPP TS 44.065, 6.5.2.2 Assignment of PCOMP values */
|
||||
enum gprs_sndcp_pcomp_rfc1144_pcomp {
|
||||
RFC1144_PCOMP1, /* Uncompressed TCP */
|
||||
RFC1144_PCOMP2, /* Compressed TCP */
|
||||
RFC1144_PCOMP_NUM /* Number of pcomp values */
|
||||
};
|
||||
|
||||
/* According to: 3GPP TS 44.065, 6.5.3.1 Parameters (Table 6) */
|
||||
struct gprs_sndcp_pcomp_rfc2507_params {
|
||||
uint8_t nsapi_len; /* Number of applicable NSAPIs
|
||||
* (default 0) */
|
||||
uint8_t nsapi[MAX_NSAPI]; /* Applicable NSAPIs (default 0) */
|
||||
int f_max_period; /* (default 256) */
|
||||
int f_max_time; /* (default 5) */
|
||||
int max_header; /* (default 168) */
|
||||
int tcp_space; /* (default 15) */
|
||||
int non_tcp_space; /* (default 15) */
|
||||
};
|
||||
|
||||
/* According to: 3GPP TS 44.065, 6.5.3.2 Assignment of PCOMP values for RFC2507 */
|
||||
enum gprs_sndcp_pcomp_rfc2507_pcomp {
|
||||
RFC2507_PCOMP1, /* Full Header */
|
||||
RFC2507_PCOMP2, /* Compressed TCP */
|
||||
RFC2507_PCOMP3, /* Compressed TCP non delta */
|
||||
RFC2507_PCOMP4, /* Compressed non TCP */
|
||||
RFC2507_PCOMP5, /* Context state */
|
||||
RFC2507_PCOMP_NUM /* Number of pcomp values */
|
||||
};
|
||||
|
||||
/* According to: 3GPP TS 44.065, 6.5.4.1 Parameter (Table 10) */
|
||||
struct gprs_sndcp_pcomp_rohc_params {
|
||||
uint8_t nsapi_len; /* Number of applicable NSAPIs
|
||||
* (default 0) */
|
||||
uint8_t nsapi[MAX_NSAPI]; /* Applicable NSAPIs (default 0) */
|
||||
int max_cid; /* (default 15) */
|
||||
int max_header; /* (default 168) */
|
||||
uint8_t profile_len; /* (default 1) */
|
||||
uint16_t profile[MAX_ROHC]; /* (default 0, ROHC uncompressed) */
|
||||
};
|
||||
|
||||
/* According to: 3GPP TS 44.065, 6.5.4.2 Assignment of PCOMP values for ROHC */
|
||||
enum gprs_sndcp_pcomp_rohc_pcomp {
|
||||
ROHC_PCOMP1, /* ROHC small CIDs */
|
||||
ROHC_PCOMP2, /* ROHC large CIDs */
|
||||
ROHC_PCOMP_NUM /* Number of pcomp values */
|
||||
};
|
||||
|
||||
/* ROHC compression profiles, see also:
|
||||
http://www.iana.org/assignments/rohc-pro-ids/rohc-pro-ids.xhtml */
|
||||
enum gprs_sndcp_xid_rohc_profiles {
|
||||
ROHC_UNCOMPRESSED = 0x0000, /* ROHC uncompressed [RFC5795] */
|
||||
ROHC_RTP = 0x0001, /* ROHC RTP [RFC3095] */
|
||||
ROHCV2_RTP = 0x0101, /* ROHCv2 RTP [RFC5225] */
|
||||
ROHC_UDP = 0x0002, /* ROHC UDP [RFC3095] */
|
||||
ROHCv2_UDP = 0x0102, /* ROHCv2 UDP [RFC5225] */
|
||||
ROHC_ESP = 0x0003, /* ROHC ESP [RFC3095] */
|
||||
ROHCV2_ESP = 0x0103, /* ROHCv2 ESP [RFC5225] */
|
||||
ROHC_IP = 0x0004, /* ROHC IP [RFC3843] */
|
||||
ROHCV2_IP = 0x0104, /* ROHCv2 IP [RFC5225] */
|
||||
ROHC_LLA = 0x0005, /* ROHC LLA [RFC4362] */
|
||||
ROHC_LLA_WITH_R_MODE = 0x0105, /* ROHC LLA with R-mode [RFC3408] */
|
||||
ROHC_TCP = 0x0006, /* ROHC TCP [RFC6846] */
|
||||
ROHC_RTP_UDP_LITE = 0x0007, /* ROHC RTP/UDP-Lite [RFC4019] */
|
||||
ROHCV2_RTP_UDP_LITE = 0x0107, /* ROHCv2 RTP/UDP-Lite [RFC5225] */
|
||||
ROHC_UDP_LITE = 0x0008, /* ROHC UDP-Lite [RFC4019] */
|
||||
ROHCV2_UDP_LITE = 0x0108, /* ROHCv2 UDP-Lite [RFC5225] */
|
||||
};
|
||||
|
||||
/* According to: 3GPP TS 44.065, 6.6.2.1 Parameters (Table 7a) */
|
||||
struct gprs_sndcp_dcomp_v42bis_params {
|
||||
uint8_t nsapi_len; /* Number of applicable NSAPIs
|
||||
* (default 0) */
|
||||
uint8_t nsapi[MAX_NSAPI]; /* Applicable NSAPIs (default 0) */
|
||||
int p0; /* (default 3) */
|
||||
int p1; /* (default 2048) */
|
||||
int p2; /* (default 20) */
|
||||
|
||||
};
|
||||
|
||||
/* According to: 3GPP TS 44.065, 6.6.2.2 Assignment of DCOMP values */
|
||||
enum gprs_sndcp_dcomp_v42bis_dcomp {
|
||||
V42BIS_DCOMP1, /* V.42bis enabled */
|
||||
V42BIS_DCOMP_NUM /* Number of dcomp values */
|
||||
};
|
||||
|
||||
/* According to: 3GPP TS 44.065, 6.6.3.1 Parameters (Table 7c) */
|
||||
struct gprs_sndcp_dcomp_v44_params {
|
||||
uint8_t nsapi_len; /* Number of applicable NSAPIs
|
||||
* (default 0) */
|
||||
uint8_t nsapi[MAX_NSAPI]; /* Applicable NSAPIs (default 0) */
|
||||
int c0; /* (default 10000000) */
|
||||
int p0; /* (default 3) */
|
||||
int p1t; /* Refer to subclause 6.6.3.1.4 */
|
||||
int p1r; /* Refer to subclause 6.6.3.1.5 */
|
||||
int p3t; /* (default 3 x p1t) */
|
||||
int p3r; /* (default 3 x p1r) */
|
||||
};
|
||||
|
||||
/* According to: 3GPP TS 44.065, 6.6.3.2 Assignment of DCOMP values */
|
||||
enum gprs_sndcp_dcomp_v44_dcomp {
|
||||
V44_DCOMP1, /* Packet method compressed */
|
||||
V44_DCOMP2, /* Multi packet method compressed */
|
||||
V44_DCOMP_NUM /* Number of dcomp values */
|
||||
};
|
||||
|
||||
/* Transform a list with compression fields into an SNDCP-XID message (dst) */
|
||||
int gprs_sndcp_compile_xid(uint8_t *dst, unsigned int dst_maxlen,
|
||||
const struct llist_head *comp_fields, int version);
|
||||
|
||||
/* Transform an SNDCP-XID message (src) into a list of SNDCP-XID fields */
|
||||
struct llist_head *gprs_sndcp_parse_xid(int *version,
|
||||
const void *ctx,
|
||||
const uint8_t *src,
|
||||
unsigned int src_len,
|
||||
const struct llist_head
|
||||
*comp_fields_req);
|
||||
|
||||
/* Find out to which compression class the specified comp-field belongs
|
||||
* (header compression or data compression?) */
|
||||
int gprs_sndcp_get_compression_class(
|
||||
const struct gprs_sndcp_comp_field *comp_field);
|
||||
|
||||
/* Dump a list with SNDCP-XID fields (Debug) */
|
||||
void gprs_sndcp_dump_comp_fields(const struct llist_head *comp_fields,
|
||||
unsigned int logl);
|
||||
|
||||
@@ -53,8 +53,7 @@ int get_reason_by_chreq(uint8_t ra, int neci);
|
||||
void gsm_net_update_ctype(struct gsm_network *net);
|
||||
|
||||
int gsm48_tx_mm_info(struct gsm_subscriber_connection *conn);
|
||||
int gsm48_tx_mm_auth_req(struct gsm_subscriber_connection *conn, uint8_t *rand,
|
||||
uint8_t *autn, int key_seq);
|
||||
int gsm48_tx_mm_auth_req(struct gsm_subscriber_connection *conn, uint8_t *rand, int key_seq);
|
||||
int gsm48_tx_mm_auth_rej(struct gsm_subscriber_connection *conn);
|
||||
int gsm48_tx_mm_serv_ack(struct gsm_subscriber_connection *conn);
|
||||
int gsm48_tx_mm_serv_rej(struct gsm_subscriber_connection *conn,
|
||||
@@ -78,6 +77,8 @@ int decode_bcd_number(char *output, int output_len, const uint8_t *bcd_lv,
|
||||
int send_siemens_mrpci(struct gsm_lchan *lchan, uint8_t *classmark2_lv);
|
||||
int gsm48_extract_mi(uint8_t *classmark2, int length, char *mi_string, uint8_t *mi_type);
|
||||
int gsm48_paging_extract_mi(struct gsm48_pag_resp *pag, int length, char *mi_string, uint8_t *mi_type);
|
||||
|
||||
/* TODO MSCSPLIT remove gsm48_handle_paging_resp() */
|
||||
int gsm48_handle_paging_resp(struct gsm_subscriber_connection *conn, struct msgb *msg, struct gsm_subscriber *subscr);
|
||||
|
||||
int gsm48_lchan_modify(struct gsm_lchan *lchan, uint8_t lchan_mode);
|
||||
@@ -94,8 +95,4 @@ void allocate_security_operation(struct gsm_subscriber_connection *conn);
|
||||
|
||||
int gsm48_multirate_config(uint8_t *lv, struct amr_multirate_conf *mr, struct amr_mode *modes);
|
||||
|
||||
int gsm0408_authorize(struct gsm_subscriber_connection *conn, struct msgb *msg);
|
||||
int gsm0408_loc_upd_rej(struct gsm_subscriber_connection *conn, uint8_t cause);
|
||||
void release_loc_updating_req(struct gsm_subscriber_connection *conn, int release);
|
||||
|
||||
#endif
|
||||
|
||||
21
openbsc/include/openbsc/gsm_04_08_gprs.h
Normal file
21
openbsc/include/openbsc/gsm_04_08_gprs.h
Normal file
@@ -0,0 +1,21 @@
|
||||
#pragma once
|
||||
|
||||
#include <osmocom/gsm/protocol/gsm_04_08_gprs.h>
|
||||
|
||||
/* TODO: Move this to osmocom/gsm/protocol/gsm_04_08_gprs.h ? */
|
||||
|
||||
/* Table 10.4 in 3GPP TS 24.008 (successor to 04.08) */
|
||||
#define GSM48_MT_GMM_SERVICE_REQ 0x0c
|
||||
#define GSM48_MT_GMM_SERVICE_ACK 0x0d
|
||||
#define GSM48_MT_GMM_SERVICE_REJ 0x0e
|
||||
|
||||
/* 3GPP 24.008 / Chapter 10.5.5.20 / Table 10.5.153a */
|
||||
enum gsm48_gmm_service_type {
|
||||
GPRS_SERVICE_T_SIGNALLING = 0x00,
|
||||
GPRS_SERVICE_T_DATA = 0x01,
|
||||
GPRS_SERVICE_T_PAGING_RESP = 0x02,
|
||||
GPRS_SERVICE_T_MBMS_MC_SERV = 0x03,
|
||||
GPRS_SERVICE_T_MBMS_BC_SERV = 0x04,
|
||||
};
|
||||
|
||||
extern const struct value_string *gprs_service_t_strs;
|
||||
@@ -38,8 +38,5 @@ int gsm411_send_sms(struct gsm_subscriber_connection *conn,
|
||||
struct gsm_sms *sms);
|
||||
void gsm411_sapi_n_reject(struct gsm_subscriber_connection *conn);
|
||||
|
||||
int gsm411_send_rp_msg_subscr(struct gsm_subscriber *subscr,
|
||||
struct msgb *rp);
|
||||
|
||||
uint8_t sms_next_rp_msg_ref(uint8_t *next_rp_ref);
|
||||
#endif
|
||||
|
||||
@@ -7,24 +7,17 @@
|
||||
|
||||
struct gsm_subscriber_connection;
|
||||
|
||||
int gsm0480_send_component(struct gsm_subscriber_connection *conn,
|
||||
struct msgb *msg,
|
||||
struct ss_header* reqhdr);
|
||||
|
||||
int gsm0480_send_ussd_response(struct gsm_subscriber_connection *conn,
|
||||
const struct msgb *in_msg, const char* response_text,
|
||||
const struct ussd_request *req);
|
||||
int gsm0480_send_ussd_reject(struct gsm_subscriber_connection *conn,
|
||||
uint8_t invoke_id,
|
||||
uint8_t transaction_id);
|
||||
const struct msgb *msg,
|
||||
const struct ussd_request *request);
|
||||
|
||||
struct msgb *gsm0480_compose_ussd_component(struct ss_request* req);
|
||||
struct msgb *gsm0480_gen_ussdNotify(int level, const char *text);
|
||||
struct msgb *gsm0480_gen_releaseComplete(void);
|
||||
|
||||
|
||||
|
||||
int msc_send_ussd_notify(struct gsm_subscriber_connection *conn, int level,
|
||||
const char *text);
|
||||
int msc_send_ussd_release_complete(struct gsm_subscriber_connection *conn);
|
||||
|
||||
int bsc_send_ussd_notify(struct gsm_subscriber_connection *conn, int level,
|
||||
const char *text);
|
||||
int bsc_send_ussd_release_complete(struct gsm_subscriber_connection *conn);
|
||||
int gsm0480_send_ussdNotify(struct gsm_subscriber_connection *conn, int level, const char *text);
|
||||
int gsm0480_send_releaseComplete(struct gsm_subscriber_connection *conn);
|
||||
|
||||
#endif
|
||||
|
||||
@@ -2,20 +2,13 @@
|
||||
#define _GSM_DATA_H
|
||||
|
||||
#include <stdint.h>
|
||||
#include <regex.h>
|
||||
#include <sys/types.h>
|
||||
#include <stdbool.h>
|
||||
|
||||
#include <osmocom/core/timer.h>
|
||||
#include <osmocom/core/rate_ctr.h>
|
||||
#include <osmocom/core/select.h>
|
||||
#include <osmocom/core/stats.h>
|
||||
|
||||
#include <osmocom/crypt/auth.h>
|
||||
|
||||
#include <openbsc/rest_octets.h>
|
||||
#include <openbsc/common_cs.h>
|
||||
#include <openbsc/gsup_client.h>
|
||||
#include <openbsc/xsc.h>
|
||||
|
||||
/** annotations for msgb ownership */
|
||||
#define __uses
|
||||
@@ -71,7 +64,6 @@ struct gsm_loc_updating_operation {
|
||||
struct osmo_timer_list updating_timer;
|
||||
unsigned int waiting_for_imsi : 1;
|
||||
unsigned int waiting_for_imei : 1;
|
||||
unsigned int waiting_for_remote_accept : 1;
|
||||
unsigned int key_seq : 4;
|
||||
};
|
||||
|
||||
@@ -106,7 +98,19 @@ struct neigh_meas_proc {
|
||||
uint8_t last_seen_nr;
|
||||
};
|
||||
|
||||
/* active radio connection of a mobile subscriber */
|
||||
enum interface_type {
|
||||
IFACE_UNKNOWN = -1,
|
||||
IFACE_A = 0, /* A-interface for 2G */
|
||||
IFACE_IU = 1 /* Iu-interface for UMTS aka 3G (IuCS or IuPS) */
|
||||
};
|
||||
|
||||
enum integrity_protection_state {
|
||||
INTEGRITY_PROTECTION_NONE = 0,
|
||||
INTEGRITY_PROTECTION_IK = 1,
|
||||
INTEGRITY_PROTECTION_IK_CK = 2,
|
||||
};
|
||||
|
||||
/* mobile subscriber data */
|
||||
struct gsm_subscriber_connection {
|
||||
struct llist_head entry;
|
||||
|
||||
@@ -133,20 +137,40 @@ struct gsm_subscriber_connection {
|
||||
int mncc_rtp_create_pending;
|
||||
int mncc_rtp_connect_pending;
|
||||
|
||||
/* bsc structures */
|
||||
struct osmo_bsc_sccp_con *sccp_con; /* BSC */
|
||||
|
||||
/* back pointers */
|
||||
struct gsm_network *network;
|
||||
|
||||
/* The BSC used to be an integral part of OsmoNITB. In OsmoCSCN, the
|
||||
* BSC and/or RNC is a separate entity, and no back pointers to the bts
|
||||
* and lchan structures are available. To facilitate separation of the
|
||||
* code paths, I'm explicitly excluding the unavailable structures from
|
||||
* the build. Once separated, this split may become unnecessary. */
|
||||
#if COMPILING_LIBMSC
|
||||
int in_release;
|
||||
struct gsm_lchan *lchan; /* BSC */
|
||||
struct gsm_lchan *ho_lchan; /* BSC */
|
||||
struct gsm_bts *bts; /* BSC */
|
||||
uint16_t lac;
|
||||
struct gsm_encr encr;
|
||||
|
||||
/* 2G or 3G? See enum interface_type */
|
||||
int via_iface;
|
||||
|
||||
/* which Iu-CS connection, if any. */
|
||||
struct {
|
||||
struct ue_conn_ctx *ue_ctx;
|
||||
int integrity_protection;
|
||||
} iu;
|
||||
|
||||
#else
|
||||
struct gsm_bts *bts;
|
||||
struct gsm_lchan *lchan;
|
||||
struct gsm_lchan *ho_lchan;
|
||||
|
||||
/* bsc structures */
|
||||
struct osmo_bsc_sccp_con *sccp_con;
|
||||
|
||||
/* for assignment handling */
|
||||
struct osmo_timer_list T10; /* BSC */
|
||||
struct gsm_lchan *secondary_lchan; /* BSC */
|
||||
struct osmo_timer_list T10;
|
||||
struct gsm_lchan *secondary_lchan;
|
||||
#endif
|
||||
|
||||
};
|
||||
|
||||
@@ -155,121 +179,62 @@ struct gsm_subscriber_connection {
|
||||
#include "gsm_data_shared.h"
|
||||
|
||||
|
||||
enum {
|
||||
BSC_CTR_CHREQ_TOTAL,
|
||||
BSC_CTR_CHREQ_NO_CHANNEL,
|
||||
BSC_CTR_HANDOVER_ATTEMPTED,
|
||||
BSC_CTR_HANDOVER_NO_CHANNEL,
|
||||
BSC_CTR_HANDOVER_TIMEOUT,
|
||||
BSC_CTR_HANDOVER_COMPLETED,
|
||||
BSC_CTR_HANDOVER_FAILED,
|
||||
BSC_CTR_PAGING_ATTEMPTED,
|
||||
BSC_CTR_PAGING_DETACHED,
|
||||
BSC_CTR_PAGING_COMPLETED,
|
||||
BSC_CTR_PAGING_EXPIRED,
|
||||
BSC_CTR_CHAN_RF_FAIL,
|
||||
BSC_CTR_CHAN_RLL_ERR,
|
||||
BSC_CTR_BTS_OML_FAIL,
|
||||
BSC_CTR_BTS_RSL_FAIL,
|
||||
BSC_CTR_CODEC_AMR_F,
|
||||
BSC_CTR_CODEC_AMR_H,
|
||||
BSC_CTR_CODEC_EFR,
|
||||
BSC_CTR_CODEC_V1_FR,
|
||||
BSC_CTR_CODEC_V1_HR,
|
||||
};
|
||||
|
||||
static const struct rate_ctr_desc bsc_ctr_description[] = {
|
||||
[BSC_CTR_CHREQ_TOTAL] = {"chreq.total", "Received channel requests."},
|
||||
[BSC_CTR_CHREQ_NO_CHANNEL] = {"chreq.no_channel", "Sent to MS no channel available."},
|
||||
[BSC_CTR_HANDOVER_ATTEMPTED] = {"handover.attempted", "Received handover attempts."},
|
||||
[BSC_CTR_HANDOVER_NO_CHANNEL] = {"handover.no_channel", "Sent no channel available responses."},
|
||||
[BSC_CTR_HANDOVER_TIMEOUT] = {"handover.timeout", "Count the amount of timeouts of timer T3103."},
|
||||
[BSC_CTR_HANDOVER_COMPLETED] = {"handover.completed", "Received handover completed."},
|
||||
[BSC_CTR_HANDOVER_FAILED] = {"handover.failed", "Receive HO FAIL messages."},
|
||||
[BSC_CTR_PAGING_ATTEMPTED] = {"paging.attempted", "Paging attempts for a MS."},
|
||||
[BSC_CTR_PAGING_DETACHED] = {"paging.detached", "Counts the amount of paging attempts which couldn't sent out any paging request because no responsible bts found."},
|
||||
[BSC_CTR_PAGING_COMPLETED] = {"paging.completed", "Paging successful completed."},
|
||||
[BSC_CTR_PAGING_EXPIRED] = {"paging.expired", "Paging Request expired because of timeout T3113."},
|
||||
[BSC_CTR_CHAN_RF_FAIL] = {"chan.rf_fail", "Received a RF failure indication from BTS."},
|
||||
[BSC_CTR_CHAN_RLL_ERR] = {"chan.rll_err", "Received a RLL failure with T200 cause from BTS."},
|
||||
[BSC_CTR_BTS_OML_FAIL] = {"bts.oml_fail", "Received a TEI down on a OML link."},
|
||||
[BSC_CTR_BTS_RSL_FAIL] = {"bts.rsl_fail", "Received a TEI down on a OML link."},
|
||||
[BSC_CTR_CODEC_AMR_F] = {"bts.codec_amr_f", "Count the usage of AMR/F codec by channel mode requested."},
|
||||
[BSC_CTR_CODEC_AMR_H] = {"bts.codec_amr_h", "Count the usage of AMR/H codec by channel mode requested."},
|
||||
[BSC_CTR_CODEC_EFR] = {"bts.codec_efr", "Count the usage of EFR codec by channel mode requested."},
|
||||
[BSC_CTR_CODEC_V1_FR] = {"bts.codec_fr", "Count the usage of FR codec by channel mode requested."},
|
||||
[BSC_CTR_CODEC_V1_HR] = {"bts.codec_hr", "Count the usage of HR codec by channel mode requested."},
|
||||
};
|
||||
|
||||
enum {
|
||||
MSC_CTR_LOC_UPDATE_TYPE_ATTACH,
|
||||
MSC_CTR_LOC_UPDATE_TYPE_NORMAL,
|
||||
MSC_CTR_LOC_UPDATE_TYPE_PERIODIC,
|
||||
MSC_CTR_LOC_UPDATE_TYPE_DETACH,
|
||||
MSC_CTR_LOC_UPDATE_RESP_REJECT,
|
||||
MSC_CTR_LOC_UPDATE_RESP_ACCEPT,
|
||||
MSC_CTR_SMS_SUBMITTED,
|
||||
MSC_CTR_SMS_NO_RECEIVER,
|
||||
MSC_CTR_SMS_DELIVERED,
|
||||
MSC_CTR_SMS_RP_ERR_MEM,
|
||||
MSC_CTR_SMS_RP_ERR_OTHER,
|
||||
MSC_CTR_SMS_DELIVER_UNKNOWN_ERROR,
|
||||
MSC_CTR_CALL_MO_SETUP,
|
||||
MSC_CTR_CALL_MO_CONNECT_ACK,
|
||||
MSC_CTR_CALL_MT_SETUP,
|
||||
MSC_CTR_CALL_MT_CONNECT,
|
||||
MSC_CTR_CALL_ACTIVE,
|
||||
MSC_CTR_CALL_COMPLETE,
|
||||
MSC_CTR_CALL_INCOMPLETE,
|
||||
};
|
||||
|
||||
static const struct rate_ctr_desc msc_ctr_description[] = {
|
||||
[MSC_CTR_LOC_UPDATE_TYPE_ATTACH] = {"loc_update_type.attach", "Received location update imsi attach requests."},
|
||||
[MSC_CTR_LOC_UPDATE_TYPE_NORMAL] = {"loc_update_type.normal", "Received location update normal requests."},
|
||||
[MSC_CTR_LOC_UPDATE_TYPE_PERIODIC] = {"loc_update_type.periodic", "Received location update periodic requests."},
|
||||
[MSC_CTR_LOC_UPDATE_TYPE_DETACH] = {"loc_update_type.detach", "Received location update detach indication."},
|
||||
[MSC_CTR_LOC_UPDATE_RESP_REJECT] = {"loc_update_resp.reject", "Sent location update reject responses."},
|
||||
[MSC_CTR_LOC_UPDATE_RESP_ACCEPT] = {"loc_update_resp.accept", "Sent location update accept responses."},
|
||||
[MSC_CTR_SMS_SUBMITTED] = {"sms.submitted", "Received a RPDU from a MS (MO)."},
|
||||
[MSC_CTR_SMS_NO_RECEIVER] = {"sms.no_receiver", "Counts SMS which couldn't routed because no receiver found."},
|
||||
[MSC_CTR_SMS_DELIVERED] = {"sms.delivered", "Global SMS Deliver attempts."},
|
||||
[MSC_CTR_SMS_RP_ERR_MEM] = {"sms.rp_err_mem", "CAUSE_MT_MEM_EXCEEDED errors of MS responses on a sms deliver attempt."},
|
||||
[MSC_CTR_SMS_RP_ERR_OTHER] = {"sms.rp_err_other", "Other error of MS responses on a sms delive attempt."},
|
||||
[MSC_CTR_SMS_DELIVER_UNKNOWN_ERROR] = {"sms.deliver_unknown_error", "Unknown error occured during sms delivery."},
|
||||
/* FIXME: count also sms delivered */
|
||||
[MSC_CTR_CALL_MO_SETUP] = {"call.mo_setup", "Received setup requests from a MS to init a MO call."},
|
||||
[MSC_CTR_CALL_MO_CONNECT_ACK] = {"call.mo_connect_ack", "Received a connect ack from MS of a MO call. Call is now succesful connected up."},
|
||||
[MSC_CTR_CALL_MT_SETUP] = {"call.mt_setup", "Sent setup requests to the MS (MT)."},
|
||||
[MSC_CTR_CALL_MT_CONNECT] = {"call.mt_connect", "Sent a connect to the MS (MT)."},
|
||||
[MSC_CTR_CALL_ACTIVE] = {"call.active", "Count total amount of calls that ever reached active state."},
|
||||
[MSC_CTR_CALL_COMPLETE] = {"call.complete", "Count total amount of calls which got terminated by disconnect req or ind after reaching active state."},
|
||||
[MSC_CTR_CALL_INCOMPLETE] = {"call.incomplete", "Count total amount of call which got terminated by any other reason after reaching active state."},
|
||||
};
|
||||
|
||||
|
||||
static const struct rate_ctr_group_desc bsc_ctrg_desc = {
|
||||
"bsc",
|
||||
"base station controller",
|
||||
OSMO_STATS_CLASS_GLOBAL,
|
||||
ARRAY_SIZE(bsc_ctr_description),
|
||||
bsc_ctr_description,
|
||||
};
|
||||
|
||||
static const struct rate_ctr_group_desc msc_ctrg_desc = {
|
||||
"msc",
|
||||
"mobile switching center",
|
||||
OSMO_STATS_CLASS_GLOBAL,
|
||||
ARRAY_SIZE(msc_ctr_description),
|
||||
msc_ctr_description,
|
||||
/* Some statistics of our network */
|
||||
struct gsmnet_stats {
|
||||
struct {
|
||||
struct osmo_counter *total;
|
||||
struct osmo_counter *no_channel;
|
||||
} chreq;
|
||||
struct {
|
||||
struct osmo_counter *attempted;
|
||||
struct osmo_counter *no_channel; /* no channel available */
|
||||
struct osmo_counter *timeout; /* T3103 timeout */
|
||||
struct osmo_counter *completed; /* HO COMPL received */
|
||||
struct osmo_counter *failed; /* HO FAIL received */
|
||||
} handover;
|
||||
struct {
|
||||
struct osmo_counter *attach;
|
||||
struct osmo_counter *normal;
|
||||
struct osmo_counter *periodic;
|
||||
struct osmo_counter *detach;
|
||||
} loc_upd_type;
|
||||
struct {
|
||||
struct osmo_counter *reject;
|
||||
struct osmo_counter *accept;
|
||||
} loc_upd_resp;
|
||||
struct {
|
||||
struct osmo_counter *attempted;
|
||||
struct osmo_counter *detached;
|
||||
struct osmo_counter *completed;
|
||||
struct osmo_counter *expired;
|
||||
} paging;
|
||||
struct {
|
||||
struct osmo_counter *submitted; /* MO SMS submissions */
|
||||
struct osmo_counter *no_receiver;
|
||||
struct osmo_counter *delivered; /* MT SMS deliveries */
|
||||
struct osmo_counter *rp_err_mem;
|
||||
struct osmo_counter *rp_err_other;
|
||||
} sms;
|
||||
struct {
|
||||
struct osmo_counter *mo_setup;
|
||||
struct osmo_counter *mo_connect_ack;
|
||||
struct osmo_counter *mt_setup;
|
||||
struct osmo_counter *mt_connect;
|
||||
} call;
|
||||
struct {
|
||||
struct osmo_counter *rf_fail;
|
||||
struct osmo_counter *rll_err;
|
||||
} chan;
|
||||
struct {
|
||||
struct osmo_counter *oml_fail;
|
||||
struct osmo_counter *rsl_fail;
|
||||
} bts;
|
||||
};
|
||||
|
||||
enum gsm_auth_policy {
|
||||
GSM_AUTH_POLICY_CLOSED, /* only subscribers authorized in DB */
|
||||
GSM_AUTH_POLICY_ACCEPT_ALL, /* accept everyone, even if not authorized in DB */
|
||||
GSM_AUTH_POLICY_TOKEN, /* accept first, send token per sms, then revoke authorization */
|
||||
GSM_AUTH_POLICY_REGEXP, /* accept IMSIs matching given regexp */
|
||||
GSM_AUTH_POLICY_REMOTE,
|
||||
GSM_AUTH_POLICY_REMOTE_CLOSED
|
||||
};
|
||||
|
||||
#define GSM_T3101_DEFAULT 10
|
||||
@@ -285,14 +250,18 @@ struct gsm_tz {
|
||||
};
|
||||
|
||||
struct gsm_network {
|
||||
/* TODO MSCSPLIT the gsm_network struct is basically a kitchen sink for
|
||||
* global settings and variables, "madly" mixing BSC and MSC stuff. Split
|
||||
* this in e.g. struct osmo_bsc and struct osmo_msc, with the things
|
||||
* these have in common, like country and network code, put in yet
|
||||
* separate structs and placed as members in osmo_bsc and osmo_msc. */
|
||||
|
||||
/* global parameters */
|
||||
uint16_t country_code;
|
||||
uint16_t network_code;
|
||||
char *name_long;
|
||||
char *name_short;
|
||||
enum gsm_auth_policy auth_policy;
|
||||
regex_t authorized_regexp;
|
||||
char *authorized_reg_str;
|
||||
enum gsm48_reject_value reject_cause;
|
||||
int a5_encryption;
|
||||
int neci;
|
||||
@@ -314,19 +283,14 @@ struct gsm_network {
|
||||
unsigned int max_distance; /* TA values */
|
||||
} handover;
|
||||
|
||||
struct rate_ctr_group *bsc_ctrs;
|
||||
struct rate_ctr_group *msc_ctrs;
|
||||
struct osmo_counter *active_calls;
|
||||
struct gsmnet_stats stats;
|
||||
|
||||
/* layer 4 */
|
||||
struct mncc_sock_state *mncc_state;
|
||||
mncc_recv_cb_t mncc_recv;
|
||||
int (*mncc_recv) (struct gsm_network *net, struct msgb *msg);
|
||||
struct llist_head upqueue;
|
||||
struct llist_head trans_list;
|
||||
struct bsc_api *bsc_api;
|
||||
struct gsup_client *hlr_sup_client;
|
||||
struct gsup_client *ussd_sup_client;
|
||||
struct gsup_client *sms_client;
|
||||
|
||||
unsigned int num_bts;
|
||||
struct llist_head bts_list;
|
||||
@@ -353,6 +317,9 @@ struct gsm_network {
|
||||
enum rrlp_mode mode;
|
||||
} rrlp;
|
||||
|
||||
/* enable the DTXu and DTXd for this network */
|
||||
int dtx_enabled;
|
||||
|
||||
enum gsm_chan_t ctype_by_chreq[16];
|
||||
|
||||
/* Use a TCH for handling requests of type paging any */
|
||||
@@ -362,10 +329,7 @@ struct gsm_network {
|
||||
struct osmo_bsc_data *bsc_data;
|
||||
|
||||
/* subscriber related features */
|
||||
bool auto_create_subscr;
|
||||
bool auto_assign_exten;
|
||||
uint64_t ext_min;
|
||||
uint64_t ext_max;
|
||||
int create_subscriber;
|
||||
struct gsm_subscriber_group *subscr_group;
|
||||
struct gsm_sms_queue *sms_queue;
|
||||
|
||||
@@ -375,10 +339,6 @@ struct gsm_network {
|
||||
/* control interface */
|
||||
struct ctrl_handle *ctrl;
|
||||
|
||||
/* Allow or disallow TCH/F on dynamic TCH/F_TCH/H_PDCH; OS#1778 */
|
||||
bool dyn_ts_allow_tch_f;
|
||||
/* TODO: vty for this; related: OS#1781 */
|
||||
|
||||
/* all active subscriber connections. */
|
||||
struct llist_head subscr_conns;
|
||||
|
||||
@@ -388,6 +348,9 @@ struct gsm_network {
|
||||
* BTS|RNC specific timezone overrides for multi-tz networks in
|
||||
* OsmoCSCN, this should be tied to the location area code (LAC). */
|
||||
struct gsm_tz tz;
|
||||
|
||||
/* Periodic location update default value */
|
||||
uint8_t t3212;
|
||||
};
|
||||
|
||||
struct osmo_esme;
|
||||
@@ -434,14 +397,13 @@ struct gsm_sms {
|
||||
char text[SMS_TEXT_SIZE];
|
||||
};
|
||||
|
||||
extern void talloc_ctx_init(void *ctx_root);
|
||||
struct gsm_network *gsm_network_init(void *ctx,
|
||||
uint16_t country_code,
|
||||
uint16_t network_code,
|
||||
mncc_recv_cb_t mncc_recv);
|
||||
|
||||
int gsm_set_bts_type(struct gsm_bts *bts, enum gsm_bts_type type);
|
||||
|
||||
/* Get reference to a neighbor cell on a given BCCH ARFCN */
|
||||
struct gsm_bts *gsm_bts_neighbor(const struct gsm_bts *bts,
|
||||
uint16_t arfcn, uint8_t bsic);
|
||||
|
||||
enum gsm_bts_type parse_btstype(const char *arg);
|
||||
const char *btstype2str(enum gsm_bts_type type);
|
||||
struct gsm_bts *gsm_bts_by_lac(struct gsm_network *net, unsigned int lac,
|
||||
@@ -524,7 +486,6 @@ int bts_gprs_mode_is_compat(struct gsm_bts *bts, enum bts_gprs_mode mode);
|
||||
|
||||
int gsm48_ra_id_by_bts(uint8_t *buf, struct gsm_bts *bts);
|
||||
void gprs_ra_id_by_bts(struct gprs_ra_id *raid, struct gsm_bts *bts);
|
||||
struct gsm_meas_rep *lchan_next_meas_rep(struct gsm_lchan *lchan);
|
||||
|
||||
int gsm_btsmodel_set_feature(struct gsm_bts_model *model, enum gsm_bts_features feat);
|
||||
int gsm_bts_model_register(struct gsm_bts_model *model);
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
#include <osmocom/gsm/rxlev_stat.h>
|
||||
#include <osmocom/gsm/sysinfo.h>
|
||||
#include <osmocom/gsm/meas_rep.h>
|
||||
#include <osmocom/gsm/protocol/gsm_04_08.h>
|
||||
|
||||
#include <osmocom/gsm/protocol/gsm_08_58.h>
|
||||
#include <osmocom/gsm/protocol/gsm_12_21.h>
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
#include <osmocom/gsm/lapdm.h>
|
||||
#endif
|
||||
|
||||
#include <openbsc/common_cs.h>
|
||||
#include <openbsc/xsc.h>
|
||||
|
||||
struct osmo_bsc_data;
|
||||
|
||||
@@ -48,10 +48,6 @@ enum gsm_chreq_reason_t {
|
||||
GSM_CHREQ_REASON_OTHER,
|
||||
};
|
||||
|
||||
/* lchans 0..3 are SDCCH in combined channel configuration,
|
||||
use 4 as magic number for BCCH hack - see osmo-bts-../oml.c:opstart_compl() */
|
||||
#define CCCH_LCHAN 4
|
||||
|
||||
#define TRX_NR_TS 8
|
||||
#define TS_MAX_LCHAN 8
|
||||
|
||||
@@ -106,19 +102,6 @@ struct gsm_abis_mo {
|
||||
struct gsm_bts *bts;
|
||||
};
|
||||
|
||||
/* Ericsson OM2000 Managed Object */
|
||||
struct abis_om2k_mo {
|
||||
uint8_t class;
|
||||
uint8_t bts;
|
||||
uint8_t assoc_so;
|
||||
uint8_t inst;
|
||||
} __attribute__ ((packed));
|
||||
|
||||
struct om2k_mo {
|
||||
struct abis_om2k_mo addr;
|
||||
struct osmo_fsm_inst *fsm;
|
||||
};
|
||||
|
||||
#define A38_XOR_MIN_KEY_LEN 12
|
||||
#define A38_XOR_MAX_KEY_LEN 16
|
||||
#define A38_COMP128_KEY_LEN 16
|
||||
@@ -270,14 +253,6 @@ struct gsm_lchan {
|
||||
struct gsm48_req_ref *rqd_ref;
|
||||
|
||||
struct gsm_subscriber_connection *conn;
|
||||
|
||||
struct {
|
||||
/* channel activation type and handover ref */
|
||||
uint8_t act_type;
|
||||
uint8_t ho_ref;
|
||||
struct gsm48_req_ref *rqd_ref;
|
||||
uint8_t rqd_ta;
|
||||
} dyn;
|
||||
#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. */
|
||||
@@ -309,23 +284,10 @@ struct gsm_lchan {
|
||||
struct {
|
||||
struct amr_multirate_conf amr_mr;
|
||||
struct {
|
||||
struct osmo_fsm_inst *dl_amr_fsm;
|
||||
/* TCH cache */
|
||||
uint8_t cache[20];
|
||||
/* FACCH cache */
|
||||
uint8_t facch[GSM_MACBLOCK_LEN];
|
||||
uint8_t buf[16];
|
||||
uint8_t len;
|
||||
uint32_t fn;
|
||||
bool is_update;
|
||||
/* set for each SID frame to detect talkspurt for codecs
|
||||
without explicit ONSET event */
|
||||
bool ul_sid;
|
||||
/* indicates if DTXd was active during DL measurement
|
||||
period */
|
||||
bool dl_active;
|
||||
} dtx;
|
||||
} last_sid;
|
||||
uint8_t last_cmr;
|
||||
uint32_t last_fn;
|
||||
} tch;
|
||||
/* BTS-side ciphering state (rx only, bi-directional, ...) */
|
||||
uint8_t ciph_state;
|
||||
@@ -343,26 +305,16 @@ struct gsm_lchan {
|
||||
int s;
|
||||
/* Kind of the release/activation. E.g. RSL or PCU */
|
||||
int rel_act_kind;
|
||||
/* RTP header Marker bit to indicate beginning of speech after pause */
|
||||
bool rtp_tx_marker;
|
||||
|
||||
/* power handling */
|
||||
struct {
|
||||
uint8_t current;
|
||||
uint8_t fixed;
|
||||
} ms_power_ctrl;
|
||||
|
||||
struct msgb *pending_rel_ind_msg;
|
||||
#endif
|
||||
};
|
||||
|
||||
enum {
|
||||
TS_F_PDCH_ACTIVE = 0x1000,
|
||||
TS_F_PDCH_ACT_PENDING = 0x2000,
|
||||
TS_F_PDCH_DEACT_PENDING = 0x4000,
|
||||
TS_F_PDCH_PENDING_MASK = 0x6000 /*<
|
||||
TS_F_PDCH_ACT_PENDING | TS_F_PDCH_DEACT_PENDING */
|
||||
} gsm_bts_trx_ts_flags;
|
||||
|
||||
#define TS_F_PDCH_MODE 0x1000
|
||||
/* One Timeslot in a TRX */
|
||||
struct gsm_bts_trx_ts {
|
||||
struct gsm_bts_trx *trx;
|
||||
@@ -371,12 +323,6 @@ struct gsm_bts_trx_ts {
|
||||
|
||||
enum gsm_phys_chan_config pchan;
|
||||
|
||||
struct {
|
||||
enum gsm_phys_chan_config pchan_is;
|
||||
enum gsm_phys_chan_config pchan_want;
|
||||
struct msgb *pending_chan_activ;
|
||||
} dyn;
|
||||
|
||||
unsigned int flags;
|
||||
struct gsm_abis_mo mo;
|
||||
struct tlv_parsed nm_attr;
|
||||
@@ -399,16 +345,10 @@ struct gsm_bts_trx_ts {
|
||||
/* To which E1 subslot are we connected */
|
||||
struct gsm_e1_subslot e1_link;
|
||||
|
||||
union {
|
||||
struct {
|
||||
struct om2k_mo om2k_mo;
|
||||
} rbs2000;
|
||||
};
|
||||
|
||||
struct gsm_lchan lchan[TS_MAX_LCHAN];
|
||||
};
|
||||
|
||||
/* One TRX in a BTS */
|
||||
/* One TRX (transceiver) in a BTS */
|
||||
struct gsm_bts_trx {
|
||||
/* list header in bts->trx_list */
|
||||
struct llist_head list;
|
||||
@@ -459,17 +399,6 @@ struct gsm_bts_trx {
|
||||
uint8_t test_nr;
|
||||
struct rxlev_stats rxlev_stat;
|
||||
} ipaccess;
|
||||
struct {
|
||||
struct {
|
||||
struct om2k_mo om2k_mo;
|
||||
} trxc;
|
||||
struct {
|
||||
struct om2k_mo om2k_mo;
|
||||
} rx;
|
||||
struct {
|
||||
struct om2k_mo om2k_mo;
|
||||
} tx;
|
||||
} rbs2000;
|
||||
};
|
||||
struct gsm_bts_trx_ts ts[TRX_NR_TS];
|
||||
};
|
||||
@@ -662,10 +591,6 @@ struct gsm_bts {
|
||||
/* number of this BTS on given E1 link */
|
||||
uint8_t bts_nr;
|
||||
|
||||
/* DTX features of this BTS */
|
||||
enum gsm48_dtx_mode dtxu;
|
||||
bool dtxd;
|
||||
|
||||
/* paging state and control */
|
||||
struct gsm_bts_paging_state paging;
|
||||
|
||||
@@ -700,26 +625,17 @@ struct gsm_bts {
|
||||
} bs11;
|
||||
struct {
|
||||
struct {
|
||||
struct om2k_mo om2k_mo;
|
||||
struct gsm_abis_mo mo;
|
||||
struct llist_head conn_groups;
|
||||
} cf;
|
||||
struct {
|
||||
struct om2k_mo om2k_mo;
|
||||
struct gsm_abis_mo mo;
|
||||
struct llist_head conn_groups;
|
||||
} is;
|
||||
struct {
|
||||
struct om2k_mo om2k_mo;
|
||||
struct gsm_abis_mo mo;
|
||||
struct llist_head conn_groups;
|
||||
} con;
|
||||
struct {
|
||||
struct om2k_mo om2k_mo;
|
||||
struct gsm_abis_mo mo;
|
||||
} dp;
|
||||
struct {
|
||||
struct om2k_mo om2k_mo;
|
||||
struct gsm_abis_mo mo;
|
||||
} tf;
|
||||
} rbs2000;
|
||||
@@ -737,7 +653,6 @@ struct gsm_bts {
|
||||
|
||||
/* Not entirely sure how ip.access specific this is */
|
||||
struct {
|
||||
uint8_t supports_egprs_11bit_rach;
|
||||
enum bts_gprs_mode mode;
|
||||
struct {
|
||||
struct gsm_abis_mo mo;
|
||||
@@ -753,7 +668,6 @@ struct gsm_bts {
|
||||
struct gsm_bts_gprs_nsvc nsvc[2];
|
||||
uint8_t rac;
|
||||
uint8_t net_ctrl_ord;
|
||||
bool ctrl_ack_type_use_block;
|
||||
} gprs;
|
||||
|
||||
/* RACH NM values */
|
||||
@@ -805,7 +719,6 @@ struct gsm_bts {
|
||||
uint16_t scramble_list[MAX_EARFCN_LIST];
|
||||
} data;
|
||||
} si_common;
|
||||
bool early_classmark_allowed;
|
||||
|
||||
/* do we use static (user-defined) system information messages? (bitmask) */
|
||||
uint32_t si_mode_static;
|
||||
@@ -835,15 +748,15 @@ 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[13];
|
||||
const struct value_string gsm_pchant_descs[13];
|
||||
const struct value_string gsm_pchant_names[12];
|
||||
const struct value_string gsm_pchant_descs[12];
|
||||
const struct value_string gsm_lchant_names[8];
|
||||
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);
|
||||
const char *gsm_chreq_name(enum gsm_chreq_reason_t c);
|
||||
char *gsm_trx_name(const struct gsm_bts_trx *trx);
|
||||
char *gsm_ts_name(const struct gsm_bts_trx_ts *ts);
|
||||
char *gsm_ts_and_pchan_name(const struct gsm_bts_trx_ts *ts);
|
||||
char *gsm_lchan_name_compute(const struct gsm_lchan *lchan);
|
||||
const char *gsm_lchans_name(enum gsm_lchan_state s);
|
||||
|
||||
@@ -868,11 +781,8 @@ gsm_objclass2obj(struct gsm_bts *bts, uint8_t obj_class,
|
||||
/* reset the state of all MO in the BTS */
|
||||
void gsm_bts_mo_reset(struct gsm_bts *bts);
|
||||
|
||||
uint8_t gsm_pchan2chan_nr(enum gsm_phys_chan_config pchan,
|
||||
uint8_t ts_nr, uint8_t lchan_nr);
|
||||
uint8_t gsm_ts2chan_nr(const struct gsm_bts_trx_ts *ts, uint8_t lchan_nr);
|
||||
uint8_t gsm_lchan2chan_nr(const struct gsm_lchan *lchan);
|
||||
uint8_t gsm_lchan_as_pchan2chan_nr(const struct gsm_lchan *lchan,
|
||||
enum gsm_phys_chan_config as_pchan);
|
||||
|
||||
/* return the gsm_lchan for the CBCH (if it exists at all) */
|
||||
struct gsm_lchan *gsm_bts_get_cbch(struct gsm_bts *bts);
|
||||
@@ -891,11 +801,5 @@ static inline uint8_t gsm_ts_tsc(const struct gsm_bts_trx_ts *ts)
|
||||
return ts->trx->bts->bsic & 7;
|
||||
}
|
||||
|
||||
struct gsm_lchan *rsl_lchan_lookup(struct gsm_bts_trx *trx, uint8_t chan_nr,
|
||||
int *rc);
|
||||
|
||||
enum gsm_phys_chan_config ts_pchan(struct gsm_bts_trx_ts *ts);
|
||||
uint8_t ts_subslots(struct gsm_bts_trx_ts *ts);
|
||||
bool ts_is_tch(struct gsm_bts_trx_ts *ts);
|
||||
|
||||
#endif
|
||||
|
||||
@@ -3,11 +3,10 @@
|
||||
|
||||
#include <stdbool.h>
|
||||
|
||||
#include "gsm_data.h"
|
||||
#include <osmocom/core/linuxlist.h>
|
||||
#include <osmocom/gsm/protocol/gsm_23_003.h>
|
||||
|
||||
#include <openbsc/gsm_data.h>
|
||||
|
||||
#define GSM_NAME_LENGTH 160
|
||||
|
||||
#define GSM_EXTENSION_LENGTH 15 /* MSISDN can only be 15 digits length */
|
||||
@@ -71,6 +70,7 @@ struct gsm_subscriber {
|
||||
|
||||
/* pending requests */
|
||||
int is_paging;
|
||||
struct osmo_timer_list paging_timeout;
|
||||
struct llist_head requests;
|
||||
|
||||
/* GPRS/SGSN related fields */
|
||||
@@ -90,6 +90,20 @@ enum gsm_subscriber_update_reason {
|
||||
GSM_SUBSCRIBER_UPDATE_EQUIPMENT,
|
||||
};
|
||||
|
||||
/*
|
||||
* Struct for pending channel requests. This is managed in the
|
||||
* llist_head requests of each subscriber. The reference counting
|
||||
* should work in such a way that a subscriber with a pending request
|
||||
* remains in memory.
|
||||
*/
|
||||
struct subscr_request {
|
||||
struct llist_head entry;
|
||||
|
||||
/* the callback data */
|
||||
gsm_cbfn *cbfn;
|
||||
void *param;
|
||||
};
|
||||
|
||||
struct gsm_subscriber *subscr_get(struct gsm_subscriber *subscr);
|
||||
struct gsm_subscriber *subscr_put(struct gsm_subscriber *subscr);
|
||||
struct gsm_subscriber *subscr_create_subscriber(struct gsm_subscriber_group *sgrp,
|
||||
@@ -104,7 +118,8 @@ struct gsm_subscriber *subscr_get_by_id(struct gsm_subscriber_group *sgrp,
|
||||
unsigned long long id);
|
||||
struct gsm_subscriber *subscr_get_or_create(struct gsm_subscriber_group *sgrp,
|
||||
const char *imsi);
|
||||
int subscr_update(struct gsm_subscriber *s, struct gsm_bts *bts, int reason);
|
||||
int subscr_update(struct gsm_network *network, struct gsm_subscriber *s,
|
||||
uint16_t lac, int reason);
|
||||
struct gsm_subscriber *subscr_active_by_tmsi(struct gsm_subscriber_group *sgrp,
|
||||
uint32_t tmsi);
|
||||
struct gsm_subscriber *subscr_active_by_imsi(struct gsm_subscriber_group *sgrp,
|
||||
@@ -115,14 +130,18 @@ char *subscr_name(struct gsm_subscriber *subscr);
|
||||
int subscr_purge_inactive(struct gsm_subscriber_group *sgrp);
|
||||
void subscr_update_from_db(struct gsm_subscriber *subscr);
|
||||
void subscr_expire(struct gsm_subscriber_group *sgrp);
|
||||
int subscr_update_expire_lu(struct gsm_subscriber *subscr, struct gsm_bts *bts);
|
||||
int subscr_update_expire_lu(struct gsm_network *network, struct gsm_subscriber *subscr);
|
||||
|
||||
bool subscr_authorized(struct gsm_subscriber *subsc);
|
||||
|
||||
/*
|
||||
* Paging handling with authentication
|
||||
*/
|
||||
struct subscr_request *subscr_request_channel(struct gsm_subscriber *subscr,
|
||||
int type, gsm_cbfn *cbfn, void *param);
|
||||
struct subscr_request *subscr_request_conn(struct gsm_subscriber *subscr,
|
||||
gsm_cbfn *cbfn, void *param);
|
||||
void subscr_remove_request(struct subscr_request *req);
|
||||
int subscr_rx_paging_response(struct msgb *msg,
|
||||
struct gsm_subscriber_connection *conn);
|
||||
|
||||
/* internal */
|
||||
struct gsm_subscriber *subscr_alloc(void);
|
||||
|
||||
@@ -1,26 +0,0 @@
|
||||
#ifndef _GSM_SUP_H
|
||||
#define _GSM_SUP_H
|
||||
|
||||
#include <openbsc/debug.h>
|
||||
#include <openbsc/gsm_subscriber.h>
|
||||
#include <osmocom/gsm/gsm0480.h>
|
||||
#include <osmocom/gsm/protocol/gsm_04_11.h>
|
||||
|
||||
#define LOGGSUBSCRP(level, subscr, fmt, args...) \
|
||||
LOGP(DSUP, level, "SUBSCR(%s) " fmt, \
|
||||
(subscr) ? (subscr)->imsi : "---", \
|
||||
## args)
|
||||
|
||||
/* Callback for both HLR/auth and USSD SUP sockets */
|
||||
int sup_read_cb(struct gsup_client *sup_client, struct msgb *msg);
|
||||
|
||||
/*
|
||||
int subscr_query_auth_info(struct gsm_subscriber *subscr);
|
||||
*/
|
||||
int subscr_location_update(struct gsm_subscriber *subscr);
|
||||
int subscr_purge_ms(struct gsm_subscriber *subscr);
|
||||
|
||||
int subscr_tx_sms_message(struct gsm_subscriber *subscr,
|
||||
struct gsm411_rp_hdr *rph);
|
||||
|
||||
#endif /* _GSM_SUP_H */
|
||||
@@ -1,14 +0,0 @@
|
||||
#ifndef _GSM_USSD_MAP_H
|
||||
#define _GSM_USSD_MAP_H
|
||||
|
||||
#include <openbsc/gsup_client.h>
|
||||
#include <openbsc/gsm_subscriber.h>
|
||||
#include <openbsc/gsm_ussd_map_proto.h>
|
||||
|
||||
int ussd_map_read_cb(struct gsup_client *sup_client,
|
||||
struct msgb *msg);
|
||||
|
||||
int ussd_map_tx_message(struct gsm_network *net, struct ss_header *req,
|
||||
const char *extension, uint32_t ref, const uint8_t *component_data);
|
||||
|
||||
#endif /* _GSM_USSD_MAP_H */
|
||||
@@ -1,25 +0,0 @@
|
||||
#ifndef _GSM_USSD_MAP_PROTO_H
|
||||
#define _GSM_USSD_MAP_PROTO_H
|
||||
|
||||
#include <osmocom/gsm/gsm0480.h>
|
||||
|
||||
|
||||
enum {
|
||||
FMAP_MSISDN = 0x80
|
||||
};
|
||||
|
||||
int subscr_uss_message(struct msgb *msg,
|
||||
struct ss_header *req,
|
||||
const char* extension,
|
||||
uint32_t ref,
|
||||
const uint8_t *component_data);
|
||||
|
||||
int rx_uss_message_parse(const uint8_t* data,
|
||||
size_t len,
|
||||
struct ss_header *ss,
|
||||
uint32_t *ref,
|
||||
char* extention,
|
||||
size_t extention_len);
|
||||
|
||||
|
||||
#endif /* _GSM_USSD_MAP_PROTO_H */
|
||||
@@ -3,6 +3,9 @@
|
||||
|
||||
struct gsm_subscriber_connection;
|
||||
|
||||
/* Hand over the specified logical channel to the specified new BTS.
|
||||
* This is the main entry point for the actual handover algorithm,
|
||||
* after it has decided it wants to initiate HO to a specific BTS */
|
||||
int bsc_handover_start(struct gsm_lchan *old_lchan, struct gsm_bts *bts);
|
||||
|
||||
/* clear any operation for this connection */
|
||||
|
||||
@@ -11,7 +11,7 @@ struct RANAP_GlobalRNC_ID;
|
||||
|
||||
struct ue_conn_ctx {
|
||||
struct llist_head list;
|
||||
struct osmo_sccp_link *link;
|
||||
struct osmo_sua_link *link;
|
||||
uint32_t conn_id;
|
||||
int integrity_active;
|
||||
struct gprs_ra_id ra_id;
|
||||
@@ -47,16 +47,15 @@ typedef int (* iu_rab_ass_resp_cb_t )(struct ue_conn_ctx *ue_ctx, uint8_t rab_id
|
||||
int iu_init(void *ctx, const char *listen_addr, uint16_t listen_port,
|
||||
iu_recv_cb_t iu_recv_cb, iu_event_cb_t iu_event_cb);
|
||||
|
||||
void iu_link_del(struct osmo_sccp_link *link);
|
||||
void iu_link_del(struct osmo_sua_link *link);
|
||||
|
||||
int iu_tx(struct msgb *msg, uint8_t sapi);
|
||||
|
||||
int iu_page_cs(const char *imsi, const uint32_t *tmsi, uint16_t lac);
|
||||
int iu_page_ps(const char *imsi, const uint32_t *ptmsi, uint16_t lac, uint8_t rac);
|
||||
|
||||
int iu_rab_act(struct ue_conn_ctx *ue_ctx, struct msgb *msg);
|
||||
int iu_rab_act_cs(struct ue_conn_ctx *ue_ctx, uint32_t rtp_ip, uint16_t rtp_port);
|
||||
int iu_rab_act_ps(uint8_t rab_id, struct sgsn_pdp_ctx *pdp, bool use_x213_nsap);
|
||||
int iu_rab_deact(struct ue_conn_ctx *ue_ctx, uint8_t rab_id);
|
||||
int iu_tx_sec_mode_cmd(struct ue_conn_ctx *uectx, struct gsm_auth_tuple *tp,
|
||||
int send_ck, int new_key);
|
||||
|
||||
void iu_vty_init(int *asn_debug_p);
|
||||
|
||||
7
openbsc/include/openbsc/iu_cs.h
Normal file
7
openbsc/include/openbsc/iu_cs.h
Normal file
@@ -0,0 +1,7 @@
|
||||
#pragma once
|
||||
|
||||
int gsm0408_rcvmsg_iucs(struct gsm_network *network, struct msgb *msg,
|
||||
uint16_t *lac);
|
||||
|
||||
struct gsm_subscriber_connection *subscr_conn_lookup_iu(struct gsm_network *network,
|
||||
struct ue_conn_ctx *ue);
|
||||
29
openbsc/include/openbsc/msc_api.h
Normal file
29
openbsc/include/openbsc/msc_api.h
Normal file
@@ -0,0 +1,29 @@
|
||||
#pragma once
|
||||
|
||||
/* These functions receive or send MM|CC|... messages from/to the BSC|RNC
|
||||
* direction, while they are not concerned with which particular external
|
||||
* interface is actually involved (A or IuCS).
|
||||
*
|
||||
* For the interface specific decisions see msc_iface.[hc]
|
||||
*/
|
||||
|
||||
/* MSCSPLIT WIP: this will gradually replace the role that the bsc_api.h had in
|
||||
* OsmoNITB. Actually, osmo_msc.[hc] has the same role as this file, but having
|
||||
* separate files helps me to keep track of how far I've gotten yet. */
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
struct gsm_subscriber_connection;
|
||||
struct msgb;
|
||||
|
||||
enum {
|
||||
MSC_CONN_ACCEPT = 0,
|
||||
MSC_CONN_REJECT = 1,
|
||||
};
|
||||
|
||||
/* receive a Level 3 Complete message and return MSC_CONN_ACCEPT or
|
||||
* MSC_CONN_REJECT */
|
||||
int msc_compl_l3(struct gsm_subscriber_connection *conn, struct msgb *msg,
|
||||
uint16_t chosen_channel);
|
||||
/* TODO: is chosen_channel BSC land == NITB legacy? */
|
||||
|
||||
40
openbsc/include/openbsc/msc_ifaces.h
Normal file
40
openbsc/include/openbsc/msc_ifaces.h
Normal file
@@ -0,0 +1,40 @@
|
||||
#pragma once
|
||||
|
||||
#include <osmocom/core/msgb.h>
|
||||
#include <openbsc/gsm_data.h>
|
||||
|
||||
/* These are the interfaces of the MSC layer towards (from?) the BSC and RNC,
|
||||
* i.e. in the direction towards the mobile device (MS aka UE).
|
||||
*
|
||||
* 2G will use the A-interface,
|
||||
* 3G aka UMTS will use the Iu-interface (for the MSC, it's IuCS).
|
||||
*
|
||||
* To allow linking parts of the MSC code without having to include entire
|
||||
* infrastructures of external libraries, the core transmitting and receiving
|
||||
* functions are left unimplemented. For example, a unit test does not need to
|
||||
* link against external ASN1 libraries if it is never going to encode actual
|
||||
* outgoing messages. It is up to each building scope to implement real world
|
||||
* functions or to plug mere dummy implementations.
|
||||
*
|
||||
* For example, msc_tx_dtap(conn, msg), depending on conn->via_iface, will call
|
||||
* either iu_tx() or a_tx() [note: at time of writing, the A-interface is not
|
||||
* yet implemented]. When you try to link against libmsc, you will find that
|
||||
* the compiler complains about an undefined reference to iu_tx(). If you,
|
||||
* however, link against libiu as well as the osmo-iuh libs (etc.), iu_tx() is
|
||||
* available. A unit test may instead simply implement a dummy iu_tx() function
|
||||
* and not link against osmo-iuh.
|
||||
*/
|
||||
|
||||
/* Each main linkage must implement this function (see comment above). */
|
||||
extern int iu_tx(struct msgb *msg, uint8_t sapi);
|
||||
|
||||
/* So far this is a dummy implemented in libmsc/a_iface.c. When A-interface
|
||||
* gets implemented, it should be in a separate lib (like libiu), this function
|
||||
* should move there, and the following comment should remain here: "
|
||||
* Each main linkage must implement this function (see comment above).
|
||||
* " */
|
||||
extern int a_tx(struct msgb *msg);
|
||||
|
||||
int msc_tx_dtap(struct gsm_subscriber_connection *conn,
|
||||
struct msgb *msg);
|
||||
|
||||
@@ -27,10 +27,9 @@
|
||||
struct msgb;
|
||||
struct osmo_oap_message;
|
||||
|
||||
/* This is the config part for vty. It is essentially copied in
|
||||
* oap_client_state, where values are copied over once the config is
|
||||
* considered valid. */
|
||||
struct oap_client_config {
|
||||
/* This is the config part for vty. It is essentially copied in oap_state,
|
||||
* where values are copied over once the config is considered valid. */
|
||||
struct oap_config {
|
||||
uint16_t client_id;
|
||||
int secret_k_present;
|
||||
uint8_t secret_k[16];
|
||||
@@ -39,10 +38,9 @@ struct oap_client_config {
|
||||
};
|
||||
|
||||
/* The runtime state of the OAP client. client_id and the secrets are in fact
|
||||
* duplicated from oap_client_config, so that a separate validation of the
|
||||
* config data is possible, and so that only a struct oap_client_state* is
|
||||
* passed around. */
|
||||
struct oap_client_state {
|
||||
* duplicated from oap_config, so that a separate validation of the config data
|
||||
* is possible, and so that only a struct oap_state* is passed around. */
|
||||
struct oap_state {
|
||||
enum {
|
||||
OAP_UNINITIALIZED = 0, /* just allocated. */
|
||||
OAP_DISABLED, /* disabled by config. */
|
||||
@@ -58,25 +56,23 @@ struct oap_client_state {
|
||||
};
|
||||
|
||||
/* From config, initialize state. Return 0 on success. */
|
||||
int oap_client_init(struct oap_client_config *config,
|
||||
struct oap_client_state *state);
|
||||
int oap_init(struct oap_config *config, struct oap_state *state);
|
||||
|
||||
/* Construct an OAP registration message and return in *msg_tx. Use
|
||||
* state->client_id and update state->state.
|
||||
* Return 0 on success, or a negative value on error.
|
||||
* If an error is returned, *msg_tx is guaranteed to be NULL. */
|
||||
int oap_client_register(struct oap_client_state *state, struct msgb **msg_tx);
|
||||
int oap_register(struct oap_state *state, struct msgb **msg_tx);
|
||||
|
||||
/* Decode and act on a received OAP message msg_rx. Update state->state. If a
|
||||
* non-NULL pointer is returned in *msg_tx, that msgb should be sent to the OAP
|
||||
* server (and freed) by the caller. The received msg_rx is not freed.
|
||||
* Return 0 on success, or a negative value on error.
|
||||
* If an error is returned, *msg_tx is guaranteed to be NULL. */
|
||||
int oap_client_handle(struct oap_client_state *state,
|
||||
const struct msgb *msg_rx, struct msgb **msg_tx);
|
||||
int oap_handle(struct oap_state *state, const struct msgb *msg_rx, struct msgb **msg_tx);
|
||||
|
||||
/* Allocate a msgb and in it, return the encoded oap_msg. Return NULL on
|
||||
* error. (Like oap_encode(), but also allocates a msgb.)
|
||||
* About the name: the idea is do_something(oap_encoded(my_struct)) */
|
||||
struct msgb *oap_encoded(const struct osmo_oap_message *oap_msg);
|
||||
|
||||
/* Allocate a msgb and in it, return the encoded oap_client_msg. Return
|
||||
* NULL on error. (Like oap_client_encode(), but also allocates a msgb.)
|
||||
* About the name: the idea is do_something(oap_client_encoded(my_struct))
|
||||
*/
|
||||
struct msgb *oap_client_encoded(const struct osmo_oap_message *oap_client_msg);
|
||||
70
openbsc/include/openbsc/oap_messages.h
Normal file
70
openbsc/include/openbsc/oap_messages.h
Normal file
@@ -0,0 +1,70 @@
|
||||
/* Osmocom Authentication Protocol message encoder/decoder */
|
||||
|
||||
/* (C) 2015 by Sysmocom s.f.m.c. GmbH
|
||||
* All Rights Reserved
|
||||
*
|
||||
* Author: Neels Hofmeyr
|
||||
*
|
||||
* 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/>.
|
||||
*
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
#include <stdint.h>
|
||||
#include <osmocom/core/msgb.h>
|
||||
#include <osmocom/gsm/protocol/gsm_04_08_gprs.h>
|
||||
|
||||
/* Some numbers are out of sequence because (so far) they match gprs_gsup_iei.
|
||||
*/
|
||||
enum oap_iei {
|
||||
OAP_CAUSE_IE = 0x02,
|
||||
OAP_RAND_IE = 0x20,
|
||||
OAP_AUTN_IE = 0x23,
|
||||
OAP_XRES_IE = 0x24,
|
||||
OAP_AUTS_IE = 0x25,
|
||||
OAP_CLIENT_ID_IE = 0x30,
|
||||
};
|
||||
|
||||
enum osmo_oap_message_type {
|
||||
OAP_MSGT_REGISTER_REQUEST = 0b00000100,
|
||||
OAP_MSGT_REGISTER_ERROR = 0b00000101,
|
||||
OAP_MSGT_REGISTER_RESULT = 0b00000110,
|
||||
|
||||
OAP_MSGT_CHALLENGE_REQUEST = 0b00001000,
|
||||
OAP_MSGT_CHALLENGE_ERROR = 0b00001001,
|
||||
OAP_MSGT_CHALLENGE_RESULT = 0b00001010,
|
||||
|
||||
OAP_MSGT_SYNC_REQUEST = 0b00001100,
|
||||
OAP_MSGT_SYNC_ERROR = 0b00001101,
|
||||
OAP_MSGT_SYNC_RESULT = 0b00001110,
|
||||
};
|
||||
|
||||
struct osmo_oap_message {
|
||||
enum osmo_oap_message_type message_type;
|
||||
enum gsm48_gmm_cause cause;
|
||||
uint16_t client_id;
|
||||
int rand_present;
|
||||
uint8_t rand[16];
|
||||
int autn_present;
|
||||
uint8_t autn[16];
|
||||
int xres_present;
|
||||
uint8_t xres[8];
|
||||
int auts_present;
|
||||
uint8_t auts[16];
|
||||
};
|
||||
|
||||
int osmo_oap_decode(struct osmo_oap_message *oap_msg,
|
||||
const uint8_t *data, size_t data_len);
|
||||
void osmo_oap_encode(struct msgb *msg, const struct osmo_oap_message *oap_msg);
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
#ifndef OSMO_BSC_GRACE_H
|
||||
#define OSMO_BSC_GRACE_H
|
||||
|
||||
#include <openbsc/gsm_data.h>
|
||||
#include "gsm_data.h"
|
||||
|
||||
struct osmo_msc_data;
|
||||
|
||||
|
||||
@@ -28,7 +28,6 @@ int osmux_used_cid(void);
|
||||
|
||||
enum osmux_state {
|
||||
OSMUX_STATE_DISABLED = 0,
|
||||
OSMUX_STATE_NEGOTIATING,
|
||||
OSMUX_STATE_ACTIVATING,
|
||||
OSMUX_STATE_ENABLED,
|
||||
};
|
||||
|
||||
@@ -24,11 +24,10 @@
|
||||
#include <string.h>
|
||||
|
||||
#include <osmocom/core/linuxlist.h>
|
||||
#include "gsm_data.h"
|
||||
#include "gsm_subscriber.h"
|
||||
#include <osmocom/core/timer.h>
|
||||
|
||||
#include <openbsc/gsm_data.h>
|
||||
#include <openbsc/gsm_subscriber.h>
|
||||
|
||||
/**
|
||||
* A pending paging request
|
||||
*/
|
||||
|
||||
@@ -1,15 +0,0 @@
|
||||
#ifndef _REG_PROXY_H
|
||||
#define _REG_PROXY_H
|
||||
|
||||
#include <openbsc/sup_server.h>
|
||||
#include <openbsc/sip_client.h>
|
||||
#include <osip2/osip.h>
|
||||
void *tall_reg_ctx;
|
||||
|
||||
struct reg_proxy {
|
||||
struct gsm_sup_server *sup_server;
|
||||
struct sip_client *sip_client;
|
||||
osip_t *osip;
|
||||
};
|
||||
|
||||
#endif /* _REG_PROXY_H */
|
||||
@@ -12,7 +12,6 @@
|
||||
int rest_octets_si1(uint8_t *data, uint8_t *nch_pos, int is1800_net);
|
||||
int rest_octets_si2quater(uint8_t *data, const struct osmo_earfcn_si2q *e,
|
||||
const uint16_t *u, const uint16_t *sc, size_t u_len);
|
||||
int rest_octets_si6(uint8_t *data, bool is1800_net);
|
||||
|
||||
struct gsm48_si_selection_params {
|
||||
uint16_t penalty_time:5,
|
||||
@@ -88,8 +87,6 @@ struct gprs_cell_options {
|
||||
uint32_t t3192; /* in milliseconds */
|
||||
uint32_t drx_timer_max;/* in seconds */
|
||||
uint32_t bs_cv_max;
|
||||
uint8_t supports_egprs_11bit_rach;
|
||||
bool ctrl_ack_type_use_block; /* use PACKET CONTROL ACKNOWLEDGMENT */
|
||||
|
||||
uint8_t ext_info_present;
|
||||
struct {
|
||||
|
||||
@@ -3,10 +3,10 @@
|
||||
|
||||
|
||||
#include <osmocom/core/msgb.h>
|
||||
#include <osmocom/crypt/gprs_cipher.h>
|
||||
|
||||
#include <osmocom/gprs/gprs_ns.h>
|
||||
#include <openbsc/gprs_sgsn.h>
|
||||
#include <openbsc/oap_client.h>
|
||||
#include <openbsc/oap.h>
|
||||
|
||||
#include <ares.h>
|
||||
|
||||
@@ -20,34 +20,6 @@ enum sgsn_auth_policy {
|
||||
SGSN_AUTH_POLICY_REMOTE
|
||||
};
|
||||
|
||||
|
||||
enum sgsn_rate_ctr_keys {
|
||||
CTR_LLC_DL_BYTES,
|
||||
CTR_LLC_UL_BYTES,
|
||||
CTR_LLC_DL_PACKETS,
|
||||
CTR_LLC_UL_PACKETS,
|
||||
CTR_GPRS_ATTACH_REQUEST,
|
||||
CTR_GPRS_ATTACH_ACKED,
|
||||
CTR_GPRS_ATTACH_REJECTED,
|
||||
CTR_GPRS_DETACH_REQUEST,
|
||||
CTR_GPRS_DETACH_ACKED,
|
||||
CTR_GPRS_ROUTING_AREA_REQUEST,
|
||||
CTR_GPRS_ROUTING_AREA_ACKED,
|
||||
CTR_GPRS_ROUTING_AREA_REJECT,
|
||||
/* PDP single packet counter / GSM 04.08 9.5.1 - 9.5.9 */
|
||||
CTR_PDP_ACTIVATE_REQUEST,
|
||||
CTR_PDP_ACTIVATE_REJECT,
|
||||
CTR_PDP_ACTIVATE_ACCEPT,
|
||||
CTR_PDP_REQUEST_ACTIVATE, /* unused */
|
||||
CTR_PDP_REQUEST_ACTIVATE_REJ, /* unused */
|
||||
CTR_PDP_MODIFY_REQUEST, /* unsued */
|
||||
CTR_PDP_MODIFY_ACCEPT, /* unused */
|
||||
CTR_PDP_DL_DEACTIVATE_REQUEST,
|
||||
CTR_PDP_DL_DEACTIVATE_ACCEPT,
|
||||
CTR_PDP_UL_DEACTIVATE_REQUEST,
|
||||
CTR_PDP_UL_DEACTIVATE_ACCEPT,
|
||||
};
|
||||
|
||||
struct sgsn_cdr {
|
||||
char *filename;
|
||||
int interval;
|
||||
@@ -63,7 +35,6 @@ struct sgsn_config {
|
||||
struct gprs_ns_inst *nsi;
|
||||
|
||||
enum sgsn_auth_policy auth_policy;
|
||||
enum gprs_ciph_algo cipher;
|
||||
struct llist_head imsi_acl;
|
||||
|
||||
struct sockaddr_in gsup_server_addr;
|
||||
@@ -92,23 +63,7 @@ struct sgsn_config {
|
||||
|
||||
int dynamic_lookup;
|
||||
|
||||
struct oap_client_config oap;
|
||||
|
||||
/* RFC1144 TCP/IP header compression */
|
||||
struct {
|
||||
int active;
|
||||
int passive;
|
||||
int s01;
|
||||
} pcomp_rfc1144;
|
||||
|
||||
/* V.42vis data compression */
|
||||
struct {
|
||||
int active;
|
||||
int passive;
|
||||
int p0;
|
||||
int p1;
|
||||
int p2;
|
||||
} dcomp_v42bis;
|
||||
struct oap_config oap;
|
||||
};
|
||||
|
||||
struct sgsn_instance {
|
||||
@@ -123,7 +78,7 @@ struct sgsn_instance {
|
||||
/* GSN instance for libgtp */
|
||||
struct gsn_t *gsn;
|
||||
/* Subscriber */
|
||||
struct gsup_client *gsup_client;
|
||||
struct gprs_gsup_client *gsup_client;
|
||||
/* LLME inactivity timer */
|
||||
struct osmo_timer_list llme_timer;
|
||||
|
||||
@@ -132,8 +87,6 @@ struct sgsn_instance {
|
||||
struct llist_head ares_fds;
|
||||
ares_channel ares_channel;
|
||||
struct ares_addr_node *ares_servers;
|
||||
|
||||
struct rate_ctr_group *rate_ctrs;
|
||||
};
|
||||
|
||||
extern struct sgsn_instance *sgsn;
|
||||
@@ -154,7 +107,6 @@ struct sgsn_pdp_ctx *sgsn_create_pdp_ctx(struct sgsn_ggsn_ctx *ggsn,
|
||||
uint16_t nsapi,
|
||||
struct tlv_parsed *tp);
|
||||
int sgsn_delete_pdp_ctx(struct sgsn_pdp_ctx *pctx);
|
||||
void sgsn_pdp_upd_gtp_u(struct sgsn_pdp_ctx *pdp, void *addr, size_t alen);
|
||||
|
||||
/* gprs_sndcp.c */
|
||||
|
||||
|
||||
@@ -142,7 +142,6 @@ struct gsm_subscriber;
|
||||
|
||||
struct paging_signal_data {
|
||||
struct gsm_subscriber *subscr;
|
||||
struct gsm_bts *bts;
|
||||
|
||||
int paging_result;
|
||||
|
||||
|
||||
@@ -1,16 +0,0 @@
|
||||
#ifndef _SIP_H
|
||||
#define _SIP_H
|
||||
|
||||
#include <openbsc/sip_client.h>
|
||||
#include <openbsc/reg_proxy.h>
|
||||
#include <osip2/osip.h>
|
||||
#include <osmocom/gsm/gsm0480.h>
|
||||
|
||||
int tx_ss_handle(struct sip_client *sip_client, osip_t *osip, struct ss_request *ss,
|
||||
const char *extention);
|
||||
|
||||
int tx_sip_register(struct sip_client *sip_client, osip_t *osip, char *imsi, int expires_time);
|
||||
|
||||
int sip_client_init(struct reg_proxy *reg, const char *src_ip, u_int16_t src_port,
|
||||
const char *dst_ip, u_int16_t dst_port, int expires_time);
|
||||
#endif /* _SIP_H */
|
||||
@@ -1,36 +0,0 @@
|
||||
#pragma once
|
||||
|
||||
#include <osmocom/core/timer.h>
|
||||
|
||||
#define SIP_RECONNECT_INTERVAL 10
|
||||
|
||||
struct msgb;
|
||||
struct ipa_client_conn;
|
||||
struct sip_client;
|
||||
|
||||
/* Expects message in msg->l2h */
|
||||
typedef int (*sip_read_cb_t)(struct sip_client *sip_client, struct msgb *msg);
|
||||
|
||||
struct sip_client {
|
||||
struct tcp_client_conn *link;
|
||||
sip_read_cb_t read_cb;
|
||||
void *data;
|
||||
|
||||
struct osmo_timer_list connect_timer;
|
||||
int is_connected;
|
||||
|
||||
char *src_ip;
|
||||
char *dst_ip;
|
||||
u_int16_t src_port;
|
||||
u_int16_t dst_port;
|
||||
int expires_time;
|
||||
};
|
||||
|
||||
struct sip_client *sip_client_create(const char *src_ip, u_int16_t src_port,
|
||||
const char *dst_ip, u_int16_t dst_port,
|
||||
int expires_time, sip_read_cb_t read_cb,
|
||||
void *data);
|
||||
|
||||
void sip_client_destroy(struct sip_client *sip_client);
|
||||
int sip_client_send(struct sip_client *sip_client, struct msgb *msg);
|
||||
struct msgb *sip_msgb_alloc(void);
|
||||
@@ -1,187 +0,0 @@
|
||||
#ifndef _SLHC_H
|
||||
#define _SLHC_H
|
||||
/*
|
||||
* Definitions for tcp compression routines.
|
||||
*
|
||||
* $Header: slcompress.h,v 1.10 89/12/31 08:53:02 van Exp $
|
||||
*
|
||||
* Copyright (c) 1989 Regents of the University of California.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms are permitted
|
||||
* provided that the above copyright notice and this paragraph are
|
||||
* duplicated in all such forms and that any documentation,
|
||||
* advertising materials, and other materials related to such
|
||||
* distribution and use acknowledge that the software was developed
|
||||
* by the University of California, Berkeley. The name of the
|
||||
* University may not be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
|
||||
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
*
|
||||
* Van Jacobson (van@helios.ee.lbl.gov), Dec 31, 1989:
|
||||
* - Initial distribution.
|
||||
*
|
||||
*
|
||||
* modified for KA9Q Internet Software Package by
|
||||
* Katie Stevens (dkstevens@ucdavis.edu)
|
||||
* University of California, Davis
|
||||
* Computing Services
|
||||
* - 01-31-90 initial adaptation
|
||||
*
|
||||
* - Feb 1991 Bill_Simpson@um.cc.umich.edu
|
||||
* variable number of conversation slots
|
||||
* allow zero or one slots
|
||||
* separate routines
|
||||
* status display
|
||||
*/
|
||||
|
||||
/*
|
||||
* Compressed packet format:
|
||||
*
|
||||
* The first octet contains the packet type (top 3 bits), TCP
|
||||
* 'push' bit, and flags that indicate which of the 4 TCP sequence
|
||||
* numbers have changed (bottom 5 bits). The next octet is a
|
||||
* conversation number that associates a saved IP/TCP header with
|
||||
* the compressed packet. The next two octets are the TCP checksum
|
||||
* from the original datagram. The next 0 to 15 octets are
|
||||
* sequence number changes, one change per bit set in the header
|
||||
* (there may be no changes and there are two special cases where
|
||||
* the receiver implicitly knows what changed -- see below).
|
||||
*
|
||||
* There are 5 numbers which can change (they are always inserted
|
||||
* in the following order): TCP urgent pointer, window,
|
||||
* acknowledgment, sequence number and IP ID. (The urgent pointer
|
||||
* is different from the others in that its value is sent, not the
|
||||
* change in value.) Since typical use of SLIP links is biased
|
||||
* toward small packets (see comments on MTU/MSS below), changes
|
||||
* use a variable length coding with one octet for numbers in the
|
||||
* range 1 - 255 and 3 octets (0, MSB, LSB) for numbers in the
|
||||
* range 256 - 65535 or 0. (If the change in sequence number or
|
||||
* ack is more than 65535, an uncompressed packet is sent.)
|
||||
*/
|
||||
|
||||
/*
|
||||
* Packet types (must not conflict with IP protocol version)
|
||||
*
|
||||
* The top nibble of the first octet is the packet type. There are
|
||||
* three possible types: IP (not proto TCP or tcp with one of the
|
||||
* control flags set); uncompressed TCP (a normal IP/TCP packet but
|
||||
* with the 8-bit protocol field replaced by an 8-bit connection id --
|
||||
* this type of packet syncs the sender & receiver); and compressed
|
||||
* TCP (described above).
|
||||
*
|
||||
* LSB of 4-bit field is TCP "PUSH" bit (a worthless anachronism) and
|
||||
* is logically part of the 4-bit "changes" field that follows. Top
|
||||
* three bits are actual packet type. For backward compatibility
|
||||
* and in the interest of conserving bits, numbers are chosen so the
|
||||
* IP protocol version number (4) which normally appears in this nibble
|
||||
* means "IP packet".
|
||||
*/
|
||||
|
||||
|
||||
#include <linux/ip.h>
|
||||
#include <linux/tcp.h>
|
||||
|
||||
/* SLIP compression masks for len/vers byte */
|
||||
#define SL_TYPE_IP 0x40
|
||||
#define SL_TYPE_UNCOMPRESSED_TCP 0x70
|
||||
#define SL_TYPE_COMPRESSED_TCP 0x80
|
||||
#define SL_TYPE_ERROR 0x00
|
||||
|
||||
/* Bits in first octet of compressed packet */
|
||||
#define NEW_C 0x40 /* flag bits for what changed in a packet */
|
||||
#define NEW_I 0x20
|
||||
#define NEW_S 0x08
|
||||
#define NEW_A 0x04
|
||||
#define NEW_W 0x02
|
||||
#define NEW_U 0x01
|
||||
|
||||
/* reserved, special-case values of above */
|
||||
#define SPECIAL_I (NEW_S|NEW_W|NEW_U) /* echoed interactive traffic */
|
||||
#define SPECIAL_D (NEW_S|NEW_A|NEW_W|NEW_U) /* unidirectional data */
|
||||
#define SPECIALS_MASK (NEW_S|NEW_A|NEW_W|NEW_U)
|
||||
|
||||
#define TCP_PUSH_BIT 0x10
|
||||
|
||||
/*
|
||||
* data type and sizes conversion assumptions:
|
||||
*
|
||||
* VJ code KA9Q style generic
|
||||
* u_char byte_t unsigned char 8 bits
|
||||
* u_short int16 unsigned short 16 bits
|
||||
* u_int int16 unsigned short 16 bits
|
||||
* u_long unsigned long unsigned long 32 bits
|
||||
* int int32 long 32 bits
|
||||
*/
|
||||
|
||||
typedef __u8 byte_t;
|
||||
typedef __u32 int32;
|
||||
|
||||
/*
|
||||
* "state" data for each active tcp conversation on the wire. This is
|
||||
* basically a copy of the entire IP/TCP header from the last packet
|
||||
* we saw from the conversation together with a small identifier
|
||||
* the transmit & receive ends of the line use to locate saved header.
|
||||
*/
|
||||
struct cstate {
|
||||
byte_t cs_this; /* connection id number (xmit) */
|
||||
struct cstate *next; /* next in ring (xmit) */
|
||||
struct iphdr cs_ip; /* ip/tcp hdr from most recent packet */
|
||||
struct tcphdr cs_tcp;
|
||||
unsigned char cs_ipopt[64];
|
||||
unsigned char cs_tcpopt[64];
|
||||
int cs_hsize;
|
||||
};
|
||||
#define NULLSLSTATE (struct cstate *)0
|
||||
|
||||
/*
|
||||
* all the state data for one serial line (we need one of these per line).
|
||||
*/
|
||||
struct slcompress {
|
||||
struct cstate *tstate; /* transmit connection states (array)*/
|
||||
struct cstate *rstate; /* receive connection states (array)*/
|
||||
|
||||
byte_t tslot_limit; /* highest transmit slot id (0-l)*/
|
||||
byte_t rslot_limit; /* highest receive slot id (0-l)*/
|
||||
|
||||
byte_t xmit_oldest; /* oldest xmit in ring */
|
||||
byte_t xmit_current; /* most recent xmit id */
|
||||
byte_t recv_current; /* most recent rcvd id */
|
||||
|
||||
byte_t flags;
|
||||
#define SLF_TOSS 0x01 /* tossing rcvd frames until id received */
|
||||
|
||||
int32 sls_o_nontcp; /* outbound non-TCP packets */
|
||||
int32 sls_o_tcp; /* outbound TCP packets */
|
||||
int32 sls_o_uncompressed; /* outbound uncompressed packets */
|
||||
int32 sls_o_compressed; /* outbound compressed packets */
|
||||
int32 sls_o_searches; /* searches for connection state */
|
||||
int32 sls_o_misses; /* times couldn't find conn. state */
|
||||
|
||||
int32 sls_i_uncompressed; /* inbound uncompressed packets */
|
||||
int32 sls_i_compressed; /* inbound compressed packets */
|
||||
int32 sls_i_error; /* inbound error packets */
|
||||
int32 sls_i_tossed; /* inbound packets tossed because of error */
|
||||
|
||||
int32 sls_i_runt;
|
||||
int32 sls_i_badcheck;
|
||||
};
|
||||
#define NULLSLCOMPR (struct slcompress *)0
|
||||
|
||||
/* In slhc.c: */
|
||||
struct slcompress *slhc_init(const void *ctx, int rslots, int tslots);
|
||||
|
||||
void slhc_free(struct slcompress *comp);
|
||||
|
||||
int slhc_compress(struct slcompress *comp, unsigned char *icp, int isize,
|
||||
unsigned char *ocp, unsigned char **cpp, int compress_cid);
|
||||
int slhc_uncompress(struct slcompress *comp, unsigned char *icp, int isize);
|
||||
int slhc_remember(struct slcompress *comp, unsigned char *icp, int isize);
|
||||
int slhc_toss(struct slcompress *comp);
|
||||
|
||||
void slhc_i_status(struct slcompress *comp);
|
||||
void slhc_o_status(struct slcompress *comp);
|
||||
|
||||
#endif /* _SLHC_H */
|
||||
@@ -1,19 +0,0 @@
|
||||
#ifndef _SUP_H
|
||||
#define _SUP_H
|
||||
|
||||
#include <openbsc/reg_proxy.h>
|
||||
|
||||
#define LOGGSUPP(level, sup, fmt, args...) \
|
||||
LOGP(DGPRS, level, "SUP(%s) " fmt, \
|
||||
(sup)->imsi, \
|
||||
## args)
|
||||
|
||||
int sup_server_init(struct reg_proxy *reg);
|
||||
|
||||
int handle_location_update_result(struct gsm_sup_server *sup_server,
|
||||
char *imsi, char *msisdn);
|
||||
|
||||
int handle_purge_ms_result(struct gsm_sup_server *sup_server,
|
||||
char *imsi);
|
||||
|
||||
#endif /* _SUP_H */
|
||||
@@ -1,29 +0,0 @@
|
||||
#ifndef _SUP_SERVER_H
|
||||
#define _SUP_SERVER_H
|
||||
|
||||
#include <osmocom/abis/ipa.h>
|
||||
|
||||
//struct msgb;
|
||||
struct ipa_server_conn;
|
||||
struct gsm_sup_server;
|
||||
|
||||
/* Expects message in msg->l2h */
|
||||
typedef int (*sup_read_cb_t)(struct gsm_sup_server *sup_server, struct msgb *msg);
|
||||
|
||||
struct gsm_sup_server {
|
||||
struct ipa_server_link *link;
|
||||
sup_read_cb_t read_cb;
|
||||
void *data;
|
||||
struct osmo_fd fd;
|
||||
struct ipa_server_conn *server_conn;
|
||||
void *app;
|
||||
};
|
||||
|
||||
struct gsm_sup_server *sup_server_create(const char *ip_addr,
|
||||
unsigned int tcp_port,
|
||||
sup_read_cb_t read_cb,
|
||||
void *app);
|
||||
|
||||
int sup_server_send(struct gsm_sup_server *sup_server, struct msgb *msg);
|
||||
|
||||
#endif /* _SUP_SERVER_H */
|
||||
@@ -3,17 +3,14 @@
|
||||
|
||||
#include <osmocom/gsm/sysinfo.h>
|
||||
|
||||
#include <openbsc/arfcn_range_encode.h>
|
||||
|
||||
struct gsm_bts;
|
||||
|
||||
int gsm_generate_si(struct gsm_bts *bts, enum osmo_sysinfo_type type);
|
||||
uint16_t encode_fdd(uint16_t scramble, bool diversity);
|
||||
unsigned uarfcn_size(const uint16_t *u, const uint16_t *sc, size_t u_len);
|
||||
unsigned earfcn_size(const struct osmo_earfcn_si2q *e);
|
||||
unsigned range1024_p(unsigned n);
|
||||
unsigned range512_q(unsigned m);
|
||||
int range_encode(enum gsm48_range r, int *arfcns, int arfcns_used, int *w,
|
||||
int f0, uint8_t *chan_list);
|
||||
bool si2q_size_check(const struct gsm_bts *bts);
|
||||
int bts_uarfcn_del(struct gsm_bts *bts, uint16_t arfcn, uint16_t scramble);
|
||||
int bts_uarfcn_add(struct gsm_bts *bts, uint16_t arfcn, uint16_t scramble,
|
||||
|
||||
@@ -1,51 +0,0 @@
|
||||
#ifndef _TCP_CLIENT_H_
|
||||
#define _TCP_CLIENT_H_
|
||||
|
||||
#include <stdint.h>
|
||||
#include <osmocom/core/linuxlist.h>
|
||||
#include <osmocom/core/timer.h>
|
||||
#include <osmocom/core/select.h>
|
||||
|
||||
|
||||
struct msgb;
|
||||
|
||||
enum tcp_client_conn_state {
|
||||
TCP_CLIENT_LINK_STATE_NONE = 0,
|
||||
TCP_CLIENT_LINK_STATE_CONNECTING = 1,
|
||||
TCP_CLIENT_LINK_STATE_CONNECTED = 2,
|
||||
TCP_CLIENT_LINK_STATE_MAX
|
||||
};
|
||||
|
||||
struct tcp_client_conn {
|
||||
struct osmo_fd *ofd;
|
||||
struct llist_head tx_queue;
|
||||
struct osmo_timer_list timer;
|
||||
enum tcp_client_conn_state state;
|
||||
const char *src_addr;
|
||||
uint16_t src_port;
|
||||
const char *dst_addr;
|
||||
uint16_t dst_port;
|
||||
void (*updown_cb)(struct tcp_client_conn *link, int up);
|
||||
int (*read_cb)(struct tcp_client_conn *link, struct msgb *msg);
|
||||
int (*write_cb)(struct tcp_client_conn *link);
|
||||
void *data;
|
||||
struct msgb *pending_msg;
|
||||
};
|
||||
|
||||
struct tcp_client_conn *
|
||||
tcp_client_conn_create(void *ctx, int priv_nr,
|
||||
const char *dst_addr, uint16_t dst_port,
|
||||
const char *src_addr, uint16_t src_port,
|
||||
void (*updown)(struct tcp_client_conn *link, int),
|
||||
int (*read_cb)(struct tcp_client_conn *link, struct msgb *msgb),
|
||||
int (*write_cb)(struct tcp_client_conn *link),
|
||||
void *data);
|
||||
void tcp_client_conn_destroy(struct tcp_client_conn *link);
|
||||
|
||||
int tcp_client_conn_open(struct tcp_client_conn *link);
|
||||
void tcp_client_conn_close(struct tcp_client_conn *link);
|
||||
|
||||
void tcp_client_conn_send(struct tcp_client_conn *link, struct msgb *msg);
|
||||
size_t tcp_client_conn_clear_queue(struct tcp_client_conn *link);
|
||||
|
||||
#endif
|
||||
@@ -14,7 +14,7 @@ struct gsm_trans {
|
||||
/* Entry in list of all transactions */
|
||||
struct llist_head entry;
|
||||
|
||||
/* Back pointer to the network struct */
|
||||
/* Back pointer to the netweork struct */
|
||||
struct gsm_network *net;
|
||||
|
||||
/* The protocol within which we live */
|
||||
@@ -22,7 +22,7 @@ struct gsm_trans {
|
||||
|
||||
/* The current transaction ID */
|
||||
uint8_t transaction_id;
|
||||
|
||||
|
||||
/* To whom we belong, unique identifier of remote MM entity */
|
||||
struct gsm_subscriber *subscr;
|
||||
|
||||
@@ -32,11 +32,6 @@ struct gsm_trans {
|
||||
/* reference from MNCC or other application */
|
||||
uint32_t callref;
|
||||
|
||||
/* SMS RP message reference */
|
||||
uint8_t msg_ref;
|
||||
/* handle SMS local */
|
||||
uint8_t sms_local;
|
||||
|
||||
/* if traffic channel receive was requested */
|
||||
int tch_recv;
|
||||
|
||||
@@ -61,11 +56,6 @@ struct gsm_trans {
|
||||
|
||||
struct gsm_sms *sms;
|
||||
} sms;
|
||||
struct {
|
||||
uint8_t invoke_id;
|
||||
uint8_t mo;
|
||||
uint8_t dirty;
|
||||
} ss;
|
||||
};
|
||||
};
|
||||
|
||||
@@ -75,8 +65,6 @@ struct gsm_trans *trans_find_by_id(struct gsm_subscriber_connection *conn,
|
||||
uint8_t proto, uint8_t trans_id);
|
||||
struct gsm_trans *trans_find_by_callref(struct gsm_network *net,
|
||||
uint32_t callref);
|
||||
struct gsm_trans *trans_find_by_msgref(struct gsm_subscriber_connection *conn,
|
||||
uint8_t msg_ref);
|
||||
|
||||
struct gsm_trans *trans_alloc(struct gsm_network *net,
|
||||
struct gsm_subscriber *subscr,
|
||||
|
||||
@@ -5,19 +5,6 @@
|
||||
|
||||
#include <osmocom/core/msgb.h>
|
||||
|
||||
#define USSD_MO 1
|
||||
#define USSD_MT 0
|
||||
|
||||
int handle_rcv_ussd(struct gsm_subscriber_connection *conn, struct msgb *msg);
|
||||
|
||||
|
||||
int on_ussd_response(struct gsm_network *net,
|
||||
uint32_t ref,
|
||||
struct ss_header *reqhdr,
|
||||
const uint8_t *component,
|
||||
const char* extention);
|
||||
|
||||
|
||||
void _ussd_trans_free(struct gsm_trans *trans);
|
||||
|
||||
#endif
|
||||
|
||||
@@ -1,147 +0,0 @@
|
||||
/*
|
||||
* SpanDSP - a series of DSP components for telephony
|
||||
*
|
||||
* v42bis.h
|
||||
*
|
||||
* Written by Steve Underwood <steveu@coppice.org>
|
||||
*
|
||||
* Copyright (C) 2005, 2011 Steve Underwood
|
||||
*
|
||||
* All rights reserved.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License version 2.1,
|
||||
* as published by the Free Software Foundation.
|
||||
*
|
||||
* 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 Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*/
|
||||
|
||||
/*! \page v42bis_page V.42bis modem data compression
|
||||
\section v42bis_page_sec_1 What does it do?
|
||||
The v.42bis specification defines a data compression scheme, to work in
|
||||
conjunction with the error correction scheme defined in V.42.
|
||||
|
||||
\section v42bis_page_sec_2 How does it work?
|
||||
*/
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#if !defined(_SPANDSP_V42BIS_H_)
|
||||
#define _SPANDSP_V42BIS_H_
|
||||
|
||||
#define SPAN_DECLARE(x) x
|
||||
|
||||
#define V42BIS_MIN_STRING_SIZE 6
|
||||
#define V42BIS_MAX_STRING_SIZE 250
|
||||
#define V42BIS_MIN_DICTIONARY_SIZE 512
|
||||
#define V42BIS_MAX_BITS 12
|
||||
#define V42BIS_MAX_CODEWORDS 4096 /* 2^V42BIS_MAX_BITS */
|
||||
#define V42BIS_MAX_OUTPUT_LENGTH 1024
|
||||
|
||||
enum
|
||||
{
|
||||
V42BIS_P0_NEITHER_DIRECTION = 0,
|
||||
V42BIS_P0_INITIATOR_RESPONDER,
|
||||
V42BIS_P0_RESPONDER_INITIATOR,
|
||||
V42BIS_P0_BOTH_DIRECTIONS
|
||||
};
|
||||
|
||||
enum
|
||||
{
|
||||
V42BIS_COMPRESSION_MODE_DYNAMIC = 0,
|
||||
V42BIS_COMPRESSION_MODE_ALWAYS,
|
||||
V42BIS_COMPRESSION_MODE_NEVER
|
||||
};
|
||||
|
||||
typedef void (*put_msg_func_t)(void *user_data, const uint8_t *msg, int len);
|
||||
|
||||
/*!
|
||||
V.42bis compression/decompression descriptor. This defines the working state for a
|
||||
single instance of V.42bis compress/decompression.
|
||||
*/
|
||||
typedef struct v42bis_state_s v42bis_state_t;
|
||||
|
||||
#if defined(__cplusplus)
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
|
||||
/*! Compress a block of octets.
|
||||
\param s The V.42bis context.
|
||||
\param buf The data to be compressed.
|
||||
\param len The length of the data buffer.
|
||||
\return 0 */
|
||||
SPAN_DECLARE(int) v42bis_compress(v42bis_state_t *s, const uint8_t buf[], int len);
|
||||
|
||||
/*! Flush out any data remaining in a compression buffer.
|
||||
\param s The V.42bis context.
|
||||
\return 0 */
|
||||
SPAN_DECLARE(int) v42bis_compress_flush(v42bis_state_t *s);
|
||||
|
||||
/*! Decompress a block of octets.
|
||||
\param s The V.42bis context.
|
||||
\param buf The data to be decompressed.
|
||||
\param len The length of the data buffer.
|
||||
\return 0 */
|
||||
SPAN_DECLARE(int) v42bis_decompress(v42bis_state_t *s, const uint8_t buf[], int len);
|
||||
|
||||
/*! Flush out any data remaining in the decompression buffer.
|
||||
\param s The V.42bis context.
|
||||
\return 0 */
|
||||
SPAN_DECLARE(int) v42bis_decompress_flush(v42bis_state_t *s);
|
||||
|
||||
/*! Set the compression mode.
|
||||
\param s The V.42bis context.
|
||||
\param mode One of the V.42bis compression modes -
|
||||
V42BIS_COMPRESSION_MODE_DYNAMIC,
|
||||
V42BIS_COMPRESSION_MODE_ALWAYS,
|
||||
V42BIS_COMPRESSION_MODE_NEVER */
|
||||
SPAN_DECLARE(void) v42bis_compression_control(v42bis_state_t *s, int mode);
|
||||
|
||||
/*! Initialise a V.42bis context.
|
||||
\param s The V.42bis context.
|
||||
\param negotiated_p0 The negotiated P0 parameter, from the V.42bis spec.
|
||||
\param negotiated_p1 The negotiated P1 parameter, from the V.42bis spec.
|
||||
\param negotiated_p2 The negotiated P2 parameter, from the V.42bis spec.
|
||||
\param encode_handler Encode callback handler.
|
||||
\param encode_user_data An opaque pointer passed to the encode callback handler.
|
||||
\param max_encode_len The maximum length that should be passed to the encode handler.
|
||||
\param decode_handler Decode callback handler.
|
||||
\param decode_user_data An opaque pointer passed to the decode callback handler.
|
||||
\param max_decode_len The maximum length that should be passed to the decode handler.
|
||||
\return The V.42bis context. */
|
||||
SPAN_DECLARE(v42bis_state_t *) v42bis_init(const void *ctx,
|
||||
v42bis_state_t *s,
|
||||
int negotiated_p0,
|
||||
int negotiated_p1,
|
||||
int negotiated_p2,
|
||||
put_msg_func_t encode_handler,
|
||||
void *encode_user_data,
|
||||
int max_encode_len,
|
||||
put_msg_func_t decode_handler,
|
||||
void *decode_user_data,
|
||||
int max_decode_len);
|
||||
|
||||
/*! Release a V.42bis context.
|
||||
\param s The V.42bis context.
|
||||
\return 0 if OK */
|
||||
SPAN_DECLARE(int) v42bis_release(v42bis_state_t *s);
|
||||
|
||||
/*! Free a V.42bis context.
|
||||
\param s The V.42bis context.
|
||||
\return 0 if OK */
|
||||
SPAN_DECLARE(int) v42bis_free(v42bis_state_t *s);
|
||||
|
||||
#if defined(__cplusplus)
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
/*- End of file ------------------------------------------------------------*/
|
||||
@@ -1,126 +0,0 @@
|
||||
/*
|
||||
* SpanDSP - a series of DSP components for telephony
|
||||
*
|
||||
* private/v42bis.h
|
||||
*
|
||||
* Written by Steve Underwood <steveu@coppice.org>
|
||||
*
|
||||
* Copyright (C) 2005 Steve Underwood
|
||||
*
|
||||
* All rights reserved.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License version 2.1,
|
||||
* as published by the Free Software Foundation.
|
||||
*
|
||||
* 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 Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*/
|
||||
|
||||
#if !defined(_SPANDSP_PRIVATE_V42BIS_H_)
|
||||
#define _SPANDSP_PRIVATE_V42BIS_H_
|
||||
|
||||
/*!
|
||||
V.42bis dictionary node.
|
||||
Note that 0 is not a valid node to point to (0 is always a control code), so 0 is used
|
||||
as a "no such value" marker in this structure.
|
||||
*/
|
||||
typedef struct
|
||||
{
|
||||
/*! \brief The value of the octet represented by the current dictionary node */
|
||||
uint8_t node_octet;
|
||||
/*! \brief The parent of this node */
|
||||
uint16_t parent;
|
||||
/*! \brief The first child of this node */
|
||||
uint16_t child;
|
||||
/*! \brief The next node at the same depth */
|
||||
uint16_t next;
|
||||
} v42bis_dict_node_t;
|
||||
|
||||
/*!
|
||||
V.42bis compression or decompression. This defines the working state for a single instance
|
||||
of V.42bis compression or decompression.
|
||||
*/
|
||||
typedef struct
|
||||
{
|
||||
/*! \brief Compression enabled. */
|
||||
int v42bis_parm_p0;
|
||||
/*! \brief Compression mode. */
|
||||
int compression_mode;
|
||||
/*! \brief Callback function to handle output data. */
|
||||
put_msg_func_t handler;
|
||||
/*! \brief An opaque pointer passed in calls to the data handler. */
|
||||
void *user_data;
|
||||
/*! \brief The maximum amount to be passed to the data handler. */
|
||||
int max_output_len;
|
||||
|
||||
/*! \brief TRUE if we are in transparent (i.e. uncompressable) mode */
|
||||
int transparent;
|
||||
/*! \brief Next empty dictionary entry */
|
||||
uint16_t v42bis_parm_c1;
|
||||
/*! \brief Current codeword size */
|
||||
uint16_t v42bis_parm_c2;
|
||||
/*! \brief Threshold for codeword size change */
|
||||
uint16_t v42bis_parm_c3;
|
||||
/*! \brief The current update point in the dictionary */
|
||||
uint16_t update_at;
|
||||
/*! \brief The last entry matched in the dictionary */
|
||||
uint16_t last_matched;
|
||||
/*! \brief The last entry added to the dictionary */
|
||||
uint16_t last_added;
|
||||
/*! \brief Total number of codewords in the dictionary */
|
||||
int v42bis_parm_n2;
|
||||
/*! \brief Maximum permitted string length */
|
||||
int v42bis_parm_n7;
|
||||
/*! \brief The dictionary */
|
||||
v42bis_dict_node_t dict[V42BIS_MAX_CODEWORDS];
|
||||
|
||||
/*! \brief The octet string in progress */
|
||||
uint8_t string[V42BIS_MAX_STRING_SIZE];
|
||||
/*! \brief The current length of the octet string in progress */
|
||||
int string_length;
|
||||
/*! \brief The amount of the octet string in progress which has already
|
||||
been flushed out of the buffer */
|
||||
int flushed_length;
|
||||
|
||||
/*! \brief Compression performance metric */
|
||||
uint16_t compression_performance;
|
||||
|
||||
/*! \brief Outgoing bit buffer (compression), or incoming bit buffer (decompression) */
|
||||
uint32_t bit_buffer;
|
||||
/*! \brief Outgoing bit count (compression), or incoming bit count (decompression) */
|
||||
int bit_count;
|
||||
|
||||
/*! \brief The output composition buffer */
|
||||
uint8_t output_buf[V42BIS_MAX_OUTPUT_LENGTH];
|
||||
/*! \brief The length of the contents of the output composition buffer */
|
||||
int output_octet_count;
|
||||
|
||||
/*! \brief The current value of the escape code */
|
||||
uint8_t escape_code;
|
||||
/*! \brief TRUE if we just hit an escape code, and are waiting for the following octet */
|
||||
int escaped;
|
||||
} v42bis_comp_state_t;
|
||||
|
||||
/*!
|
||||
V.42bis compression/decompression descriptor. This defines the working state for a
|
||||
single instance of V.42bis compress/decompression.
|
||||
*/
|
||||
struct v42bis_state_s
|
||||
{
|
||||
/*! \brief Compression state. */
|
||||
v42bis_comp_state_t compress;
|
||||
/*! \brief Decompression state. */
|
||||
v42bis_comp_state_t decompress;
|
||||
|
||||
/*! \brief Error and flow logging control */
|
||||
};
|
||||
|
||||
#endif
|
||||
/*- End of file ------------------------------------------------------------*/
|
||||
@@ -29,15 +29,14 @@ enum bsc_vty_node {
|
||||
NAT_BSC_NODE,
|
||||
MSC_NODE,
|
||||
OM2K_NODE,
|
||||
OM2K_CON_GROUP_NODE,
|
||||
TRUNK_NODE,
|
||||
PGROUP_NODE,
|
||||
MNCC_INT_NODE,
|
||||
NITB_NODE,
|
||||
BSC_NODE,
|
||||
SMPP_NODE,
|
||||
SMPP_ESME_NODE,
|
||||
GTPHUB_NODE,
|
||||
CSCN_NODE,
|
||||
};
|
||||
|
||||
extern int bsc_vty_is_config_node(struct vty *vty, int node);
|
||||
@@ -47,6 +46,8 @@ struct log_info;
|
||||
int bsc_vty_init(const struct log_info *cat, struct gsm_network *network);
|
||||
int bsc_vty_init_extra(void);
|
||||
|
||||
void cscn_vty_init(void);
|
||||
|
||||
struct gsm_network *gsmnet_from_vty(struct vty *vty);
|
||||
|
||||
#endif
|
||||
|
||||
23
openbsc/include/openbsc/xsc.h
Normal file
23
openbsc/include/openbsc/xsc.h
Normal file
@@ -0,0 +1,23 @@
|
||||
#pragma once
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
struct msgb;
|
||||
struct gsm_network;
|
||||
struct log_info;
|
||||
struct ctrl_handle;
|
||||
|
||||
typedef int (*mncc_recv_cb_t)(struct gsm_network *, struct msgb *);
|
||||
|
||||
#define MAX_A5_KEY_LEN (128/8)
|
||||
|
||||
struct gsm_encr {
|
||||
uint8_t alg_id;
|
||||
uint8_t key_len;
|
||||
uint8_t key[MAX_A5_KEY_LEN];
|
||||
};
|
||||
|
||||
extern struct gsm_network *vty_global_gsm_network;
|
||||
|
||||
int xsc_vty_init(struct gsm_network *network);
|
||||
|
||||
@@ -1,3 +0,0 @@
|
||||
We want to avoid creating too many external build-time dependencies
|
||||
like this one to autoconf-archive. This directory provides a local
|
||||
copy of required m4 rules.
|
||||
@@ -1,74 +0,0 @@
|
||||
# ===========================================================================
|
||||
# http://www.gnu.org/software/autoconf-archive/ax_check_compile_flag.html
|
||||
# ===========================================================================
|
||||
#
|
||||
# SYNOPSIS
|
||||
#
|
||||
# AX_CHECK_COMPILE_FLAG(FLAG, [ACTION-SUCCESS], [ACTION-FAILURE], [EXTRA-FLAGS], [INPUT])
|
||||
#
|
||||
# DESCRIPTION
|
||||
#
|
||||
# Check whether the given FLAG works with the current language's compiler
|
||||
# or gives an error. (Warnings, however, are ignored)
|
||||
#
|
||||
# ACTION-SUCCESS/ACTION-FAILURE are shell commands to execute on
|
||||
# success/failure.
|
||||
#
|
||||
# If EXTRA-FLAGS is defined, it is added to the current language's default
|
||||
# flags (e.g. CFLAGS) when the check is done. The check is thus made with
|
||||
# the flags: "CFLAGS EXTRA-FLAGS FLAG". This can for example be used to
|
||||
# force the compiler to issue an error when a bad flag is given.
|
||||
#
|
||||
# INPUT gives an alternative input source to AC_COMPILE_IFELSE.
|
||||
#
|
||||
# NOTE: Implementation based on AX_CFLAGS_GCC_OPTION. Please keep this
|
||||
# macro in sync with AX_CHECK_{PREPROC,LINK}_FLAG.
|
||||
#
|
||||
# LICENSE
|
||||
#
|
||||
# Copyright (c) 2008 Guido U. Draheim <guidod@gmx.de>
|
||||
# Copyright (c) 2011 Maarten Bosmans <mkbosmans@gmail.com>
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify it
|
||||
# under the terms of the GNU 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 General
|
||||
# Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License along
|
||||
# with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
# As a special exception, the respective Autoconf Macro's copyright owner
|
||||
# gives unlimited permission to copy, distribute and modify the configure
|
||||
# scripts that are the output of Autoconf when processing the Macro. You
|
||||
# need not follow the terms of the GNU General Public License when using
|
||||
# or distributing such scripts, even though portions of the text of the
|
||||
# Macro appear in them. The GNU General Public License (GPL) does govern
|
||||
# all other use of the material that constitutes the Autoconf Macro.
|
||||
#
|
||||
# This special exception to the GPL applies to versions of the Autoconf
|
||||
# Macro released by the Autoconf Archive. When you make and distribute a
|
||||
# modified version of the Autoconf Macro, you may extend this special
|
||||
# exception to the GPL to apply to your modified version as well.
|
||||
|
||||
#serial 4
|
||||
|
||||
AC_DEFUN([AX_CHECK_COMPILE_FLAG],
|
||||
[AC_PREREQ(2.64)dnl for _AC_LANG_PREFIX and AS_VAR_IF
|
||||
AS_VAR_PUSHDEF([CACHEVAR],[ax_cv_check_[]_AC_LANG_ABBREV[]flags_$4_$1])dnl
|
||||
AC_CACHE_CHECK([whether _AC_LANG compiler accepts $1], CACHEVAR, [
|
||||
ax_check_save_flags=$[]_AC_LANG_PREFIX[]FLAGS
|
||||
_AC_LANG_PREFIX[]FLAGS="$[]_AC_LANG_PREFIX[]FLAGS $4 $1"
|
||||
AC_COMPILE_IFELSE([m4_default([$5],[AC_LANG_PROGRAM()])],
|
||||
[AS_VAR_SET(CACHEVAR,[yes])],
|
||||
[AS_VAR_SET(CACHEVAR,[no])])
|
||||
_AC_LANG_PREFIX[]FLAGS=$ax_check_save_flags])
|
||||
AS_VAR_IF(CACHEVAR,yes,
|
||||
[m4_default([$2], :)],
|
||||
[m4_default([$3], :)])
|
||||
AS_VAR_POPDEF([CACHEVAR])dnl
|
||||
])dnl AX_CHECK_COMPILE_FLAGS
|
||||
@@ -1,62 +1,13 @@
|
||||
AM_CPPFLAGS = \
|
||||
$(all_includes) \
|
||||
-I$(top_srcdir)/include \
|
||||
-I$(top_builddir) \
|
||||
$(NULL)
|
||||
AM_CPPFLAGS = $(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)
|
||||
|
||||
AM_CFLAGS = \
|
||||
-Wall \
|
||||
$(LIBOSMOCORE_CFLAGS) \
|
||||
$(LIBOSMOGSM_CFLAGS) \
|
||||
$(LIBOSMOGSM_CFLAGS) \
|
||||
$(LIBOSMOVTY_CFLAGS) \
|
||||
$(COVERAGE_CFLAGS) \
|
||||
$(NULL)
|
||||
SUBDIRS = libcommon libmgcp libbsc libiu libmsc libtrau libfilter libxsc osmo-cscn osmo-bsc_mgcp utils ipaccess gprs
|
||||
|
||||
AM_LDFLAGS = \
|
||||
$(LIBOSMOCORE_LIBS) \
|
||||
$(LIBOSMOGSM_LIBS) \
|
||||
$(COVERAGE_LDFLAGS) \
|
||||
$(NULL)
|
||||
|
||||
# Libraries
|
||||
SUBDIRS = \
|
||||
libcommon \
|
||||
libmgcp \
|
||||
libbsc \
|
||||
libmsc \
|
||||
libtrau \
|
||||
libfilter \
|
||||
libcommon-cs \
|
||||
$(NULL)
|
||||
|
||||
# Conditional Libraries
|
||||
if BUILD_IU
|
||||
SUBDIRS += \
|
||||
libiu \
|
||||
$(NULL)
|
||||
endif
|
||||
|
||||
# Programs
|
||||
SUBDIRS += \
|
||||
osmo-nitb \
|
||||
osmo-bsc_mgcp \
|
||||
utils \
|
||||
ipaccess \
|
||||
gprs \
|
||||
reg-proxy \
|
||||
ussd-proxy \
|
||||
$(NULL)
|
||||
|
||||
# Conditional Programs
|
||||
# Conditional modules
|
||||
if BUILD_NAT
|
||||
SUBDIRS += \
|
||||
osmo-bsc_nat \
|
||||
$(NULL)
|
||||
SUBDIRS += osmo-bsc_nat
|
||||
endif
|
||||
|
||||
if BUILD_BSC
|
||||
SUBDIRS += \
|
||||
osmo-bsc \
|
||||
$(NULL)
|
||||
SUBDIRS += osmo-bsc
|
||||
endif
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user