From 7258285fe76c5373950521ec2b96ce6b4d85be69 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Mon, 19 Dec 2005 09:52:47 +0000 Subject: [PATCH] hcidump: Add skeleton for AVCTP parser --- tools/hcidump.1 | 1 + tools/hcidump.c | 1 + tools/parser/avctp.c | 45 +++++++++++++++++++++++++++++++++++++++++++ tools/parser/l2cap.c | 7 +++++++ tools/parser/parser.h | 2 ++ 5 files changed, 56 insertions(+) create mode 100644 tools/parser/avctp.c diff --git a/tools/hcidump.1 b/tools/hcidump.1 index 6a7c51266..17a9f142f 100644 --- a/tools/hcidump.1 +++ b/tools/hcidump.1 @@ -114,6 +114,7 @@ is a space-separated list of packet categories: available categories are .IR hidp , .IR hcrp , .IR avdtp , +.IR avctp , .IR obex and .IR capi . diff --git a/tools/hcidump.c b/tools/hcidump.c index ac5c2ba9a..7beecdc28 100644 --- a/tools/hcidump.c +++ b/tools/hcidump.c @@ -603,6 +603,7 @@ static struct { { "hidp", FILT_HIDP }, { "hcrp", FILT_HCRP }, { "avdtp", FILT_AVDTP }, + { "avctp", FILT_AVCTP }, { "obex", FILT_OBEX }, { "capi", FILT_CAPI }, { "csr", FILT_CSR }, diff --git a/tools/parser/avctp.c b/tools/parser/avctp.c new file mode 100644 index 000000000..10c46a87d --- /dev/null +++ b/tools/parser/avctp.c @@ -0,0 +1,45 @@ +/* + * + * BlueZ - Bluetooth protocol stack for Linux + * + * Copyright (C) 2004-2005 Marcel Holtmann + * + * + * 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 +#endif + +#include +#include +#include +#include +#include + +#include +#include + +#include "parser.h" + +void avctp_dump(int level, struct frame *frm) +{ + p_indent(level, frm); + printf("AVCTP:\n"); + + raw_dump(level, frm); +} diff --git a/tools/parser/l2cap.c b/tools/parser/l2cap.c index b7425cfbf..d535b9589 100644 --- a/tools/parser/l2cap.c +++ b/tools/parser/l2cap.c @@ -794,6 +794,13 @@ static void l2cap_parse(int level, struct frame *frm) raw_dump(level + 1, frm); break; + case 0x17: + if (!p_filter(FILT_AVCTP)) + avctp_dump(level, frm); + else + raw_dump(level + 1, frm); + break; + case 0x19: if (!p_filter(FILT_AVDTP)) avdtp_dump(level, frm); diff --git a/tools/parser/parser.h b/tools/parser/parser.h index 1c4f80ab9..9ca66f1fb 100644 --- a/tools/parser/parser.h +++ b/tools/parser/parser.h @@ -74,6 +74,7 @@ struct frame { #define FILT_HIDP 0x0100 #define FILT_HCRP 0x0200 #define FILT_AVDTP 0x0400 +#define FILT_AVCTP 0x0800 #define FILT_OBEX 0x00010000 #define FILT_CAPI 0x00020000 @@ -203,6 +204,7 @@ void cmtp_dump(int level, struct frame *frm); void hidp_dump(int level, struct frame *frm); void hcrp_dump(int level, struct frame *frm); void avdtp_dump(int level, struct frame *frm); +void avctp_dump(int level, struct frame *frm); void obex_dump(int level, struct frame *frm); void capi_dump(int level, struct frame *frm); -- 2.47.3