This is our old Q&A Site. Please post any new questions and answers at ask.wireshark.org.

I'm trying to print a specific data inside my Wireshark Custom Dissector to a file that I can upload to a different program. I tried opening and writing to a data using fopen and fprintf but Wireshark crashes when I upload my captured packet it crashes. Is there any way I can write a print-to-file function inside a custom dissector?

asked 06 Aug '15, 14:40

J1Ronnie's gravatar image

J1Ronnie
11226
accept rate: 0%


OS and Wireshark version?

There are platform independent file I/O routines in wsutil\file_util that might be handy.

Arguably though, writing to a file in a dissector is not a good idea, it will slow down dissection and live captures. Maybe it should be driven from a user generated action, e.g. a menu option.

permanent link

answered 07 Aug '15, 01:20

grahamb's gravatar image

grahamb ♦
19.8k330206
accept rate: 22%

Yes, look into using a tap for that.

(07 Aug '15, 05:31) Jaap ♦
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×91
×76
×16
×2
×2

question asked: 06 Aug '15, 14:40

question was seen: 1,266 times

last updated: 07 Aug '15, 05:31

p​o​w​e​r​e​d by O​S​Q​A