Commit Graph

374 Commits

Author SHA1 Message Date
Pablo Neira Ayuso 7251604cce tests: e1inp_ipa_*_test: fix leak of msgb in ->sign_link path
Fix a leak in the tests: The ->sign_link callback is reponsible
for releasing the msgb.
2012-08-30 21:50:32 +02:00
Pablo Neira Ayuso 1fd93bbc6e tests: e1inp_ipa_*_test: add signal handling for process termination
This patch adds signal handling to release memory in the exit
path of the tests. This is good to check what memory we are
leaking in the exist path of the tests.
2012-08-30 21:50:32 +02:00
Pablo Neira Ayuso 7723b4e9a3 tests: fix CPU suckup e1inp_ipa_bts_test after test finish
We have to read from the eventfd, otherwise select keeps returning
the file descriptor as ready to read.
2012-08-30 21:50:32 +02:00
Pablo Neira Ayuso 953060001d input: add generic PCAP interface for LAPD
This patch allows you to create PCAP traces between the BSC and BTS including
the LAPD frames. Useful for debugging communication issues.

So far, it was only possible to create layer 3 traces containing
OML/RSL. LAPD traces can be also interesting to debug communication
issues between the BSC and the BTS.

To enable PCAP of LAPD, you only have to invoke:

li->pcap_fd = osmo_pcap_lapd_open("/tmp/file.pcap", 0600);

By default, li->pcap_fd is set to -1 which means disabled.

openBSC needs a patch to replace all usage of e1_set_pcap_fd by
osmo_pcap_lapd_open.
2012-08-30 21:50:31 +02:00
Pablo Neira Ayuso 7ed92581ee input: dahdi: replace exit by return
This is a library, we leave up to the client code to decide when to
finish the code execution.
2012-08-30 21:50:31 +02:00
Pablo Neira Ayuso 5c67fb5610 input: dahdi: use logging facilities instead of fprintf and stderr 2012-08-30 21:50:31 +02:00
Pablo Neira Ayuso f42280b6a2 lapd: use C99 structure initialization for profile templates 2012-08-30 21:50:31 +02:00
Pablo Neira Ayuso 18d6294efe tests: e1inp_ipa_bts_test: fix compilation warnings
CC     e1inp_ipa_bts_test.o
e1inp_ipa_bts_test.c: In function ‘sign_link_up’:
e1inp_ipa_bts_test.c:47:8: warning: variable ‘dst’ set but not used [-Wunused-but-set-variable]
e1inp_ipa_bts_test.c: In function ‘test_bts_gsm_12_21_cb’:
e1inp_ipa_bts_test.c:211:6: warning: variable ‘ret’ set but not used [-Wunused-but-set-variable]
  CCLD   e1inp_ipa_bts_test
2012-08-30 21:50:30 +02:00
Pablo Neira Ayuso 1e4019483f ipaccess: improve error handling
If we hit any error, spot an error message containing the reason
and close the links to start over.

This patch has been tested by injecting errors in:

* ipaccess_send, by randomly returning -1.
* returning error from the ->sign_link_up callback, both from the
  OML and RSL links.
* returning error from the ->sign_link callback, both for the
  OML and RSL links.

With this patch, Valgrind shows no "definitely lost" memory blocks
anymore (including the error path that has been tested) and the
ipaccess driver behaves more robustly in case of errors.

Acked-by: Holger Freyther <holger@freyther.de>
2012-08-30 21:50:30 +02:00
Pablo Neira Ayuso 5a8cca3a1c tests: e1inp_ipa_bsc_test: fix crash
The sequence to trigger the crash was:

1) establish a full A-bis IPA link (both OML and RSL correctly established
and ID_RESP received from BTS).
2) nc 127.0.0.1 3002 # establish OML link only

I forgot to set to NULL the oml and rsl links we're using. Otherwise,
the test calls e1inp_sign_link_destroy(rsl) which does not exists.
2012-08-30 21:50:30 +02:00
Pablo Neira Ayuso 6cc3f92ea4 ipaccess: fix leak of e1inp_line
Holger reported a leak in the ipaccess_drop path and a patch to
fix this. This is a new version of the patch posted that also
handle the case in which only one of the link (OML / RSL) is
established and no ID_RESP was received.

Based on patch of Holger Freyther.
2012-08-30 21:50:30 +02:00
Pablo Neira Ayuso 81ed759993 ipa: fix missing set of write_cb for IPA client connection
Now the BTS and BSC tests work again.
2012-08-30 21:50:29 +02:00
Eric Butler d11a5c1103 Use package version since git info won't be available. 2012-08-14 20:56:26 -07:00
Eric Butler 91ffa2b5c1 Add debian/ubuntu packaging files. 2012-08-14 18:07:48 -07:00
Holger Hans Peter Freyther 9e8f1c0362 doc: Describe the optional 'stats' parameter 2012-07-21 00:09:52 +02:00
Holger Hans Peter Freyther 36bac9a8b1 doc: Add a newline to fix the documentation of the HSL option 2012-07-20 23:49:52 +02:00
Diego Elio Pettenò e5ae7f5217 build: remove checks introduced by autoscan.
Therre is no current use of HAVE_* variables for these checks in the
code, so there is no reason to keep the checks around.

Signed-off-by: Diego Elio Pettenò <flameeyes@flameeyes.eu>
2012-07-01 07:40:36 +02:00
Diego Elio Pettenò 6e389a3b2b build: consolidate automake options to configure.ac
Also disable building the gzip distribution since we're building the
bzip2-compressed tarball already.

Signed-off-by: Diego Elio Pettenò <flameeyes@flameeyes.eu>
2012-07-01 07:40:36 +02:00
Diego Elio Pettenò 56855350e9 build: build libosmotrau.la in the src directory.
This spares us another recursion, and allows a much higher
parallelisation, since trau is only one source unit and one standalone
library.

Incidentally, also make sure that the version specification for
libosmoabis is applied.

Signed-off-by: Diego Elio Pettenò <flameeyes@flameeyes.eu>
2012-07-01 07:40:36 +02:00
Diego Elio Pettenò 05819cebc4 build: avoid using a convenience library for the input subdirectory.
automake is well capable of building sources present in sub-directory
without requiring a recursion, so there is no reason to use a
non-installed library just for the extra files.

Signed-off-by: Diego Elio Pettenò <flameeyes@flameeyes.eu>
2012-07-01 07:40:36 +02:00
Diego Elio Pettenò 3dfe8bf80c build: only build tests during make check
Signed-off-by: Diego Elio Pettenò <flameeyes@flameeyes.eu>
2012-07-01 07:40:36 +02:00
Diego Elio Pettenò 51f7940d1f build: use nobase_include_HEADERS instead of using recursive Makefiles
This simplifies installation of include files, as make no longer have
to recurse into subdirectories and install each subset of files in
different directories.

Signed-off-by: Diego Elio Pettenò <flameeyes@flameeyes.eu>
2012-07-01 07:40:35 +02:00
Diego Elio Pettenò 62f0e0612a build: use LT_INIT([pic-only]) instead of forcing -fPIC in AM_CFLAGS.
Also contextually remove the AC_PROG_LIBTOOL call (which is an
obsolete name for what is now LT_INIT).

Signed-off-by: Diego Elio Pettenò <flameeyes@flameeyes.eu>
2012-07-01 07:40:35 +02:00
Holger Hans Peter Freyther 584672e8f4 misc: Fix the email address in the configure.ac 2012-03-26 16:36:57 +02:00
Harald Welte 36a85a41b0 ipaccess: hex-dump message in case ops->sign_link() returns an error 2012-03-18 18:46:23 +01:00
Holger Hans Peter Freyther 180ce7eaad e1_input.h: Declare abis_rsl_sendmsg(struct msgb *msg)
The E1 abstraction provides the above method, declare it in
our header file.

GCC warning (of OpenBSC):
abis_rsl.c: In function ‘rsl_bcch_info’:
abis_rsl.c:221:2: warning: implicit declaration of function ‘abis_rsl_sendmsg’ [-Wimplicit-function-declaration]
2012-02-04 19:01:36 +01:00
Holger Hans Peter Freyther df78e92596 osmo-ortp: Prefix oRTP messages with osmo-ortp
When many applications write to the stdout it is not clear that
'network_error' comes from osmo-bts due the usage of oRTP. At least
provide a hint that oRTP is involved.
2012-02-04 19:01:36 +01:00
Andreas Eversberg a659f4827e Fixed TRAU frame handling of packet lengths that are not a multiple of 4 2012-01-18 19:07:30 +01:00
Andreas Eversberg 4308667a25 Fixed wrong reference while opening mISDN socket 2012-01-18 19:06:12 +01:00
Holger Hans Peter Freyther 55467f0478 abis/close: Deliver S_L_INP_TEI_DN when closing the socket
* HSL/IPA had different socket closing code for the same thing,
  create one method for it.
* Both methods tried to send an event but as we are on the close
  path the sign_link was already removed from the list and the
  input event sending method couldn't find the sign_link using the
  sapi/tei provided.
2011-12-28 19:47:07 +01:00
Andreas Eversberg d73c84670b mISDN input: avoid some strange distortion caused by buffer mgmt
We used to write as many messages as we received from mISDN for
b-channels.  Now we write as many _bytes_ as we have received, which
seems to be the more logical thing to do.
2011-12-20 18:56:42 +01:00
Holger Hans Peter Freyther e194cd92a8 ipa: The message claims to close the socket but it remains open.
Correct the 'closing socket' statement. It would be nice to know
why this message has been discarded but I can't answer that right now.
2011-11-07 13:37:56 +01:00
Harald Welte 0b5ffc1788 osmo_ortp: include ortp/port.h for the memory management functions 2011-10-22 15:58:02 +02:00
Harald Welte 833aa79ffa version 0.13.1 of libortp seems sufficient 2011-10-22 15:57:42 +02:00
Holger Hans Peter Freyther 25c83611be misc: Linker fix for Ubuntu 11.10
--as-needed was default in Natty and somehow got more strict in
this version of Ubuntu. Link to osmo vty.
2011-10-16 17:19:13 +02:00
Harald Welte 43f4e08841 depend on new libosmocore 0.3.10 (lapd) and increment LIBVERSION 2011-10-10 08:49:01 +02:00
Andreas Eversberg 8aaed05e21 Length check of LAPD messages to prevent overflows on corrupt frames 2011-10-01 04:10:57 +02:00
Andreas Eversberg d88c5bf637 Fixed missing T203 in profiles 2011-09-30 03:41:44 +02:00
Andreas Eversberg 3c46044cf1 Addition to last commit 2f5a3714075882ac946536709ac581453b6ad52a 2011-09-29 01:31:20 +02:00
Andreas Eversberg 3744b873e5 LAPD profiles are globally defined structures
The pre-defined structures can be used as a profile, as well as own
defined or modified versions of them.
2011-09-29 01:31:20 +02:00
Andreas Eversberg a7ff0019b3 Replaced LAPD implementation with new LAPD core of libosmogsm
The core functionality of input/lapd.c is removed. Now it uses lapd_core.c
of libosmogsm. The stucture of lapd_instance and SAP (SAPI/TEI handling)
is kept, as well as interfaceing and header transcoding. The former
implementation of datalink is completely replaced, except for the minimal
TEI manager..

Currently it supports 3 modes:
- ABIS (BS11/Ericsson/Nokia)
- ISDN (Not used yet)
- ASAT (A interface for satellite)
all these modes can run as NETWORK or USER.
2011-09-29 01:31:20 +02:00
Harald Welte fe05cf5b39 DAHDI: add information on span number, timeslot count to VTY 2011-09-26 23:18:41 +02:00
Harald Welte 494f290f6b DAHDI: remove unused variable 2011-09-26 23:06:49 +02:00
Harald Welte 0cf5514616 DAHDI: Print error message in case config uses non-existing span 2011-09-26 23:06:18 +02:00
Harald Welte e2bd68575f DAHDI: make sure the first e1_line N port start with number 0 2011-09-26 23:03:12 +02:00
Harald Welte 356918fed4 fix parsing error during "e1_line N port M"
A misplaced comma in the DEFUN macro argument list resulted in
part of the help message becoming part of the command syntax ;)
2011-09-26 22:58:07 +02:00
Alexander Huemer 70e04c7ccc request ortp >=0.15.0
build fails with ortp <0.15.0 because of incompatible API.
2011-09-26 17:14:55 +02:00
Harald Welte c2889512c4 e1_input: add 'port_nr' field and support DAHDI T1 cards
the "e1_line <0-255> port <0-255>" vty command allows the user to
set which physical port/card number should be represented by the
given virtual e1_line.

Furthermore, we now actually query the DAHDI hardware to determine the
number of ports of a given span (e.g. only 24 in case of T1) instead of
blindly assuming there are 31 timeslots on each port.

This specifically will fix T1 timeslot (/dev/dahdi/%u) calculation in
setups with multiple DAHDI spans/ports and a T1 span != span 1.
2011-09-25 23:37:47 +02:00
Daniel Willmann a0d9331cb1 ipa: Add a callback to detect if the server_conn was closed 2011-09-19 03:00:43 +02:00
Daniel Willmann dc4479f27d ipa: Fix resource leak if we encounter an error in ipa_server_conn_read
In case of a connection reset or protocol error we should destroy the
connection as well.
2011-09-19 03:00:26 +02:00