Compare commits

...

141 Commits

Author SHA1 Message Date
Alexander Couzens
c56f68abd7 git-version-gen: revert to same version as libosmocore
OpenBSC required additional care because of an unusal .git location.
This is not need anymore for osmo-mgw

Change-Id: I5aad67612026947ad52cdc9477b603732c146e7a
2017-08-08 17:19:15 +02:00
Alexander Couzens
01fc7fb239 reword debian packages support
Remove old leftover from split of osmo-mgw out of openbsc.

Change-Id: I96a6a56c401833d053d48908872fb0474f5aec53
2017-08-08 17:18:40 +02:00
Neels Hofmeyr
370f4e3867 mgcp client: allow getting actual conf from opaque struct 2017-07-26 14:21:15 +02:00
Neels Hofmeyr
3acaadd44d prune public mgcpgw_client api 2017-07-26 14:21:15 +02:00
Neels Hofmeyr
f6a9cd53f4 split off osmo-mgw: remove files, apply build, rename
Add vty and logging previously used from libcommon

Rename libmgcp to libosmo-legacy-mgcp and install.

Use DLMGCP, not DMGCP.

Change-Id: I71a0a16ebaaef881c34235849601fc40aa12cfd7
Depends: libosmocore I09c587e2d59472cbde852d467d457254746d9e67
2017-07-26 14:21:15 +02:00
Neels Hofmeyr
f81151bd3f iudummy: remove public ranap_ue_conn_ctx_alloc
This function has been removed in osmo-iuh.
2017-07-25 15:32:42 +02:00
Neels Hofmeyr
9c0bab9b48 add msg type to SMS rx logging
Change-Id: I73ea4eebe57b2d1008045a27f174072178b9f077
2017-07-25 15:32:41 +02:00
Neels Hofmeyr
2fa9279702 set require IMEI by default
Change-Id: I91d8f3e79cdaa206f8cd32b42bd7c23933f9631a
2017-07-25 15:32:41 +02:00
Neels Hofmeyr
a622828806 msc_vlr tests: add IMEISV tests
Change-Id: I752afef2ae3ce04e813c7e9fea0e883e607c0e14
2017-07-25 15:32:41 +02:00
Neels Hofmeyr
2ab3af5263 vlr: LU FSM: enable Retrieve_IMEISV_If_Required
Change-Id: I121b95ad6d5ecb7603815eece2b43008de487a8a
2017-07-25 15:24:42 +02:00
Neels Hofmeyr
8571981205 vlr: place comments on if (0) cases 2017-07-25 15:24:42 +02:00
Neels Hofmeyr
2930c2d8ad .gitignore: cosmetic: use globs to ignore test binaries
Change-Id: I840e4333a4cad646d751ebafe7e0ef23e7a9c708
2017-07-25 15:24:42 +02:00
Neels Hofmeyr
6cd30366be move libiu to osmo-iuh/libosmo-ranap
Remove libiu here, use the functions from libosmo-ranap instead, by applying
the ranap_ / RANAP_ prefix.

Corresponding change-id in osmo-iuh.git is I6a3f7ad15be03fb94689b4af6ccfa828c25f45c0

Change-Id: Ib8c4fcdb4766c5e575618b95ce16dce51063206b
2017-07-25 15:24:41 +02:00
Neels Hofmeyr
ffb3e8d2ec MSC,SGSN: use OSMO_GSUP_PORT == 4222 instead of 2222
In SGSN, actually place the port in the SGSN config by default, so that the
gsup port may now be omitted in the VTY config (the IP address suffices).

Adjust the osmo-sgsn.cfg example.

Depends: I4222e21686c823985be8ff1f16b1182be8ad6175 (libosmocore)
Change-Id: I50f2040e2eb0baacb43849e93cfed10cbc2fc156
2017-07-25 15:18:48 +02:00
Neels Hofmeyr
b3f606a826 msc_vlr_tests: properly check BSSAP Clear and Iu Release
Change-Id: Ice8125decc1a663d95ae70418e151bff559b983b
2017-07-25 15:18:43 +02:00
Neels Hofmeyr
838a381b49 cosmetic: msc_vlr_tests: better place clear_cmd wrap, adjust printed msg
Change-Id: Iec6f03f97803b2604f0094260cba256e72ee67bd
2017-07-25 15:15:22 +02:00
Neels Hofmeyr
c5aed8c10e fix release upon IMSI Detach
In case of an IMSI Detach, we don't have a conn_fsm, yet we still need to send
release messages. Hence directly release the conn in msc_subscr_conn_close()
when there is no conn_fsm present.

Move the conn release actions from the conn_fsm cleanup function to new
function msc_subscr_conn_release_all(). From the FSM cleanup, call
msc_subscr_conn_close(), and invoke msc_subscr_conn_release_all() from there.

Document msc_subscr_conn_close() behavior.

Change-Id: Ied6981099605ad803f8ffed38f23ed8203a97727
2017-07-25 15:15:22 +02:00
Neels Hofmeyr
5b2283ba68 cosmetic: add info log for Iu Release tx
Change-Id: Ia64bc937d7f37ef6209efbdf884de61008f8816d
2017-07-25 15:15:22 +02:00
Neels Hofmeyr
f42457ec98 cosmetic: remove obsolete comment
Change-Id: Ie60e00e07b2129ac4bb3cac94921bf3c8d9cd861
2017-07-25 15:15:22 +02:00
Philipp Maier
09db3b69ed a-iface: move clear command to subscriber_conn.c
The clear command is currently triggered from the wrong place.
This is a fixup that corrects that. However, it will introduce
another problem: The clear command is not sent on detach.

Adjust test expectations.

Change-Id: Ia27d7e94cb11adf351457b3b0e98a5c9d5070fbf
2017-07-25 15:15:22 +02:00
Philipp Maier
4ebab46847 vty: Fixup sccp/ss7 configuration
The sccp/ss7 configuration is now fixed. The cs7 instance id is
implicitly detected from the bsc_addr or the msc_addr. Depending
on what is listed last. (I am not sure if that is wise, maybe
we should only use the local/bsc address to do the lookup).

Remove cs7-instance vty command

Modify VTY commands, so that the fixed API is used

Set msc->a.cs7_instance from the VTY to when msc/bsc addr is parsed

Fix the initalization to use osmo_sccp_simple_client_on_ss7_id() and
pass the cs7-instance id we determined from the vty.

The whole thing is not waterproof yet. We are still not at the
point where we allow to leave the local address out. This would
be fine, but when it is left out, the only way to determine the
cs7 instance is to use the msc_addr then.

We also might want to make sure to reach a state where all cs7
related config may be left out (like with the MSC)
2017-07-25 15:15:22 +02:00
Philipp Maier
19c4fd0562 fixup for: mgcp: display properly mgcp-messages in log 2017-07-25 15:15:22 +02:00
Philipp Maier
e198087a15 msc-vty-complete 2017-07-25 15:15:22 +02:00
Philipp Maier
50643e419d msc_vlr: Fix tests: accomodate a_iface_tx_clear_cmd()
msc_vlr_tests.c: wrap a_iface_tx_clear_cmd(), adjust test expectations.

Change-Id: I01c099e62b3e3d74c4f567c0654e748d9d7e45d4
2017-07-25 15:14:16 +02:00
Philipp Maier
e21c93fc96 osmo_msc: only clear A-Interface connections for GSM calls
The clear command is sent via the A-Interface for both,
A and IuCS connections. This is wrong.

Only send the clear command for connections related to
the A-Interface, which means only for connections where
the RAN is set to GERAN
2017-07-25 15:14:16 +02:00
Philipp Maier
956a2eb418 fixup: fix typo 2017-07-25 15:14:16 +02:00
Philipp Maier
90835e0083 mncc: make external mncc work
The external mncc currently does not work properly since the
MNCC_RTP_CREATE commands are removed due to the MSC-Split. It
is possible to operate without these commands, but then it is
not possible to route the RTP streams to an outside leg. Only
internal bridging is currenlty possible. This method is used
when the internal MNCC is enabled.

Add the missing MNCC_RTP_CREATE implementation.
Add logic to keep the old bridging mode working.
2017-07-25 15:14:16 +02:00
Philipp Maier
8643faad59 mgcp: display properly mgcp-messages in log
The generated mgcp messages are not displayed properly (stray
newlines). Also, the messages we receive are not displayed
at all.

Display generated and received messages in logtext, reformat
the strings properly so that the logtext does not get messed
up
2017-07-25 15:14:16 +02:00
Philipp Maier
03e1d5c7c5 fixup for: a_iface: fix missing clear command 2017-07-25 15:14:15 +02:00
Neels Hofmeyr
5bc821566f cosmetic: tweak error log in osmo_bsc_sigtran_init()
Change-Id: Iec3dbeb0ee1421129aaf9e313d616757955bee48
2017-07-25 15:14:15 +02:00
Philipp Maier
b67fb4fc63 a_iface: fix missing clear command
When a subscriber connection is freed on the MSC side (the
conversion is over) the MSC should send a clear command to
the BSC in order to inform the BSC that the connection is
over. Currently this step is missing. Instead we wait for
the BSC to issue a clear request. This is not as it should
be, connections should be actively cleared by the MSC.

Add the missing clear command
2017-07-25 15:14:15 +02:00
Philipp Maier
4b36c7a34e a_iface: fix missing log output 2017-07-25 15:14:15 +02:00
Philipp Maier
15b06b9d3c a_iface: fix missing const 2017-07-25 15:14:15 +02:00
Philipp Maier
241f119d8e a_iface: add missing static 2017-07-25 15:14:15 +02:00
Philipp Maier
5938727956 msc_ifaces: add checks for nullpointers 2017-07-25 15:14:15 +02:00
Neels Hofmeyr
ec49e842fe fixup: remove allocation/usage of iu struct again.
The allocation and usage of the iu struct was accidentally
re-introduced into a_iface_bssap.c.

Remove the allocation and the usage of iu struct.

Related to:
aoip: don't use iu struct: do not allocate unnecessary ue_conn_ctx
2017-07-25 15:14:15 +02:00
Philipp Maier
3ae6040afd osmo-bsc change bsc_handle_dt1() to bsc_handle_dt()
_dt1() is not applicable with the current setup, _dt() is
more accurate
2017-07-25 15:14:15 +02:00
Philipp Maier
9b0db3860c osmo-bsc: fix sccp name string
Change-Id: I4caf935fbeacc23d7a10766112ab844d6fc367ea
2017-07-25 15:14:15 +02:00
Philipp Maier
0317b106fe a_iface: remove unused variable
Change-Id: If964ac5344fa0275c07755b5a43d37ce186d3ca2
2017-07-25 15:14:15 +02:00
Philipp Maier
920420284c osmo-msc/a_iface/reset: add missing const
Change-Id: Id75918dfd891d9407a62a0b7cd9590932c858093
2017-07-25 15:14:15 +02:00
Philipp Maier
ae33266f6c osmo-bsc/sigtran: add missing const
Change-Id: I36404b34b8a85fc98670a3eeb8aaf29a4a6f10ea
2017-07-25 15:14:15 +02:00
Philipp Maier
ea452c93ca osmo-msc/a_iface: add missing assertions
Change-Id: If9eac28f70522edc42a9f169a7d12fed5936fb62
2017-07-25 15:14:15 +02:00
Philipp Maier
195cab61ab osmo-bsc: add missing comment
Change-Id: Iac59f2ff2f10997c636a8ac19427ed4a95dc99b5
2017-07-25 15:14:15 +02:00
Philipp Maier
23880357f2 osmo-bsc: add missing assertion
Change-Id: Ia7d4b0bff697acfa71ef616a12d78d17e3af4c20
2017-07-25 15:14:15 +02:00
Philipp Maier
2fd3a60ed8 osmo-msc: remove orphanned struct members
Change-Id: I229946cfe4ffa6de982586b1c2fa1117c3260e3a
2017-07-25 15:14:15 +02:00
Philipp Maier
569335bc34 osmo-msc: rename called/calling address in struct a_conn_info
Change-Id: I1b28652662d83f52db21cb78b512c501c7adf4bb
2017-07-25 15:14:15 +02:00
Philipp Maier
4c098cfb32 osmo-bsc: use better msc identifier
Using the MSC numbers in the logtext is not very expressive,
ise the SCCP-Addresses instead.

When creating the sccp instance and user, use more parseable
string than "MSC No.: n"

Change-Id: Ib56134193ba95538f63e09dc702dc3ff0e827a02
2017-07-25 15:14:15 +02:00
Philipp Maier
d3f2ae8d6a osmo-bsc: fix typo
Change-Id: I154db5bcaada8f5503ca8700644abf00f511ff6e
2017-07-25 15:14:15 +02:00
Philipp Maier
faa1b9dd0a osmo-bsc: vty: fix error message
The warning message that is displayed when a non standard SSN is
set is confusing.

Make warning message more expressive.

Change-Id: I5283bcc5acf4739d468fe43937f0e59f44dee3d9
2017-07-25 15:14:15 +02:00
Neels Hofmeyr
f85f656b18 build: osmo-bsc_nat: add missing sigtran LDADD
Change-Id: Ia3031232a3a44b8e8a665610a2fd1cf0a7e55b22
2017-07-25 15:14:15 +02:00
Philipp Maier
51442a7886 osmo-bsc: rename calling_addr to msc_addr
The variable name "calling_addr" is not very expressive. Change
the variable name to "msc_addr".

Change-Id: I3a43880d4172063e78bfef1556dbb037f20a9a99
2017-07-25 15:14:15 +02:00
Philipp Maier
88824c7c7d osmo-bsc: change calling/called addr in VTY
The vty commands:
 called-addr my_msc
 calling-addr my_bsc

are not very expressive to the user. Change the command
names into something more expressive:

 msc-addr my_msc
 bsc-addr my_bsc

Also change the function and variable names accordingly

Change-Id: I8d46aad01fb80afcaccb966fadd6b2ecbd1a1f9e
2017-07-25 15:14:15 +02:00
Philipp Maier
6202b37a0b osmo-bsc: change calling/called_addr variable names
"calling_address" and "called_address" is not very expressive.

change the respective struct memeber names of bsc_msc_data to
bsc_addr and msc_addr to increase readability of the code.

Change-Id: I63b2e810b97131c690edd5a9cc5c7b3b54ec5e12
2017-07-25 15:14:15 +02:00
Philipp Maier
dd93694587 osmo-bsc: check configured sccp addresses before start
do not start unless the user has configured sufficient SCCP
addresses via VTY. Do not accept address that lack point codes
or ssn

Change-Id: I42b4fb0ef93dec225e220e88e1b92664b9b55be3
2017-07-25 15:14:14 +02:00
Philipp Maier
ead844e65e osmo-bsc: make sure only default SSNs are used
The VTY technically allows setting custom values for the
SSN. However, SSN values and their purposes are well
standardized.

If the user has configured an SSN, check that is compliant
to the standard. If not, warn and ignore the setting by
using the stanard SSN.

If the user left out the SSN, automatically use the standard
SSN.

Change-Id: Ib34fe0474f625b964dbfedfb4263fb0b5f976bdc
2017-07-25 15:14:14 +02:00
Philipp Maier
d6278889c4 cosmetic: fix typo in log output
Change-Id: I8d76a61e28c0677e121586c1fe4666baa7196b18
2017-07-25 15:14:14 +02:00
Philipp Maier
2535d12377 osmo-bsc: only clear connections of a specific MSC
The BSC clears all connections on reception of a
BSSAP RESET, however, the RESET command must not
affect the connections of other MSCs.

Ensure that only the connections of the MSC who
actually sent the BSSAP RESET are cleared.

Change-Id: I68fe2eadeae8ba6b6728fced42f6308e9b2d997a
2017-07-25 15:14:14 +02:00
Philipp Maier
ed21f2eecf osmo-bsc: Make SCCP-Addresses configurable via VTY
Add VTY commands to configure the sccp-address of the BSC
and the one of the MSC.

Change-Id: I49cedc0ce339defa6fb354f6fb9b1af7820da7cc
2017-07-25 15:14:14 +02:00
Philipp Maier
31b05fe895 common-vty: add ss7 nodes commands to VTY
The current VTY implementation has no knowledge about the
libosmo-sccp nodes and therefor can not resolve parent nodes,
nor decide if we deal with a config node.

Change-Id: I815a57ed6270bd55c25ee9a8f45026d4aaad9004
2017-07-25 15:14:14 +02:00
Philipp Maier
e4b33dd303 osmo-msc: finish msc-sided reset
finish the implementation for msc sided reset, automatically
register connecting BSCs.

Ensure that all sccp connections are cleared when the reset
procedure executes.

Change-Id: Iba3f5523795c6972600bbfda2a02b06ba84ea12d
2017-07-25 15:14:14 +02:00
Philipp Maier
184892b371 msc_vlr: fix linker problem in testcase
Swap libmsc.a and libcommon-cs.a to make symbols from
libcommon-cs.a available to libmsc.a

Change-Id: I16fdd58d0b542aca987865a6bb7ca0f996693e81
2017-07-25 15:14:14 +02:00
Philipp Maier
8a3c5a0699 mgcp: Fix missing call id in DLCX
The call id field in the DLCX message is missing. Use the endpoint
id as call id in all CRCX and DLCX messages.

Change-Id: I8b78b76126c63c4882e982c64c3953dbe1dab179
2017-07-25 15:14:14 +02:00
Philipp Maier
7d5e706964 reset: fix allocation and add deallocator for reset procedure
When the reset is started, state machines are allocated. The user
must provide a correctly filled structure where the reset start
function adds the state machine into.

This is prone to errors, besides of that, a proper deallocator
function which tears down the osmo fsm is missing.

make a more cofmortable allocator function and add deallocator
function.

Change-Id: I0054fb31589fb9f4c63c45df436e83448c59bd97
2017-07-25 15:14:14 +02:00
Neels Hofmeyr
04d1ca7895 aoip: don't use iu struct: move rtp ports from .iu to new subscr_conn.rtp
Change-Id: Ib1a84b0733655b2e87c1598ae9df0640cdca833b
2017-07-25 15:14:14 +02:00
Neels Hofmeyr
e4dc412e7b aoip: don't use iu struct: do not allocate unnecessary ue_conn_ctx
Change-Id: I06c4c3eac3cf95cef78d49f1462096d6350f226a
2017-07-25 15:14:14 +02:00
Neels Hofmeyr
1f94ba58ea osmo_bsc_main: use osmo_sccp_make_addr_pc_ssn() for SCCP addresses
Change-Id: I91eb444def4715652f7988189a58e1168ef15d19
2017-07-25 15:14:14 +02:00
Neels Hofmeyr
104548372c AoIP+3G: use one common SCCP client for A and IuCS
Move osmo_sccp_simple_client() setup out of iu_init() and a_init().
In msc_main.c and sgsn_main.c, initialize the STP connection first and then
pass to iu_init() and a_init().

This allows serving 3G (IuCS) and 2G (A) from one and the same MSC instance.

Since both OsmoHNBGW and OsmoBSC are using PC 23 by default now, move BSC to PC
42 (because OsmoBSC typically has vty port 4242, bla).

Also:
a_iface.c: remove now unused defines
a_init(): remove osmo_ss7_init() call that duplicated msc_main.c

Change-Id: I963a94e1a0bfc455992d22940dcc9c67c44570b9
2017-07-25 15:14:14 +02:00
Neels Hofmeyr
79b2387c0b msc: re-enable iu_init()
Change-Id: Iee7fa94d3f6880847020f3e0dfe7ed7672d4fb23
2017-07-25 15:14:14 +02:00
Neels Hofmeyr
39bc234f9e a_init: use name arg for sccp client and user bind
Change-Id: Ie281e8a486471e1d48a1444a07795e97c17627f2
2017-07-25 15:14:14 +02:00
Philipp Maier
3a401548ce a_iface: fix typo in function name
Change-Id: Ia545a0daec6336732f1bcaa01e27c843eb732dd8
2017-07-25 15:14:14 +02:00
Philipp Maier
cc12b708a7 a_iface: Check if channel type and speech codec list are successful
Currently we do not check for errors during the generation of
channel type and speech codec list. This might blow an assertion
in gsm0808_create_ass if the generated data is invalid. So
we need to check beforehand.

Change-Id: Ifa7ba00e0d731a3c43a8dbfac893c71d63559eb5
2017-07-25 15:14:14 +02:00
Philipp Maier
114c4ff913 rsl: fix stray line break in logtext
The log output from the rsl layer injects line breaks at wrong
places in the log. This messes up the logtext. This commit fixes
the problem.

Change-Id: Ibebffd52a551ead0f5486a56a92774204b337c7d
2017-07-25 15:14:14 +02:00
Philipp Maier
9fa9783dc6 mgcp: fix line-break problem in log
When the mgcp_client prints MGCP strings in the log text, it does
not remove the line break before printing. This will mess up
the log text. This patch removes the line break characters before
printing properly.

Change-Id: I7fce23a50371ce94a8f2d8aef2fe9d2001d41b8c
2017-07-25 15:14:14 +02:00
Neels Hofmeyr
3d09bbbbc4 apply function renames in merged libosmocore patches
Change-Id: Ic659d6d79a6284732e1837f8b0947e8a128ddd87
2017-07-25 15:14:14 +02:00
Philipp Maier
34ed929877 osmo-bsc: react on reset requests from MSC
The bsc side currently can not receive reset commands from an
MSC. This patch adds required functionality to receive a reset
command and acknowlege it properly. The effects are the same
as with when sending resets (all drop all ongoing calls and
sccp connections)

Change-Id: I44c7e54c845948c54614b36d97d2ba1e760ac46b
2017-07-25 15:14:14 +02:00
Philipp Maier
fef5ee84f2 libcommon-cs: genralize a interface reset fsm
The AoIP standard also describes an MSC->BSC reset procedure. We
currently do not implement it. However, the fsm that is used to
issue the reset request from the bsc side is not generalized. This
patch generalizes the code in order to be able to use the same
code on the MSC side to perform a reset procedure from there.

Change-Id: I65e20bebb126ba35122ca3a545393d18fcadf5ad
2017-07-25 15:14:14 +02:00
Philipp Maier
ad228e16cf fixup: remove unused counter
Forgot to remove the counter struct osmo_timer_list msc_reset_timer;
Needs to be fixuped into the reset handling patches

Change-Id: I6d397188732f4593edc12459de6f3b5f47b7f06a
2017-07-25 15:14:14 +02:00
Philipp Maier
869842e16c sccp-lite: remove old sccp-lite code
in osmo_bsc_sccp.c all code is commented out. There is no point
in keeping the file. This commit deletes it.

Change-Id: I5c9f15a658c41fd872db7b078d38fbfdeb2bdcbd
2017-07-25 15:14:14 +02:00
Philipp Maier
3bac10082a osmo-bsc: Send USSD notification when an MSC loss is detected
the old sccp-lite based imlementation offered support for sending
an USSD notification as soon as a loss of the MSC connection is
detected. This is done before forcefully dropping the affected
connection.

This commit ports the feature to the new libosmo-sigtran
implementation.

NOTE: I do not know if this works and I also do not really
understand how this is even possible. Sending an USSD notification
would rquire the subscriber to be properly attached? When the MSC
is lost this almost not possible since no backend to authenticate
against is available.

Change-Id: Idaadf8d708608843e3c36ed35b3661b48096c21b
2017-07-25 15:14:14 +02:00
Philipp Maier
158d842969 cosmetic: make function names in a_iface_bssap more expressive.
The function names in a_iface_bssap.c are not very expressive.
The problem not only exists on the API side, but also for static
functions. This patch replaces the function names with more
expressive names.

Change-Id: I1cdf37e4034ed8a9536c253c13910fc436c66f04
2017-07-25 15:14:14 +02:00
Philipp Maier
a2ec888287 cosmetic: more expressive function names in a_iface
The function names if the API function in a_iface.c are not
very expressive. Besides of that, the prototypes are in the
wrong header file. This commit gives the function more
expressive names and moves the prototypes in the right header
file.

Change-Id: I6af4b7deed9d11ac5fe188eb5625fba50caad7c1
2017-07-25 15:14:14 +02:00
Philipp Maier
1a331b5405 fixup: return with value in void function
Change-Id: Iab2569205eac9cb96a7d6f756f087413af5fc68c
2017-07-25 15:14:13 +02:00
Philipp Maier
83d75bb19a mgcp: make bts base port configurable
Currently the rtp base port of the BTS is hardcoded (4000) and not
configurable. This patch adds VTY configuration options to make
it adjustable.

Change-Id: I76e008eb0bd95b2941b67ea2fbdc1a82eef3cc5f
2017-07-25 15:14:13 +02:00
Philipp Maier
7a8e4a0215 Revert "mgcp: make sure all endpoints are closed on startup"
Clearing all endpoints by sending a DLCX on startup has ben found
to be a bit too offensive. It also will not help against
inconsitancies that may occour during runtime (e.g. an overheard
DLCX during regular call teardown).

This reverts commit b669ea94cb78fd9b56ee8dd9392538151349f8ba.

Change-Id: Ia3bd8bfe9a09e300cf11629f7d7e3012ca8f394d
2017-07-25 15:14:13 +02:00
Philipp Maier
d4d44cacbc mgcp: Make sure endpoint is free on CRCX
The MSC is aware of the assigned endpoints at all times, so it
will not assign an occupied endpoint to someone else. However,
if it has just restarted, there maybe lingering open endpoints.

This patch introduces a fairly simple soultion. Before a new
endpoint is seized (CRCX), a DLCX is send in advance. If the
endpoint was still occupied with a dead connection, it will
be freed. If it was free anyway, the DLCX will just have no
effect.

Change-Id: I7990e9e7c4c8101b8772ab5505a7cc11f8f7cd23
2017-07-25 15:14:13 +02:00
Philipp Maier
554488dee8 a_iface_bssap: clear lingering subscriber connections on reset
When the BSC is vanishing, the subscriber connections will stay
active until the MSC is instructed via tha A interface to clear
the connections. Unfortunately, this will most likely not be
the case because the BSC will most likeley have lost all its
state and does not know about the old connections anymore.

This patch fixes the problem by looping through the list with
the active gsm subscriber connections and clearing them manually
when the reset from the BSC is received. Only connections by the
bsc who actually executes the reset are affected. Connections
from other BSCs will not be touched.

Change-Id: Ic2b43b937d08a6dea4fe70dbc3eb722323338dc1
2017-07-25 15:14:13 +02:00
Philipp Maier
d46c75dac9 cosmetic: fix typo
Change-Id: I2cfea36a5626605ecb72d0f0927ac1a731aa1609
2017-07-25 15:14:13 +02:00
Philipp Maier
2a6629b27e mgcp: make sure all endpoints are closed on startup
If the MSC is crashing and restarting, it may leave some endpoints
open. The endpoints can not be re-used until they are deleted
(DLCX). This patch sends a DLCX to all possible endpoints (usually
this is in a countable range) in order to clear possible open
endpoints from a previous run

Change-Id: I9de2f67ffe08b2d76574ef4470c7a9767ca74702
2017-07-25 15:14:13 +02:00
Philipp Maier
95e1a3b53c mgcp: make structs accessible from outside
struct mgcpgw_client and struct mgcp_inuse_endpoint are not
accessible from outside, making it difficult to look in the
mgcp client properties and status. The commit moves the
structs into the header file.

Change-Id: I20dcdaac013e3bcbd870eaf34a17598eac373f95
2017-07-25 15:14:13 +02:00
Philipp Maier
00a0862e9c mgcp: release no longer used endpoint identifiers
When an MGCP endpoint is deleted, we need to mark its endpoint
id as unused, so other calls can used it. This is currently not
happening. This patch fixes that.

Change-Id: I346affea940efb3a55e9b34c28a6cbe676d57d56
2017-07-25 15:14:13 +02:00
Philipp Maier
d4195472f5 mgcp: improve endpoint management
Currently the assignment of endpoint identifiers works by just
incrementing a counter. The mgcpgw only has a limited amount
of endpoint identifiers avaliable, this means we will run out
of endpoints after only a few calls.

This commit adds a mechanism to keep track of used endpoint
identifiers so unused endpoint identifiers can be re-used

Change-Id: I081f9178975b6593a7ab8de5261a29a1d43d36a3
2017-07-25 15:14:13 +02:00
Philipp Maier
741b987923 mgcp: use mgcp DLCX command to terminate endpoint after call is done
Currently no DLCX command is sent to the mgcpgw when a call is over,
this leaves the endpoint open. This means that the endpoint can not
never be reused by other calls. This patch adds a DLCX that
terminates the the endpoint when the call is done.

Change-Id: Ifc5a7a62fc07b4b7fee612d52e949fcd6a8e04ed
2017-07-25 15:14:13 +02:00
Philipp Maier
3398964176 mgcp: add DLCX command to mgcpgw client
The mgcpgw client currently lacks support for DLCX. This patch
adds a generator function to generate a DLCX command as well.

Change-Id: I1ac4635fc1371f2d3a46815f26a1f9ede3eedafa
2017-07-25 15:14:13 +02:00
Philipp Maier
c5bb5816cd cosmetic: fixing coding style
Change-Id: I9dc3b1d2990ad6c89932d77632c3b22748e8361e
2017-07-25 15:14:13 +02:00
Philipp Maier
1c832b34b1 fixup: in osmo-bsc-sigtran.h header (bsc_msc_data.h) was missing
Change-Id: I4220bc9a3a6f13fd6b09c3a7edadea5b8823d1c5
2017-07-25 15:14:13 +02:00
Philipp Maier
88e9ecbfb5 osmo-bsc: Handle RESET/RESET-ACK properly
Improve the way the BSC executes its RESET/RESET-ACK sequence.
Currently only a simple bool variable serves as a state holder.
We set this variable to true when we receive the RESET-ACK
message. Unfortunately no further checking is done. This
patch replaces the old mechanism with a more elaborated
implementation which also detects a loss of the connection
and makes sure to reconnect properly afterwards. Also the
all open connections are closed on connection loss

Change-Id: I876319b15103cc395e74597a52ce4d1a934915f4
2017-07-25 15:14:13 +02:00
Philipp Maier
3386a8791e sccp: Use osmo-stp instead of direct server/client connection
This patch adjusts the code to use osmo-stp. This is only an
intermediate solution, since we still have hardcoded parameter.
Next step is to use the VTY options from libosmo-sigtran to
issue the configurations.

Change-Id: I2b02bf159051beed6ff3afc66fcfb7a30e8d2541
2017-07-25 15:14:13 +02:00
Philipp Maier
2529f046e8 fixup for: aoip: signal channel type to BSC
The channel type and the speech codec element is now
signalled to the BSC. The BSC checks both fields and
select a codec by its preference. The choosen speech
codec and the choosen channel (type) is returned to
the MSC. Currently the MSC ignores the return values

Change-Id: I5c422a1e831f572e493db9756cf45e7a0b7ec7d0
2017-07-25 15:14:13 +02:00
Philipp Maier
ae819a1be4 aoip: signal channel type to BSC
obtain the permitted speech and the prefered channel parameters
and signal it to the MSC with the channel type field.

Change-Id: I642480fa408dee7a4f40f7aab95f40383b3e91af
2017-07-25 15:14:13 +02:00
Philipp Maier
2878423b95 osmo-msc: Integrate A interface into existing call control
The MSC already has some basic call control handling mechanism, that
was primarily used with 3G before. However, the already existing
code that handles the 3G calls is also perfectly fine for handling
2G calls. This commit integrates the A interface without breaking
it for 3G.

Change-Id: Ib61cf2987823958314c9016d5a3f494c1aaaabbc
2017-07-25 15:14:13 +02:00
Philipp Maier
714b2281b8 osmo-bsc: Negotiate rtp ip address/port with BTS
This patch adds the support for the RTP IP-Address/Port assignment.
The post communicated via the assignment request is now transmitted
via RSL/IPACC to the BTS. The Response containing the RX-Port at
the BTS side is communicated back to the MSC.

Since we plan to add a private MGCPGW to each BSC, this has to
be extended. Currently it only creates a direct connection to
the BTS. This will be introduced with a future patch.

Change-Id: I693e428b6bfdd8534eb5b88fa4d47dac20db88ea
2017-07-25 15:14:13 +02:00
Philipp Maier
c7aa82b109 fixup: Hexdump for incoming unit data was missing
Change-Id: Ie867455f12eba5b5091424796a9dbf5140890e41
2017-07-25 15:14:13 +02:00
Neels Hofmeyr
d69cdf75e0 comment: fixme to cleanup MGCP ports
Change-Id: Ibbd8279116262c3adcb35e9f3d417b6d7da40d5a
Related: OS#2279
2017-07-25 15:14:13 +02:00
Neels Hofmeyr
6cad4c3e7f msc: enable basic CTRL commands
So far CTRL was not used by anyone, and was still disabled from the initial
implementation of the OsmoMSC. Now we need it in osmo-gsm-tester.

Only add the MSC specific CTRL commands, the bsc_base_ctrl_cmds_install() still
needs to be split up.

Change-Id: I373279ccea8941c237330c3404c63d4924c5ffa0
2017-07-25 15:14:13 +02:00
Neels Hofmeyr
2238185739 sgsn: add missing osmo_ss7_init()
Change-Id: Ibcf73383bbf2b94f308b4d5bc4e69b652c73ce6e
2017-07-25 15:14:13 +02:00
Neels Hofmeyr
456dbb8070 drop libosmo-ranap from sms_queue test
Change-Id: I93d4a7d54c39cc2c1b4e8e30df7b0b410ac00786
2017-07-25 15:14:13 +02:00
Neels Hofmeyr
a3df1f8732 wip iudummy struct osmo_sccp_addr -- drop this?
Change-Id: Ie1df8502c0b1a504b552cfe24ddc2717b672c300
2017-07-25 15:14:13 +02:00
Philipp Maier
e66311b1bd WIP: Integrate AoIP into MSC
Change-Id: Iaf7deff397ec95b744fe287e713bbdd6a1ee73cf
2017-07-25 15:12:32 +02:00
Philipp Maier
7e77a293a5 libmsc: make pitfall in gsm0408_dispatch() more obvious
The function gsm0408_dispatch() accepts a message buffer pointer
and accesses the l3h pointer. Even in a properly allocated
message buffer, this may lead into a segfault if the user forgets
to set the l3h pointer. This commit adds assertions to popup a
more expressive error message.

Change-Id: I43bd9bd1c170559aaa8dacaef25dba090744bcd5
2017-07-25 01:06:57 +02:00
Philipp Maier
2932bc4955 WIP: Integrate AoIP into OsmoBSC
Change-Id: I5ae4e05ee7c57cad341ea5e86af37c1f6b0ffa77
2017-07-25 01:06:57 +02:00
Harald Welte
1168969378 WIP: Port to new libosmo-sigtran API (with proper M3UA for Iuh)
This changes over to the new libosmo-sigtran API with support for
proper SCCP/M3UA/SCTP stacking, as mandated by 3GPP specifications for
the IuCS and IuPS interfaces.

Only the ASP (client) is used, assuming that both the HNB-GWs and RNCs
as well as the MSCs and SGSNs are all connecting as ASP to some STP/SGW
which offers M3UA server functionality as well as point-code and/or
global title based routing.

Change-Id: I450e22d46e47eec350a152f7832428f226bf17fc
Tweaked-by: nhofmeyr (test expectation)
2017-07-25 01:06:57 +02:00
Daniel Willmann
3d5990fc65 examples/sgsn: Use osmo-hlr with auth-policy remote by default
Change-Id: Ie3b2013198d3e2b780a4e31c36b89b58129dcacd
2017-07-25 01:06:56 +02:00
Daniel Willmann
21ca60807c contrib: Change systemd requirements so the services connect properly
Change-Id: Ib1b3c640ddd81927a60ee307c4b0cb90fd83eebe
2017-07-25 01:06:56 +02:00
Daniel Willmann
aba422a6cc examples: Change IP address of config files
This helps in providing 3G software packages for the sysmoNITB hardware.

Change-Id: Ie3a25f6771ed6e620cb2b315638c622a9a24e530
2017-07-25 01:06:56 +02:00
Daniel Willmann
d0a25a05a2 contrib: Add osmo-msc service file
Change-Id: Ifdaf4107167c84af8a616f4ee792d5a34495564b
2017-07-25 01:06:56 +02:00
Neels Hofmeyr
bbc26f444a temporary dev: set debug log level almost everywhere
Change-Id: I851d8d5791caa301c0b06eca295d05837834a3ee
2017-07-25 01:06:56 +02:00
Neels Hofmeyr
c49975de02 log protocol discriminators and message types by name
Change-Id: Ida205d217e304337d816b14fd15e2ee435e7397d
Depends: libosmocore change-id I0fca8e95ed5c2148b1a7440eff3fc9c7583898df
2017-07-25 01:06:56 +02:00
Neels Hofmeyr
6a87169a31 mgcp: hack RAB success from nano3G: patch first RTP payload
The ip.access nano3G needs the first RTP payload's first two bytes to read hex
'e400', or it will reject the RAB assignment. Add flag
patched_first_rtp_payload to mgcp_rtp_state to detect the first RTP payload on
a stream, and overwrite its first bytes with e400. This should probably be
configurable, but seems to not harm other femto cells (as long as we patch only
the first RTP payload in each stream). Only do this when sending to the BTS
side.

Change-Id: I5eff04dcb0936e21690e427ae5e49228cd459bd4
2017-07-25 01:06:56 +02:00
Neels Hofmeyr
3a0b3b2182 msc_vlr_tests: add missing wrap for ranap_iu_tx_release()
It seems merely luck that the tests worked so far without this wrap. Adjust
test logs now indicating where we actually send an Iu Release -- and leaving
gaping holes where we don't. To be fixed in another commit.

Change-Id: I770f5f058c72539ff4a2913b076fee8440248fd9
2017-07-25 01:06:56 +02:00
Neels Hofmeyr
3f8fdf0e7a Implement IuCS (large refactoring and addition)
osmo-nitb becomes osmo-msc
add DIUCS debug log constant
add iucs.[hc]
add msc vty, remove nitb vty
add libiudummy, to avoid linking Iu deps in tests
Use new msc_tx_dtap() instead of gsm0808_submit_dtap()
libmgcp: add mgcpgw client API
bridge calls via mgcpgw

mgcp: hack RAB success from nano3G: patch first RTP payload
The ip.access nano3G needs the first RTP payload's first two bytes to read hex
'e400', or it will reject the RAB assignment. Add flag
patched_first_rtp_payload to mgcp_rtp_state to detect the first RTP payload on
a stream, and overwrite its first bytes with e400. This should probably be
configurable, but seems to not harm other femto cells (as long as we patch only
the first RTP payload in each stream). Only do this when sending to the BTS
side.

Change-Id: I5b5b6a9678b458affa86800afb1ec726e66eed88
2017-07-25 01:06:56 +02:00
Neels Hofmeyr
36e6e7f074 sgsn init: pass sgsn_config pointer to sgsn_vty_init(), not sgsn_parse_config
In an upcoming commit, sgsn_vty_init() will require access to the global sgsn
config struct to initialize a generic VTY command with the proper config
destination address, see Change-Id I5b5b6a9678b458affa86800afb1ec726e66eed88.

Change-Id: Ie6b6e5422987586531a898e0c5b867623dbecb0f
2017-07-25 01:06:56 +02:00
Neels Hofmeyr
03f51df03c mscsplit: various preparations to separate MSC from BSC
Disable large parts of the code that depend on BSC presence. The code sections
disabled by #if BEFORE_MSCSPLIT shall be modified or dropped in the course of
adding the A-interface.

Don't set msg->lchan nor msg->dst.
Don't use lchan in libmsc.
Decouple lac from bts.

Prepare entry/exit point for MSC -> BSC and MSC -> RNC communication:
Add msc_ifaces.[hc], a_iface.c, with a general msc_tx_dtap() to redirect to
different interfaces depending on the actual subscriber connection.
While iu_tx() is going to be functional fairly soon, the a_tx() is going to be
just a dummy for some time (see comment).
Add Iu specific fields in gsm_subscriber_connection: the UE connection pointer
and an indicator for the Integrity Protection status on Iu (to be fully
implemented in later commits).
Add lac member to gsm_subscriber_connection, to allow decoupling from
bts->location_area_code. The conn->lac will actually be set in iu.c in an
upcoming commit ("add iucs.[hc]").

move to libcommon-cs: gsm48_extract_mi(), gsm48_paging_extract_mi().

libmsc: duplicate gsm0808 / gsm48 functions (towards BSC).
In osmo-nitb, libmsc would directly call the functions on the BSC level, not
always via the bsc_api. When separating libmsc from libbsc, some functions are
missing from the linkage.
Hence duplicate these functions to libmsc, add an msc_ prefix for clarity, also
add a _tx to gsm0808_cipher_mode():
* add msc_gsm0808_tx_cipher_mode() (dummy/stub)
* add msc_gsm48_tx_mm_serv_ack()
* add msc_gsm48_tx_mm_serv_rej()
Call these from libmsc instead of
* gsm0808_cipher_mode()
* gsm48_tx_mm_serv_ack()
* gsm48_tx_mm_serv_rej()
Also add a comment related to msc_gsm0808_tx_cipher_mode() in two places.

Remove internal RTP streaming code; OsmoNITB supported that, but for OsmoMSC,
this will be done with an external MGCP gateway.

Remove LCHAN_MODIFY from internal MNCC state machine.

Temporarily disable all paging to be able to link libmsc without libbsc.
Skip the paging part of channel_test because the paging is now disabled.
Employ fake paging shims in order for msc_vlr_tests to still work.

msc_compl_l3(): publish in .h, tweak return value.  Use new libmsc enum values
for return val, to avoid dependency on libbsc headers.  Make callable from
other scopes: publish in osmo_msc.h and remove 'static' in osmo_msc.c

add gsm_encr to subscr_conn
move subscr_request to gsm_subscriber.h
subscr_request_channel() -> subscr_request_conn()
move to libmsc: osmo_stats_vty_add_cmds()
gsm_04_08: remove apply_codec_restrictions()
gsm0408_test: use NULL for root ctx
move to libbsc: gsm_bts_neighbor()
move to libbsc: lchan_next_meas_rep()
move vty config for t3212 to network level (periodic lu)
remove unneccessary linking from some tests
remove handle_abisip_signal()
abis_rsl.c: don't use libvlr from libbsc

gsm_subscriber_connection: put the LAC here, so that it is available without
accessing conn->bts. In bsc_api.c, place this lac in conn for the sake of
transition: Iu and A will use this new field to pass the LAC around, but in a
completely separate OsmoBSC this is not actually needed. It can be removed
again from osmo-bsc.git when the time has come.

Siemens MRPCI: completely drop sending the MRPCI messages for now, they shall
be added in osmo-bsc once the A-Interface code has settled. See OS#2389.

Related: OS#1845 OS#2257 OS#2389
Change-Id: Id3705236350d5f69e447046b0a764bbabc3d493c
2017-07-25 01:06:28 +02:00
Harald Welte
46f4f14024 SGSN: Don't indicate GERAN in Iu mode PDP CTX ACT REQ to GGSN
Change-Id: Ifd9ff4342de342475609bad0257a23c50290e23b
2017-07-23 04:30:44 +02:00
Neels Hofmeyr
ecd8c048fc IuPS: explicitly check RAN type; move comment
Change-Id: I054d72590dfb2012f6f8506d3a5f8fd2953194e1
2017-07-23 04:30:44 +02:00
Neels Hofmeyr
ed739b9dac IuPS: don't require an MM context for Iu Release
Change-Id: I8b4d08b3ee8add1f1d54efb13985eabe0c9d31f3
2017-07-23 04:30:44 +02:00
Neels Hofmeyr
5322912630 SI3: indicate R99+ MSC to GSM MS to enable UMTS AKA
Change-Id: I796e1f4281628061f4522c43c549de9e751bc045
2017-07-23 04:30:44 +02:00
Neels Hofmeyr
772205aae1 cosmetic: make osmo-python-tests dependency more accurate
Change-Id: I4f84a13b7fa6ec4173bdc155e6114d4d7328b619
2017-07-23 04:30:44 +02:00
Neels Hofmeyr
853883d1f6 osmo-nitb: change default db name to sms.db
libvlr now delegates subscriber management to osmo-hlr, so the database no
longer represents a HLR. It basically only stores SMS, so reflect that fact in
the default database name.

Change-Id: I3289d68d3eb63aff940b48a25b584d5e83cd0197
2017-07-23 04:30:44 +02:00
Neels Hofmeyr
6a29d326e0 Add msc_vlr test suite for MSC+VLR end-to-end tests
Change-Id: If0e7cf20b9d1eac12126955b2f5f02bd8f1192cd
2017-07-23 04:30:05 +02:00
Harald Welte
2483f1b050 Use libvlr in libmsc (large refactoring)
Original libvlr code is by Harald Welte <laforge@gnumonks.org>,
polished and tweaked by Neels Hofmeyr <nhofmeyr@sysmocom.de>.

This is a long series of trial-and-error development collapsed in one patch.
This may be split in smaller commits if reviewers prefer that. If we can keep
it as one, we have saved ourselves the additional separation work.

SMS:

The SQL based lookup of SMS for attached subscribers no longer works since the
SQL database no longer has the subscriber data. Replace with a round-robin on
the SMS recipient MSISDNs paired with a VLR subscriber RAM lookup whether the
subscriber is currently attached.

If there are many SMS for not-attached subscribers in the SMS database, this
will become inefficient: a DB hit returns a pending SMS, the RAM lookup will
reveal that the subscriber is not attached, after which the DB is hit for the
next SMS. It would become more efficient e.g. by having an MSISDN based hash
list for the VLR subscribers and by marking non-attached SMS recipients in the
SMS database so that they can be excluded with the SQL query already.

There is a sanity limit to do at most 100 db hits per attempt to find a pending
SMS. So if there are more than 100 stored SMS waiting for their recipients to
actually attach to the MSC, it may take more than one SMS queue trigger to
deliver SMS for subscribers that are actually attached.

This is not very beautiful, but is merely intended to carry us over to a time
when we have a proper separate SMSC entity.

Introduce gsm_subscriber_connection ref-counting in libmsc.

Remove/Disable VTY and CTRL commands to create subscribers, which is now a task
of the OsmoHLR. Adjust the python tests accordingly.

Remove VTY cmd subscriber-keep-in-ram.

Use OSMO_GSUP_PORT = 4222 instead of 2222. See
I4222e21686c823985be8ff1f16b1182be8ad6175.

So far use the LAC from conn->bts, will be replaced by conn->lac in
Id3705236350d5f69e447046b0a764bbabc3d493c.

Related: OS#1592 OS#1974
Change-Id: I639544a6cdda77a3aafc4e3446a55393f60e4050
2017-07-23 04:08:43 +02:00
Harald Welte
b8b85a1b2e Add libvlr implementation
Original libvlr code is by Harald Welte <laforge@gnumonks.org>,
polished and tweaked by Neels Hofmeyr <nhofmeyr@sysmocom.de>.

This is a long series of trial-and-error development collapsed in one patch.
This may be split in smaller commits if reviewers prefer that. If we can keep
it as one, we have saved ourselves the additional separation work.

Related: OS#1592
Change-Id: Ie303c98f8c18e40c87c1b68474b35de332033622
2017-07-21 18:32:03 +02:00
Neels Hofmeyr
53edff3c70 jenkins: pass proper configure flags to make distcheck
Enable various components according to the build matrix during make distcheck.
Add python tests, osmo-bsc, nat, ...

Change-Id: Ic724cf61d44409337414dc58c8795896b4b97a8a
2017-07-21 03:48:01 +02:00
Neels Hofmeyr
625e05a6b2 fix make distcheck with python tests
- bscs.config needed by the vty tests was not picked up as a dist file, because
  its suffix is not 'cfg'. Rename to *.cfg. Apply this rename in
  vty_test_runner.py and osmo-bsc_nat.cfg.
- Remove restart counters after external tests, otherwise distcheck complains
  about uncleaned files.
- Add contrib/ipa.py to EXTRA_DIST, hence add a Makefile.am to contrib/.
  Otherwise the python tests cannot find that dependency.

Change-Id: I42b55cb1125099afc3a8e3f87c0e398426b2e2a9
2017-07-21 03:39:38 +02:00
Neels Hofmeyr
3355fd674f logging: auth request: use hexdump without spaces for RAND, AUTN
Change-Id: Ie16bb2c01e770914f411bfb34b523c56ea9fab81
2017-07-13 02:17:39 +00:00
Neels Hofmeyr
f2ba81303e gsup_client: allow passing a unit id to identify with HLR
Before, each GSUP client would contact the HLR with an identical unit id, i.e.
"SGSN-00-00-00-00-00-00", with the result that some messages were sucked off by
the wrong client.

Pass explicit unit name from each gsup client user, so that OsmoMSC is "MSC"
and OsmoSGSN is "SGSN". Hence the HLR can properly route the messages.

Todo: also set some values instead of the zeros.

Unrelated cosmetic change while editing the arguments: gsup_client_create()'s
definition's oap client config arg name mismatched the one used in the
declaration. Use oapc_config in both.

Change-Id: I0a60681ab4a4d73e26fe8f0637447db4b6fe6eb2
2017-07-13 02:17:31 +00:00
Neels Hofmeyr
cbafa255cc GPRS/IuPS: remove all 3G authentication dev hacks
UMTS auth works now with the external OsmoHLR.

Change-Id: Ie42945bb687b077fd0ee430c2711d19782151610
2017-07-13 02:17:23 +00:00
Neels Hofmeyr
14ce472225 git-version-gen: look for .git in ./, not ../
Change-Id: Ic71cfb8dde0a43325b50c75aae1e6ef3c3008501
2017-07-12 23:28:38 +00:00
Neels Hofmeyr
c00d016e20 join openbsc/.gitignore with .gitignore
Change-Id: Ib2120592749e85a4d13f6668e198857e3bddcf1e
2017-07-12 23:28:24 +00:00
Neels Hofmeyr
f29ff888a2 jenkins: apply rename to osmo-msc in log marker
Change-Id: I8ca9a1a8bdb5b9615df5f19f0c1017cb9383f6ee
2017-07-12 23:28:11 +00:00
Neels Hofmeyr
29b9206e80 move openbsc/* to repos root
This is the first step in creating this repository from the legacy openbsc.git.

Like all other Osmocom repositories, keep the autoconf and automake files in
the repository root. openbsc.git has been the sole exception, which ends now.

Change-Id: I9c6f2a448d9cb1cc088cf1cf6918b69d7e69b4e7
2017-07-12 23:17:10 +00:00
Neels Hofmeyr
9e3c66b181 jenkins: fix build of --enable-iu: use osmo-iuh tag 'old_sua'
We are building with libosmo-sccp tag 'old_sua' until the new sigtran has
been applied. Since osmo-iuh commit
  0f88c110093935305143987638e46dc6db304a3e
  "migrate osmo-hnbgw to libosmo-sigtran's SCCP/M3UA"
osmo-iuh requires libosmo-sccp master. A similar 'old_sua' tag is in place in
osmo-iuh.git, to match libosmo-sccp 'old_sua'. Do that to fix the jenkins
build of --enable-iu.

Change-Id: I70f731db0b74ed48ae6dd713ed4c3247222ef0de
2017-07-12 23:42:21 +02:00
495 changed files with 1985 additions and 130572 deletions

82
.gitignore vendored
View File

@@ -1 +1,83 @@
debian/*.log
*.o
*.lo
*.a
.deps
Makefile
Makefile.in
bscconfig.h
bscconfig.h.in
openbsc.pc
src/osmo-nitb/osmo-nitb
src/osmo-bsc_mgcp/osmo-bsc_mgcp
src/osmo-bsc/osmo-bsc
src/utils/meas_vis
src/utils/meas_json
src/utils/osmo-meas-pcap2db
src/utils/osmo-meas-udp2db
src/utils/smpp_mirror
*.*~
*.sw?
.libs
*.pyc
*.gcda
*.gcno
#configure
aclocal.m4
autom4te.cache/
config.log
config.status
config.guess
config.sub
configure
compile
depcomp
install-sh
missing
stamp-h1
libtool
ltmain.sh
# git-version-gen magic
.tarball-version
.version
# apps and app data
hlr.sqlite3
src/utils/bs11_config
src/ipaccess/ipaccess-config
src/ipaccess/abisip-find
src/ipaccess/ipaccess-firmware
src/ipaccess/ipaccess-proxy
src/utils/isdnsync
src/nat/bsc_nat
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-msc/osmo-msc
#tests
tests/testsuite.dir
tests/*/*_test
# ignore compiled binaries like msc_vlr_test_foo; do not ignore
# msc_vlr_test_foo.{c,ok,err}, but do still ignore the corresponding .o object
# files:
tests/msc_vlr/msc_vlr_test_*
!tests/msc_vlr/msc_vlr_test_*.*
tests/msc_vlr/msc_vlr_test_*.o
tests/atconfig
tests/atlocal
tests/package.m4
tests/testsuite
tests/testsuite.log
gsn_restart
src/openbsc.cfg*
writtenconfig/
gtphub_restart_count

View File

@@ -13,10 +13,11 @@ SUBDIRS = \
include \
src \
tests \
contrib \
$(NULL)
pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = openbsc.pc
pkgconfig_DATA = libosmo-legacy-mgcp.pc
BUILT_SOURCES = $(top_srcdir)/.version
EXTRA_DIST = git-version-gen osmoappdesc.py .version

View File

@@ -1,5 +1,5 @@
dnl Process this file with autoconf to produce a configure script
AC_INIT([openbsc],
AC_INIT([osmo-mgw],
m4_esyscmd([./git-version-gen .tarball-version]),
[openbsc@lists.osmocom.org])
@@ -37,40 +37,7 @@ AC_SUBST(LIBRARY_DL)
PKG_CHECK_MODULES(LIBOSMOCORE, libosmocore >= 0.9.5)
PKG_CHECK_MODULES(LIBOSMOVTY, libosmovty >= 0.3.0)
PKG_CHECK_MODULES(LIBOSMOCTRL, libosmoctrl)
PKG_CHECK_MODULES(LIBOSMOGSM, libosmogsm >= 0.9.5)
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)
# Enabke/disable the NAT?
AC_ARG_ENABLE([nat], [AS_HELP_STRING([--enable-nat], [Build the BSC NAT. Requires SCCP])],
[osmo_ac_build_nat="$enableval"],[osmo_ac_build_nat="no"])
if test "$osmo_ac_build_nat" = "yes" ; then
PKG_CHECK_MODULES(LIBOSMOSCCP, libosmo-sccp >= 0.0.2)
fi
AM_CONDITIONAL(BUILD_NAT, test "x$osmo_ac_build_nat" = "xyes")
AC_SUBST(osmo_ac_build_nat)
# Enable/disable the BSC?
AC_ARG_ENABLE([osmo-bsc], [AS_HELP_STRING([--enable-osmo-bsc], [Build the Osmo BSC])],
[osmo_ac_build_bsc="$enableval"],[osmo_ac_build_bsc="no"])
if test "$osmo_ac_build_bsc" = "yes" ; then
PKG_CHECK_MODULES(LIBOSMOSCCP, libosmo-sccp >= 0.0.6)
fi
AM_CONDITIONAL(BUILD_BSC, test "x$osmo_ac_build_bsc" = "xyes")
AC_SUBST(osmo_ac_build_bsc)
# Enable/disable smpp support in the nitb?
AC_ARG_ENABLE([smpp], [AS_HELP_STRING([--enable-smpp], [Build the SMPP interface])],
[osmo_ac_build_smpp="$enableval"],[osmo_ac_build_smpp="no"])
if test "$osmo_ac_build_smpp" = "yes" ; then
PKG_CHECK_MODULES(LIBSMPP34, libsmpp34 >= 1.10)
AC_DEFINE(BUILD_SMPP, 1, [Define if we want to build SMPP])
fi
AM_CONDITIONAL(BUILD_SMPP, test "x$osmo_ac_build_smpp" = "xyes")
AC_SUBST(osmo_ac_build_smpp)
# Enable/disable transcoding within osmo-bsc_mgcp?
AC_ARG_ENABLE([mgcp-transcoding], [AS_HELP_STRING([--enable-mgcp-transcoding], [Build the MGCP gateway with internal transcoding enabled.])],
@@ -88,53 +55,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)
AM_CONDITIONAL(HAVE_LIBGTP, test "$found_libgtp" = yes)
AC_SUBST(found_libgtp)
found_libcares=yes
PKG_CHECK_MODULES([LIBCARES], [libcares], [], [found_libcares=no])
AM_CONDITIONAL(HAVE_LIBCARES, test "$found_libcares" = yes)
AC_SUBST(found_libcares)
found_libgtp_and_libcares=no
if test "$found_libgtp" = "yes" -a "$found_libcares" = "yes"; then
found_libgtp_and_libcares=yes
fi
AC_SUBST(found_libgtp_and_libcares)
dnl checks for header files
AC_HEADER_STDC
AC_CHECK_HEADERS(dbi/dbd.h,,AC_MSG_ERROR(DBI library is not installed))
found_pcap=yes
AC_CHECK_HEADERS(pcap/pcap.h,,found_pcap=no)
AM_CONDITIONAL(HAVE_PCAP, test "$found_pcap" = yes)
found_cdk=yes
AC_CHECK_HEADERS(cdk/cdk.h,,found_cdk=no)
AM_CONDITIONAL(HAVE_LIBCDK, test "$found_cdk" = yes)
found_sqlite3=yes
PKG_CHECK_MODULES(SQLITE3, sqlite3, ,found_sqlite3=no)
AM_CONDITIONAL(HAVE_SQLITE3, test "$found_sqlite3" = yes)
AC_SUBST(found_sqlite3)
dnl Checks for typedefs, structures and compiler characteristics
# The following test is taken from WebKit's webkit.m4
@@ -169,31 +89,6 @@ if test "$enable_coverage" = "yes"; then
AC_SUBST([COVERAGE_LDFLAGS])
fi
AC_DEFUN([CHECK_TM_INCLUDES_TM_GMTOFF], [
AC_CACHE_CHECK(
[whether struct tm has tm_gmtoff member],
osmo_cv_tm_includes_tm_gmtoff,
[AC_LINK_IFELSE([
AC_LANG_PROGRAM([
#include <time.h>
], [
time_t t = time(NULL);
struct tm* lt = localtime(&t);
int off = lt->tm_gmtoff;
])
],
osmo_cv_tm_includes_tm_gmtoff=yes,
osmo_cv_tm_includes_tm_gmtoff=no
)]
)
if test "x$osmo_cv_tm_includes_tm_gmtoff" = xyes; then
AC_DEFINE(HAVE_TM_GMTOFF_IN_TM, 1,
[Define if struct tm has tm_gmtoff member.])
fi
])
CHECK_TM_INCLUDES_TM_GMTOFF
AC_ARG_ENABLE([vty_tests],
AC_HELP_STRING([--enable-vty-tests],
[Include the VTY/CTRL tests in make check (deprecated)
@@ -207,7 +102,7 @@ if test "x$enable_ext_tests" = "xyes" ; then
AM_PATH_PYTHON
AC_CHECK_PROG(OSMOTESTEXT_CHECK,osmotestvty.py,yes)
if test "x$OSMOTESTEXT_CHECK" != "xyes" ; then
AC_MSG_ERROR([Please install osmocom-python to run the VTY/CTRL tests.])
AC_MSG_ERROR([Please install git://osmocom.org/python/osmo-python-tests to run the VTY/CTRL tests.])
fi
fi
AC_MSG_CHECKING([whether to enable VTY/CTRL tests])
@@ -218,49 +113,17 @@ dnl Generate the output
AM_CONFIG_HEADER(bscconfig.h)
AC_OUTPUT(
openbsc.pc
include/openbsc/Makefile
libosmo-legacy-mgcp.pc
include/Makefile
include/osmocom/Makefile
include/osmocom/legacy_mgcp/Makefile
src/Makefile
src/libtrau/Makefile
src/libbsc/Makefile
src/libmsc/Makefile
src/libmgcp/Makefile
src/libcommon/Makefile
src/libfilter/Makefile
src/libiu/Makefile
src/libcommon-cs/Makefile
src/osmo-nitb/Makefile
src/osmo-bsc/Makefile
src/osmo-bsc_nat/Makefile
src/libosmo-legacy-mgcp/Makefile
src/osmo-bsc_mgcp/Makefile
src/ipaccess/Makefile
src/utils/Makefile
src/gprs/Makefile
tests/Makefile
tests/atlocal
tests/gsm0408/Makefile
tests/db/Makefile
tests/channel/Makefile
tests/bsc/Makefile
tests/bsc-nat/Makefile
tests/bsc-nat-trie/Makefile
tests/mgcp/Makefile
tests/gprs/Makefile
tests/gbproxy/Makefile
tests/abis/Makefile
tests/smpp/Makefile
tests/trau/Makefile
tests/sgsn/Makefile
tests/subscr/Makefile
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/legacy_mgcp/Makefile
doc/Makefile
doc/examples/Makefile
contrib/Makefile
Makefile)

1
contrib/Makefile.am Normal file
View File

@@ -0,0 +1 @@
EXTRA_DIST = ipa.py

View File

@@ -19,34 +19,26 @@ export LD_LIBRARY_PATH="$inst/lib"
if [ "x$IU" = "x--enable-iu" ]; then
sccp_branch="old_sua"
osmo_iuh_branch="old_sua"
fi
osmo-build-dep.sh libosmo-abis
osmo-build-dep.sh libosmo-netif
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 " =============================== osmo-mgw ==============================="
echo
set -x
cd "$base"
cd openbsc
autoreconf --install --force
./configure --enable-osmo-bsc --enable-nat $SMPP $MGCP $IU --enable-vty-tests --enable-external-tests
./configure $MGCP --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 \
LD_LIBRARY_PATH="$inst/lib" \
DISTCHECK_CONFIGURE_FLAGS="--enable-osmo-bsc --enable-nat $SMPP $MGCP $IU --enable-vty-tests --enable-external-tests" \
$MAKE distcheck \
|| cat-testlogs.sh

1
debian/autoreconf vendored
View File

@@ -1 +0,0 @@
openbsc

76
debian/changelog vendored
View File

@@ -1,75 +1,5 @@
openbsc (0.15.1) UNRELEASED; urgency=medium
osmo-mgw (0.1.0) unstable; urgency=low
* 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.
* Initial release.
-- Holger Hans Peter Freyther <holger@moiji-mobile.com> Tue, 24 May 2016 23:14:31 +0200
openbsc (0.14.0) unstable; urgency=low
* New upstream tag and additional patches.
-- Holger Hans Peter Freyther <holger@freyther.de> Sat, 14 Mar 2015 20:33:25 +0100
openbsc (0.12.0+git26-7) unstable; urgency=low
* 64bit fix for the MGCP rewriting
-- Holger Hans Peter Freyther <holger@freyther.de> Wed, 07 Nov 2012 11:39:34 +0100
openbsc (0.12.0+git26-6) precise; urgency=low
* Added init script for osmocom-sgsn.
-- Eric Butler <eric@codebutler.com> Fri, 24 Aug 2012 21:04:32 -0700
openbsc (0.12.0+git26-5) precise; urgency=low
* Don't enable MNCC sock by default.
* Automatically create important directories.
* Fix init script 'stop' command.
-- Eric Butler <eric@codebutler.com> Fri, 24 Aug 2012 20:56:33 -0700
openbsc (0.12.0+git26-4) precise; urgency=low
* Specify HLR path and enable RTP proxy.
-- Eric Butler <eric@codebutler.com> Mon, 20 Aug 2012 00:21:07 -0700
openbsc (0.12.0+git26-3) precise; urgency=low
* Fix init script.
-- Eric Butler <eric@codebutler.com> Sun, 19 Aug 2012 16:05:44 -0700
openbsc (0.12.0+git26-2) precise; urgency=low
* Fix libdbi package dependency.
-- Eric Butler <eric@codebutler.com> Wed, 15 Aug 2012 00:35:37 -0700
openbsc (0.12.0+git26-1) precise; urgency=low
* Fix version issue.
-- Eric Butler <eric@codebutler.com> Tue, 14 Aug 2012 21:00:51 -0700
openbsc (0.12.0+git26) precise; urgency=low
* Updated ubuntu package.
-- Eric Butler <eric@codebutler.com> Tue, 14 Aug 2012 17:36:51 -0700
openbsc (0.9.13.115.eb113-1) natty; urgency=low
* New upstream release
-- Harald Welte <laforge@gnumonks.org> Wed, 11 May 2011 18:41:24 +0000
openbsc (0.9.4-1) unstable; urgency=low
* Initial release
-- Harald Welte <laforge@gnumonks.org> Tue, 24 Aug 2010 13:34:24 +0200
-- Alexander Couzens <lynxis@fe80.eu> Tue, 08 Aug 2017 01:12:53 +0000

202
debian/control vendored
View File

@@ -1,181 +1,49 @@
Source: openbsc
Maintainer: Harald Welte <laforge@gnumonks.org>
Source: osmo-mgw
Section: net
Priority: optional
Build-Depends: debhelper (>= 9),
autotools-dev,
autoconf-archive,
pkg-config,
libgtp-dev,
libosmocore-dev,
libosmo-sccp-dev,
libdbi0-dev,
Priority: extra
Maintainer: Alexander Couzens <lynxis@fe80.eu>
Build-Depends: debhelper (>=9),
dh-autoreconf,
libosmo-abis-dev,
libosmo-netif-dev,
libdbd-sqlite3,
libpcap-dev,
libssl-dev,
libc-ares-dev,
libsmpp34-dev
pkg-config,
autotools-dev,
libosmocore-dev,
libosmo-netif-dev
Standards-Version: 3.9.8
Vcs-Git: git://bs11-abis.gnumonks.org/openbsc.git
Vcs-Browser: http://openbsc.osmocom.org/trac/browser
Homepage: https://projects.osmocom.org/projects/openbsc
Vcs-Git: git://git.osmocom.org/osmo-iuh.git
Vcs-Browser: https://git.osmocom.org/osmo-iuh/
Homepage: https://projects.osmocom.org/projects/osmohnbgw
Package: osmocom-bsc
Package: osmo-mgw
Architecture: any
Depends: ${shlibs:Depends},
${misc:Depends}
Description: GSM Base Station Controller
This is the BSC-only version of OpenBSC. It requires a Mobile Switching Center
(MSC) to operate.
.
You might rather prefer to use osmocom-nitb which is considered a
"GSM Network-in-a-Box" and does not depend on a MSC.
Multi-Arch: foreign
Depends: libosmo-legacy-mgcp0, ${misc:Depends}, ${shlibs:Depends}
Description: OsmoMGW: Osmocom's Media Gateway for 2G and 3G circuit-switched mobile networks
Package: osmocom-nitb
Architecture: any
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.
Package: osmocom-ipaccess-utils
Architecture: any
Depends: ${shlibs:Depends},
${misc:Depends}
Description: Command line utilities for ip.access nanoBTS
This package contains utilities that are specific for nanoBTS when being used
together with OpenBSC. It contains mainly three tools: ipaccess-find,
ipaccess-config and ipaccess-proxy.
Package: osmocom-bs11-utils
Architecture: any
Depends: ${shlibs:Depends},
${misc:Depends}
Description: Command line utilities for Siemens BS-11 BTS
There is a tool in this package for configuring the Siemens BS-11 BTS.
Additionally, it contains one tool for making use of an ISDN-card and the
public telephone network as frequency standard for the E1 line.
Package: osmocom-sgsn
Architecture: any
Depends: ${shlibs:Depends},
${misc:Depends}
Suggests: osmocom-bsc
Description: Osmocom Serving GPRS Support Node
This is an implementation of the GPRS Serving GPRS Support Node (SGSN). As
such it implements the GPRS Mobility Management (GMM) and SM (Session
Management).
.
The SGSN connects via the Gb-interface to the BSS (like the osmo-pcu or an
ip.access nanoBTS), and it connects via the GTP protocol to a Gateway GPRS
Support Node (GGSN) like openggsn.
Package: osmocom-gbproxy
Architecture: any
Depends: ${shlibs:Depends},
${misc:Depends}
Recommends: osmocom-sgsn
Description: Osmocom GPRS Gb Interface Proxy
The purpose of the Gb proxy is to aggregate the Gb links of multiple
BSS's and present them in one Gb link to the SGSN.
.
This package is part of OpenBSC and closely related to osmocom-sgsn.
Package: osmocom-bsc-nat
Architecture: any
Depends: ${shlibs:Depends},
${misc:Depends}
Recommends: osmocom-bsc
Description: Osmocom Base Station Controller Network Address Translation
This NAT is useful for masquerading multiple BSCs behind one. It listens
for incoming BSCs on port 5000 and connects to a specified Mobile Switching
Center (MSC).
.
This package is part of OpenBSC and closely related to osmocom-bsc.
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: 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
Package: osmo-mgw-dbg
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}
Description: Debug symbols for the OpenBSC NITB
Make debugging possible
Multi-Arch: same
Depends: osmo-mgw (= ${binary:Version}), ${misc:Depends}
Description: OsmoMGW: Osmocom's Media Gateway for 2G and 3G circuit-switched mobile networks
Package: osmocom-ipaccess-utils-dbg
Package: libosmo-legacy-mgcp0
Section: libs
Architecture: any
Section: debug
Priority: extra
Depends: osmocom-ipaccess-utils (= ${binary:Version}), ${misc:Depends}
Description: Debug symbols for the OpenBSC ip.access utils
Make debugging possible
Multi-Arch: same
Pre-Depends: ${misc:Pre-Depends}
Depends: ${misc:Depends}, ${shlibs:Depends}
Description: OsmoMGW: Osmocom's Media Gateway for 2G and 3G circuit-switched mobile networks
Package: osmocom-bs11-utils-dbg
Architecture: any
Package: libosmo-legacy-mgcp-dbg
Section: debug
Priority: extra
Depends: osmocom-bs11-utils (= ${binary:Version}), ${misc:Depends}
Description: Debug symbols for the OpenBSC BS11 utils
Make debugging possible
Architecture: any
Multi-Arch: same
Depends: libosmo-legacy-mgcp0 (= ${binary:Version}), ${misc:Depends}
Description: OsmoMGW: Osmocom's Media Gateway for 2G and 3G circuit-switched mobile networks
Package: osmocom-sgsn-dbg
Package: libosmo-legacy-mgcp-dev
Section: libdevel
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
Multi-Arch: same
Depends: libosmo-legacy-mgcp0 (= ${binary:Version}), ${misc:Depends}
Description: OsmoMGW: Osmocom's Media Gateway for 2G and 3G circuit-switched mobile networks

183
debian/copyright vendored
View File

@@ -1,74 +1,14 @@
Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
Upstream-Name: OpenBSC
Source: http://openbsc.osmocom.org/
Upstream-Name: osmo-mgw
Source: git://git.osmocom.org/osmo-mgw
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
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+
Files: openbsc/include/mISDNif.h
Copyright: 2008 Karsten Keil <kkeil@novell.com>
License: LGPL-2.1
Files: openbsc/src/libmgcp/g711common.h
Copyright: 2009 Abramo Bagnara <abramo@alsa-project.org>
License: GPL-2+
Files: openbsc/git-version-gen
Copyright: 2007-2010 Free Software Foundation
License: GPL-3+
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+
Files: openbsc/src/libbsc/bsc_ctrl_lookup.c
Copyright: 2010-2011 Daniel Willmann <daniel@totalueberwachung.de>
2010-2011 On-Waves
License: GPL-2+
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+
Files: debian/*
Copyright: 2012-2015 Holger Hans Peter Freyther <zecke@selfish.org>
2016 Ruben Undheim <ruben.undheim@gmail.com>
License: GPL-2+
License: AGPL-3+
This package is free software; you can redistribute it and/or modify
Files: *
Copyright: 2009-2014 On-Waves
2009-2015 Holger Hans Peter Freyther <zecke@selfish.org>
2013 Jacob Erlbeck <jerlbeck@sysmocom.de>
2016 sysmocom s.m.f.c. GmbH <info@sysmocom.de>
License: AGPL-3.0+
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.
@@ -76,62 +16,67 @@ License: AGPL-3+
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.
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/>.
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.
Files: src/libosmo-legacy-mgcp/g711common.h
Copyright: 2000 Abramo Bagnara <abramo@alsa-project.org>
License: GPL-2.0+
Wrapper for linphone Codec class by Simon Morlat <simon.morlat@linphone.org>
.
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.
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 2 of the License, or
(at your option) any later version.
.
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,
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.
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 Lesser General Public
License along with this library; if not, see <http://www.gnu.org/licenses/>.
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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
.
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".
The FSF address in the above text is the old one.
.
On Debian systems, the complete text of the GNU General Public License
Version 2 can be found in `/usr/share/common-licenses/GPL-2'.
Files: tests/vty_test_runner.py
Copyright: 2013 Holger Hans Peter Freyther
2013 Katerina Barone-Adesi <kat.obsc@gmail.com>
License: GPL-3.0+
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/>.
.
On Debian systems, the complete text of the GNU General Public License
Version 3 can be found in `/usr/share/common-licenses/GPL-3'.
Files: osmoappdesc.py
Copyright: 2013 Katerina Barone-Adesi <kat.obsc@gmail.com>
License: GPL-3.0+
Files: src/libosmo-legacy-mgcp/mgcp_osmux.c
Copyright: 2012-2013 On Waves ehf <http://www.on-waves.com>
2012-2013 Pablo Neira Ayuso <pablo@gnumonks.org>
License: AGPL-3.0+
All rights not specifically granted under this license are reserved.
.
This program is free software; you can redistribute it and/or modify it
under the terms of the GNU Affero General Public License as published by the
Free Software Foundation; either version 3 of the License, or (at your
option) any later version.

1
debian/docs vendored
View File

@@ -1 +0,0 @@
openbsc/README

View File

@@ -0,0 +1,3 @@
usr/include
usr/lib/*/*.so
usr/lib/*/pkgconfig/*.pc

1
debian/libosmo-legacy-mgcp0.install vendored Normal file
View File

@@ -0,0 +1 @@
usr/lib/*/*.so.*

View File

@@ -1,4 +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/
usr/lib/*/pkgconfig/openbsc.pc

View File

@@ -1,2 +0,0 @@
CONFIG_FILE="/etc/osmocom/osmo-gtphub.cfg"

View File

@@ -1 +0,0 @@
openbsc/doc/examples/osmo-gtphub

View File

@@ -1,150 +0,0 @@
#!/bin/sh
### BEGIN INIT INFO
# Provides: osmo-gtphub
# Required-Start: $network $local_fs
# Required-Stop:
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Osmocom GTP hub
# Description: Osmocom GTP hub
### END INIT INFO
# Author: Neels Hofmeyr <nhofmeyr@sysmocom.de>
# PATH should only include /usr/* if it runs after the mountnfs.sh script
PATH=/sbin:/usr/sbin:/bin:/usr/bin
NAME=osmo-gtphub # Introduce the short server's name here
DESC="Osmocom GTP hub" # Introduce a short description here
DAEMON=/usr/bin/osmo-gtphub # Introduce the server's location here
SCRIPTNAME=/etc/init.d/osmo-gtphub
# Exit if the package is not installed
[ -x $DAEMON ] || exit 0
# Read configuration variable file if it is present
[ -r /etc/default/osmo-gtphub ] && . /etc/default/osmo-gtphub
# Load the VERBOSE setting and other rcS variables
. /lib/init/vars.sh
# Define LSB log_* functions.
# Depend on lsb-base (>= 3.0-6) to ensure that this file is present.
. /lib/lsb/init-functions
DAEMON_ARGS="$DAEMON_ARGS -D -c $CONFIG_FILE"
#
# Function that starts the daemon/service
#
do_start()
{
# Return
# 0 if daemon has been started
# 1 if daemon was already running
# 2 if daemon could not be started
start-stop-daemon --start --quiet --exec $DAEMON --test > /dev/null \
|| return 1
start-stop-daemon --start --quiet --exec $DAEMON -- \
$DAEMON_ARGS \
|| return 2
# Add code here, if necessary, that waits for the process to be ready
# to handle requests from services started subsequently which depend
# on this one. As a last resort, sleep for some time.
}
#
# Function that stops the daemon/service
#
do_stop()
{
# Return
# 0 if daemon has been stopped
# 1 if daemon was already stopped
# 2 if daemon could not be stopped
# other if a failure occurred
start-stop-daemon --stop --quiet --retry=TERM/30/KILL/5 --name $NAME
RETVAL="$?"
[ "$RETVAL" = 2 ] && return 2
# Wait for children to finish too if this is a daemon that forks
# and if the daemon is only ever run from this initscript.
# If the above conditions are not satisfied then add some other code
# that waits for the process to drop all resources that could be
# needed by services started subsequently. A last resort is to
# sleep for some time.
start-stop-daemon --stop --quiet --oknodo --retry=0/30/KILL/5 --exec $DAEMON
[ "$?" = 2 ] && return 2
return "$RETVAL"
}
#
# Function that sends a SIGHUP to the daemon/service
#
do_reload() {
#
# If the daemon can reload its configuration without
# restarting (for example, when it is sent a SIGHUP),
# then implement that here.
#
start-stop-daemon --stop --signal 1 --quiet $PIDFILE --name $NAME
return 0
}
case "$1" in
start)
[ "$VERBOSE" != no ] && log_daemon_msg "Starting $DESC " "$NAME"
do_start
case "$?" in
0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;
2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;
esac
;;
stop)
[ "$VERBOSE" != no ] && log_daemon_msg "Stopping $DESC" "$NAME"
do_stop
case "$?" in
0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;
2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;
esac
;;
status)
status_of_proc "$DAEMON" "$NAME" && exit 0 || exit $?
;;
#reload|force-reload)
#
# If do_reload() is not implemented then leave this commented out
# and leave 'force-reload' as an alias for 'restart'.
#
#log_daemon_msg "Reloading $DESC" "$NAME"
#do_reload
#log_end_msg $?
#;;
restart|force-reload)
#
# If the "reload" option is implemented then remove the
# 'force-reload' alias
#
log_daemon_msg "Restarting $DESC" "$NAME"
do_stop
case "$?" in
0|1)
do_start
case "$?" in
0) log_end_msg 0 ;;
1) log_end_msg 1 ;; # Old process is still running
*) log_end_msg 1 ;; # Failed to start
esac
;;
*)
# Failed to stop
log_end_msg 1
;;
esac
;;
*)
#echo "Usage: $SCRIPTNAME {start|stop|restart|reload|force-reload}" >&2
echo "Usage: $SCRIPTNAME {start|stop|status|restart|force-reload}" >&2
exit 3
;;
esac
:

View File

@@ -1 +0,0 @@
/usr/bin/osmo-gtphub

1
debian/osmo-mgw.install vendored Normal file
View File

@@ -0,0 +1 @@
usr/bin

View File

@@ -1,2 +0,0 @@
/usr/bin/bs11_config
/usr/bin/isdnsync

View File

@@ -1,153 +0,0 @@
#!/bin/sh
### BEGIN INIT INFO
# Provides: osmocom-bsc-nat
# Required-Start: $network $local_fs
# Required-Stop:
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Osmocom GSM network-in-a-box
# Description: A minimal implementation of the GSM Base Station Controller,
# Mobile Switching Center, Home Location regster and all other
# components to run a self-contained GSM network.
### END INIT INFO
# Author: Harald Welte <laforge@gnumonks.org>
# PATH should only include /usr/* if it runs after the mountnfs.sh script
PATH=/sbin:/usr/sbin:/bin:/usr/bin
NAME=osmo-bsc_nat # Introduce the short server's name here
DESC="Osmocom GSM BSC Multiplexer (NAT)" # Introduce a short description here
DAEMON=/usr/bin/osmo-bsc_nat # Introduce the server's location here
SCRIPTNAME=/etc/init.d/osmocom-bsc-nat
CONFIG_FILE=/etc/osmocom/osmocom-bsc-nat.cfg
# Exit if the package is not installed
[ -x $DAEMON ] || exit 0
# Read configuration variable file if it is present
[ -r /etc/default/osmocom-bsc-nat ] && . /etc/default/osmocom-bsc-nat
# Load the VERBOSE setting and other rcS variables
. /lib/init/vars.sh
# Define LSB log_* functions.
# Depend on lsb-base (>= 3.0-6) to ensure that this file is present.
. /lib/lsb/init-functions
DAEMON_ARGS="-D -c $CONFIG_FILE"
#
# Function that starts the daemon/service
#
do_start()
{
# Return
# 0 if daemon has been started
# 1 if daemon was already running
# 2 if daemon could not be started
start-stop-daemon --start --quiet --exec $DAEMON --test > /dev/null \
|| return 1
start-stop-daemon --start --quiet --exec $DAEMON -- \
$DAEMON_ARGS \
|| return 2
# Add code here, if necessary, that waits for the process to be ready
# to handle requests from services started subsequently which depend
# on this one. As a last resort, sleep for some time.
}
#
# Function that stops the daemon/service
#
do_stop()
{
# Return
# 0 if daemon has been stopped
# 1 if daemon was already stopped
# 2 if daemon could not be stopped
# other if a failure occurred
start-stop-daemon --stop --quiet --retry=TERM/30/KILL/5 --name $NAME
RETVAL="$?"
[ "$RETVAL" = 2 ] && return 2
# Wait for children to finish too if this is a daemon that forks
# and if the daemon is only ever run from this initscript.
# If the above conditions are not satisfied then add some other code
# that waits for the process to drop all resources that could be
# needed by services started subsequently. A last resort is to
# sleep for some time.
start-stop-daemon --stop --quiet --oknodo --retry=0/30/KILL/5 --exec $DAEMON
[ "$?" = 2 ] && return 2
return "$RETVAL"
}
#
# Function that sends a SIGHUP to the daemon/service
#
do_reload() {
#
# If the daemon can reload its configuration without
# restarting (for example, when it is sent a SIGHUP),
# then implement that here.
#
start-stop-daemon --stop --signal 1 --quiet $PIDFILE --name $NAME
return 0
}
case "$1" in
start)
[ "$VERBOSE" != no ] && log_daemon_msg "Starting $DESC " "$NAME"
do_start
case "$?" in
0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;
2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;
esac
;;
stop)
[ "$VERBOSE" != no ] && log_daemon_msg "Stopping $DESC" "$NAME"
do_stop
case "$?" in
0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;
2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;
esac
;;
status)
status_of_proc "$DAEMON" "$NAME" && exit 0 || exit $?
;;
#reload|force-reload)
#
# If do_reload() is not implemented then leave this commented out
# and leave 'force-reload' as an alias for 'restart'.
#
#log_daemon_msg "Reloading $DESC" "$NAME"
#do_reload
#log_end_msg $?
#;;
restart|force-reload)
#
# If the "reload" option is implemented then remove the
# 'force-reload' alias
#
log_daemon_msg "Restarting $DESC" "$NAME"
do_stop
case "$?" in
0|1)
do_start
case "$?" in
0) log_end_msg 0 ;;
1) log_end_msg 1 ;; # Old process is still running
*) log_end_msg 1 ;; # Failed to start
esac
;;
*)
# Failed to stop
log_end_msg 1
;;
esac
;;
*)
#echo "Usage: $SCRIPTNAME {start|stop|restart|reload|force-reload}" >&2
echo "Usage: $SCRIPTNAME {start|stop|status|restart|force-reload}" >&2
exit 3
;;
esac
:

View File

@@ -1 +0,0 @@
/usr/bin/osmo-bsc_nat

View File

@@ -1 +0,0 @@
openbsc/doc/examples/osmo-bsc_mgcp

View File

@@ -1,2 +0,0 @@
/usr/bin/osmo-bsc_mgcp
/usr/bin/osmo-bsc

View File

@@ -1,151 +0,0 @@
#!/bin/sh
### BEGIN INIT INFO
# Provides: osmo-gbproxy
# Required-Start: $network $local_fs
# Required-Stop:
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Osmocom GBproxy
# Description: A tool to proxy the GPRS Gb interface.
### END INIT INFO
# Author: Harald Welte <laforge@gnumonks.org>
# PATH should only include /usr/* if it runs after the mountnfs.sh script
PATH=/sbin:/usr/sbin:/bin:/usr/bin
NAME=osmo-gbproxy # Introduce the short server's name here
DESC="Osmocom GBProxy" # Introduce a short description here
DAEMON=/usr/bin/osmo-gbproxy # Introduce the server's location here
SCRIPTNAME=/etc/init.d/osmocom-gbproxy
CONFIG_FILE=/etc/osmocom/osmocom-gbproxy.cfg
# Exit if the package is not installed
[ -x $DAEMON ] || exit 0
# Read configuration variable file if it is present
[ -r /etc/default/osmocom-gbproxy ] && . /etc/default/osmocom-gbproxy
# Load the VERBOSE setting and other rcS variables
. /lib/init/vars.sh
# Define LSB log_* functions.
# Depend on lsb-base (>= 3.0-6) to ensure that this file is present.
. /lib/lsb/init-functions
DAEMON_ARGS="-D -c $CONFIG_FILE"
#
# Function that starts the daemon/service
#
do_start()
{
# Return
# 0 if daemon has been started
# 1 if daemon was already running
# 2 if daemon could not be started
start-stop-daemon --start --quiet --exec $DAEMON --test > /dev/null \
|| return 1
start-stop-daemon --start --quiet --exec $DAEMON -- \
$DAEMON_ARGS \
|| return 2
# Add code here, if necessary, that waits for the process to be ready
# to handle requests from services started subsequently which depend
# on this one. As a last resort, sleep for some time.
}
#
# Function that stops the daemon/service
#
do_stop()
{
# Return
# 0 if daemon has been stopped
# 1 if daemon was already stopped
# 2 if daemon could not be stopped
# other if a failure occurred
start-stop-daemon --stop --quiet --retry=TERM/30/KILL/5 --name $NAME
RETVAL="$?"
[ "$RETVAL" = 2 ] && return 2
# Wait for children to finish too if this is a daemon that forks
# and if the daemon is only ever run from this initscript.
# If the above conditions are not satisfied then add some other code
# that waits for the process to drop all resources that could be
# needed by services started subsequently. A last resort is to
# sleep for some time.
start-stop-daemon --stop --quiet --oknodo --retry=0/30/KILL/5 --exec $DAEMON
[ "$?" = 2 ] && return 2
return "$RETVAL"
}
#
# Function that sends a SIGHUP to the daemon/service
#
do_reload() {
#
# If the daemon can reload its configuration without
# restarting (for example, when it is sent a SIGHUP),
# then implement that here.
#
start-stop-daemon --stop --signal 1 --quiet $PIDFILE --name $NAME
return 0
}
case "$1" in
start)
[ "$VERBOSE" != no ] && log_daemon_msg "Starting $DESC " "$NAME"
do_start
case "$?" in
0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;
2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;
esac
;;
stop)
[ "$VERBOSE" != no ] && log_daemon_msg "Stopping $DESC" "$NAME"
do_stop
case "$?" in
0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;
2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;
esac
;;
status)
status_of_proc "$DAEMON" "$NAME" && exit 0 || exit $?
;;
#reload|force-reload)
#
# If do_reload() is not implemented then leave this commented out
# and leave 'force-reload' as an alias for 'restart'.
#
#log_daemon_msg "Reloading $DESC" "$NAME"
#do_reload
#log_end_msg $?
#;;
restart|force-reload)
#
# If the "reload" option is implemented then remove the
# 'force-reload' alias
#
log_daemon_msg "Restarting $DESC" "$NAME"
do_stop
case "$?" in
0|1)
do_start
case "$?" in
0) log_end_msg 0 ;;
1) log_end_msg 1 ;; # Old process is still running
*) log_end_msg 1 ;; # Failed to start
esac
;;
*)
# Failed to stop
log_end_msg 1
;;
esac
;;
*)
#echo "Usage: $SCRIPTNAME {start|stop|restart|reload|force-reload}" >&2
echo "Usage: $SCRIPTNAME {start|stop|status|restart|force-reload}" >&2
exit 3
;;
esac
:

View File

@@ -1 +0,0 @@
/usr/bin/osmo-gbproxy

View File

@@ -1,3 +0,0 @@
/usr/bin/ipaccess-config
/usr/bin/abisip-find
/usr/bin/ipaccess-proxy

View File

@@ -1,8 +0,0 @@
CONFIG_FILE="/etc/osmocom/osmo-nitb.cfg"
HLR_FILE="/var/lib/osmocom/hlr.sqlite3"
DAEMON_ARGS="-P"
# Uncomment if using LCR+Asterisk
# DAEMON_ARGS="-m -P"

View File

@@ -1,3 +0,0 @@
/etc/osmocom
/var/log/osmocom
/var/lib/osmocom

View File

@@ -1 +0,0 @@
openbsc/doc/examples/osmo-nitb

View File

@@ -1,152 +0,0 @@
#!/bin/sh
### BEGIN INIT INFO
# Provides: osmo-nitb
# Required-Start: $network $local_fs
# Required-Stop:
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Osmocom GSM network-in-a-box
# Description: A minimal implementation of the GSM Base Station Controller,
# Mobile Switching Center, Home Location regster and all other
# components to run a self-contained GSM network.
### END INIT INFO
# Author: Harald Welte <laforge@gnumonks.org>
# PATH should only include /usr/* if it runs after the mountnfs.sh script
PATH=/sbin:/usr/sbin:/bin:/usr/bin
NAME=osmo-nitb # Introduce the short server's name here
DESC="Osmocom GSM Network-in-a-Box" # Introduce a short description here
DAEMON=/usr/bin/osmo-nitb # Introduce the server's location here
SCRIPTNAME=/etc/init.d/osmocom-nitb
# Exit if the package is not installed
[ -x $DAEMON ] || exit 0
# Read configuration variable file if it is present
[ -r /etc/default/osmocom-nitb ] && . /etc/default/osmocom-nitb
# Load the VERBOSE setting and other rcS variables
. /lib/init/vars.sh
# Define LSB log_* functions.
# Depend on lsb-base (>= 3.0-6) to ensure that this file is present.
. /lib/lsb/init-functions
DAEMON_ARGS="$DAEMON_ARGS -D -c $CONFIG_FILE -l $HLR_FILE"
#
# Function that starts the daemon/service
#
do_start()
{
# Return
# 0 if daemon has been started
# 1 if daemon was already running
# 2 if daemon could not be started
start-stop-daemon --start --quiet --exec $DAEMON --test > /dev/null \
|| return 1
start-stop-daemon --start --quiet --exec $DAEMON -- \
$DAEMON_ARGS \
|| return 2
# Add code here, if necessary, that waits for the process to be ready
# to handle requests from services started subsequently which depend
# on this one. As a last resort, sleep for some time.
}
#
# Function that stops the daemon/service
#
do_stop()
{
# Return
# 0 if daemon has been stopped
# 1 if daemon was already stopped
# 2 if daemon could not be stopped
# other if a failure occurred
start-stop-daemon --stop --quiet --retry=TERM/30/KILL/5 --name $NAME
RETVAL="$?"
[ "$RETVAL" = 2 ] && return 2
# Wait for children to finish too if this is a daemon that forks
# and if the daemon is only ever run from this initscript.
# If the above conditions are not satisfied then add some other code
# that waits for the process to drop all resources that could be
# needed by services started subsequently. A last resort is to
# sleep for some time.
start-stop-daemon --stop --quiet --oknodo --retry=0/30/KILL/5 --exec $DAEMON
[ "$?" = 2 ] && return 2
return "$RETVAL"
}
#
# Function that sends a SIGHUP to the daemon/service
#
do_reload() {
#
# If the daemon can reload its configuration without
# restarting (for example, when it is sent a SIGHUP),
# then implement that here.
#
start-stop-daemon --stop --signal 1 --quiet $PIDFILE --name $NAME
return 0
}
case "$1" in
start)
[ "$VERBOSE" != no ] && log_daemon_msg "Starting $DESC " "$NAME"
do_start
case "$?" in
0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;
2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;
esac
;;
stop)
[ "$VERBOSE" != no ] && log_daemon_msg "Stopping $DESC" "$NAME"
do_stop
case "$?" in
0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;
2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;
esac
;;
status)
status_of_proc "$DAEMON" "$NAME" && exit 0 || exit $?
;;
#reload|force-reload)
#
# If do_reload() is not implemented then leave this commented out
# and leave 'force-reload' as an alias for 'restart'.
#
#log_daemon_msg "Reloading $DESC" "$NAME"
#do_reload
#log_end_msg $?
#;;
restart|force-reload)
#
# If the "reload" option is implemented then remove the
# 'force-reload' alias
#
log_daemon_msg "Restarting $DESC" "$NAME"
do_stop
case "$?" in
0|1)
do_start
case "$?" in
0) log_end_msg 0 ;;
1) log_end_msg 1 ;; # Old process is still running
*) log_end_msg 1 ;; # Failed to start
esac
;;
*)
# Failed to stop
log_end_msg 1
;;
esac
;;
*)
#echo "Usage: $SCRIPTNAME {start|stop|restart|reload|force-reload}" >&2
echo "Usage: $SCRIPTNAME {start|stop|status|restart|force-reload}" >&2
exit 3
;;
esac
:

View File

@@ -1,2 +0,0 @@
/usr/bin/osmo-nitb
openbsc/contrib/*.py usr/bin/

View File

@@ -1,2 +0,0 @@
CONFIG_FILE="/etc/osmocom/osmo-sgsn.cfg"

View File

@@ -1 +0,0 @@
openbsc/doc/examples/osmo-sgsn

View File

@@ -1,150 +0,0 @@
#!/bin/sh
### BEGIN INIT INFO
# Provides: osmo-sgsn
# Required-Start: $network $local_fs
# Required-Stop:
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Osmocom Serving GPRS Support Node
# Description: Osmocom Serving GPRS Support Node
### END INIT INFO
# Author: Harald Welte <laforge@gnumonks.org>
# PATH should only include /usr/* if it runs after the mountnfs.sh script
PATH=/sbin:/usr/sbin:/bin:/usr/bin
NAME=osmo-sgsn # Introduce the short server's name here
DESC="Osmocom Serving GPRS Support Node" # Introduce a short description here
DAEMON=/usr/bin/osmo-sgsn # Introduce the server's location here
SCRIPTNAME=/etc/init.d/osmocom-sgsn
# Exit if the package is not installed
[ -x $DAEMON ] || exit 0
# Read configuration variable file if it is present
[ -r /etc/default/osmocom-sgsn ] && . /etc/default/osmocom-sgsn
# Load the VERBOSE setting and other rcS variables
. /lib/init/vars.sh
# Define LSB log_* functions.
# Depend on lsb-base (>= 3.0-6) to ensure that this file is present.
. /lib/lsb/init-functions
DAEMON_ARGS="$DAEMON_ARGS -D -c $CONFIG_FILE"
#
# Function that starts the daemon/service
#
do_start()
{
# Return
# 0 if daemon has been started
# 1 if daemon was already running
# 2 if daemon could not be started
start-stop-daemon --start --quiet --exec $DAEMON --test > /dev/null \
|| return 1
start-stop-daemon --start --quiet --exec $DAEMON -- \
$DAEMON_ARGS \
|| return 2
# Add code here, if necessary, that waits for the process to be ready
# to handle requests from services started subsequently which depend
# on this one. As a last resort, sleep for some time.
}
#
# Function that stops the daemon/service
#
do_stop()
{
# Return
# 0 if daemon has been stopped
# 1 if daemon was already stopped
# 2 if daemon could not be stopped
# other if a failure occurred
start-stop-daemon --stop --quiet --retry=TERM/30/KILL/5 --name $NAME
RETVAL="$?"
[ "$RETVAL" = 2 ] && return 2
# Wait for children to finish too if this is a daemon that forks
# and if the daemon is only ever run from this initscript.
# If the above conditions are not satisfied then add some other code
# that waits for the process to drop all resources that could be
# needed by services started subsequently. A last resort is to
# sleep for some time.
start-stop-daemon --stop --quiet --oknodo --retry=0/30/KILL/5 --exec $DAEMON
[ "$?" = 2 ] && return 2
return "$RETVAL"
}
#
# Function that sends a SIGHUP to the daemon/service
#
do_reload() {
#
# If the daemon can reload its configuration without
# restarting (for example, when it is sent a SIGHUP),
# then implement that here.
#
start-stop-daemon --stop --signal 1 --quiet $PIDFILE --name $NAME
return 0
}
case "$1" in
start)
[ "$VERBOSE" != no ] && log_daemon_msg "Starting $DESC " "$NAME"
do_start
case "$?" in
0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;
2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;
esac
;;
stop)
[ "$VERBOSE" != no ] && log_daemon_msg "Stopping $DESC" "$NAME"
do_stop
case "$?" in
0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;
2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;
esac
;;
status)
status_of_proc "$DAEMON" "$NAME" && exit 0 || exit $?
;;
#reload|force-reload)
#
# If do_reload() is not implemented then leave this commented out
# and leave 'force-reload' as an alias for 'restart'.
#
#log_daemon_msg "Reloading $DESC" "$NAME"
#do_reload
#log_end_msg $?
#;;
restart|force-reload)
#
# If the "reload" option is implemented then remove the
# 'force-reload' alias
#
log_daemon_msg "Restarting $DESC" "$NAME"
do_stop
case "$?" in
0|1)
do_start
case "$?" in
0) log_end_msg 0 ;;
1) log_end_msg 1 ;; # Old process is still running
*) log_end_msg 1 ;; # Failed to start
esac
;;
*)
# Failed to stop
log_end_msg 1
;;
esac
;;
*)
#echo "Usage: $SCRIPTNAME {start|stop|restart|reload|force-reload}" >&2
echo "Usage: $SCRIPTNAME {start|stop|status|restart|force-reload}" >&2
exit 3
;;
esac
:

View File

@@ -1 +0,0 @@
/usr/bin/osmo-sgsn

46
debian/rules vendored
View File

@@ -1,32 +1,34 @@
#!/usr/bin/make -f
# You must remove unused comment lines for the released package.
# See debhelper(7) (uncomment to enable)
# This is an autogenerated template for debian/rules.
#
# Output every command that modifies files on the build system.
#export DH_VERBOSE = 1
# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1
DEBIAN := $(shell dpkg-parsechangelog | grep ^Version: | cut -d' ' -f2)
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
# main packaging script based on dh7 syntax
%:
dh $@ --sourcedirectory=openbsc --with autoreconf
dh $@ --with autoreconf
# debmake generated override targets
# Set options for ./configure
#CONFIGURE_FLAGS = <options for ./configure>
#overrride_dh_configure:
# dh_configure -- $(CONFIGURE_FLAGS)
#
# Do not install libtool archive, python .pyc .pyo
#override_dh_install:
# dh_install --list-missing -X.la -X.pyc -X.pyo
# This is needed for debian stable (squeeze)
override_dh_autoreconf:
cd openbsc && autoreconf --install --force
echo $(VERSION) > .tarball-version
dh_autoreconf
# See https://www.debian.org/doc/manuals/developers-reference/best-pkging-practices.html#bpp-dbg
override_dh_strip:
dh_strip -posmocom-bsc --dbg-package=osmocom-bsc-dbg
dh_strip -posmocom-nitb --dbg-package=osmocom-nitb-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-nat --enable-osmo-bsc --enable-smpp
dh_strip --dbg-package=osmo-mgw-dbg
dh_strip --dbg-package=libosmo-legacy-mgcp-dbg

View File

@@ -40,7 +40,6 @@ network
timer t3119 0
timer t3122 0
timer t3141 0
subscriber-keep-in-ram 0
bts 0
type nanobts
band DCS1800

View File

@@ -7,13 +7,13 @@ line vty
no login
!
mgcp
! local ip 213.167.134.14
bts ip 172.16.252.43
bind ip 127.0.0.1
local ip 10.23.24.2
bts ip 10.24.24.1
bind ip 10.23.24.1
bind port 2427
rtp base 4000
rtp force-ptime 20
sdp audio payload number 98
sdp audio payload name AMR/8000
number endpoints 31
loop 1
no rtcp-omit

View File

@@ -62,5 +62,5 @@ nat
timeout ping 20
timeout pong 5
ip-dscp 0
bscs-config-file bscs.config
bscs-config-file bscs.cfg
access-list bla imsi-allow ^11$

View File

@@ -0,0 +1,19 @@
!
! OsmoMSC configuration saved from vty
!
line vty
no login
!
network
network country code 1
mobile network code 1
short name OsmoMSC
long name OsmoMSC
auth policy closed
location updating reject cause 13
encryption a5 0
rrlp mode none
mm info 1
msc
mgcpgw remote-ip 10.23.24.1
assign-tmsi

View File

@@ -6,9 +6,12 @@ line vty
no login
!
sgsn
gtp local-ip 127.0.0.1
ggsn 0 remote-ip 127.0.0.1
gtp local-ip 10.23.24.1
ggsn 0 remote-ip 10.23.24.2
ggsn 0 gtp-version 1
auth-policy remote
gsup remote-ip 127.0.0.1
gsup remote-port 4222
!
ns
timer tns-block 3
@@ -18,7 +21,7 @@ ns
timer tns-test 30
timer tns-alive 3
timer tns-alive-retries 10
encapsulation udp local-ip 127.0.0.1
encapsulation udp local-ip 10.23.24.1
encapsulation udp local-port 23000
encapsulation framerelay-gre enabled 0
!

View File

@@ -92,8 +92,8 @@ fi
if test -n "$v"
then
: # use $v
elif test -d ./../.git \
&& v=`git describe --abbrev=4 --match='v*' HEAD 2>/dev/null \
elif
v=`git describe --abbrev=4 --match='v*' HEAD 2>/dev/null \
|| git describe --abbrev=4 HEAD 2>/dev/null` \
&& case $v in
[0-9]*) ;;

6
include/Makefile.am Normal file
View File

@@ -0,0 +1,6 @@
nobase_include_HEADERS = \
osmocom/legacy_mgcp/mgcp.h \
osmocom/legacy_mgcp/mgcp_internal.h \
osmocom/legacy_mgcp/mgcpgw_client.h \
osmocom/legacy_mgcp/osmux.h \
$(NULL)

View File

@@ -0,0 +1,3 @@
SUBDIRS = \
legacy_mgcp \
$(NULL)

View File

@@ -0,0 +1,4 @@
noinst_HEADERS = \
mgcp_transcode.h \
vty.h \
$(NULL)

View File

@@ -26,8 +26,7 @@
#include <osmocom/core/msgb.h>
#include <osmocom/core/write_queue.h>
#include <osmocom/core/timer.h>
#include "debug.h"
#include <osmocom/core/logging.h>
#include <arpa/inet.h>
#include <sys/types.h>
@@ -170,6 +169,21 @@ enum mgcp_role {
MGCP_BSC_NAT,
};
enum mgcp_connection_mode {
MGCP_CONN_NONE = 0,
MGCP_CONN_RECV_ONLY = 1,
MGCP_CONN_SEND_ONLY = 2,
MGCP_CONN_RECV_SEND = MGCP_CONN_RECV_ONLY | MGCP_CONN_SEND_ONLY,
MGCP_CONN_LOOPBACK = 4 | MGCP_CONN_RECV_SEND,
};
extern const struct value_string mgcp_connection_mode_strs[];
static inline const char *mgcp_cmode_name(enum mgcp_connection_mode mode)
{
return get_value_string(mgcp_connection_mode_strs, mode);
}
struct mgcp_config {
int source_port;
char *local_ip;
@@ -261,7 +275,7 @@ struct msgb *mgcp_handle_message(struct mgcp_config *cfg, struct msgb *msg);
static inline int mgcp_timeslot_to_endpoint(int multiplex, int timeslot)
{
if (timeslot == 0) {
LOGP(DMGCP, LOGL_ERROR, "Timeslot should not be 0\n");
LOGP(DLMGCP, LOGL_ERROR, "Timeslot should not be 0\n");
timeslot = 255;
}

View File

@@ -28,14 +28,6 @@
#define CI_UNUSED 0
enum mgcp_connection_mode {
MGCP_CONN_NONE = 0,
MGCP_CONN_RECV_ONLY = 1,
MGCP_CONN_SEND_ONLY = 2,
MGCP_CONN_RECV_SEND = MGCP_CONN_RECV_ONLY | MGCP_CONN_SEND_ONLY,
MGCP_CONN_LOOPBACK = 4 | MGCP_CONN_RECV_SEND,
};
enum mgcp_trunk_type {
MGCP_TRUNK_VIRTUAL,
MGCP_TRUNK_E1,
@@ -72,6 +64,7 @@ struct mgcp_rtp_state {
uint32_t stats_jitter;
int32_t stats_transit;
int stats_cycles;
bool patched_first_rtp_payload;
};
struct mgcp_rtp_codec {
@@ -150,7 +143,7 @@ enum mgcp_type {
MGCP_OSMUX_BSC_NAT,
};
#include <openbsc/osmux.h>
#include <osmocom/legacy_mgcp/osmux.h>
struct mgcp_endpoint {
int allocated;
@@ -340,3 +333,5 @@ static inline const char *mgcp_bts_src_addr(struct mgcp_endpoint *endp)
return endp->cfg->bts_ports.bind_addr;
return endp->cfg->source_addr;
}
int mgcp_msg_terminate_nul(struct msgb *msg);

View File

@@ -0,0 +1,73 @@
#pragma once
#include <stdint.h>
#define MGCPGW_CLIENT_LOCAL_ADDR_DEFAULT "0.0.0.0"
#define MGCPGW_CLIENT_LOCAL_PORT_DEFAULT 0
#define MGCPGW_CLIENT_REMOTE_ADDR_DEFAULT "127.0.0.1"
#define MGCPGW_CLIENT_REMOTE_PORT_DEFAULT 2427
struct msgb;
struct vty;
struct mgcpgw_client;
struct mgcpgw_client_conf {
const char *local_addr;
int local_port;
const char *remote_addr;
int remote_port;
uint16_t first_endpoint;
uint16_t last_endpoint;
uint16_t bts_base;
};
typedef unsigned int mgcp_trans_id_t;
struct mgcp_response_head {
int response_code;
mgcp_trans_id_t trans_id;
const char *comment;
};
struct mgcp_response {
char *body;
struct mgcp_response_head head;
uint16_t audio_port;
};
void mgcpgw_client_conf_init(struct mgcpgw_client_conf *conf);
void mgcpgw_client_vty_init(void *talloc_ctx, int node, struct mgcpgw_client_conf *conf);
int mgcpgw_client_config_write(struct vty *vty, const char *indent);
struct mgcpgw_client_conf *mgcpgw_client_conf_actual(struct mgcpgw_client *mgcp);
struct mgcpgw_client *mgcpgw_client_init(void *ctx,
struct mgcpgw_client_conf *conf);
int mgcpgw_client_connect(struct mgcpgw_client *mgcp);
const char *mgcpgw_client_remote_addr_str(struct mgcpgw_client *mgcp);
uint16_t mgcpgw_client_remote_port(struct mgcpgw_client *mgcp);
uint32_t mgcpgw_client_remote_addr_n(struct mgcpgw_client *mgcp);
int mgcpgw_client_next_endpoint(struct mgcpgw_client *client);
void mgcpgw_client_release_endpoint(uint16_t id, struct mgcpgw_client *client);
/* Invoked when an MGCP response is received or sending failed. When the
* response is passed as NULL, this indicates failure during transmission. */
typedef void (* mgcp_response_cb_t )(struct mgcp_response *response, void *priv);
int mgcp_response_parse_params(struct mgcp_response *r);
int mgcpgw_client_tx(struct mgcpgw_client *mgcp, struct msgb *msg,
mgcp_response_cb_t response_cb, void *priv);
enum mgcp_connection_mode;
struct msgb *mgcp_msg_crcx(struct mgcpgw_client *mgcp,
uint16_t rtp_endpoint, unsigned int call_id,
enum mgcp_connection_mode mode);
struct msgb *mgcp_msg_mdcx(struct mgcpgw_client *mgcp,
uint16_t rtp_endpoint, const char *rtp_conn_addr,
uint16_t rtp_port, enum mgcp_connection_mode mode);
struct msgb *mgcp_msg_dlcx(struct mgcpgw_client *mgcp, uint16_t rtp_endpoint,
unsigned int call_id);

View File

@@ -0,0 +1,33 @@
#pragma once
#define MSGB_CB_MGCP_TRANS_ID 0
struct mgcpgw_client {
struct mgcpgw_client_conf actual;
uint32_t remote_addr;
struct osmo_wqueue wq;
mgcp_trans_id_t next_trans_id;
struct llist_head responses_pending;
struct llist_head inuse_endpoints;
};
struct mgcp_inuse_endpoint {
struct llist_head entry;
uint16_t id;
};
struct mgcp_response_pending {
struct llist_head entry;
mgcp_trans_id_t trans_id;
mgcp_response_cb_t response_cb;
void *priv;
};
int mgcpgw_client_rx(struct mgcpgw_client *mgcp, struct msgb *msg);
struct mgcp_response_pending * mgcpgw_client_pending_add(
struct mgcpgw_client *mgcp,
mgcp_trans_id_t trans_id,
mgcp_response_cb_t response_cb,
void *priv);

View File

@@ -15,37 +15,17 @@ struct buffer *vty_argv_to_buffer(int argc, const char *argv[], int base);
extern struct cmd_element cfg_description_cmd;
extern struct cmd_element cfg_no_description_cmd;
enum bsc_vty_node {
GSMNET_NODE = _LAST_OSMOVTY_NODE + 1,
BTS_NODE,
TRX_NODE,
TS_NODE,
SUBSCR_NODE,
enum mgcp_vty_node {
MGCP_NODE,
GBPROXY_NODE,
SGSN_NODE,
OML_NODE,
NAT_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,
};
extern int bsc_vty_is_config_node(struct vty *vty, int node);
struct log_info;
int bsc_vty_init(struct gsm_network *network);
int bsc_vty_init_extra(void);
void msc_vty_init(struct gsm_network *msc_network);
struct gsm_network *gsmnet_from_vty(struct vty *vty);
#endif

10
libosmo-legacy-mgcp.pc.in Normal file
View File

@@ -0,0 +1,10 @@
prefix=@prefix@
exec_prefix=@exec_prefix@
libdir=@libdir@
includedir=@includedir@
Name: Osmocom legacy Media Gateway Control Protocol library
Description: C Utility Library
Version: @VERSION@
Libs: -L${libdir} -losmo-legacy-mgcp
Cflags: -I${includedir}/

103
openbsc/.gitignore vendored
View File

@@ -1,103 +0,0 @@
*.o
*.lo
*.a
.deps
Makefile
Makefile.in
bscconfig.h
bscconfig.h.in
openbsc.pc
src/osmo-nitb/osmo-nitb
src/osmo-bsc_mgcp/osmo-bsc_mgcp
src/osmo-bsc/osmo-bsc
src/utils/meas_vis
src/utils/meas_json
src/utils/osmo-meas-pcap2db
src/utils/osmo-meas-udp2db
src/utils/smpp_mirror
*.*~
*.sw?
.libs
*.pyc
*.gcda
*.gcno
#configure
aclocal.m4
autom4te.cache/
config.log
config.status
config.guess
config.sub
configure
compile
depcomp
install-sh
missing
stamp-h1
libtool
ltmain.sh
# git-version-gen magic
.tarball-version
.version
# apps and app data
hlr.sqlite3
src/utils/bs11_config
src/ipaccess/ipaccess-config
src/ipaccess/abisip-find
src/ipaccess/ipaccess-firmware
src/ipaccess/ipaccess-proxy
src/utils/isdnsync
src/nat/bsc_nat
src/gprs/osmo-sgsn
src/gprs/osmo-gbproxy
src/gprs/osmo-gtphub
src/osmo-bsc_nat/osmo-bsc_nat
src/libcommon/gsup_test_client
#tests
tests/testsuite.dir
tests/bsc-nat/bsc_nat_test
tests/bsc-nat-trie/bsc_nat_trie_test
tests/channel/channel_test
tests/db/db_test
tests/debug/debug_test
tests/gsm0408/gsm0408_test
tests/mgcp/mgcp_test
tests/sccp/sccp_test
tests/sms/sms_test
tests/timer/timer_test
tests/gprs/gprs_test
tests/gbproxy/gbproxy_test
tests/abis/abis_test
tests/si/si_test
tests/smpp/smpp_test
tests/bsc/bsc_test
tests/trau/trau_test
tests/mgcp/mgcp_transcoding_test
tests/sgsn/sgsn_test
tests/subscr/subscr_test
tests/subscr/bsc_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/oap/oap_client_test
tests/atconfig
tests/atlocal
tests/package.m4
tests/testsuite
tests/testsuite.log
gsn_restart
src/openbsc.cfg*
writtenconfig/
gtphub_restart_count

View File

@@ -1,170 +0,0 @@
-- Split trace based on SCCP Source
-- There are still bugs to find... bugs bugs bugs... hmm
do
local function init_listener()
print("CREATED LISTENER")
local tap = Listener.new("ip", "sccp && (ip.src == 172.16.1.81 || ip.dst == 172.16.1.81)")
local sccp_type_field = Field.new("sccp.message_type")
local sccp_src_field = Field.new("sccp.slr")
local sccp_dst_field = Field.new("sccp.dlr")
local msg_type_field = Field.new("gsm_a.dtap_msg_mm_type")
local lu_rej_field = Field.new("gsm_a.dtap.rej_cause")
local ip_src_field = Field.new("ip.src")
local ip_dst_field = Field.new("ip.dst")
--
local bssmap_msgtype_field = Field.new("gsm_a.bssmap_msgtype")
-- assignment failure 0x03
--
--
local dtap_cause_field = Field.new("gsm_a_dtap.cause")
local dtap_cc_field = Field.new("gsm_a.dtap_msg_cc_type")
local connections = {}
function check_failure(con)
check_lu_reject(con)
check_disconnect(con)
check_failures(con)
end
-- cipher mode reject
function check_failures(con)
local msgtype = bssmap_msgtype_field()
if not msgtype then
return
end
msgtype = tonumber(msgtype)
if msgtype == 89 then
print("Cipher mode reject")
con[4] = true
elseif msgtype == 0x03 then
print("Assignment failure")
con[4] = true
elseif msgtype == 0x22 then
print("Clear Request... RF failure?")
con[4] = true
end
end
-- check if a DISCONNECT is normal
function check_disconnect(con)
local msg_type = dtap_cc_field()
if not msg_type then
return
end
if tonumber(msg_type) ~= 0x25 then
return
end
local cause = dtap_cause_field()
if not cause then
return
end
cause = tonumber(cause)
if cause ~= 0x10 then
print("DISCONNECT != Normal")
con[4] = true
end
end
-- check if we have a LU Reject
function check_lu_reject(con)
local msg_type = msg_type_field()
if not msg_type then
return
end
msg_type = tonumber(tostring(msg_type))
if msg_type == 0x04 then
print("LU REJECT with " .. tostring(lu_rej_field()))
con[4] = true
end
end
function tap.packet(pinfo,tvb,ip)
local ip_src = tostring(ip_src_field())
local ip_dst = tostring(ip_dst_field())
local sccp_type = tonumber(tostring(sccp_type_field()))
local sccp_src = sccp_src_field()
local sccp_dst = sccp_dst_field()
local con
if sccp_type == 0x01 then
elseif sccp_type == 0x2 then
local src = string.format("%s-%s", ip_src, tostring(sccp_src))
local dst = string.format("%s-%s", ip_dst, tostring(sccp_dst))
local datestring = os.date("%Y%m%d%H%M%S")
local pcap_name = string.format("alink_trace_%s-%s_%s.pcap", src, dst, datestring)
local dumper = Dumper.new_for_current(pcap_name)
local con = { ip_src, tostring(sccp_src), tostring(sccp_dst), false, dumper, pcap_name }
dumper:dump_current()
connections[src] = con
connections[dst] = con
elseif sccp_type == 0x4 then
-- close a connection... remove it from the list
local src = string.format("%s-%s", ip_src, tostring(sccp_src))
local dst = string.format("%s-%s", ip_dst, tostring(sccp_dst))
local con = connections[src]
if not con then
return
end
con[5]:dump_current()
con[5]:flush()
-- this causes a crash on unpacted wireshark
con[5]:close()
-- the connection had a failure
if con[4] == true then
local datestring = os.date("%Y%m%d%H%M%S")
local new_name = string.format("alink_failure_%s_%s-%s.pcap", datestring, con[2], con[3])
os.rename(con[6], new_name)
else
os.remove(con[6])
end
-- clear the old connection
connections[src] = nil
connections[dst] = nil
elseif sccp_type == 0x5 then
-- not handled yet... we should verify stuff here...
local dst = string.format("%s-%s", ip_dst, tostring(sccp_dst))
local con = connections[dst]
if not con then
return
end
con[5]:dump_current()
elseif sccp_type == 0x6 then
local dst = string.format("%s-%s", ip_dst, tostring(sccp_dst))
local con = connections[dst]
if not con then
print("DON'T KNOW THIS CONNECTION for " .. ip_dst)
return
end
con[5]:dump_current()
check_failure(con)
end
end
function tap.draw()
print("DRAW")
end
function tap.reset()
print("RESET")
end
end
init_listener()
end

View File

@@ -1 +0,0 @@
Some crazy scripts call testing... and MSC link failure simulation

View File

@@ -1,8 +0,0 @@
ABORT BUSY
ABORT 'NO CARRIER'
ABORT 'OK'
'' AT
SAY "Dialing a number\n"
'OK' ATD05660066;

View File

@@ -1,11 +0,0 @@
#!/bin/sh
# Evil dial script..
while true;
do
chat -v -f all_dial < /dev/ttyACM0 > /dev/ttyACM0
sleep 5s
chat -v -f hangup < /dev/ttyACM0 > /dev/ttyACM0
sleep 2s
done

View File

@@ -1,6 +0,0 @@
#!/bin/sh
sleep 3
echo "enable"
sleep 1
echo "drop bts connection 0 oml"
sleep 1

View File

@@ -1,8 +0,0 @@
#!/bin/sh
while true;
do
echo "Going to drop the OML connection"
./drop-oml.sh | telnet 127.0.0.1 4242
sleep 58m
done

View File

@@ -1,4 +0,0 @@
TIMEOUT 10
'' ^Z
SAY "Waiting for hangup confirm\n"
'' ATH;

View File

@@ -1,8 +0,0 @@
#!/bin/sh
while true;
do
echo "Kill the osmo-bsc"
/usr/bin/kill -s SIGUSR2 `pidof osmo-bsc`
sleep 58s
done

View File

@@ -1,120 +0,0 @@
#!/usr/bin/python
# -*- 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 optparse import OptionParser
from ipa import Ctrl
import socket
verbose = False
def connect(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
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 set_var(sck, var, val):
(a, _, _) = do_set_get(sck, var, val)
return a
def get_var(sck, var):
(_, _, v) = do_set_get(sck, var)
return v
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
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()
verbose = options.verbose
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.host):
parser.error("Destination host and port required!")
sock = connect(options.host, options.port)
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")
_leftovers(sock, socket.MSG_DONTWAIT)
(a, _, _) = do_set_get(sock, args[0])
print "Got message:", a
if options.monitor:
while True:
if not _leftovers(sock, 0):
print "Connection is gone."
break
sock.close()

View File

@@ -1,33 +0,0 @@
#!/usr/bin/env python
import os
f = open("unbalanced")
lines = []
for line in f:
lines.append(line)
filenames = {}
output = []
for line in lines:
if "[0x" in line:
start = line.find("[")
end = line.find("]")
addr = line[start+1:end]
try:
file = filenames[addr]
except KeyError:
r = os.popen("addr2line -fs -e ./bsc_hack %s" % addr)
all = r.read().replace("\n", ",")
file = all
filenames[addr] = file
line = line.replace(addr, file)
output.append(line)
g = open("unbalanced.2", "w")
g.write("".join(output))

View File

@@ -1,37 +0,0 @@
#!/usr/bin/env python
#
# Convert ETSI documents to an enum
#
import re, sys
def convert(string):
string = string.strip().replace(" ", "").rjust(8, "0")
var = 0
offset = 7
for char in string:
assert offset >= 0
var = var | (int(char) << offset)
offset = offset - 1
return var
def string(name):
name = name.replace(" ", "_")
name = name.replace('"', "")
name = name.replace('/', '_')
name = name.replace('(', '_')
name = name.replace(')', '_')
return "%s_%s" % (sys.argv[2], name.upper())
file = open(sys.argv[1])
for line in file:
m = re.match(r"[ \t]*(?P<value>[01 ]+)[ ]+(?P<name>[a-zA-Z /0-9()]+)", line[:-1])
if m:
print "\t%s\t\t= %d," % (string(m.groupdict()["name"]), convert(m.groupdict()["value"]))
else:
print line[:-1]

View File

@@ -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()

View File

@@ -1,58 +0,0 @@
#!/usr/bin/env python
"""
demonstrate a unblock bug on the GB Proxy..
"""
bts_ns_reset = "\x02\x00\x81\x01\x01\x82\x1f\xe7\x04\x82\x1f\xe7"
ns_reset_ack = "\x03\x01\x82\x1f\xe7\x04\x82\x1f\xe7"
bts_ns_unblock = "\x06"
ns_unblock_ack = "\x07"
bts_bvc_reset_0 = "\x00\x00\x00\x00\x22\x04\x82\x00\x00\x07\x81\x03\x3b\x81\x02"
ns_bvc_reset_0_ack = "\x00\x00\x00\x00\x23\x04\x82\x00\x00"
bts_bvc_reset_8167 = "\x00\x00\x00\x00\x22\x04\x82\x1f\xe7\x07\x81\x08\x08\x88\x72\xf4\x80\x10\x1c\x00\x9c\x40"
import socket
socket = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
socket.bind(("0.0.0.0", 0))
socket.setblocking(1)
import sys
port = int(sys.argv[1])
print "Sending data to port: %d" % port
def send_and_receive(packet):
socket.sendto(packet, ("127.0.0.1", port))
try:
data, addr = socket.recvfrom(4096)
except socket.error, e:
print "ERROR", e
import sys
sys.exit(0)
return data
#send stuff once
to_send = [
(bts_ns_reset, ns_reset_ack, "reset ack"),
(bts_ns_unblock, ns_unblock_ack, "unblock ack"),
(bts_bvc_reset_0, ns_bvc_reset_0_ack, "BVCI=0 reset ack"),
]
for (out, inp, type) in to_send:
res = send_and_receive(out)
if res != inp:
print "Failed to get the %s" % type
sys.exit(-1)
import time
time.sleep(3)
res = send_and_receive(bts_bvc_reset_8167)
print "Sent all messages... check wireshark for the last response"

View File

@@ -1,78 +0,0 @@
-- Simple LUA script to print the size of BSSGP messages over their type...
do
local ip_bucket = {}
local pdu_types = {}
pdu_types[ 6] = "PAGING"
pdu_types[11] = "SUSPEND"
pdu_types[12] = "SUSPEND-ACK"
pdu_types[32] = "BVC-BLOCK"
pdu_types[33] = "BVC-BLOCK-ACK"
pdu_types[34] = "BVC-RESET"
pdu_types[35] = "BVC-RESET-ACK"
pdu_types[36] = "UNBLOCK"
pdu_types[37] = "UNBLOCK-ACK"
pdu_types[38] = "FLOW-CONTROL-BVC"
pdu_types[39] = "FLOW-CONTROL-BVC-ACK"
pdu_types[40] = "FLOW-CONTROL-MS"
pdu_types[41] = "FLOW-CONTROL-MS-ACK"
pdu_types[44] = "LLC-DISCARDED"
local function init_listener()
-- handle the port as NS over IP
local udp_port_table = DissectorTable.get("udp.port")
local gprs_ns_dis = Dissector.get("gprs_ns")
udp_port_table:add(23000,gprs_ns_dis)
-- bssgp filters
local bssgp_pdu_get = Field.new("bssgp.pdu_type")
local udp_length_get = Field.new("udp.length")
local tap = Listener.new("ip", "udp.port == 23000")
function tap.packet(pinfo,tvb,ip)
local pdu = bssgp_pdu_get()
local len = udp_length_get()
-- only handle bssgp, but we also want the IP frame
if not pdu then
return
end
pdu = tostring(pdu)
if tonumber(pdu) == 0 or tonumber(pdu) == 1 then
return
end
local ip_src = tostring(ip.ip_src)
local bssgp_histo = ip_bucket[ip_src]
if not bssgp_histo then
bssgp_histo = {}
ip_bucket[ip_src] = bssgp_histo
end
local key = pdu
local bucket = bssgp_histo[key]
if not bucket then
bucket = {}
bssgp_histo[key] = bucket
end
table.insert(bucket, tostring(len))
print("IP: " .. ip_src .. " PDU: " .. pdu_types[tonumber(pdu)] .. " Length: " .. tostring(len))
end
function tap.draw()
-- well... this will not be called...
-- for ip,bssgp_histo in pairs(dumpers) do
-- print("IP " .. ip)
-- end
end
function tap.reset()
-- well... this will not be called...
end
end
init_listener()
end

View File

@@ -1,80 +0,0 @@
-- I count the buffer space needed for LLC PDUs in the worse case and print it
do
local function init_listener()
-- handle the port as NS over IP
local udp_port_table = DissectorTable.get("udp.port")
local gprs_ns_dis = Dissector.get("gprs_ns")
udp_port_table:add(23000,gprs_ns_dis)
-- bssgp filters
local bssgp_pdu_get = Field.new("bssgp.pdu_type")
local bssgp_delay_get = Field.new("bssgp.delay_val")
local llcgprs_get = Field.new("llcgprs")
local pdus = nil
print("START...")
local tap = Listener.new("ip", "udp.port == 23000 && bssgp.pdu_type == 0")
function tap.packet(pinfo,tvb,ip)
local pdu = bssgp_pdu_get()
local len = llcgprs_get().len
local delay = bssgp_delay_get()
-- only handle bssgp, but we also want the IP frame
if not pdu then
return
end
if tonumber(tostring(delay)) == 65535 then
pdus = { next = pdus,
len = len,
expires = -1 }
else
local off = tonumber(tostring(delay)) / 100.0
pdus = { next = pdus,
len = len,
expires = pinfo.rel_ts + off }
end
local now_time = tonumber(tostring(pinfo.rel_ts))
local now_size = 0
local l = pdus
local prev = nil
local count = 0
while l do
if now_time < l.expires or l.expires == -1 then
now_size = now_size + l.len
prev = l
l = l.next
count = count + 1
else
-- delete things
if prev == nil then
pdus = nil
l = nil
else
prev.next = l.next
l = l.next
end
end
end
-- print("TOTAL: " .. now_time .. " PDU_SIZE: " .. now_size)
print(now_time .. " " .. now_size / 1024.0 .. " " .. count)
-- print("NOW: " .. tostring(pinfo.rel_ts) .. " Delay: " .. tostring(delay) .. " Length: " .. tostring(len))
end
function tap.draw()
-- well... this will not be called...
-- for ip,bssgp_histo in pairs(dumpers) do
-- print("IP " .. ip)
-- end
print("END")
end
function tap.reset()
-- well... this will not be called...
end
end
init_listener()
end

View File

@@ -1,46 +0,0 @@
-- Create a file named by_ip/''ip_addess''.cap with all ip traffic of each ip host. (works for tshark only)
-- Dump files are created for both source and destination hosts
do
local dir = "by_tlli"
local dumpers = {}
local function init_listener()
local udp_port_table = DissectorTable.get("udp.port")
local gprs_ns_dis = Dissector.get("gprs_ns")
udp_port_table:add(23000,gprs_ns_dis)
local field_tlli = Field.new("bssgp.tlli")
local tap = Listener.new("ip", "udp.port == 23000")
-- we will be called once for every IP Header.
-- If there's more than one IP header in a given packet we'll dump the packet once per every header
function tap.packet(pinfo,tvb,ip)
local tlli = field_tlli()
if not tlli then
return
end
local tlli_str = tostring(tlli)
tlli_dmp = dumpers[tlli_str]
if not tlli_dmp then
local tlli_hex = string.format("0x%x", tonumber(tlli_str))
print("Creating dump for TLLI " .. tlli_hex)
tlli_dmp = Dumper.new_for_current(dir .. "/" .. tlli_hex .. ".pcap")
dumpers[tlli_str] = tlli_dmp
end
tlli_dmp:dump_current()
tlli_dmp:flush()
end
function tap.draw()
for tlli,dumper in pairs(dumpers) do
dumper:flush()
end
end
function tap.reset()
for tlli,dumper in pairs(dumpers) do
dumper:close()
end
dumpers = {}
end
end
init_listener()
end

View File

@@ -1,59 +0,0 @@
-- This script verifies that the N(U) is increasing...
--
do
local nu_state_src = {}
local function init_listener()
-- handle the port as NS over IP
local udp_port_table = DissectorTable.get("udp.port")
local gprs_ns_dis = Dissector.get("gprs_ns")
udp_port_table:add(23000,gprs_ns_dis)
-- we want to look here...
local llc_sapi_get = Field.new("llcgprs.sapib")
local llc_nu_get = Field.new("llcgprs.nu")
local bssgp_tlli_get = Field.new("bssgp.tlli")
local tap = Listener.new("ip", "udp.port == 23000")
function tap.packet(pinfo,tvb,ip)
local llc_sapi = llc_sapi_get()
local llc_nu = llc_nu_get()
local bssgp_tlli = bssgp_tlli_get()
if not llc_sapi or not llc_nu or not bssgp_tlli then
return
end
local ip_src = tostring(ip.ip_src)
local bssgp_tlli = tostring(bssgp_tlli)
local llc_nu = tostring(llc_nu)
local llc_sapi = tostring(llc_sapi)
local src_key = ip_src .. "-" .. bssgp_tlli .. "-" .. llc_sapi
local last_nu = nu_state_src[src_key]
if not last_nu then
-- print("Establishing mapping for " .. src_key)
nu_state_src[src_key] = llc_nu
return
end
local function tohex(number)
return string.format("0x%x", tonumber(number))
end
nu_state_src[src_key] = llc_nu
if tonumber(last_nu) + 1 ~= tonumber(llc_nu) then
print("JUMP in N(U) on TLLI " .. tohex(bssgp_tlli) .. " and SAPI: " .. llc_sapi .. " src: " .. ip_src)
print("\t last: " .. last_nu .. " now: " .. llc_nu)
end
end
function tap.draw()
end
function tap.reset()
end
end
init_listener()
end

View File

@@ -1,18 +0,0 @@
-- Remove old data from the database
DELETE FROM Subscriber
WHERE id != 1 AND datetime('now', '-10 days') > updated AND authorized != 1;
DELETE FROM Equipment
WHERE datetime('now', '-10 days') > updated;
DELETE FROM EquipmentWatch
WHERE datetime('now', '-10 days') > updated;
DELETE FROM SMS
WHERE datetime('now', '-10 days') > created;
DELETE FROM VLR
WHERE datetime('now', '-10 days') > updated;
DELETE FROM ApduBlobs
WHERE datetime('now', '-10 days') > created;
DELETE FROM Counters
WHERE datetime('now', '-10 days') > timestamp;
DELETE FROM RateCounters
WHERE datetime('now', '-10 days') > timestamp;
VACUUM;

View File

@@ -1,125 +0,0 @@
#!/usr/bin/python2.5
from __future__ import with_statement
from pysqlite2 import dbapi2 as sqlite3
import sys
hlr = sqlite3.connect(sys.argv[1])
web = sqlite3.connect(sys.argv[2])
# switch to autocommit
hlr.isolation_level = None
web.isolation_level = None
hlr.row_factory = sqlite3.Row
web.row_factory = sqlite3.Row
with hlr:
hlr_subscrs = hlr.execute("""
SELECT * FROM Subscriber
""").fetchall()
hlr_tokens = hlr.execute("""
SELECT * FROM AuthToken
""").fetchall()
with web:
web_tokens = web.execute("""
SELECT * FROM reg_tokens
""").fetchall()
web_sms = web.execute("""
SELECT * FROM sms_queue
""").fetchall()
# index by subscr id
hlr_subscrs_by_id = {}
hlr_subscrs_by_ext = {}
hlr_tokens_by_subscr_id = {}
for x in hlr_subscrs:
hlr_subscrs_by_id[x['id']] = x
hlr_subscrs_by_ext[x['extension']] = x
del hlr_subscrs
for x in hlr_tokens:
hlr_tokens_by_subscr_id[x['subscriber_id']] = x
del hlr_tokens
web_tokens_by_subscr_id = {}
for x in web_tokens:
web_tokens_by_subscr_id[x['subscriber_id']] = x
del web_tokens
# remove leftover web_tokens and correct inconsistent fields
with web:
for x in web_tokens_by_subscr_id.values():
subscr = hlr_subscrs_by_id.get(x['subscriber_id'], None)
if subscr is None:
web.execute("""
DELETE FROM reg_tokens WHERE subscriber_id = ?
""", (x['subscriber_id'],))
del web_tokens_by_subscr_id[x['subscriber_id']]
continue
if str(x['imsi']) != str(subscr['imsi']) or \
x['extension'] != subscr['extension'] or \
x['tmsi'] != subscr['tmsi'] or \
x['lac'] != subscr['lac']:
web.execute("""
UPDATE reg_tokens
SET imsi = ?, extension = ?, tmsi = ?, lac = ?
WHERE subscriber_id = ?
""", (str(subscr['imsi']), subscr['extension'],
subscr['tmsi'], subscr['lac'], x['subscriber_id']))
# add missing web_tokens
with web:
for x in hlr_tokens_by_subscr_id.values():
subscr = hlr_subscrs_by_id.get(x['subscriber_id'], None)
if subscr is None:
hlr.execute("""
DELETE FROM AuthToken WHERE subscriber_id = ?
""", (x['subscriber_id'],))
del hlr_tokens_by_subscr_id[x['subscriber_id']]
continue
webtoken = web_tokens_by_subscr_id.get(x['subscriber_id'], None)
if webtoken is None:
web.execute("""
INSERT INTO reg_tokens
(subscriber_id, extension, reg_completed, name, email, lac, imsi, token, tmsi)
VALUES
(?, ?, 0, ?, '', ?, ?, ?, ?)
""", (x['subscriber_id'], subscr['extension'], subscr['name'],
subscr['lac'], str(subscr['imsi']), x['token'], subscr['tmsi']))
# authorize subscribers
with hlr:
for x in web_tokens_by_subscr_id.values():
subscr = hlr_subscrs_by_id.get(x['subscriber_id'], None)
if x['reg_completed'] and not subscr['authorized']:
hlr.execute("""
UPDATE Subscriber
SET authorized = 1
WHERE id = ?
""", (x['subscriber_id'],))
# Sync SMS from web to hlr
with hlr:
for sms in web_sms:
subscr = hlr_subscrs_by_ext.get(sms['receiver_ext'])
if subscr is None:
print '%s not found' % sms['receiver_ext']
continue
hlr.execute("""
INSERT INTO SMS
(created, sender_id, receiver_id, reply_path_req, status_rep_req, protocol_id, data_coding_scheme, ud_hdr_ind, text)
VALUES
(?, 1, ?, 0, 0, 0, 0, 0, ?)
""", (sms['created'], subscr['id'], sms['text']))
with web:
for sms in web_sms:
web.execute("""
DELETE FROM sms_queue WHERE id = ?
""", (sms['id'],))
hlr.close()
web.close()

Some files were not shown because too many files have changed in this diff Show More