Commit Graph

24 Commits

Author SHA1 Message Date
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
Harald Welte 57ea229e8a storage.c: Remove debug printf() 2016-10-19 00:22:55 +02:00
Harald Welte 74d1e3409d e1cap_dump: Print human-readable time 2016-10-19 00:06:22 +02:00
Harald Welte dbb0f5ae99 add a command line tool for dumping the contents of a capture file 2016-10-18 23:51:54 +02:00
Harald Welte 232b972035 storage.h: make sure we use packed attribute not aligned.
This was a stupid mistake when writing the header initially, let's try
to fix it while staying binary compatible.
2016-10-18 23:50:49 +02:00
Harald Welte 4a92d0b9b9 e1_recorder: Fix msgb memory leaks in absence of a mirror port 2016-10-18 21:36:01 +02:00
Harald Welte afb6d39908 storage.h: document fields of header 2016-10-17 18:50:19 +02:00
Harald Welte b7e40238d7 first functional version that actually records + mirrors data 2016-07-29 14:26:50 +02:00
Harald Welte 0e91aa1ec5 fix compilation 2016-07-28 21:03:40 +02:00
Harald Welte 39cfbf435d initial import of incomplete project to record E1 lines 2016-07-28 09:04:11 +02:00