Diff between 80700291b6192ba035e5b8ac004d21a03e7c8136 and 8eb1ef58280f0a3fe50c366cdb3ad5c86f4dd905

Changed Files

File Additions Deletions Status
tools/hcidump.1 +7 -3 modified
tools/hcidump.c +8 -1 modified
tools/parser/parser.h +2 -0 modified
tools/parser/ppp.c +45 -0 added
tools/parser/rfcomm.c +8 -0 modified

Full Patch

diff --git a/tools/hcidump.1 b/tools/hcidump.1
index 17a9f14..3f8a01f 100644
--- a/tools/hcidump.1
+++ b/tools/hcidump.1
@@ -86,7 +86,10 @@ Sets the PSM value for the CAPI Message Transport Protocol.
 Sets the PSM value for the Hardcopy Control Channel.
 .TP
 .BR -O ", " "\-\^\-obex=" "<channel>"
-Sets the RFCOMM channel value for the Object Exchange protocol.
+Sets the RFCOMM channel value for the Object Exchange Protocol.
+.TP
+.BR -P ", " "\-\^\-ppp=" "<channel>"
+Sets the RFCOMM channel value for the Point-to-Point Protocol.
 .TP
 .BR -A ", " "\-\^\-audio=" "<file>"
 Extract SCO audio data.
@@ -115,9 +118,10 @@ is a space-separated list of packet categories: available categories are
 .IR hcrp ,
 .IR avdtp ,
 .IR avctp ,
-.IR obex
+.IR obex ,
+.IR capi
 and
-.IR capi .
+.IR ppp .
 If filters are used, only packets belonging to the specified categories are
 dumped. By default, all packets are dumped.
 .SH AUTHORS
diff --git a/tools/hcidump.c b/tools/hcidump.c
index 15e63b3..362e0e9 100644
--- a/tools/hcidump.c
+++ b/tools/hcidump.c
@@ -606,6 +606,7 @@ static struct {
 	{ "avctp",	FILT_AVCTP	},
 	{ "obex",	FILT_OBEX	},
 	{ "capi",	FILT_CAPI	},
+	{ "ppp",	FILT_PPP	},
 	{ "csr",	FILT_CSR	},
 	{ "dga",	FILT_DGA	},
 	{ 0 }
@@ -645,6 +646,7 @@ static void usage(void)
 	"  -C, --cmtp=psm             PSM for CMTP\n"
 	"  -H, --hcrp=psm             PSM for HCRP\n"
 	"  -O, --obex=channel         Channel for OBEX\n"
+	"  -P, --ppp=channel          Channel for PPP\n"
 	"  -A, --audio=file           Extract SCO audio data\n"
 	"  -B, --btsnoop              Use BTSnoop file format\n"
 	"  -V, --verbose              Verbose decoding\n"
@@ -671,6 +673,7 @@ static struct option main_options[] = {
 	{ "cmtp",		1, 0, 'C' },
 	{ "hcrp",		1, 0, 'H' },
 	{ "obex",		1, 0, 'O' },
+	{ "ppp",		1, 0, 'P' },
 	{ "audio",		1, 0, 'A' },
 	{ "btsnoop",		0, 0, 'B' },
 	{ "verbose",		0, 0, 'V' },
@@ -688,7 +691,7 @@ int main(int argc, char *argv[])
 
 	printf("HCI sniffer - Bluetooth packet analyzer ver %s\n", VERSION);
 
-	while ((opt=getopt_long(argc, argv, "i:l:p:m:w:r:s:n:taxXRC:H:O:A:BVYZh", main_options, NULL)) != -1) {
+	while ((opt=getopt_long(argc, argv, "i:l:p:m:w:r:s:n:taxXRC:H:O:P:A:BVYZh", main_options, NULL)) != -1) {
 		switch(opt) {
 		case 'i':
 			if (strcasecmp(optarg, "none") && strcasecmp(optarg, "system"))
@@ -777,6 +780,10 @@ int main(int argc, char *argv[])
 			set_proto(0, 0, atoi(optarg), SDP_UUID_OBEX);
 			break;
 
+		case 'P':
+			set_proto(0, 0, atoi(optarg), SDP_UUID_LAN_ACCESS_PPP);
+			break;
+
 		case 'A':
 			audio_file = strdup(optarg);
 			break;
diff --git a/tools/parser/parser.h b/tools/parser/parser.h
index 740acf3..264771c 100644
--- a/tools/parser/parser.h
+++ b/tools/parser/parser.h
@@ -78,6 +78,7 @@ struct frame {
 
 #define FILT_OBEX	0x00010000
 #define FILT_CAPI	0x00020000
+#define FILT_PPP	0x00040000
 #define FILT_CSR	0x1000000a
 #define FILT_DGA	0x1000000c
 
@@ -208,6 +209,7 @@ void avctp_dump(int level, struct frame *frm);
 
 void obex_dump(int level, struct frame *frm);
 void capi_dump(int level, struct frame *frm);
+void ppp_dump(int level, struct frame *frm);
 void csr_dump(int level, struct frame *frm);
 void bpa_dump(int level, struct frame *frm);
 
diff --git a/tools/parser/ppp.c b/tools/parser/ppp.c
new file mode 100644
index 0000000..f311ac1
--- /dev/null
+++ b/tools/parser/ppp.c
@@ -0,0 +1,45 @@
+/*
+ *
+ *  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 <unistd.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include <sys/types.h>
+#include <netinet/in.h>
+
+#include "parser.h"
+
+void ppp_dump(int level, struct frame *frm)
+{
+	p_indent(level, frm);
+	printf("PPP:\n");
+
+	raw_dump(level, frm);
+}
diff --git a/tools/parser/rfcomm.c b/tools/parser/rfcomm.c
index 5bb82aa..d576342 100644
--- a/tools/parser/rfcomm.c
+++ b/tools/parser/rfcomm.c
@@ -280,6 +280,14 @@ static inline void uih_frame(int level, struct frame *frm, long_frame_head *head
 					raw_dump(level, frm);
 				break;
 
+			case SDP_UUID_LAN_ACCESS_PPP:
+			case SDP_UUID_DIALUP_NETWORKING:
+				if (!p_filter(FILT_PPP))
+					ppp_dump(level + 1, frm);
+				else
+					raw_dump(level, frm);
+				break;
+
 			default:
 				if (p_filter(FILT_RFCOMM))
 					break;