From f8444cbe7a97eb96930e66f22c602dbce6b03fdf Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Tue, 20 Aug 2013 19:56:21 -0700 Subject: [PATCH] monitor: Add stub for link layer decoding --- Makefile.tools | 3 ++- monitor/ll.c | 35 +++++++++++++++++++++++++++++++++++ monitor/ll.h | 27 +++++++++++++++++++++++++++ monitor/packet.c | 3 ++- 4 files changed, 66 insertions(+), 2 deletions(-) create mode 100644 monitor/ll.c create mode 100644 monitor/ll.h diff --git a/Makefile.tools b/Makefile.tools index f7fbc4030..0509e688f 100644 --- a/Makefile.tools +++ b/Makefile.tools @@ -23,7 +23,8 @@ monitor_btmon_SOURCES = monitor/main.c monitor/bt.h \ monitor/vendor.h monitor/vendor.c \ monitor/l2cap.h monitor/l2cap.c \ monitor/uuid.h monitor/uuid.c \ - monitor/sdp.h monitor/sdp.c + monitor/sdp.h monitor/sdp.c \ + monitor/ll.h monitor/ll.c monitor_btmon_LDADD = lib/libbluetooth-internal.la endif diff --git a/monitor/ll.c b/monitor/ll.c new file mode 100644 index 000000000..95fed726c --- /dev/null +++ b/monitor/ll.c @@ -0,0 +1,35 @@ +/* + * + * BlueZ - Bluetooth protocol stack for Linux + * + * Copyright (C) 2011-2012 Intel Corporation + * Copyright (C) 2004-2010 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 "packet.h" +#include "ll.h" + +void ll_packet(uint16_t frequency, const void *data, uint8_t size) +{ + packet_hexdump(data, size); +} diff --git a/monitor/ll.h b/monitor/ll.h new file mode 100644 index 000000000..496bc22f6 --- /dev/null +++ b/monitor/ll.h @@ -0,0 +1,27 @@ +/* + * + * BlueZ - Bluetooth protocol stack for Linux + * + * Copyright (C) 2011-2012 Intel Corporation + * Copyright (C) 2004-2010 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 + * + */ + +#include + +void ll_packet(uint16_t frequency, const void *data, uint8_t size); diff --git a/monitor/packet.c b/monitor/packet.c index 1d69c17f9..4070e60f1 100644 --- a/monitor/packet.c +++ b/monitor/packet.c @@ -43,6 +43,7 @@ #include "display.h" #include "bt.h" +#include "ll.h" #include "uuid.h" #include "l2cap.h" #include "control.h" @@ -2293,7 +2294,7 @@ void packet_simulator(struct timeval *tv, uint16_t frequency, print_packet(tv, 0, '*', COLOR_PHY_PACKET, label, NULL, extra); - packet_hexdump(data, size); + ll_packet(frequency, data, size); } static void null_cmd(const void *data, uint8_t size) -- 2.47.3