From 37fe15255ac568ab7d7b7fad2d7fa2ecf6c8f4d8 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Sun, 16 Apr 2006 23:22:36 +0000 Subject: [PATCH] hcidump: Add Ericsson specific parser --- tools/parser/ericsson.c | 36 ++++++++++++++++++++++++++++++++++++ tools/parser/hci.c | 13 ++++++++++++- tools/parser/parser.h | 2 ++ 3 files changed, 50 insertions(+), 1 deletion(-) create mode 100644 tools/parser/ericsson.c diff --git a/tools/parser/ericsson.c b/tools/parser/ericsson.c new file mode 100644 index 000000000..eea18aab7 --- /dev/null +++ b/tools/parser/ericsson.c @@ -0,0 +1,36 @@ +/* + * + * BlueZ - Bluetooth protocol stack for Linux + * + * Copyright (C) 2004-2006 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 "parser.h" + +void ericsson_dump(int level, struct frame *frm) +{ + raw_dump(level, frm); +} diff --git a/tools/parser/hci.c b/tools/parser/hci.c index 9a4b2652c..96ef17c2c 100644 --- a/tools/parser/hci.c +++ b/tools/parser/hci.c @@ -2431,13 +2431,24 @@ static inline void event_dump(int level, struct frame *frm) p_indent(level, frm); printf("HCI Event: Testing (0x%2.2x) plen %d\n", hdr->evt, hdr->plen); } else if (hdr->evt == EVT_VENDOR) { + uint16_t manufacturer; + if (parser.flags & DUMP_NOVENDOR) return; p_indent(level, frm); printf("HCI Event: Vendor (0x%2.2x) plen %d\n", hdr->evt, hdr->plen); - if (get_manufacturer() == 10) { + manufacturer = get_manufacturer(); + + switch (manufacturer) { + case 0: + case 48: + frm->ptr += HCI_EVENT_HDR_SIZE; + frm->len -= HCI_EVENT_HDR_SIZE; + ericsson_dump(level + 1, frm); + return; + case 10: frm->ptr += HCI_EVENT_HDR_SIZE; frm->len -= HCI_EVENT_HDR_SIZE; csr_dump(level + 1, frm); diff --git a/tools/parser/parser.h b/tools/parser/parser.h index efaadfa38..7363c2ae3 100644 --- a/tools/parser/parser.h +++ b/tools/parser/parser.h @@ -80,6 +80,7 @@ struct frame { #define FILT_OBEX 0x00010000 #define FILT_CAPI 0x00020000 #define FILT_PPP 0x00040000 +#define FILT_ERICSSON 0x10000000 #define FILT_CSR 0x1000000a #define FILT_DGA 0x1000000c @@ -233,6 +234,7 @@ void capi_dump(int level, struct frame *frm); void ppp_dump(int level, struct frame *frm); void arp_dump(int level, struct frame *frm); void ip_dump(int level, struct frame *frm); +void ericsson_dump(int level, struct frame *frm); void csr_dump(int level, struct frame *frm); void bpa_dump(int level, struct frame *frm); -- 2.47.3