hcidump: Add Ericsson specific parser

This commit is contained in:
Marcel Holtmann 2006-04-16 23:22:36 +00:00
parent 4665be2e3f
commit 37fe15255a
3 changed files with 50 additions and 1 deletions

36
tools/parser/ericsson.c Normal file
View File

@ -0,0 +1,36 @@
/*
*
* BlueZ - Bluetooth protocol stack for Linux
*
* Copyright (C) 2004-2006 Marcel Holtmann <marcel@holtmann.org>
*
*
* 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 "parser.h"
void ericsson_dump(int level, struct frame *frm)
{
raw_dump(level, frm);
}

View File

@ -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);

View File

@ -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);