summaryrefslogtreecommitdiff
path: root/monitor/rfcomm.c
Commit message (Collapse)AuthorAgeFilesLines
* monitor: Fix uninitiailzed scalar variableTedd Ho-Jeong An2021-11-151-0/+1
| | | | | This patch fixes the uninitiailzed varialble(CWE-457) reported by the Coverity scan.
* monitor: Fix calculation of RFCOMM lengthLuiz Augusto von Dentz2021-09-021-1/+1
| | | | Byte order is assumed to be big endian instead of little endian.
* monitor: Fix possible crash of rfcomm packetYun-Hao Chung2021-05-131-0/+3
| | | | | | | | | | When RFCOMM_TEST_EA returns false, btmon assumes packet data has at least 5 bytes long. If that assumption fails, btmon could crash when trying to read the next byte. This patch fix it by checking the remaining size before reading the last byte. Reviewed-by: apusaka@chromium.org
* 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
* build: Move declaration of _GNU_SOURCE back into individual source filesMarcel Holtmann2018-12-061-0/+1
|
* monitor: Fix uuid.h includesJohan Hedberg2017-12-261-1/+1
| | | | | | | | | | | | Commit e0e7eb08d5d28a952221070a4b50794d63dcc625 tried to fix this, but missed most of the files concerned. Without the fix an out-of-tree build (e.g. make distcheck) will throw errors like this: CC monitor/l2cap.o ../monitor/l2cap.c:41:18: fatal error: uuid.h: No such file or directory #include "uuid.h"
* monitor/rfcomm: Fix a potential memory access issue for compatibility with LLVMMiao-chen Chou2016-12-221-1/+4
| | | | | | | | | | | | | | | | | | | | | | This patch removes "packed" attribute from the definition of struct rfcomm_rpn to prevent the access to an unaligned struct member in mmc_rpn(). This patch also introduces a temp variable in mcc_pn() to prevent unaligned access without touching the definition of struct rfcomm_pn, since struct rfcomm_pn is used as a PDU. error messages from LLVM build: monitor/rfcomm.c:238:36: error: taking address of packed member 'pm' of class or structure 'rfcomm_rpn' may result in an unaligned pointer value [-Werror,-Waddress-of-packed-member] if (!l2cap_frame_get_le16(frame, &rpn.pm)) monitor/rfcomm.c:287:36: error: taking address of packed member 'mtu' of class or structure 'rfcomm_pn' may result in an unaligned pointer value [-Werror,-Waddress-of-packed-member] if (!l2cap_frame_get_le16(frame, &pn.mtu)) Currently there is no corresponding flag in GCC to generate the same error messages. See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=51628.
* monitor/rfcomm: Fix left over packed structLuiz Augusto von Dentz2016-12-201-1/+1
|
* monitor/rfcomm: Remove packed attribute from structsLuiz Augusto von Dentz2016-12-161-5/+5
| | | | | These structs do not represent the raw PDU format thus they don't need to be the exact same size.
* monitor/rfcomm: Fix names formattingAndrzej Kaczmarek2015-11-161-3/+3
|
* monitor: Use local includes for libbluetooth headersMarcel Holtmann2015-02-121-1/+1
|
* monitor/rfcomm: Add support for decoding Test commandGowtham Anandha Babu2014-12-191-0/+19
| | | | | | | | | | | RFCOMM: Unnumbered Info with Header Check (UIH)(0xef) Address: 0x01 cr 0 dlci 0x00 Control: 0xef poll/final 0 Length: 6 FCS: 0xaa MCC Message type: Test Command RSP(0x08) Length: 4 Test Data: 0x 5f 54 65 73
* monitor/rfcomm: Fix byte ordering issueGowtham Anandha Babu2014-12-051-2/+2
| | | | | The correct byte order for RFCOMM protocol is little endian.
* monitor: Fix RFCOMM parity type maskAndrei Emeltchenko2014-12-051-1/+1
| | | | | Fix RFCOMM RPN parity type bit according to Spec. GSM 07.10 version 6.3.0. (PT1 - PT2 indicates the parity type).
* monitor/rfcomm: Fix incorrect byte swappingSzymon Janc2014-12-041-3/+3
| | | | Those were already converted to host order with l2cap_frame_get_be16.
* monitor/rfcomm: Add support for NSC frame decodingGowtham Anandha Babu2014-12-041-0/+20
| | | | | Changes made to decode NSC frame in RFCOMM for btmon. Not able capture the output.
* monitor/rfcomm: Add support for PN frame decodingGowtham Anandha Babu2014-12-041-0/+47
| | | | | | | | | | | | | | Changes made to decode PN frame in RFCOMM for btmon. RFCOMM: Unnumbered Info with Header Check (UIH)(0xef) Address: 0x01 cr 0 dlci 0x00 Control: 0xef poll/final 0 Length: 10 FCS: 0xaa MCC Message type: DLC Parameter Negotiation RSP(0x20) Length: 8 dlci 32 frame_type 0 credit_flow 14 pri 39 ack_timer 0 frame_size 666 max_retrans 0 credits 7
* monitor/rfcomm: Add support for RLS frame decodingGowtham Anandha Babu2014-12-041-0/+27
| | | | | | | | | | | | | Changes made to decode RLS frame in RFCOMM for btmon. RFCOMM: Unnumbered Info with Header Check (UIH)(0xef) Address: 0x03 cr 1 dlci 0x00 Control: 0xef poll/final 0 Length: 4 FCS: 0x70 MCC Message type: Remote Line Status CMD(0x14) Length: 2 dlci 32 error: 5
* monitor/rfcomm: Add support for RPN frame decodingGowtham Anandha Babu2014-12-041-0/+73
| | | | | | | | | | | | | | | | Changes made to decode RPN frame in RFCOMM for btmon. RFCOMM: Unnumbered Info with Header Check (UIH)(0xef) Address: 0x03 cr 1 dlci 0x00 Control: 0xef poll/final 0 Length: 10 FCS: 0x70 MCC Message type: Remote Port Negotiation Command CMD(0x24) Length: 8 dlci 32 br 3 db 2 sb 0 p 0 pt 0 xi 0 xo 0 rtri 0 rtro 0 rtci 0 rtco 0 xon 17 xoff 19 pm 0x3f7f
* monitor/rfcomm.c: Add support for MSC frame decodingGowtham Anandha Babu2014-12-041-7/+59
| | | | | | | | | | | | | | Changes made to decode MSC frame in RFCOMM for btmon. RFCOMM: Unnumbered Info with Header Check (UIH)(0xef) Address: 0x01 cr 0 dlci 0x00 Control: 0xef poll/final 0 Length: 4 FCS: 0xaa MCC Message type: Modem Status Command CMD(0x38) Length: 2 dlci 32 fc 0 rtc 1 rtr 1 ic 0 dv 1
* monitor/rfcomm: Fix not printing userdata in UIH frame with creditsSzymon Janc2014-11-171-1/+0
| | | | | | | | | | | | > ACL Data RX: Handle 7 flags 0x02 dlen 19 [hci0] 8.723738 Channel: 65 len 15 [PSM 3 mode 0] {chan 1} RFCOMM: Unnumbered Info with Header Check (UIH)(0xef) Address: 0x09 cr 0 dlci 0x02 Control: 0xff poll/final 1 Length: 10 FCS: 0x5c Credits: 1 41 54 2b 43 49 4e 44 3d 3f 0d 5c AT+CIND=?.\
* monitor/rfcomm: Add support for mcc frame decodingGowtham Anandha Babu2014-11-101-5/+78
| | | | | | | | | | | | | Changes made to decode MCC frame in RFCOMM for btmon. RFCOMM: Unnumbered Info with Header Check (UIH)(0xef) Address: 0x01 cr 0 dlci 0x00 Control: 0xef poll/final 0 Length: 10 FCS: 0xaa MCC Message type: DLC Parameter Negotiation RSP(0x20) Length: 8 20 e0 27 00 9a 02 00 07 aa .'......
* monitor/rfcomm: Add support for UIH frame decodingGowtham Anandha Babu2014-11-101-2/+28
| | | | | | | | | | | | | | | | | | | | | | Changes made to decode UIH frame in btmon. In below UIH frame, MCC frame is present, so no credits field is printed. RFCOMM: Unnumbered Info with Header Check (UIH)(0xef) Address: 0x01 cr 0 dlci 0x00 Control: 0xef poll/final 0 Length: 10 FCS: 0xaa 81 11 20 e0 27 00 9a 02 00 07 aa .. .'...... In this UIH frame, no MCC frame, so credits field is printed. RFCOMM: Unnumbered Info with Header Check (UIH)(0xef) Address: 0x81 cr 0 dlci 0x20 Control: 0xff poll/final 1 Length: 0 FCS: 0x1e Credits : 33
* monitor/rfcomm: Add support for printing RFCOMM hdrGowtham Anandha Babu2014-11-101-4/+48
| | | | | | | | | | | Changes made to decode RFCOMM hdr and print the same. RFCOMM: Unnumbered Info with Header Check (UIH)(0xef) Address: 0x01 cr 0 dlci 0x00 Control: 0xef poll/final 0 Length: 10 FCS: 0xaa 81 11 20 e0 27 00 9a 02 00 07 aa .. .'......
* monitor/rfcomm: Add RFCOMM support to btmonGowtham Anandha Babu2014-11-101-0/+132
Changes made to add initial code to support RFCOMM frame in btmon btmon logs: RFCOMM: Set Async Balance Mode (SABM) (0x2f) 01 1c .. RFCOMM: Unnumbered Ack (UA)(0x63) 01 d7 .. RFCOMM: Unnumbered Info with Header Check (UIH)(0xef) 15 81 11 20 e0 27 00 9a 02 00 07 aa ... .'...... RFCOMM: Disconnect (DISC)(0x43) 01 fd