Commit Graph

59 Commits (master)

Author SHA1 Message Date
Harald Welte 456135a605 e1_recorder: Fix potential null-dereference
Fixes: CID#307523: Dereference null return value (NULL_RETURNS)
Change-Id: I481f0695f971f5cd2e77b8c9c62d423a70e0840d
2023-07-18 14:40:30 +02:00
Vadim Yanitskiy dc4b5d6522 configure.ac: migrate from python2 to python3
Fortunatelly we don't have any python2 specific code, so just bump.

Change-Id: Ib293c60cf66000b3e2520f7a02f39c4baa1c5ce9
2023-07-15 00:58:55 +07:00
Harald Welte e9ce31876d handle telnet_init_default() error case
Closes: CID#307532
Change-Id: I0210b535b844529e217fd5d6ffb01f94a262dc9c
2023-02-06 17:03:34 +01:00
Max 7b6171b473 Add git-review config
Change-Id: I4ce3f6806fed00c452d859c164a42a4f9f3f7d1f
2022-12-23 11:16:30 +00:00
Alexander Rehbein 55a1b836ea osmo-e1-recorder: Transition to use of 'telnet_init_default'
Related: OS#5809
Change-Id: Id8148f71f4231de40c4762094e2969d11821e5c4
2022-12-19 22:34:39 +01:00
Harald Welte 91c6873cc0 Support RPM building via contrib/osmo-e1-recorder.spec.in
Change-Id: I1851b5c2a68ec9559e42c9da3f04d43c0fc7cdfe
2022-11-06 12:36:05 +01:00
Harald Welte 50f3f8e179 README.md: Fix lots of typos + formatting in markdown
Change-Id: I14cad6ae7e20479aea0c872fc57100f6a890a209
2022-11-06 10:36:36 +01:00
Harald Welte d54a10b2b0 README: Migrate to README.md
Change-Id: Ic6553d7f672d737cc2813b3b0aeb7fc1d4715ce5
2022-11-06 10:35:59 +01:00
Harald Welte 31d44f4d19 README: update explaining the difference to other approaches
Change-Id: Ie6afe8016c0168c2f0beee96d6c151c5b4cc5e81
2022-11-06 10:35:26 +01:00
Harald Welte 81e622768d jenkins.sh: Fix printed URL of osmo-ci git repository
Change-Id: I043c2c613a3b204403f3b0fb41cab9f41bfc77fe
2022-11-06 10:31:34 +01:00
Harald Welte b9c7fd8f79 Fix use of logging_vty_add_cmds(void) API function.
This function never accepted any arguments.  However, a sloppy
declaration in the header file as logging_vty_add_cmds() allowed
to pass any number of any type arguments until recently.

Change-Id: Icdbe2f253c9e17ff82bd3b1dc3d4fbea4ad6f333
2022-11-06 10:29:41 +01:00
Harald Welte be5f2c7d81 update git URLs (git -> https)
Change-Id: I2fa27a3fd75db65f828153124dc4e4f5b9ea6780
2022-06-18 11:56:48 +02:00
Oliver Smith b07caaceba configure: don't turn some warnings into errors
Do not turn some compiler warnings into errors by default. This part was
copied from openbsc.git 34f012 ("Turn some compiler warnings into
errors"), where it was added before --enable-werror was available.

We build with --enable-werror during development and in CI. If the code
is built with a different compiler that throws additional warnings, it
should not stop the build.

Related: OS#5289
Change-Id: Ib5602017545d68f0fdb0b4df7ed3087a2cb1775c
2021-11-04 10:59:10 +01:00
Eric Wild 607a3e4bdb tests: adjust slot numbers
The vty ts slot number was adjusted in commmit
df088b0ea93d3d5851ee680ae95afa30a9359730 in libosmo-abis

Change-Id: I97fc56461f800afb067f815bb85fbfab102d86f0
2021-05-18 12:05:16 +02:00
Oliver Smith 91a98c0865 configure.ac: set -std=gnu11
Change-Id: I19674944cea499d450571a7c6e47ab5676dc4b21
2021-01-28 10:48:52 +00:00
Oliver Smith 1a469b3a7b contrib/jenkins: don't build osmo-gsm-manuals
Related: OS#4912
Change-Id: I5349a67dcc6dd47e5a1cc9f8d30a2ca7aa1094f9
2021-01-13 13:48:28 +01:00
Harald Welte d8b9e552db fix build against recent libosmo-abis (typo fixes)
libosmo-abis Change-Id Ifb22b5544cf06012fa529828dfdf3f0d73b07e7d
fixed spelling from existant -> existent, which breaks some of the
tests here.

Making this change catches up, but will of course fail when older
libosmo-abis versions are used.  Given the niche nature of
osmo-e1-recorder, I think it's not worth investing time into that.

Change-Id: Ib7430bf940dea33df79abe01baae670f188ff82e
2020-11-06 08:58:47 +01:00
Harald Welte 130eeb39f7 fix "-Werror" build against latest libosmo-abis
libosmo-abisrecently marked the 'out_cb' of the subchan_demux
as 'const', which caused compiler warnings/errors.

Related: libosmo-abis.git Ia082b9fddf03d02afd007825a1588a3ef0dbedae
Change-Id: I0cf430980e50fa8094f0efc7642004fb5923c4c6
2020-06-09 09:03:55 +02:00
Harald Welte 456888a273 make e1cap format portable
The original format included a 'struct timeval' into the packet header,
which unfortunately is non-potrable between e.g. i386 and amd64.

Change-Id: I0d22ad8f772d173c2252c2f6c562faee2e578806
2019-12-04 14:15:47 +01:00
Harald Welte 8486938efb e1_recorder: Skip storing data to disk if line is in ALARM state
Change-Id: Ie4c671053d372bc700f506198d1916853da03b9e
2019-12-04 14:15:47 +01:00
Harald Welte 1b41abda3d e1cap_dump: Avoid deprecated osmo_init_logging() API
Change-Id: I7d9d88eb5615f6b323b6c36eceb4d847bae01d1d
2019-12-04 14:15:47 +01:00
Harald Welte 45e12d3f8e e1_recorder: Avoid deprecated osmo_init_logging() API
Change-Id: Ib0e7c90eb8049acd48d6b3cf32ec2fc2c7a2ef29
2019-12-04 14:15:47 +01:00
Harald Welte 54fc223ab9 jenkins.sh: disable 'publish' of manuals; we don't have any yet
Change-Id: Ib5fb783e4e7e5e327e474344220206f33c64a8bd
2019-12-04 13:57:57 +01:00
Harald Welte b36921fffc e1cap_dump: Add -h and -V to print help / version of program
Change-Id: I621c1f15e1bdb38691ae1fc50c5190ae2701eb58
2019-12-04 12:08:33 +01:00
Harald Welte 06e3198e70 e1_recorder: Add --help and --version command line arguments
Change-Id: Ie676466e5406243cf4205948cddd95426e2b8c10
2019-12-04 12:08:33 +01:00
Harald Welte 2c5c079e53 print error message when config file cannot be opened
Change-Id: I52514adf853c0d2dc5114864f0713e549733786d
2019-12-04 12:08:33 +01:00
Harald Welte cbf23b6465 exit(2) on unsupported positional arguments on command line
Change-Id: I6d4efa6ddef41607aecd5ceee78e400db821292f
2019-12-04 12:08:33 +01:00
Harald Welte 50595fb9b5 vty: Make sure to save timeslot mode in lowercase (as vty expects)
Change-Id: I9b11fbe3bf85b7096a3bd5f9b67168350e66a90a
2019-12-04 12:08:33 +01:00
Harald Welte a6d1211414 tests: Add test_nodes.vty for VTY interface testing
Change-Id: I322e8857990f77246bcf4dbc0510f4b42527dc82
2019-12-04 12:08:33 +01:00
Harald Welte de9e646193 vty: don't store configurations for timeslots in mode NONE
This reflects what happens in libosmo-abis during 'show e1'
and makes sure we don't attempt to write for more TS than exist
(e.g. in the T1 case).

Change-Id: Iaeac2d080ae3ddc27901cbc4be5220100e9820a8
2019-12-04 12:04:22 +01:00
Harald Welte 3863beef26 e1cap_dump: fix superchannel without pcap output
We have to check if g_pcap_fd is >= 0,as we initialize it to -1.

Change-Id: I458c02b4619b6fb2c7d30b1ce3bbac86243a6977
2019-11-24 18:56:12 +01:00
Harald Welte 645fa46967 add contrib/jenkins.sh
Change-Id: I79d9e12ef723841db186cd122da4dadb3f7d3969
2019-11-24 18:42:29 +01:00
Harald Welte 2933fcf477 update .gitignore
Change-Id: Id9adf8d444013272a461bd5f4dbe64a5d0b373b4
2019-11-24 18:42:29 +01:00
Harald Welte bad3897529 convert build system to autotools
Change-Id: I705b5356309507c39eaf517ca5b9ce0e1aa89852
2019-11-24 18:42:29 +01:00
Harald Welte 6df0729271 fix various compiler warnings
Change-Id: I65a862132563f578eff11b8d085960b820f5d4b7
2019-11-24 18:42:26 +01:00
Harald Welte 6f45dcdc25 storage.c: Fix compiler error due to missing writev() declaration
storage.c:90:7: error: implicit declaration of function ‘writev’; did you mean ‘write’? [-Werror=implicit-function-declaration]
   90 |  rc = writev(g_out_fd, iov, ARRAY_SIZE(iov));
      |       ^~~~~~
      |       write

Change-Id: If98737199f5a6e8fb37a4fd6403ee973dcf70612
2019-11-24 18:06:06 +01:00
Harald Welte 41a5300243 e1_recorder: Add LAPD PCAP dump support
We can now write a PCAP file from the HDLC-decoded super channel.
2016-11-14 23:22:49 +01:00
Harald Welte 90bd7b6709 hdlc: add call-back function for completely decoded HDLC frames
... and some more comments/documentation
2016-11-14 22:06:46 +01:00
Harald Welte 1df5cf4950 e1cap_dump: Implement functional HDLC decode of super-channel
Finally the bit ordering and bit format of the SuperChannel has been
figured out.
* the data as read from DAHDI must be flipped (0->1 / 1->0). why?
* the data must be read lsb-first when converting into a bit-buffer

We are now getting the following output e.g. for a OM2000 "TX
Configuration Request" message:
fa 03 8a 8a 80 80 00 13 00 b0 0b 00 ff 01 20 00 2e 2b 1c 00 06 01 95 81 76 00 e9 bf
^ lapd hdr  ^ OML    ^l ^OM2000 TX Config Req for 43 dBm
2016-11-14 21:29:01 +01:00
Harald Welte 6daa71dbd2 hdlc: Simplify + Fix HDLC implementation
* remove the notion of states, as there is really only one state
* implement zero removal / bit stuffing for synchronous links
2016-11-14 21:26:11 +01:00
Harald Welte 90fb785804 hdlc: Add some more comments to the code [cosmetic] 2016-11-14 19:34:30 +01:00
Harald Welte d83c51379b WIP: More work on SuperChannel decode, but it doesn't work yet... 2016-10-26 09:38:24 +02:00
Harald Welte 59b94d0611 add .gitignore file 2016-10-26 09:38:18 +02:00
Harald Welte c1b9cab053 e1cap_dump: Add SC (Super Channel) mode
In the super channel mode, it seems the BTS transmits one byte in each
timeslot, accross the entire link.

This basically means that if you have a 10 byte long signalling message
to be sent, its first byte will be in TS1 up until the tenth byte in
TS10.

As we are reading in 160 byte chunks from the E1 timeslots, we build a
matrix with 160 columns (for each byte) and 24/30 rows (timeslots).  So
we write 24 times 160 bytes into the matrix.

Once we have completed all timeslots, we start to read the matrix by
reading byte 0 of each timeslot (in incrementing TS order), next byte 1
of each timeslot, ... until we end up having read 160 times 24 bytes
from the matrix.

The resulting bitstream needs to be HDLC-synchronized and the resulting
messages passed up for further decoding.
2016-10-23 19:36:14 +02:00
Harald Welte 4dc14a751b e1_recorder: add config option for configuration file 2016-10-19 10:55:25 +02:00
Harald Welte 2ac78497dd e1_recorder: propagate errors to main, where we exit() in case of failing to open file 2016-10-19 10:55:25 +02:00
Harald Welte df7a306df5 e1_recorder: Add signal handlers for log file rotation + talloc report 2016-10-19 10:55:25 +02:00
Harald Welte 13351138e2 e1_inp: Use HDLC mode for signalling, not SIGN
The SIGN mode implies that LAPD instances are bound to the timeslots, which is
of course not what we want in a pure capturing/recording scenario.

Instead, use the new E1INP_TS_TYPE_HDLC mode, which allows us to capture
any HDLC framed messages on E1/T1 timeslots, whether LAPD or e.g. MTP.
2016-10-19 10:54:59 +02:00
Harald Welte 525af1832e e1cap_dump: Add 16k sub-channel demux + filter
We can now filter a given 16k sub-slot out of the capture data and
export it to stdout.
2016-10-19 00:38:46 +02:00
Harald Welte f403232e0f e1cap_dump: Add capability to filter on a given line+timeslot and for binary output 2016-10-19 00:23:10 +02:00