aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcel Holtmann <marcel@holtmann.org>2004-03-03 02:03:49 +0000
committerMarcel Holtmann <marcel@holtmann.org>2004-03-03 02:03:49 +0000
commit1df6af51ff685f7cd1c6c5049e9ad4f1ece74a0d (patch)
treef95cbab4cc0512ea5b3edee28fa6669ac33163a2
parente918e1383e6e80ba4e4808404999521f984f0b5c (diff)
downloadhcidump-1df6af51ff685f7cd1c6c5049e9ad4f1ece74a0d.tar.gz
Update copyright information
-rw-r--r--AUTHORS2
-rw-r--r--COPYING90
-rw-r--r--Makefile.am3
-rw-r--r--README28
-rw-r--r--hcidump.h76
-rw-r--r--src/hcidump.c108
6 files changed, 161 insertions, 146 deletions
diff --git a/AUTHORS b/AUTHORS
index f965960..67d8147 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -1,6 +1,5 @@
Maxim Krasnyansky <maxk@qualcomm.com>
Original author.
- Primary maintainer.
Wayne Lee <waynelee@qualcomm.com>
RFCOMM parser.
@@ -12,6 +11,7 @@ Takashi Sasai <sasai@sm.sony.co.jp>
BNEP parser.
Marcel Holtmann <marcel@holtmann.org>
+ Primary maintainer.
CMTP parser.
HIDP parser.
CAPI parser.
diff --git a/COPYING b/COPYING
index 80560db..5b6e7c6 100644
--- a/COPYING
+++ b/COPYING
@@ -1,25 +1,3 @@
-
- HCIDump - HCI packet analyzer
- Copyright (C) 2000-2001 Maxim Krasnyansky <maxk@qualcomm.com>
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License version 2 as
- published by the Free Software Foundation;
-
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS.
- IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) AND AUTHOR(S) BE LIABLE FOR ANY CLAIM,
- OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER
- RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
- NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE
- USE OR PERFORMANCE OF THIS SOFTWARE.
-
- ALL LIABILITY, INCLUDING LIABILITY FOR INFRINGEMENT OF ANY PATENTS, COPYRIGHTS,
- TRADEMARKS OR OTHER RIGHTS, RELATING TO USE OF THIS SOFTWARE IS DISCLAIMED.
-
- -------------------------------------------------------------------------
-
GNU GENERAL PUBLIC LICENSE
Version 2, June 1991
@@ -77,7 +55,7 @@ patent must be licensed for everyone's free use or not licensed at all.
The precise terms and conditions for copying, distribution and
modification follow.
-
+
GNU GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
@@ -132,7 +110,7 @@ above, provided that you also meet all of these conditions:
License. (Exception: if the Program itself is interactive but
does not normally print such an announcement, your work based on
the Program is not required to print an announcement.)
-
+
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Program,
and can be reasonably considered independent and separate works in
@@ -190,7 +168,7 @@ access to copy from a designated place, then offering equivalent
access to copy the source code from the same place counts as
distribution of the source code, even though third parties are not
compelled to copy the source along with the object code.
-
+
4. You may not copy, modify, sublicense, or distribute the Program
except as expressly provided under this License. Any attempt
otherwise to copy, modify, sublicense or distribute the Program is
@@ -247,7 +225,7 @@ impose that choice.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
-
+
8. If the distribution and/or use of the Program is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Program under this License
@@ -300,3 +278,63 @@ PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES.
END OF TERMS AND CONDITIONS
+
+ How to Apply These Terms to Your New Programs
+
+ If you develop a new program, and you want it to be of the greatest
+possible use to the public, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these terms.
+
+ To do so, attach the following notices to the program. It is safest
+to attach them to the start of each source file to most effectively
+convey the exclusion of warranty; and each file should have at least
+the "copyright" line and a pointer to where the full notice is found.
+
+ <one line to give the program's name and a brief idea of what it does.>
+ Copyright (C) <year> <name of author>
+
+ 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+
+Also add information on how to contact you by electronic and paper mail.
+
+If the program is interactive, make it output a short notice like this
+when it starts in an interactive mode:
+
+ Gnomovision version 69, Copyright (C) year name of author
+ Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+ This is free software, and you are welcome to redistribute it
+ under certain conditions; type `show c' for details.
+
+The hypothetical commands `show w' and `show c' should show the appropriate
+parts of the General Public License. Of course, the commands you use may
+be called something other than `show w' and `show c'; they could even be
+mouse-clicks or menu items--whatever suits your program.
+
+You should also get your employer (if you work as a programmer) or your
+school, if any, to sign a "copyright disclaimer" for the program, if
+necessary. Here is a sample; alter the names:
+
+ Yoyodyne, Inc., hereby disclaims all copyright interest in the program
+ `Gnomovision' (which makes passes at compilers) written by James Hacker.
+
+ <signature of Ty Coon>, 1 April 1989
+ Ty Coon, President of Vice
+
+This General Public License does not permit incorporating your program into
+proprietary programs. If your program is a subroutine library, you may
+consider it more useful to permit linking proprietary applications with the
+library. If this is what you want to do, use the GNU Library General
+Public License instead of this License.
diff --git a/Makefile.am b/Makefile.am
index 165acf6..0b2b914 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -8,8 +8,7 @@ mandir = $(prefix)/share/man
sbin_PROGRAMS = hcidump
-hcidump_SOURCES = hcidump.c hcidump.h
-hcidump_LDADD = parser/libparser.a
+LDADD = parser/libparser.a
man_MANS = hcidump.8
diff --git a/README b/README
index 0b6c2b6..2ba7d96 100644
--- a/README
+++ b/README
@@ -1,27 +1,29 @@
-HCIDump - HCI packet analyzer
-Copyright (C) 2000-2001 Maxim Krasnyansky <maxk@qualcomm.com>
+Bluetooth packet analyzer - HCIdump
-1. Compilation and Installation.
+Copyright (C) 2000-2002 Maxim Krasnyansky <maxk@qualcomm.com>
+Copyright (C) 2003-2004 Marcel Holtmann <marcel@holtmann.org>
-In order to compile HCIDump you need following software packages:
- - Linux Bluetooth protocol stack (BlueZ)
- - GCC compiler
-To configure HCIDump run:
- ./configure
+1. Compilation and installation
+
+In order to compile HCIdump you need following software packages:
+ - Linux Bluetooth protocol stack (BlueZ)
+ - GCC compiler
+
+To configure HCIdump run:
+ ./configure
Configure automatically searches for all required components and packages.
To compile and install run:
- make install
+ make install
-2.0 Information
+
+2. Information
Mailing lists:
bluez-users@lists.sourceforge.net - BlueZ general questions and discussions
bluez-devel@lists.sourceforge.net - BlueZ development
For additional information about the project visit BlueZ web site:
- http://bluez.sf.net/hcidump
-
-Maxim Krasnyansky <maxk@qualcomm.com>
+ http://www.bluez.org
diff --git a/hcidump.h b/hcidump.h
deleted file mode 100644
index a45775f..0000000
--- a/hcidump.h
+++ /dev/null
@@ -1,76 +0,0 @@
-/*
- HCIDump - HCI packet analyzer
- Copyright (C) 2000-2001 Maxim Krasnyansky <maxk@qualcomm.com>
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License version 2 as
- published by the Free Software Foundation;
-
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS.
- IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) AND AUTHOR(S) BE LIABLE FOR ANY CLAIM,
- OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER
- RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
- NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE
- USE OR PERFORMANCE OF THIS SOFTWARE.
-
- ALL LIABILITY, INCLUDING LIABILITY FOR INFRINGEMENT OF ANY PATENTS, COPYRIGHTS,
- TRADEMARKS OR OTHER RIGHTS, RELATING TO USE OF THIS SOFTWARE IS DISCLAIMED.
-*/
-
-/*
- * $Id$
- */
-
-/* Modes */
-enum {
- PARSE,
- READ,
- WRITE
-};
-
-struct dump_hdr {
- uint16_t len;
- uint8_t in;
- uint8_t pad;
- uint32_t ts_sec;
- uint32_t ts_usec;
-} __attribute__ ((packed));
-#define DUMP_HDR_SIZE (sizeof(struct dump_hdr))
-
-#define SNAP_LEN HCI_MAX_FRAME_SIZE
-
-static inline int read_n(int fd, char *buf, int len)
-{
- register int t=0, w;
-
- while (len > 0) {
- if ((w = read(fd, buf, len)) < 0) {
- if( errno == EINTR || errno == EAGAIN )
- continue;
- return -1;
- }
- if (!w)
- return 0;
- len -= w; buf += w; t += w;
- }
- return t;
-}
-
-static inline int write_n(int fd, char *buf, int len)
-{
- register int t=0, w;
-
- while (len > 0) {
- if ((w = write(fd, buf, len)) < 0) {
- if( errno == EINTR || errno == EAGAIN )
- continue;
- return -1;
- }
- if (!w)
- return 0;
- len -= w; buf += w; t += w;
- }
- return t;
-}
diff --git a/src/hcidump.c b/src/hcidump.c
index 745cc3e..6586c24 100644
--- a/src/hcidump.c
+++ b/src/hcidump.c
@@ -1,54 +1,63 @@
-/*
- HCIDump - HCI packet analyzer
- Copyright (C) 2000-2001 Maxim Krasnyansky <maxk@qualcomm.com>
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License version 2 as
- published by the Free Software Foundation;
-
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS.
- IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) AND AUTHOR(S) BE LIABLE FOR ANY CLAIM,
- OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER
- RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
- NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE
- USE OR PERFORMANCE OF THIS SOFTWARE.
-
- ALL LIABILITY, INCLUDING LIABILITY FOR INFRINGEMENT OF ANY PATENTS, COPYRIGHTS,
- TRADEMARKS OR OTHER RIGHTS, RELATING TO USE OF THIS SOFTWARE IS DISCLAIMED.
-*/
-
/*
- * $Id$
+ *
+ * Bluetooth packet analyzer - HCIdump
+ *
+ * Copyright (C) 2000-2002 Maxim Krasnyansky <maxk@qualcomm.com>
+ * Copyright (C) 2003-2004 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ *
+ * $Id$
*/
#include <stdio.h>
+#include <errno.h>
+#include <fcntl.h>
#include <stdlib.h>
#include <unistd.h>
#include <termios.h>
-#include <fcntl.h>
-#include <errno.h>
#include <string.h>
-#include <pwd.h>
#include <getopt.h>
+#include <pwd.h>
#include <sys/types.h>
-#include <sys/ioctl.h>
#include <sys/socket.h>
+#include <sys/ioctl.h>
#include <sys/uio.h>
#include <sys/stat.h>
#include <netinet/in.h>
#include <bluetooth/bluetooth.h>
#include <bluetooth/hci.h>
-#include <bluetooth/l2cap.h>
#include <bluetooth/hci_lib.h>
-#include "hcidump.h"
#include "parser/parser.h"
#include "parser/sdp.h"
+
+#define SNAP_LEN HCI_MAX_FRAME_SIZE
+
+/* Modes */
+enum {
+ PARSE,
+ READ,
+ WRITE
+};
+
/* Default options */
static int device;
static int snap_len = SNAP_LEN;
@@ -58,6 +67,49 @@ static long flags;
static long filter;
static char *dump_file;
+struct dump_hdr {
+ uint16_t len;
+ uint8_t in;
+ uint8_t pad;
+ uint32_t ts_sec;
+ uint32_t ts_usec;
+} __attribute__ ((packed));
+#define DUMP_HDR_SIZE (sizeof(struct dump_hdr))
+
+static inline int read_n(int fd, char *buf, int len)
+{
+ register int t = 0, w;
+
+ while (len > 0) {
+ if ((w = read(fd, buf, len)) < 0) {
+ if( errno == EINTR || errno == EAGAIN )
+ continue;
+ return -1;
+ }
+ if (!w)
+ return 0;
+ len -= w; buf += w; t += w;
+ }
+ return t;
+}
+
+static inline int write_n(int fd, char *buf, int len)
+{
+ register int t = 0, w;
+
+ while (len > 0) {
+ if ((w = write(fd, buf, len)) < 0) {
+ if( errno == EINTR || errno == EAGAIN )
+ continue;
+ return -1;
+ }
+ if (!w)
+ return 0;
+ len -= w; buf += w; t += w;
+ }
+ return t;
+}
+
static void process_frames(int dev, int sock, int file)
{
struct cmsghdr *cmsg;