Re: some question about mon binary

2013-11-25 Thread vichy
hi alan

2013/11/15 Alan Stern st...@rowland.harvard.edu:
 On Fri, 15 Nov 2013, vichy wrote:

 hi Alan

 2013/11/14 Alan Stern st...@rowland.harvard.edu:
  On Thu, 14 Nov 2013, vichy wrote:
 
  hi all:
  I have some questions:
  1. if I need to capture all the data host capture from bus, usb mon
  binary can reach this goal?
 
  Yes.
 
  2. if #1 is Yes. from usb mon text I need
   a. compile kernel with usbmon support
   b. access /dev/usbmonx
   c. feed the binary file to wireshark.
  in b), shall we write a user mode program?
 
  No, just use the usbmon program.  However, it creates a text file, not
  a binary file.  You can't feed the output to wireshark.
  If you want binary output that wireshark can use, you have to run a
  different program like tcpdump or dumpcap.

 Read the four lines above...

I can use wireshark to pasring the binary get from tcpdump.
I apoligize for misunderstanding your explaination. :)


BTW, is it possible to filter out bulk, interrupt or isochronous data
that echi driver pass to urb?
I am writing user mode usb driver with libusb and want to check the
data correctness by comparing
1. the data return from urb-complete
2. data ehci get from device and pass to urb

Appreciate your help,
--
To unsubscribe from this list: send the line unsubscribe linux-usb in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: some question about mon binary

2013-11-25 Thread Alan Stern
On Tue, 26 Nov 2013, vichy wrote:

 BTW, is it possible to filter out bulk, interrupt or isochronous data
 that echi driver pass to urb?

If you use usbmon, you can filter the text output file very easily.

I don't know of any way to filter a binary output file from tcpdump.

 I am writing user mode usb driver with libusb and want to check the
 data correctness by comparing
 1. the data return from urb-complete
 2. data ehci get from device and pass to urb
 
 Appreciate your help,

Alan Stern

--
To unsubscribe from this list: send the line unsubscribe linux-usb in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


some question about mon binary

2013-11-14 Thread vichy
hi all:
I have some questions:
1. if I need to capture all the data host capture from bus, usb mon
binary can reach this goal?
2. if #1 is Yes. from usb mon text I need
 a. compile kernel with usbmon support
 b. access /dev/usbmonx
 c. feed the binary file to wireshark.
in b), shall we write a user mode program?
if so, is there any sample flow I can reference?
3. if #1 is No, is there any default kernel config can do that?
or I should write memcpy by hand in urb_complete?

Thanks for your help
--
To unsubscribe from this list: send the line unsubscribe linux-usb in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: some question about mon binary

2013-11-14 Thread Alan Ott

On 11/14/2013 09:33 AM, vichy wrote:

1. if I need to capture all the data host capture from bus, usb mon
binary can reach this goal?
2. if #1 is Yes. from usb mon text I need
  a. compile kernel with usbmon support
  b. access /dev/usbmonx
  c. feed the binary file to wireshark.


With usbmon loaded, wireshark can capture from usbmon directly. 
Depending on your distro, you may need to load usbmon manually:

modprobe usbmon

Alan.
--
To unsubscribe from this list: send the line unsubscribe linux-usb in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: some question about mon binary

2013-11-14 Thread vichy
hi alan:

2013/11/14 Alan Ott a...@signal11.us:
 On 11/14/2013 09:33 AM, vichy wrote:

 1. if I need to capture all the data host capture from bus, usb mon
 binary can reach this goal?
 2. if #1 is Yes. from usb mon text I need
   a. compile kernel with usbmon support
   b. access /dev/usbmonx
   c. feed the binary file to wireshark.


 With usbmon loaded, wireshark can capture from usbmon directly. Depending on
 your distro, you may need to load usbmon manually:
 modprobe usbmon

forget to mentioned, my platform is arm embedded system.
And it seems I have to get binary from my target board then feed it to
wireshark on my pc, right?
if so, how could I dump the binary from embedded target board?

Appreciate your help,
--
To unsubscribe from this list: send the line unsubscribe linux-usb in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: some question about mon binary

2013-11-14 Thread Alan Ott

On 11/14/2013 09:52 AM, vichy wrote:

hi alan:

2013/11/14 Alan Ott a...@signal11.us:

On 11/14/2013 09:33 AM, vichy wrote:

1. if I need to capture all the data host capture from bus, usb mon
binary can reach this goal?
2. if #1 is Yes. from usb mon text I need
   a. compile kernel with usbmon support
   b. access /dev/usbmonx
   c. feed the binary file to wireshark.


With usbmon loaded, wireshark can capture from usbmon directly. Depending on
your distro, you may need to load usbmon manually:
 modprobe usbmon

forget to mentioned, my platform is arm embedded system.
And it seems I have to get binary from my target board then feed it to
wireshark on my pc, right?
if so, how could I dump the binary from embedded target board?


Use tcpdump:
tcpdump -i usbmon1 -w out.dump

--
To unsubscribe from this list: send the line unsubscribe linux-usb in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: some question about mon binary

2013-11-14 Thread vichy
hi alan ott:
2013/11/14 Alan Ott a...@signal11.us:
 On 11/14/2013 09:52 AM, vichy wrote:

 hi alan:

 2013/11/14 Alan Ott a...@signal11.us:

 On 11/14/2013 09:33 AM, vichy wrote:

 1. if I need to capture all the data host capture from bus, usb mon
 binary can reach this goal?
 2. if #1 is Yes. from usb mon text I need
a. compile kernel with usbmon support
b. access /dev/usbmonx
c. feed the binary file to wireshark.


 With usbmon loaded, wireshark can capture from usbmon directly. Depending
 on
 your distro, you may need to load usbmon manually:
  modprobe usbmon

 forget to mentioned, my platform is arm embedded system.
 And it seems I have to get binary from my target board then feed it to
 wireshark on my pc, right?
 if so, how could I dump the binary from embedded target board?


 Use tcpdump:
 tcpdump -i usbmon1 -w out.dump
It is embarrassing that busybox on the target don't have tcpdump :-)
Is there any other way to reach the same goal?

appreciate your kind help,
--
To unsubscribe from this list: send the line unsubscribe linux-usb in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: some question about mon binary

2013-11-14 Thread Alan Ott

On 11/14/2013 10:04 AM, vichy wrote:

hi alan ott:
2013/11/14 Alan Ott a...@signal11.us:

On 11/14/2013 09:52 AM, vichy wrote:

hi alan:

2013/11/14 Alan Ott a...@signal11.us:

On 11/14/2013 09:33 AM, vichy wrote:

1. if I need to capture all the data host capture from bus, usb mon
binary can reach this goal?
2. if #1 is Yes. from usb mon text I need
a. compile kernel with usbmon support
b. access /dev/usbmonx
c. feed the binary file to wireshark.


With usbmon loaded, wireshark can capture from usbmon directly. Depending
on
your distro, you may need to load usbmon manually:
  modprobe usbmon

forget to mentioned, my platform is arm embedded system.
And it seems I have to get binary from my target board then feed it to
wireshark on my pc, right?
if so, how could I dump the binary from embedded target board?


Use tcpdump:
 tcpdump -i usbmon1 -w out.dump

It is embarrassing that busybox on the target don't have tcpdump :-)
Is there any other way to reach the same goal?


If it were me, I'd compile tcpdump and libpcap for your target, or find 
a userspace that has them pre-built, like Angstrom or buildroot.


Alan.

--
To unsubscribe from this list: send the line unsubscribe linux-usb in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: some question about mon binary

2013-11-14 Thread Alan Stern
On Thu, 14 Nov 2013, vichy wrote:

 hi all:
 I have some questions:
 1. if I need to capture all the data host capture from bus, usb mon
 binary can reach this goal?

Yes.

 2. if #1 is Yes. from usb mon text I need
  a. compile kernel with usbmon support
  b. access /dev/usbmonx
  c. feed the binary file to wireshark.
 in b), shall we write a user mode program?

No, just use the usbmon program.  However, it creates a text file, not 
a binary file.  You can't feed the output to wireshark.

If you want binary output that wireshark can use, you have to run a 
different program like tcpdump or dumpcap.

 if so, is there any sample flow I can reference?

See the README file and the man page that are part of the usbmon 
package:

http://people.redhat.com/zaitcev/linux/usbmon-6.tar.gz

 3. if #1 is No, is there any default kernel config can do that?
 or I should write memcpy by hand in urb_complete?
 
 Thanks for your help

Alan Stern

--
To unsubscribe from this list: send the line unsubscribe linux-usb in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: some question about mon binary

2013-11-14 Thread vichy
hi Alan

2013/11/14 Alan Stern st...@rowland.harvard.edu:
 On Thu, 14 Nov 2013, vichy wrote:

 hi all:
 I have some questions:
 1. if I need to capture all the data host capture from bus, usb mon
 binary can reach this goal?

 Yes.

 2. if #1 is Yes. from usb mon text I need
  a. compile kernel with usbmon support
  b. access /dev/usbmonx
  c. feed the binary file to wireshark.
 in b), shall we write a user mode program?

 No, just use the usbmon program.  However, it creates a text file, not
 a binary file.  You can't feed the output to wireshark.

 If you want binary output that wireshark can use, you have to run a
 different program like tcpdump or dumpcap.

 if so, is there any sample flow I can reference?

 See the README file and the man page that are part of the usbmon
 package:

 http://people.redhat.com/zaitcev/linux/usbmon-6.tar.gz

I download and compile the file you mention.
when I run the binary as below with option  -a1, I still cannot see binary file.


# ./usbmon -i usb1 -a1
f2acb600 0.568167 S Ci:1:001:0 s a3 00  0001 0004 4 
f2acb600 0.568181 C Ci:1:001:0 0 4 =
0001
f2acb600 0.568186 S Ci:1:001:0 s a3 00  0002 0004 4 
f2acb600 0.568193 C Ci:1:001:0 0 4 =
01050100
f2acb600 0.568199 S Co:1:001:0 s 23 01 0010 0002  0
f2acb600 0.568205 C Co:1:001:0 0 0
f2acb600 0.568209 S Ci:1:001:0 s a3 00  0003 0004 4 
f2acb600 0.568213 C Ci:1:001:0 0 4 =
#
# ls
# ls
COPYING  Makefile  README  usbmon  usbmon.8  usbmon.c  usbmon.o
#


Did I use the wrong option or the only way to get binary is using tcpdump?

Appreciate all your kind help :-)
--
To unsubscribe from this list: send the line unsubscribe linux-usb in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html