Wireshark-dev: Re: [Wireshark-dev] Browse field in the preferences
From: Aurélien Decagny <funtim78@xxxxxxxxxxx>
Date: Tue, 11 Aug 2009 16:46:03 +0200
Thank you!

So finally I will begin with "just a string field" in the preferences.
The function to do that should be prefs_register_string_preference(), but I don't manage to make it work!
(And I have already use almost all the others prefs_register, so that's very strange.

Looking in some other dissectors using this function too, I made this:


At the beginning, I initialize my variable:

static const char *sle_nameFile = "SLE_packets_decoded.txt"; /* Name of the text file */

/*This thing seems me already a little bit strange, I would better have use something like:
* static char sle_nameFile[50] = "SLE_packets_decoded.txt";
* but it doesn't seem to work, and the other method is used in the other dissectors...
* if someone can explain to me why...*/


And then in proto_register_sle():

        /* Name of the file */
        prefs_register_string_preference(sle_module, "saveName_sle",
            "Enter the name of the text file (with the extension)",
            "Enter the name of the text file to save the data",
            &sle_nameFile);

The thing compile well, but when launching, I have the following problem:

Microsoft Visual C++ Runtime Library

Runtime Error!

Program : c:\wireshark\wireshark-gtk2\wireshark.exe

This application has requested the Runtime to terminate it in an unusual way.
Please contact the application's support team for more information

So, what did I do wrong ?


Regards / Mit freundlichen Grüßen / Cordialement,

Aurelien Decagny
____________________________________________________

Second year student in Supelec engineering school (Metz, France)
ESA/ESOC trainee, OPS-GSI section (Darmstadt, Germany)




> From: guy@xxxxxxxxxxxx
> Date: Wed, 5 Aug 2009 16:50:20 -0700
> To: wireshark-dev@xxxxxxxxxxxxx
> Subject: Re: [Wireshark-dev] Browse field in the preferences
>
>
> On Aug 5, 2009, at 3:30 PM, Aurélien Decagny wrote:
>
> > For the field part, you are right. But my question was more about
> > how to
> > make easily the browse button, so that the user don't need to write
> > all
> > the path for the data. And also how to get this path.
>
> Currently, there is no way to do that in Wireshark; you can create a
> string preference, but the user would have to type the path in.
>
> At some point, we should add a "path name" preference type, which
> would be like a string preference, except that it would have a browse
> button allowing the user to browse for a path name.
>
> > I also have another question, which has no link with the first one,
> > but
> > I won't create a new thread just for it: do you know how to get the
> > number of the No. column of Wireshark? (there should be a variable,
> > but
> > I can't find the name of this one...)
>
> In a dissector, pinfo->fd->num (where pinfo is the "packet_info *"
> second argument to the dissector) will give you the frame number of
> the frame currently being dissected.
> ___________________________________________________________________________
> Sent via: Wireshark-dev mailing list <wireshark-dev@xxxxxxxxxxxxx>
> Archives: http://www.wireshark.org/lists/wireshark-dev
> Unsubscribe: https://wireshark.org/mailman/options/wireshark-dev
> mailto:wireshark-dev-request@xxxxxxxxxxxxx?subject=unsubscribe


Votre correspondant a choisi Hotmail et profite d'un stockage quasiment illimité. Créez un compte Hotmail gratuitement !