Hello community, here is the log from the commit of package bluez-hcidump for openSUSE:Factory checked in at 2012-07-12 10:40:30 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/bluez-hcidump (Old) and /work/SRC/openSUSE:Factory/.bluez-hcidump.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "bluez-hcidump", Maintainer is "a...@suse.com" Changes: -------- --- /work/SRC/openSUSE:Factory/bluez-hcidump/bluez-hcidump.changes 2012-03-16 13:09:48.000000000 +0100 +++ /work/SRC/openSUSE:Factory/.bluez-hcidump.new/bluez-hcidump.changes 2012-07-12 10:40:56.000000000 +0200 @@ -1,0 +2,10 @@ +Tue Apr 24 13:30:10 UTC 2012 - seife+...@b1-systems.com + +- update to version 2.4: + - Add support for A2MP decoding. + - Add support for L2CAP create/move channel decoding. + - Add support for AVRCP volume change notification. + - Add support for AVRCP absolute volume PDUs. + - Add support for basic SAP decoding. + +------------------------------------------------------------------- Old: ---- bluez-hcidump-2.3.tar.bz2 New: ---- bluez-hcidump-2.4.tar.bz2 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ bluez-hcidump.spec ++++++ --- /var/tmp/diff_new_pack.5q4hOj/_old 2012-07-12 10:40:58.000000000 +0200 +++ /var/tmp/diff_new_pack.5q4hOj/_new 2012-07-12 10:40:58.000000000 +0200 @@ -22,7 +22,7 @@ BuildRequires: bluez-devel >= 4.70 BuildRequires: pkgconfig Url: http://www.bluez.org -Version: 2.3 +Version: 2.4 Release: 0 Summary: HCI Dumper for Debugging Bluetooth Connections License: GPL-2.0+ ++++++ bluez-hcidump-2.3.tar.bz2 -> bluez-hcidump-2.4.tar.bz2 ++++++ ++++ 6341 lines of diff (skipped) ++++ retrying with extended exclude list diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/bluez-hcidump-2.3/ChangeLog new/bluez-hcidump-2.4/ChangeLog --- old/bluez-hcidump-2.3/ChangeLog 2012-02-29 19:23:20.000000000 +0100 +++ new/bluez-hcidump-2.4/ChangeLog 2012-04-20 21:28:19.000000000 +0200 @@ -1,3 +1,10 @@ +ver 2.4: + Add support for A2MP decoding. + Add support for L2CAP create/move channel decoding. + Add support for AVRCP volume change notification. + Add support for AVRCP absolute volume PDUs. + Add support for basic SAP decoding. + ver 2.3: Fix issue with UUID-128 attribute decoding. Add support for OBEX over L2CAP decoding. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/bluez-hcidump-2.3/Makefile.am new/bluez-hcidump-2.4/Makefile.am --- old/bluez-hcidump-2.3/Makefile.am 2011-12-22 01:18:58.000000000 +0100 +++ new/bluez-hcidump-2.4/Makefile.am 2012-04-20 21:28:19.000000000 +0200 @@ -2,7 +2,7 @@ AM_MAKEFLAGS = --no-print-directory library_sources = lib/bluetooth.h lib/bluetooth.c \ - lib/hci_lib.h lib/hci.h lib/hci.c lib/l2cap.h + lib/hci_lib.h lib/hci.h lib/hci.c lib/l2cap.h lib/a2mp.h parser_sources = parser/parser.h parser/parser.c \ parser/lmp.c \ @@ -19,6 +19,7 @@ parser/avdtp.c \ parser/avctp.c \ parser/avrcp.c \ + parser/sap.c \ parser/obex.c \ parser/capi.c \ parser/ppp.c \ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/bluez-hcidump-2.3/config.h.in new/bluez-hcidump-2.4/config.h.in --- old/bluez-hcidump-2.3/config.h.in 2012-02-29 19:23:31.000000000 +0100 +++ new/bluez-hcidump-2.4/config.h.in 2012-04-20 21:28:28.000000000 +0200 @@ -15,6 +15,9 @@ /* Define to the one symbol short name of this package. */ #undef PACKAGE_TARNAME +/* Define to the home page for this package. */ +#undef PACKAGE_URL + /* Define to the version of this package. */ #undef PACKAGE_VERSION diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/bluez-hcidump-2.3/configure.ac new/bluez-hcidump-2.4/configure.ac --- old/bluez-hcidump-2.3/configure.ac 2012-02-29 19:23:20.000000000 +0100 +++ new/bluez-hcidump-2.4/configure.ac 2012-04-20 21:28:19.000000000 +0200 @@ -1,5 +1,5 @@ AC_PREREQ(2.60) -AC_INIT(bluez-hcidump, 2.3) +AC_INIT(bluez-hcidump, 2.4) AM_INIT_AUTOMAKE([foreign subdir-objects]) AM_CONFIG_HEADER(config.h) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/bluez-hcidump-2.3/lib/a2mp.h new/bluez-hcidump-2.4/lib/a2mp.h --- old/bluez-hcidump-2.3/lib/a2mp.h 1970-01-01 01:00:00.000000000 +0100 +++ new/bluez-hcidump-2.4/lib/a2mp.h 2012-04-20 21:28:19.000000000 +0200 @@ -0,0 +1,149 @@ +/* + * + * BlueZ - Bluetooth protocol stack for Linux + * + * Copyright (C) 2012 Intel Corporation. All rights reserved. + * Copyright (c) 2012 Code Aurora Forum. All rights reserved. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + * + */ + +#ifndef __A2MP_H +#define __A2MP_H + +#ifdef __cplusplus +extern "C" { +#endif + +/* A2MP Protocol */ + +/* A2MP command codes */ + +#define A2MP_COMMAND_REJ 0x01 +#define A2MP_DISCOVER_REQ 0x02 +#define A2MP_DISCOVER_RSP 0x03 +#define A2MP_CHANGE_NOTIFY 0x04 +#define A2MP_CHANGE_RSP 0x05 +#define A2MP_INFO_REQ 0x06 +#define A2MP_INFO_RSP 0x07 +#define A2MP_ASSOC_REQ 0x08 +#define A2MP_ASSOC_RSP 0x09 +#define A2MP_CREATE_REQ 0x0a +#define A2MP_CREATE_RSP 0x0b +#define A2MP_DISCONN_REQ 0x0c +#define A2MP_DISCONN_RSP 0x0d + +struct a2mp_hdr { + uint8_t code; + uint8_t ident; + uint16_t len; +} __attribute__ ((packed)); +#define A2MP_HDR_SIZE 4 + +struct a2mp_command_rej { + uint16_t reason; +} __attribute__ ((packed)); + +struct a2mp_discover_req { + uint16_t mtu; + uint16_t mask; +} __attribute__ ((packed)); + +struct a2mp_ctrl { + uint8_t id; + uint8_t type; + uint8_t status; +} __attribute__ ((packed)); + +struct a2mp_discover_rsp { + uint16_t mtu; + uint16_t mask; + struct a2mp_ctrl ctrl_list[0]; +} __attribute__ ((packed)); + +struct a2mp_info_req { + uint8_t id; +} __attribute__ ((packed)); + +struct a2mp_info_rsp { + uint8_t id; + uint8_t status; + uint32_t total_bw; + uint32_t max_bw; + uint32_t min_latency; + uint16_t pal_caps; + uint16_t assoc_size; +} __attribute__ ((packed)); + +struct a2mp_assoc_req { + uint8_t id; +} __attribute__ ((packed)); + +struct a2mp_assoc_rsp { + uint8_t id; + uint8_t status; + uint8_t assoc_data[0]; +} __attribute__ ((packed)); + +struct a2mp_create_req { + uint8_t local_id; + uint8_t remote_id; + uint8_t assoc_data[0]; +} __attribute__ ((packed)); + +struct a2mp_create_rsp { + uint8_t local_id; + uint8_t remote_id; + uint8_t status; +} __attribute__ ((packed)); + +struct a2mp_disconn_req { + uint8_t local_id; + uint8_t remote_id; +} __attribute__ ((packed)); + +struct a2mp_disconn_rsp { + uint8_t local_id; + uint8_t remote_id; + uint8_t status; +} __attribute__ ((packed)); + +#define A2MP_COMMAND_NOT_RECOGNIZED 0x0000 + +/* AMP controller status */ +#define AMP_CTRL_POWERED_DOWN 0x00 +#define AMP_CTRL_BLUETOOTH_ONLY 0x01 +#define AMP_CTRL_NO_CAPACITY 0x02 +#define AMP_CTRL_LOW_CAPACITY 0x03 +#define AMP_CTRL_MEDIUM_CAPACITY 0x04 +#define AMP_CTRL_HIGH_CAPACITY 0x05 +#define AMP_CTRL_FULL_CAPACITY 0x06 + +/* A2MP response status */ +#define A2MP_STATUS_SUCCESS 0x00 +#define A2MP_STATUS_INVALID_CTRL_ID 0x01 +#define A2MP_STATUS_UNABLE_START_LINK_CREATION 0x02 +#define A2MP_STATUS_NO_PHYSICAL_LINK_EXISTS 0x02 +#define A2MP_STATUS_COLLISION_OCCURED 0x03 +#define A2MP_STATUS_DISCONN_REQ_RECVD 0x04 +#define A2MP_STATUS_PHYS_LINK_EXISTS 0x05 +#define A2MP_STATUS_SECURITY_VIOLATION 0x06 + +#ifdef __cplusplus +} +#endif + +#endif /* __A2MP_H */ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/bluez-hcidump-2.3/missing new/bluez-hcidump-2.4/missing --- old/bluez-hcidump-2.3/missing 2012-02-29 19:23:33.000000000 +0100 +++ new/bluez-hcidump-2.4/missing 2012-04-20 21:28:29.000000000 +0200 @@ -1,10 +1,10 @@ #! /bin/sh # Common stub for a few missing GNU programs while installing. -scriptversion=2009-04-28.21; # UTC +scriptversion=2012-01-06.13; # UTC # Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005, 2006, -# 2008, 2009 Free Software Foundation, Inc. +# 2008, 2009, 2010, 2011, 2012 Free Software Foundation, Inc. # Originally by Fran,cois Pinard <pin...@iro.umontreal.ca>, 1996. # This program is free software; you can redistribute it and/or modify @@ -84,7 +84,6 @@ help2man touch the output file lex create \`lex.yy.c', if possible, from existing .c makeinfo touch the output file - tar try tar, gnutar, gtar, then tar without non-portable flags yacc create \`y.tab.[ch]', if possible, from existing .[ch] Version suffixes to PROGRAM as well as the prefixes \`gnu-', \`gnu', and @@ -122,15 +121,6 @@ # Not GNU programs, they don't have --version. ;; - tar*) - if test -n "$run"; then - echo 1>&2 "ERROR: \`tar' requires --run" - exit 1 - elif test "x$2" = "x--version" || test "x$2" = "x--help"; then - exit 1 - fi - ;; - *) if test -z "$run" && ($1 --version) > /dev/null 2>&1; then # We have it, but it failed. @@ -226,7 +216,7 @@ \`Bison' from any GNU archive site." rm -f y.tab.c y.tab.h if test $# -ne 1; then - eval LASTARG="\${$#}" + eval LASTARG=\${$#} case $LASTARG in *.y) SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'` @@ -256,7 +246,7 @@ \`Flex' from any GNU archive site." rm -f lex.yy.c if test $# -ne 1; then - eval LASTARG="\${$#}" + eval LASTARG=\${$#} case $LASTARG in *.l) SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'` @@ -318,41 +308,6 @@ touch $file ;; - tar*) - shift - - # We have already tried tar in the generic part. - # Look for gnutar/gtar before invocation to avoid ugly error - # messages. - if (gnutar --version > /dev/null 2>&1); then - gnutar "$@" && exit 0 - fi - if (gtar --version > /dev/null 2>&1); then - gtar "$@" && exit 0 - fi - firstarg="$1" - if shift; then - case $firstarg in - *o*) - firstarg=`echo "$firstarg" | sed s/o//` - tar "$firstarg" "$@" && exit 0 - ;; - esac - case $firstarg in - *h*) - firstarg=`echo "$firstarg" | sed s/h//` - tar "$firstarg" "$@" && exit 0 - ;; - esac - fi - - echo 1>&2 "\ -WARNING: I can't seem to be able to run \`tar' with the given arguments. - You may want to install GNU tar or Free paxutils, or check the - command line arguments." - exit 1 - ;; - *) echo 1>&2 "\ WARNING: \`$1' is needed, and is $msg. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/bluez-hcidump-2.3/parser/avrcp.c new/bluez-hcidump-2.4/parser/avrcp.c --- old/bluez-hcidump-2.3/parser/avrcp.c 2011-12-22 01:18:58.000000000 +0100 +++ new/bluez-hcidump-2.4/parser/avrcp.c 2012-04-20 21:28:19.000000000 +0200 @@ -1198,9 +1198,30 @@ value2str(attr, value)); } break; + case AVRCP_EVENT_VOLUME_CHANGED: + status = get_u8(frm) & 0x7F; + printf("Volume: %.2f%% (%d/127)\n", status/1.27, status); + break; } } +static void avrcp_set_absolute_volume_dump(int level, struct frame *frm, + uint8_t ctype, uint16_t len) +{ + uint8_t value; + + p_indent(level, frm); + + if (len < 1) { + printf("PDU Malformed\n"); + raw_dump(level, frm); + return; + } + + value = get_u8(frm) & 0x7F; + printf("Volume: %.2f%% (%d/127)\n", value/1.27, value); +} + static void avrcp_pdu_dump(int level, struct frame *frm, uint8_t ctype) { uint8_t pduid, pt; @@ -1267,6 +1288,9 @@ case AVRCP_REGISTER_NOTIFICATION: avrcp_register_notification_dump(level + 1, frm, ctype, len); break; + case AVRCP_SET_ABSOLUTE_VOLUME: + avrcp_set_absolute_volume_dump(level + 1, frm, ctype, len); + break; default: raw_dump(level, frm); } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/bluez-hcidump-2.3/parser/hci.c new/bluez-hcidump-2.4/parser/hci.c --- old/bluez-hcidump-2.3/parser/hci.c 2011-12-22 01:18:58.000000000 +0100 +++ new/bluez-hcidump-2.4/parser/hci.c 2012-04-20 21:28:19.000000000 +0200 @@ -1124,12 +1124,11 @@ int i; p_indent(level, frm); - printf("handle %d key length %d key type %d\n", cp->handle, cp->key_length, cp->key_type); + p_indent(level, frm); printf("key "); - - for (i = 0; i < cp->key_length && cp->key_length < 32; i++) + for (i = 0; i < cp->key_length && cp->key_length <= 32; i++) printf("%2.2x", cp->key[i]); printf("\n"); } @@ -1140,12 +1139,16 @@ int i; p_indent(level, frm); - printf("handle %d\n", cp->handle); + + p_indent(level, frm); printf("tx_flow "); for (i = 0; i < 16; i++) printf("%2.2x", cp->tx_flow[i]); - printf("\nrx_flow "); + printf("\n"); + + p_indent(level, frm); + printf("rx_flow "); for (i = 0; i < 16; i++) printf("%2.2x", cp->rx_flow[i]); printf("\n"); @@ -2605,6 +2608,8 @@ p_indent(level, frm); printf("Error: %s\n", status2str(rp->status)); } else { + p_indent(level, frm); + printf("assoc data"); for (i = 0; i < len; i++) { if (!(i % 16)) { printf("\n"); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/bluez-hcidump-2.3/parser/l2cap.c new/bluez-hcidump-2.4/parser/l2cap.c --- old/bluez-hcidump-2.3/parser/l2cap.c 2012-02-29 19:23:20.000000000 +0100 +++ new/bluez-hcidump-2.4/parser/l2cap.c 2012-04-20 21:28:19.000000000 +0200 @@ -37,6 +37,7 @@ #include "parser/sdp.h" #include "lib/hci.h" #include "lib/l2cap.h" +#include "lib/a2mp.h" typedef struct { uint16_t handle; @@ -269,6 +270,16 @@ } } +static char *a2mpreason2str(uint16_t reason) +{ + switch (reason) { + case A2MP_COMMAND_NOT_RECOGNIZED: + return "Command not recognized"; + default: + return "Reserved"; + } +} + static char *connresult2str(uint16_t result) { switch (result) { @@ -409,6 +420,89 @@ } } +static char *ampctrltype2str(uint8_t type) +{ + switch (type) { + case HCI_BREDR: + return "BR-EDR"; + case HCI_AMP: + return "802.11 AMP"; + default: + return "Reserved"; + } +} + +static char *ampctrlstatus2str(uint8_t status) +{ + switch (status) { + case AMP_CTRL_POWERED_DOWN: + return "Powered down"; + case AMP_CTRL_BLUETOOTH_ONLY: + return "Bluetooth only"; + case AMP_CTRL_NO_CAPACITY: + return "No capacity"; + case AMP_CTRL_LOW_CAPACITY: + return "Low capacity"; + case AMP_CTRL_MEDIUM_CAPACITY: + return "Medium capacity"; + case AMP_CTRL_HIGH_CAPACITY: + return "High capacity"; + case AMP_CTRL_FULL_CAPACITY: + return "Full capacity"; + default: + return "Reserved"; + + } +} + +static char *a2mpstatus2str(uint8_t status) +{ + switch (status) { + case A2MP_STATUS_SUCCESS: + return "Success"; + case A2MP_STATUS_INVALID_CTRL_ID: + return "Invalid Controller ID"; + default: + return "Reserved"; + } +} + +static char *a2mpcplstatus2str(uint8_t status) +{ + switch (status) { + case A2MP_STATUS_SUCCESS: + return "Success"; + case A2MP_STATUS_INVALID_CTRL_ID: + return "Invalid Controller ID"; + case A2MP_STATUS_UNABLE_START_LINK_CREATION: + return "Failed - Unable to start link creation"; + case A2MP_STATUS_COLLISION_OCCURED: + return "Failed - Collision occured"; + case A2MP_STATUS_DISCONN_REQ_RECVD: + return "Failed - Disconnect physical link received"; + case A2MP_STATUS_PHYS_LINK_EXISTS: + return "Failed - Physical link already exists"; + case A2MP_STATUS_SECURITY_VIOLATION: + return "Failed - Security violation"; + default: + return "Reserved"; + } +} + +static char *a2mpdplstatus2str(uint8_t status) +{ + switch (status) { + case A2MP_STATUS_SUCCESS: + return "Success"; + case A2MP_STATUS_INVALID_CTRL_ID: + return "Invalid Controller ID"; + case A2MP_STATUS_NO_PHYSICAL_LINK_EXISTS: + return "Failed - No Physical Link exists"; + default: + return "Reserved"; + } +} + static inline void command_rej(int level, struct frame *frm) { l2cap_cmd_rej *h = frm->ptr; @@ -868,6 +962,268 @@ printf(" F-bit"); } +static inline void create_req(int level, l2cap_cmd_hdr *cmd, struct frame *frm) +{ + l2cap_create_req *h = frm->ptr; + uint16_t psm = btohs(h->psm); + uint16_t scid = btohs(h->scid); + + if (p_filter(FILT_L2CAP)) + return; + + printf("Create req: psm %d scid 0x%4.4x id %d\n", psm, scid, h->id); +} + +static inline void create_rsp(int level, l2cap_cmd_hdr *cmd, struct frame *frm) +{ + l2cap_create_rsp *h = frm->ptr; + uint16_t scid = btohs(h->scid); + uint16_t dcid = btohs(h->dcid); + uint16_t result = btohs(h->result); + uint16_t status = btohs(h->status); + + if (p_filter(FILT_L2CAP)) + return; + + printf("Create rsp: dcid 0x%4.4x scid 0x%4.4x result %d status %d\n", dcid, scid, result, status); +} + +static inline void move_req(int level, l2cap_cmd_hdr *cmd, struct frame *frm) +{ + l2cap_move_req *h = frm->ptr; + uint16_t icid = btohs(h->icid); + + if (p_filter(FILT_L2CAP)) + return; + + printf("Move req: icid 0x%4.4x id %d\n", icid, h->id); +} + +static inline void move_rsp(int level, l2cap_cmd_hdr *cmd, struct frame *frm) +{ + l2cap_move_rsp *h = frm->ptr; + uint16_t icid = btohs(h->icid); + uint16_t result = btohs(h->result); + + if (p_filter(FILT_L2CAP)) + return; + + printf("Move rsp: icid 0x%4.4x result %d\n", icid, result); +} + +static inline void move_cfm(int level, l2cap_cmd_hdr *cmd, struct frame *frm) +{ + l2cap_move_cfm *h = frm->ptr; + uint16_t icid = btohs(h->icid); + uint16_t result = btohs(h->result); + + if (p_filter(FILT_L2CAP)) + return; + + printf("Move cfm: icid 0x%4.4x result %d\n", icid, result); +} + +static inline void move_cfm_rsp(int level, l2cap_cmd_hdr *cmd, struct frame *frm) +{ + l2cap_move_cfm_rsp *h = frm->ptr; + uint16_t icid = btohs(h->icid); + + if (p_filter(FILT_L2CAP)) + return; + + printf("Move cfm rsp: icid 0x%4.4x\n", icid); +} + +static inline void a2mp_command_rej(int level, struct frame *frm) +{ + struct a2mp_command_rej *h = frm->ptr; + uint16_t reason = btohs(h->reason); + + printf("Command Reject: reason %d\n", reason); + p_indent(level + 1, 0); + printf("%s\n", a2mpreason2str(reason)); +} + +static inline void a2mp_discover_req(int level, struct frame *frm, uint16_t len) +{ + struct a2mp_discover_req *h = frm->ptr; + uint16_t mtu = btohs(h->mtu); + uint8_t *octet = (uint8_t *)&(h->mask); + uint16_t mask; + uint8_t extension; + + printf("Discover req: mtu/mps %d ", mtu); + len -= 2; + + printf("mask:"); + + do { + len -= 2; + mask = btohs(*(uint16_t *)(&octet[0])); + printf(" 0x%4.4x", mask); + + extension = octet[1] & 0x80; + octet += 2; + } while ((extension != 0) && (len >= 2)); + + printf("\n"); +} + +static inline void a2mp_ctrl_list_dump(int level, struct a2mp_ctrl *list, uint16_t len) +{ + p_indent(level, 0); + printf("Controller list:\n"); + + while (len >= 3) { + p_indent(level + 1, 0); + printf("id %d type %d (%s) status 0x%2.2x (%s)\n", + list->id, list->type, ampctrltype2str(list->type), list->status, ampctrlstatus2str(list->status)); + list++; + len -= 3; + } + +} + +static inline void a2mp_discover_rsp(int level, struct frame *frm, uint16_t len) +{ + struct a2mp_discover_rsp *h = frm->ptr; + uint16_t mtu = btohs(h->mtu); + uint8_t *octet = (uint8_t *)&(h->mask); + uint16_t mask; + uint8_t extension; + + printf("Discover rsp: mtu/mps %d ", mtu); + len -= 2; + + printf("mask:"); + + do { + len -= 2; + mask = btohs(*(uint16_t *)(&octet[0])); + printf(" 0x%4.4x", mask); + + extension = octet[1] & 0x80; + octet += 2; + } while ((extension != 0) && (len >= 2)); + + printf("\n"); + + if (len >= 3) { + a2mp_ctrl_list_dump(level + 1, (struct a2mp_ctrl *) octet, len); + } +} + +static inline void a2mp_change_notify(int level, struct frame *frm, uint16_t len) +{ + struct a2mp_ctrl *list = frm->ptr; + + printf("Change Notify\n"); + + if (len >= 3) { + a2mp_ctrl_list_dump(level + 1, list, len); + } +} + +static inline void a2mp_change_rsp(int level, struct frame *frm) +{ + printf("Change Response\n"); +} + +static inline void a2mp_info_req(int level, struct frame *frm) +{ + struct a2mp_info_req *h = frm->ptr; + + printf("Get Info req: id %d\n", h->id); +} + +static inline void a2mp_info_rsp(int level, struct frame *frm) +{ + struct a2mp_info_rsp *h = frm->ptr; + + printf("Get Info rsp: id %d status %d (%s)\n", + h->id, h->status, a2mpstatus2str(h->status)); + + p_indent(level + 1, 0); + printf("Total bandwidth %d\n", btohl(h->total_bw)); + p_indent(level + 1, 0); + printf("Max guaranteed bandwidth %d\n", btohl(h->max_bw)); + p_indent(level + 1, 0); + printf("Min latency %d\n", btohl(h->min_latency)); + p_indent(level + 1, 0); + printf("Pal capabilities 0x%4.4x\n", btohs(h->pal_caps)); + p_indent(level + 1, 0); + printf("Assoc size %d\n", btohs(h->assoc_size)); +} + +static inline void a2mp_assoc_req(int level, struct frame *frm) +{ + struct a2mp_assoc_req *h = frm->ptr; + + printf("Get AMP Assoc req: id %d\n", h->id); +} + +static inline void a2mp_assoc_dump(int level, uint8_t *assoc, uint16_t len) +{ + int i; + + p_indent(level, 0); + printf("Assoc data:"); + for (i = 0; i < len; i++) { + if (!(i%16)) { + printf("\n"); + p_indent(level+1, 0); + } + printf("%2.2x ",*assoc++); + } + printf("\n"); +} + +static inline void a2mp_assoc_rsp(int level, struct frame *frm, uint16_t len) +{ + struct a2mp_assoc_rsp *h = frm->ptr; + + printf("Get AMP Assoc rsp: id %d status (%d) %s \n", + h->id, h->status, a2mpstatus2str(h->status)); + a2mp_assoc_dump(level + 1, (uint8_t *) &h->assoc_data, len - 2); +} + +static inline void a2mp_create_req(int level, struct frame *frm, uint16_t len) +{ + struct a2mp_create_req *h = frm->ptr; + + printf("Create Physical Link req: local id %d remote id %d\n", + h->local_id, h->remote_id); + a2mp_assoc_dump(level + 1, (uint8_t *) &h->assoc_data, len - 2); +} + +static inline void a2mp_create_rsp(int level, struct frame *frm) +{ + struct a2mp_create_rsp *h = frm->ptr; + + printf("Create Physical Link rsp: local id %d remote id %d status %d\n", + h->local_id, h->remote_id, h->status); + p_indent(level+1, 0); + printf("%s\n", a2mpcplstatus2str(h->status)); +} + +static inline void a2mp_disconn_req(int level, struct frame *frm) +{ + struct a2mp_disconn_req *h = frm->ptr; + + printf("Disconnect Physical Link req: local id %d remote id %d\n", + h->local_id, h->remote_id); +} + +static inline void a2mp_disconn_rsp(int level, struct frame *frm) +{ + struct a2mp_disconn_rsp *h = frm->ptr; + + printf("Disconnect Physical Link rsp: local id %d remote id %d status %d\n", + h->local_id, h->remote_id, h->status); + p_indent(level+1, 0); + printf("%s\n", a2mpdplstatus2str(h->status)); +} + static void l2cap_parse(int level, struct frame *frm) { l2cap_hdr *hdr = (void *)frm->ptr; @@ -937,6 +1293,30 @@ info_rsp(level, hdr, frm); break; + case L2CAP_CREATE_REQ: + create_req(level, hdr, frm); + break; + + case L2CAP_CREATE_RSP: + create_rsp(level, hdr, frm); + break; + + case L2CAP_MOVE_REQ: + move_req(level, hdr, frm); + break; + + case L2CAP_MOVE_RSP: + move_rsp(level, hdr, frm); + break; + + case L2CAP_MOVE_CFM: + move_cfm(level, hdr, frm); + break; + + case L2CAP_MOVE_CFM_RSP: + move_cfm_rsp(level, hdr, frm); + break; + default: if (p_filter(FILT_L2CAP)) break; @@ -964,6 +1344,76 @@ p_indent(level, frm); printf("L2CAP(c): len %d psm %d\n", dlen, psm); raw_dump(level, frm); + } else if (cid == 0x3) { + /* AMP Manager channel */ + + if (p_filter(FILT_A2MP)) + return; + + /* Adjust for ERTM control bytes */ + frm->ptr += 2; + frm->len -= 2; + + while (frm->len >= A2MP_HDR_SIZE) { + struct a2mp_hdr *hdr = frm->ptr; + + frm->ptr += A2MP_HDR_SIZE; + frm->len -= A2MP_HDR_SIZE; + + p_indent(level, frm); + printf("A2MP: "); + + switch (hdr->code) { + case A2MP_COMMAND_REJ: + a2mp_command_rej(level, frm); + break; + case A2MP_DISCOVER_REQ: + a2mp_discover_req(level, frm, btohs(hdr->len)); + break; + case A2MP_DISCOVER_RSP: + a2mp_discover_rsp(level, frm, btohs(hdr->len)); + break; + case A2MP_CHANGE_NOTIFY: + a2mp_change_notify(level, frm, btohs(hdr->len)); + break; + case A2MP_CHANGE_RSP: + a2mp_change_rsp(level, frm); + break; + case A2MP_INFO_REQ: + a2mp_info_req(level, frm); + break; + case A2MP_INFO_RSP: + a2mp_info_rsp(level, frm); + break; + case A2MP_ASSOC_REQ: + a2mp_assoc_req(level, frm); + break; + case A2MP_ASSOC_RSP: + a2mp_assoc_rsp(level, frm, btohs(hdr->len)); + break; + case A2MP_CREATE_REQ: + a2mp_create_req(level, frm, btohs(hdr->len)); + break; + case A2MP_CREATE_RSP: + a2mp_create_rsp(level, frm); + break; + case A2MP_DISCONN_REQ: + a2mp_disconn_req(level, frm); + break; + case A2MP_DISCONN_RSP: + a2mp_disconn_rsp(level, frm); + break; + default: + printf("code 0x%2.2x ident %d len %d\n", + hdr->code, hdr->ident, btohs(hdr->len)); + raw_dump(level, frm); + } + if (frm->len > btohs(hdr->len)) { + frm->len -= btohs(hdr->len); + frm->ptr += btohs(hdr->len); + } else + frm->len = 0; + } } else if (cid == 0x04) { if (!p_filter(FILT_ATT)) att_dump(level, frm); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/bluez-hcidump-2.3/parser/parser.h new/bluez-hcidump-2.4/parser/parser.h --- old/bluez-hcidump-2.3/parser/parser.h 2011-12-22 01:18:58.000000000 +0100 +++ new/bluez-hcidump-2.4/parser/parser.h 2012-04-20 21:28:19.000000000 +0200 @@ -80,10 +80,12 @@ #define FILT_AVCTP 0x0800 #define FILT_ATT 0x1000 #define FILT_SMP 0x2000 +#define FILT_A2MP 0x4000 #define FILT_OBEX 0x00010000 #define FILT_CAPI 0x00020000 #define FILT_PPP 0x00040000 +#define FILT_SAP 0x00080000 #define FILT_ERICSSON 0x10000000 #define FILT_CSR 0x1000000a #define FILT_DGA 0x1000000c @@ -235,6 +237,7 @@ void avrcp_dump(int level, struct frame *frm); void att_dump(int level, struct frame *frm); void smp_dump(int level, struct frame *frm); +void sap_dump(int level, struct frame *frm); void obex_dump(int level, struct frame *frm); void capi_dump(int level, struct frame *frm); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/bluez-hcidump-2.3/parser/rfcomm.c new/bluez-hcidump-2.4/parser/rfcomm.c --- old/bluez-hcidump-2.3/parser/rfcomm.c 2011-12-22 01:18:58.000000000 +0100 +++ new/bluez-hcidump-2.4/parser/rfcomm.c 2012-04-20 21:28:19.000000000 +0200 @@ -281,6 +281,13 @@ raw_dump(level, frm); break; + case SDP_UUID_SIM_ACCESS: + if (!p_filter(FILT_SAP)) + sap_dump(level + 1, frm); + else + raw_dump(level, frm); + break; + default: if (p_filter(FILT_RFCOMM)) break; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/bluez-hcidump-2.3/parser/sap.c new/bluez-hcidump-2.4/parser/sap.c --- old/bluez-hcidump-2.3/parser/sap.c 1970-01-01 01:00:00.000000000 +0100 +++ new/bluez-hcidump-2.4/parser/sap.c 2012-04-20 21:28:19.000000000 +0200 @@ -0,0 +1,335 @@ +/* + * + * BlueZ - Bluetooth protocol stack for Linux + * + * Copyright (C) 2012 Tieto Poland + * + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + * + */ + +#ifdef HAVE_CONFIG_H +#include <config.h> +#endif + +#include <stdio.h> +#include <errno.h> +#include <unistd.h> +#include <stdlib.h> +#include <string.h> + +#include "parser.h" + +#define PADDING4(x) ((4 - ((x) & 0x03)) & 0x03) + +#define SAP_CONNECT_REQ 0x00 +#define SAP_CONNECT_RESP 0x01 +#define SAP_DISCONNECT_REQ 0x02 +#define SAP_DISCONNECT_RESP 0x03 +#define SAP_DISCONNECT_IND 0x04 +#define SAP_TRANSFER_APDU_REQ 0x05 +#define SAP_TRANSFER_APDU_RESP 0x06 +#define SAP_TRANSFER_ATR_REQ 0x07 +#define SAP_TRANSFER_ATR_RESP 0x08 +#define SAP_POWER_SIM_OFF_REQ 0x09 +#define SAP_POWER_SIM_OFF_RESP 0x0A +#define SAP_POWER_SIM_ON_REQ 0x0B +#define SAP_POWER_SIM_ON_RESP 0x0C +#define SAP_RESET_SIM_REQ 0x0D +#define SAP_RESET_SIM_RESP 0x0E +#define SAP_TRANSFER_CARD_READER_STATUS_REQ 0x0F +#define SAP_TRANSFER_CARD_READER_STATUS_RESP 0x10 +#define SAP_STATUS_IND 0x11 +#define SAP_ERROR_RESP 0x12 +#define SAP_SET_TRANSPORT_PROTOCOL_REQ 0x13 +#define SAP_SET_TRANSPORT_PROTOCOL_RESP 0x14 + +#define SAP_PARAM_ID_MAX_MSG_SIZE 0x00 +#define SAP_PARAM_ID_CONN_STATUS 0x01 +#define SAP_PARAM_ID_RESULT_CODE 0x02 +#define SAP_PARAM_ID_DISCONNECT_IND 0x03 +#define SAP_PARAM_ID_COMMAND_APDU 0x04 +#define SAP_PARAM_ID_COMMAND_APDU7816 0x10 +#define SAP_PARAM_ID_RESPONSE_APDU 0x05 +#define SAP_PARAM_ID_ATR 0x06 +#define SAP_PARAM_ID_CARD_READER_STATUS 0x07 +#define SAP_PARAM_ID_STATUS_CHANGE 0x08 +#define SAP_PARAM_ID_TRANSPORT_PROTOCOL 0x09 + +#define SAP_STATUS_OK 0x00 +#define SAP_STATUS_CONNECTION_FAILED 0x01 +#define SAP_STATUS_MAX_MSG_SIZE_NOT_SUPPORTED 0x02 +#define SAP_STATUS_MAX_MSG_SIZE_TOO_SMALL 0x03 +#define SAP_STATUS_OK_ONGOING_CALL 0x04 + +#define SAP_DISCONNECTION_TYPE_GRACEFUL 0x00 +#define SAP_DISCONNECTION_TYPE_IMMEDIATE 0x01 +#define SAP_DISCONNECTION_TYPE_CLIENT 0xFF + +#define SAP_RESULT_OK 0x00 +#define SAP_RESULT_ERROR_NO_REASON 0x01 +#define SAP_RESULT_ERROR_NOT_ACCESSIBLE 0x02 +#define SAP_RESULT_ERROR_POWERED_OFF 0x03 +#define SAP_RESULT_ERROR_CARD_REMOVED 0x04 +#define SAP_RESULT_ERROR_POWERED_ON 0x05 +#define SAP_RESULT_ERROR_NO_DATA 0x06 +#define SAP_RESULT_NOT_SUPPORTED 0x07 + +#define SAP_STATUS_CHANGE_UNKNOWN_ERROR 0x00 +#define SAP_STATUS_CHANGE_CARD_RESET 0x01 +#define SAP_STATUS_CHANGE_CARD_NOT_ACCESSIBLE 0x02 +#define SAP_STATUS_CHANGE_CARD_REMOVED 0x03 +#define SAP_STATUS_CHANGE_CARD_INSERTED 0x04 +#define SAP_STATUS_CHANGE_CARD_RECOVERED 0x05 + +#define SAP_TRANSPORT_PROTOCOL_T0 0x00 +#define SAP_TRANSPORT_PROTOCOL_T1 0x01 + +static const char *msg2str(uint8_t msg) +{ + switch (msg) { + case SAP_CONNECT_REQ: + return "Connect Req"; + case SAP_CONNECT_RESP: + return "Connect Resp"; + case SAP_DISCONNECT_REQ: + return "Disconnect Req"; + case SAP_DISCONNECT_RESP: + return "Disconnect Resp"; + case SAP_DISCONNECT_IND: + return "Disconnect Ind"; + case SAP_TRANSFER_APDU_REQ: + return "Transfer APDU Req"; + case SAP_TRANSFER_APDU_RESP: + return "Transfer APDU Resp"; + case SAP_TRANSFER_ATR_REQ: + return "Transfer ATR Req"; + case SAP_TRANSFER_ATR_RESP: + return "Transfer ATR Resp"; + case SAP_POWER_SIM_OFF_REQ: + return "Power SIM Off Req"; + case SAP_POWER_SIM_OFF_RESP: + return "Power SIM Off Resp"; + case SAP_POWER_SIM_ON_REQ: + return "Power SIM On Req"; + case SAP_POWER_SIM_ON_RESP: + return "Power SIM On Resp"; + case SAP_RESET_SIM_REQ: + return "Reset SIM Req"; + case SAP_RESET_SIM_RESP: + return "Reset SIM Resp"; + case SAP_TRANSFER_CARD_READER_STATUS_REQ: + return "Transfer Card Reader Status Req"; + case SAP_TRANSFER_CARD_READER_STATUS_RESP: + return "Transfer Card Reader Status Resp"; + case SAP_STATUS_IND: + return "Status Ind"; + case SAP_ERROR_RESP: + return "Error Resp"; + case SAP_SET_TRANSPORT_PROTOCOL_REQ: + return "Set Transport Protocol Req"; + case SAP_SET_TRANSPORT_PROTOCOL_RESP: + return "Set Transport Protocol Resp"; + default: + return "Reserved"; + } +} + +static const char *param2str(uint8_t param) +{ + switch (param) { + case SAP_PARAM_ID_MAX_MSG_SIZE: + return "MaxMsgSize"; + case SAP_PARAM_ID_CONN_STATUS: + return "ConnectionStatus"; + case SAP_PARAM_ID_RESULT_CODE: + return "ResultCode"; + case SAP_PARAM_ID_DISCONNECT_IND: + return "DisconnectionType"; + case SAP_PARAM_ID_COMMAND_APDU: + return "CommandAPDU"; + case SAP_PARAM_ID_COMMAND_APDU7816: + return "CommandAPDU7816"; + case SAP_PARAM_ID_RESPONSE_APDU: + return "ResponseAPDU"; + case SAP_PARAM_ID_ATR: + return "ATR"; + case SAP_PARAM_ID_CARD_READER_STATUS: + return "CardReaderStatus"; + case SAP_PARAM_ID_STATUS_CHANGE: + return "StatusChange"; + case SAP_PARAM_ID_TRANSPORT_PROTOCOL: + return "TransportProtocol"; + default: + return "Reserved"; + } +} + +static const char *status2str(uint8_t status) +{ + switch (status) { + case SAP_STATUS_OK: + return "OK, Server can fulfill requirements"; + case SAP_STATUS_CONNECTION_FAILED: + return "Error, Server unable to establish connection"; + case SAP_STATUS_MAX_MSG_SIZE_NOT_SUPPORTED: + return "Error, Server does not support maximum message size"; + case SAP_STATUS_MAX_MSG_SIZE_TOO_SMALL: + return "Error, maximum message size by Client is too small"; + case SAP_STATUS_OK_ONGOING_CALL: + return "OK, ongoing call"; + default: + return "Reserved"; + } +} + +static const char *disctype2str(uint8_t disctype) +{ + switch (disctype) { + case SAP_DISCONNECTION_TYPE_GRACEFUL: + return "Graceful"; + case SAP_DISCONNECTION_TYPE_IMMEDIATE: + return "Immediate"; + default: + return "Reserved"; + } +} + +static const char *result2str(uint8_t result) +{ + switch (result) { + case SAP_RESULT_OK: + return "OK, request processed correctly"; + case SAP_RESULT_ERROR_NO_REASON: + return "Error, no reason defined"; + case SAP_RESULT_ERROR_NOT_ACCESSIBLE: + return "Error, card not accessible"; + case SAP_RESULT_ERROR_POWERED_OFF: + return "Error, card (already) powered off"; + case SAP_RESULT_ERROR_CARD_REMOVED: + return "Error, card removed"; + case SAP_RESULT_ERROR_POWERED_ON: + return "Error, card already powered on"; + case SAP_RESULT_ERROR_NO_DATA: + return "Error, data not available"; + case SAP_RESULT_NOT_SUPPORTED: + return "Error, not supported"; + default: + return "Reserved"; + } +} + +static const char *statuschg2str(uint8_t statuschg) +{ + switch (statuschg) { + case SAP_STATUS_CHANGE_UNKNOWN_ERROR: + return "Unknown Error"; + case SAP_STATUS_CHANGE_CARD_RESET: + return "Card reset"; + case SAP_STATUS_CHANGE_CARD_NOT_ACCESSIBLE: + return "Card not accessible"; + case SAP_STATUS_CHANGE_CARD_REMOVED: + return "Card removed"; + case SAP_STATUS_CHANGE_CARD_INSERTED: + return "Card inserted"; + case SAP_STATUS_CHANGE_CARD_RECOVERED: + return "Card recovered"; + default: + return "Reserved"; + } +} + +static const char *prot2str(uint8_t prot) +{ + switch (prot) { + case SAP_TRANSPORT_PROTOCOL_T0: + return "T=0"; + case SAP_TRANSPORT_PROTOCOL_T1: + return "T=1"; + default: + return "Reserved"; + } +} + +static void parse_parameters(int level, struct frame *frm) +{ + uint8_t param; + uint16_t len; + uint8_t pv8; + + while (frm->len > 3) { + p_indent(level, frm); + + param = get_u8(frm); + get_u8(frm); + len = get_u16(frm); + + printf("%s (0x%02x) len %d = ", param2str(param), param, len); + + switch (param) { + case SAP_PARAM_ID_MAX_MSG_SIZE: + printf("%d\n", get_u16(frm)); + break; + case SAP_PARAM_ID_CONN_STATUS: + pv8 = get_u8(frm); + printf("0x%02x (%s)\n", pv8, status2str(pv8)); + break; + case SAP_PARAM_ID_RESULT_CODE: + case SAP_PARAM_ID_CARD_READER_STATUS: + pv8 = get_u8(frm); + printf("0x%02x (%s)\n", pv8, result2str(pv8)); + break; + case SAP_PARAM_ID_DISCONNECT_IND: + pv8 = get_u8(frm); + printf("0x%02x (%s)\n", pv8, disctype2str(pv8)); + break; + case SAP_PARAM_ID_STATUS_CHANGE: + pv8 = get_u8(frm); + printf("0x%02x (%s)\n", pv8, statuschg2str(pv8)); + break; + case SAP_PARAM_ID_TRANSPORT_PROTOCOL: + pv8 = get_u8(frm); + printf("0x%02x (%s)\n", pv8, prot2str(pv8)); + break; + default: + printf("\n"); + raw_ndump(level + 1, frm, len); + frm->ptr += len; + frm->len -= len; + } + + /* Skip padding */ + frm->ptr += PADDING4(len); + frm->len -= PADDING4(len); + } +} + +void sap_dump(int level, struct frame *frm) +{ + uint8_t msg, params; + + msg = get_u8(frm); + params = get_u8(frm); + + /* Skip reserved field */ + get_u16(frm); + + p_indent(level, frm); + + printf("SAP: %s: params %d\n", msg2str(msg), params); + + parse_parameters(level, frm); +} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/bluez-hcidump-2.3/src/hcidump.c new/bluez-hcidump-2.4/src/hcidump.c --- old/bluez-hcidump-2.3/src/hcidump.c 2012-02-29 19:23:20.000000000 +0100 +++ new/bluez-hcidump-2.4/src/hcidump.c 2012-04-20 21:28:19.000000000 +0200 @@ -802,6 +802,7 @@ { "hci", FILT_HCI }, { "sco", FILT_SCO }, { "l2cap", FILT_L2CAP }, + { "a2mp", FILT_A2MP }, { "rfcomm", FILT_RFCOMM }, { "sdp", FILT_SDP }, { "bnep", FILT_BNEP }, @@ -815,6 +816,7 @@ { "obex", FILT_OBEX }, { "capi", FILT_CAPI }, { "ppp", FILT_PPP }, + { "sap", FILT_SAP }, { "csr", FILT_CSR }, { "dga", FILT_DGA }, { 0 } @@ -857,6 +859,7 @@ " -H, --hcrp=psm PSM for HCRP\n" " -O, --obex=port Channel/PSM for OBEX\n" " -P, --ppp=channel Channel for PPP\n" + " -S, --sap=channel Channel for SAP\n" " -D, --pppdump=file Extract PPP traffic\n" " -A, --audio=file Extract SCO audio data\n" " -Y, --novendor No vendor commands or events\n" @@ -885,6 +888,7 @@ { "hcrp", 1, 0, 'H' }, { "obex", 1, 0, 'O' }, { "ppp", 1, 0, 'P' }, + { "sap", 1, 0, 'S' }, { "pppdump", 1, 0, 'D' }, { "audio", 1, 0, 'A' }, { "novendor", 0, 0, 'Y' }, @@ -906,7 +910,9 @@ int opt, pppdump_fd = -1, audio_fd = -1; uint16_t obex_port; - while ((opt=getopt_long(argc, argv, "i:l:p:m:w:r:d:taxXRC:H:O:P:D:A:YZ46hv", main_options, NULL)) != -1) { + while ((opt = getopt_long(argc, argv, + "i:l:p:m:w:r:d:taxXRC:H:O:P:S:D:A:YZ46hv", + main_options, NULL)) != -1) { switch(opt) { case 'i': if (strcasecmp(optarg, "none") && strcasecmp(optarg, "system")) @@ -982,6 +988,10 @@ set_proto(0, 0, atoi(optarg), SDP_UUID_LAN_ACCESS_PPP); break; + case 'S': + set_proto(0, 0, atoi(optarg), SDP_UUID_SIM_ACCESS); + break; + case 'D': pppdump_file = strdup(optarg); break; -- To unsubscribe, e-mail: opensuse-commit+unsubscr...@opensuse.org For additional commands, e-mail: opensuse-commit+h...@opensuse.org