summaryrefslogtreecommitdiff
path: root/monitor/control.c
Commit message (Collapse)AuthorAgeFilesLines
* monitor: Inclusive language changesArchie Pusaka2021-09-211-5/+5
| | | | | | | | BT core spec 5.3 promotes the usage of inclusive languages. This CL replaces some terms with the more appropriate counterparts, such as "central", "peripheral", "link key", and "accept list" Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
* lib: Inclusive language changesArchie Pusaka2021-09-211-2/+2
| | | | | | | | BT core spec 5.3 promotes the usage of inclusive languages. This CL replaces some terms with the more appropriate counterparts, such as "central", "peripheral", and "accept list". Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
* monitor: Fix truncated server socket path parameterMariusz Skamra2021-08-041-4/+2
| | | | | | | This fixes the issue of --server <socket> parameter last character was dropped. There is no need to use strncpy, as the length is already checked, and it is known that the destination buffer is big enough
* monitor: Fix potential memory leakTedd Ho-Jeong An2020-11-241-3/+17
| | | | | | | | | | | | | | | | | | | | | | | | If the mainloop_add_fd() returns with failure, the destroy callback is never called so any reosurces need to be released never freed/closed. This potential leakage is checked with valgrind after failing the mainloop_add_fd() function manually. ==258684== 1,500 bytes in 1 blocks are definitely lost in loss record 3 of 3 ==258684== at 0x483BB1A: calloc (vg_replace_malloc.c:760) ==258684== by 0x123F1A: open_channel (control.c:1058) ==258684== by 0x125B09: control_tracing (control.c:1540) ==258684== by 0x122764: main (main.c:255) ==258684== ==258684== LEAK SUMMARY: ==258684== definitely lost: 1,500 bytes in 1 blocks ==258684== indirectly lost: 0 bytes in 0 blocks ==258684== possibly lost: 0 bytes in 0 blocks ==258684== still reachable: 48 bytes in 2 blocks ==258684== suppressed: 0 bytes in 0 blocks This patch frees/closes the resources if the function returns with failure.
* monitor: Add SPDX License IdentifierTedd Ho-Jeong An2020-09-211-14/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds SPDX License Identifier and removes the license text. ------------------------------------- License COUNT ------------------------------------- LGPL-2.1-or-later : 47 License: LGPL-2.1-or-later monitor/bt.h monitor/hcidump.h monitor/avdtp.h monitor/crc.c monitor/sdp.c monitor/hwdb.c monitor/intel.h monitor/avctp.c monitor/control.h monitor/display.c monitor/a2dp.c monitor/ll.c monitor/ll.h monitor/jlink.h monitor/broadcom.h monitor/lmp.c monitor/keys.c monitor/ellisys.c monitor/main.c monitor/ellisys.h monitor/hwdb.h monitor/display.h monitor/jlink.c monitor/rfcomm.h monitor/packet.c monitor/crc.h monitor/keys.h monitor/sdp.h monitor/rfcomm.c monitor/avdtp.c monitor/a2dp.h monitor/avctp.h monitor/vendor.h monitor/hcidump.c monitor/intel.c monitor/tty.h monitor/control.c monitor/lmp.h monitor/analyze.c monitor/bnep.c monitor/l2cap.c monitor/vendor.c monitor/packet.h monitor/broadcom.c monitor/analyze.h monitor/l2cap.h monitor/bnep.h
* monitor: Add support for opening extra mgmt socket for eventsMarcel Holtmann2020-04-081-1/+2
|
* monitor: Adding missing settings descriptions in btmonAlain Michaud2020-03-271-1/+1
| | | | This change adds the missing settings descriptions from btmon.
* monitor: Add support for reading over J-Link RTTAndrzej Kaczmarek2019-10-141-0/+50
| | | | | | | | | | | | | | | | | | | | | | This patch adds support for reading data over J-Link RTT. It can be used as replacement for TTY when reading from embedded devices since it's much faster and does block a UART. Data format is the same as for TTY. At the moment monitor over RTT is only supported by Apache Mynewt project. Reading data is done by polling RTT every 1 msec since there is no blocking API to read something from RTT buffer. To enable reading from RTT, J-Link configuration needs to be passed via command line (all parameters except <device> can be skipped to use default value): -J <device>,<serialno=0>,<interface=swd>,<speed=1000> -J nrf52,683649029 In some cases J-Link cannot locate RTT buffer in RAM. In such case RAM area and buffer name should be provided via command line: -R <address=0x0>,<area=0x1000>,<buffer=monitor> -R 0x20000000,0x10000
* monitor: Extract TTY data processing to separate functionAndrzej Kaczmarek2019-10-141-16/+21
|
* build: Move declaration of _GNU_SOURCE back into individual source filesMarcel Holtmann2018-12-061-0/+1
|
* monitor: Allow Ellisys injection when reading from TTYAndrzej Kaczmarek2018-07-201-0/+2
|
* monitor: Use BPF to filter packets by indexLuiz Augusto von Dentz2018-07-191-0/+42
| | | | This uses a BPF filter to filter packets to specific index.
* monitor: Add command line option to disable pager supportMarcel Holtmann2018-05-241-3/+5
|
* monitor: Fix compiler warning from wrong array sizeMarcel Holtmann2018-05-231-1/+1
|
* tools: Add initial code for btmon-loggerSzymon Janc2018-04-241-1/+1
| | | | | | This is intended for use for automated logging or unatrended systems. It doesn't contain any packet decoding functionality which results in much smaller binary.
* monitor: Fix buffer overflow with unix socketERAMOTO Masaya2017-10-051-1/+8
| | | | | | | | | | | | | | | | | If btmon uses a unix socket, which has a long pathname, then the buffer overflow occurs as below: *** strcpy_chk: buffer overflow detected ***: program terminated at 0x4C3085C: ??? (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so) by 0x4C34E46: __strcpy_chk (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so) by 0x4084FE: strcpy (string3.h:110) by 0x4084FE: control_server (control.c:1148) by 0x4029E9: main (main.c:144) This patch also gives an error and stops running when parsing command-line arguments if the unix socket pathname is too long. And this patch adds the redundant check in control_server() to prevent the regression when reusing in the future.
* monitor: Disable decoding of control channel and not close itMarcel Holtmann2016-09-011-9/+8
|
* monitor: Close the mgmt channel if control tracing is availableMarcel Holtmann2016-08-281-2/+12
|
* monitor: Pass drop count from TTY to BTSnoop fileJohan Hedberg2016-05-041-4/+8
|
* shared/btsnoop: Add support for providing cumulative drops countJohan Hedberg2016-05-041-2/+2
|
* monitor: Add support for writing to BTSnoop file from TTY inputJohan Hedberg2016-05-041-1/+3
|
* monitor: Introduce support for extended TTY headerJohan Hedberg2016-05-041-9/+92
| | | | Add support for packet drops and 32-bit timestamps.
* Make use of new tty_get_speed helperJohan Hedberg2016-04-271-54/+1
|
* monitor: Update to new header format of TTY protocolJohan Hedberg2016-04-271-13/+31
| | | | | | | | | | | The updated TTY protocol content looks like: uint16 data_len uint16 opcode uint8 flags uint8 hdr_len uint8 extra_hdr[hdr_len]; uint8 payload[data_len - 4 - hdr_len]
* monitor: Add error return value to control_tty()Johan Hedberg2016-04-271-6/+11
|
* monitor: Add --tty-speed command line switchJohan Hedberg2016-04-271-2/+55
|
* monitor: Fix processing left-over dataJohan Hedberg2016-04-271-10/+12
| | | | | If there's enough data in the buffer after processing a packet we should just continue looping and trying to parse it too.
* monitor: Fix checking for sufficient dataJohan Hedberg2016-04-271-2/+2
|
* monitor: Add support for TTY based dataJohan Hedberg2016-04-211-0/+89
| | | | Add support for receiving a monitor data stream over a TTY.
* btsnoop: Update file format identifiers for trace filesMarcel Holtmann2015-11-081-13/+13
|
* monitor: Add support for handling SCM_CREDENTIALS if presentMarcel Holtmann2015-10-301-5/+20
|
* monitor: Add full key type decoding for New Link Key eventsJohan Hedberg2015-06-021-1/+19
|
* monitor: Print control events for advertising added/removedMarcel Holtmann2015-03-241-0/+40
|
* lib: Change field name from class_of_dev to dev_classMarcel Holtmann2015-03-141-3/+3
|
* monitor: Add decoding for extended index control messagesMarcel Holtmann2015-03-141-0/+40
|
* monitor: Add strings for configuration and static address settingsMarcel Holtmann2015-03-061-0/+1
|
* mgmt: Update code to match updated New CSRK specificationJohan Hedberg2015-02-271-2/+21
| | | | | The 'master' parameter was renamed to 'type' and now has two new possible values.
* shared: Move mainloop implementation from monitor to sharedJohan Hedberg2015-02-121-1/+2
|
* monitor: Print full type information for LTKsJohan Hedberg2014-12-031-2/+31
|
* monitor: Use common maximum packet size definitionAndrei Emeltchenko2014-08-131-4/+2
|
* monitor: Rename pairable to bondableJohan Hedberg2014-07-301-1/+1
|
* monitor: Write btsnoop before processing packetSzymon Janc2014-07-151-1/+1
| | | | | In case of parser crash packet should still be present in btsnoop file. This allows to reproduce crash and provide fix.
* monitor: Exit with error if failed to open file for writingSzymon Janc2014-07-151-1/+3
|
* monitor: Print control settings details only if availableMarcel Holtmann2014-07-041-5/+7
|
* monitor: Decode New Configuration Options control messageMarcel Holtmann2014-07-041-0/+36
|
* monitor: Decode Unconfigured Index Removed control eventMarcel Holtmann2014-07-021-6/+16
|
* monitor: Decode Unconfigured Index Added control eventMarcel Holtmann2014-07-021-0/+10
|
* monitor: Add support for decoding New Connection Parameter eventAndre Guedes2014-07-021-0/+30
|
* monitor: Decode Device Added and Device Removed control eventsMarcel Holtmann2014-06-291-0/+46
|
* monitor: Fix User Passkey Request nameJohan Hedberg2014-06-011-1/+1
|