Commit Graph

68 Commits

Author SHA1 Message Date
Harald Welte b8a70980b6 patch %s out of format strings received from phone
%s can obviously not work, as we have no access to the targets memory
space on the host PC.  I guess the programmers adding those log lines
have done so in error.  Let's replace %s with %p in the format string.
2017-01-08 16:04:01 +01:00
Harald Welte 5fa552cbd3 separate diag_log_umts to diag_log_wcdma
Qualcomm differentiates between WCDMA (the access stratum) and UMTS (the
non access stratum).  Let's reflect that here.  As an added bonus, we
get working NAS protocol traces.
2017-01-08 16:04:01 +01:00
Harald Welte a32c769bb7 Generate GSMTAP messages from raw received DIAG frames
This forwards the raw DIAG messages via GSMTAP, so the receiver (e.g.
wireshark) will have to do a full DIAG protocol decode.  I currently
prefer this idea to that of converting only the protocol payload to
"native" GSMTAP messages like GSMTAP_UM.

One of the problems is that the LAPDm headers are alrady stripped, and
we would have to re-add fake LAPDm headers to generate GSMTAP_UM.  So
let's rather forward all information we have and let wireshark deal with
it.

I'm not entirely sure if this is  the best strategy, but we can always
implement both modes and switch between them at runtime.
2017-01-08 16:04:01 +01:00
Harald Welte a115fbb1bb diag_read_msg(): Discard any messages shorter than 3 bytes
The 16bit CRC and the FLAG octet together are 3 bytes.  If a message is
shorter than that, something is going wrong, for sure.
2017-01-08 16:04:01 +01:00
Harald Welte 4ae0936123 WIP: Enable PCAP generation in modem 2017-01-07 16:01:42 +01:00
Harald Welte 6ec7abf157 Genreate GSMTAP messages from raw received DIAG frames 2017-01-07 16:01:42 +01:00
Harald Welte 651d4d8fbc replace old magic numbers with proper #defines 2017-01-02 00:53:11 +01:00
Harald Welte 02f7f3af76 diag_io.c: remove left-over 'rc=%d' print 2017-01-02 00:52:29 +01:00
Harald Welte 0eb2ef1a26 DPL: consequently use struct dpl_iid rather than uint32_t 2017-01-02 00:52:01 +01:00
Harald Welte 3b144a27fa DPL: add parsing of results from modem
we can now get a list of DPL interfaces and their links.
2017-01-01 19:51:50 +01:00
Harald Welte f727edcd7d diag_push_subsys_hdr(): subsystem code is 16bits 2017-01-01 19:51:50 +01:00
Harald Welte ddd6a0d249 diag_cmd: Print error messages for bad {command, length, parameter} 2017-01-01 19:51:50 +01:00
Harald Welte 89c159c873 add printing of DIAG_QSR_EXT_MSG_TERSE_F
Those are QSHRINK type messages where the format-string is not contained
in the message itself but would have to be provided from an external
source and looked up by a hash.
2017-01-01 19:51:50 +01:00
Harald Welte 022c45a263 register diag_msg via the diag_cmd dispatch table 2017-01-01 19:51:50 +01:00
Harald Welte 95fdb6e584 don't use magic numbers if we have #defines 2017-01-01 19:51:50 +01:00
Harald Welte 58185e6df5 fixup dpl 2017-01-01 19:51:50 +01:00
Harald Welte 7af93aacba diag_msg: endian fixes 2017-01-01 19:51:50 +01:00
Harald Welte f6bd58c7fb diag_msg: Include subsys_id in printed message 2017-01-01 19:51:50 +01:00
Harald Welte e4204631bc diag_log: rough verification if response matches request 2017-01-01 19:51:50 +01:00
Harald Welte c265c1206d remove Tx/Rx debugging from diag_io.c 2017-01-01 19:51:50 +01:00
Harald Welte f180199521 diag_msgc: Parse responses 2017-01-01 19:51:50 +01:00
Harald Welte efb3ecadd7 add ability to hexdump all received and transmitted messages 2017-01-01 19:51:50 +01:00
Harald Welte dc2cafcd97 restructuring: Introduce _transceive_ functions for Tx-then-Rx 2017-01-01 19:51:50 +01:00
Harald Welte 9a3cd09fed fixup dpl 2017-01-01 19:51:50 +01:00
Harald Welte 035e146029 fix DIAG timestamp conversion routines + add comments 2017-01-01 19:51:50 +01:00
Harald Welte ce2f3967a0 WIP: gsmtap 2017-01-01 19:51:50 +01:00
Harald Welte 8ca17c654f fix typos 2017-01-01 19:51:50 +01:00
Martin Hauke af2351546e Fix typos 2016-12-28 15:12:38 +01:00
Martin Hauke b236aa77a0 Fix no-return-in-nonvoid-functions in osmo-qcdiag-log.c
[    4s] E: osmo-qcdiag no-return-in-nonvoid-function osmo-qcdiag-log.c:170

[hfreyther: Changed exit to return EXIT_SUCCESS]
2016-12-28 15:11:52 +01:00
Holger Hans Peter Freyther 1d53544f1c Modernize README, move the old information to HISTORY 2016-12-26 16:04:02 +01:00
Harald Welte 9fe15e0dff Add TODO file 2016-12-24 16:25:31 +01:00
Harald Welte ccea8dd51c Add GPLv2-or-later license text + headers + rename to osmo-qcdiag-log 2016-12-24 10:31:07 +01:00
Harald Welte 634d57a4f5 Makefile: use pkg-config to get libosmocore cflags/libs 2016-12-24 10:27:39 +01:00
Harald Welte 97de170735 add missing #pragma once to header files 2016-12-24 10:19:23 +01:00
Harald Welte 84ec50f901 header file restructuring
Move all protocol definitions to protocol/*.h and keep only
definitions related to our implementation as *.h in the top directory.

Also, remove some header files to reduce header file proliferation.
2016-12-24 10:16:00 +01:00
Harald Welte 6fc7f68db8 introduce API for MSG SSID runtime mask configuration 2016-12-24 10:01:28 +01:00
Harald Welte 0e50916954 move DIAG MSG handling to separate file diag_msg.c 2016-12-24 01:32:10 +01:00
Harald Welte 98f6fadd96 diag_io: print error messsage to stderr 2016-12-24 01:27:49 +01:00
Harald Welte faea754d39 re-structure the LOG dispatcher
we now have a nice structure for dispatching log messages to various
handlers, each self-contained.  As an added benefit, we remove the need
to manually enable all the various log codes, as we simply auto-generate
the default config from all the message types we support.

Furthermore, we reduce computational complexity by avoiding linear
iteration over the array of registered log handlers.
2016-12-24 01:21:03 +01:00
Harald Welte 2c36375f5b better formatting of output, incldue LOG/MSG prefix, timestamp, ... 2016-12-24 00:19:55 +01:00
Harald Welte 654f1179c0 cosmetic: some more comments 2016-12-24 00:01:25 +01:00
Harald Welte 4359a48ca6 rename dump_log() to diag_rx_ext_msg_f()
there is too many things called log.  Let's align more closely with how
diag calls things.  This function is about handling the extended message
service, which is basically a 'remote printf'.
2016-12-23 23:56:26 +01:00
Harald Welte 234b56b477 fix various compiler warnings 2016-12-23 23:44:19 +01:00
Harald Welte b506ce8b74 rename Makefile to more usual name 2016-12-23 23:41:36 +01:00
Harald Welte bd4485852a split the I/O part into diag_io.c 2016-12-23 23:41:14 +01:00
Harald Welte 272b4ae157 remove our own framing.c implemmentation in favor of Linux one
The Qualcomm Linux kernel has a HDLC encoder/decoder, let's use that one
rather than our own implementation.
2016-12-23 23:28:28 +01:00
Harald Welte 4e06b5cb44 remove local serial.[ch] code and use libosmocore for that 2016-12-23 22:58:41 +01:00
Harald Welte 6a50b9670e diagchar_hdlc.c: Adopt to work outside of the Linux kernel
... and rather work in userspace, relying on libosmocore for CRC
2016-12-23 22:54:30 +01:00
Harald Welte 99ac1f3800 import diagchar.[ch] from linux kernel of Quectel EC25 module
Rather than running our own, we should just use the same HDLC code that
Qualcomm also uses. It's GPLv2 from the Qualcomm Linux kerenl sources.
2016-12-23 22:09:22 +01:00
Harald Welte 7e8d96f6c8 framing.c: Unify coding style 2016-12-23 22:02:04 +01:00